@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.
Files changed (127) hide show
  1. package/README.md +94 -47
  2. package/dist/duckdb-browser-blocking.cjs +25 -0
  3. package/dist/duckdb-browser-blocking.cjs.map +7 -0
  4. package/dist/duckdb-browser-blocking.d.ts +1 -0
  5. package/dist/duckdb-browser-blocking.mjs +25 -0
  6. package/dist/duckdb-browser-blocking.mjs.map +7 -0
  7. package/dist/duckdb-browser-coi.pthread.worker.js +27 -0
  8. package/dist/duckdb-browser-coi.pthread.worker.js.map +7 -0
  9. package/dist/duckdb-browser-coi.worker.js +35 -0
  10. package/dist/duckdb-browser-coi.worker.js.map +7 -0
  11. package/dist/duckdb-browser-eh.worker.js +33 -0
  12. package/dist/duckdb-browser-eh.worker.js.map +7 -0
  13. package/dist/duckdb-browser-mvp.worker.js +33 -0
  14. package/dist/duckdb-browser-mvp.worker.js.map +7 -0
  15. package/dist/duckdb-browser.cjs +2 -0
  16. package/dist/duckdb-browser.cjs.map +7 -0
  17. package/dist/duckdb-browser.d.ts +1 -0
  18. package/dist/duckdb-browser.mjs +2 -0
  19. package/dist/duckdb-browser.mjs.map +7 -0
  20. package/dist/{duckdb-next-coi.wasm → duckdb-coi.wasm} +0 -0
  21. package/dist/{duckdb.wasm → duckdb-eh.wasm} +0 -0
  22. package/dist/duckdb-mvp.wasm +0 -0
  23. package/dist/duckdb-node-blocking.cjs +37 -0
  24. package/dist/duckdb-node-blocking.cjs.map +7 -0
  25. package/dist/duckdb-node-blocking.d.ts +1 -0
  26. package/dist/duckdb-node-eh.worker.cjs +37 -0
  27. package/dist/duckdb-node-eh.worker.cjs.map +7 -0
  28. package/dist/duckdb-node-mvp.worker.cjs +36 -0
  29. package/dist/duckdb-node-mvp.worker.cjs.map +7 -0
  30. package/dist/duckdb-node.cjs +2 -0
  31. package/dist/duckdb-node.cjs.map +7 -0
  32. package/dist/duckdb-node.d.ts +1 -0
  33. package/dist/img/duckdb.svg +6 -0
  34. package/dist/img/duckdb_version_badge.svg +1 -0
  35. package/dist/img/duckdb_wasm.svg +14 -0
  36. package/dist/tests-browser.js +20661 -19449
  37. package/dist/tests-browser.js.map +4 -4
  38. package/dist/tests-node.cjs +17258 -0
  39. package/dist/tests-node.cjs.map +7 -0
  40. package/dist/types/src/bindings/bindings_base.d.ts +30 -8
  41. package/dist/types/src/bindings/{bindings_browser_next.d.ts → bindings_browser_coi.d.ts} +0 -0
  42. package/dist/types/src/bindings/{bindings_browser_next_coi.d.ts → bindings_browser_eh.d.ts} +0 -0
  43. package/dist/types/src/bindings/{bindings_browser.d.ts → bindings_browser_mvp.d.ts} +0 -0
  44. package/dist/types/src/bindings/bindings_interface.d.ts +13 -5
  45. package/dist/types/src/bindings/{bindings_node_next.d.ts → bindings_node_eh.d.ts} +0 -0
  46. package/dist/types/src/bindings/{bindings_node.d.ts → bindings_node_mvp.d.ts} +0 -0
  47. package/dist/types/src/bindings/config.d.ts +43 -2
  48. package/dist/types/src/bindings/connection.d.ts +7 -7
  49. package/dist/types/src/bindings/index.d.ts +1 -1
  50. package/dist/types/src/bindings/insert_options.d.ts +3 -3
  51. package/dist/types/src/bindings/progress.d.ts +9 -0
  52. package/dist/types/src/bindings/runtime.d.ts +41 -10
  53. package/dist/types/src/bindings/runtime_browser.d.ts +5 -3
  54. package/dist/types/src/bindings/runtime_node.d.ts +2 -1
  55. package/dist/types/src/bindings/udf_function.d.ts +14 -0
  56. package/dist/types/src/bindings/udf_runtime.d.ts +3 -0
  57. package/dist/types/src/bindings/web_file.d.ts +11 -0
  58. package/dist/types/src/index.d.ts +1 -0
  59. package/dist/types/src/json_typedef.d.ts +17 -0
  60. package/dist/types/src/log.d.ts +5 -2
  61. package/dist/types/src/parallel/async_bindings.d.ts +19 -6
  62. package/dist/types/src/parallel/async_bindings_interface.d.ts +6 -3
  63. package/dist/types/src/parallel/async_connection.d.ts +4 -6
  64. package/dist/types/src/parallel/worker_dispatcher.d.ts +2 -1
  65. package/dist/types/src/parallel/worker_request.d.ts +18 -7
  66. package/dist/types/src/platform.d.ts +6 -3
  67. package/dist/types/src/targets/duckdb-browser-blocking.d.ts +12 -0
  68. package/dist/types/src/targets/{duckdb-browser-async-next-coi.pthread.worker.d.ts → duckdb-browser-coi.pthread.worker.d.ts} +0 -0
  69. package/dist/types/src/targets/{duckdb-browser-async-next-coi.worker.d.ts → duckdb-browser-coi.worker.d.ts} +0 -0
  70. package/dist/types/src/targets/{duckdb-browser-async-next.worker.d.ts → duckdb-browser-eh.worker.d.ts} +0 -0
  71. package/dist/types/src/targets/{duckdb-browser-async.worker.d.ts → duckdb-browser-mvp.worker.d.ts} +0 -0
  72. package/dist/types/src/targets/duckdb-node-blocking.d.ts +13 -0
  73. package/dist/types/src/targets/{duckdb-node-async-next.worker.d.ts → duckdb-node-eh.worker.d.ts} +0 -0
  74. package/dist/types/src/targets/{duckdb-node-async.worker.d.ts → duckdb-node-mvp.worker.d.ts} +0 -0
  75. package/dist/types/src/targets/duckdb.d.ts +8 -0
  76. package/dist/types/src/utils/index.d.ts +1 -1
  77. package/dist/types/src/utils/s3_helper.d.ts +27 -0
  78. package/dist/types/src/worker.d.ts +1 -0
  79. package/package.json +108 -44
  80. package/dist/duckdb-browser-async-next-coi.d.ts +0 -1
  81. package/dist/duckdb-browser-async-next-coi.pthread.worker.js +0 -4
  82. package/dist/duckdb-browser-async-next-coi.pthread.worker.js.map +0 -7
  83. package/dist/duckdb-browser-async-next-coi.worker.js +0 -19
  84. package/dist/duckdb-browser-async-next-coi.worker.js.map +0 -7
  85. package/dist/duckdb-browser-async-next.d.ts +0 -1
  86. package/dist/duckdb-browser-async-next.worker.js +0 -19
  87. package/dist/duckdb-browser-async-next.worker.js.map +0 -7
  88. package/dist/duckdb-browser-async.d.ts +0 -1
  89. package/dist/duckdb-browser-async.js +0 -18
  90. package/dist/duckdb-browser-async.js.map +0 -7
  91. package/dist/duckdb-browser-async.worker.js +0 -19
  92. package/dist/duckdb-browser-async.worker.js.map +0 -7
  93. package/dist/duckdb-browser-sync-next.d.ts +0 -1
  94. package/dist/duckdb-browser-sync-next.js +0 -19
  95. package/dist/duckdb-browser-sync-next.js.map +0 -7
  96. package/dist/duckdb-browser-sync.d.ts +0 -1
  97. package/dist/duckdb-browser-sync.js +0 -19
  98. package/dist/duckdb-browser-sync.js.map +0 -7
  99. package/dist/duckdb-esm.d.ts +0 -1
  100. package/dist/duckdb-esm.js +0 -2
  101. package/dist/duckdb-esm.js.map +0 -7
  102. package/dist/duckdb-next.wasm +0 -0
  103. package/dist/duckdb-node-async-next.worker.js +0 -4
  104. package/dist/duckdb-node-async-next.worker.js.map +0 -7
  105. package/dist/duckdb-node-async.d.ts +0 -1
  106. package/dist/duckdb-node-async.js +0 -2
  107. package/dist/duckdb-node-async.js.map +0 -7
  108. package/dist/duckdb-node-async.worker.js +0 -3
  109. package/dist/duckdb-node-async.worker.js.map +0 -7
  110. package/dist/duckdb-node-sync-next.d.ts +0 -1
  111. package/dist/duckdb-node-sync-next.js +0 -4
  112. package/dist/duckdb-node-sync-next.js.map +0 -7
  113. package/dist/duckdb-node-sync.d.ts +0 -1
  114. package/dist/duckdb-node-sync.js +0 -3
  115. package/dist/duckdb-node-sync.js.map +0 -7
  116. package/dist/tests-node.js +0 -152
  117. package/dist/tests-node.js.map +0 -7
  118. package/dist/types/src/bindings/insert.d.ts +0 -7
  119. package/dist/types/src/flat_arrow.d.ts +0 -14
  120. package/dist/types/src/targets/duckdb-browser-async.d.ts +0 -4
  121. package/dist/types/src/targets/duckdb-browser-sync-next.d.ts +0 -6
  122. package/dist/types/src/targets/duckdb-browser-sync.d.ts +0 -6
  123. package/dist/types/src/targets/duckdb-esm.d.ts +0 -1
  124. package/dist/types/src/targets/duckdb-node-async.d.ts +0 -4
  125. package/dist/types/src/targets/duckdb-node-sync-next.d.ts +0 -6
  126. package/dist/types/src/targets/duckdb-node-sync.d.ts +0 -6
  127. package/dist/types/src/utils/ipc_buffer.d.ts +0 -4
@@ -1,19 +0,0 @@
1
- var duckdb=(()=>{var Z_=Object.create;var Ss=Object.defineProperty;var eg=Object.getOwnPropertyDescriptor;var tg=Object.getOwnPropertyNames;var rg=Object.getPrototypeOf,ng=Object.prototype.hasOwnProperty;var Od=r=>Ss(r,"__esModule",{value:!0});var w=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ig=(r,e)=>{Od(r);for(var t in e)Ss(r,t,{get:e[t],enumerable:!0})},sg=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of tg(e))!ng.call(r,n)&&n!=="default"&&Ss(r,n,{get:()=>e[n],enumerable:!(t=eg(e,n))||t.enumerable});return r},Os=r=>sg(Od(Ss(r!=null?Z_(rg(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var gn=w(Ad=>{var b={};b.Offset;b.Table;b.SIZEOF_SHORT=2;b.SIZEOF_INT=4;b.FILE_IDENTIFIER_LENGTH=4;b.Encoding={UTF8_BYTES:1,UTF16_STRING:2};b.int32=new Int32Array(2);b.float32=new Float32Array(b.int32.buffer);b.float64=new Float64Array(b.int32.buffer);b.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;b.Long=function(r,e){this.low=r|0,this.high=e|0};b.Long.create=function(r,e){return r==0&&e==0?b.Long.ZERO:new b.Long(r,e)};b.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};b.Long.prototype.equals=function(r){return this.low==r.low&&this.high==r.high};b.Long.ZERO=new b.Long(0,0);b.Builder=function(r){if(r)var e=r;else var e=1024;this.bb=b.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};b.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};b.Builder.prototype.forceDefaults=function(r){this.force_defaults=r};b.Builder.prototype.dataBuffer=function(){return this.bb};b.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};b.Builder.prototype.prep=function(r,e){r>this.minalign&&(this.minalign=r);for(var t=~(this.bb.capacity()-this.space+e)+1&r-1;this.space<t+r+e;){var n=this.bb.capacity();this.bb=b.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(t)};b.Builder.prototype.pad=function(r){for(var e=0;e<r;e++)this.bb.writeInt8(--this.space,0)};b.Builder.prototype.writeInt8=function(r){this.bb.writeInt8(this.space-=1,r)};b.Builder.prototype.writeInt16=function(r){this.bb.writeInt16(this.space-=2,r)};b.Builder.prototype.writeInt32=function(r){this.bb.writeInt32(this.space-=4,r)};b.Builder.prototype.writeInt64=function(r){this.bb.writeInt64(this.space-=8,r)};b.Builder.prototype.writeFloat32=function(r){this.bb.writeFloat32(this.space-=4,r)};b.Builder.prototype.writeFloat64=function(r){this.bb.writeFloat64(this.space-=8,r)};b.Builder.prototype.addInt8=function(r){this.prep(1,0),this.writeInt8(r)};b.Builder.prototype.addInt16=function(r){this.prep(2,0),this.writeInt16(r)};b.Builder.prototype.addInt32=function(r){this.prep(4,0),this.writeInt32(r)};b.Builder.prototype.addInt64=function(r){this.prep(8,0),this.writeInt64(r)};b.Builder.prototype.addFloat32=function(r){this.prep(4,0),this.writeFloat32(r)};b.Builder.prototype.addFloat64=function(r){this.prep(8,0),this.writeFloat64(r)};b.Builder.prototype.addFieldInt8=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt8(e),this.slot(r))};b.Builder.prototype.addFieldInt16=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt16(e),this.slot(r))};b.Builder.prototype.addFieldInt32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt32(e),this.slot(r))};b.Builder.prototype.addFieldInt64=function(r,e,t){(this.force_defaults||!e.equals(t))&&(this.addInt64(e),this.slot(r))};b.Builder.prototype.addFieldFloat32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat32(e),this.slot(r))};b.Builder.prototype.addFieldFloat64=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat64(e),this.slot(r))};b.Builder.prototype.addFieldOffset=function(r,e,t){(this.force_defaults||e!=t)&&(this.addOffset(e),this.slot(r))};b.Builder.prototype.addFieldStruct=function(r,e,t){e!=t&&(this.nested(e),this.slot(r))};b.Builder.prototype.nested=function(r){if(r!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};b.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};b.Builder.prototype.slot=function(r){this.vtable[r]=this.offset()};b.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};b.Builder.growByteBuffer=function(r){var e=r.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var t=e<<1,n=b.ByteBuffer.allocate(t);return n.setPosition(t-e),n.bytes().set(r.bytes(),t-e),n};b.Builder.prototype.addOffset=function(r){this.prep(b.SIZEOF_INT,0),this.writeInt32(this.offset()-r+b.SIZEOF_INT)};b.Builder.prototype.startObject=function(r){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=r;for(var e=0;e<r;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()};b.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var r=this.offset(),e=this.vtable_in_use-1;e>=0&&this.vtable[e]==0;e--);for(var t=e+1;e>=0;e--)this.addInt16(this.vtable[e]!=0?r-this.vtable[e]:0);var n=2;this.addInt16(r-this.object_start);var i=(t+n)*b.SIZEOF_SHORT;this.addInt16(i);var o=0,a=this.space;e:for(e=0;e<this.vtables.length;e++){var u=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(u)){for(var f=b.SIZEOF_SHORT;f<i;f+=b.SIZEOF_SHORT)if(this.bb.readInt16(a+f)!=this.bb.readInt16(u+f))continue e;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-r,this.bb.writeInt32(this.space,o-r)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-r,this.offset()-r)),this.isNested=!1,r};b.Builder.prototype.finish=function(r,e){if(e){var t=e;if(this.prep(this.minalign,b.SIZEOF_INT+b.FILE_IDENTIFIER_LENGTH),t.length!=b.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+b.FILE_IDENTIFIER_LENGTH);for(var n=b.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(t.charCodeAt(n))}this.prep(this.minalign,b.SIZEOF_INT),this.addOffset(r),this.bb.setPosition(this.space)};b.Builder.prototype.requiredField=function(r,e){var t=this.bb.capacity()-r,n=t-this.bb.readInt32(t),i=this.bb.readInt16(n+e)!=0;if(!i)throw new Error("FlatBuffers: field "+e+" must be set")};b.Builder.prototype.startVector=function(r,e,t){this.notNested(),this.vector_num_elems=e,this.prep(b.SIZEOF_INT,r*e),this.prep(t,r*e)};b.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};b.Builder.prototype.createString=function(r){if(r instanceof Uint8Array)var e=r;else for(var e=[],t=0;t<r.length;){var n,i=r.charCodeAt(t++);if(i<55296||i>=56320)n=i;else{var o=r.charCodeAt(t++);n=(i<<10)+o+(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 t=0,a=this.space,u=this.bb.bytes();t<e.length;t++)u[a++]=e[t];return this.endVector()};b.Builder.prototype.createLong=function(r,e){return b.Long.create(r,e)};b.ByteBuffer=function(r){this.bytes_=r,this.position_=0};b.ByteBuffer.allocate=function(r){return new b.ByteBuffer(new Uint8Array(r))};b.ByteBuffer.prototype.clear=function(){this.position_=0};b.ByteBuffer.prototype.bytes=function(){return this.bytes_};b.ByteBuffer.prototype.position=function(){return this.position_};b.ByteBuffer.prototype.setPosition=function(r){this.position_=r};b.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};b.ByteBuffer.prototype.readInt8=function(r){return this.readUint8(r)<<24>>24};b.ByteBuffer.prototype.readUint8=function(r){return this.bytes_[r]};b.ByteBuffer.prototype.readInt16=function(r){return this.readUint16(r)<<16>>16};b.ByteBuffer.prototype.readUint16=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8};b.ByteBuffer.prototype.readInt32=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8|this.bytes_[r+2]<<16|this.bytes_[r+3]<<24};b.ByteBuffer.prototype.readUint32=function(r){return this.readInt32(r)>>>0};b.ByteBuffer.prototype.readInt64=function(r){return new b.Long(this.readInt32(r),this.readInt32(r+4))};b.ByteBuffer.prototype.readUint64=function(r){return new b.Long(this.readUint32(r),this.readUint32(r+4))};b.ByteBuffer.prototype.readFloat32=function(r){return b.int32[0]=this.readInt32(r),b.float32[0]};b.ByteBuffer.prototype.readFloat64=function(r){return b.int32[b.isLittleEndian?0:1]=this.readInt32(r),b.int32[b.isLittleEndian?1:0]=this.readInt32(r+4),b.float64[0]};b.ByteBuffer.prototype.writeInt8=function(r,e){this.bytes_[r]=e};b.ByteBuffer.prototype.writeUint8=function(r,e){this.bytes_[r]=e};b.ByteBuffer.prototype.writeInt16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};b.ByteBuffer.prototype.writeUint16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};b.ByteBuffer.prototype.writeInt32=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8,this.bytes_[r+2]=e>>16,this.bytes_[r+3]=e>>24};b.ByteBuffer.prototype.writeUint32=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8,this.bytes_[r+2]=e>>16,this.bytes_[r+3]=e>>24};b.ByteBuffer.prototype.writeInt64=function(r,e){this.writeInt32(r,e.low),this.writeInt32(r+4,e.high)};b.ByteBuffer.prototype.writeUint64=function(r,e){this.writeUint32(r,e.low),this.writeUint32(r+4,e.high)};b.ByteBuffer.prototype.writeFloat32=function(r,e){b.float32[0]=e,this.writeInt32(r,b.int32[0])};b.ByteBuffer.prototype.writeFloat64=function(r,e){b.float64[0]=e,this.writeInt32(r,b.int32[b.isLittleEndian?0:1]),this.writeInt32(r+4,b.int32[b.isLittleEndian?1:0])};b.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+b.SIZEOF_INT+b.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var r="",e=0;e<b.FILE_IDENTIFIER_LENGTH;e++)r+=String.fromCharCode(this.readInt8(this.position_+b.SIZEOF_INT+e));return r};b.ByteBuffer.prototype.__offset=function(r,e){var t=r-this.readInt32(r);return e<this.readInt16(t)?this.readInt16(t+e):0};b.ByteBuffer.prototype.__union=function(r,e){return r.bb_pos=e+this.readInt32(e),r.bb=this,r};b.ByteBuffer.prototype.__string=function(r,e){r+=this.readInt32(r);var t=this.readInt32(r),n="",i=0;if(r+=b.SIZEOF_INT,e===b.Encoding.UTF8_BYTES)return this.bytes_.subarray(r,r+t);for(;i<t;){var o,a=this.readUint8(r+i++);if(a<192)o=a;else{var u=this.readUint8(r+i++);if(a<224)o=(a&31)<<6|u&63;else{var f=this.readUint8(r+i++);if(a<240)o=(a&15)<<12|(u&63)<<6|f&63;else{var s=this.readUint8(r+i++);o=(a&7)<<18|(u&63)<<12|(f&63)<<6|s&63}}}o<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode((o>>10)+55296,(o&(1<<10)-1)+56320))}return n};b.ByteBuffer.prototype.__indirect=function(r){return r+this.readInt32(r)};b.ByteBuffer.prototype.__vector=function(r){return r+this.readInt32(r)+b.SIZEOF_INT};b.ByteBuffer.prototype.__vector_len=function(r){return this.readInt32(r+this.readInt32(r))};b.ByteBuffer.prototype.__has_identifier=function(r){if(r.length!=b.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+b.FILE_IDENTIFIER_LENGTH);for(var e=0;e<b.FILE_IDENTIFIER_LENGTH;e++)if(r.charCodeAt(e)!=this.readInt8(this.position_+b.SIZEOF_INT+e))return!1;return!0};b.ByteBuffer.prototype.createLong=function(r,e){return b.Long.create(r,e)};Ad.flatbuffers=b});var Dd=w(ja=>{"use strict";function or(r,e,t){return e<=r&&r<=t}function As(r){if(r===void 0)return{};if(r===Object(r))return r;throw TypeError("Could not convert argument to dictionary")}function og(r){for(var e=String(r),t=e.length,n=0,i=[];n<t;){var o=e.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===t-1)i.push(65533);else{var a=r.charCodeAt(n+1);if(56320<=a&&a<=57343){var u=o&1023,f=a&1023;i.push(65536+(u<<10)+f),n+=1}else i.push(65533)}n+=1}return i}function ag(r){for(var e="",t=0;t<r.length;++t){var n=r[t];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return e}var Ds=-1;function xa(r){this.tokens=[].slice.call(r)}xa.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Ds},prepend:function(r){if(Array.isArray(r))for(var e=r;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(r)},push:function(r){if(Array.isArray(r))for(var e=r;e.length;)this.tokens.push(e.shift());else this.tokens.push(r)}};var wn=-1;function Ca(r,e){if(r)throw TypeError("Decoder error");return e||65533}var Fs="utf-8";function Rs(r,e){if(!(this instanceof Rs))return new Rs(r,e);if(r=r!==void 0?String(r).toLowerCase():Fs,r!==Fs)throw new Error("Encoding not supported. Only utf-8 is supported");e=As(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})}Rs.prototype={decode:function(e,t){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),t=As(t),this._streaming||(this._decoder=new ug({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var i=new xa(n),o=[],a;!i.endOfStream()&&(a=this._decoder.handler(i,i.read()),a!==wn);)a!==null&&(Array.isArray(a)?o.push.apply(o,a):o.push(a));if(!this._streaming){do{if(a=this._decoder.handler(i,i.read()),a===wn)break;a!==null&&(Array.isArray(a)?o.push.apply(o,a):o.push(a))}while(!i.endOfStream());this._decoder=null}return o.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(o[0]===65279?(this._BOMseen=!0,o.shift()):this._BOMseen=!0),ag(o)}};function Es(r,e){if(!(this instanceof Es))return new Es(r,e);if(r=r!==void 0?String(r).toLowerCase():Fs,r!==Fs)throw new Error("Encoding not supported. Only utf-8 is supported");e=As(e),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(e.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}Es.prototype={encode:function(e,t){e=e?String(e):"",t=As(t),this._streaming||(this._encoder=new cg(this._options)),this._streaming=Boolean(t.stream);for(var n=[],i=new xa(og(e)),o;!i.endOfStream()&&(o=this._encoder.handler(i,i.read()),o!==wn);)Array.isArray(o)?n.push.apply(n,o):n.push(o);if(!this._streaming){for(;o=this._encoder.handler(i,i.read()),o!==wn;)Array.isArray(o)?n.push.apply(n,o):n.push(o);this._encoder=null}return new Uint8Array(n)}};function ug(r){var e=r.fatal,t=0,n=0,i=0,o=128,a=191;this.handler=function(u,f){if(f===Ds&&i!==0)return i=0,Ca(e);if(f===Ds)return wn;if(i===0){if(or(f,0,127))return f;if(or(f,194,223))i=1,t=f-192;else if(or(f,224,239))f===224&&(o=160),f===237&&(a=159),i=2,t=f-224;else if(or(f,240,244))f===240&&(o=144),f===244&&(a=143),i=3,t=f-240;else return Ca(e);return t=t<<6*i,null}if(!or(f,o,a))return t=i=n=0,o=128,a=191,u.prepend(f),Ca(e);if(o=128,a=191,n+=1,t+=f-128<<6*(i-n),n!==i)return null;var s=t;return t=i=n=0,s}}function cg(r){var e=r.fatal;this.handler=function(t,n){if(n===Ds)return wn;if(or(n,0,127))return n;var i,o;or(n,128,2047)?(i=1,o=192):or(n,2048,65535)?(i=2,o=224):or(n,65536,1114111)&&(i=3,o=240);for(var a=[(n>>6*i)+o];i>0;){var u=n>>6*(i-1);a.push(128|u&63),i-=1}return a}}ja.TextEncoder=Es;ja.TextDecoder=Rs});var Xr=w(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.encodeUtf8=Tn.decodeUtf8=void 0;var Fd=Se(),Rd=Dd(),Us=typeof Buffer=="function"?Buffer:null,Ed=typeof TextDecoder=="function"&&typeof TextEncoder=="function";Tn.decodeUtf8=(r=>{if(Ed||!Us){let e=new r("utf-8");return t=>e.decode(t)}return e=>{let{buffer:t,byteOffset:n,length:i}=Fd.toUint8Array(e);return Us.from(t,n,i).toString()}})(typeof TextDecoder!="undefined"?TextDecoder:Rd.TextDecoder);Tn.encodeUtf8=(r=>{if(Ed||!Us){let e=new r;return t=>e.encode(t)}return(e="")=>Fd.toUint8Array(Us.from(e,"utf8"))})(typeof TextEncoder!="undefined"?TextEncoder:Rd.TextEncoder)});var Bn=w(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.AsyncQueue=rt.ReadableInterop=rt.ArrowJSON=rt.ITERATOR_DONE=void 0;var Ud=Si();rt.ITERATOR_DONE=Object.freeze({done:!0,value:void 0});var Md=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}};rt.ArrowJSON=Md;var qa=class{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}};rt.ReadableInterop=qa;var Pd=class extends qa{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(rt.ITERATOR_DONE);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Ud.default.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Ud.default.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}async throw(e){return await this.abort(e),rt.ITERATOR_DONE}async return(e){return await this.close(),rt.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((t,n)=>{this.resolvers.push({resolve:t,reject:n})}):Promise.resolve(rt.ITERATOR_DONE)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error(`${this} is closed`)}};rt.AsyncQueue=Pd});var Je=w(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.isReadableNodeStream=F.isWritableNodeStream=F.isReadableDOMStream=F.isWritableDOMStream=F.isFetchResponse=F.isFSReadStream=F.isFileHandle=F.isUnderlyingSink=F.isIteratorResult=F.isArrayLike=F.isArrowJSON=F.isAsyncIterable=F.isIterable=F.isObservable=F.isPromise=F.isObject=F.BigUint64ArrayAvailable=F.BigUint64Array=F.BigInt64ArrayAvailable=F.BigInt64Array=F.BigIntAvailable=F.BigInt=void 0;var Ms=Bn(),[lg,dg]=(()=>{let r=()=>{throw new Error("BigInt is not available in this environment")};function e(){throw r()}return e.asIntN=()=>{throw r()},e.asUintN=()=>{throw r()},typeof BigInt!="undefined"?[BigInt,!0]:[e,!1]})();F.BigInt=lg;F.BigIntAvailable=dg;var[fg,hg]=(()=>{let r=()=>{throw new Error("BigInt64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigInt64Array!="undefined"?[BigInt64Array,!0]:[e,!1]})();F.BigInt64Array=fg;F.BigInt64ArrayAvailable=hg;var[pg,yg]=(()=>{let r=()=>{throw new Error("BigUint64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigUint64Array!="undefined"?[BigUint64Array,!0]:[e,!1]})();F.BigUint64Array=pg;F.BigUint64ArrayAvailable=yg;var Wa=r=>typeof r=="number",Vd=r=>typeof r=="boolean",We=r=>typeof r=="function";F.isObject=r=>r!=null&&Object(r)===r;F.isPromise=r=>F.isObject(r)&&We(r.then);F.isObservable=r=>F.isObject(r)&&We(r.subscribe);F.isIterable=r=>F.isObject(r)&&We(r[Symbol.iterator]);F.isAsyncIterable=r=>F.isObject(r)&&We(r[Symbol.asyncIterator]);F.isArrowJSON=r=>F.isObject(r)&&F.isObject(r.schema);F.isArrayLike=r=>F.isObject(r)&&Wa(r.length);F.isIteratorResult=r=>F.isObject(r)&&"done"in r&&"value"in r;F.isUnderlyingSink=r=>F.isObject(r)&&We(r.abort)&&We(r.close)&&We(r.start)&&We(r.write);F.isFileHandle=r=>F.isObject(r)&&We(r.stat)&&Wa(r.fd);F.isFSReadStream=r=>F.isReadableNodeStream(r)&&Wa(r.bytesRead);F.isFetchResponse=r=>F.isObject(r)&&F.isReadableDOMStream(r.body);F.isWritableDOMStream=r=>F.isObject(r)&&We(r.abort)&&We(r.getWriter)&&!(r instanceof Ms.ReadableInterop);F.isReadableDOMStream=r=>F.isObject(r)&&We(r.cancel)&&We(r.getReader)&&!(r instanceof Ms.ReadableInterop);F.isWritableNodeStream=r=>F.isObject(r)&&We(r.end)&&We(r.write)&&Vd(r.writable)&&!(r instanceof Ms.ReadableInterop);F.isReadableNodeStream=r=>F.isObject(r)&&We(r.read)&&We(r.pipe)&&Vd(r.readable)&&!(r instanceof Ms.ReadableInterop)});var Se=w(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.compareArrayLike=O.rebaseValueOffsets=O.toUint8ClampedArrayAsyncIterator=O.toFloat64ArrayAsyncIterator=O.toFloat32ArrayAsyncIterator=O.toUint32ArrayAsyncIterator=O.toUint16ArrayAsyncIterator=O.toUint8ArrayAsyncIterator=O.toInt32ArrayAsyncIterator=O.toInt16ArrayAsyncIterator=O.toInt8ArrayAsyncIterator=O.toArrayBufferViewAsyncIterator=O.toUint8ClampedArrayIterator=O.toFloat64ArrayIterator=O.toFloat32ArrayIterator=O.toUint32ArrayIterator=O.toUint16ArrayIterator=O.toUint8ArrayIterator=O.toInt32ArrayIterator=O.toInt16ArrayIterator=O.toInt8ArrayIterator=O.toArrayBufferViewIterator=O.toUint8ClampedArray=O.toFloat64Array=O.toFloat32Array=O.toBigUint64Array=O.toUint32Array=O.toUint16Array=O.toUint8Array=O.toBigInt64Array=O.toInt32Array=O.toInt16Array=O.toInt8Array=O.toArrayBufferView=O.joinUint8Arrays=O.memcpy=void 0;var bg=gn(),mg=Xr(),_g=bg.flatbuffers.ByteBuffer,Zr=Je(),za=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:ArrayBuffer;function gg(r){let e=r[0]?[r[0]]:[],t,n,i,o;for(let a,u,f=0,s=0,c=r.length;++f<c;){if(a=e[s],u=r[f],!a||!u||a.buffer!==u.buffer||u.byteOffset<a.byteOffset){u&&(e[++s]=u);continue}if({byteOffset:t,byteLength:i}=a,{byteOffset:n,byteLength:o}=u,t+i<n||n+o<t){u&&(e[++s]=u);continue}e[s]=new Uint8Array(a.buffer,t,n-t+o)}return e}function Ya(r,e,t=0,n=e.byteLength){let i=r.byteLength,o=new Uint8Array(r.buffer,r.byteOffset,i),a=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return o.set(a,t),r}O.memcpy=Ya;function wg(r,e){let t=gg(r),n=t.reduce((c,_)=>c+_.byteLength,0),i,o,a,u=0,f=-1,s=Math.min(e||1/0,n);for(let c=t.length;++f<c;){if(i=t[f],o=i.subarray(0,Math.min(i.length,s-u)),s<=u+o.length){o.length<i.length?t[f]=i.subarray(o.length):o.length===i.length&&f++,a?Ya(a,o,u):a=o;break}Ya(a||(a=new Uint8Array(s)),o,u),u+=o.length}return[a||new Uint8Array(0),t.slice(f),n-(a?a.byteLength:0)]}O.joinUint8Arrays=wg;function Xe(r,e){let t=Zr.isIteratorResult(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=mg.encodeUtf8(t)),t instanceof ArrayBuffer?new r(t):t instanceof za?new r(t):t instanceof _g?Xe(r,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new r(0):new r(t.buffer,t.byteOffset,t.byteLength/r.BYTES_PER_ELEMENT):r.from(t)):new r(0)}O.toArrayBufferView=Xe;O.toInt8Array=r=>Xe(Int8Array,r);O.toInt16Array=r=>Xe(Int16Array,r);O.toInt32Array=r=>Xe(Int32Array,r);O.toBigInt64Array=r=>Xe(Zr.BigInt64Array,r);O.toUint8Array=r=>Xe(Uint8Array,r);O.toUint16Array=r=>Xe(Uint16Array,r);O.toUint32Array=r=>Xe(Uint32Array,r);O.toBigUint64Array=r=>Xe(Zr.BigUint64Array,r);O.toFloat32Array=r=>Xe(Float32Array,r);O.toFloat64Array=r=>Xe(Float64Array,r);O.toUint8ClampedArray=r=>Xe(Uint8ClampedArray,r);var Ha=r=>(r.next(),r);function*Lt(r,e){let t=function*(i){yield i},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof za?t(e):Zr.isIterable(e)?e:t(e);return yield*Ha(function*(i){let o=null;do o=i.next(yield Xe(r,o));while(!o.done)}(n[Symbol.iterator]())),new r}O.toArrayBufferViewIterator=Lt;O.toInt8ArrayIterator=r=>Lt(Int8Array,r);O.toInt16ArrayIterator=r=>Lt(Int16Array,r);O.toInt32ArrayIterator=r=>Lt(Int32Array,r);O.toUint8ArrayIterator=r=>Lt(Uint8Array,r);O.toUint16ArrayIterator=r=>Lt(Uint16Array,r);O.toUint32ArrayIterator=r=>Lt(Uint32Array,r);O.toFloat32ArrayIterator=r=>Lt(Float32Array,r);O.toFloat64ArrayIterator=r=>Lt(Float64Array,r);O.toUint8ClampedArrayIterator=r=>Lt(Uint8ClampedArray,r);async function*St(r,e){if(Zr.isPromise(e))return yield*St(r,await e);let t=async function*(o){yield await o},n=async function*(o){yield*Ha(function*(a){let u=null;do u=a.next(yield u&&u.value);while(!u.done)}(o[Symbol.iterator]()))},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof za?t(e):Zr.isIterable(e)?n(e):Zr.isAsyncIterable(e)?e:t(e);return yield*Ha(async function*(o){let a=null;do a=await o.next(yield Xe(r,a));while(!a.done)}(i[Symbol.asyncIterator]())),new r}O.toArrayBufferViewAsyncIterator=St;O.toInt8ArrayAsyncIterator=r=>St(Int8Array,r);O.toInt16ArrayAsyncIterator=r=>St(Int16Array,r);O.toInt32ArrayAsyncIterator=r=>St(Int32Array,r);O.toUint8ArrayAsyncIterator=r=>St(Uint8Array,r);O.toUint16ArrayAsyncIterator=r=>St(Uint16Array,r);O.toUint32ArrayAsyncIterator=r=>St(Uint32Array,r);O.toFloat32ArrayAsyncIterator=r=>St(Float32Array,r);O.toFloat64ArrayAsyncIterator=r=>St(Float64Array,r);O.toUint8ClampedArrayAsyncIterator=r=>St(Uint8ClampedArray,r);function Tg(r,e,t){if(r!==0){t=t.slice(0,e+1);for(let n=-1;++n<=e;)t[n]+=r}return t}O.rebaseValueOffsets=Tg;function Bg(r,e){let t=0,n=r.length;if(n!==e.length)return!1;if(n>0)do if(r[t]!==e[t])return!1;while(++t<n);return!0}O.compareArrayLike=Bg});var Si=w($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});var Ze=Se();$a.default={fromIterable(r){return Ps(vg(r))},fromAsyncIterable(r){return Ps(Ig(r))},fromDOMStream(r){return Ps(Sg(r))},fromNodeStream(r){return Ps(Og(r))},toDOMStream(r,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,e){throw new Error('"toNodeStream" not available in this environment')}};var Ps=r=>(r.next(),r);function*vg(r){let e,t=!1,n=[],i,o,a,u=0;function f(){return o==="peek"?Ze.joinUint8Arrays(n,a)[0]:([i,n,u]=Ze.joinUint8Arrays(n,a),i)}({cmd:o,size:a}=yield null);let s=Ze.toUint8ArrayIterator(r)[Symbol.iterator]();try{do if({done:e,value:i}=isNaN(a-u)?s.next(void 0):s.next(a-u),!e&&i.byteLength>0&&(n.push(i),u+=i.byteLength),e||a<=u)do({cmd:o,size:a}=yield f());while(a<u);while(!e)}catch(c){(t=!0)&&typeof s.throw=="function"&&s.throw(c)}finally{t===!1&&typeof s.return=="function"&&s.return(null)}return null}async function*Ig(r){let e,t=!1,n=[],i,o,a,u=0;function f(){return o==="peek"?Ze.joinUint8Arrays(n,a)[0]:([i,n,u]=Ze.joinUint8Arrays(n,a),i)}({cmd:o,size:a}=yield null);let s=Ze.toUint8ArrayAsyncIterator(r)[Symbol.asyncIterator]();try{do if({done:e,value:i}=isNaN(a-u)?await s.next(void 0):await s.next(a-u),!e&&i.byteLength>0&&(n.push(i),u+=i.byteLength),e||a<=u)do({cmd:o,size:a}=yield f());while(a<u);while(!e)}catch(c){(t=!0)&&typeof s.throw=="function"&&await s.throw(c)}finally{t===!1&&typeof s.return=="function"&&await s.return(new Uint8Array(0))}return null}async function*Sg(r){let e=!1,t=!1,n=[],i,o,a,u=0;function f(){return o==="peek"?Ze.joinUint8Arrays(n,a)[0]:([i,n,u]=Ze.joinUint8Arrays(n,a),i)}({cmd:o,size:a}=yield null);let s=new Nd(r);try{do if({done:e,value:i}=isNaN(a-u)?await s.read(void 0):await s.read(a-u),!e&&i.byteLength>0&&(n.push(Ze.toUint8Array(i)),u+=i.byteLength),e||a<=u)do({cmd:o,size:a}=yield f());while(a<u);while(!e)}catch(c){(t=!0)&&await s.cancel(c)}finally{t===!1?await s.cancel():r.locked&&s.releaseLock()}return null}var Nd=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:t,source:n}=this;t&&await t.cancel(e).catch(()=>{}),n&&n.locked&&this.releaseLock()}async read(e){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=!this.supportsBYOB||typeof e!="number"?await this.getDefaultReader().read():await this.readFromBYOBReader(e);return!t.done&&(t.value=Ze.toUint8Array(t)),t}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 kd(this.getBYOBReader(),new ArrayBuffer(e),0,e)}};async function kd(r,e,t,n){if(t>=n)return{done:!1,value:new Uint8Array(e,0,n)};let{done:i,value:o}=await r.read(new Uint8Array(e,t,n-t));return(t+=o.byteLength)<n&&!i?await kd(r,o.buffer,t,n):{done:i,value:new Uint8Array(o.buffer,0,t)}}var Ga=(r,e)=>{let t=i=>n([e,i]),n;return[e,t,new Promise(i=>(n=i)&&r.once(e,t))]};async function*Og(r){let e=[],t="error",n=!1,i=null,o,a,u=0,f=[],s;function c(){return o==="peek"?Ze.joinUint8Arrays(f,a)[0]:([s,f,u]=Ze.joinUint8Arrays(f,a),s)}if({cmd:o,size:a}=yield null,r.isTTY)return yield new Uint8Array(0),null;try{e[0]=Ga(r,"end"),e[1]=Ga(r,"error");do{if(e[2]=Ga(r,"readable"),[t,i]=await Promise.race(e.map(U=>U[2])),t==="error")break;if((n=t==="end")||(isFinite(a-u)?(s=Ze.toUint8Array(r.read(a-u)),s.byteLength<a-u&&(s=Ze.toUint8Array(r.read(void 0)))):s=Ze.toUint8Array(r.read(void 0)),s.byteLength>0&&(f.push(s),u+=s.byteLength)),n||a<=u)do({cmd:o,size:a}=yield c());while(a<u)}while(!n)}finally{await _(e,t==="error"?i:null)}return null;function _(U,J){return s=f=null,new Promise(async(tt,Mt)=>{for(let[It,K]of U)r.off(It,K);try{let It=r.destroy;It&&It.call(r,J),J=void 0}catch(It){J=It||J}finally{J!=null?Mt(J):tt()}})}}});var ve=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.Vector=vn.AbstractVector=void 0;var Vs=class{};vn.AbstractVector=Vs;vn.Vector=Vs;Vs.prototype.data=null});var In=w(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.org=void 0;var ne;(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.V1=0]="V1",f[f.V2=1]="V2",f[f.V3=2]="V3",f[f.V4=3]="V4"})(u=a.MetadataVersion||(a.MetadataVersion={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.Sparse=0]="Sparse",f[f.Dense=1]="Dense"})(u=a.UnionMode||(a.UnionMode={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.HALF=0]="HALF",f[f.SINGLE=1]="SINGLE",f[f.DOUBLE=2]="DOUBLE"})(u=a.Precision||(a.Precision={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.DAY=0]="DAY",f[f.MILLISECOND=1]="MILLISECOND"})(u=a.DateUnit||(a.DateUnit={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.SECOND=0]="SECOND",f[f.MILLISECOND=1]="MILLISECOND",f[f.MICROSECOND=2]="MICROSECOND",f[f.NANOSECOND=3]="NANOSECOND"})(u=a.TimeUnit||(a.TimeUnit={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.YEAR_MONTH=0]="YEAR_MONTH",f[f.DAY_TIME=1]="DAY_TIME"})(u=a.IntervalUnit||(a.IntervalUnit={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.NONE=0]="NONE",f[f.Null=1]="Null",f[f.Int=2]="Int",f[f.FloatingPoint=3]="FloatingPoint",f[f.Binary=4]="Binary",f[f.Utf8=5]="Utf8",f[f.Bool=6]="Bool",f[f.Decimal=7]="Decimal",f[f.Date=8]="Date",f[f.Time=9]="Time",f[f.Timestamp=10]="Timestamp",f[f.Interval=11]="Interval",f[f.List=12]="List",f[f.Struct_=13]="Struct_",f[f.Union=14]="Union",f[f.FixedSizeBinary=15]="FixedSizeBinary",f[f.FixedSizeList=16]="FixedSizeList",f[f.Map=17]="Map",f[f.Duration=18]="Duration",f[f.LargeBinary=19]="LargeBinary",f[f.LargeUtf8=20]="LargeUtf8",f[f.LargeList=21]="LargeList"})(u=a.Type||(a.Type={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.Little=0]="Little",f[f.Big=1]="Big"})(u=a.Endianness||(a.Endianness={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsNull(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startNull(s){s.startObject(0)}static endNull(s){return s.endObject()}static createNull(s){return u.startNull(s),u.endNull(s)}}a.Null=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsStruct_(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startStruct_(s){s.startObject(0)}static endStruct_(s){return s.endObject()}static createStruct_(s){return u.startStruct_(s),u.endStruct_(s)}}a.Struct_=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsList(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startList(s){s.startObject(0)}static endList(s){return s.endObject()}static createList(s){return u.startList(s),u.endList(s)}}a.List=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsLargeList(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startLargeList(s){s.startObject(0)}static endLargeList(s){return s.endObject()}static createLargeList(s){return u.startLargeList(s),u.endLargeList(s)}}a.LargeList=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsFixedSizeList(s,c){return(c||new u).__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,c){s.addFieldInt32(0,c,0)}static endFixedSizeList(s){return s.endObject()}static createFixedSizeList(s,c){return u.startFixedSizeList(s),u.addListSize(s,c),u.endFixedSizeList(s)}}a.FixedSizeList=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsMap(s,c){return(c||new u).__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,c){s.addFieldInt8(0,+c,0)}static endMap(s){return s.endObject()}static createMap(s,c){return u.startMap(s),u.addKeysSorted(s,c),u.endMap(s)}}a.Map=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsUnion(s,c){return(c||new u).__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):r.apache.arrow.flatbuf.UnionMode.Sparse}typeIds(s){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.readInt32(this.bb.__vector(this.bb_pos+c)+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,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.UnionMode.Sparse)}static addTypeIds(s,c){s.addFieldOffset(1,c,0)}static createTypeIdsVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addInt32(c[_]);return s.endVector()}static startTypeIdsVector(s,c){s.startVector(4,c,4)}static endUnion(s){return s.endObject()}static createUnion(s,c,_){return u.startUnion(s),u.addMode(s,c),u.addTypeIds(s,_),u.endUnion(s)}}a.Union=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsInt(s,c){return(c||new u).__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,c){s.addFieldInt32(0,c,0)}static addIsSigned(s,c){s.addFieldInt8(1,+c,0)}static endInt(s){return s.endObject()}static createInt(s,c,_){return u.startInt(s),u.addBitWidth(s,c),u.addIsSigned(s,_),u.endInt(s)}}a.Int=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsFloatingPoint(s,c){return(c||new u).__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):r.apache.arrow.flatbuf.Precision.HALF}static startFloatingPoint(s){s.startObject(1)}static addPrecision(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.Precision.HALF)}static endFloatingPoint(s){return s.endObject()}static createFloatingPoint(s,c){return u.startFloatingPoint(s),u.addPrecision(s,c),u.endFloatingPoint(s)}}a.FloatingPoint=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsUtf8(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startUtf8(s){s.startObject(0)}static endUtf8(s){return s.endObject()}static createUtf8(s){return u.startUtf8(s),u.endUtf8(s)}}a.Utf8=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsBinary(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startBinary(s){s.startObject(0)}static endBinary(s){return s.endObject()}static createBinary(s){return u.startBinary(s),u.endBinary(s)}}a.Binary=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsLargeUtf8(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startLargeUtf8(s){s.startObject(0)}static endLargeUtf8(s){return s.endObject()}static createLargeUtf8(s){return u.startLargeUtf8(s),u.endLargeUtf8(s)}}a.LargeUtf8=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsLargeBinary(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startLargeBinary(s){s.startObject(0)}static endLargeBinary(s){return s.endObject()}static createLargeBinary(s){return u.startLargeBinary(s),u.endLargeBinary(s)}}a.LargeBinary=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsFixedSizeBinary(s,c){return(c||new u).__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,c){s.addFieldInt32(0,c,0)}static endFixedSizeBinary(s){return s.endObject()}static createFixedSizeBinary(s,c){return u.startFixedSizeBinary(s),u.addByteWidth(s,c),u.endFixedSizeBinary(s)}}a.FixedSizeBinary=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsBool(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}static startBool(s){s.startObject(0)}static endBool(s){return s.endObject()}static createBool(s){return u.startBool(s),u.endBool(s)}}a.Bool=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDecimal(s,c){return(c||new u).__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,c){s.addFieldInt32(0,c,0)}static addScale(s,c){s.addFieldInt32(1,c,0)}static endDecimal(s){return s.endObject()}static createDecimal(s,c,_){return u.startDecimal(s),u.addPrecision(s,c),u.addScale(s,_),u.endDecimal(s)}}a.Decimal=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDate(s,c){return(c||new u).__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):r.apache.arrow.flatbuf.DateUnit.MILLISECOND}static startDate(s){s.startObject(1)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.DateUnit.MILLISECOND)}static endDate(s){return s.endObject()}static createDate(s,c){return u.startDate(s),u.addUnit(s,c),u.endDate(s)}}a.Date=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsTime(s,c){return(c||new u).__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):r.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,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static addBitWidth(s,c){s.addFieldInt32(1,c,32)}static endTime(s){return s.endObject()}static createTime(s,c,_){return u.startTime(s),u.addUnit(s,c),u.addBitWidth(s,_),u.endTime(s)}}a.Time=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsTimestamp(s,c){return(c||new u).__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):r.apache.arrow.flatbuf.TimeUnit.SECOND}timezone(s){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__string(this.bb_pos+c,s):null}static startTimestamp(s){s.startObject(2)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.TimeUnit.SECOND)}static addTimezone(s,c){s.addFieldOffset(1,c,0)}static endTimestamp(s){return s.endObject()}static createTimestamp(s,c,_){return u.startTimestamp(s),u.addUnit(s,c),u.addTimezone(s,_),u.endTimestamp(s)}}a.Timestamp=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsInterval(s,c){return(c||new u).__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):r.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}static startInterval(s){s.startObject(1)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}static endInterval(s){return s.endObject()}static createInterval(s,c){return u.startInterval(s),u.addUnit(s,c),u.endInterval(s)}}a.Interval=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDuration(s,c){return(c||new u).__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):r.apache.arrow.flatbuf.TimeUnit.MILLISECOND}static startDuration(s){s.startObject(1)}static addUnit(s,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static endDuration(s){return s.endObject()}static createDuration(s,c){return u.startDuration(s),u.addUnit(s,c),u.endDuration(s)}}a.Duration=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsKeyValue(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}key(s){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.__string(this.bb_pos+c,s):null}value(s){let c=this.bb.__offset(this.bb_pos,6);return c?this.bb.__string(this.bb_pos+c,s):null}static startKeyValue(s){s.startObject(2)}static addKey(s,c){s.addFieldOffset(0,c,0)}static addValue(s,c){s.addFieldOffset(1,c,0)}static endKeyValue(s){return s.endObject()}static createKeyValue(s,c,_){return u.startKeyValue(s),u.addKey(s,c),u.addValue(s,_),u.endKeyValue(s)}}a.KeyValue=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDictionaryEncoding(s,c){return(c||new u).__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 c=this.bb.__offset(this.bb_pos,6);return c?(s||new r.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+c),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,c){s.addFieldInt64(0,c,s.createLong(0,0))}static addIndexType(s,c){s.addFieldOffset(1,c,0)}static addIsOrdered(s,c){s.addFieldInt8(2,+c,0)}static endDictionaryEncoding(s){return s.endObject()}static createDictionaryEncoding(s,c,_,U){return u.startDictionaryEncoding(s),u.addId(s,c),u.addIndexType(s,_),u.addIsOrdered(s,U),u.endDictionaryEncoding(s)}}a.DictionaryEncoding=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsField(s,c){return(c||new u).__init(s.readInt32(s.position())+s.position(),s)}name(s){let c=this.bb.__offset(this.bb_pos,4);return c?this.bb.__string(this.bb_pos+c,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):r.apache.arrow.flatbuf.Type.NONE}type(s){let c=this.bb.__offset(this.bb_pos,10);return c?this.bb.__union(s,this.bb_pos+c):null}dictionary(s){let c=this.bb.__offset(this.bb_pos,12);return c?(s||new r.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+c),this.bb):null}children(s,c){let _=this.bb.__offset(this.bb_pos,14);return _?(c||new r.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+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,c){let _=this.bb.__offset(this.bb_pos,16);return _?(c||new r.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+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,c){s.addFieldOffset(0,c,0)}static addNullable(s,c){s.addFieldInt8(1,+c,0)}static addTypeType(s,c){s.addFieldInt8(2,c,r.apache.arrow.flatbuf.Type.NONE)}static addType(s,c){s.addFieldOffset(3,c,0)}static addDictionary(s,c){s.addFieldOffset(4,c,0)}static addChildren(s,c){s.addFieldOffset(5,c,0)}static createChildrenVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startChildrenVector(s,c){s.startVector(4,c,4)}static addCustomMetadata(s,c){s.addFieldOffset(6,c,0)}static createCustomMetadataVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startCustomMetadataVector(s,c){s.startVector(4,c,4)}static endField(s){return s.endObject()}static createField(s,c,_,U,J,tt,Mt,It){return u.startField(s),u.addName(s,c),u.addNullable(s,_),u.addTypeType(s,U),u.addType(s,J),u.addDictionary(s,tt),u.addChildren(s,Mt),u.addCustomMetadata(s,It),u.endField(s)}}a.Field=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(s,c,_){return s.prep(8,16),s.writeInt64(_),s.writeInt64(c),s.offset()}}a.Buffer=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsSchema(s,c){return(c||new u).__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):r.apache.arrow.flatbuf.Endianness.Little}fields(s,c){let _=this.bb.__offset(this.bb_pos,6);return _?(c||new r.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+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,c){let _=this.bb.__offset(this.bb_pos,8);return _?(c||new r.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+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,c){s.addFieldInt16(0,c,r.apache.arrow.flatbuf.Endianness.Little)}static addFields(s,c){s.addFieldOffset(1,c,0)}static createFieldsVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startFieldsVector(s,c){s.startVector(4,c,4)}static addCustomMetadata(s,c){s.addFieldOffset(2,c,0)}static createCustomMetadataVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startCustomMetadataVector(s,c){s.startVector(4,c,4)}static endSchema(s){return s.endObject()}static finishSchemaBuffer(s,c){s.finish(c)}static createSchema(s,c,_,U){return u.startSchema(s),u.addEndianness(s,c),u.addFields(s,_),u.addCustomMetadata(s,U),u.endSchema(s)}}a.Schema=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(ne=A.org||(A.org={}))});var Ja=w(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.org=void 0;var Oi=In(),Sn;(function(r){var e;(function(t){var n;(function(i){var o;(function(a){a.Schema=Oi.org.apache.arrow.flatbuf.Schema})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(Sn=et.org||(et.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){let u;(function(f){f[f.NONE=0]="NONE",f[f.Schema=1]="Schema",f[f.DictionaryBatch=2]="DictionaryBatch",f[f.RecordBatch=3]="RecordBatch",f[f.Tensor=4]="Tensor",f[f.SparseTensor=5]="SparseTensor"})(u=a.MessageHeader||(a.MessageHeader={}))})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(Sn=et.org||(et.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(s,c,_){return s.prep(8,16),s.writeInt64(_),s.writeInt64(c),s.offset()}}a.FieldNode=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(Sn=et.org||(et.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsRecordBatch(s,c){return(c||new u).__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,c){let _=this.bb.__offset(this.bb_pos,6);return _?(c||new r.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+_)+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,c){let _=this.bb.__offset(this.bb_pos,8);return _?(c||new Oi.org.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+_)+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,c){s.addFieldInt64(0,c,s.createLong(0,0))}static addNodes(s,c){s.addFieldOffset(1,c,0)}static startNodesVector(s,c){s.startVector(16,c,8)}static addBuffers(s,c){s.addFieldOffset(2,c,0)}static startBuffersVector(s,c){s.startVector(16,c,8)}static endRecordBatch(s){return s.endObject()}static createRecordBatch(s,c,_,U){return u.startRecordBatch(s),u.addLength(s,c),u.addNodes(s,_),u.addBuffers(s,U),u.endRecordBatch(s)}}a.RecordBatch=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(Sn=et.org||(et.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsDictionaryBatch(s,c){return(c||new u).__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 c=this.bb.__offset(this.bb_pos,6);return c?(s||new r.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+c),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,c){s.addFieldInt64(0,c,s.createLong(0,0))}static addData(s,c){s.addFieldOffset(1,c,0)}static addIsDelta(s,c){s.addFieldInt8(2,+c,0)}static endDictionaryBatch(s){return s.endObject()}static createDictionaryBatch(s,c,_,U){return u.startDictionaryBatch(s),u.addId(s,c),u.addData(s,_),u.addIsDelta(s,U),u.endDictionaryBatch(s)}}a.DictionaryBatch=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(Sn=et.org||(et.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsMessage(s,c){return(c||new u).__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):Oi.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):r.apache.arrow.flatbuf.MessageHeader.NONE}header(s){let c=this.bb.__offset(this.bb_pos,8);return c?this.bb.__union(s,this.bb_pos+c):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,c){let _=this.bb.__offset(this.bb_pos,12);return _?(c||new Oi.org.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+_)+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,c){s.addFieldInt16(0,c,Oi.org.apache.arrow.flatbuf.MetadataVersion.V1)}static addHeaderType(s,c){s.addFieldInt8(1,c,r.apache.arrow.flatbuf.MessageHeader.NONE)}static addHeader(s,c){s.addFieldOffset(2,c,0)}static addBodyLength(s,c){s.addFieldInt64(3,c,s.createLong(0,0))}static addCustomMetadata(s,c){s.addFieldOffset(4,c,0)}static createCustomMetadataVector(s,c){s.startVector(4,c.length,4);for(let _=c.length-1;_>=0;_--)s.addOffset(c[_]);return s.endVector()}static startCustomMetadataVector(s,c){s.startVector(4,c,4)}static endMessage(s){return s.endObject()}static finishMessageBuffer(s,c){s.finish(c)}static createMessage(s,c,_,U,J,tt){return u.startMessage(s),u.addVersion(s,c),u.addHeaderType(s,_),u.addHeader(s,U),u.addBodyLength(s,J),u.addCustomMetadata(s,tt),u.endMessage(s)}}a.Message=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(Sn=et.org||(et.org={}))});var le=w(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.BufferType=he.Type=he.MetadataVersion=he.MessageHeader=he.IntervalUnit=he.UnionMode=he.Precision=he.TimeUnit=he.DateUnit=he.ArrowType=void 0;var en=In(),Ag=Ja();he.ArrowType=en.org.apache.arrow.flatbuf.Type;he.DateUnit=en.org.apache.arrow.flatbuf.DateUnit;he.TimeUnit=en.org.apache.arrow.flatbuf.TimeUnit;he.Precision=en.org.apache.arrow.flatbuf.Precision;he.UnionMode=en.org.apache.arrow.flatbuf.UnionMode;he.IntervalUnit=en.org.apache.arrow.flatbuf.IntervalUnit;he.MessageHeader=Ag.org.apache.arrow.flatbuf.MessageHeader;he.MetadataVersion=en.org.apache.arrow.flatbuf.MetadataVersion;var Dg;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth"})(Dg=he.Type||(he.Type={}));var Fg;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(Fg=he.BufferType||(he.BufferType={}))});var xt=w(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.popcnt_uint32=Oe.popcnt_array=Oe.popcnt_bit_range=Oe.iterateBits=Oe.packBools=Oe.truncateBitmap=Oe.setBool=Oe.getBit=Oe.getBool=void 0;function Ld(r,e,t,n){return(t&1<<n)!=0}Oe.getBool=Ld;function xd(r,e,t,n){return(t&1<<n)>>n}Oe.getBit=xd;function Rg(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}Oe.setBool=Rg;function Eg(r,e,t){let n=t.byteLength+7&~7;if(r>0||t.byteLength<n){let i=new Uint8Array(n);return i.set(r%8==0?t.subarray(r>>3):Cd(Ka(t,r,e,null,Ld)).subarray(0,n)),i}return t}Oe.truncateBitmap=Eg;function Cd(r){let e=[],t=0,n=0,i=0;for(let a of r)a&&(i|=1<<n),++n==8&&(e[t++]=i,i=n=0);(t===0||n>0)&&(e[t++]=i);let o=new Uint8Array(e.length+7&~7);return o.set(e),o}Oe.packBools=Cd;function*Ka(r,e,t,n,i){let o=e%8,a=e>>3,u=0,f=t;for(;f>0;o=0){let s=r[a++];do yield i(n,u++,s,o);while(--f>0&&++o<8)}}Oe.iterateBits=Ka;function Qa(r,e,t){if(t-e<=0)return 0;if(t-e<8){let o=0;for(let a of Ka(r,e,t-e,r,xd))o+=a;return o}let n=t>>3<<3,i=e+(e%8==0?0:8-e%8);return Qa(r,e,i)+Qa(r,n,t)+jd(r,i>>3,n-i>>3)}Oe.popcnt_bit_range=Qa;function jd(r,e,t){let n=0,i=e|0,o=new DataView(r.buffer,r.byteOffset,r.byteLength),a=t===void 0?r.byteLength:i+t;for(;a-i>=4;)n+=Ns(o.getUint32(i)),i+=4;for(;a-i>=2;)n+=Ns(o.getUint16(i)),i+=2;for(;a-i>=1;)n+=Ns(o.getUint8(i)),i+=1;return n}Oe.popcnt_array=jd;function Ns(r){let e=r|0;return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}Oe.popcnt_uint32=Ns});var ze=w(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.Visitor=void 0;var Ug=Ot(),Mg=ve(),g=le(),Pg=se(),ue=class{visitMany(e,...t){return e.map((n,i)=>this.visit(n,...t.map(o=>o[i])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Vg(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};ks.Visitor=ue;function Vg(r,e,t=!0){let n=null,i=g.Type.NONE;switch(e instanceof Ug.Data||e instanceof Mg.Vector?i=Xa(e.type):e instanceof Pg.DataType?i=Xa(e):typeof(i=e)!="number"&&(i=g.Type[e]),i){case g.Type.Null:n=r.visitNull;break;case g.Type.Bool:n=r.visitBool;break;case g.Type.Int:n=r.visitInt;break;case g.Type.Int8:n=r.visitInt8||r.visitInt;break;case g.Type.Int16:n=r.visitInt16||r.visitInt;break;case g.Type.Int32:n=r.visitInt32||r.visitInt;break;case g.Type.Int64:n=r.visitInt64||r.visitInt;break;case g.Type.Uint8:n=r.visitUint8||r.visitInt;break;case g.Type.Uint16:n=r.visitUint16||r.visitInt;break;case g.Type.Uint32:n=r.visitUint32||r.visitInt;break;case g.Type.Uint64:n=r.visitUint64||r.visitInt;break;case g.Type.Float:n=r.visitFloat;break;case g.Type.Float16:n=r.visitFloat16||r.visitFloat;break;case g.Type.Float32:n=r.visitFloat32||r.visitFloat;break;case g.Type.Float64:n=r.visitFloat64||r.visitFloat;break;case g.Type.Utf8:n=r.visitUtf8;break;case g.Type.Binary:n=r.visitBinary;break;case g.Type.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case g.Type.Date:n=r.visitDate;break;case g.Type.DateDay:n=r.visitDateDay||r.visitDate;break;case g.Type.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case g.Type.Timestamp:n=r.visitTimestamp;break;case g.Type.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case g.Type.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case g.Type.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case g.Type.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case g.Type.Time:n=r.visitTime;break;case g.Type.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case g.Type.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case g.Type.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case g.Type.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case g.Type.Decimal:n=r.visitDecimal;break;case g.Type.List:n=r.visitList;break;case g.Type.Struct:n=r.visitStruct;break;case g.Type.Union:n=r.visitUnion;break;case g.Type.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case g.Type.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case g.Type.Dictionary:n=r.visitDictionary;break;case g.Type.Interval:n=r.visitInterval;break;case g.Type.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case g.Type.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case g.Type.FixedSizeList:n=r.visitFixedSizeList;break;case g.Type.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${g.Type[i]}'`)}function Xa(r){switch(r.typeId){case g.Type.Null:return g.Type.Null;case g.Type.Int:let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?g.Type.Int8:g.Type.Uint8;case 16:return t?g.Type.Int16:g.Type.Uint16;case 32:return t?g.Type.Int32:g.Type.Uint32;case 64:return t?g.Type.Int64:g.Type.Uint64}return g.Type.Int;case g.Type.Float:switch(r.precision){case g.Precision.HALF:return g.Type.Float16;case g.Precision.SINGLE:return g.Type.Float32;case g.Precision.DOUBLE:return g.Type.Float64}return g.Type.Float;case g.Type.Binary:return g.Type.Binary;case g.Type.Utf8:return g.Type.Utf8;case g.Type.Bool:return g.Type.Bool;case g.Type.Decimal:return g.Type.Decimal;case g.Type.Time:switch(r.unit){case g.TimeUnit.SECOND:return g.Type.TimeSecond;case g.TimeUnit.MILLISECOND:return g.Type.TimeMillisecond;case g.TimeUnit.MICROSECOND:return g.Type.TimeMicrosecond;case g.TimeUnit.NANOSECOND:return g.Type.TimeNanosecond}return g.Type.Time;case g.Type.Timestamp:switch(r.unit){case g.TimeUnit.SECOND:return g.Type.TimestampSecond;case g.TimeUnit.MILLISECOND:return g.Type.TimestampMillisecond;case g.TimeUnit.MICROSECOND:return g.Type.TimestampMicrosecond;case g.TimeUnit.NANOSECOND:return g.Type.TimestampNanosecond}return g.Type.Timestamp;case g.Type.Date:switch(r.unit){case g.DateUnit.DAY:return g.Type.DateDay;case g.DateUnit.MILLISECOND:return g.Type.DateMillisecond}return g.Type.Date;case g.Type.Interval:switch(r.unit){case g.IntervalUnit.DAY_TIME:return g.Type.IntervalDayTime;case g.IntervalUnit.YEAR_MONTH:return g.Type.IntervalYearMonth}return g.Type.Interval;case g.Type.Map:return g.Type.Map;case g.Type.List:return g.Type.List;case g.Type.Struct:return g.Type.Struct;case g.Type.Union:switch(r.mode){case g.UnionMode.Dense:return g.Type.DenseUnion;case g.UnionMode.Sparse:return g.Type.SparseUnion}return g.Type.Union;case g.Type.FixedSizeBinary:return g.Type.FixedSizeBinary;case g.Type.FixedSizeList:return g.Type.FixedSizeList;case g.Type.Dictionary:return g.Type.Dictionary}throw new Error(`Unrecognized type '${g.Type[r.typeId]}'`)}ue.prototype.visitInt8=null;ue.prototype.visitInt16=null;ue.prototype.visitInt32=null;ue.prototype.visitInt64=null;ue.prototype.visitUint8=null;ue.prototype.visitUint16=null;ue.prototype.visitUint32=null;ue.prototype.visitUint64=null;ue.prototype.visitFloat16=null;ue.prototype.visitFloat32=null;ue.prototype.visitFloat64=null;ue.prototype.visitDateDay=null;ue.prototype.visitDateMillisecond=null;ue.prototype.visitTimestampSecond=null;ue.prototype.visitTimestampMillisecond=null;ue.prototype.visitTimestampMicrosecond=null;ue.prototype.visitTimestampNanosecond=null;ue.prototype.visitTimeSecond=null;ue.prototype.visitTimeMillisecond=null;ue.prototype.visitTimeMicrosecond=null;ue.prototype.visitTimeNanosecond=null;ue.prototype.visitDenseUnion=null;ue.prototype.visitSparseUnion=null;ue.prototype.visitIntervalDayTime=null;ue.prototype.visitIntervalYearMonth=null});var ru=w(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.instance=Ke.TypeComparator=void 0;var Ng=ze(),P=class extends Ng.Visitor{compareSchemas(e,t){return e===t||t instanceof e.constructor&&Ke.instance.compareFields(e.fields,t.fields)}compareFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,i)=>Ke.instance.compareField(n,t[i]))}compareField(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&Ke.instance.visit(e.type,t.type)}};Ke.TypeComparator=P;function nt(r,e){return e instanceof r.constructor}function Ai(r,e){return r===e||nt(r,e)}function ar(r,e){return r===e||nt(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function Ls(r,e){return r===e||nt(r,e)&&r.precision===e.precision}function kg(r,e){return r===e||nt(r,e)&&r.byteWidth===e.byteWidth}function Za(r,e){return r===e||nt(r,e)&&r.unit===e.unit}function Di(r,e){return r===e||nt(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function Fi(r,e){return r===e||nt(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function Lg(r,e){return r===e||nt(r,e)&&r.children.length===e.children.length&&Ke.instance.compareFields(r.children,e.children)}function xg(r,e){return r===e||nt(r,e)&&r.children.length===e.children.length&&Ke.instance.compareFields(r.children,e.children)}function eu(r,e){return r===e||nt(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&Ke.instance.compareFields(r.children,e.children)}function Cg(r,e){return r===e||nt(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&Ke.instance.visit(r.indices,e.indices)&&Ke.instance.visit(r.dictionary,e.dictionary)}function tu(r,e){return r===e||nt(r,e)&&r.unit===e.unit}function jg(r,e){return r===e||nt(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&Ke.instance.compareFields(r.children,e.children)}function qg(r,e){return r===e||nt(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&Ke.instance.compareFields(r.children,e.children)}P.prototype.visitNull=Ai;P.prototype.visitBool=Ai;P.prototype.visitInt=ar;P.prototype.visitInt8=ar;P.prototype.visitInt16=ar;P.prototype.visitInt32=ar;P.prototype.visitInt64=ar;P.prototype.visitUint8=ar;P.prototype.visitUint16=ar;P.prototype.visitUint32=ar;P.prototype.visitUint64=ar;P.prototype.visitFloat=Ls;P.prototype.visitFloat16=Ls;P.prototype.visitFloat32=Ls;P.prototype.visitFloat64=Ls;P.prototype.visitUtf8=Ai;P.prototype.visitBinary=Ai;P.prototype.visitFixedSizeBinary=kg;P.prototype.visitDate=Za;P.prototype.visitDateDay=Za;P.prototype.visitDateMillisecond=Za;P.prototype.visitTimestamp=Di;P.prototype.visitTimestampSecond=Di;P.prototype.visitTimestampMillisecond=Di;P.prototype.visitTimestampMicrosecond=Di;P.prototype.visitTimestampNanosecond=Di;P.prototype.visitTime=Fi;P.prototype.visitTimeSecond=Fi;P.prototype.visitTimeMillisecond=Fi;P.prototype.visitTimeMicrosecond=Fi;P.prototype.visitTimeNanosecond=Fi;P.prototype.visitDecimal=Ai;P.prototype.visitList=Lg;P.prototype.visitStruct=xg;P.prototype.visitUnion=eu;P.prototype.visitDenseUnion=eu;P.prototype.visitSparseUnion=eu;P.prototype.visitDictionary=Cg;P.prototype.visitInterval=tu;P.prototype.visitIntervalDayTime=tu;P.prototype.visitIntervalYearMonth=tu;P.prototype.visitFixedSizeList=jg;P.prototype.visitMap=qg;Ke.instance=new P});var se=w(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.strideForType=B.Dictionary=B.Map_=B.FixedSizeList=B.FixedSizeBinary=B.SparseUnion=B.DenseUnion=B.Union=B.Struct=B.List=B.IntervalYearMonth=B.IntervalDayTime=B.Interval=B.TimestampNanosecond=B.TimestampMicrosecond=B.TimestampMillisecond=B.TimestampSecond=B.Timestamp=B.TimeNanosecond=B.TimeMicrosecond=B.TimeMillisecond=B.TimeSecond=B.Time=B.DateMillisecond=B.DateDay=B.Date_=B.Decimal=B.Bool=B.Utf8=B.Binary=B.Float64=B.Float32=B.Float16=B.Float=B.Uint64=B.Uint32=B.Uint16=B.Uint8=B.Int64=B.Int32=B.Int16=B.Int8=B.Int=B.Null=B.DataType=void 0;var Wg=ru(),D=le(),ge=class{static isNull(e){return e&&e.typeId===D.Type.Null}static isInt(e){return e&&e.typeId===D.Type.Int}static isFloat(e){return e&&e.typeId===D.Type.Float}static isBinary(e){return e&&e.typeId===D.Type.Binary}static isUtf8(e){return e&&e.typeId===D.Type.Utf8}static isBool(e){return e&&e.typeId===D.Type.Bool}static isDecimal(e){return e&&e.typeId===D.Type.Decimal}static isDate(e){return e&&e.typeId===D.Type.Date}static isTime(e){return e&&e.typeId===D.Type.Time}static isTimestamp(e){return e&&e.typeId===D.Type.Timestamp}static isInterval(e){return e&&e.typeId===D.Type.Interval}static isList(e){return e&&e.typeId===D.Type.List}static isStruct(e){return e&&e.typeId===D.Type.Struct}static isUnion(e){return e&&e.typeId===D.Type.Union}static isFixedSizeBinary(e){return e&&e.typeId===D.Type.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===D.Type.FixedSizeList}static isMap(e){return e&&e.typeId===D.Type.Map}static isDictionary(e){return e&&e.typeId===D.Type.Dictionary}get typeId(){return D.Type.NONE}compareTo(e){return Wg.instance.visit(this,e)}};B.DataType=ge;ge[Symbol.toStringTag]=(r=>(r.children=null,r.ArrayType=Array,r[Symbol.toStringTag]="DataType"))(ge.prototype);var xs=class extends ge{toString(){return"Null"}get typeId(){return D.Type.Null}};B.Null=xs;xs[Symbol.toStringTag]=(r=>r[Symbol.toStringTag]="Null")(xs.prototype);var lt=class extends ge{constructor(e,t){super();this.isSigned=e,this.bitWidth=t}get typeId(){return D.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}`}};B.Int=lt;lt[Symbol.toStringTag]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(lt.prototype);var nu=class extends lt{constructor(){super(!0,8)}};B.Int8=nu;var iu=class extends lt{constructor(){super(!0,16)}};B.Int16=iu;var su=class extends lt{constructor(){super(!0,32)}};B.Int32=su;var ou=class extends lt{constructor(){super(!0,64)}};B.Int64=ou;var au=class extends lt{constructor(){super(!1,8)}};B.Uint8=au;var uu=class extends lt{constructor(){super(!1,16)}};B.Uint16=uu;var cu=class extends lt{constructor(){super(!1,32)}};B.Uint32=cu;var lu=class extends lt{constructor(){super(!1,64)}};B.Uint64=lu;Object.defineProperty(nu.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(iu.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(su.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(ou.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(au.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(uu.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(cu.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(lu.prototype,"ArrayType",{value:Uint32Array});var tn=class extends ge{constructor(e){super();this.precision=e}get typeId(){return D.Type.Float}get ArrayType(){switch(this.precision){case D.Precision.HALF:return Uint16Array;case D.Precision.SINGLE:return Float32Array;case D.Precision.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};B.Float=tn;tn[Symbol.toStringTag]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(tn.prototype);var du=class extends tn{constructor(){super(D.Precision.HALF)}};B.Float16=du;var fu=class extends tn{constructor(){super(D.Precision.SINGLE)}};B.Float32=fu;var hu=class extends tn{constructor(){super(D.Precision.DOUBLE)}};B.Float64=hu;Object.defineProperty(du.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(fu.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(hu.prototype,"ArrayType",{value:Float64Array});var Cs=class extends ge{constructor(){super()}get typeId(){return D.Type.Binary}toString(){return"Binary"}};B.Binary=Cs;Cs[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Cs.prototype);var js=class extends ge{constructor(){super()}get typeId(){return D.Type.Utf8}toString(){return"Utf8"}};B.Utf8=js;js[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(js.prototype);var qs=class extends ge{constructor(){super()}get typeId(){return D.Type.Bool}toString(){return"Bool"}};B.Bool=qs;qs[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(qs.prototype);var Ws=class extends ge{constructor(e,t){super();this.scale=e,this.precision=t}get typeId(){return D.Type.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};B.Decimal=Ws;Ws[Symbol.toStringTag]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Ws.prototype);var On=class extends ge{constructor(e){super();this.unit=e}get typeId(){return D.Type.Date}toString(){return`Date${(this.unit+1)*32}<${D.DateUnit[this.unit]}>`}};B.Date_=On;On[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Date"))(On.prototype);var qd=class extends On{constructor(){super(D.DateUnit.DAY)}};B.DateDay=qd;var Wd=class extends On{constructor(){super(D.DateUnit.MILLISECOND)}};B.DateMillisecond=Wd;var _r=class extends ge{constructor(e,t){super();this.unit=e,this.bitWidth=t}get typeId(){return D.Type.Time}toString(){return`Time${this.bitWidth}<${D.TimeUnit[this.unit]}>`}};B.Time=_r;_r[Symbol.toStringTag]=(r=>(r.unit=null,r.bitWidth=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Time"))(_r.prototype);var zd=class extends _r{constructor(){super(D.TimeUnit.SECOND,32)}};B.TimeSecond=zd;var Yd=class extends _r{constructor(){super(D.TimeUnit.MILLISECOND,32)}};B.TimeMillisecond=Yd;var Hd=class extends _r{constructor(){super(D.TimeUnit.MICROSECOND,64)}};B.TimeMicrosecond=Hd;var Gd=class extends _r{constructor(){super(D.TimeUnit.NANOSECOND,64)}};B.TimeNanosecond=Gd;var gr=class extends ge{constructor(e,t){super();this.unit=e,this.timezone=t}get typeId(){return D.Type.Timestamp}toString(){return`Timestamp<${D.TimeUnit[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};B.Timestamp=gr;gr[Symbol.toStringTag]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Timestamp"))(gr.prototype);var $d=class extends gr{constructor(e){super(D.TimeUnit.SECOND,e)}};B.TimestampSecond=$d;var Jd=class extends gr{constructor(e){super(D.TimeUnit.MILLISECOND,e)}};B.TimestampMillisecond=Jd;var Kd=class extends gr{constructor(e){super(D.TimeUnit.MICROSECOND,e)}};B.TimestampMicrosecond=Kd;var Qd=class extends gr{constructor(e){super(D.TimeUnit.NANOSECOND,e)}};B.TimestampNanosecond=Qd;var An=class extends ge{constructor(e){super();this.unit=e}get typeId(){return D.Type.Interval}toString(){return`Interval<${D.IntervalUnit[this.unit]}>`}};B.Interval=An;An[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(An.prototype);var Xd=class extends An{constructor(){super(D.IntervalUnit.DAY_TIME)}};B.IntervalDayTime=Xd;var Zd=class extends An{constructor(){super(D.IntervalUnit.YEAR_MONTH)}};B.IntervalYearMonth=Zd;var zs=class extends ge{constructor(e){super();this.children=[e]}get typeId(){return D.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}};B.List=zs;zs[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(zs.prototype);var Ys=class extends ge{constructor(e){super();this.children=e}get typeId(){return D.Type.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};B.Struct=Ys;Ys[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(Ys.prototype);var Dn=class extends ge{constructor(e,t,n){super();this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((i,o,a)=>(i[o]=a)&&i||i,Object.create(null))}get typeId(){return D.Type.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};B.Union=Dn;Dn[Symbol.toStringTag]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Dn.prototype);var ef=class extends Dn{constructor(e,t){super(D.UnionMode.Dense,e,t)}};B.DenseUnion=ef;var tf=class extends Dn{constructor(e,t){super(D.UnionMode.Sparse,e,t)}};B.SparseUnion=tf;var Hs=class extends ge{constructor(e){super();this.byteWidth=e}get typeId(){return D.Type.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};B.FixedSizeBinary=Hs;Hs[Symbol.toStringTag]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Hs.prototype);var Gs=class extends ge{constructor(e,t){super();this.listSize=e,this.children=[t]}get typeId(){return D.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}>`}};B.FixedSizeList=Gs;Gs[Symbol.toStringTag]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Gs.prototype);var $s=class extends ge{constructor(e,t=!1){super();this.children=[e],this.keysSorted=t}get typeId(){return D.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(", ")}}>`}};B.Map_=$s;$s[Symbol.toStringTag]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))($s.prototype);var zg=(r=>()=>++r)(-1),Js=class extends ge{constructor(e,t,n,i){super();this.indices=t,this.dictionary=e,this.isOrdered=i||!1,this.id=n==null?zg():typeof n=="number"?n:n.low}get typeId(){return D.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}>`}};B.Dictionary=Js;Js[Symbol.toStringTag]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Js.prototype);function Yg(r){let e=r;switch(r.typeId){case D.Type.Decimal:return 4;case D.Type.Timestamp:return 2;case D.Type.Date:return 1+e.unit;case D.Type.Interval:return 1+e.unit;case D.Type.Int:return 1+ +(e.bitWidth>32);case D.Type.Time:return 1+ +(e.bitWidth>32);case D.Type.FixedSizeList:return e.listSize;case D.Type.FixedSizeBinary:return e.byteWidth;default:return 1}}B.strideForType=Yg});var Ot=w(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.Data=rn.kUnknownNullCount=void 0;var Hg=xt(),Gg=xt(),R=le(),$g=se(),te=Se();rn.kUnknownNullCount=-1;var j=class{constructor(e,t,n,i,o,a,u){this.type=e,this.dictionary=u,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1)),this.childData=(a||[]).map(s=>s instanceof j?s:s.data);let f;o instanceof j?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=$g.strideForType(e),o&&((f=o[0])&&(this.valueOffsets=f),(f=o[1])&&(this.values=f),(f=o[2])&&(this.nullBitmap=f),(f=o[3])&&(this.typeIds=f)))}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:t,values:n,nullBitmap:i,typeIds:o}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),o&&(e+=o.byteLength),this.childData.reduce((a,u)=>a+u.byteLength,e)}get nullCount(){let e=this._nullCount,t;return e<=rn.kUnknownNullCount&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-Gg.popcnt_bit_range(t,this.offset,this.offset+this.length)),e}clone(e,t=this.offset,n=this.length,i=this._nullCount,o=this,a=this.childData){return new j(e,t,n,i,o,a,this.dictionary)}slice(e,t){let{stride:n,typeId:i,childData:o}=this,a=+(this._nullCount===0)-1,u=i===16?n:1,f=this._sliceBuffers(e,t,n,i);return this.clone(this.type,this.offset+e,t,a,f,!o.length||this.valueOffsets?o:this._sliceChildren(o,u*e,u*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===R.Type.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,i=new Uint8Array((e+63&~63)>>3).fill(255,0,t>>3);i[t>>3]=(1<<t-(t&~7))-1,n>0&&i.set(Hg.truncateBitmap(this.offset,t,this.nullBitmap),0);let o=this.buffers;return o[R.BufferType.VALIDITY]=i,this.clone(this.type,0,e,n+(e-t),o)}_sliceBuffers(e,t,n,i){let o,{buffers:a}=this;return(o=a[R.BufferType.TYPE])&&(a[R.BufferType.TYPE]=o.subarray(e,e+t)),(o=a[R.BufferType.OFFSET])&&(a[R.BufferType.OFFSET]=o.subarray(e,e+t+1))||(o=a[R.BufferType.DATA])&&(a[R.BufferType.DATA]=i===6?o:o.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(i=>i.slice(t,n))}static new(e,t,n,i,o,a,u){switch(o instanceof j?o=o.buffers:o||(o=[]),e.typeId){case R.Type.Null:return j.Null(e,t,n);case R.Type.Int:return j.Int(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.Dictionary:return j.Dictionary(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[],u);case R.Type.Float:return j.Float(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.Bool:return j.Bool(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.Decimal:return j.Decimal(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.Date:return j.Date(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.Time:return j.Time(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.Timestamp:return j.Timestamp(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.Interval:return j.Interval(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.FixedSizeBinary:return j.FixedSizeBinary(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.DATA]||[]);case R.Type.Binary:return j.Binary(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.OFFSET]||[],o[R.BufferType.DATA]||[]);case R.Type.Utf8:return j.Utf8(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.OFFSET]||[],o[R.BufferType.DATA]||[]);case R.Type.List:return j.List(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.OFFSET]||[],(a||[])[0]);case R.Type.FixedSizeList:return j.FixedSizeList(e,t,n,i||0,o[R.BufferType.VALIDITY],(a||[])[0]);case R.Type.Struct:return j.Struct(e,t,n,i||0,o[R.BufferType.VALIDITY],a||[]);case R.Type.Map:return j.Map(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.OFFSET]||[],(a||[])[0]);case R.Type.Union:return j.Union(e,t,n,i||0,o[R.BufferType.VALIDITY],o[R.BufferType.TYPE]||[],o[R.BufferType.OFFSET]||a,a)}throw new Error(`Unrecognized typeId ${e.typeId}`)}static Null(e,t,n){return new j(e,t,n,0)}static Int(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static Dictionary(e,t,n,i,o,a,u){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.indices.ArrayType,a),te.toUint8Array(o)],[],u)}static Float(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static Bool(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static Decimal(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static Date(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static Time(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static Timestamp(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static Interval(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static FixedSizeBinary(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,te.toArrayBufferView(e.ArrayType,a),te.toUint8Array(o)])}static Binary(e,t,n,i,o,a,u){return new j(e,t,n,i,[te.toInt32Array(a),te.toUint8Array(u),te.toUint8Array(o)])}static Utf8(e,t,n,i,o,a,u){return new j(e,t,n,i,[te.toInt32Array(a),te.toUint8Array(u),te.toUint8Array(o)])}static List(e,t,n,i,o,a,u){return new j(e,t,n,i,[te.toInt32Array(a),void 0,te.toUint8Array(o)],u?[u]:[])}static FixedSizeList(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,void 0,te.toUint8Array(o)],a?[a]:[])}static Struct(e,t,n,i,o,a){return new j(e,t,n,i,[void 0,void 0,te.toUint8Array(o)],a)}static Map(e,t,n,i,o,a,u){return new j(e,t,n,i,[te.toInt32Array(a),void 0,te.toUint8Array(o)],u?[u]:[])}static Union(e,t,n,i,o,a,u,f){let s=[void 0,void 0,te.toUint8Array(o),te.toArrayBufferView(e.ArrayType,a)];return e.mode===R.UnionMode.Sparse?new j(e,t,n,i,s,u):(s[R.BufferType.OFFSET]=te.toInt32Array(u),new j(e,t,n,i,s,f))}};rn.Data=j;j.prototype.childData=Object.freeze([])});var pu=w(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.valueToString=void 0;var Jg=void 0;function Kg(r){if(r===null)return"null";if(r===Jg)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r)}Ks.valueToString=Kg});var rf=w(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.createIsValidFunction=void 0;var yu=pu(),Qg=Je();function Xg(r){if(!r||r.length<=0)return function(i){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
2
- switch (x) {${t.map(n=>`
3
- case ${Zg(n)}:`).join("")}
4
- return false;
5
- }`),r.length!==t.length&&(e=`if (x !== x) return false;
6
- ${e}`),new Function("x",`${e}
7
- return true;`)}Qs.createIsValidFunction=Xg;function Zg(r){return typeof r!="bigint"?yu.valueToString(r):Qg.BigIntAvailable?`${yu.valueToString(r)}n`:`"${yu.valueToString(r)}"`}});var wr=w(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.WideBufferBuilder=dt.OffsetsBufferBuilder=dt.BitmapBufferBuilder=dt.DataBufferBuilder=dt.BufferBuilder=void 0;var nf=Se(),bu=Je(),mu=(r,e)=>(r*e+63&~63||64)/e,ew=(r,e=0)=>r.length>=e?r.subarray(0,e):nf.memcpy(new r.constructor(e),r,0),Ri=class{constructor(e,t=1){this.buffer=e,this.stride=t,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e.constructor,this._resize(this.length=e.length/t|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,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,n=this.length*t,i=this.buffer.length;n>=i&&this._resize(i===0?mu(n*1,this.BYTES_PER_ELEMENT):mu(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=mu(e*this.stride,this.BYTES_PER_ELEMENT);let t=ew(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this._resize(0),this}_resize(e){return this.buffer=nf.memcpy(new this.ArrayType(e),this.buffer)}};dt.BufferBuilder=Ri;Ri.prototype.offset=0;var Xs=class extends Ri{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}};dt.DataBufferBuilder=Xs;var sf=class extends Xs{constructor(e=new Uint8Array(0)){super(e,1/8);this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:n}=this.reserve(e-this.length+1),i=e>>3,o=e%8,a=n[i]>>o&1;return t?a===0&&(n[i]|=1<<o,++this.numValid):a===1&&(n[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}};dt.BitmapBufferBuilder=sf;var of=class extends Xs{constructor(e=new Int32Array(1)){super(e,1)}append(e){return this.set(this.length-1,e)}set(e,t){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]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,0),super.flush(e+1)}};dt.OffsetsBufferBuilder=of;var af=class extends Ri{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?bu.BigInt64Array:bu.BigUint64Array)}set(e,t){switch(this.reserve(e-this.length+1),typeof t){case"bigint":this.buffer64[e]=t;break;case"number":this.buffer[e*this.stride]=t;break;default:this.buffer.set(t,e*this.stride)}return this}_resize(e){let t=super._resize(e),n=t.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return bu.BigIntAvailable&&(this.buffer64=new this.ArrayType64(t.buffer,t.byteOffset,n)),t}};dt.WideBufferBuilder=af});var we=w(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.VariableWidthBuilder=Tr.FixedWidthBuilder=Tr.Builder=void 0;var tw=ve(),Fn=le(),rw=Ot(),nw=rf(),_u=wr(),iw=se(),ft=class{constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=iw.strideForType(e),this._nulls=new _u.BitmapBufferBuilder,t&&t.length>0&&(this._isValid=nw.createIsValidFunction(t))}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 sw(e)}static throughAsyncIterable(e){return ow(e)}toVector(){return tw.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((t,n)=>t+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((t,n)=>t+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,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e=[],t=this._values,n=this._offsets,i=this._typeIds,{length:o,nullCount:a}=this;i?(e[Fn.BufferType.TYPE]=i.flush(o),n&&(e[Fn.BufferType.OFFSET]=n.flush(o))):n?(t&&(e[Fn.BufferType.DATA]=t.flush(n.last())),e[Fn.BufferType.OFFSET]=n.flush(o)):t&&(e[Fn.BufferType.DATA]=t.flush(o)),a>0&&(e[Fn.BufferType.VALIDITY]=this._nulls.flush(o));let u=rw.Data.new(this.type,0,o,a,e,this.children.map(f=>f.flush()));return this.clear(),u}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}};Tr.Builder=ft;ft.prototype.length=1;ft.prototype.stride=1;ft.prototype.children=null;ft.prototype.finished=!1;ft.prototype.nullValues=null;ft.prototype._isValid=()=>!0;var uf=class extends ft{constructor(e){super(e);this._values=new _u.DataBufferBuilder(new this.ArrayType(0),this.stride)}setValue(e,t){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,t)}};Tr.FixedWidthBuilder=uf;var cf=class extends ft{constructor(e){super(e);this._pendingLength=0,this._offsets=new _u.OffsetsBufferBuilder}setValue(e,t){let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.length),this._pendingLength+=t.length,n.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}};Tr.VariableWidthBuilder=cf;function sw(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:2**14}=r,n=e!=="bytes"?"length":"byteLength";return function*(i){let o=0,a=ft.new(r);for(let u of i)a.append(u)[n]>=t&&++o&&(yield a.toVector());(a.finish().length>0||o===0)&&(yield a.toVector())}}function ow(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:2**14}=r,n=e!=="bytes"?"length":"byteLength";return async function*(i){let o=0,a=ft.new(r);for await(let u of i)a.append(u)[n]>=t&&++o&&(yield a.toVector());(a.finish().length>0||o===0)&&(yield a.toVector())}}});var gu=w(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.BoolBuilder=void 0;var aw=wr(),uw=we(),lf=class extends uw.Builder{constructor(e){super(e);this._values=new aw.BitmapBufferBuilder}setValue(e,t){this._values.set(e,+t)}};Zs.BoolBuilder=lf});var wu=w(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.NullBuilder=void 0;var cw=we(),df=class extends cw.Builder{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};eo.NullBuilder=df});var Tu=w(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.DateMillisecondBuilder=Br.DateDayBuilder=Br.DateBuilder=void 0;var lw=we(),to=class extends lw.FixedWidthBuilder{};Br.DateBuilder=to;var ff=class extends to{};Br.DateDayBuilder=ff;var hf=class extends to{};Br.DateMillisecondBuilder=hf});var Bu=w(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.DecimalBuilder=void 0;var dw=we(),pf=class extends dw.FixedWidthBuilder{};ro.DecimalBuilder=pf});var Iu=w(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.DictionaryBuilder=void 0;var fw=se(),vu=we(),yf=class extends vu.Builder{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new fw.Dictionary(e.dictionary,e.indices,e.id,e.isOrdered)});this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=vu.Builder.new({type:this.type.indices,nullValues:t}),this.dictionary=vu.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,t){let n=this.indices;return t=n.setValid(e,t),this.length=n.length,t}setValue(e,t){let n=this._keysToIndices,i=this.valueToKey(t),o=n[i];return o===void 0&&(n[i]=o=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,o)}flush(){let e=this.type,t=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(e);return i.dictionary=t?t.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}`}};no.DictionaryBuilder=yf});var Su=w(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.FixedSizeBinaryBuilder=void 0;var hw=we(),bf=class extends hw.FixedWidthBuilder{};io.FixedSizeBinaryBuilder=bf});var Ei=w(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.float64ToUint16=En.uint16ToFloat64=void 0;var mf=new Float64Array(1),Rn=new Uint32Array(mf.buffer);function pw(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=(-1)**((r&32768)>>15);switch(e){case 31:return n*(t?NaN:1/0);case 0:return n*(t?6103515625e-14*t:0)}return n*2**(e-15)*(1+t)}En.uint16ToFloat64=pw;function yw(r){if(r!==r)return 32256;mf[0]=r;let e=(Rn[1]&2147483648)>>16&65535,t=Rn[1]&2146435072,n=0;return t>=1089470464?Rn[0]>0?t=31744:(t=(t&2080374784)>>16,n=(Rn[1]&1048575)>>10):t<=1056964608?(n=1048576+(Rn[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(Rn[1]&1048575)+512>>10),e|t|n&65535}En.float64ToUint16=yw});var Ou=w(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.Float64Builder=Ct.Float32Builder=Ct.Float16Builder=Ct.FloatBuilder=void 0;var bw=Ei(),mw=we(),Ui=class extends mw.FixedWidthBuilder{};Ct.FloatBuilder=Ui;var _f=class extends Ui{setValue(e,t){this._values.set(e,bw.float64ToUint16(t))}};Ct.Float16Builder=_f;var gf=class extends Ui{setValue(e,t){this._values.set(e,t)}};Ct.Float32Builder=gf;var wf=class extends Ui{setValue(e,t){this._values.set(e,t)}};Ct.Float64Builder=wf});var Vi=w(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.BN=Me.bignumToBigInt=Me.bignumToString=Me.isArrowBigNumSymbol=void 0;var _w=Se(),Mi=Je();Me.isArrowBigNumSymbol=Symbol.for("isArrowBigNum");function At(r,...e){return e.length===0?Object.setPrototypeOf(_w.toArrayBufferView(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}At.prototype[Me.isArrowBigNumSymbol]=!0;At.prototype.toJSON=function(){return`"${Me.bignumToString(this)}"`};At.prototype.valueOf=function(){return Tf(this)};At.prototype.toString=function(){return Me.bignumToString(this)};At.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Tf(this);case"string":return Me.bignumToString(this);case"default":return Me.bignumToBigInt(this)}return Me.bignumToString(this)};function Un(...r){return At.apply(this,r)}function Mn(...r){return At.apply(this,r)}function Pi(...r){return At.apply(this,r)}Object.setPrototypeOf(Un.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Mn.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Pi.prototype,Object.create(Uint32Array.prototype));Object.assign(Un.prototype,At.prototype,{constructor:Un,signed:!0,TypedArray:Int32Array,BigIntArray:Mi.BigInt64Array});Object.assign(Mn.prototype,At.prototype,{constructor:Mn,signed:!1,TypedArray:Uint32Array,BigIntArray:Mi.BigUint64Array});Object.assign(Pi.prototype,At.prototype,{constructor:Pi,signed:!0,TypedArray:Uint32Array,BigIntArray:Mi.BigUint64Array});function Tf(r){let{buffer:e,byteOffset:t,length:n,signed:i}=r,o=new Int32Array(e,t,n),a=0,u=0,f=o.length,s,c;for(;u<f;)c=o[u++],s=o[u++],i||(s=s>>>0),a+=(c>>>0)+s*u**32;return a}Mi.BigIntAvailable?(Me.bignumToBigInt=r=>r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Au(r),Me.bignumToString=r=>r.byteLength===8?`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`:Au(r)):(Me.bignumToString=Au,Me.bignumToBigInt=Me.bignumToString);function Au(r){let e="",t=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),o=-1,a=n.length-1;do{for(t[0]=n[o=0];o<a;)n[o++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[o];n[o]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(i[0]||i[1]||i[2]||i[3]);return e||"0"}var so=class{static new(e,t){switch(t){case!0:return new Un(e);case!1:return new Mn(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case Mi.BigInt64Array:return new Un(e)}return e.byteLength===16?new Pi(e):new Mn(e)}static signed(e){return new Un(e)}static unsigned(e){return new Mn(e)}static decimal(e){return new Pi(e)}constructor(e,t){return so.new(e,t)}};Me.BN=so});var Du=w(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.Uint64Builder=Ae.Uint32Builder=Ae.Uint16Builder=Ae.Uint8Builder=Ae.Int64Builder=Ae.Int32Builder=Ae.Int16Builder=Ae.Int8Builder=Ae.IntBuilder=void 0;var gw=Vi(),Bf=wr(),ww=Je(),Tw=we(),jt=class extends Tw.FixedWidthBuilder{setValue(e,t){this._values.set(e,t)}};Ae.IntBuilder=jt;var vf=class extends jt{};Ae.Int8Builder=vf;var If=class extends jt{};Ae.Int16Builder=If;var Sf=class extends jt{};Ae.Int32Builder=Sf;var Of=class extends jt{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(oo));super(e);this._values=new Bf.WideBufferBuilder(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(oo(e))}};Ae.Int64Builder=Of;var Af=class extends jt{};Ae.Uint8Builder=Af;var Df=class extends jt{};Ae.Uint16Builder=Df;var Ff=class extends jt{};Ae.Uint32Builder=Ff;var Rf=class extends jt{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(oo));super(e);this._values=new Bf.WideBufferBuilder(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(oo(e))}};Ae.Uint64Builder=Rf;var oo=(r=>e=>(ArrayBuffer.isView(e)&&(r.buffer=e.buffer,r.byteOffset=e.byteOffset,r.byteLength=e.byteLength,e=gw.bignumToBigInt(r),r.buffer=null),e))({BigIntArray:ww.BigInt64Array})});var Fu=w(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.TimeNanosecondBuilder=ht.TimeMicrosecondBuilder=ht.TimeMillisecondBuilder=ht.TimeSecondBuilder=ht.TimeBuilder=void 0;var Bw=we(),Pn=class extends Bw.FixedWidthBuilder{};ht.TimeBuilder=Pn;var Ef=class extends Pn{};ht.TimeSecondBuilder=Ef;var Uf=class extends Pn{};ht.TimeMillisecondBuilder=Uf;var Mf=class extends Pn{};ht.TimeMicrosecondBuilder=Mf;var Pf=class extends Pn{};ht.TimeNanosecondBuilder=Pf});var Ru=w(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.TimestampNanosecondBuilder=pt.TimestampMicrosecondBuilder=pt.TimestampMillisecondBuilder=pt.TimestampSecondBuilder=pt.TimestampBuilder=void 0;var vw=we(),Vn=class extends vw.FixedWidthBuilder{};pt.TimestampBuilder=Vn;var Vf=class extends Vn{};pt.TimestampSecondBuilder=Vf;var Nf=class extends Vn{};pt.TimestampMillisecondBuilder=Nf;var kf=class extends Vn{};pt.TimestampMicrosecondBuilder=kf;var Lf=class extends Vn{};pt.TimestampNanosecondBuilder=Lf});var Eu=w(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.IntervalYearMonthBuilder=vr.IntervalDayTimeBuilder=vr.IntervalBuilder=void 0;var Iw=we(),ao=class extends Iw.FixedWidthBuilder{};vr.IntervalBuilder=ao;var xf=class extends ao{};vr.IntervalDayTimeBuilder=xf;var Cf=class extends ao{};vr.IntervalYearMonthBuilder=Cf});var co=w(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.BinaryBuilder=void 0;var Sw=Se(),Ow=wr(),Aw=we(),jf=class extends Aw.VariableWidthBuilder{constructor(e){super(e);this._values=new Ow.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,t){return super.setValue(e,Sw.toUint8Array(t))}_flushPending(e,t){let n=this._offsets,i=this._values.reserve(t).buffer,o=0,a=0,u=0,f;for([o,f]of e)f===void 0?n.set(o,0):(a=f.length,i.set(f,u),n.set(o,a),u+=a)}};uo.BinaryBuilder=jf});var fo=w(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.Utf8Builder=void 0;var Dw=Xr(),Fw=co(),Rw=wr(),Ew=we(),Uu=class extends Ew.VariableWidthBuilder{constructor(e){super(e);this._values=new Rw.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,t){return super.setValue(e,Dw.encodeUtf8(t))}_flushPending(e,t){}};lo.Utf8Builder=Uu;Uu.prototype._flushPending=Fw.BinaryBuilder.prototype._flushPending});var Mu=w(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.Run=void 0;var Uw=ve(),qf=class{get length(){return this._values.length}get(e){return this._values[e]}clear(){return this._values=null,this}bind(e){return e instanceof Uw.Vector?e:(this._values=e,this)}};ho.Run=qf});var Ni=w(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.StructRow=kn.MapRow=void 0;var Wf=pu(),Ye=Symbol.for("parent"),Nn=Symbol.for("rowIndex"),st=Symbol.for("keyToIdx"),ot=Symbol.for("idxToVal"),Pu=Symbol.for("nodejs.util.inspect.custom"),qt=class{constructor(e,t){this[Ye]=e,this.size=t}entries(){return this[Symbol.iterator]()}has(e){return this.get(e)!==void 0}get(e){let t;if(e!=null){let n=this[st]||(this[st]=new Map),i=n.get(e);if(i!==void 0){let o=this[ot]||(this[ot]=new Array(this.size));(t=o[i])!==void 0||(o[i]=t=this.getValue(i))}else if((i=this.getIndex(e))>-1){n.set(e,i);let o=this[ot]||(this[ot]=new Array(this.size));(t=o[i])!==void 0||(o[i]=t=this.getValue(i))}}return t}set(e,t){if(e!=null){let n=this[st]||(this[st]=new Map),i=n.get(e);if(i===void 0&&n.set(e,i=this.getIndex(e)),i>-1){let o=this[ot]||(this[ot]=new Array(this.size));o[i]=this.setValue(i,t)}}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(),t=this.values(),n=this[st]||(this[st]=new Map),i=this[ot]||(this[ot]=new Array(this.size));for(let o,a,u=0,f,s;!((f=e.next()).done||(s=t.next()).done);++u)o=f.value,a=s.value,i[u]=a,n.has(o)||n.set(o,u),yield[o,a]}forEach(e,t){let n=this.keys(),i=this.values(),o=t===void 0?e:(f,s,c)=>e.call(t,f,s,c),a=this[st]||(this[st]=new Map),u=this[ot]||(this[ot]=new Array(this.size));for(let f,s,c=0,_,U;!((_=n.next()).done||(U=i.next()).done);++c)f=_.value,s=U.value,u[c]=s,a.has(f)||a.set(f,c),o(s,f,this)}toArray(){return[...this.values()]}toJSON(){let e={};return this.forEach((t,n)=>e[n]=t),e}inspect(){return this.toString()}[Pu](){return this.toString()}toString(){let e=[];return this.forEach((t,n)=>{n=Wf.valueToString(n),t=Wf.valueToString(t),e.push(`${n}: ${t}`)}),`{ ${e.join(", ")} }`}};qt[Symbol.toStringTag]=(r=>(Object.defineProperties(r,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[Ye]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Nn]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),r[Symbol.toStringTag]="Row"))(qt.prototype);var zf=class extends qt{constructor(e){super(e,e.length);return Mw(this)}keys(){return this[Ye].getChildAt(0)[Symbol.iterator]()}values(){return this[Ye].getChildAt(1)[Symbol.iterator]()}getKey(e){return this[Ye].getChildAt(0).get(e)}getIndex(e){return this[Ye].getChildAt(0).indexOf(e)}getValue(e){return this[Ye].getChildAt(1).get(e)}setValue(e,t){this[Ye].getChildAt(1).set(e,t)}};kn.MapRow=zf;var Yf=class extends qt{constructor(e){super(e,e.type.children.length);return Hf(this)}*keys(){for(let e of this[Ye].type.children)yield e.name}*values(){for(let e of this[Ye].type.children)yield this[e.name]}getKey(e){return this[Ye].type.children[e].name}getIndex(e){return this[Ye].type.children.findIndex(t=>t.name===e)}getValue(e){return this[Ye].getChildAt(e).get(this[Nn])}setValue(e,t){return this[Ye].getChildAt(e).set(this[Nn],t)}};kn.StructRow=Yf;Object.setPrototypeOf(qt.prototype,Map.prototype);var Hf=(()=>{let r={enumerable:!0,configurable:!1,get:null,set:null};return e=>{let t=-1,n=e[st]||(e[st]=new Map),i=a=>function(){return this.get(a)},o=a=>function(u){return this.set(a,u)};for(let a of e.keys())n.set(a,++t),r.get=i(a),r.set=o(a),e.hasOwnProperty(a)||(r.enumerable=!0,Object.defineProperty(e,a,r)),e.hasOwnProperty(t)||(r.enumerable=!1,Object.defineProperty(e,t,r));return r.get=r.set=null,e}})(),Mw=(()=>{if(typeof Proxy=="undefined")return Hf;let r=qt.prototype.has,e=qt.prototype.get,t=qt.prototype.set,n=qt.prototype.getKey,i={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(o){return[...o.keys()].map(a=>`${a}`)},has(o,a){switch(a){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 Ye:case Nn:case ot:case st:case Pu:return!0}return typeof a=="number"&&!o.has(a)&&(a=o.getKey(a)),o.has(a)},get(o,a,u){switch(a){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 Ye:case Nn:case ot:case st:case Pu:return Reflect.get(o,a,u)}return typeof a=="number"&&!r.call(u,a)&&(a=n.call(u,a)),e.call(u,a)},set(o,a,u,f){switch(a){case Ye:case Nn:case ot:case st:return Reflect.set(o,a,u,f);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 a=="number"&&!r.call(f,a)&&(a=n.call(f,a)),r.call(f,a)?!!t.call(f,a,u):!1}};return o=>new Proxy(o,i)})()});var Li=w(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.createElementComparator=Ir.clampRange=Ir.clampIndex=void 0;var Gf=ve(),$f=Ni(),Pw=Se(),Jf=Je();function Vw(r,e,t){let n=r.length,i=e>-1?e:n+e%n;return t?t(r,i):i}Ir.clampIndex=Vw;var Kf;function Nw(r,e,t,n){let{length:i=0}=r,o=typeof e!="number"?0:e,a=typeof t!="number"?i:t;return o<0&&(o=(o%i+i)%i),a<0&&(a=(a%i+i)%i),a<o&&(Kf=o,o=a,a=Kf),a>i&&(a=i),n?n(r,o,a):[o,a]}Ir.clampRange=Nw;var kw=Jf.BigIntAvailable?Jf.BigInt(0):0,Qf=r=>r!==r;function ki(r){let e=typeof r;if(e!=="object"||r===null)return Qf(r)?Qf:e!=="bigint"?t=>t===r:t=>kw+t===r;if(r instanceof Date){let t=r.valueOf();return n=>n instanceof Date?n.valueOf()===t:!1}return ArrayBuffer.isView(r)?t=>t?Pw.compareArrayLike(r,t):!1:r instanceof Map?xw(r):Array.isArray(r)?Lw(r):r instanceof Gf.Vector?Cw(r):jw(r)}Ir.createElementComparator=ki;function Lw(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=ki(r[t]);return po(e)}function xw(r){let e=-1,t=[];return r.forEach(n=>t[++e]=ki(n)),po(t)}function Cw(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=ki(r.get(t));return po(e)}function jw(r){let e=Object.keys(r);if(e.length===0)return()=>!1;let t=[];for(let n=-1,i=e.length;++n<i;)t[n]=ki(r[e[n]]);return po(t,e)}function po(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return qw(r,t);case Map:case $f.MapRow:case $f.StructRow:return Xf(r,t,t.keys());case Object:case void 0:return Xf(r,t,e||Object.keys(t))}return t instanceof Gf.Vector?Ww(r,t):!1}}function qw(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e[n]))return!1;return!0}function Ww(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e.get(n)))return!1;return!0}function Xf(r,e,t){let n=t[Symbol.iterator](),i=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),o=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),a=0,u=r.length,f=o.next(),s=n.next(),c=i.next();for(;a<u&&!s.done&&!c.done&&!f.done&&!(s.value!==c.value||!r[a](f.value));++a,s=n.next(),c=i.next(),f=o.next());return a===u&&s.done&&c.done&&f.done?!0:(n.return&&n.return(),i.return&&i.return(),o.return&&o.return(),!1)}});var Sr=w(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.Chunked=void 0;var zw=Li(),Zf=se(),Yw=Or(),eh=ve(),ur=class extends eh.AbstractVector{constructor(e,t=[],n=Hw(t)){super();this._nullCount=-1,this._type=e,this._chunks=t,this._chunkOffsets=n,this._length=n[n.length-1],this._numChildren=(this._type.children||[]).length}static flatten(...e){return Yw.selectChunkArgs(eh.Vector,e)}static concat(...e){let t=ur.flatten(...e);return new ur(t[0].type,t)}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,t)=>e+t.byteLength,0)}get nullCount(){let e=this._nullCount;return e<0&&(this._nullCount=e=this._chunks.reduce((t,{nullCount:n})=>t+n,0)),e}get indices(){if(Zf.DataType.isDictionary(this._type)){if(!this._indices){let e=this._chunks;this._indices=e.length===1?e[0].indices:ur.concat(...e.map(t=>t.indices))}return this._indices}return null}get dictionary(){return Zf.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 ur(this._type,e)}concat(...e){return this.clone(ur.flatten(this,...e))}slice(e,t){return zw.clampRange(this,e,t,this._sliceInternal)}getChildAt(e){if(e<0||e>=this._numChildren)return null;let t=this._children||(this._children=[]),n,i,o;return(n=t[e])?n:(i=(this._type.children||[])[e])&&(o=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null),o.length>0)?t[e]=new ur(i.type,o):null}search(e,t){let n=e,i=this._chunkOffsets,o=i.length-1;if(n<0||n>=i[o])return null;if(o<=1)return t?t(this,0,n):[0,n];let a=0,u=0,f=0;do{if(a+1===o)return t?t(this,a,n-u):[a,n-u];f=a+(o-a)/2|0,n>=i[f]?a=f:o=f}while(n<i[o]&&n>=(u=i[a]));return null}isValid(e){return!!this.search(e,this.isValidInternal)}get(e){return this.search(e,this.getInternal)}set(e,t){this.search(e,({chunks:n},i,o)=>n[i].set(o,t))}indexOf(e,t){return t&&typeof t=="number"?this.search(t,(n,i,o)=>this.indexOfInternal(n,i,o,e)):this.indexOfInternal(this,0,Math.max(0,t||0),e)}toArray(){let{chunks:e}=this,t=e.length,n=this._type.ArrayType;if(t<=0)return new n(0);if(t<=1)return e[0].toArray();let i=0,o=new Array(t);for(let f=-1;++f<t;)i+=(o[f]=e[f].toArray()).length;n!==o[0].constructor&&(n=o[0].constructor);let a=new n(i),u=n===Array?$w:Gw;for(let f=-1,s=0;++f<t;)s=u(o[f],a,s);return a}getInternal({_chunks:e},t,n){return e[t].get(n)}isValidInternal({_chunks:e},t,n){return e[t].isValid(n)}indexOfInternal({_chunks:e},t,n,i){let o=t-1,a=e.length,u=n,f=0,s=-1;for(;++o<a;){if(~(s=e[o].indexOf(i,u)))return f+s;u=0,f+=e[o].length}return-1}_sliceInternal(e,t,n){let i=[],{chunks:o,_chunkOffsets:a}=e;for(let u=-1,f=o.length;++u<f;){let s=o[u],c=s.length,_=a[u];if(_>=n)break;if(t>=_+c)continue;if(_>=t&&_+c<=n){i.push(s);continue}let U=Math.max(0,t-_),J=Math.min(n-_,c);i.push(s.slice(U,J))}return e.clone(i)}};yo.Chunked=ur;function Hw(r){let e=new Uint32Array((r||[]).length+1),t=e[0]=0,n=e.length;for(let i=0;++i<n;)e[i]=t+=r[i-1].length;return e}var Gw=(r,e,t)=>(e.set(r,t),t+r.length),$w=(r,e,t)=>{let n=t;for(let i=-1,o=r.length;++i<o;)e[n++]=r[i];return n}});var Ln=w(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.Column=void 0;var th=xe(),rh=ve(),Vu=Sr(),nn=class extends Vu.Chunked{constructor(e,t=[],n){t=Vu.Chunked.flatten(...t);super(e.type,t,n);if(this._field=e,t.length===1&&!(this instanceof Nu))return new Nu(e,t[0],this._chunkOffsets)}static new(...e){let[t,n,...i]=e;typeof t!="string"&&!(t instanceof th.Field)&&(n=t,t="");let o=Vu.Chunked.flatten(Array.isArray(n)?[...n,...i]:n instanceof rh.Vector?[n,...i]:[rh.Vector.new(n,...i)]);if(typeof t=="string"){let a=o[0].data.type;t=new th.Field(t,a,!0)}else!t.nullable&&o.some(({nullCount:a})=>a>0)&&(t=t.clone({nullable:!0}));return new nn(t,o)}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 nn(this._field,e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t=this._children||(this._children=[]),n,i,o;return(n=t[e])?n:(i=(this.type.children||[])[e])&&(o=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null),o.length>0)?t[e]=new nn(i,o):null}};bo.Column=nn;var Nu=class extends nn{constructor(e,t,n){super(e,[t],n);this._chunk=t}search(e,t){return t?t(this,0,e):[0,e]}isValid(e){return this._chunk.isValid(e)}get(e){return this._chunk.get(e)}set(e,t){this._chunk.set(e,t)}indexOf(e,t){return this._chunk.indexOf(e,t)}}});var Or=w(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.selectColumnChildrenArgs=it.selectVectorChildrenArgs=it.selectChunkArgs=it.selectFieldArgs=it.selectColumnArgs=it.selectArgs=void 0;var nh=Ot(),ih=xe(),Ar=Ln(),xi=ve(),sh=se(),Jw=Sr(),Dr=Array.isArray;it.selectArgs=(r,e)=>mo(r,e,[],0);it.selectColumnArgs=r=>{let[e,t]=Lu(r,[[],[]]);return t.map((n,i)=>n instanceof Ar.Column?Ar.Column.new(n.field.clone(e[i]),n):n instanceof xi.Vector?Ar.Column.new(e[i],n):Ar.Column.new(e[i],[]))};it.selectFieldArgs=r=>Lu(r,[[],[]]);it.selectChunkArgs=(r,e)=>ku(r,e,[],0);it.selectVectorChildrenArgs=(r,e)=>oh(r,e,[],0);it.selectColumnChildrenArgs=(r,e)=>ah(r,e,[],0);function mo(r,e,t,n){let i,o=n,a=-1,u=e.length;for(;++a<u;)Dr(i=e[a])?o=mo(r,i,t,o).length:i instanceof r&&(t[o++]=i);return t}function ku(r,e,t,n){let i,o=n,a=-1,u=e.length;for(;++a<u;)Dr(i=e[a])?o=ku(r,i,t,o).length:i instanceof Jw.Chunked?o=ku(r,i.chunks,t,o).length:i instanceof r&&(t[o++]=i);return t}function oh(r,e,t,n){let i,o=n,a=-1,u=e.length;for(;++a<u;)Dr(i=e[a])?o=oh(r,i,t,o).length:i instanceof r?o=mo(xi.Vector,i.schema.fields.map((f,s)=>i.getChildAt(s)),t,o).length:i instanceof xi.Vector&&(t[o++]=i);return t}function ah(r,e,t,n){let i,o=n,a=-1,u=e.length;for(;++a<u;)Dr(i=e[a])?o=ah(r,i,t,o).length:i instanceof r?o=mo(Ar.Column,i.schema.fields.map((f,s)=>Ar.Column.new(f,i.getChildAt(s))),t,o).length:i instanceof Ar.Column&&(t[o++]=i);return t}var Kw=(r,[e,t],n)=>(r[0][n]=e,r[1][n]=t,r);function Lu(r,e){let t,n;switch(n=r.length){case 0:return e;case 1:if(t=e[0],!r[0])return e;if(Dr(r[0]))return Lu(r[0],e);r[0]instanceof nh.Data||r[0]instanceof xi.Vector||r[0]instanceof sh.DataType||([t,r]=Object.entries(r[0]).reduce(Kw,e));break;default:Dr(t=r[n-1])?r=Dr(r[0])?r[0]:r.slice(0,n-1):(r=Dr(r[0])?r[0]:r,t=[])}let i=-1,o=-1,a=-1,u=r.length,f,s,[c,_]=e;for(;++a<u;)s=r[a],s instanceof Ar.Column&&(_[++o]=s)?c[++i]=s.field.clone(t[a],s.type,!0):({[a]:f=a}=t,s instanceof sh.DataType&&(_[++o]=s)?c[++i]=ih.Field.new(f,s,!0):s&&s.type&&(_[++o]=s)&&(s instanceof nh.Data&&(_[o]=s=xi.Vector.new(s)),c[++i]=ih.Field.new(f,s.type,!0)));return e}});var xe=w(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.Field=xn.Schema=void 0;var Qw=se(),Xw=Or(),Zw=Or(),uh=ru(),at=class{constructor(e=[],t,n){this.fields=e||[],this.metadata=t||new Map,n||(n=xu(e)),this.dictionaries=n}static from(...e){return at.new(e[0],e[1])}static new(...e){return new at(Zw.selectFieldArgs(e)[0])}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}compareTo(e){return uh.instance.compareSchemas(this,e)}select(...e){let t=e.reduce((n,i)=>(n[i]=!0)&&n,Object.create(null));return new at(this.fields.filter(n=>t[n.name]),this.metadata)}selectAt(...e){return new at(e.map(t=>this.fields[t]).filter(Boolean),this.metadata)}assign(...e){let t=e[0]instanceof at?e[0]:new at(Xw.selectArgs(Wt,e)),n=[...this.fields],i=_o(_o(new Map,this.metadata),t.metadata),o=t.fields.filter(u=>{let f=n.findIndex(s=>s.name===u.name);return~f?(n[f]=u.clone({metadata:_o(_o(new Map,n[f].metadata),u.metadata)}))&&!1:!0}),a=xu(o,new Map);return new at([...n,...o],i,new Map([...this.dictionaries,...a]))}};xn.Schema=at;var Wt=class{constructor(e,t,n=!1,i){this.name=e,this.type=t,this.nullable=n,this.metadata=i||new Map}static new(...e){let[t,n,i,o]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],n===void 0&&(n=e[0].type),i===void 0&&(i=e[0].nullable),o===void 0&&(o=e[0].metadata)),new Wt(`${t}`,n,i,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}compareTo(e){return uh.instance.compareField(this,e)}clone(...e){let[t,n,i,o]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,n=this.type,i=this.nullable,o=this.metadata]=e:{name:t=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=e[0],Wt.new(t,n,i,o)}};xn.Field=Wt;function _o(r,e){return new Map([...r||new Map,...e||new Map])}function xu(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let o=r[t].type;if(Qw.DataType.isDictionary(o)){if(!e.has(o.id))e.set(o.id,o.dictionary);else if(e.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&xu(o.children,e)}return e}at.prototype.fields=null;at.prototype.metadata=null;at.prototype.dictionaries=null;Wt.prototype.type=null;Wt.prototype.name=null;Wt.prototype.nullable=null;Wt.prototype.metadata=null});var Cu=w(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.ListBuilder=void 0;var eT=Mu(),tT=xe(),rT=se(),nT=wr(),iT=we(),ch=class extends iT.VariableWidthBuilder{constructor(e){super(e);this._run=new eT.Run,this._offsets=new nT.OffsetsBufferBuilder}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new rT.List(new tT.Field(t,e.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(e){let t=this._run,n=this._offsets,i=this._setValue,o=0,a;for([o,a]of e)a===void 0?n.set(o,0):(n.set(o,a.length),i(this,o,t.bind(a)))}};go.ListBuilder=ch});var ju=w(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.FixedSizeListBuilder=void 0;var sT=Mu(),oT=xe(),aT=we(),uT=se(),lh=class extends aT.Builder{constructor(){super(...arguments);this._run=new sT.Run}setValue(e,t){super.setValue(e,this._run.bind(t))}addChild(e,t="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new uT.FixedSizeList(this.type.listSize,new oT.Field(t,e.type,!0)),n}clear(){return this._run.clear(),super.clear()}};wo.FixedSizeListBuilder=lh});var qu=w(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.MapBuilder=void 0;var cT=xe(),lT=se(),dT=we(),dh=class extends dT.VariableWidthBuilder{set(e,t){return super.set(e,t)}setValue(e,t){t=t instanceof Map?t:new Map(Object.entries(t));let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.size),this._pendingLength+=t.size,n.set(e,t)}addChild(e,t=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new lT.Map_(new cT.Field(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,n=this._setValue;e.forEach((i,o)=>{i===void 0?t.set(o,0):(t.set(o,i.size),n(this,o,i))})}};To.MapBuilder=dh});var Wu=w(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.StructBuilder=void 0;var fT=xe(),hT=we(),pT=se(),fh=class extends hT.Builder{addChild(e,t=`${this.numChildren}`){let n=this.children.push(e);return this.type=new pT.Struct([...this.type.children,new fT.Field(t,e.type,!0)]),n}};Bo.StructBuilder=fh});var zu=w(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.DenseUnionBuilder=Fr.SparseUnionBuilder=Fr.UnionBuilder=void 0;var yT=xe(),hh=wr(),bT=we(),mT=se(),vo=class extends bT.Builder{constructor(e){super(e);this._typeIds=new hh.DataBufferBuilder(new Int8Array(0),1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,n){return n===void 0&&(n=this._valueToChildTypeId(this,t,e)),this.setValid(e,this.isValid(t))&&this.setValue(e,t,n),this}setValue(e,t,n){this._typeIds.set(e,n),super.setValue(e,t)}addChild(e,t=`${this.children.length}`){let n=this.children.push(e),{type:{children:i,mode:o,typeIds:a}}=this,u=[...i,new yT.Field(t,e.type)];return this.type=new mT.Union(o,[...a,n],u),n}_valueToChildTypeId(e,t,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.")}};Fr.UnionBuilder=vo;var ph=class extends vo{};Fr.SparseUnionBuilder=ph;var yh=class extends vo{constructor(e){super(e);this._offsets=new hh.DataBufferBuilder(new Int32Array(0))}setValue(e,t,n){let i=this.type.typeIdToChildIndex[n];return this._offsets.set(e,this.getChildAt(i).length),super.setValue(e,t,n)}};Fr.DenseUnionBuilder=yh});var Gu=w(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.instance=Cn.SetVisitor=void 0;var _T=ve(),gT=ze(),wT=Xr(),TT=Ei(),BT=Se(),yt=le(),q=class extends gT.Visitor{};Cn.SetVisitor=q;var vT=(r,e,t)=>{r[e]=t/864e5|0},Yu=(r,e,t)=>{r[e]=t%4294967296|0,r[e+1]=t/4294967296|0},IT=(r,e,t)=>{r[e]=t*1e3%4294967296|0,r[e+1]=t*1e3/4294967296|0},ST=(r,e,t)=>{r[e]=t*1e6%4294967296|0,r[e+1]=t*1e6/4294967296|0},bh=(r,e,t,n)=>{let{[t]:i,[t+1]:o}=e;i!=null&&o!=null&&r.set(n.subarray(0,o-i),i)},OT=({offset:r,values:e},t,n)=>{let i=r+t;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)},mh=({values:r},e,t)=>{vT(r,e,t.valueOf())},_h=({values:r},e,t)=>{Yu(r,e*2,t.valueOf())},zt=({stride:r,values:e},t,n)=>{e[r*t]=n},gh=({stride:r,values:e},t,n)=>{e[r*t]=TT.float64ToUint16(n)},Hu=(r,e,t)=>{switch(typeof t){case"bigint":r.values64[e]=t;break;case"number":r.values[e*r.stride]=t;break;default:let n=t,{stride:i,ArrayType:o}=r,a=BT.toArrayBufferView(o,n);r.values.set(a.subarray(0,i),i*e)}},AT=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},DT=({values:r,valueOffsets:e},t,n)=>bh(r,e,t,n),FT=({values:r,valueOffsets:e},t,n)=>{bh(r,e,t,wT.encodeUtf8(n))},RT=(r,e,t)=>{r.type.bitWidth<64?zt(r,e,t):Hu(r,e,t)},ET=(r,e,t)=>{r.type.precision!==yt.Precision.HALF?zt(r,e,t):gh(r,e,t)},UT=(r,e,t)=>{r.type.unit===yt.DateUnit.DAY?mh(r,e,t):_h(r,e,t)},wh=({values:r},e,t)=>Yu(r,e*2,t/1e3),Th=({values:r},e,t)=>Yu(r,e*2,t),Bh=({values:r},e,t)=>IT(r,e*2,t),vh=({values:r},e,t)=>ST(r,e*2,t),MT=(r,e,t)=>{switch(r.type.unit){case yt.TimeUnit.SECOND:return wh(r,e,t);case yt.TimeUnit.MILLISECOND:return Th(r,e,t);case yt.TimeUnit.MICROSECOND:return Bh(r,e,t);case yt.TimeUnit.NANOSECOND:return vh(r,e,t)}},Ih=({values:r,stride:e},t,n)=>{r[e*t]=n},Sh=({values:r,stride:e},t,n)=>{r[e*t]=n},Oh=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Ah=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},PT=(r,e,t)=>{switch(r.type.unit){case yt.TimeUnit.SECOND:return Ih(r,e,t);case yt.TimeUnit.MILLISECOND:return Sh(r,e,t);case yt.TimeUnit.MICROSECOND:return Oh(r,e,t);case yt.TimeUnit.NANOSECOND:return Ah(r,e,t)}},VT=({values:r},e,t)=>{r.set(t.subarray(0,4),4*e)},NT=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets;for(let o=-1,a=i[e],u=i[e+1];a<u;)n.set(a++,t.get(++o))},kT=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets,o=t instanceof Map?[...t]:Object.entries(t);for(let a=-1,u=i[e],f=i[e+1];u<f;)n.set(u++,o[++a])},LT=(r,e)=>(t,n,i)=>t&&t.set(r,e[i]),xT=(r,e)=>(t,n,i)=>t&&t.set(r,e.get(i)),CT=(r,e)=>(t,n,i)=>t&&t.set(r,e.get(n.name)),jT=(r,e)=>(t,n,i)=>t&&t.set(r,e[n.name]),qT=(r,e,t)=>{let n=t instanceof Map?CT(e,t):t instanceof _T.Vector?xT(e,t):Array.isArray(t)?LT(e,t):jT(e,t);r.type.children.forEach((i,o)=>n(r.getChildAt(o),i,o))},WT=(r,e,t)=>{r.type.mode===yt.UnionMode.Dense?Dh(r,e,t):Fh(r,e,t)},Dh=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(r.valueOffsets[e],t)},Fh=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(e,t)},zT=(r,e,t)=>{let n=r.getKey(e);n!==null&&r.setValue(n,t)},YT=(r,e,t)=>{r.type.unit===yt.IntervalUnit.DAY_TIME?Rh(r,e,t):Eh(r,e,t)},Rh=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Eh=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},HT=(r,e,t)=>{let n=r.getChildAt(0),{stride:i}=r;for(let o=-1,a=e*i;++o<i;)n.set(a+o,t.get(o))};q.prototype.visitBool=OT;q.prototype.visitInt=RT;q.prototype.visitInt8=zt;q.prototype.visitInt16=zt;q.prototype.visitInt32=zt;q.prototype.visitInt64=Hu;q.prototype.visitUint8=zt;q.prototype.visitUint16=zt;q.prototype.visitUint32=zt;q.prototype.visitUint64=Hu;q.prototype.visitFloat=ET;q.prototype.visitFloat16=gh;q.prototype.visitFloat32=zt;q.prototype.visitFloat64=zt;q.prototype.visitUtf8=FT;q.prototype.visitBinary=DT;q.prototype.visitFixedSizeBinary=AT;q.prototype.visitDate=UT;q.prototype.visitDateDay=mh;q.prototype.visitDateMillisecond=_h;q.prototype.visitTimestamp=MT;q.prototype.visitTimestampSecond=wh;q.prototype.visitTimestampMillisecond=Th;q.prototype.visitTimestampMicrosecond=Bh;q.prototype.visitTimestampNanosecond=vh;q.prototype.visitTime=PT;q.prototype.visitTimeSecond=Ih;q.prototype.visitTimeMillisecond=Sh;q.prototype.visitTimeMicrosecond=Oh;q.prototype.visitTimeNanosecond=Ah;q.prototype.visitDecimal=VT;q.prototype.visitList=NT;q.prototype.visitStruct=qT;q.prototype.visitUnion=WT;q.prototype.visitDenseUnion=Dh;q.prototype.visitSparseUnion=Fh;q.prototype.visitDictionary=zT;q.prototype.visitInterval=YT;q.prototype.visitIntervalDayTime=Rh;q.prototype.visitIntervalYearMonth=Eh;q.prototype.visitFixedSizeList=HT;q.prototype.visitMap=kT;Cn.instance=new q});var Uh=w(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.instance=jn.GetBuilderCtor=void 0;var GT=ze(),$T=co(),JT=gu(),$u=Tu(),KT=Bu(),QT=Iu(),XT=Su(),ZT=ju(),Io=Ou(),Ju=Eu(),cr=Du(),eB=Cu(),tB=qu(),rB=wu(),nB=Wu(),Ci=Ru(),ji=Fu(),Ku=zu(),iB=fo(),Qu=class extends GT.Visitor{visitNull(){return rB.NullBuilder}visitBool(){return JT.BoolBuilder}visitInt(){return cr.IntBuilder}visitInt8(){return cr.Int8Builder}visitInt16(){return cr.Int16Builder}visitInt32(){return cr.Int32Builder}visitInt64(){return cr.Int64Builder}visitUint8(){return cr.Uint8Builder}visitUint16(){return cr.Uint16Builder}visitUint32(){return cr.Uint32Builder}visitUint64(){return cr.Uint64Builder}visitFloat(){return Io.FloatBuilder}visitFloat16(){return Io.Float16Builder}visitFloat32(){return Io.Float32Builder}visitFloat64(){return Io.Float64Builder}visitUtf8(){return iB.Utf8Builder}visitBinary(){return $T.BinaryBuilder}visitFixedSizeBinary(){return XT.FixedSizeBinaryBuilder}visitDate(){return $u.DateBuilder}visitDateDay(){return $u.DateDayBuilder}visitDateMillisecond(){return $u.DateMillisecondBuilder}visitTimestamp(){return Ci.TimestampBuilder}visitTimestampSecond(){return Ci.TimestampSecondBuilder}visitTimestampMillisecond(){return Ci.TimestampMillisecondBuilder}visitTimestampMicrosecond(){return Ci.TimestampMicrosecondBuilder}visitTimestampNanosecond(){return Ci.TimestampNanosecondBuilder}visitTime(){return ji.TimeBuilder}visitTimeSecond(){return ji.TimeSecondBuilder}visitTimeMillisecond(){return ji.TimeMillisecondBuilder}visitTimeMicrosecond(){return ji.TimeMicrosecondBuilder}visitTimeNanosecond(){return ji.TimeNanosecondBuilder}visitDecimal(){return KT.DecimalBuilder}visitList(){return eB.ListBuilder}visitStruct(){return nB.StructBuilder}visitUnion(){return Ku.UnionBuilder}visitDenseUnion(){return Ku.DenseUnionBuilder}visitSparseUnion(){return Ku.SparseUnionBuilder}visitDictionary(){return QT.DictionaryBuilder}visitInterval(){return Ju.IntervalBuilder}visitIntervalDayTime(){return Ju.IntervalDayTimeBuilder}visitIntervalYearMonth(){return Ju.IntervalYearMonthBuilder}visitFixedSizeList(){return ZT.FixedSizeListBuilder}visitMap(){return tB.MapBuilder}};jn.GetBuilderCtor=Qu;jn.instance=new Qu});var Oo=w(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.DenseUnionBuilder=v.SparseUnionBuilder=v.UnionBuilder=v.StructBuilder=v.MapBuilder=v.FixedSizeListBuilder=v.ListBuilder=v.BinaryBuilder=v.Utf8Builder=v.IntervalYearMonthBuilder=v.IntervalDayTimeBuilder=v.IntervalBuilder=v.TimestampNanosecondBuilder=v.TimestampMicrosecondBuilder=v.TimestampMillisecondBuilder=v.TimestampSecondBuilder=v.TimestampBuilder=v.TimeNanosecondBuilder=v.TimeMicrosecondBuilder=v.TimeMillisecondBuilder=v.TimeSecondBuilder=v.TimeBuilder=v.Uint64Builder=v.Uint32Builder=v.Uint16Builder=v.Uint8Builder=v.Int64Builder=v.Int32Builder=v.Int16Builder=v.Int8Builder=v.IntBuilder=v.Float64Builder=v.Float32Builder=v.Float16Builder=v.FloatBuilder=v.FixedSizeBinaryBuilder=v.DictionaryBuilder=v.DecimalBuilder=v.DateMillisecondBuilder=v.DateDayBuilder=v.DateBuilder=v.NullBuilder=v.BoolBuilder=v.Builder=void 0;var sB=we();Object.defineProperty(v,"Builder",{enumerable:!0,get:function(){return sB.Builder}});var oB=gu();Object.defineProperty(v,"BoolBuilder",{enumerable:!0,get:function(){return oB.BoolBuilder}});var aB=wu();Object.defineProperty(v,"NullBuilder",{enumerable:!0,get:function(){return aB.NullBuilder}});var Xu=Tu();Object.defineProperty(v,"DateBuilder",{enumerable:!0,get:function(){return Xu.DateBuilder}});Object.defineProperty(v,"DateDayBuilder",{enumerable:!0,get:function(){return Xu.DateDayBuilder}});Object.defineProperty(v,"DateMillisecondBuilder",{enumerable:!0,get:function(){return Xu.DateMillisecondBuilder}});var uB=Bu();Object.defineProperty(v,"DecimalBuilder",{enumerable:!0,get:function(){return uB.DecimalBuilder}});var cB=Iu();Object.defineProperty(v,"DictionaryBuilder",{enumerable:!0,get:function(){return cB.DictionaryBuilder}});var lB=Su();Object.defineProperty(v,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return lB.FixedSizeBinaryBuilder}});var So=Ou();Object.defineProperty(v,"FloatBuilder",{enumerable:!0,get:function(){return So.FloatBuilder}});Object.defineProperty(v,"Float16Builder",{enumerable:!0,get:function(){return So.Float16Builder}});Object.defineProperty(v,"Float32Builder",{enumerable:!0,get:function(){return So.Float32Builder}});Object.defineProperty(v,"Float64Builder",{enumerable:!0,get:function(){return So.Float64Builder}});var lr=Du();Object.defineProperty(v,"IntBuilder",{enumerable:!0,get:function(){return lr.IntBuilder}});Object.defineProperty(v,"Int8Builder",{enumerable:!0,get:function(){return lr.Int8Builder}});Object.defineProperty(v,"Int16Builder",{enumerable:!0,get:function(){return lr.Int16Builder}});Object.defineProperty(v,"Int32Builder",{enumerable:!0,get:function(){return lr.Int32Builder}});Object.defineProperty(v,"Int64Builder",{enumerable:!0,get:function(){return lr.Int64Builder}});Object.defineProperty(v,"Uint8Builder",{enumerable:!0,get:function(){return lr.Uint8Builder}});Object.defineProperty(v,"Uint16Builder",{enumerable:!0,get:function(){return lr.Uint16Builder}});Object.defineProperty(v,"Uint32Builder",{enumerable:!0,get:function(){return lr.Uint32Builder}});Object.defineProperty(v,"Uint64Builder",{enumerable:!0,get:function(){return lr.Uint64Builder}});var qi=Fu();Object.defineProperty(v,"TimeBuilder",{enumerable:!0,get:function(){return qi.TimeBuilder}});Object.defineProperty(v,"TimeSecondBuilder",{enumerable:!0,get:function(){return qi.TimeSecondBuilder}});Object.defineProperty(v,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return qi.TimeMillisecondBuilder}});Object.defineProperty(v,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return qi.TimeMicrosecondBuilder}});Object.defineProperty(v,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return qi.TimeNanosecondBuilder}});var Wi=Ru();Object.defineProperty(v,"TimestampBuilder",{enumerable:!0,get:function(){return Wi.TimestampBuilder}});Object.defineProperty(v,"TimestampSecondBuilder",{enumerable:!0,get:function(){return Wi.TimestampSecondBuilder}});Object.defineProperty(v,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return Wi.TimestampMillisecondBuilder}});Object.defineProperty(v,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return Wi.TimestampMicrosecondBuilder}});Object.defineProperty(v,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return Wi.TimestampNanosecondBuilder}});var Zu=Eu();Object.defineProperty(v,"IntervalBuilder",{enumerable:!0,get:function(){return Zu.IntervalBuilder}});Object.defineProperty(v,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return Zu.IntervalDayTimeBuilder}});Object.defineProperty(v,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return Zu.IntervalYearMonthBuilder}});var dB=fo();Object.defineProperty(v,"Utf8Builder",{enumerable:!0,get:function(){return dB.Utf8Builder}});var fB=co();Object.defineProperty(v,"BinaryBuilder",{enumerable:!0,get:function(){return fB.BinaryBuilder}});var hB=Cu();Object.defineProperty(v,"ListBuilder",{enumerable:!0,get:function(){return hB.ListBuilder}});var pB=ju();Object.defineProperty(v,"FixedSizeListBuilder",{enumerable:!0,get:function(){return pB.FixedSizeListBuilder}});var yB=qu();Object.defineProperty(v,"MapBuilder",{enumerable:!0,get:function(){return yB.MapBuilder}});var bB=Wu();Object.defineProperty(v,"StructBuilder",{enumerable:!0,get:function(){return bB.StructBuilder}});var ec=zu();Object.defineProperty(v,"UnionBuilder",{enumerable:!0,get:function(){return ec.UnionBuilder}});Object.defineProperty(v,"SparseUnionBuilder",{enumerable:!0,get:function(){return ec.SparseUnionBuilder}});Object.defineProperty(v,"DenseUnionBuilder",{enumerable:!0,get:function(){return ec.DenseUnionBuilder}});var tc=le(),mB=fo(),_B=we(),Mh=Gu(),Ph=Uh();_B.Builder.new=Vh;function Vh(r){let e=r.type,t=new(Ph.instance.getVisitFn(e)())(r);if(e.children&&e.children.length>0){let n=r.children||[],i={nullValues:r.nullValues},o=Array.isArray(n)?(a,u)=>n[u]||i:({name:a})=>n[a]||i;e.children.forEach((a,u)=>{let{type:f}=a,s=o(a,u);t.children.push(Vh({...s,type:f}))})}return t}Object.keys(tc.Type).map(r=>tc.Type[r]).filter(r=>typeof r=="number"&&r!==tc.Type.NONE).forEach(r=>{let e=Ph.instance.visit(r);e.prototype._setValue=Mh.instance.getVisitFn(r)});mB.Utf8Builder.prototype._setValue=Mh.instance.visitBinary});var kh=w(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.org=void 0;var rc=In(),Nh;(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,this}static getRootAsFooter(s,c){return(c||new u).__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):rc.org.apache.arrow.flatbuf.MetadataVersion.V1}schema(s){let c=this.bb.__offset(this.bb_pos,6);return c?(s||new rc.org.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+c),this.bb):null}dictionaries(s,c){let _=this.bb.__offset(this.bb_pos,8);return _?(c||new r.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+_)+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,c){let _=this.bb.__offset(this.bb_pos,10);return _?(c||new r.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+_)+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,c){s.addFieldInt16(0,c,rc.org.apache.arrow.flatbuf.MetadataVersion.V1)}static addSchema(s,c){s.addFieldOffset(1,c,0)}static addDictionaries(s,c){s.addFieldOffset(2,c,0)}static startDictionariesVector(s,c){s.startVector(24,c,8)}static addRecordBatches(s,c){s.addFieldOffset(3,c,0)}static startRecordBatchesVector(s,c){s.startVector(24,c,8)}static endFooter(s){return s.endObject()}static finishFooterBuffer(s,c){s.finish(c)}static createFooter(s,c,_,U,J){return u.startFooter(s),u.addVersion(s,c),u.addSchema(s,_),u.addDictionaries(s,U),u.addRecordBatches(s,J),u.endFooter(s)}}a.Footer=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(Nh=sn.org||(sn.org={}));(function(r){var e;(function(t){var n;(function(i){var o;(function(a){class u{constructor(){this.bb=null,this.bb_pos=0}__init(s,c){return this.bb_pos=s,this.bb=c,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,c,_,U){return s.prep(8,24),s.writeInt64(U),s.pad(4),s.writeInt32(_),s.writeInt64(c),s.offset()}}a.Block=u})(o=i.flatbuf||(i.flatbuf={}))})(n=t.arrow||(t.arrow={}))})(e=r.apache||(r.apache={}))})(Nh=sn.org||(sn.org={}))});var sc=w(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.FileBlock=qn.Footer=void 0;var Lh=kh(),nc=gn(),xh=nc.flatbuffers.Long,gB=nc.flatbuffers.Builder,wB=nc.flatbuffers.ByteBuffer,TB=Lh.org.apache.arrow.flatbuf.Block,Yt=Lh.org.apache.arrow.flatbuf.Footer,Ch=xe(),jh=le(),BB=Se(),ic=class{constructor(e,t=jh.MetadataVersion.V4,n,i){this.schema=e,this.version=t,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}static decode(e){e=new wB(BB.toUint8Array(e));let t=Yt.getRootAsFooter(e),n=Ch.Schema.decode(t.schema());return new qh(n,t)}static encode(e){let t=new gB,n=Ch.Schema.encode(t,e.schema);Yt.startRecordBatchesVector(t,e.numRecordBatches),[...e.recordBatches()].slice().reverse().forEach(a=>Rr.encode(t,a));let i=t.endVector();Yt.startDictionariesVector(t,e.numDictionaries),[...e.dictionaryBatches()].slice().reverse().forEach(a=>Rr.encode(t,a));let o=t.endVector();return Yt.startFooter(t),Yt.addSchema(t,n),Yt.addVersion(t,jh.MetadataVersion.V4),Yt.addRecordBatches(t,i),Yt.addDictionaries(t,o),Yt.finishFooterBuffer(t,Yt.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t<n;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,n=this.numDictionaries;++t<n;)(e=this.getDictionaryBatch(t))&&(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}};qn.Footer=ic;var qh=class extends ic{constructor(e,t){super(e,t.version());this._footer=t}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let t=this._footer.recordBatches(e);if(t)return Rr.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return Rr.decode(t)}return null}},Rr=class{constructor(e,t,n){this.metaDataLength=e,this.offset=typeof n=="number"?n:n.low,this.bodyLength=typeof t=="number"?t:t.low}static decode(e){return new Rr(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:n}=t,i=new xh(t.offset,0),o=new xh(t.bodyLength,0);return TB.createBlock(e,i,n,o)}};qn.FileBlock=Rr});var Pr=w(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.AsyncByteStream=Mr.ByteStream=Mr.AsyncByteQueue=void 0;var Er=Si(),Wh=Xr(),zi=Bn(),oc=Se(),Wn=Je(),ac=class extends zi.AsyncQueue{write(e){if((e=oc.toUint8Array(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Wh.decodeUtf8(this.toUint8Array(!0)):this.toUint8Array(!1).then(Wh.decodeUtf8)}toUint8Array(e=!1){return e?oc.joinUint8Arrays(this._values)[0]:(async()=>{let t=[],n=0;for await(let i of this)t.push(i),n+=i.byteLength;return oc.joinUint8Arrays(t,n)[0]})()}};Mr.AsyncByteQueue=ac;var zh=class{constructor(e){e&&(this.source=new Yh(Er.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)}};Mr.ByteStream=zh;var Ao=class{constructor(e){e instanceof Ao?this.source=e.source:e instanceof ac?this.source=new Ur(Er.default.fromAsyncIterable(e)):Wn.isReadableNodeStream(e)?this.source=new Ur(Er.default.fromNodeStream(e)):Wn.isReadableDOMStream(e)?this.source=new Ur(Er.default.fromDOMStream(e)):Wn.isFetchResponse(e)?this.source=new Ur(Er.default.fromDOMStream(e.body)):Wn.isIterable(e)?this.source=new Ur(Er.default.fromIterable(e)):Wn.isPromise(e)?this.source=new Ur(Er.default.fromAsyncIterable(e)):Wn.isAsyncIterable(e)&&(this.source=new Ur(Er.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)}};Mr.AsyncByteStream=Ao;var Yh=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||zi.ITERATOR_DONE)}return(e){return Object.create(this.source.return&&this.source.return(e)||zi.ITERATOR_DONE)}},Ur=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}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,t="read"){return await this.source.next({cmd:t,size:e})}async throw(e){let t=this.source.throw&&await this.source.throw(e)||zi.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)}async return(e){let t=this.source.return&&await this.source.return(e)||zi.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)}}});var uc=w(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.AsyncRandomAccessFile=zn.RandomAccessFile=void 0;var Hh=Pr(),vB=Se(),Gh=class extends Hh.ByteStream{constructor(e,t){super();this.position=0,this.buffer=vB.toUint8Array(e),this.size=typeof t=="undefined"?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:t,size:n,position:i}=this;return t&&i<n?(typeof e!="number"&&(e=1/0),this.position=Math.min(n,i+Math.min(n-i,e)),t.subarray(i,this.position)):null}readAt(e,t){let n=this.buffer,i=Math.min(this.size,e+t);return n?n.subarray(e,i):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}};zn.RandomAccessFile=Gh;var $h=class extends Hh.AsyncByteStream{constructor(e,t){super();this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=(async()=>{this.size=(await e.stat()).size,delete this._pending})()}async readInt32(e){let{buffer:t,byteOffset:n}=await this.readAt(e,4);return new DataView(t,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:t,size:n,position:i}=this;if(t&&i<n){typeof e!="number"&&(e=1/0);let o=i,a=0,u=0,f=Math.min(n,o+Math.min(n-o,e)),s=new Uint8Array(Math.max(0,(this.position=f)-o));for(;(o+=u)<f&&(a+=u)<s.byteLength;)({bytesRead:u}=await t.read(s,a,s.byteLength-a,o));return s}return null}async readAt(e,t){this._pending&&await this._pending;let{_handle:n,size:i}=this;if(n&&e+t<i){let o=Math.min(i,e+t),a=new Uint8Array(o-e);return(await n.read(a,0,t,e)).buffer}return new Uint8Array(t)}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}}};zn.AsyncRandomAccessFile=$h});var lc=w(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.Int128=Ht.Int64=Ht.Uint64=Ht.BaseInt64=void 0;var IB=1<<16;function Yn(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var Hn=8,cc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Do=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),i=t[3]*n[3];this.buffer[0]=i&65535;let o=i>>>16;return i=t[2]*n[3],o+=i,i=t[3]*n[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?IB:0,this.buffer[1]+=o>>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}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`${Yn(this.buffer[1])} ${Yn(this.buffer[0])}`}};Ht.BaseInt64=Do;var oe=class extends Do{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return oe.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return oe.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.length,i=new oe(t);for(let o=0;o<n;){let a=Hn<n-o?Hn:n-o,u=new oe(new Uint32Array([parseInt(e.substr(o,a),10),0])),f=new oe(new Uint32Array([cc[a],0]));i.times(f),i.plus(u),o+=a}return i}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)oe.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new oe(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new oe(new Uint32Array(e.buffer)).plus(t)}};Ht.Uint64=oe;var ut=class extends Do{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 t=this.buffer[1]<<0,n=e.buffer[1]<<0;return t<n||t===n&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return ut.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return ut.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.startsWith("-"),i=e.length,o=new ut(t);for(let a=n?1:0;a<i;){let u=Hn<i-a?Hn:i-a,f=new ut(new Uint32Array([parseInt(e.substr(a,u),10),0])),s=new ut(new Uint32Array([cc[u],0]));o.times(s),o.plus(f),a+=u}return n?o.negate():o}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)ut.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new ut(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new ut(new Uint32Array(e.buffer)).plus(t)}};Ht.Int64=ut;var Dt=class{constructor(e){this.buffer=e}high(){return new ut(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new ut(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 t=new oe(new Uint32Array([this.buffer[3],0])),n=new oe(new Uint32Array([this.buffer[2],0])),i=new oe(new Uint32Array([this.buffer[1],0])),o=new oe(new Uint32Array([this.buffer[0],0])),a=new oe(new Uint32Array([e.buffer[3],0])),u=new oe(new Uint32Array([e.buffer[2],0])),f=new oe(new Uint32Array([e.buffer[1],0])),s=new oe(new Uint32Array([e.buffer[0],0])),c=oe.multiply(o,s);this.buffer[0]=c.low();let _=new oe(new Uint32Array([c.high(),0]));return c=oe.multiply(i,s),_.plus(c),c=oe.multiply(o,f),_.plus(c),this.buffer[1]=_.low(),this.buffer[3]=_.lessThan(c)?1:0,this.buffer[2]=_.high(),new oe(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(oe.multiply(n,s)).plus(oe.multiply(i,f)).plus(oe.multiply(o,u)),this.buffer[3]+=oe.multiply(t,s).plus(oe.multiply(n,f)).plus(oe.multiply(i,u)).plus(oe.multiply(o,a)).low(),this}plus(e){let t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${Yn(this.buffer[3])} ${Yn(this.buffer[2])} ${Yn(this.buffer[1])} ${Yn(this.buffer[0])}`}static multiply(e,t){return new Dt(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new Dt(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return Dt.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return Dt.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let n=e.startsWith("-"),i=e.length,o=new Dt(t);for(let a=n?1:0;a<i;){let u=Hn<i-a?Hn:i-a,f=new Dt(new Uint32Array([parseInt(e.substr(a,u),10),0,0,0])),s=new Dt(new Uint32Array([cc[u],0,0,0]));o.times(s),o.plus(f),a+=u}return n?o.negate():o}static convertArray(e){let t=new Uint32Array(e.length*4);for(let n=-1,i=e.length;++n<i;)Dt.from(e[n],new Uint32Array(t.buffer,t.byteOffset+4*4*n,4));return t}};Ht.Int128=Dt});var Xh=w(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.JSONVectorLoader=Gn.VectorLoader=void 0;var Pe=Ot(),SB=xe(),dr=se(),OB=ze(),Jh=xt(),AB=Xr(),Fo=lc(),Kh=le(),Gt=Se(),dc=class extends OB.Visitor{constructor(e,t,n,i){super();this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=e,this.nodes=t,this.buffers=n,this.dictionaries=i}visit(e){return super.visit(e instanceof SB.Field?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return Pe.Data.Null(e,0,t)}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Bool(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Int(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Float(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Utf8(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.readData(e))}visitBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Binary(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.readData(e))}visitFixedSizeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.FixedSizeBinary(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Date(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Timestamp(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Time(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Decimal(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.List(e,0,t,n,this.readNullBitmap(e,n),this.readOffsets(e),this.visit(e.children[0]))}visitStruct(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Struct(e,0,t,n,this.readNullBitmap(e,n),this.visitMany(e.children))}visitUnion(e){return e.mode===Kh.UnionMode.Sparse?this.visitSparseUnion(e):this.visitDenseUnion(e)}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Union(e,0,t,n,this.readNullBitmap(e,n),this.readTypeIds(e),this.readOffsets(e),this.visitMany(e.children))}visitSparseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Union(e,0,t,n,this.readNullBitmap(e,n),this.readTypeIds(e),this.visitMany(e.children))}visitDictionary(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Dictionary(e,0,t,n,this.readNullBitmap(e,n),this.readData(e.indices),this.readDictionary(e))}visitInterval(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Interval(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.FixedSizeList(e,0,t,n,this.readNullBitmap(e,n),this.visit(e.children[0]))}visitMap(e,{length:t,nullCount:n}=this.nextFieldNode()){return Pe.Data.Map(e,0,t,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,t,n=this.nextBufferRange()){return t>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readDictionary(e){return this.dictionaries.get(e.id)}};Gn.VectorLoader=dc;var Qh=class extends dc{constructor(e,t,n,i){super(new Uint8Array(0),t,n,i);this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array(0):Jh.packBools(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return Gt.toArrayBufferView(Uint8Array,Gt.toArrayBufferView(Int32Array,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return Gt.toArrayBufferView(Uint8Array,Gt.toArrayBufferView(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return dr.DataType.isTimestamp(e)||(dr.DataType.isInt(e)||dr.DataType.isTime(e))&&e.bitWidth===64||dr.DataType.isDate(e)&&e.unit===Kh.DateUnit.MILLISECOND?Gt.toArrayBufferView(Uint8Array,Fo.Int64.convertArray(n[t])):dr.DataType.isDecimal(e)?Gt.toArrayBufferView(Uint8Array,Fo.Int128.convertArray(n[t])):dr.DataType.isBinary(e)||dr.DataType.isFixedSizeBinary(e)?DB(n[t]):dr.DataType.isBool(e)?Jh.packBools(n[t]):dr.DataType.isUtf8(e)?AB.encodeUtf8(n[t].join("")):Gt.toArrayBufferView(Uint8Array,Gt.toArrayBufferView(e.ArrayType,n[t].map(i=>+i)))}};Gn.JSONVectorLoader=Qh;function DB(r){let e=r.join(""),t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=parseInt(e.substr(n,2),16);return t}});var sp=w(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.instance=Jn.TypeAssembler=void 0;var FB=gn(),RB=FB.flatbuffers.Long,Ce=In(),EB=ze(),Zh=Ce.org.apache.arrow.flatbuf.Null,Ro=Ce.org.apache.arrow.flatbuf.Int,fc=Ce.org.apache.arrow.flatbuf.FloatingPoint,ep=Ce.org.apache.arrow.flatbuf.Binary,tp=Ce.org.apache.arrow.flatbuf.Bool,rp=Ce.org.apache.arrow.flatbuf.Utf8,Eo=Ce.org.apache.arrow.flatbuf.Decimal,hc=Ce.org.apache.arrow.flatbuf.Date,Uo=Ce.org.apache.arrow.flatbuf.Time,Mo=Ce.org.apache.arrow.flatbuf.Timestamp,pc=Ce.org.apache.arrow.flatbuf.Interval,np=Ce.org.apache.arrow.flatbuf.List,ip=Ce.org.apache.arrow.flatbuf.Struct_,$n=Ce.org.apache.arrow.flatbuf.Union,Yi=Ce.org.apache.arrow.flatbuf.DictionaryEncoding,yc=Ce.org.apache.arrow.flatbuf.FixedSizeBinary,bc=Ce.org.apache.arrow.flatbuf.FixedSizeList,mc=Ce.org.apache.arrow.flatbuf.Map,_c=class extends EB.Visitor{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Zh.startNull(t),Zh.endNull(t)}visitInt(e,t){return Ro.startInt(t),Ro.addBitWidth(t,e.bitWidth),Ro.addIsSigned(t,e.isSigned),Ro.endInt(t)}visitFloat(e,t){return fc.startFloatingPoint(t),fc.addPrecision(t,e.precision),fc.endFloatingPoint(t)}visitBinary(e,t){return ep.startBinary(t),ep.endBinary(t)}visitBool(e,t){return tp.startBool(t),tp.endBool(t)}visitUtf8(e,t){return rp.startUtf8(t),rp.endUtf8(t)}visitDecimal(e,t){return Eo.startDecimal(t),Eo.addScale(t,e.scale),Eo.addPrecision(t,e.precision),Eo.endDecimal(t)}visitDate(e,t){return hc.startDate(t),hc.addUnit(t,e.unit),hc.endDate(t)}visitTime(e,t){return Uo.startTime(t),Uo.addUnit(t,e.unit),Uo.addBitWidth(t,e.bitWidth),Uo.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return Mo.startTimestamp(t),Mo.addUnit(t,e.unit),n!==void 0&&Mo.addTimezone(t,n),Mo.endTimestamp(t)}visitInterval(e,t){return pc.startInterval(t),pc.addUnit(t,e.unit),pc.endInterval(t)}visitList(e,t){return np.startList(t),np.endList(t)}visitStruct(e,t){return ip.startStruct_(t),ip.endStruct_(t)}visitUnion(e,t){$n.startTypeIdsVector(t,e.typeIds.length);let n=$n.createTypeIdsVector(t,e.typeIds);return $n.startUnion(t),$n.addMode(t,e.mode),$n.addTypeIds(t,n),$n.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Yi.startDictionaryEncoding(t),Yi.addId(t,new RB(e.id,0)),Yi.addIsOrdered(t,e.isOrdered),n!==void 0&&Yi.addIndexType(t,n),Yi.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return yc.startFixedSizeBinary(t),yc.addByteWidth(t,e.byteWidth),yc.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return bc.startFixedSizeList(t),bc.addListSize(t,e.listSize),bc.endFixedSizeList(t)}visitMap(e,t){return mc.startMap(t),mc.addKeysSorted(t,e.keysSorted),mc.endMap(t)}};Jn.TypeAssembler=_c;Jn.instance=new _c});var fp=w($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.fieldFromJSON=$t.dictionaryBatchFromJSON=$t.recordBatchFromJSON=$t.schemaFromJSON=void 0;var Kn=xe(),pe=se(),on=an(),Qn=le();function UB(r,e=new Map){return new Kn.Schema(PB(r,e),Po(r.customMetadata),e)}$t.schemaFromJSON=UB;function op(r){return new on.RecordBatch(r.count,up(r.columns),cp(r.columns))}$t.recordBatchFromJSON=op;function MB(r){return new on.DictionaryBatch(op(r.data),r.id,r.isDelta)}$t.dictionaryBatchFromJSON=MB;function PB(r,e){return(r.fields||[]).filter(Boolean).map(t=>Kn.Field.fromJSON(t,e))}function ap(r,e){return(r.children||[]).filter(Boolean).map(t=>Kn.Field.fromJSON(t,e))}function up(r){return(r||[]).reduce((e,t)=>[...e,new on.FieldNode(t.count,VB(t.VALIDITY)),...up(t.children)],[])}function cp(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let i=r[t];i.VALIDITY&&e.push(new on.BufferRegion(e.length,i.VALIDITY.length)),i.TYPE&&e.push(new on.BufferRegion(e.length,i.TYPE.length)),i.OFFSET&&e.push(new on.BufferRegion(e.length,i.OFFSET.length)),i.DATA&&e.push(new on.BufferRegion(e.length,i.DATA.length)),e=cp(i.children,e)}return e}function VB(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function NB(r,e){let t,n,i,o,a,u;return!e||!(o=r.dictionary)?(a=dp(r,ap(r,e)),i=new Kn.Field(r.name,a,r.nullable,Po(r.customMetadata))):e.has(t=o.id)?(n=(n=o.indexType)?lp(n):new pe.Int32,u=new pe.Dictionary(e.get(t),n,t,o.isOrdered),i=new Kn.Field(r.name,u,r.nullable,Po(r.customMetadata))):(n=(n=o.indexType)?lp(n):new pe.Int32,e.set(t,a=dp(r,ap(r,e))),u=new pe.Dictionary(a,n,t,o.isOrdered),i=new Kn.Field(r.name,u,r.nullable,Po(r.customMetadata))),i||null}$t.fieldFromJSON=NB;function Po(r){return new Map(Object.entries(r||{}))}function lp(r){return new pe.Int(r.isSigned,r.bitWidth)}function dp(r,e){let t=r.type.name;switch(t){case"NONE":return new pe.Null;case"null":return new pe.Null;case"binary":return new pe.Binary;case"utf8":return new pe.Utf8;case"bool":return new pe.Bool;case"list":return new pe.List((e||[])[0]);case"struct":return new pe.Struct(e||[]);case"struct_":return new pe.Struct(e||[])}switch(t){case"int":{let n=r.type;return new pe.Int(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new pe.Float(Qn.Precision[n.precision])}case"decimal":{let n=r.type;return new pe.Decimal(n.scale,n.precision)}case"date":{let n=r.type;return new pe.Date_(Qn.DateUnit[n.unit])}case"time":{let n=r.type;return new pe.Time(Qn.TimeUnit[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new pe.Timestamp(Qn.TimeUnit[n.unit],n.timezone)}case"interval":{let n=r.type;return new pe.Interval(Qn.IntervalUnit[n.unit])}case"union":{let n=r.type;return new pe.Union(Qn.UnionMode[n.mode],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new pe.FixedSizeBinary(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new pe.FixedSizeList(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new pe.Map_((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}});var an=w(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.FieldNode=mt.BufferRegion=mt.DictionaryBatch=mt.RecordBatch=mt.Message=void 0;var gc=gn(),He=In(),Vo=Ja(),je=xe(),kB=Se(),Te=le(),wc=sp(),No=fp(),un=gc.flatbuffers.Long,LB=gc.flatbuffers.Builder,xB=gc.flatbuffers.ByteBuffer,Ve=He.org.apache.arrow.flatbuf.Type,Ft=He.org.apache.arrow.flatbuf.Field,fr=He.org.apache.arrow.flatbuf.Schema,CB=He.org.apache.arrow.flatbuf.Buffer,Vr=Vo.org.apache.arrow.flatbuf.Message,Nr=He.org.apache.arrow.flatbuf.KeyValue,jB=Vo.org.apache.arrow.flatbuf.FieldNode,hp=He.org.apache.arrow.flatbuf.Endianness,kr=Vo.org.apache.arrow.flatbuf.RecordBatch,Xn=Vo.org.apache.arrow.flatbuf.DictionaryBatch,ye=se(),Lr=class{constructor(e,t,n,i){this._version=t,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=typeof e=="number"?e:e.low}static fromJSON(e,t){let n=new Lr(0,Te.MetadataVersion.V4,t);return n._createHeader=qB(e,t),n}static decode(e){e=new xB(kB.toUint8Array(e));let t=Vr.getRootAsMessage(e),n=t.bodyLength(),i=t.version(),o=t.headerType(),a=new Lr(n,i,o);return a._createHeader=WB(t,o),a}static encode(e){let t=new LB,n=-1;return e.isSchema()?n=je.Schema.encode(t,e.header()):e.isRecordBatch()?n=bt.encode(t,e.header()):e.isDictionaryBatch()&&(n=Jt.encode(t,e.header())),Vr.startMessage(t),Vr.addVersion(t,Te.MetadataVersion.V4),Vr.addHeader(t,n),Vr.addHeaderType(t,e.headerType),Vr.addBodyLength(t,new un(e.bodyLength,0)),Vr.finishMessageBuffer(t,Vr.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof je.Schema)return new Lr(0,Te.MetadataVersion.V4,Te.MessageHeader.Schema,e);if(e instanceof bt)return new Lr(t,Te.MetadataVersion.V4,Te.MessageHeader.RecordBatch,e);if(e instanceof Jt)return new Lr(t,Te.MetadataVersion.V4,Te.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===Te.MessageHeader.Schema}isRecordBatch(){return this.headerType===Te.MessageHeader.RecordBatch}isDictionaryBatch(){return this.headerType===Te.MessageHeader.DictionaryBatch}};mt.Message=Lr;var bt=class{constructor(e,t,n){this._nodes=t,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}};mt.RecordBatch=bt;var Jt=class{constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=typeof t=="number"?t:t.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}};mt.DictionaryBatch=Jt;var cn=class{constructor(e,t){this.offset=typeof e=="number"?e:e.low,this.length=typeof t=="number"?t:t.low}};mt.BufferRegion=cn;var ln=class{constructor(e,t){this.length=typeof e=="number"?e:e.low,this.nullCount=typeof t=="number"?t:t.low}};mt.FieldNode=ln;function qB(r,e){return()=>{switch(e){case Te.MessageHeader.Schema:return je.Schema.fromJSON(r);case Te.MessageHeader.RecordBatch:return bt.fromJSON(r);case Te.MessageHeader.DictionaryBatch:return Jt.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${Te.MessageHeader[e]}, type: ${e} }`)}}function WB(r,e){return()=>{switch(e){case Te.MessageHeader.Schema:return je.Schema.decode(r.header(new fr));case Te.MessageHeader.RecordBatch:return bt.decode(r.header(new kr),r.version());case Te.MessageHeader.DictionaryBatch:return Jt.decode(r.header(new Xn),r.version())}throw new Error(`Unrecognized Message type: { name: ${Te.MessageHeader[e]}, type: ${e} }`)}}je.Field.encode=ev;je.Field.decode=XB;je.Field.fromJSON=No.fieldFromJSON;je.Schema.encode=ZB;je.Schema.decode=zB;je.Schema.fromJSON=No.schemaFromJSON;bt.encode=tv;bt.decode=YB;bt.fromJSON=No.recordBatchFromJSON;Jt.encode=rv;Jt.decode=HB;Jt.fromJSON=No.dictionaryBatchFromJSON;ln.encode=nv;ln.decode=$B;cn.encode=iv;cn.decode=GB;function zB(r,e=new Map){let t=QB(r,e);return new je.Schema(t,ko(r),e)}function YB(r,e=Te.MetadataVersion.V4){return new bt(r.length(),JB(r),KB(r,e))}function HB(r,e=Te.MetadataVersion.V4){return new Jt(bt.decode(r.data(),e),r.id(),r.isDelta())}function GB(r){return new cn(r.offset(),r.length())}function $B(r){return new ln(r.length(),r.nullCount())}function JB(r){let e=[];for(let t,n=-1,i=-1,o=r.nodesLength();++n<o;)(t=r.nodes(n))&&(e[++i]=ln.decode(t));return e}function KB(r,e){let t=[];for(let n,i=-1,o=-1,a=r.buffersLength();++i<a;)(n=r.buffers(i))&&(e<Te.MetadataVersion.V4&&(n.bb_pos+=8*(i+1)),t[++o]=cn.decode(n));return t}function QB(r,e){let t=[];for(let n,i=-1,o=-1,a=r.fieldsLength();++i<a;)(n=r.fields(i))&&(t[++o]=je.Field.decode(n,e));return t}function pp(r,e){let t=[];for(let n,i=-1,o=-1,a=r.childrenLength();++i<a;)(n=r.children(i))&&(t[++o]=je.Field.decode(n,e));return t}function XB(r,e){let t,n,i,o,a,u;return!e||!(u=r.dictionary())?(i=bp(r,pp(r,e)),n=new je.Field(r.name(),i,r.nullable(),ko(r))):e.has(t=u.id().low)?(o=(o=u.indexType())?yp(o):new ye.Int32,a=new ye.Dictionary(e.get(t),o,t,u.isOrdered()),n=new je.Field(r.name(),a,r.nullable(),ko(r))):(o=(o=u.indexType())?yp(o):new ye.Int32,e.set(t,i=bp(r,pp(r,e))),a=new ye.Dictionary(i,o,t,u.isOrdered()),n=new je.Field(r.name(),a,r.nullable(),ko(r))),n||null}function ko(r){let e=new Map;if(r)for(let t,n,i=-1,o=r.customMetadataLength()|0;++i<o;)(t=r.customMetadata(i))&&(n=t.key())!=null&&e.set(n,t.value());return e}function yp(r){return new ye.Int(r.isSigned(),r.bitWidth())}function bp(r,e){let t=r.typeType();switch(t){case Ve.NONE:return new ye.Null;case Ve.Null:return new ye.Null;case Ve.Binary:return new ye.Binary;case Ve.Utf8:return new ye.Utf8;case Ve.Bool:return new ye.Bool;case Ve.List:return new ye.List((e||[])[0]);case Ve.Struct_:return new ye.Struct(e||[])}switch(t){case Ve.Int:{let n=r.type(new He.org.apache.arrow.flatbuf.Int);return new ye.Int(n.isSigned(),n.bitWidth())}case Ve.FloatingPoint:{let n=r.type(new He.org.apache.arrow.flatbuf.FloatingPoint);return new ye.Float(n.precision())}case Ve.Decimal:{let n=r.type(new He.org.apache.arrow.flatbuf.Decimal);return new ye.Decimal(n.scale(),n.precision())}case Ve.Date:{let n=r.type(new He.org.apache.arrow.flatbuf.Date);return new ye.Date_(n.unit())}case Ve.Time:{let n=r.type(new He.org.apache.arrow.flatbuf.Time);return new ye.Time(n.unit(),n.bitWidth())}case Ve.Timestamp:{let n=r.type(new He.org.apache.arrow.flatbuf.Timestamp);return new ye.Timestamp(n.unit(),n.timezone())}case Ve.Interval:{let n=r.type(new He.org.apache.arrow.flatbuf.Interval);return new ye.Interval(n.unit())}case Ve.Union:{let n=r.type(new He.org.apache.arrow.flatbuf.Union);return new ye.Union(n.mode(),n.typeIdsArray()||[],e||[])}case Ve.FixedSizeBinary:{let n=r.type(new He.org.apache.arrow.flatbuf.FixedSizeBinary);return new ye.FixedSizeBinary(n.byteWidth())}case Ve.FixedSizeList:{let n=r.type(new He.org.apache.arrow.flatbuf.FixedSizeList);return new ye.FixedSizeList(n.listSize(),(e||[])[0])}case Ve.Map:{let n=r.type(new He.org.apache.arrow.flatbuf.Map);return new ye.Map_((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${Ve[t]}" (${t})`)}function ZB(r,e){let t=e.fields.map(o=>je.Field.encode(r,o));fr.startFieldsVector(r,t.length);let n=fr.createFieldsVector(r,t),i=e.metadata&&e.metadata.size>0?fr.createCustomMetadataVector(r,[...e.metadata].map(([o,a])=>{let u=r.createString(`${o}`),f=r.createString(`${a}`);return Nr.startKeyValue(r),Nr.addKey(r,u),Nr.addValue(r,f),Nr.endKeyValue(r)})):-1;return fr.startSchema(r),fr.addFields(r,n),fr.addEndianness(r,sv?hp.Little:hp.Big),i!==-1&&fr.addCustomMetadata(r,i),fr.endSchema(r)}function ev(r,e){let t=-1,n=-1,i=-1,o=e.type,a=e.typeId;ye.DataType.isDictionary(o)?(a=o.dictionary.typeId,i=wc.instance.visit(o,r),n=wc.instance.visit(o.dictionary,r)):n=wc.instance.visit(o,r);let u=(o.children||[]).map(c=>je.Field.encode(r,c)),f=Ft.createChildrenVector(r,u),s=e.metadata&&e.metadata.size>0?Ft.createCustomMetadataVector(r,[...e.metadata].map(([c,_])=>{let U=r.createString(`${c}`),J=r.createString(`${_}`);return Nr.startKeyValue(r),Nr.addKey(r,U),Nr.addValue(r,J),Nr.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),Ft.startField(r),Ft.addType(r,n),Ft.addTypeType(r,a),Ft.addChildren(r,f),Ft.addNullable(r,!!e.nullable),t!==-1&&Ft.addName(r,t),i!==-1&&Ft.addDictionary(r,i),s!==-1&&Ft.addCustomMetadata(r,s),Ft.endField(r)}function tv(r,e){let t=e.nodes||[],n=e.buffers||[];kr.startNodesVector(r,t.length),t.slice().reverse().forEach(a=>ln.encode(r,a));let i=r.endVector();kr.startBuffersVector(r,n.length),n.slice().reverse().forEach(a=>cn.encode(r,a));let o=r.endVector();return kr.startRecordBatch(r),kr.addLength(r,new un(e.length,0)),kr.addNodes(r,i),kr.addBuffers(r,o),kr.endRecordBatch(r)}function rv(r,e){let t=bt.encode(r,e.data);return Xn.startDictionaryBatch(r),Xn.addId(r,new un(e.id,0)),Xn.addIsDelta(r,e.isDelta),Xn.addData(r,t),Xn.endDictionaryBatch(r)}function nv(r,e){return jB.createFieldNode(r,new un(e.length,0),new un(e.nullCount,0))}function iv(r,e){return CB.createBuffer(r,new un(e.offset,0),new un(e.length,0))}var sv=function(){let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256}()});var xo=w(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.magicX2AndPadding=re.magicAndPadding=re.magicLength=re.checkForMagicArrowString=re.MAGIC=re.MAGIC_STR=re.PADDING=re.JSONMessageReader=re.AsyncMessageReader=re.MessageReader=void 0;var xr=le(),ov=gn(),mp=ov.flatbuffers.ByteBuffer,Hi=an(),av=Je(),uv=uc(),_p=Se(),Lo=Pr(),Rt=Bn(),Tc=r=>`Expected ${xr.MessageHeader[r]} Message in stream, but was null or length 0.`,Bc=r=>`Header pointer of flatbuffer-encoded ${xr.MessageHeader[r]} Message is null or length 0.`,gp=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,wp=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,vc=class{constructor(e){this.source=e instanceof Lo.ByteStream?e:new Lo.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?Rt.ITERATOR_DONE:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Tc(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=_p.toUint8Array(this.source.read(e));if(t.byteLength<e)throw new Error(wp(e,t.byteLength));return t.byteOffset%8==0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=xr.MessageHeader.Schema,n=this.readMessage(t),i=n&&n.header();if(e&&!i)throw new Error(Bc(t));return i}readMetadataLength(){let e=this.source.read(re.PADDING),t=e&&new mp(e),n=t&&t.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Rt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(gp(e,t.byteLength));return{done:!1,value:Hi.Message.decode(t)}}};re.MessageReader=vc;var Tp=class{constructor(e,t){this.source=e instanceof Lo.AsyncByteStream?e:av.isFileHandle(e)?new uv.AsyncRandomAccessFile(e,t):new Lo.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?Rt.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 t;if((t=await this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Tc(e));return t.value}async readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=_p.toUint8Array(await this.source.read(e));if(t.byteLength<e)throw new Error(wp(e,t.byteLength));return t.byteOffset%8==0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}async readSchema(e=!1){let t=xr.MessageHeader.Schema,n=await this.readMessage(t),i=n&&n.header();if(e&&!i)throw new Error(Bc(t));return i}async readMetadataLength(){let e=await this.source.read(re.PADDING),t=e&&new mp(e),n=t&&t.readInt32(0)||0;return{done:n===0,value:n}}async readMetadata(e){let t=await this.source.read(e);if(!t)return Rt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(gp(e,t.byteLength));return{done:!1,value:Hi.Message.decode(t)}}};re.AsyncMessageReader=Tp;var Bp=class extends vc{constructor(e){super(new Uint8Array(0));this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Rt.ArrowJSON?e:new Rt.ArrowJSON(e)}next(){let{_json:e}=this;if(!this._schema){this._schema=!0;let t=Hi.Message.fromJSON(e.schema,xr.MessageHeader.Schema);return{done:!1,value:t}}if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];this._body=t.data.columns;let n=Hi.Message.fromJSON(t,xr.MessageHeader.DictionaryBatch);return{done:!1,value:n}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];this._body=t.columns;let n=Hi.Message.fromJSON(t,xr.MessageHeader.RecordBatch);return{done:!1,value:n}}return this._body=[],Rt.ITERATOR_DONE}readMessageBody(e){return t(this._body);function t(n){return(n||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...t(o.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Tc(e));return t.value}readSchema(){let e=xr.MessageHeader.Schema,t=this.readMessage(e),n=t&&t.header();if(!t||!n)throw new Error(Bc(e));return n}};re.JSONMessageReader=Bp;re.PADDING=4;re.MAGIC_STR="ARROW1";re.MAGIC=new Uint8Array(re.MAGIC_STR.length);for(let r=0;r<re.MAGIC_STR.length;r+=1|0)re.MAGIC[r]=re.MAGIC_STR.charCodeAt(r);function cv(r,e=0){for(let t=-1,n=re.MAGIC.length;++t<n;)if(re.MAGIC[t]!==r[e+t])return!1;return!0}re.checkForMagicArrowString=cv;re.magicLength=re.MAGIC.length;re.magicAndPadding=re.magicLength+re.PADDING;re.magicX2AndPadding=re.magicLength*2+re.PADDING});var Ap=w(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.VectorAssembler=void 0;var lv=ze(),vp=le(),dv=hr(),Ic=Se(),Sc=xt(),fv=Or(),Ip=an(),Sp=se(),De=class extends lv.Visitor{constructor(){super();this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...e){let t=new De,n=fv.selectVectorChildrenArgs(dv.RecordBatch,e),[i=t]=t.visitMany(n);return i}visit(e){if(!Sp.DataType.isDictionary(e.type)){let{data:t,length:n,nullCount:i}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");Sp.DataType.isNull(e.type)||Et.call(this,i<=0?new Uint8Array(0):Sc.truncateBitmap(t.offset,n,t.nullBitmap)),this.nodes.push(new Ip.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=De;function Et(r){let e=r.byteLength+7&~7;return this.buffers.push(r),this.bufferRegions.push(new Ip.BufferRegion(this._byteLength,e)),this._byteLength+=e,this}function hv(r){let{type:e,length:t,typeIds:n,valueOffsets:i}=r;if(Et.call(this,n),e.mode===vp.UnionMode.Sparse)return Ac.call(this,r);if(e.mode===vp.UnionMode.Dense){if(r.offset<=0)return Et.call(this,i),Ac.call(this,r);{let o=n.reduce((c,_)=>Math.max(c,_),n[0]),a=new Int32Array(o+1),u=new Int32Array(o+1).fill(-1),f=new Int32Array(t),s=Ic.rebaseValueOffsets(-i[0],t,i);for(let c,_,U=-1;++U<t;)(_=u[c=n[U]])===-1&&(_=u[c]=s[c]),f[U]=s[U]-_,++a[c];Et.call(this,f);for(let c,_=-1,U=e.children.length;++_<U;)if(c=r.getChildAt(_)){let J=e.typeIds[_],tt=Math.min(t,a[J]);this.visit(c.slice(u[J],tt))}}}return this}function pv(r){let e;return r.nullCount>=r.length?Et.call(this,new Uint8Array(0)):(e=r.values)instanceof Uint8Array?Et.call(this,Sc.truncateBitmap(r.offset,r.length,e)):Et.call(this,Sc.packBools(r))}function Cr(r){return Et.call(this,r.values.subarray(0,r.length*r.stride))}function Op(r){let{length:e,values:t,valueOffsets:n}=r,i=n[0],o=n[e],a=Math.min(o-i,t.byteLength-i);return Et.call(this,Ic.rebaseValueOffsets(-n[0],e,n)),Et.call(this,t.subarray(i,i+a)),this}function Oc(r){let{length:e,valueOffsets:t}=r;return t&&Et.call(this,Ic.rebaseValueOffsets(t[0],e,t)),this.visit(r.getChildAt(0))}function Ac(r){return this.visitMany(r.type.children.map((e,t)=>r.getChildAt(t)).filter(Boolean))[0]}De.prototype.visitBool=pv;De.prototype.visitInt=Cr;De.prototype.visitFloat=Cr;De.prototype.visitUtf8=Op;De.prototype.visitBinary=Op;De.prototype.visitFixedSizeBinary=Cr;De.prototype.visitDate=Cr;De.prototype.visitTimestamp=Cr;De.prototype.visitTime=Cr;De.prototype.visitDecimal=Cr;De.prototype.visitList=Oc;De.prototype.visitStruct=Ac;De.prototype.visitUnion=hv;De.prototype.visitInterval=Cr;De.prototype.visitFixedSizeList=Oc;De.prototype.visitMap=Oc});var Fp=w(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.JSONTypeAssembler=void 0;var yv=ze(),_e=le(),Dp=class extends yv.Visitor{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:_e.ArrowType[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:_e.ArrowType[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:_e.ArrowType[e].toLowerCase(),precision:_e.Precision[t]}}visitBinary({typeId:e}){return{name:_e.ArrowType[e].toLowerCase()}}visitBool({typeId:e}){return{name:_e.ArrowType[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:_e.ArrowType[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n}){return{name:_e.ArrowType[e].toLowerCase(),scale:t,precision:n}}visitDate({typeId:e,unit:t}){return{name:_e.ArrowType[e].toLowerCase(),unit:_e.DateUnit[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:_e.ArrowType[e].toLowerCase(),unit:_e.TimeUnit[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:_e.ArrowType[e].toLowerCase(),unit:_e.TimeUnit[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:_e.ArrowType[e].toLowerCase(),unit:_e.IntervalUnit[t]}}visitList({typeId:e}){return{name:_e.ArrowType[e].toLowerCase()}}visitStruct({typeId:e}){return{name:_e.ArrowType[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:_e.ArrowType[e].toLowerCase(),mode:_e.UnionMode[t],typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:_e.ArrowType[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:_e.ArrowType[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:_e.ArrowType[e].toLowerCase(),keysSorted:t}}};jo.JSONTypeAssembler=Dp});var Up=w(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.JSONVectorAssembler=void 0;var bv=Vi(),Gi=Ln(),mv=ve(),_v=ze(),gv=le(),wv=hr(),Dc=le(),qo=xt(),Tv=Or(),Rp=se(),Wo=class extends _v.Visitor{static assemble(...e){return new Wo().visitMany(Tv.selectColumnChildrenArgs(wv.RecordBatch,e))}visit(e){let{data:t,name:n,length:i}=e,{offset:o,nullCount:a,nullBitmap:u}=t,f=Rp.DataType.isDictionary(e.type)?e.type.indices:e.type,s=Object.assign([],t.buffers,{[gv.BufferType.VALIDITY]:void 0});return{name:n,count:i,VALIDITY:Rp.DataType.isNull(f)?void 0:a<=0?Array.from({length:i},()=>1):[...qo.iterateBits(u,o,i,null,qo.getBit)],...super.visit(mv.Vector.new(t.clone(f,o,i,0,s)))}}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...qo.iterateBits(e,t,n,null,qo.getBool)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...$i(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...e],OFFSET:[...e.valueOffsets]}}visitBinary(e){return{DATA:[...Ep(e)],OFFSET:[...e.valueOffsets]}}visitFixedSizeBinary(e){return{DATA:[...Ep(e)]}}visitDate(e){return{DATA:e.type.unit===Dc.DateUnit.DAY?[...e.values]:[...$i(e.values,2)]}}visitTimestamp(e){return{DATA:[...$i(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<Dc.TimeUnit.MICROSECOND?[...e.values]:[...$i(e.values,2)]}}visitDecimal(e){return{DATA:[...$i(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new Gi.Column(t,[e.getChildAt(n)])))}}visitStruct(e){return{children:e.type.children.map((t,n)=>this.visit(new Gi.Column(t,[e.getChildAt(n)])))}}visitUnion(e){return{TYPE:[...e.typeIds],OFFSET:e.type.mode===Dc.UnionMode.Dense?[...e.valueOffsets]:void 0,children:e.type.children.map((t,n)=>this.visit(new Gi.Column(t,[e.getChildAt(n)])))}}visitInterval(e){return{DATA:[...e.values]}}visitFixedSizeList(e){return{children:e.type.children.map((t,n)=>this.visit(new Gi.Column(t,[e.getChildAt(n)])))}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new Gi.Column(t,[e.getChildAt(n)])))}}};zo.JSONVectorAssembler=Wo;function*Ep(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*$i(r,e){for(let t=-1,n=r.length/e;++t<n;)yield`${bv.BN.new(r.subarray((t+0)*e,(t+1)*e),!1)}`}});var Jo=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.RecordBatchJSONWriter=Qt.RecordBatchFileWriter=Qt.RecordBatchStreamWriter=Qt.RecordBatchWriter=void 0;var Fc=Ki(),Bv=xo(),vv=Ln(),Iv=se(),Sv=xe(),Yo=an(),Rc=an(),Zn=sc(),Ec=le(),Uc=Pr(),Mp=Ap(),Ov=Fp(),Pp=Up(),Av=Se(),Mc=hr(),Dv=Bn(),Kt=Je(),Ji=class extends Dv.ReadableInterop{constructor(e){super();this._position=0,this._started=!1,this._sink=new Uc.AsyncByteQueue,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Kt.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,t){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 Kt.isPromise(e)?e.then(t=>this.writeAll(t)):Kt.isAsyncIterable(e)?Vc(this,e):Pc(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof Uc.AsyncByteQueue?this._sink=e:(this._sink=new Uc.AsyncByteQueue,e&&Kt.isWritableDOMStream(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&Kt.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,(!t||!t.compareTo(this._schema))&&(t===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof Fc.Table&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof Mc.RecordBatch&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!t.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Mc.RecordBatch?e instanceof Mc._InternalEmptyPlaceholderRecordBatch||this._writeRecordBatch(e):e instanceof Fc.Table?this.writeAll(e.chunks):Kt.isIterable(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,i=Yo.Message.encode(e),o=i.byteLength,a=this._writeLegacyIpcFormat?4:8,u=o+a+n&~n,f=u-o-a;return e.headerType===Ec.MessageHeader.RecordBatch?this._recordBatchBlocks.push(new Zn.FileBlock(u,e.bodyLength,this._position)):e.headerType===Ec.MessageHeader.DictionaryBatch&&this._dictionaryBlocks.push(new Zn.FileBlock(u,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(u-a)),o>0&&this._write(i),this._writePadding(f)}_write(e){if(this._started){let t=Av.toUint8Array(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.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(Bv.MAGIC)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:i,buffers:o}=Mp.VectorAssembler.assemble(e),a=new Rc.RecordBatch(e.length,n,i),u=Yo.Message.from(a,t);return this._writeDictionaries(e)._writeMessage(u)._writeBodyBuffers(o)}_writeDictionaryBatch(e,t,n=!1){this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0));let{byteLength:i,nodes:o,bufferRegions:a,buffers:u}=Mp.VectorAssembler.assemble(e),f=new Rc.RecordBatch(e.length,o,a),s=new Rc.DictionaryBatch(f,t,n),c=Yo.Message.from(s,i);return this._writeMessage(c)._writeBodyBuffers(u)}_writeBodyBuffers(e){let t,n,i;for(let o=-1,a=e.length;++o<a;)(t=e[o])&&(n=t.byteLength)>0&&(this._write(t),(i=(n+7&~7)-n)>0&&this._writePadding(i));return this}_writeDictionaries(e){for(let[t,n]of e.dictionaries){let i=this._dictionaryDeltaOffsets.get(t)||0;if(i===0||(n=n.slice(i)).length>0){let o="chunks"in n?n.chunks:[n];for(let a of o)this._writeDictionaryBatch(a,t,i>0),i+=a.length}}return this}};Qt.RecordBatchWriter=Ji;var Ho=class extends Ji{static writeAll(e,t){let n=new Ho(t);return Kt.isPromise(e)?e.then(i=>n.writeAll(i)):Kt.isAsyncIterable(e)?Vc(n,e):Pc(n,e)}};Qt.RecordBatchStreamWriter=Ho;var Go=class extends Ji{static writeAll(e){let t=new Go;return Kt.isPromise(e)?e.then(n=>t.writeAll(n)):Kt.isAsyncIterable(e)?Vc(t,e):Pc(t,e)}constructor(){super();this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeFooter(e){let t=Zn.Footer.encode(new Zn.Footer(e,Ec.MetadataVersion.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};Qt.RecordBatchFileWriter=Go;var $o=class extends Ji{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(Vp)},null,2)}`)}_writeDictionaries(e){return e.dictionaries.size>0&&this._dictionaries.push(e),this}_writeDictionaryBatch(e,t,n=!1){return this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0)),this._write(this._dictionaryBlocks.length===0?" ":`,
9
- `),this._write(`${Fv(e,t,n)}`),this._dictionaryBlocks.push(new Zn.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,t=this._recordBatches.length;++e<t;)this._write(e===0?`,
13
- "batches": [
14
- `:`,
15
- `),this._write(`${Rv(this._recordBatches[e])}`),this._recordBatchBlocks.push(new Zn.FileBlock(0,0,0));this._write(`
16
- ]`)}return this._schema&&this._write(`
17
- }`),this._dictionaries=[],this._recordBatches=[],super.close()}};Qt.RecordBatchJSONWriter=$o;function Pc(r,e){let t=e;e instanceof Fc.Table&&(t=e.chunks,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}async function Vc(r,e){for await(let t of e)r.write(t);return r.finish()}function Vp({name:r,type:e,nullable:t}){let n=new Ov.JSONTypeAssembler;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(Vp),dictionary:Iv.DataType.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function Fv(r,e,t=!1){let n=new Sv.Field(`${e}`,r.type,r.nullCount>0),i=Pp.JSONVectorAssembler.assemble(new vv.Column(n,[r]));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:i}},null,2)}function Rv(r){return JSON.stringify({count:r.length,columns:Pp.JSONVectorAssembler.assemble(r)},null,2)}});var Lc=w(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.distributeVectorsIntoRecordBatches=jr.distributeColumnsIntoRecordBatches=jr.ensureSameLengthData=void 0;var Np=Ot(),Nc=xe(),Ev=Sr(),Uv=hr(),kc=new Uint8Array(0),kp=r=>[kc,kc,new Uint8Array(r),kc];function Mv(r,e,t=e.reduce((n,i)=>Math.max(n,i.length),0)){let n,i,o=-1,a=e.length,u=[...r.fields],f=[],s=(t+63&~63)>>3;for(;++o<a;)(n=e[o])&&n.length===t?f[o]=n:((i=u[o]).nullable||(u[o]=u[o].clone({nullable:!0})),f[o]=n?n._changeLengthAndBackfillNullBitmap(t):Np.Data.new(i.type,0,t,t,kp(s)));return[new Nc.Schema(u),t,f]}jr.ensureSameLengthData=Mv;function Pv(r){return Lp(new Nc.Schema(r.map(({field:e})=>e)),r)}jr.distributeColumnsIntoRecordBatches=Pv;function Lp(r,e){return Vv(r,e.map(t=>t instanceof Ev.Chunked?t.chunks.map(n=>n.data):[t.data]))}jr.distributeVectorsIntoRecordBatches=Lp;function Vv(r,e){let t=[...r.fields],n=[],i={numBatches:e.reduce((_,U)=>Math.max(_,U.length),0)},o=0,a=0,u=-1,f=e.length,s,c=[];for(;i.numBatches-- >0;){for(a=Number.POSITIVE_INFINITY,u=-1;++u<f;)c[u]=s=e[u].shift(),a=Math.min(a,s?s.length:a);isFinite(a)&&(c=Nv(t,a,c,e,i),a>0&&(n[o++]=[a,c.slice()]))}return[r=new Nc.Schema(t,r.metadata),n.map(_=>new Uv.RecordBatch(r,..._))]}function Nv(r,e,t,n,i){let o,a,u=0,f=-1,s=n.length,c=(e+63&~63)>>3;for(;++f<s;)(o=t[f])&&(u=o.length)>=e?u===e?t[f]=o:(t[f]=o.slice(0,e),o=o.slice(e,u-e),i.numBatches=Math.max(i.numBatches,n[f].unshift(o))):((a=r[f]).nullable||(r[f]=a.clone({nullable:!0})),t[f]=o?o._changeLengthAndBackfillNullBitmap(e):Np.Data.new(a.type,0,e,e,kp(c)));return t}});var Ie=w(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.BaseVector=void 0;var kv=le(),Lv=Sr(),xv=Li(),xc=ve(),Cc=class extends xc.AbstractVector{constructor(e,t){super();this._children=t,this.numChildren=e.childData.length,this._bindDataAccessors(this.data=e)}get type(){return this.data.type}get typeId(){return this.data.typeId}get length(){return this.data.length}get offset(){return this.data.offset}get stride(){return this.data.stride}get nullCount(){return this.data.nullCount}get byteLength(){return this.data.byteLength}get VectorName(){return`${kv.Type[this.typeId]}Vector`}get ArrayType(){return this.type.ArrayType}get values(){return this.data.values}get typeIds(){return this.data.typeIds}get nullBitmap(){return this.data.nullBitmap}get valueOffsets(){return this.data.valueOffsets}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}clone(e,t=this._children){return xc.Vector.new(e,t)}concat(...e){return Lv.Chunked.concat(this,...e)}slice(e,t){return xv.clampRange(this,e,t,this._sliceInternal)}isValid(e){if(this.nullCount>0){let t=this.offset+e;return(this.nullBitmap[t>>3]&1<<t%8)!==0}return!0}getChildAt(e){return e<0||e>=this.numChildren?null:(this._children||(this._children=[]))[e]||(this._children[e]=xc.Vector.new(this.data.childData[e]))}toJSON(){return[...this]}_sliceInternal(e,t,n){return e.clone(e.data.slice(t,n-t),null)}_bindDataAccessors(e){}};Ko.BaseVector=Cc;Cc.prototype[Symbol.isConcatSpreadable]=!0});var jc=w(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.BinaryVector=void 0;var Cv=ve(),jv=Ie(),qv=se(),xp=class extends jv.BaseVector{asUtf8(){return Cv.Vector.new(this.data.clone(new qv.Utf8))}};Qo.BinaryVector=xp});var qc=w(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.BoolVector=void 0;var Wv=se(),zv=Ie(),Yv=Xt(),Cp=class extends zv.BaseVector{static from(e){return Yv.vectorFromValuesWithType(()=>new Wv.Bool,e)}};Xo.BoolVector=Cp});var zc=w(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.DateMillisecondVector=qr.DateDayVector=qr.DateVector=void 0;var Hv=le(),Gv=Ie(),jp=Xt(),Wc=se(),Zo=class extends Gv.BaseVector{static from(...e){return e.length===2?jp.vectorFromValuesWithType(()=>e[1]===Hv.DateUnit.DAY?new Wc.DateDay:new Wc.DateMillisecond,e[0]):jp.vectorFromValuesWithType(()=>new Wc.DateMillisecond,e[0])}};qr.DateVector=Zo;var qp=class extends Zo{};qr.DateDayVector=qp;var Wp=class extends Zo{};qr.DateMillisecondVector=Wp});var Yc=w(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.DecimalVector=void 0;var $v=Ie(),zp=class extends $v.BaseVector{};ea.DecimalVector=zp});var ra=w(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.DictionaryVector=void 0;var Jv=Ot(),Yp=ve(),Kv=Ie(),Qv=Xt(),Xv=se(),Hc=class extends Kv.BaseVector{constructor(e){super(e);this.indices=Yp.Vector.new(e.clone(this.type.indices))}static from(...e){if(e.length===3){let[t,n,i]=e,o=new Xv.Dictionary(t.type,n,null,null);return Yp.Vector.new(Jv.Data.Dictionary(o,0,i.length,0,null,i,t))}return Qv.vectorFromValuesWithType(()=>e[0].type,e[0])}get dictionary(){return this.data.dictionary}reverseLookup(e){return this.dictionary.indexOf(e)}getKey(e){return this.indices.get(e)}getValue(e){return this.dictionary.get(e)}setKey(e,t){return this.indices.set(e,t)}setValue(e,t){return this.dictionary.set(e,t)}};ta.DictionaryVector=Hc;Hc.prototype.indices=null});var Gc=w(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.FixedSizeBinaryVector=void 0;var Zv=Ie(),Hp=class extends Zv.BaseVector{};na.FixedSizeBinaryVector=Hp});var $c=w(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.FixedSizeListVector=void 0;var eI=Ie(),Gp=class extends eI.BaseVector{};ia.FixedSizeListVector=Gp});var Xc=w(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.Float64Vector=Zt.Float32Vector=Zt.Float16Vector=Zt.FloatVector=void 0;var tI=Ot(),rI=ve(),nI=Ie(),iI=Xt(),dn=se(),Qi=class extends nI.BaseVector{static from(e){let t=aI(this);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){let n=oI(e.constructor)||t;if(t===null&&(t=n),t&&t===n){let i=new t,o=e.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!sI(t,e.constructor))return rI.Vector.new(tI.Data.Float(i,0,o,0,null,e))}}if(t)return iI.vectorFromValuesWithType(()=>new t,e);throw e instanceof DataView||e instanceof ArrayBuffer?new TypeError(`Cannot infer float type from instance of ${e.constructor.name}`):new TypeError("Unrecognized FloatVector input")}};Zt.FloatVector=Qi;var Jc=class extends Qi{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}};Zt.Float16Vector=Jc;var Kc=class extends Qi{};Zt.Float32Vector=Kc;var Qc=class extends Qi{};Zt.Float64Vector=Qc;var sI=(r,e)=>r===dn.Float16&&e!==Uint16Array,oI=r=>{switch(r){case Uint16Array:return dn.Float16;case Float32Array:return dn.Float32;case Float64Array:return dn.Float64;default:return null}},aI=r=>{switch(r){case Jc:return dn.Float16;case Kc:return dn.Float32;case Qc:return dn.Float64;default:return null}}});var Zc=w(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.IntervalYearMonthVector=Wr.IntervalDayTimeVector=Wr.IntervalVector=void 0;var uI=Ie(),sa=class extends uI.BaseVector{};Wr.IntervalVector=sa;var $p=class extends sa{};Wr.IntervalDayTimeVector=$p;var Jp=class extends sa{};Wr.IntervalYearMonthVector=Jp});var oa=w(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.Uint64Vector=Fe.Uint32Vector=Fe.Uint16Vector=Fe.Uint8Vector=Fe.Int64Vector=Fe.Int32Vector=Fe.Int16Vector=Fe.Int8Vector=Fe.IntVector=void 0;var cI=Ot(),lI=ve(),dI=Ie(),fI=Xt(),Kp=Je(),Qp=Se(),Be=se(),er=class extends dI.BaseVector{static from(...e){let[t,n=!1]=e,i=yI(this,n);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let o=pI(t.constructor,n)||i;if(i===null&&(i=o),i&&i===o){let a=new i,u=t.byteLength/a.ArrayType.BYTES_PER_ELEMENT;return hI(i,t.constructor)&&(u*=.5),lI.Vector.new(cI.Data.Int(a,0,u,0,null,t))}}if(i)return fI.vectorFromValuesWithType(()=>new i,t);throw t instanceof DataView||t instanceof ArrayBuffer?new TypeError(`Cannot infer integer type from instance of ${t.constructor.name}`):new TypeError("Unrecognized IntVector input")}};Fe.IntVector=er;var el=class extends er{};Fe.Int8Vector=el;var tl=class extends er{};Fe.Int16Vector=tl;var rl=class extends er{};Fe.Int32Vector=rl;var nl=class extends er{toBigInt64Array(){return Qp.toBigInt64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}};Fe.Int64Vector=nl;var il=class extends er{};Fe.Uint8Vector=il;var sl=class extends er{};Fe.Uint16Vector=sl;var ol=class extends er{};Fe.Uint32Vector=ol;var al=class extends er{toBigUint64Array(){return Qp.toBigUint64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}};Fe.Uint64Vector=al;var hI=(r,e)=>(r===Be.Int64||r===Be.Uint64)&&(e===Int32Array||e===Uint32Array),pI=(r,e)=>{switch(r){case Int8Array:return Be.Int8;case Int16Array:return Be.Int16;case Int32Array:return e?Be.Int64:Be.Int32;case Kp.BigInt64Array:return Be.Int64;case Uint8Array:return Be.Uint8;case Uint16Array:return Be.Uint16;case Uint32Array:return e?Be.Uint64:Be.Uint32;case Kp.BigUint64Array:return Be.Uint64;default:return null}},yI=(r,e)=>{switch(r){case el:return Be.Int8;case tl:return Be.Int16;case rl:return e?Be.Int64:Be.Int32;case nl:return Be.Int64;case il:return Be.Uint8;case sl:return Be.Uint16;case ol:return e?Be.Uint64:Be.Uint32;case al:return Be.Uint64;default:return null}}});var ul=w(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.ListVector=void 0;var bI=Ie(),Xp=class extends bI.BaseVector{};aa.ListVector=Xp});var cl=w(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.MapVector=void 0;var mI=Ni(),_I=ve(),gI=Ie(),wI=se(),Zp=class extends gI.BaseVector{asList(){let e=this.type.children[0];return _I.Vector.new(this.data.clone(new wI.List(e)))}bind(e){let t=this.getChildAt(0),{[e]:n,[e+1]:i}=this.valueOffsets;return new mI.MapRow(t.slice(n,i))}};ua.MapVector=Zp});var ll=w(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.NullVector=void 0;var TI=Ie(),ey=class extends TI.BaseVector{};ca.NullVector=ey});var dl=w(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.StructVector=void 0;var BI=Ni(),vI=Ie(),II=Symbol.for("rowIndex"),ty=class extends vI.BaseVector{bind(e){let t=this._row||(this._row=new BI.StructRow(this)),n=Object.create(t);return n[II]=e,n}};la.StructVector=ty});var fl=w(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.TimestampNanosecondVector=_t.TimestampMicrosecondVector=_t.TimestampMillisecondVector=_t.TimestampSecondVector=_t.TimestampVector=void 0;var SI=Ie(),ei=class extends SI.BaseVector{};_t.TimestampVector=ei;var ry=class extends ei{};_t.TimestampSecondVector=ry;var ny=class extends ei{};_t.TimestampMillisecondVector=ny;var iy=class extends ei{};_t.TimestampMicrosecondVector=iy;var sy=class extends ei{};_t.TimestampNanosecondVector=sy});var hl=w(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.TimeNanosecondVector=gt.TimeMicrosecondVector=gt.TimeMillisecondVector=gt.TimeSecondVector=gt.TimeVector=void 0;var OI=Ie(),ti=class extends OI.BaseVector{};gt.TimeVector=ti;var oy=class extends ti{};gt.TimeSecondVector=oy;var ay=class extends ti{};gt.TimeMillisecondVector=ay;var uy=class extends ti{};gt.TimeMicrosecondVector=uy;var cy=class extends ti{};gt.TimeNanosecondVector=cy});var pl=w(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.SparseUnionVector=zr.DenseUnionVector=zr.UnionVector=void 0;var AI=Ie(),da=class extends AI.BaseVector{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}};zr.UnionVector=da;var ly=class extends da{get valueOffsets(){return this.data.valueOffsets}};zr.DenseUnionVector=ly;var dy=class extends da{};zr.SparseUnionVector=dy});var yl=w(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.Utf8Vector=void 0;var DI=ve(),FI=Ie(),fy=se(),RI=Xt(),hy=class extends FI.BaseVector{static from(e){return RI.vectorFromValuesWithType(()=>new fy.Utf8,e)}asBinary(){return DI.Vector.new(this.data.clone(new fy.Binary))}};fa.Utf8Vector=hy});var py=w(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.partial2=Yr.partial1=Yr.partial0=void 0;function EI(r){return function(){return r(this)}}Yr.partial0=EI;function UI(r){return function(e){return r(this,e)}}Yr.partial1=UI;function MI(r){return function(e,t){return r(this,e,t)}}Yr.partial2=MI});var _l=w(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.instance=ri.GetVisitor=void 0;var ha=Vi(),PI=ze(),VI=Xr(),NI=Ei(),wt=le(),V=class extends PI.Visitor{};ri.GetVisitor=V;var kI=(r,e)=>864e5*r[e],bl=(r,e)=>4294967296*r[e+1]+(r[e]>>>0),LI=(r,e)=>4294967296*(r[e+1]/1e3)+(r[e]>>>0)/1e3,xI=(r,e)=>4294967296*(r[e+1]/1e6)+(r[e]>>>0)/1e6,yy=r=>new Date(r),CI=(r,e)=>yy(kI(r,e)),jI=(r,e)=>yy(bl(r,e)),qI=(r,e)=>null,by=(r,e,t)=>{let{[t]:n,[t+1]:i}=e;return n!=null&&i!=null?r.subarray(n,i):null},WI=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!=0},my=({values:r},e)=>CI(r,e),_y=({values:r},e)=>jI(r,e*2),tr=({stride:r,values:e},t)=>e[r*t],gy=({stride:r,values:e},t)=>NI.uint16ToFloat64(e[r*t]),ml=({stride:r,values:e,type:t},n)=>ha.BN.new(e.subarray(r*n,r*(n+1)),t.isSigned),zI=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),YI=({values:r,valueOffsets:e},t)=>by(r,e,t),HI=({values:r,valueOffsets:e},t)=>{let n=by(r,e,t);return n!==null?VI.decodeUtf8(n):null},GI=(r,e)=>r.type.bitWidth<64?tr(r,e):ml(r,e),$I=(r,e)=>r.type.precision!==wt.Precision.HALF?tr(r,e):gy(r,e),JI=(r,e)=>r.type.unit===wt.DateUnit.DAY?my(r,e):_y(r,e),wy=({values:r},e)=>1e3*bl(r,e*2),Ty=({values:r},e)=>bl(r,e*2),By=({values:r},e)=>LI(r,e*2),vy=({values:r},e)=>xI(r,e*2),KI=(r,e)=>{switch(r.type.unit){case wt.TimeUnit.SECOND:return wy(r,e);case wt.TimeUnit.MILLISECOND:return Ty(r,e);case wt.TimeUnit.MICROSECOND:return By(r,e);case wt.TimeUnit.NANOSECOND:return vy(r,e)}},Iy=({values:r,stride:e},t)=>r[e*t],Sy=({values:r,stride:e},t)=>r[e*t],Oy=({values:r},e)=>ha.BN.signed(r.subarray(2*e,2*(e+1))),Ay=({values:r},e)=>ha.BN.signed(r.subarray(2*e,2*(e+1))),QI=(r,e)=>{switch(r.type.unit){case wt.TimeUnit.SECOND:return Iy(r,e);case wt.TimeUnit.MILLISECOND:return Sy(r,e);case wt.TimeUnit.MICROSECOND:return Oy(r,e);case wt.TimeUnit.NANOSECOND:return Ay(r,e)}},XI=({values:r},e)=>ha.BN.decimal(r.subarray(4*e,4*(e+1))),ZI=(r,e)=>{let t=r.getChildAt(0),{valueOffsets:n,stride:i}=r;return t.slice(n[e*i],n[e*i+1])},eS=(r,e)=>r.bind(e),tS=(r,e)=>r.bind(e),rS=(r,e)=>r.type.mode===wt.UnionMode.Dense?Dy(r,e):Fy(r,e),Dy=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(r.valueOffsets[e]):null},Fy=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(e):null},nS=(r,e)=>r.getValue(r.getKey(e)),iS=(r,e)=>r.type.unit===wt.IntervalUnit.DAY_TIME?Ry(r,e):Ey(r,e),Ry=({values:r},e)=>r.subarray(2*e,2*(e+1)),Ey=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=t/12|0,n[1]=t%12|0,n},sS=(r,e)=>{let t=r.getChildAt(0),{stride:n}=r;return t.slice(e*n,(e+1)*n)};V.prototype.visitNull=qI;V.prototype.visitBool=WI;V.prototype.visitInt=GI;V.prototype.visitInt8=tr;V.prototype.visitInt16=tr;V.prototype.visitInt32=tr;V.prototype.visitInt64=ml;V.prototype.visitUint8=tr;V.prototype.visitUint16=tr;V.prototype.visitUint32=tr;V.prototype.visitUint64=ml;V.prototype.visitFloat=$I;V.prototype.visitFloat16=gy;V.prototype.visitFloat32=tr;V.prototype.visitFloat64=tr;V.prototype.visitUtf8=HI;V.prototype.visitBinary=YI;V.prototype.visitFixedSizeBinary=zI;V.prototype.visitDate=JI;V.prototype.visitDateDay=my;V.prototype.visitDateMillisecond=_y;V.prototype.visitTimestamp=KI;V.prototype.visitTimestampSecond=wy;V.prototype.visitTimestampMillisecond=Ty;V.prototype.visitTimestampMicrosecond=By;V.prototype.visitTimestampNanosecond=vy;V.prototype.visitTime=QI;V.prototype.visitTimeSecond=Iy;V.prototype.visitTimeMillisecond=Sy;V.prototype.visitTimeMicrosecond=Oy;V.prototype.visitTimeNanosecond=Ay;V.prototype.visitDecimal=XI;V.prototype.visitList=ZI;V.prototype.visitStruct=tS;V.prototype.visitUnion=rS;V.prototype.visitDenseUnion=Dy;V.prototype.visitSparseUnion=Fy;V.prototype.visitDictionary=nS;V.prototype.visitInterval=iS;V.prototype.visitIntervalDayTime=Ry;V.prototype.visitIntervalYearMonth=Ey;V.prototype.visitFixedSizeList=sS;V.prototype.visitMap=eS;ri.instance=new V});var Vy=w(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.instance=ni.IndexOfVisitor=void 0;var oS=ze(),Uy=xt(),My=Li(),N=class extends oS.Visitor{};ni.IndexOfVisitor=N;function aS(r,e){return e===null&&r.length>0?0:-1}function uS(r,e){let{nullBitmap:t}=r.data;if(!t||r.nullCount<=0)return-1;let n=0;for(let i of Uy.iterateBits(t,r.data.offset+(e||0),r.length,t,Uy.getBool)){if(!i)return n;++n}return-1}function X(r,e,t){if(e===void 0)return-1;if(e===null)return uS(r,t);let n=My.createElementComparator(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(n(r.get(i)))return i;return-1}function Py(r,e,t){let n=My.createElementComparator(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(n(r.get(i)))return i;return-1}N.prototype.visitNull=aS;N.prototype.visitBool=X;N.prototype.visitInt=X;N.prototype.visitInt8=X;N.prototype.visitInt16=X;N.prototype.visitInt32=X;N.prototype.visitInt64=X;N.prototype.visitUint8=X;N.prototype.visitUint16=X;N.prototype.visitUint32=X;N.prototype.visitUint64=X;N.prototype.visitFloat=X;N.prototype.visitFloat16=X;N.prototype.visitFloat32=X;N.prototype.visitFloat64=X;N.prototype.visitUtf8=X;N.prototype.visitBinary=X;N.prototype.visitFixedSizeBinary=X;N.prototype.visitDate=X;N.prototype.visitDateDay=X;N.prototype.visitDateMillisecond=X;N.prototype.visitTimestamp=X;N.prototype.visitTimestampSecond=X;N.prototype.visitTimestampMillisecond=X;N.prototype.visitTimestampMicrosecond=X;N.prototype.visitTimestampNanosecond=X;N.prototype.visitTime=X;N.prototype.visitTimeSecond=X;N.prototype.visitTimeMillisecond=X;N.prototype.visitTimeMicrosecond=X;N.prototype.visitTimeNanosecond=X;N.prototype.visitDecimal=X;N.prototype.visitList=X;N.prototype.visitStruct=X;N.prototype.visitUnion=X;N.prototype.visitDenseUnion=Py;N.prototype.visitSparseUnion=Py;N.prototype.visitDictionary=X;N.prototype.visitInterval=X;N.prototype.visitIntervalDayTime=X;N.prototype.visitIntervalYearMonth=X;N.prototype.visitFixedSizeList=X;N.prototype.visitMap=X;ni.instance=new N});var gl=w(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.instance=ii.IteratorVisitor=void 0;var pa=le(),cS=ze(),lS=xt(),Ny=_l(),k=class extends cS.Visitor{};ii.IteratorVisitor=k;function dS(r){let e=Ny.instance.getVisitFn(r);return lS.iterateBits(r.data.nullBitmap,r.data.offset,r.length,r,(t,n,i,o)=>(i&1<<o)!=0?e(t,n):null)}function G(r){if(r.nullCount>0)return dS(r);let{type:e,typeId:t,length:n}=r;return r.stride===1&&(t===pa.Type.Timestamp||t===pa.Type.Int&&e.bitWidth!==64||t===pa.Type.Time&&e.bitWidth!==64||t===pa.Type.Float&&e.precision>0)?r.data.values.subarray(0,n)[Symbol.iterator]():function*(i){for(let o=-1;++o<n;)yield i(r,o)}(Ny.instance.getVisitFn(r))}k.prototype.visitNull=G;k.prototype.visitBool=G;k.prototype.visitInt=G;k.prototype.visitInt8=G;k.prototype.visitInt16=G;k.prototype.visitInt32=G;k.prototype.visitInt64=G;k.prototype.visitUint8=G;k.prototype.visitUint16=G;k.prototype.visitUint32=G;k.prototype.visitUint64=G;k.prototype.visitFloat=G;k.prototype.visitFloat16=G;k.prototype.visitFloat32=G;k.prototype.visitFloat64=G;k.prototype.visitUtf8=G;k.prototype.visitBinary=G;k.prototype.visitFixedSizeBinary=G;k.prototype.visitDate=G;k.prototype.visitDateDay=G;k.prototype.visitDateMillisecond=G;k.prototype.visitTimestamp=G;k.prototype.visitTimestampSecond=G;k.prototype.visitTimestampMillisecond=G;k.prototype.visitTimestampMicrosecond=G;k.prototype.visitTimestampNanosecond=G;k.prototype.visitTime=G;k.prototype.visitTimeSecond=G;k.prototype.visitTimeMillisecond=G;k.prototype.visitTimeMicrosecond=G;k.prototype.visitTimeNanosecond=G;k.prototype.visitDecimal=G;k.prototype.visitList=G;k.prototype.visitStruct=G;k.prototype.visitUnion=G;k.prototype.visitDenseUnion=G;k.prototype.visitSparseUnion=G;k.prototype.visitDictionary=G;k.prototype.visitInterval=G;k.prototype.visitIntervalDayTime=G;k.prototype.visitIntervalYearMonth=G;k.prototype.visitFixedSizeList=G;k.prototype.visitMap=G;ii.instance=new k});var ky=w(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.instance=si.ToArrayVisitor=void 0;var Xi=le(),fS=ze(),hS=gl(),L=class extends fS.Visitor{};si.ToArrayVisitor=L;function $(r){let{type:e,length:t,stride:n}=r;switch(e.typeId){case Xi.Type.Int:case Xi.Type.Float:case Xi.Type.Decimal:case Xi.Type.Time:case Xi.Type.Timestamp:return r.data.values.subarray(0,t*n)}return[...hS.instance.visit(r)]}L.prototype.visitNull=$;L.prototype.visitBool=$;L.prototype.visitInt=$;L.prototype.visitInt8=$;L.prototype.visitInt16=$;L.prototype.visitInt32=$;L.prototype.visitInt64=$;L.prototype.visitUint8=$;L.prototype.visitUint16=$;L.prototype.visitUint32=$;L.prototype.visitUint64=$;L.prototype.visitFloat=$;L.prototype.visitFloat16=$;L.prototype.visitFloat32=$;L.prototype.visitFloat64=$;L.prototype.visitUtf8=$;L.prototype.visitBinary=$;L.prototype.visitFixedSizeBinary=$;L.prototype.visitDate=$;L.prototype.visitDateDay=$;L.prototype.visitDateMillisecond=$;L.prototype.visitTimestamp=$;L.prototype.visitTimestampSecond=$;L.prototype.visitTimestampMillisecond=$;L.prototype.visitTimestampMicrosecond=$;L.prototype.visitTimestampNanosecond=$;L.prototype.visitTime=$;L.prototype.visitTimeSecond=$;L.prototype.visitTimeMillisecond=$;L.prototype.visitTimeMicrosecond=$;L.prototype.visitTimeNanosecond=$;L.prototype.visitDecimal=$;L.prototype.visitList=$;L.prototype.visitStruct=$;L.prototype.visitUnion=$;L.prototype.visitDenseUnion=$;L.prototype.visitSparseUnion=$;L.prototype.visitDictionary=$;L.prototype.visitInterval=$;L.prototype.visitIntervalDayTime=$;L.prototype.visitIntervalYearMonth=$;L.prototype.visitFixedSizeList=$;L.prototype.visitMap=$;si.instance=new L});var Ly=w(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.instance=oi.ByteWidthVisitor=void 0;var pS=ze(),yS=le(),Zi=(r,e)=>r+e,wl=r=>`Cannot compute the byte width of variable-width column ${r}`,Tl=class extends pS.Visitor{visitNull(e){return 0}visitInt(e){return e.bitWidth/8}visitFloat(e){return e.ArrayType.BYTES_PER_ELEMENT}visitBinary(e){throw new Error(wl(e))}visitUtf8(e){throw new Error(wl(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===yS.TimeUnit.SECOND?4:8}visitInterval(e){return(e.unit+1)*4}visitList(e){throw new Error(wl(e))}visitStruct(e){return this.visitFields(e.children).reduce(Zi,0)}visitUnion(e){return this.visitFields(e.children).reduce(Zi,0)}visitFixedSizeBinary(e){return e.byteWidth}visitFixedSizeList(e){return e.listSize*this.visitFields(e.children).reduce(Zi,0)}visitMap(e){return this.visitFields(e.children).reduce(Zi,0)}visitDictionary(e){return this.visit(e.indices)}visitFields(e){return(e||[]).map(t=>this.visit(t.type))}visitSchema(e){return this.visitFields(e.fields).reduce(Zi,0)}};oi.ByteWidthVisitor=Tl;oi.instance=new Tl});var xy=w(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.instance=ai.GetVectorConstructor=void 0;var bS=ze(),mS=jc(),_S=qc(),Bl=zc(),gS=Yc(),wS=ra(),TS=Gc(),BS=$c(),ya=Xc(),vl=Zc(),pr=oa(),vS=ul(),IS=cl(),SS=ll(),OS=dl(),es=fl(),ts=hl(),Il=pl(),AS=yl(),Sl=class extends bS.Visitor{visitNull(){return SS.NullVector}visitBool(){return _S.BoolVector}visitInt(){return pr.IntVector}visitInt8(){return pr.Int8Vector}visitInt16(){return pr.Int16Vector}visitInt32(){return pr.Int32Vector}visitInt64(){return pr.Int64Vector}visitUint8(){return pr.Uint8Vector}visitUint16(){return pr.Uint16Vector}visitUint32(){return pr.Uint32Vector}visitUint64(){return pr.Uint64Vector}visitFloat(){return ya.FloatVector}visitFloat16(){return ya.Float16Vector}visitFloat32(){return ya.Float32Vector}visitFloat64(){return ya.Float64Vector}visitUtf8(){return AS.Utf8Vector}visitBinary(){return mS.BinaryVector}visitFixedSizeBinary(){return TS.FixedSizeBinaryVector}visitDate(){return Bl.DateVector}visitDateDay(){return Bl.DateDayVector}visitDateMillisecond(){return Bl.DateMillisecondVector}visitTimestamp(){return es.TimestampVector}visitTimestampSecond(){return es.TimestampSecondVector}visitTimestampMillisecond(){return es.TimestampMillisecondVector}visitTimestampMicrosecond(){return es.TimestampMicrosecondVector}visitTimestampNanosecond(){return es.TimestampNanosecondVector}visitTime(){return ts.TimeVector}visitTimeSecond(){return ts.TimeSecondVector}visitTimeMillisecond(){return ts.TimeMillisecondVector}visitTimeMicrosecond(){return ts.TimeMicrosecondVector}visitTimeNanosecond(){return ts.TimeNanosecondVector}visitDecimal(){return gS.DecimalVector}visitList(){return vS.ListVector}visitStruct(){return OS.StructVector}visitUnion(){return Il.UnionVector}visitDenseUnion(){return Il.DenseUnionVector}visitSparseUnion(){return Il.SparseUnionVector}visitDictionary(){return wS.DictionaryVector}visitInterval(){return vl.IntervalVector}visitIntervalDayTime(){return vl.IntervalDayTimeVector}visitIntervalYearMonth(){return vl.IntervalYearMonthVector}visitFixedSizeList(){return BS.FixedSizeListVector}visitMap(){return IS.MapVector}};ai.GetVectorConstructor=Sl;ai.instance=new Sl});var Xt=w(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.vectorFromValuesWithType=T.StructRow=T.MapRow=T.Utf8Vector=T.SparseUnionVector=T.DenseUnionVector=T.UnionVector=T.TimeNanosecondVector=T.TimeMicrosecondVector=T.TimeMillisecondVector=T.TimeSecondVector=T.TimeVector=T.TimestampNanosecondVector=T.TimestampMicrosecondVector=T.TimestampMillisecondVector=T.TimestampSecondVector=T.TimestampVector=T.StructVector=T.NullVector=T.MapVector=T.ListVector=T.Uint64Vector=T.Uint32Vector=T.Uint16Vector=T.Uint8Vector=T.Int64Vector=T.Int32Vector=T.Int16Vector=T.Int8Vector=T.IntVector=T.IntervalYearMonthVector=T.IntervalDayTimeVector=T.IntervalVector=T.Float64Vector=T.Float32Vector=T.Float16Vector=T.FloatVector=T.FixedSizeListVector=T.FixedSizeBinaryVector=T.DictionaryVector=T.DecimalVector=T.DateMillisecondVector=T.DateDayVector=T.DateVector=T.Chunked=T.BoolVector=T.BinaryVector=T.BaseVector=T.Vector=void 0;var DS=ve();Object.defineProperty(T,"Vector",{enumerable:!0,get:function(){return DS.Vector}});var FS=Ie();Object.defineProperty(T,"BaseVector",{enumerable:!0,get:function(){return FS.BaseVector}});var RS=jc();Object.defineProperty(T,"BinaryVector",{enumerable:!0,get:function(){return RS.BinaryVector}});var ES=qc();Object.defineProperty(T,"BoolVector",{enumerable:!0,get:function(){return ES.BoolVector}});var US=Sr();Object.defineProperty(T,"Chunked",{enumerable:!0,get:function(){return US.Chunked}});var Ol=zc();Object.defineProperty(T,"DateVector",{enumerable:!0,get:function(){return Ol.DateVector}});Object.defineProperty(T,"DateDayVector",{enumerable:!0,get:function(){return Ol.DateDayVector}});Object.defineProperty(T,"DateMillisecondVector",{enumerable:!0,get:function(){return Ol.DateMillisecondVector}});var MS=Yc();Object.defineProperty(T,"DecimalVector",{enumerable:!0,get:function(){return MS.DecimalVector}});var PS=ra();Object.defineProperty(T,"DictionaryVector",{enumerable:!0,get:function(){return PS.DictionaryVector}});var VS=Gc();Object.defineProperty(T,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return VS.FixedSizeBinaryVector}});var NS=$c();Object.defineProperty(T,"FixedSizeListVector",{enumerable:!0,get:function(){return NS.FixedSizeListVector}});var ba=Xc();Object.defineProperty(T,"FloatVector",{enumerable:!0,get:function(){return ba.FloatVector}});Object.defineProperty(T,"Float16Vector",{enumerable:!0,get:function(){return ba.Float16Vector}});Object.defineProperty(T,"Float32Vector",{enumerable:!0,get:function(){return ba.Float32Vector}});Object.defineProperty(T,"Float64Vector",{enumerable:!0,get:function(){return ba.Float64Vector}});var Al=Zc();Object.defineProperty(T,"IntervalVector",{enumerable:!0,get:function(){return Al.IntervalVector}});Object.defineProperty(T,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Al.IntervalDayTimeVector}});Object.defineProperty(T,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Al.IntervalYearMonthVector}});var yr=oa();Object.defineProperty(T,"IntVector",{enumerable:!0,get:function(){return yr.IntVector}});Object.defineProperty(T,"Int8Vector",{enumerable:!0,get:function(){return yr.Int8Vector}});Object.defineProperty(T,"Int16Vector",{enumerable:!0,get:function(){return yr.Int16Vector}});Object.defineProperty(T,"Int32Vector",{enumerable:!0,get:function(){return yr.Int32Vector}});Object.defineProperty(T,"Int64Vector",{enumerable:!0,get:function(){return yr.Int64Vector}});Object.defineProperty(T,"Uint8Vector",{enumerable:!0,get:function(){return yr.Uint8Vector}});Object.defineProperty(T,"Uint16Vector",{enumerable:!0,get:function(){return yr.Uint16Vector}});Object.defineProperty(T,"Uint32Vector",{enumerable:!0,get:function(){return yr.Uint32Vector}});Object.defineProperty(T,"Uint64Vector",{enumerable:!0,get:function(){return yr.Uint64Vector}});var kS=ul();Object.defineProperty(T,"ListVector",{enumerable:!0,get:function(){return kS.ListVector}});var LS=cl();Object.defineProperty(T,"MapVector",{enumerable:!0,get:function(){return LS.MapVector}});var xS=ll();Object.defineProperty(T,"NullVector",{enumerable:!0,get:function(){return xS.NullVector}});var CS=dl();Object.defineProperty(T,"StructVector",{enumerable:!0,get:function(){return CS.StructVector}});var rs=fl();Object.defineProperty(T,"TimestampVector",{enumerable:!0,get:function(){return rs.TimestampVector}});Object.defineProperty(T,"TimestampSecondVector",{enumerable:!0,get:function(){return rs.TimestampSecondVector}});Object.defineProperty(T,"TimestampMillisecondVector",{enumerable:!0,get:function(){return rs.TimestampMillisecondVector}});Object.defineProperty(T,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return rs.TimestampMicrosecondVector}});Object.defineProperty(T,"TimestampNanosecondVector",{enumerable:!0,get:function(){return rs.TimestampNanosecondVector}});var ns=hl();Object.defineProperty(T,"TimeVector",{enumerable:!0,get:function(){return ns.TimeVector}});Object.defineProperty(T,"TimeSecondVector",{enumerable:!0,get:function(){return ns.TimeSecondVector}});Object.defineProperty(T,"TimeMillisecondVector",{enumerable:!0,get:function(){return ns.TimeMillisecondVector}});Object.defineProperty(T,"TimeMicrosecondVector",{enumerable:!0,get:function(){return ns.TimeMicrosecondVector}});Object.defineProperty(T,"TimeNanosecondVector",{enumerable:!0,get:function(){return ns.TimeNanosecondVector}});var Dl=pl();Object.defineProperty(T,"UnionVector",{enumerable:!0,get:function(){return Dl.UnionVector}});Object.defineProperty(T,"DenseUnionVector",{enumerable:!0,get:function(){return Dl.DenseUnionVector}});Object.defineProperty(T,"SparseUnionVector",{enumerable:!0,get:function(){return Dl.SparseUnionVector}});var jS=yl();Object.defineProperty(T,"Utf8Vector",{enumerable:!0,get:function(){return jS.Utf8Vector}});var Cy=Ni();Object.defineProperty(T,"MapRow",{enumerable:!0,get:function(){return Cy.MapRow}});Object.defineProperty(T,"StructRow",{enumerable:!0,get:function(){return Cy.StructRow}});var is=py(),Fl=le(),ui=ve(),jy=Sr(),fn=Ie(),qS=xt(),ma=Je(),qy=we(),Wy=_l(),zy=Gu(),Yy=Vy(),Hy=ky(),Gy=gl(),$y=Ly(),Jy=xy();ui.Vector.new=WS;ui.Vector.from=YS;function WS(r,...e){return new(Jy.instance.getVisitFn(r)())(r,...e)}function zS(r,e){if(ma.isIterable(e))return ui.Vector.from({nullValues:[null,void 0],type:r(),values:e});if(ma.isAsyncIterable(e))return ui.Vector.from({nullValues:[null,void 0],type:r(),values:e});let{values:t=[],type:n=r(),nullValues:i=[null,void 0]}={...e};return ma.isIterable(t)?ui.Vector.from({nullValues:i,...e,type:n}):ui.Vector.from({nullValues:i,...e,type:n})}T.vectorFromValuesWithType=zS;function YS(r){let{values:e=[],...t}={nullValues:[null,void 0],...r};if(ma.isIterable(e)){let n=[...qy.Builder.throughIterable(t)(e)];return n.length===1?n[0]:jy.Chunked.concat(n)}return(async n=>{let i=qy.Builder.throughAsyncIterable(t);for await(let o of i(e))n.push(o);return n.length===1?n[0]:jy.Chunked.concat(n)})([])}fn.BaseVector.prototype.get=function(e){return Wy.instance.visit(this,e)};fn.BaseVector.prototype.set=function(e,t){return zy.instance.visit(this,e,t)};fn.BaseVector.prototype.indexOf=function(e,t){return Yy.instance.visit(this,e,t)};fn.BaseVector.prototype.toArray=function(){return Hy.instance.visit(this)};fn.BaseVector.prototype.getByteWidth=function(){return $y.instance.visit(this.type)};fn.BaseVector.prototype[Symbol.iterator]=function(){return Gy.instance.visit(this)};fn.BaseVector.prototype._bindDataAccessors=JS;Object.keys(Fl.Type).map(r=>Fl.Type[r]).filter(r=>typeof r=="number").filter(r=>r!==Fl.Type.NONE).forEach(r=>{let e=Jy.instance.visit(r);e.prototype.get=is.partial1(Wy.instance.getVisitFn(r)),e.prototype.set=is.partial2(zy.instance.getVisitFn(r)),e.prototype.indexOf=is.partial2(Yy.instance.getVisitFn(r)),e.prototype.toArray=is.partial0(Hy.instance.getVisitFn(r)),e.prototype.getByteWidth=HS($y.instance.getVisitFn(r)),e.prototype[Symbol.iterator]=is.partial0(Gy.instance.getVisitFn(r))});function HS(r){return function(){return r(this.type)}}function GS(r){return function(e){return this.isValid(e)?r.call(this,e):null}}function $S(r){return function(e,t){qS.setBool(this.nullBitmap,this.offset+e,t!=null)&&r.call(this,e,t)}}function JS(){let r=this.nullBitmap;r&&r.byteLength>0&&(this.get=GS(this.get),this.set=$S(this.set))}});var Ki=w(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.Table=void 0;var KS=Ln(),Ky=xe(),Rl=hr(),QS=ss(),El=se(),Qy=Or(),Ul=Je(),Xy=Jo(),Zy=Lc(),Ml=Xt(),qe=class extends Ml.Chunked{constructor(...e){let t=null;e[0]instanceof Ky.Schema&&(t=e.shift());let n=Qy.selectArgs(Rl.RecordBatch,e);if(!t&&!(t=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 Rl._InternalEmptyPlaceholderRecordBatch(t));super(new El.Struct(t.fields),n);this._schema=t,this._chunks=n}static empty(e=new Ky.Schema([])){return new qe(e,[])}static from(e){if(!e)return qe.empty();if(typeof e=="object"){let n=Ul.isIterable(e.values)?XS(e):Ul.isAsyncIterable(e.values)?ZS(e):null;if(n!==null)return n}let t=QS.RecordBatchReader.from(e);return Ul.isPromise(t)?(async()=>await qe.from(await t))():t.isSync()&&(t=t.open())?t.schema?new qe(t.schema,[...t]):qe.empty():(async n=>{let i=await n,o=i.schema,a=[];if(o){for await(let u of i)a.push(u);return new qe(o,a)}return qe.empty()})(t.open())}static async fromAsync(e){return await qe.from(e)}static fromStruct(e){return qe.new(e.data.childData,e.type.children)}static new(...e){return new qe(...Zy.distributeColumnsIntoRecordBatches(Qy.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 qe(this._schema,e)}getColumn(e){return this.getColumnAt(this.getColumnIndex(e))}getColumnAt(e){return this.getChildAt(e)}getColumnIndex(e){return this._schema.fields.findIndex(t=>t.name===e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t,n,i=this._schema.fields,o=this._children||(this._children=[]);if(n=o[e])return n;if(t=i[e]){let a=this._chunks.map(u=>u.getChildAt(e)).filter(u=>u!=null);if(a.length>0)return o[e]=new KS.Column(t,a)}return null}serialize(e="binary",t=!0){return(t?Xy.RecordBatchStreamWriter:Xy.RecordBatchFileWriter).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...e){let t=this._schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e);return new qe(t,this._chunks.map(({length:n,data:{childData:i}})=>new Rl.RecordBatch(t,n,e.map(o=>i[o]).filter(Boolean))))}assign(e){let t=this._schema.fields,[n,i]=e.schema.fields.reduce((u,f,s)=>{let[c,_]=u,U=t.findIndex(J=>J.name===f.name);return~U?_[U]=s:c.push(s),u},[[],[]]),o=this._schema.assign(e.schema),a=[...t.map((u,f,s,c=i[f])=>c===void 0?this.getColumnAt(f):e.getColumnAt(c)),...n.map(u=>e.getColumnAt(u))].filter(Boolean);return new qe(...Zy.distributeVectorsIntoRecordBatches(o,a))}};_a.Table=qe;function XS(r){let{type:e}=r;return e instanceof El.Struct?qe.fromStruct(Ml.StructVector.from(r)):null}function ZS(r){let{type:e}=r;return e instanceof El.Struct?Ml.StructVector.from(r).then(t=>qe.fromStruct(t)):null}});var hr=w(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci._InternalEmptyPlaceholderRecordBatch=ci.RecordBatch=void 0;var Pl=Ot(),Vl=Ki(),eO=ve(),tO=ze(),rO=xe(),nO=Je(),iO=Sr(),sO=Or(),Nl=se(),oO=Lc(),aO=Xt(),Hr=class extends aO.StructVector{constructor(...e){let t,n=e[0],i;if(e[1]instanceof Pl.Data)[,t,i]=e;else{let o=n.fields,[,a,u]=e;t=Pl.Data.Struct(new Nl.Struct(o),0,a,0,null,u)}super(t,i);this._schema=n}static from(e){return nO.isIterable(e.values),Vl.Table.from(e)}static new(...e){let[t,n]=sO.selectFieldArgs(e),i=n.filter(o=>o instanceof eO.Vector);return new Hr(...oO.ensureSameLengthData(new rO.Schema(t),i.map(o=>o.data)))}clone(e,t=this._children){return new Hr(this._schema,e,t)}concat(...e){let t=this._schema,n=iO.Chunked.flatten(this,...e);return new Vl.Table(t,n.map(({data:i})=>new Hr(t,i)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=ga.collect(this))}select(...e){let t=this._schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e),n=e.map(i=>this.data.childData[i]).filter(Boolean);return new Hr(t,this.length,n)}};ci.RecordBatch=Hr;var eb=class extends Hr{constructor(e){super(e,0,e.fields.map(t=>Pl.Data.new(t.type,0,0,0)))}};ci._InternalEmptyPlaceholderRecordBatch=eb;var ga=class extends tO.Visitor{constructor(){super(...arguments);this.dictionaries=new Map}static collect(e){return new ga().visit(e.data,new Nl.Struct(e.schema.fields)).dictionaries}visit(e,t){return Nl.DataType.isDictionary(t)?this.visitDictionary(e,t):(e.childData.forEach((n,i)=>this.visit(n,t.children[i].type)),this)}visitDictionary(e,t){let n=e.dictionary;return n&&n.length>0&&this.dictionaries.set(t.id,n),this}}});var ss=w(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.AsyncRecordBatchFileReader=vt.RecordBatchFileReader=vt.AsyncRecordBatchStreamReader=vt.RecordBatchStreamReader=vt.RecordBatchReader=void 0;var tb=ve(),wa=le(),rb=sc(),nb=Si(),ib=Pr(),os=uc(),sb=Xh(),kl=hr(),hn=Bn(),Tt=xo(),Bt=Je(),rr=class extends hn.ReadableInterop{constructor(e){super();this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return Bt.isPromise(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return nb.default.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return nb.default.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof rr?e:Bt.isArrowJSON(e)?uO(e):Bt.isFileHandle(e)?dO(e):Bt.isPromise(e)?(async()=>await rr.from(await e))():Bt.isFetchResponse(e)||Bt.isReadableDOMStream(e)||Bt.isReadableNodeStream(e)||Bt.isAsyncIterable(e)?lO(new ib.AsyncByteStream(e)):cO(new ib.ByteStream(e))}static readAll(e){return e instanceof rr?e.isSync()?cb(e):lb(e):Bt.isArrowJSON(e)||ArrayBuffer.isView(e)||Bt.isIterable(e)||Bt.isIteratorResult(e)?cb(e):lb(e)}};vt.RecordBatchReader=rr;var li=class extends rr{constructor(e){super(e);this._impl=e}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}};vt.RecordBatchStreamReader=li;var di=class extends rr{constructor(e){super(e);this._impl=e}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}};vt.AsyncRecordBatchStreamReader=di;var Ta=class extends li{constructor(e){super(e);this._impl=e}};vt.RecordBatchFileReader=Ta;var Ll=class extends di{constructor(e){super(e);this._impl=e}};vt.AsyncRecordBatchFileReader=Ll;var xl=class{constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){return new kl.RecordBatch(this.schema,e.length,this._loadVectors(e,t,this.schema.fields))}_loadDictionaryBatch(e,t){let{id:n,isDelta:i,data:o}=e,{dictionaries:a,schema:u}=this,f=a.get(n);if(i||!f){let s=u.dictionaries.get(n);return f&&i?f.concat(tb.Vector.new(this._loadVectors(o,t,[s])[0])):tb.Vector.new(this._loadVectors(o,t,[s])[0])}return f}_loadVectors(e,t,n){return new sb.VectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}},as=class extends xl{constructor(e,t){super(t);this._reader=Bt.isArrowJSON(e)?new Tt.JSONMessageReader(this._handle=e):new Tt.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=ub(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):hn.ITERATOR_DONE}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):hn.ITERATOR_DONE}next(){if(this.closed)return hn.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),o=this._loadRecordBatch(n,i);return{done:!1,value:o}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new kl._InternalEmptyPlaceholderRecordBatch(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},us=class extends xl{constructor(e,t){super(t);this._reader=new Tt.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=ub(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):hn.ITERATOR_DONE}async return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(e):hn.ITERATOR_DONE}async next(){if(this.closed)return hn.ITERATOR_DONE;let e,{_reader:t}=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 t.readMessageBody(e.bodyLength),o=this._loadRecordBatch(n,i);return{done:!1,value:o}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=await t.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new kl._InternalEmptyPlaceholderRecordBatch(this.schema)}):await this.return()}async _readNextMessageAndValidate(e){return await this._reader.readMessage(e)}},Cl=class extends as{constructor(e,t){super(e instanceof os.RandomAccessFile?e:new os.RandomAccessFile(e),t)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){if(this.closed)return null;this._footer||this.open();let t=this._footer&&this._footer.getRecordBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(wa.MessageHeader.RecordBatch);if(n&&n.isRecordBatch()){let i=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,o)}}return null}_readDictionaryBatch(e){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(wa.MessageHeader.DictionaryBatch);if(n&&n.isDictionaryBatch()){let i=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}}_readFooter(){let{_handle:e}=this,t=e.size-Tt.magicAndPadding,n=e.readInt32(t),i=e.readAt(t-n,n);return rb.Footer.decode(i)}_readNextMessageAndValidate(e){if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer&&this._footer.getRecordBatch(this._recordBatchIndex);if(t&&this._handle.seek(t.offset))return this._reader.readMessage(e)}return null}},ob=class extends us{constructor(e,...t){let n=typeof t[0]!="number"?t.shift():void 0,i=t[0]instanceof Map?t.shift():void 0;super(e instanceof 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 t of this._footer.dictionaryBatches())t&&await this._readDictionaryBatch(this._dictionaryIndex++)}return await super.open(e)}async readRecordBatch(e){if(this.closed)return null;this._footer||await this.open();let t=this._footer&&this._footer.getRecordBatch(e);if(t&&await this._handle.seek(t.offset)){let n=await this._reader.readMessage(wa.MessageHeader.RecordBatch);if(n&&n.isRecordBatch()){let i=n.header(),o=await this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,o)}}return null}async _readDictionaryBatch(e){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&await this._handle.seek(t.offset)){let n=await this._reader.readMessage(wa.MessageHeader.DictionaryBatch);if(n&&n.isDictionaryBatch()){let i=n.header(),o=await this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}}async _readFooter(){let{_handle:e}=this;e._pending&&await e._pending;let t=e.size-Tt.magicAndPadding,n=await e.readInt32(t),i=await e.readAt(t-n,n);return rb.Footer.decode(i)}async _readNextMessageAndValidate(e){if(this._footer||await this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&await this._handle.seek(t.offset))return await this._reader.readMessage(e)}return null}},ab=class extends as{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new sb.JSONVectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}};function ub(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*cb(r){let e=rr.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}async function*lb(r){let e=await rr.from(r);try{if(!(await e.open({autoDestroy:!1})).closed)do yield e;while(!(await e.reset().open()).closed)}finally{await e.cancel()}}function uO(r){return new li(new ab(r))}function cO(r){let e=r.peek(Tt.magicLength+7&~7);return e&&e.byteLength>=4?Tt.checkForMagicArrowString(e)?new Ta(new Cl(r.read())):new li(new as(r)):new li(new as(function*(){}()))}async function lO(r){let e=await r.peek(Tt.magicLength+7&~7);return e&&e.byteLength>=4?Tt.checkForMagicArrowString(e)?new Ta(new Cl(await r.read())):new di(new us(r)):new di(new us(async function*(){}()))}async function dO(r){let{size:e}=await r.stat(),t=new os.AsyncRandomAccessFile(r,e);return e>=Tt.magicX2AndPadding&&Tt.checkForMagicArrowString(await t.readAt(0,Tt.magicLength+7&~7))?new Ll(new ob(t)):new di(new us(t))}});var hb=w(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.toDOMStream=void 0;var db=Se(),fb=Je();function fO(r,e){if(fb.isAsyncIterable(r))return pO(r,e);if(fb.isIterable(r))return hO(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}Ba.toDOMStream=fO;function hO(r,e){let t=null,n=e&&e.type==="bytes"||!1,i=e&&e.highWaterMark||2**24;return new ReadableStream({...e,start(a){o(a,t||(t=r[Symbol.iterator]()))},pull(a){t?o(a,t):a.close()},cancel(){(t&&t.return&&t.return()||!0)&&(t=null)}},{highWaterMark:n?i:void 0,...e});function o(a,u){let f,s=null,c=a.desiredSize||null;for(;!(s=u.next(n?c:null)).done;)if(ArrayBuffer.isView(s.value)&&(f=db.toUint8Array(s.value))&&(c!=null&&n&&(c=c-f.byteLength+1),s.value=f),a.enqueue(s.value),c!=null&&--c<=0)return;a.close()}}function pO(r,e){let t=null,n=e&&e.type==="bytes"||!1,i=e&&e.highWaterMark||2**24;return new ReadableStream({...e,async start(a){await o(a,t||(t=r[Symbol.asyncIterator]()))},async pull(a){t?await o(a,t):a.close()},async cancel(){(t&&t.return&&await t.return()||!0)&&(t=null)}},{highWaterMark:n?i:void 0,...e});async function o(a,u){let f,s=null,c=a.desiredSize||null;for(;!(s=await u.next(n?c:null)).done;)if(ArrayBuffer.isView(s.value)&&(f=db.toUint8Array(s.value))&&(c!=null&&n&&(c=c-f.byteLength+1),s.value=f),a.enqueue(s.value),c!=null&&--c<=0)return;a.close()}}});var bb=w(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.BuilderTransform=fi.builderThroughDOMStream=void 0;var yO=Oo();function bO(r){return new jl(r)}fi.builderThroughDOMStream=bO;var jl=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:i="count",...o}=e;this._controller=null,this._builder=yO.Builder.new(o),this._getSize=i!=="bytes"?pb:yb;let{["highWaterMark"]:a=i==="bytes"?2**14:1e3}={...t},{["highWaterMark"]:u=i==="bytes"?2**14:1e3}={...n};this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:f=>{this._maybeFlush(this._builder,this._controller=f)},start:f=>{this._maybeFlush(this._builder,this._controller=f)}},{highWaterMark:a,size:i!=="bytes"?pb:yb}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:u,size:f=>this._writeValueAndReturnChunkSize(f)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!==null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t===null?e.close():e.enqueue(t)}};fi.BuilderTransform=jl;var pb=r=>r.length,yb=r=>r.byteLength});var mb=w(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.recordBatchReaderThroughDOMStream=void 0;var mO=Pr(),_O=ss();function gO(r,e){let t=new mO.AsyncByteQueue,n=null,i=new ReadableStream({async cancel(){await t.close()},async start(u){await a(u,n||(n=await o()))},async pull(u){n?await a(u,n):u.close()}});return{writable:new WritableStream(t,{highWaterMark:2**14,...r}),readable:i};async function o(){return await(await _O.RecordBatchReader.from(t)).open(e)}async function a(u,f){let s=u.desiredSize,c=null;for(;!(c=await f.next()).done;)if(u.enqueue(c.value),s!=null&&--s<=0)return;u.close()}}va.recordBatchReaderThroughDOMStream=gO});var _b=w(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.recordBatchWriterThroughDOMStream=void 0;var wO=Pr();function TO(r,e){let t=new this(r),n=new wO.AsyncByteStream(t),i=new ReadableStream({type:"bytes",async cancel(){await n.cancel()},async pull(a){await o(a)},async start(a){await o(a)}},{highWaterMark:2**14,...e});return{writable:new WritableStream(t,r),readable:i};async function o(a){let u=null,f=a.desiredSize;for(;u=await n.read(f||null);)if(a.enqueue(u),f!=null&&(f-=u.byteLength)<=0)return;a.close()}}Ia.recordBatchWriterThroughDOMStream=TO});var Gl=w(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.custom=Z.or=Z.and=Z.col=Z.lit=Z.CustomPredicate=Z.Not=Z.GTeq=Z.LTeq=Z.Equals=Z.Or=Z.And=Z.CombinationPredicate=Z.ComparisonPredicate=Z.Predicate=Z.Col=Z.Literal=Z.Value=void 0;var BO=ra(),Gr=class{eq(e){return e instanceof Gr||(e=new br(e)),new Wl(this,e)}le(e){return e instanceof Gr||(e=new br(e)),new zl(this,e)}ge(e){return e instanceof Gr||(e=new br(e)),new Yl(this,e)}lt(e){return new bi(this.ge(e))}gt(e){return new bi(this.le(e))}ne(e){return new bi(this.eq(e))}};Z.Value=Gr;var br=class extends Gr{constructor(e){super();this.v=e}};Z.Literal=br;var ql=class extends Gr{constructor(e){super();this.name=e}bind(e){if(!this.colidx){this.colidx=-1;let n=e.schema.fields;for(let i=-1;++i<n.length;)if(n[i].name===this.name){this.colidx=i;break}if(this.colidx<0)throw new Error(`Failed to bind Col "${this.name}"`)}let t=this.vector=e.getChildAt(this.colidx);return n=>t.get(n)}};Z.Col=ql;var hi=class{and(...e){return new pi(this,...e)}or(...e){return new yi(this,...e)}not(){return new bi(this)}};Z.Predicate=hi;var cs=class extends hi{constructor(e,t){super();this.left=e,this.right=t}bind(e){return this.left instanceof br?this.right instanceof br?this._bindLitLit(e,this.left,this.right):this._bindLitCol(e,this.left,this.right):this.right instanceof br?this._bindColLit(e,this.left,this.right):this._bindColCol(e,this.left,this.right)}};Z.ComparisonPredicate=cs;var ls=class extends hi{constructor(...e){super();this.children=e}};Z.CombinationPredicate=ls;ls.prototype.children=Object.freeze([]);var pi=class extends ls{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof pi?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.every(o=>o(n,i))}};Z.And=pi;var yi=class extends ls{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof yi?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.some(o=>o(n,i))}};Z.Or=yi;var Wl=class extends cs{_bindLitLit(e,t,n){let i=t.v==n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),o=n.bind(e);return(a,u)=>i(a,u)==o(a,u)}_bindColLit(e,t,n){let i=t.bind(e);if(t.vector instanceof BO.DictionaryVector){let o,a=t.vector;return a.dictionary!==this.lastDictionary?(o=a.reverseLookup(n.v),this.lastDictionary=a.dictionary,this.lastKey=o):o=this.lastKey,o===-1?()=>!1:u=>a.getKey(u)===o}else return(o,a)=>i(o,a)==n.v}_bindLitCol(e,t,n){return this._bindColLit(e,n,t)}};Z.Equals=Wl;var zl=class extends cs{_bindLitLit(e,t,n){let i=t.v<=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),o=n.bind(e);return(a,u)=>i(a,u)<=o(a,u)}_bindColLit(e,t,n){let i=t.bind(e);return(o,a)=>i(o,a)<=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(o,a)=>t.v<=i(o,a)}};Z.LTeq=zl;var Yl=class extends cs{_bindLitLit(e,t,n){let i=t.v>=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),o=n.bind(e);return(a,u)=>i(a,u)>=o(a,u)}_bindColLit(e,t,n){let i=t.bind(e);return(o,a)=>i(o,a)>=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(o,a)=>t.v>=i(o,a)}};Z.GTeq=Yl;var bi=class extends hi{constructor(e){super();this.child=e}bind(e){let t=this.child.bind(e);return(n,i)=>!t(n,i)}};Z.Not=bi;var Hl=class extends hi{constructor(e,t){super();this.next=e,this.bind_=t}bind(e){return this.bind_(e),this.next}};Z.CustomPredicate=Hl;function vO(r){return new br(r)}Z.lit=vO;function IO(r){return new ql(r)}Z.col=IO;function SO(...r){return new pi(...r)}Z.and=SO;function OO(...r){return new yi(...r)}Z.or=OO;function AO(r,e){return new Hl(r,e)}Z.custom=AO});var Bb=w($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.FilteredDataFrame=$r.CountByResult=$r.DataFrame=void 0;var mi=Ki(),gb=oa(),$l=xe(),wb=Gl(),DO=hr(),Tb=se();mi.Table.prototype.countBy=function(r){return new pn(this.chunks).countBy(r)};mi.Table.prototype.scan=function(r,e){return new pn(this.chunks).scan(r,e)};mi.Table.prototype.scanReverse=function(r,e){return new pn(this.chunks).scanReverse(r,e)};mi.Table.prototype.filter=function(r){return new pn(this.chunks).filter(r)};var pn=class extends mi.Table{filter(e){return new ds(this.chunks,e)}scan(e,t){let n=this.chunks,i=n.length;for(let o=-1;++o<i;){let a=n[o];t&&t(a);for(let u=-1,f=a.length;++u<f;)e(u,a)}}scanReverse(e,t){let n=this.chunks,i=n.length;for(let o=i;--o>=0;){let a=n[o];t&&t(a);for(let u=a.length;--u>=0;)e(u,a)}}countBy(e){let t=this.chunks,n=t.length,i=typeof e=="string"?new wb.Col(e):e;i.bind(t[n-1]);let o=i.vector;if(!Tb.DataType.isDictionary(o.type))throw new Error("countBy currently only supports dictionary-encoded columns");let a=Math.ceil(Math.log(o.length)/Math.log(256)),u=a==4?Uint32Array:a>=2?Uint16Array:Uint8Array,f=new u(o.dictionary.length);for(let s=-1;++s<n;){let c=t[s];i.bind(c);let _=i.vector.indices;for(let U=-1,J=c.length;++U<J;){let tt=_.get(U);tt!==null&&f[tt]++}}return new Sa(o.dictionary,gb.IntVector.from(f))}};$r.DataFrame=pn;var Sa=class extends mi.Table{constructor(e,t){let n=new $l.Schema([new $l.Field("values",e.type),new $l.Field("counts",t.type)]);super(new DO.RecordBatch(n,t.length,[e,t]))}toJSON(){let e=this.getColumnAt(0),t=this.getColumnAt(1),n={};for(let i=-1;++i<this.length;)n[e.get(i)]=t.get(i);return n}};$r.CountByResult=Sa;var ds=class extends pn{constructor(e,t){super(e);this._predicate=t}scan(e,t){let n=this._chunks,i=n.length;for(let o=-1;++o<i;){let a=n[o],u=this._predicate.bind(a),f=!1;for(let s=-1,c=a.length;++s<c;)u(s,a)&&(t&&!f&&(t(a),f=!0),e(s,a))}}scanReverse(e,t){let n=this._chunks,i=n.length;for(let o=i;--o>=0;){let a=n[o],u=this._predicate.bind(a),f=!1;for(let s=a.length;--s>=0;)u(s,a)&&(t&&!f&&(t(a),f=!0),e(s,a))}}count(){let e=0,t=this._chunks,n=t.length;for(let i=-1;++i<n;){let o=t[i],a=this._predicate.bind(o);for(let u=-1,f=o.length;++u<f;)a(u,o)&&++e}return e}*[Symbol.iterator](){let e=this._chunks,t=e.length;for(let n=-1;++n<t;){let i=e[n],o=this._predicate.bind(i);for(let a=-1,u=i.length;++a<u;)o(a,i)&&(yield i.get(a))}}filter(e){return new ds(this._chunks,this._predicate.and(e))}countBy(e){let t=this._chunks,n=t.length,i=typeof e=="string"?new wb.Col(e):e;i.bind(t[n-1]);let o=i.vector;if(!Tb.DataType.isDictionary(o.type))throw new Error("countBy currently only supports dictionary-encoded columns");let a=Math.ceil(Math.log(o.length)/Math.log(256)),u=a==4?Uint32Array:a>=2?Uint16Array:Uint8Array,f=new u(o.dictionary.length);for(let s=-1;++s<n;){let c=t[s],_=this._predicate.bind(c);i.bind(c);let U=i.vector.indices;for(let J=-1,tt=c.length;++J<tt;){let Mt=U.get(J);Mt!==null&&_(J,c)&&f[Mt]++}}return new Sa(o.dictionary,gb.IntVector.from(f))}};$r.FilteredDataFrame=ds});var Ib=w(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.util=l.predicate=l.CountByResult=l.FilteredDataFrame=l.DataFrame=l.RecordBatch=l.Message=l.JSONMessageReader=l.AsyncMessageReader=l.MessageReader=l.RecordBatchJSONWriter=l.RecordBatchStreamWriter=l.RecordBatchFileWriter=l.RecordBatchWriter=l.AsyncRecordBatchStreamReader=l.AsyncRecordBatchFileReader=l.RecordBatchStreamReader=l.RecordBatchFileReader=l.RecordBatchReader=l.AsyncByteQueue=l.AsyncByteStream=l.ByteStream=l.Utf8Builder=l.SparseUnionBuilder=l.DenseUnionBuilder=l.UnionBuilder=l.TimeNanosecondBuilder=l.TimeMicrosecondBuilder=l.TimeMillisecondBuilder=l.TimeSecondBuilder=l.TimeBuilder=l.TimestampNanosecondBuilder=l.TimestampMicrosecondBuilder=l.TimestampMillisecondBuilder=l.TimestampSecondBuilder=l.TimestampBuilder=l.StructBuilder=l.NullBuilder=l.MapBuilder=l.ListBuilder=l.Uint64Builder=l.Uint32Builder=l.Uint16Builder=l.Uint8Builder=l.Int64Builder=l.Int32Builder=l.Int16Builder=l.Int8Builder=l.IntBuilder=l.IntervalYearMonthBuilder=l.IntervalDayTimeBuilder=l.IntervalBuilder=l.Float64Builder=l.Float32Builder=l.Float16Builder=l.FloatBuilder=l.FixedSizeListBuilder=l.FixedSizeBinaryBuilder=l.DictionaryBuilder=l.DecimalBuilder=l.DateMillisecondBuilder=l.DateDayBuilder=l.DateBuilder=l.BoolBuilder=l.BinaryBuilder=l.Builder=l.Utf8Vector=l.SparseUnionVector=l.DenseUnionVector=l.UnionVector=l.TimeNanosecondVector=l.TimeMicrosecondVector=l.TimeMillisecondVector=l.TimeSecondVector=l.TimeVector=l.TimestampNanosecondVector=l.TimestampMicrosecondVector=l.TimestampMillisecondVector=l.TimestampSecondVector=l.TimestampVector=l.StructVector=l.NullVector=l.MapVector=l.ListVector=l.Uint64Vector=l.Uint32Vector=l.Uint16Vector=l.Uint8Vector=l.Int64Vector=l.Int32Vector=l.Int16Vector=l.Int8Vector=l.IntVector=l.IntervalYearMonthVector=l.IntervalDayTimeVector=l.IntervalVector=l.Float64Vector=l.Float32Vector=l.Float16Vector=l.FloatVector=l.FixedSizeListVector=l.FixedSizeBinaryVector=l.DictionaryVector=l.DecimalVector=l.DateMillisecondVector=l.DateDayVector=l.DateVector=l.Chunked=l.BoolVector=l.BinaryVector=l.BaseVector=l.Vector=l.Field=l.Schema=l.Visitor=l.Column=l.Table=l.Map_=l.FixedSizeList=l.IntervalYearMonth=l.IntervalDayTime=l.Interval=l.Dictionary=l.SparseUnion=l.DenseUnion=l.Union=l.Struct=l.List=l.Decimal=l.TimeNanosecond=l.TimeMicrosecond=l.TimeMillisecond=l.TimeSecond=l.Time=l.TimestampNanosecond=l.TimestampMicrosecond=l.TimestampMillisecond=l.TimestampSecond=l.Timestamp=l.DateMillisecond=l.DateDay=l.Date_=l.FixedSizeBinary=l.Binary=l.Utf8=l.Float64=l.Float32=l.Float16=l.Float=l.Uint64=l.Uint32=l.Uint16=l.Uint8=l.Int64=l.Int32=l.Int16=l.Int8=l.Int=l.Bool=l.Null=l.DataType=l.Data=l.BufferType=l.UnionMode=l.Type=l.TimeUnit=l.Precision=l.MetadataVersion=l.MessageHeader=l.IntervalUnit=l.DateUnit=l.ArrowType=void 0;var nr=le();Object.defineProperty(l,"ArrowType",{enumerable:!0,get:function(){return nr.ArrowType}});Object.defineProperty(l,"DateUnit",{enumerable:!0,get:function(){return nr.DateUnit}});Object.defineProperty(l,"IntervalUnit",{enumerable:!0,get:function(){return nr.IntervalUnit}});Object.defineProperty(l,"MessageHeader",{enumerable:!0,get:function(){return nr.MessageHeader}});Object.defineProperty(l,"MetadataVersion",{enumerable:!0,get:function(){return nr.MetadataVersion}});Object.defineProperty(l,"Precision",{enumerable:!0,get:function(){return nr.Precision}});Object.defineProperty(l,"TimeUnit",{enumerable:!0,get:function(){return nr.TimeUnit}});Object.defineProperty(l,"Type",{enumerable:!0,get:function(){return nr.Type}});Object.defineProperty(l,"UnionMode",{enumerable:!0,get:function(){return nr.UnionMode}});Object.defineProperty(l,"BufferType",{enumerable:!0,get:function(){return nr.BufferType}});var FO=Ot();Object.defineProperty(l,"Data",{enumerable:!0,get:function(){return FO.Data}});var z=se();Object.defineProperty(l,"DataType",{enumerable:!0,get:function(){return z.DataType}});Object.defineProperty(l,"Null",{enumerable:!0,get:function(){return z.Null}});Object.defineProperty(l,"Bool",{enumerable:!0,get:function(){return z.Bool}});Object.defineProperty(l,"Int",{enumerable:!0,get:function(){return z.Int}});Object.defineProperty(l,"Int8",{enumerable:!0,get:function(){return z.Int8}});Object.defineProperty(l,"Int16",{enumerable:!0,get:function(){return z.Int16}});Object.defineProperty(l,"Int32",{enumerable:!0,get:function(){return z.Int32}});Object.defineProperty(l,"Int64",{enumerable:!0,get:function(){return z.Int64}});Object.defineProperty(l,"Uint8",{enumerable:!0,get:function(){return z.Uint8}});Object.defineProperty(l,"Uint16",{enumerable:!0,get:function(){return z.Uint16}});Object.defineProperty(l,"Uint32",{enumerable:!0,get:function(){return z.Uint32}});Object.defineProperty(l,"Uint64",{enumerable:!0,get:function(){return z.Uint64}});Object.defineProperty(l,"Float",{enumerable:!0,get:function(){return z.Float}});Object.defineProperty(l,"Float16",{enumerable:!0,get:function(){return z.Float16}});Object.defineProperty(l,"Float32",{enumerable:!0,get:function(){return z.Float32}});Object.defineProperty(l,"Float64",{enumerable:!0,get:function(){return z.Float64}});Object.defineProperty(l,"Utf8",{enumerable:!0,get:function(){return z.Utf8}});Object.defineProperty(l,"Binary",{enumerable:!0,get:function(){return z.Binary}});Object.defineProperty(l,"FixedSizeBinary",{enumerable:!0,get:function(){return z.FixedSizeBinary}});Object.defineProperty(l,"Date_",{enumerable:!0,get:function(){return z.Date_}});Object.defineProperty(l,"DateDay",{enumerable:!0,get:function(){return z.DateDay}});Object.defineProperty(l,"DateMillisecond",{enumerable:!0,get:function(){return z.DateMillisecond}});Object.defineProperty(l,"Timestamp",{enumerable:!0,get:function(){return z.Timestamp}});Object.defineProperty(l,"TimestampSecond",{enumerable:!0,get:function(){return z.TimestampSecond}});Object.defineProperty(l,"TimestampMillisecond",{enumerable:!0,get:function(){return z.TimestampMillisecond}});Object.defineProperty(l,"TimestampMicrosecond",{enumerable:!0,get:function(){return z.TimestampMicrosecond}});Object.defineProperty(l,"TimestampNanosecond",{enumerable:!0,get:function(){return z.TimestampNanosecond}});Object.defineProperty(l,"Time",{enumerable:!0,get:function(){return z.Time}});Object.defineProperty(l,"TimeSecond",{enumerable:!0,get:function(){return z.TimeSecond}});Object.defineProperty(l,"TimeMillisecond",{enumerable:!0,get:function(){return z.TimeMillisecond}});Object.defineProperty(l,"TimeMicrosecond",{enumerable:!0,get:function(){return z.TimeMicrosecond}});Object.defineProperty(l,"TimeNanosecond",{enumerable:!0,get:function(){return z.TimeNanosecond}});Object.defineProperty(l,"Decimal",{enumerable:!0,get:function(){return z.Decimal}});Object.defineProperty(l,"List",{enumerable:!0,get:function(){return z.List}});Object.defineProperty(l,"Struct",{enumerable:!0,get:function(){return z.Struct}});Object.defineProperty(l,"Union",{enumerable:!0,get:function(){return z.Union}});Object.defineProperty(l,"DenseUnion",{enumerable:!0,get:function(){return z.DenseUnion}});Object.defineProperty(l,"SparseUnion",{enumerable:!0,get:function(){return z.SparseUnion}});Object.defineProperty(l,"Dictionary",{enumerable:!0,get:function(){return z.Dictionary}});Object.defineProperty(l,"Interval",{enumerable:!0,get:function(){return z.Interval}});Object.defineProperty(l,"IntervalDayTime",{enumerable:!0,get:function(){return z.IntervalDayTime}});Object.defineProperty(l,"IntervalYearMonth",{enumerable:!0,get:function(){return z.IntervalYearMonth}});Object.defineProperty(l,"FixedSizeList",{enumerable:!0,get:function(){return z.FixedSizeList}});Object.defineProperty(l,"Map_",{enumerable:!0,get:function(){return z.Map_}});var RO=Ki();Object.defineProperty(l,"Table",{enumerable:!0,get:function(){return RO.Table}});var EO=Ln();Object.defineProperty(l,"Column",{enumerable:!0,get:function(){return EO.Column}});var UO=ze();Object.defineProperty(l,"Visitor",{enumerable:!0,get:function(){return UO.Visitor}});var vb=xe();Object.defineProperty(l,"Schema",{enumerable:!0,get:function(){return vb.Schema}});Object.defineProperty(l,"Field",{enumerable:!0,get:function(){return vb.Field}});var x=Xt();Object.defineProperty(l,"Vector",{enumerable:!0,get:function(){return x.Vector}});Object.defineProperty(l,"BaseVector",{enumerable:!0,get:function(){return x.BaseVector}});Object.defineProperty(l,"BinaryVector",{enumerable:!0,get:function(){return x.BinaryVector}});Object.defineProperty(l,"BoolVector",{enumerable:!0,get:function(){return x.BoolVector}});Object.defineProperty(l,"Chunked",{enumerable:!0,get:function(){return x.Chunked}});Object.defineProperty(l,"DateVector",{enumerable:!0,get:function(){return x.DateVector}});Object.defineProperty(l,"DateDayVector",{enumerable:!0,get:function(){return x.DateDayVector}});Object.defineProperty(l,"DateMillisecondVector",{enumerable:!0,get:function(){return x.DateMillisecondVector}});Object.defineProperty(l,"DecimalVector",{enumerable:!0,get:function(){return x.DecimalVector}});Object.defineProperty(l,"DictionaryVector",{enumerable:!0,get:function(){return x.DictionaryVector}});Object.defineProperty(l,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return x.FixedSizeBinaryVector}});Object.defineProperty(l,"FixedSizeListVector",{enumerable:!0,get:function(){return x.FixedSizeListVector}});Object.defineProperty(l,"FloatVector",{enumerable:!0,get:function(){return x.FloatVector}});Object.defineProperty(l,"Float16Vector",{enumerable:!0,get:function(){return x.Float16Vector}});Object.defineProperty(l,"Float32Vector",{enumerable:!0,get:function(){return x.Float32Vector}});Object.defineProperty(l,"Float64Vector",{enumerable:!0,get:function(){return x.Float64Vector}});Object.defineProperty(l,"IntervalVector",{enumerable:!0,get:function(){return x.IntervalVector}});Object.defineProperty(l,"IntervalDayTimeVector",{enumerable:!0,get:function(){return x.IntervalDayTimeVector}});Object.defineProperty(l,"IntervalYearMonthVector",{enumerable:!0,get:function(){return x.IntervalYearMonthVector}});Object.defineProperty(l,"IntVector",{enumerable:!0,get:function(){return x.IntVector}});Object.defineProperty(l,"Int8Vector",{enumerable:!0,get:function(){return x.Int8Vector}});Object.defineProperty(l,"Int16Vector",{enumerable:!0,get:function(){return x.Int16Vector}});Object.defineProperty(l,"Int32Vector",{enumerable:!0,get:function(){return x.Int32Vector}});Object.defineProperty(l,"Int64Vector",{enumerable:!0,get:function(){return x.Int64Vector}});Object.defineProperty(l,"Uint8Vector",{enumerable:!0,get:function(){return x.Uint8Vector}});Object.defineProperty(l,"Uint16Vector",{enumerable:!0,get:function(){return x.Uint16Vector}});Object.defineProperty(l,"Uint32Vector",{enumerable:!0,get:function(){return x.Uint32Vector}});Object.defineProperty(l,"Uint64Vector",{enumerable:!0,get:function(){return x.Uint64Vector}});Object.defineProperty(l,"ListVector",{enumerable:!0,get:function(){return x.ListVector}});Object.defineProperty(l,"MapVector",{enumerable:!0,get:function(){return x.MapVector}});Object.defineProperty(l,"NullVector",{enumerable:!0,get:function(){return x.NullVector}});Object.defineProperty(l,"StructVector",{enumerable:!0,get:function(){return x.StructVector}});Object.defineProperty(l,"TimestampVector",{enumerable:!0,get:function(){return x.TimestampVector}});Object.defineProperty(l,"TimestampSecondVector",{enumerable:!0,get:function(){return x.TimestampSecondVector}});Object.defineProperty(l,"TimestampMillisecondVector",{enumerable:!0,get:function(){return x.TimestampMillisecondVector}});Object.defineProperty(l,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return x.TimestampMicrosecondVector}});Object.defineProperty(l,"TimestampNanosecondVector",{enumerable:!0,get:function(){return x.TimestampNanosecondVector}});Object.defineProperty(l,"TimeVector",{enumerable:!0,get:function(){return x.TimeVector}});Object.defineProperty(l,"TimeSecondVector",{enumerable:!0,get:function(){return x.TimeSecondVector}});Object.defineProperty(l,"TimeMillisecondVector",{enumerable:!0,get:function(){return x.TimeMillisecondVector}});Object.defineProperty(l,"TimeMicrosecondVector",{enumerable:!0,get:function(){return x.TimeMicrosecondVector}});Object.defineProperty(l,"TimeNanosecondVector",{enumerable:!0,get:function(){return x.TimeNanosecondVector}});Object.defineProperty(l,"UnionVector",{enumerable:!0,get:function(){return x.UnionVector}});Object.defineProperty(l,"DenseUnionVector",{enumerable:!0,get:function(){return x.DenseUnionVector}});Object.defineProperty(l,"SparseUnionVector",{enumerable:!0,get:function(){return x.SparseUnionVector}});Object.defineProperty(l,"Utf8Vector",{enumerable:!0,get:function(){return x.Utf8Vector}});var Y=Oo();Object.defineProperty(l,"Builder",{enumerable:!0,get:function(){return Y.Builder}});Object.defineProperty(l,"BinaryBuilder",{enumerable:!0,get:function(){return Y.BinaryBuilder}});Object.defineProperty(l,"BoolBuilder",{enumerable:!0,get:function(){return Y.BoolBuilder}});Object.defineProperty(l,"DateBuilder",{enumerable:!0,get:function(){return Y.DateBuilder}});Object.defineProperty(l,"DateDayBuilder",{enumerable:!0,get:function(){return Y.DateDayBuilder}});Object.defineProperty(l,"DateMillisecondBuilder",{enumerable:!0,get:function(){return Y.DateMillisecondBuilder}});Object.defineProperty(l,"DecimalBuilder",{enumerable:!0,get:function(){return Y.DecimalBuilder}});Object.defineProperty(l,"DictionaryBuilder",{enumerable:!0,get:function(){return Y.DictionaryBuilder}});Object.defineProperty(l,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return Y.FixedSizeBinaryBuilder}});Object.defineProperty(l,"FixedSizeListBuilder",{enumerable:!0,get:function(){return Y.FixedSizeListBuilder}});Object.defineProperty(l,"FloatBuilder",{enumerable:!0,get:function(){return Y.FloatBuilder}});Object.defineProperty(l,"Float16Builder",{enumerable:!0,get:function(){return Y.Float16Builder}});Object.defineProperty(l,"Float32Builder",{enumerable:!0,get:function(){return Y.Float32Builder}});Object.defineProperty(l,"Float64Builder",{enumerable:!0,get:function(){return Y.Float64Builder}});Object.defineProperty(l,"IntervalBuilder",{enumerable:!0,get:function(){return Y.IntervalBuilder}});Object.defineProperty(l,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return Y.IntervalDayTimeBuilder}});Object.defineProperty(l,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return Y.IntervalYearMonthBuilder}});Object.defineProperty(l,"IntBuilder",{enumerable:!0,get:function(){return Y.IntBuilder}});Object.defineProperty(l,"Int8Builder",{enumerable:!0,get:function(){return Y.Int8Builder}});Object.defineProperty(l,"Int16Builder",{enumerable:!0,get:function(){return Y.Int16Builder}});Object.defineProperty(l,"Int32Builder",{enumerable:!0,get:function(){return Y.Int32Builder}});Object.defineProperty(l,"Int64Builder",{enumerable:!0,get:function(){return Y.Int64Builder}});Object.defineProperty(l,"Uint8Builder",{enumerable:!0,get:function(){return Y.Uint8Builder}});Object.defineProperty(l,"Uint16Builder",{enumerable:!0,get:function(){return Y.Uint16Builder}});Object.defineProperty(l,"Uint32Builder",{enumerable:!0,get:function(){return Y.Uint32Builder}});Object.defineProperty(l,"Uint64Builder",{enumerable:!0,get:function(){return Y.Uint64Builder}});Object.defineProperty(l,"ListBuilder",{enumerable:!0,get:function(){return Y.ListBuilder}});Object.defineProperty(l,"MapBuilder",{enumerable:!0,get:function(){return Y.MapBuilder}});Object.defineProperty(l,"NullBuilder",{enumerable:!0,get:function(){return Y.NullBuilder}});Object.defineProperty(l,"StructBuilder",{enumerable:!0,get:function(){return Y.StructBuilder}});Object.defineProperty(l,"TimestampBuilder",{enumerable:!0,get:function(){return Y.TimestampBuilder}});Object.defineProperty(l,"TimestampSecondBuilder",{enumerable:!0,get:function(){return Y.TimestampSecondBuilder}});Object.defineProperty(l,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return Y.TimestampMillisecondBuilder}});Object.defineProperty(l,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return Y.TimestampMicrosecondBuilder}});Object.defineProperty(l,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return Y.TimestampNanosecondBuilder}});Object.defineProperty(l,"TimeBuilder",{enumerable:!0,get:function(){return Y.TimeBuilder}});Object.defineProperty(l,"TimeSecondBuilder",{enumerable:!0,get:function(){return Y.TimeSecondBuilder}});Object.defineProperty(l,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return Y.TimeMillisecondBuilder}});Object.defineProperty(l,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return Y.TimeMicrosecondBuilder}});Object.defineProperty(l,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return Y.TimeNanosecondBuilder}});Object.defineProperty(l,"UnionBuilder",{enumerable:!0,get:function(){return Y.UnionBuilder}});Object.defineProperty(l,"DenseUnionBuilder",{enumerable:!0,get:function(){return Y.DenseUnionBuilder}});Object.defineProperty(l,"SparseUnionBuilder",{enumerable:!0,get:function(){return Y.SparseUnionBuilder}});Object.defineProperty(l,"Utf8Builder",{enumerable:!0,get:function(){return Y.Utf8Builder}});var Jl=Pr();Object.defineProperty(l,"ByteStream",{enumerable:!0,get:function(){return Jl.ByteStream}});Object.defineProperty(l,"AsyncByteStream",{enumerable:!0,get:function(){return Jl.AsyncByteStream}});Object.defineProperty(l,"AsyncByteQueue",{enumerable:!0,get:function(){return Jl.AsyncByteQueue}});var fs=ss();Object.defineProperty(l,"RecordBatchReader",{enumerable:!0,get:function(){return fs.RecordBatchReader}});Object.defineProperty(l,"RecordBatchFileReader",{enumerable:!0,get:function(){return fs.RecordBatchFileReader}});Object.defineProperty(l,"RecordBatchStreamReader",{enumerable:!0,get:function(){return fs.RecordBatchStreamReader}});Object.defineProperty(l,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return fs.AsyncRecordBatchFileReader}});Object.defineProperty(l,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return fs.AsyncRecordBatchStreamReader}});var Oa=Jo();Object.defineProperty(l,"RecordBatchWriter",{enumerable:!0,get:function(){return Oa.RecordBatchWriter}});Object.defineProperty(l,"RecordBatchFileWriter",{enumerable:!0,get:function(){return Oa.RecordBatchFileWriter}});Object.defineProperty(l,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return Oa.RecordBatchStreamWriter}});Object.defineProperty(l,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return Oa.RecordBatchJSONWriter}});var Kl=xo();Object.defineProperty(l,"MessageReader",{enumerable:!0,get:function(){return Kl.MessageReader}});Object.defineProperty(l,"AsyncMessageReader",{enumerable:!0,get:function(){return Kl.AsyncMessageReader}});Object.defineProperty(l,"JSONMessageReader",{enumerable:!0,get:function(){return Kl.JSONMessageReader}});var MO=an();Object.defineProperty(l,"Message",{enumerable:!0,get:function(){return MO.Message}});var PO=hr();Object.defineProperty(l,"RecordBatch",{enumerable:!0,get:function(){return PO.RecordBatch}});var Ql=Bb();Object.defineProperty(l,"DataFrame",{enumerable:!0,get:function(){return Ql.DataFrame}});Object.defineProperty(l,"FilteredDataFrame",{enumerable:!0,get:function(){return Ql.FilteredDataFrame}});Object.defineProperty(l,"CountByResult",{enumerable:!0,get:function(){return Ql.CountByResult}});var VO=Vi(),NO=lc(),kO=xt(),LO=Ei(),xO=Se(),CO=Li(),jO=Gl();l.predicate=jO;l.util={...VO,...NO,...kO,...LO,...xO,...CO}});var hs=w(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.Utf8Builder=d.SparseUnionBuilder=d.DenseUnionBuilder=d.UnionBuilder=d.TimeNanosecondBuilder=d.TimeMicrosecondBuilder=d.TimeMillisecondBuilder=d.TimeSecondBuilder=d.TimeBuilder=d.TimestampNanosecondBuilder=d.TimestampMicrosecondBuilder=d.TimestampMillisecondBuilder=d.TimestampSecondBuilder=d.TimestampBuilder=d.StructBuilder=d.NullBuilder=d.MapBuilder=d.ListBuilder=d.Uint64Builder=d.Uint32Builder=d.Uint16Builder=d.Uint8Builder=d.Int64Builder=d.Int32Builder=d.Int16Builder=d.Int8Builder=d.IntBuilder=d.IntervalYearMonthBuilder=d.IntervalDayTimeBuilder=d.IntervalBuilder=d.Float64Builder=d.Float32Builder=d.Float16Builder=d.FloatBuilder=d.FixedSizeListBuilder=d.FixedSizeBinaryBuilder=d.DictionaryBuilder=d.DecimalBuilder=d.DateMillisecondBuilder=d.DateDayBuilder=d.DateBuilder=d.BoolBuilder=d.BinaryBuilder=d.Builder=d.util=d.predicate=d.CountByResult=d.FilteredDataFrame=d.DataFrame=d.RecordBatch=d.Message=d.JSONMessageReader=d.AsyncMessageReader=d.MessageReader=d.RecordBatchJSONWriter=d.RecordBatchStreamWriter=d.RecordBatchFileWriter=d.RecordBatchWriter=d.AsyncRecordBatchStreamReader=d.AsyncRecordBatchFileReader=d.RecordBatchStreamReader=d.RecordBatchFileReader=d.RecordBatchReader=d.AsyncByteQueue=d.AsyncByteStream=d.ByteStream=d.Utf8Vector=d.SparseUnionVector=d.DenseUnionVector=d.UnionVector=d.TimeNanosecondVector=d.TimeMicrosecondVector=d.TimeMillisecondVector=d.TimeSecondVector=d.TimeVector=d.TimestampNanosecondVector=d.TimestampMicrosecondVector=d.TimestampMillisecondVector=d.TimestampSecondVector=d.TimestampVector=d.StructVector=d.NullVector=d.MapVector=d.ListVector=d.Uint64Vector=d.Uint32Vector=d.Uint16Vector=d.Uint8Vector=d.Int64Vector=d.Int32Vector=d.Int16Vector=d.Int8Vector=d.IntVector=d.IntervalYearMonthVector=d.IntervalDayTimeVector=d.IntervalVector=d.Float64Vector=d.Float32Vector=d.Float16Vector=d.FloatVector=d.FixedSizeListVector=d.FixedSizeBinaryVector=d.DictionaryVector=d.DecimalVector=d.DateMillisecondVector=d.DateDayVector=d.DateVector=d.Chunked=d.BoolVector=d.BinaryVector=d.BaseVector=d.Vector=d.Visitor=d.Field=d.Schema=d.Column=d.Table=d.Map_=d.FixedSizeList=d.IntervalYearMonth=d.IntervalDayTime=d.Interval=d.Dictionary=d.SparseUnion=d.DenseUnion=d.Union=d.Struct=d.List=d.Decimal=d.TimeNanosecond=d.TimeMicrosecond=d.TimeMillisecond=d.TimeSecond=d.Time=d.TimestampNanosecond=d.TimestampMicrosecond=d.TimestampMillisecond=d.TimestampSecond=d.Timestamp=d.DateMillisecond=d.DateDay=d.Date_=d.FixedSizeBinary=d.Binary=d.Utf8=d.Float64=d.Float32=d.Float16=d.Float=d.Uint64=d.Uint32=d.Uint16=d.Uint8=d.Int64=d.Int32=d.Int16=d.Int8=d.Int=d.Bool=d.Null=d.DataType=d.Data=d.BufferType=d.UnionMode=d.Type=d.TimeUnit=d.Precision=d.MetadataVersion=d.MessageHeader=d.IntervalUnit=d.DateUnit=d.ArrowType=void 0;var qO=Si(),WO=Oo(),zO=ss(),YO=Jo(),HO=hb(),GO=bb(),$O=mb(),JO=_b();qO.default.toDOMStream=HO.toDOMStream;WO.Builder.throughDOM=GO.builderThroughDOMStream;zO.RecordBatchReader.throughDOM=$O.recordBatchReaderThroughDOMStream;YO.RecordBatchWriter.throughDOM=JO.recordBatchWriterThroughDOMStream;var y=Ib();Object.defineProperty(d,"ArrowType",{enumerable:!0,get:function(){return y.ArrowType}});Object.defineProperty(d,"DateUnit",{enumerable:!0,get:function(){return y.DateUnit}});Object.defineProperty(d,"IntervalUnit",{enumerable:!0,get:function(){return y.IntervalUnit}});Object.defineProperty(d,"MessageHeader",{enumerable:!0,get:function(){return y.MessageHeader}});Object.defineProperty(d,"MetadataVersion",{enumerable:!0,get:function(){return y.MetadataVersion}});Object.defineProperty(d,"Precision",{enumerable:!0,get:function(){return y.Precision}});Object.defineProperty(d,"TimeUnit",{enumerable:!0,get:function(){return y.TimeUnit}});Object.defineProperty(d,"Type",{enumerable:!0,get:function(){return y.Type}});Object.defineProperty(d,"UnionMode",{enumerable:!0,get:function(){return y.UnionMode}});Object.defineProperty(d,"BufferType",{enumerable:!0,get:function(){return y.BufferType}});Object.defineProperty(d,"Data",{enumerable:!0,get:function(){return y.Data}});Object.defineProperty(d,"DataType",{enumerable:!0,get:function(){return y.DataType}});Object.defineProperty(d,"Null",{enumerable:!0,get:function(){return y.Null}});Object.defineProperty(d,"Bool",{enumerable:!0,get:function(){return y.Bool}});Object.defineProperty(d,"Int",{enumerable:!0,get:function(){return y.Int}});Object.defineProperty(d,"Int8",{enumerable:!0,get:function(){return y.Int8}});Object.defineProperty(d,"Int16",{enumerable:!0,get:function(){return y.Int16}});Object.defineProperty(d,"Int32",{enumerable:!0,get:function(){return y.Int32}});Object.defineProperty(d,"Int64",{enumerable:!0,get:function(){return y.Int64}});Object.defineProperty(d,"Uint8",{enumerable:!0,get:function(){return y.Uint8}});Object.defineProperty(d,"Uint16",{enumerable:!0,get:function(){return y.Uint16}});Object.defineProperty(d,"Uint32",{enumerable:!0,get:function(){return y.Uint32}});Object.defineProperty(d,"Uint64",{enumerable:!0,get:function(){return y.Uint64}});Object.defineProperty(d,"Float",{enumerable:!0,get:function(){return y.Float}});Object.defineProperty(d,"Float16",{enumerable:!0,get:function(){return y.Float16}});Object.defineProperty(d,"Float32",{enumerable:!0,get:function(){return y.Float32}});Object.defineProperty(d,"Float64",{enumerable:!0,get:function(){return y.Float64}});Object.defineProperty(d,"Utf8",{enumerable:!0,get:function(){return y.Utf8}});Object.defineProperty(d,"Binary",{enumerable:!0,get:function(){return y.Binary}});Object.defineProperty(d,"FixedSizeBinary",{enumerable:!0,get:function(){return y.FixedSizeBinary}});Object.defineProperty(d,"Date_",{enumerable:!0,get:function(){return y.Date_}});Object.defineProperty(d,"DateDay",{enumerable:!0,get:function(){return y.DateDay}});Object.defineProperty(d,"DateMillisecond",{enumerable:!0,get:function(){return y.DateMillisecond}});Object.defineProperty(d,"Timestamp",{enumerable:!0,get:function(){return y.Timestamp}});Object.defineProperty(d,"TimestampSecond",{enumerable:!0,get:function(){return y.TimestampSecond}});Object.defineProperty(d,"TimestampMillisecond",{enumerable:!0,get:function(){return y.TimestampMillisecond}});Object.defineProperty(d,"TimestampMicrosecond",{enumerable:!0,get:function(){return y.TimestampMicrosecond}});Object.defineProperty(d,"TimestampNanosecond",{enumerable:!0,get:function(){return y.TimestampNanosecond}});Object.defineProperty(d,"Time",{enumerable:!0,get:function(){return y.Time}});Object.defineProperty(d,"TimeSecond",{enumerable:!0,get:function(){return y.TimeSecond}});Object.defineProperty(d,"TimeMillisecond",{enumerable:!0,get:function(){return y.TimeMillisecond}});Object.defineProperty(d,"TimeMicrosecond",{enumerable:!0,get:function(){return y.TimeMicrosecond}});Object.defineProperty(d,"TimeNanosecond",{enumerable:!0,get:function(){return y.TimeNanosecond}});Object.defineProperty(d,"Decimal",{enumerable:!0,get:function(){return y.Decimal}});Object.defineProperty(d,"List",{enumerable:!0,get:function(){return y.List}});Object.defineProperty(d,"Struct",{enumerable:!0,get:function(){return y.Struct}});Object.defineProperty(d,"Union",{enumerable:!0,get:function(){return y.Union}});Object.defineProperty(d,"DenseUnion",{enumerable:!0,get:function(){return y.DenseUnion}});Object.defineProperty(d,"SparseUnion",{enumerable:!0,get:function(){return y.SparseUnion}});Object.defineProperty(d,"Dictionary",{enumerable:!0,get:function(){return y.Dictionary}});Object.defineProperty(d,"Interval",{enumerable:!0,get:function(){return y.Interval}});Object.defineProperty(d,"IntervalDayTime",{enumerable:!0,get:function(){return y.IntervalDayTime}});Object.defineProperty(d,"IntervalYearMonth",{enumerable:!0,get:function(){return y.IntervalYearMonth}});Object.defineProperty(d,"FixedSizeList",{enumerable:!0,get:function(){return y.FixedSizeList}});Object.defineProperty(d,"Map_",{enumerable:!0,get:function(){return y.Map_}});Object.defineProperty(d,"Table",{enumerable:!0,get:function(){return y.Table}});Object.defineProperty(d,"Column",{enumerable:!0,get:function(){return y.Column}});Object.defineProperty(d,"Schema",{enumerable:!0,get:function(){return y.Schema}});Object.defineProperty(d,"Field",{enumerable:!0,get:function(){return y.Field}});Object.defineProperty(d,"Visitor",{enumerable:!0,get:function(){return y.Visitor}});Object.defineProperty(d,"Vector",{enumerable:!0,get:function(){return y.Vector}});Object.defineProperty(d,"BaseVector",{enumerable:!0,get:function(){return y.BaseVector}});Object.defineProperty(d,"BinaryVector",{enumerable:!0,get:function(){return y.BinaryVector}});Object.defineProperty(d,"BoolVector",{enumerable:!0,get:function(){return y.BoolVector}});Object.defineProperty(d,"Chunked",{enumerable:!0,get:function(){return y.Chunked}});Object.defineProperty(d,"DateVector",{enumerable:!0,get:function(){return y.DateVector}});Object.defineProperty(d,"DateDayVector",{enumerable:!0,get:function(){return y.DateDayVector}});Object.defineProperty(d,"DateMillisecondVector",{enumerable:!0,get:function(){return y.DateMillisecondVector}});Object.defineProperty(d,"DecimalVector",{enumerable:!0,get:function(){return y.DecimalVector}});Object.defineProperty(d,"DictionaryVector",{enumerable:!0,get:function(){return y.DictionaryVector}});Object.defineProperty(d,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return y.FixedSizeBinaryVector}});Object.defineProperty(d,"FixedSizeListVector",{enumerable:!0,get:function(){return y.FixedSizeListVector}});Object.defineProperty(d,"FloatVector",{enumerable:!0,get:function(){return y.FloatVector}});Object.defineProperty(d,"Float16Vector",{enumerable:!0,get:function(){return y.Float16Vector}});Object.defineProperty(d,"Float32Vector",{enumerable:!0,get:function(){return y.Float32Vector}});Object.defineProperty(d,"Float64Vector",{enumerable:!0,get:function(){return y.Float64Vector}});Object.defineProperty(d,"IntervalVector",{enumerable:!0,get:function(){return y.IntervalVector}});Object.defineProperty(d,"IntervalDayTimeVector",{enumerable:!0,get:function(){return y.IntervalDayTimeVector}});Object.defineProperty(d,"IntervalYearMonthVector",{enumerable:!0,get:function(){return y.IntervalYearMonthVector}});Object.defineProperty(d,"IntVector",{enumerable:!0,get:function(){return y.IntVector}});Object.defineProperty(d,"Int8Vector",{enumerable:!0,get:function(){return y.Int8Vector}});Object.defineProperty(d,"Int16Vector",{enumerable:!0,get:function(){return y.Int16Vector}});Object.defineProperty(d,"Int32Vector",{enumerable:!0,get:function(){return y.Int32Vector}});Object.defineProperty(d,"Int64Vector",{enumerable:!0,get:function(){return y.Int64Vector}});Object.defineProperty(d,"Uint8Vector",{enumerable:!0,get:function(){return y.Uint8Vector}});Object.defineProperty(d,"Uint16Vector",{enumerable:!0,get:function(){return y.Uint16Vector}});Object.defineProperty(d,"Uint32Vector",{enumerable:!0,get:function(){return y.Uint32Vector}});Object.defineProperty(d,"Uint64Vector",{enumerable:!0,get:function(){return y.Uint64Vector}});Object.defineProperty(d,"ListVector",{enumerable:!0,get:function(){return y.ListVector}});Object.defineProperty(d,"MapVector",{enumerable:!0,get:function(){return y.MapVector}});Object.defineProperty(d,"NullVector",{enumerable:!0,get:function(){return y.NullVector}});Object.defineProperty(d,"StructVector",{enumerable:!0,get:function(){return y.StructVector}});Object.defineProperty(d,"TimestampVector",{enumerable:!0,get:function(){return y.TimestampVector}});Object.defineProperty(d,"TimestampSecondVector",{enumerable:!0,get:function(){return y.TimestampSecondVector}});Object.defineProperty(d,"TimestampMillisecondVector",{enumerable:!0,get:function(){return y.TimestampMillisecondVector}});Object.defineProperty(d,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return y.TimestampMicrosecondVector}});Object.defineProperty(d,"TimestampNanosecondVector",{enumerable:!0,get:function(){return y.TimestampNanosecondVector}});Object.defineProperty(d,"TimeVector",{enumerable:!0,get:function(){return y.TimeVector}});Object.defineProperty(d,"TimeSecondVector",{enumerable:!0,get:function(){return y.TimeSecondVector}});Object.defineProperty(d,"TimeMillisecondVector",{enumerable:!0,get:function(){return y.TimeMillisecondVector}});Object.defineProperty(d,"TimeMicrosecondVector",{enumerable:!0,get:function(){return y.TimeMicrosecondVector}});Object.defineProperty(d,"TimeNanosecondVector",{enumerable:!0,get:function(){return y.TimeNanosecondVector}});Object.defineProperty(d,"UnionVector",{enumerable:!0,get:function(){return y.UnionVector}});Object.defineProperty(d,"DenseUnionVector",{enumerable:!0,get:function(){return y.DenseUnionVector}});Object.defineProperty(d,"SparseUnionVector",{enumerable:!0,get:function(){return y.SparseUnionVector}});Object.defineProperty(d,"Utf8Vector",{enumerable:!0,get:function(){return y.Utf8Vector}});Object.defineProperty(d,"ByteStream",{enumerable:!0,get:function(){return y.ByteStream}});Object.defineProperty(d,"AsyncByteStream",{enumerable:!0,get:function(){return y.AsyncByteStream}});Object.defineProperty(d,"AsyncByteQueue",{enumerable:!0,get:function(){return y.AsyncByteQueue}});Object.defineProperty(d,"RecordBatchReader",{enumerable:!0,get:function(){return y.RecordBatchReader}});Object.defineProperty(d,"RecordBatchFileReader",{enumerable:!0,get:function(){return y.RecordBatchFileReader}});Object.defineProperty(d,"RecordBatchStreamReader",{enumerable:!0,get:function(){return y.RecordBatchStreamReader}});Object.defineProperty(d,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return y.AsyncRecordBatchFileReader}});Object.defineProperty(d,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return y.AsyncRecordBatchStreamReader}});Object.defineProperty(d,"RecordBatchWriter",{enumerable:!0,get:function(){return y.RecordBatchWriter}});Object.defineProperty(d,"RecordBatchFileWriter",{enumerable:!0,get:function(){return y.RecordBatchFileWriter}});Object.defineProperty(d,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return y.RecordBatchStreamWriter}});Object.defineProperty(d,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return y.RecordBatchJSONWriter}});Object.defineProperty(d,"MessageReader",{enumerable:!0,get:function(){return y.MessageReader}});Object.defineProperty(d,"AsyncMessageReader",{enumerable:!0,get:function(){return y.AsyncMessageReader}});Object.defineProperty(d,"JSONMessageReader",{enumerable:!0,get:function(){return y.JSONMessageReader}});Object.defineProperty(d,"Message",{enumerable:!0,get:function(){return y.Message}});Object.defineProperty(d,"RecordBatch",{enumerable:!0,get:function(){return y.RecordBatch}});Object.defineProperty(d,"DataFrame",{enumerable:!0,get:function(){return y.DataFrame}});Object.defineProperty(d,"FilteredDataFrame",{enumerable:!0,get:function(){return y.FilteredDataFrame}});Object.defineProperty(d,"CountByResult",{enumerable:!0,get:function(){return y.CountByResult}});Object.defineProperty(d,"predicate",{enumerable:!0,get:function(){return y.predicate}});Object.defineProperty(d,"util",{enumerable:!0,get:function(){return y.util}});Object.defineProperty(d,"Builder",{enumerable:!0,get:function(){return y.Builder}});Object.defineProperty(d,"BinaryBuilder",{enumerable:!0,get:function(){return y.BinaryBuilder}});Object.defineProperty(d,"BoolBuilder",{enumerable:!0,get:function(){return y.BoolBuilder}});Object.defineProperty(d,"DateBuilder",{enumerable:!0,get:function(){return y.DateBuilder}});Object.defineProperty(d,"DateDayBuilder",{enumerable:!0,get:function(){return y.DateDayBuilder}});Object.defineProperty(d,"DateMillisecondBuilder",{enumerable:!0,get:function(){return y.DateMillisecondBuilder}});Object.defineProperty(d,"DecimalBuilder",{enumerable:!0,get:function(){return y.DecimalBuilder}});Object.defineProperty(d,"DictionaryBuilder",{enumerable:!0,get:function(){return y.DictionaryBuilder}});Object.defineProperty(d,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return y.FixedSizeBinaryBuilder}});Object.defineProperty(d,"FixedSizeListBuilder",{enumerable:!0,get:function(){return y.FixedSizeListBuilder}});Object.defineProperty(d,"FloatBuilder",{enumerable:!0,get:function(){return y.FloatBuilder}});Object.defineProperty(d,"Float16Builder",{enumerable:!0,get:function(){return y.Float16Builder}});Object.defineProperty(d,"Float32Builder",{enumerable:!0,get:function(){return y.Float32Builder}});Object.defineProperty(d,"Float64Builder",{enumerable:!0,get:function(){return y.Float64Builder}});Object.defineProperty(d,"IntervalBuilder",{enumerable:!0,get:function(){return y.IntervalBuilder}});Object.defineProperty(d,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return y.IntervalDayTimeBuilder}});Object.defineProperty(d,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return y.IntervalYearMonthBuilder}});Object.defineProperty(d,"IntBuilder",{enumerable:!0,get:function(){return y.IntBuilder}});Object.defineProperty(d,"Int8Builder",{enumerable:!0,get:function(){return y.Int8Builder}});Object.defineProperty(d,"Int16Builder",{enumerable:!0,get:function(){return y.Int16Builder}});Object.defineProperty(d,"Int32Builder",{enumerable:!0,get:function(){return y.Int32Builder}});Object.defineProperty(d,"Int64Builder",{enumerable:!0,get:function(){return y.Int64Builder}});Object.defineProperty(d,"Uint8Builder",{enumerable:!0,get:function(){return y.Uint8Builder}});Object.defineProperty(d,"Uint16Builder",{enumerable:!0,get:function(){return y.Uint16Builder}});Object.defineProperty(d,"Uint32Builder",{enumerable:!0,get:function(){return y.Uint32Builder}});Object.defineProperty(d,"Uint64Builder",{enumerable:!0,get:function(){return y.Uint64Builder}});Object.defineProperty(d,"ListBuilder",{enumerable:!0,get:function(){return y.ListBuilder}});Object.defineProperty(d,"MapBuilder",{enumerable:!0,get:function(){return y.MapBuilder}});Object.defineProperty(d,"NullBuilder",{enumerable:!0,get:function(){return y.NullBuilder}});Object.defineProperty(d,"StructBuilder",{enumerable:!0,get:function(){return y.StructBuilder}});Object.defineProperty(d,"TimestampBuilder",{enumerable:!0,get:function(){return y.TimestampBuilder}});Object.defineProperty(d,"TimestampSecondBuilder",{enumerable:!0,get:function(){return y.TimestampSecondBuilder}});Object.defineProperty(d,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return y.TimestampMillisecondBuilder}});Object.defineProperty(d,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return y.TimestampMicrosecondBuilder}});Object.defineProperty(d,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return y.TimestampNanosecondBuilder}});Object.defineProperty(d,"TimeBuilder",{enumerable:!0,get:function(){return y.TimeBuilder}});Object.defineProperty(d,"TimeSecondBuilder",{enumerable:!0,get:function(){return y.TimeSecondBuilder}});Object.defineProperty(d,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return y.TimeMillisecondBuilder}});Object.defineProperty(d,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return y.TimeMicrosecondBuilder}});Object.defineProperty(d,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return y.TimeNanosecondBuilder}});Object.defineProperty(d,"UnionBuilder",{enumerable:!0,get:function(){return y.UnionBuilder}});Object.defineProperty(d,"DenseUnionBuilder",{enumerable:!0,get:function(){return y.DenseUnionBuilder}});Object.defineProperty(d,"SparseUnionBuilder",{enumerable:!0,get:function(){return y.SparseUnionBuilder}});Object.defineProperty(d,"Utf8Builder",{enumerable:!0,get:function(){return y.Utf8Builder}})});var Da=w(()=>{});var id=w(()=>{});var Ob=w(()=>{});var t0={};ig(t0,{registerWorker:()=>Ub});var rd=Os(hs());var Sb=Os(hs()),Aa=class extends Sb.AsyncByteQueue{flush(){let e=super.toUint8Array(!0);return this._values.length=0,e}};var Xl;(function(o){o[o.NONE=0]="NONE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARNING=3]="WARNING",o[o.ERROR=4]="ERROR"})(Xl||(Xl={}));var Zl;(function(o){o[o.NONE=0]="NONE",o[o.CONNECT=1]="CONNECT",o[o.DISCONNECT=2]="DISCONNECT",o[o.OPEN=3]="OPEN",o[o.QUERY=4]="QUERY"})(Zl||(Zl={}));var ed;(function(a){a[a.NONE=0]="NONE",a[a.OK=1]="OK",a[a.ERROR=2]="ERROR",a[a.START=3]="START",a[a.RUN=4]="RUN",a[a.CAPTURE=5]="CAPTURE"})(ed||(ed={}));var td;(function(o){o[o.NONE=0]="NONE",o[o.WEB_WORKER=1]="WEB_WORKER",o[o.NODE_WORKER=2]="NODE_WORKER",o[o.BINDINGS=3]="BINDINGS",o[o.ASYNC_DUCKDB=4]="ASYNC_DUCKDB"})(td||(td={}));var KO=class{constructor(e,t,n){this.db=e;this.conn=t;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 ie;(function(E){E.CLOSE_PREPARED="CLOSE_PREPARED",E.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",E.CONNECT="CONNECT",E.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",E.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",E.CREATE_PREPARED="CREATE_PREPARED",E.DISCONNECT="DISCONNECT",E.DROP_FILE="DROP_FILE",E.DROP_FILES="DROP_FILES",E.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",E.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",E.FLUSH_FILES="FLUSH_FILES",E.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",E.GET_VERSION="GET_VERSION",E.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",E.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",E.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",E.INSTANTIATE="INSTANTIATE",E.OPEN="OPEN",E.PING="PING",E.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",E.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",E.REGISTER_FILE_URL="REGISTER_FILE_URL",E.RESET="RESET",E.RUN_PREPARED="RUN_PREPARED",E.RUN_QUERY="RUN_QUERY",E.SEND_PREPARED="SEND_PREPARED",E.SEND_QUERY="SEND_QUERY",E.TOKENIZE="TOKENIZE"})(ie||(ie={}));var Re;(function(K){K.CONNECTION_INFO="CONNECTION_INFO",K.ERROR="ERROR",K.FEATURE_FLAGS="FEATURE_FLAGS",K.FILE_BUFFER="FILE_BUFFER",K.FILE_SIZE="FILE_SIZE",K.FILE_STATISTICS="FILE_STATISTICS",K.LOG="LOG",K.OK="OK",K.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",K.QUERY_PLAN="QUERY_PLAN",K.QUERY_RESULT="QUERY_RESULT",K.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",K.QUERY_START="QUERY_START",K.REGISTERED_FILE="REGISTERED_FILE",K.SCRIPT_TOKENS="SCRIPT_TOKENS",K.SUCCESS="SUCCESS",K.VERSION_STRING="VERSION_STRING"})(Re||(Re={}));var ee=Os(hs());function _i(r,e){switch(e.typeId){case ee.Type.Binary:return{name:r,type:"binary"};case ee.Type.Bool:return{name:r,type:"bool"};case ee.Type.Date:return{name:r,type:"date"};case ee.Type.DateDay:return{name:r,type:"date32[d]"};case ee.Type.DateMillisecond:return{name:r,type:"date64[ms]"};case ee.Type.Decimal:{let t=e;return{name:r,type:"decimal",precision:t.precision,scale:t.scale}}case ee.Type.Float:return{name:r,type:"float"};case ee.Type.Float16:return{name:r,type:"float16"};case ee.Type.Float32:return{name:r,type:"float32"};case ee.Type.Float64:return{name:r,type:"float64"};case ee.Type.Int:return{name:r,type:"int32"};case ee.Type.Int16:return{name:r,type:"int16"};case ee.Type.Int32:return{name:r,type:"int32"};case ee.Type.Int64:return{name:r,type:"int64"};case ee.Type.Uint16:return{name:r,type:"uint16"};case ee.Type.Uint32:return{name:r,type:"uint32"};case ee.Type.Uint64:return{name:r,type:"uint64"};case ee.Type.Uint8:return{name:r,type:"uint8"};case ee.Type.IntervalDayTime:return{name:r,type:"interval[dt]"};case ee.Type.IntervalYearMonth:return{name:r,type:"interval[m]"};case ee.Type.List:{let t=e;return{name:r,type:"list",children:[_i(t.valueField.name,t.valueField.type)]}}case ee.Type.FixedSizeBinary:return{name:r,type:"fixedsizebinary",byteWidth:e.byteWidth};case ee.Type.Null:return{name:r,type:"null"};case ee.Type.Utf8:return{name:r,type:"utf8"};case ee.Type.Struct:return{name:r,type:"struct",children:e.children.map(n=>_i(n.name,n.type))};case ee.Type.Time:return{name:r,type:"time[s]"};case ee.Type.TimeMicrosecond:return{name:r,type:"time[us]"};case ee.Type.TimeMillisecond:return{name:r,type:"time[ms]"};case ee.Type.TimeNanosecond:return{name:r,type:"time[ns]"};case ee.Type.TimeSecond:return{name:r,type:"time[s]"};case ee.Type.Timestamp:return{name:r,type:"timestamp",timezone:e.timezone||void 0};case ee.Type.TimestampSecond:return{name:r,type:"timestamp[s]",timezone:e.timezone||void 0};case ee.Type.TimestampMicrosecond:return{name:r,type:"timestamp[us]",timezone:e.timezone||void 0};case ee.Type.TimestampNanosecond:return{name:r,type:"timestamp[ns]",timezone:e.timezone||void 0};case ee.Type.TimestampMillisecond:return{name:r,type:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error(`unsupported arrow type: ${e.toString()}`)}var TD=new TextEncoder;var nd=class{constructor(){this._bindings=null;this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:Re.LOG,data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.OK,data:null},[])}failWith(e,t){let n={name:t.name,message:t.message,stack:t.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.ERROR,data:n},[])}async onMessage(e){switch(e.type){case ie.PING:this.sendOK(e);return;case ie.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(t){this._bindings=null,this.failWith(e,t)}return;default:break}if(!this._bindings)return this.failWith(e,new Error("duckdb is not initialized"));try{switch(e.type){case ie.GET_VERSION:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.VERSION_STRING,data:this._bindings.getVersion()},[]);break;case ie.GET_FEATURE_FLAGS:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.FEATURE_FLAGS,data:this._bindings.getFeatureFlags()},[]);break;case ie.RESET:this._bindings.reset(),this.sendOK(e);break;case ie.OPEN:this._bindings.open(e.data),this.sendOK(e);break;case ie.DROP_FILE:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.SUCCESS,data:this._bindings.dropFile(e.data)},[]);break;case ie.DROP_FILES:this._bindings.dropFiles(),this.sendOK(e);break;case ie.FLUSH_FILES:this._bindings.flushFiles(),this.sendOK(e);break;case ie.CONNECT:{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.CONNECTION_INFO,data:t.useUnsafe((n,i)=>i)},[]);break}case ie.DISCONNECT:this._bindings.disconnect(e.data),this.sendOK(e);break;case ie.CREATE_PREPARED:{let t=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.PREPARED_STATEMENT_ID,data:t},[]);break}case ie.CLOSE_PREPARED:{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case ie.RUN_PREPARED:{let t=this._bindings.runPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.QUERY_RESULT,data:t},[t.buffer]);break}case ie.RUN_QUERY:{let t=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.QUERY_RESULT,data:t},[t.buffer]);break}case ie.SEND_PREPARED:{let t=this._bindings.sendPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.QUERY_START,data:t},[t.buffer]);break}case ie.SEND_QUERY:{let t=this._bindings.sendQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.QUERY_START,data:t},[t.buffer]);break}case ie.FETCH_QUERY_RESULTS:{let t=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.QUERY_RESULT_CHUNK,data:t},[t.buffer]);break}case ie.REGISTER_FILE_URL:this._bindings.registerFileURL(e.data[0],e.data[1]),this.sendOK(e);break;case ie.REGISTER_FILE_BUFFER:this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case ie.REGISTER_FILE_HANDLE:this._bindings.registerFileHandle(e.data[0],e.data[1]),this.sendOK(e);break;case ie.COPY_FILE_TO_PATH:this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case ie.COPY_FILE_TO_BUFFER:{let t=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.FILE_BUFFER,data:t},[]);break}case ie.COLLECT_FILE_STATISTICS:this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case ie.EXPORT_FILE_STATISTICS:{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.FILE_STATISTICS,data:this._bindings.exportFileStatistics(e.data)},[]);break}case ie.INSERT_ARROW_FROM_IPC_STREAM:{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case ie.INSERT_CSV_FROM_PATH:{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case ie.INSERT_JSON_FROM_PATH:{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case ie.TOKENIZE:{let t=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Re.SCRIPT_TOKENS,data:t},[]);break}}}catch(t){return this.failWith(e,t)}}};var Db={},QO=function(){var r=Db.url;return function(e){e=e||{};var t=typeof e!="undefined"?e:{},n,i;t.ready=new Promise(function(h,p){n=h,i=p});var o={},a;for(a in t)t.hasOwnProperty(a)&&(o[a]=t[a]);var u=[],f="./this.program",s=function(h,p){throw p},c=typeof window=="object",_=typeof importScripts=="function",U=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",J="";function tt(h){return t.locateFile?t.locateFile(h,J):J+h}var Mt,It,K,Mb;function Pb(h){if(!(h instanceof Is)){var p=h;Jr("exiting due to exception: "+p)}}var yn,bn;U?(_?J=Da().dirname(J)+"/":J=__dirname+"/",Mt=function(p,m){return yn||(yn=id()),bn||(bn=Da()),p=bn.normalize(p),yn.readFileSync(p,m?null:"utf8")},K=function(p){var m=Mt(p,!0);return m.buffer||(m=new Uint8Array(m)),E(m.buffer),m},It=function(p,m,I){yn||(yn=id()),bn||(bn=Da()),p=bn.normalize(p),yn.readFile(p,function(C,Q){C?I(C):m(Q.buffer)})},process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),u=process.argv.slice(2),process.on("uncaughtException",function(h){if(!(h instanceof Is))throw h}),process.on("unhandledRejection",function(h){throw h}),s=function(h,p){if(Ea())throw process.exitCode=h,p;Pb(p),process.exit(h)},t.inspect=function(){return"[Emscripten Module object]"}):(c||_)&&(_?J=self.location.href:typeof document!="undefined"&&document.currentScript&&(J=document.currentScript.src),r&&(J=r),J.indexOf("blob:")!==0?J=J.substr(0,J.replace(/[?#].*/,"").lastIndexOf("/")+1):J="",Mt=function(h){var p=new XMLHttpRequest;return p.open("GET",h,!1),p.send(null),p.responseText},_&&(K=function(h){var p=new XMLHttpRequest;return p.open("GET",h,!1),p.responseType="arraybuffer",p.send(null),new Uint8Array(p.response)}),It=function(h,p,m){var I=new XMLHttpRequest;I.open("GET",h,!0),I.responseType="arraybuffer",I.onload=function(){if(I.status==200||I.status==0&&I.response){p(I.response);return}m()},I.onerror=m,I.send(null)},Mb=function(h){document.title=h});var Vb=t.print||console.log.bind(console),Jr=t.printErr||console.warn.bind(console);for(a in o)o.hasOwnProperty(a)&&(t[a]=o[a]);o=null,t.arguments&&(u=t.arguments),t.thisProgram&&(f=t.thisProgram),t.quit&&(s=t.quit);var wi;t.wasmBinary&&(wi=t.wasmBinary);var Nb=t.noExitRuntime||!0;typeof WebAssembly!="object"&&ir("no native wasm support detected");var ps,Fa=!1,ys;function E(h,p){h||ir("Assertion failed: "+p)}function kb(h){var p=t["_"+h];return E(p,"Cannot call unknown function "+h+", make sure it is exported"),p}function Lb(h,p,m,I,C){var Q={string:function(Ee){var sr=0;if(Ee!=null&&Ee!==0){var Ii=(Ee.length<<2)+1;sr=Na(Ii),xb(Ee,sr,Ii)}return sr},array:function(Ee){var sr=Na(Ee.length);return pd(Ee,sr),sr}};function W(Ee){return p==="string"?bs(Ee):p==="boolean"?Boolean(Ee):Ee}var H=kb(h),me=[],Pt=0;if(I)for(var Vt=0;Vt<I.length;Vt++){var vi=Q[m[Vt]];vi?(Pt===0&&(Pt=vd()),me[Vt]=vi(I[Vt])):me[Vt]=I[Vt]}var Qe=H.apply(null,me);function Nt(Ee){return Pt!==0&&Id(Pt),W(Ee)}return Qe=Nt(Qe),Qe}var dd=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function fd(h,p,m){for(var I=p+m,C=p;h[C]&&!(C>=I);)++C;if(C-p>16&&h.subarray&&dd)return dd.decode(h.subarray(p,C));for(var Q="";p<C;){var W=h[p++];if(!(W&128)){Q+=String.fromCharCode(W);continue}var H=h[p++]&63;if((W&224)==192){Q+=String.fromCharCode((W&31)<<6|H);continue}var me=h[p++]&63;if((W&240)==224?W=(W&15)<<12|H<<6|me:W=(W&7)<<18|H<<12|me<<6|h[p++]&63,W<65536)Q+=String.fromCharCode(W);else{var Pt=W-65536;Q+=String.fromCharCode(55296|Pt>>10,56320|Pt&1023)}}return Q}function bs(h,p){return h?fd(_n,h,p):""}function hd(h,p,m,I){if(!(I>0))return 0;for(var C=m,Q=m+I-1,W=0;W<h.length;++W){var H=h.charCodeAt(W);if(H>=55296&&H<=57343){var me=h.charCodeAt(++W);H=65536+((H&1023)<<10)|me&1023}if(H<=127){if(m>=Q)break;p[m++]=H}else if(H<=2047){if(m+1>=Q)break;p[m++]=192|H>>6,p[m++]=128|H&63}else if(H<=65535){if(m+2>=Q)break;p[m++]=224|H>>12,p[m++]=128|H>>6&63,p[m++]=128|H&63}else{if(m+3>=Q)break;p[m++]=240|H>>18,p[m++]=128|H>>12&63,p[m++]=128|H>>6&63,p[m++]=128|H&63}}return p[m]=0,m-C}function xb(h,p,m){return hd(h,_n,p,m)}function Cb(h){for(var p=0,m=0;m<h.length;++m){var I=h.charCodeAt(m);I>=55296&&I<=57343&&(I=65536+((I&1023)<<10)|h.charCodeAt(++m)&1023),I<=127?++p:I<=2047?p+=2:I<=65535?p+=3:p+=4}return p}function pd(h,p){mn.set(h,p)}function jb(h,p,m){for(var I=0;I<h.length;++I)mn[p++>>0]=h.charCodeAt(I);m||(mn[p>>0]=0)}function qb(h,p){return h%p>0&&(h+=p-h%p),h}var yd,mn,_n,Wb,zb,fe,Yb,Hb,Gb;function bd(h){yd=h,t.HEAP8=mn=new Int8Array(h),t.HEAP16=Wb=new Int16Array(h),t.HEAP32=fe=new Int32Array(h),t.HEAPU8=_n=new Uint8Array(h),t.HEAPU16=zb=new Uint16Array(h),t.HEAPU32=Yb=new Uint32Array(h),t.HEAPF32=Hb=new Float32Array(h),t.HEAPF64=Gb=new Float64Array(h)}var r0=t.INITIAL_MEMORY||16777216,Ra,md=[],_d=[],$b=[],gd=[],Jb=!1,Kb=!1,Qb=0;function Ea(){return Nb||Qb>0}function Xb(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)nm(t.preRun.shift());ms(md)}function Zb(){Jb=!0,ms(_d)}function em(){ms($b)}function tm(){Kb=!0}function rm(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)sm(t.postRun.shift());ms(gd)}function nm(h){md.unshift(h)}function im(h){_d.unshift(h)}function sm(h){gd.unshift(h)}var Kr=0,Ua=null,Ti=null;function om(h){Kr++,t.monitorRunDependencies&&t.monitorRunDependencies(Kr)}function am(h){if(Kr--,t.monitorRunDependencies&&t.monitorRunDependencies(Kr),Kr==0&&(Ua!==null&&(clearInterval(Ua),Ua=null),Ti)){var p=Ti;Ti=null,p()}}t.preloadedImages={},t.preloadedAudios={};function ir(h){t.onAbort&&t.onAbort(h),h="Aborted("+h+")",Jr(h),Fa=!0,ys=1,h+=". Build with -s ASSERTIONS=1 for more info.";var p=new WebAssembly.RuntimeError(h);throw i(p),p}var um="data:application/octet-stream;base64,";function wd(h){return h.startsWith(um)}var ct;t.locateFile?(ct="duckdb_wasm.wasm",wd(ct)||(ct=tt(ct))):ct=new URL("duckdb_wasm.wasm",Db.url).toString();function Td(h){try{if(h==ct&&wi)return new Uint8Array(wi);if(K)return K(h);throw"both async and sync fetching of the wasm failed"}catch(p){ir(p)}}function cm(){return!wi&&(c||_)&&typeof fetch=="function"?fetch(ct,{credentials:"same-origin"}).then(function(h){if(!h.ok)throw"failed to load wasm binary file at '"+ct+"'";return h.arrayBuffer()}).catch(function(){return Td(ct)}):Promise.resolve().then(function(){return Td(ct)})}function lm(){var h={a:f_};function p(W,H){var me=W.exports;t.asm=me,ps=t.asm.W,bd(ps.buffer),Ra=t.asm.Z,im(t.asm.X),am("wasm-instantiate")}om("wasm-instantiate");function m(W){p(W.instance)}function I(W){return cm().then(function(H){return WebAssembly.instantiate(H,h)}).then(function(H){return H}).then(W,function(H){Jr("failed to asynchronously prepare wasm: "+H),ir(H)})}function C(){return!wi&&typeof WebAssembly.instantiateStreaming=="function"&&!wd(ct)&&typeof fetch=="function"?fetch(ct,{credentials:"same-origin"}).then(function(W){var H=WebAssembly.instantiateStreaming(W,h);return H.then(m,function(me){return Jr("wasm streaming compile failed: "+me),Jr("falling back to ArrayBuffer instantiation"),I(m)})}):I(m)}if(t.instantiateWasm)try{var Q=t.instantiateWasm(h,p);return Q}catch(W){return Jr("Module.instantiateWasm callback failed with error: "+W),!1}return C().catch(i),{}}function ms(h){for(;h.length>0;){var p=h.shift();if(typeof p=="function"){p(t);continue}var m=p.func;typeof m=="number"?p.arg===void 0?Ra.get(m)():Ra.get(m)(p.arg):m(p.arg===void 0?null:p.arg)}}function dm(h){if(h instanceof Is||h=="unwind")return ys;s(1,h)}var Le={mappings:{},buffers:[null,[],[]],printChar:function(h,p){var m=Le.buffers[h];p===0||p===10?((h===1?Vb:Jr)(fd(m,0)),m.length=0):m.push(p)},varargs:void 0,get:function(){Le.varargs+=4;var h=fe[Le.varargs-4>>2];return h},getStr:function(h){var p=bs(h);return p},get64:function(h,p){return h}};function fm(h,p){return h=Le.getStr(h),Le.doAccess(h,p)}function hm(h){return fe[Bd()>>2]=h,h}function pm(h,p,m){return Le.varargs=m,0}function ym(h,p){}function bm(h,p,m,I){}function mm(h,p,m){}function _m(){return 42}function gm(h,p,m){return Le.varargs=m,0}function wm(h,p,m){return 0}function Tm(h,p){return h=Le.getStr(h),Le.doMkdir(h,p)}function Bm(h,p,m){Le.varargs=m}function vm(h,p){}function Im(h){}function Sm(h,p){}function Om(h){}function Am(h,p){ir("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Dm(h,p){ir("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Fm(){ir("")}var Ma;U?Ma=function(){var h=process.hrtime();return h[0]*1e3+h[1]/1e6}:Ma=function(){return performance.now()};var Rm=!0;function Em(h,p){var m;if(h===0)m=Date.now();else if((h===1||h===4)&&Rm)m=Ma();else return hm(28),-1;return fe[p>>2]=m/1e3|0,fe[p+4>>2]=m%1e3*1e3*1e3|0,0}function Um(h,p){return globalThis.DUCKDB_RUNTIME.createDirectory(t,h,p)}function Mm(h,p){return globalThis.DUCKDB_RUNTIME.checkDirectory(t,h,p)}function Pm(h,p){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(t,h,p)}function Vm(h,p){return globalThis.DUCKDB_RUNTIME.removeDirectory(t,h,p)}function Nm(h){return globalThis.DUCKDB_RUNTIME.closeFile(t,h)}function km(h,p){return globalThis.DUCKDB_RUNTIME.checkFile(t,h,p)}function Lm(h){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(t,h)}function xm(h){return globalThis.DUCKDB_RUNTIME.getFileSize(t,h)}function Cm(h,p,m,I){return globalThis.DUCKDB_RUNTIME.moveFile(t,h,p,m,I)}function jm(h){return globalThis.DUCKDB_RUNTIME.openFile(t,h)}function qm(h,p,m,I){return globalThis.DUCKDB_RUNTIME.readFile(t,h,p,m,I)}function Wm(h,p){return globalThis.DUCKDB_RUNTIME.truncateFile(t,h,p)}function zm(h,p,m,I){return globalThis.DUCKDB_RUNTIME.writeFile(t,h,p,m,I)}function Ym(h,p){return globalThis.DUCKDB_RUNTIME.glob(t,h,p)}function Hm(h){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(t,h)}function Gm(){return 2147483648}function $m(h,p,m){_n.copyWithin(h,p,p+m)}function Jm(h){try{return ps.grow(h-yd.byteLength+65535>>>16),bd(ps.buffer),1}catch{}}function Km(h){var p=_n.length;h=h>>>0;var m=2147483648;if(h>m)return!1;for(var I=1;I<=4;I*=2){var C=p*(1+.2/I);C=Math.min(C,h+100663296);var Q=Math.min(m,qb(Math.max(h,C),65536)),W=Jm(Q);if(W)return!0}return!1}var Pa={};function Qm(){return f||"./this.program"}function Bi(){if(!Bi.strings){var h=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",p={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:h,_:Qm()};for(var m in Pa)Pa[m]===void 0?delete p[m]:p[m]=Pa[m];var I=[];for(var m in p)I.push(m+"="+p[m]);Bi.strings=I}return Bi.strings}function Xm(h,p){var m=0;return Bi().forEach(function(I,C){var Q=p+m;fe[h+C*4>>2]=Q,jb(I,Q),m+=I.length+1}),0}function Zm(h,p){var m=Bi();fe[h>>2]=m.length;var I=0;return m.forEach(function(C){I+=C.length+1}),fe[p>>2]=I,0}function e_(h){return 0}function t_(h,p){var m=h==1||h==2?2:ir();return mn[p>>0]=m,0}function r_(h,p,m,I,C,Q){var W=Le.getStreamFromFD(h),H=Le.doReadv(W,p,m,I);return fe[Q>>2]=H,0}function n_(h,p,m,I,C,Q){var W=Le.getStreamFromFD(h),H=Le.doWritev(W,p,m,I);return fe[Q>>2]=H,0}function i_(h,p,m,I){var C=Le.getStreamFromFD(h),Q=Le.doReadv(C,p,m);return fe[I>>2]=Q,0}function s_(h,p,m,I,C){}function o_(h){var p=Le.getStreamFromFD(h);return p.stream_ops&&p.stream_ops.fsync?-p.stream_ops.fsync(p):0}function a_(h,p,m,I){for(var C=0,Q=0;Q<m;Q++){for(var W=fe[p+Q*8>>2],H=fe[p+(Q*8+4)>>2],me=0;me<H;me++)Le.printChar(h,_n[W+me]);C+=H}return fe[I>>2]=C,0}function u_(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var h=new Uint8Array(1);return function(){return crypto.getRandomValues(h),h[0]}}else if(U)try{var p=Ob();return function(){return p.randomBytes(1)[0]}}catch{}return function(){ir("randomDevice")}}function _s(h,p){_s.randomDevice||(_s.randomDevice=u_());for(var m=0;m<p;m++)mn[h+m>>0]=_s.randomDevice();return 0}function gs(h){return h%4==0&&(h%100!=0||h%400==0)}function Va(h,p){for(var m=0,I=0;I<=p;m+=h[I++]);return m}var ws=[31,29,31,30,31,30,31,31,30,31,30,31],Ts=[31,28,31,30,31,30,31,31,30,31,30,31];function Bs(h,p){for(var m=new Date(h.getTime());p>0;){var I=gs(m.getFullYear()),C=m.getMonth(),Q=(I?ws:Ts)[C];if(p>Q-m.getDate())p-=Q-m.getDate()+1,m.setDate(1),C<11?m.setMonth(C+1):(m.setMonth(0),m.setFullYear(m.getFullYear()+1));else return m.setDate(m.getDate()+p),m}return m}function c_(h,p,m,I){var C=fe[I+40>>2],Q={tm_sec:fe[I>>2],tm_min:fe[I+4>>2],tm_hour:fe[I+8>>2],tm_mday:fe[I+12>>2],tm_mon:fe[I+16>>2],tm_year:fe[I+20>>2],tm_wday:fe[I+24>>2],tm_yday:fe[I+28>>2],tm_isdst:fe[I+32>>2],tm_gmtoff:fe[I+36>>2],tm_zone:C?bs(C):""},W=bs(m),H={"%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 me in H)W=W.replace(new RegExp(me,"g"),H[me]);var Pt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Vt=["January","February","March","April","May","June","July","August","September","October","November","December"];function vi(S,M,Ue){for(var ce=typeof S=="number"?S.toString():S||"";ce.length<M;)ce=Ue[0]+ce;return ce}function Qe(S,M){return vi(S,M,"0")}function Nt(S,M){function Ue(kt){return kt<0?-1:kt>0?1:0}var ce;return(ce=Ue(S.getFullYear()-M.getFullYear()))===0&&(ce=Ue(S.getMonth()-M.getMonth()))===0&&(ce=Ue(S.getDate()-M.getDate())),ce}function Ee(S){switch(S.getDay()){case 0:return new Date(S.getFullYear()-1,11,29);case 1:return S;case 2:return new Date(S.getFullYear(),0,3);case 3:return new Date(S.getFullYear(),0,2);case 4:return new Date(S.getFullYear(),0,1);case 5:return new Date(S.getFullYear()-1,11,31);case 6:return new Date(S.getFullYear()-1,11,30)}}function sr(S){var M=Bs(new Date(S.tm_year+1900,0,1),S.tm_yday),Ue=new Date(M.getFullYear(),0,4),ce=new Date(M.getFullYear()+1,0,4),kt=Ee(Ue),mr=Ee(ce);return Nt(kt,M)<=0?Nt(mr,M)<=0?M.getFullYear()+1:M.getFullYear():M.getFullYear()-1}var Ii={"%a":function(S){return Pt[S.tm_wday].substring(0,3)},"%A":function(S){return Pt[S.tm_wday]},"%b":function(S){return Vt[S.tm_mon].substring(0,3)},"%B":function(S){return Vt[S.tm_mon]},"%C":function(S){var M=S.tm_year+1900;return Qe(M/100|0,2)},"%d":function(S){return Qe(S.tm_mday,2)},"%e":function(S){return vi(S.tm_mday,2," ")},"%g":function(S){return sr(S).toString().substring(2)},"%G":function(S){return sr(S)},"%H":function(S){return Qe(S.tm_hour,2)},"%I":function(S){var M=S.tm_hour;return M==0?M=12:M>12&&(M-=12),Qe(M,2)},"%j":function(S){return Qe(S.tm_mday+Va(gs(S.tm_year+1900)?ws:Ts,S.tm_mon-1),3)},"%m":function(S){return Qe(S.tm_mon+1,2)},"%M":function(S){return Qe(S.tm_min,2)},"%n":function(){return`
18
- `},"%p":function(S){return S.tm_hour>=0&&S.tm_hour<12?"AM":"PM"},"%S":function(S){return Qe(S.tm_sec,2)},"%t":function(){return" "},"%u":function(S){return S.tm_wday||7},"%U":function(S){var M=new Date(S.tm_year+1900,0,1),Ue=M.getDay()===0?M:Bs(M,7-M.getDay()),ce=new Date(S.tm_year+1900,S.tm_mon,S.tm_mday);if(Nt(Ue,ce)<0){var kt=Va(gs(ce.getFullYear())?ws:Ts,ce.getMonth()-1)-31,mr=31-Ue.getDate(),Qr=mr+kt+ce.getDate();return Qe(Math.ceil(Qr/7),2)}return Nt(Ue,M)===0?"01":"00"},"%V":function(S){var M=new Date(S.tm_year+1900,0,4),Ue=new Date(S.tm_year+1901,0,4),ce=Ee(M),kt=Ee(Ue),mr=Bs(new Date(S.tm_year+1900,0,1),S.tm_yday);if(Nt(mr,ce)<0)return"53";if(Nt(kt,mr)<=0)return"01";var Qr;return ce.getFullYear()<S.tm_year+1900?Qr=S.tm_yday+32-ce.getDate():Qr=S.tm_yday+1-ce.getDate(),Qe(Math.ceil(Qr/7),2)},"%w":function(S){return S.tm_wday},"%W":function(S){var M=new Date(S.tm_year,0,1),Ue=M.getDay()===1?M:Bs(M,M.getDay()===0?1:7-M.getDay()+1),ce=new Date(S.tm_year+1900,S.tm_mon,S.tm_mday);if(Nt(Ue,ce)<0){var kt=Va(gs(ce.getFullYear())?ws:Ts,ce.getMonth()-1)-31,mr=31-Ue.getDate(),Qr=mr+kt+ce.getDate();return Qe(Math.ceil(Qr/7),2)}return Nt(Ue,M)===0?"01":"00"},"%y":function(S){return(S.tm_year+1900).toString().substring(2)},"%Y":function(S){return S.tm_year+1900},"%z":function(S){var M=S.tm_gmtoff,Ue=M>=0;return M=Math.abs(M)/60,M=M/60*100+M%60,(Ue?"+":"-")+String("0000"+M).slice(-4)},"%Z":function(S){return S.tm_zone},"%%":function(){return"%"}};for(var me in Ii)W.includes(me)&&(W=W.replace(new RegExp(me,"g"),Ii[me](Q)));var La=d_(W,!1);return La.length>p?0:(pd(La,h),La.length-1)}function l_(h,p,m,I){return c_(h,p,m,I)}function d_(h,p,m){var I=m>0?m:Cb(h)+1,C=new Array(I),Q=hd(h,C,0,C.length);return p&&(C.length=Q),C}var f_={u:fm,e:pm,O:ym,N:bm,P:mm,j:_m,R:gm,M:wm,Q:Tm,m:Bm,s:vm,i:Im,l:Sm,k:Om,x:Am,v:Dm,a:Fm,h:Em,D:Um,E:Mm,B:Pm,C:Vm,w:Nm,z:km,G:Lm,J:xm,A:Cm,K:jm,d:qm,F:Wm,I:zm,y:Ym,g:Hm,H:Gm,U:$m,V:Km,T:Xm,n:Zm,b:e_,o:t_,q:r_,p:n_,f:i_,r:s_,t:o_,c:a_,L:_s,S:l_},n0=lm(),h_=t.___wasm_call_ctors=function(){return(h_=t.___wasm_call_ctors=t.asm.X).apply(null,arguments)},p_=t._main=function(){return(p_=t._main=t.asm.Y).apply(null,arguments)},y_=t._duckdb_web_fs_glob_add_path=function(){return(y_=t._duckdb_web_fs_glob_add_path=t.asm._).apply(null,arguments)},b_=t._duckdb_web_clear_response=function(){return(b_=t._duckdb_web_clear_response=t.asm.$).apply(null,arguments)},m_=t._duckdb_web_fail_with=function(){return(m_=t._duckdb_web_fail_with=t.asm.aa).apply(null,arguments)},__=t._duckdb_web_reset=function(){return(__=t._duckdb_web_reset=t.asm.ba).apply(null,arguments)},g_=t._duckdb_web_connect=function(){return(g_=t._duckdb_web_connect=t.asm.ca).apply(null,arguments)},w_=t._duckdb_web_disconnect=function(){return(w_=t._duckdb_web_disconnect=t.asm.da).apply(null,arguments)},T_=t._duckdb_web_flush_files=function(){return(T_=t._duckdb_web_flush_files=t.asm.ea).apply(null,arguments)},B_=t._duckdb_web_flush_file=function(){return(B_=t._duckdb_web_flush_file=t.asm.fa).apply(null,arguments)},v_=t._duckdb_web_open=function(){return(v_=t._duckdb_web_open=t.asm.ga).apply(null,arguments)},I_=t._duckdb_web_collect_file_stats=function(){return(I_=t._duckdb_web_collect_file_stats=t.asm.ha).apply(null,arguments)},S_=t._duckdb_web_export_file_stats=function(){return(S_=t._duckdb_web_export_file_stats=t.asm.ia).apply(null,arguments)},O_=t._duckdb_web_fs_drop_file=function(){return(O_=t._duckdb_web_fs_drop_file=t.asm.ja).apply(null,arguments)},A_=t._duckdb_web_fs_drop_files=function(){return(A_=t._duckdb_web_fs_drop_files=t.asm.ka).apply(null,arguments)},D_=t._duckdb_web_fs_get_file_info=function(){return(D_=t._duckdb_web_fs_get_file_info=t.asm.la).apply(null,arguments)},F_=t._duckdb_web_fs_set_file_descriptor=function(){return(F_=t._duckdb_web_fs_set_file_descriptor=t.asm.ma).apply(null,arguments)},R_=t._duckdb_web_fs_register_file_url=function(){return(R_=t._duckdb_web_fs_register_file_url=t.asm.na).apply(null,arguments)},E_=t._duckdb_web_fs_register_file_buffer=function(){return(E_=t._duckdb_web_fs_register_file_buffer=t.asm.oa).apply(null,arguments)},U_=t._duckdb_web_copy_file_to_buffer=function(){return(U_=t._duckdb_web_copy_file_to_buffer=t.asm.pa).apply(null,arguments)},M_=t._duckdb_web_copy_file_to_path=function(){return(M_=t._duckdb_web_copy_file_to_path=t.asm.qa).apply(null,arguments)},P_=t._duckdb_web_get_version=function(){return(P_=t._duckdb_web_get_version=t.asm.ra).apply(null,arguments)},V_=t._duckdb_web_get_feature_flags=function(){return(V_=t._duckdb_web_get_feature_flags=t.asm.sa).apply(null,arguments)},N_=t._duckdb_web_tokenize=function(){return(N_=t._duckdb_web_tokenize=t.asm.ta).apply(null,arguments)},k_=t._duckdb_web_prepared_create=function(){return(k_=t._duckdb_web_prepared_create=t.asm.ua).apply(null,arguments)},L_=t._duckdb_web_prepared_close=function(){return(L_=t._duckdb_web_prepared_close=t.asm.va).apply(null,arguments)},x_=t._duckdb_web_prepared_run=function(){return(x_=t._duckdb_web_prepared_run=t.asm.wa).apply(null,arguments)},C_=t._duckdb_web_prepared_send=function(){return(C_=t._duckdb_web_prepared_send=t.asm.xa).apply(null,arguments)},j_=t._duckdb_web_query_run=function(){return(j_=t._duckdb_web_query_run=t.asm.ya).apply(null,arguments)},q_=t._duckdb_web_query_send=function(){return(q_=t._duckdb_web_query_send=t.asm.za).apply(null,arguments)},W_=t._duckdb_web_query_fetch_results=function(){return(W_=t._duckdb_web_query_fetch_results=t.asm.Aa).apply(null,arguments)},z_=t._duckdb_web_insert_arrow_from_ipc_stream=function(){return(z_=t._duckdb_web_insert_arrow_from_ipc_stream=t.asm.Ba).apply(null,arguments)},Y_=t._duckdb_web_insert_csv_from_path=function(){return(Y_=t._duckdb_web_insert_csv_from_path=t.asm.Ca).apply(null,arguments)},H_=t._duckdb_web_insert_json_from_path=function(){return(H_=t._duckdb_web_insert_json_from_path=t.asm.Da).apply(null,arguments)},Bd=t.___errno_location=function(){return(Bd=t.___errno_location=t.asm.Ea).apply(null,arguments)},vd=t.stackSave=function(){return(vd=t.stackSave=t.asm.Fa).apply(null,arguments)},Id=t.stackRestore=function(){return(Id=t.stackRestore=t.asm.Ga).apply(null,arguments)},Na=t.stackAlloc=function(){return(Na=t.stackAlloc=t.asm.Ha).apply(null,arguments)},G_=t._malloc=function(){return(G_=t._malloc=t.asm.Ia).apply(null,arguments)},$_=t._free=function(){return($_=t._free=t.asm.Ja).apply(null,arguments)};t.ccall=Lb;var vs;function Is(h){this.name="ExitStatus",this.message="Program terminated with exit("+h+")",this.status=h}var J_=!1;Ti=function h(){vs||ka(),vs||(Ti=h)};function K_(h){var p=t._main,m=0,I=0;try{var C=p(m,I);return Q_(C,!0),C}catch(Q){return dm(Q)}finally{J_=!0}}function ka(h){if(h=h||u,Kr>0||(Xb(),Kr>0))return;function p(){vs||(vs=!0,t.calledRun=!0,!Fa&&(Zb(),em(),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Sd&&K_(h),rm()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),p()},1)):p()}t.run=ka;function Q_(h,p){ys=h,Ea()||tm(),X_(h)}function X_(h){ys=h,Ea()||(t.onExit&&t.onExit(h),Fa=!0),s(h,new Is(h))}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();var Sd=!0;return t.noInitialRun&&(Sd=!1),ka(),e.ready}}(),Ab=QO;var Ut=Os(hs());var sd=class{constructor(e,t){this._bindings=e,this._conn=t}close(){this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}query(e){let t=this._bindings.runQuery(this._conn,e),n=Ut.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),Ut.Table.from(n)}send(e){let t=this._bindings.sendQuery(this._conn,e),n=new od(this._bindings,this._conn,t),i=Ut.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new Fb(this._bindings,this._conn,t)}insertArrowVectors(e,t){this.insertArrowTable(Ut.Table.new(e),t)}insertArrowTable(e,t){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,t)}insertArrowBatches(e,t,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 Aa,o=new Ut.RecordBatchStreamWriter().reset(i,e),a=!0;for(let u of t)a||this._bindings.insertArrowFromIPCStream(this._conn,i.flush(),n),a=!1,o.write(u);o.finish(),this._bindings.insertArrowFromIPCStream(this._conn,i.flush(),n)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},od=class{constructor(e,t,n){this.bindings=e;this.conn=t;this.header=n;this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},Fb=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),n=Ut.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),Ut.Table.from(n)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new od(this.bindings,this.connectionId,t),i=Ut.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}};var de;(function(e){e[e.SUCCESS=0]="SUCCESS"})(de||(de={}));function XO(){let r=new TextDecoder;return e=>(typeof SharedArrayBuffer!="undefined"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),r.decode(e))}var ZO=XO();function Ne(r,e){console.error(e),r.ccall("duckdb_web_fail_with",null,["string"],[e])}function gi(r,e,t){let n=r.HEAPU8.subarray(e,e+t),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function ae(r,e,t){return ZO(r.HEAPU8.subarray(e,e+t))}var Ge;(function(n){n[n.BUFFER=0]="BUFFER",n[n.NATIVE=1]="NATIVE",n[n.HTTP=3]="HTTP"})(Ge||(Ge={}));function be(r,e,t,n){let i=r.stackSave(),o=r.stackAlloc(3*8);t.unshift("number"),n.unshift(o),r.ccall(e,null,t,n);let a=r.HEAPF64[(o>>3)+0],u=r.HEAPF64[(o>>3)+1],f=r.HEAPF64[(o>>3)+2];return r.stackRestore(i),[a,u,f]}function ke(r){r.ccall("duckdb_web_clear_response",null,[],[])}var ad=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),n=new Uint8Array(new ArrayBuffer(e.byteLength));n.set(e.subarray(7*8)),this.totalFileReadsCold=t[0],this.totalFileReadsAhead=t[1],this.totalFileReadsCached=t[2],this.totalFileWrites=t[3],this.totalPageAccesses=t[4],this.totalPageLoads=t[5],this.blockSize=t[6],this.blockStats=n}getBlockStats(e,t){return t=t||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},t.file_writes=this.blockStats[e*3+0]&15,t.file_reads_cold=this.blockStats[e*3+0]>>4,t.file_reads_ahead=this.blockStats[e*3+1]&15,t.file_reads_cached=this.blockStats[e*3+1]>>4,t.page_accesses=this.blockStats[e*3+1]&15,t.page_loads=this.blockStats[e*3+1]>>4,t}};var e0=new TextEncoder,Rb;(function(o){o[o.WASM_EXCEPTIONS=1]="WASM_EXCEPTIONS",o[o.WASM_THREADS=2]="WASM_THREADS",o[o.WASM_SIMD=4]="WASM_SIMD",o[o.WASM_BULK_MEMORY=8]="WASM_BULK_MEMORY",o[o.EMIT_BIGINT=16]="EMIT_BIGINT"})(Rb||(Rb={}));var ud=class{constructor(e,t){this._instance=null;this._initPromise=null;this._initPromiseResolver=()=>{};this._logger=e,this._runtime=t}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[t,n,i]=be(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==de.SUCCESS)throw new Error(ae(this.mod,n,i));ke(this.mod)}reset(){let[e,t,n]=be(this.mod,"duckdb_web_reset",[],[]);if(e!==de.SUCCESS)throw new Error(ae(this.mod,t,n));ke(this.mod)}getVersion(){let[e,t,n]=be(this.mod,"duckdb_web_get_version",[],[]);if(e!==de.SUCCESS)throw new Error(ae(this.mod,t,n));let i=ae(this.mod,t,n);return ke(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,n,i]=be(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==de.SUCCESS)throw new Error(ae(this.mod,n,i));let o=ae(this.mod,n,i);return ke(this.mod),JSON.parse(o)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new sd(this,e)}disconnect(e){this.mod.ccall("duckdb_web_disconnect",null,["number"],[e])}runQuery(e,t){let[n,i,o]=be(this.mod,"duckdb_web_query_run",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(ae(this.mod,i,o));let a=gi(this.mod,i,o);return ke(this.mod),a}sendQuery(e,t){let[n,i,o]=be(this.mod,"duckdb_web_query_send",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(ae(this.mod,i,o));let a=gi(this.mod,i,o);return ke(this.mod),a}fetchQueryResults(e){let[t,n,i]=be(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==de.SUCCESS)throw new Error(ae(this.mod,n,i));let o=gi(this.mod,n,i);return ke(this.mod),o}createPrepared(e,t){let[n,i,o]=be(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(ae(this.mod,i,o));return ke(this.mod),i}closePrepared(e,t){let[n,i,o]=be(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(n!==de.SUCCESS)throw new Error(ae(this.mod,i,o));ke(this.mod)}runPrepared(e,t,n){let[i,o,a]=be(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==de.SUCCESS)throw new Error(ae(this.mod,o,a));let u=gi(this.mod,o,a);return ke(this.mod),u}sendPrepared(e,t,n){let[i,o,a]=be(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==de.SUCCESS)throw new Error(ae(this.mod,o,a));let u=gi(this.mod,o,a);return ke(this.mod),u}insertArrowFromIPCStream(e,t,n){let i=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(i,i+t.length).set(t);let a=n?JSON.stringify(n):"",[u,f,s]=be(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,i,t.length,a]);if(u!==de.SUCCESS)throw new Error(ae(this.mod,f,s))}insertCSVFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let s in n.columns)n.columnsFlat.push(_i(s,n.columns[s]))}let i={...n};i.columns=i.columnsFlat,delete i.columnsFlat;let o=JSON.stringify(i),[a,u,f]=be(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,o]);if(a!==de.SUCCESS)throw new Error(ae(this.mod,u,f))}insertJSONFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let s in n.columns)n.columnsFlat.push(_i(s,n.columns[s]))}let i={...n};i.columns=i.columnsFlat,delete i.columnsFlat;let o=JSON.stringify(i),[a,u,f]=be(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,o]);if(a!==de.SUCCESS)throw new Error(ae(this.mod,u,f))}registerFileURL(e,t){t===void 0&&(t=e);let[n,i,o]=be(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(ae(this.mod,i,o));ke(this.mod)}registerFileText(e,t){let n=e0.encode(t);this.registerFileBuffer(e,n)}registerFileBuffer(e,t){let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let[o,a,u]=be(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,n,t.length]);if(o!==de.SUCCESS)throw new Error(ae(this.mod,a,u));ke(this.mod)}registerFileHandle(e,t){let[n,i,o]=be(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,e]);if(n!==de.SUCCESS)throw new Error(ae(this.mod,i,o));if(ke(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let a of this.pthread.runningWorkers)a.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let a of this.pthread.unusedWorkers)a.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,t){let[n,i,o]=be(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(ae(this.mod,i,o));ke(this.mod)}copyFileToBuffer(e){let[t,n,i]=be(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==de.SUCCESS)throw new Error(ae(this.mod,n,i));let o=this.mod.HEAPU8.subarray(n,n+i),a=new Uint8Array(o.length);return a.set(o),ke(this.mod),a}collectFileStatistics(e,t){let[n,i,o]=be(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(n!==de.SUCCESS)throw new Error(ae(this.mod,i,o))}exportFileStatistics(e){let[t,n,i]=be(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==de.SUCCESS)throw new Error(ae(this.mod,n,i));return new ad(this.mod.HEAPU8.subarray(n,n+i))}};var cd=class extends ud{constructor(e,t,n,i){super(e,t);this.mainModuleURL=n,this.pthreadWorkerURL=i}locateFile(e,t){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error(`WASM instantiation requested unexpected file: prefix=${t} path=${e}`)}instantiateWasm(e,t){return globalThis.DUCKDB_RUNTIME=this._runtime,WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(fetch(this.mainModuleURL),e).then(n=>{t(n.instance,n.module)}):fetch(this.mainModuleURL).then(n=>n.arrayBuffer()).then(n=>WebAssembly.instantiate(n,e).then(i=>{t(i.instance,i.module)})).catch(n=>{console.error("Failed to instantiate WASM:",n)}),[]}};var ld=class extends cd{constructor(e,t,n,i=null){super(e,t,n,i)}instantiateImpl(e){return Ab({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var $e={fileInfoCache:new Map,getFileInfo(r,e){try{let t=$e.fileInfoCache.get(e);if(t)return t;let[n,i,o]=be(r,"duckdb_web_fs_get_file_info",["number"],[e]);if(n!==de.SUCCESS)throw new Error(ae(r,i,o));let a=ae(r,i,o);ke(r);let u=JSON.parse(a);if(u==null)return null;let f={...u,blob:null};return $e.fileInfoCache.set(e,f),f}catch(t){return Ne(r,t.toString()),null}},testPlatformFeature:(r,e)=>{switch(e){case 1:return typeof BigInt64Array!="undefined";default:return console.warn(`test for unknown feature: ${e}`),!1}},openFile:(r,e)=>{try{$e.fileInfoCache.delete(e);let t=$e.getFileInfo(r,e);switch(t?.data_protocol){case Ge.HTTP:{let n=new XMLHttpRequest;n.open("HEAD",t.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 Ne(r,`File does not support range requests: ${t.file_name}`),0;break}case Ge.NATIVE:{if(!$e._files?.get(t.file_name))return Ne(r,`No handle available for file: ${t.file_name}`),0;break}}}catch(t){Ne(r,t.toString())}return 0},glob:(r,e,t)=>{try{let n=ae(r,e,t);if(n.startsWith("http")){let i=new XMLHttpRequest;i.open("HEAD",n,!1),i.setRequestHeader("Range","bytes=0-"),i.send(null);let o=!1;if(i.status==206)o=!0;else if(i.status==200)o=i.getResponseHeader("Accept-Ranges")==="bytes";else{Ne(r,`HEAD request failed: ${n}`);return}if(!o){Ne(r,`File does not support range requests: ${n}`);return}r.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}}catch(n){return Ne(r,n.toString()),0}},checkFile:(r,e,t)=>{try{let n=ae(r,e,t);if(n.startsWith("http")){let i=new XMLHttpRequest;i.open("HEAD",n,!1),i.setRequestHeader("Range","bytes=0-"),i.send(null);let o=!1;if(i.status==206)o=!0;else if(i.status==200)o=i.getResponseHeader("Accept-Ranges")==="bytes";else return!1;return!!o}}catch{return!1}return!1},syncFile:(r,e)=>{},closeFile:(r,e)=>{let t=$e.getFileInfo(r,e);switch($e.fileInfoCache.delete(e),t?.data_protocol){case Ge.HTTP:break;case Ge.NATIVE:return}},truncateFile:(r,e,t)=>{switch($e.getFileInfo(r,e)?.data_protocol){case Ge.HTTP:Ne(r,"Cannot truncate a http file");return;case Ge.NATIVE:Ne(r,"truncateFile not implemented");return}return 0},readFile(r,e,t,n,i){try{let o=$e.getFileInfo(r,e);switch(o?.data_protocol){case Ge.HTTP:{if(!o.data_url)return Ne(r,`Missing data URL for file ${e}`),0;let a=new XMLHttpRequest;if(a.open("GET",o.data_url,!1),a.responseType="arraybuffer",a.setRequestHeader("Range",`bytes=${i}-${i+n-1}`),a.send(null),a.status==206||a.status==200&&n==a.response.byteLength&&i==0){let u=new Uint8Array(a.response,0,Math.min(a.response.byteLength,n));return r.HEAPU8.set(u,t),u.byteLength}else return a.status==200?(Ne(r,`Range request for ${o.data_url} did not return a partial response: ${a.status} "${a.statusText}"`),0):(Ne(r,`Range request for ${o.data_url} did returned non-success status: ${a.status} "${a.statusText}"`),0)}case Ge.NATIVE:{let a=$e._files?.get(o.file_name);if(!a)return Ne(r,`No handle available for file: ${o.file_name}`),0;let u=a.slice(i,i+n),f=new Uint8Array(new FileReaderSync().readAsArrayBuffer(u));return r.HEAPU8.set(f,t),f.byteLength}}return 0}catch(o){return Ne(r,o.toString()),0}},writeFile:(r,e,t,n,i)=>{switch($e.getFileInfo(r,e)?.data_protocol){case Ge.HTTP:return Ne(r,"Cannot write to HTTP file"),0;case Ge.NATIVE:return Ne(r,"writefile not implemented"),0}return 0},getFileSize:(r,e)=>{try{let t=$e.getFileInfo(r,e);switch(t?.data_protocol){case Ge.NATIVE:{let n=$e._files?.get(t.file_name);return n?n.size:(Ne(r,`No handle available for file: ${t.file_name}`),0)}case Ge.HTTP:{if(!t.data_url)throw new Error(`Missing data URL for file ${e}`);let n=new XMLHttpRequest;if(n.open("HEAD",t.data_url,!1),n.send(null),n.status==200){let i=n.getResponseHeader("Content-Length");if(i)return parseInt(i);throw Error(`HEAD ${t.data_url} does not contain the HTTP header: Content-Length`)}else throw Error(`HEAD ${t.data_url} returned non-success status: ${n.status} "${n.statusText}"`)}}return 0}catch(t){return Ne(r,t.toString()),0}},getLastFileModificationTime:(r,e)=>{let t=$e.getFileInfo(r,e);switch(t?.data_protocol){case Ge.NATIVE:{if(!$e._files?.get(t.file_name))throw Error(`No handle available for file: ${t.file_name}`);return 0}case Ge.HTTP:return new Date().getTime()}return 0},checkDirectory:(r,e,t)=>!1,createDirectory:(r,e,t)=>{},removeDirectory:(r,e,t)=>{},listDirectoryEntries:(r,e,t)=>!1,moveFile:(r,e,t,n,i)=>{},removeFile:(r,e,t)=>{}};var Eb=class extends nd{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t){return await new ld(this,$e,e,t).instantiate()}};function Ub(){let r=new Eb;globalThis.onmessage=async e=>{await r.onMessage(e.data)}}Ub();return t0;})();
19
- //# sourceMappingURL=duckdb-browser-async-next.worker.js.map