@duckdb/duckdb-wasm 0.1.13-dev25.0 → 0.1.13-dev33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/duckdb-browser-blocking.js +20492 -16
- package/dist/duckdb-browser-blocking.js.map +3 -3
- package/dist/duckdb-browser-next-coi.pthread.worker.js +2 -2
- package/dist/duckdb-browser-next-coi.pthread.worker.js.map +3 -3
- package/dist/duckdb-browser-next-coi.worker.js +8 -8
- package/dist/duckdb-browser-next-coi.worker.js.map +3 -3
- package/dist/duckdb-browser-next.worker.js +9 -9
- package/dist/duckdb-browser-next.worker.js.map +3 -3
- package/dist/duckdb-browser.js +3 -3
- package/dist/duckdb-browser.js.map +1 -1
- package/dist/duckdb-browser.mjs +31 -1
- package/dist/duckdb-browser.mjs.map +3 -3
- package/dist/duckdb-browser.worker.js +8 -8
- package/dist/duckdb-browser.worker.js.map +3 -3
- package/dist/duckdb-node-blocking.cjs +3 -3
- package/dist/duckdb-node-blocking.cjs.map +3 -3
- package/dist/duckdb-node-next.worker.cjs +3 -3
- package/dist/duckdb-node-next.worker.cjs.map +3 -3
- package/dist/duckdb-node.cjs +1 -1
- package/dist/duckdb-node.cjs.map +1 -1
- package/dist/duckdb-node.mjs +31 -1
- package/dist/duckdb-node.mjs.map +3 -3
- package/dist/duckdb-node.worker.cjs +2 -2
- package/dist/duckdb-node.worker.cjs.map +3 -3
- package/dist/tests-browser.js +5330 -5325
- package/dist/tests-browser.js.map +3 -3
- package/dist/tests-node.cjs +59 -59
- package/dist/tests-node.cjs.map +3 -3
- package/package.json +24 -9
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var duckdb=(()=>{var UT=Object.create;var So=Object.defineProperty;var PT=Object.getOwnPropertyDescriptor;var kT=Object.getOwnPropertyNames;var VT=Object.getPrototypeOf,NT=Object.prototype.hasOwnProperty;var Mh=r=>So(r,"__esModule",{value:!0});var LT=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),xT=(r,e)=>{Mh(r);for(var t in e)So(r,t,{get:e[t],enumerable:!0})},CT=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of kT(e))!NT.call(r,n)&&n!=="default"&&So(r,n,{get:()=>e[n],enumerable:!(t=PT(e,n))||t.enumerable});return r},nr=r=>CT(Mh(So(r!=null?UT(VT(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var ot=v((VE,Oo)=>{var Uh,Ph,kh,Vh,Nh,Lh,xh,Ch,jh,Bo,xc,qh,Wh,zh,si,Hh,Yh,Gh,Kh,$h,Jh,Qh,Zh,Ao;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof Oo=="object"&&typeof Oo.exports=="object"?r(t(e,t(Oo.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){return n[s]=i?i(s,a):a}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};Uh=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},Ph=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},kh=function(n,i){var s={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(s[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(n);o<a.length;o++)i.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(n,a[o])&&(s[a[o]]=n[a[o]]);return s},Vh=function(n,i,s,a){var o=arguments.length,d=o<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,i,s,a);else for(var _=n.length-1;_>=0;_--)(h=n[_])&&(d=(o<3?h(d):o>3?h(i,s,d):h(i,s))||d);return o>3&&d&&Object.defineProperty(i,s,d),d},Nh=function(n,i){return function(s,a){i(s,a,n)}},Lh=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},xh=function(n,i,s,a){function o(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function _(re){try{U(a.next(re))}catch(_e){h(_e)}}function F(re){try{U(a.throw(re))}catch(_e){h(_e)}}function U(re){re.done?d(re.value):o(re.value).then(_,F)}U((a=a.apply(n,i||[])).next())})},Ch=function(n,i){var s={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},a,o,d,h;return h={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function _(U){return function(re){return F([U,re])}}function F(U){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,o&&(d=U[0]&2?o.return:U[0]?o.throw||((d=o.return)&&d.call(o),0):o.next)&&!(d=d.call(o,U[1])).done)return d;switch(o=0,d&&(U=[U[0]&2,d.value]),U[0]){case 0:case 1:d=U;break;case 4:return s.label++,{value:U[1],done:!1};case 5:s.label++,o=U[1],U=[0];continue;case 7:U=s.ops.pop(),s.trys.pop();continue;default:if(d=s.trys,!(d=d.length>0&&d[d.length-1])&&(U[0]===6||U[0]===2)){s=0;continue}if(U[0]===3&&(!d||U[1]>d[0]&&U[1]<d[3])){s.label=U[1];break}if(U[0]===6&&s.label<d[1]){s.label=d[1],d=U;break}if(d&&s.label<d[2]){s.label=d[2],s.ops.push(U);break}d[2]&&s.ops.pop(),s.trys.pop();continue}U=i.call(n,s)}catch(re){U=[6,re],o=0}finally{a=d=0}if(U[0]&5)throw U[1];return{value:U[0]?U[1]:void 0,done:!0}}},jh=function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&Ao(i,n,s)},Ao=Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]},Bo=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&n[i],a=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},xc=function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var a=s.call(n),o,d=[],h;try{for(;(i===void 0||i-- >0)&&!(o=a.next()).done;)d.push(o.value)}catch(_){h={error:_}}finally{try{o&&!o.done&&(s=a.return)&&s.call(a)}finally{if(h)throw h.error}}return d},qh=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(xc(arguments[i]));return n},Wh=function(){for(var n=0,i=0,s=arguments.length;i<s;i++)n+=arguments[i].length;for(var a=Array(n),o=0,i=0;i<s;i++)for(var d=arguments[i],h=0,_=d.length;h<_;h++,o++)a[o]=d[h];return a},zh=function(n,i,s){if(s||arguments.length===2)for(var a=0,o=i.length,d;a<o;a++)(d||!(a in i))&&(d||(d=Array.prototype.slice.call(i,0,a)),d[a]=i[a]);return n.concat(d||Array.prototype.slice.call(i))},si=function(n){return this instanceof si?(this.v=n,this):new si(n)},Hh=function(n,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s.apply(n,i||[]),o,d=[];return o={},h("next"),h("throw"),h("return"),o[Symbol.asyncIterator]=function(){return this},o;function h(me){a[me]&&(o[me]=function(it){return new Promise(function(Ne,S){d.push([me,it,Ne,S])>1||_(me,it)})})}function _(me,it){try{F(a[me](it))}catch(Ne){_e(d[0][3],Ne)}}function F(me){me.value instanceof si?Promise.resolve(me.value.v).then(U,re):_e(d[0][2],me)}function U(me){_("next",me)}function re(me){_("throw",me)}function _e(me,it){me(it),d.shift(),d.length&&_(d[0][0],d[0][1])}},Yh=function(n){var i,s;return i={},a("next"),a("throw",function(o){throw o}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(o,d){i[o]=n[o]?function(h){return(s=!s)?{value:si(n[o](h)),done:o==="return"}:d?d(h):h}:d}},Gh=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof Bo=="function"?Bo(n):n[Symbol.iterator](),s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s);function a(d){s[d]=n[d]&&function(h){return new Promise(function(_,F){h=n[d](h),o(_,F,h.done,h.value)})}}function o(d,h,_,F){Promise.resolve(F).then(function(U){d({value:U,done:_})},h)}},Kh=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};$h=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&Ao(i,n,s);return t(i,n),i},Jh=function(n){return n&&n.__esModule?n:{default:n}},Qh=function(n,i,s,a){if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?a:s==="a"?a.call(n):a?a.value:i.get(n)},Zh=function(n,i,s,a,o){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!o:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?o.call(n,s):o?o.value=s:i.set(n,s),s},r("__extends",Uh),r("__assign",Ph),r("__rest",kh),r("__decorate",Vh),r("__param",Nh),r("__metadata",Lh),r("__awaiter",xh),r("__generator",Ch),r("__exportStar",jh),r("__createBinding",Ao),r("__values",Bo),r("__read",xc),r("__spread",qh),r("__spreadArrays",Wh),r("__spreadArray",zh),r("__await",si),r("__asyncGenerator",Hh),r("__asyncDelegator",Yh),r("__asyncValues",Gh),r("__makeTemplateObject",Kh),r("__importStar",$h),r("__importDefault",Jh),r("__classPrivateFieldGet",Qh),r("__classPrivateFieldSet",Zh)})});var Ar=v(Xh=>{var m={};m.Offset;m.Table;m.SIZEOF_SHORT=2;m.SIZEOF_INT=4;m.FILE_IDENTIFIER_LENGTH=4;m.SIZE_PREFIX_LENGTH=4;m.Encoding={UTF8_BYTES:1,UTF16_STRING:2};m.int32=new Int32Array(2);m.float32=new Float32Array(m.int32.buffer);m.float64=new Float64Array(m.int32.buffer);m.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;m.Long=function(r,e){this.low=r|0,this.high=e|0};m.Long.create=function(r,e){return r==0&&e==0?m.Long.ZERO:new m.Long(r,e)};m.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};m.Long.prototype.equals=function(r){return this.low==r.low&&this.high==r.high};m.Long.ZERO=new m.Long(0,0);m.Builder=function(r){if(r)var e=r;else var e=1024;this.bb=m.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};m.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};m.Builder.prototype.forceDefaults=function(r){this.force_defaults=r};m.Builder.prototype.dataBuffer=function(){return this.bb};m.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};m.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=m.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(t)};m.Builder.prototype.pad=function(r){for(var e=0;e<r;e++)this.bb.writeInt8(--this.space,0)};m.Builder.prototype.writeInt8=function(r){this.bb.writeInt8(this.space-=1,r)};m.Builder.prototype.writeInt16=function(r){this.bb.writeInt16(this.space-=2,r)};m.Builder.prototype.writeInt32=function(r){this.bb.writeInt32(this.space-=4,r)};m.Builder.prototype.writeInt64=function(r){this.bb.writeInt64(this.space-=8,r)};m.Builder.prototype.writeFloat32=function(r){this.bb.writeFloat32(this.space-=4,r)};m.Builder.prototype.writeFloat64=function(r){this.bb.writeFloat64(this.space-=8,r)};m.Builder.prototype.addInt8=function(r){this.prep(1,0),this.writeInt8(r)};m.Builder.prototype.addInt16=function(r){this.prep(2,0),this.writeInt16(r)};m.Builder.prototype.addInt32=function(r){this.prep(4,0),this.writeInt32(r)};m.Builder.prototype.addInt64=function(r){this.prep(8,0),this.writeInt64(r)};m.Builder.prototype.addFloat32=function(r){this.prep(4,0),this.writeFloat32(r)};m.Builder.prototype.addFloat64=function(r){this.prep(8,0),this.writeFloat64(r)};m.Builder.prototype.addFieldInt8=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt8(e),this.slot(r))};m.Builder.prototype.addFieldInt16=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt16(e),this.slot(r))};m.Builder.prototype.addFieldInt32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt32(e),this.slot(r))};m.Builder.prototype.addFieldInt64=function(r,e,t){(this.force_defaults||!e.equals(t))&&(this.addInt64(e),this.slot(r))};m.Builder.prototype.addFieldFloat32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat32(e),this.slot(r))};m.Builder.prototype.addFieldFloat64=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat64(e),this.slot(r))};m.Builder.prototype.addFieldOffset=function(r,e,t){(this.force_defaults||e!=t)&&(this.addOffset(e),this.slot(r))};m.Builder.prototype.addFieldStruct=function(r,e,t){e!=t&&(this.nested(e),this.slot(r))};m.Builder.prototype.nested=function(r){if(r!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};m.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};m.Builder.prototype.slot=function(r){this.vtable[r]=this.offset()};m.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};m.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=m.ByteBuffer.allocate(t);return n.setPosition(t-e),n.bytes().set(r.bytes(),t-e),n};m.Builder.prototype.addOffset=function(r){this.prep(m.SIZEOF_INT,0),this.writeInt32(this.offset()-r+m.SIZEOF_INT)};m.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()};m.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)*m.SIZEOF_SHORT;this.addInt16(i);var s=0,a=this.space;e:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(o)){for(var d=m.SIZEOF_SHORT;d<i;d+=m.SIZEOF_SHORT)if(this.bb.readInt16(a+d)!=this.bb.readInt16(o+d))continue e;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-r,this.bb.writeInt32(this.space,s-r)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-r,this.offset()-r)),this.isNested=!1,r};m.Builder.prototype.finish=function(r,e,t){var n=t?m.SIZE_PREFIX_LENGTH:0;if(e){var i=e;if(this.prep(this.minalign,m.SIZEOF_INT+m.FILE_IDENTIFIER_LENGTH+n),i.length!=m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+m.FILE_IDENTIFIER_LENGTH);for(var s=m.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(i.charCodeAt(s))}this.prep(this.minalign,m.SIZEOF_INT+n),this.addOffset(r),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)};m.Builder.prototype.finishSizePrefixed=function(r,e){this.finish(r,e,!0)};m.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")};m.Builder.prototype.startVector=function(r,e,t){this.notNested(),this.vector_num_elems=e,this.prep(m.SIZEOF_INT,r*e),this.prep(t,r*e)};m.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};m.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 s=r.charCodeAt(t++);n=(i<<10)+s+(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,o=this.bb.bytes();t<e.length;t++)o[a++]=e[t];return this.endVector()};m.Builder.prototype.createLong=function(r,e){return m.Long.create(r,e)};m.ByteBuffer=function(r){this.bytes_=r,this.position_=0};m.ByteBuffer.allocate=function(r){return new m.ByteBuffer(new Uint8Array(r))};m.ByteBuffer.prototype.clear=function(){this.position_=0};m.ByteBuffer.prototype.bytes=function(){return this.bytes_};m.ByteBuffer.prototype.position=function(){return this.position_};m.ByteBuffer.prototype.setPosition=function(r){this.position_=r};m.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};m.ByteBuffer.prototype.readInt8=function(r){return this.readUint8(r)<<24>>24};m.ByteBuffer.prototype.readUint8=function(r){return this.bytes_[r]};m.ByteBuffer.prototype.readInt16=function(r){return this.readUint16(r)<<16>>16};m.ByteBuffer.prototype.readUint16=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8};m.ByteBuffer.prototype.readInt32=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8|this.bytes_[r+2]<<16|this.bytes_[r+3]<<24};m.ByteBuffer.prototype.readUint32=function(r){return this.readInt32(r)>>>0};m.ByteBuffer.prototype.readInt64=function(r){return new m.Long(this.readInt32(r),this.readInt32(r+4))};m.ByteBuffer.prototype.readUint64=function(r){return new m.Long(this.readUint32(r),this.readUint32(r+4))};m.ByteBuffer.prototype.readFloat32=function(r){return m.int32[0]=this.readInt32(r),m.float32[0]};m.ByteBuffer.prototype.readFloat64=function(r){return m.int32[m.isLittleEndian?0:1]=this.readInt32(r),m.int32[m.isLittleEndian?1:0]=this.readInt32(r+4),m.float64[0]};m.ByteBuffer.prototype.writeInt8=function(r,e){this.bytes_[r]=e};m.ByteBuffer.prototype.writeUint8=function(r,e){this.bytes_[r]=e};m.ByteBuffer.prototype.writeInt16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};m.ByteBuffer.prototype.writeUint16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};m.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};m.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};m.ByteBuffer.prototype.writeInt64=function(r,e){this.writeInt32(r,e.low),this.writeInt32(r+4,e.high)};m.ByteBuffer.prototype.writeUint64=function(r,e){this.writeUint32(r,e.low),this.writeUint32(r+4,e.high)};m.ByteBuffer.prototype.writeFloat32=function(r,e){m.float32[0]=e,this.writeInt32(r,m.int32[0])};m.ByteBuffer.prototype.writeFloat64=function(r,e){m.float64[0]=e,this.writeInt32(r,m.int32[m.isLittleEndian?0:1]),this.writeInt32(r+4,m.int32[m.isLittleEndian?1:0])};m.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+m.SIZEOF_INT+m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var r="",e=0;e<m.FILE_IDENTIFIER_LENGTH;e++)r+=String.fromCharCode(this.readInt8(this.position_+m.SIZEOF_INT+e));return r};m.ByteBuffer.prototype.__offset=function(r,e){var t=r-this.readInt32(r);return e<this.readInt16(t)?this.readInt16(t+e):0};m.ByteBuffer.prototype.__union=function(r,e){return r.bb_pos=e+this.readInt32(e),r.bb=this,r};m.ByteBuffer.prototype.__string=function(r,e){r+=this.readInt32(r);var t=this.readInt32(r),n="",i=0;if(r+=m.SIZEOF_INT,e===m.Encoding.UTF8_BYTES)return this.bytes_.subarray(r,r+t);for(;i<t;){var s,a=this.readUint8(r+i++);if(a<192)s=a;else{var o=this.readUint8(r+i++);if(a<224)s=(a&31)<<6|o&63;else{var d=this.readUint8(r+i++);if(a<240)s=(a&15)<<12|(o&63)<<6|d&63;else{var h=this.readUint8(r+i++);s=(a&7)<<18|(o&63)<<12|(d&63)<<6|h&63}}}s<65536?n+=String.fromCharCode(s):(s-=65536,n+=String.fromCharCode((s>>10)+55296,(s&(1<<10)-1)+56320))}return n};m.ByteBuffer.prototype.__indirect=function(r){return r+this.readInt32(r)};m.ByteBuffer.prototype.__vector=function(r){return r+this.readInt32(r)+m.SIZEOF_INT};m.ByteBuffer.prototype.__vector_len=function(r){return this.readInt32(r+this.readInt32(r))};m.ByteBuffer.prototype.__has_identifier=function(r){if(r.length!=m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+m.FILE_IDENTIFIER_LENGTH);for(var e=0;e<m.FILE_IDENTIFIER_LENGTH;e++)if(r.charCodeAt(e)!=this.readInt8(this.position_+m.SIZEOF_INT+e))return!1;return!0};m.ByteBuffer.prototype.createLong=function(r,e){return m.Long.create(r,e)};Xh.flatbuffers=m});var Rn=v(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.encodeUtf8=oi.decodeUtf8=void 0;var jT=new TextDecoder("utf-8");oi.decodeUtf8=r=>jT.decode(r);var qT=new TextEncoder;oi.encodeUtf8=r=>qT.encode(r)});var ai=v(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.AsyncQueue=pt.ReadableInterop=pt.ArrowJSON=pt.ITERATOR_DONE=void 0;var Ts=ot(),ep=Is();pt.ITERATOR_DONE=Object.freeze({done:!0,value:void 0});var tp=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}};pt.ArrowJSON=tp;var Cc=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())}};pt.ReadableInterop=Cc;var rp=class extends Cc{constructor(){super();this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return Ts.__awaiter(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(pt.ITERATOR_DONE);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return ep.default.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return ep.default.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return Ts.__awaiter(this,void 0,void 0,function*(){return yield this.abort(e),pt.ITERATOR_DONE})}return(e){return Ts.__awaiter(this,void 0,void 0,function*(){return yield this.close(),pt.ITERATOR_DONE})}read(e){return Ts.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return Ts.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,n)=>{this.resolvers.push({resolve:t,reject:n})}):Promise.resolve(pt.ITERATOR_DONE)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};pt.AsyncQueue=rp});var at=v(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.isReadableNodeStream=P.isWritableNodeStream=P.isReadableDOMStream=P.isWritableDOMStream=P.isFetchResponse=P.isFSReadStream=P.isFileHandle=P.isUnderlyingSink=P.isIteratorResult=P.isArrayLike=P.isArrowJSON=P.isAsyncIterable=P.isIterable=P.isObservable=P.isPromise=P.isObject=P.BigUint64ArrayAvailable=P.BigUint64Array=P.BigInt64ArrayAvailable=P.BigInt64Array=P.BigIntAvailable=P.BigInt=void 0;var Eo=ai(),[WT,zT]=(()=>{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]})();P.BigInt=WT;P.BigIntAvailable=zT;var[HT,YT]=(()=>{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]})();P.BigInt64Array=HT;P.BigInt64ArrayAvailable=YT;var[GT,KT]=(()=>{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]})();P.BigUint64Array=GT;P.BigUint64ArrayAvailable=KT;var jc=r=>typeof r=="number",np=r=>typeof r=="boolean",et=r=>typeof r=="function";P.isObject=r=>r!=null&&Object(r)===r;P.isPromise=r=>P.isObject(r)&&et(r.then);P.isObservable=r=>P.isObject(r)&&et(r.subscribe);P.isIterable=r=>P.isObject(r)&&et(r[Symbol.iterator]);P.isAsyncIterable=r=>P.isObject(r)&&et(r[Symbol.asyncIterator]);P.isArrowJSON=r=>P.isObject(r)&&P.isObject(r.schema);P.isArrayLike=r=>P.isObject(r)&&jc(r.length);P.isIteratorResult=r=>P.isObject(r)&&"done"in r&&"value"in r;P.isUnderlyingSink=r=>P.isObject(r)&&et(r.abort)&&et(r.close)&&et(r.start)&&et(r.write);P.isFileHandle=r=>P.isObject(r)&&et(r.stat)&&jc(r.fd);P.isFSReadStream=r=>P.isReadableNodeStream(r)&&jc(r.bytesRead);P.isFetchResponse=r=>P.isObject(r)&&P.isReadableDOMStream(r.body);P.isWritableDOMStream=r=>P.isObject(r)&&et(r.abort)&&et(r.getWriter)&&!(r instanceof Eo.ReadableInterop);P.isReadableDOMStream=r=>P.isObject(r)&&et(r.cancel)&&et(r.getReader)&&!(r instanceof Eo.ReadableInterop);P.isWritableNodeStream=r=>P.isObject(r)&&et(r.end)&&et(r.write)&&np(r.writable)&&!(r instanceof Eo.ReadableInterop);P.isReadableNodeStream=r=>P.isObject(r)&&et(r.read)&&et(r.pipe)&&np(r.readable)&&!(r instanceof Eo.ReadableInterop)});var He=v(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.compareArrayLike=R.rebaseValueOffsets=R.toUint8ClampedArrayAsyncIterator=R.toFloat64ArrayAsyncIterator=R.toFloat32ArrayAsyncIterator=R.toUint32ArrayAsyncIterator=R.toUint16ArrayAsyncIterator=R.toUint8ArrayAsyncIterator=R.toInt32ArrayAsyncIterator=R.toInt16ArrayAsyncIterator=R.toInt8ArrayAsyncIterator=R.toArrayBufferViewAsyncIterator=R.toUint8ClampedArrayIterator=R.toFloat64ArrayIterator=R.toFloat32ArrayIterator=R.toUint32ArrayIterator=R.toUint16ArrayIterator=R.toUint8ArrayIterator=R.toInt32ArrayIterator=R.toInt16ArrayIterator=R.toInt8ArrayIterator=R.toArrayBufferViewIterator=R.toUint8ClampedArray=R.toFloat64Array=R.toFloat32Array=R.toBigUint64Array=R.toUint32Array=R.toUint16Array=R.toUint8Array=R.toBigInt64Array=R.toInt32Array=R.toInt16Array=R.toInt8Array=R.toArrayBufferView=R.joinUint8Arrays=R.memcpy=void 0;var Le=ot(),$T=Ar(),JT=Rn(),QT=$T.flatbuffers.ByteBuffer,Mn=at(),qc=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:ArrayBuffer;function ZT(r){let e=r[0]?[r[0]]:[],t,n,i,s;for(let a,o,d=0,h=0,_=r.length;++d<_;){if(a=e[h],o=r[d],!a||!o||a.buffer!==o.buffer||o.byteOffset<a.byteOffset){o&&(e[++h]=o);continue}if({byteOffset:t,byteLength:i}=a,{byteOffset:n,byteLength:s}=o,t+i<n||n+s<t){o&&(e[++h]=o);continue}e[h]=new Uint8Array(a.buffer,t,n-t+s)}return e}function Wc(r,e,t=0,n=e.byteLength){let i=r.byteLength,s=new Uint8Array(r.buffer,r.byteOffset,i),a=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return s.set(a,t),r}R.memcpy=Wc;function XT(r,e){let t=ZT(r),n=t.reduce((_,F)=>_+F.byteLength,0),i,s,a,o=0,d=-1,h=Math.min(e||1/0,n);for(let _=t.length;++d<_;){if(i=t[d],s=i.subarray(0,Math.min(i.length,h-o)),h<=o+s.length){s.length<i.length?t[d]=i.subarray(s.length):s.length===i.length&&d++,a?Wc(a,s,o):a=s;break}Wc(a||(a=new Uint8Array(h)),s,o),o+=s.length}return[a||new Uint8Array(0),t.slice(d),n-(a?a.byteLength:0)]}R.joinUint8Arrays=XT;function lt(r,e){let t=Mn.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=JT.encodeUtf8(t)),t instanceof ArrayBuffer?new r(t):t instanceof qc?new r(t):t instanceof QT?lt(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)}R.toArrayBufferView=lt;R.toInt8Array=r=>lt(Int8Array,r);R.toInt16Array=r=>lt(Int16Array,r);R.toInt32Array=r=>lt(Int32Array,r);R.toBigInt64Array=r=>lt(Mn.BigInt64Array,r);R.toUint8Array=r=>lt(Uint8Array,r);R.toUint16Array=r=>lt(Uint16Array,r);R.toUint32Array=r=>lt(Uint32Array,r);R.toBigUint64Array=r=>lt(Mn.BigUint64Array,r);R.toFloat32Array=r=>lt(Float32Array,r);R.toFloat64Array=r=>lt(Float64Array,r);R.toUint8ClampedArray=r=>lt(Uint8ClampedArray,r);var zc=r=>(r.next(),r);function*ir(r,e){let t=function*(i){yield i},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof qc?t(e):Mn.isIterable(e)?e:t(e);return yield*zc(function*(i){let s=null;do s=i.next(yield lt(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}R.toArrayBufferViewIterator=ir;R.toInt8ArrayIterator=r=>ir(Int8Array,r);R.toInt16ArrayIterator=r=>ir(Int16Array,r);R.toInt32ArrayIterator=r=>ir(Int32Array,r);R.toUint8ArrayIterator=r=>ir(Uint8Array,r);R.toUint16ArrayIterator=r=>ir(Uint16Array,r);R.toUint32ArrayIterator=r=>ir(Uint32Array,r);R.toFloat32ArrayIterator=r=>ir(Float32Array,r);R.toFloat64ArrayIterator=r=>ir(Float64Array,r);R.toUint8ClampedArrayIterator=r=>ir(Uint8ClampedArray,r);function zt(r,e){return Le.__asyncGenerator(this,arguments,function*(){if(Mn.isPromise(e))return yield Le.__await(yield Le.__await(yield*Le.__asyncDelegator(Le.__asyncValues(zt(r,yield Le.__await(e))))));let n=function(a){return Le.__asyncGenerator(this,arguments,function*(){yield yield Le.__await(yield Le.__await(a))})},i=function(a){return Le.__asyncGenerator(this,arguments,function*(){yield Le.__await(yield*Le.__asyncDelegator(Le.__asyncValues(zc(function*(o){let d=null;do d=o.next(yield d==null?void 0:d.value);while(!d.done)}(a[Symbol.iterator]())))))})},s=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof qc?n(e):Mn.isIterable(e)?i(e):Mn.isAsyncIterable(e)?e:n(e);return yield Le.__await(yield*Le.__asyncDelegator(Le.__asyncValues(zc(function(a){return Le.__asyncGenerator(this,arguments,function*(){let o=null;do o=yield Le.__await(a.next(yield yield Le.__await(lt(r,o))));while(!o.done)})}(s[Symbol.asyncIterator]()))))),yield Le.__await(new r)})}R.toArrayBufferViewAsyncIterator=zt;R.toInt8ArrayAsyncIterator=r=>zt(Int8Array,r);R.toInt16ArrayAsyncIterator=r=>zt(Int16Array,r);R.toInt32ArrayAsyncIterator=r=>zt(Int32Array,r);R.toUint8ArrayAsyncIterator=r=>zt(Uint8Array,r);R.toUint16ArrayAsyncIterator=r=>zt(Uint16Array,r);R.toUint32ArrayAsyncIterator=r=>zt(Uint32Array,r);R.toFloat32ArrayAsyncIterator=r=>zt(Float32Array,r);R.toFloat64ArrayAsyncIterator=r=>zt(Float64Array,r);R.toUint8ClampedArrayAsyncIterator=r=>zt(Uint8ClampedArray,r);function eI(r,e,t){if(r!==0){t=t.slice(0,e+1);for(let n=-1;++n<=e;)t[n]+=r}return t}R.rebaseValueOffsets=eI;function tI(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}R.compareArrayLike=tI});var Is=v(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});var le=ot(),dt=He();Yc.default={fromIterable(r){return Do(rI(r))},fromAsyncIterable(r){return Do(nI(r))},fromDOMStream(r){return Do(iI(r))},fromNodeStream(r){return Do(sI(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 Do=r=>(r.next(),r);function*rI(r){let e,t=!1,n=[],i,s,a,o=0;function d(){return s==="peek"?dt.joinUint8Arrays(n,a)[0]:([i,n,o]=dt.joinUint8Arrays(n,a),i)}({cmd:s,size:a}=yield null);let h=dt.toUint8ArrayIterator(r)[Symbol.iterator]();try{do if({done:e,value:i}=isNaN(a-o)?h.next(void 0):h.next(a-o),!e&&i.byteLength>0&&(n.push(i),o+=i.byteLength),e||a<=o)do({cmd:s,size:a}=yield d());while(a<o);while(!e)}catch(_){(t=!0)&&typeof h.throw=="function"&&h.throw(_)}finally{t===!1&&typeof h.return=="function"&&h.return(null)}return null}function nI(r){return le.__asyncGenerator(this,arguments,function*(){let t,n=!1,i=[],s,a,o,d=0;function h(){return a==="peek"?dt.joinUint8Arrays(i,o)[0]:([s,i,d]=dt.joinUint8Arrays(i,o),s)}({cmd:a,size:o}=yield yield le.__await(null));let _=dt.toUint8ArrayAsyncIterator(r)[Symbol.asyncIterator]();try{do if({done:t,value:s}=isNaN(o-d)?yield le.__await(_.next(void 0)):yield le.__await(_.next(o-d)),!t&&s.byteLength>0&&(i.push(s),d+=s.byteLength),t||o<=d)do({cmd:a,size:o}=yield yield le.__await(h()));while(o<d);while(!t)}catch(F){(n=!0)&&typeof _.throw=="function"&&(yield le.__await(_.throw(F)))}finally{n===!1&&typeof _.return=="function"&&(yield le.__await(_.return(new Uint8Array(0))))}return yield le.__await(null)})}function iI(r){return le.__asyncGenerator(this,arguments,function*(){let t=!1,n=!1,i=[],s,a,o,d=0;function h(){return a==="peek"?dt.joinUint8Arrays(i,o)[0]:([s,i,d]=dt.joinUint8Arrays(i,o),s)}({cmd:a,size:o}=yield yield le.__await(null));let _=new ip(r);try{do if({done:t,value:s}=isNaN(o-d)?yield le.__await(_.read(void 0)):yield le.__await(_.read(o-d)),!t&&s.byteLength>0&&(i.push(dt.toUint8Array(s)),d+=s.byteLength),t||o<=d)do({cmd:a,size:o}=yield yield le.__await(h()));while(o<d);while(!t)}catch(F){(n=!0)&&(yield le.__await(_.cancel(F)))}finally{n===!1?yield le.__await(_.cancel()):r.locked&&_.releaseLock()}return yield le.__await(null)})}var ip=class{constructor(e){this.source=e,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch(t){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}cancel(e){return le.__awaiter(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return le.__awaiter(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=!this.supportsBYOB||typeof e!="number"?yield this.getDefaultReader().read():yield this.readFromBYOBReader(e);return!t.done&&(t.value=dt.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}readFromBYOBReader(e){return le.__awaiter(this,void 0,void 0,function*(){return yield sp(this.getBYOBReader(),new ArrayBuffer(e),0,e)})}};function sp(r,e,t,n){return le.__awaiter(this,void 0,void 0,function*(){if(t>=n)return{done:!1,value:new Uint8Array(e,0,n)};let{done:i,value:s}=yield r.read(new Uint8Array(e,t,n-t));return(t+=s.byteLength)<n&&!i?yield sp(r,s.buffer,t,n):{done:i,value:new Uint8Array(s.buffer,0,t)}})}var Hc=(r,e)=>{let t=i=>n([e,i]),n;return[e,t,new Promise(i=>(n=i)&&r.once(e,t))]};function sI(r){return le.__asyncGenerator(this,arguments,function*(){let t=[],n="error",i=!1,s=null,a,o,d=0,h=[],_;function F(){return a==="peek"?dt.joinUint8Arrays(h,o)[0]:([_,h,d]=dt.joinUint8Arrays(h,o),_)}if({cmd:a,size:o}=yield yield le.__await(null),r.isTTY)return yield yield le.__await(new Uint8Array(0)),yield le.__await(null);try{t[0]=Hc(r,"end"),t[1]=Hc(r,"error");do{if(t[2]=Hc(r,"readable"),[n,s]=yield le.__await(Promise.race(t.map(re=>re[2]))),n==="error")break;if((i=n==="end")||(isFinite(o-d)?(_=dt.toUint8Array(r.read(o-d)),_.byteLength<o-d&&(_=dt.toUint8Array(r.read(void 0)))):_=dt.toUint8Array(r.read(void 0)),_.byteLength>0&&(h.push(_),d+=_.byteLength)),i||o<=d)do({cmd:a,size:o}=yield yield le.__await(F()));while(o<d)}while(!i)}finally{yield le.__await(U(t,n==="error"?s:null))}return yield le.__await(null);function U(re,_e){return _=h=null,new Promise((me,it)=>{for(let[Ne,S]of re)r.off(Ne,S);try{let Ne=r.destroy;Ne&&Ne.call(r,_e),_e=void 0}catch(Ne){_e=Ne||_e}finally{_e!=null?it(_e):me()}})}})}});var Me=v(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.Vector=ci.AbstractVector=void 0;var Fo=class{};ci.AbstractVector=Fo;ci.Vector=Fo;Fo.prototype.data=null});var Jr=v(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.Schema=E.Buffer=E.Field=E.DictionaryEncoding=E.KeyValue=E.Duration=E.Interval=E.Timestamp=E.Time=E.Date=E.Decimal=E.Bool=E.FixedSizeBinary=E.LargeBinary=E.LargeUtf8=E.Binary=E.Utf8=E.FloatingPoint=E.Int=E.Union=E.Map=E.FixedSizeList=E.LargeList=E.List=E.Struct_=E.Null=E.Endianness=E.DictionaryKind=E.Type=E.IntervalUnit=E.TimeUnit=E.DateUnit=E.Precision=E.UnionMode=E.Feature=E.MetadataVersion=void 0;var ge=Ar(),oI;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(oI=E.MetadataVersion||(E.MetadataVersion={}));var aI;(function(r){r[r.UNUSED=0]="UNUSED",r[r.DICTIONARY_REPLACEMENT=1]="DICTIONARY_REPLACEMENT",r[r.COMPRESSED_BODY=2]="COMPRESSED_BODY"})(aI=E.Feature||(E.Feature={}));var Gc;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(Gc=E.UnionMode||(E.UnionMode={}));var Kc;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(Kc=E.Precision||(E.Precision={}));var $c;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})($c=E.DateUnit||(E.DateUnit={}));var Un;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(Un=E.TimeUnit||(E.TimeUnit={}));var Jc;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME"})(Jc=E.IntervalUnit||(E.IntervalUnit={}));var Qc;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",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.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList"})(Qc=E.Type||(E.Type={}));var Zc;(function(r){r[r.DenseArray=0]="DenseArray"})(Zc=E.DictionaryKind||(E.DictionaryKind={}));var Xc;(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Xc=E.Endianness||(E.Endianness={}));var Pn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new Pn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Pn).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return Pn.startNull(e),Pn.endNull(e)}};E.Null=Pn;var kn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new kn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new kn).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return kn.startStruct_(e),kn.endStruct_(e)}};E.Struct_=kn;var Vn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new Vn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Vn).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return Vn.startList(e),Vn.endList(e)}};E.List=Vn;var Nn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeList(e,t){return(t||new Nn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Nn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return Nn.startLargeList(e),Nn.endLargeList(e)}};E.LargeList=Nn;var Wr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new Wr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Wr).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return Wr.startFixedSizeList(e),Wr.addListSize(e,t),Wr.endFixedSizeList(e)}};E.FixedSizeList=Wr;var zr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new zr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new zr).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return zr.startMap(e),zr.addKeysSorted(e,t),zr.endMap(e)}};E.Map=zr;var Or=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new Or).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Or).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Gc.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,Gc.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,n){return Or.startUnion(e),Or.addMode(e,t),Or.addTypeIds(e,n),Or.endUnion(e)}};E.Union=Or;var sr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new sr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new sr).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,n){return sr.startInt(e),sr.addBitWidth(e,t),sr.addIsSigned(e,n),sr.endInt(e)}};E.Int=sr;var Hr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new Hr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Hr).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Kc.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,Kc.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return Hr.startFloatingPoint(e),Hr.addPrecision(e,t),Hr.endFloatingPoint(e)}};E.FloatingPoint=Hr;var Ln=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new Ln).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Ln).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return Ln.startUtf8(e),Ln.endUtf8(e)}};E.Utf8=Ln;var xn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new xn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new xn).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return xn.startBinary(e),xn.endBinary(e)}};E.Binary=xn;var Cn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new Cn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Cn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return Cn.startLargeUtf8(e),Cn.endLargeUtf8(e)}};E.LargeUtf8=Cn;var jn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new jn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new jn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return jn.startLargeBinary(e),jn.endLargeBinary(e)}};E.LargeBinary=jn;var Yr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new Yr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Yr).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return Yr.startFixedSizeBinary(e),Yr.addByteWidth(e,t),Yr.endFixedSizeBinary(e)}};E.FixedSizeBinary=Yr;var qn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new qn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new qn).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return qn.startBool(e),qn.endBool(e)}};E.Bool=qn;var or=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new or).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new or).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,n,i){return or.startDecimal(e),or.addPrecision(e,t),or.addScale(e,n),or.addBitWidth(e,i),or.endDecimal(e)}};E.Decimal=or;var Gr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new Gr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Gr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):$c.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,$c.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return Gr.startDate(e),Gr.addUnit(e,t),Gr.endDate(e)}};E.Date=Gr;var Er=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new Er).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Er).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Un.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,Un.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,n){return Er.startTime(e),Er.addUnit(e,t),Er.addBitWidth(e,n),Er.endTime(e)}};E.Time=Er;var Dr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new Dr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Dr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Un.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,Un.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,n){return Dr.startTimestamp(e),Dr.addUnit(e,t),Dr.addTimezone(e,n),Dr.endTimestamp(e)}};E.Timestamp=Dr;var Kr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new Kr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Kr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Jc.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,Jc.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return Kr.startInterval(e),Kr.addUnit(e,t),Kr.endInterval(e)}};E.Interval=Kr;var $r=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new $r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new $r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Un.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,Un.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return $r.startDuration(e),$r.addUnit(e,t),$r.endDuration(e)}};E.Duration=$r;var Ht=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new Ht).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Ht).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,n){return Ht.startKeyValue(e),Ht.addKey(e,t),Ht.addValue(e,n),Ht.endKeyValue(e)}};E.KeyValue=Ht;var wt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new wt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new wt).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new sr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Zc.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,Zc.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}static createDictionaryEncoding(e,t,n,i,s){return wt.startDictionaryEncoding(e),wt.addId(e,t),wt.addIndexType(e,n),wt.addIsOrdered(e,i),wt.addDictionaryKind(e,s),wt.endDictionaryEncoding(e)}};E.DictionaryEncoding=wt;var ct=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new ct).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new ct).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):Qc.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new wt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?(t||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Ht).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,Qc.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}static createField(e,t,n,i,s,a,o,d){return ct.startField(e),ct.addName(e,t),ct.addNullable(e,n),ct.addTypeType(e,i),ct.addType(e,s),ct.addDictionary(e,a),ct.addChildren(e,o),ct.addCustomMetadata(e,d),ct.endField(e)}};E.Field=ct;var op=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(e,t,n){return e.prep(8,16),e.writeInt64(n),e.writeInt64(t),e.offset()}};E.Buffer=op;var Yt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new Yt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Yt).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Xc.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Ht).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):this.bb.createLong(0,0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,Xc.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,n,i,s){return Yt.startSchema(e),Yt.addEndianness(e,t),Yt.addFields(e,n),Yt.addCustomMetadata(e,i),Yt.addFeatures(e,s),Yt.endSchema(e)}};E.Schema=Yt});var Uo=v(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Message=Ue.DictionaryBatch=Ue.RecordBatch=Ue.BodyCompression=Ue.FieldNode=Ue.MessageHeader=Ue.BodyCompressionMethod=Ue.CompressionType=void 0;var Ro=Ar(),Mo=Jr(),eu;(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(eu=Ue.CompressionType||(Ue.CompressionType={}));var tu;(function(r){r[r.BUFFER=0]="BUFFER"})(tu=Ue.BodyCompressionMethod||(Ue.BodyCompressionMethod={}));var ru;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(ru=Ue.MessageHeader||(Ue.MessageHeader={}));var nu=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(e,t,n){return e.prep(8,16),e.writeInt64(n),e.writeInt64(t),e.offset()}};Ue.FieldNode=nu;var ar=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new ar).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+Ro.flatbuffers.SIZE_PREFIX_LENGTH),(t||new ar).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):eu.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):tu.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,eu.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,tu.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,n){return ar.startBodyCompression(e),ar.addCodec(e,t),ar.addMethod(e,n),ar.endBodyCompression(e)}};Ue.BodyCompression=ar;var St=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new St).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+Ro.flatbuffers.SIZE_PREFIX_LENGTH),(t||new St).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}nodes(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new nu).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Mo.Buffer).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new ar).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}static startRecordBatch(e){e.startObject(4)}static addLength(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static endRecordBatch(e){return e.endObject()}static createRecordBatch(e,t,n,i,s){return St.startRecordBatch(e),St.addLength(e,t),St.addNodes(e,n),St.addBuffers(e,i),St.addCompression(e,s),St.endRecordBatch(e)}};Ue.RecordBatch=St;var cr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new cr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+Ro.flatbuffers.SIZE_PREFIX_LENGTH),(t||new cr).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new St).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}static createDictionaryBatch(e,t,n,i){return cr.startDictionaryBatch(e),cr.addId(e,t),cr.addData(e,n),cr.addIsDelta(e,i),cr.endDictionaryBatch(e)}};Ue.DictionaryBatch=cr;var Bt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new Bt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+Ro.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Bt).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Mo.MetadataVersion.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ru.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Mo.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Mo.MetadataVersion.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,ru.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,e.createLong(0,0))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,n,i,s,a){return Bt.startMessage(e),Bt.addVersion(e,t),Bt.addHeaderType(e,n),Bt.addHeader(e,i),Bt.addBodyLength(e,s),Bt.addCustomMetadata(e,a),Bt.endMessage(e)}};Ue.Message=Bt});var pe=v(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.BufferType=Be.Type=Be.MessageHeader=Be.MetadataVersion=Be.IntervalUnit=Be.UnionMode=Be.Precision=Be.TimeUnit=Be.DateUnit=void 0;var ui=Jr();Object.defineProperty(Be,"DateUnit",{enumerable:!0,get:function(){return ui.DateUnit}});Object.defineProperty(Be,"TimeUnit",{enumerable:!0,get:function(){return ui.TimeUnit}});Object.defineProperty(Be,"Precision",{enumerable:!0,get:function(){return ui.Precision}});Object.defineProperty(Be,"UnionMode",{enumerable:!0,get:function(){return ui.UnionMode}});Object.defineProperty(Be,"IntervalUnit",{enumerable:!0,get:function(){return ui.IntervalUnit}});Object.defineProperty(Be,"MetadataVersion",{enumerable:!0,get:function(){return ui.MetadataVersion}});var cI=Uo();Object.defineProperty(Be,"MessageHeader",{enumerable:!0,get:function(){return cI.MessageHeader}});var uI;(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"})(uI=Be.Type||(Be.Type={}));var lI;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(lI=Be.BufferType||(Be.BufferType={}))});var ur=v(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.popcnt_uint32=xe.popcnt_array=xe.popcnt_bit_range=xe.BitIterator=xe.packBools=xe.truncateBitmap=xe.setBool=xe.getBit=xe.getBool=void 0;function ap(r,e,t,n){return(t&1<<n)!=0}xe.getBool=ap;function cp(r,e,t,n){return(t&1<<n)>>n}xe.getBit=cp;function dI(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}xe.setBool=dI;function fI(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):up(new Po(t,r,e,null,ap)).subarray(0,n)),i}return t}xe.truncateBitmap=fI;function up(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 s=new Uint8Array(e.length+7&~7);return s.set(e),s}xe.packBools=up;var Po=class{constructor(e,t,n,i,s){this.bytes=e,this.length=n,this.context=i,this.get=s,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};xe.BitIterator=Po;function iu(r,e,t){if(t-e<=0)return 0;if(t-e<8){let s=0;for(let a of new Po(r,e,t-e,r,cp))s+=a;return s}let n=t>>3<<3,i=e+(e%8==0?0:8-e%8);return iu(r,e,i)+iu(r,n,t)+lp(r,i>>3,n-i>>3)}xe.popcnt_bit_range=iu;function lp(r,e,t){let n=0,i=e|0,s=new DataView(r.buffer,r.byteOffset,r.byteLength),a=t===void 0?r.byteLength:i+t;for(;a-i>=4;)n+=ko(s.getUint32(i)),i+=4;for(;a-i>=2;)n+=ko(s.getUint16(i)),i+=2;for(;a-i>=1;)n+=ko(s.getUint8(i)),i+=1;return n}xe.popcnt_array=lp;function ko(r){let e=r|0;return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}xe.popcnt_uint32=ko});var ce=v(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.strideForType=w.Dictionary=w.Map_=w.FixedSizeList=w.FixedSizeBinary=w.SparseUnion=w.DenseUnion=w.Union=w.Struct=w.List=w.IntervalYearMonth=w.IntervalDayTime=w.Interval=w.TimestampNanosecond=w.TimestampMicrosecond=w.TimestampMillisecond=w.TimestampSecond=w.Timestamp=w.TimeNanosecond=w.TimeMicrosecond=w.TimeMillisecond=w.TimeSecond=w.Time=w.DateMillisecond=w.DateDay=w.Date_=w.Decimal=w.Bool=w.Utf8=w.Binary=w.Float64=w.Float32=w.Float16=w.Float=w.Uint64=w.Uint32=w.Uint16=w.Uint8=w.Int64=w.Int32=w.Int16=w.Int8=w.Int=w.Null=w.DataType=void 0;var M=pe(),Ae=class{static isNull(e){return(e==null?void 0:e.typeId)===M.Type.Null}static isInt(e){return(e==null?void 0:e.typeId)===M.Type.Int}static isFloat(e){return(e==null?void 0:e.typeId)===M.Type.Float}static isBinary(e){return(e==null?void 0:e.typeId)===M.Type.Binary}static isUtf8(e){return(e==null?void 0:e.typeId)===M.Type.Utf8}static isBool(e){return(e==null?void 0:e.typeId)===M.Type.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===M.Type.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===M.Type.Date}static isTime(e){return(e==null?void 0:e.typeId)===M.Type.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===M.Type.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===M.Type.Interval}static isList(e){return(e==null?void 0:e.typeId)===M.Type.List}static isStruct(e){return(e==null?void 0:e.typeId)===M.Type.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===M.Type.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===M.Type.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===M.Type.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===M.Type.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===M.Type.Dictionary}get typeId(){return M.Type.NONE}};w.DataType=Ae;Ae[Symbol.toStringTag]=(r=>(r.children=null,r.ArrayType=Array,r[Symbol.toStringTag]="DataType"))(Ae.prototype);var Vo=class extends Ae{toString(){return"Null"}get typeId(){return M.Type.Null}};w.Null=Vo;Vo[Symbol.toStringTag]=(r=>r[Symbol.toStringTag]="Null")(Vo.prototype);var At=class extends Ae{constructor(e,t){super();this.isSigned=e,this.bitWidth=t}get typeId(){return M.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}`}};w.Int=At;At[Symbol.toStringTag]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(At.prototype);var su=class extends At{constructor(){super(!0,8)}};w.Int8=su;var ou=class extends At{constructor(){super(!0,16)}};w.Int16=ou;var au=class extends At{constructor(){super(!0,32)}};w.Int32=au;var cu=class extends At{constructor(){super(!0,64)}};w.Int64=cu;var uu=class extends At{constructor(){super(!1,8)}};w.Uint8=uu;var lu=class extends At{constructor(){super(!1,16)}};w.Uint16=lu;var du=class extends At{constructor(){super(!1,32)}};w.Uint32=du;var fu=class extends At{constructor(){super(!1,64)}};w.Uint64=fu;Object.defineProperty(su.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(ou.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(au.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(cu.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(uu.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(lu.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(du.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(fu.prototype,"ArrayType",{value:Uint32Array});var Wn=class extends Ae{constructor(e){super();this.precision=e}get typeId(){return M.Type.Float}get ArrayType(){switch(this.precision){case M.Precision.HALF:return Uint16Array;case M.Precision.SINGLE:return Float32Array;case M.Precision.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};w.Float=Wn;Wn[Symbol.toStringTag]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Wn.prototype);var hu=class extends Wn{constructor(){super(M.Precision.HALF)}};w.Float16=hu;var pu=class extends Wn{constructor(){super(M.Precision.SINGLE)}};w.Float32=pu;var yu=class extends Wn{constructor(){super(M.Precision.DOUBLE)}};w.Float64=yu;Object.defineProperty(hu.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(pu.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(yu.prototype,"ArrayType",{value:Float64Array});var No=class extends Ae{constructor(){super()}get typeId(){return M.Type.Binary}toString(){return"Binary"}};w.Binary=No;No[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(No.prototype);var Lo=class extends Ae{constructor(){super()}get typeId(){return M.Type.Utf8}toString(){return"Utf8"}};w.Utf8=Lo;Lo[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Lo.prototype);var xo=class extends Ae{constructor(){super()}get typeId(){return M.Type.Bool}toString(){return"Bool"}};w.Bool=xo;xo[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(xo.prototype);var Co=class extends Ae{constructor(e,t){super();this.scale=e,this.precision=t}get typeId(){return M.Type.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};w.Decimal=Co;Co[Symbol.toStringTag]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Co.prototype);var li=class extends Ae{constructor(e){super();this.unit=e}get typeId(){return M.Type.Date}toString(){return`Date${(this.unit+1)*32}<${M.DateUnit[this.unit]}>`}};w.Date_=li;li[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Date"))(li.prototype);var dp=class extends li{constructor(){super(M.DateUnit.DAY)}};w.DateDay=dp;var fp=class extends li{constructor(){super(M.DateUnit.MILLISECOND)}};w.DateMillisecond=fp;var Qr=class extends Ae{constructor(e,t){super();this.unit=e,this.bitWidth=t}get typeId(){return M.Type.Time}toString(){return`Time${this.bitWidth}<${M.TimeUnit[this.unit]}>`}};w.Time=Qr;Qr[Symbol.toStringTag]=(r=>(r.unit=null,r.bitWidth=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Time"))(Qr.prototype);var hp=class extends Qr{constructor(){super(M.TimeUnit.SECOND,32)}};w.TimeSecond=hp;var pp=class extends Qr{constructor(){super(M.TimeUnit.MILLISECOND,32)}};w.TimeMillisecond=pp;var yp=class extends Qr{constructor(){super(M.TimeUnit.MICROSECOND,64)}};w.TimeMicrosecond=yp;var _p=class extends Qr{constructor(){super(M.TimeUnit.NANOSECOND,64)}};w.TimeNanosecond=_p;var Zr=class extends Ae{constructor(e,t){super();this.unit=e,this.timezone=t}get typeId(){return M.Type.Timestamp}toString(){return`Timestamp<${M.TimeUnit[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};w.Timestamp=Zr;Zr[Symbol.toStringTag]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Timestamp"))(Zr.prototype);var mp=class extends Zr{constructor(e){super(M.TimeUnit.SECOND,e)}};w.TimestampSecond=mp;var bp=class extends Zr{constructor(e){super(M.TimeUnit.MILLISECOND,e)}};w.TimestampMillisecond=bp;var gp=class extends Zr{constructor(e){super(M.TimeUnit.MICROSECOND,e)}};w.TimestampMicrosecond=gp;var vp=class extends Zr{constructor(e){super(M.TimeUnit.NANOSECOND,e)}};w.TimestampNanosecond=vp;var di=class extends Ae{constructor(e){super();this.unit=e}get typeId(){return M.Type.Interval}toString(){return`Interval<${M.IntervalUnit[this.unit]}>`}};w.Interval=di;di[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(di.prototype);var Tp=class extends di{constructor(){super(M.IntervalUnit.DAY_TIME)}};w.IntervalDayTime=Tp;var Ip=class extends di{constructor(){super(M.IntervalUnit.YEAR_MONTH)}};w.IntervalYearMonth=Ip;var jo=class extends Ae{constructor(e){super();this.children=[e]}get typeId(){return M.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}};w.List=jo;jo[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(jo.prototype);var qo=class extends Ae{constructor(e){super();this.children=e}get typeId(){return M.Type.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};w.Struct=qo;qo[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(qo.prototype);var fi=class extends Ae{constructor(e,t,n){super();this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((i,s,a)=>(i[s]=a)&&i||i,Object.create(null))}get typeId(){return M.Type.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};w.Union=fi;fi[Symbol.toStringTag]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(fi.prototype);var wp=class extends fi{constructor(e,t){super(M.UnionMode.Dense,e,t)}};w.DenseUnion=wp;var Sp=class extends fi{constructor(e,t){super(M.UnionMode.Sparse,e,t)}};w.SparseUnion=Sp;var Wo=class extends Ae{constructor(e){super();this.byteWidth=e}get typeId(){return M.Type.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};w.FixedSizeBinary=Wo;Wo[Symbol.toStringTag]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Wo.prototype);var zo=class extends Ae{constructor(e,t){super();this.listSize=e,this.children=[t]}get typeId(){return M.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}>`}};w.FixedSizeList=zo;zo[Symbol.toStringTag]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(zo.prototype);var Ho=class extends Ae{constructor(e,t=!1){super();this.children=[e],this.keysSorted=t}get typeId(){return M.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(", ")}}>`}};w.Map_=Ho;Ho[Symbol.toStringTag]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Ho.prototype);var hI=(r=>()=>++r)(-1),Yo=class extends Ae{constructor(e,t,n,i){super();this.indices=t,this.dictionary=e,this.isOrdered=i||!1,this.id=n==null?hI():typeof n=="number"?n:n.low}get typeId(){return M.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}>`}};w.Dictionary=Yo;Yo[Symbol.toStringTag]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Yo.prototype);function pI(r){let e=r;switch(r.typeId){case M.Type.Decimal:return 4;case M.Type.Timestamp:return 2;case M.Type.Date:return 1+e.unit;case M.Type.Interval:return 1+e.unit;case M.Type.Int:return 1+ +(e.bitWidth>32);case M.Type.Time:return 1+ +(e.bitWidth>32);case M.Type.FixedSizeList:return e.listSize;case M.Type.FixedSizeBinary:return e.byteWidth;default:return 1}}w.strideForType=pI});var Gt=v(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.Data=zn.kUnknownNullCount=void 0;var yI=ur(),_I=ur(),k=pe(),mI=ce(),ne=He();zn.kUnknownNullCount=-1;var G=class{constructor(e,t,n,i,s,a,o){this.type=e,this.dictionary=o,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(h=>h instanceof G?h:h.data);let d;s instanceof G?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=mI.strideForType(e),s&&((d=s[0])&&(this.valueOffsets=d),(d=s[1])&&(this.values=d),(d=s[2])&&(this.nullBitmap=d),(d=s[3])&&(this.typeIds=d)))}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:s}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),s&&(e+=s.byteLength),this.childData.reduce((a,o)=>a+o.byteLength,e)}get nullCount(){let e=this._nullCount,t;return e<=zn.kUnknownNullCount&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-_I.popcnt_bit_range(t,this.offset,this.offset+this.length)),e}clone(e,t=this.offset,n=this.length,i=this._nullCount,s=this,a=this.childData){return new G(e,t,n,i,s,a,this.dictionary)}slice(e,t){let{stride:n,typeId:i,childData:s}=this,a=+(this._nullCount===0)-1,o=i===16?n:1,d=this._sliceBuffers(e,t,n,i);return this.clone(this.type,this.offset+e,t,a,d,!s.length||this.valueOffsets?s:this._sliceChildren(s,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===k.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(yI.truncateBitmap(this.offset,t,this.nullBitmap),0);let s=this.buffers;return s[k.BufferType.VALIDITY]=i,this.clone(this.type,0,e,n+(e-t),s)}_sliceBuffers(e,t,n,i){let s,{buffers:a}=this;return(s=a[k.BufferType.TYPE])&&(a[k.BufferType.TYPE]=s.subarray(e,e+t)),(s=a[k.BufferType.OFFSET])&&(a[k.BufferType.OFFSET]=s.subarray(e,e+t+1))||(s=a[k.BufferType.DATA])&&(a[k.BufferType.DATA]=i===6?s:s.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,s,a,o){switch(s instanceof G?s=s.buffers:s||(s=[]),e.typeId){case k.Type.Null:return G.Null(e,t,n);case k.Type.Int:return G.Int(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Dictionary:return G.Dictionary(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[],o);case k.Type.Float:return G.Float(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Bool:return G.Bool(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Decimal:return G.Decimal(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Date:return G.Date(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Time:return G.Time(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Timestamp:return G.Timestamp(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Interval:return G.Interval(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.FixedSizeBinary:return G.FixedSizeBinary(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Binary:return G.Binary(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.OFFSET]||[],s[k.BufferType.DATA]||[]);case k.Type.Utf8:return G.Utf8(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.OFFSET]||[],s[k.BufferType.DATA]||[]);case k.Type.List:return G.List(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.OFFSET]||[],(a||[])[0]);case k.Type.FixedSizeList:return G.FixedSizeList(e,t,n,i||0,s[k.BufferType.VALIDITY],(a||[])[0]);case k.Type.Struct:return G.Struct(e,t,n,i||0,s[k.BufferType.VALIDITY],a||[]);case k.Type.Map:return G.Map(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.OFFSET]||[],(a||[])[0]);case k.Type.Union:return G.Union(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.TYPE]||[],s[k.BufferType.OFFSET]||a,a)}throw new Error(`Unrecognized typeId ${e.typeId}`)}static Null(e,t,n){return new G(e,t,n,0)}static Int(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Dictionary(e,t,n,i,s,a,o){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.indices.ArrayType,a),ne.toUint8Array(s)],[],o)}static Float(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Bool(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Decimal(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Date(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Time(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Timestamp(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Interval(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static FixedSizeBinary(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Binary(e,t,n,i,s,a,o){return new G(e,t,n,i,[ne.toInt32Array(a),ne.toUint8Array(o),ne.toUint8Array(s)])}static Utf8(e,t,n,i,s,a,o){return new G(e,t,n,i,[ne.toInt32Array(a),ne.toUint8Array(o),ne.toUint8Array(s)])}static List(e,t,n,i,s,a,o){return new G(e,t,n,i,[ne.toInt32Array(a),void 0,ne.toUint8Array(s)],o?[o]:[])}static FixedSizeList(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,void 0,ne.toUint8Array(s)],a?[a]:[])}static Struct(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,void 0,ne.toUint8Array(s)],a)}static Map(e,t,n,i,s,a,o){return new G(e,t,n,i,[ne.toInt32Array(a),void 0,ne.toUint8Array(s)],o?[o]:[])}static Union(e,t,n,i,s,a,o,d){let h=[void 0,void 0,ne.toUint8Array(s),ne.toArrayBufferView(e.ArrayType,a)];return e.mode===k.UnionMode.Sparse?new G(e,t,n,i,h,o):(h[k.BufferType.OFFSET]=ne.toInt32Array(o),new G(e,t,n,i,h,d))}};zn.Data=G;G.prototype.childData=Object.freeze([])});var _u=v(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.valueToString=void 0;var bI=void 0;function gI(r){if(r===null)return"null";if(r===bI)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)}Go.valueToString=gI});var Bp=v(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.createIsValidFunction=void 0;var mu=_u(),vI=at();function TI(r){if(!r||r.length<=0)return function(i){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
|
|
1
|
+
var duckdb=(()=>{var kT=Object.create;var Is=Object.defineProperty,VT=Object.defineProperties,NT=Object.getOwnPropertyDescriptor,LT=Object.getOwnPropertyDescriptors,xT=Object.getOwnPropertyNames,Mh=Object.getOwnPropertySymbols,CT=Object.getPrototypeOf,Uh=Object.prototype.hasOwnProperty,jT=Object.prototype.propertyIsEnumerable;var Ph=(r,e,t)=>e in r?Is(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Rn=(r,e)=>{for(var t in e||(e={}))Uh.call(e,t)&&Ph(r,t,e[t]);if(Mh)for(var t of Mh(e))jT.call(e,t)&&Ph(r,t,e[t]);return r},Ao=(r,e)=>VT(r,LT(e)),kh=r=>Is(r,"__esModule",{value:!0});var qT=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),WT=(r,e)=>{kh(r);for(var t in e)Is(r,t,{get:e[t],enumerable:!0})},zT=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xT(e))!Uh.call(r,n)&&n!=="default"&&Is(r,n,{get:()=>e[n],enumerable:!(t=NT(e,n))||t.enumerable});return r},Br=r=>zT(kh(Is(r!=null?kT(CT(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var ot=v((jE,Do)=>{var Vh,Nh,Lh,xh,Ch,jh,qh,Wh,zh,Oo,Cc,Hh,Yh,Gh,oi,Kh,$h,Jh,Qh,Zh,Xh,ep,tp,Eo;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof Do=="object"&&typeof Do.exports=="object"?r(t(e,t(Do.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){return n[s]=i?i(s,a):a}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};Vh=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},Nh=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},Lh=function(n,i){var s={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(s[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(n);o<a.length;o++)i.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(n,a[o])&&(s[a[o]]=n[a[o]]);return s},xh=function(n,i,s,a){var o=arguments.length,d=o<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,i,s,a);else for(var _=n.length-1;_>=0;_--)(h=n[_])&&(d=(o<3?h(d):o>3?h(i,s,d):h(i,s))||d);return o>3&&d&&Object.defineProperty(i,s,d),d},Ch=function(n,i){return function(s,a){i(s,a,n)}},jh=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},qh=function(n,i,s,a){function o(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function _(re){try{U(a.next(re))}catch(_e){h(_e)}}function F(re){try{U(a.throw(re))}catch(_e){h(_e)}}function U(re){re.done?d(re.value):o(re.value).then(_,F)}U((a=a.apply(n,i||[])).next())})},Wh=function(n,i){var s={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},a,o,d,h;return h={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function _(U){return function(re){return F([U,re])}}function F(U){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,o&&(d=U[0]&2?o.return:U[0]?o.throw||((d=o.return)&&d.call(o),0):o.next)&&!(d=d.call(o,U[1])).done)return d;switch(o=0,d&&(U=[U[0]&2,d.value]),U[0]){case 0:case 1:d=U;break;case 4:return s.label++,{value:U[1],done:!1};case 5:s.label++,o=U[1],U=[0];continue;case 7:U=s.ops.pop(),s.trys.pop();continue;default:if(d=s.trys,!(d=d.length>0&&d[d.length-1])&&(U[0]===6||U[0]===2)){s=0;continue}if(U[0]===3&&(!d||U[1]>d[0]&&U[1]<d[3])){s.label=U[1];break}if(U[0]===6&&s.label<d[1]){s.label=d[1],d=U;break}if(d&&s.label<d[2]){s.label=d[2],s.ops.push(U);break}d[2]&&s.ops.pop(),s.trys.pop();continue}U=i.call(n,s)}catch(re){U=[6,re],o=0}finally{a=d=0}if(U[0]&5)throw U[1];return{value:U[0]?U[1]:void 0,done:!0}}},zh=function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&Eo(i,n,s)},Eo=Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]},Oo=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&n[i],a=0;if(s)return s.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Cc=function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var a=s.call(n),o,d=[],h;try{for(;(i===void 0||i-- >0)&&!(o=a.next()).done;)d.push(o.value)}catch(_){h={error:_}}finally{try{o&&!o.done&&(s=a.return)&&s.call(a)}finally{if(h)throw h.error}}return d},Hh=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(Cc(arguments[i]));return n},Yh=function(){for(var n=0,i=0,s=arguments.length;i<s;i++)n+=arguments[i].length;for(var a=Array(n),o=0,i=0;i<s;i++)for(var d=arguments[i],h=0,_=d.length;h<_;h++,o++)a[o]=d[h];return a},Gh=function(n,i,s){if(s||arguments.length===2)for(var a=0,o=i.length,d;a<o;a++)(d||!(a in i))&&(d||(d=Array.prototype.slice.call(i,0,a)),d[a]=i[a]);return n.concat(d||Array.prototype.slice.call(i))},oi=function(n){return this instanceof oi?(this.v=n,this):new oi(n)},Kh=function(n,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s.apply(n,i||[]),o,d=[];return o={},h("next"),h("throw"),h("return"),o[Symbol.asyncIterator]=function(){return this},o;function h(me){a[me]&&(o[me]=function(it){return new Promise(function(Ne,S){d.push([me,it,Ne,S])>1||_(me,it)})})}function _(me,it){try{F(a[me](it))}catch(Ne){_e(d[0][3],Ne)}}function F(me){me.value instanceof oi?Promise.resolve(me.value.v).then(U,re):_e(d[0][2],me)}function U(me){_("next",me)}function re(me){_("throw",me)}function _e(me,it){me(it),d.shift(),d.length&&_(d[0][0],d[0][1])}},$h=function(n){var i,s;return i={},a("next"),a("throw",function(o){throw o}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(o,d){i[o]=n[o]?function(h){return(s=!s)?{value:oi(n[o](h)),done:o==="return"}:d?d(h):h}:d}},Jh=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof Oo=="function"?Oo(n):n[Symbol.iterator](),s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s);function a(d){s[d]=n[d]&&function(h){return new Promise(function(_,F){h=n[d](h),o(_,F,h.done,h.value)})}}function o(d,h,_,F){Promise.resolve(F).then(function(U){d({value:U,done:_})},h)}},Qh=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var t=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};Zh=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&Eo(i,n,s);return t(i,n),i},Xh=function(n){return n&&n.__esModule?n:{default:n}},ep=function(n,i,s,a){if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?a:s==="a"?a.call(n):a?a.value:i.get(n)},tp=function(n,i,s,a,o){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!o:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?o.call(n,s):o?o.value=s:i.set(n,s),s},r("__extends",Vh),r("__assign",Nh),r("__rest",Lh),r("__decorate",xh),r("__param",Ch),r("__metadata",jh),r("__awaiter",qh),r("__generator",Wh),r("__exportStar",zh),r("__createBinding",Eo),r("__values",Oo),r("__read",Cc),r("__spread",Hh),r("__spreadArrays",Yh),r("__spreadArray",Gh),r("__await",oi),r("__asyncGenerator",Kh),r("__asyncDelegator",$h),r("__asyncValues",Jh),r("__makeTemplateObject",Qh),r("__importStar",Zh),r("__importDefault",Xh),r("__classPrivateFieldGet",ep),r("__classPrivateFieldSet",tp)})});var Ar=v(rp=>{var m={};m.Offset;m.Table;m.SIZEOF_SHORT=2;m.SIZEOF_INT=4;m.FILE_IDENTIFIER_LENGTH=4;m.SIZE_PREFIX_LENGTH=4;m.Encoding={UTF8_BYTES:1,UTF16_STRING:2};m.int32=new Int32Array(2);m.float32=new Float32Array(m.int32.buffer);m.float64=new Float64Array(m.int32.buffer);m.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;m.Long=function(r,e){this.low=r|0,this.high=e|0};m.Long.create=function(r,e){return r==0&&e==0?m.Long.ZERO:new m.Long(r,e)};m.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};m.Long.prototype.equals=function(r){return this.low==r.low&&this.high==r.high};m.Long.ZERO=new m.Long(0,0);m.Builder=function(r){if(r)var e=r;else var e=1024;this.bb=m.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};m.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};m.Builder.prototype.forceDefaults=function(r){this.force_defaults=r};m.Builder.prototype.dataBuffer=function(){return this.bb};m.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};m.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=m.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(t)};m.Builder.prototype.pad=function(r){for(var e=0;e<r;e++)this.bb.writeInt8(--this.space,0)};m.Builder.prototype.writeInt8=function(r){this.bb.writeInt8(this.space-=1,r)};m.Builder.prototype.writeInt16=function(r){this.bb.writeInt16(this.space-=2,r)};m.Builder.prototype.writeInt32=function(r){this.bb.writeInt32(this.space-=4,r)};m.Builder.prototype.writeInt64=function(r){this.bb.writeInt64(this.space-=8,r)};m.Builder.prototype.writeFloat32=function(r){this.bb.writeFloat32(this.space-=4,r)};m.Builder.prototype.writeFloat64=function(r){this.bb.writeFloat64(this.space-=8,r)};m.Builder.prototype.addInt8=function(r){this.prep(1,0),this.writeInt8(r)};m.Builder.prototype.addInt16=function(r){this.prep(2,0),this.writeInt16(r)};m.Builder.prototype.addInt32=function(r){this.prep(4,0),this.writeInt32(r)};m.Builder.prototype.addInt64=function(r){this.prep(8,0),this.writeInt64(r)};m.Builder.prototype.addFloat32=function(r){this.prep(4,0),this.writeFloat32(r)};m.Builder.prototype.addFloat64=function(r){this.prep(8,0),this.writeFloat64(r)};m.Builder.prototype.addFieldInt8=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt8(e),this.slot(r))};m.Builder.prototype.addFieldInt16=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt16(e),this.slot(r))};m.Builder.prototype.addFieldInt32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addInt32(e),this.slot(r))};m.Builder.prototype.addFieldInt64=function(r,e,t){(this.force_defaults||!e.equals(t))&&(this.addInt64(e),this.slot(r))};m.Builder.prototype.addFieldFloat32=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat32(e),this.slot(r))};m.Builder.prototype.addFieldFloat64=function(r,e,t){(this.force_defaults||e!=t)&&(this.addFloat64(e),this.slot(r))};m.Builder.prototype.addFieldOffset=function(r,e,t){(this.force_defaults||e!=t)&&(this.addOffset(e),this.slot(r))};m.Builder.prototype.addFieldStruct=function(r,e,t){e!=t&&(this.nested(e),this.slot(r))};m.Builder.prototype.nested=function(r){if(r!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};m.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};m.Builder.prototype.slot=function(r){this.vtable[r]=this.offset()};m.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};m.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=m.ByteBuffer.allocate(t);return n.setPosition(t-e),n.bytes().set(r.bytes(),t-e),n};m.Builder.prototype.addOffset=function(r){this.prep(m.SIZEOF_INT,0),this.writeInt32(this.offset()-r+m.SIZEOF_INT)};m.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()};m.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)*m.SIZEOF_SHORT;this.addInt16(i);var s=0,a=this.space;e:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(o)){for(var d=m.SIZEOF_SHORT;d<i;d+=m.SIZEOF_SHORT)if(this.bb.readInt16(a+d)!=this.bb.readInt16(o+d))continue e;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-r,this.bb.writeInt32(this.space,s-r)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-r,this.offset()-r)),this.isNested=!1,r};m.Builder.prototype.finish=function(r,e,t){var n=t?m.SIZE_PREFIX_LENGTH:0;if(e){var i=e;if(this.prep(this.minalign,m.SIZEOF_INT+m.FILE_IDENTIFIER_LENGTH+n),i.length!=m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+m.FILE_IDENTIFIER_LENGTH);for(var s=m.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(i.charCodeAt(s))}this.prep(this.minalign,m.SIZEOF_INT+n),this.addOffset(r),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)};m.Builder.prototype.finishSizePrefixed=function(r,e){this.finish(r,e,!0)};m.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")};m.Builder.prototype.startVector=function(r,e,t){this.notNested(),this.vector_num_elems=e,this.prep(m.SIZEOF_INT,r*e),this.prep(t,r*e)};m.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};m.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 s=r.charCodeAt(t++);n=(i<<10)+s+(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,o=this.bb.bytes();t<e.length;t++)o[a++]=e[t];return this.endVector()};m.Builder.prototype.createLong=function(r,e){return m.Long.create(r,e)};m.ByteBuffer=function(r){this.bytes_=r,this.position_=0};m.ByteBuffer.allocate=function(r){return new m.ByteBuffer(new Uint8Array(r))};m.ByteBuffer.prototype.clear=function(){this.position_=0};m.ByteBuffer.prototype.bytes=function(){return this.bytes_};m.ByteBuffer.prototype.position=function(){return this.position_};m.ByteBuffer.prototype.setPosition=function(r){this.position_=r};m.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};m.ByteBuffer.prototype.readInt8=function(r){return this.readUint8(r)<<24>>24};m.ByteBuffer.prototype.readUint8=function(r){return this.bytes_[r]};m.ByteBuffer.prototype.readInt16=function(r){return this.readUint16(r)<<16>>16};m.ByteBuffer.prototype.readUint16=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8};m.ByteBuffer.prototype.readInt32=function(r){return this.bytes_[r]|this.bytes_[r+1]<<8|this.bytes_[r+2]<<16|this.bytes_[r+3]<<24};m.ByteBuffer.prototype.readUint32=function(r){return this.readInt32(r)>>>0};m.ByteBuffer.prototype.readInt64=function(r){return new m.Long(this.readInt32(r),this.readInt32(r+4))};m.ByteBuffer.prototype.readUint64=function(r){return new m.Long(this.readUint32(r),this.readUint32(r+4))};m.ByteBuffer.prototype.readFloat32=function(r){return m.int32[0]=this.readInt32(r),m.float32[0]};m.ByteBuffer.prototype.readFloat64=function(r){return m.int32[m.isLittleEndian?0:1]=this.readInt32(r),m.int32[m.isLittleEndian?1:0]=this.readInt32(r+4),m.float64[0]};m.ByteBuffer.prototype.writeInt8=function(r,e){this.bytes_[r]=e};m.ByteBuffer.prototype.writeUint8=function(r,e){this.bytes_[r]=e};m.ByteBuffer.prototype.writeInt16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};m.ByteBuffer.prototype.writeUint16=function(r,e){this.bytes_[r]=e,this.bytes_[r+1]=e>>8};m.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};m.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};m.ByteBuffer.prototype.writeInt64=function(r,e){this.writeInt32(r,e.low),this.writeInt32(r+4,e.high)};m.ByteBuffer.prototype.writeUint64=function(r,e){this.writeUint32(r,e.low),this.writeUint32(r+4,e.high)};m.ByteBuffer.prototype.writeFloat32=function(r,e){m.float32[0]=e,this.writeInt32(r,m.int32[0])};m.ByteBuffer.prototype.writeFloat64=function(r,e){m.float64[0]=e,this.writeInt32(r,m.int32[m.isLittleEndian?0:1]),this.writeInt32(r+4,m.int32[m.isLittleEndian?1:0])};m.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+m.SIZEOF_INT+m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var r="",e=0;e<m.FILE_IDENTIFIER_LENGTH;e++)r+=String.fromCharCode(this.readInt8(this.position_+m.SIZEOF_INT+e));return r};m.ByteBuffer.prototype.__offset=function(r,e){var t=r-this.readInt32(r);return e<this.readInt16(t)?this.readInt16(t+e):0};m.ByteBuffer.prototype.__union=function(r,e){return r.bb_pos=e+this.readInt32(e),r.bb=this,r};m.ByteBuffer.prototype.__string=function(r,e){r+=this.readInt32(r);var t=this.readInt32(r),n="",i=0;if(r+=m.SIZEOF_INT,e===m.Encoding.UTF8_BYTES)return this.bytes_.subarray(r,r+t);for(;i<t;){var s,a=this.readUint8(r+i++);if(a<192)s=a;else{var o=this.readUint8(r+i++);if(a<224)s=(a&31)<<6|o&63;else{var d=this.readUint8(r+i++);if(a<240)s=(a&15)<<12|(o&63)<<6|d&63;else{var h=this.readUint8(r+i++);s=(a&7)<<18|(o&63)<<12|(d&63)<<6|h&63}}}s<65536?n+=String.fromCharCode(s):(s-=65536,n+=String.fromCharCode((s>>10)+55296,(s&(1<<10)-1)+56320))}return n};m.ByteBuffer.prototype.__indirect=function(r){return r+this.readInt32(r)};m.ByteBuffer.prototype.__vector=function(r){return r+this.readInt32(r)+m.SIZEOF_INT};m.ByteBuffer.prototype.__vector_len=function(r){return this.readInt32(r+this.readInt32(r))};m.ByteBuffer.prototype.__has_identifier=function(r){if(r.length!=m.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+m.FILE_IDENTIFIER_LENGTH);for(var e=0;e<m.FILE_IDENTIFIER_LENGTH;e++)if(r.charCodeAt(e)!=this.readInt8(this.position_+m.SIZEOF_INT+e))return!1;return!0};m.ByteBuffer.prototype.createLong=function(r,e){return m.Long.create(r,e)};rp.flatbuffers=m});var Mn=v(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.encodeUtf8=ai.decodeUtf8=void 0;var HT=new TextDecoder("utf-8");ai.decodeUtf8=r=>HT.decode(r);var YT=new TextEncoder;ai.encodeUtf8=r=>YT.encode(r)});var ci=v(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.AsyncQueue=pt.ReadableInterop=pt.ArrowJSON=pt.ITERATOR_DONE=void 0;var ws=ot(),np=Ss();pt.ITERATOR_DONE=Object.freeze({done:!0,value:void 0});var ip=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}};pt.ArrowJSON=ip;var jc=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())}};pt.ReadableInterop=jc;var sp=class extends jc{constructor(){super();this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return ws.__awaiter(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(pt.ITERATOR_DONE);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return np.default.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return np.default.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return ws.__awaiter(this,void 0,void 0,function*(){return yield this.abort(e),pt.ITERATOR_DONE})}return(e){return ws.__awaiter(this,void 0,void 0,function*(){return yield this.close(),pt.ITERATOR_DONE})}read(e){return ws.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return ws.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,n)=>{this.resolvers.push({resolve:t,reject:n})}):Promise.resolve(pt.ITERATOR_DONE)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}};pt.AsyncQueue=sp});var at=v(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.isReadableNodeStream=P.isWritableNodeStream=P.isReadableDOMStream=P.isWritableDOMStream=P.isFetchResponse=P.isFSReadStream=P.isFileHandle=P.isUnderlyingSink=P.isIteratorResult=P.isArrayLike=P.isArrowJSON=P.isAsyncIterable=P.isIterable=P.isObservable=P.isPromise=P.isObject=P.BigUint64ArrayAvailable=P.BigUint64Array=P.BigInt64ArrayAvailable=P.BigInt64Array=P.BigIntAvailable=P.BigInt=void 0;var Fo=ci(),[GT,KT]=(()=>{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]})();P.BigInt=GT;P.BigIntAvailable=KT;var[$T,JT]=(()=>{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]})();P.BigInt64Array=$T;P.BigInt64ArrayAvailable=JT;var[QT,ZT]=(()=>{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]})();P.BigUint64Array=QT;P.BigUint64ArrayAvailable=ZT;var qc=r=>typeof r=="number",op=r=>typeof r=="boolean",et=r=>typeof r=="function";P.isObject=r=>r!=null&&Object(r)===r;P.isPromise=r=>P.isObject(r)&&et(r.then);P.isObservable=r=>P.isObject(r)&&et(r.subscribe);P.isIterable=r=>P.isObject(r)&&et(r[Symbol.iterator]);P.isAsyncIterable=r=>P.isObject(r)&&et(r[Symbol.asyncIterator]);P.isArrowJSON=r=>P.isObject(r)&&P.isObject(r.schema);P.isArrayLike=r=>P.isObject(r)&&qc(r.length);P.isIteratorResult=r=>P.isObject(r)&&"done"in r&&"value"in r;P.isUnderlyingSink=r=>P.isObject(r)&&et(r.abort)&&et(r.close)&&et(r.start)&&et(r.write);P.isFileHandle=r=>P.isObject(r)&&et(r.stat)&&qc(r.fd);P.isFSReadStream=r=>P.isReadableNodeStream(r)&&qc(r.bytesRead);P.isFetchResponse=r=>P.isObject(r)&&P.isReadableDOMStream(r.body);P.isWritableDOMStream=r=>P.isObject(r)&&et(r.abort)&&et(r.getWriter)&&!(r instanceof Fo.ReadableInterop);P.isReadableDOMStream=r=>P.isObject(r)&&et(r.cancel)&&et(r.getReader)&&!(r instanceof Fo.ReadableInterop);P.isWritableNodeStream=r=>P.isObject(r)&&et(r.end)&&et(r.write)&&op(r.writable)&&!(r instanceof Fo.ReadableInterop);P.isReadableNodeStream=r=>P.isObject(r)&&et(r.read)&&et(r.pipe)&&op(r.readable)&&!(r instanceof Fo.ReadableInterop)});var He=v(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.compareArrayLike=R.rebaseValueOffsets=R.toUint8ClampedArrayAsyncIterator=R.toFloat64ArrayAsyncIterator=R.toFloat32ArrayAsyncIterator=R.toUint32ArrayAsyncIterator=R.toUint16ArrayAsyncIterator=R.toUint8ArrayAsyncIterator=R.toInt32ArrayAsyncIterator=R.toInt16ArrayAsyncIterator=R.toInt8ArrayAsyncIterator=R.toArrayBufferViewAsyncIterator=R.toUint8ClampedArrayIterator=R.toFloat64ArrayIterator=R.toFloat32ArrayIterator=R.toUint32ArrayIterator=R.toUint16ArrayIterator=R.toUint8ArrayIterator=R.toInt32ArrayIterator=R.toInt16ArrayIterator=R.toInt8ArrayIterator=R.toArrayBufferViewIterator=R.toUint8ClampedArray=R.toFloat64Array=R.toFloat32Array=R.toBigUint64Array=R.toUint32Array=R.toUint16Array=R.toUint8Array=R.toBigInt64Array=R.toInt32Array=R.toInt16Array=R.toInt8Array=R.toArrayBufferView=R.joinUint8Arrays=R.memcpy=void 0;var Le=ot(),XT=Ar(),eI=Mn(),tI=XT.flatbuffers.ByteBuffer,Un=at(),Wc=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:ArrayBuffer;function rI(r){let e=r[0]?[r[0]]:[],t,n,i,s;for(let a,o,d=0,h=0,_=r.length;++d<_;){if(a=e[h],o=r[d],!a||!o||a.buffer!==o.buffer||o.byteOffset<a.byteOffset){o&&(e[++h]=o);continue}if({byteOffset:t,byteLength:i}=a,{byteOffset:n,byteLength:s}=o,t+i<n||n+s<t){o&&(e[++h]=o);continue}e[h]=new Uint8Array(a.buffer,t,n-t+s)}return e}function zc(r,e,t=0,n=e.byteLength){let i=r.byteLength,s=new Uint8Array(r.buffer,r.byteOffset,i),a=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return s.set(a,t),r}R.memcpy=zc;function nI(r,e){let t=rI(r),n=t.reduce((_,F)=>_+F.byteLength,0),i,s,a,o=0,d=-1,h=Math.min(e||1/0,n);for(let _=t.length;++d<_;){if(i=t[d],s=i.subarray(0,Math.min(i.length,h-o)),h<=o+s.length){s.length<i.length?t[d]=i.subarray(s.length):s.length===i.length&&d++,a?zc(a,s,o):a=s;break}zc(a||(a=new Uint8Array(h)),s,o),o+=s.length}return[a||new Uint8Array(0),t.slice(d),n-(a?a.byteLength:0)]}R.joinUint8Arrays=nI;function lt(r,e){let t=Un.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=eI.encodeUtf8(t)),t instanceof ArrayBuffer?new r(t):t instanceof Wc?new r(t):t instanceof tI?lt(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)}R.toArrayBufferView=lt;R.toInt8Array=r=>lt(Int8Array,r);R.toInt16Array=r=>lt(Int16Array,r);R.toInt32Array=r=>lt(Int32Array,r);R.toBigInt64Array=r=>lt(Un.BigInt64Array,r);R.toUint8Array=r=>lt(Uint8Array,r);R.toUint16Array=r=>lt(Uint16Array,r);R.toUint32Array=r=>lt(Uint32Array,r);R.toBigUint64Array=r=>lt(Un.BigUint64Array,r);R.toFloat32Array=r=>lt(Float32Array,r);R.toFloat64Array=r=>lt(Float64Array,r);R.toUint8ClampedArray=r=>lt(Uint8ClampedArray,r);var Hc=r=>(r.next(),r);function*nr(r,e){let t=function*(i){yield i},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Wc?t(e):Un.isIterable(e)?e:t(e);return yield*Hc(function*(i){let s=null;do s=i.next(yield lt(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}R.toArrayBufferViewIterator=nr;R.toInt8ArrayIterator=r=>nr(Int8Array,r);R.toInt16ArrayIterator=r=>nr(Int16Array,r);R.toInt32ArrayIterator=r=>nr(Int32Array,r);R.toUint8ArrayIterator=r=>nr(Uint8Array,r);R.toUint16ArrayIterator=r=>nr(Uint16Array,r);R.toUint32ArrayIterator=r=>nr(Uint32Array,r);R.toFloat32ArrayIterator=r=>nr(Float32Array,r);R.toFloat64ArrayIterator=r=>nr(Float64Array,r);R.toUint8ClampedArrayIterator=r=>nr(Uint8ClampedArray,r);function zt(r,e){return Le.__asyncGenerator(this,arguments,function*(){if(Un.isPromise(e))return yield Le.__await(yield Le.__await(yield*Le.__asyncDelegator(Le.__asyncValues(zt(r,yield Le.__await(e))))));let n=function(a){return Le.__asyncGenerator(this,arguments,function*(){yield yield Le.__await(yield Le.__await(a))})},i=function(a){return Le.__asyncGenerator(this,arguments,function*(){yield Le.__await(yield*Le.__asyncDelegator(Le.__asyncValues(Hc(function*(o){let d=null;do d=o.next(yield d==null?void 0:d.value);while(!d.done)}(a[Symbol.iterator]())))))})},s=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Wc?n(e):Un.isIterable(e)?i(e):Un.isAsyncIterable(e)?e:n(e);return yield Le.__await(yield*Le.__asyncDelegator(Le.__asyncValues(Hc(function(a){return Le.__asyncGenerator(this,arguments,function*(){let o=null;do o=yield Le.__await(a.next(yield yield Le.__await(lt(r,o))));while(!o.done)})}(s[Symbol.asyncIterator]()))))),yield Le.__await(new r)})}R.toArrayBufferViewAsyncIterator=zt;R.toInt8ArrayAsyncIterator=r=>zt(Int8Array,r);R.toInt16ArrayAsyncIterator=r=>zt(Int16Array,r);R.toInt32ArrayAsyncIterator=r=>zt(Int32Array,r);R.toUint8ArrayAsyncIterator=r=>zt(Uint8Array,r);R.toUint16ArrayAsyncIterator=r=>zt(Uint16Array,r);R.toUint32ArrayAsyncIterator=r=>zt(Uint32Array,r);R.toFloat32ArrayAsyncIterator=r=>zt(Float32Array,r);R.toFloat64ArrayAsyncIterator=r=>zt(Float64Array,r);R.toUint8ClampedArrayAsyncIterator=r=>zt(Uint8ClampedArray,r);function iI(r,e,t){if(r!==0){t=t.slice(0,e+1);for(let n=-1;++n<=e;)t[n]+=r}return t}R.rebaseValueOffsets=iI;function sI(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}R.compareArrayLike=sI});var Ss=v(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});var le=ot(),dt=He();Gc.default={fromIterable(r){return Ro(oI(r))},fromAsyncIterable(r){return Ro(aI(r))},fromDOMStream(r){return Ro(cI(r))},fromNodeStream(r){return Ro(uI(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 Ro=r=>(r.next(),r);function*oI(r){let e,t=!1,n=[],i,s,a,o=0;function d(){return s==="peek"?dt.joinUint8Arrays(n,a)[0]:([i,n,o]=dt.joinUint8Arrays(n,a),i)}({cmd:s,size:a}=yield null);let h=dt.toUint8ArrayIterator(r)[Symbol.iterator]();try{do if({done:e,value:i}=isNaN(a-o)?h.next(void 0):h.next(a-o),!e&&i.byteLength>0&&(n.push(i),o+=i.byteLength),e||a<=o)do({cmd:s,size:a}=yield d());while(a<o);while(!e)}catch(_){(t=!0)&&typeof h.throw=="function"&&h.throw(_)}finally{t===!1&&typeof h.return=="function"&&h.return(null)}return null}function aI(r){return le.__asyncGenerator(this,arguments,function*(){let t,n=!1,i=[],s,a,o,d=0;function h(){return a==="peek"?dt.joinUint8Arrays(i,o)[0]:([s,i,d]=dt.joinUint8Arrays(i,o),s)}({cmd:a,size:o}=yield yield le.__await(null));let _=dt.toUint8ArrayAsyncIterator(r)[Symbol.asyncIterator]();try{do if({done:t,value:s}=isNaN(o-d)?yield le.__await(_.next(void 0)):yield le.__await(_.next(o-d)),!t&&s.byteLength>0&&(i.push(s),d+=s.byteLength),t||o<=d)do({cmd:a,size:o}=yield yield le.__await(h()));while(o<d);while(!t)}catch(F){(n=!0)&&typeof _.throw=="function"&&(yield le.__await(_.throw(F)))}finally{n===!1&&typeof _.return=="function"&&(yield le.__await(_.return(new Uint8Array(0))))}return yield le.__await(null)})}function cI(r){return le.__asyncGenerator(this,arguments,function*(){let t=!1,n=!1,i=[],s,a,o,d=0;function h(){return a==="peek"?dt.joinUint8Arrays(i,o)[0]:([s,i,d]=dt.joinUint8Arrays(i,o),s)}({cmd:a,size:o}=yield yield le.__await(null));let _=new ap(r);try{do if({done:t,value:s}=isNaN(o-d)?yield le.__await(_.read(void 0)):yield le.__await(_.read(o-d)),!t&&s.byteLength>0&&(i.push(dt.toUint8Array(s)),d+=s.byteLength),t||o<=d)do({cmd:a,size:o}=yield yield le.__await(h()));while(o<d);while(!t)}catch(F){(n=!0)&&(yield le.__await(_.cancel(F)))}finally{n===!1?yield le.__await(_.cancel()):r.locked&&_.releaseLock()}return yield le.__await(null)})}var ap=class{constructor(e){this.source=e,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch(t){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}cancel(e){return le.__awaiter(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return le.__awaiter(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=!this.supportsBYOB||typeof e!="number"?yield this.getDefaultReader().read():yield this.readFromBYOBReader(e);return!t.done&&(t.value=dt.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}readFromBYOBReader(e){return le.__awaiter(this,void 0,void 0,function*(){return yield cp(this.getBYOBReader(),new ArrayBuffer(e),0,e)})}};function cp(r,e,t,n){return le.__awaiter(this,void 0,void 0,function*(){if(t>=n)return{done:!1,value:new Uint8Array(e,0,n)};let{done:i,value:s}=yield r.read(new Uint8Array(e,t,n-t));return(t+=s.byteLength)<n&&!i?yield cp(r,s.buffer,t,n):{done:i,value:new Uint8Array(s.buffer,0,t)}})}var Yc=(r,e)=>{let t=i=>n([e,i]),n;return[e,t,new Promise(i=>(n=i)&&r.once(e,t))]};function uI(r){return le.__asyncGenerator(this,arguments,function*(){let t=[],n="error",i=!1,s=null,a,o,d=0,h=[],_;function F(){return a==="peek"?dt.joinUint8Arrays(h,o)[0]:([_,h,d]=dt.joinUint8Arrays(h,o),_)}if({cmd:a,size:o}=yield yield le.__await(null),r.isTTY)return yield yield le.__await(new Uint8Array(0)),yield le.__await(null);try{t[0]=Yc(r,"end"),t[1]=Yc(r,"error");do{if(t[2]=Yc(r,"readable"),[n,s]=yield le.__await(Promise.race(t.map(re=>re[2]))),n==="error")break;if((i=n==="end")||(isFinite(o-d)?(_=dt.toUint8Array(r.read(o-d)),_.byteLength<o-d&&(_=dt.toUint8Array(r.read(void 0)))):_=dt.toUint8Array(r.read(void 0)),_.byteLength>0&&(h.push(_),d+=_.byteLength)),i||o<=d)do({cmd:a,size:o}=yield yield le.__await(F()));while(o<d)}while(!i)}finally{yield le.__await(U(t,n==="error"?s:null))}return yield le.__await(null);function U(re,_e){return _=h=null,new Promise((me,it)=>{for(let[Ne,S]of re)r.off(Ne,S);try{let Ne=r.destroy;Ne&&Ne.call(r,_e),_e=void 0}catch(Ne){_e=Ne||_e}finally{_e!=null?it(_e):me()}})}})}});var Me=v(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.Vector=ui.AbstractVector=void 0;var Mo=class{};ui.AbstractVector=Mo;ui.Vector=Mo;Mo.prototype.data=null});var Jr=v(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.Schema=E.Buffer=E.Field=E.DictionaryEncoding=E.KeyValue=E.Duration=E.Interval=E.Timestamp=E.Time=E.Date=E.Decimal=E.Bool=E.FixedSizeBinary=E.LargeBinary=E.LargeUtf8=E.Binary=E.Utf8=E.FloatingPoint=E.Int=E.Union=E.Map=E.FixedSizeList=E.LargeList=E.List=E.Struct_=E.Null=E.Endianness=E.DictionaryKind=E.Type=E.IntervalUnit=E.TimeUnit=E.DateUnit=E.Precision=E.UnionMode=E.Feature=E.MetadataVersion=void 0;var ge=Ar(),lI;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(lI=E.MetadataVersion||(E.MetadataVersion={}));var dI;(function(r){r[r.UNUSED=0]="UNUSED",r[r.DICTIONARY_REPLACEMENT=1]="DICTIONARY_REPLACEMENT",r[r.COMPRESSED_BODY=2]="COMPRESSED_BODY"})(dI=E.Feature||(E.Feature={}));var Kc;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(Kc=E.UnionMode||(E.UnionMode={}));var $c;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})($c=E.Precision||(E.Precision={}));var Jc;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Jc=E.DateUnit||(E.DateUnit={}));var Pn;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(Pn=E.TimeUnit||(E.TimeUnit={}));var Qc;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME"})(Qc=E.IntervalUnit||(E.IntervalUnit={}));var Zc;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",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.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList"})(Zc=E.Type||(E.Type={}));var Xc;(function(r){r[r.DenseArray=0]="DenseArray"})(Xc=E.DictionaryKind||(E.DictionaryKind={}));var eu;(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(eu=E.Endianness||(E.Endianness={}));var kn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new kn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new kn).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return kn.startNull(e),kn.endNull(e)}};E.Null=kn;var Vn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new Vn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Vn).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return Vn.startStruct_(e),Vn.endStruct_(e)}};E.Struct_=Vn;var Nn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new Nn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Nn).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return Nn.startList(e),Nn.endList(e)}};E.List=Nn;var Ln=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeList(e,t){return(t||new Ln).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Ln).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return Ln.startLargeList(e),Ln.endLargeList(e)}};E.LargeList=Ln;var Wr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new Wr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Wr).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return Wr.startFixedSizeList(e),Wr.addListSize(e,t),Wr.endFixedSizeList(e)}};E.FixedSizeList=Wr;var zr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new zr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new zr).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return zr.startMap(e),zr.addKeysSorted(e,t),zr.endMap(e)}};E.Map=zr;var Or=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new Or).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Or).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Kc.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,Kc.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,n){return Or.startUnion(e),Or.addMode(e,t),Or.addTypeIds(e,n),Or.endUnion(e)}};E.Union=Or;var ir=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new ir).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new ir).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,n){return ir.startInt(e),ir.addBitWidth(e,t),ir.addIsSigned(e,n),ir.endInt(e)}};E.Int=ir;var Hr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new Hr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Hr).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):$c.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,$c.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return Hr.startFloatingPoint(e),Hr.addPrecision(e,t),Hr.endFloatingPoint(e)}};E.FloatingPoint=Hr;var xn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new xn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new xn).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return xn.startUtf8(e),xn.endUtf8(e)}};E.Utf8=xn;var Cn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new Cn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Cn).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return Cn.startBinary(e),Cn.endBinary(e)}};E.Binary=Cn;var jn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new jn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new jn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return jn.startLargeUtf8(e),jn.endLargeUtf8(e)}};E.LargeUtf8=jn;var qn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new qn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new qn).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return qn.startLargeBinary(e),qn.endLargeBinary(e)}};E.LargeBinary=qn;var Yr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new Yr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Yr).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return Yr.startFixedSizeBinary(e),Yr.addByteWidth(e,t),Yr.endFixedSizeBinary(e)}};E.FixedSizeBinary=Yr;var Wn=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new Wn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Wn).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return Wn.startBool(e),Wn.endBool(e)}};E.Bool=Wn;var sr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new sr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new sr).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,n,i){return sr.startDecimal(e),sr.addPrecision(e,t),sr.addScale(e,n),sr.addBitWidth(e,i),sr.endDecimal(e)}};E.Decimal=sr;var Gr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new Gr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Gr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Jc.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,Jc.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return Gr.startDate(e),Gr.addUnit(e,t),Gr.endDate(e)}};E.Date=Gr;var Er=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new Er).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Er).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Pn.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,Pn.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,n){return Er.startTime(e),Er.addUnit(e,t),Er.addBitWidth(e,n),Er.endTime(e)}};E.Time=Er;var Dr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new Dr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Dr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Pn.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,Pn.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,n){return Dr.startTimestamp(e),Dr.addUnit(e,t),Dr.addTimezone(e,n),Dr.endTimestamp(e)}};E.Timestamp=Dr;var Kr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new Kr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Kr).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Qc.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,Qc.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return Kr.startInterval(e),Kr.addUnit(e,t),Kr.endInterval(e)}};E.Interval=Kr;var $r=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new $r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new $r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Pn.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,Pn.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return $r.startDuration(e),$r.addUnit(e,t),$r.endDuration(e)}};E.Duration=$r;var Ht=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new Ht).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Ht).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,n){return Ht.startKeyValue(e),Ht.addKey(e,t),Ht.addValue(e,n),Ht.endKeyValue(e)}};E.KeyValue=Ht;var St=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new St).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new St).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new ir).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Xc.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,Xc.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}static createDictionaryEncoding(e,t,n,i,s){return St.startDictionaryEncoding(e),St.addId(e,t),St.addIndexType(e,n),St.addIsOrdered(e,i),St.addDictionaryKind(e,s),St.endDictionaryEncoding(e)}};E.DictionaryEncoding=St;var ct=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new ct).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new ct).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):Zc.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new St).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?(t||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Ht).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,Zc.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}static createField(e,t,n,i,s,a,o,d){return ct.startField(e),ct.addName(e,t),ct.addNullable(e,n),ct.addTypeType(e,i),ct.addType(e,s),ct.addDictionary(e,a),ct.addChildren(e,o),ct.addCustomMetadata(e,d),ct.endField(e)}};E.Field=ct;var up=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(e,t,n){return e.prep(8,16),e.writeInt64(n),e.writeInt64(t),e.offset()}};E.Buffer=up;var Yt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new Yt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+ge.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Yt).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):eu.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Ht).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):this.bb.createLong(0,0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,eu.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(e,t,n,i,s){return Yt.startSchema(e),Yt.addEndianness(e,t),Yt.addFields(e,n),Yt.addCustomMetadata(e,i),Yt.addFeatures(e,s),Yt.endSchema(e)}};E.Schema=Yt});var ko=v(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Message=Ue.DictionaryBatch=Ue.RecordBatch=Ue.BodyCompression=Ue.FieldNode=Ue.MessageHeader=Ue.BodyCompressionMethod=Ue.CompressionType=void 0;var Uo=Ar(),Po=Jr(),tu;(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(tu=Ue.CompressionType||(Ue.CompressionType={}));var ru;(function(r){r[r.BUFFER=0]="BUFFER"})(ru=Ue.BodyCompressionMethod||(Ue.BodyCompressionMethod={}));var nu;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(nu=Ue.MessageHeader||(Ue.MessageHeader={}));var iu=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(e,t,n){return e.prep(8,16),e.writeInt64(n),e.writeInt64(t),e.offset()}};Ue.FieldNode=iu;var or=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new or).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+Uo.flatbuffers.SIZE_PREFIX_LENGTH),(t||new or).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):tu.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):ru.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,tu.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,ru.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,n){return or.startBodyCompression(e),or.addCodec(e,t),or.addMethod(e,n),or.endBodyCompression(e)}};Ue.BodyCompression=or;var Bt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new Bt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+Uo.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Bt).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}nodes(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new iu).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Po.Buffer).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new or).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}static startRecordBatch(e){e.startObject(4)}static addLength(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static endRecordBatch(e){return e.endObject()}static createRecordBatch(e,t,n,i,s){return Bt.startRecordBatch(e),Bt.addLength(e,t),Bt.addNodes(e,n),Bt.addBuffers(e,i),Bt.addCompression(e,s),Bt.endRecordBatch(e)}};Ue.RecordBatch=Bt;var ar=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new ar).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+Uo.flatbuffers.SIZE_PREFIX_LENGTH),(t||new ar).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Bt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}static createDictionaryBatch(e,t,n,i){return ar.startDictionaryBatch(e),ar.addId(e,t),ar.addData(e,n),ar.addIsDelta(e,i),ar.endDictionaryBatch(e)}};Ue.DictionaryBatch=ar;var At=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new At).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+Uo.flatbuffers.SIZE_PREFIX_LENGTH),(t||new At).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Po.MetadataVersion.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):nu.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Po.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Po.MetadataVersion.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,nu.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,e.createLong(0,0))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,n,i,s,a){return At.startMessage(e),At.addVersion(e,t),At.addHeaderType(e,n),At.addHeader(e,i),At.addBodyLength(e,s),At.addCustomMetadata(e,a),At.endMessage(e)}};Ue.Message=At});var pe=v(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.BufferType=Be.Type=Be.MessageHeader=Be.MetadataVersion=Be.IntervalUnit=Be.UnionMode=Be.Precision=Be.TimeUnit=Be.DateUnit=void 0;var li=Jr();Object.defineProperty(Be,"DateUnit",{enumerable:!0,get:function(){return li.DateUnit}});Object.defineProperty(Be,"TimeUnit",{enumerable:!0,get:function(){return li.TimeUnit}});Object.defineProperty(Be,"Precision",{enumerable:!0,get:function(){return li.Precision}});Object.defineProperty(Be,"UnionMode",{enumerable:!0,get:function(){return li.UnionMode}});Object.defineProperty(Be,"IntervalUnit",{enumerable:!0,get:function(){return li.IntervalUnit}});Object.defineProperty(Be,"MetadataVersion",{enumerable:!0,get:function(){return li.MetadataVersion}});var fI=ko();Object.defineProperty(Be,"MessageHeader",{enumerable:!0,get:function(){return fI.MessageHeader}});var hI;(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"})(hI=Be.Type||(Be.Type={}));var pI;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(pI=Be.BufferType||(Be.BufferType={}))});var cr=v(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.popcnt_uint32=xe.popcnt_array=xe.popcnt_bit_range=xe.BitIterator=xe.packBools=xe.truncateBitmap=xe.setBool=xe.getBit=xe.getBool=void 0;function lp(r,e,t,n){return(t&1<<n)!=0}xe.getBool=lp;function dp(r,e,t,n){return(t&1<<n)>>n}xe.getBit=dp;function yI(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}xe.setBool=yI;function _I(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):fp(new Vo(t,r,e,null,lp)).subarray(0,n)),i}return t}xe.truncateBitmap=_I;function fp(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 s=new Uint8Array(e.length+7&~7);return s.set(e),s}xe.packBools=fp;var Vo=class{constructor(e,t,n,i,s){this.bytes=e,this.length=n,this.context=i,this.get=s,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}};xe.BitIterator=Vo;function su(r,e,t){if(t-e<=0)return 0;if(t-e<8){let s=0;for(let a of new Vo(r,e,t-e,r,dp))s+=a;return s}let n=t>>3<<3,i=e+(e%8==0?0:8-e%8);return su(r,e,i)+su(r,n,t)+hp(r,i>>3,n-i>>3)}xe.popcnt_bit_range=su;function hp(r,e,t){let n=0,i=e|0,s=new DataView(r.buffer,r.byteOffset,r.byteLength),a=t===void 0?r.byteLength:i+t;for(;a-i>=4;)n+=No(s.getUint32(i)),i+=4;for(;a-i>=2;)n+=No(s.getUint16(i)),i+=2;for(;a-i>=1;)n+=No(s.getUint8(i)),i+=1;return n}xe.popcnt_array=hp;function No(r){let e=r|0;return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}xe.popcnt_uint32=No});var ce=v(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.strideForType=w.Dictionary=w.Map_=w.FixedSizeList=w.FixedSizeBinary=w.SparseUnion=w.DenseUnion=w.Union=w.Struct=w.List=w.IntervalYearMonth=w.IntervalDayTime=w.Interval=w.TimestampNanosecond=w.TimestampMicrosecond=w.TimestampMillisecond=w.TimestampSecond=w.Timestamp=w.TimeNanosecond=w.TimeMicrosecond=w.TimeMillisecond=w.TimeSecond=w.Time=w.DateMillisecond=w.DateDay=w.Date_=w.Decimal=w.Bool=w.Utf8=w.Binary=w.Float64=w.Float32=w.Float16=w.Float=w.Uint64=w.Uint32=w.Uint16=w.Uint8=w.Int64=w.Int32=w.Int16=w.Int8=w.Int=w.Null=w.DataType=void 0;var M=pe(),Ae=class{static isNull(e){return(e==null?void 0:e.typeId)===M.Type.Null}static isInt(e){return(e==null?void 0:e.typeId)===M.Type.Int}static isFloat(e){return(e==null?void 0:e.typeId)===M.Type.Float}static isBinary(e){return(e==null?void 0:e.typeId)===M.Type.Binary}static isUtf8(e){return(e==null?void 0:e.typeId)===M.Type.Utf8}static isBool(e){return(e==null?void 0:e.typeId)===M.Type.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===M.Type.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===M.Type.Date}static isTime(e){return(e==null?void 0:e.typeId)===M.Type.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===M.Type.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===M.Type.Interval}static isList(e){return(e==null?void 0:e.typeId)===M.Type.List}static isStruct(e){return(e==null?void 0:e.typeId)===M.Type.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===M.Type.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===M.Type.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===M.Type.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===M.Type.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===M.Type.Dictionary}get typeId(){return M.Type.NONE}};w.DataType=Ae;Ae[Symbol.toStringTag]=(r=>(r.children=null,r.ArrayType=Array,r[Symbol.toStringTag]="DataType"))(Ae.prototype);var Lo=class extends Ae{toString(){return"Null"}get typeId(){return M.Type.Null}};w.Null=Lo;Lo[Symbol.toStringTag]=(r=>r[Symbol.toStringTag]="Null")(Lo.prototype);var Ot=class extends Ae{constructor(e,t){super();this.isSigned=e,this.bitWidth=t}get typeId(){return M.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}`}};w.Int=Ot;Ot[Symbol.toStringTag]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Ot.prototype);var ou=class extends Ot{constructor(){super(!0,8)}};w.Int8=ou;var au=class extends Ot{constructor(){super(!0,16)}};w.Int16=au;var cu=class extends Ot{constructor(){super(!0,32)}};w.Int32=cu;var uu=class extends Ot{constructor(){super(!0,64)}};w.Int64=uu;var lu=class extends Ot{constructor(){super(!1,8)}};w.Uint8=lu;var du=class extends Ot{constructor(){super(!1,16)}};w.Uint16=du;var fu=class extends Ot{constructor(){super(!1,32)}};w.Uint32=fu;var hu=class extends Ot{constructor(){super(!1,64)}};w.Uint64=hu;Object.defineProperty(ou.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(au.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(cu.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(uu.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(lu.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(du.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(fu.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(hu.prototype,"ArrayType",{value:Uint32Array});var zn=class extends Ae{constructor(e){super();this.precision=e}get typeId(){return M.Type.Float}get ArrayType(){switch(this.precision){case M.Precision.HALF:return Uint16Array;case M.Precision.SINGLE:return Float32Array;case M.Precision.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};w.Float=zn;zn[Symbol.toStringTag]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(zn.prototype);var pu=class extends zn{constructor(){super(M.Precision.HALF)}};w.Float16=pu;var yu=class extends zn{constructor(){super(M.Precision.SINGLE)}};w.Float32=yu;var _u=class extends zn{constructor(){super(M.Precision.DOUBLE)}};w.Float64=_u;Object.defineProperty(pu.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(yu.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(_u.prototype,"ArrayType",{value:Float64Array});var xo=class extends Ae{constructor(){super()}get typeId(){return M.Type.Binary}toString(){return"Binary"}};w.Binary=xo;xo[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(xo.prototype);var Co=class extends Ae{constructor(){super()}get typeId(){return M.Type.Utf8}toString(){return"Utf8"}};w.Utf8=Co;Co[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Co.prototype);var jo=class extends Ae{constructor(){super()}get typeId(){return M.Type.Bool}toString(){return"Bool"}};w.Bool=jo;jo[Symbol.toStringTag]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(jo.prototype);var qo=class extends Ae{constructor(e,t){super();this.scale=e,this.precision=t}get typeId(){return M.Type.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};w.Decimal=qo;qo[Symbol.toStringTag]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(qo.prototype);var di=class extends Ae{constructor(e){super();this.unit=e}get typeId(){return M.Type.Date}toString(){return`Date${(this.unit+1)*32}<${M.DateUnit[this.unit]}>`}};w.Date_=di;di[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Date"))(di.prototype);var pp=class extends di{constructor(){super(M.DateUnit.DAY)}};w.DateDay=pp;var yp=class extends di{constructor(){super(M.DateUnit.MILLISECOND)}};w.DateMillisecond=yp;var Qr=class extends Ae{constructor(e,t){super();this.unit=e,this.bitWidth=t}get typeId(){return M.Type.Time}toString(){return`Time${this.bitWidth}<${M.TimeUnit[this.unit]}>`}};w.Time=Qr;Qr[Symbol.toStringTag]=(r=>(r.unit=null,r.bitWidth=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Time"))(Qr.prototype);var _p=class extends Qr{constructor(){super(M.TimeUnit.SECOND,32)}};w.TimeSecond=_p;var mp=class extends Qr{constructor(){super(M.TimeUnit.MILLISECOND,32)}};w.TimeMillisecond=mp;var bp=class extends Qr{constructor(){super(M.TimeUnit.MICROSECOND,64)}};w.TimeMicrosecond=bp;var gp=class extends Qr{constructor(){super(M.TimeUnit.NANOSECOND,64)}};w.TimeNanosecond=gp;var Zr=class extends Ae{constructor(e,t){super();this.unit=e,this.timezone=t}get typeId(){return M.Type.Timestamp}toString(){return`Timestamp<${M.TimeUnit[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};w.Timestamp=Zr;Zr[Symbol.toStringTag]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Timestamp"))(Zr.prototype);var vp=class extends Zr{constructor(e){super(M.TimeUnit.SECOND,e)}};w.TimestampSecond=vp;var Tp=class extends Zr{constructor(e){super(M.TimeUnit.MILLISECOND,e)}};w.TimestampMillisecond=Tp;var Ip=class extends Zr{constructor(e){super(M.TimeUnit.MICROSECOND,e)}};w.TimestampMicrosecond=Ip;var wp=class extends Zr{constructor(e){super(M.TimeUnit.NANOSECOND,e)}};w.TimestampNanosecond=wp;var fi=class extends Ae{constructor(e){super();this.unit=e}get typeId(){return M.Type.Interval}toString(){return`Interval<${M.IntervalUnit[this.unit]}>`}};w.Interval=fi;fi[Symbol.toStringTag]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(fi.prototype);var Sp=class extends fi{constructor(){super(M.IntervalUnit.DAY_TIME)}};w.IntervalDayTime=Sp;var Bp=class extends fi{constructor(){super(M.IntervalUnit.YEAR_MONTH)}};w.IntervalYearMonth=Bp;var Wo=class extends Ae{constructor(e){super();this.children=[e]}get typeId(){return M.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}};w.List=Wo;Wo[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(Wo.prototype);var zo=class extends Ae{constructor(e){super();this.children=e}get typeId(){return M.Type.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};w.Struct=zo;zo[Symbol.toStringTag]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(zo.prototype);var hi=class extends Ae{constructor(e,t,n){super();this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((i,s,a)=>(i[s]=a)&&i||i,Object.create(null))}get typeId(){return M.Type.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};w.Union=hi;hi[Symbol.toStringTag]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(hi.prototype);var Ap=class extends hi{constructor(e,t){super(M.UnionMode.Dense,e,t)}};w.DenseUnion=Ap;var Op=class extends hi{constructor(e,t){super(M.UnionMode.Sparse,e,t)}};w.SparseUnion=Op;var Ho=class extends Ae{constructor(e){super();this.byteWidth=e}get typeId(){return M.Type.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};w.FixedSizeBinary=Ho;Ho[Symbol.toStringTag]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Ho.prototype);var Yo=class extends Ae{constructor(e,t){super();this.listSize=e,this.children=[t]}get typeId(){return M.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}>`}};w.FixedSizeList=Yo;Yo[Symbol.toStringTag]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Yo.prototype);var Go=class extends Ae{constructor(e,t=!1){super();this.children=[e],this.keysSorted=t}get typeId(){return M.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(", ")}}>`}};w.Map_=Go;Go[Symbol.toStringTag]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Go.prototype);var mI=(r=>()=>++r)(-1),Ko=class extends Ae{constructor(e,t,n,i){super();this.indices=t,this.dictionary=e,this.isOrdered=i||!1,this.id=n==null?mI():typeof n=="number"?n:n.low}get typeId(){return M.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}>`}};w.Dictionary=Ko;Ko[Symbol.toStringTag]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Ko.prototype);function bI(r){let e=r;switch(r.typeId){case M.Type.Decimal:return 4;case M.Type.Timestamp:return 2;case M.Type.Date:return 1+e.unit;case M.Type.Interval:return 1+e.unit;case M.Type.Int:return 1+ +(e.bitWidth>32);case M.Type.Time:return 1+ +(e.bitWidth>32);case M.Type.FixedSizeList:return e.listSize;case M.Type.FixedSizeBinary:return e.byteWidth;default:return 1}}w.strideForType=bI});var Gt=v(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.Data=Hn.kUnknownNullCount=void 0;var gI=cr(),vI=cr(),k=pe(),TI=ce(),ne=He();Hn.kUnknownNullCount=-1;var G=class{constructor(e,t,n,i,s,a,o){this.type=e,this.dictionary=o,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(h=>h instanceof G?h:h.data);let d;s instanceof G?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=TI.strideForType(e),s&&((d=s[0])&&(this.valueOffsets=d),(d=s[1])&&(this.values=d),(d=s[2])&&(this.nullBitmap=d),(d=s[3])&&(this.typeIds=d)))}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:s}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),s&&(e+=s.byteLength),this.childData.reduce((a,o)=>a+o.byteLength,e)}get nullCount(){let e=this._nullCount,t;return e<=Hn.kUnknownNullCount&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-vI.popcnt_bit_range(t,this.offset,this.offset+this.length)),e}clone(e,t=this.offset,n=this.length,i=this._nullCount,s=this,a=this.childData){return new G(e,t,n,i,s,a,this.dictionary)}slice(e,t){let{stride:n,typeId:i,childData:s}=this,a=+(this._nullCount===0)-1,o=i===16?n:1,d=this._sliceBuffers(e,t,n,i);return this.clone(this.type,this.offset+e,t,a,d,!s.length||this.valueOffsets?s:this._sliceChildren(s,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===k.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(gI.truncateBitmap(this.offset,t,this.nullBitmap),0);let s=this.buffers;return s[k.BufferType.VALIDITY]=i,this.clone(this.type,0,e,n+(e-t),s)}_sliceBuffers(e,t,n,i){let s,{buffers:a}=this;return(s=a[k.BufferType.TYPE])&&(a[k.BufferType.TYPE]=s.subarray(e,e+t)),(s=a[k.BufferType.OFFSET])&&(a[k.BufferType.OFFSET]=s.subarray(e,e+t+1))||(s=a[k.BufferType.DATA])&&(a[k.BufferType.DATA]=i===6?s:s.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,s,a,o){switch(s instanceof G?s=s.buffers:s||(s=[]),e.typeId){case k.Type.Null:return G.Null(e,t,n);case k.Type.Int:return G.Int(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Dictionary:return G.Dictionary(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[],o);case k.Type.Float:return G.Float(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Bool:return G.Bool(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Decimal:return G.Decimal(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Date:return G.Date(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Time:return G.Time(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Timestamp:return G.Timestamp(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Interval:return G.Interval(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.FixedSizeBinary:return G.FixedSizeBinary(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.DATA]||[]);case k.Type.Binary:return G.Binary(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.OFFSET]||[],s[k.BufferType.DATA]||[]);case k.Type.Utf8:return G.Utf8(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.OFFSET]||[],s[k.BufferType.DATA]||[]);case k.Type.List:return G.List(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.OFFSET]||[],(a||[])[0]);case k.Type.FixedSizeList:return G.FixedSizeList(e,t,n,i||0,s[k.BufferType.VALIDITY],(a||[])[0]);case k.Type.Struct:return G.Struct(e,t,n,i||0,s[k.BufferType.VALIDITY],a||[]);case k.Type.Map:return G.Map(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.OFFSET]||[],(a||[])[0]);case k.Type.Union:return G.Union(e,t,n,i||0,s[k.BufferType.VALIDITY],s[k.BufferType.TYPE]||[],s[k.BufferType.OFFSET]||a,a)}throw new Error(`Unrecognized typeId ${e.typeId}`)}static Null(e,t,n){return new G(e,t,n,0)}static Int(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Dictionary(e,t,n,i,s,a,o){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.indices.ArrayType,a),ne.toUint8Array(s)],[],o)}static Float(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Bool(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Decimal(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Date(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Time(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Timestamp(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Interval(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static FixedSizeBinary(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,a),ne.toUint8Array(s)])}static Binary(e,t,n,i,s,a,o){return new G(e,t,n,i,[ne.toInt32Array(a),ne.toUint8Array(o),ne.toUint8Array(s)])}static Utf8(e,t,n,i,s,a,o){return new G(e,t,n,i,[ne.toInt32Array(a),ne.toUint8Array(o),ne.toUint8Array(s)])}static List(e,t,n,i,s,a,o){return new G(e,t,n,i,[ne.toInt32Array(a),void 0,ne.toUint8Array(s)],o?[o]:[])}static FixedSizeList(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,void 0,ne.toUint8Array(s)],a?[a]:[])}static Struct(e,t,n,i,s,a){return new G(e,t,n,i,[void 0,void 0,ne.toUint8Array(s)],a)}static Map(e,t,n,i,s,a,o){return new G(e,t,n,i,[ne.toInt32Array(a),void 0,ne.toUint8Array(s)],o?[o]:[])}static Union(e,t,n,i,s,a,o,d){let h=[void 0,void 0,ne.toUint8Array(s),ne.toArrayBufferView(e.ArrayType,a)];return e.mode===k.UnionMode.Sparse?new G(e,t,n,i,h,o):(h[k.BufferType.OFFSET]=ne.toInt32Array(o),new G(e,t,n,i,h,d))}};Hn.Data=G;G.prototype.childData=Object.freeze([])});var mu=v($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.valueToString=void 0;var II=void 0;function wI(r){if(r===null)return"null";if(r===II)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)}$o.valueToString=wI});var Ep=v(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.createIsValidFunction=void 0;var bu=mu(),SI=at();function BI(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
2
|
switch (x) {${t.map(n=>`
|
|
3
|
-
case ${
|
|
3
|
+
case ${AI(n)}:`).join("")}
|
|
4
4
|
return false;
|
|
5
5
|
}`),r.length!==t.length&&(e=`if (x !== x) return false;
|
|
6
6
|
${e}`),new Function("x",`${e}
|
|
7
|
-
return true;`)}Ko.createIsValidFunction=TI;function II(r){return typeof r!="bigint"?mu.valueToString(r):vI.BigIntAvailable?`${mu.valueToString(r)}n`:`"${mu.valueToString(r)}"`}});var Xr=v(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.WideBufferBuilder=Ot.OffsetsBufferBuilder=Ot.BitmapBufferBuilder=Ot.DataBufferBuilder=Ot.BufferBuilder=void 0;var Ap=He(),bu=at(),gu=(r,e)=>(r*e+63&~63||64)/e,wI=(r,e=0)=>r.length>=e?r.subarray(0,e):Ap.memcpy(new r.constructor(e),r,0),ws=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?gu(n*1,this.BYTES_PER_ELEMENT):gu(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=gu(e*this.stride,this.BYTES_PER_ELEMENT);let t=wI(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this._resize(0),this}_resize(e){return this.buffer=Ap.memcpy(new this.ArrayType(e),this.buffer)}};Ot.BufferBuilder=ws;ws.prototype.offset=0;var $o=class extends ws{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}};Ot.DataBufferBuilder=$o;var Op=class extends $o{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,s=e%8,a=n[i]>>s&1;return t?a===0&&(n[i]|=1<<s,++this.numValid):a===1&&(n[i]&=~(1<<s),--this.numValid),this}clear(){return this.numValid=0,super.clear()}};Ot.BitmapBufferBuilder=Op;var Ep=class extends $o{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)}};Ot.OffsetsBufferBuilder=Ep;var Dp=class extends ws{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}};Ot.WideBufferBuilder=Dp});var Oe=v(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.VariableWidthBuilder=en.FixedWidthBuilder=en.Builder=void 0;var hi=ot(),SI=Me(),pi=pe(),BI=Gt(),AI=Bp(),vu=Xr(),OI=ce(),Et=class{constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=OI.strideForType(e),this._nulls=new vu.BitmapBufferBuilder,t&&t.length>0&&(this._isValid=AI.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 EI(e)}static throughAsyncIterable(e){return DI(e)}toVector(){return SI.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:s,nullCount:a}=this;i?(e[pi.BufferType.TYPE]=i.flush(s),n&&(e[pi.BufferType.OFFSET]=n.flush(s))):n?(t&&(e[pi.BufferType.DATA]=t.flush(n.last())),e[pi.BufferType.OFFSET]=n.flush(s)):t&&(e[pi.BufferType.DATA]=t.flush(s)),a>0&&(e[pi.BufferType.VALIDITY]=this._nulls.flush(s));let o=BI.Data.new(this.type,0,s,a,e,this.children.map(d=>d.flush()));return this.clear(),o}finish(){return this.finished=!0,this.children.forEach(e=>e.finish()),this}clear(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach(e=>e.clear()),this}};en.Builder=Et;Et.prototype.length=1;Et.prototype.stride=1;Et.prototype.children=null;Et.prototype.finished=!1;Et.prototype.nullValues=null;Et.prototype._isValid=()=>!0;var Fp=class extends Et{constructor(e){super(e);this._values=new vu.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)}};en.FixedWidthBuilder=Fp;var Rp=class extends Et{constructor(e){super(e);this._pendingLength=0,this._offsets=new vu.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}};en.VariableWidthBuilder=Rp;function EI(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function*(i){let s=0,a=Et.new(r);for(let o of i)a.append(o)[n]>=t&&++s&&(yield a.toVector());(a.finish().length>0||s===0)&&(yield a.toVector())}}function DI(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function(i){return hi.__asyncGenerator(this,arguments,function*(){var s,a;let o=0,d=Et.new(r);try{for(var h=hi.__asyncValues(i),_;_=yield hi.__await(h.next()),!_.done;){let F=_.value;d.append(F)[n]>=t&&++o&&(yield yield hi.__await(d.toVector()))}}catch(F){s={error:F}}finally{try{_&&!_.done&&(a=h.return)&&(yield hi.__await(a.call(h)))}finally{if(s)throw s.error}}(d.finish().length>0||o===0)&&(yield yield hi.__await(d.toVector()))})}}});var Tu=v(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.BoolBuilder=void 0;var FI=Xr(),RI=Oe(),Mp=class extends RI.Builder{constructor(e){super(e);this._values=new FI.BitmapBufferBuilder}setValue(e,t){this._values.set(e,+t)}};Jo.BoolBuilder=Mp});var Iu=v(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.NullBuilder=void 0;var MI=Oe(),Up=class extends MI.Builder{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};Qo.NullBuilder=Up});var wu=v(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.DateMillisecondBuilder=tn.DateDayBuilder=tn.DateBuilder=void 0;var UI=Oe(),Zo=class extends UI.FixedWidthBuilder{};tn.DateBuilder=Zo;var Pp=class extends Zo{};tn.DateDayBuilder=Pp;var kp=class extends Zo{};tn.DateMillisecondBuilder=kp});var Su=v(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.DecimalBuilder=void 0;var PI=Oe(),Vp=class extends PI.FixedWidthBuilder{};Xo.DecimalBuilder=Vp});var Au=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.DictionaryBuilder=void 0;var kI=ce(),Bu=Oe(),Np=class extends Bu.Builder{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new kI.Dictionary(e.dictionary,e.indices,e.id,e.isOrdered)});this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Bu.Builder.new({type:this.type.indices,nullValues:t}),this.dictionary=Bu.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),s=n[i];return s===void 0&&(n[i]=s=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,s)}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}`}};ea.DictionaryBuilder=Np});var Ou=v(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.FixedSizeBinaryBuilder=void 0;var VI=Oe(),Lp=class extends VI.FixedWidthBuilder{};ta.FixedSizeBinaryBuilder=Lp});var Ss=v(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.float64ToUint16=_i.uint16ToFloat64=void 0;var xp=new Float64Array(1),yi=new Uint32Array(xp.buffer);function NI(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=Math.pow(-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*Math.pow(2,e-15)*(1+t)}_i.uint16ToFloat64=NI;function LI(r){if(r!==r)return 32256;xp[0]=r;let e=(yi[1]&2147483648)>>16&65535,t=yi[1]&2146435072,n=0;return t>=1089470464?yi[0]>0?t=31744:(t=(t&2080374784)>>16,n=(yi[1]&1048575)>>10):t<=1056964608?(n=1048576+(yi[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(yi[1]&1048575)+512>>10),e|t|n&65535}_i.float64ToUint16=LI});var Eu=v(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.Float64Builder=lr.Float32Builder=lr.Float16Builder=lr.FloatBuilder=void 0;var xI=Ss(),CI=Oe(),Bs=class extends CI.FixedWidthBuilder{};lr.FloatBuilder=Bs;var Cp=class extends Bs{setValue(e,t){this._values.set(e,xI.float64ToUint16(t))}};lr.Float16Builder=Cp;var jp=class extends Bs{setValue(e,t){this._values.set(e,t)}};lr.Float32Builder=jp;var qp=class extends Bs{setValue(e,t){this._values.set(e,t)}};lr.Float64Builder=qp});var Es=v(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.BN=Ye.bignumToBigInt=Ye.bignumToString=Ye.isArrowBigNumSymbol=void 0;var jI=He(),As=at();Ye.isArrowBigNumSymbol=Symbol.for("isArrowBigNum");function Kt(r,...e){return e.length===0?Object.setPrototypeOf(jI.toArrayBufferView(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}Kt.prototype[Ye.isArrowBigNumSymbol]=!0;Kt.prototype.toJSON=function(){return`"${Ye.bignumToString(this)}"`};Kt.prototype.valueOf=function(){return Wp(this)};Kt.prototype.toString=function(){return Ye.bignumToString(this)};Kt.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Wp(this);case"string":return Ye.bignumToString(this);case"default":return Ye.bignumToBigInt(this)}return Ye.bignumToString(this)};function mi(...r){return Kt.apply(this,r)}function bi(...r){return Kt.apply(this,r)}function Os(...r){return Kt.apply(this,r)}Object.setPrototypeOf(mi.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(bi.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Os.prototype,Object.create(Uint32Array.prototype));Object.assign(mi.prototype,Kt.prototype,{constructor:mi,signed:!0,TypedArray:Int32Array,BigIntArray:As.BigInt64Array});Object.assign(bi.prototype,Kt.prototype,{constructor:bi,signed:!1,TypedArray:Uint32Array,BigIntArray:As.BigUint64Array});Object.assign(Os.prototype,Kt.prototype,{constructor:Os,signed:!0,TypedArray:Uint32Array,BigIntArray:As.BigUint64Array});function Wp(r){let{buffer:e,byteOffset:t,length:n,signed:i}=r,s=new Int32Array(e,t,n),a=0,o=0,d=s.length,h,_;for(;o<d;)_=s[o++],h=s[o++],i||(h=h>>>0),a+=(_>>>0)+h*Math.pow(o,32);return a}As.BigIntAvailable?(Ye.bignumToBigInt=r=>r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Du(r),Ye.bignumToString=r=>r.byteLength===8?`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`:Du(r)):(Ye.bignumToString=Du,Ye.bignumToBigInt=Ye.bignumToString);function Du(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),s=-1,a=n.length-1;do{for(t[0]=n[s=0];s<a;)n[s++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[s];n[s]=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 ra=class{static new(e,t){switch(t){case!0:return new mi(e);case!1:return new bi(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case As.BigInt64Array:return new mi(e)}return e.byteLength===16?new Os(e):new bi(e)}static signed(e){return new mi(e)}static unsigned(e){return new bi(e)}static decimal(e){return new Os(e)}constructor(e,t){return ra.new(e,t)}};Ye.BN=ra});var Fu=v(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.Uint64Builder=Ce.Uint32Builder=Ce.Uint16Builder=Ce.Uint8Builder=Ce.Int64Builder=Ce.Int32Builder=Ce.Int16Builder=Ce.Int8Builder=Ce.IntBuilder=void 0;var qI=Es(),zp=Xr(),WI=at(),zI=Oe(),dr=class extends zI.FixedWidthBuilder{setValue(e,t){this._values.set(e,t)}};Ce.IntBuilder=dr;var Hp=class extends dr{};Ce.Int8Builder=Hp;var Yp=class extends dr{};Ce.Int16Builder=Yp;var Gp=class extends dr{};Ce.Int32Builder=Gp;var Kp=class extends dr{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(na));super(e);this._values=new zp.WideBufferBuilder(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(na(e))}};Ce.Int64Builder=Kp;var $p=class extends dr{};Ce.Uint8Builder=$p;var Jp=class extends dr{};Ce.Uint16Builder=Jp;var Qp=class extends dr{};Ce.Uint32Builder=Qp;var Zp=class extends dr{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(na));super(e);this._values=new zp.WideBufferBuilder(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(na(e))}};Ce.Uint64Builder=Zp;var na=(r=>e=>(ArrayBuffer.isView(e)&&(r.buffer=e.buffer,r.byteOffset=e.byteOffset,r.byteLength=e.byteLength,e=qI.bignumToBigInt(r),r.buffer=null),e))({BigIntArray:WI.BigInt64Array})});var Ru=v(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.TimeNanosecondBuilder=Dt.TimeMicrosecondBuilder=Dt.TimeMillisecondBuilder=Dt.TimeSecondBuilder=Dt.TimeBuilder=void 0;var HI=Oe(),gi=class extends HI.FixedWidthBuilder{};Dt.TimeBuilder=gi;var Xp=class extends gi{};Dt.TimeSecondBuilder=Xp;var ey=class extends gi{};Dt.TimeMillisecondBuilder=ey;var ty=class extends gi{};Dt.TimeMicrosecondBuilder=ty;var ry=class extends gi{};Dt.TimeNanosecondBuilder=ry});var Mu=v(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.TimestampNanosecondBuilder=Ft.TimestampMicrosecondBuilder=Ft.TimestampMillisecondBuilder=Ft.TimestampSecondBuilder=Ft.TimestampBuilder=void 0;var YI=Oe(),vi=class extends YI.FixedWidthBuilder{};Ft.TimestampBuilder=vi;var ny=class extends vi{};Ft.TimestampSecondBuilder=ny;var iy=class extends vi{};Ft.TimestampMillisecondBuilder=iy;var sy=class extends vi{};Ft.TimestampMicrosecondBuilder=sy;var oy=class extends vi{};Ft.TimestampNanosecondBuilder=oy});var Uu=v(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.IntervalYearMonthBuilder=rn.IntervalDayTimeBuilder=rn.IntervalBuilder=void 0;var GI=Oe(),ia=class extends GI.FixedWidthBuilder{};rn.IntervalBuilder=ia;var ay=class extends ia{};rn.IntervalDayTimeBuilder=ay;var cy=class extends ia{};rn.IntervalYearMonthBuilder=cy});var oa=v(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.BinaryBuilder=void 0;var KI=He(),$I=Xr(),JI=Oe(),uy=class extends JI.VariableWidthBuilder{constructor(e){super(e);this._values=new $I.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,KI.toUint8Array(t))}_flushPending(e,t){let n=this._offsets,i=this._values.reserve(t).buffer,s=0,a=0,o=0,d;for([s,d]of e)d===void 0?n.set(s,0):(a=d.length,i.set(d,o),n.set(s,a),o+=a)}};sa.BinaryBuilder=uy});var ca=v(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.Utf8Builder=void 0;var QI=Rn(),ZI=oa(),XI=Xr(),ew=Oe(),Pu=class extends ew.VariableWidthBuilder{constructor(e){super(e);this._values=new XI.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,QI.encodeUtf8(t))}_flushPending(e,t){}};aa.Utf8Builder=Pu;Pu.prototype._flushPending=ZI.BinaryBuilder.prototype._flushPending});var ku=v(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.Run=void 0;var tw=Me(),ly=class{get length(){return this._values.length}get(e){return this._values[e]}clear(){return this._values=null,this}bind(e){return e instanceof tw.Vector?e:(this._values=e,this)}};ua.Run=ly});var Je=v(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.Field=Ti.Schema=void 0;var rw=ce(),Rt=class{constructor(e=[],t,n){this.fields=e||[],this.metadata=t||new Map,n||(n=Vu(e)),this.dictionaries=n}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}select(...e){let t=e.reduce((n,i)=>(n[i]=!0)&&n,Object.create(null));return new Rt(this.fields.filter(n=>t[n.name]),this.metadata)}selectAt(...e){return new Rt(e.map(t=>this.fields[t]).filter(Boolean),this.metadata)}assign(...e){let t=e[0]instanceof Rt?e[0]:Array.isArray(e[0])?new Rt(e[0]):new Rt(e),n=[...this.fields],i=la(la(new Map,this.metadata),t.metadata),s=t.fields.filter(o=>{let d=n.findIndex(h=>h.name===o.name);return~d?(n[d]=o.clone({metadata:la(la(new Map,n[d].metadata),o.metadata)}))&&!1:!0}),a=Vu(s,new Map);return new Rt([...n,...s],i,new Map([...this.dictionaries,...a]))}};Ti.Schema=Rt;var Fr=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,s]=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),s===void 0&&(s=e[0].metadata)),new Fr(`${t}`,n,i,s)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[t,n,i,s]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,n=this.type,i=this.nullable,s=this.metadata]=e:{name:t=this.name,type:n=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=e[0],Fr.new(t,n,i,s)}};Ti.Field=Fr;function la(r,e){return new Map([...r||new Map,...e||new Map])}function Vu(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let s=r[t].type;if(rw.DataType.isDictionary(s)){if(!e.has(s.id))e.set(s.id,s.dictionary);else if(e.get(s.id)!==s.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}s.children&&s.children.length>0&&Vu(s.children,e)}return e}Rt.prototype.fields=null;Rt.prototype.metadata=null;Rt.prototype.dictionaries=null;Fr.prototype.type=null;Fr.prototype.name=null;Fr.prototype.nullable=null;Fr.prototype.metadata=null});var Nu=v(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.ListBuilder=void 0;var nw=ku(),iw=Je(),sw=ce(),ow=Xr(),aw=Oe(),dy=class extends aw.VariableWidthBuilder{constructor(e){super(e);this._run=new nw.Run,this._offsets=new ow.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 sw.List(new iw.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,s=0,a;for([s,a]of e)a===void 0?n.set(s,0):(n.set(s,a.length),i(this,s,t.bind(a)))}};da.ListBuilder=dy});var Lu=v(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.FixedSizeListBuilder=void 0;var cw=ku(),uw=Je(),lw=Oe(),dw=ce(),fy=class extends lw.Builder{constructor(){super(...arguments);this._run=new cw.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 dw.FixedSizeList(this.type.listSize,new uw.Field(t,e.type,!0)),n}clear(){return this._run.clear(),super.clear()}};fa.FixedSizeListBuilder=fy});var xu=v(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.MapBuilder=void 0;var fw=Je(),hw=ce(),pw=Oe(),hy=class extends pw.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 hw.Map_(new fw.Field(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,n=this._setValue;e.forEach((i,s)=>{i===void 0?t.set(s,0):(t.set(s,i.size),n(this,s,i))})}};ha.MapBuilder=hy});var Cu=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.StructBuilder=void 0;var yw=Je(),_w=Oe(),mw=ce(),py=class extends _w.Builder{addChild(e,t=`${this.numChildren}`){let n=this.children.push(e);return this.type=new mw.Struct([...this.type.children,new yw.Field(t,e.type,!0)]),n}};pa.StructBuilder=py});var ju=v(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.DenseUnionBuilder=nn.SparseUnionBuilder=nn.UnionBuilder=void 0;var bw=Je(),yy=Xr(),gw=Oe(),vw=ce(),ya=class extends gw.Builder{constructor(e){super(e);this._typeIds=new yy.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:s,typeIds:a}}=this,o=[...i,new bw.Field(t,e.type)];return this.type=new vw.Union(s,[...a,n],o),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.")}};nn.UnionBuilder=ya;var _y=class extends ya{};nn.SparseUnionBuilder=_y;var my=class extends ya{constructor(e){super(e);this._offsets=new yy.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)}};nn.DenseUnionBuilder=my});var tt=v(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.Visitor=void 0;var Tw=Gt(),Iw=Me(),b=pe(),ww=ce(),fe=class{visitMany(e,...t){return e.map((n,i)=>this.visit(n,...t.map(s=>s[i])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Sw(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}};_a.Visitor=fe;function Sw(r,e,t=!0){let n=null,i=b.Type.NONE;switch(e instanceof Tw.Data||e instanceof Iw.Vector?i=qu(e.type):e instanceof ww.DataType?i=qu(e):typeof(i=e)!="number"&&(i=b.Type[e]),i){case b.Type.Null:n=r.visitNull;break;case b.Type.Bool:n=r.visitBool;break;case b.Type.Int:n=r.visitInt;break;case b.Type.Int8:n=r.visitInt8||r.visitInt;break;case b.Type.Int16:n=r.visitInt16||r.visitInt;break;case b.Type.Int32:n=r.visitInt32||r.visitInt;break;case b.Type.Int64:n=r.visitInt64||r.visitInt;break;case b.Type.Uint8:n=r.visitUint8||r.visitInt;break;case b.Type.Uint16:n=r.visitUint16||r.visitInt;break;case b.Type.Uint32:n=r.visitUint32||r.visitInt;break;case b.Type.Uint64:n=r.visitUint64||r.visitInt;break;case b.Type.Float:n=r.visitFloat;break;case b.Type.Float16:n=r.visitFloat16||r.visitFloat;break;case b.Type.Float32:n=r.visitFloat32||r.visitFloat;break;case b.Type.Float64:n=r.visitFloat64||r.visitFloat;break;case b.Type.Utf8:n=r.visitUtf8;break;case b.Type.Binary:n=r.visitBinary;break;case b.Type.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case b.Type.Date:n=r.visitDate;break;case b.Type.DateDay:n=r.visitDateDay||r.visitDate;break;case b.Type.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case b.Type.Timestamp:n=r.visitTimestamp;break;case b.Type.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case b.Type.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case b.Type.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case b.Type.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case b.Type.Time:n=r.visitTime;break;case b.Type.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case b.Type.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case b.Type.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case b.Type.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case b.Type.Decimal:n=r.visitDecimal;break;case b.Type.List:n=r.visitList;break;case b.Type.Struct:n=r.visitStruct;break;case b.Type.Union:n=r.visitUnion;break;case b.Type.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case b.Type.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case b.Type.Dictionary:n=r.visitDictionary;break;case b.Type.Interval:n=r.visitInterval;break;case b.Type.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case b.Type.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case b.Type.FixedSizeList:n=r.visitFixedSizeList;break;case b.Type.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${b.Type[i]}'`)}function qu(r){switch(r.typeId){case b.Type.Null:return b.Type.Null;case b.Type.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?b.Type.Int8:b.Type.Uint8;case 16:return t?b.Type.Int16:b.Type.Uint16;case 32:return t?b.Type.Int32:b.Type.Uint32;case 64:return t?b.Type.Int64:b.Type.Uint64}return b.Type.Int}case b.Type.Float:switch(r.precision){case b.Precision.HALF:return b.Type.Float16;case b.Precision.SINGLE:return b.Type.Float32;case b.Precision.DOUBLE:return b.Type.Float64}return b.Type.Float;case b.Type.Binary:return b.Type.Binary;case b.Type.Utf8:return b.Type.Utf8;case b.Type.Bool:return b.Type.Bool;case b.Type.Decimal:return b.Type.Decimal;case b.Type.Time:switch(r.unit){case b.TimeUnit.SECOND:return b.Type.TimeSecond;case b.TimeUnit.MILLISECOND:return b.Type.TimeMillisecond;case b.TimeUnit.MICROSECOND:return b.Type.TimeMicrosecond;case b.TimeUnit.NANOSECOND:return b.Type.TimeNanosecond}return b.Type.Time;case b.Type.Timestamp:switch(r.unit){case b.TimeUnit.SECOND:return b.Type.TimestampSecond;case b.TimeUnit.MILLISECOND:return b.Type.TimestampMillisecond;case b.TimeUnit.MICROSECOND:return b.Type.TimestampMicrosecond;case b.TimeUnit.NANOSECOND:return b.Type.TimestampNanosecond}return b.Type.Timestamp;case b.Type.Date:switch(r.unit){case b.DateUnit.DAY:return b.Type.DateDay;case b.DateUnit.MILLISECOND:return b.Type.DateMillisecond}return b.Type.Date;case b.Type.Interval:switch(r.unit){case b.IntervalUnit.DAY_TIME:return b.Type.IntervalDayTime;case b.IntervalUnit.YEAR_MONTH:return b.Type.IntervalYearMonth}return b.Type.Interval;case b.Type.Map:return b.Type.Map;case b.Type.List:return b.Type.List;case b.Type.Struct:return b.Type.Struct;case b.Type.Union:switch(r.mode){case b.UnionMode.Dense:return b.Type.DenseUnion;case b.UnionMode.Sparse:return b.Type.SparseUnion}return b.Type.Union;case b.Type.FixedSizeBinary:return b.Type.FixedSizeBinary;case b.Type.FixedSizeList:return b.Type.FixedSizeList;case b.Type.Dictionary:return b.Type.Dictionary}throw new Error(`Unrecognized type '${b.Type[r.typeId]}'`)}fe.prototype.visitInt8=null;fe.prototype.visitInt16=null;fe.prototype.visitInt32=null;fe.prototype.visitInt64=null;fe.prototype.visitUint8=null;fe.prototype.visitUint16=null;fe.prototype.visitUint32=null;fe.prototype.visitUint64=null;fe.prototype.visitFloat16=null;fe.prototype.visitFloat32=null;fe.prototype.visitFloat64=null;fe.prototype.visitDateDay=null;fe.prototype.visitDateMillisecond=null;fe.prototype.visitTimestampSecond=null;fe.prototype.visitTimestampMillisecond=null;fe.prototype.visitTimestampMicrosecond=null;fe.prototype.visitTimestampNanosecond=null;fe.prototype.visitTimeSecond=null;fe.prototype.visitTimeMillisecond=null;fe.prototype.visitTimeMicrosecond=null;fe.prototype.visitTimeNanosecond=null;fe.prototype.visitDenseUnion=null;fe.prototype.visitSparseUnion=null;fe.prototype.visitIntervalDayTime=null;fe.prototype.visitIntervalYearMonth=null});var Hu=v(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.instance=Ii.SetVisitor=void 0;var Bw=Me(),Aw=tt(),Ow=Rn(),Ew=Ss(),Dw=He(),Mt=pe(),K=class extends Aw.Visitor{};Ii.SetVisitor=K;var Fw=(r,e,t)=>{r[e]=t/864e5|0},Wu=(r,e,t)=>{r[e]=t%4294967296|0,r[e+1]=t/4294967296|0},Rw=(r,e,t)=>{r[e]=t*1e3%4294967296|0,r[e+1]=t*1e3/4294967296|0},Mw=(r,e,t)=>{r[e]=t*1e6%4294967296|0,r[e+1]=t*1e6/4294967296|0},by=(r,e,t,n)=>{let{[t]:i,[t+1]:s}=e;i!=null&&s!=null&&r.set(n.subarray(0,s-i),i)},Uw=({offset:r,values:e},t,n)=>{let i=r+t;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)},gy=({values:r},e,t)=>{Fw(r,e,t.valueOf())},vy=({values:r},e,t)=>{Wu(r,e*2,t.valueOf())},fr=({stride:r,values:e},t,n)=>{e[r*t]=n},Ty=({stride:r,values:e},t,n)=>{e[r*t]=Ew.float64ToUint16(n)},zu=(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:s}=r,a=Dw.toArrayBufferView(s,n);r.values.set(a.subarray(0,i),i*e)}}},Pw=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},kw=({values:r,valueOffsets:e},t,n)=>by(r,e,t,n),Vw=({values:r,valueOffsets:e},t,n)=>{by(r,e,t,Ow.encodeUtf8(n))},Nw=(r,e,t)=>{r.type.bitWidth<64?fr(r,e,t):zu(r,e,t)},Lw=(r,e,t)=>{r.type.precision!==Mt.Precision.HALF?fr(r,e,t):Ty(r,e,t)},xw=(r,e,t)=>{r.type.unit===Mt.DateUnit.DAY?gy(r,e,t):vy(r,e,t)},Iy=({values:r},e,t)=>Wu(r,e*2,t/1e3),wy=({values:r},e,t)=>Wu(r,e*2,t),Sy=({values:r},e,t)=>Rw(r,e*2,t),By=({values:r},e,t)=>Mw(r,e*2,t),Cw=(r,e,t)=>{switch(r.type.unit){case Mt.TimeUnit.SECOND:return Iy(r,e,t);case Mt.TimeUnit.MILLISECOND:return wy(r,e,t);case Mt.TimeUnit.MICROSECOND:return Sy(r,e,t);case Mt.TimeUnit.NANOSECOND:return By(r,e,t)}},Ay=({values:r,stride:e},t,n)=>{r[e*t]=n},Oy=({values:r,stride:e},t,n)=>{r[e*t]=n},Ey=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Dy=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},jw=(r,e,t)=>{switch(r.type.unit){case Mt.TimeUnit.SECOND:return Ay(r,e,t);case Mt.TimeUnit.MILLISECOND:return Oy(r,e,t);case Mt.TimeUnit.MICROSECOND:return Ey(r,e,t);case Mt.TimeUnit.NANOSECOND:return Dy(r,e,t)}},qw=({values:r},e,t)=>{r.set(t.subarray(0,4),4*e)},Ww=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets;for(let s=-1,a=i[e],o=i[e+1];a<o;)n.set(a++,t.get(++s))},zw=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets,s=t instanceof Map?[...t]:Object.entries(t);for(let a=-1,o=i[e],d=i[e+1];o<d;)n.set(o++,s[++a])},Hw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e[i]),Yw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e.get(i)),Gw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e.get(n.name)),Kw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e[n.name]),$w=(r,e,t)=>{let n=t instanceof Map?Gw(e,t):t instanceof Bw.Vector?Yw(e,t):Array.isArray(t)?Hw(e,t):Kw(e,t);r.type.children.forEach((i,s)=>n(r.getChildAt(s),i,s))},Jw=(r,e,t)=>{r.type.mode===Mt.UnionMode.Dense?Fy(r,e,t):Ry(r,e,t)},Fy=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(r.valueOffsets[e],t)},Ry=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(e,t)},Qw=(r,e,t)=>{let n=r.getKey(e);n!==null&&r.setValue(n,t)},Zw=(r,e,t)=>{r.type.unit===Mt.IntervalUnit.DAY_TIME?My(r,e,t):Uy(r,e,t)},My=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Uy=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},Xw=(r,e,t)=>{let n=r.getChildAt(0),{stride:i}=r;for(let s=-1,a=e*i;++s<i;)n.set(a+s,t.get(s))};K.prototype.visitBool=Uw;K.prototype.visitInt=Nw;K.prototype.visitInt8=fr;K.prototype.visitInt16=fr;K.prototype.visitInt32=fr;K.prototype.visitInt64=zu;K.prototype.visitUint8=fr;K.prototype.visitUint16=fr;K.prototype.visitUint32=fr;K.prototype.visitUint64=zu;K.prototype.visitFloat=Lw;K.prototype.visitFloat16=Ty;K.prototype.visitFloat32=fr;K.prototype.visitFloat64=fr;K.prototype.visitUtf8=Vw;K.prototype.visitBinary=kw;K.prototype.visitFixedSizeBinary=Pw;K.prototype.visitDate=xw;K.prototype.visitDateDay=gy;K.prototype.visitDateMillisecond=vy;K.prototype.visitTimestamp=Cw;K.prototype.visitTimestampSecond=Iy;K.prototype.visitTimestampMillisecond=wy;K.prototype.visitTimestampMicrosecond=Sy;K.prototype.visitTimestampNanosecond=By;K.prototype.visitTime=jw;K.prototype.visitTimeSecond=Ay;K.prototype.visitTimeMillisecond=Oy;K.prototype.visitTimeMicrosecond=Ey;K.prototype.visitTimeNanosecond=Dy;K.prototype.visitDecimal=qw;K.prototype.visitList=Ww;K.prototype.visitStruct=$w;K.prototype.visitUnion=Jw;K.prototype.visitDenseUnion=Fy;K.prototype.visitSparseUnion=Ry;K.prototype.visitDictionary=Qw;K.prototype.visitInterval=Zw;K.prototype.visitIntervalDayTime=My;K.prototype.visitIntervalYearMonth=Uy;K.prototype.visitFixedSizeList=Xw;K.prototype.visitMap=zw;Ii.instance=new K});var Py=v(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.instance=wi.GetBuilderCtor=void 0;var eS=tt(),tS=oa(),rS=Tu(),Yu=wu(),nS=Su(),iS=Au(),sS=Ou(),oS=Lu(),ma=Eu(),Gu=Uu(),Rr=Fu(),aS=Nu(),cS=xu(),uS=Iu(),lS=Cu(),Ds=Mu(),Fs=Ru(),Ku=ju(),dS=ca(),$u=class extends eS.Visitor{visitNull(){return uS.NullBuilder}visitBool(){return rS.BoolBuilder}visitInt(){return Rr.IntBuilder}visitInt8(){return Rr.Int8Builder}visitInt16(){return Rr.Int16Builder}visitInt32(){return Rr.Int32Builder}visitInt64(){return Rr.Int64Builder}visitUint8(){return Rr.Uint8Builder}visitUint16(){return Rr.Uint16Builder}visitUint32(){return Rr.Uint32Builder}visitUint64(){return Rr.Uint64Builder}visitFloat(){return ma.FloatBuilder}visitFloat16(){return ma.Float16Builder}visitFloat32(){return ma.Float32Builder}visitFloat64(){return ma.Float64Builder}visitUtf8(){return dS.Utf8Builder}visitBinary(){return tS.BinaryBuilder}visitFixedSizeBinary(){return sS.FixedSizeBinaryBuilder}visitDate(){return Yu.DateBuilder}visitDateDay(){return Yu.DateDayBuilder}visitDateMillisecond(){return Yu.DateMillisecondBuilder}visitTimestamp(){return Ds.TimestampBuilder}visitTimestampSecond(){return Ds.TimestampSecondBuilder}visitTimestampMillisecond(){return Ds.TimestampMillisecondBuilder}visitTimestampMicrosecond(){return Ds.TimestampMicrosecondBuilder}visitTimestampNanosecond(){return Ds.TimestampNanosecondBuilder}visitTime(){return Fs.TimeBuilder}visitTimeSecond(){return Fs.TimeSecondBuilder}visitTimeMillisecond(){return Fs.TimeMillisecondBuilder}visitTimeMicrosecond(){return Fs.TimeMicrosecondBuilder}visitTimeNanosecond(){return Fs.TimeNanosecondBuilder}visitDecimal(){return nS.DecimalBuilder}visitList(){return aS.ListBuilder}visitStruct(){return lS.StructBuilder}visitUnion(){return Ku.UnionBuilder}visitDenseUnion(){return Ku.DenseUnionBuilder}visitSparseUnion(){return Ku.SparseUnionBuilder}visitDictionary(){return iS.DictionaryBuilder}visitInterval(){return Gu.IntervalBuilder}visitIntervalDayTime(){return Gu.IntervalDayTimeBuilder}visitIntervalYearMonth(){return Gu.IntervalYearMonthBuilder}visitFixedSizeList(){return oS.FixedSizeListBuilder}visitMap(){return cS.MapBuilder}};wi.GetBuilderCtor=$u;wi.instance=new $u});var ga=v(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.DenseUnionBuilder=A.SparseUnionBuilder=A.UnionBuilder=A.StructBuilder=A.MapBuilder=A.FixedSizeListBuilder=A.ListBuilder=A.BinaryBuilder=A.Utf8Builder=A.IntervalYearMonthBuilder=A.IntervalDayTimeBuilder=A.IntervalBuilder=A.TimestampNanosecondBuilder=A.TimestampMicrosecondBuilder=A.TimestampMillisecondBuilder=A.TimestampSecondBuilder=A.TimestampBuilder=A.TimeNanosecondBuilder=A.TimeMicrosecondBuilder=A.TimeMillisecondBuilder=A.TimeSecondBuilder=A.TimeBuilder=A.Uint64Builder=A.Uint32Builder=A.Uint16Builder=A.Uint8Builder=A.Int64Builder=A.Int32Builder=A.Int16Builder=A.Int8Builder=A.IntBuilder=A.Float64Builder=A.Float32Builder=A.Float16Builder=A.FloatBuilder=A.FixedSizeBinaryBuilder=A.DictionaryBuilder=A.DecimalBuilder=A.DateMillisecondBuilder=A.DateDayBuilder=A.DateBuilder=A.NullBuilder=A.BoolBuilder=A.Builder=void 0;var fS=Oe();Object.defineProperty(A,"Builder",{enumerable:!0,get:function(){return fS.Builder}});var hS=Tu();Object.defineProperty(A,"BoolBuilder",{enumerable:!0,get:function(){return hS.BoolBuilder}});var pS=Iu();Object.defineProperty(A,"NullBuilder",{enumerable:!0,get:function(){return pS.NullBuilder}});var Ju=wu();Object.defineProperty(A,"DateBuilder",{enumerable:!0,get:function(){return Ju.DateBuilder}});Object.defineProperty(A,"DateDayBuilder",{enumerable:!0,get:function(){return Ju.DateDayBuilder}});Object.defineProperty(A,"DateMillisecondBuilder",{enumerable:!0,get:function(){return Ju.DateMillisecondBuilder}});var yS=Su();Object.defineProperty(A,"DecimalBuilder",{enumerable:!0,get:function(){return yS.DecimalBuilder}});var _S=Au();Object.defineProperty(A,"DictionaryBuilder",{enumerable:!0,get:function(){return _S.DictionaryBuilder}});var mS=Ou();Object.defineProperty(A,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return mS.FixedSizeBinaryBuilder}});var ba=Eu();Object.defineProperty(A,"FloatBuilder",{enumerable:!0,get:function(){return ba.FloatBuilder}});Object.defineProperty(A,"Float16Builder",{enumerable:!0,get:function(){return ba.Float16Builder}});Object.defineProperty(A,"Float32Builder",{enumerable:!0,get:function(){return ba.Float32Builder}});Object.defineProperty(A,"Float64Builder",{enumerable:!0,get:function(){return ba.Float64Builder}});var Mr=Fu();Object.defineProperty(A,"IntBuilder",{enumerable:!0,get:function(){return Mr.IntBuilder}});Object.defineProperty(A,"Int8Builder",{enumerable:!0,get:function(){return Mr.Int8Builder}});Object.defineProperty(A,"Int16Builder",{enumerable:!0,get:function(){return Mr.Int16Builder}});Object.defineProperty(A,"Int32Builder",{enumerable:!0,get:function(){return Mr.Int32Builder}});Object.defineProperty(A,"Int64Builder",{enumerable:!0,get:function(){return Mr.Int64Builder}});Object.defineProperty(A,"Uint8Builder",{enumerable:!0,get:function(){return Mr.Uint8Builder}});Object.defineProperty(A,"Uint16Builder",{enumerable:!0,get:function(){return Mr.Uint16Builder}});Object.defineProperty(A,"Uint32Builder",{enumerable:!0,get:function(){return Mr.Uint32Builder}});Object.defineProperty(A,"Uint64Builder",{enumerable:!0,get:function(){return Mr.Uint64Builder}});var Rs=Ru();Object.defineProperty(A,"TimeBuilder",{enumerable:!0,get:function(){return Rs.TimeBuilder}});Object.defineProperty(A,"TimeSecondBuilder",{enumerable:!0,get:function(){return Rs.TimeSecondBuilder}});Object.defineProperty(A,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return Rs.TimeMillisecondBuilder}});Object.defineProperty(A,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return Rs.TimeMicrosecondBuilder}});Object.defineProperty(A,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return Rs.TimeNanosecondBuilder}});var Ms=Mu();Object.defineProperty(A,"TimestampBuilder",{enumerable:!0,get:function(){return Ms.TimestampBuilder}});Object.defineProperty(A,"TimestampSecondBuilder",{enumerable:!0,get:function(){return Ms.TimestampSecondBuilder}});Object.defineProperty(A,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return Ms.TimestampMillisecondBuilder}});Object.defineProperty(A,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return Ms.TimestampMicrosecondBuilder}});Object.defineProperty(A,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return Ms.TimestampNanosecondBuilder}});var Qu=Uu();Object.defineProperty(A,"IntervalBuilder",{enumerable:!0,get:function(){return Qu.IntervalBuilder}});Object.defineProperty(A,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return Qu.IntervalDayTimeBuilder}});Object.defineProperty(A,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return Qu.IntervalYearMonthBuilder}});var bS=ca();Object.defineProperty(A,"Utf8Builder",{enumerable:!0,get:function(){return bS.Utf8Builder}});var gS=oa();Object.defineProperty(A,"BinaryBuilder",{enumerable:!0,get:function(){return gS.BinaryBuilder}});var vS=Nu();Object.defineProperty(A,"ListBuilder",{enumerable:!0,get:function(){return vS.ListBuilder}});var TS=Lu();Object.defineProperty(A,"FixedSizeListBuilder",{enumerable:!0,get:function(){return TS.FixedSizeListBuilder}});var IS=xu();Object.defineProperty(A,"MapBuilder",{enumerable:!0,get:function(){return IS.MapBuilder}});var wS=Cu();Object.defineProperty(A,"StructBuilder",{enumerable:!0,get:function(){return wS.StructBuilder}});var Zu=ju();Object.defineProperty(A,"UnionBuilder",{enumerable:!0,get:function(){return Zu.UnionBuilder}});Object.defineProperty(A,"SparseUnionBuilder",{enumerable:!0,get:function(){return Zu.SparseUnionBuilder}});Object.defineProperty(A,"DenseUnionBuilder",{enumerable:!0,get:function(){return Zu.DenseUnionBuilder}});var Xu=pe(),SS=ca(),BS=Oe(),ky=Hu(),Vy=Py();BS.Builder.new=Ny;function Ny(r){let e=r.type,t=new(Vy.instance.getVisitFn(e)())(r);if(e.children&&e.children.length>0){let n=r.children||[],i={nullValues:r.nullValues},s=Array.isArray(n)?(a,o)=>n[o]||i:({name:a})=>n[a]||i;e.children.forEach((a,o)=>{let{type:d}=a,h=s(a,o);t.children.push(Ny(Object.assign(Object.assign({},h),{type:d})))})}return t}Object.keys(Xu.Type).map(r=>Xu.Type[r]).filter(r=>typeof r=="number"&&r!==Xu.Type.NONE).forEach(r=>{let e=Vy.instance.visit(r);e.prototype._setValue=ky.instance.getVisitFn(r)});SS.Utf8Builder.prototype._setValue=ky.instance.visitBinary});var Ly=v(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.Block=Si.Footer=void 0;var AS=Ar(),va=Jr(),Ut=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new Ut).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+AS.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Ut).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):va.MetadataVersion.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new va.Schema).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Ta).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new Ta).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new va.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,va.MetadataVersion.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}static createFooter(e,t,n,i,s,a){return Ut.startFooter(e),Ut.addVersion(e,t),Ut.addSchema(e,n),Ut.addDictionaries(e,i),Ut.addRecordBatches(e,s),Ut.addCustomMetadata(e,a),Ut.endFooter(e)}};Si.Footer=Ut;var Ta=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static createBlock(e,t,n,i){return e.prep(8,24),e.writeInt64(i),e.pad(4),e.writeInt32(n),e.writeInt64(t),e.offset()}};Si.Block=Ta});var rl=v(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.FileBlock=Bi.Footer=void 0;var $t=Ly(),el=Ar(),xy=el.flatbuffers.Long,OS=el.flatbuffers.Builder,ES=el.flatbuffers.ByteBuffer,Cy=Je(),jy=pe(),DS=He(),tl=class{constructor(e,t=jy.MetadataVersion.V4,n,i){this.schema=e,this.version=t,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}static decode(e){e=new ES(DS.toUint8Array(e));let t=$t.Footer.getRootAsFooter(e),n=Cy.Schema.decode(t.schema());return new qy(n,t)}static encode(e){let t=new OS,n=Cy.Schema.encode(t,e.schema);$t.Footer.startRecordBatchesVector(t,e.numRecordBatches),[...e.recordBatches()].slice().reverse().forEach(a=>sn.encode(t,a));let i=t.endVector();$t.Footer.startDictionariesVector(t,e.numDictionaries),[...e.dictionaryBatches()].slice().reverse().forEach(a=>sn.encode(t,a));let s=t.endVector();return $t.Footer.startFooter(t),$t.Footer.addSchema(t,n),$t.Footer.addVersion(t,jy.MetadataVersion.V4),$t.Footer.addRecordBatches(t,i),$t.Footer.addDictionaries(t,s),$t.Footer.finishFooterBuffer(t,$t.Footer.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}};Bi.Footer=tl;var qy=class extends tl{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 sn.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return sn.decode(t)}return null}},sn=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 sn(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:n}=t,i=new xy(t.offset,0),s=new xy(t.bodyLength,0);return $t.Block.createBlock(e,i,n,s)}};Bi.FileBlock=sn});var ln=v(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.AsyncByteStream=un.ByteStream=un.AsyncByteQueue=void 0;var on=ot(),an=Is(),Wy=Rn(),Us=ai(),nl=He(),Ai=at(),il=class extends Us.AsyncQueue{write(e){if((e=nl.toUint8Array(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Wy.decodeUtf8(this.toUint8Array(!0)):this.toUint8Array(!1).then(Wy.decodeUtf8)}toUint8Array(e=!1){return e?nl.joinUint8Arrays(this._values)[0]:(()=>on.__awaiter(this,void 0,void 0,function*(){var t,n;let i=[],s=0;try{for(var a=on.__asyncValues(this),o;o=yield a.next(),!o.done;){let d=o.value;i.push(d),s+=d.byteLength}}catch(d){t={error:d}}finally{try{o&&!o.done&&(n=a.return)&&(yield n.call(a))}finally{if(t)throw t.error}}return nl.joinUint8Arrays(i,s)[0]}))()}};un.AsyncByteQueue=il;var zy=class{constructor(e){e&&(this.source=new Hy(an.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)}};un.ByteStream=zy;var Ia=class{constructor(e){e instanceof Ia?this.source=e.source:e instanceof il?this.source=new cn(an.default.fromAsyncIterable(e)):Ai.isReadableNodeStream(e)?this.source=new cn(an.default.fromNodeStream(e)):Ai.isReadableDOMStream(e)?this.source=new cn(an.default.fromDOMStream(e)):Ai.isFetchResponse(e)?this.source=new cn(an.default.fromDOMStream(e.body)):Ai.isIterable(e)?this.source=new cn(an.default.fromIterable(e)):Ai.isPromise(e)?this.source=new cn(an.default.fromAsyncIterable(e)):Ai.isAsyncIterable(e)&&(this.source=new cn(an.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)}};un.AsyncByteStream=Ia;var Hy=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)||Us.ITERATOR_DONE)}return(e){return Object.create(this.source.return&&this.source.return(e)||Us.ITERATOR_DONE)}},cn=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return on.__awaiter(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return on.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return on.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e,t="read"){return on.__awaiter(this,void 0,void 0,function*(){return yield this.source.next({cmd:t,size:e})})}throw(e){return on.__awaiter(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Us.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return on.__awaiter(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Us.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}});var sl=v(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.AsyncRandomAccessFile=Oi.RandomAccessFile=void 0;var dn=ot(),Yy=ln(),FS=He(),Gy=class extends Yy.ByteStream{constructor(e,t){super();this.position=0,this.buffer=FS.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}}};Oi.RandomAccessFile=Gy;var Ky=class extends Yy.AsyncByteStream{constructor(e,t){super();this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=(()=>dn.__awaiter(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return dn.__awaiter(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return dn.__awaiter(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return dn.__awaiter(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:t,size:n,position:i}=this;if(t&&i<n){typeof e!="number"&&(e=1/0);let s=i,a=0,o=0,d=Math.min(n,s+Math.min(n-s,e)),h=new Uint8Array(Math.max(0,(this.position=d)-s));for(;(s+=o)<d&&(a+=o)<h.byteLength;)({bytesRead:o}=yield t.read(h,a,h.byteLength-a,s));return h}return null})}readAt(e,t){return dn.__awaiter(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&e+t<i){let s=Math.min(i,e+t),a=new Uint8Array(s-e);return(yield n.read(a,0,t,e)).buffer}return new Uint8Array(t)})}close(){return dn.__awaiter(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return dn.__awaiter(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return dn.__awaiter(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}};Oi.AsyncRandomAccessFile=Ky});var al=v(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.Int128=hr.Int64=hr.Uint64=hr.BaseInt64=void 0;var RS=1<<16;function Ei(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var Di=8,ol=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],wa=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 s=i>>>16;return i=t[2]*n[3],s+=i,i=t[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0<i?RS:0,this.buffer[1]+=s>>>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`${Ei(this.buffer[1])} ${Ei(this.buffer[0])}`}};hr.BaseInt64=wa;var ue=class extends wa{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return ue.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return ue.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.length,i=new ue(t);for(let s=0;s<n;){let a=Di<n-s?Di:n-s,o=new ue(new Uint32Array([parseInt(e.substr(s,a),10),0])),d=new ue(new Uint32Array([ol[a],0]));i.times(d),i.plus(o),s+=a}return i}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)ue.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new ue(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new ue(new Uint32Array(e.buffer)).plus(t)}};hr.Uint64=ue;var mt=class extends wa{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 mt.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return mt.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.startsWith("-"),i=e.length,s=new mt(t);for(let a=n?1:0;a<i;){let o=Di<i-a?Di:i-a,d=new mt(new Uint32Array([parseInt(e.substr(a,o),10),0])),h=new mt(new Uint32Array([ol[o],0]));s.times(h),s.plus(d),a+=o}return n?s.negate():s}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)mt.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new mt(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new mt(new Uint32Array(e.buffer)).plus(t)}};hr.Int64=mt;var Jt=class{constructor(e){this.buffer=e}high(){return new mt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new mt(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 ue(new Uint32Array([this.buffer[3],0])),n=new ue(new Uint32Array([this.buffer[2],0])),i=new ue(new Uint32Array([this.buffer[1],0])),s=new ue(new Uint32Array([this.buffer[0],0])),a=new ue(new Uint32Array([e.buffer[3],0])),o=new ue(new Uint32Array([e.buffer[2],0])),d=new ue(new Uint32Array([e.buffer[1],0])),h=new ue(new Uint32Array([e.buffer[0],0])),_=ue.multiply(s,h);this.buffer[0]=_.low();let F=new ue(new Uint32Array([_.high(),0]));return _=ue.multiply(i,h),F.plus(_),_=ue.multiply(s,d),F.plus(_),this.buffer[1]=F.low(),this.buffer[3]=F.lessThan(_)?1:0,this.buffer[2]=F.high(),new ue(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ue.multiply(n,h)).plus(ue.multiply(i,d)).plus(ue.multiply(s,o)),this.buffer[3]+=ue.multiply(t,h).plus(ue.multiply(n,d)).plus(ue.multiply(i,o)).plus(ue.multiply(s,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`${Ei(this.buffer[3])} ${Ei(this.buffer[2])} ${Ei(this.buffer[1])} ${Ei(this.buffer[0])}`}static multiply(e,t){return new Jt(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new Jt(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return Jt.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return Jt.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let n=e.startsWith("-"),i=e.length,s=new Jt(t);for(let a=n?1:0;a<i;){let o=Di<i-a?Di:i-a,d=new Jt(new Uint32Array([parseInt(e.substr(a,o),10),0,0,0])),h=new Jt(new Uint32Array([ol[o],0,0,0]));s.times(h),s.plus(d),a+=o}return n?s.negate():s}static convertArray(e){let t=new Uint32Array(e.length*4);for(let n=-1,i=e.length;++n<i;)Jt.from(e[n],new Uint32Array(t.buffer,t.byteOffset+4*4*n,4));return t}};hr.Int128=Jt});var Zy=v(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.JSONVectorLoader=Fi.VectorLoader=void 0;var Ge=Gt(),MS=Je(),Ur=ce(),US=tt(),$y=ur(),PS=Rn(),Sa=al(),Jy=pe(),pr=He(),cl=class extends US.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 MS.Field?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return Ge.Data.Null(e,0,t)}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Bool(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Int(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Float(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.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 Ge.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 Ge.Data.FixedSizeBinary(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Date(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Timestamp(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Time(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Decimal(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.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 Ge.Data.Struct(e,0,t,n,this.readNullBitmap(e,n),this.visitMany(e.children))}visitUnion(e){return e.mode===Jy.UnionMode.Sparse?this.visitSparseUnion(e):this.visitDenseUnion(e)}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.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 Ge.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 Ge.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 Ge.Data.Interval(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.FixedSizeList(e,0,t,n,this.readNullBitmap(e,n),this.visit(e.children[0]))}visitMap(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.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)}};Fi.VectorLoader=cl;var Qy=class extends cl{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):$y.packBools(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return pr.toArrayBufferView(Uint8Array,pr.toArrayBufferView(Int32Array,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return pr.toArrayBufferView(Uint8Array,pr.toArrayBufferView(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return Ur.DataType.isTimestamp(e)||(Ur.DataType.isInt(e)||Ur.DataType.isTime(e))&&e.bitWidth===64||Ur.DataType.isDate(e)&&e.unit===Jy.DateUnit.MILLISECOND?pr.toArrayBufferView(Uint8Array,Sa.Int64.convertArray(n[t])):Ur.DataType.isDecimal(e)?pr.toArrayBufferView(Uint8Array,Sa.Int128.convertArray(n[t])):Ur.DataType.isBinary(e)||Ur.DataType.isFixedSizeBinary(e)?kS(n[t]):Ur.DataType.isBool(e)?$y.packBools(n[t]):Ur.DataType.isUtf8(e)?PS.encodeUtf8(n[t].join("")):pr.toArrayBufferView(Uint8Array,pr.toArrayBufferView(e.ArrayType,n[t].map(i=>+i)))}};Fi.JSONVectorLoader=Qy;function kS(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 Ps=v(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.StructRow=Mi.MapRow=void 0;var Xy=_u(),rt=Symbol.for("parent"),Ri=Symbol.for("rowIndex"),bt=Symbol.for("keyToIdx"),gt=Symbol.for("idxToVal"),ul=Symbol.for("nodejs.util.inspect.custom"),yr=class{constructor(e,t){this[rt]=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[bt]||(this[bt]=new Map),i=n.get(e);if(i!==void 0){let s=this[gt]||(this[gt]=new Array(this.size));(t=s[i])!==void 0||(s[i]=t=this.getValue(i))}else if((i=this.getIndex(e))>-1){n.set(e,i);let s=this[gt]||(this[gt]=new Array(this.size));(t=s[i])!==void 0||(s[i]=t=this.getValue(i))}}return t}set(e,t){if(e!=null){let n=this[bt]||(this[bt]=new Map),i=n.get(e);if(i===void 0&&n.set(e,i=this.getIndex(e)),i>-1){let s=this[gt]||(this[gt]=new Array(this.size));s[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[bt]||(this[bt]=new Map),i=this[gt]||(this[gt]=new Array(this.size));for(let s,a,o=0,d,h;!((d=e.next()).done||(h=t.next()).done);++o)s=d.value,a=h.value,i[o]=a,n.has(s)||n.set(s,o),yield[s,a]}forEach(e,t){let n=this.keys(),i=this.values(),s=t===void 0?e:(d,h,_)=>e.call(t,d,h,_),a=this[bt]||(this[bt]=new Map),o=this[gt]||(this[gt]=new Array(this.size));for(let d,h,_=0,F,U;!((F=n.next()).done||(U=i.next()).done);++_)d=F.value,h=U.value,o[_]=h,a.has(d)||a.set(d,_),s(h,d,this)}toArray(){return[...this.values()]}toJSON(){let e={};return this.forEach((t,n)=>e[n]=t),e}inspect(){return this.toString()}[ul](){return this.toString()}toString(){let e=[];return this.forEach((t,n)=>{n=Xy.valueToString(n),t=Xy.valueToString(t),e.push(`${n}: ${t}`)}),`{ ${e.join(", ")} }`}};yr[Symbol.toStringTag]=(r=>(Object.defineProperties(r,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[rt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ri]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),r[Symbol.toStringTag]="Row"))(yr.prototype);var e_=class extends yr{constructor(e){super(e,e.length);return VS(this)}keys(){return this[rt].getChildAt(0)[Symbol.iterator]()}values(){return this[rt].getChildAt(1)[Symbol.iterator]()}getKey(e){return this[rt].getChildAt(0).get(e)}getIndex(e){return this[rt].getChildAt(0).indexOf(e)}getValue(e){return this[rt].getChildAt(1).get(e)}setValue(e,t){this[rt].getChildAt(1).set(e,t)}};Mi.MapRow=e_;var t_=class extends yr{constructor(e){super(e,e.type.children.length);return r_(this)}*keys(){for(let e of this[rt].type.children)yield e.name}*values(){for(let e of this[rt].type.children)yield this[e.name]}getKey(e){return this[rt].type.children[e].name}getIndex(e){return this[rt].type.children.findIndex(t=>t.name===e)}getValue(e){return this[rt].getChildAt(e).get(this[Ri])}setValue(e,t){return this[rt].getChildAt(e).set(this[Ri],t)}};Mi.StructRow=t_;Object.setPrototypeOf(yr.prototype,Map.prototype);var r_=(()=>{let r={enumerable:!0,configurable:!1,get:null,set:null};return e=>{let t=-1,n=e[bt]||(e[bt]=new Map),i=a=>function(){return this.get(a)},s=a=>function(o){return this.set(a,o)};for(let a of e.keys())n.set(a,++t),r.get=i(a),r.set=s(a),Object.prototype.hasOwnProperty.call(e,a)||(r.enumerable=!0,Object.defineProperty(e,a,r)),Object.prototype.hasOwnProperty.call(e,t)||(r.enumerable=!1,Object.defineProperty(e,t,r));return r.get=r.set=null,e}})(),VS=(()=>{if(typeof Proxy=="undefined")return r_;let r=yr.prototype.has,e=yr.prototype.get,t=yr.prototype.set,n=yr.prototype.getKey,i={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(s){return[...s.keys()].map(a=>`${a}`)},has(s,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 rt:case Ri:case gt:case bt:case ul:return!0}return typeof a=="number"&&!s.has(a)&&(a=s.getKey(a)),s.has(a)},get(s,a,o){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 rt:case Ri:case gt:case bt:case ul:return Reflect.get(s,a,o)}return typeof a=="number"&&!r.call(o,a)&&(a=n.call(o,a)),e.call(o,a)},set(s,a,o,d){switch(a){case rt:case Ri:case gt:case bt:return Reflect.set(s,a,o,d);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(d,a)&&(a=n.call(d,a)),r.call(d,a)?!!t.call(d,a,o):!1}};return s=>new Proxy(s,i)})()});var Vs=v(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.createElementComparator=fn.clampRange=fn.clampIndex=void 0;var n_=Me(),i_=Ps(),NS=He(),s_=at();function LS(r,e,t){let n=r.length,i=e>-1?e:n+e%n;return t?t(r,i):i}fn.clampIndex=LS;var o_;function xS(r,e,t,n){let{length:i=0}=r,s=typeof e!="number"?0:e,a=typeof t!="number"?i:t;return s<0&&(s=(s%i+i)%i),a<0&&(a=(a%i+i)%i),a<s&&(o_=s,s=a,a=o_),a>i&&(a=i),n?n(r,s,a):[s,a]}fn.clampRange=xS;var CS=s_.BigIntAvailable?s_.BigInt(0):0,a_=r=>r!==r;function ks(r){let e=typeof r;if(e!=="object"||r===null)return a_(r)?a_:e!=="bigint"?t=>t===r:t=>CS+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?NS.compareArrayLike(r,t):!1:r instanceof Map?qS(r):Array.isArray(r)?jS(r):r instanceof n_.Vector?WS(r):zS(r)}fn.createElementComparator=ks;function jS(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=ks(r[t]);return Ba(e)}function qS(r){let e=-1,t=[];return r.forEach(n=>t[++e]=ks(n)),Ba(t)}function WS(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=ks(r.get(t));return Ba(e)}function zS(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]=ks(r[e[n]]);return Ba(t,e)}function Ba(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return HS(r,t);case Map:case i_.MapRow:case i_.StructRow:return c_(r,t,t.keys());case Object:case void 0:return c_(r,t,e||Object.keys(t))}return t instanceof n_.Vector?YS(r,t):!1}}function HS(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 YS(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 c_(r,e,t){let n=t[Symbol.iterator](),i=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),s=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),a=0,o=r.length,d=s.next(),h=n.next(),_=i.next();for(;a<o&&!h.done&&!_.done&&!d.done&&!(h.value!==_.value||!r[a](d.value));++a,h=n.next(),_=i.next(),d=s.next());return a===o&&h.done&&_.done&&d.done?!0:(n.return&&n.return(),i.return&&i.return(),s.return&&s.return(),!1)}});var Hn=v(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.selectColumnChildrenArgs=Qe.selectVectorChildrenArgs=Qe.selectChunkArgs=Qe.selectFieldArgs=Qe.selectColumnArgs=Qe.selectArgs=Qe.arrayTypeToDataType=Qe.isTypedArray=void 0;var ll=Gt(),u_=Je(),Pr=Pi(),Ui=Me(),Pt=ce(),GS=pn(),hn=Array.isArray;function dl(r){return ArrayBuffer.isView(r)&&"BYTES_PER_ELEMENT"in r}Qe.isTypedArray=dl;function l_(r){switch(r){case Int8Array:return Pt.Int8;case Int16Array:return Pt.Int16;case Int32Array:return Pt.Int32;case BigInt64Array:return Pt.Int64;case Uint8Array:return Pt.Uint8;case Uint16Array:return Pt.Uint16;case Uint32Array:return Pt.Uint32;case BigUint64Array:return Pt.Uint64;case Float32Array:return Pt.Float32;case Float64Array:return Pt.Float64;default:return null}}Qe.arrayTypeToDataType=l_;function KS(r){let e=l_(r.constructor);if(!e)throw new TypeError("Unrecognized Array input");let t=new e,n=ll.Data.new(t,0,r.length,0,[void 0,r]);return Ui.Vector.new(n)}Qe.selectArgs=(r,e)=>Aa(r,e,[],0);Qe.selectColumnArgs=r=>{let[e,t]=hl(r,[[],[]]);return t.map((n,i)=>n instanceof Pr.Column?Pr.Column.new(n.field.clone(e[i]),n):n instanceof Ui.Vector?Pr.Column.new(e[i],n):dl(n)?Pr.Column.new(e[i],KS(n)):Pr.Column.new(e[i],[]))};Qe.selectFieldArgs=r=>hl(r,[[],[]]);Qe.selectChunkArgs=(r,e)=>fl(r,e,[],0);Qe.selectVectorChildrenArgs=(r,e)=>d_(r,e,[],0);Qe.selectColumnChildrenArgs=(r,e)=>f_(r,e,[],0);function Aa(r,e,t,n){let i,s=n,a=-1,o=e.length;for(;++a<o;)hn(i=e[a])?s=Aa(r,i,t,s).length:i instanceof r&&(t[s++]=i);return t}function fl(r,e,t,n){let i,s=n,a=-1,o=e.length;for(;++a<o;)hn(i=e[a])?s=fl(r,i,t,s).length:i instanceof GS.Chunked?s=fl(r,i.chunks,t,s).length:i instanceof r&&(t[s++]=i);return t}function d_(r,e,t,n){let i,s=n,a=-1,o=e.length;for(;++a<o;)hn(i=e[a])?s=d_(r,i,t,s).length:i instanceof r?s=Aa(Ui.Vector,i.schema.fields.map((d,h)=>i.getChildAt(h)),t,s).length:i instanceof Ui.Vector&&(t[s++]=i);return t}function f_(r,e,t,n){let i,s=n,a=-1,o=e.length;for(;++a<o;)hn(i=e[a])?s=f_(r,i,t,s).length:i instanceof r?s=Aa(Pr.Column,i.schema.fields.map((d,h)=>Pr.Column.new(d,i.getChildAt(h))),t,s).length:i instanceof Pr.Column&&(t[s++]=i);return t}var $S=(r,[e,t],n)=>(r[0][n]=e,r[1][n]=t,r);function hl(r,e){let t,n;switch(n=r.length){case 0:return e;case 1:if(t=e[0],!r[0])return e;if(hn(r[0]))return hl(r[0],e);r[0]instanceof ll.Data||r[0]instanceof Ui.Vector||dl(r[0])||r[0]instanceof Pt.DataType||([t,r]=Object.entries(r[0]).reduce($S,e));break;default:hn(t=r[n-1])?r=hn(r[0])?r[0]:r.slice(0,n-1):(r=hn(r[0])?r[0]:r,t=[])}let i=-1,s=-1,a=-1,o=r.length,d,h,[_,F]=e;for(;++a<o;)h=r[a],h instanceof Pr.Column&&(F[++s]=h)?_[++i]=h.field.clone(t[a],h.type,!0):({[a]:d=a}=t,h instanceof Pt.DataType&&(F[++s]=h)?_[++i]=u_.Field.new(d,h,!0):(h==null?void 0:h.type)&&(F[++s]=h)&&(h instanceof ll.Data&&(F[s]=h=Ui.Vector.new(h)),_[++i]=u_.Field.new(d,h.type,!0)));return e}});var pn=v(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.Chunked=void 0;var JS=Vs(),h_=ce(),QS=Hn(),p_=Me(),y_=class{constructor(e){this.chunks=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator()}next(){for(;this.chunkIndex<this.chunks.length;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.chunks.length&&(this.chunkIterator=this.getChunkIterator())}return{done:!0,value:null}}getChunkIterator(){return this.chunks[this.chunkIndex][Symbol.iterator]()}[Symbol.iterator](){return this}},kr=class extends p_.AbstractVector{constructor(e,t=[],n=ZS(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 QS.selectChunkArgs(p_.Vector,e)}static concat(...e){let t=kr.flatten(...e);return new kr(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(h_.DataType.isDictionary(this._type)){if(!this._indices){let e=this._chunks;this._indices=e.length===1?e[0].indices:kr.concat(...e.map(t=>t.indices))}return this._indices}return null}get dictionary(){return h_.DataType.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}[Symbol.iterator](){return new y_(this._chunks)}clone(e=this._chunks){return new kr(this._type,e)}concat(...e){return this.clone(kr.flatten(this,...e))}slice(e,t){return JS.clampRange(this,e,t,this._sliceInternal)}getChildAt(e){if(e<0||e>=this._numChildren)return null;let t=this._children||(this._children=[]),n,i,s;return(n=t[e])?n:(i=(this._type.children||[])[e])&&(s=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null),s.length>0)?t[e]=new kr(i.type,s):null}search(e,t){let n=e,i=this._chunkOffsets,s=i.length-1;if(n<0||n>=i[s])return null;if(s<=1)return t?t(this,0,n):[0,n];let a=0,o=0,d=0;do{if(a+1===s)return t?t(this,a,n-o):[a,n-o];d=a+(s-a)/2|0,n>=i[d]?a=d:s=d}while(n<i[s]&&n>=(o=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,s)=>n[i].set(s,t))}indexOf(e,t){return t&&typeof t=="number"?this.search(t,(n,i,s)=>this.indexOfInternal(n,i,s,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,s=new Array(t);for(let d=-1;++d<t;)i+=(s[d]=e[d].toArray()).length;n!==s[0].constructor&&(n=s[0].constructor);let a=new n(i),o=n===Array?eB:XS;for(let d=-1,h=0;++d<t;)h=o(s[d],a,h);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 s=t-1,a=e.length,o=n,d=0,h=-1;for(;++s<a;){if(~(h=e[s].indexOf(i,o)))return d+h;o=0,d+=e[s].length}return-1}_sliceInternal(e,t,n){let i=[],{chunks:s,_chunkOffsets:a}=e;for(let o=-1,d=s.length;++o<d;){let h=s[o],_=h.length,F=a[o];if(F>=n)break;if(t>=F+_)continue;if(F>=t&&F+_<=n){i.push(h);continue}let U=Math.max(0,t-F),re=Math.min(n-F,_);i.push(h.slice(U,re))}return e.clone(i)}};Oa.Chunked=kr;function ZS(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 XS=(r,e,t)=>(e.set(r,t),t+r.length),eB=(r,e,t)=>{let n=t;for(let i=-1,s=r.length;++i<s;)e[n++]=r[i];return n}});var Pi=v(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.Column=void 0;var __=Je(),m_=Me(),pl=pn(),Yn=class extends pl.Chunked{constructor(e,t=[],n){t=pl.Chunked.flatten(...t);super(e.type,t,n);if(this._field=e,t.length===1&&!(this instanceof yl))return new yl(e,t[0],this._chunkOffsets)}static new(...e){let[t,n,...i]=e;typeof t!="string"&&!(t instanceof __.Field)&&(n=t,t="");let s=pl.Chunked.flatten(Array.isArray(n)?[...n,...i]:n instanceof m_.Vector?[n,...i]:[m_.Vector.new(n,...i)]);if(typeof t=="string"){let a=s[0].data.type;t=new __.Field(t,a,!0)}else!t.nullable&&s.some(({nullCount:a})=>a>0)&&(t=t.clone({nullable:!0}));return new Yn(t,s)}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 Yn(this._field,e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t=this._children||(this._children=[]),n,i,s;return(n=t[e])?n:(i=(this.type.children||[])[e])&&(s=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null),s.length>0)?t[e]=new Yn(i,s):null}};Ea.Column=Yn;var yl=class extends Yn{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 b_=v(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.instance=ki.TypeAssembler=void 0;var tB=Ar(),rB=tB.flatbuffers.Long,nB=tt(),L=Jr(),_l=class extends nB.Visitor{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return L.Null.startNull(t),L.Null.endNull(t)}visitInt(e,t){return L.Int.startInt(t),L.Int.addBitWidth(t,e.bitWidth),L.Int.addIsSigned(t,e.isSigned),L.Int.endInt(t)}visitFloat(e,t){return L.FloatingPoint.startFloatingPoint(t),L.FloatingPoint.addPrecision(t,e.precision),L.FloatingPoint.endFloatingPoint(t)}visitBinary(e,t){return L.Binary.startBinary(t),L.Binary.endBinary(t)}visitBool(e,t){return L.Bool.startBool(t),L.Bool.endBool(t)}visitUtf8(e,t){return L.Utf8.startUtf8(t),L.Utf8.endUtf8(t)}visitDecimal(e,t){return L.Decimal.startDecimal(t),L.Decimal.addScale(t,e.scale),L.Decimal.addPrecision(t,e.precision),L.Decimal.endDecimal(t)}visitDate(e,t){return L.Date.startDate(t),L.Date.addUnit(t,e.unit),L.Date.endDate(t)}visitTime(e,t){return L.Time.startTime(t),L.Time.addUnit(t,e.unit),L.Time.addBitWidth(t,e.bitWidth),L.Time.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return L.Timestamp.startTimestamp(t),L.Timestamp.addUnit(t,e.unit),n!==void 0&&L.Timestamp.addTimezone(t,n),L.Timestamp.endTimestamp(t)}visitInterval(e,t){return L.Interval.startInterval(t),L.Interval.addUnit(t,e.unit),L.Interval.endInterval(t)}visitList(e,t){return L.List.startList(t),L.List.endList(t)}visitStruct(e,t){return L.Struct_.startStruct_(t),L.Struct_.endStruct_(t)}visitUnion(e,t){L.Union.startTypeIdsVector(t,e.typeIds.length);let n=L.Union.createTypeIdsVector(t,e.typeIds);return L.Union.startUnion(t),L.Union.addMode(t,e.mode),L.Union.addTypeIds(t,n),L.Union.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return L.DictionaryEncoding.startDictionaryEncoding(t),L.DictionaryEncoding.addId(t,new rB(e.id,0)),L.DictionaryEncoding.addIsOrdered(t,e.isOrdered),n!==void 0&&L.DictionaryEncoding.addIndexType(t,n),L.DictionaryEncoding.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return L.FixedSizeBinary.startFixedSizeBinary(t),L.FixedSizeBinary.addByteWidth(t,e.byteWidth),L.FixedSizeBinary.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return L.FixedSizeList.startFixedSizeList(t),L.FixedSizeList.addListSize(t,e.listSize),L.FixedSizeList.endFixedSizeList(t)}visitMap(e,t){return L.Map.startMap(t),L.Map.addKeysSorted(t,e.keysSorted),L.Map.endMap(t)}};ki.TypeAssembler=_l;ki.instance=new _l});var B_=v(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.fieldFromJSON=_r.dictionaryBatchFromJSON=_r.recordBatchFromJSON=_r.schemaFromJSON=void 0;var Vi=Je(),Te=ce(),Gn=Kn(),Ni=pe();function iB(r,e=new Map){return new Vi.Schema(oB(r,e),Da(r.customMetadata),e)}_r.schemaFromJSON=iB;function g_(r){return new Gn.RecordBatch(r.count,T_(r.columns),I_(r.columns))}_r.recordBatchFromJSON=g_;function sB(r){return new Gn.DictionaryBatch(g_(r.data),r.id,r.isDelta)}_r.dictionaryBatchFromJSON=sB;function oB(r,e){return(r.fields||[]).filter(Boolean).map(t=>Vi.Field.fromJSON(t,e))}function v_(r,e){return(r.children||[]).filter(Boolean).map(t=>Vi.Field.fromJSON(t,e))}function T_(r){return(r||[]).reduce((e,t)=>[...e,new Gn.FieldNode(t.count,aB(t.VALIDITY)),...T_(t.children)],[])}function I_(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let i=r[t];i.VALIDITY&&e.push(new Gn.BufferRegion(e.length,i.VALIDITY.length)),i.TYPE&&e.push(new Gn.BufferRegion(e.length,i.TYPE.length)),i.OFFSET&&e.push(new Gn.BufferRegion(e.length,i.OFFSET.length)),i.DATA&&e.push(new Gn.BufferRegion(e.length,i.DATA.length)),e=I_(i.children,e)}return e}function aB(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function cB(r,e){let t,n,i,s,a,o;return!e||!(s=r.dictionary)?(a=S_(r,v_(r,e)),i=new Vi.Field(r.name,a,r.nullable,Da(r.customMetadata))):e.has(t=s.id)?(n=(n=s.indexType)?w_(n):new Te.Int32,o=new Te.Dictionary(e.get(t),n,t,s.isOrdered),i=new Vi.Field(r.name,o,r.nullable,Da(r.customMetadata))):(n=(n=s.indexType)?w_(n):new Te.Int32,e.set(t,a=S_(r,v_(r,e))),o=new Te.Dictionary(a,n,t,s.isOrdered),i=new Vi.Field(r.name,o,r.nullable,Da(r.customMetadata))),i||null}_r.fieldFromJSON=cB;function Da(r){return new Map(Object.entries(r||{}))}function w_(r){return new Te.Int(r.isSigned,r.bitWidth)}function S_(r,e){let t=r.type.name;switch(t){case"NONE":return new Te.Null;case"null":return new Te.Null;case"binary":return new Te.Binary;case"utf8":return new Te.Utf8;case"bool":return new Te.Bool;case"list":return new Te.List((e||[])[0]);case"struct":return new Te.Struct(e||[]);case"struct_":return new Te.Struct(e||[])}switch(t){case"int":{let n=r.type;return new Te.Int(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new Te.Float(Ni.Precision[n.precision])}case"decimal":{let n=r.type;return new Te.Decimal(n.scale,n.precision)}case"date":{let n=r.type;return new Te.Date_(Ni.DateUnit[n.unit])}case"time":{let n=r.type;return new Te.Time(Ni.TimeUnit[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new Te.Timestamp(Ni.TimeUnit[n.unit],n.timezone)}case"interval":{let n=r.type;return new Te.Interval(Ni.IntervalUnit[n.unit])}case"union":{let n=r.type;return new Te.Union(Ni.UnionMode[n.mode],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new Te.FixedSizeBinary(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new Te.FixedSizeList(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new Te.Map_((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}});var Kn=v(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.FieldNode=Vt.BufferRegion=Vt.DictionaryBatch=Vt.RecordBatch=Vt.Message=void 0;var ml=Ar(),N=Jr(),we=Uo(),Ze=Je(),uB=He(),Ee=pe(),bl=b_(),Fa=B_(),$n=ml.flatbuffers.Long,lB=ml.flatbuffers.Builder,dB=ml.flatbuffers.ByteBuffer,Ie=ce(),yn=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 yn(0,Ee.MetadataVersion.V4,t);return n._createHeader=fB(e,t),n}static decode(e){e=new dB(uB.toUint8Array(e));let t=we.Message.getRootAsMessage(e),n=t.bodyLength(),i=t.version(),s=t.headerType(),a=new yn(n,i,s);return a._createHeader=hB(t,s),a}static encode(e){let t=new lB,n=-1;return e.isSchema()?n=Ze.Schema.encode(t,e.header()):e.isRecordBatch()?n=kt.encode(t,e.header()):e.isDictionaryBatch()&&(n=mr.encode(t,e.header())),we.Message.startMessage(t),we.Message.addVersion(t,Ee.MetadataVersion.V4),we.Message.addHeader(t,n),we.Message.addHeaderType(t,e.headerType),we.Message.addBodyLength(t,new $n(e.bodyLength,0)),we.Message.finishMessageBuffer(t,we.Message.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof Ze.Schema)return new yn(0,Ee.MetadataVersion.V4,Ee.MessageHeader.Schema,e);if(e instanceof kt)return new yn(t,Ee.MetadataVersion.V4,Ee.MessageHeader.RecordBatch,e);if(e instanceof mr)return new yn(t,Ee.MetadataVersion.V4,Ee.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===Ee.MessageHeader.Schema}isRecordBatch(){return this.headerType===Ee.MessageHeader.RecordBatch}isDictionaryBatch(){return this.headerType===Ee.MessageHeader.DictionaryBatch}};Vt.Message=yn;var kt=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}};Vt.RecordBatch=kt;var mr=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}};Vt.DictionaryBatch=mr;var Jn=class{constructor(e,t){this.offset=typeof e=="number"?e:e.low,this.length=typeof t=="number"?t:t.low}};Vt.BufferRegion=Jn;var Qn=class{constructor(e,t){this.length=typeof e=="number"?e:e.low,this.nullCount=typeof t=="number"?t:t.low}};Vt.FieldNode=Qn;function fB(r,e){return()=>{switch(e){case Ee.MessageHeader.Schema:return Ze.Schema.fromJSON(r);case Ee.MessageHeader.RecordBatch:return kt.fromJSON(r);case Ee.MessageHeader.DictionaryBatch:return mr.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${Ee.MessageHeader[e]}, type: ${e} }`)}}function hB(r,e){return()=>{switch(e){case Ee.MessageHeader.Schema:return Ze.Schema.decode(r.header(new N.Schema));case Ee.MessageHeader.RecordBatch:return kt.decode(r.header(new we.RecordBatch),r.version());case Ee.MessageHeader.DictionaryBatch:return mr.decode(r.header(new we.DictionaryBatch),r.version())}throw new Error(`Unrecognized Message type: { name: ${Ee.MessageHeader[e]}, type: ${e} }`)}}Ze.Field.encode=SB;Ze.Field.decode=IB;Ze.Field.fromJSON=Fa.fieldFromJSON;Ze.Schema.encode=wB;Ze.Schema.decode=pB;Ze.Schema.fromJSON=Fa.schemaFromJSON;kt.encode=BB;kt.decode=yB;kt.fromJSON=Fa.recordBatchFromJSON;mr.encode=AB;mr.decode=_B;mr.fromJSON=Fa.dictionaryBatchFromJSON;Qn.encode=OB;Qn.decode=bB;Jn.encode=EB;Jn.decode=mB;function pB(r,e=new Map){let t=TB(r,e);return new Ze.Schema(t,Ra(r),e)}function yB(r,e=Ee.MetadataVersion.V4){return new kt(r.length(),gB(r),vB(r,e))}function _B(r,e=Ee.MetadataVersion.V4){return new mr(kt.decode(r.data(),e),r.id(),r.isDelta())}function mB(r){return new Jn(r.offset(),r.length())}function bB(r){return new Qn(r.length(),r.nullCount())}function gB(r){let e=[];for(let t,n=-1,i=-1,s=r.nodesLength();++n<s;)(t=r.nodes(n))&&(e[++i]=Qn.decode(t));return e}function vB(r,e){let t=[];for(let n,i=-1,s=-1,a=r.buffersLength();++i<a;)(n=r.buffers(i))&&(e<Ee.MetadataVersion.V4&&(n.bb_pos+=8*(i+1)),t[++s]=Jn.decode(n));return t}function TB(r,e){let t=[];for(let n,i=-1,s=-1,a=r.fieldsLength();++i<a;)(n=r.fields(i))&&(t[++s]=Ze.Field.decode(n,e));return t}function A_(r,e){let t=[];for(let n,i=-1,s=-1,a=r.childrenLength();++i<a;)(n=r.children(i))&&(t[++s]=Ze.Field.decode(n,e));return t}function IB(r,e){let t,n,i,s,a,o;return!e||!(o=r.dictionary())?(i=E_(r,A_(r,e)),n=new Ze.Field(r.name(),i,r.nullable(),Ra(r))):e.has(t=o.id().low)?(s=(s=o.indexType())?O_(s):new Ie.Int32,a=new Ie.Dictionary(e.get(t),s,t,o.isOrdered()),n=new Ze.Field(r.name(),a,r.nullable(),Ra(r))):(s=(s=o.indexType())?O_(s):new Ie.Int32,e.set(t,i=E_(r,A_(r,e))),a=new Ie.Dictionary(i,s,t,o.isOrdered()),n=new Ze.Field(r.name(),a,r.nullable(),Ra(r))),n||null}function Ra(r){let e=new Map;if(r)for(let t,n,i=-1,s=r.customMetadataLength()|0;++i<s;)(t=r.customMetadata(i))&&(n=t.key())!=null&&e.set(n,t.value());return e}function O_(r){return new Ie.Int(r.isSigned(),r.bitWidth())}function E_(r,e){let t=r.typeType();switch(t){case N.Type.NONE:return new Ie.Null;case N.Type.Null:return new Ie.Null;case N.Type.Binary:return new Ie.Binary;case N.Type.Utf8:return new Ie.Utf8;case N.Type.Bool:return new Ie.Bool;case N.Type.List:return new Ie.List((e||[])[0]);case N.Type.Struct_:return new Ie.Struct(e||[])}switch(t){case N.Type.Int:{let n=r.type(new N.Int);return new Ie.Int(n.isSigned(),n.bitWidth())}case N.Type.FloatingPoint:{let n=r.type(new N.FloatingPoint);return new Ie.Float(n.precision())}case N.Type.Decimal:{let n=r.type(new N.Decimal);return new Ie.Decimal(n.scale(),n.precision())}case N.Type.Date:{let n=r.type(new N.Date);return new Ie.Date_(n.unit())}case N.Type.Time:{let n=r.type(new N.Time);return new Ie.Time(n.unit(),n.bitWidth())}case N.Type.Timestamp:{let n=r.type(new N.Timestamp);return new Ie.Timestamp(n.unit(),n.timezone())}case N.Type.Interval:{let n=r.type(new N.Interval);return new Ie.Interval(n.unit())}case N.Type.Union:{let n=r.type(new N.Union);return new Ie.Union(n.mode(),n.typeIdsArray()||[],e||[])}case N.Type.FixedSizeBinary:{let n=r.type(new N.FixedSizeBinary);return new Ie.FixedSizeBinary(n.byteWidth())}case N.Type.FixedSizeList:{let n=r.type(new N.FixedSizeList);return new Ie.FixedSizeList(n.listSize(),(e||[])[0])}case N.Type.Map:{let n=r.type(new N.Map);return new Ie.Map_((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${N.Type[t]}" (${t})`)}function wB(r,e){let t=e.fields.map(s=>Ze.Field.encode(r,s));N.Schema.startFieldsVector(r,t.length);let n=N.Schema.createFieldsVector(r,t),i=e.metadata&&e.metadata.size>0?N.Schema.createCustomMetadataVector(r,[...e.metadata].map(([s,a])=>{let o=r.createString(`${s}`),d=r.createString(`${a}`);return N.KeyValue.startKeyValue(r),N.KeyValue.addKey(r,o),N.KeyValue.addValue(r,d),N.KeyValue.endKeyValue(r)})):-1;return N.Schema.startSchema(r),N.Schema.addFields(r,n),N.Schema.addEndianness(r,DB?N.Endianness.Little:N.Endianness.Big),i!==-1&&N.Schema.addCustomMetadata(r,i),N.Schema.endSchema(r)}function SB(r,e){let t=-1,n=-1,i=-1,s=e.type,a=e.typeId;Ie.DataType.isDictionary(s)?(a=s.dictionary.typeId,i=bl.instance.visit(s,r),n=bl.instance.visit(s.dictionary,r)):n=bl.instance.visit(s,r);let o=(s.children||[]).map(_=>Ze.Field.encode(r,_)),d=N.Field.createChildrenVector(r,o),h=e.metadata&&e.metadata.size>0?N.Field.createCustomMetadataVector(r,[...e.metadata].map(([_,F])=>{let U=r.createString(`${_}`),re=r.createString(`${F}`);return N.KeyValue.startKeyValue(r),N.KeyValue.addKey(r,U),N.KeyValue.addValue(r,re),N.KeyValue.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),N.Field.startField(r),N.Field.addType(r,n),N.Field.addTypeType(r,a),N.Field.addChildren(r,d),N.Field.addNullable(r,!!e.nullable),t!==-1&&N.Field.addName(r,t),i!==-1&&N.Field.addDictionary(r,i),h!==-1&&N.Field.addCustomMetadata(r,h),N.Field.endField(r)}function BB(r,e){let t=e.nodes||[],n=e.buffers||[];we.RecordBatch.startNodesVector(r,t.length),t.slice().reverse().forEach(a=>Qn.encode(r,a));let i=r.endVector();we.RecordBatch.startBuffersVector(r,n.length),n.slice().reverse().forEach(a=>Jn.encode(r,a));let s=r.endVector();return we.RecordBatch.startRecordBatch(r),we.RecordBatch.addLength(r,new $n(e.length,0)),we.RecordBatch.addNodes(r,i),we.RecordBatch.addBuffers(r,s),we.RecordBatch.endRecordBatch(r)}function AB(r,e){let t=kt.encode(r,e.data);return we.DictionaryBatch.startDictionaryBatch(r),we.DictionaryBatch.addId(r,new $n(e.id,0)),we.DictionaryBatch.addIsDelta(r,e.isDelta),we.DictionaryBatch.addData(r,t),we.DictionaryBatch.endDictionaryBatch(r)}function OB(r,e){return we.FieldNode.createFieldNode(r,new $n(e.length,0),new $n(e.nullCount,0))}function EB(r,e){return N.Buffer.createBuffer(r,new $n(e.offset,0),new $n(e.length,0))}var DB=function(){let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256}()});var Ua=v(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.magicX2AndPadding=ie.magicAndPadding=ie.magicLength=ie.checkForMagicArrowString=ie.MAGIC=ie.MAGIC_STR=ie.PADDING=ie.JSONMessageReader=ie.AsyncMessageReader=ie.MessageReader=void 0;var _n=ot(),mn=pe(),FB=Ar(),D_=FB.flatbuffers.ByteBuffer,Ns=Kn(),RB=at(),MB=sl(),F_=He(),Ma=ln(),Qt=ai(),gl=r=>`Expected ${mn.MessageHeader[r]} Message in stream, but was null or length 0.`,vl=r=>`Header pointer of flatbuffer-encoded ${mn.MessageHeader[r]} Message is null or length 0.`,R_=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,M_=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,Tl=class{constructor(e){this.source=e instanceof Ma.ByteStream?e:new Ma.ByteStream(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?Qt.ITERATOR_DONE:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(gl(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=F_.toUint8Array(this.source.read(e));if(t.byteLength<e)throw new Error(M_(e,t.byteLength));return t.byteOffset%8==0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=mn.MessageHeader.Schema,n=this.readMessage(t),i=n==null?void 0:n.header();if(e&&!i)throw new Error(vl(t));return i}readMetadataLength(){let e=this.source.read(ie.PADDING),t=e&&new D_(e),n=(t==null?void 0:t.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Qt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(R_(e,t.byteLength));return{done:!1,value:Ns.Message.decode(t)}}};ie.MessageReader=Tl;var U_=class{constructor(e,t){this.source=e instanceof Ma.AsyncByteStream?e:RB.isFileHandle(e)?new MB.AsyncRandomAccessFile(e,t):new Ma.AsyncByteStream(e)}[Symbol.asyncIterator](){return this}next(){return _n.__awaiter(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done||e.value===-1&&(e=yield this.readMetadataLength()).done||(e=yield this.readMetadata(e.value)).done?Qt.ITERATOR_DONE:e})}throw(e){return _n.__awaiter(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return _n.__awaiter(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return _n.__awaiter(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(gl(e));return t.value})}readMessageBody(e){return _n.__awaiter(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=F_.toUint8Array(yield this.source.read(e));if(t.byteLength<e)throw new Error(M_(e,t.byteLength));return t.byteOffset%8==0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(e=!1){return _n.__awaiter(this,void 0,void 0,function*(){let t=mn.MessageHeader.Schema,n=yield this.readMessage(t),i=n==null?void 0:n.header();if(e&&!i)throw new Error(vl(t));return i})}readMetadataLength(){return _n.__awaiter(this,void 0,void 0,function*(){let e=yield this.source.read(ie.PADDING),t=e&&new D_(e),n=(t==null?void 0:t.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(e){return _n.__awaiter(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return Qt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(R_(e,t.byteLength));return{done:!1,value:Ns.Message.decode(t)}})}};ie.AsyncMessageReader=U_;var P_=class extends Tl{constructor(e){super(new Uint8Array(0));this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Qt.ArrowJSON?e:new Qt.ArrowJSON(e)}next(){let{_json:e}=this;if(!this._schema){this._schema=!0;let t=Ns.Message.fromJSON(e.schema,mn.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=Ns.Message.fromJSON(t,mn.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=Ns.Message.fromJSON(t,mn.MessageHeader.RecordBatch);return{done:!1,value:n}}return this._body=[],Qt.ITERATOR_DONE}readMessageBody(e){return t(this._body);function t(n){return(n||[]).reduce((i,s)=>[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE&&[s.TYPE]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...t(s.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(gl(e));return t.value}readSchema(){let e=mn.MessageHeader.Schema,t=this.readMessage(e),n=t==null?void 0:t.header();if(!t||!n)throw new Error(vl(e));return n}};ie.JSONMessageReader=P_;ie.PADDING=4;ie.MAGIC_STR="ARROW1";ie.MAGIC=new Uint8Array(ie.MAGIC_STR.length);for(let r=0;r<ie.MAGIC_STR.length;r+=1|0)ie.MAGIC[r]=ie.MAGIC_STR.charCodeAt(r);function UB(r,e=0){for(let t=-1,n=ie.MAGIC.length;++t<n;)if(ie.MAGIC[t]!==r[e+t])return!1;return!0}ie.checkForMagicArrowString=UB;ie.magicLength=ie.MAGIC.length;ie.magicAndPadding=ie.magicLength+ie.PADDING;ie.magicX2AndPadding=ie.magicLength*2+ie.PADDING});var Bl=v(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.compareTypes=De.compareFields=De.compareSchemas=De.instance=De.TypeComparator=void 0;var PB=tt(),j=class extends PB.Visitor{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,i)=>this.compareFields(n,t[i]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};De.TypeComparator=j;function yt(r,e){return e instanceof r.constructor}function Ls(r,e){return r===e||yt(r,e)}function Vr(r,e){return r===e||yt(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function Pa(r,e){return r===e||yt(r,e)&&r.precision===e.precision}function kB(r,e){return r===e||yt(r,e)&&r.byteWidth===e.byteWidth}function Il(r,e){return r===e||yt(r,e)&&r.unit===e.unit}function xs(r,e){return r===e||yt(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function Cs(r,e){return r===e||yt(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function VB(r,e){return r===e||yt(r,e)&&r.children.length===e.children.length&&De.instance.compareManyFields(r.children,e.children)}function NB(r,e){return r===e||yt(r,e)&&r.children.length===e.children.length&&De.instance.compareManyFields(r.children,e.children)}function wl(r,e){return r===e||yt(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&De.instance.compareManyFields(r.children,e.children)}function LB(r,e){return r===e||yt(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&De.instance.visit(r.indices,e.indices)&&De.instance.visit(r.dictionary,e.dictionary)}function Sl(r,e){return r===e||yt(r,e)&&r.unit===e.unit}function xB(r,e){return r===e||yt(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&De.instance.compareManyFields(r.children,e.children)}function CB(r,e){return r===e||yt(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&De.instance.compareManyFields(r.children,e.children)}j.prototype.visitNull=Ls;j.prototype.visitBool=Ls;j.prototype.visitInt=Vr;j.prototype.visitInt8=Vr;j.prototype.visitInt16=Vr;j.prototype.visitInt32=Vr;j.prototype.visitInt64=Vr;j.prototype.visitUint8=Vr;j.prototype.visitUint16=Vr;j.prototype.visitUint32=Vr;j.prototype.visitUint64=Vr;j.prototype.visitFloat=Pa;j.prototype.visitFloat16=Pa;j.prototype.visitFloat32=Pa;j.prototype.visitFloat64=Pa;j.prototype.visitUtf8=Ls;j.prototype.visitBinary=Ls;j.prototype.visitFixedSizeBinary=kB;j.prototype.visitDate=Il;j.prototype.visitDateDay=Il;j.prototype.visitDateMillisecond=Il;j.prototype.visitTimestamp=xs;j.prototype.visitTimestampSecond=xs;j.prototype.visitTimestampMillisecond=xs;j.prototype.visitTimestampMicrosecond=xs;j.prototype.visitTimestampNanosecond=xs;j.prototype.visitTime=Cs;j.prototype.visitTimeSecond=Cs;j.prototype.visitTimeMillisecond=Cs;j.prototype.visitTimeMicrosecond=Cs;j.prototype.visitTimeNanosecond=Cs;j.prototype.visitDecimal=Ls;j.prototype.visitList=VB;j.prototype.visitStruct=NB;j.prototype.visitUnion=wl;j.prototype.visitDenseUnion=wl;j.prototype.visitSparseUnion=wl;j.prototype.visitDictionary=LB;j.prototype.visitInterval=Sl;j.prototype.visitIntervalDayTime=Sl;j.prototype.visitIntervalYearMonth=Sl;j.prototype.visitFixedSizeList=xB;j.prototype.visitMap=CB;De.instance=new j;function jB(r,e){return De.instance.compareSchemas(r,e)}De.compareSchemas=jB;function qB(r,e){return De.instance.compareFields(r,e)}De.compareFields=qB;function WB(r,e){return De.instance.visit(r,e)}De.compareTypes=WB});var x_=v(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.VectorAssembler=void 0;var zB=tt(),k_=pe(),HB=Nr(),Al=He(),Ol=ur(),YB=Hn(),V_=Kn(),N_=ce(),je=class extends zB.Visitor{constructor(){super();this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...e){let t=new je,n=YB.selectVectorChildrenArgs(HB.RecordBatch,e),[i=t]=t.visitMany(n);return i}visit(e){if(!N_.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");N_.DataType.isNull(e.type)||Zt.call(this,i<=0?new Uint8Array(0):Ol.truncateBitmap(t.offset,n,t.nullBitmap)),this.nodes.push(new V_.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}};ka.VectorAssembler=je;function Zt(r){let e=r.byteLength+7&~7;return this.buffers.push(r),this.bufferRegions.push(new V_.BufferRegion(this._byteLength,e)),this._byteLength+=e,this}function GB(r){let{type:e,length:t,typeIds:n,valueOffsets:i}=r;if(Zt.call(this,n),e.mode===k_.UnionMode.Sparse)return Dl.call(this,r);if(e.mode===k_.UnionMode.Dense){if(r.offset<=0)return Zt.call(this,i),Dl.call(this,r);{let s=n.reduce((_,F)=>Math.max(_,F),n[0]),a=new Int32Array(s+1),o=new Int32Array(s+1).fill(-1),d=new Int32Array(t),h=Al.rebaseValueOffsets(-i[0],t,i);for(let _,F,U=-1;++U<t;)(F=o[_=n[U]])===-1&&(F=o[_]=h[_]),d[U]=h[U]-F,++a[_];Zt.call(this,d);for(let _,F=-1,U=e.children.length;++F<U;)if(_=r.getChildAt(F)){let re=e.typeIds[F],_e=Math.min(t,a[re]);this.visit(_.slice(o[re],_e))}}}return this}function KB(r){let e;return r.nullCount>=r.length?Zt.call(this,new Uint8Array(0)):(e=r.values)instanceof Uint8Array?Zt.call(this,Ol.truncateBitmap(r.offset,r.length,e)):Zt.call(this,Ol.packBools(r))}function bn(r){return Zt.call(this,r.values.subarray(0,r.length*r.stride))}function L_(r){let{length:e,values:t,valueOffsets:n}=r,i=n[0],s=n[e],a=Math.min(s-i,t.byteLength-i);return Zt.call(this,Al.rebaseValueOffsets(-n[0],e,n)),Zt.call(this,t.subarray(i,i+a)),this}function El(r){let{length:e,valueOffsets:t}=r;return t&&Zt.call(this,Al.rebaseValueOffsets(t[0],e,t)),this.visit(r.getChildAt(0))}function Dl(r){return this.visitMany(r.type.children.map((e,t)=>r.getChildAt(t)).filter(Boolean))[0]}je.prototype.visitBool=KB;je.prototype.visitInt=bn;je.prototype.visitFloat=bn;je.prototype.visitUtf8=L_;je.prototype.visitBinary=L_;je.prototype.visitFixedSizeBinary=bn;je.prototype.visitDate=bn;je.prototype.visitTimestamp=bn;je.prototype.visitTime=bn;je.prototype.visitDecimal=bn;je.prototype.visitList=El;je.prototype.visitStruct=Dl;je.prototype.visitUnion=GB;je.prototype.visitInterval=bn;je.prototype.visitFixedSizeList=El;je.prototype.visitMap=El});var j_=v(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.JSONTypeAssembler=void 0;var $B=tt(),nt=Jr(),Li=pe(),C_=class extends $B.Visitor{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:nt.Type[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:nt.Type[e].toLowerCase(),precision:Li.Precision[t]}}visitBinary({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitBool({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n}){return{name:nt.Type[e].toLowerCase(),scale:t,precision:n}}visitDate({typeId:e,unit:t}){return{name:nt.Type[e].toLowerCase(),unit:Li.DateUnit[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:nt.Type[e].toLowerCase(),unit:Li.TimeUnit[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:nt.Type[e].toLowerCase(),unit:Li.TimeUnit[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:nt.Type[e].toLowerCase(),unit:Li.IntervalUnit[t]}}visitList({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitStruct({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:nt.Type[e].toLowerCase(),mode:Li.UnionMode[t],typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:nt.Type[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:nt.Type[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:nt.Type[e].toLowerCase(),keysSorted:t}}};Va.JSONTypeAssembler=C_});var z_=v(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.JSONVectorAssembler=void 0;var JB=Es(),js=Pi(),QB=Me(),ZB=tt(),XB=pe(),e0=Nr(),Fl=pe(),Na=ur(),t0=Hn(),q_=ce(),La=class extends ZB.Visitor{static assemble(...e){return new La().visitMany(t0.selectColumnChildrenArgs(e0.RecordBatch,e))}visit(e){let{data:t,name:n,length:i}=e,{offset:s,nullCount:a,nullBitmap:o}=t,d=q_.DataType.isDictionary(e.type)?e.type.indices:e.type,h=Object.assign([],t.buffers,{[XB.BufferType.VALIDITY]:void 0});return Object.assign({name:n,count:i,VALIDITY:q_.DataType.isNull(d)?void 0:a<=0?Array.from({length:i},()=>1):[...new Na.BitIterator(o,s,i,null,Na.getBit)]},super.visit(QB.Vector.new(t.clone(d,s,i,0,h))))}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...new Na.BitIterator(e,t,n,null,Na.getBool)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...qs(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...e],OFFSET:[...e.valueOffsets]}}visitBinary(e){return{DATA:[...W_(e)],OFFSET:[...e.valueOffsets]}}visitFixedSizeBinary(e){return{DATA:[...W_(e)]}}visitDate(e){return{DATA:e.type.unit===Fl.DateUnit.DAY?[...e.values]:[...qs(e.values,2)]}}visitTimestamp(e){return{DATA:[...qs(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<Fl.TimeUnit.MICROSECOND?[...e.values]:[...qs(e.values,2)]}}visitDecimal(e){return{DATA:[...qs(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new js.Column(t,[e.getChildAt(n)])))}}visitStruct(e){return{children:e.type.children.map((t,n)=>this.visit(new js.Column(t,[e.getChildAt(n)])))}}visitUnion(e){return{TYPE:[...e.typeIds],OFFSET:e.type.mode===Fl.UnionMode.Dense?[...e.valueOffsets]:void 0,children:e.type.children.map((t,n)=>this.visit(new js.Column(t,[e.getChildAt(n)])))}}visitInterval(e){return{DATA:[...e.values]}}visitFixedSizeList(e){return{children:e.type.children.map((t,n)=>this.visit(new js.Column(t,[e.getChildAt(n)])))}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new js.Column(t,[e.getChildAt(n)])))}}};xa.JSONVectorAssembler=La;function*W_(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*qs(r,e){for(let t=-1,n=r.length/e;++t<n;)yield`${JB.BN.new(r.subarray((t+0)*e,(t+1)*e),!1)}`}});var za=v(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.RecordBatchJSONWriter=gr.RecordBatchFileWriter=gr.RecordBatchStreamWriter=gr.RecordBatchWriter=void 0;var H_=ot(),Rl=zs(),r0=Ua(),n0=Pi(),i0=ce(),s0=Je(),Ca=Kn(),Ml=Kn(),xi=rl(),Ul=pe(),Y_=Bl(),Pl=ln(),G_=x_(),o0=j_(),K_=z_(),a0=He(),kl=Nr(),c0=ai(),br=at(),Ws=class extends c0.ReadableInterop{constructor(e){super();this._position=0,this._started=!1,this._sink=new Pl.AsyncByteQueue,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,br.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 br.isPromise(e)?e.then(t=>this.writeAll(t)):br.isAsyncIterable(e)?Nl(this,e):Vl(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 Pl.AsyncByteQueue?this._sink=e:(this._sink=new Pl.AsyncByteQueue,e&&br.isWritableDOMStream(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&br.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||!Y_.compareSchemas(t,this._schema))&&(t===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof Rl.Table&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof kl.RecordBatch&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!Y_.compareSchemas(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof kl.RecordBatch?e instanceof kl._InternalEmptyPlaceholderRecordBatch||this._writeRecordBatch(e):e instanceof Rl.Table?this.writeAll(e.chunks):br.isIterable(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,i=Ca.Message.encode(e),s=i.byteLength,a=this._writeLegacyIpcFormat?4:8,o=s+a+n&~n,d=o-s-a;return e.headerType===Ul.MessageHeader.RecordBatch?this._recordBatchBlocks.push(new xi.FileBlock(o,e.bodyLength,this._position)):e.headerType===Ul.MessageHeader.DictionaryBatch&&this._dictionaryBlocks.push(new xi.FileBlock(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-a)),s>0&&this._write(i),this._writePadding(d)}_write(e){if(this._started){let t=a0.toUint8Array(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Ca.Message.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(r0.MAGIC)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:i,buffers:s}=G_.VectorAssembler.assemble(e),a=new Ml.RecordBatch(e.length,n,i),o=Ca.Message.from(a,t);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(s)}_writeDictionaryBatch(e,t,n=!1){this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0));let{byteLength:i,nodes:s,bufferRegions:a,buffers:o}=G_.VectorAssembler.assemble(e),d=new Ml.RecordBatch(e.length,s,a),h=new Ml.DictionaryBatch(d,t,n),_=Ca.Message.from(h,i);return this._writeMessage(_)._writeBodyBuffers(o)}_writeBodyBuffers(e){let t,n,i;for(let s=-1,a=e.length;++s<a;)(t=e[s])&&(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 s="chunks"in n?n.chunks:[n];for(let a of s)this._writeDictionaryBatch(a,t,i>0),i+=a.length}}return this}};gr.RecordBatchWriter=Ws;var ja=class extends Ws{static writeAll(e,t){let n=new ja(t);return br.isPromise(e)?e.then(i=>n.writeAll(i)):br.isAsyncIterable(e)?Nl(n,e):Vl(n,e)}};gr.RecordBatchStreamWriter=ja;var qa=class extends Ws{static writeAll(e){let t=new qa;return br.isPromise(e)?e.then(n=>t.writeAll(n)):br.isAsyncIterable(e)?Nl(t,e):Vl(t,e)}constructor(){super();this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeFooter(e){let t=xi.Footer.encode(new xi.Footer(e,Ul.MetadataVersion.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};gr.RecordBatchFileWriter=qa;var Wa=class extends Ws{constructor(){super();this._autoDestroy=!0,this._recordBatches=[],this._dictionaries=[]}static writeAll(e){return new Wa().writeAll(e)}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
8
|
-
"schema": ${JSON.stringify({fields:e.fields.map(
|
|
9
|
-
`),this._write(`${
|
|
7
|
+
return true;`)}Jo.createIsValidFunction=BI;function AI(r){return typeof r!="bigint"?bu.valueToString(r):SI.BigIntAvailable?`${bu.valueToString(r)}n`:`"${bu.valueToString(r)}"`}});var Xr=v(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.WideBufferBuilder=Et.OffsetsBufferBuilder=Et.BitmapBufferBuilder=Et.DataBufferBuilder=Et.BufferBuilder=void 0;var Dp=He(),gu=at(),vu=(r,e)=>(r*e+63&~63||64)/e,OI=(r,e=0)=>r.length>=e?r.subarray(0,e):Dp.memcpy(new r.constructor(e),r,0),Bs=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?vu(n*1,this.BYTES_PER_ELEMENT):vu(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=vu(e*this.stride,this.BYTES_PER_ELEMENT);let t=OI(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this._resize(0),this}_resize(e){return this.buffer=Dp.memcpy(new this.ArrayType(e),this.buffer)}};Et.BufferBuilder=Bs;Bs.prototype.offset=0;var Qo=class extends Bs{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}};Et.DataBufferBuilder=Qo;var Fp=class extends Qo{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,s=e%8,a=n[i]>>s&1;return t?a===0&&(n[i]|=1<<s,++this.numValid):a===1&&(n[i]&=~(1<<s),--this.numValid),this}clear(){return this.numValid=0,super.clear()}};Et.BitmapBufferBuilder=Fp;var Rp=class extends Qo{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)}};Et.OffsetsBufferBuilder=Rp;var Mp=class extends Bs{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?gu.BigInt64Array:gu.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 gu.BigIntAvailable&&(this.buffer64=new this.ArrayType64(t.buffer,t.byteOffset,n)),t}};Et.WideBufferBuilder=Mp});var Oe=v(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.VariableWidthBuilder=en.FixedWidthBuilder=en.Builder=void 0;var pi=ot(),EI=Me(),yi=pe(),DI=Gt(),FI=Ep(),Tu=Xr(),RI=ce(),Dt=class{constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=RI.strideForType(e),this._nulls=new Tu.BitmapBufferBuilder,t&&t.length>0&&(this._isValid=FI.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 MI(e)}static throughAsyncIterable(e){return UI(e)}toVector(){return EI.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:s,nullCount:a}=this;i?(e[yi.BufferType.TYPE]=i.flush(s),n&&(e[yi.BufferType.OFFSET]=n.flush(s))):n?(t&&(e[yi.BufferType.DATA]=t.flush(n.last())),e[yi.BufferType.OFFSET]=n.flush(s)):t&&(e[yi.BufferType.DATA]=t.flush(s)),a>0&&(e[yi.BufferType.VALIDITY]=this._nulls.flush(s));let o=DI.Data.new(this.type,0,s,a,e,this.children.map(d=>d.flush()));return this.clear(),o}finish(){return this.finished=!0,this.children.forEach(e=>e.finish()),this}clear(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach(e=>e.clear()),this}};en.Builder=Dt;Dt.prototype.length=1;Dt.prototype.stride=1;Dt.prototype.children=null;Dt.prototype.finished=!1;Dt.prototype.nullValues=null;Dt.prototype._isValid=()=>!0;var Up=class extends Dt{constructor(e){super(e);this._values=new Tu.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)}};en.FixedWidthBuilder=Up;var Pp=class extends Dt{constructor(e){super(e);this._pendingLength=0,this._offsets=new Tu.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}};en.VariableWidthBuilder=Pp;function MI(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function*(i){let s=0,a=Dt.new(r);for(let o of i)a.append(o)[n]>=t&&++s&&(yield a.toVector());(a.finish().length>0||s===0)&&(yield a.toVector())}}function UI(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?1e3:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function(i){return pi.__asyncGenerator(this,arguments,function*(){var s,a;let o=0,d=Dt.new(r);try{for(var h=pi.__asyncValues(i),_;_=yield pi.__await(h.next()),!_.done;){let F=_.value;d.append(F)[n]>=t&&++o&&(yield yield pi.__await(d.toVector()))}}catch(F){s={error:F}}finally{try{_&&!_.done&&(a=h.return)&&(yield pi.__await(a.call(h)))}finally{if(s)throw s.error}}(d.finish().length>0||o===0)&&(yield yield pi.__await(d.toVector()))})}}});var Iu=v(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.BoolBuilder=void 0;var PI=Xr(),kI=Oe(),kp=class extends kI.Builder{constructor(e){super(e);this._values=new PI.BitmapBufferBuilder}setValue(e,t){this._values.set(e,+t)}};Zo.BoolBuilder=kp});var wu=v(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.NullBuilder=void 0;var VI=Oe(),Vp=class extends VI.Builder{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}};Xo.NullBuilder=Vp});var Su=v(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.DateMillisecondBuilder=tn.DateDayBuilder=tn.DateBuilder=void 0;var NI=Oe(),ea=class extends NI.FixedWidthBuilder{};tn.DateBuilder=ea;var Np=class extends ea{};tn.DateDayBuilder=Np;var Lp=class extends ea{};tn.DateMillisecondBuilder=Lp});var Bu=v(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.DecimalBuilder=void 0;var LI=Oe(),xp=class extends LI.FixedWidthBuilder{};ta.DecimalBuilder=xp});var Ou=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.DictionaryBuilder=void 0;var xI=ce(),Au=Oe(),Cp=class extends Au.Builder{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new xI.Dictionary(e.dictionary,e.indices,e.id,e.isOrdered)});this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Au.Builder.new({type:this.type.indices,nullValues:t}),this.dictionary=Au.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),s=n[i];return s===void 0&&(n[i]=s=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,s)}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}`}};ra.DictionaryBuilder=Cp});var Eu=v(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.FixedSizeBinaryBuilder=void 0;var CI=Oe(),jp=class extends CI.FixedWidthBuilder{};na.FixedSizeBinaryBuilder=jp});var As=v(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.float64ToUint16=mi.uint16ToFloat64=void 0;var qp=new Float64Array(1),_i=new Uint32Array(qp.buffer);function jI(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=Math.pow(-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*Math.pow(2,e-15)*(1+t)}mi.uint16ToFloat64=jI;function qI(r){if(r!==r)return 32256;qp[0]=r;let e=(_i[1]&2147483648)>>16&65535,t=_i[1]&2146435072,n=0;return t>=1089470464?_i[0]>0?t=31744:(t=(t&2080374784)>>16,n=(_i[1]&1048575)>>10):t<=1056964608?(n=1048576+(_i[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(_i[1]&1048575)+512>>10),e|t|n&65535}mi.float64ToUint16=qI});var Du=v(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.Float64Builder=ur.Float32Builder=ur.Float16Builder=ur.FloatBuilder=void 0;var WI=As(),zI=Oe(),Os=class extends zI.FixedWidthBuilder{};ur.FloatBuilder=Os;var Wp=class extends Os{setValue(e,t){this._values.set(e,WI.float64ToUint16(t))}};ur.Float16Builder=Wp;var zp=class extends Os{setValue(e,t){this._values.set(e,t)}};ur.Float32Builder=zp;var Hp=class extends Os{setValue(e,t){this._values.set(e,t)}};ur.Float64Builder=Hp});var Fs=v(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.BN=Ye.bignumToBigInt=Ye.bignumToString=Ye.isArrowBigNumSymbol=void 0;var HI=He(),Es=at();Ye.isArrowBigNumSymbol=Symbol.for("isArrowBigNum");function Kt(r,...e){return e.length===0?Object.setPrototypeOf(HI.toArrayBufferView(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}Kt.prototype[Ye.isArrowBigNumSymbol]=!0;Kt.prototype.toJSON=function(){return`"${Ye.bignumToString(this)}"`};Kt.prototype.valueOf=function(){return Yp(this)};Kt.prototype.toString=function(){return Ye.bignumToString(this)};Kt.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Yp(this);case"string":return Ye.bignumToString(this);case"default":return Ye.bignumToBigInt(this)}return Ye.bignumToString(this)};function bi(...r){return Kt.apply(this,r)}function gi(...r){return Kt.apply(this,r)}function Ds(...r){return Kt.apply(this,r)}Object.setPrototypeOf(bi.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(gi.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ds.prototype,Object.create(Uint32Array.prototype));Object.assign(bi.prototype,Kt.prototype,{constructor:bi,signed:!0,TypedArray:Int32Array,BigIntArray:Es.BigInt64Array});Object.assign(gi.prototype,Kt.prototype,{constructor:gi,signed:!1,TypedArray:Uint32Array,BigIntArray:Es.BigUint64Array});Object.assign(Ds.prototype,Kt.prototype,{constructor:Ds,signed:!0,TypedArray:Uint32Array,BigIntArray:Es.BigUint64Array});function Yp(r){let{buffer:e,byteOffset:t,length:n,signed:i}=r,s=new Int32Array(e,t,n),a=0,o=0,d=s.length,h,_;for(;o<d;)_=s[o++],h=s[o++],i||(h=h>>>0),a+=(_>>>0)+h*Math.pow(o,32);return a}Es.BigIntAvailable?(Ye.bignumToBigInt=r=>r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Fu(r),Ye.bignumToString=r=>r.byteLength===8?`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`:Fu(r)):(Ye.bignumToString=Fu,Ye.bignumToBigInt=Ye.bignumToString);function Fu(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),s=-1,a=n.length-1;do{for(t[0]=n[s=0];s<a;)n[s++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[s];n[s]=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 ia=class{static new(e,t){switch(t){case!0:return new bi(e);case!1:return new gi(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case Es.BigInt64Array:return new bi(e)}return e.byteLength===16?new Ds(e):new gi(e)}static signed(e){return new bi(e)}static unsigned(e){return new gi(e)}static decimal(e){return new Ds(e)}constructor(e,t){return ia.new(e,t)}};Ye.BN=ia});var Ru=v(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.Uint64Builder=Ce.Uint32Builder=Ce.Uint16Builder=Ce.Uint8Builder=Ce.Int64Builder=Ce.Int32Builder=Ce.Int16Builder=Ce.Int8Builder=Ce.IntBuilder=void 0;var YI=Fs(),Gp=Xr(),GI=at(),KI=Oe(),lr=class extends KI.FixedWidthBuilder{setValue(e,t){this._values.set(e,t)}};Ce.IntBuilder=lr;var Kp=class extends lr{};Ce.Int8Builder=Kp;var $p=class extends lr{};Ce.Int16Builder=$p;var Jp=class extends lr{};Ce.Int32Builder=Jp;var Qp=class extends lr{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(sa));super(e);this._values=new Gp.WideBufferBuilder(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(sa(e))}};Ce.Int64Builder=Qp;var Zp=class extends lr{};Ce.Uint8Builder=Zp;var Xp=class extends lr{};Ce.Uint16Builder=Xp;var ey=class extends lr{};Ce.Uint32Builder=ey;var ty=class extends lr{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(sa));super(e);this._values=new Gp.WideBufferBuilder(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(sa(e))}};Ce.Uint64Builder=ty;var sa=(r=>e=>(ArrayBuffer.isView(e)&&(r.buffer=e.buffer,r.byteOffset=e.byteOffset,r.byteLength=e.byteLength,e=YI.bignumToBigInt(r),r.buffer=null),e))({BigIntArray:GI.BigInt64Array})});var Mu=v(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.TimeNanosecondBuilder=Ft.TimeMicrosecondBuilder=Ft.TimeMillisecondBuilder=Ft.TimeSecondBuilder=Ft.TimeBuilder=void 0;var $I=Oe(),vi=class extends $I.FixedWidthBuilder{};Ft.TimeBuilder=vi;var ry=class extends vi{};Ft.TimeSecondBuilder=ry;var ny=class extends vi{};Ft.TimeMillisecondBuilder=ny;var iy=class extends vi{};Ft.TimeMicrosecondBuilder=iy;var sy=class extends vi{};Ft.TimeNanosecondBuilder=sy});var Uu=v(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.TimestampNanosecondBuilder=Rt.TimestampMicrosecondBuilder=Rt.TimestampMillisecondBuilder=Rt.TimestampSecondBuilder=Rt.TimestampBuilder=void 0;var JI=Oe(),Ti=class extends JI.FixedWidthBuilder{};Rt.TimestampBuilder=Ti;var oy=class extends Ti{};Rt.TimestampSecondBuilder=oy;var ay=class extends Ti{};Rt.TimestampMillisecondBuilder=ay;var cy=class extends Ti{};Rt.TimestampMicrosecondBuilder=cy;var uy=class extends Ti{};Rt.TimestampNanosecondBuilder=uy});var Pu=v(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.IntervalYearMonthBuilder=rn.IntervalDayTimeBuilder=rn.IntervalBuilder=void 0;var QI=Oe(),oa=class extends QI.FixedWidthBuilder{};rn.IntervalBuilder=oa;var ly=class extends oa{};rn.IntervalDayTimeBuilder=ly;var dy=class extends oa{};rn.IntervalYearMonthBuilder=dy});var ca=v(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.BinaryBuilder=void 0;var ZI=He(),XI=Xr(),ew=Oe(),fy=class extends ew.VariableWidthBuilder{constructor(e){super(e);this._values=new XI.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,ZI.toUint8Array(t))}_flushPending(e,t){let n=this._offsets,i=this._values.reserve(t).buffer,s=0,a=0,o=0,d;for([s,d]of e)d===void 0?n.set(s,0):(a=d.length,i.set(d,o),n.set(s,a),o+=a)}};aa.BinaryBuilder=fy});var la=v(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.Utf8Builder=void 0;var tw=Mn(),rw=ca(),nw=Xr(),iw=Oe(),ku=class extends iw.VariableWidthBuilder{constructor(e){super(e);this._values=new nw.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,tw.encodeUtf8(t))}_flushPending(e,t){}};ua.Utf8Builder=ku;ku.prototype._flushPending=rw.BinaryBuilder.prototype._flushPending});var Vu=v(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.Run=void 0;var sw=Me(),hy=class{get length(){return this._values.length}get(e){return this._values[e]}clear(){return this._values=null,this}bind(e){return e instanceof sw.Vector?e:(this._values=e,this)}};da.Run=hy});var Je=v(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.Field=Ii.Schema=void 0;var ow=ce(),Mt=class{constructor(e=[],t,n){this.fields=e||[],this.metadata=t||new Map,n||(n=Nu(e)),this.dictionaries=n}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}select(...e){let t=e.reduce((n,i)=>(n[i]=!0)&&n,Object.create(null));return new Mt(this.fields.filter(n=>t[n.name]),this.metadata)}selectAt(...e){return new Mt(e.map(t=>this.fields[t]).filter(Boolean),this.metadata)}assign(...e){let t=e[0]instanceof Mt?e[0]:Array.isArray(e[0])?new Mt(e[0]):new Mt(e),n=[...this.fields],i=fa(fa(new Map,this.metadata),t.metadata),s=t.fields.filter(o=>{let d=n.findIndex(h=>h.name===o.name);return~d?(n[d]=o.clone({metadata:fa(fa(new Map,n[d].metadata),o.metadata)}))&&!1:!0}),a=Nu(s,new Map);return new Mt([...n,...s],i,new Map([...this.dictionaries,...a]))}};Ii.Schema=Mt;var Fr=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,s]=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),s===void 0&&(s=e[0].metadata)),new Fr(`${t}`,n,i,s)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[t,n,i,s]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,n=this.type,i=this.nullable,s=this.metadata]=e:{name:t=this.name,type:n=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=e[0],Fr.new(t,n,i,s)}};Ii.Field=Fr;function fa(r,e){return new Map([...r||new Map,...e||new Map])}function Nu(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let s=r[t].type;if(ow.DataType.isDictionary(s)){if(!e.has(s.id))e.set(s.id,s.dictionary);else if(e.get(s.id)!==s.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}s.children&&s.children.length>0&&Nu(s.children,e)}return e}Mt.prototype.fields=null;Mt.prototype.metadata=null;Mt.prototype.dictionaries=null;Fr.prototype.type=null;Fr.prototype.name=null;Fr.prototype.nullable=null;Fr.prototype.metadata=null});var Lu=v(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.ListBuilder=void 0;var aw=Vu(),cw=Je(),uw=ce(),lw=Xr(),dw=Oe(),py=class extends dw.VariableWidthBuilder{constructor(e){super(e);this._run=new aw.Run,this._offsets=new lw.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 uw.List(new cw.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,s=0,a;for([s,a]of e)a===void 0?n.set(s,0):(n.set(s,a.length),i(this,s,t.bind(a)))}};ha.ListBuilder=py});var xu=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.FixedSizeListBuilder=void 0;var fw=Vu(),hw=Je(),pw=Oe(),yw=ce(),yy=class extends pw.Builder{constructor(){super(...arguments);this._run=new fw.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 yw.FixedSizeList(this.type.listSize,new hw.Field(t,e.type,!0)),n}clear(){return this._run.clear(),super.clear()}};pa.FixedSizeListBuilder=yy});var Cu=v(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.MapBuilder=void 0;var _w=Je(),mw=ce(),bw=Oe(),_y=class extends bw.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 mw.Map_(new _w.Field(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,n=this._setValue;e.forEach((i,s)=>{i===void 0?t.set(s,0):(t.set(s,i.size),n(this,s,i))})}};ya.MapBuilder=_y});var ju=v(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.StructBuilder=void 0;var gw=Je(),vw=Oe(),Tw=ce(),my=class extends vw.Builder{addChild(e,t=`${this.numChildren}`){let n=this.children.push(e);return this.type=new Tw.Struct([...this.type.children,new gw.Field(t,e.type,!0)]),n}};_a.StructBuilder=my});var qu=v(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.DenseUnionBuilder=nn.SparseUnionBuilder=nn.UnionBuilder=void 0;var Iw=Je(),by=Xr(),ww=Oe(),Sw=ce(),ma=class extends ww.Builder{constructor(e){super(e);this._typeIds=new by.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:s,typeIds:a}}=this,o=[...i,new Iw.Field(t,e.type)];return this.type=new Sw.Union(s,[...a,n],o),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.")}};nn.UnionBuilder=ma;var gy=class extends ma{};nn.SparseUnionBuilder=gy;var vy=class extends ma{constructor(e){super(e);this._offsets=new by.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)}};nn.DenseUnionBuilder=vy});var tt=v(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.Visitor=void 0;var Bw=Gt(),Aw=Me(),b=pe(),Ow=ce(),fe=class{visitMany(e,...t){return e.map((n,i)=>this.visit(n,...t.map(s=>s[i])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Ew(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}};ba.Visitor=fe;function Ew(r,e,t=!0){let n=null,i=b.Type.NONE;switch(e instanceof Bw.Data||e instanceof Aw.Vector?i=Wu(e.type):e instanceof Ow.DataType?i=Wu(e):typeof(i=e)!="number"&&(i=b.Type[e]),i){case b.Type.Null:n=r.visitNull;break;case b.Type.Bool:n=r.visitBool;break;case b.Type.Int:n=r.visitInt;break;case b.Type.Int8:n=r.visitInt8||r.visitInt;break;case b.Type.Int16:n=r.visitInt16||r.visitInt;break;case b.Type.Int32:n=r.visitInt32||r.visitInt;break;case b.Type.Int64:n=r.visitInt64||r.visitInt;break;case b.Type.Uint8:n=r.visitUint8||r.visitInt;break;case b.Type.Uint16:n=r.visitUint16||r.visitInt;break;case b.Type.Uint32:n=r.visitUint32||r.visitInt;break;case b.Type.Uint64:n=r.visitUint64||r.visitInt;break;case b.Type.Float:n=r.visitFloat;break;case b.Type.Float16:n=r.visitFloat16||r.visitFloat;break;case b.Type.Float32:n=r.visitFloat32||r.visitFloat;break;case b.Type.Float64:n=r.visitFloat64||r.visitFloat;break;case b.Type.Utf8:n=r.visitUtf8;break;case b.Type.Binary:n=r.visitBinary;break;case b.Type.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case b.Type.Date:n=r.visitDate;break;case b.Type.DateDay:n=r.visitDateDay||r.visitDate;break;case b.Type.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case b.Type.Timestamp:n=r.visitTimestamp;break;case b.Type.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case b.Type.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case b.Type.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case b.Type.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case b.Type.Time:n=r.visitTime;break;case b.Type.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case b.Type.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case b.Type.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case b.Type.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case b.Type.Decimal:n=r.visitDecimal;break;case b.Type.List:n=r.visitList;break;case b.Type.Struct:n=r.visitStruct;break;case b.Type.Union:n=r.visitUnion;break;case b.Type.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case b.Type.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case b.Type.Dictionary:n=r.visitDictionary;break;case b.Type.Interval:n=r.visitInterval;break;case b.Type.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case b.Type.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case b.Type.FixedSizeList:n=r.visitFixedSizeList;break;case b.Type.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${b.Type[i]}'`)}function Wu(r){switch(r.typeId){case b.Type.Null:return b.Type.Null;case b.Type.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?b.Type.Int8:b.Type.Uint8;case 16:return t?b.Type.Int16:b.Type.Uint16;case 32:return t?b.Type.Int32:b.Type.Uint32;case 64:return t?b.Type.Int64:b.Type.Uint64}return b.Type.Int}case b.Type.Float:switch(r.precision){case b.Precision.HALF:return b.Type.Float16;case b.Precision.SINGLE:return b.Type.Float32;case b.Precision.DOUBLE:return b.Type.Float64}return b.Type.Float;case b.Type.Binary:return b.Type.Binary;case b.Type.Utf8:return b.Type.Utf8;case b.Type.Bool:return b.Type.Bool;case b.Type.Decimal:return b.Type.Decimal;case b.Type.Time:switch(r.unit){case b.TimeUnit.SECOND:return b.Type.TimeSecond;case b.TimeUnit.MILLISECOND:return b.Type.TimeMillisecond;case b.TimeUnit.MICROSECOND:return b.Type.TimeMicrosecond;case b.TimeUnit.NANOSECOND:return b.Type.TimeNanosecond}return b.Type.Time;case b.Type.Timestamp:switch(r.unit){case b.TimeUnit.SECOND:return b.Type.TimestampSecond;case b.TimeUnit.MILLISECOND:return b.Type.TimestampMillisecond;case b.TimeUnit.MICROSECOND:return b.Type.TimestampMicrosecond;case b.TimeUnit.NANOSECOND:return b.Type.TimestampNanosecond}return b.Type.Timestamp;case b.Type.Date:switch(r.unit){case b.DateUnit.DAY:return b.Type.DateDay;case b.DateUnit.MILLISECOND:return b.Type.DateMillisecond}return b.Type.Date;case b.Type.Interval:switch(r.unit){case b.IntervalUnit.DAY_TIME:return b.Type.IntervalDayTime;case b.IntervalUnit.YEAR_MONTH:return b.Type.IntervalYearMonth}return b.Type.Interval;case b.Type.Map:return b.Type.Map;case b.Type.List:return b.Type.List;case b.Type.Struct:return b.Type.Struct;case b.Type.Union:switch(r.mode){case b.UnionMode.Dense:return b.Type.DenseUnion;case b.UnionMode.Sparse:return b.Type.SparseUnion}return b.Type.Union;case b.Type.FixedSizeBinary:return b.Type.FixedSizeBinary;case b.Type.FixedSizeList:return b.Type.FixedSizeList;case b.Type.Dictionary:return b.Type.Dictionary}throw new Error(`Unrecognized type '${b.Type[r.typeId]}'`)}fe.prototype.visitInt8=null;fe.prototype.visitInt16=null;fe.prototype.visitInt32=null;fe.prototype.visitInt64=null;fe.prototype.visitUint8=null;fe.prototype.visitUint16=null;fe.prototype.visitUint32=null;fe.prototype.visitUint64=null;fe.prototype.visitFloat16=null;fe.prototype.visitFloat32=null;fe.prototype.visitFloat64=null;fe.prototype.visitDateDay=null;fe.prototype.visitDateMillisecond=null;fe.prototype.visitTimestampSecond=null;fe.prototype.visitTimestampMillisecond=null;fe.prototype.visitTimestampMicrosecond=null;fe.prototype.visitTimestampNanosecond=null;fe.prototype.visitTimeSecond=null;fe.prototype.visitTimeMillisecond=null;fe.prototype.visitTimeMicrosecond=null;fe.prototype.visitTimeNanosecond=null;fe.prototype.visitDenseUnion=null;fe.prototype.visitSparseUnion=null;fe.prototype.visitIntervalDayTime=null;fe.prototype.visitIntervalYearMonth=null});var Yu=v(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.instance=wi.SetVisitor=void 0;var Dw=Me(),Fw=tt(),Rw=Mn(),Mw=As(),Uw=He(),Ut=pe(),K=class extends Fw.Visitor{};wi.SetVisitor=K;var Pw=(r,e,t)=>{r[e]=t/864e5|0},zu=(r,e,t)=>{r[e]=t%4294967296|0,r[e+1]=t/4294967296|0},kw=(r,e,t)=>{r[e]=t*1e3%4294967296|0,r[e+1]=t*1e3/4294967296|0},Vw=(r,e,t)=>{r[e]=t*1e6%4294967296|0,r[e+1]=t*1e6/4294967296|0},Ty=(r,e,t,n)=>{let{[t]:i,[t+1]:s}=e;i!=null&&s!=null&&r.set(n.subarray(0,s-i),i)},Nw=({offset:r,values:e},t,n)=>{let i=r+t;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)},Iy=({values:r},e,t)=>{Pw(r,e,t.valueOf())},wy=({values:r},e,t)=>{zu(r,e*2,t.valueOf())},dr=({stride:r,values:e},t,n)=>{e[r*t]=n},Sy=({stride:r,values:e},t,n)=>{e[r*t]=Mw.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:s}=r,a=Uw.toArrayBufferView(s,n);r.values.set(a.subarray(0,i),i*e)}}},Lw=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},xw=({values:r,valueOffsets:e},t,n)=>Ty(r,e,t,n),Cw=({values:r,valueOffsets:e},t,n)=>{Ty(r,e,t,Rw.encodeUtf8(n))},jw=(r,e,t)=>{r.type.bitWidth<64?dr(r,e,t):Hu(r,e,t)},qw=(r,e,t)=>{r.type.precision!==Ut.Precision.HALF?dr(r,e,t):Sy(r,e,t)},Ww=(r,e,t)=>{r.type.unit===Ut.DateUnit.DAY?Iy(r,e,t):wy(r,e,t)},By=({values:r},e,t)=>zu(r,e*2,t/1e3),Ay=({values:r},e,t)=>zu(r,e*2,t),Oy=({values:r},e,t)=>kw(r,e*2,t),Ey=({values:r},e,t)=>Vw(r,e*2,t),zw=(r,e,t)=>{switch(r.type.unit){case Ut.TimeUnit.SECOND:return By(r,e,t);case Ut.TimeUnit.MILLISECOND:return Ay(r,e,t);case Ut.TimeUnit.MICROSECOND:return Oy(r,e,t);case Ut.TimeUnit.NANOSECOND:return Ey(r,e,t)}},Dy=({values:r,stride:e},t,n)=>{r[e*t]=n},Fy=({values:r,stride:e},t,n)=>{r[e*t]=n},Ry=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},My=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Hw=(r,e,t)=>{switch(r.type.unit){case Ut.TimeUnit.SECOND:return Dy(r,e,t);case Ut.TimeUnit.MILLISECOND:return Fy(r,e,t);case Ut.TimeUnit.MICROSECOND:return Ry(r,e,t);case Ut.TimeUnit.NANOSECOND:return My(r,e,t)}},Yw=({values:r},e,t)=>{r.set(t.subarray(0,4),4*e)},Gw=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets;for(let s=-1,a=i[e],o=i[e+1];a<o;)n.set(a++,t.get(++s))},Kw=(r,e,t)=>{let n=r.getChildAt(0),i=r.valueOffsets,s=t instanceof Map?[...t]:Object.entries(t);for(let a=-1,o=i[e],d=i[e+1];o<d;)n.set(o++,s[++a])},$w=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e[i]),Jw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e.get(i)),Qw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e.get(n.name)),Zw=(r,e)=>(t,n,i)=>t==null?void 0:t.set(r,e[n.name]),Xw=(r,e,t)=>{let n=t instanceof Map?Qw(e,t):t instanceof Dw.Vector?Jw(e,t):Array.isArray(t)?$w(e,t):Zw(e,t);r.type.children.forEach((i,s)=>n(r.getChildAt(s),i,s))},eS=(r,e,t)=>{r.type.mode===Ut.UnionMode.Dense?Uy(r,e,t):Py(r,e,t)},Uy=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(r.valueOffsets[e],t)},Py=(r,e,t)=>{let n=r.typeIdToChildIndex[r.typeIds[e]],i=r.getChildAt(n);i&&i.set(e,t)},tS=(r,e,t)=>{let n=r.getKey(e);n!==null&&r.setValue(n,t)},rS=(r,e,t)=>{r.type.unit===Ut.IntervalUnit.DAY_TIME?ky(r,e,t):Vy(r,e,t)},ky=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Vy=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},nS=(r,e,t)=>{let n=r.getChildAt(0),{stride:i}=r;for(let s=-1,a=e*i;++s<i;)n.set(a+s,t.get(s))};K.prototype.visitBool=Nw;K.prototype.visitInt=jw;K.prototype.visitInt8=dr;K.prototype.visitInt16=dr;K.prototype.visitInt32=dr;K.prototype.visitInt64=Hu;K.prototype.visitUint8=dr;K.prototype.visitUint16=dr;K.prototype.visitUint32=dr;K.prototype.visitUint64=Hu;K.prototype.visitFloat=qw;K.prototype.visitFloat16=Sy;K.prototype.visitFloat32=dr;K.prototype.visitFloat64=dr;K.prototype.visitUtf8=Cw;K.prototype.visitBinary=xw;K.prototype.visitFixedSizeBinary=Lw;K.prototype.visitDate=Ww;K.prototype.visitDateDay=Iy;K.prototype.visitDateMillisecond=wy;K.prototype.visitTimestamp=zw;K.prototype.visitTimestampSecond=By;K.prototype.visitTimestampMillisecond=Ay;K.prototype.visitTimestampMicrosecond=Oy;K.prototype.visitTimestampNanosecond=Ey;K.prototype.visitTime=Hw;K.prototype.visitTimeSecond=Dy;K.prototype.visitTimeMillisecond=Fy;K.prototype.visitTimeMicrosecond=Ry;K.prototype.visitTimeNanosecond=My;K.prototype.visitDecimal=Yw;K.prototype.visitList=Gw;K.prototype.visitStruct=Xw;K.prototype.visitUnion=eS;K.prototype.visitDenseUnion=Uy;K.prototype.visitSparseUnion=Py;K.prototype.visitDictionary=tS;K.prototype.visitInterval=rS;K.prototype.visitIntervalDayTime=ky;K.prototype.visitIntervalYearMonth=Vy;K.prototype.visitFixedSizeList=nS;K.prototype.visitMap=Kw;wi.instance=new K});var Ny=v(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.instance=Si.GetBuilderCtor=void 0;var iS=tt(),sS=ca(),oS=Iu(),Gu=Su(),aS=Bu(),cS=Ou(),uS=Eu(),lS=xu(),ga=Du(),Ku=Pu(),Rr=Ru(),dS=Lu(),fS=Cu(),hS=wu(),pS=ju(),Rs=Uu(),Ms=Mu(),$u=qu(),yS=la(),Ju=class extends iS.Visitor{visitNull(){return hS.NullBuilder}visitBool(){return oS.BoolBuilder}visitInt(){return Rr.IntBuilder}visitInt8(){return Rr.Int8Builder}visitInt16(){return Rr.Int16Builder}visitInt32(){return Rr.Int32Builder}visitInt64(){return Rr.Int64Builder}visitUint8(){return Rr.Uint8Builder}visitUint16(){return Rr.Uint16Builder}visitUint32(){return Rr.Uint32Builder}visitUint64(){return Rr.Uint64Builder}visitFloat(){return ga.FloatBuilder}visitFloat16(){return ga.Float16Builder}visitFloat32(){return ga.Float32Builder}visitFloat64(){return ga.Float64Builder}visitUtf8(){return yS.Utf8Builder}visitBinary(){return sS.BinaryBuilder}visitFixedSizeBinary(){return uS.FixedSizeBinaryBuilder}visitDate(){return Gu.DateBuilder}visitDateDay(){return Gu.DateDayBuilder}visitDateMillisecond(){return Gu.DateMillisecondBuilder}visitTimestamp(){return Rs.TimestampBuilder}visitTimestampSecond(){return Rs.TimestampSecondBuilder}visitTimestampMillisecond(){return Rs.TimestampMillisecondBuilder}visitTimestampMicrosecond(){return Rs.TimestampMicrosecondBuilder}visitTimestampNanosecond(){return Rs.TimestampNanosecondBuilder}visitTime(){return Ms.TimeBuilder}visitTimeSecond(){return Ms.TimeSecondBuilder}visitTimeMillisecond(){return Ms.TimeMillisecondBuilder}visitTimeMicrosecond(){return Ms.TimeMicrosecondBuilder}visitTimeNanosecond(){return Ms.TimeNanosecondBuilder}visitDecimal(){return aS.DecimalBuilder}visitList(){return dS.ListBuilder}visitStruct(){return pS.StructBuilder}visitUnion(){return $u.UnionBuilder}visitDenseUnion(){return $u.DenseUnionBuilder}visitSparseUnion(){return $u.SparseUnionBuilder}visitDictionary(){return cS.DictionaryBuilder}visitInterval(){return Ku.IntervalBuilder}visitIntervalDayTime(){return Ku.IntervalDayTimeBuilder}visitIntervalYearMonth(){return Ku.IntervalYearMonthBuilder}visitFixedSizeList(){return lS.FixedSizeListBuilder}visitMap(){return fS.MapBuilder}};Si.GetBuilderCtor=Ju;Si.instance=new Ju});var Ta=v(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.DenseUnionBuilder=A.SparseUnionBuilder=A.UnionBuilder=A.StructBuilder=A.MapBuilder=A.FixedSizeListBuilder=A.ListBuilder=A.BinaryBuilder=A.Utf8Builder=A.IntervalYearMonthBuilder=A.IntervalDayTimeBuilder=A.IntervalBuilder=A.TimestampNanosecondBuilder=A.TimestampMicrosecondBuilder=A.TimestampMillisecondBuilder=A.TimestampSecondBuilder=A.TimestampBuilder=A.TimeNanosecondBuilder=A.TimeMicrosecondBuilder=A.TimeMillisecondBuilder=A.TimeSecondBuilder=A.TimeBuilder=A.Uint64Builder=A.Uint32Builder=A.Uint16Builder=A.Uint8Builder=A.Int64Builder=A.Int32Builder=A.Int16Builder=A.Int8Builder=A.IntBuilder=A.Float64Builder=A.Float32Builder=A.Float16Builder=A.FloatBuilder=A.FixedSizeBinaryBuilder=A.DictionaryBuilder=A.DecimalBuilder=A.DateMillisecondBuilder=A.DateDayBuilder=A.DateBuilder=A.NullBuilder=A.BoolBuilder=A.Builder=void 0;var _S=Oe();Object.defineProperty(A,"Builder",{enumerable:!0,get:function(){return _S.Builder}});var mS=Iu();Object.defineProperty(A,"BoolBuilder",{enumerable:!0,get:function(){return mS.BoolBuilder}});var bS=wu();Object.defineProperty(A,"NullBuilder",{enumerable:!0,get:function(){return bS.NullBuilder}});var Qu=Su();Object.defineProperty(A,"DateBuilder",{enumerable:!0,get:function(){return Qu.DateBuilder}});Object.defineProperty(A,"DateDayBuilder",{enumerable:!0,get:function(){return Qu.DateDayBuilder}});Object.defineProperty(A,"DateMillisecondBuilder",{enumerable:!0,get:function(){return Qu.DateMillisecondBuilder}});var gS=Bu();Object.defineProperty(A,"DecimalBuilder",{enumerable:!0,get:function(){return gS.DecimalBuilder}});var vS=Ou();Object.defineProperty(A,"DictionaryBuilder",{enumerable:!0,get:function(){return vS.DictionaryBuilder}});var TS=Eu();Object.defineProperty(A,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return TS.FixedSizeBinaryBuilder}});var va=Du();Object.defineProperty(A,"FloatBuilder",{enumerable:!0,get:function(){return va.FloatBuilder}});Object.defineProperty(A,"Float16Builder",{enumerable:!0,get:function(){return va.Float16Builder}});Object.defineProperty(A,"Float32Builder",{enumerable:!0,get:function(){return va.Float32Builder}});Object.defineProperty(A,"Float64Builder",{enumerable:!0,get:function(){return va.Float64Builder}});var Mr=Ru();Object.defineProperty(A,"IntBuilder",{enumerable:!0,get:function(){return Mr.IntBuilder}});Object.defineProperty(A,"Int8Builder",{enumerable:!0,get:function(){return Mr.Int8Builder}});Object.defineProperty(A,"Int16Builder",{enumerable:!0,get:function(){return Mr.Int16Builder}});Object.defineProperty(A,"Int32Builder",{enumerable:!0,get:function(){return Mr.Int32Builder}});Object.defineProperty(A,"Int64Builder",{enumerable:!0,get:function(){return Mr.Int64Builder}});Object.defineProperty(A,"Uint8Builder",{enumerable:!0,get:function(){return Mr.Uint8Builder}});Object.defineProperty(A,"Uint16Builder",{enumerable:!0,get:function(){return Mr.Uint16Builder}});Object.defineProperty(A,"Uint32Builder",{enumerable:!0,get:function(){return Mr.Uint32Builder}});Object.defineProperty(A,"Uint64Builder",{enumerable:!0,get:function(){return Mr.Uint64Builder}});var Us=Mu();Object.defineProperty(A,"TimeBuilder",{enumerable:!0,get:function(){return Us.TimeBuilder}});Object.defineProperty(A,"TimeSecondBuilder",{enumerable:!0,get:function(){return Us.TimeSecondBuilder}});Object.defineProperty(A,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return Us.TimeMillisecondBuilder}});Object.defineProperty(A,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return Us.TimeMicrosecondBuilder}});Object.defineProperty(A,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return Us.TimeNanosecondBuilder}});var Ps=Uu();Object.defineProperty(A,"TimestampBuilder",{enumerable:!0,get:function(){return Ps.TimestampBuilder}});Object.defineProperty(A,"TimestampSecondBuilder",{enumerable:!0,get:function(){return Ps.TimestampSecondBuilder}});Object.defineProperty(A,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return Ps.TimestampMillisecondBuilder}});Object.defineProperty(A,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return Ps.TimestampMicrosecondBuilder}});Object.defineProperty(A,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return Ps.TimestampNanosecondBuilder}});var Zu=Pu();Object.defineProperty(A,"IntervalBuilder",{enumerable:!0,get:function(){return Zu.IntervalBuilder}});Object.defineProperty(A,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return Zu.IntervalDayTimeBuilder}});Object.defineProperty(A,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return Zu.IntervalYearMonthBuilder}});var IS=la();Object.defineProperty(A,"Utf8Builder",{enumerable:!0,get:function(){return IS.Utf8Builder}});var wS=ca();Object.defineProperty(A,"BinaryBuilder",{enumerable:!0,get:function(){return wS.BinaryBuilder}});var SS=Lu();Object.defineProperty(A,"ListBuilder",{enumerable:!0,get:function(){return SS.ListBuilder}});var BS=xu();Object.defineProperty(A,"FixedSizeListBuilder",{enumerable:!0,get:function(){return BS.FixedSizeListBuilder}});var AS=Cu();Object.defineProperty(A,"MapBuilder",{enumerable:!0,get:function(){return AS.MapBuilder}});var OS=ju();Object.defineProperty(A,"StructBuilder",{enumerable:!0,get:function(){return OS.StructBuilder}});var Xu=qu();Object.defineProperty(A,"UnionBuilder",{enumerable:!0,get:function(){return Xu.UnionBuilder}});Object.defineProperty(A,"SparseUnionBuilder",{enumerable:!0,get:function(){return Xu.SparseUnionBuilder}});Object.defineProperty(A,"DenseUnionBuilder",{enumerable:!0,get:function(){return Xu.DenseUnionBuilder}});var el=pe(),ES=la(),DS=Oe(),Ly=Yu(),xy=Ny();DS.Builder.new=Cy;function Cy(r){let e=r.type,t=new(xy.instance.getVisitFn(e)())(r);if(e.children&&e.children.length>0){let n=r.children||[],i={nullValues:r.nullValues},s=Array.isArray(n)?(a,o)=>n[o]||i:({name:a})=>n[a]||i;e.children.forEach((a,o)=>{let{type:d}=a,h=s(a,o);t.children.push(Cy(Object.assign(Object.assign({},h),{type:d})))})}return t}Object.keys(el.Type).map(r=>el.Type[r]).filter(r=>typeof r=="number"&&r!==el.Type.NONE).forEach(r=>{let e=xy.instance.visit(r);e.prototype._setValue=Ly.instance.getVisitFn(r)});ES.Utf8Builder.prototype._setValue=Ly.instance.visitBinary});var jy=v(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.Block=Bi.Footer=void 0;var FS=Ar(),Ia=Jr(),Pt=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new Pt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+FS.flatbuffers.SIZE_PREFIX_LENGTH),(t||new Pt).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ia.MetadataVersion.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Ia.Schema).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new wa).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new wa).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Ia.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Ia.MetadataVersion.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}static createFooter(e,t,n,i,s,a){return Pt.startFooter(e),Pt.addVersion(e,t),Pt.addSchema(e,n),Pt.addDictionaries(e,i),Pt.addRecordBatches(e,s),Pt.addCustomMetadata(e,a),Pt.endFooter(e)}};Bi.Footer=Pt;var wa=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static createBlock(e,t,n,i){return e.prep(8,24),e.writeInt64(i),e.pad(4),e.writeInt32(n),e.writeInt64(t),e.offset()}};Bi.Block=wa});var nl=v(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.FileBlock=Ai.Footer=void 0;var $t=jy(),tl=Ar(),qy=tl.flatbuffers.Long,RS=tl.flatbuffers.Builder,MS=tl.flatbuffers.ByteBuffer,Wy=Je(),zy=pe(),US=He(),rl=class{constructor(e,t=zy.MetadataVersion.V4,n,i){this.schema=e,this.version=t,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}static decode(e){e=new MS(US.toUint8Array(e));let t=$t.Footer.getRootAsFooter(e),n=Wy.Schema.decode(t.schema());return new Hy(n,t)}static encode(e){let t=new RS,n=Wy.Schema.encode(t,e.schema);$t.Footer.startRecordBatchesVector(t,e.numRecordBatches),[...e.recordBatches()].slice().reverse().forEach(a=>sn.encode(t,a));let i=t.endVector();$t.Footer.startDictionariesVector(t,e.numDictionaries),[...e.dictionaryBatches()].slice().reverse().forEach(a=>sn.encode(t,a));let s=t.endVector();return $t.Footer.startFooter(t),$t.Footer.addSchema(t,n),$t.Footer.addVersion(t,zy.MetadataVersion.V4),$t.Footer.addRecordBatches(t,i),$t.Footer.addDictionaries(t,s),$t.Footer.finishFooterBuffer(t,$t.Footer.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}};Ai.Footer=rl;var Hy=class extends rl{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 sn.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return sn.decode(t)}return null}},sn=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 sn(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:n}=t,i=new qy(t.offset,0),s=new qy(t.bodyLength,0);return $t.Block.createBlock(e,i,n,s)}};Ai.FileBlock=sn});var ln=v(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.AsyncByteStream=un.ByteStream=un.AsyncByteQueue=void 0;var on=ot(),an=Ss(),Yy=Mn(),ks=ci(),il=He(),Oi=at(),sl=class extends ks.AsyncQueue{write(e){if((e=il.toUint8Array(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Yy.decodeUtf8(this.toUint8Array(!0)):this.toUint8Array(!1).then(Yy.decodeUtf8)}toUint8Array(e=!1){return e?il.joinUint8Arrays(this._values)[0]:(()=>on.__awaiter(this,void 0,void 0,function*(){var t,n;let i=[],s=0;try{for(var a=on.__asyncValues(this),o;o=yield a.next(),!o.done;){let d=o.value;i.push(d),s+=d.byteLength}}catch(d){t={error:d}}finally{try{o&&!o.done&&(n=a.return)&&(yield n.call(a))}finally{if(t)throw t.error}}return il.joinUint8Arrays(i,s)[0]}))()}};un.AsyncByteQueue=sl;var Gy=class{constructor(e){e&&(this.source=new Ky(an.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)}};un.ByteStream=Gy;var Sa=class{constructor(e){e instanceof Sa?this.source=e.source:e instanceof sl?this.source=new cn(an.default.fromAsyncIterable(e)):Oi.isReadableNodeStream(e)?this.source=new cn(an.default.fromNodeStream(e)):Oi.isReadableDOMStream(e)?this.source=new cn(an.default.fromDOMStream(e)):Oi.isFetchResponse(e)?this.source=new cn(an.default.fromDOMStream(e.body)):Oi.isIterable(e)?this.source=new cn(an.default.fromIterable(e)):Oi.isPromise(e)?this.source=new cn(an.default.fromAsyncIterable(e)):Oi.isAsyncIterable(e)&&(this.source=new cn(an.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)}};un.AsyncByteStream=Sa;var Ky=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)||ks.ITERATOR_DONE)}return(e){return Object.create(this.source.return&&this.source.return(e)||ks.ITERATOR_DONE)}},cn=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return on.__awaiter(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return on.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return on.__awaiter(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e,t="read"){return on.__awaiter(this,void 0,void 0,function*(){return yield this.source.next({cmd:t,size:e})})}throw(e){return on.__awaiter(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||ks.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return on.__awaiter(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||ks.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}});var ol=v(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.AsyncRandomAccessFile=Ei.RandomAccessFile=void 0;var dn=ot(),$y=ln(),PS=He(),Jy=class extends $y.ByteStream{constructor(e,t){super();this.position=0,this.buffer=PS.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}}};Ei.RandomAccessFile=Jy;var Qy=class extends $y.AsyncByteStream{constructor(e,t){super();this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=(()=>dn.__awaiter(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return dn.__awaiter(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return dn.__awaiter(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return dn.__awaiter(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:t,size:n,position:i}=this;if(t&&i<n){typeof e!="number"&&(e=1/0);let s=i,a=0,o=0,d=Math.min(n,s+Math.min(n-s,e)),h=new Uint8Array(Math.max(0,(this.position=d)-s));for(;(s+=o)<d&&(a+=o)<h.byteLength;)({bytesRead:o}=yield t.read(h,a,h.byteLength-a,s));return h}return null})}readAt(e,t){return dn.__awaiter(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&e+t<i){let s=Math.min(i,e+t),a=new Uint8Array(s-e);return(yield n.read(a,0,t,e)).buffer}return new Uint8Array(t)})}close(){return dn.__awaiter(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return dn.__awaiter(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return dn.__awaiter(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}};Ei.AsyncRandomAccessFile=Qy});var cl=v(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.Int128=fr.Int64=fr.Uint64=fr.BaseInt64=void 0;var kS=1<<16;function Di(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var Fi=8,al=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Ba=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 s=i>>>16;return i=t[2]*n[3],s+=i,i=t[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0<i?kS:0,this.buffer[1]+=s>>>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`${Di(this.buffer[1])} ${Di(this.buffer[0])}`}};fr.BaseInt64=Ba;var ue=class extends Ba{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return ue.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return ue.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.length,i=new ue(t);for(let s=0;s<n;){let a=Fi<n-s?Fi:n-s,o=new ue(new Uint32Array([parseInt(e.substr(s,a),10),0])),d=new ue(new Uint32Array([al[a],0]));i.times(d),i.plus(o),s+=a}return i}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)ue.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new ue(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new ue(new Uint32Array(e.buffer)).plus(t)}};fr.Uint64=ue;var mt=class extends Ba{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 mt.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return mt.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.startsWith("-"),i=e.length,s=new mt(t);for(let a=n?1:0;a<i;){let o=Fi<i-a?Fi:i-a,d=new mt(new Uint32Array([parseInt(e.substr(a,o),10),0])),h=new mt(new Uint32Array([al[o],0]));s.times(h),s.plus(d),a+=o}return n?s.negate():s}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)mt.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new mt(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new mt(new Uint32Array(e.buffer)).plus(t)}};fr.Int64=mt;var Jt=class{constructor(e){this.buffer=e}high(){return new mt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new mt(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 ue(new Uint32Array([this.buffer[3],0])),n=new ue(new Uint32Array([this.buffer[2],0])),i=new ue(new Uint32Array([this.buffer[1],0])),s=new ue(new Uint32Array([this.buffer[0],0])),a=new ue(new Uint32Array([e.buffer[3],0])),o=new ue(new Uint32Array([e.buffer[2],0])),d=new ue(new Uint32Array([e.buffer[1],0])),h=new ue(new Uint32Array([e.buffer[0],0])),_=ue.multiply(s,h);this.buffer[0]=_.low();let F=new ue(new Uint32Array([_.high(),0]));return _=ue.multiply(i,h),F.plus(_),_=ue.multiply(s,d),F.plus(_),this.buffer[1]=F.low(),this.buffer[3]=F.lessThan(_)?1:0,this.buffer[2]=F.high(),new ue(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(ue.multiply(n,h)).plus(ue.multiply(i,d)).plus(ue.multiply(s,o)),this.buffer[3]+=ue.multiply(t,h).plus(ue.multiply(n,d)).plus(ue.multiply(i,o)).plus(ue.multiply(s,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`${Di(this.buffer[3])} ${Di(this.buffer[2])} ${Di(this.buffer[1])} ${Di(this.buffer[0])}`}static multiply(e,t){return new Jt(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new Jt(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return Jt.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return Jt.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let n=e.startsWith("-"),i=e.length,s=new Jt(t);for(let a=n?1:0;a<i;){let o=Fi<i-a?Fi:i-a,d=new Jt(new Uint32Array([parseInt(e.substr(a,o),10),0,0,0])),h=new Jt(new Uint32Array([al[o],0,0,0]));s.times(h),s.plus(d),a+=o}return n?s.negate():s}static convertArray(e){let t=new Uint32Array(e.length*4);for(let n=-1,i=e.length;++n<i;)Jt.from(e[n],new Uint32Array(t.buffer,t.byteOffset+4*4*n,4));return t}};fr.Int128=Jt});var t_=v(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.JSONVectorLoader=Ri.VectorLoader=void 0;var Ge=Gt(),VS=Je(),Ur=ce(),NS=tt(),Zy=cr(),LS=Mn(),Aa=cl(),Xy=pe(),hr=He(),ul=class extends NS.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 VS.Field?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return Ge.Data.Null(e,0,t)}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Bool(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Int(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Float(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.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 Ge.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 Ge.Data.FixedSizeBinary(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Date(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Timestamp(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Time(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.Decimal(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.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 Ge.Data.Struct(e,0,t,n,this.readNullBitmap(e,n),this.visitMany(e.children))}visitUnion(e){return e.mode===Xy.UnionMode.Sparse?this.visitSparseUnion(e):this.visitDenseUnion(e)}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.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 Ge.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 Ge.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 Ge.Data.Interval(e,0,t,n,this.readNullBitmap(e,n),this.readData(e))}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.Data.FixedSizeList(e,0,t,n,this.readNullBitmap(e,n),this.visit(e.children[0]))}visitMap(e,{length:t,nullCount:n}=this.nextFieldNode()){return Ge.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)}};Ri.VectorLoader=ul;var e_=class extends ul{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):Zy.packBools(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return hr.toArrayBufferView(Uint8Array,hr.toArrayBufferView(Int32Array,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return hr.toArrayBufferView(Uint8Array,hr.toArrayBufferView(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return Ur.DataType.isTimestamp(e)||(Ur.DataType.isInt(e)||Ur.DataType.isTime(e))&&e.bitWidth===64||Ur.DataType.isDate(e)&&e.unit===Xy.DateUnit.MILLISECOND?hr.toArrayBufferView(Uint8Array,Aa.Int64.convertArray(n[t])):Ur.DataType.isDecimal(e)?hr.toArrayBufferView(Uint8Array,Aa.Int128.convertArray(n[t])):Ur.DataType.isBinary(e)||Ur.DataType.isFixedSizeBinary(e)?xS(n[t]):Ur.DataType.isBool(e)?Zy.packBools(n[t]):Ur.DataType.isUtf8(e)?LS.encodeUtf8(n[t].join("")):hr.toArrayBufferView(Uint8Array,hr.toArrayBufferView(e.ArrayType,n[t].map(i=>+i)))}};Ri.JSONVectorLoader=e_;function xS(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 Vs=v(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.StructRow=Ui.MapRow=void 0;var r_=mu(),rt=Symbol.for("parent"),Mi=Symbol.for("rowIndex"),bt=Symbol.for("keyToIdx"),gt=Symbol.for("idxToVal"),ll=Symbol.for("nodejs.util.inspect.custom"),pr=class{constructor(e,t){this[rt]=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[bt]||(this[bt]=new Map),i=n.get(e);if(i!==void 0){let s=this[gt]||(this[gt]=new Array(this.size));(t=s[i])!==void 0||(s[i]=t=this.getValue(i))}else if((i=this.getIndex(e))>-1){n.set(e,i);let s=this[gt]||(this[gt]=new Array(this.size));(t=s[i])!==void 0||(s[i]=t=this.getValue(i))}}return t}set(e,t){if(e!=null){let n=this[bt]||(this[bt]=new Map),i=n.get(e);if(i===void 0&&n.set(e,i=this.getIndex(e)),i>-1){let s=this[gt]||(this[gt]=new Array(this.size));s[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[bt]||(this[bt]=new Map),i=this[gt]||(this[gt]=new Array(this.size));for(let s,a,o=0,d,h;!((d=e.next()).done||(h=t.next()).done);++o)s=d.value,a=h.value,i[o]=a,n.has(s)||n.set(s,o),yield[s,a]}forEach(e,t){let n=this.keys(),i=this.values(),s=t===void 0?e:(d,h,_)=>e.call(t,d,h,_),a=this[bt]||(this[bt]=new Map),o=this[gt]||(this[gt]=new Array(this.size));for(let d,h,_=0,F,U;!((F=n.next()).done||(U=i.next()).done);++_)d=F.value,h=U.value,o[_]=h,a.has(d)||a.set(d,_),s(h,d,this)}toArray(){return[...this.values()]}toJSON(){let e={};return this.forEach((t,n)=>e[n]=t),e}inspect(){return this.toString()}[ll](){return this.toString()}toString(){let e=[];return this.forEach((t,n)=>{n=r_.valueToString(n),t=r_.valueToString(t),e.push(`${n}: ${t}`)}),`{ ${e.join(", ")} }`}};pr[Symbol.toStringTag]=(r=>(Object.defineProperties(r,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[rt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Mi]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),r[Symbol.toStringTag]="Row"))(pr.prototype);var n_=class extends pr{constructor(e){super(e,e.length);return CS(this)}keys(){return this[rt].getChildAt(0)[Symbol.iterator]()}values(){return this[rt].getChildAt(1)[Symbol.iterator]()}getKey(e){return this[rt].getChildAt(0).get(e)}getIndex(e){return this[rt].getChildAt(0).indexOf(e)}getValue(e){return this[rt].getChildAt(1).get(e)}setValue(e,t){this[rt].getChildAt(1).set(e,t)}};Ui.MapRow=n_;var i_=class extends pr{constructor(e){super(e,e.type.children.length);return s_(this)}*keys(){for(let e of this[rt].type.children)yield e.name}*values(){for(let e of this[rt].type.children)yield this[e.name]}getKey(e){return this[rt].type.children[e].name}getIndex(e){return this[rt].type.children.findIndex(t=>t.name===e)}getValue(e){return this[rt].getChildAt(e).get(this[Mi])}setValue(e,t){return this[rt].getChildAt(e).set(this[Mi],t)}};Ui.StructRow=i_;Object.setPrototypeOf(pr.prototype,Map.prototype);var s_=(()=>{let r={enumerable:!0,configurable:!1,get:null,set:null};return e=>{let t=-1,n=e[bt]||(e[bt]=new Map),i=a=>function(){return this.get(a)},s=a=>function(o){return this.set(a,o)};for(let a of e.keys())n.set(a,++t),r.get=i(a),r.set=s(a),Object.prototype.hasOwnProperty.call(e,a)||(r.enumerable=!0,Object.defineProperty(e,a,r)),Object.prototype.hasOwnProperty.call(e,t)||(r.enumerable=!1,Object.defineProperty(e,t,r));return r.get=r.set=null,e}})(),CS=(()=>{if(typeof Proxy=="undefined")return s_;let r=pr.prototype.has,e=pr.prototype.get,t=pr.prototype.set,n=pr.prototype.getKey,i={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(s){return[...s.keys()].map(a=>`${a}`)},has(s,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 rt:case Mi:case gt:case bt:case ll:return!0}return typeof a=="number"&&!s.has(a)&&(a=s.getKey(a)),s.has(a)},get(s,a,o){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 rt:case Mi:case gt:case bt:case ll:return Reflect.get(s,a,o)}return typeof a=="number"&&!r.call(o,a)&&(a=n.call(o,a)),e.call(o,a)},set(s,a,o,d){switch(a){case rt:case Mi:case gt:case bt:return Reflect.set(s,a,o,d);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(d,a)&&(a=n.call(d,a)),r.call(d,a)?!!t.call(d,a,o):!1}};return s=>new Proxy(s,i)})()});var Ls=v(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.createElementComparator=fn.clampRange=fn.clampIndex=void 0;var o_=Me(),a_=Vs(),jS=He(),c_=at();function qS(r,e,t){let n=r.length,i=e>-1?e:n+e%n;return t?t(r,i):i}fn.clampIndex=qS;var u_;function WS(r,e,t,n){let{length:i=0}=r,s=typeof e!="number"?0:e,a=typeof t!="number"?i:t;return s<0&&(s=(s%i+i)%i),a<0&&(a=(a%i+i)%i),a<s&&(u_=s,s=a,a=u_),a>i&&(a=i),n?n(r,s,a):[s,a]}fn.clampRange=WS;var zS=c_.BigIntAvailable?c_.BigInt(0):0,l_=r=>r!==r;function Ns(r){let e=typeof r;if(e!=="object"||r===null)return l_(r)?l_:e!=="bigint"?t=>t===r:t=>zS+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?jS.compareArrayLike(r,t):!1:r instanceof Map?YS(r):Array.isArray(r)?HS(r):r instanceof o_.Vector?GS(r):KS(r)}fn.createElementComparator=Ns;function HS(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=Ns(r[t]);return Oa(e)}function YS(r){let e=-1,t=[];return r.forEach(n=>t[++e]=Ns(n)),Oa(t)}function GS(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=Ns(r.get(t));return Oa(e)}function KS(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]=Ns(r[e[n]]);return Oa(t,e)}function Oa(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return $S(r,t);case Map:case a_.MapRow:case a_.StructRow:return d_(r,t,t.keys());case Object:case void 0:return d_(r,t,e||Object.keys(t))}return t instanceof o_.Vector?JS(r,t):!1}}function $S(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 JS(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 d_(r,e,t){let n=t[Symbol.iterator](),i=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),s=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),a=0,o=r.length,d=s.next(),h=n.next(),_=i.next();for(;a<o&&!h.done&&!_.done&&!d.done&&!(h.value!==_.value||!r[a](d.value));++a,h=n.next(),_=i.next(),d=s.next());return a===o&&h.done&&_.done&&d.done?!0:(n.return&&n.return(),i.return&&i.return(),s.return&&s.return(),!1)}});var Yn=v(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.selectColumnChildrenArgs=Qe.selectVectorChildrenArgs=Qe.selectChunkArgs=Qe.selectFieldArgs=Qe.selectColumnArgs=Qe.selectArgs=Qe.arrayTypeToDataType=Qe.isTypedArray=void 0;var dl=Gt(),f_=Je(),Pr=ki(),Pi=Me(),kt=ce(),QS=pn(),hn=Array.isArray;function fl(r){return ArrayBuffer.isView(r)&&"BYTES_PER_ELEMENT"in r}Qe.isTypedArray=fl;function h_(r){switch(r){case Int8Array:return kt.Int8;case Int16Array:return kt.Int16;case Int32Array:return kt.Int32;case BigInt64Array:return kt.Int64;case Uint8Array:return kt.Uint8;case Uint16Array:return kt.Uint16;case Uint32Array:return kt.Uint32;case BigUint64Array:return kt.Uint64;case Float32Array:return kt.Float32;case Float64Array:return kt.Float64;default:return null}}Qe.arrayTypeToDataType=h_;function ZS(r){let e=h_(r.constructor);if(!e)throw new TypeError("Unrecognized Array input");let t=new e,n=dl.Data.new(t,0,r.length,0,[void 0,r]);return Pi.Vector.new(n)}Qe.selectArgs=(r,e)=>Ea(r,e,[],0);Qe.selectColumnArgs=r=>{let[e,t]=pl(r,[[],[]]);return t.map((n,i)=>n instanceof Pr.Column?Pr.Column.new(n.field.clone(e[i]),n):n instanceof Pi.Vector?Pr.Column.new(e[i],n):fl(n)?Pr.Column.new(e[i],ZS(n)):Pr.Column.new(e[i],[]))};Qe.selectFieldArgs=r=>pl(r,[[],[]]);Qe.selectChunkArgs=(r,e)=>hl(r,e,[],0);Qe.selectVectorChildrenArgs=(r,e)=>p_(r,e,[],0);Qe.selectColumnChildrenArgs=(r,e)=>y_(r,e,[],0);function Ea(r,e,t,n){let i,s=n,a=-1,o=e.length;for(;++a<o;)hn(i=e[a])?s=Ea(r,i,t,s).length:i instanceof r&&(t[s++]=i);return t}function hl(r,e,t,n){let i,s=n,a=-1,o=e.length;for(;++a<o;)hn(i=e[a])?s=hl(r,i,t,s).length:i instanceof QS.Chunked?s=hl(r,i.chunks,t,s).length:i instanceof r&&(t[s++]=i);return t}function p_(r,e,t,n){let i,s=n,a=-1,o=e.length;for(;++a<o;)hn(i=e[a])?s=p_(r,i,t,s).length:i instanceof r?s=Ea(Pi.Vector,i.schema.fields.map((d,h)=>i.getChildAt(h)),t,s).length:i instanceof Pi.Vector&&(t[s++]=i);return t}function y_(r,e,t,n){let i,s=n,a=-1,o=e.length;for(;++a<o;)hn(i=e[a])?s=y_(r,i,t,s).length:i instanceof r?s=Ea(Pr.Column,i.schema.fields.map((d,h)=>Pr.Column.new(d,i.getChildAt(h))),t,s).length:i instanceof Pr.Column&&(t[s++]=i);return t}var XS=(r,[e,t],n)=>(r[0][n]=e,r[1][n]=t,r);function pl(r,e){let t,n;switch(n=r.length){case 0:return e;case 1:if(t=e[0],!r[0])return e;if(hn(r[0]))return pl(r[0],e);r[0]instanceof dl.Data||r[0]instanceof Pi.Vector||fl(r[0])||r[0]instanceof kt.DataType||([t,r]=Object.entries(r[0]).reduce(XS,e));break;default:hn(t=r[n-1])?r=hn(r[0])?r[0]:r.slice(0,n-1):(r=hn(r[0])?r[0]:r,t=[])}let i=-1,s=-1,a=-1,o=r.length,d,h,[_,F]=e;for(;++a<o;)h=r[a],h instanceof Pr.Column&&(F[++s]=h)?_[++i]=h.field.clone(t[a],h.type,!0):({[a]:d=a}=t,h instanceof kt.DataType&&(F[++s]=h)?_[++i]=f_.Field.new(d,h,!0):(h==null?void 0:h.type)&&(F[++s]=h)&&(h instanceof dl.Data&&(F[s]=h=Pi.Vector.new(h)),_[++i]=f_.Field.new(d,h.type,!0)));return e}});var pn=v(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.Chunked=void 0;var eB=Ls(),__=ce(),tB=Yn(),m_=Me(),b_=class{constructor(e){this.chunks=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator()}next(){for(;this.chunkIndex<this.chunks.length;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.chunks.length&&(this.chunkIterator=this.getChunkIterator())}return{done:!0,value:null}}getChunkIterator(){return this.chunks[this.chunkIndex][Symbol.iterator]()}[Symbol.iterator](){return this}},kr=class extends m_.AbstractVector{constructor(e,t=[],n=rB(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 tB.selectChunkArgs(m_.Vector,e)}static concat(...e){let t=kr.flatten(...e);return new kr(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(__.DataType.isDictionary(this._type)){if(!this._indices){let e=this._chunks;this._indices=e.length===1?e[0].indices:kr.concat(...e.map(t=>t.indices))}return this._indices}return null}get dictionary(){return __.DataType.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}[Symbol.iterator](){return new b_(this._chunks)}clone(e=this._chunks){return new kr(this._type,e)}concat(...e){return this.clone(kr.flatten(this,...e))}slice(e,t){return eB.clampRange(this,e,t,this._sliceInternal)}getChildAt(e){if(e<0||e>=this._numChildren)return null;let t=this._children||(this._children=[]),n,i,s;return(n=t[e])?n:(i=(this._type.children||[])[e])&&(s=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null),s.length>0)?t[e]=new kr(i.type,s):null}search(e,t){let n=e,i=this._chunkOffsets,s=i.length-1;if(n<0||n>=i[s])return null;if(s<=1)return t?t(this,0,n):[0,n];let a=0,o=0,d=0;do{if(a+1===s)return t?t(this,a,n-o):[a,n-o];d=a+(s-a)/2|0,n>=i[d]?a=d:s=d}while(n<i[s]&&n>=(o=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,s)=>n[i].set(s,t))}indexOf(e,t){return t&&typeof t=="number"?this.search(t,(n,i,s)=>this.indexOfInternal(n,i,s,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,s=new Array(t);for(let d=-1;++d<t;)i+=(s[d]=e[d].toArray()).length;n!==s[0].constructor&&(n=s[0].constructor);let a=new n(i),o=n===Array?iB:nB;for(let d=-1,h=0;++d<t;)h=o(s[d],a,h);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 s=t-1,a=e.length,o=n,d=0,h=-1;for(;++s<a;){if(~(h=e[s].indexOf(i,o)))return d+h;o=0,d+=e[s].length}return-1}_sliceInternal(e,t,n){let i=[],{chunks:s,_chunkOffsets:a}=e;for(let o=-1,d=s.length;++o<d;){let h=s[o],_=h.length,F=a[o];if(F>=n)break;if(t>=F+_)continue;if(F>=t&&F+_<=n){i.push(h);continue}let U=Math.max(0,t-F),re=Math.min(n-F,_);i.push(h.slice(U,re))}return e.clone(i)}};Da.Chunked=kr;function rB(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 nB=(r,e,t)=>(e.set(r,t),t+r.length),iB=(r,e,t)=>{let n=t;for(let i=-1,s=r.length;++i<s;)e[n++]=r[i];return n}});var ki=v(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.Column=void 0;var g_=Je(),v_=Me(),yl=pn(),Gn=class extends yl.Chunked{constructor(e,t=[],n){t=yl.Chunked.flatten(...t);super(e.type,t,n);if(this._field=e,t.length===1&&!(this instanceof _l))return new _l(e,t[0],this._chunkOffsets)}static new(...e){let[t,n,...i]=e;typeof t!="string"&&!(t instanceof g_.Field)&&(n=t,t="");let s=yl.Chunked.flatten(Array.isArray(n)?[...n,...i]:n instanceof v_.Vector?[n,...i]:[v_.Vector.new(n,...i)]);if(typeof t=="string"){let a=s[0].data.type;t=new g_.Field(t,a,!0)}else!t.nullable&&s.some(({nullCount:a})=>a>0)&&(t=t.clone({nullable:!0}));return new Gn(t,s)}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 Gn(this._field,e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t=this._children||(this._children=[]),n,i,s;return(n=t[e])?n:(i=(this.type.children||[])[e])&&(s=this._chunks.map(a=>a.getChildAt(e)).filter(a=>a!=null),s.length>0)?t[e]=new Gn(i,s):null}};Fa.Column=Gn;var _l=class extends Gn{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 T_=v(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.instance=Vi.TypeAssembler=void 0;var sB=Ar(),oB=sB.flatbuffers.Long,aB=tt(),L=Jr(),ml=class extends aB.Visitor{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return L.Null.startNull(t),L.Null.endNull(t)}visitInt(e,t){return L.Int.startInt(t),L.Int.addBitWidth(t,e.bitWidth),L.Int.addIsSigned(t,e.isSigned),L.Int.endInt(t)}visitFloat(e,t){return L.FloatingPoint.startFloatingPoint(t),L.FloatingPoint.addPrecision(t,e.precision),L.FloatingPoint.endFloatingPoint(t)}visitBinary(e,t){return L.Binary.startBinary(t),L.Binary.endBinary(t)}visitBool(e,t){return L.Bool.startBool(t),L.Bool.endBool(t)}visitUtf8(e,t){return L.Utf8.startUtf8(t),L.Utf8.endUtf8(t)}visitDecimal(e,t){return L.Decimal.startDecimal(t),L.Decimal.addScale(t,e.scale),L.Decimal.addPrecision(t,e.precision),L.Decimal.endDecimal(t)}visitDate(e,t){return L.Date.startDate(t),L.Date.addUnit(t,e.unit),L.Date.endDate(t)}visitTime(e,t){return L.Time.startTime(t),L.Time.addUnit(t,e.unit),L.Time.addBitWidth(t,e.bitWidth),L.Time.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return L.Timestamp.startTimestamp(t),L.Timestamp.addUnit(t,e.unit),n!==void 0&&L.Timestamp.addTimezone(t,n),L.Timestamp.endTimestamp(t)}visitInterval(e,t){return L.Interval.startInterval(t),L.Interval.addUnit(t,e.unit),L.Interval.endInterval(t)}visitList(e,t){return L.List.startList(t),L.List.endList(t)}visitStruct(e,t){return L.Struct_.startStruct_(t),L.Struct_.endStruct_(t)}visitUnion(e,t){L.Union.startTypeIdsVector(t,e.typeIds.length);let n=L.Union.createTypeIdsVector(t,e.typeIds);return L.Union.startUnion(t),L.Union.addMode(t,e.mode),L.Union.addTypeIds(t,n),L.Union.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return L.DictionaryEncoding.startDictionaryEncoding(t),L.DictionaryEncoding.addId(t,new oB(e.id,0)),L.DictionaryEncoding.addIsOrdered(t,e.isOrdered),n!==void 0&&L.DictionaryEncoding.addIndexType(t,n),L.DictionaryEncoding.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return L.FixedSizeBinary.startFixedSizeBinary(t),L.FixedSizeBinary.addByteWidth(t,e.byteWidth),L.FixedSizeBinary.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return L.FixedSizeList.startFixedSizeList(t),L.FixedSizeList.addListSize(t,e.listSize),L.FixedSizeList.endFixedSizeList(t)}visitMap(e,t){return L.Map.startMap(t),L.Map.addKeysSorted(t,e.keysSorted),L.Map.endMap(t)}};Vi.TypeAssembler=ml;Vi.instance=new ml});var E_=v(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.fieldFromJSON=yr.dictionaryBatchFromJSON=yr.recordBatchFromJSON=yr.schemaFromJSON=void 0;var Ni=Je(),Te=ce(),Kn=$n(),Li=pe();function cB(r,e=new Map){return new Ni.Schema(lB(r,e),Ra(r.customMetadata),e)}yr.schemaFromJSON=cB;function I_(r){return new Kn.RecordBatch(r.count,S_(r.columns),B_(r.columns))}yr.recordBatchFromJSON=I_;function uB(r){return new Kn.DictionaryBatch(I_(r.data),r.id,r.isDelta)}yr.dictionaryBatchFromJSON=uB;function lB(r,e){return(r.fields||[]).filter(Boolean).map(t=>Ni.Field.fromJSON(t,e))}function w_(r,e){return(r.children||[]).filter(Boolean).map(t=>Ni.Field.fromJSON(t,e))}function S_(r){return(r||[]).reduce((e,t)=>[...e,new Kn.FieldNode(t.count,dB(t.VALIDITY)),...S_(t.children)],[])}function B_(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let i=r[t];i.VALIDITY&&e.push(new Kn.BufferRegion(e.length,i.VALIDITY.length)),i.TYPE&&e.push(new Kn.BufferRegion(e.length,i.TYPE.length)),i.OFFSET&&e.push(new Kn.BufferRegion(e.length,i.OFFSET.length)),i.DATA&&e.push(new Kn.BufferRegion(e.length,i.DATA.length)),e=B_(i.children,e)}return e}function dB(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function fB(r,e){let t,n,i,s,a,o;return!e||!(s=r.dictionary)?(a=O_(r,w_(r,e)),i=new Ni.Field(r.name,a,r.nullable,Ra(r.customMetadata))):e.has(t=s.id)?(n=(n=s.indexType)?A_(n):new Te.Int32,o=new Te.Dictionary(e.get(t),n,t,s.isOrdered),i=new Ni.Field(r.name,o,r.nullable,Ra(r.customMetadata))):(n=(n=s.indexType)?A_(n):new Te.Int32,e.set(t,a=O_(r,w_(r,e))),o=new Te.Dictionary(a,n,t,s.isOrdered),i=new Ni.Field(r.name,o,r.nullable,Ra(r.customMetadata))),i||null}yr.fieldFromJSON=fB;function Ra(r){return new Map(Object.entries(r||{}))}function A_(r){return new Te.Int(r.isSigned,r.bitWidth)}function O_(r,e){let t=r.type.name;switch(t){case"NONE":return new Te.Null;case"null":return new Te.Null;case"binary":return new Te.Binary;case"utf8":return new Te.Utf8;case"bool":return new Te.Bool;case"list":return new Te.List((e||[])[0]);case"struct":return new Te.Struct(e||[]);case"struct_":return new Te.Struct(e||[])}switch(t){case"int":{let n=r.type;return new Te.Int(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new Te.Float(Li.Precision[n.precision])}case"decimal":{let n=r.type;return new Te.Decimal(n.scale,n.precision)}case"date":{let n=r.type;return new Te.Date_(Li.DateUnit[n.unit])}case"time":{let n=r.type;return new Te.Time(Li.TimeUnit[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new Te.Timestamp(Li.TimeUnit[n.unit],n.timezone)}case"interval":{let n=r.type;return new Te.Interval(Li.IntervalUnit[n.unit])}case"union":{let n=r.type;return new Te.Union(Li.UnionMode[n.mode],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new Te.FixedSizeBinary(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new Te.FixedSizeList(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new Te.Map_((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}});var $n=v(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.FieldNode=Nt.BufferRegion=Nt.DictionaryBatch=Nt.RecordBatch=Nt.Message=void 0;var bl=Ar(),N=Jr(),we=ko(),Ze=Je(),hB=He(),Ee=pe(),gl=T_(),Ma=E_(),Jn=bl.flatbuffers.Long,pB=bl.flatbuffers.Builder,yB=bl.flatbuffers.ByteBuffer,Ie=ce(),yn=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 yn(0,Ee.MetadataVersion.V4,t);return n._createHeader=_B(e,t),n}static decode(e){e=new yB(hB.toUint8Array(e));let t=we.Message.getRootAsMessage(e),n=t.bodyLength(),i=t.version(),s=t.headerType(),a=new yn(n,i,s);return a._createHeader=mB(t,s),a}static encode(e){let t=new pB,n=-1;return e.isSchema()?n=Ze.Schema.encode(t,e.header()):e.isRecordBatch()?n=Vt.encode(t,e.header()):e.isDictionaryBatch()&&(n=_r.encode(t,e.header())),we.Message.startMessage(t),we.Message.addVersion(t,Ee.MetadataVersion.V4),we.Message.addHeader(t,n),we.Message.addHeaderType(t,e.headerType),we.Message.addBodyLength(t,new Jn(e.bodyLength,0)),we.Message.finishMessageBuffer(t,we.Message.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof Ze.Schema)return new yn(0,Ee.MetadataVersion.V4,Ee.MessageHeader.Schema,e);if(e instanceof Vt)return new yn(t,Ee.MetadataVersion.V4,Ee.MessageHeader.RecordBatch,e);if(e instanceof _r)return new yn(t,Ee.MetadataVersion.V4,Ee.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===Ee.MessageHeader.Schema}isRecordBatch(){return this.headerType===Ee.MessageHeader.RecordBatch}isDictionaryBatch(){return this.headerType===Ee.MessageHeader.DictionaryBatch}};Nt.Message=yn;var Vt=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}};Nt.RecordBatch=Vt;var _r=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}};Nt.DictionaryBatch=_r;var Qn=class{constructor(e,t){this.offset=typeof e=="number"?e:e.low,this.length=typeof t=="number"?t:t.low}};Nt.BufferRegion=Qn;var Zn=class{constructor(e,t){this.length=typeof e=="number"?e:e.low,this.nullCount=typeof t=="number"?t:t.low}};Nt.FieldNode=Zn;function _B(r,e){return()=>{switch(e){case Ee.MessageHeader.Schema:return Ze.Schema.fromJSON(r);case Ee.MessageHeader.RecordBatch:return Vt.fromJSON(r);case Ee.MessageHeader.DictionaryBatch:return _r.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${Ee.MessageHeader[e]}, type: ${e} }`)}}function mB(r,e){return()=>{switch(e){case Ee.MessageHeader.Schema:return Ze.Schema.decode(r.header(new N.Schema));case Ee.MessageHeader.RecordBatch:return Vt.decode(r.header(new we.RecordBatch),r.version());case Ee.MessageHeader.DictionaryBatch:return _r.decode(r.header(new we.DictionaryBatch),r.version())}throw new Error(`Unrecognized Message type: { name: ${Ee.MessageHeader[e]}, type: ${e} }`)}}Ze.Field.encode=EB;Ze.Field.decode=AB;Ze.Field.fromJSON=Ma.fieldFromJSON;Ze.Schema.encode=OB;Ze.Schema.decode=bB;Ze.Schema.fromJSON=Ma.schemaFromJSON;Vt.encode=DB;Vt.decode=gB;Vt.fromJSON=Ma.recordBatchFromJSON;_r.encode=FB;_r.decode=vB;_r.fromJSON=Ma.dictionaryBatchFromJSON;Zn.encode=RB;Zn.decode=IB;Qn.encode=MB;Qn.decode=TB;function bB(r,e=new Map){let t=BB(r,e);return new Ze.Schema(t,Ua(r),e)}function gB(r,e=Ee.MetadataVersion.V4){return new Vt(r.length(),wB(r),SB(r,e))}function vB(r,e=Ee.MetadataVersion.V4){return new _r(Vt.decode(r.data(),e),r.id(),r.isDelta())}function TB(r){return new Qn(r.offset(),r.length())}function IB(r){return new Zn(r.length(),r.nullCount())}function wB(r){let e=[];for(let t,n=-1,i=-1,s=r.nodesLength();++n<s;)(t=r.nodes(n))&&(e[++i]=Zn.decode(t));return e}function SB(r,e){let t=[];for(let n,i=-1,s=-1,a=r.buffersLength();++i<a;)(n=r.buffers(i))&&(e<Ee.MetadataVersion.V4&&(n.bb_pos+=8*(i+1)),t[++s]=Qn.decode(n));return t}function BB(r,e){let t=[];for(let n,i=-1,s=-1,a=r.fieldsLength();++i<a;)(n=r.fields(i))&&(t[++s]=Ze.Field.decode(n,e));return t}function D_(r,e){let t=[];for(let n,i=-1,s=-1,a=r.childrenLength();++i<a;)(n=r.children(i))&&(t[++s]=Ze.Field.decode(n,e));return t}function AB(r,e){let t,n,i,s,a,o;return!e||!(o=r.dictionary())?(i=R_(r,D_(r,e)),n=new Ze.Field(r.name(),i,r.nullable(),Ua(r))):e.has(t=o.id().low)?(s=(s=o.indexType())?F_(s):new Ie.Int32,a=new Ie.Dictionary(e.get(t),s,t,o.isOrdered()),n=new Ze.Field(r.name(),a,r.nullable(),Ua(r))):(s=(s=o.indexType())?F_(s):new Ie.Int32,e.set(t,i=R_(r,D_(r,e))),a=new Ie.Dictionary(i,s,t,o.isOrdered()),n=new Ze.Field(r.name(),a,r.nullable(),Ua(r))),n||null}function Ua(r){let e=new Map;if(r)for(let t,n,i=-1,s=r.customMetadataLength()|0;++i<s;)(t=r.customMetadata(i))&&(n=t.key())!=null&&e.set(n,t.value());return e}function F_(r){return new Ie.Int(r.isSigned(),r.bitWidth())}function R_(r,e){let t=r.typeType();switch(t){case N.Type.NONE:return new Ie.Null;case N.Type.Null:return new Ie.Null;case N.Type.Binary:return new Ie.Binary;case N.Type.Utf8:return new Ie.Utf8;case N.Type.Bool:return new Ie.Bool;case N.Type.List:return new Ie.List((e||[])[0]);case N.Type.Struct_:return new Ie.Struct(e||[])}switch(t){case N.Type.Int:{let n=r.type(new N.Int);return new Ie.Int(n.isSigned(),n.bitWidth())}case N.Type.FloatingPoint:{let n=r.type(new N.FloatingPoint);return new Ie.Float(n.precision())}case N.Type.Decimal:{let n=r.type(new N.Decimal);return new Ie.Decimal(n.scale(),n.precision())}case N.Type.Date:{let n=r.type(new N.Date);return new Ie.Date_(n.unit())}case N.Type.Time:{let n=r.type(new N.Time);return new Ie.Time(n.unit(),n.bitWidth())}case N.Type.Timestamp:{let n=r.type(new N.Timestamp);return new Ie.Timestamp(n.unit(),n.timezone())}case N.Type.Interval:{let n=r.type(new N.Interval);return new Ie.Interval(n.unit())}case N.Type.Union:{let n=r.type(new N.Union);return new Ie.Union(n.mode(),n.typeIdsArray()||[],e||[])}case N.Type.FixedSizeBinary:{let n=r.type(new N.FixedSizeBinary);return new Ie.FixedSizeBinary(n.byteWidth())}case N.Type.FixedSizeList:{let n=r.type(new N.FixedSizeList);return new Ie.FixedSizeList(n.listSize(),(e||[])[0])}case N.Type.Map:{let n=r.type(new N.Map);return new Ie.Map_((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${N.Type[t]}" (${t})`)}function OB(r,e){let t=e.fields.map(s=>Ze.Field.encode(r,s));N.Schema.startFieldsVector(r,t.length);let n=N.Schema.createFieldsVector(r,t),i=e.metadata&&e.metadata.size>0?N.Schema.createCustomMetadataVector(r,[...e.metadata].map(([s,a])=>{let o=r.createString(`${s}`),d=r.createString(`${a}`);return N.KeyValue.startKeyValue(r),N.KeyValue.addKey(r,o),N.KeyValue.addValue(r,d),N.KeyValue.endKeyValue(r)})):-1;return N.Schema.startSchema(r),N.Schema.addFields(r,n),N.Schema.addEndianness(r,UB?N.Endianness.Little:N.Endianness.Big),i!==-1&&N.Schema.addCustomMetadata(r,i),N.Schema.endSchema(r)}function EB(r,e){let t=-1,n=-1,i=-1,s=e.type,a=e.typeId;Ie.DataType.isDictionary(s)?(a=s.dictionary.typeId,i=gl.instance.visit(s,r),n=gl.instance.visit(s.dictionary,r)):n=gl.instance.visit(s,r);let o=(s.children||[]).map(_=>Ze.Field.encode(r,_)),d=N.Field.createChildrenVector(r,o),h=e.metadata&&e.metadata.size>0?N.Field.createCustomMetadataVector(r,[...e.metadata].map(([_,F])=>{let U=r.createString(`${_}`),re=r.createString(`${F}`);return N.KeyValue.startKeyValue(r),N.KeyValue.addKey(r,U),N.KeyValue.addValue(r,re),N.KeyValue.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),N.Field.startField(r),N.Field.addType(r,n),N.Field.addTypeType(r,a),N.Field.addChildren(r,d),N.Field.addNullable(r,!!e.nullable),t!==-1&&N.Field.addName(r,t),i!==-1&&N.Field.addDictionary(r,i),h!==-1&&N.Field.addCustomMetadata(r,h),N.Field.endField(r)}function DB(r,e){let t=e.nodes||[],n=e.buffers||[];we.RecordBatch.startNodesVector(r,t.length),t.slice().reverse().forEach(a=>Zn.encode(r,a));let i=r.endVector();we.RecordBatch.startBuffersVector(r,n.length),n.slice().reverse().forEach(a=>Qn.encode(r,a));let s=r.endVector();return we.RecordBatch.startRecordBatch(r),we.RecordBatch.addLength(r,new Jn(e.length,0)),we.RecordBatch.addNodes(r,i),we.RecordBatch.addBuffers(r,s),we.RecordBatch.endRecordBatch(r)}function FB(r,e){let t=Vt.encode(r,e.data);return we.DictionaryBatch.startDictionaryBatch(r),we.DictionaryBatch.addId(r,new Jn(e.id,0)),we.DictionaryBatch.addIsDelta(r,e.isDelta),we.DictionaryBatch.addData(r,t),we.DictionaryBatch.endDictionaryBatch(r)}function RB(r,e){return we.FieldNode.createFieldNode(r,new Jn(e.length,0),new Jn(e.nullCount,0))}function MB(r,e){return N.Buffer.createBuffer(r,new Jn(e.offset,0),new Jn(e.length,0))}var UB=function(){let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256}()});var ka=v(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.magicX2AndPadding=ie.magicAndPadding=ie.magicLength=ie.checkForMagicArrowString=ie.MAGIC=ie.MAGIC_STR=ie.PADDING=ie.JSONMessageReader=ie.AsyncMessageReader=ie.MessageReader=void 0;var _n=ot(),mn=pe(),PB=Ar(),M_=PB.flatbuffers.ByteBuffer,xs=$n(),kB=at(),VB=ol(),U_=He(),Pa=ln(),Qt=ci(),vl=r=>`Expected ${mn.MessageHeader[r]} Message in stream, but was null or length 0.`,Tl=r=>`Header pointer of flatbuffer-encoded ${mn.MessageHeader[r]} Message is null or length 0.`,P_=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,k_=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,Il=class{constructor(e){this.source=e instanceof Pa.ByteStream?e:new Pa.ByteStream(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?Qt.ITERATOR_DONE:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(vl(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=U_.toUint8Array(this.source.read(e));if(t.byteLength<e)throw new Error(k_(e,t.byteLength));return t.byteOffset%8==0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=mn.MessageHeader.Schema,n=this.readMessage(t),i=n==null?void 0:n.header();if(e&&!i)throw new Error(Tl(t));return i}readMetadataLength(){let e=this.source.read(ie.PADDING),t=e&&new M_(e),n=(t==null?void 0:t.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Qt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(P_(e,t.byteLength));return{done:!1,value:xs.Message.decode(t)}}};ie.MessageReader=Il;var V_=class{constructor(e,t){this.source=e instanceof Pa.AsyncByteStream?e:kB.isFileHandle(e)?new VB.AsyncRandomAccessFile(e,t):new Pa.AsyncByteStream(e)}[Symbol.asyncIterator](){return this}next(){return _n.__awaiter(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done||e.value===-1&&(e=yield this.readMetadataLength()).done||(e=yield this.readMetadata(e.value)).done?Qt.ITERATOR_DONE:e})}throw(e){return _n.__awaiter(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return _n.__awaiter(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return _n.__awaiter(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(vl(e));return t.value})}readMessageBody(e){return _n.__awaiter(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=U_.toUint8Array(yield this.source.read(e));if(t.byteLength<e)throw new Error(k_(e,t.byteLength));return t.byteOffset%8==0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(e=!1){return _n.__awaiter(this,void 0,void 0,function*(){let t=mn.MessageHeader.Schema,n=yield this.readMessage(t),i=n==null?void 0:n.header();if(e&&!i)throw new Error(Tl(t));return i})}readMetadataLength(){return _n.__awaiter(this,void 0,void 0,function*(){let e=yield this.source.read(ie.PADDING),t=e&&new M_(e),n=(t==null?void 0:t.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(e){return _n.__awaiter(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return Qt.ITERATOR_DONE;if(t.byteLength<e)throw new Error(P_(e,t.byteLength));return{done:!1,value:xs.Message.decode(t)}})}};ie.AsyncMessageReader=V_;var N_=class extends Il{constructor(e){super(new Uint8Array(0));this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Qt.ArrowJSON?e:new Qt.ArrowJSON(e)}next(){let{_json:e}=this;if(!this._schema){this._schema=!0;let t=xs.Message.fromJSON(e.schema,mn.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=xs.Message.fromJSON(t,mn.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=xs.Message.fromJSON(t,mn.MessageHeader.RecordBatch);return{done:!1,value:n}}return this._body=[],Qt.ITERATOR_DONE}readMessageBody(e){return t(this._body);function t(n){return(n||[]).reduce((i,s)=>[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE&&[s.TYPE]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...t(s.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(vl(e));return t.value}readSchema(){let e=mn.MessageHeader.Schema,t=this.readMessage(e),n=t==null?void 0:t.header();if(!t||!n)throw new Error(Tl(e));return n}};ie.JSONMessageReader=N_;ie.PADDING=4;ie.MAGIC_STR="ARROW1";ie.MAGIC=new Uint8Array(ie.MAGIC_STR.length);for(let r=0;r<ie.MAGIC_STR.length;r+=1|0)ie.MAGIC[r]=ie.MAGIC_STR.charCodeAt(r);function NB(r,e=0){for(let t=-1,n=ie.MAGIC.length;++t<n;)if(ie.MAGIC[t]!==r[e+t])return!1;return!0}ie.checkForMagicArrowString=NB;ie.magicLength=ie.MAGIC.length;ie.magicAndPadding=ie.magicLength+ie.PADDING;ie.magicX2AndPadding=ie.magicLength*2+ie.PADDING});var Al=v(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.compareTypes=De.compareFields=De.compareSchemas=De.instance=De.TypeComparator=void 0;var LB=tt(),j=class extends LB.Visitor{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,i)=>this.compareFields(n,t[i]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};De.TypeComparator=j;function yt(r,e){return e instanceof r.constructor}function Cs(r,e){return r===e||yt(r,e)}function Vr(r,e){return r===e||yt(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function Va(r,e){return r===e||yt(r,e)&&r.precision===e.precision}function xB(r,e){return r===e||yt(r,e)&&r.byteWidth===e.byteWidth}function wl(r,e){return r===e||yt(r,e)&&r.unit===e.unit}function js(r,e){return r===e||yt(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function qs(r,e){return r===e||yt(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function CB(r,e){return r===e||yt(r,e)&&r.children.length===e.children.length&&De.instance.compareManyFields(r.children,e.children)}function jB(r,e){return r===e||yt(r,e)&&r.children.length===e.children.length&&De.instance.compareManyFields(r.children,e.children)}function Sl(r,e){return r===e||yt(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&De.instance.compareManyFields(r.children,e.children)}function qB(r,e){return r===e||yt(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&De.instance.visit(r.indices,e.indices)&&De.instance.visit(r.dictionary,e.dictionary)}function Bl(r,e){return r===e||yt(r,e)&&r.unit===e.unit}function WB(r,e){return r===e||yt(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&De.instance.compareManyFields(r.children,e.children)}function zB(r,e){return r===e||yt(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&De.instance.compareManyFields(r.children,e.children)}j.prototype.visitNull=Cs;j.prototype.visitBool=Cs;j.prototype.visitInt=Vr;j.prototype.visitInt8=Vr;j.prototype.visitInt16=Vr;j.prototype.visitInt32=Vr;j.prototype.visitInt64=Vr;j.prototype.visitUint8=Vr;j.prototype.visitUint16=Vr;j.prototype.visitUint32=Vr;j.prototype.visitUint64=Vr;j.prototype.visitFloat=Va;j.prototype.visitFloat16=Va;j.prototype.visitFloat32=Va;j.prototype.visitFloat64=Va;j.prototype.visitUtf8=Cs;j.prototype.visitBinary=Cs;j.prototype.visitFixedSizeBinary=xB;j.prototype.visitDate=wl;j.prototype.visitDateDay=wl;j.prototype.visitDateMillisecond=wl;j.prototype.visitTimestamp=js;j.prototype.visitTimestampSecond=js;j.prototype.visitTimestampMillisecond=js;j.prototype.visitTimestampMicrosecond=js;j.prototype.visitTimestampNanosecond=js;j.prototype.visitTime=qs;j.prototype.visitTimeSecond=qs;j.prototype.visitTimeMillisecond=qs;j.prototype.visitTimeMicrosecond=qs;j.prototype.visitTimeNanosecond=qs;j.prototype.visitDecimal=Cs;j.prototype.visitList=CB;j.prototype.visitStruct=jB;j.prototype.visitUnion=Sl;j.prototype.visitDenseUnion=Sl;j.prototype.visitSparseUnion=Sl;j.prototype.visitDictionary=qB;j.prototype.visitInterval=Bl;j.prototype.visitIntervalDayTime=Bl;j.prototype.visitIntervalYearMonth=Bl;j.prototype.visitFixedSizeList=WB;j.prototype.visitMap=zB;De.instance=new j;function HB(r,e){return De.instance.compareSchemas(r,e)}De.compareSchemas=HB;function YB(r,e){return De.instance.compareFields(r,e)}De.compareFields=YB;function GB(r,e){return De.instance.visit(r,e)}De.compareTypes=GB});var q_=v(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.VectorAssembler=void 0;var KB=tt(),L_=pe(),$B=Nr(),Ol=He(),El=cr(),JB=Yn(),x_=$n(),C_=ce(),je=class extends KB.Visitor{constructor(){super();this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...e){let t=new je,n=JB.selectVectorChildrenArgs($B.RecordBatch,e),[i=t]=t.visitMany(n);return i}visit(e){if(!C_.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");C_.DataType.isNull(e.type)||Zt.call(this,i<=0?new Uint8Array(0):El.truncateBitmap(t.offset,n,t.nullBitmap)),this.nodes.push(new x_.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}};Na.VectorAssembler=je;function Zt(r){let e=r.byteLength+7&~7;return this.buffers.push(r),this.bufferRegions.push(new x_.BufferRegion(this._byteLength,e)),this._byteLength+=e,this}function QB(r){let{type:e,length:t,typeIds:n,valueOffsets:i}=r;if(Zt.call(this,n),e.mode===L_.UnionMode.Sparse)return Fl.call(this,r);if(e.mode===L_.UnionMode.Dense){if(r.offset<=0)return Zt.call(this,i),Fl.call(this,r);{let s=n.reduce((_,F)=>Math.max(_,F),n[0]),a=new Int32Array(s+1),o=new Int32Array(s+1).fill(-1),d=new Int32Array(t),h=Ol.rebaseValueOffsets(-i[0],t,i);for(let _,F,U=-1;++U<t;)(F=o[_=n[U]])===-1&&(F=o[_]=h[_]),d[U]=h[U]-F,++a[_];Zt.call(this,d);for(let _,F=-1,U=e.children.length;++F<U;)if(_=r.getChildAt(F)){let re=e.typeIds[F],_e=Math.min(t,a[re]);this.visit(_.slice(o[re],_e))}}}return this}function ZB(r){let e;return r.nullCount>=r.length?Zt.call(this,new Uint8Array(0)):(e=r.values)instanceof Uint8Array?Zt.call(this,El.truncateBitmap(r.offset,r.length,e)):Zt.call(this,El.packBools(r))}function bn(r){return Zt.call(this,r.values.subarray(0,r.length*r.stride))}function j_(r){let{length:e,values:t,valueOffsets:n}=r,i=n[0],s=n[e],a=Math.min(s-i,t.byteLength-i);return Zt.call(this,Ol.rebaseValueOffsets(-n[0],e,n)),Zt.call(this,t.subarray(i,i+a)),this}function Dl(r){let{length:e,valueOffsets:t}=r;return t&&Zt.call(this,Ol.rebaseValueOffsets(t[0],e,t)),this.visit(r.getChildAt(0))}function Fl(r){return this.visitMany(r.type.children.map((e,t)=>r.getChildAt(t)).filter(Boolean))[0]}je.prototype.visitBool=ZB;je.prototype.visitInt=bn;je.prototype.visitFloat=bn;je.prototype.visitUtf8=j_;je.prototype.visitBinary=j_;je.prototype.visitFixedSizeBinary=bn;je.prototype.visitDate=bn;je.prototype.visitTimestamp=bn;je.prototype.visitTime=bn;je.prototype.visitDecimal=bn;je.prototype.visitList=Dl;je.prototype.visitStruct=Fl;je.prototype.visitUnion=QB;je.prototype.visitInterval=bn;je.prototype.visitFixedSizeList=Dl;je.prototype.visitMap=Dl});var z_=v(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.JSONTypeAssembler=void 0;var XB=tt(),nt=Jr(),xi=pe(),W_=class extends XB.Visitor{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:nt.Type[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:nt.Type[e].toLowerCase(),precision:xi.Precision[t]}}visitBinary({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitBool({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n}){return{name:nt.Type[e].toLowerCase(),scale:t,precision:n}}visitDate({typeId:e,unit:t}){return{name:nt.Type[e].toLowerCase(),unit:xi.DateUnit[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:nt.Type[e].toLowerCase(),unit:xi.TimeUnit[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:nt.Type[e].toLowerCase(),unit:xi.TimeUnit[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:nt.Type[e].toLowerCase(),unit:xi.IntervalUnit[t]}}visitList({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitStruct({typeId:e}){return{name:nt.Type[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:nt.Type[e].toLowerCase(),mode:xi.UnionMode[t],typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:nt.Type[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:nt.Type[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:nt.Type[e].toLowerCase(),keysSorted:t}}};La.JSONTypeAssembler=W_});var G_=v(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.JSONVectorAssembler=void 0;var e0=Fs(),Ws=ki(),t0=Me(),r0=tt(),n0=pe(),i0=Nr(),Rl=pe(),xa=cr(),s0=Yn(),H_=ce(),Ca=class extends r0.Visitor{static assemble(...e){return new Ca().visitMany(s0.selectColumnChildrenArgs(i0.RecordBatch,e))}visit(e){let{data:t,name:n,length:i}=e,{offset:s,nullCount:a,nullBitmap:o}=t,d=H_.DataType.isDictionary(e.type)?e.type.indices:e.type,h=Object.assign([],t.buffers,{[n0.BufferType.VALIDITY]:void 0});return Object.assign({name:n,count:i,VALIDITY:H_.DataType.isNull(d)?void 0:a<=0?Array.from({length:i},()=>1):[...new xa.BitIterator(o,s,i,null,xa.getBit)]},super.visit(t0.Vector.new(t.clone(d,s,i,0,h))))}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...new xa.BitIterator(e,t,n,null,xa.getBool)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...zs(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...e],OFFSET:[...e.valueOffsets]}}visitBinary(e){return{DATA:[...Y_(e)],OFFSET:[...e.valueOffsets]}}visitFixedSizeBinary(e){return{DATA:[...Y_(e)]}}visitDate(e){return{DATA:e.type.unit===Rl.DateUnit.DAY?[...e.values]:[...zs(e.values,2)]}}visitTimestamp(e){return{DATA:[...zs(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<Rl.TimeUnit.MICROSECOND?[...e.values]:[...zs(e.values,2)]}}visitDecimal(e){return{DATA:[...zs(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new Ws.Column(t,[e.getChildAt(n)])))}}visitStruct(e){return{children:e.type.children.map((t,n)=>this.visit(new Ws.Column(t,[e.getChildAt(n)])))}}visitUnion(e){return{TYPE:[...e.typeIds],OFFSET:e.type.mode===Rl.UnionMode.Dense?[...e.valueOffsets]:void 0,children:e.type.children.map((t,n)=>this.visit(new Ws.Column(t,[e.getChildAt(n)])))}}visitInterval(e){return{DATA:[...e.values]}}visitFixedSizeList(e){return{children:e.type.children.map((t,n)=>this.visit(new Ws.Column(t,[e.getChildAt(n)])))}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((t,n)=>this.visit(new Ws.Column(t,[e.getChildAt(n)])))}}};ja.JSONVectorAssembler=Ca;function*Y_(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*zs(r,e){for(let t=-1,n=r.length/e;++t<n;)yield`${e0.BN.new(r.subarray((t+0)*e,(t+1)*e),!1)}`}});var Ya=v(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.RecordBatchJSONWriter=br.RecordBatchFileWriter=br.RecordBatchStreamWriter=br.RecordBatchWriter=void 0;var K_=ot(),Ml=Ys(),o0=ka(),a0=ki(),c0=ce(),u0=Je(),qa=$n(),Ul=$n(),Ci=nl(),Pl=pe(),$_=Al(),kl=ln(),J_=q_(),l0=z_(),Q_=G_(),d0=He(),Vl=Nr(),f0=ci(),mr=at(),Hs=class extends f0.ReadableInterop{constructor(e){super();this._position=0,this._started=!1,this._sink=new kl.AsyncByteQueue,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,mr.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 mr.isPromise(e)?e.then(t=>this.writeAll(t)):mr.isAsyncIterable(e)?Ll(this,e):Nl(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 kl.AsyncByteQueue?this._sink=e:(this._sink=new kl.AsyncByteQueue,e&&mr.isWritableDOMStream(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&mr.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||!$_.compareSchemas(t,this._schema))&&(t===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof Ml.Table&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof Vl.RecordBatch&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!$_.compareSchemas(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Vl.RecordBatch?e instanceof Vl._InternalEmptyPlaceholderRecordBatch||this._writeRecordBatch(e):e instanceof Ml.Table?this.writeAll(e.chunks):mr.isIterable(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,i=qa.Message.encode(e),s=i.byteLength,a=this._writeLegacyIpcFormat?4:8,o=s+a+n&~n,d=o-s-a;return e.headerType===Pl.MessageHeader.RecordBatch?this._recordBatchBlocks.push(new Ci.FileBlock(o,e.bodyLength,this._position)):e.headerType===Pl.MessageHeader.DictionaryBatch&&this._dictionaryBlocks.push(new Ci.FileBlock(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-a)),s>0&&this._write(i),this._writePadding(d)}_write(e){if(this._started){let t=d0.toUint8Array(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(qa.Message.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(o0.MAGIC)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:i,buffers:s}=J_.VectorAssembler.assemble(e),a=new Ul.RecordBatch(e.length,n,i),o=qa.Message.from(a,t);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(s)}_writeDictionaryBatch(e,t,n=!1){this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0));let{byteLength:i,nodes:s,bufferRegions:a,buffers:o}=J_.VectorAssembler.assemble(e),d=new Ul.RecordBatch(e.length,s,a),h=new Ul.DictionaryBatch(d,t,n),_=qa.Message.from(h,i);return this._writeMessage(_)._writeBodyBuffers(o)}_writeBodyBuffers(e){let t,n,i;for(let s=-1,a=e.length;++s<a;)(t=e[s])&&(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 s="chunks"in n?n.chunks:[n];for(let a of s)this._writeDictionaryBatch(a,t,i>0),i+=a.length}}return this}};br.RecordBatchWriter=Hs;var Wa=class extends Hs{static writeAll(e,t){let n=new Wa(t);return mr.isPromise(e)?e.then(i=>n.writeAll(i)):mr.isAsyncIterable(e)?Ll(n,e):Nl(n,e)}};br.RecordBatchStreamWriter=Wa;var za=class extends Hs{static writeAll(e){let t=new za;return mr.isPromise(e)?e.then(n=>t.writeAll(n)):mr.isAsyncIterable(e)?Ll(t,e):Nl(t,e)}constructor(){super();this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeFooter(e){let t=Ci.Footer.encode(new Ci.Footer(e,Pl.MetadataVersion.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};br.RecordBatchFileWriter=za;var Ha=class extends Hs{constructor(){super();this._autoDestroy=!0,this._recordBatches=[],this._dictionaries=[]}static writeAll(e){return new Ha().writeAll(e)}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
8
|
+
"schema": ${JSON.stringify({fields:e.fields.map(Z_)},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(`${h0(e,t,n)}`),this._dictionaryBlocks.push(new Ci.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
10
|
"dictionaries": [
|
|
11
11
|
`);for(let e of this._dictionaries)super._writeDictionaries(e);this._write(`
|
|
12
12
|
]`)}if(this._recordBatches.length>0){for(let e=-1,t=this._recordBatches.length;++e<t;)this._write(e===0?`,
|
|
13
13
|
"batches": [
|
|
14
14
|
`:`,
|
|
15
|
-
`),this._write(`${
|
|
15
|
+
`),this._write(`${p0(this._recordBatches[e])}`),this._recordBatchBlocks.push(new Ci.FileBlock(0,0,0));this._write(`
|
|
16
16
|
]`)}return this._schema&&this._write(`
|
|
17
|
-
}`),this._dictionaries=[],this._recordBatches=[],super.close()}};gr.RecordBatchJSONWriter=Wa;function Vl(r,e){let t=e;e instanceof Rl.Table&&(t=e.chunks,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}function Nl(r,e){var t,n,i,s;return H_.__awaiter(this,void 0,void 0,function*(){try{for(t=H_.__asyncValues(e);n=yield t.next(),!n.done;){let a=n.value;r.write(a)}}catch(a){i={error:a}}finally{try{n&&!n.done&&(s=t.return)&&(yield s.call(t))}finally{if(i)throw i.error}}return r.finish()})}function $_({name:r,type:e,nullable:t}){let n=new o0.JSONTypeAssembler;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map($_),dictionary:i0.DataType.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function u0(r,e,t=!1){let n=new s0.Field(`${e}`,r.type,r.nullCount>0),i=K_.JSONVectorAssembler.assemble(new n0.Column(n,[r]));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:i}},null,2)}function l0(r){return JSON.stringify({count:r.length,columns:K_.JSONVectorAssembler.assemble(r)},null,2)}});var Cl=v(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.distributeVectorsIntoRecordBatches=gn.distributeColumnsIntoRecordBatches=gn.ensureSameLengthData=void 0;var J_=Gt(),Ll=Je(),d0=pn(),f0=Nr(),xl=new Uint8Array(0),Q_=r=>[xl,xl,new Uint8Array(r),xl];function h0(r,e,t=e.reduce((n,i)=>Math.max(n,i.length),0)){let n,i,s=-1,a=e.length,o=[...r.fields],d=[],h=(t+63&~63)>>3;for(;++s<a;)(n=e[s])&&n.length===t?d[s]=n:((i=o[s]).nullable||(o[s]=o[s].clone({nullable:!0})),d[s]=n?n._changeLengthAndBackfillNullBitmap(t):J_.Data.new(i.type,0,t,t,Q_(h)));return[new Ll.Schema(o),t,d]}gn.ensureSameLengthData=h0;function p0(r){return Z_(new Ll.Schema(r.map(({field:e})=>e)),r)}gn.distributeColumnsIntoRecordBatches=p0;function Z_(r,e){return y0(r,e.map(t=>t instanceof d0.Chunked?t.chunks.map(n=>n.data):[t.data]))}gn.distributeVectorsIntoRecordBatches=Z_;function y0(r,e){let t=[...r.fields],n=[],i={numBatches:e.reduce((F,U)=>Math.max(F,U.length),0)},s=0,a=0,o=-1,d=e.length,h,_=[];for(;i.numBatches-- >0;){for(a=Number.POSITIVE_INFINITY,o=-1;++o<d;)_[o]=h=e[o].shift(),a=Math.min(a,h?h.length:a);isFinite(a)&&(_=_0(t,a,_,e,i),a>0&&(n[s++]=[a,_.slice()]))}return[r=new Ll.Schema(t,r.metadata),n.map(F=>new f0.RecordBatch(r,...F))]}function _0(r,e,t,n,i){let s,a,o=0,d=-1,h=n.length,_=(e+63&~63)>>3;for(;++d<h;)(s=t[d])&&(o=s.length)>=e?o===e?t[d]=s:(t[d]=s.slice(0,e),s=s.slice(e,o-e),i.numBatches=Math.max(i.numBatches,n[d].unshift(s))):((a=r[d]).nullable||(r[d]=a.clone({nullable:!0})),t[d]=s?s._changeLengthAndBackfillNullBitmap(e):J_.Data.new(a.type,0,e,e,Q_(_)));return t}});var Pe=v(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.BaseVector=void 0;var m0=pe(),b0=pn(),g0=Vs(),jl=Me(),ql=class extends jl.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`${m0.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 jl.Vector.new(e,t)}concat(...e){return b0.Chunked.concat(this,...e)}slice(e,t){return g0.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]=jl.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){}};Ha.BaseVector=ql;ql.prototype[Symbol.isConcatSpreadable]=!0});var Wl=v(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.BinaryVector=void 0;var v0=Me(),T0=Pe(),I0=ce(),X_=class extends T0.BaseVector{asUtf8(){return v0.Vector.new(this.data.clone(new I0.Utf8))}};Ya.BinaryVector=X_});var zl=v(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.BoolVector=void 0;var w0=ce(),S0=Pe(),B0=vr(),em=class extends S0.BaseVector{static from(e){return B0.vectorFromValuesWithType(()=>new w0.Bool,e)}};Ga.BoolVector=em});var Yl=v(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.DateMillisecondVector=vn.DateDayVector=vn.DateVector=void 0;var A0=pe(),O0=Pe(),tm=vr(),Hl=ce(),Ka=class extends O0.BaseVector{static from(...e){return e.length===2?tm.vectorFromValuesWithType(()=>e[1]===A0.DateUnit.DAY?new Hl.DateDay:new Hl.DateMillisecond,e[0]):tm.vectorFromValuesWithType(()=>new Hl.DateMillisecond,e[0])}};vn.DateVector=Ka;var rm=class extends Ka{};vn.DateDayVector=rm;var nm=class extends Ka{};vn.DateMillisecondVector=nm});var Gl=v($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.DecimalVector=void 0;var E0=Pe(),im=class extends E0.BaseVector{};$a.DecimalVector=im});var Qa=v(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.DictionaryVector=void 0;var D0=Gt(),sm=Me(),F0=Pe(),R0=vr(),M0=ce(),Kl=class extends F0.BaseVector{constructor(e){super(e);this.indices=sm.Vector.new(e.clone(this.type.indices))}static from(...e){if(e.length===3){let[t,n,i]=e,s=new M0.Dictionary(t.type,n,null,null);return sm.Vector.new(D0.Data.Dictionary(s,0,i.length,0,null,i,t))}return R0.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)}};Ja.DictionaryVector=Kl;Kl.prototype.indices=null});var $l=v(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.FixedSizeBinaryVector=void 0;var U0=Pe(),om=class extends U0.BaseVector{};Za.FixedSizeBinaryVector=om});var Jl=v(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.FixedSizeListVector=void 0;var P0=Pe(),am=class extends P0.BaseVector{};Xa.FixedSizeListVector=am});var ed=v(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.Float64Vector=Tr.Float32Vector=Tr.Float16Vector=Tr.FloatVector=void 0;var k0=Gt(),V0=Me(),N0=Pe(),L0=vr(),Zn=ce(),Hs=class extends N0.BaseVector{static from(e){let t=j0(this);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){let n=C0(e.constructor)||t;if(t===null&&(t=n),t&&t===n){let i=new t,s=e.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!x0(t,e.constructor))return V0.Vector.new(k0.Data.Float(i,0,s,0,null,e))}}if(t)return L0.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")}};Tr.FloatVector=Hs;var Ql=class extends Hs{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}};Tr.Float16Vector=Ql;var Zl=class extends Hs{};Tr.Float32Vector=Zl;var Xl=class extends Hs{};Tr.Float64Vector=Xl;var x0=(r,e)=>r===Zn.Float16&&e!==Uint16Array,C0=r=>{switch(r){case Uint16Array:return Zn.Float16;case Float32Array:return Zn.Float32;case Float64Array:return Zn.Float64;default:return null}},j0=r=>{switch(r){case Ql:return Zn.Float16;case Zl:return Zn.Float32;case Xl:return Zn.Float64;default:return null}}});var td=v(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.IntervalYearMonthVector=Tn.IntervalDayTimeVector=Tn.IntervalVector=void 0;var q0=Pe(),ec=class extends q0.BaseVector{};Tn.IntervalVector=ec;var cm=class extends ec{};Tn.IntervalDayTimeVector=cm;var um=class extends ec{};Tn.IntervalYearMonthVector=um});var tc=v(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.Uint64Vector=qe.Uint32Vector=qe.Uint16Vector=qe.Uint8Vector=qe.Int64Vector=qe.Int32Vector=qe.Int16Vector=qe.Int8Vector=qe.IntVector=void 0;var W0=Gt(),z0=Me(),H0=Pe(),Y0=vr(),lm=at(),dm=He(),Fe=ce(),Ir=class extends H0.BaseVector{static from(...e){let[t,n=!1]=e,i=$0(this,n);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let s=K0(t.constructor,n)||i;if(i===null&&(i=s),i&&i===s){let a=new i,o=t.byteLength/a.ArrayType.BYTES_PER_ELEMENT;return G0(i,t.constructor)&&(o*=.5),z0.Vector.new(W0.Data.Int(a,0,o,0,null,t))}}if(i)return Y0.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")}};qe.IntVector=Ir;var rd=class extends Ir{};qe.Int8Vector=rd;var nd=class extends Ir{};qe.Int16Vector=nd;var id=class extends Ir{};qe.Int32Vector=id;var sd=class extends Ir{toBigInt64Array(){return dm.toBigInt64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}};qe.Int64Vector=sd;var od=class extends Ir{};qe.Uint8Vector=od;var ad=class extends Ir{};qe.Uint16Vector=ad;var cd=class extends Ir{};qe.Uint32Vector=cd;var ud=class extends Ir{toBigUint64Array(){return dm.toBigUint64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}};qe.Uint64Vector=ud;var G0=(r,e)=>(r===Fe.Int64||r===Fe.Uint64)&&(e===Int32Array||e===Uint32Array),K0=(r,e)=>{switch(r){case Int8Array:return Fe.Int8;case Int16Array:return Fe.Int16;case Int32Array:return e?Fe.Int64:Fe.Int32;case lm.BigInt64Array:return Fe.Int64;case Uint8Array:return Fe.Uint8;case Uint16Array:return Fe.Uint16;case Uint32Array:return e?Fe.Uint64:Fe.Uint32;case lm.BigUint64Array:return Fe.Uint64;default:return null}},$0=(r,e)=>{switch(r){case rd:return Fe.Int8;case nd:return Fe.Int16;case id:return e?Fe.Int64:Fe.Int32;case sd:return Fe.Int64;case od:return Fe.Uint8;case ad:return Fe.Uint16;case cd:return e?Fe.Uint64:Fe.Uint32;case ud:return Fe.Uint64;default:return null}}});var ld=v(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.ListVector=void 0;var J0=Pe(),fm=class extends J0.BaseVector{};rc.ListVector=fm});var dd=v(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.MapVector=void 0;var Q0=Ps(),Z0=Me(),X0=Pe(),eA=ce(),hm=class extends X0.BaseVector{asList(){let e=this.type.children[0];return Z0.Vector.new(this.data.clone(new eA.List(e)))}bind(e){let t=this.getChildAt(0),{[e]:n,[e+1]:i}=this.valueOffsets;return new Q0.MapRow(t.slice(n,i))}};nc.MapVector=hm});var fd=v(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.NullVector=void 0;var tA=Pe(),pm=class extends tA.BaseVector{};ic.NullVector=pm});var hd=v(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.StructVector=void 0;var rA=Ps(),nA=Pe(),iA=Symbol.for("rowIndex"),ym=class extends nA.BaseVector{bind(e){let t=this._row||(this._row=new rA.StructRow(this)),n=Object.create(t);return n[iA]=e,n}};sc.StructVector=ym});var pd=v(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.TimestampNanosecondVector=Nt.TimestampMicrosecondVector=Nt.TimestampMillisecondVector=Nt.TimestampSecondVector=Nt.TimestampVector=void 0;var sA=Pe(),Ci=class extends sA.BaseVector{};Nt.TimestampVector=Ci;var _m=class extends Ci{};Nt.TimestampSecondVector=_m;var mm=class extends Ci{};Nt.TimestampMillisecondVector=mm;var bm=class extends Ci{};Nt.TimestampMicrosecondVector=bm;var gm=class extends Ci{};Nt.TimestampNanosecondVector=gm});var yd=v(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.TimeNanosecondVector=Lt.TimeMicrosecondVector=Lt.TimeMillisecondVector=Lt.TimeSecondVector=Lt.TimeVector=void 0;var oA=Pe(),ji=class extends oA.BaseVector{};Lt.TimeVector=ji;var vm=class extends ji{};Lt.TimeSecondVector=vm;var Tm=class extends ji{};Lt.TimeMillisecondVector=Tm;var Im=class extends ji{};Lt.TimeMicrosecondVector=Im;var wm=class extends ji{};Lt.TimeNanosecondVector=wm});var _d=v(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.SparseUnionVector=In.DenseUnionVector=In.UnionVector=void 0;var aA=Pe(),oc=class extends aA.BaseVector{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}};In.UnionVector=oc;var Sm=class extends oc{get valueOffsets(){return this.data.valueOffsets}};In.DenseUnionVector=Sm;var Bm=class extends oc{};In.SparseUnionVector=Bm});var md=v(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.Utf8Vector=void 0;var cA=Me(),uA=Pe(),Am=ce(),lA=vr(),Om=class extends uA.BaseVector{static from(e){return lA.vectorFromValuesWithType(()=>new Am.Utf8,e)}asBinary(){return cA.Vector.new(this.data.clone(new Am.Binary))}};ac.Utf8Vector=Om});var Em=v(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.partial2=wn.partial1=wn.partial0=void 0;function dA(r){return function(){return r(this)}}wn.partial0=dA;function fA(r){return function(e){return r(this,e)}}wn.partial1=fA;function hA(r){return function(e,t){return r(this,e,t)}}wn.partial2=hA});var vd=v(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.instance=qi.GetVisitor=void 0;var cc=Es(),pA=tt(),yA=Rn(),_A=Ss(),xt=pe(),q=class extends pA.Visitor{};qi.GetVisitor=q;var mA=(r,e)=>864e5*r[e],bd=(r,e)=>4294967296*r[e+1]+(r[e]>>>0),bA=(r,e)=>4294967296*(r[e+1]/1e3)+(r[e]>>>0)/1e3,gA=(r,e)=>4294967296*(r[e+1]/1e6)+(r[e]>>>0)/1e6,Dm=r=>new Date(r),vA=(r,e)=>Dm(mA(r,e)),TA=(r,e)=>Dm(bd(r,e)),IA=(r,e)=>null,Fm=(r,e,t)=>{let{[t]:n,[t+1]:i}=e;return n!=null&&i!=null?r.subarray(n,i):null},wA=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!=0},Rm=({values:r},e)=>vA(r,e),Mm=({values:r},e)=>TA(r,e*2),wr=({stride:r,values:e},t)=>e[r*t],Um=({stride:r,values:e},t)=>_A.uint16ToFloat64(e[r*t]),gd=({stride:r,values:e,type:t},n)=>cc.BN.new(e.subarray(r*n,r*(n+1)),t.isSigned),SA=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),BA=({values:r,valueOffsets:e},t)=>Fm(r,e,t),AA=({values:r,valueOffsets:e},t)=>{let n=Fm(r,e,t);return n!==null?yA.decodeUtf8(n):null},OA=(r,e)=>r.type.bitWidth<64?wr(r,e):gd(r,e),EA=(r,e)=>r.type.precision!==xt.Precision.HALF?wr(r,e):Um(r,e),DA=(r,e)=>r.type.unit===xt.DateUnit.DAY?Rm(r,e):Mm(r,e),Pm=({values:r},e)=>1e3*bd(r,e*2),km=({values:r},e)=>bd(r,e*2),Vm=({values:r},e)=>bA(r,e*2),Nm=({values:r},e)=>gA(r,e*2),FA=(r,e)=>{switch(r.type.unit){case xt.TimeUnit.SECOND:return Pm(r,e);case xt.TimeUnit.MILLISECOND:return km(r,e);case xt.TimeUnit.MICROSECOND:return Vm(r,e);case xt.TimeUnit.NANOSECOND:return Nm(r,e)}},Lm=({values:r,stride:e},t)=>r[e*t],xm=({values:r,stride:e},t)=>r[e*t],Cm=({values:r},e)=>cc.BN.signed(r.subarray(2*e,2*(e+1))),jm=({values:r},e)=>cc.BN.signed(r.subarray(2*e,2*(e+1))),RA=(r,e)=>{switch(r.type.unit){case xt.TimeUnit.SECOND:return Lm(r,e);case xt.TimeUnit.MILLISECOND:return xm(r,e);case xt.TimeUnit.MICROSECOND:return Cm(r,e);case xt.TimeUnit.NANOSECOND:return jm(r,e)}},MA=({values:r},e)=>cc.BN.decimal(r.subarray(4*e,4*(e+1))),UA=(r,e)=>{let t=r.getChildAt(0),{valueOffsets:n,stride:i}=r;return t.slice(n[e*i],n[e*i+1])},PA=(r,e)=>r.bind(e),kA=(r,e)=>r.bind(e),VA=(r,e)=>r.type.mode===xt.UnionMode.Dense?qm(r,e):Wm(r,e),qm=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(r.valueOffsets[e]):null},Wm=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(e):null},NA=(r,e)=>r.getValue(r.getKey(e)),LA=(r,e)=>r.type.unit===xt.IntervalUnit.DAY_TIME?zm(r,e):Hm(r,e),zm=({values:r},e)=>r.subarray(2*e,2*(e+1)),Hm=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=t/12|0,n[1]=t%12|0,n},xA=(r,e)=>{let t=r.getChildAt(0),{stride:n}=r;return t.slice(e*n,(e+1)*n)};q.prototype.visitNull=IA;q.prototype.visitBool=wA;q.prototype.visitInt=OA;q.prototype.visitInt8=wr;q.prototype.visitInt16=wr;q.prototype.visitInt32=wr;q.prototype.visitInt64=gd;q.prototype.visitUint8=wr;q.prototype.visitUint16=wr;q.prototype.visitUint32=wr;q.prototype.visitUint64=gd;q.prototype.visitFloat=EA;q.prototype.visitFloat16=Um;q.prototype.visitFloat32=wr;q.prototype.visitFloat64=wr;q.prototype.visitUtf8=AA;q.prototype.visitBinary=BA;q.prototype.visitFixedSizeBinary=SA;q.prototype.visitDate=DA;q.prototype.visitDateDay=Rm;q.prototype.visitDateMillisecond=Mm;q.prototype.visitTimestamp=FA;q.prototype.visitTimestampSecond=Pm;q.prototype.visitTimestampMillisecond=km;q.prototype.visitTimestampMicrosecond=Vm;q.prototype.visitTimestampNanosecond=Nm;q.prototype.visitTime=RA;q.prototype.visitTimeSecond=Lm;q.prototype.visitTimeMillisecond=xm;q.prototype.visitTimeMicrosecond=Cm;q.prototype.visitTimeNanosecond=jm;q.prototype.visitDecimal=MA;q.prototype.visitList=UA;q.prototype.visitStruct=kA;q.prototype.visitUnion=VA;q.prototype.visitDenseUnion=qm;q.prototype.visitSparseUnion=Wm;q.prototype.visitDictionary=NA;q.prototype.visitInterval=LA;q.prototype.visitIntervalDayTime=zm;q.prototype.visitIntervalYearMonth=Hm;q.prototype.visitFixedSizeList=xA;q.prototype.visitMap=PA;qi.instance=new q});var $m=v(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.instance=Wi.IndexOfVisitor=void 0;var CA=tt(),Ym=ur(),Gm=Vs(),W=class extends CA.Visitor{};Wi.IndexOfVisitor=W;function jA(r,e){return e===null&&r.length>0?0:-1}function qA(r,e){let{nullBitmap:t}=r.data;if(!t||r.nullCount<=0)return-1;let n=0;for(let i of new Ym.BitIterator(t,r.data.offset+(e||0),r.length,t,Ym.getBool)){if(!i)return n;++n}return-1}function X(r,e,t){if(e===void 0)return-1;if(e===null)return qA(r,t);let n=Gm.createElementComparator(e);for(let i=(t||0)-1,s=r.length;++i<s;)if(n(r.get(i)))return i;return-1}function Km(r,e,t){let n=Gm.createElementComparator(e);for(let i=(t||0)-1,s=r.length;++i<s;)if(n(r.get(i)))return i;return-1}W.prototype.visitNull=jA;W.prototype.visitBool=X;W.prototype.visitInt=X;W.prototype.visitInt8=X;W.prototype.visitInt16=X;W.prototype.visitInt32=X;W.prototype.visitInt64=X;W.prototype.visitUint8=X;W.prototype.visitUint16=X;W.prototype.visitUint32=X;W.prototype.visitUint64=X;W.prototype.visitFloat=X;W.prototype.visitFloat16=X;W.prototype.visitFloat32=X;W.prototype.visitFloat64=X;W.prototype.visitUtf8=X;W.prototype.visitBinary=X;W.prototype.visitFixedSizeBinary=X;W.prototype.visitDate=X;W.prototype.visitDateDay=X;W.prototype.visitDateMillisecond=X;W.prototype.visitTimestamp=X;W.prototype.visitTimestampSecond=X;W.prototype.visitTimestampMillisecond=X;W.prototype.visitTimestampMicrosecond=X;W.prototype.visitTimestampNanosecond=X;W.prototype.visitTime=X;W.prototype.visitTimeSecond=X;W.prototype.visitTimeMillisecond=X;W.prototype.visitTimeMicrosecond=X;W.prototype.visitTimeNanosecond=X;W.prototype.visitDecimal=X;W.prototype.visitList=X;W.prototype.visitStruct=X;W.prototype.visitUnion=X;W.prototype.visitDenseUnion=Km;W.prototype.visitSparseUnion=Km;W.prototype.visitDictionary=X;W.prototype.visitInterval=X;W.prototype.visitIntervalDayTime=X;W.prototype.visitIntervalYearMonth=X;W.prototype.visitFixedSizeList=X;W.prototype.visitMap=X;Wi.instance=new W});var Td=v(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.instance=zi.IteratorVisitor=void 0;var uc=pe(),WA=tt(),zA=ur(),Jm=vd(),z=class extends WA.Visitor{};zi.IteratorVisitor=z;function HA(r){let e=Jm.instance.getVisitFn(r);return new zA.BitIterator(r.data.nullBitmap,r.data.offset,r.length,r,(t,n,i,s)=>(i&1<<s)!=0?e(t,n):null)}var Qm=class{constructor(e,t){this.vector=e,this.getFn=t,this.index=0}next(){return this.index<this.vector.length?{value:this.getFn(this.vector,this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};function Q(r){if(r.nullCount>0)return HA(r);let{type:e,typeId:t,length:n}=r;return r.stride===1&&(t===uc.Type.Timestamp||t===uc.Type.Int&&e.bitWidth!==64||t===uc.Type.Time&&e.bitWidth!==64||t===uc.Type.Float&&e.precision>0)?r.data.values.subarray(0,n)[Symbol.iterator]():new Qm(r,Jm.instance.getVisitFn(r))}z.prototype.visitNull=Q;z.prototype.visitBool=Q;z.prototype.visitInt=Q;z.prototype.visitInt8=Q;z.prototype.visitInt16=Q;z.prototype.visitInt32=Q;z.prototype.visitInt64=Q;z.prototype.visitUint8=Q;z.prototype.visitUint16=Q;z.prototype.visitUint32=Q;z.prototype.visitUint64=Q;z.prototype.visitFloat=Q;z.prototype.visitFloat16=Q;z.prototype.visitFloat32=Q;z.prototype.visitFloat64=Q;z.prototype.visitUtf8=Q;z.prototype.visitBinary=Q;z.prototype.visitFixedSizeBinary=Q;z.prototype.visitDate=Q;z.prototype.visitDateDay=Q;z.prototype.visitDateMillisecond=Q;z.prototype.visitTimestamp=Q;z.prototype.visitTimestampSecond=Q;z.prototype.visitTimestampMillisecond=Q;z.prototype.visitTimestampMicrosecond=Q;z.prototype.visitTimestampNanosecond=Q;z.prototype.visitTime=Q;z.prototype.visitTimeSecond=Q;z.prototype.visitTimeMillisecond=Q;z.prototype.visitTimeMicrosecond=Q;z.prototype.visitTimeNanosecond=Q;z.prototype.visitDecimal=Q;z.prototype.visitList=Q;z.prototype.visitStruct=Q;z.prototype.visitUnion=Q;z.prototype.visitDenseUnion=Q;z.prototype.visitSparseUnion=Q;z.prototype.visitDictionary=Q;z.prototype.visitInterval=Q;z.prototype.visitIntervalDayTime=Q;z.prototype.visitIntervalYearMonth=Q;z.prototype.visitFixedSizeList=Q;z.prototype.visitMap=Q;zi.instance=new z});var Zm=v(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.instance=Hi.ToArrayVisitor=void 0;var Ys=pe(),YA=tt(),GA=Td(),H=class extends YA.Visitor{};Hi.ToArrayVisitor=H;function Z(r){let{type:e,length:t,stride:n}=r;switch(e.typeId){case Ys.Type.Int:case Ys.Type.Float:case Ys.Type.Decimal:case Ys.Type.Time:case Ys.Type.Timestamp:return r.data.values.subarray(0,t*n)}return[...GA.instance.visit(r)]}H.prototype.visitNull=Z;H.prototype.visitBool=Z;H.prototype.visitInt=Z;H.prototype.visitInt8=Z;H.prototype.visitInt16=Z;H.prototype.visitInt32=Z;H.prototype.visitInt64=Z;H.prototype.visitUint8=Z;H.prototype.visitUint16=Z;H.prototype.visitUint32=Z;H.prototype.visitUint64=Z;H.prototype.visitFloat=Z;H.prototype.visitFloat16=Z;H.prototype.visitFloat32=Z;H.prototype.visitFloat64=Z;H.prototype.visitUtf8=Z;H.prototype.visitBinary=Z;H.prototype.visitFixedSizeBinary=Z;H.prototype.visitDate=Z;H.prototype.visitDateDay=Z;H.prototype.visitDateMillisecond=Z;H.prototype.visitTimestamp=Z;H.prototype.visitTimestampSecond=Z;H.prototype.visitTimestampMillisecond=Z;H.prototype.visitTimestampMicrosecond=Z;H.prototype.visitTimestampNanosecond=Z;H.prototype.visitTime=Z;H.prototype.visitTimeSecond=Z;H.prototype.visitTimeMillisecond=Z;H.prototype.visitTimeMicrosecond=Z;H.prototype.visitTimeNanosecond=Z;H.prototype.visitDecimal=Z;H.prototype.visitList=Z;H.prototype.visitStruct=Z;H.prototype.visitUnion=Z;H.prototype.visitDenseUnion=Z;H.prototype.visitSparseUnion=Z;H.prototype.visitDictionary=Z;H.prototype.visitInterval=Z;H.prototype.visitIntervalDayTime=Z;H.prototype.visitIntervalYearMonth=Z;H.prototype.visitFixedSizeList=Z;H.prototype.visitMap=Z;Hi.instance=new H});var Xm=v(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.instance=Yi.ByteWidthVisitor=void 0;var KA=tt(),$A=pe(),Gs=(r,e)=>r+e,Id=r=>`Cannot compute the byte width of variable-width column ${r}`,wd=class extends KA.Visitor{visitNull(e){return 0}visitInt(e){return e.bitWidth/8}visitFloat(e){return e.ArrayType.BYTES_PER_ELEMENT}visitBinary(e){throw new Error(Id(e))}visitUtf8(e){throw new Error(Id(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===$A.TimeUnit.SECOND?4:8}visitInterval(e){return(e.unit+1)*4}visitList(e){throw new Error(Id(e))}visitStruct(e){return this.visitFields(e.children).reduce(Gs,0)}visitUnion(e){return this.visitFields(e.children).reduce(Gs,0)}visitFixedSizeBinary(e){return e.byteWidth}visitFixedSizeList(e){return e.listSize*this.visitFields(e.children).reduce(Gs,0)}visitMap(e){return this.visitFields(e.children).reduce(Gs,0)}visitDictionary(e){return this.visit(e.indices)}visitFields(e){return(e||[]).map(t=>this.visit(t.type))}visitSchema(e){return this.visitFields(e.fields).reduce(Gs,0)}};Yi.ByteWidthVisitor=wd;Yi.instance=new wd});var eb=v(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.instance=Gi.GetVectorConstructor=void 0;var JA=tt(),QA=Wl(),ZA=zl(),Sd=Yl(),XA=Gl(),eO=Qa(),tO=$l(),rO=Jl(),lc=ed(),Bd=td(),Lr=tc(),nO=ld(),iO=dd(),sO=fd(),oO=hd(),Ks=pd(),$s=yd(),Ad=_d(),aO=md(),Od=class extends JA.Visitor{visitNull(){return sO.NullVector}visitBool(){return ZA.BoolVector}visitInt(){return Lr.IntVector}visitInt8(){return Lr.Int8Vector}visitInt16(){return Lr.Int16Vector}visitInt32(){return Lr.Int32Vector}visitInt64(){return Lr.Int64Vector}visitUint8(){return Lr.Uint8Vector}visitUint16(){return Lr.Uint16Vector}visitUint32(){return Lr.Uint32Vector}visitUint64(){return Lr.Uint64Vector}visitFloat(){return lc.FloatVector}visitFloat16(){return lc.Float16Vector}visitFloat32(){return lc.Float32Vector}visitFloat64(){return lc.Float64Vector}visitUtf8(){return aO.Utf8Vector}visitBinary(){return QA.BinaryVector}visitFixedSizeBinary(){return tO.FixedSizeBinaryVector}visitDate(){return Sd.DateVector}visitDateDay(){return Sd.DateDayVector}visitDateMillisecond(){return Sd.DateMillisecondVector}visitTimestamp(){return Ks.TimestampVector}visitTimestampSecond(){return Ks.TimestampSecondVector}visitTimestampMillisecond(){return Ks.TimestampMillisecondVector}visitTimestampMicrosecond(){return Ks.TimestampMicrosecondVector}visitTimestampNanosecond(){return Ks.TimestampNanosecondVector}visitTime(){return $s.TimeVector}visitTimeSecond(){return $s.TimeSecondVector}visitTimeMillisecond(){return $s.TimeMillisecondVector}visitTimeMicrosecond(){return $s.TimeMicrosecondVector}visitTimeNanosecond(){return $s.TimeNanosecondVector}visitDecimal(){return XA.DecimalVector}visitList(){return nO.ListVector}visitStruct(){return oO.StructVector}visitUnion(){return Ad.UnionVector}visitDenseUnion(){return Ad.DenseUnionVector}visitSparseUnion(){return Ad.SparseUnionVector}visitDictionary(){return eO.DictionaryVector}visitInterval(){return Bd.IntervalVector}visitIntervalDayTime(){return Bd.IntervalDayTimeVector}visitIntervalYearMonth(){return Bd.IntervalYearMonthVector}visitFixedSizeList(){return rO.FixedSizeListVector}visitMap(){return iO.MapVector}};Gi.GetVectorConstructor=Od;Gi.instance=new Od});var vr=v(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 Ed=ot(),cO=Me();Object.defineProperty(T,"Vector",{enumerable:!0,get:function(){return cO.Vector}});var uO=Pe();Object.defineProperty(T,"BaseVector",{enumerable:!0,get:function(){return uO.BaseVector}});var lO=Wl();Object.defineProperty(T,"BinaryVector",{enumerable:!0,get:function(){return lO.BinaryVector}});var dO=zl();Object.defineProperty(T,"BoolVector",{enumerable:!0,get:function(){return dO.BoolVector}});var fO=pn();Object.defineProperty(T,"Chunked",{enumerable:!0,get:function(){return fO.Chunked}});var Dd=Yl();Object.defineProperty(T,"DateVector",{enumerable:!0,get:function(){return Dd.DateVector}});Object.defineProperty(T,"DateDayVector",{enumerable:!0,get:function(){return Dd.DateDayVector}});Object.defineProperty(T,"DateMillisecondVector",{enumerable:!0,get:function(){return Dd.DateMillisecondVector}});var hO=Gl();Object.defineProperty(T,"DecimalVector",{enumerable:!0,get:function(){return hO.DecimalVector}});var pO=Qa();Object.defineProperty(T,"DictionaryVector",{enumerable:!0,get:function(){return pO.DictionaryVector}});var yO=$l();Object.defineProperty(T,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return yO.FixedSizeBinaryVector}});var _O=Jl();Object.defineProperty(T,"FixedSizeListVector",{enumerable:!0,get:function(){return _O.FixedSizeListVector}});var dc=ed();Object.defineProperty(T,"FloatVector",{enumerable:!0,get:function(){return dc.FloatVector}});Object.defineProperty(T,"Float16Vector",{enumerable:!0,get:function(){return dc.Float16Vector}});Object.defineProperty(T,"Float32Vector",{enumerable:!0,get:function(){return dc.Float32Vector}});Object.defineProperty(T,"Float64Vector",{enumerable:!0,get:function(){return dc.Float64Vector}});var Fd=td();Object.defineProperty(T,"IntervalVector",{enumerable:!0,get:function(){return Fd.IntervalVector}});Object.defineProperty(T,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Fd.IntervalDayTimeVector}});Object.defineProperty(T,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Fd.IntervalYearMonthVector}});var xr=tc();Object.defineProperty(T,"IntVector",{enumerable:!0,get:function(){return xr.IntVector}});Object.defineProperty(T,"Int8Vector",{enumerable:!0,get:function(){return xr.Int8Vector}});Object.defineProperty(T,"Int16Vector",{enumerable:!0,get:function(){return xr.Int16Vector}});Object.defineProperty(T,"Int32Vector",{enumerable:!0,get:function(){return xr.Int32Vector}});Object.defineProperty(T,"Int64Vector",{enumerable:!0,get:function(){return xr.Int64Vector}});Object.defineProperty(T,"Uint8Vector",{enumerable:!0,get:function(){return xr.Uint8Vector}});Object.defineProperty(T,"Uint16Vector",{enumerable:!0,get:function(){return xr.Uint16Vector}});Object.defineProperty(T,"Uint32Vector",{enumerable:!0,get:function(){return xr.Uint32Vector}});Object.defineProperty(T,"Uint64Vector",{enumerable:!0,get:function(){return xr.Uint64Vector}});var mO=ld();Object.defineProperty(T,"ListVector",{enumerable:!0,get:function(){return mO.ListVector}});var bO=dd();Object.defineProperty(T,"MapVector",{enumerable:!0,get:function(){return bO.MapVector}});var gO=fd();Object.defineProperty(T,"NullVector",{enumerable:!0,get:function(){return gO.NullVector}});var vO=hd();Object.defineProperty(T,"StructVector",{enumerable:!0,get:function(){return vO.StructVector}});var Js=pd();Object.defineProperty(T,"TimestampVector",{enumerable:!0,get:function(){return Js.TimestampVector}});Object.defineProperty(T,"TimestampSecondVector",{enumerable:!0,get:function(){return Js.TimestampSecondVector}});Object.defineProperty(T,"TimestampMillisecondVector",{enumerable:!0,get:function(){return Js.TimestampMillisecondVector}});Object.defineProperty(T,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return Js.TimestampMicrosecondVector}});Object.defineProperty(T,"TimestampNanosecondVector",{enumerable:!0,get:function(){return Js.TimestampNanosecondVector}});var Qs=yd();Object.defineProperty(T,"TimeVector",{enumerable:!0,get:function(){return Qs.TimeVector}});Object.defineProperty(T,"TimeSecondVector",{enumerable:!0,get:function(){return Qs.TimeSecondVector}});Object.defineProperty(T,"TimeMillisecondVector",{enumerable:!0,get:function(){return Qs.TimeMillisecondVector}});Object.defineProperty(T,"TimeMicrosecondVector",{enumerable:!0,get:function(){return Qs.TimeMicrosecondVector}});Object.defineProperty(T,"TimeNanosecondVector",{enumerable:!0,get:function(){return Qs.TimeNanosecondVector}});var Rd=_d();Object.defineProperty(T,"UnionVector",{enumerable:!0,get:function(){return Rd.UnionVector}});Object.defineProperty(T,"DenseUnionVector",{enumerable:!0,get:function(){return Rd.DenseUnionVector}});Object.defineProperty(T,"SparseUnionVector",{enumerable:!0,get:function(){return Rd.SparseUnionVector}});var TO=md();Object.defineProperty(T,"Utf8Vector",{enumerable:!0,get:function(){return TO.Utf8Vector}});var tb=Ps();Object.defineProperty(T,"MapRow",{enumerable:!0,get:function(){return tb.MapRow}});Object.defineProperty(T,"StructRow",{enumerable:!0,get:function(){return tb.StructRow}});var Zs=Em(),Md=pe(),Ki=Me(),rb=pn(),Xn=Pe(),IO=ur(),fc=at(),nb=Oe(),ib=vd(),sb=Hu(),ob=$m(),ab=Zm(),cb=Td(),ub=Xm(),lb=eb();Ki.Vector.new=wO;Ki.Vector.from=BO;function wO(r,...e){return new(lb.instance.getVisitFn(r)())(r,...e)}function SO(r,e){if(fc.isIterable(e))return Ki.Vector.from({nullValues:[null,void 0],type:r(),values:e});if(fc.isAsyncIterable(e))return Ki.Vector.from({nullValues:[null,void 0],type:r(),values:e});let{values:t=[],type:n=r(),nullValues:i=[null,void 0]}=Object.assign({},e);return fc.isIterable(t)?Ki.Vector.from(Object.assign(Object.assign({nullValues:i},e),{type:n})):Ki.Vector.from(Object.assign(Object.assign({nullValues:i},e),{type:n}))}T.vectorFromValuesWithType=SO;function BO(r){let e=Object.assign({nullValues:[null,void 0]},r),{values:t=[]}=e,n=Ed.__rest(e,["values"]);if(fc.isIterable(t)){let i=[...nb.Builder.throughIterable(n)(t)];return i.length===1?i[0]:rb.Chunked.concat(i)}return(i=>Ed.__awaiter(this,void 0,void 0,function*(){var s,a;let o=nb.Builder.throughAsyncIterable(n);try{for(var d=Ed.__asyncValues(o(t)),h;h=yield d.next(),!h.done;){let _=h.value;i.push(_)}}catch(_){s={error:_}}finally{try{h&&!h.done&&(a=d.return)&&(yield a.call(d))}finally{if(s)throw s.error}}return i.length===1?i[0]:rb.Chunked.concat(i)}))([])}Xn.BaseVector.prototype.get=function(e){return ib.instance.visit(this,e)};Xn.BaseVector.prototype.set=function(e,t){return sb.instance.visit(this,e,t)};Xn.BaseVector.prototype.indexOf=function(e,t){return ob.instance.visit(this,e,t)};Xn.BaseVector.prototype.toArray=function(){return ab.instance.visit(this)};Xn.BaseVector.prototype.getByteWidth=function(){return ub.instance.visit(this.type)};Xn.BaseVector.prototype[Symbol.iterator]=function(){return cb.instance.visit(this)};Xn.BaseVector.prototype._bindDataAccessors=DO;Object.keys(Md.Type).map(r=>Md.Type[r]).filter(r=>typeof r=="number").filter(r=>r!==Md.Type.NONE).forEach(r=>{let e=lb.instance.visit(r);e.prototype.get=Zs.partial1(ib.instance.getVisitFn(r)),e.prototype.set=Zs.partial2(sb.instance.getVisitFn(r)),e.prototype.indexOf=Zs.partial2(ob.instance.getVisitFn(r)),e.prototype.toArray=Zs.partial0(ab.instance.getVisitFn(r)),e.prototype.getByteWidth=AO(ub.instance.getVisitFn(r)),e.prototype[Symbol.iterator]=Zs.partial0(cb.instance.getVisitFn(r))});function AO(r){return function(){return r(this.type)}}function OO(r){return function(e){return this.isValid(e)?r.call(this,e):null}}function EO(r){return function(e,t){IO.setBool(this.nullBitmap,this.offset+e,t!=null)&&r.call(this,e,t)}}function DO(){let r=this.nullBitmap;r&&r.byteLength>0&&(this.get=OO(this.get),this.set=EO(this.set))}});var zs=v(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.Table=void 0;var hc=ot(),FO=Pi(),RO=Xs(),db=za(),Ud=Nr(),fb=Je(),Pd=ce(),hb=Hn(),kd=at(),pb=Cl(),Vd=vr(),Ke=class extends Vd.Chunked{constructor(...e){var t;let n=null;e[0]instanceof fb.Schema&&(n=e[0]);let i=e[0]instanceof Ke?e[0].chunks:hb.selectArgs(Ud.RecordBatch,e);if(!n&&!(n=(t=i[0])===null||t===void 0?void 0:t.schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");i[0]||(i[0]=new Ud._InternalEmptyPlaceholderRecordBatch(n));super(new Pd.Struct(n.fields),i);this._schema=n,this._chunks=i}static empty(e=new fb.Schema([])){return new Ke(e,[])}static from(e){if(!e)return Ke.empty();if(typeof e=="object"){let n=kd.isIterable(e.values)?MO(e):kd.isAsyncIterable(e.values)?UO(e):null;if(n!==null)return n}let t=RO.RecordBatchReader.from(e);return kd.isPromise(t)?(()=>hc.__awaiter(this,void 0,void 0,function*(){return yield Ke.from(yield t)}))():t.isSync()&&(t=t.open())?t.schema?new Ke(t.schema,[...t]):Ke.empty():(n=>hc.__awaiter(this,void 0,void 0,function*(){var i,s;let a=yield n,o=a.schema,d=[];if(o){try{for(var h=hc.__asyncValues(a),_;_=yield h.next(),!_.done;){let F=_.value;d.push(F)}}catch(F){i={error:F}}finally{try{_&&!_.done&&(s=h.return)&&(yield s.call(h))}finally{if(i)throw i.error}}return new Ke(o,d)}return Ke.empty()}))(t.open())}static fromAsync(e){return hc.__awaiter(this,void 0,void 0,function*(){return yield Ke.from(e)})}static fromStruct(e){return Ke.new(e.data.childData,e.type.children)}static new(...e){return new Ke(...pb.distributeColumnsIntoRecordBatches(hb.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 Ke(this._schema,e)}getColumn(e){return this.getColumnAt(this.getColumnIndex(e))}getColumnAt(e){return this.getChildAt(e)}getColumnIndex(e){return this._schema.fields.findIndex(t=>t.name===e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t,n,i=this._schema.fields,s=this._children||(this._children=[]);if(n=s[e])return n;if(t=i[e]){let a=this._chunks.map(o=>o.getChildAt(e)).filter(o=>o!=null);if(a.length>0)return s[e]=new FO.Column(t,a)}return null}serialize(e="binary",t=!0){return(t?db.RecordBatchStreamWriter:db.RecordBatchFileWriter).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...e){let t=this._schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e);return new Ke(t,this._chunks.map(({length:n,data:{childData:i}})=>new Ud.RecordBatch(t,n,e.map(s=>i[s]).filter(Boolean))))}assign(e){let t=this._schema.fields,[n,i]=e.schema.fields.reduce((o,d,h)=>{let[_,F]=o,U=t.findIndex(re=>re.name===d.name);return~U?F[U]=h:_.push(h),o},[[],[]]),s=this._schema.assign(e.schema),a=[...t.map((o,d,h,_=i[d])=>_===void 0?this.getColumnAt(d):e.getColumnAt(_)),...n.map(o=>e.getColumnAt(o))].filter(Boolean);return new Ke(...pb.distributeVectorsIntoRecordBatches(s,a))}};pc.Table=Ke;function MO(r){let{type:e}=r;return e instanceof Pd.Struct?Ke.fromStruct(Vd.StructVector.from(r)):null}function UO(r){let{type:e}=r;return e instanceof Pd.Struct?Vd.StructVector.from(r).then(t=>Ke.fromStruct(t)):null}});var Nr=v($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i._InternalEmptyPlaceholderRecordBatch=$i.RecordBatch=void 0;var Nd=Gt(),Ld=zs(),PO=Me(),kO=tt(),VO=Je(),NO=at(),LO=pn(),xO=Hn(),xd=ce(),CO=Cl(),jO=vr(),Sn=class extends jO.StructVector{constructor(...e){let t,n=e[0],i;if(e[1]instanceof Nd.Data)[,t,i]=e;else{let s=n.fields,[,a,o]=e;t=Nd.Data.Struct(new xd.Struct(s),0,a,0,null,o)}super(t,i);this._schema=n}static from(e){return NO.isIterable(e.values),Ld.Table.from(e)}static new(...e){let[t,n]=xO.selectFieldArgs(e),i=n.filter(s=>s instanceof PO.Vector);return new Sn(...CO.ensureSameLengthData(new VO.Schema(t),i.map(s=>s.data)))}clone(e,t=this._children){return new Sn(this._schema,e,t)}concat(...e){let t=this._schema,n=LO.Chunked.flatten(this,...e);return new Ld.Table(t,n.map(({data:i})=>new Sn(t,i)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=yc.collect(this))}select(...e){let t=this._schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e),n=e.map(i=>this.data.childData[i]).filter(Boolean);return new Sn(t,this.length,n)}};$i.RecordBatch=Sn;var yb=class extends Sn{constructor(e){super(e,0,e.fields.map(t=>Nd.Data.new(t.type,0,0,0)))}};$i._InternalEmptyPlaceholderRecordBatch=yb;var yc=class extends kO.Visitor{constructor(){super(...arguments);this.dictionaries=new Map}static collect(e){return new yc().visit(e.data,new xd.Struct(e.schema.fields)).dictionaries}visit(e,t){return xd.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 Xs=v(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.AsyncRecordBatchFileReader=qt.RecordBatchFileReader=qt.AsyncRecordBatchStreamReader=qt.RecordBatchStreamReader=qt.RecordBatchReader=void 0;var ve=ot(),_b=Me(),_c=pe(),mb=rl(),bb=Is(),gb=ln(),eo=sl(),vb=Zy(),Cd=Nr(),ei=ai(),Ct=Ua(),jt=at(),Sr=class extends ei.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 jt.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 bb.default.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return bb.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 Sr?e:jt.isArrowJSON(e)?qO(e):jt.isFileHandle(e)?HO(e):jt.isPromise(e)?(()=>ve.__awaiter(this,void 0,void 0,function*(){return yield Sr.from(yield e)}))():jt.isFetchResponse(e)||jt.isReadableDOMStream(e)||jt.isReadableNodeStream(e)||jt.isAsyncIterable(e)?zO(new gb.AsyncByteStream(e)):WO(new gb.ByteStream(e))}static readAll(e){return e instanceof Sr?e.isSync()?Sb(e):Bb(e):jt.isArrowJSON(e)||ArrayBuffer.isView(e)||jt.isIterable(e)||jt.isIteratorResult(e)?Sb(e):Bb(e)}};qt.RecordBatchReader=Sr;var Ji=class extends Sr{constructor(e){super(e);this._impl=e}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return ve.__asyncGenerator(this,arguments,function*(){yield ve.__await(yield*ve.__asyncDelegator(ve.__asyncValues(this[Symbol.iterator]())))})}};qt.RecordBatchStreamReader=Ji;var Qi=class extends Sr{constructor(e){super(e);this._impl=e}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}};qt.AsyncRecordBatchStreamReader=Qi;var mc=class extends Ji{constructor(e){super(e);this._impl=e}};qt.RecordBatchFileReader=mc;var jd=class extends Qi{constructor(e){super(e);this._impl=e}};qt.AsyncRecordBatchFileReader=jd;var qd=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 Cd.RecordBatch(this.schema,e.length,this._loadVectors(e,t,this.schema.fields))}_loadDictionaryBatch(e,t){let{id:n,isDelta:i,data:s}=e,{dictionaries:a,schema:o}=this,d=a.get(n);if(i||!d){let h=o.dictionaries.get(n);return d&&i?d.concat(_b.Vector.new(this._loadVectors(s,t,[h])[0])):_b.Vector.new(this._loadVectors(s,t,[h])[0])}return d}_loadVectors(e,t,n){return new vb.VectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}},to=class extends qd{constructor(e,t){super(t);this._reader=jt.isArrowJSON(e)?new Ct.JSONMessageReader(this._handle=e):new Ct.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=wb(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):ei.ITERATOR_DONE}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):ei.ITERATOR_DONE}next(){if(this.closed)return ei.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Cd._InternalEmptyPlaceholderRecordBatch(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},ro=class extends qd{constructor(e,t){super(t);this._reader=new Ct.AsyncMessageReader(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return ve.__awaiter(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return ve.__awaiter(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=wb(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return ve.__awaiter(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):ei.ITERATOR_DONE})}return(e){return ve.__awaiter(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):ei.ITERATOR_DONE})}next(){return ve.__awaiter(this,void 0,void 0,function*(){if(this.closed)return ei.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=yield t.readMessageBody(e.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=yield t.readMessageBody(e.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Cd._InternalEmptyPlaceholderRecordBatch(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return ve.__awaiter(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},Wd=class extends to{constructor(e,t){super(e instanceof eo.RandomAccessFile?e:new eo.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(_c.MessageHeader.RecordBatch);if(n==null?void 0:n.isRecordBatch()){let i=n.header(),s=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,s)}}return null}_readDictionaryBatch(e){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(_c.MessageHeader.DictionaryBatch);if(n==null?void 0:n.isDictionaryBatch()){let i=n.header(),s=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(i,s);this.dictionaries.set(i.id,a)}}}_readFooter(){let{_handle:e}=this,t=e.size-Ct.magicAndPadding,n=e.readInt32(t),i=e.readAt(t-n,n);return mb.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}},Tb=class extends ro{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 eo.AsyncRandomAccessFile?e:new eo.AsyncRandomAccessFile(e,n),i)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return ve.__awaiter(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return ve.__awaiter(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let t=this._footer&&this._footer.getRecordBatch(e);if(t&&(yield this._handle.seek(t.offset))){let n=yield this._reader.readMessage(_c.MessageHeader.RecordBatch);if(n==null?void 0:n.isRecordBatch()){let i=n.header(),s=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,s)}}return null})}_readDictionaryBatch(e){return ve.__awaiter(this,void 0,void 0,function*(){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&(yield this._handle.seek(t.offset))){let n=yield this._reader.readMessage(_c.MessageHeader.DictionaryBatch);if(n==null?void 0:n.isDictionaryBatch()){let i=n.header(),s=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(i,s);this.dictionaries.set(i.id,a)}}})}_readFooter(){return ve.__awaiter(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Ct.magicAndPadding,n=yield e.readInt32(t),i=yield e.readAt(t-n,n);return mb.Footer.decode(i)})}_readNextMessageAndValidate(e){return ve.__awaiter(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},Ib=class extends to{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new vb.JSONVectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}};function wb(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*Sb(r){let e=Sr.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function Bb(r){return ve.__asyncGenerator(this,arguments,function*(){let t=yield ve.__await(Sr.from(r));try{if(!(yield ve.__await(t.open({autoDestroy:!1}))).closed)do yield yield ve.__await(t);while(!(yield ve.__await(t.reset().open())).closed)}finally{yield ve.__await(t.cancel())}})}function qO(r){return new Ji(new Ib(r))}function WO(r){let e=r.peek(Ct.magicLength+7&~7);return e&&e.byteLength>=4?Ct.checkForMagicArrowString(e)?new mc(new Wd(r.read())):new Ji(new to(r)):new Ji(new to(function*(){}()))}function zO(r){return ve.__awaiter(this,void 0,void 0,function*(){let e=yield r.peek(Ct.magicLength+7&~7);return e&&e.byteLength>=4?Ct.checkForMagicArrowString(e)?new mc(new Wd(yield r.read())):new Qi(new ro(r)):new Qi(new ro(function(){return ve.__asyncGenerator(this,arguments,function*(){})}()))})}function HO(r){return ve.__awaiter(this,void 0,void 0,function*(){let{size:e}=yield r.stat(),t=new eo.AsyncRandomAccessFile(r,e);return e>=Ct.magicX2AndPadding&&Ct.checkForMagicArrowString(yield t.readAt(0,Ct.magicLength+7&~7))?new jd(new Tb(t)):new Qi(new ro(t))})}});var Eb=v(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.toDOMStream=void 0;var bc=ot(),Ab=He(),Ob=at();function YO(r,e){if(Ob.isAsyncIterable(r))return KO(r,e);if(Ob.isIterable(r))return GO(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}gc.toDOMStream=YO;function GO(r,e){let t=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(a){s(a,t||(t=r[Symbol.iterator]()))},pull(a){t?s(a,t):a.close()},cancel(){((t==null?void 0:t.return)&&t.return()||!0)&&(t=null)}}),Object.assign({highWaterMark:n?i:void 0},e));function s(a,o){let d,h=null,_=a.desiredSize||null;for(;!(h=o.next(n?_:null)).done;)if(ArrayBuffer.isView(h.value)&&(d=Ab.toUint8Array(h.value))&&(_!=null&&n&&(_=_-d.byteLength+1),h.value=d),a.enqueue(h.value),_!=null&&--_<=0)return;a.close()}}function KO(r,e){let t=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(a){return bc.__awaiter(this,void 0,void 0,function*(){yield s(a,t||(t=r[Symbol.asyncIterator]()))})},pull(a){return bc.__awaiter(this,void 0,void 0,function*(){t?yield s(a,t):a.close()})},cancel(){return bc.__awaiter(this,void 0,void 0,function*(){((t==null?void 0:t.return)&&(yield t.return())||!0)&&(t=null)})}}),Object.assign({highWaterMark:n?i:void 0},e));function s(a,o){return bc.__awaiter(this,void 0,void 0,function*(){let d,h=null,_=a.desiredSize||null;for(;!(h=yield o.next(n?_:null)).done;)if(ArrayBuffer.isView(h.value)&&(d=Ab.toUint8Array(h.value))&&(_!=null&&n&&(_=_-d.byteLength+1),h.value=d),a.enqueue(h.value),_!=null&&--_<=0)return;a.close()})}}});var Rb=v(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.BuilderTransform=Zi.builderThroughDOMStream=void 0;var $O=ot(),JO=ga();function QO(r){return new zd(r)}Zi.builderThroughDOMStream=QO;var zd=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=e,s=$O.__rest(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=JO.Builder.new(s),this._getSize=i!=="bytes"?Db:Fb;let{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:o=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:d=>{this._maybeFlush(this._builder,this._controller=d)},start:d=>{this._maybeFlush(this._builder,this._controller=d)}},{highWaterMark:a,size:i!=="bytes"?Db:Fb}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:o,size:d=>this._writeValueAndReturnChunkSize(d)})}_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)}};Zi.BuilderTransform=zd;var Db=r=>r.length,Fb=r=>r.byteLength});var Mb=v(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.recordBatchReaderThroughDOMStream=void 0;var no=ot(),ZO=ln(),XO=Xs();function eE(r,e){let t=new ZO.AsyncByteQueue,n=null,i=new ReadableStream({cancel(){return no.__awaiter(this,void 0,void 0,function*(){yield t.close()})},start(o){return no.__awaiter(this,void 0,void 0,function*(){yield a(o,n||(n=yield s()))})},pull(o){return no.__awaiter(this,void 0,void 0,function*(){n?yield a(o,n):o.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:i};function s(){return no.__awaiter(this,void 0,void 0,function*(){return yield(yield XO.RecordBatchReader.from(t)).open(e)})}function a(o,d){return no.__awaiter(this,void 0,void 0,function*(){let h=o.desiredSize,_=null;for(;!(_=yield d.next()).done;)if(o.enqueue(_.value),h!=null&&--h<=0)return;o.close()})}}vc.recordBatchReaderThroughDOMStream=eE});var Ub=v(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.recordBatchWriterThroughDOMStream=void 0;var Tc=ot(),tE=ln();function rE(r,e){let t=new this(r),n=new tE.AsyncByteStream(t),i=new ReadableStream({type:"bytes",cancel(){return Tc.__awaiter(this,void 0,void 0,function*(){yield n.cancel()})},pull(a){return Tc.__awaiter(this,void 0,void 0,function*(){yield s(a)})},start(a){return Tc.__awaiter(this,void 0,void 0,function*(){yield s(a)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:i};function s(a){return Tc.__awaiter(this,void 0,void 0,function*(){let o=null,d=a.desiredSize;for(;o=yield n.read(d||null);)if(a.enqueue(o),d!=null&&(d-=o.byteLength)<=0)return;a.close()})}}Ic.recordBatchWriterThroughDOMStream=rE});var Jd=v(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.custom=te.or=te.and=te.col=te.lit=te.CustomPredicate=te.Not=te.GTeq=te.LTeq=te.Equals=te.Or=te.And=te.CombinationPredicate=te.ComparisonPredicate=te.Predicate=te.Col=te.Literal=te.Value=void 0;var nE=Qa(),Bn=class{eq(e){return e instanceof Bn||(e=new Cr(e)),new Yd(this,e)}le(e){return e instanceof Bn||(e=new Cr(e)),new Gd(this,e)}ge(e){return e instanceof Bn||(e=new Cr(e)),new Kd(this,e)}lt(e){return new rs(this.ge(e))}gt(e){return new rs(this.le(e))}ne(e){return new rs(this.eq(e))}};te.Value=Bn;var Cr=class extends Bn{constructor(e){super();this.v=e}};te.Literal=Cr;var Hd=class extends Bn{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)}};te.Col=Hd;var Xi=class{and(...e){return new es(this,...e)}or(...e){return new ts(this,...e)}not(){return new rs(this)}};te.Predicate=Xi;var io=class extends Xi{constructor(e,t){super();this.left=e,this.right=t}bind(e){return this.left instanceof Cr?this.right instanceof Cr?this._bindLitLit(e,this.left,this.right):this._bindLitCol(e,this.left,this.right):this.right instanceof Cr?this._bindColLit(e,this.left,this.right):this._bindColCol(e,this.left,this.right)}};te.ComparisonPredicate=io;var so=class extends Xi{constructor(...e){super();this.children=e}};te.CombinationPredicate=so;so.prototype.children=Object.freeze([]);var es=class extends so{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof es?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.every(s=>s(n,i))}};te.And=es;var ts=class extends so{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof ts?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.some(s=>s(n,i))}};te.Or=ts;var Yd=class extends io{_bindLitLit(e,t,n){let i=t.v==n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(a,o)=>i(a,o)==s(a,o)}_bindColLit(e,t,n){let i=t.bind(e);if(t.vector instanceof nE.DictionaryVector){let s,a=t.vector;return a.dictionary!==this.lastDictionary?(s=a.reverseLookup(n.v),this.lastDictionary=a.dictionary,this.lastKey=s):s=this.lastKey,s===-1?()=>!1:o=>a.getKey(o)===s}else return(s,a)=>i(s,a)==n.v}_bindLitCol(e,t,n){return this._bindColLit(e,n,t)}};te.Equals=Yd;var Gd=class extends io{_bindLitLit(e,t,n){let i=t.v<=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(a,o)=>i(a,o)<=s(a,o)}_bindColLit(e,t,n){let i=t.bind(e);return(s,a)=>i(s,a)<=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(s,a)=>t.v<=i(s,a)}};te.LTeq=Gd;var Kd=class extends io{_bindLitLit(e,t,n){let i=t.v>=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(a,o)=>i(a,o)>=s(a,o)}_bindColLit(e,t,n){let i=t.bind(e);return(s,a)=>i(s,a)>=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(s,a)=>t.v>=i(s,a)}};te.GTeq=Kd;var rs=class extends Xi{constructor(e){super();this.child=e}bind(e){let t=this.child.bind(e);return(n,i)=>!t(n,i)}};te.Not=rs;var $d=class extends Xi{constructor(e,t){super();this.next=e,this.bind_=t}bind(e){return this.bind_(e),this.next}};te.CustomPredicate=$d;function iE(r){return new Cr(r)}te.lit=iE;function sE(r){return new Hd(r)}te.col=sE;function oE(...r){return new es(...r)}te.and=oE;function aE(...r){return new ts(...r)}te.or=aE;function cE(r,e){return new $d(r,e)}te.custom=cE});var xb=v(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.FilteredDataFrame=An.CountByResult=An.DataFrame=void 0;var Pb=zs(),kb=tc(),Qd=Je(),Vb=Jd(),uE=Nr(),Nb=ce(),Zd=class extends Pb.Table{filter(e){return new oo(this.chunks,e)}scan(e,t){let n=this.chunks,i=n.length;for(let s=-1;++s<i;){let a=n[s];t&&t(a);for(let o=-1,d=a.length;++o<d;)e(o,a)}}scanReverse(e,t){let n=this.chunks,i=n.length;for(let s=i;--s>=0;){let a=n[s];t&&t(a);for(let o=a.length;--o>=0;)e(o,a)}}countBy(e){let t=this.chunks,n=t.length,i=typeof e=="string"?new Vb.Col(e):e;i.bind(t[n-1]);let s=i.vector;if(!Nb.DataType.isDictionary(s.type))throw new Error("countBy currently only supports dictionary-encoded columns");let a=Math.ceil(Math.log(s.length)/Math.log(256)),o=a==4?Uint32Array:a>=2?Uint16Array:Uint8Array,d=new o(s.dictionary.length);for(let h=-1;++h<n;){let _=t[h];i.bind(_);let F=i.vector.indices;for(let U=-1,re=_.length;++U<re;){let _e=F.get(U);_e!==null&&d[_e]++}}return new wc(s.dictionary,kb.IntVector.from(d))}};An.DataFrame=Zd;var wc=class extends Pb.Table{constructor(e,t){let n=new Qd.Schema([new Qd.Field("values",e.type),new Qd.Field("counts",t.type)]);super(new uE.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}};An.CountByResult=wc;var Lb=class{constructor(e,t){this.batches=e,this.predicate=t,this.batchIndex=0,this.index=0,this.batch=this.batches[this.batchIndex],this.predicateFunc=this.predicate.bind(this.batch)}next(){for(;this.batchIndex<this.batches.length;){for(;this.index<this.batch.length;){if(this.predicateFunc(this.index,this.batch))return{value:this.batch.get(this.index++)};this.index++}++this.batchIndex<this.batches.length&&(this.index=0,this.batch=this.batches[this.batchIndex],this.predicateFunc=this.predicate.bind(this.batch))}return{done:!0,value:null}}[Symbol.iterator](){return this}},oo=class extends Zd{constructor(e,t){super(e);this._predicate=t}scan(e,t){let n=this._chunks,i=n.length;for(let s=-1;++s<i;){let a=n[s],o=this._predicate.bind(a),d=!1;for(let h=-1,_=a.length;++h<_;)o(h,a)&&(t&&!d&&(t(a),d=!0),e(h,a))}}scanReverse(e,t){let n=this._chunks,i=n.length;for(let s=i;--s>=0;){let a=n[s],o=this._predicate.bind(a),d=!1;for(let h=a.length;--h>=0;)o(h,a)&&(t&&!d&&(t(a),d=!0),e(h,a))}}count(){let e=0,t=this._chunks,n=t.length;for(let i=-1;++i<n;){let s=t[i],a=this._predicate.bind(s);for(let o=-1,d=s.length;++o<d;)a(o,s)&&++e}return e}[Symbol.iterator](){return new Lb(this._chunks,this._predicate)}filter(e){return new oo(this._chunks,this._predicate.and(e))}countBy(e){let t=this._chunks,n=t.length,i=typeof e=="string"?new Vb.Col(e):e;i.bind(t[n-1]);let s=i.vector;if(!Nb.DataType.isDictionary(s.type))throw new Error("countBy currently only supports dictionary-encoded columns");let a=Math.ceil(Math.log(s.length)/Math.log(256)),o=a==4?Uint32Array:a>=2?Uint16Array:Uint8Array,d=new o(s.dictionary.length);for(let h=-1;++h<n;){let _=t[h],F=this._predicate.bind(_);i.bind(_);let U=i.vector.indices;for(let re=-1,_e=_.length;++re<_e;){let me=U.get(re);me!==null&&F(re,_)&&d[me]++}}return new wc(s.dictionary,kb.IntVector.from(d))}};An.FilteredDataFrame=oo});var qb=v(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.isTypedArray=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.Type=l.MessageHeader=l.MetadataVersion=l.IntervalUnit=l.UnionMode=l.Precision=l.TimeUnit=l.DateUnit=void 0;var ns=Jr();Object.defineProperty(l,"DateUnit",{enumerable:!0,get:function(){return ns.DateUnit}});Object.defineProperty(l,"TimeUnit",{enumerable:!0,get:function(){return ns.TimeUnit}});Object.defineProperty(l,"Precision",{enumerable:!0,get:function(){return ns.Precision}});Object.defineProperty(l,"UnionMode",{enumerable:!0,get:function(){return ns.UnionMode}});Object.defineProperty(l,"IntervalUnit",{enumerable:!0,get:function(){return ns.IntervalUnit}});Object.defineProperty(l,"MetadataVersion",{enumerable:!0,get:function(){return ns.MetadataVersion}});var lE=Uo();Object.defineProperty(l,"MessageHeader",{enumerable:!0,get:function(){return lE.MessageHeader}});var Cb=pe();Object.defineProperty(l,"Type",{enumerable:!0,get:function(){return Cb.Type}});Object.defineProperty(l,"BufferType",{enumerable:!0,get:function(){return Cb.BufferType}});var dE=Gt();Object.defineProperty(l,"Data",{enumerable:!0,get:function(){return dE.Data}});var $=ce();Object.defineProperty(l,"DataType",{enumerable:!0,get:function(){return $.DataType}});Object.defineProperty(l,"Null",{enumerable:!0,get:function(){return $.Null}});Object.defineProperty(l,"Bool",{enumerable:!0,get:function(){return $.Bool}});Object.defineProperty(l,"Int",{enumerable:!0,get:function(){return $.Int}});Object.defineProperty(l,"Int8",{enumerable:!0,get:function(){return $.Int8}});Object.defineProperty(l,"Int16",{enumerable:!0,get:function(){return $.Int16}});Object.defineProperty(l,"Int32",{enumerable:!0,get:function(){return $.Int32}});Object.defineProperty(l,"Int64",{enumerable:!0,get:function(){return $.Int64}});Object.defineProperty(l,"Uint8",{enumerable:!0,get:function(){return $.Uint8}});Object.defineProperty(l,"Uint16",{enumerable:!0,get:function(){return $.Uint16}});Object.defineProperty(l,"Uint32",{enumerable:!0,get:function(){return $.Uint32}});Object.defineProperty(l,"Uint64",{enumerable:!0,get:function(){return $.Uint64}});Object.defineProperty(l,"Float",{enumerable:!0,get:function(){return $.Float}});Object.defineProperty(l,"Float16",{enumerable:!0,get:function(){return $.Float16}});Object.defineProperty(l,"Float32",{enumerable:!0,get:function(){return $.Float32}});Object.defineProperty(l,"Float64",{enumerable:!0,get:function(){return $.Float64}});Object.defineProperty(l,"Utf8",{enumerable:!0,get:function(){return $.Utf8}});Object.defineProperty(l,"Binary",{enumerable:!0,get:function(){return $.Binary}});Object.defineProperty(l,"FixedSizeBinary",{enumerable:!0,get:function(){return $.FixedSizeBinary}});Object.defineProperty(l,"Date_",{enumerable:!0,get:function(){return $.Date_}});Object.defineProperty(l,"DateDay",{enumerable:!0,get:function(){return $.DateDay}});Object.defineProperty(l,"DateMillisecond",{enumerable:!0,get:function(){return $.DateMillisecond}});Object.defineProperty(l,"Timestamp",{enumerable:!0,get:function(){return $.Timestamp}});Object.defineProperty(l,"TimestampSecond",{enumerable:!0,get:function(){return $.TimestampSecond}});Object.defineProperty(l,"TimestampMillisecond",{enumerable:!0,get:function(){return $.TimestampMillisecond}});Object.defineProperty(l,"TimestampMicrosecond",{enumerable:!0,get:function(){return $.TimestampMicrosecond}});Object.defineProperty(l,"TimestampNanosecond",{enumerable:!0,get:function(){return $.TimestampNanosecond}});Object.defineProperty(l,"Time",{enumerable:!0,get:function(){return $.Time}});Object.defineProperty(l,"TimeSecond",{enumerable:!0,get:function(){return $.TimeSecond}});Object.defineProperty(l,"TimeMillisecond",{enumerable:!0,get:function(){return $.TimeMillisecond}});Object.defineProperty(l,"TimeMicrosecond",{enumerable:!0,get:function(){return $.TimeMicrosecond}});Object.defineProperty(l,"TimeNanosecond",{enumerable:!0,get:function(){return $.TimeNanosecond}});Object.defineProperty(l,"Decimal",{enumerable:!0,get:function(){return $.Decimal}});Object.defineProperty(l,"List",{enumerable:!0,get:function(){return $.List}});Object.defineProperty(l,"Struct",{enumerable:!0,get:function(){return $.Struct}});Object.defineProperty(l,"Union",{enumerable:!0,get:function(){return $.Union}});Object.defineProperty(l,"DenseUnion",{enumerable:!0,get:function(){return $.DenseUnion}});Object.defineProperty(l,"SparseUnion",{enumerable:!0,get:function(){return $.SparseUnion}});Object.defineProperty(l,"Dictionary",{enumerable:!0,get:function(){return $.Dictionary}});Object.defineProperty(l,"Interval",{enumerable:!0,get:function(){return $.Interval}});Object.defineProperty(l,"IntervalDayTime",{enumerable:!0,get:function(){return $.IntervalDayTime}});Object.defineProperty(l,"IntervalYearMonth",{enumerable:!0,get:function(){return $.IntervalYearMonth}});Object.defineProperty(l,"FixedSizeList",{enumerable:!0,get:function(){return $.FixedSizeList}});Object.defineProperty(l,"Map_",{enumerable:!0,get:function(){return $.Map_}});var fE=zs();Object.defineProperty(l,"Table",{enumerable:!0,get:function(){return fE.Table}});var hE=Pi();Object.defineProperty(l,"Column",{enumerable:!0,get:function(){return hE.Column}});var pE=tt();Object.defineProperty(l,"Visitor",{enumerable:!0,get:function(){return pE.Visitor}});var jb=Je();Object.defineProperty(l,"Schema",{enumerable:!0,get:function(){return jb.Schema}});Object.defineProperty(l,"Field",{enumerable:!0,get:function(){return jb.Field}});var Y=vr();Object.defineProperty(l,"Vector",{enumerable:!0,get:function(){return Y.Vector}});Object.defineProperty(l,"BaseVector",{enumerable:!0,get:function(){return Y.BaseVector}});Object.defineProperty(l,"BinaryVector",{enumerable:!0,get:function(){return Y.BinaryVector}});Object.defineProperty(l,"BoolVector",{enumerable:!0,get:function(){return Y.BoolVector}});Object.defineProperty(l,"Chunked",{enumerable:!0,get:function(){return Y.Chunked}});Object.defineProperty(l,"DateVector",{enumerable:!0,get:function(){return Y.DateVector}});Object.defineProperty(l,"DateDayVector",{enumerable:!0,get:function(){return Y.DateDayVector}});Object.defineProperty(l,"DateMillisecondVector",{enumerable:!0,get:function(){return Y.DateMillisecondVector}});Object.defineProperty(l,"DecimalVector",{enumerable:!0,get:function(){return Y.DecimalVector}});Object.defineProperty(l,"DictionaryVector",{enumerable:!0,get:function(){return Y.DictionaryVector}});Object.defineProperty(l,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return Y.FixedSizeBinaryVector}});Object.defineProperty(l,"FixedSizeListVector",{enumerable:!0,get:function(){return Y.FixedSizeListVector}});Object.defineProperty(l,"FloatVector",{enumerable:!0,get:function(){return Y.FloatVector}});Object.defineProperty(l,"Float16Vector",{enumerable:!0,get:function(){return Y.Float16Vector}});Object.defineProperty(l,"Float32Vector",{enumerable:!0,get:function(){return Y.Float32Vector}});Object.defineProperty(l,"Float64Vector",{enumerable:!0,get:function(){return Y.Float64Vector}});Object.defineProperty(l,"IntervalVector",{enumerable:!0,get:function(){return Y.IntervalVector}});Object.defineProperty(l,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Y.IntervalDayTimeVector}});Object.defineProperty(l,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Y.IntervalYearMonthVector}});Object.defineProperty(l,"IntVector",{enumerable:!0,get:function(){return Y.IntVector}});Object.defineProperty(l,"Int8Vector",{enumerable:!0,get:function(){return Y.Int8Vector}});Object.defineProperty(l,"Int16Vector",{enumerable:!0,get:function(){return Y.Int16Vector}});Object.defineProperty(l,"Int32Vector",{enumerable:!0,get:function(){return Y.Int32Vector}});Object.defineProperty(l,"Int64Vector",{enumerable:!0,get:function(){return Y.Int64Vector}});Object.defineProperty(l,"Uint8Vector",{enumerable:!0,get:function(){return Y.Uint8Vector}});Object.defineProperty(l,"Uint16Vector",{enumerable:!0,get:function(){return Y.Uint16Vector}});Object.defineProperty(l,"Uint32Vector",{enumerable:!0,get:function(){return Y.Uint32Vector}});Object.defineProperty(l,"Uint64Vector",{enumerable:!0,get:function(){return Y.Uint64Vector}});Object.defineProperty(l,"ListVector",{enumerable:!0,get:function(){return Y.ListVector}});Object.defineProperty(l,"MapVector",{enumerable:!0,get:function(){return Y.MapVector}});Object.defineProperty(l,"NullVector",{enumerable:!0,get:function(){return Y.NullVector}});Object.defineProperty(l,"StructVector",{enumerable:!0,get:function(){return Y.StructVector}});Object.defineProperty(l,"TimestampVector",{enumerable:!0,get:function(){return Y.TimestampVector}});Object.defineProperty(l,"TimestampSecondVector",{enumerable:!0,get:function(){return Y.TimestampSecondVector}});Object.defineProperty(l,"TimestampMillisecondVector",{enumerable:!0,get:function(){return Y.TimestampMillisecondVector}});Object.defineProperty(l,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return Y.TimestampMicrosecondVector}});Object.defineProperty(l,"TimestampNanosecondVector",{enumerable:!0,get:function(){return Y.TimestampNanosecondVector}});Object.defineProperty(l,"TimeVector",{enumerable:!0,get:function(){return Y.TimeVector}});Object.defineProperty(l,"TimeSecondVector",{enumerable:!0,get:function(){return Y.TimeSecondVector}});Object.defineProperty(l,"TimeMillisecondVector",{enumerable:!0,get:function(){return Y.TimeMillisecondVector}});Object.defineProperty(l,"TimeMicrosecondVector",{enumerable:!0,get:function(){return Y.TimeMicrosecondVector}});Object.defineProperty(l,"TimeNanosecondVector",{enumerable:!0,get:function(){return Y.TimeNanosecondVector}});Object.defineProperty(l,"UnionVector",{enumerable:!0,get:function(){return Y.UnionVector}});Object.defineProperty(l,"DenseUnionVector",{enumerable:!0,get:function(){return Y.DenseUnionVector}});Object.defineProperty(l,"SparseUnionVector",{enumerable:!0,get:function(){return Y.SparseUnionVector}});Object.defineProperty(l,"Utf8Vector",{enumerable:!0,get:function(){return Y.Utf8Vector}});var J=ga();Object.defineProperty(l,"Builder",{enumerable:!0,get:function(){return J.Builder}});Object.defineProperty(l,"BinaryBuilder",{enumerable:!0,get:function(){return J.BinaryBuilder}});Object.defineProperty(l,"BoolBuilder",{enumerable:!0,get:function(){return J.BoolBuilder}});Object.defineProperty(l,"DateBuilder",{enumerable:!0,get:function(){return J.DateBuilder}});Object.defineProperty(l,"DateDayBuilder",{enumerable:!0,get:function(){return J.DateDayBuilder}});Object.defineProperty(l,"DateMillisecondBuilder",{enumerable:!0,get:function(){return J.DateMillisecondBuilder}});Object.defineProperty(l,"DecimalBuilder",{enumerable:!0,get:function(){return J.DecimalBuilder}});Object.defineProperty(l,"DictionaryBuilder",{enumerable:!0,get:function(){return J.DictionaryBuilder}});Object.defineProperty(l,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return J.FixedSizeBinaryBuilder}});Object.defineProperty(l,"FixedSizeListBuilder",{enumerable:!0,get:function(){return J.FixedSizeListBuilder}});Object.defineProperty(l,"FloatBuilder",{enumerable:!0,get:function(){return J.FloatBuilder}});Object.defineProperty(l,"Float16Builder",{enumerable:!0,get:function(){return J.Float16Builder}});Object.defineProperty(l,"Float32Builder",{enumerable:!0,get:function(){return J.Float32Builder}});Object.defineProperty(l,"Float64Builder",{enumerable:!0,get:function(){return J.Float64Builder}});Object.defineProperty(l,"IntervalBuilder",{enumerable:!0,get:function(){return J.IntervalBuilder}});Object.defineProperty(l,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return J.IntervalDayTimeBuilder}});Object.defineProperty(l,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return J.IntervalYearMonthBuilder}});Object.defineProperty(l,"IntBuilder",{enumerable:!0,get:function(){return J.IntBuilder}});Object.defineProperty(l,"Int8Builder",{enumerable:!0,get:function(){return J.Int8Builder}});Object.defineProperty(l,"Int16Builder",{enumerable:!0,get:function(){return J.Int16Builder}});Object.defineProperty(l,"Int32Builder",{enumerable:!0,get:function(){return J.Int32Builder}});Object.defineProperty(l,"Int64Builder",{enumerable:!0,get:function(){return J.Int64Builder}});Object.defineProperty(l,"Uint8Builder",{enumerable:!0,get:function(){return J.Uint8Builder}});Object.defineProperty(l,"Uint16Builder",{enumerable:!0,get:function(){return J.Uint16Builder}});Object.defineProperty(l,"Uint32Builder",{enumerable:!0,get:function(){return J.Uint32Builder}});Object.defineProperty(l,"Uint64Builder",{enumerable:!0,get:function(){return J.Uint64Builder}});Object.defineProperty(l,"ListBuilder",{enumerable:!0,get:function(){return J.ListBuilder}});Object.defineProperty(l,"MapBuilder",{enumerable:!0,get:function(){return J.MapBuilder}});Object.defineProperty(l,"NullBuilder",{enumerable:!0,get:function(){return J.NullBuilder}});Object.defineProperty(l,"StructBuilder",{enumerable:!0,get:function(){return J.StructBuilder}});Object.defineProperty(l,"TimestampBuilder",{enumerable:!0,get:function(){return J.TimestampBuilder}});Object.defineProperty(l,"TimestampSecondBuilder",{enumerable:!0,get:function(){return J.TimestampSecondBuilder}});Object.defineProperty(l,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return J.TimestampMillisecondBuilder}});Object.defineProperty(l,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return J.TimestampMicrosecondBuilder}});Object.defineProperty(l,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return J.TimestampNanosecondBuilder}});Object.defineProperty(l,"TimeBuilder",{enumerable:!0,get:function(){return J.TimeBuilder}});Object.defineProperty(l,"TimeSecondBuilder",{enumerable:!0,get:function(){return J.TimeSecondBuilder}});Object.defineProperty(l,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return J.TimeMillisecondBuilder}});Object.defineProperty(l,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return J.TimeMicrosecondBuilder}});Object.defineProperty(l,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return J.TimeNanosecondBuilder}});Object.defineProperty(l,"UnionBuilder",{enumerable:!0,get:function(){return J.UnionBuilder}});Object.defineProperty(l,"DenseUnionBuilder",{enumerable:!0,get:function(){return J.DenseUnionBuilder}});Object.defineProperty(l,"SparseUnionBuilder",{enumerable:!0,get:function(){return J.SparseUnionBuilder}});Object.defineProperty(l,"Utf8Builder",{enumerable:!0,get:function(){return J.Utf8Builder}});var Xd=ln();Object.defineProperty(l,"ByteStream",{enumerable:!0,get:function(){return Xd.ByteStream}});Object.defineProperty(l,"AsyncByteStream",{enumerable:!0,get:function(){return Xd.AsyncByteStream}});Object.defineProperty(l,"AsyncByteQueue",{enumerable:!0,get:function(){return Xd.AsyncByteQueue}});var ao=Xs();Object.defineProperty(l,"RecordBatchReader",{enumerable:!0,get:function(){return ao.RecordBatchReader}});Object.defineProperty(l,"RecordBatchFileReader",{enumerable:!0,get:function(){return ao.RecordBatchFileReader}});Object.defineProperty(l,"RecordBatchStreamReader",{enumerable:!0,get:function(){return ao.RecordBatchStreamReader}});Object.defineProperty(l,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return ao.AsyncRecordBatchFileReader}});Object.defineProperty(l,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return ao.AsyncRecordBatchStreamReader}});var Sc=za();Object.defineProperty(l,"RecordBatchWriter",{enumerable:!0,get:function(){return Sc.RecordBatchWriter}});Object.defineProperty(l,"RecordBatchFileWriter",{enumerable:!0,get:function(){return Sc.RecordBatchFileWriter}});Object.defineProperty(l,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return Sc.RecordBatchStreamWriter}});Object.defineProperty(l,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return Sc.RecordBatchJSONWriter}});var ef=Ua();Object.defineProperty(l,"MessageReader",{enumerable:!0,get:function(){return ef.MessageReader}});Object.defineProperty(l,"AsyncMessageReader",{enumerable:!0,get:function(){return ef.AsyncMessageReader}});Object.defineProperty(l,"JSONMessageReader",{enumerable:!0,get:function(){return ef.JSONMessageReader}});var yE=Kn();Object.defineProperty(l,"Message",{enumerable:!0,get:function(){return yE.Message}});var _E=Nr();Object.defineProperty(l,"RecordBatch",{enumerable:!0,get:function(){return _E.RecordBatch}});var tf=xb();Object.defineProperty(l,"DataFrame",{enumerable:!0,get:function(){return tf.DataFrame}});Object.defineProperty(l,"FilteredDataFrame",{enumerable:!0,get:function(){return tf.FilteredDataFrame}});Object.defineProperty(l,"CountByResult",{enumerable:!0,get:function(){return tf.CountByResult}});var mE=Es(),bE=al(),gE=ur(),vE=Ss(),TE=He(),IE=Vs(),wE=Jd();l.predicate=wE;var rf=Bl();l.util=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},mE),bE),gE),vE),TE),IE),{compareSchemas:rf.compareSchemas,compareFields:rf.compareFields,compareTypes:rf.compareTypes});var SE=Hn();Object.defineProperty(l,"isTypedArray",{enumerable:!0,get:function(){return SE.isTypedArray}})});var as=v(()=>{});var co=v(()=>{});var Gb=v(()=>{});var Kb=v(()=>{});var $b=v(()=>{});var Jb=v((Oc,lf)=>{var uf=function(){var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(e){e=e||{};function t(){return Re.buffer!=It&&En(Re.buffer),Df}function n(){return Re.buffer!=It&&En(Re.buffer),Ff}function i(){return Re.buffer!=It&&En(Re.buffer),Rf}function s(){return Re.buffer!=It&&En(Re.buffer),Mf}function a(){return Re.buffer!=It&&En(Re.buffer),Uf}var o=typeof e!="undefined"?e:{},d,h;o.ready=new Promise(function(c,u){d=c,h=u});var _={},F;for(F in o)o.hasOwnProperty(F)&&(_[F]=o[F]);var U=[],re="./this.program",_e=function(c,u){throw u},me=typeof window=="object",it=typeof importScripts=="function",Ne=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",S=o.ENVIRONMENT_IS_PTHREAD||!1,_t="";function mf(c){return o.locateFile?o.locateFile(c,_t):_t+c}var us,Ec,ls,rg;function ng(c){if(!(c instanceof bs)){var u=c;D("exiting due to exception: "+u)}}var vt,Tt;if(Ne){it?_t=as().dirname(_t)+"/":_t=__dirname+"/",us=function(u,f){return vt||(vt=co()),Tt||(Tt=as()),u=Tt.normalize(u),vt.readFileSync(u,f?null:"utf8")},ls=function(u){var f=us(u,!0);return f.buffer||(f=new Uint8Array(f)),lo(f.buffer),f},Ec=function(u,f,y){vt||(vt=co()),Tt||(Tt=as()),u=Tt.normalize(u),vt.readFile(u,function(g,I){g?y(g):f(I.buffer)})},process.argv.length>1&&(re=process.argv[1].replace(/\\/g,"/")),U=process.argv.slice(2),process.on("uncaughtException",function(c){if(!(c instanceof bs))throw c}),process.on("unhandledRejection",function(c){throw c}),_e=function(c,u){if(hs())throw process.exitCode=c,u;ng(u),process.exit(c)},o.inspect=function(){return"[Emscripten Module object]"};var bf;try{bf=Gb()}catch(c){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),c}global.Worker=bf.Worker}else(me||it)&&(it?_t=self.location.href:typeof document!="undefined"&&document.currentScript&&(_t=document.currentScript.src),r&&(_t=r),_t.indexOf("blob:")!==0?_t=_t.substr(0,_t.replace(/[?#].*/,"").lastIndexOf("/")+1):_t="",Ne?(us=function(u,f){return vt||(vt=co()),Tt||(Tt=as()),u=Tt.normalize(u),vt.readFileSync(u,f?null:"utf8")},ls=function(u){var f=us(u,!0);return f.buffer||(f=new Uint8Array(f)),lo(f.buffer),f},Ec=function(u,f,y){vt||(vt=co()),Tt||(Tt=as()),u=Tt.normalize(u),vt.readFile(u,function(g,I){g?y(g):f(I.buffer)})}):(us=function(c){var u=new XMLHttpRequest;return u.open("GET",c,!1),u.send(null),u.responseText},it&&(ls=function(c){var u=new XMLHttpRequest;return u.open("GET",c,!1),u.responseType="arraybuffer",u.send(null),new Uint8Array(u.response)}),Ec=function(c,u,f){var y=new XMLHttpRequest;y.open("GET",c,!0),y.responseType="arraybuffer",y.onload=function(){if(y.status==200||y.status==0&&y.response){u(y.response);return}f()},y.onerror=f,y.send(null)}),rg=function(c){document.title=c});Ne&&typeof performance=="undefined"&&(global.performance=Kb().performance);var gf=o.print||console.log.bind(console),D=o.printErr||console.warn.bind(console);for(F in _)_.hasOwnProperty(F)&&(o[F]=_[F]);_=null,o.arguments&&(U=o.arguments),o.thisProgram&&(re=o.thisProgram),o.quit&&(_e=o.quit);function ds(c){ds.shown||(ds.shown={}),ds.shown[c]||(ds.shown[c]=1,D(c))}var FE=Atomics.load,RE=Atomics.store,ME=Atomics.compareExchange,fs;o.wasmBinary&&(fs=o.wasmBinary);var vf=o.noExitRuntime||!0;typeof WebAssembly!="object"&&er("no native wasm support detected");var Re,Tf,uo=!1,On;function lo(c,u){c||er("Assertion failed: "+u)}function ig(c){var u=o["_"+c];return lo(u,"Cannot call unknown function "+c+", make sure it is exported"),u}function sg(c,u,f,y,g){var I={string:function(We){var Br=0;if(We!=null&&We!==0){var vs=(We.length<<2)+1;Br=ni(vs),Af(We,Br,vs)}return Br},array:function(We){var Br=ni(We.length);return Ef(We,Br),Br}};function B(We){return u==="string"?Xt(We):u==="boolean"?Boolean(We):We}var V=ig(c),ae=[],Xe=0;if(y)for(var st=0;st<y.length;st++){var gs=I[f[st]];gs?(Xe===0&&(Xe=ms()),ae[st]=gs(y[st])):ae[st]=y[st]}var ut=V.apply(null,ae);function tr(We){return Xe!==0&&ri(Xe),B(We)}return ut=tr(ut),ut}function If(c){var u=new TextDecoder(c);this.decode=function(f){return f.buffer instanceof SharedArrayBuffer&&(f=new Uint8Array(f)),u.decode.call(u,f)}}var wf=typeof TextDecoder!="undefined"?new If("utf8"):void 0;function Sf(c,u,f){for(var y=u+f,g=u;c[g]&&!(g>=y);)++g;if(g-u>16&&c.subarray&&wf)return wf.decode(c.subarray(u,g));for(var I="";u<g;){var B=c[u++];if(!(B&128)){I+=String.fromCharCode(B);continue}var V=c[u++]&63;if((B&224)==192){I+=String.fromCharCode((B&31)<<6|V);continue}var ae=c[u++]&63;if((B&240)==224?B=(B&15)<<12|V<<6|ae:B=(B&7)<<18|V<<12|ae<<6|c[u++]&63,B<65536)I+=String.fromCharCode(B);else{var Xe=B-65536;I+=String.fromCharCode(55296|Xe>>10,56320|Xe&1023)}}return I}function Xt(c,u){return c?Sf(n(),c,u):""}function Bf(c,u,f,y){if(!(y>0))return 0;for(var g=f,I=f+y-1,B=0;B<c.length;++B){var V=c.charCodeAt(B);if(V>=55296&&V<=57343){var ae=c.charCodeAt(++B);V=65536+((V&1023)<<10)|ae&1023}if(V<=127){if(f>=I)break;u[f++]=V}else if(V<=2047){if(f+1>=I)break;u[f++]=192|V>>6,u[f++]=128|V&63}else if(V<=65535){if(f+2>=I)break;u[f++]=224|V>>12,u[f++]=128|V>>6&63,u[f++]=128|V&63}else{if(f+3>=I)break;u[f++]=240|V>>18,u[f++]=128|V>>12&63,u[f++]=128|V>>6&63,u[f++]=128|V&63}}return u[f]=0,f-g}function Af(c,u,f){return Bf(c,n(),u,f)}function Of(c){for(var u=0,f=0;f<c.length;++f){var y=c.charCodeAt(f);y>=55296&&y<=57343&&(y=65536+((y&1023)<<10)|c.charCodeAt(++f)&1023),y<=127?++u:y<=2047?u+=2:y<=65535?u+=3:u+=4}return u}var UE=typeof TextDecoder!="undefined"?new If("utf-16le"):void 0;function Ef(c,u){t().set(c,u)}function og(c,u,f){for(var y=0;y<c.length;++y)t()[u++>>0]=c.charCodeAt(y);f||(t()[u>>0]=0)}function ag(c,u){return c%u>0&&(c+=u-c%u),c}var It,Df,Ff,cg,ug,Rf,Mf,lg,Uf;S&&(It=o.buffer);function En(c){It=c,o.HEAP8=Df=new Int8Array(c),o.HEAP16=cg=new Int16Array(c),o.HEAP32=Rf=new Int32Array(c),o.HEAPU8=Ff=new Uint8Array(c),o.HEAPU16=ug=new Uint16Array(c),o.HEAPU32=Mf=new Uint32Array(c),o.HEAPF32=lg=new Float32Array(c),o.HEAPF64=Uf=new Float64Array(c)}var Pf=o.INITIAL_MEMORY||16777216;if(S)Re=o.wasmMemory,It=o.buffer;else if(o.wasmMemory)Re=o.wasmMemory;else if(Re=new WebAssembly.Memory({initial:Pf/65536,maximum:2147483648/65536,shared:!0}),!(Re.buffer instanceof SharedArrayBuffer))throw D("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),Ne&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Re&&(It=Re.buffer),Pf=It.byteLength,En(It);var ti,kf=[],Vf=[],dg=[],fg=[],Nf=[],hg=!1,pg=!1,Dc=0;function hs(){return vf||Dc>0}function yg(){if(!S){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)gg(o.preRun.shift());fo(kf)}}function Lf(){hg=!0,!S&&fo(Vf)}function _g(){S||fo(dg)}function mg(){S||(x.terminateAllThreads(),pg=!0)}function bg(){if(!S){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)Tg(o.postRun.shift());fo(Nf)}}function gg(c){kf.unshift(c)}function vg(c){Vf.unshift(c)}function Tg(c){Nf.unshift(c)}var Dn=0,Fc=null,ps=null;function Ig(c){Dn++,o.monitorRunDependencies&&o.monitorRunDependencies(Dn)}function wg(c){if(Dn--,o.monitorRunDependencies&&o.monitorRunDependencies(Dn),Dn==0&&(Fc!==null&&(clearInterval(Fc),Fc=null),ps)){var u=ps;ps=null,u()}}o.preloadedImages={},o.preloadedAudios={};function er(c){S?postMessage({cmd:"onAbort",arg:c}):o.onAbort&&o.onAbort(c),c="Aborted("+c+")",D(c),uo=!0,On=1,c+=". Build with -s ASSERTIONS=1 for more info.";var u=new WebAssembly.RuntimeError(c);throw h(u),u}var Sg="data:application/octet-stream;base64,";function xf(c){return c.startsWith(Sg)}var Wt;Wt="duckdb_wasm.wasm",xf(Wt)||(Wt=mf(Wt));function Cf(c){try{if(c==Wt&&fs)return new Uint8Array(fs);if(ls)return ls(c);throw"both async and sync fetching of the wasm failed"}catch(u){er(u)}}function Bg(){return!fs&&(me||it)&&typeof fetch=="function"?fetch(Wt,{credentials:"same-origin"}).then(function(c){if(!c.ok)throw"failed to load wasm binary file at '"+Wt+"'";return c.arrayBuffer()}).catch(function(){return Cf(Wt)}):Promise.resolve().then(function(){return Cf(Wt)})}function Ag(){var c={a:Hv};function u(B,V){var ae=B.exports;if(o.asm=ae,Mg(o.asm.$a),ti=o.asm.sa,vg(o.asm.qa),Tf=V,!S){var Xe=x.unusedWorkers.length;x.unusedWorkers.forEach(function(st){x.loadWasmModuleToWorker(st,function(){--Xe||wg("wasm-instantiate")})})}}S||Ig("wasm-instantiate");function f(B){u(B.instance,B.module)}function y(B){return Bg().then(function(V){return WebAssembly.instantiate(V,c)}).then(function(V){return V}).then(B,function(V){D("failed to asynchronously prepare wasm: "+V),er(V)})}function g(){return!fs&&typeof WebAssembly.instantiateStreaming=="function"&&!xf(Wt)&&typeof fetch=="function"?fetch(Wt,{credentials:"same-origin"}).then(function(B){var V=WebAssembly.instantiateStreaming(B,c);return V.then(f,function(ae){return D("wasm streaming compile failed: "+ae),D("falling back to ArrayBuffer instantiation"),y(f)})}):y(f)}if(o.instantiateWasm)try{var I=o.instantiateWasm(c,u);return I}catch(B){return D("Module.instantiateWasm callback failed with error: "+B),!1}return g().catch(h),{}}var Og={};function fo(c){for(;c.length>0;){var u=c.shift();if(typeof u=="function"){u(o);continue}var f=u.func;typeof f=="number"?u.arg===void 0?ti.get(f)():ti.get(f)(u.arg):f(u.arg===void 0?null:u.arg)}}function jf(c,u){if(c<=0||c>t().length||c&!0||u<0)return-28;if(u==0)return 0;u>=2147483647&&(u=1/0);var f=Atomics.load(i(),ii>>2),y=0;if(f==c){var g=Atomics.compareExchange(i(),ii>>2,f,0);if(g==f&&(--u,y=1,u<=0))return 1}var I=Atomics.notify(i(),c>>2,u);if(I>=0)return I+y;throw"Atomics.notify returned an unexpected value "+I}o._emscripten_futex_wake=jf;function Eg(c){i()[c+8>>2]=0;var u=x.pthreads[c];delete x.pthreads[c],u.worker.terminate(),Wf(u),x.runningWorkers.splice(x.runningWorkers.indexOf(u.worker),1),u.worker.pthread=void 0}function Dg(c){var u=x.pthreads[c];u.worker.postMessage({cmd:"cancel"})}function qf(c){var u=x.pthreads[c];if(u){i()[c+8>>2]=0;var f=u.worker;x.returnWorkerToPool(f)}}function Wf(c){!c||(c.threadInfoStruct&&Io(c.threadInfoStruct),c.threadInfoStruct=0,c.allocatedOwnStack&&c.stackBase&&Io(c.stackBase),c.stackBase=0,c.worker&&(c.worker.pthread=null))}function ho(c){Fh(c)}o._exit=ho;function po(c){if(c instanceof bs||c=="unwind")return On;_e(1,c)}var x={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){for(var c=4,u=0;u<c;++u)x.allocateUnusedWorker()},initWorker:function(){},pthreads:{},threadExitHandlers:[],setExitStatus:function(c){On=c},terminateAllThreads:function(){for(var c in x.pthreads){var u=x.pthreads[c];u&&u.worker&&x.returnWorkerToPool(u.worker)}for(var f=0;f<x.unusedWorkers.length;++f){var y=x.unusedWorkers[f];y.terminate()}x.unusedWorkers=[]},returnWorkerToPool:function(c){x.runWithoutMainThreadQueuedCalls(function(){delete x.pthreads[c.pthread.threadInfoStruct],x.unusedWorkers.push(c),x.runningWorkers.splice(x.runningWorkers.indexOf(c),1),Wf(c.pthread),c.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(c){i()[Dh>>2]=0;try{c()}finally{i()[Dh>>2]=1}},receiveObjectTransfer:function(c){},threadInit:function(){for(var c in x.tlsInitFunctions)x.tlsInitFunctions[c]()},loadWasmModuleToWorker:function(c,u){c.onmessage=function(f){var y=f.data,g=y.cmd;if(c.pthread&&(x.currentProxiedOperationCallerThread=c.pthread.threadInfoStruct),y.targetThread&&y.targetThread!=To()){var I=x.pthreads[y.targetThread];I?I.worker.postMessage(y,y.transferList):D('Internal error! Worker sent a message "'+g+'" to target pthread '+y.targetThread+", but that thread no longer exists!"),x.currentProxiedOperationCallerThread=void 0;return}g==="processQueuedMainThreadWork"?vo():g==="spawnThread"?Yf(y):g==="cleanupThread"?qf(y.thread):g==="killThread"?Eg(y.thread):g==="cancelThread"?Dg(y.thread):g==="loaded"?(c.loaded=!0,u&&u(c),c.runPthread&&(c.runPthread(),delete c.runPthread)):g==="print"?gf("Thread "+y.threadId+": "+y.text):g==="printErr"?D("Thread "+y.threadId+": "+y.text):g==="alert"?alert("Thread "+y.threadId+": "+y.text):g==="detachedExit"||g==="cancelDone"?x.returnWorkerToPool(c):y.target==="setimmediate"?c.postMessage(y):g==="onAbort"?o.onAbort&&o.onAbort(y.arg):D("worker sent an unknown command "+g),x.currentProxiedOperationCallerThread=void 0},c.onerror=function(f){throw D("pthread sent an error! "+f.filename+":"+f.lineno+": "+f.message),f},Ne&&(c.on("message",function(f){c.onmessage({data:f})}),c.on("error",function(f){c.onerror(f)}),c.on("detachedExit",function(){})),c.postMessage({cmd:"load",urlOrBlob:o.mainScriptUrlOrBlob||r,wasmMemory:Re,wasmModule:Tf})},allocateUnusedWorker:function(){var c=mf("duckdb_wasm.worker.js");x.unusedWorkers.push(new Worker(c))},getNewWorker:function(){return x.unusedWorkers.length==0&&(x.allocateUnusedWorker(),x.loadWasmModuleToWorker(x.unusedWorkers[0])),x.unusedWorkers.pop()}};function Fg(c,u){Oh(c,u),ri(c)}o.establishStackSpace=Fg;function zf(c){if(S)return be(1,0,c);try{ho(c)}catch(u){po(u)}}function Rg(c,u){return ti.get(c)(u)}o.invokeEntryPoint=Rg;function Mg(c,u,f){x.tlsInitFunctions.push(c)}function Ug(c,u,f,y){er("Assertion failed: "+Xt(c)+", at: "+[u?Xt(u):"unknown filename",f,y?Xt(y):"unknown function"])}var ys;Ne?ys=function(){var c=process.hrtime();return c[0]*1e3+c[1]/1e6}:S?ys=function(){return performance.now()-o.__performance_now_clock_drift}:ys=function(){return performance.now()};var Pg=!0;function kg(c){return i()[Ah()>>2]=c,c}function Hf(c,u){var f;if(c===0)f=Date.now();else if((c===1||c===4)&&Pg)f=ys();else return kg(28),-1;return i()[u>>2]=f/1e3|0,i()[u+4>>2]=f%1e3*1e3*1e3|0,0}function Vg(c,u){return Hf(c,u)}function Ng(c,u){if(S)return be(2,1,c,u)}function Lg(c,u){x.threadExitHandlers.push(function(){ti.get(c)(u)})}function xg(c){Bh(c,!it,1),x.threadInit()}function Yf(c){var u=x.getNewWorker();if(!u)return 6;x.runningWorkers.push(u);var f=c.stackBase+c.stackSize,y=x.pthreads[c.pthread_ptr]={worker:u,stackBase:c.stackBase,stackSize:c.stackSize,allocatedOwnStack:c.allocatedOwnStack,threadInfoStruct:c.pthread_ptr},g=y.threadInfoStruct>>2;Atomics.store(s(),g+(60>>2),c.detached),Atomics.store(s(),g+(76>>2),c.stackSize),Atomics.store(s(),g+(72>>2),f),Atomics.store(s(),g+(100>>2),c.stackSize),Atomics.store(s(),g+(100+8>>2),f),Atomics.store(s(),g+(100+12>>2),c.detached),u.pthread=y;var I={cmd:"run",start_routine:c.startRoutine,arg:c.arg,threadInfoStruct:c.pthread_ptr,stackBase:c.stackBase,stackSize:c.stackSize};return u.runPthread=function(){I.time=performance.now(),u.postMessage(I,c.transferList)},u.loaded&&(u.runPthread(),delete u.runPthread),0}function Cg(c,u,f,y){if(typeof SharedArrayBuffer=="undefined")return D("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var g=[],I=0;if(S&&(g.length===0||I))return Th(687865856,c,u,f,y);if(I)return I;var B=0,V=0,ae=0;u&&u!=-1?(B=i()[u>>2],B+=2097152,V=i()[u+8>>2],ae=i()[u+12>>2]!==0):B=2097152;var Xe=V==0;Xe?V=Eh(16,B):(V-=B,lo(V>0));var st={stackBase:V,stackSize:B,allocatedOwnStack:Xe,detached:ae,startRoutine:f,pthread_ptr:c,arg:y,transferList:g};return S?(st.cmd="spawnThread",postMessage(st,g),0):Yf(st)}function jg(){postMessage({cmd:"detachedExit"})}function qg(c){for(;x.threadExitHandlers.length>0;)x.threadExitHandlers.pop()()}function Gf(c,u,f){if(c<=0||c>t().length||c&!0)return-28;if(me){if(Atomics.load(i(),c>>2)!=u)return-6;for(var g=performance.now(),I=g+f,B=Atomics.exchange(i(),ii>>2,c);;){if(g=performance.now(),g>I)return B=Atomics.exchange(i(),ii>>2,0),-73;if(B=Atomics.exchange(i(),ii>>2,0),B==0)break;if(vo(),Atomics.load(i(),c>>2)!=u)return-6;B=Atomics.exchange(i(),ii>>2,c)}return 0}else{var y=Atomics.wait(i(),c>>2,u,f);if(y==="timed-out")return-73;if(y==="not-equal")return-6;if(y==="ok")return 0;throw"Atomics.wait returned an unexpected value "+y}}function Kf(){Ne||it||ds("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function Wg(c,u,f){if(!c)return D("pthread_join attempted on a null thread pointer!"),71;if(S&&To()==c)return D("PThread "+c+" is attempting to join to itself!"),16;if(!S&&vh()==c)return D("Main thread "+c+" is attempting to join to itself!"),16;var y=i()[c+8>>2];if(y!==c)return D("pthread_join attempted on thread "+c+", which does not point to a valid thread, or does not exist anymore!"),71;var g=Atomics.load(s(),c+60>>2);if(g)return D("Attempted to join thread "+c+", which was already detached!"),28;for(f&&Kf();;){var I=Atomics.load(s(),c+0>>2);if(I==1){if(u){var B=Atomics.load(s(),c+88>>2);i()[u>>2]=B}return Atomics.store(s(),c+60>>2,1),S?postMessage({cmd:"cleanupThread",thread:c}):qf(c),0}if(!f)return 10;Sh(),S||vo(),Gf(c+0,I,S?100:1)}}function zg(c,u){return Wg(c,u,!0)}var $e={mappings:{},buffers:[null,[],[]],printChar:function(c,u){var f=$e.buffers[c];u===0||u===10?((c===1?gf:D)(Sf(f,0)),f.length=0):f.push(u)},varargs:void 0,get:function(){$e.varargs+=4;var c=i()[$e.varargs-4>>2];return c},getStr:function(c){var u=Xt(c);return u},get64:function(c,u){return c}};function $f(c,u){return S?be(3,1,c,u):(c=$e.getStr(c),$e.doAccess(c,u))}function Jf(c,u,f){return S?be(4,1,c,u,f):($e.varargs=f,0)}function Qf(c,u){if(S)return be(5,1,c,u)}function Zf(c,u,f,y){if(S)return be(6,1,c,u,f,y)}function Xf(c,u,f){if(S)return be(7,1,c,u,f)}function Hg(){return 42}function eh(c,u,f){return S?be(8,1,c,u,f):($e.varargs=f,0)}function Yg(c,u,f){return 0}function th(c,u){return S?be(9,1,c,u):(c=$e.getStr(c),$e.doMkdir(c,u))}function rh(c,u,f){if(S)return be(10,1,c,u,f);$e.varargs=f}function nh(c,u){if(S)return be(11,1,c,u)}function ih(c){if(S)return be(12,1,c)}function sh(c,u){if(S)return be(13,1,c,u)}function oh(c){if(S)return be(14,1,c)}function Gg(c,u){er("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Kg(c,u){er("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function $g(c,u){if(c==u)postMessage({cmd:"processQueuedMainThreadWork"});else if(S)postMessage({targetThread:c,cmd:"processThreadQueue"});else{var f=x.pthreads[c],y=f&&f.worker;if(!y)return;y.postMessage({cmd:"processThreadQueue"})}return 1}function Jg(){er("")}function Qg(c,u){return globalThis.DUCKDB_RUNTIME.createDirectory(o,c,u)}function Zg(c,u){return globalThis.DUCKDB_RUNTIME.checkDirectory(o,c,u)}function Xg(c,u){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(o,c,u)}function ev(c,u){return globalThis.DUCKDB_RUNTIME.removeDirectory(o,c,u)}function tv(c){return globalThis.DUCKDB_RUNTIME.closeFile(o,c)}function rv(c,u){return globalThis.DUCKDB_RUNTIME.checkFile(o,c,u)}function nv(c){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(o,c)}function iv(c,u,f,y){return globalThis.DUCKDB_RUNTIME.moveFile(o,c,u,f,y)}function sv(c){return globalThis.DUCKDB_RUNTIME.openFile(o,c)}function ov(c,u,f,y){return globalThis.DUCKDB_RUNTIME.readFile(o,c,u,f,y)}function av(c,u){return globalThis.DUCKDB_RUNTIME.truncateFile(o,c,u)}function cv(c,u,f,y){return globalThis.DUCKDB_RUNTIME.writeFile(o,c,u,f,y)}function uv(c,u){return globalThis.DUCKDB_RUNTIME.glob(o,c,u)}function lv(c){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(o,c)}function dv(c,u){}function fv(){return 2147483648}function hv(c,u,f){n().copyWithin(c,u,u+f)}function pv(){return Ne?$b().cpus().length:navigator.hardwareConcurrency}function be(c,u){for(var f=arguments.length-2,y=ms(),g=f,I=ni(g*8),B=I>>3,V=0;V<f;V++){var ae=arguments[2+V];a()[B+V]=ae}var Xe=Ih(c,g,I,u);return ri(y),Xe}var Rc=[];function yv(c,u,f){Rc.length=u;for(var y=f>>3,g=0;g<u;g++)Rc[g]=a()[y+g];var I=c<0,B=I?Og[-c-1]:Wv[c];return B.apply(null,Rc)}function _v(c){try{return Re.grow(c-It.byteLength+65535>>>16),En(Re.buffer),1}catch(u){}}function mv(c){var u=n().length;if(c=c>>>0,c<=u)return!1;var f=2147483648;if(c>f)return!1;for(var y=1;y<=4;y*=2){var g=u*(1+.2/y);g=Math.min(g,c+100663296);var I=Math.min(f,ag(Math.max(c,g),65536)),B=_v(I);if(B)return!0}return!1}var ee={inEventHandler:0,removeAllEventListeners:function(){for(var c=ee.eventHandlers.length-1;c>=0;--c)ee._removeHandler(c);ee.eventHandlers=[],ee.deferredCalls=[]},registerRemoveEventListeners:function(){ee.removeEventListenersRegistered||(fg.push(ee.removeAllEventListeners),ee.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(c,u,f){function y(B,V){if(B.length!=V.length)return!1;for(var ae in B)if(B[ae]!=V[ae])return!1;return!0}for(var g in ee.deferredCalls){var I=ee.deferredCalls[g];if(I.targetFunction==c&&y(I.argsList,f))return}ee.deferredCalls.push({targetFunction:c,precedence:u,argsList:f}),ee.deferredCalls.sort(function(B,V){return B.precedence<V.precedence})},removeDeferredCalls:function(c){for(var u=0;u<ee.deferredCalls.length;++u)ee.deferredCalls[u].targetFunction==c&&(ee.deferredCalls.splice(u,1),--u)},canPerformEventHandlerRequests:function(){return ee.inEventHandler&&ee.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(!!ee.canPerformEventHandlerRequests())for(var c=0;c<ee.deferredCalls.length;++c){var u=ee.deferredCalls[c];ee.deferredCalls.splice(c,1),--c,u.targetFunction.apply(null,u.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(c,u){for(var f=0;f<ee.eventHandlers.length;++f)ee.eventHandlers[f].target==c&&(!u||u==ee.eventHandlers[f].eventTypeString)&&ee._removeHandler(f--)},_removeHandler:function(c){var u=ee.eventHandlers[c];u.target.removeEventListener(u.eventTypeString,u.eventListenerFunc,u.useCapture),ee.eventHandlers.splice(c,1)},registerOrRemoveHandler:function(c){var u=function(g){++ee.inEventHandler,ee.currentEventHandler=c,ee.runDeferredCalls(),c.handlerFunc(g),ee.runDeferredCalls(),--ee.inEventHandler};if(c.callbackfunc)c.eventListenerFunc=u,c.target.addEventListener(c.eventTypeString,u,c.useCapture),ee.eventHandlers.push(c),ee.registerRemoveEventListeners();else for(var f=0;f<ee.eventHandlers.length;++f)ee.eventHandlers[f].target==c.target&&ee.eventHandlers[f].eventTypeString==c.eventTypeString&&ee._removeHandler(f--)},queueEventHandlerOnThread_iiii:function(c,u,f,y,g){var I=ms(),B=ni(12);i()[B>>2]=f,i()[B+4>>2]=y,i()[B+8>>2]=g,kc(0,c,637534208,u,y,B),ri(I)},getTargetThreadForEventCallback:function(c){switch(c){case 1:return 0;case 2:return x.currentProxiedOperationCallerThread;default:return c}},getNodeNameForTarget:function(c){return c?c==window?"#window":c==screen?"#screen":c&&c.nodeName?c.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function bv(c){var u=Of(c)+1,f=Vc(u);return Af(c,f,u),f}function gv(c,u,f,y){var g=ms(),I=ni(12),B=0;u&&(B=bv(u)),i()[I>>2]=B,i()[I+4>>2]=f,i()[I+8>>2]=y,kc(0,c,657457152,0,B,I),ri(g)}function vv(c,u,f,y){u=u?Xt(u):"",gv(c,u,f,y)}function Tv(c){return c>2?Xt(c):c}var Iv=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function wv(c){c=Tv(c);var u=Iv[c]||(typeof document!="undefined"?document.querySelector(c):void 0);return u}function Mc(c){return wv(c)}function ah(c,u,f){var y=Mc(c);if(!y)return-4;if(y.canvasSharedPtr&&(i()[y.canvasSharedPtr>>2]=u,i()[y.canvasSharedPtr+4>>2]=f),y.offscreenCanvas||!y.controlTransferredOffscreen){y.offscreenCanvas&&(y=y.offscreenCanvas);var g=!1;if(y.GLctxObject&&y.GLctxObject.GLctx){var I=y.GLctxObject.GLctx.getParameter(2978);g=I[0]===0&&I[1]===0&&I[2]===y.width&&I[3]===y.height}y.width=u,y.height=f,g&&y.GLctxObject.GLctx.viewport(0,0,u,f)}else if(y.canvasSharedPtr){var B=i()[y.canvasSharedPtr+8>>2];return vv(B,c,u,f),1}else return-4;return 0}function ch(c,u,f){return S?be(15,1,c,u,f):ah(c,u,f)}function Sv(c,u,f){var y=Mc(c);return y?ah(c,u,f):ch(c,u,f)}function Bv(c){}function Av(){if(!hs())try{S?wh(On):ho(On)}catch(c){po(c)}}function Ov(c,u){if(!uo){if(u){c();return}try{c(),S&&Av()}catch(f){po(f)}}}function Ev(){Dc+=1}function Dv(){Dc-=1}function Fv(c,u,f){return Ev(),setTimeout(function(){Dv(),Ov(function(){ti.get(c)(f)})},u)}function Rv(){throw"unwind"}function Mv(c){var u=c.getExtension("ANGLE_instanced_arrays");if(u)return c.vertexAttribDivisor=function(f,y){u.vertexAttribDivisorANGLE(f,y)},c.drawArraysInstanced=function(f,y,g,I){u.drawArraysInstancedANGLE(f,y,g,I)},c.drawElementsInstanced=function(f,y,g,I,B){u.drawElementsInstancedANGLE(f,y,g,I,B)},1}function Uv(c){var u=c.getExtension("OES_vertex_array_object");if(u)return c.createVertexArray=function(){return u.createVertexArrayOES()},c.deleteVertexArray=function(f){u.deleteVertexArrayOES(f)},c.bindVertexArray=function(f){u.bindVertexArrayOES(f)},c.isVertexArray=function(f){return u.isVertexArrayOES(f)},1}function Pv(c){var u=c.getExtension("WEBGL_draw_buffers");if(u)return c.drawBuffers=function(f,y){u.drawBuffersWEBGL(f,y)},1}function kv(c){return!!(c.multiDrawWebgl=c.getExtension("WEBGL_multi_draw"))}var Se={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function(u){Se.lastError||(Se.lastError=u)},getNewId:function(c){for(var u=Se.counter++,f=c.length;f<u;f++)c[f]=null;return u},getSource:function(c,u,f,y){for(var g="",I=0;I<u;++I){var B=y?i()[y+I*4>>2]:-1;g+=Xt(i()[f+I*4>>2],B<0?void 0:B)}return g},createContext:function(c,u){c.getContextSafariWebGL2Fixed||(c.getContextSafariWebGL2Fixed=c.getContext,c.getContext=function(g,I){var B=c.getContextSafariWebGL2Fixed(g,I);return g=="webgl"==B instanceof WebGLRenderingContext?B:null});var f=c.getContext("webgl",u);if(!f)return 0;var y=Se.registerContext(f,u);return y},registerContext:function(c,u){var f=Vc(8);i()[f+4>>2]=To();var y={handle:f,attributes:u,version:u.majorVersion,GLctx:c};return c.canvas&&(c.canvas.GLctxObject=y),Se.contexts[f]=y,(typeof u.enableExtensionsByDefault=="undefined"||u.enableExtensionsByDefault)&&Se.initExtensions(y),f},makeContextCurrent:function(c){return Se.currentContext=Se.contexts[c],o.ctx=gh=Se.currentContext&&Se.currentContext.GLctx,!(c&&!gh)},getContext:function(c){return Se.contexts[c]},deleteContext:function(c){Se.currentContext===Se.contexts[c]&&(Se.currentContext=null),typeof ee=="object"&&ee.removeAllHandlersOnTarget(Se.contexts[c].GLctx.canvas),Se.contexts[c]&&Se.contexts[c].GLctx.canvas&&(Se.contexts[c].GLctx.canvas.GLctxObject=void 0),Io(Se.contexts[c].handle),Se.contexts[c]=null},initExtensions:function(c){if(c||(c=Se.currentContext),!c.initExtensionsDone){c.initExtensionsDone=!0;var u=c.GLctx;Mv(u),Uv(u),Pv(u),u.disjointTimerQueryExt=u.getExtension("EXT_disjoint_timer_query"),kv(u);var f=u.getSupportedExtensions()||[];f.forEach(function(y){!y.includes("lose_context")&&!y.includes("debug")&&u.getExtension(y)})}}},Vv=["default","low-power","high-performance"];function Nv(c,u){var f=u>>2,y=i()[f+(24>>2)],g={alpha:!!i()[f+(0>>2)],depth:!!i()[f+(4>>2)],stencil:!!i()[f+(8>>2)],antialias:!!i()[f+(12>>2)],premultipliedAlpha:!!i()[f+(16>>2)],preserveDrawingBuffer:!!i()[f+(20>>2)],powerPreference:Vv[y],failIfMajorPerformanceCaveat:!!i()[f+(28>>2)],majorVersion:i()[f+(32>>2)],minorVersion:i()[f+(36>>2)],enableExtensionsByDefault:i()[f+(40>>2)],explicitSwapControl:i()[f+(44>>2)],proxyContextToMainThread:i()[f+(48>>2)],renderViaOffscreenBackBuffer:i()[f+(52>>2)]},I=Mc(c);if(!I||g.explicitSwapControl)return 0;var B=Se.createContext(I,g);return B}function Lv(c,u){return Nv(c,u)}var Uc={};function xv(){return re||"./this.program"}function _s(){if(!_s.strings){var c=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",u={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:c,_:xv()};for(var f in Uc)Uc[f]===void 0?delete u[f]:u[f]=Uc[f];var y=[];for(var f in u)y.push(f+"="+u[f]);_s.strings=y}return _s.strings}function uh(c,u){if(S)return be(16,1,c,u);var f=0;return _s().forEach(function(y,g){var I=u+f;i()[c+g*4>>2]=I,og(y,I),f+=y.length+1}),0}function lh(c,u){if(S)return be(17,1,c,u);var f=_s();i()[c>>2]=f.length;var y=0;return f.forEach(function(g){y+=g.length+1}),i()[u>>2]=y,0}function dh(c){return S?be(18,1,c):0}function fh(c,u){if(S)return be(19,1,c,u);var f=c==1||c==2?2:er();return t()[u>>0]=f,0}function hh(c,u,f,y,g,I){if(S)return be(20,1,c,u,f,y,g,I);var B=$e.getStreamFromFD(c),V=$e.doReadv(B,u,f,y);return i()[I>>2]=V,0}function ph(c,u,f,y,g,I){if(S)return be(21,1,c,u,f,y,g,I);var B=$e.getStreamFromFD(c),V=$e.doWritev(B,u,f,y);return i()[I>>2]=V,0}function yh(c,u,f,y){if(S)return be(22,1,c,u,f,y);var g=$e.getStreamFromFD(c),I=$e.doReadv(g,u,f);return i()[y>>2]=I,0}function _h(c,u,f,y,g){if(S)return be(23,1,c,u,f,y,g)}function mh(c){if(S)return be(24,1,c);var u=$e.getStreamFromFD(c);return u.stream_ops&&u.stream_ops.fsync?-u.stream_ops.fsync(u):0}function bh(c,u,f,y){if(S)return be(25,1,c,u,f,y);for(var g=0,I=0;I<f;I++){for(var B=i()[u+I*8>>2],V=i()[u+(I*8+4)>>2],ae=0;ae<V;ae++)$e.printChar(c,n()[B+ae]);g+=V}return i()[y>>2]=g,0}function Cv(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var c=new Uint8Array(1);return function(){return crypto.getRandomValues(c),c[0]}}else if(Ne)try{var u=LT("crypto");return function(){return u.randomBytes(1)[0]}}catch(f){}return function(){er("randomDevice")}}function yo(c,u){yo.randomDevice||(yo.randomDevice=Cv());for(var f=0;f<u;f++)t()[c+f>>0]=yo.randomDevice();return 0}function _o(c){return c%4==0&&(c%100!=0||c%400==0)}function Pc(c,u){for(var f=0,y=0;y<=u;f+=c[y++]);return f}var mo=[31,29,31,30,31,30,31,31,30,31,30,31],bo=[31,28,31,30,31,30,31,31,30,31,30,31];function go(c,u){for(var f=new Date(c.getTime());u>0;){var y=_o(f.getFullYear()),g=f.getMonth(),I=(y?mo:bo)[g];if(u>I-f.getDate())u-=I-f.getDate()+1,f.setDate(1),g<11?f.setMonth(g+1):(f.setMonth(0),f.setFullYear(f.getFullYear()+1));else return f.setDate(f.getDate()+u),f}return f}function jv(c,u,f,y){var g=i()[y+40>>2],I={tm_sec:i()[y>>2],tm_min:i()[y+4>>2],tm_hour:i()[y+8>>2],tm_mday:i()[y+12>>2],tm_mon:i()[y+16>>2],tm_year:i()[y+20>>2],tm_wday:i()[y+24>>2],tm_yday:i()[y+28>>2],tm_isdst:i()[y+32>>2],tm_gmtoff:i()[y+36>>2],tm_zone:g?Xt(g):""},B=Xt(f),V={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var ae in V)B=B.replace(new RegExp(ae,"g"),V[ae]);var Xe=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],st=["January","February","March","April","May","June","July","August","September","October","November","December"];function gs(O,C,ze){for(var he=typeof O=="number"?O.toString():O||"";he.length<C;)he=ze[0]+he;return he}function ut(O,C){return gs(O,C,"0")}function tr(O,C){function ze(rr){return rr<0?-1:rr>0?1:0}var he;return(he=ze(O.getFullYear()-C.getFullYear()))===0&&(he=ze(O.getMonth()-C.getMonth()))===0&&(he=ze(O.getDate()-C.getDate())),he}function We(O){switch(O.getDay()){case 0:return new Date(O.getFullYear()-1,11,29);case 1:return O;case 2:return new Date(O.getFullYear(),0,3);case 3:return new Date(O.getFullYear(),0,2);case 4:return new Date(O.getFullYear(),0,1);case 5:return new Date(O.getFullYear()-1,11,31);case 6:return new Date(O.getFullYear()-1,11,30)}}function Br(O){var C=go(new Date(O.tm_year+1900,0,1),O.tm_yday),ze=new Date(C.getFullYear(),0,4),he=new Date(C.getFullYear()+1,0,4),rr=We(ze),qr=We(he);return tr(rr,C)<=0?tr(qr,C)<=0?C.getFullYear()+1:C.getFullYear():C.getFullYear()-1}var vs={"%a":function(O){return Xe[O.tm_wday].substring(0,3)},"%A":function(O){return Xe[O.tm_wday]},"%b":function(O){return st[O.tm_mon].substring(0,3)},"%B":function(O){return st[O.tm_mon]},"%C":function(O){var C=O.tm_year+1900;return ut(C/100|0,2)},"%d":function(O){return ut(O.tm_mday,2)},"%e":function(O){return gs(O.tm_mday,2," ")},"%g":function(O){return Br(O).toString().substring(2)},"%G":function(O){return Br(O)},"%H":function(O){return ut(O.tm_hour,2)},"%I":function(O){var C=O.tm_hour;return C==0?C=12:C>12&&(C-=12),ut(C,2)},"%j":function(O){return ut(O.tm_mday+Pc(_o(O.tm_year+1900)?mo:bo,O.tm_mon-1),3)},"%m":function(O){return ut(O.tm_mon+1,2)},"%M":function(O){return ut(O.tm_min,2)},"%n":function(){return`
|
|
18
|
-
`},"%p":function(O){return O.tm_hour>=0&&O.tm_hour<12?"AM":"PM"},"%S":function(O){return ut(O.tm_sec,2)},"%t":function(){return" "},"%u":function(O){return O.tm_wday||7},"%U":function(O){var C=new Date(O.tm_year+1900,0,1),ze=C.getDay()===0?C:go(C,7-C.getDay()),he=new Date(O.tm_year+1900,O.tm_mon,O.tm_mday);if(tr(ze,he)<0){var rr=Pc(_o(he.getFullYear())?mo:bo,he.getMonth()-1)-31,qr=31-ze.getDate(),Fn=qr+rr+he.getDate();return ut(Math.ceil(Fn/7),2)}return tr(ze,C)===0?"01":"00"},"%V":function(O){var C=new Date(O.tm_year+1900,0,4),ze=new Date(O.tm_year+1901,0,4),he=We(C),rr=We(ze),qr=go(new Date(O.tm_year+1900,0,1),O.tm_yday);if(tr(qr,he)<0)return"53";if(tr(rr,qr)<=0)return"01";var Fn;return he.getFullYear()<O.tm_year+1900?Fn=O.tm_yday+32-he.getDate():Fn=O.tm_yday+1-he.getDate(),ut(Math.ceil(Fn/7),2)},"%w":function(O){return O.tm_wday},"%W":function(O){var C=new Date(O.tm_year,0,1),ze=C.getDay()===1?C:go(C,C.getDay()===0?1:7-C.getDay()+1),he=new Date(O.tm_year+1900,O.tm_mon,O.tm_mday);if(tr(ze,he)<0){var rr=Pc(_o(he.getFullYear())?mo:bo,he.getMonth()-1)-31,qr=31-ze.getDate(),Fn=qr+rr+he.getDate();return ut(Math.ceil(Fn/7),2)}return tr(ze,C)===0?"01":"00"},"%y":function(O){return(O.tm_year+1900).toString().substring(2)},"%Y":function(O){return O.tm_year+1900},"%z":function(O){var C=O.tm_gmtoff,ze=C>=0;return C=Math.abs(C)/60,C=C/60*100+C%60,(ze?"+":"-")+String("0000"+C).slice(-4)},"%Z":function(O){return O.tm_zone},"%%":function(){return"%"}};for(var ae in vs)B.includes(ae)&&(B=B.replace(new RegExp(ae,"g"),vs[ae](I)));var Lc=zv(B,!1);return Lc.length>u?0:(Ef(Lc,c),Lc.length-1)}function qv(c,u,f,y){return jv(c,u,f,y)}S||x.initMainThreadBlock();var gh,Wv=[null,zf,Ng,$f,Jf,Qf,Zf,Xf,eh,th,rh,nh,ih,sh,oh,ch,uh,lh,dh,fh,hh,ph,yh,_h,mh,bh];function zv(c,u,f){var y=f>0?f:Of(c)+1,g=new Array(y),I=Bf(c,g,0,g.length);return u&&(g.length=I),g}var Hv={b:Ug,pa:Vg,ea:Lg,ja:xg,w:Cg,ia:jg,S:qg,Z:zg,P:$f,i:Jf,R:Qf,Q:Zf,N:Xf,o:Hg,W:eh,K:Yg,O:th,v:rh,L:nh,q:ih,s:sh,r:oh,V:Gg,U:Kg,oa:$g,e:Jg,t:Hf,F:Qg,G:Zg,D:Xg,E:ev,n:tv,B:rv,I:nv,C:iv,J:sv,h:ov,H:av,m:cv,A:uv,l:lv,ba:Kf,p:dv,d:Gf,c:jf,X:fv,g:ys,da:hv,Y:pv,la:yv,fa:mv,ma:Sv,k:Bv,ka:Fv,ga:Rv,na:Lv,$:uh,aa:lh,ha:ho,f:dh,ca:fh,y:hh,x:ph,u:yh,z:_h,M:mh,j:bh,T:yo,a:Re||o.wasmMemory,_:qv},PE=Ag(),Yv=o.___wasm_call_ctors=function(){return(Yv=o.___wasm_call_ctors=o.asm.qa).apply(null,arguments)},Gv=o._main=function(){return(Gv=o._main=o.asm.ra).apply(null,arguments)},Kv=o._duckdb_web_fs_glob_add_path=function(){return(Kv=o._duckdb_web_fs_glob_add_path=o.asm.ta).apply(null,arguments)},$v=o._duckdb_web_clear_response=function(){return($v=o._duckdb_web_clear_response=o.asm.ua).apply(null,arguments)},Jv=o._duckdb_web_fail_with=function(){return(Jv=o._duckdb_web_fail_with=o.asm.va).apply(null,arguments)},Qv=o._duckdb_web_reset=function(){return(Qv=o._duckdb_web_reset=o.asm.wa).apply(null,arguments)},Zv=o._duckdb_web_connect=function(){return(Zv=o._duckdb_web_connect=o.asm.xa).apply(null,arguments)},Xv=o._duckdb_web_disconnect=function(){return(Xv=o._duckdb_web_disconnect=o.asm.ya).apply(null,arguments)},eT=o._duckdb_web_flush_files=function(){return(eT=o._duckdb_web_flush_files=o.asm.za).apply(null,arguments)},tT=o._duckdb_web_flush_file=function(){return(tT=o._duckdb_web_flush_file=o.asm.Aa).apply(null,arguments)},rT=o._duckdb_web_open=function(){return(rT=o._duckdb_web_open=o.asm.Ba).apply(null,arguments)},nT=o._duckdb_web_collect_file_stats=function(){return(nT=o._duckdb_web_collect_file_stats=o.asm.Ca).apply(null,arguments)},iT=o._duckdb_web_export_file_stats=function(){return(iT=o._duckdb_web_export_file_stats=o.asm.Da).apply(null,arguments)},sT=o._duckdb_web_fs_drop_file=function(){return(sT=o._duckdb_web_fs_drop_file=o.asm.Ea).apply(null,arguments)},oT=o._duckdb_web_fs_drop_files=function(){return(oT=o._duckdb_web_fs_drop_files=o.asm.Fa).apply(null,arguments)},aT=o._duckdb_web_fs_glob_file_infos=function(){return(aT=o._duckdb_web_fs_glob_file_infos=o.asm.Ga).apply(null,arguments)},cT=o._duckdb_web_fs_get_file_info_by_id=function(){return(cT=o._duckdb_web_fs_get_file_info_by_id=o.asm.Ha).apply(null,arguments)},uT=o._duckdb_web_fs_get_file_info_by_name=function(){return(uT=o._duckdb_web_fs_get_file_info_by_name=o.asm.Ia).apply(null,arguments)},lT=o._duckdb_web_fs_set_file_descriptor=function(){return(lT=o._duckdb_web_fs_set_file_descriptor=o.asm.Ja).apply(null,arguments)},dT=o._duckdb_web_fs_register_file_url=function(){return(dT=o._duckdb_web_fs_register_file_url=o.asm.Ka).apply(null,arguments)},fT=o._duckdb_web_fs_register_file_buffer=function(){return(fT=o._duckdb_web_fs_register_file_buffer=o.asm.La).apply(null,arguments)},hT=o._duckdb_web_copy_file_to_buffer=function(){return(hT=o._duckdb_web_copy_file_to_buffer=o.asm.Ma).apply(null,arguments)},pT=o._duckdb_web_copy_file_to_path=function(){return(pT=o._duckdb_web_copy_file_to_path=o.asm.Na).apply(null,arguments)},yT=o._duckdb_web_get_version=function(){return(yT=o._duckdb_web_get_version=o.asm.Oa).apply(null,arguments)},_T=o._duckdb_web_get_feature_flags=function(){return(_T=o._duckdb_web_get_feature_flags=o.asm.Pa).apply(null,arguments)},mT=o._duckdb_web_tokenize=function(){return(mT=o._duckdb_web_tokenize=o.asm.Qa).apply(null,arguments)},bT=o._duckdb_web_prepared_create=function(){return(bT=o._duckdb_web_prepared_create=o.asm.Ra).apply(null,arguments)},gT=o._duckdb_web_prepared_close=function(){return(gT=o._duckdb_web_prepared_close=o.asm.Sa).apply(null,arguments)},vT=o._duckdb_web_prepared_run=function(){return(vT=o._duckdb_web_prepared_run=o.asm.Ta).apply(null,arguments)},TT=o._duckdb_web_prepared_send=function(){return(TT=o._duckdb_web_prepared_send=o.asm.Ua).apply(null,arguments)},IT=o._duckdb_web_query_run=function(){return(IT=o._duckdb_web_query_run=o.asm.Va).apply(null,arguments)},wT=o._duckdb_web_query_send=function(){return(wT=o._duckdb_web_query_send=o.asm.Wa).apply(null,arguments)},ST=o._duckdb_web_query_fetch_results=function(){return(ST=o._duckdb_web_query_fetch_results=o.asm.Xa).apply(null,arguments)},BT=o._duckdb_web_insert_arrow_from_ipc_stream=function(){return(BT=o._duckdb_web_insert_arrow_from_ipc_stream=o.asm.Ya).apply(null,arguments)},AT=o._duckdb_web_insert_csv_from_path=function(){return(AT=o._duckdb_web_insert_csv_from_path=o.asm.Za).apply(null,arguments)},OT=o._duckdb_web_insert_json_from_path=function(){return(OT=o._duckdb_web_insert_json_from_path=o.asm._a).apply(null,arguments)},ET=o._emscripten_tls_init=function(){return(ET=o._emscripten_tls_init=o.asm.$a).apply(null,arguments)},DT=o._emscripten_current_thread_process_queued_calls=function(){return(DT=o._emscripten_current_thread_process_queued_calls=o.asm.ab).apply(null,arguments)},vh=o._emscripten_main_browser_thread_id=function(){return(vh=o._emscripten_main_browser_thread_id=o.asm.bb).apply(null,arguments)},Th=o._emscripten_sync_run_in_main_thread_4=function(){return(Th=o._emscripten_sync_run_in_main_thread_4=o.asm.cb).apply(null,arguments)},vo=o._emscripten_main_thread_process_queued_calls=function(){return(vo=o._emscripten_main_thread_process_queued_calls=o.asm.db).apply(null,arguments)},Ih=o._emscripten_run_in_main_runtime_thread_js=function(){return(Ih=o._emscripten_run_in_main_runtime_thread_js=o.asm.eb).apply(null,arguments)},kc=o.__emscripten_call_on_thread=function(){return(kc=o.__emscripten_call_on_thread=o.asm.fb).apply(null,arguments)},wh=o.__emscripten_thread_exit=function(){return(wh=o.__emscripten_thread_exit=o.asm.gb).apply(null,arguments)},Sh=o._pthread_testcancel=function(){return(Sh=o._pthread_testcancel=o.asm.hb).apply(null,arguments)},Bh=o.__emscripten_thread_init=function(){return(Bh=o.__emscripten_thread_init=o.asm.ib).apply(null,arguments)},Ah=o.___errno_location=function(){return(Ah=o.___errno_location=o.asm.jb).apply(null,arguments)},To=o._pthread_self=function(){return(To=o._pthread_self=o.asm.kb).apply(null,arguments)},ms=o.stackSave=function(){return(ms=o.stackSave=o.asm.lb).apply(null,arguments)},ri=o.stackRestore=function(){return(ri=o.stackRestore=o.asm.mb).apply(null,arguments)},ni=o.stackAlloc=function(){return(ni=o.stackAlloc=o.asm.nb).apply(null,arguments)},Oh=o._emscripten_stack_set_limits=function(){return(Oh=o._emscripten_stack_set_limits=o.asm.ob).apply(null,arguments)},Vc=o._malloc=function(){return(Vc=o._malloc=o.asm.pb).apply(null,arguments)},Io=o._free=function(){return(Io=o._free=o.asm.qb).apply(null,arguments)},Eh=o._memalign=function(){return(Eh=o._memalign=o.asm.rb).apply(null,arguments)},Dh=o.__emscripten_allow_main_runtime_queued_calls=939456,ii=o.__emscripten_main_thread_futex=1038800;o.ccall=sg,o.keepRuntimeAlive=hs,o.PThread=x,o.PThread=x,o.wasmMemory=Re,o.ExitStatus=bs;var wo;function bs(c){this.name="ExitStatus",this.message="Program terminated with exit("+c+")",this.status=c}var FT=!1;ps=function c(){wo||Nc(),wo||(ps=c)};function RT(c){var u=o._main,f=0,y=0;try{var g=u(f,y);return Fh(g,!0),g}catch(I){return po(I)}finally{FT=!0}}function Nc(c){if(c=c||U,Dn>0)return;if(S){d(o),Lf(),postMessage({cmd:"loaded"});return}if(yg(),Dn>0)return;function u(){wo||(wo=!0,o.calledRun=!0,!uo&&(Lf(),_g(),d(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),Rh&&RT(c),bg()))}o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),u()},1)):u()}o.run=Nc;function Fh(c,u){if(On=c,!u&&S)throw zf(c),"unwind";hs()||mg(),MT(c)}function MT(c){On=c,hs()||(x.terminateAllThreads(),o.onExit&&o.onExit(c),uo=!0),_e(c,new bs(c))}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var Rh=!0;return o.noInitialRun&&(Rh=!1),S&&(vf=!1,x.initWorker()),Nc(),e.ready}}();typeof Oc=="object"&&typeof lf=="object"?lf.exports=uf:typeof define=="function"&&define.amd?define([],function(){return uf}):typeof Oc=="object"&&(Oc.DuckDB=uf)});var DE={};xT(DE,{registerWorker:()=>tg});var Wb=nr(Is()),zb=nr(ga()),is=nr(Xs()),ss=nr(za()),Hb=nr(Eb()),Yb=nr(Rb()),Bc=nr(Mb()),Ac=nr(Ub()),p=nr(qb());Wb.default.toDOMStream=Hb.toDOMStream;zb.Builder.throughDOM=Yb.builderThroughDOMStream;is.RecordBatchReader.throughDOM=Bc.recordBatchReaderThroughDOMStream;is.RecordBatchFileReader.throughDOM=Bc.recordBatchReaderThroughDOMStream;is.RecordBatchStreamReader.throughDOM=Bc.recordBatchReaderThroughDOMStream;ss.RecordBatchWriter.throughDOM=Ac.recordBatchWriterThroughDOMStream;ss.RecordBatchFileWriter.throughDOM=Ac.recordBatchWriterThroughDOMStream;ss.RecordBatchStreamWriter.throughDOM=Ac.recordBatchWriterThroughDOMStream;var nf;(function(s){s[s.NONE=0]="NONE",s[s.DEBUG=1]="DEBUG",s[s.INFO=2]="INFO",s[s.WARNING=3]="WARNING",s[s.ERROR=4]="ERROR"})(nf||(nf={}));var sf;(function(s){s[s.NONE=0]="NONE",s[s.CONNECT=1]="CONNECT",s[s.DISCONNECT=2]="DISCONNECT",s[s.OPEN=3]="OPEN",s[s.QUERY=4]="QUERY"})(sf||(sf={}));var of;(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"})(of||(of={}));var af;(function(s){s[s.NONE=0]="NONE",s[s.WEB_WORKER=1]="WEB_WORKER",s[s.NODE_WORKER=2]="NODE_WORKER",s[s.BINDINGS=3]="BINDINGS",s[s.ASYNC_DUCKDB=4]="ASYNC_DUCKDB"})(af||(af={}));var BE=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 oe;(function(D){D.CLOSE_PREPARED="CLOSE_PREPARED",D.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",D.CONNECT="CONNECT",D.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",D.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",D.CREATE_PREPARED="CREATE_PREPARED",D.DISCONNECT="DISCONNECT",D.DROP_FILE="DROP_FILE",D.DROP_FILES="DROP_FILES",D.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",D.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",D.FLUSH_FILES="FLUSH_FILES",D.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",D.GET_VERSION="GET_VERSION",D.GLOB_FILE_INFOS="GLOB_FILE_INFOS",D.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",D.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",D.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",D.INSTANTIATE="INSTANTIATE",D.OPEN="OPEN",D.PING="PING",D.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",D.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",D.REGISTER_FILE_URL="REGISTER_FILE_URL",D.RESET="RESET",D.RUN_PREPARED="RUN_PREPARED",D.RUN_QUERY="RUN_QUERY",D.SEND_PREPARED="SEND_PREPARED",D.SEND_QUERY="SEND_QUERY",D.TOKENIZE="TOKENIZE"})(oe||(oe={}));var ke;(function(S){S.CONNECTION_INFO="CONNECTION_INFO",S.ERROR="ERROR",S.FEATURE_FLAGS="FEATURE_FLAGS",S.FILE_BUFFER="FILE_BUFFER",S.FILE_INFOS="FILE_INFOS",S.FILE_SIZE="FILE_SIZE",S.FILE_STATISTICS="FILE_STATISTICS",S.LOG="LOG",S.OK="OK",S.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",S.QUERY_PLAN="QUERY_PLAN",S.QUERY_RESULT="QUERY_RESULT",S.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",S.QUERY_START="QUERY_START",S.REGISTERED_FILE="REGISTERED_FILE",S.SCRIPT_TOKENS="SCRIPT_TOKENS",S.SUCCESS="SUCCESS",S.VERSION_STRING="VERSION_STRING"})(ke||(ke={}));function os(r,e){switch(e.typeId){case p.Type.Binary:return{name:r,type:"binary"};case p.Type.Bool:return{name:r,type:"bool"};case p.Type.Date:return{name:r,type:"date"};case p.Type.DateDay:return{name:r,type:"date32[d]"};case p.Type.DateMillisecond:return{name:r,type:"date64[ms]"};case p.Type.Decimal:{let t=e;return{name:r,type:"decimal",precision:t.precision,scale:t.scale}}case p.Type.Float:return{name:r,type:"float"};case p.Type.Float16:return{name:r,type:"float16"};case p.Type.Float32:return{name:r,type:"float32"};case p.Type.Float64:return{name:r,type:"float64"};case p.Type.Int:return{name:r,type:"int32"};case p.Type.Int16:return{name:r,type:"int16"};case p.Type.Int32:return{name:r,type:"int32"};case p.Type.Int64:return{name:r,type:"int64"};case p.Type.Uint16:return{name:r,type:"uint16"};case p.Type.Uint32:return{name:r,type:"uint32"};case p.Type.Uint64:return{name:r,type:"uint64"};case p.Type.Uint8:return{name:r,type:"uint8"};case p.Type.IntervalDayTime:return{name:r,type:"interval[dt]"};case p.Type.IntervalYearMonth:return{name:r,type:"interval[m]"};case p.Type.List:{let t=e;return{name:r,type:"list",children:[os(t.valueField.name,t.valueField.type)]}}case p.Type.FixedSizeBinary:return{name:r,type:"fixedsizebinary",byteWidth:e.byteWidth};case p.Type.Null:return{name:r,type:"null"};case p.Type.Utf8:return{name:r,type:"utf8"};case p.Type.Struct:return{name:r,type:"struct",children:e.children.map(n=>os(n.name,n.type))};case p.Type.Time:return{name:r,type:"time[s]"};case p.Type.TimeMicrosecond:return{name:r,type:"time[us]"};case p.Type.TimeMillisecond:return{name:r,type:"time[ms]"};case p.Type.TimeNanosecond:return{name:r,type:"time[ns]"};case p.Type.TimeSecond:return{name:r,type:"time[s]"};case p.Type.Timestamp:return{name:r,type:"timestamp",timezone:e.timezone||void 0};case p.Type.TimestampSecond:return{name:r,type:"timestamp[s]",timezone:e.timezone||void 0};case p.Type.TimestampMicrosecond:return{name:r,type:"timestamp[us]",timezone:e.timezone||void 0};case p.Type.TimestampNanosecond:return{name:r,type:"timestamp[ns]",timezone:e.timezone||void 0};case p.Type.TimestampMillisecond:return{name:r,type:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error(`unsupported arrow type: ${e.toString()}`)}var KF=new TextEncoder;var cf=class{constructor(){this._bindings=null;this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:ke.LOG,data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.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:ke.ERROR,data:n},[])}async onMessage(e){switch(e.type){case oe.PING:this.sendOK(e);return;case oe.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 oe.GET_VERSION:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.VERSION_STRING,data:this._bindings.getVersion()},[]);break;case oe.GET_FEATURE_FLAGS:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.FEATURE_FLAGS,data:this._bindings.getFeatureFlags()},[]);break;case oe.RESET:this._bindings.reset(),this.sendOK(e);break;case oe.OPEN:this._bindings.open(e.data),this.sendOK(e);break;case oe.DROP_FILE:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.SUCCESS,data:this._bindings.dropFile(e.data)},[]);break;case oe.DROP_FILES:this._bindings.dropFiles(),this.sendOK(e);break;case oe.FLUSH_FILES:this._bindings.flushFiles(),this.sendOK(e);break;case oe.CONNECT:{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.CONNECTION_INFO,data:t.useUnsafe((n,i)=>i)},[]);break}case oe.DISCONNECT:this._bindings.disconnect(e.data),this.sendOK(e);break;case oe.CREATE_PREPARED:{let t=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.PREPARED_STATEMENT_ID,data:t},[]);break}case oe.CLOSE_PREPARED:{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case oe.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:ke.QUERY_RESULT,data:t},[t.buffer]);break}case oe.RUN_QUERY:{let t=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.QUERY_RESULT,data:t},[t.buffer]);break}case oe.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:ke.QUERY_START,data:t},[t.buffer]);break}case oe.SEND_QUERY:{let t=this._bindings.sendQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.QUERY_START,data:t},[t.buffer]);break}case oe.FETCH_QUERY_RESULTS:{let t=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.QUERY_RESULT_CHUNK,data:t},[t.buffer]);break}case oe.GLOB_FILE_INFOS:{let t=this._bindings.globFiles(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.FILE_INFOS,data:t},[]);break}case oe.REGISTER_FILE_URL:this._bindings.registerFileURL(e.data[0],e.data[1]),this.sendOK(e);break;case oe.REGISTER_FILE_BUFFER:this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case oe.REGISTER_FILE_HANDLE:this._bindings.registerFileHandle(e.data[0],e.data[1]),this.sendOK(e);break;case oe.COPY_FILE_TO_PATH:this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case oe.COPY_FILE_TO_BUFFER:{let t=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.FILE_BUFFER,data:t},[]);break}case oe.COLLECT_FILE_STATISTICS:this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case oe.EXPORT_FILE_STATISTICS:{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.FILE_STATISTICS,data:this._bindings.exportFileStatistics(e.data)},[]);break}case oe.INSERT_ARROW_FROM_IPC_STREAM:{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case oe.INSERT_CSV_FROM_PATH:{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case oe.INSERT_JSON_FROM_PATH:{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case oe.TOKENIZE:{let t=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.SCRIPT_TOKENS,data:t},[]);break}}}catch(t){return this.failWith(e,t)}}};var Xb=nr(Jb());var df=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=p.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),p.Table.from(n)}send(e){let t=this._bindings.sendQuery(this._conn,e),n=new ff(this._bindings,this._conn,t),i=p.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 Qb(this._bindings,this._conn,t)}insertArrowTable(e,t){let n=e.serialize("binary",!0);this.insertArrowFromIPCStream(n,t)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},ff=class{constructor(e,t,n){this.bindings=e;this.conn=t;this.header=n;this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},Qb=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=p.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),p.Table.from(n)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new ff(this.bindings,this.connectionId,t),i=p.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 AE(){let r=new TextDecoder;return e=>(typeof SharedArrayBuffer!="undefined"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),r.decode(e))}var OE=AE();function jr(r,e){r.ccall("duckdb_web_fail_with",null,["string"],[e])}function cs(r,e,t){let n=r.HEAPU8.subarray(e,e+t),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function se(r,e,t){return OE(r.HEAPU8.subarray(e,e+t))}var ft;(function(n){n[n.BUFFER=0]="BUFFER",n[n.NATIVE=1]="NATIVE",n[n.HTTP=3]="HTTP"})(ft||(ft={}));function ye(r,e,t,n){let i=r.stackSave(),s=r.stackAlloc(3*8);t.unshift("number"),n.unshift(s),r.ccall(e,null,t,n);let a=r.HEAPF64[(s>>3)+0],o=r.HEAPF64[(s>>3)+1],d=r.HEAPF64[(s>>3)+2];return r.stackRestore(i),[a,o,d]}function Ve(r){r.ccall("duckdb_web_clear_response",null,[],[])}var hf=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 EE=new TextEncoder,Zb;(function(s){s[s.WASM_EXCEPTIONS=1]="WASM_EXCEPTIONS",s[s.WASM_THREADS=2]="WASM_THREADS",s[s.WASM_SIMD=4]="WASM_SIMD",s[s.WASM_BULK_MEMORY=8]="WASM_BULK_MEMORY",s[s.EMIT_BIGINT=16]="EMIT_BIGINT"})(Zb||(Zb={}));var pf=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]=ye(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));Ve(this.mod)}reset(){let[e,t,n]=ye(this.mod,"duckdb_web_reset",[],[]);if(e!==de.SUCCESS)throw new Error(se(this.mod,t,n));Ve(this.mod)}getVersion(){let[e,t,n]=ye(this.mod,"duckdb_web_get_version",[],[]);if(e!==de.SUCCESS)throw new Error(se(this.mod,t,n));let i=se(this.mod,t,n);return Ve(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,n,i]=ye(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));let s=se(this.mod,n,i);return Ve(this.mod),JSON.parse(s)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new df(this,e)}disconnect(e){this.mod.ccall("duckdb_web_disconnect",null,["number"],[e])}runQuery(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_query_run",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));let a=cs(this.mod,i,s);return Ve(this.mod),a}sendQuery(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_query_send",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));let a=cs(this.mod,i,s);return Ve(this.mod),a}fetchQueryResults(e){let[t,n,i]=ye(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));let s=cs(this.mod,n,i);return Ve(this.mod),s}createPrepared(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));return Ve(this.mod),i}closePrepared(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));Ve(this.mod)}runPrepared(e,t,n){let[i,s,a]=ye(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==de.SUCCESS)throw new Error(se(this.mod,s,a));let o=cs(this.mod,s,a);return Ve(this.mod),o}sendPrepared(e,t,n){let[i,s,a]=ye(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==de.SUCCESS)throw new Error(se(this.mod,s,a));let o=cs(this.mod,s,a);return Ve(this.mod),o}insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let i=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(i,i+t.length).set(t);let a=n?JSON.stringify(n):"",[o,d,h]=ye(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,i,t.length,a]);if(o!==de.SUCCESS)throw new Error(se(this.mod,d,h))}insertCSVFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let h in n.columns)n.columnsFlat.push(os(h,n.columns[h]))}let i={...n};i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[a,o,d]=ye(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,s]);if(a!==de.SUCCESS)throw new Error(se(this.mod,o,d))}insertJSONFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let h in n.columns)n.columnsFlat.push(os(h,n.columns[h]))}let i={...n};i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[a,o,d]=ye(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,s]);if(a!==de.SUCCESS)throw new Error(se(this.mod,o,d))}globFiles(e){let[t,n,i]=ye(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));let s=se(this.mod,n,i);Ve(this.mod);let a=JSON.parse(s);return a==null?[]:a}registerFileURL(e,t){t===void 0&&(t=e);let[n,i,s]=ye(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));Ve(this.mod)}registerFileText(e,t){let n=EE.encode(t);this.registerFileBuffer(e,n)}registerFileBuffer(e,t){let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let[s,a,o]=ye(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,n,t.length]);if(s!==de.SUCCESS)throw new Error(se(this.mod,a,o));Ve(this.mod)}registerFileHandle(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,e]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));if(Ve(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(){let[e,t,n]=ye(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==de.SUCCESS)throw new Error(se(this.mod,t,n));Ve(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));Ve(this.mod)}copyFileToBuffer(e){let[t,n,i]=ye(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));let s=this.mod.HEAPU8.subarray(n,n+i),a=new Uint8Array(s.length);return a.set(s),Ve(this.mod),a}collectFileStatistics(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s))}exportFileStatistics(e){let[t,n,i]=ye(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));return new hf(this.mod.HEAPU8.subarray(n,n+i))}};var yf=class extends pf{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 _f=class extends yf{constructor(e,t,n,i=null){super(e,t,n,i)}instantiateImpl(e){return(0,Xb.default)({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var ht={fileInfoCache:new Map,getFileInfo(r,e){try{let t=ht.fileInfoCache.get(e);if(t)return t;let[n,i,s]=ye(r,"duckdb_web_fs_get_file_info_by_id",["number"],[e]);if(n!==de.SUCCESS)return null;let a=se(r,i,s);Ve(r);let o=JSON.parse(a);if(o==null)return null;let d={...o,blob:null};return ht.fileInfoCache.set(e,d),d}catch(t){return 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)=>{var t;try{ht.fileInfoCache.delete(e);let n=ht.getFileInfo(r,e);switch(n==null?void 0:n.dataProtocol){case ft.HTTP:{let i=null;try{let s=new XMLHttpRequest;s.open("HEAD",n.dataUrl,!1),s.setRequestHeader("Range","bytes=0-"),s.send(null);let a=s.getResponseHeader("Content-Length");if(s.status==206&&a!==null){let o=r._malloc(2*8);return r.HEAPF64[(o>>3)+0]=+a,r.HEAPF64[(o>>3)+1]=0,o}}catch(s){i=s,console.warn(`HEAD request with range header failed: ${s}`)}if(n.allowFullHttpReads){console.warn(`falling back to full HTTP read for: ${n.dataUrl}`);let s=new XMLHttpRequest;if(s.open("GET",n.dataUrl,!1),s.responseType="arraybuffer",s.send(null),s.status==200){let a=r._malloc(s.response.byteLength),o=new Uint8Array(s.response,0,s.response.byteLength);r.HEAPU8.set(o,a);let d=r._malloc(2*8);return r.HEAPF64[(d>>3)+0]=s.response.byteLength,r.HEAPF64[(d>>3)+1]=a,d}}if(i!=null)throw new Error(`Reading file ${n.fileName} failed with error: ${i}`);return 0}case ft.NATIVE:{let i=(t=ht._files)==null?void 0:t.get(n.fileName);if(i){let o=r._malloc(2*8);return r.HEAPF64[(o>>3)+0]=i.size,r.HEAPF64[(o>>3)+1]=0,o}console.warn(`Buffering missing file: ${n.fileName}`);let s=r._malloc(2*8),a=r._malloc(1);return r.HEAPF64[(s>>3)+0]=1,r.HEAPF64[(s>>3)+1]=a,s}}}catch(n){console.error(n.toString()),jr(r,n.toString())}return 0},glob:(r,e,t)=>{try{let n=se(r,e,t);if(n.startsWith("http")){let i=new XMLHttpRequest;if(i.open("HEAD",n,!1),i.send(null),i.status!=200&&i.status!==206){jr(r,`HEAD request failed: ${n}`);return}r.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}}catch(n){return jr(r,n.toString()),0}},checkFile:(r,e,t)=>{try{let n=se(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 s=!1;if(i.status==206)s=!0;else if(i.status==200)s=i.getResponseHeader("Accept-Ranges")==="bytes";else return!1;return!!s}}catch(n){return!1}return!1},syncFile:(r,e)=>{},closeFile:(r,e)=>{let t=ht.getFileInfo(r,e);switch(ht.fileInfoCache.delete(e),t==null?void 0:t.dataProtocol){case ft.HTTP:break;case ft.NATIVE:return}},truncateFile:(r,e,t)=>{let n=ht.getFileInfo(r,e);switch(n==null?void 0:n.dataProtocol){case ft.HTTP:jr(r,"Cannot truncate a http file");return;case ft.NATIVE:jr(r,"truncateFile not implemented");return}return 0},readFile(r,e,t,n,i){var s;try{let a=ht.getFileInfo(r,e);switch(a==null?void 0:a.dataProtocol){case ft.HTTP:{if(!a.dataUrl)throw new Error(`Missing data URL for file ${e}`);try{let o=new XMLHttpRequest;if(o.open("GET",a.dataUrl,!1),o.responseType="arraybuffer",o.setRequestHeader("Range",`bytes=${i}-${i+n-1}`),o.send(null),o.status==206||o.status==200&&n==o.response.byteLength&&i==0){let d=new Uint8Array(o.response,0,Math.min(o.response.byteLength,n));return r.HEAPU8.set(d,t),d.byteLength}else throw o.status==200?new Error(`Range request for ${a.dataUrl} did not return a partial response: ${o.status} "${o.statusText}"`):new Error(`Range request for ${a.dataUrl} did returned non-success status: ${o.status} "${o.statusText}"`)}catch(o){throw new Error(`Range request for ${a.dataUrl} failed with error: ${o}"`)}}case ft.NATIVE:{let o=(s=ht._files)==null?void 0:s.get(a.fileName);if(!o)throw new Error(`No handle available for file: ${a.fileName}`);let d=o.slice(i,i+n),h=new Uint8Array(new FileReaderSync().readAsArrayBuffer(d));return r.HEAPU8.set(h,t),h.byteLength}}return 0}catch(a){return jr(r,a.toString()),0}},writeFile:(r,e,t,n,i)=>{let s=ht.getFileInfo(r,e);switch(s==null?void 0:s.dataProtocol){case ft.HTTP:return jr(r,"Cannot write to HTTP file"),0;case ft.NATIVE:return jr(r,"writefile not implemented"),0}return 0},getLastFileModificationTime:(r,e)=>{var n;let t=ht.getFileInfo(r,e);switch(t==null?void 0:t.dataProtocol){case ft.NATIVE:{if(!((n=ht._files)==null?void 0:n.get(t.fileName)))throw Error(`No handle available for file: ${t.fileName}`);return 0}case ft.HTTP:return new Date().getTime()}return 0},checkDirectory:(r,e,t)=>{let n=se(r,e,t);return console.log(`checkDirectory: ${n}`),!1},createDirectory:(r,e,t)=>{let n=se(r,e,t);console.log(`createDirectory: ${n}`)},removeDirectory:(r,e,t)=>{let n=se(r,e,t);console.log(`removeDirectory: ${n}`)},listDirectoryEntries:(r,e,t)=>{let n=se(r,e,t);return console.log(`listDirectoryEntries: ${n}`),!1},moveFile:(r,e,t,n,i)=>{},removeFile:(r,e,t)=>{}};var eg=class extends cf{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t){return await new _f(this,ht,e,t).instantiate()}};function tg(){let r=new eg;globalThis.onmessage=async e=>{await r.onMessage(e.data)}}tg();return DE;})();
|
|
17
|
+
}`),this._dictionaries=[],this._recordBatches=[],super.close()}};br.RecordBatchJSONWriter=Ha;function Nl(r,e){let t=e;e instanceof Ml.Table&&(t=e.chunks,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}function Ll(r,e){var t,n,i,s;return K_.__awaiter(this,void 0,void 0,function*(){try{for(t=K_.__asyncValues(e);n=yield t.next(),!n.done;){let a=n.value;r.write(a)}}catch(a){i={error:a}}finally{try{n&&!n.done&&(s=t.return)&&(yield s.call(t))}finally{if(i)throw i.error}}return r.finish()})}function Z_({name:r,type:e,nullable:t}){let n=new l0.JSONTypeAssembler;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(Z_),dictionary:c0.DataType.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function h0(r,e,t=!1){let n=new u0.Field(`${e}`,r.type,r.nullCount>0),i=Q_.JSONVectorAssembler.assemble(new a0.Column(n,[r]));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:i}},null,2)}function p0(r){return JSON.stringify({count:r.length,columns:Q_.JSONVectorAssembler.assemble(r)},null,2)}});var jl=v(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.distributeVectorsIntoRecordBatches=gn.distributeColumnsIntoRecordBatches=gn.ensureSameLengthData=void 0;var X_=Gt(),xl=Je(),y0=pn(),_0=Nr(),Cl=new Uint8Array(0),em=r=>[Cl,Cl,new Uint8Array(r),Cl];function m0(r,e,t=e.reduce((n,i)=>Math.max(n,i.length),0)){let n,i,s=-1,a=e.length,o=[...r.fields],d=[],h=(t+63&~63)>>3;for(;++s<a;)(n=e[s])&&n.length===t?d[s]=n:((i=o[s]).nullable||(o[s]=o[s].clone({nullable:!0})),d[s]=n?n._changeLengthAndBackfillNullBitmap(t):X_.Data.new(i.type,0,t,t,em(h)));return[new xl.Schema(o),t,d]}gn.ensureSameLengthData=m0;function b0(r){return tm(new xl.Schema(r.map(({field:e})=>e)),r)}gn.distributeColumnsIntoRecordBatches=b0;function tm(r,e){return g0(r,e.map(t=>t instanceof y0.Chunked?t.chunks.map(n=>n.data):[t.data]))}gn.distributeVectorsIntoRecordBatches=tm;function g0(r,e){let t=[...r.fields],n=[],i={numBatches:e.reduce((F,U)=>Math.max(F,U.length),0)},s=0,a=0,o=-1,d=e.length,h,_=[];for(;i.numBatches-- >0;){for(a=Number.POSITIVE_INFINITY,o=-1;++o<d;)_[o]=h=e[o].shift(),a=Math.min(a,h?h.length:a);isFinite(a)&&(_=v0(t,a,_,e,i),a>0&&(n[s++]=[a,_.slice()]))}return[r=new xl.Schema(t,r.metadata),n.map(F=>new _0.RecordBatch(r,...F))]}function v0(r,e,t,n,i){let s,a,o=0,d=-1,h=n.length,_=(e+63&~63)>>3;for(;++d<h;)(s=t[d])&&(o=s.length)>=e?o===e?t[d]=s:(t[d]=s.slice(0,e),s=s.slice(e,o-e),i.numBatches=Math.max(i.numBatches,n[d].unshift(s))):((a=r[d]).nullable||(r[d]=a.clone({nullable:!0})),t[d]=s?s._changeLengthAndBackfillNullBitmap(e):X_.Data.new(a.type,0,e,e,em(_)));return t}});var Pe=v(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.BaseVector=void 0;var T0=pe(),I0=pn(),w0=Ls(),ql=Me(),Wl=class extends ql.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`${T0.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 ql.Vector.new(e,t)}concat(...e){return I0.Chunked.concat(this,...e)}slice(e,t){return w0.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]=ql.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){}};Ga.BaseVector=Wl;Wl.prototype[Symbol.isConcatSpreadable]=!0});var zl=v(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.BinaryVector=void 0;var S0=Me(),B0=Pe(),A0=ce(),rm=class extends B0.BaseVector{asUtf8(){return S0.Vector.new(this.data.clone(new A0.Utf8))}};Ka.BinaryVector=rm});var Hl=v($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.BoolVector=void 0;var O0=ce(),E0=Pe(),D0=gr(),nm=class extends E0.BaseVector{static from(e){return D0.vectorFromValuesWithType(()=>new O0.Bool,e)}};$a.BoolVector=nm});var Gl=v(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.DateMillisecondVector=vn.DateDayVector=vn.DateVector=void 0;var F0=pe(),R0=Pe(),im=gr(),Yl=ce(),Ja=class extends R0.BaseVector{static from(...e){return e.length===2?im.vectorFromValuesWithType(()=>e[1]===F0.DateUnit.DAY?new Yl.DateDay:new Yl.DateMillisecond,e[0]):im.vectorFromValuesWithType(()=>new Yl.DateMillisecond,e[0])}};vn.DateVector=Ja;var sm=class extends Ja{};vn.DateDayVector=sm;var om=class extends Ja{};vn.DateMillisecondVector=om});var Kl=v(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.DecimalVector=void 0;var M0=Pe(),am=class extends M0.BaseVector{};Qa.DecimalVector=am});var Xa=v(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.DictionaryVector=void 0;var U0=Gt(),cm=Me(),P0=Pe(),k0=gr(),V0=ce(),$l=class extends P0.BaseVector{constructor(e){super(e);this.indices=cm.Vector.new(e.clone(this.type.indices))}static from(...e){if(e.length===3){let[t,n,i]=e,s=new V0.Dictionary(t.type,n,null,null);return cm.Vector.new(U0.Data.Dictionary(s,0,i.length,0,null,i,t))}return k0.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)}};Za.DictionaryVector=$l;$l.prototype.indices=null});var Jl=v(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.FixedSizeBinaryVector=void 0;var N0=Pe(),um=class extends N0.BaseVector{};ec.FixedSizeBinaryVector=um});var Ql=v(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.FixedSizeListVector=void 0;var L0=Pe(),lm=class extends L0.BaseVector{};tc.FixedSizeListVector=lm});var td=v(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.Float64Vector=vr.Float32Vector=vr.Float16Vector=vr.FloatVector=void 0;var x0=Gt(),C0=Me(),j0=Pe(),q0=gr(),Xn=ce(),Gs=class extends j0.BaseVector{static from(e){let t=H0(this);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){let n=z0(e.constructor)||t;if(t===null&&(t=n),t&&t===n){let i=new t,s=e.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!W0(t,e.constructor))return C0.Vector.new(x0.Data.Float(i,0,s,0,null,e))}}if(t)return q0.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")}};vr.FloatVector=Gs;var Zl=class extends Gs{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}};vr.Float16Vector=Zl;var Xl=class extends Gs{};vr.Float32Vector=Xl;var ed=class extends Gs{};vr.Float64Vector=ed;var W0=(r,e)=>r===Xn.Float16&&e!==Uint16Array,z0=r=>{switch(r){case Uint16Array:return Xn.Float16;case Float32Array:return Xn.Float32;case Float64Array:return Xn.Float64;default:return null}},H0=r=>{switch(r){case Zl:return Xn.Float16;case Xl:return Xn.Float32;case ed:return Xn.Float64;default:return null}}});var rd=v(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.IntervalYearMonthVector=Tn.IntervalDayTimeVector=Tn.IntervalVector=void 0;var Y0=Pe(),rc=class extends Y0.BaseVector{};Tn.IntervalVector=rc;var dm=class extends rc{};Tn.IntervalDayTimeVector=dm;var fm=class extends rc{};Tn.IntervalYearMonthVector=fm});var nc=v(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.Uint64Vector=qe.Uint32Vector=qe.Uint16Vector=qe.Uint8Vector=qe.Int64Vector=qe.Int32Vector=qe.Int16Vector=qe.Int8Vector=qe.IntVector=void 0;var G0=Gt(),K0=Me(),$0=Pe(),J0=gr(),hm=at(),pm=He(),Fe=ce(),Tr=class extends $0.BaseVector{static from(...e){let[t,n=!1]=e,i=X0(this,n);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let s=Z0(t.constructor,n)||i;if(i===null&&(i=s),i&&i===s){let a=new i,o=t.byteLength/a.ArrayType.BYTES_PER_ELEMENT;return Q0(i,t.constructor)&&(o*=.5),K0.Vector.new(G0.Data.Int(a,0,o,0,null,t))}}if(i)return J0.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")}};qe.IntVector=Tr;var nd=class extends Tr{};qe.Int8Vector=nd;var id=class extends Tr{};qe.Int16Vector=id;var sd=class extends Tr{};qe.Int32Vector=sd;var od=class extends Tr{toBigInt64Array(){return pm.toBigInt64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}};qe.Int64Vector=od;var ad=class extends Tr{};qe.Uint8Vector=ad;var cd=class extends Tr{};qe.Uint16Vector=cd;var ud=class extends Tr{};qe.Uint32Vector=ud;var ld=class extends Tr{toBigUint64Array(){return pm.toBigUint64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}};qe.Uint64Vector=ld;var Q0=(r,e)=>(r===Fe.Int64||r===Fe.Uint64)&&(e===Int32Array||e===Uint32Array),Z0=(r,e)=>{switch(r){case Int8Array:return Fe.Int8;case Int16Array:return Fe.Int16;case Int32Array:return e?Fe.Int64:Fe.Int32;case hm.BigInt64Array:return Fe.Int64;case Uint8Array:return Fe.Uint8;case Uint16Array:return Fe.Uint16;case Uint32Array:return e?Fe.Uint64:Fe.Uint32;case hm.BigUint64Array:return Fe.Uint64;default:return null}},X0=(r,e)=>{switch(r){case nd:return Fe.Int8;case id:return Fe.Int16;case sd:return e?Fe.Int64:Fe.Int32;case od:return Fe.Int64;case ad:return Fe.Uint8;case cd:return Fe.Uint16;case ud:return e?Fe.Uint64:Fe.Uint32;case ld:return Fe.Uint64;default:return null}}});var dd=v(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.ListVector=void 0;var eA=Pe(),ym=class extends eA.BaseVector{};ic.ListVector=ym});var fd=v(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.MapVector=void 0;var tA=Vs(),rA=Me(),nA=Pe(),iA=ce(),_m=class extends nA.BaseVector{asList(){let e=this.type.children[0];return rA.Vector.new(this.data.clone(new iA.List(e)))}bind(e){let t=this.getChildAt(0),{[e]:n,[e+1]:i}=this.valueOffsets;return new tA.MapRow(t.slice(n,i))}};sc.MapVector=_m});var hd=v(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.NullVector=void 0;var sA=Pe(),mm=class extends sA.BaseVector{};oc.NullVector=mm});var pd=v(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.StructVector=void 0;var oA=Vs(),aA=Pe(),cA=Symbol.for("rowIndex"),bm=class extends aA.BaseVector{bind(e){let t=this._row||(this._row=new oA.StructRow(this)),n=Object.create(t);return n[cA]=e,n}};ac.StructVector=bm});var yd=v(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.TimestampNanosecondVector=Lt.TimestampMicrosecondVector=Lt.TimestampMillisecondVector=Lt.TimestampSecondVector=Lt.TimestampVector=void 0;var uA=Pe(),ji=class extends uA.BaseVector{};Lt.TimestampVector=ji;var gm=class extends ji{};Lt.TimestampSecondVector=gm;var vm=class extends ji{};Lt.TimestampMillisecondVector=vm;var Tm=class extends ji{};Lt.TimestampMicrosecondVector=Tm;var Im=class extends ji{};Lt.TimestampNanosecondVector=Im});var _d=v(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.TimeNanosecondVector=xt.TimeMicrosecondVector=xt.TimeMillisecondVector=xt.TimeSecondVector=xt.TimeVector=void 0;var lA=Pe(),qi=class extends lA.BaseVector{};xt.TimeVector=qi;var wm=class extends qi{};xt.TimeSecondVector=wm;var Sm=class extends qi{};xt.TimeMillisecondVector=Sm;var Bm=class extends qi{};xt.TimeMicrosecondVector=Bm;var Am=class extends qi{};xt.TimeNanosecondVector=Am});var md=v(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.SparseUnionVector=In.DenseUnionVector=In.UnionVector=void 0;var dA=Pe(),cc=class extends dA.BaseVector{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}};In.UnionVector=cc;var Om=class extends cc{get valueOffsets(){return this.data.valueOffsets}};In.DenseUnionVector=Om;var Em=class extends cc{};In.SparseUnionVector=Em});var bd=v(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.Utf8Vector=void 0;var fA=Me(),hA=Pe(),Dm=ce(),pA=gr(),Fm=class extends hA.BaseVector{static from(e){return pA.vectorFromValuesWithType(()=>new Dm.Utf8,e)}asBinary(){return fA.Vector.new(this.data.clone(new Dm.Binary))}};uc.Utf8Vector=Fm});var Rm=v(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.partial2=wn.partial1=wn.partial0=void 0;function yA(r){return function(){return r(this)}}wn.partial0=yA;function _A(r){return function(e){return r(this,e)}}wn.partial1=_A;function mA(r){return function(e,t){return r(this,e,t)}}wn.partial2=mA});var Td=v(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.instance=Wi.GetVisitor=void 0;var lc=Fs(),bA=tt(),gA=Mn(),vA=As(),Ct=pe(),q=class extends bA.Visitor{};Wi.GetVisitor=q;var TA=(r,e)=>864e5*r[e],gd=(r,e)=>4294967296*r[e+1]+(r[e]>>>0),IA=(r,e)=>4294967296*(r[e+1]/1e3)+(r[e]>>>0)/1e3,wA=(r,e)=>4294967296*(r[e+1]/1e6)+(r[e]>>>0)/1e6,Mm=r=>new Date(r),SA=(r,e)=>Mm(TA(r,e)),BA=(r,e)=>Mm(gd(r,e)),AA=(r,e)=>null,Um=(r,e,t)=>{let{[t]:n,[t+1]:i}=e;return n!=null&&i!=null?r.subarray(n,i):null},OA=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!=0},Pm=({values:r},e)=>SA(r,e),km=({values:r},e)=>BA(r,e*2),Ir=({stride:r,values:e},t)=>e[r*t],Vm=({stride:r,values:e},t)=>vA.uint16ToFloat64(e[r*t]),vd=({stride:r,values:e,type:t},n)=>lc.BN.new(e.subarray(r*n,r*(n+1)),t.isSigned),EA=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),DA=({values:r,valueOffsets:e},t)=>Um(r,e,t),FA=({values:r,valueOffsets:e},t)=>{let n=Um(r,e,t);return n!==null?gA.decodeUtf8(n):null},RA=(r,e)=>r.type.bitWidth<64?Ir(r,e):vd(r,e),MA=(r,e)=>r.type.precision!==Ct.Precision.HALF?Ir(r,e):Vm(r,e),UA=(r,e)=>r.type.unit===Ct.DateUnit.DAY?Pm(r,e):km(r,e),Nm=({values:r},e)=>1e3*gd(r,e*2),Lm=({values:r},e)=>gd(r,e*2),xm=({values:r},e)=>IA(r,e*2),Cm=({values:r},e)=>wA(r,e*2),PA=(r,e)=>{switch(r.type.unit){case Ct.TimeUnit.SECOND:return Nm(r,e);case Ct.TimeUnit.MILLISECOND:return Lm(r,e);case Ct.TimeUnit.MICROSECOND:return xm(r,e);case Ct.TimeUnit.NANOSECOND:return Cm(r,e)}},jm=({values:r,stride:e},t)=>r[e*t],qm=({values:r,stride:e},t)=>r[e*t],Wm=({values:r},e)=>lc.BN.signed(r.subarray(2*e,2*(e+1))),zm=({values:r},e)=>lc.BN.signed(r.subarray(2*e,2*(e+1))),kA=(r,e)=>{switch(r.type.unit){case Ct.TimeUnit.SECOND:return jm(r,e);case Ct.TimeUnit.MILLISECOND:return qm(r,e);case Ct.TimeUnit.MICROSECOND:return Wm(r,e);case Ct.TimeUnit.NANOSECOND:return zm(r,e)}},VA=({values:r},e)=>lc.BN.decimal(r.subarray(4*e,4*(e+1))),NA=(r,e)=>{let t=r.getChildAt(0),{valueOffsets:n,stride:i}=r;return t.slice(n[e*i],n[e*i+1])},LA=(r,e)=>r.bind(e),xA=(r,e)=>r.bind(e),CA=(r,e)=>r.type.mode===Ct.UnionMode.Dense?Hm(r,e):Ym(r,e),Hm=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(r.valueOffsets[e]):null},Ym=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(e):null},jA=(r,e)=>r.getValue(r.getKey(e)),qA=(r,e)=>r.type.unit===Ct.IntervalUnit.DAY_TIME?Gm(r,e):Km(r,e),Gm=({values:r},e)=>r.subarray(2*e,2*(e+1)),Km=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=t/12|0,n[1]=t%12|0,n},WA=(r,e)=>{let t=r.getChildAt(0),{stride:n}=r;return t.slice(e*n,(e+1)*n)};q.prototype.visitNull=AA;q.prototype.visitBool=OA;q.prototype.visitInt=RA;q.prototype.visitInt8=Ir;q.prototype.visitInt16=Ir;q.prototype.visitInt32=Ir;q.prototype.visitInt64=vd;q.prototype.visitUint8=Ir;q.prototype.visitUint16=Ir;q.prototype.visitUint32=Ir;q.prototype.visitUint64=vd;q.prototype.visitFloat=MA;q.prototype.visitFloat16=Vm;q.prototype.visitFloat32=Ir;q.prototype.visitFloat64=Ir;q.prototype.visitUtf8=FA;q.prototype.visitBinary=DA;q.prototype.visitFixedSizeBinary=EA;q.prototype.visitDate=UA;q.prototype.visitDateDay=Pm;q.prototype.visitDateMillisecond=km;q.prototype.visitTimestamp=PA;q.prototype.visitTimestampSecond=Nm;q.prototype.visitTimestampMillisecond=Lm;q.prototype.visitTimestampMicrosecond=xm;q.prototype.visitTimestampNanosecond=Cm;q.prototype.visitTime=kA;q.prototype.visitTimeSecond=jm;q.prototype.visitTimeMillisecond=qm;q.prototype.visitTimeMicrosecond=Wm;q.prototype.visitTimeNanosecond=zm;q.prototype.visitDecimal=VA;q.prototype.visitList=NA;q.prototype.visitStruct=xA;q.prototype.visitUnion=CA;q.prototype.visitDenseUnion=Hm;q.prototype.visitSparseUnion=Ym;q.prototype.visitDictionary=jA;q.prototype.visitInterval=qA;q.prototype.visitIntervalDayTime=Gm;q.prototype.visitIntervalYearMonth=Km;q.prototype.visitFixedSizeList=WA;q.prototype.visitMap=LA;Wi.instance=new q});var Zm=v(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.instance=zi.IndexOfVisitor=void 0;var zA=tt(),$m=cr(),Jm=Ls(),W=class extends zA.Visitor{};zi.IndexOfVisitor=W;function HA(r,e){return e===null&&r.length>0?0:-1}function YA(r,e){let{nullBitmap:t}=r.data;if(!t||r.nullCount<=0)return-1;let n=0;for(let i of new $m.BitIterator(t,r.data.offset+(e||0),r.length,t,$m.getBool)){if(!i)return n;++n}return-1}function X(r,e,t){if(e===void 0)return-1;if(e===null)return YA(r,t);let n=Jm.createElementComparator(e);for(let i=(t||0)-1,s=r.length;++i<s;)if(n(r.get(i)))return i;return-1}function Qm(r,e,t){let n=Jm.createElementComparator(e);for(let i=(t||0)-1,s=r.length;++i<s;)if(n(r.get(i)))return i;return-1}W.prototype.visitNull=HA;W.prototype.visitBool=X;W.prototype.visitInt=X;W.prototype.visitInt8=X;W.prototype.visitInt16=X;W.prototype.visitInt32=X;W.prototype.visitInt64=X;W.prototype.visitUint8=X;W.prototype.visitUint16=X;W.prototype.visitUint32=X;W.prototype.visitUint64=X;W.prototype.visitFloat=X;W.prototype.visitFloat16=X;W.prototype.visitFloat32=X;W.prototype.visitFloat64=X;W.prototype.visitUtf8=X;W.prototype.visitBinary=X;W.prototype.visitFixedSizeBinary=X;W.prototype.visitDate=X;W.prototype.visitDateDay=X;W.prototype.visitDateMillisecond=X;W.prototype.visitTimestamp=X;W.prototype.visitTimestampSecond=X;W.prototype.visitTimestampMillisecond=X;W.prototype.visitTimestampMicrosecond=X;W.prototype.visitTimestampNanosecond=X;W.prototype.visitTime=X;W.prototype.visitTimeSecond=X;W.prototype.visitTimeMillisecond=X;W.prototype.visitTimeMicrosecond=X;W.prototype.visitTimeNanosecond=X;W.prototype.visitDecimal=X;W.prototype.visitList=X;W.prototype.visitStruct=X;W.prototype.visitUnion=X;W.prototype.visitDenseUnion=Qm;W.prototype.visitSparseUnion=Qm;W.prototype.visitDictionary=X;W.prototype.visitInterval=X;W.prototype.visitIntervalDayTime=X;W.prototype.visitIntervalYearMonth=X;W.prototype.visitFixedSizeList=X;W.prototype.visitMap=X;zi.instance=new W});var Id=v(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.instance=Hi.IteratorVisitor=void 0;var dc=pe(),GA=tt(),KA=cr(),Xm=Td(),z=class extends GA.Visitor{};Hi.IteratorVisitor=z;function $A(r){let e=Xm.instance.getVisitFn(r);return new KA.BitIterator(r.data.nullBitmap,r.data.offset,r.length,r,(t,n,i,s)=>(i&1<<s)!=0?e(t,n):null)}var eb=class{constructor(e,t){this.vector=e,this.getFn=t,this.index=0}next(){return this.index<this.vector.length?{value:this.getFn(this.vector,this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};function Q(r){if(r.nullCount>0)return $A(r);let{type:e,typeId:t,length:n}=r;return r.stride===1&&(t===dc.Type.Timestamp||t===dc.Type.Int&&e.bitWidth!==64||t===dc.Type.Time&&e.bitWidth!==64||t===dc.Type.Float&&e.precision>0)?r.data.values.subarray(0,n)[Symbol.iterator]():new eb(r,Xm.instance.getVisitFn(r))}z.prototype.visitNull=Q;z.prototype.visitBool=Q;z.prototype.visitInt=Q;z.prototype.visitInt8=Q;z.prototype.visitInt16=Q;z.prototype.visitInt32=Q;z.prototype.visitInt64=Q;z.prototype.visitUint8=Q;z.prototype.visitUint16=Q;z.prototype.visitUint32=Q;z.prototype.visitUint64=Q;z.prototype.visitFloat=Q;z.prototype.visitFloat16=Q;z.prototype.visitFloat32=Q;z.prototype.visitFloat64=Q;z.prototype.visitUtf8=Q;z.prototype.visitBinary=Q;z.prototype.visitFixedSizeBinary=Q;z.prototype.visitDate=Q;z.prototype.visitDateDay=Q;z.prototype.visitDateMillisecond=Q;z.prototype.visitTimestamp=Q;z.prototype.visitTimestampSecond=Q;z.prototype.visitTimestampMillisecond=Q;z.prototype.visitTimestampMicrosecond=Q;z.prototype.visitTimestampNanosecond=Q;z.prototype.visitTime=Q;z.prototype.visitTimeSecond=Q;z.prototype.visitTimeMillisecond=Q;z.prototype.visitTimeMicrosecond=Q;z.prototype.visitTimeNanosecond=Q;z.prototype.visitDecimal=Q;z.prototype.visitList=Q;z.prototype.visitStruct=Q;z.prototype.visitUnion=Q;z.prototype.visitDenseUnion=Q;z.prototype.visitSparseUnion=Q;z.prototype.visitDictionary=Q;z.prototype.visitInterval=Q;z.prototype.visitIntervalDayTime=Q;z.prototype.visitIntervalYearMonth=Q;z.prototype.visitFixedSizeList=Q;z.prototype.visitMap=Q;Hi.instance=new z});var tb=v(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.instance=Yi.ToArrayVisitor=void 0;var Ks=pe(),JA=tt(),QA=Id(),H=class extends JA.Visitor{};Yi.ToArrayVisitor=H;function Z(r){let{type:e,length:t,stride:n}=r;switch(e.typeId){case Ks.Type.Int:case Ks.Type.Float:case Ks.Type.Decimal:case Ks.Type.Time:case Ks.Type.Timestamp:return r.data.values.subarray(0,t*n)}return[...QA.instance.visit(r)]}H.prototype.visitNull=Z;H.prototype.visitBool=Z;H.prototype.visitInt=Z;H.prototype.visitInt8=Z;H.prototype.visitInt16=Z;H.prototype.visitInt32=Z;H.prototype.visitInt64=Z;H.prototype.visitUint8=Z;H.prototype.visitUint16=Z;H.prototype.visitUint32=Z;H.prototype.visitUint64=Z;H.prototype.visitFloat=Z;H.prototype.visitFloat16=Z;H.prototype.visitFloat32=Z;H.prototype.visitFloat64=Z;H.prototype.visitUtf8=Z;H.prototype.visitBinary=Z;H.prototype.visitFixedSizeBinary=Z;H.prototype.visitDate=Z;H.prototype.visitDateDay=Z;H.prototype.visitDateMillisecond=Z;H.prototype.visitTimestamp=Z;H.prototype.visitTimestampSecond=Z;H.prototype.visitTimestampMillisecond=Z;H.prototype.visitTimestampMicrosecond=Z;H.prototype.visitTimestampNanosecond=Z;H.prototype.visitTime=Z;H.prototype.visitTimeSecond=Z;H.prototype.visitTimeMillisecond=Z;H.prototype.visitTimeMicrosecond=Z;H.prototype.visitTimeNanosecond=Z;H.prototype.visitDecimal=Z;H.prototype.visitList=Z;H.prototype.visitStruct=Z;H.prototype.visitUnion=Z;H.prototype.visitDenseUnion=Z;H.prototype.visitSparseUnion=Z;H.prototype.visitDictionary=Z;H.prototype.visitInterval=Z;H.prototype.visitIntervalDayTime=Z;H.prototype.visitIntervalYearMonth=Z;H.prototype.visitFixedSizeList=Z;H.prototype.visitMap=Z;Yi.instance=new H});var rb=v(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.instance=Gi.ByteWidthVisitor=void 0;var ZA=tt(),XA=pe(),$s=(r,e)=>r+e,wd=r=>`Cannot compute the byte width of variable-width column ${r}`,Sd=class extends ZA.Visitor{visitNull(e){return 0}visitInt(e){return e.bitWidth/8}visitFloat(e){return e.ArrayType.BYTES_PER_ELEMENT}visitBinary(e){throw new Error(wd(e))}visitUtf8(e){throw new Error(wd(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===XA.TimeUnit.SECOND?4:8}visitInterval(e){return(e.unit+1)*4}visitList(e){throw new Error(wd(e))}visitStruct(e){return this.visitFields(e.children).reduce($s,0)}visitUnion(e){return this.visitFields(e.children).reduce($s,0)}visitFixedSizeBinary(e){return e.byteWidth}visitFixedSizeList(e){return e.listSize*this.visitFields(e.children).reduce($s,0)}visitMap(e){return this.visitFields(e.children).reduce($s,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($s,0)}};Gi.ByteWidthVisitor=Sd;Gi.instance=new Sd});var nb=v(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.instance=Ki.GetVectorConstructor=void 0;var eO=tt(),tO=zl(),rO=Hl(),Bd=Gl(),nO=Kl(),iO=Xa(),sO=Jl(),oO=Ql(),fc=td(),Ad=rd(),Lr=nc(),aO=dd(),cO=fd(),uO=hd(),lO=pd(),Js=yd(),Qs=_d(),Od=md(),dO=bd(),Ed=class extends eO.Visitor{visitNull(){return uO.NullVector}visitBool(){return rO.BoolVector}visitInt(){return Lr.IntVector}visitInt8(){return Lr.Int8Vector}visitInt16(){return Lr.Int16Vector}visitInt32(){return Lr.Int32Vector}visitInt64(){return Lr.Int64Vector}visitUint8(){return Lr.Uint8Vector}visitUint16(){return Lr.Uint16Vector}visitUint32(){return Lr.Uint32Vector}visitUint64(){return Lr.Uint64Vector}visitFloat(){return fc.FloatVector}visitFloat16(){return fc.Float16Vector}visitFloat32(){return fc.Float32Vector}visitFloat64(){return fc.Float64Vector}visitUtf8(){return dO.Utf8Vector}visitBinary(){return tO.BinaryVector}visitFixedSizeBinary(){return sO.FixedSizeBinaryVector}visitDate(){return Bd.DateVector}visitDateDay(){return Bd.DateDayVector}visitDateMillisecond(){return Bd.DateMillisecondVector}visitTimestamp(){return Js.TimestampVector}visitTimestampSecond(){return Js.TimestampSecondVector}visitTimestampMillisecond(){return Js.TimestampMillisecondVector}visitTimestampMicrosecond(){return Js.TimestampMicrosecondVector}visitTimestampNanosecond(){return Js.TimestampNanosecondVector}visitTime(){return Qs.TimeVector}visitTimeSecond(){return Qs.TimeSecondVector}visitTimeMillisecond(){return Qs.TimeMillisecondVector}visitTimeMicrosecond(){return Qs.TimeMicrosecondVector}visitTimeNanosecond(){return Qs.TimeNanosecondVector}visitDecimal(){return nO.DecimalVector}visitList(){return aO.ListVector}visitStruct(){return lO.StructVector}visitUnion(){return Od.UnionVector}visitDenseUnion(){return Od.DenseUnionVector}visitSparseUnion(){return Od.SparseUnionVector}visitDictionary(){return iO.DictionaryVector}visitInterval(){return Ad.IntervalVector}visitIntervalDayTime(){return Ad.IntervalDayTimeVector}visitIntervalYearMonth(){return Ad.IntervalYearMonthVector}visitFixedSizeList(){return oO.FixedSizeListVector}visitMap(){return cO.MapVector}};Ki.GetVectorConstructor=Ed;Ki.instance=new Ed});var gr=v(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 Dd=ot(),fO=Me();Object.defineProperty(T,"Vector",{enumerable:!0,get:function(){return fO.Vector}});var hO=Pe();Object.defineProperty(T,"BaseVector",{enumerable:!0,get:function(){return hO.BaseVector}});var pO=zl();Object.defineProperty(T,"BinaryVector",{enumerable:!0,get:function(){return pO.BinaryVector}});var yO=Hl();Object.defineProperty(T,"BoolVector",{enumerable:!0,get:function(){return yO.BoolVector}});var _O=pn();Object.defineProperty(T,"Chunked",{enumerable:!0,get:function(){return _O.Chunked}});var Fd=Gl();Object.defineProperty(T,"DateVector",{enumerable:!0,get:function(){return Fd.DateVector}});Object.defineProperty(T,"DateDayVector",{enumerable:!0,get:function(){return Fd.DateDayVector}});Object.defineProperty(T,"DateMillisecondVector",{enumerable:!0,get:function(){return Fd.DateMillisecondVector}});var mO=Kl();Object.defineProperty(T,"DecimalVector",{enumerable:!0,get:function(){return mO.DecimalVector}});var bO=Xa();Object.defineProperty(T,"DictionaryVector",{enumerable:!0,get:function(){return bO.DictionaryVector}});var gO=Jl();Object.defineProperty(T,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return gO.FixedSizeBinaryVector}});var vO=Ql();Object.defineProperty(T,"FixedSizeListVector",{enumerable:!0,get:function(){return vO.FixedSizeListVector}});var hc=td();Object.defineProperty(T,"FloatVector",{enumerable:!0,get:function(){return hc.FloatVector}});Object.defineProperty(T,"Float16Vector",{enumerable:!0,get:function(){return hc.Float16Vector}});Object.defineProperty(T,"Float32Vector",{enumerable:!0,get:function(){return hc.Float32Vector}});Object.defineProperty(T,"Float64Vector",{enumerable:!0,get:function(){return hc.Float64Vector}});var Rd=rd();Object.defineProperty(T,"IntervalVector",{enumerable:!0,get:function(){return Rd.IntervalVector}});Object.defineProperty(T,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Rd.IntervalDayTimeVector}});Object.defineProperty(T,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Rd.IntervalYearMonthVector}});var xr=nc();Object.defineProperty(T,"IntVector",{enumerable:!0,get:function(){return xr.IntVector}});Object.defineProperty(T,"Int8Vector",{enumerable:!0,get:function(){return xr.Int8Vector}});Object.defineProperty(T,"Int16Vector",{enumerable:!0,get:function(){return xr.Int16Vector}});Object.defineProperty(T,"Int32Vector",{enumerable:!0,get:function(){return xr.Int32Vector}});Object.defineProperty(T,"Int64Vector",{enumerable:!0,get:function(){return xr.Int64Vector}});Object.defineProperty(T,"Uint8Vector",{enumerable:!0,get:function(){return xr.Uint8Vector}});Object.defineProperty(T,"Uint16Vector",{enumerable:!0,get:function(){return xr.Uint16Vector}});Object.defineProperty(T,"Uint32Vector",{enumerable:!0,get:function(){return xr.Uint32Vector}});Object.defineProperty(T,"Uint64Vector",{enumerable:!0,get:function(){return xr.Uint64Vector}});var TO=dd();Object.defineProperty(T,"ListVector",{enumerable:!0,get:function(){return TO.ListVector}});var IO=fd();Object.defineProperty(T,"MapVector",{enumerable:!0,get:function(){return IO.MapVector}});var wO=hd();Object.defineProperty(T,"NullVector",{enumerable:!0,get:function(){return wO.NullVector}});var SO=pd();Object.defineProperty(T,"StructVector",{enumerable:!0,get:function(){return SO.StructVector}});var Zs=yd();Object.defineProperty(T,"TimestampVector",{enumerable:!0,get:function(){return Zs.TimestampVector}});Object.defineProperty(T,"TimestampSecondVector",{enumerable:!0,get:function(){return Zs.TimestampSecondVector}});Object.defineProperty(T,"TimestampMillisecondVector",{enumerable:!0,get:function(){return Zs.TimestampMillisecondVector}});Object.defineProperty(T,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return Zs.TimestampMicrosecondVector}});Object.defineProperty(T,"TimestampNanosecondVector",{enumerable:!0,get:function(){return Zs.TimestampNanosecondVector}});var Xs=_d();Object.defineProperty(T,"TimeVector",{enumerable:!0,get:function(){return Xs.TimeVector}});Object.defineProperty(T,"TimeSecondVector",{enumerable:!0,get:function(){return Xs.TimeSecondVector}});Object.defineProperty(T,"TimeMillisecondVector",{enumerable:!0,get:function(){return Xs.TimeMillisecondVector}});Object.defineProperty(T,"TimeMicrosecondVector",{enumerable:!0,get:function(){return Xs.TimeMicrosecondVector}});Object.defineProperty(T,"TimeNanosecondVector",{enumerable:!0,get:function(){return Xs.TimeNanosecondVector}});var Md=md();Object.defineProperty(T,"UnionVector",{enumerable:!0,get:function(){return Md.UnionVector}});Object.defineProperty(T,"DenseUnionVector",{enumerable:!0,get:function(){return Md.DenseUnionVector}});Object.defineProperty(T,"SparseUnionVector",{enumerable:!0,get:function(){return Md.SparseUnionVector}});var BO=bd();Object.defineProperty(T,"Utf8Vector",{enumerable:!0,get:function(){return BO.Utf8Vector}});var ib=Vs();Object.defineProperty(T,"MapRow",{enumerable:!0,get:function(){return ib.MapRow}});Object.defineProperty(T,"StructRow",{enumerable:!0,get:function(){return ib.StructRow}});var eo=Rm(),Ud=pe(),$i=Me(),sb=pn(),ei=Pe(),AO=cr(),pc=at(),ob=Oe(),ab=Td(),cb=Yu(),ub=Zm(),lb=tb(),db=Id(),fb=rb(),hb=nb();$i.Vector.new=OO;$i.Vector.from=DO;function OO(r,...e){return new(hb.instance.getVisitFn(r)())(r,...e)}function EO(r,e){if(pc.isIterable(e))return $i.Vector.from({nullValues:[null,void 0],type:r(),values:e});if(pc.isAsyncIterable(e))return $i.Vector.from({nullValues:[null,void 0],type:r(),values:e});let{values:t=[],type:n=r(),nullValues:i=[null,void 0]}=Object.assign({},e);return pc.isIterable(t)?$i.Vector.from(Object.assign(Object.assign({nullValues:i},e),{type:n})):$i.Vector.from(Object.assign(Object.assign({nullValues:i},e),{type:n}))}T.vectorFromValuesWithType=EO;function DO(r){let e=Object.assign({nullValues:[null,void 0]},r),{values:t=[]}=e,n=Dd.__rest(e,["values"]);if(pc.isIterable(t)){let i=[...ob.Builder.throughIterable(n)(t)];return i.length===1?i[0]:sb.Chunked.concat(i)}return(i=>Dd.__awaiter(this,void 0,void 0,function*(){var s,a;let o=ob.Builder.throughAsyncIterable(n);try{for(var d=Dd.__asyncValues(o(t)),h;h=yield d.next(),!h.done;){let _=h.value;i.push(_)}}catch(_){s={error:_}}finally{try{h&&!h.done&&(a=d.return)&&(yield a.call(d))}finally{if(s)throw s.error}}return i.length===1?i[0]:sb.Chunked.concat(i)}))([])}ei.BaseVector.prototype.get=function(e){return ab.instance.visit(this,e)};ei.BaseVector.prototype.set=function(e,t){return cb.instance.visit(this,e,t)};ei.BaseVector.prototype.indexOf=function(e,t){return ub.instance.visit(this,e,t)};ei.BaseVector.prototype.toArray=function(){return lb.instance.visit(this)};ei.BaseVector.prototype.getByteWidth=function(){return fb.instance.visit(this.type)};ei.BaseVector.prototype[Symbol.iterator]=function(){return db.instance.visit(this)};ei.BaseVector.prototype._bindDataAccessors=UO;Object.keys(Ud.Type).map(r=>Ud.Type[r]).filter(r=>typeof r=="number").filter(r=>r!==Ud.Type.NONE).forEach(r=>{let e=hb.instance.visit(r);e.prototype.get=eo.partial1(ab.instance.getVisitFn(r)),e.prototype.set=eo.partial2(cb.instance.getVisitFn(r)),e.prototype.indexOf=eo.partial2(ub.instance.getVisitFn(r)),e.prototype.toArray=eo.partial0(lb.instance.getVisitFn(r)),e.prototype.getByteWidth=FO(fb.instance.getVisitFn(r)),e.prototype[Symbol.iterator]=eo.partial0(db.instance.getVisitFn(r))});function FO(r){return function(){return r(this.type)}}function RO(r){return function(e){return this.isValid(e)?r.call(this,e):null}}function MO(r){return function(e,t){AO.setBool(this.nullBitmap,this.offset+e,t!=null)&&r.call(this,e,t)}}function UO(){let r=this.nullBitmap;r&&r.byteLength>0&&(this.get=RO(this.get),this.set=MO(this.set))}});var Ys=v(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.Table=void 0;var yc=ot(),PO=ki(),kO=to(),pb=Ya(),Pd=Nr(),yb=Je(),kd=ce(),_b=Yn(),Vd=at(),mb=jl(),Nd=gr(),Ke=class extends Nd.Chunked{constructor(...e){var t;let n=null;e[0]instanceof yb.Schema&&(n=e[0]);let i=e[0]instanceof Ke?e[0].chunks:_b.selectArgs(Pd.RecordBatch,e);if(!n&&!(n=(t=i[0])===null||t===void 0?void 0:t.schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");i[0]||(i[0]=new Pd._InternalEmptyPlaceholderRecordBatch(n));super(new kd.Struct(n.fields),i);this._schema=n,this._chunks=i}static empty(e=new yb.Schema([])){return new Ke(e,[])}static from(e){if(!e)return Ke.empty();if(typeof e=="object"){let n=Vd.isIterable(e.values)?VO(e):Vd.isAsyncIterable(e.values)?NO(e):null;if(n!==null)return n}let t=kO.RecordBatchReader.from(e);return Vd.isPromise(t)?(()=>yc.__awaiter(this,void 0,void 0,function*(){return yield Ke.from(yield t)}))():t.isSync()&&(t=t.open())?t.schema?new Ke(t.schema,[...t]):Ke.empty():(n=>yc.__awaiter(this,void 0,void 0,function*(){var i,s;let a=yield n,o=a.schema,d=[];if(o){try{for(var h=yc.__asyncValues(a),_;_=yield h.next(),!_.done;){let F=_.value;d.push(F)}}catch(F){i={error:F}}finally{try{_&&!_.done&&(s=h.return)&&(yield s.call(h))}finally{if(i)throw i.error}}return new Ke(o,d)}return Ke.empty()}))(t.open())}static fromAsync(e){return yc.__awaiter(this,void 0,void 0,function*(){return yield Ke.from(e)})}static fromStruct(e){return Ke.new(e.data.childData,e.type.children)}static new(...e){return new Ke(...mb.distributeColumnsIntoRecordBatches(_b.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 Ke(this._schema,e)}getColumn(e){return this.getColumnAt(this.getColumnIndex(e))}getColumnAt(e){return this.getChildAt(e)}getColumnIndex(e){return this._schema.fields.findIndex(t=>t.name===e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t,n,i=this._schema.fields,s=this._children||(this._children=[]);if(n=s[e])return n;if(t=i[e]){let a=this._chunks.map(o=>o.getChildAt(e)).filter(o=>o!=null);if(a.length>0)return s[e]=new PO.Column(t,a)}return null}serialize(e="binary",t=!0){return(t?pb.RecordBatchStreamWriter:pb.RecordBatchFileWriter).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...e){let t=this._schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e);return new Ke(t,this._chunks.map(({length:n,data:{childData:i}})=>new Pd.RecordBatch(t,n,e.map(s=>i[s]).filter(Boolean))))}assign(e){let t=this._schema.fields,[n,i]=e.schema.fields.reduce((o,d,h)=>{let[_,F]=o,U=t.findIndex(re=>re.name===d.name);return~U?F[U]=h:_.push(h),o},[[],[]]),s=this._schema.assign(e.schema),a=[...t.map((o,d,h,_=i[d])=>_===void 0?this.getColumnAt(d):e.getColumnAt(_)),...n.map(o=>e.getColumnAt(o))].filter(Boolean);return new Ke(...mb.distributeVectorsIntoRecordBatches(s,a))}};_c.Table=Ke;function VO(r){let{type:e}=r;return e instanceof kd.Struct?Ke.fromStruct(Nd.StructVector.from(r)):null}function NO(r){let{type:e}=r;return e instanceof kd.Struct?Nd.StructVector.from(r).then(t=>Ke.fromStruct(t)):null}});var Nr=v(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji._InternalEmptyPlaceholderRecordBatch=Ji.RecordBatch=void 0;var Ld=Gt(),xd=Ys(),LO=Me(),xO=tt(),CO=Je(),jO=at(),qO=pn(),WO=Yn(),Cd=ce(),zO=jl(),HO=gr(),Sn=class extends HO.StructVector{constructor(...e){let t,n=e[0],i;if(e[1]instanceof Ld.Data)[,t,i]=e;else{let s=n.fields,[,a,o]=e;t=Ld.Data.Struct(new Cd.Struct(s),0,a,0,null,o)}super(t,i);this._schema=n}static from(e){return jO.isIterable(e.values),xd.Table.from(e)}static new(...e){let[t,n]=WO.selectFieldArgs(e),i=n.filter(s=>s instanceof LO.Vector);return new Sn(...zO.ensureSameLengthData(new CO.Schema(t),i.map(s=>s.data)))}clone(e,t=this._children){return new Sn(this._schema,e,t)}concat(...e){let t=this._schema,n=qO.Chunked.flatten(this,...e);return new xd.Table(t,n.map(({data:i})=>new Sn(t,i)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=mc.collect(this))}select(...e){let t=this._schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e),n=e.map(i=>this.data.childData[i]).filter(Boolean);return new Sn(t,this.length,n)}};Ji.RecordBatch=Sn;var bb=class extends Sn{constructor(e){super(e,0,e.fields.map(t=>Ld.Data.new(t.type,0,0,0)))}};Ji._InternalEmptyPlaceholderRecordBatch=bb;var mc=class extends xO.Visitor{constructor(){super(...arguments);this.dictionaries=new Map}static collect(e){return new mc().visit(e.data,new Cd.Struct(e.schema.fields)).dictionaries}visit(e,t){return Cd.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 to=v(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.AsyncRecordBatchFileReader=Wt.RecordBatchFileReader=Wt.AsyncRecordBatchStreamReader=Wt.RecordBatchStreamReader=Wt.RecordBatchReader=void 0;var ve=ot(),gb=Me(),bc=pe(),vb=nl(),Tb=Ss(),Ib=ln(),ro=ol(),wb=t_(),jd=Nr(),ti=ci(),jt=ka(),qt=at(),wr=class extends ti.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 qt.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 Tb.default.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Tb.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 wr?e:qt.isArrowJSON(e)?YO(e):qt.isFileHandle(e)?$O(e):qt.isPromise(e)?(()=>ve.__awaiter(this,void 0,void 0,function*(){return yield wr.from(yield e)}))():qt.isFetchResponse(e)||qt.isReadableDOMStream(e)||qt.isReadableNodeStream(e)||qt.isAsyncIterable(e)?KO(new Ib.AsyncByteStream(e)):GO(new Ib.ByteStream(e))}static readAll(e){return e instanceof wr?e.isSync()?Ob(e):Eb(e):qt.isArrowJSON(e)||ArrayBuffer.isView(e)||qt.isIterable(e)||qt.isIteratorResult(e)?Ob(e):Eb(e)}};Wt.RecordBatchReader=wr;var Qi=class extends wr{constructor(e){super(e);this._impl=e}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return ve.__asyncGenerator(this,arguments,function*(){yield ve.__await(yield*ve.__asyncDelegator(ve.__asyncValues(this[Symbol.iterator]())))})}};Wt.RecordBatchStreamReader=Qi;var Zi=class extends wr{constructor(e){super(e);this._impl=e}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}};Wt.AsyncRecordBatchStreamReader=Zi;var gc=class extends Qi{constructor(e){super(e);this._impl=e}};Wt.RecordBatchFileReader=gc;var qd=class extends Zi{constructor(e){super(e);this._impl=e}};Wt.AsyncRecordBatchFileReader=qd;var Wd=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 jd.RecordBatch(this.schema,e.length,this._loadVectors(e,t,this.schema.fields))}_loadDictionaryBatch(e,t){let{id:n,isDelta:i,data:s}=e,{dictionaries:a,schema:o}=this,d=a.get(n);if(i||!d){let h=o.dictionaries.get(n);return d&&i?d.concat(gb.Vector.new(this._loadVectors(s,t,[h])[0])):gb.Vector.new(this._loadVectors(s,t,[h])[0])}return d}_loadVectors(e,t,n){return new wb.VectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}},no=class extends Wd{constructor(e,t){super(t);this._reader=qt.isArrowJSON(e)?new jt.JSONMessageReader(this._handle=e):new jt.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=Ab(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):ti.ITERATOR_DONE}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):ti.ITERATOR_DONE}next(){if(this.closed)return ti.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new jd._InternalEmptyPlaceholderRecordBatch(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},io=class extends Wd{constructor(e,t){super(t);this._reader=new jt.AsyncMessageReader(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return ve.__awaiter(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return ve.__awaiter(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Ab(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return ve.__awaiter(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):ti.ITERATOR_DONE})}return(e){return ve.__awaiter(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):ti.ITERATOR_DONE})}next(){return ve.__awaiter(this,void 0,void 0,function*(){if(this.closed)return ti.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=yield t.readMessageBody(e.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=yield t.readMessageBody(e.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new jd._InternalEmptyPlaceholderRecordBatch(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return ve.__awaiter(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},zd=class extends no{constructor(e,t){super(e instanceof ro.RandomAccessFile?e:new ro.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(bc.MessageHeader.RecordBatch);if(n==null?void 0:n.isRecordBatch()){let i=n.header(),s=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,s)}}return null}_readDictionaryBatch(e){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(bc.MessageHeader.DictionaryBatch);if(n==null?void 0:n.isDictionaryBatch()){let i=n.header(),s=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(i,s);this.dictionaries.set(i.id,a)}}}_readFooter(){let{_handle:e}=this,t=e.size-jt.magicAndPadding,n=e.readInt32(t),i=e.readAt(t-n,n);return vb.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}},Sb=class extends io{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 ro.AsyncRandomAccessFile?e:new ro.AsyncRandomAccessFile(e,n),i)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return ve.__awaiter(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return ve.__awaiter(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let t=this._footer&&this._footer.getRecordBatch(e);if(t&&(yield this._handle.seek(t.offset))){let n=yield this._reader.readMessage(bc.MessageHeader.RecordBatch);if(n==null?void 0:n.isRecordBatch()){let i=n.header(),s=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,s)}}return null})}_readDictionaryBatch(e){return ve.__awaiter(this,void 0,void 0,function*(){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&(yield this._handle.seek(t.offset))){let n=yield this._reader.readMessage(bc.MessageHeader.DictionaryBatch);if(n==null?void 0:n.isDictionaryBatch()){let i=n.header(),s=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(i,s);this.dictionaries.set(i.id,a)}}})}_readFooter(){return ve.__awaiter(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-jt.magicAndPadding,n=yield e.readInt32(t),i=yield e.readAt(t-n,n);return vb.Footer.decode(i)})}_readNextMessageAndValidate(e){return ve.__awaiter(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},Bb=class extends no{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new wb.JSONVectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}};function Ab(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*Ob(r){let e=wr.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function Eb(r){return ve.__asyncGenerator(this,arguments,function*(){let t=yield ve.__await(wr.from(r));try{if(!(yield ve.__await(t.open({autoDestroy:!1}))).closed)do yield yield ve.__await(t);while(!(yield ve.__await(t.reset().open())).closed)}finally{yield ve.__await(t.cancel())}})}function YO(r){return new Qi(new Bb(r))}function GO(r){let e=r.peek(jt.magicLength+7&~7);return e&&e.byteLength>=4?jt.checkForMagicArrowString(e)?new gc(new zd(r.read())):new Qi(new no(r)):new Qi(new no(function*(){}()))}function KO(r){return ve.__awaiter(this,void 0,void 0,function*(){let e=yield r.peek(jt.magicLength+7&~7);return e&&e.byteLength>=4?jt.checkForMagicArrowString(e)?new gc(new zd(yield r.read())):new Zi(new io(r)):new Zi(new io(function(){return ve.__asyncGenerator(this,arguments,function*(){})}()))})}function $O(r){return ve.__awaiter(this,void 0,void 0,function*(){let{size:e}=yield r.stat(),t=new ro.AsyncRandomAccessFile(r,e);return e>=jt.magicX2AndPadding&&jt.checkForMagicArrowString(yield t.readAt(0,jt.magicLength+7&~7))?new qd(new Sb(t)):new Zi(new io(t))})}});var Rb=v(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.toDOMStream=void 0;var vc=ot(),Db=He(),Fb=at();function JO(r,e){if(Fb.isAsyncIterable(r))return ZO(r,e);if(Fb.isIterable(r))return QO(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}Tc.toDOMStream=JO;function QO(r,e){let t=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(a){s(a,t||(t=r[Symbol.iterator]()))},pull(a){t?s(a,t):a.close()},cancel(){((t==null?void 0:t.return)&&t.return()||!0)&&(t=null)}}),Object.assign({highWaterMark:n?i:void 0},e));function s(a,o){let d,h=null,_=a.desiredSize||null;for(;!(h=o.next(n?_:null)).done;)if(ArrayBuffer.isView(h.value)&&(d=Db.toUint8Array(h.value))&&(_!=null&&n&&(_=_-d.byteLength+1),h.value=d),a.enqueue(h.value),_!=null&&--_<=0)return;a.close()}}function ZO(r,e){let t=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(a){return vc.__awaiter(this,void 0,void 0,function*(){yield s(a,t||(t=r[Symbol.asyncIterator]()))})},pull(a){return vc.__awaiter(this,void 0,void 0,function*(){t?yield s(a,t):a.close()})},cancel(){return vc.__awaiter(this,void 0,void 0,function*(){((t==null?void 0:t.return)&&(yield t.return())||!0)&&(t=null)})}}),Object.assign({highWaterMark:n?i:void 0},e));function s(a,o){return vc.__awaiter(this,void 0,void 0,function*(){let d,h=null,_=a.desiredSize||null;for(;!(h=yield o.next(n?_:null)).done;)if(ArrayBuffer.isView(h.value)&&(d=Db.toUint8Array(h.value))&&(_!=null&&n&&(_=_-d.byteLength+1),h.value=d),a.enqueue(h.value),_!=null&&--_<=0)return;a.close()})}}});var Pb=v(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.BuilderTransform=Xi.builderThroughDOMStream=void 0;var XO=ot(),eE=Ta();function tE(r){return new Hd(r)}Xi.builderThroughDOMStream=tE;var Hd=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=e,s=XO.__rest(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=eE.Builder.new(s),this._getSize=i!=="bytes"?Mb:Ub;let{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:o=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:d=>{this._maybeFlush(this._builder,this._controller=d)},start:d=>{this._maybeFlush(this._builder,this._controller=d)}},{highWaterMark:a,size:i!=="bytes"?Mb:Ub}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:o,size:d=>this._writeValueAndReturnChunkSize(d)})}_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)}};Xi.BuilderTransform=Hd;var Mb=r=>r.length,Ub=r=>r.byteLength});var kb=v(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.recordBatchReaderThroughDOMStream=void 0;var so=ot(),rE=ln(),nE=to();function iE(r,e){let t=new rE.AsyncByteQueue,n=null,i=new ReadableStream({cancel(){return so.__awaiter(this,void 0,void 0,function*(){yield t.close()})},start(o){return so.__awaiter(this,void 0,void 0,function*(){yield a(o,n||(n=yield s()))})},pull(o){return so.__awaiter(this,void 0,void 0,function*(){n?yield a(o,n):o.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:i};function s(){return so.__awaiter(this,void 0,void 0,function*(){return yield(yield nE.RecordBatchReader.from(t)).open(e)})}function a(o,d){return so.__awaiter(this,void 0,void 0,function*(){let h=o.desiredSize,_=null;for(;!(_=yield d.next()).done;)if(o.enqueue(_.value),h!=null&&--h<=0)return;o.close()})}}Ic.recordBatchReaderThroughDOMStream=iE});var Vb=v(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.recordBatchWriterThroughDOMStream=void 0;var wc=ot(),sE=ln();function oE(r,e){let t=new this(r),n=new sE.AsyncByteStream(t),i=new ReadableStream({type:"bytes",cancel(){return wc.__awaiter(this,void 0,void 0,function*(){yield n.cancel()})},pull(a){return wc.__awaiter(this,void 0,void 0,function*(){yield s(a)})},start(a){return wc.__awaiter(this,void 0,void 0,function*(){yield s(a)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:i};function s(a){return wc.__awaiter(this,void 0,void 0,function*(){let o=null,d=a.desiredSize;for(;o=yield n.read(d||null);)if(a.enqueue(o),d!=null&&(d-=o.byteLength)<=0)return;a.close()})}}Sc.recordBatchWriterThroughDOMStream=oE});var Qd=v(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.custom=te.or=te.and=te.col=te.lit=te.CustomPredicate=te.Not=te.GTeq=te.LTeq=te.Equals=te.Or=te.And=te.CombinationPredicate=te.ComparisonPredicate=te.Predicate=te.Col=te.Literal=te.Value=void 0;var aE=Xa(),Bn=class{eq(e){return e instanceof Bn||(e=new Cr(e)),new Gd(this,e)}le(e){return e instanceof Bn||(e=new Cr(e)),new Kd(this,e)}ge(e){return e instanceof Bn||(e=new Cr(e)),new $d(this,e)}lt(e){return new ns(this.ge(e))}gt(e){return new ns(this.le(e))}ne(e){return new ns(this.eq(e))}};te.Value=Bn;var Cr=class extends Bn{constructor(e){super();this.v=e}};te.Literal=Cr;var Yd=class extends Bn{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)}};te.Col=Yd;var es=class{and(...e){return new ts(this,...e)}or(...e){return new rs(this,...e)}not(){return new ns(this)}};te.Predicate=es;var oo=class extends es{constructor(e,t){super();this.left=e,this.right=t}bind(e){return this.left instanceof Cr?this.right instanceof Cr?this._bindLitLit(e,this.left,this.right):this._bindLitCol(e,this.left,this.right):this.right instanceof Cr?this._bindColLit(e,this.left,this.right):this._bindColCol(e,this.left,this.right)}};te.ComparisonPredicate=oo;var ao=class extends es{constructor(...e){super();this.children=e}};te.CombinationPredicate=ao;ao.prototype.children=Object.freeze([]);var ts=class extends ao{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof ts?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.every(s=>s(n,i))}};te.And=ts;var rs=class extends ao{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof rs?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.some(s=>s(n,i))}};te.Or=rs;var Gd=class extends oo{_bindLitLit(e,t,n){let i=t.v==n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(a,o)=>i(a,o)==s(a,o)}_bindColLit(e,t,n){let i=t.bind(e);if(t.vector instanceof aE.DictionaryVector){let s,a=t.vector;return a.dictionary!==this.lastDictionary?(s=a.reverseLookup(n.v),this.lastDictionary=a.dictionary,this.lastKey=s):s=this.lastKey,s===-1?()=>!1:o=>a.getKey(o)===s}else return(s,a)=>i(s,a)==n.v}_bindLitCol(e,t,n){return this._bindColLit(e,n,t)}};te.Equals=Gd;var Kd=class extends oo{_bindLitLit(e,t,n){let i=t.v<=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(a,o)=>i(a,o)<=s(a,o)}_bindColLit(e,t,n){let i=t.bind(e);return(s,a)=>i(s,a)<=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(s,a)=>t.v<=i(s,a)}};te.LTeq=Kd;var $d=class extends oo{_bindLitLit(e,t,n){let i=t.v>=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(a,o)=>i(a,o)>=s(a,o)}_bindColLit(e,t,n){let i=t.bind(e);return(s,a)=>i(s,a)>=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(s,a)=>t.v>=i(s,a)}};te.GTeq=$d;var ns=class extends es{constructor(e){super();this.child=e}bind(e){let t=this.child.bind(e);return(n,i)=>!t(n,i)}};te.Not=ns;var Jd=class extends es{constructor(e,t){super();this.next=e,this.bind_=t}bind(e){return this.bind_(e),this.next}};te.CustomPredicate=Jd;function cE(r){return new Cr(r)}te.lit=cE;function uE(r){return new Yd(r)}te.col=uE;function lE(...r){return new ts(...r)}te.and=lE;function dE(...r){return new rs(...r)}te.or=dE;function fE(r,e){return new Jd(r,e)}te.custom=fE});var qb=v(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.FilteredDataFrame=An.CountByResult=An.DataFrame=void 0;var Nb=Ys(),Lb=nc(),Zd=Je(),xb=Qd(),hE=Nr(),Cb=ce(),Xd=class extends Nb.Table{filter(e){return new co(this.chunks,e)}scan(e,t){let n=this.chunks,i=n.length;for(let s=-1;++s<i;){let a=n[s];t&&t(a);for(let o=-1,d=a.length;++o<d;)e(o,a)}}scanReverse(e,t){let n=this.chunks,i=n.length;for(let s=i;--s>=0;){let a=n[s];t&&t(a);for(let o=a.length;--o>=0;)e(o,a)}}countBy(e){let t=this.chunks,n=t.length,i=typeof e=="string"?new xb.Col(e):e;i.bind(t[n-1]);let s=i.vector;if(!Cb.DataType.isDictionary(s.type))throw new Error("countBy currently only supports dictionary-encoded columns");let a=Math.ceil(Math.log(s.length)/Math.log(256)),o=a==4?Uint32Array:a>=2?Uint16Array:Uint8Array,d=new o(s.dictionary.length);for(let h=-1;++h<n;){let _=t[h];i.bind(_);let F=i.vector.indices;for(let U=-1,re=_.length;++U<re;){let _e=F.get(U);_e!==null&&d[_e]++}}return new Bc(s.dictionary,Lb.IntVector.from(d))}};An.DataFrame=Xd;var Bc=class extends Nb.Table{constructor(e,t){let n=new Zd.Schema([new Zd.Field("values",e.type),new Zd.Field("counts",t.type)]);super(new hE.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}};An.CountByResult=Bc;var jb=class{constructor(e,t){this.batches=e,this.predicate=t,this.batchIndex=0,this.index=0,this.batch=this.batches[this.batchIndex],this.predicateFunc=this.predicate.bind(this.batch)}next(){for(;this.batchIndex<this.batches.length;){for(;this.index<this.batch.length;){if(this.predicateFunc(this.index,this.batch))return{value:this.batch.get(this.index++)};this.index++}++this.batchIndex<this.batches.length&&(this.index=0,this.batch=this.batches[this.batchIndex],this.predicateFunc=this.predicate.bind(this.batch))}return{done:!0,value:null}}[Symbol.iterator](){return this}},co=class extends Xd{constructor(e,t){super(e);this._predicate=t}scan(e,t){let n=this._chunks,i=n.length;for(let s=-1;++s<i;){let a=n[s],o=this._predicate.bind(a),d=!1;for(let h=-1,_=a.length;++h<_;)o(h,a)&&(t&&!d&&(t(a),d=!0),e(h,a))}}scanReverse(e,t){let n=this._chunks,i=n.length;for(let s=i;--s>=0;){let a=n[s],o=this._predicate.bind(a),d=!1;for(let h=a.length;--h>=0;)o(h,a)&&(t&&!d&&(t(a),d=!0),e(h,a))}}count(){let e=0,t=this._chunks,n=t.length;for(let i=-1;++i<n;){let s=t[i],a=this._predicate.bind(s);for(let o=-1,d=s.length;++o<d;)a(o,s)&&++e}return e}[Symbol.iterator](){return new jb(this._chunks,this._predicate)}filter(e){return new co(this._chunks,this._predicate.and(e))}countBy(e){let t=this._chunks,n=t.length,i=typeof e=="string"?new xb.Col(e):e;i.bind(t[n-1]);let s=i.vector;if(!Cb.DataType.isDictionary(s.type))throw new Error("countBy currently only supports dictionary-encoded columns");let a=Math.ceil(Math.log(s.length)/Math.log(256)),o=a==4?Uint32Array:a>=2?Uint16Array:Uint8Array,d=new o(s.dictionary.length);for(let h=-1;++h<n;){let _=t[h],F=this._predicate.bind(_);i.bind(_);let U=i.vector.indices;for(let re=-1,_e=_.length;++re<_e;){let me=U.get(re);me!==null&&F(re,_)&&d[me]++}}return new Bc(s.dictionary,Lb.IntVector.from(d))}};An.FilteredDataFrame=co});var Hb=v(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.isTypedArray=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.Type=l.MessageHeader=l.MetadataVersion=l.IntervalUnit=l.UnionMode=l.Precision=l.TimeUnit=l.DateUnit=void 0;var is=Jr();Object.defineProperty(l,"DateUnit",{enumerable:!0,get:function(){return is.DateUnit}});Object.defineProperty(l,"TimeUnit",{enumerable:!0,get:function(){return is.TimeUnit}});Object.defineProperty(l,"Precision",{enumerable:!0,get:function(){return is.Precision}});Object.defineProperty(l,"UnionMode",{enumerable:!0,get:function(){return is.UnionMode}});Object.defineProperty(l,"IntervalUnit",{enumerable:!0,get:function(){return is.IntervalUnit}});Object.defineProperty(l,"MetadataVersion",{enumerable:!0,get:function(){return is.MetadataVersion}});var pE=ko();Object.defineProperty(l,"MessageHeader",{enumerable:!0,get:function(){return pE.MessageHeader}});var Wb=pe();Object.defineProperty(l,"Type",{enumerable:!0,get:function(){return Wb.Type}});Object.defineProperty(l,"BufferType",{enumerable:!0,get:function(){return Wb.BufferType}});var yE=Gt();Object.defineProperty(l,"Data",{enumerable:!0,get:function(){return yE.Data}});var $=ce();Object.defineProperty(l,"DataType",{enumerable:!0,get:function(){return $.DataType}});Object.defineProperty(l,"Null",{enumerable:!0,get:function(){return $.Null}});Object.defineProperty(l,"Bool",{enumerable:!0,get:function(){return $.Bool}});Object.defineProperty(l,"Int",{enumerable:!0,get:function(){return $.Int}});Object.defineProperty(l,"Int8",{enumerable:!0,get:function(){return $.Int8}});Object.defineProperty(l,"Int16",{enumerable:!0,get:function(){return $.Int16}});Object.defineProperty(l,"Int32",{enumerable:!0,get:function(){return $.Int32}});Object.defineProperty(l,"Int64",{enumerable:!0,get:function(){return $.Int64}});Object.defineProperty(l,"Uint8",{enumerable:!0,get:function(){return $.Uint8}});Object.defineProperty(l,"Uint16",{enumerable:!0,get:function(){return $.Uint16}});Object.defineProperty(l,"Uint32",{enumerable:!0,get:function(){return $.Uint32}});Object.defineProperty(l,"Uint64",{enumerable:!0,get:function(){return $.Uint64}});Object.defineProperty(l,"Float",{enumerable:!0,get:function(){return $.Float}});Object.defineProperty(l,"Float16",{enumerable:!0,get:function(){return $.Float16}});Object.defineProperty(l,"Float32",{enumerable:!0,get:function(){return $.Float32}});Object.defineProperty(l,"Float64",{enumerable:!0,get:function(){return $.Float64}});Object.defineProperty(l,"Utf8",{enumerable:!0,get:function(){return $.Utf8}});Object.defineProperty(l,"Binary",{enumerable:!0,get:function(){return $.Binary}});Object.defineProperty(l,"FixedSizeBinary",{enumerable:!0,get:function(){return $.FixedSizeBinary}});Object.defineProperty(l,"Date_",{enumerable:!0,get:function(){return $.Date_}});Object.defineProperty(l,"DateDay",{enumerable:!0,get:function(){return $.DateDay}});Object.defineProperty(l,"DateMillisecond",{enumerable:!0,get:function(){return $.DateMillisecond}});Object.defineProperty(l,"Timestamp",{enumerable:!0,get:function(){return $.Timestamp}});Object.defineProperty(l,"TimestampSecond",{enumerable:!0,get:function(){return $.TimestampSecond}});Object.defineProperty(l,"TimestampMillisecond",{enumerable:!0,get:function(){return $.TimestampMillisecond}});Object.defineProperty(l,"TimestampMicrosecond",{enumerable:!0,get:function(){return $.TimestampMicrosecond}});Object.defineProperty(l,"TimestampNanosecond",{enumerable:!0,get:function(){return $.TimestampNanosecond}});Object.defineProperty(l,"Time",{enumerable:!0,get:function(){return $.Time}});Object.defineProperty(l,"TimeSecond",{enumerable:!0,get:function(){return $.TimeSecond}});Object.defineProperty(l,"TimeMillisecond",{enumerable:!0,get:function(){return $.TimeMillisecond}});Object.defineProperty(l,"TimeMicrosecond",{enumerable:!0,get:function(){return $.TimeMicrosecond}});Object.defineProperty(l,"TimeNanosecond",{enumerable:!0,get:function(){return $.TimeNanosecond}});Object.defineProperty(l,"Decimal",{enumerable:!0,get:function(){return $.Decimal}});Object.defineProperty(l,"List",{enumerable:!0,get:function(){return $.List}});Object.defineProperty(l,"Struct",{enumerable:!0,get:function(){return $.Struct}});Object.defineProperty(l,"Union",{enumerable:!0,get:function(){return $.Union}});Object.defineProperty(l,"DenseUnion",{enumerable:!0,get:function(){return $.DenseUnion}});Object.defineProperty(l,"SparseUnion",{enumerable:!0,get:function(){return $.SparseUnion}});Object.defineProperty(l,"Dictionary",{enumerable:!0,get:function(){return $.Dictionary}});Object.defineProperty(l,"Interval",{enumerable:!0,get:function(){return $.Interval}});Object.defineProperty(l,"IntervalDayTime",{enumerable:!0,get:function(){return $.IntervalDayTime}});Object.defineProperty(l,"IntervalYearMonth",{enumerable:!0,get:function(){return $.IntervalYearMonth}});Object.defineProperty(l,"FixedSizeList",{enumerable:!0,get:function(){return $.FixedSizeList}});Object.defineProperty(l,"Map_",{enumerable:!0,get:function(){return $.Map_}});var _E=Ys();Object.defineProperty(l,"Table",{enumerable:!0,get:function(){return _E.Table}});var mE=ki();Object.defineProperty(l,"Column",{enumerable:!0,get:function(){return mE.Column}});var bE=tt();Object.defineProperty(l,"Visitor",{enumerable:!0,get:function(){return bE.Visitor}});var zb=Je();Object.defineProperty(l,"Schema",{enumerable:!0,get:function(){return zb.Schema}});Object.defineProperty(l,"Field",{enumerable:!0,get:function(){return zb.Field}});var Y=gr();Object.defineProperty(l,"Vector",{enumerable:!0,get:function(){return Y.Vector}});Object.defineProperty(l,"BaseVector",{enumerable:!0,get:function(){return Y.BaseVector}});Object.defineProperty(l,"BinaryVector",{enumerable:!0,get:function(){return Y.BinaryVector}});Object.defineProperty(l,"BoolVector",{enumerable:!0,get:function(){return Y.BoolVector}});Object.defineProperty(l,"Chunked",{enumerable:!0,get:function(){return Y.Chunked}});Object.defineProperty(l,"DateVector",{enumerable:!0,get:function(){return Y.DateVector}});Object.defineProperty(l,"DateDayVector",{enumerable:!0,get:function(){return Y.DateDayVector}});Object.defineProperty(l,"DateMillisecondVector",{enumerable:!0,get:function(){return Y.DateMillisecondVector}});Object.defineProperty(l,"DecimalVector",{enumerable:!0,get:function(){return Y.DecimalVector}});Object.defineProperty(l,"DictionaryVector",{enumerable:!0,get:function(){return Y.DictionaryVector}});Object.defineProperty(l,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return Y.FixedSizeBinaryVector}});Object.defineProperty(l,"FixedSizeListVector",{enumerable:!0,get:function(){return Y.FixedSizeListVector}});Object.defineProperty(l,"FloatVector",{enumerable:!0,get:function(){return Y.FloatVector}});Object.defineProperty(l,"Float16Vector",{enumerable:!0,get:function(){return Y.Float16Vector}});Object.defineProperty(l,"Float32Vector",{enumerable:!0,get:function(){return Y.Float32Vector}});Object.defineProperty(l,"Float64Vector",{enumerable:!0,get:function(){return Y.Float64Vector}});Object.defineProperty(l,"IntervalVector",{enumerable:!0,get:function(){return Y.IntervalVector}});Object.defineProperty(l,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Y.IntervalDayTimeVector}});Object.defineProperty(l,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Y.IntervalYearMonthVector}});Object.defineProperty(l,"IntVector",{enumerable:!0,get:function(){return Y.IntVector}});Object.defineProperty(l,"Int8Vector",{enumerable:!0,get:function(){return Y.Int8Vector}});Object.defineProperty(l,"Int16Vector",{enumerable:!0,get:function(){return Y.Int16Vector}});Object.defineProperty(l,"Int32Vector",{enumerable:!0,get:function(){return Y.Int32Vector}});Object.defineProperty(l,"Int64Vector",{enumerable:!0,get:function(){return Y.Int64Vector}});Object.defineProperty(l,"Uint8Vector",{enumerable:!0,get:function(){return Y.Uint8Vector}});Object.defineProperty(l,"Uint16Vector",{enumerable:!0,get:function(){return Y.Uint16Vector}});Object.defineProperty(l,"Uint32Vector",{enumerable:!0,get:function(){return Y.Uint32Vector}});Object.defineProperty(l,"Uint64Vector",{enumerable:!0,get:function(){return Y.Uint64Vector}});Object.defineProperty(l,"ListVector",{enumerable:!0,get:function(){return Y.ListVector}});Object.defineProperty(l,"MapVector",{enumerable:!0,get:function(){return Y.MapVector}});Object.defineProperty(l,"NullVector",{enumerable:!0,get:function(){return Y.NullVector}});Object.defineProperty(l,"StructVector",{enumerable:!0,get:function(){return Y.StructVector}});Object.defineProperty(l,"TimestampVector",{enumerable:!0,get:function(){return Y.TimestampVector}});Object.defineProperty(l,"TimestampSecondVector",{enumerable:!0,get:function(){return Y.TimestampSecondVector}});Object.defineProperty(l,"TimestampMillisecondVector",{enumerable:!0,get:function(){return Y.TimestampMillisecondVector}});Object.defineProperty(l,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return Y.TimestampMicrosecondVector}});Object.defineProperty(l,"TimestampNanosecondVector",{enumerable:!0,get:function(){return Y.TimestampNanosecondVector}});Object.defineProperty(l,"TimeVector",{enumerable:!0,get:function(){return Y.TimeVector}});Object.defineProperty(l,"TimeSecondVector",{enumerable:!0,get:function(){return Y.TimeSecondVector}});Object.defineProperty(l,"TimeMillisecondVector",{enumerable:!0,get:function(){return Y.TimeMillisecondVector}});Object.defineProperty(l,"TimeMicrosecondVector",{enumerable:!0,get:function(){return Y.TimeMicrosecondVector}});Object.defineProperty(l,"TimeNanosecondVector",{enumerable:!0,get:function(){return Y.TimeNanosecondVector}});Object.defineProperty(l,"UnionVector",{enumerable:!0,get:function(){return Y.UnionVector}});Object.defineProperty(l,"DenseUnionVector",{enumerable:!0,get:function(){return Y.DenseUnionVector}});Object.defineProperty(l,"SparseUnionVector",{enumerable:!0,get:function(){return Y.SparseUnionVector}});Object.defineProperty(l,"Utf8Vector",{enumerable:!0,get:function(){return Y.Utf8Vector}});var J=Ta();Object.defineProperty(l,"Builder",{enumerable:!0,get:function(){return J.Builder}});Object.defineProperty(l,"BinaryBuilder",{enumerable:!0,get:function(){return J.BinaryBuilder}});Object.defineProperty(l,"BoolBuilder",{enumerable:!0,get:function(){return J.BoolBuilder}});Object.defineProperty(l,"DateBuilder",{enumerable:!0,get:function(){return J.DateBuilder}});Object.defineProperty(l,"DateDayBuilder",{enumerable:!0,get:function(){return J.DateDayBuilder}});Object.defineProperty(l,"DateMillisecondBuilder",{enumerable:!0,get:function(){return J.DateMillisecondBuilder}});Object.defineProperty(l,"DecimalBuilder",{enumerable:!0,get:function(){return J.DecimalBuilder}});Object.defineProperty(l,"DictionaryBuilder",{enumerable:!0,get:function(){return J.DictionaryBuilder}});Object.defineProperty(l,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return J.FixedSizeBinaryBuilder}});Object.defineProperty(l,"FixedSizeListBuilder",{enumerable:!0,get:function(){return J.FixedSizeListBuilder}});Object.defineProperty(l,"FloatBuilder",{enumerable:!0,get:function(){return J.FloatBuilder}});Object.defineProperty(l,"Float16Builder",{enumerable:!0,get:function(){return J.Float16Builder}});Object.defineProperty(l,"Float32Builder",{enumerable:!0,get:function(){return J.Float32Builder}});Object.defineProperty(l,"Float64Builder",{enumerable:!0,get:function(){return J.Float64Builder}});Object.defineProperty(l,"IntervalBuilder",{enumerable:!0,get:function(){return J.IntervalBuilder}});Object.defineProperty(l,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return J.IntervalDayTimeBuilder}});Object.defineProperty(l,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return J.IntervalYearMonthBuilder}});Object.defineProperty(l,"IntBuilder",{enumerable:!0,get:function(){return J.IntBuilder}});Object.defineProperty(l,"Int8Builder",{enumerable:!0,get:function(){return J.Int8Builder}});Object.defineProperty(l,"Int16Builder",{enumerable:!0,get:function(){return J.Int16Builder}});Object.defineProperty(l,"Int32Builder",{enumerable:!0,get:function(){return J.Int32Builder}});Object.defineProperty(l,"Int64Builder",{enumerable:!0,get:function(){return J.Int64Builder}});Object.defineProperty(l,"Uint8Builder",{enumerable:!0,get:function(){return J.Uint8Builder}});Object.defineProperty(l,"Uint16Builder",{enumerable:!0,get:function(){return J.Uint16Builder}});Object.defineProperty(l,"Uint32Builder",{enumerable:!0,get:function(){return J.Uint32Builder}});Object.defineProperty(l,"Uint64Builder",{enumerable:!0,get:function(){return J.Uint64Builder}});Object.defineProperty(l,"ListBuilder",{enumerable:!0,get:function(){return J.ListBuilder}});Object.defineProperty(l,"MapBuilder",{enumerable:!0,get:function(){return J.MapBuilder}});Object.defineProperty(l,"NullBuilder",{enumerable:!0,get:function(){return J.NullBuilder}});Object.defineProperty(l,"StructBuilder",{enumerable:!0,get:function(){return J.StructBuilder}});Object.defineProperty(l,"TimestampBuilder",{enumerable:!0,get:function(){return J.TimestampBuilder}});Object.defineProperty(l,"TimestampSecondBuilder",{enumerable:!0,get:function(){return J.TimestampSecondBuilder}});Object.defineProperty(l,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return J.TimestampMillisecondBuilder}});Object.defineProperty(l,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return J.TimestampMicrosecondBuilder}});Object.defineProperty(l,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return J.TimestampNanosecondBuilder}});Object.defineProperty(l,"TimeBuilder",{enumerable:!0,get:function(){return J.TimeBuilder}});Object.defineProperty(l,"TimeSecondBuilder",{enumerable:!0,get:function(){return J.TimeSecondBuilder}});Object.defineProperty(l,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return J.TimeMillisecondBuilder}});Object.defineProperty(l,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return J.TimeMicrosecondBuilder}});Object.defineProperty(l,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return J.TimeNanosecondBuilder}});Object.defineProperty(l,"UnionBuilder",{enumerable:!0,get:function(){return J.UnionBuilder}});Object.defineProperty(l,"DenseUnionBuilder",{enumerable:!0,get:function(){return J.DenseUnionBuilder}});Object.defineProperty(l,"SparseUnionBuilder",{enumerable:!0,get:function(){return J.SparseUnionBuilder}});Object.defineProperty(l,"Utf8Builder",{enumerable:!0,get:function(){return J.Utf8Builder}});var ef=ln();Object.defineProperty(l,"ByteStream",{enumerable:!0,get:function(){return ef.ByteStream}});Object.defineProperty(l,"AsyncByteStream",{enumerable:!0,get:function(){return ef.AsyncByteStream}});Object.defineProperty(l,"AsyncByteQueue",{enumerable:!0,get:function(){return ef.AsyncByteQueue}});var uo=to();Object.defineProperty(l,"RecordBatchReader",{enumerable:!0,get:function(){return uo.RecordBatchReader}});Object.defineProperty(l,"RecordBatchFileReader",{enumerable:!0,get:function(){return uo.RecordBatchFileReader}});Object.defineProperty(l,"RecordBatchStreamReader",{enumerable:!0,get:function(){return uo.RecordBatchStreamReader}});Object.defineProperty(l,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return uo.AsyncRecordBatchFileReader}});Object.defineProperty(l,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return uo.AsyncRecordBatchStreamReader}});var Ac=Ya();Object.defineProperty(l,"RecordBatchWriter",{enumerable:!0,get:function(){return Ac.RecordBatchWriter}});Object.defineProperty(l,"RecordBatchFileWriter",{enumerable:!0,get:function(){return Ac.RecordBatchFileWriter}});Object.defineProperty(l,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return Ac.RecordBatchStreamWriter}});Object.defineProperty(l,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return Ac.RecordBatchJSONWriter}});var tf=ka();Object.defineProperty(l,"MessageReader",{enumerable:!0,get:function(){return tf.MessageReader}});Object.defineProperty(l,"AsyncMessageReader",{enumerable:!0,get:function(){return tf.AsyncMessageReader}});Object.defineProperty(l,"JSONMessageReader",{enumerable:!0,get:function(){return tf.JSONMessageReader}});var gE=$n();Object.defineProperty(l,"Message",{enumerable:!0,get:function(){return gE.Message}});var vE=Nr();Object.defineProperty(l,"RecordBatch",{enumerable:!0,get:function(){return vE.RecordBatch}});var rf=qb();Object.defineProperty(l,"DataFrame",{enumerable:!0,get:function(){return rf.DataFrame}});Object.defineProperty(l,"FilteredDataFrame",{enumerable:!0,get:function(){return rf.FilteredDataFrame}});Object.defineProperty(l,"CountByResult",{enumerable:!0,get:function(){return rf.CountByResult}});var TE=Fs(),IE=cl(),wE=cr(),SE=As(),BE=He(),AE=Ls(),OE=Qd();l.predicate=OE;var nf=Al();l.util=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},TE),IE),wE),SE),BE),AE),{compareSchemas:nf.compareSchemas,compareFields:nf.compareFields,compareTypes:nf.compareTypes});var EE=Yn();Object.defineProperty(l,"isTypedArray",{enumerable:!0,get:function(){return EE.isTypedArray}})});var cs=v(()=>{});var lo=v(()=>{});var Jb=v(()=>{});var Qb=v(()=>{});var Zb=v(()=>{});var PE={};WT(PE,{registerWorker:()=>ng});var Yb=Br(Ss()),Gb=Br(Ta()),ss=Br(to()),os=Br(Ya()),Kb=Br(Rb()),$b=Br(Pb()),Oc=Br(kb()),Ec=Br(Vb()),p=Br(Hb());Yb.default.toDOMStream=Kb.toDOMStream;Gb.Builder.throughDOM=$b.builderThroughDOMStream;ss.RecordBatchReader.throughDOM=Oc.recordBatchReaderThroughDOMStream;ss.RecordBatchFileReader.throughDOM=Oc.recordBatchReaderThroughDOMStream;ss.RecordBatchStreamReader.throughDOM=Oc.recordBatchReaderThroughDOMStream;os.RecordBatchWriter.throughDOM=Ec.recordBatchWriterThroughDOMStream;os.RecordBatchFileWriter.throughDOM=Ec.recordBatchWriterThroughDOMStream;os.RecordBatchStreamWriter.throughDOM=Ec.recordBatchWriterThroughDOMStream;var sf;(function(s){s[s.NONE=0]="NONE",s[s.DEBUG=1]="DEBUG",s[s.INFO=2]="INFO",s[s.WARNING=3]="WARNING",s[s.ERROR=4]="ERROR"})(sf||(sf={}));var of;(function(s){s[s.NONE=0]="NONE",s[s.CONNECT=1]="CONNECT",s[s.DISCONNECT=2]="DISCONNECT",s[s.OPEN=3]="OPEN",s[s.QUERY=4]="QUERY"})(of||(of={}));var af;(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"})(af||(af={}));var cf;(function(s){s[s.NONE=0]="NONE",s[s.WEB_WORKER=1]="WEB_WORKER",s[s.NODE_WORKER=2]="NODE_WORKER",s[s.BINDINGS=3]="BINDINGS",s[s.ASYNC_DUCKDB=4]="ASYNC_DUCKDB"})(cf||(cf={}));var DE=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 oe;(function(D){D.CLOSE_PREPARED="CLOSE_PREPARED",D.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",D.CONNECT="CONNECT",D.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",D.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",D.CREATE_PREPARED="CREATE_PREPARED",D.DISCONNECT="DISCONNECT",D.DROP_FILE="DROP_FILE",D.DROP_FILES="DROP_FILES",D.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",D.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",D.FLUSH_FILES="FLUSH_FILES",D.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",D.GET_VERSION="GET_VERSION",D.GLOB_FILE_INFOS="GLOB_FILE_INFOS",D.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",D.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",D.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",D.INSTANTIATE="INSTANTIATE",D.OPEN="OPEN",D.PING="PING",D.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",D.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",D.REGISTER_FILE_URL="REGISTER_FILE_URL",D.RESET="RESET",D.RUN_PREPARED="RUN_PREPARED",D.RUN_QUERY="RUN_QUERY",D.SEND_PREPARED="SEND_PREPARED",D.SEND_QUERY="SEND_QUERY",D.TOKENIZE="TOKENIZE"})(oe||(oe={}));var ke;(function(S){S.CONNECTION_INFO="CONNECTION_INFO",S.ERROR="ERROR",S.FEATURE_FLAGS="FEATURE_FLAGS",S.FILE_BUFFER="FILE_BUFFER",S.FILE_INFOS="FILE_INFOS",S.FILE_SIZE="FILE_SIZE",S.FILE_STATISTICS="FILE_STATISTICS",S.LOG="LOG",S.OK="OK",S.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",S.QUERY_PLAN="QUERY_PLAN",S.QUERY_RESULT="QUERY_RESULT",S.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",S.QUERY_START="QUERY_START",S.REGISTERED_FILE="REGISTERED_FILE",S.SCRIPT_TOKENS="SCRIPT_TOKENS",S.SUCCESS="SUCCESS",S.VERSION_STRING="VERSION_STRING"})(ke||(ke={}));function as(r,e){switch(e.typeId){case p.Type.Binary:return{name:r,type:"binary"};case p.Type.Bool:return{name:r,type:"bool"};case p.Type.Date:return{name:r,type:"date"};case p.Type.DateDay:return{name:r,type:"date32[d]"};case p.Type.DateMillisecond:return{name:r,type:"date64[ms]"};case p.Type.Decimal:{let t=e;return{name:r,type:"decimal",precision:t.precision,scale:t.scale}}case p.Type.Float:return{name:r,type:"float"};case p.Type.Float16:return{name:r,type:"float16"};case p.Type.Float32:return{name:r,type:"float32"};case p.Type.Float64:return{name:r,type:"float64"};case p.Type.Int:return{name:r,type:"int32"};case p.Type.Int16:return{name:r,type:"int16"};case p.Type.Int32:return{name:r,type:"int32"};case p.Type.Int64:return{name:r,type:"int64"};case p.Type.Uint16:return{name:r,type:"uint16"};case p.Type.Uint32:return{name:r,type:"uint32"};case p.Type.Uint64:return{name:r,type:"uint64"};case p.Type.Uint8:return{name:r,type:"uint8"};case p.Type.IntervalDayTime:return{name:r,type:"interval[dt]"};case p.Type.IntervalYearMonth:return{name:r,type:"interval[m]"};case p.Type.List:{let t=e;return{name:r,type:"list",children:[as(t.valueField.name,t.valueField.type)]}}case p.Type.FixedSizeBinary:return{name:r,type:"fixedsizebinary",byteWidth:e.byteWidth};case p.Type.Null:return{name:r,type:"null"};case p.Type.Utf8:return{name:r,type:"utf8"};case p.Type.Struct:return{name:r,type:"struct",children:e.children.map(n=>as(n.name,n.type))};case p.Type.Time:return{name:r,type:"time[s]"};case p.Type.TimeMicrosecond:return{name:r,type:"time[us]"};case p.Type.TimeMillisecond:return{name:r,type:"time[ms]"};case p.Type.TimeNanosecond:return{name:r,type:"time[ns]"};case p.Type.TimeSecond:return{name:r,type:"time[s]"};case p.Type.Timestamp:return{name:r,type:"timestamp",timezone:e.timezone||void 0};case p.Type.TimestampSecond:return{name:r,type:"timestamp[s]",timezone:e.timezone||void 0};case p.Type.TimestampMicrosecond:return{name:r,type:"timestamp[us]",timezone:e.timezone||void 0};case p.Type.TimestampNanosecond:return{name:r,type:"timestamp[ns]",timezone:e.timezone||void 0};case p.Type.TimestampMillisecond:return{name:r,type:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error(`unsupported arrow type: ${e.toString()}`)}var XF=new TextEncoder;var uf=class{constructor(){this._bindings=null;this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:ke.LOG,data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.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:ke.ERROR,data:n},[])}async onMessage(e){switch(e.type){case oe.PING:this.sendOK(e);return;case oe.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 oe.GET_VERSION:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.VERSION_STRING,data:this._bindings.getVersion()},[]);break;case oe.GET_FEATURE_FLAGS:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.FEATURE_FLAGS,data:this._bindings.getFeatureFlags()},[]);break;case oe.RESET:this._bindings.reset(),this.sendOK(e);break;case oe.OPEN:this._bindings.open(e.data),this.sendOK(e);break;case oe.DROP_FILE:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.SUCCESS,data:this._bindings.dropFile(e.data)},[]);break;case oe.DROP_FILES:this._bindings.dropFiles(),this.sendOK(e);break;case oe.FLUSH_FILES:this._bindings.flushFiles(),this.sendOK(e);break;case oe.CONNECT:{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.CONNECTION_INFO,data:t.useUnsafe((n,i)=>i)},[]);break}case oe.DISCONNECT:this._bindings.disconnect(e.data),this.sendOK(e);break;case oe.CREATE_PREPARED:{let t=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.PREPARED_STATEMENT_ID,data:t},[]);break}case oe.CLOSE_PREPARED:{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case oe.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:ke.QUERY_RESULT,data:t},[t.buffer]);break}case oe.RUN_QUERY:{let t=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.QUERY_RESULT,data:t},[t.buffer]);break}case oe.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:ke.QUERY_START,data:t},[t.buffer]);break}case oe.SEND_QUERY:{let t=this._bindings.sendQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.QUERY_START,data:t},[t.buffer]);break}case oe.FETCH_QUERY_RESULTS:{let t=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.QUERY_RESULT_CHUNK,data:t},[t.buffer]);break}case oe.GLOB_FILE_INFOS:{let t=this._bindings.globFiles(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.FILE_INFOS,data:t},[]);break}case oe.REGISTER_FILE_URL:this._bindings.registerFileURL(e.data[0],e.data[1]),this.sendOK(e);break;case oe.REGISTER_FILE_BUFFER:this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case oe.REGISTER_FILE_HANDLE:this._bindings.registerFileHandle(e.data[0],e.data[1]),this.sendOK(e);break;case oe.COPY_FILE_TO_PATH:this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case oe.COPY_FILE_TO_BUFFER:{let t=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.FILE_BUFFER,data:t},[]);break}case oe.COLLECT_FILE_STATISTICS:this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case oe.EXPORT_FILE_STATISTICS:{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.FILE_STATISTICS,data:this._bindings.exportFileStatistics(e.data)},[]);break}case oe.INSERT_ARROW_FROM_IPC_STREAM:{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case oe.INSERT_CSV_FROM_PATH:{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case oe.INSERT_JSON_FROM_PATH:{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case oe.TOKENIZE:{let t=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:ke.SCRIPT_TOKENS,data:t},[]);break}}}catch(t){return this.failWith(e,t)}}};var lf={},FE=function(){var r=lf.url;return function(e){e=e||{};function t(){return Re.buffer!=It&&En(Re.buffer),Df}function n(){return Re.buffer!=It&&En(Re.buffer),Ff}function i(){return Re.buffer!=It&&En(Re.buffer),Rf}function s(){return Re.buffer!=It&&En(Re.buffer),Mf}function a(){return Re.buffer!=It&&En(Re.buffer),Uf}var o=typeof e!="undefined"?e:{},d,h;o.ready=new Promise(function(c,u){d=c,h=u});var _={},F;for(F in o)o.hasOwnProperty(F)&&(_[F]=o[F]);var U=[],re="./this.program",_e=function(c,u){throw u},me=typeof window=="object",it=typeof importScripts=="function",Ne=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",S=o.ENVIRONMENT_IS_PTHREAD||!1,_t="";function mf(c){return o.locateFile?o.locateFile(c,_t):_t+c}var ls,Dc,ds,ig;function sg(c){if(!(c instanceof gs)){var u=c;D("exiting due to exception: "+u)}}var vt,Tt;if(Ne){it?_t=cs().dirname(_t)+"/":_t=__dirname+"/",ls=function(u,f){return vt||(vt=lo()),Tt||(Tt=cs()),u=Tt.normalize(u),vt.readFileSync(u,f?null:"utf8")},ds=function(u){var f=ls(u,!0);return f.buffer||(f=new Uint8Array(f)),ho(f.buffer),f},Dc=function(u,f,y){vt||(vt=lo()),Tt||(Tt=cs()),u=Tt.normalize(u),vt.readFile(u,function(g,I){g?y(g):f(I.buffer)})},process.argv.length>1&&(re=process.argv[1].replace(/\\/g,"/")),U=process.argv.slice(2),process.on("uncaughtException",function(c){if(!(c instanceof gs))throw c}),process.on("unhandledRejection",function(c){throw c}),_e=function(c,u){if(ps())throw process.exitCode=c,u;sg(u),process.exit(c)},o.inspect=function(){return"[Emscripten Module object]"};var bf;try{bf=Jb()}catch(c){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),c}global.Worker=bf.Worker}else(me||it)&&(it?_t=self.location.href:typeof document!="undefined"&&document.currentScript&&(_t=document.currentScript.src),r&&(_t=r),_t.indexOf("blob:")!==0?_t=_t.substr(0,_t.replace(/[?#].*/,"").lastIndexOf("/")+1):_t="",Ne?(ls=function(u,f){return vt||(vt=lo()),Tt||(Tt=cs()),u=Tt.normalize(u),vt.readFileSync(u,f?null:"utf8")},ds=function(u){var f=ls(u,!0);return f.buffer||(f=new Uint8Array(f)),ho(f.buffer),f},Dc=function(u,f,y){vt||(vt=lo()),Tt||(Tt=cs()),u=Tt.normalize(u),vt.readFile(u,function(g,I){g?y(g):f(I.buffer)})}):(ls=function(c){var u=new XMLHttpRequest;return u.open("GET",c,!1),u.send(null),u.responseText},it&&(ds=function(c){var u=new XMLHttpRequest;return u.open("GET",c,!1),u.responseType="arraybuffer",u.send(null),new Uint8Array(u.response)}),Dc=function(c,u,f){var y=new XMLHttpRequest;y.open("GET",c,!0),y.responseType="arraybuffer",y.onload=function(){if(y.status==200||y.status==0&&y.response){u(y.response);return}f()},y.onerror=f,y.send(null)}),ig=function(c){document.title=c});Ne&&typeof performance=="undefined"&&(global.performance=Qb().performance);var gf=o.print||console.log.bind(console),D=o.printErr||console.warn.bind(console);for(F in _)_.hasOwnProperty(F)&&(o[F]=_[F]);_=null,o.arguments&&(U=o.arguments),o.thisProgram&&(re=o.thisProgram),o.quit&&(_e=o.quit);function fs(c){fs.shown||(fs.shown={}),fs.shown[c]||(fs.shown[c]=1,D(c))}var kE=Atomics.load,VE=Atomics.store,NE=Atomics.compareExchange,hs;o.wasmBinary&&(hs=o.wasmBinary);var vf=o.noExitRuntime||!0;typeof WebAssembly!="object"&&er("no native wasm support detected");var Re,Tf,fo=!1,On;function ho(c,u){c||er("Assertion failed: "+u)}function og(c){var u=o["_"+c];return ho(u,"Cannot call unknown function "+c+", make sure it is exported"),u}function ag(c,u,f,y,g){var I={string:function(We){var Sr=0;if(We!=null&&We!==0){var Ts=(We.length<<2)+1;Sr=ii(Ts),Af(We,Sr,Ts)}return Sr},array:function(We){var Sr=ii(We.length);return Ef(We,Sr),Sr}};function B(We){return u==="string"?Xt(We):u==="boolean"?Boolean(We):We}var V=og(c),ae=[],Xe=0;if(y)for(var st=0;st<y.length;st++){var vs=I[f[st]];vs?(Xe===0&&(Xe=bs()),ae[st]=vs(y[st])):ae[st]=y[st]}var ut=V.apply(null,ae);function tr(We){return Xe!==0&&ni(Xe),B(We)}return ut=tr(ut),ut}function If(c){var u=new TextDecoder(c);this.decode=function(f){return f.buffer instanceof SharedArrayBuffer&&(f=new Uint8Array(f)),u.decode.call(u,f)}}var wf=typeof TextDecoder!="undefined"?new If("utf8"):void 0;function Sf(c,u,f){for(var y=u+f,g=u;c[g]&&!(g>=y);)++g;if(g-u>16&&c.subarray&&wf)return wf.decode(c.subarray(u,g));for(var I="";u<g;){var B=c[u++];if(!(B&128)){I+=String.fromCharCode(B);continue}var V=c[u++]&63;if((B&224)==192){I+=String.fromCharCode((B&31)<<6|V);continue}var ae=c[u++]&63;if((B&240)==224?B=(B&15)<<12|V<<6|ae:B=(B&7)<<18|V<<12|ae<<6|c[u++]&63,B<65536)I+=String.fromCharCode(B);else{var Xe=B-65536;I+=String.fromCharCode(55296|Xe>>10,56320|Xe&1023)}}return I}function Xt(c,u){return c?Sf(n(),c,u):""}function Bf(c,u,f,y){if(!(y>0))return 0;for(var g=f,I=f+y-1,B=0;B<c.length;++B){var V=c.charCodeAt(B);if(V>=55296&&V<=57343){var ae=c.charCodeAt(++B);V=65536+((V&1023)<<10)|ae&1023}if(V<=127){if(f>=I)break;u[f++]=V}else if(V<=2047){if(f+1>=I)break;u[f++]=192|V>>6,u[f++]=128|V&63}else if(V<=65535){if(f+2>=I)break;u[f++]=224|V>>12,u[f++]=128|V>>6&63,u[f++]=128|V&63}else{if(f+3>=I)break;u[f++]=240|V>>18,u[f++]=128|V>>12&63,u[f++]=128|V>>6&63,u[f++]=128|V&63}}return u[f]=0,f-g}function Af(c,u,f){return Bf(c,n(),u,f)}function Of(c){for(var u=0,f=0;f<c.length;++f){var y=c.charCodeAt(f);y>=55296&&y<=57343&&(y=65536+((y&1023)<<10)|c.charCodeAt(++f)&1023),y<=127?++u:y<=2047?u+=2:y<=65535?u+=3:u+=4}return u}var LE=typeof TextDecoder!="undefined"?new If("utf-16le"):void 0;function Ef(c,u){t().set(c,u)}function cg(c,u,f){for(var y=0;y<c.length;++y)t()[u++>>0]=c.charCodeAt(y);f||(t()[u>>0]=0)}function ug(c,u){return c%u>0&&(c+=u-c%u),c}var It,Df,Ff,lg,dg,Rf,Mf,fg,Uf;S&&(It=o.buffer);function En(c){It=c,o.HEAP8=Df=new Int8Array(c),o.HEAP16=lg=new Int16Array(c),o.HEAP32=Rf=new Int32Array(c),o.HEAPU8=Ff=new Uint8Array(c),o.HEAPU16=dg=new Uint16Array(c),o.HEAPU32=Mf=new Uint32Array(c),o.HEAPF32=fg=new Float32Array(c),o.HEAPF64=Uf=new Float64Array(c)}var Pf=o.INITIAL_MEMORY||16777216;if(S)Re=o.wasmMemory,It=o.buffer;else if(o.wasmMemory)Re=o.wasmMemory;else if(Re=new WebAssembly.Memory({initial:Pf/65536,maximum:2147483648/65536,shared:!0}),!(Re.buffer instanceof SharedArrayBuffer))throw D("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),Ne&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Re&&(It=Re.buffer),Pf=It.byteLength,En(It);var ri,kf=[],Vf=[],hg=[],pg=[],Nf=[],yg=!1,_g=!1,Fc=0;function ps(){return vf||Fc>0}function mg(){if(!S){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)Tg(o.preRun.shift());po(kf)}}function Lf(){yg=!0,!S&&po(Vf)}function bg(){S||po(hg)}function gg(){S||(x.terminateAllThreads(),_g=!0)}function vg(){if(!S){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)wg(o.postRun.shift());po(Nf)}}function Tg(c){kf.unshift(c)}function Ig(c){Vf.unshift(c)}function wg(c){Nf.unshift(c)}var Dn=0,Rc=null,ys=null;function Sg(c){Dn++,o.monitorRunDependencies&&o.monitorRunDependencies(Dn)}function Bg(c){if(Dn--,o.monitorRunDependencies&&o.monitorRunDependencies(Dn),Dn==0&&(Rc!==null&&(clearInterval(Rc),Rc=null),ys)){var u=ys;ys=null,u()}}o.preloadedImages={},o.preloadedAudios={};function er(c){S?postMessage({cmd:"onAbort",arg:c}):o.onAbort&&o.onAbort(c),c="Aborted("+c+")",D(c),fo=!0,On=1,c+=". Build with -s ASSERTIONS=1 for more info.";var u=new WebAssembly.RuntimeError(c);throw h(u),u}var Ag="data:application/octet-stream;base64,";function xf(c){return c.startsWith(Ag)}var wt;o.locateFile?(wt="./duckdb-wasm-next-coi.wasm",xf(wt)||(wt=mf(wt))):wt=new URL("duckdb_wasm.wasm",lf.url).toString();function Cf(c){try{if(c==wt&&hs)return new Uint8Array(hs);if(ds)return ds(c);throw"both async and sync fetching of the wasm failed"}catch(u){er(u)}}function Og(){return!hs&&(me||it)&&typeof fetch=="function"?fetch(wt,{credentials:"same-origin"}).then(function(c){if(!c.ok)throw"failed to load wasm binary file at '"+wt+"'";return c.arrayBuffer()}).catch(function(){return Cf(wt)}):Promise.resolve().then(function(){return Cf(wt)})}function Eg(){var c={a:Gv};function u(B,V){var ae=B.exports;if(o.asm=ae,Pg(o.asm.$a),ri=o.asm.sa,Ig(o.asm.qa),Tf=V,!S){var Xe=x.unusedWorkers.length;x.unusedWorkers.forEach(function(st){x.loadWasmModuleToWorker(st,function(){--Xe||Bg("wasm-instantiate")})})}}S||Sg("wasm-instantiate");function f(B){u(B.instance,B.module)}function y(B){return Og().then(function(V){return WebAssembly.instantiate(V,c)}).then(function(V){return V}).then(B,function(V){D("failed to asynchronously prepare wasm: "+V),er(V)})}function g(){return!hs&&typeof WebAssembly.instantiateStreaming=="function"&&!xf(wt)&&typeof fetch=="function"?fetch(wt,{credentials:"same-origin"}).then(function(B){var V=WebAssembly.instantiateStreaming(B,c);return V.then(f,function(ae){return D("wasm streaming compile failed: "+ae),D("falling back to ArrayBuffer instantiation"),y(f)})}):y(f)}if(o.instantiateWasm)try{var I=o.instantiateWasm(c,u);return I}catch(B){return D("Module.instantiateWasm callback failed with error: "+B),!1}return g().catch(h),{}}var Dg={};function po(c){for(;c.length>0;){var u=c.shift();if(typeof u=="function"){u(o);continue}var f=u.func;typeof f=="number"?u.arg===void 0?ri.get(f)():ri.get(f)(u.arg):f(u.arg===void 0?null:u.arg)}}function jf(c,u){if(c<=0||c>t().length||c&!0||u<0)return-28;if(u==0)return 0;u>=2147483647&&(u=1/0);var f=Atomics.load(i(),si>>2),y=0;if(f==c){var g=Atomics.compareExchange(i(),si>>2,f,0);if(g==f&&(--u,y=1,u<=0))return 1}var I=Atomics.notify(i(),c>>2,u);if(I>=0)return I+y;throw"Atomics.notify returned an unexpected value "+I}o._emscripten_futex_wake=jf;function Fg(c){i()[c+8>>2]=0;var u=x.pthreads[c];delete x.pthreads[c],u.worker.terminate(),Wf(u),x.runningWorkers.splice(x.runningWorkers.indexOf(u.worker),1),u.worker.pthread=void 0}function Rg(c){var u=x.pthreads[c];u.worker.postMessage({cmd:"cancel"})}function qf(c){var u=x.pthreads[c];if(u){i()[c+8>>2]=0;var f=u.worker;x.returnWorkerToPool(f)}}function Wf(c){!c||(c.threadInfoStruct&&So(c.threadInfoStruct),c.threadInfoStruct=0,c.allocatedOwnStack&&c.stackBase&&So(c.stackBase),c.stackBase=0,c.worker&&(c.worker.pthread=null))}function yo(c){Fh(c)}o._exit=yo;function _o(c){if(c instanceof gs||c=="unwind")return On;_e(1,c)}var x={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){for(var c=4,u=0;u<c;++u)x.allocateUnusedWorker()},initWorker:function(){},pthreads:{},threadExitHandlers:[],setExitStatus:function(c){On=c},terminateAllThreads:function(){for(var c in x.pthreads){var u=x.pthreads[c];u&&u.worker&&x.returnWorkerToPool(u.worker)}for(var f=0;f<x.unusedWorkers.length;++f){var y=x.unusedWorkers[f];y.terminate()}x.unusedWorkers=[]},returnWorkerToPool:function(c){x.runWithoutMainThreadQueuedCalls(function(){delete x.pthreads[c.pthread.threadInfoStruct],x.unusedWorkers.push(c),x.runningWorkers.splice(x.runningWorkers.indexOf(c),1),Wf(c.pthread),c.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(c){i()[Dh>>2]=0;try{c()}finally{i()[Dh>>2]=1}},receiveObjectTransfer:function(c){},threadInit:function(){for(var c in x.tlsInitFunctions)x.tlsInitFunctions[c]()},loadWasmModuleToWorker:function(c,u){c.onmessage=function(f){var y=f.data,g=y.cmd;if(c.pthread&&(x.currentProxiedOperationCallerThread=c.pthread.threadInfoStruct),y.targetThread&&y.targetThread!=wo()){var I=x.pthreads[y.targetThread];I?I.worker.postMessage(y,y.transferList):D('Internal error! Worker sent a message "'+g+'" to target pthread '+y.targetThread+", but that thread no longer exists!"),x.currentProxiedOperationCallerThread=void 0;return}g==="processQueuedMainThreadWork"?Io():g==="spawnThread"?Yf(y):g==="cleanupThread"?qf(y.thread):g==="killThread"?Fg(y.thread):g==="cancelThread"?Rg(y.thread):g==="loaded"?(c.loaded=!0,u&&u(c),c.runPthread&&(c.runPthread(),delete c.runPthread)):g==="print"?gf("Thread "+y.threadId+": "+y.text):g==="printErr"?D("Thread "+y.threadId+": "+y.text):g==="alert"?alert("Thread "+y.threadId+": "+y.text):g==="detachedExit"||g==="cancelDone"?x.returnWorkerToPool(c):y.target==="setimmediate"?c.postMessage(y):g==="onAbort"?o.onAbort&&o.onAbort(y.arg):D("worker sent an unknown command "+g),x.currentProxiedOperationCallerThread=void 0},c.onerror=function(f){throw D("pthread sent an error! "+f.filename+":"+f.lineno+": "+f.message),f},Ne&&(c.on("message",function(f){c.onmessage({data:f})}),c.on("error",function(f){c.onerror(f)}),c.on("detachedExit",function(){})),c.postMessage({cmd:"load",urlOrBlob:o.mainScriptUrlOrBlob,wasmMemory:Re,wasmModule:Tf})},allocateUnusedWorker:function(){if(!o.locateFile){x.unusedWorkers.push(new Worker(new URL("duckdb_wasm.worker.js",lf.url)));return}var c=mf("duckdb_wasm.worker.js");x.unusedWorkers.push(new Worker(c))},getNewWorker:function(){return x.unusedWorkers.length==0&&(x.allocateUnusedWorker(),x.loadWasmModuleToWorker(x.unusedWorkers[0])),x.unusedWorkers.pop()}};function Mg(c,u){Oh(c,u),ni(c)}o.establishStackSpace=Mg;function zf(c){if(S)return be(1,0,c);try{yo(c)}catch(u){_o(u)}}function Ug(c,u){return ri.get(c)(u)}o.invokeEntryPoint=Ug;function Pg(c,u,f){x.tlsInitFunctions.push(c)}function kg(c,u,f,y){er("Assertion failed: "+Xt(c)+", at: "+[u?Xt(u):"unknown filename",f,y?Xt(y):"unknown function"])}var _s;Ne?_s=function(){var c=process.hrtime();return c[0]*1e3+c[1]/1e6}:S?_s=function(){return performance.now()-o.__performance_now_clock_drift}:_s=function(){return performance.now()};var Vg=!0;function Ng(c){return i()[Ah()>>2]=c,c}function Hf(c,u){var f;if(c===0)f=Date.now();else if((c===1||c===4)&&Vg)f=_s();else return Ng(28),-1;return i()[u>>2]=f/1e3|0,i()[u+4>>2]=f%1e3*1e3*1e3|0,0}function Lg(c,u){return Hf(c,u)}function xg(c,u){if(S)return be(2,1,c,u)}function Cg(c,u){x.threadExitHandlers.push(function(){ri.get(c)(u)})}function jg(c){Bh(c,!it,1),x.threadInit()}function Yf(c){var u=x.getNewWorker();if(!u)return 6;x.runningWorkers.push(u);var f=c.stackBase+c.stackSize,y=x.pthreads[c.pthread_ptr]={worker:u,stackBase:c.stackBase,stackSize:c.stackSize,allocatedOwnStack:c.allocatedOwnStack,threadInfoStruct:c.pthread_ptr},g=y.threadInfoStruct>>2;Atomics.store(s(),g+(60>>2),c.detached),Atomics.store(s(),g+(76>>2),c.stackSize),Atomics.store(s(),g+(72>>2),f),Atomics.store(s(),g+(100>>2),c.stackSize),Atomics.store(s(),g+(100+8>>2),f),Atomics.store(s(),g+(100+12>>2),c.detached),u.pthread=y;var I={cmd:"run",start_routine:c.startRoutine,arg:c.arg,threadInfoStruct:c.pthread_ptr,stackBase:c.stackBase,stackSize:c.stackSize};return u.runPthread=function(){I.time=performance.now(),u.postMessage(I,c.transferList)},u.loaded&&(u.runPthread(),delete u.runPthread),0}function qg(c,u,f,y){if(typeof SharedArrayBuffer=="undefined")return D("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var g=[],I=0;if(S&&(g.length===0||I))return Th(687865856,c,u,f,y);if(I)return I;var B=0,V=0,ae=0;u&&u!=-1?(B=i()[u>>2],B+=2097152,V=i()[u+8>>2],ae=i()[u+12>>2]!==0):B=2097152;var Xe=V==0;Xe?V=Eh(16,B):(V-=B,ho(V>0));var st={stackBase:V,stackSize:B,allocatedOwnStack:Xe,detached:ae,startRoutine:f,pthread_ptr:c,arg:y,transferList:g};return S?(st.cmd="spawnThread",postMessage(st,g),0):Yf(st)}function Wg(){postMessage({cmd:"detachedExit"})}function zg(c){for(;x.threadExitHandlers.length>0;)x.threadExitHandlers.pop()()}function Gf(c,u,f){if(c<=0||c>t().length||c&!0)return-28;if(me){if(Atomics.load(i(),c>>2)!=u)return-6;for(var g=performance.now(),I=g+f,B=Atomics.exchange(i(),si>>2,c);;){if(g=performance.now(),g>I)return B=Atomics.exchange(i(),si>>2,0),-73;if(B=Atomics.exchange(i(),si>>2,0),B==0)break;if(Io(),Atomics.load(i(),c>>2)!=u)return-6;B=Atomics.exchange(i(),si>>2,c)}return 0}else{var y=Atomics.wait(i(),c>>2,u,f);if(y==="timed-out")return-73;if(y==="not-equal")return-6;if(y==="ok")return 0;throw"Atomics.wait returned an unexpected value "+y}}function Kf(){Ne||it||fs("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function Hg(c,u,f){if(!c)return D("pthread_join attempted on a null thread pointer!"),71;if(S&&wo()==c)return D("PThread "+c+" is attempting to join to itself!"),16;if(!S&&vh()==c)return D("Main thread "+c+" is attempting to join to itself!"),16;var y=i()[c+8>>2];if(y!==c)return D("pthread_join attempted on thread "+c+", which does not point to a valid thread, or does not exist anymore!"),71;var g=Atomics.load(s(),c+60>>2);if(g)return D("Attempted to join thread "+c+", which was already detached!"),28;for(f&&Kf();;){var I=Atomics.load(s(),c+0>>2);if(I==1){if(u){var B=Atomics.load(s(),c+88>>2);i()[u>>2]=B}return Atomics.store(s(),c+60>>2,1),S?postMessage({cmd:"cleanupThread",thread:c}):qf(c),0}if(!f)return 10;Sh(),S||Io(),Gf(c+0,I,S?100:1)}}function Yg(c,u){return Hg(c,u,!0)}var $e={mappings:{},buffers:[null,[],[]],printChar:function(c,u){var f=$e.buffers[c];u===0||u===10?((c===1?gf:D)(Sf(f,0)),f.length=0):f.push(u)},varargs:void 0,get:function(){$e.varargs+=4;var c=i()[$e.varargs-4>>2];return c},getStr:function(c){var u=Xt(c);return u},get64:function(c,u){return c}};function $f(c,u){return S?be(3,1,c,u):(c=$e.getStr(c),$e.doAccess(c,u))}function Jf(c,u,f){return S?be(4,1,c,u,f):($e.varargs=f,0)}function Qf(c,u){if(S)return be(5,1,c,u)}function Zf(c,u,f,y){if(S)return be(6,1,c,u,f,y)}function Xf(c,u,f){if(S)return be(7,1,c,u,f)}function Gg(){return 42}function eh(c,u,f){return S?be(8,1,c,u,f):($e.varargs=f,0)}function Kg(c,u,f){return 0}function th(c,u){return S?be(9,1,c,u):(c=$e.getStr(c),$e.doMkdir(c,u))}function rh(c,u,f){if(S)return be(10,1,c,u,f);$e.varargs=f}function nh(c,u){if(S)return be(11,1,c,u)}function ih(c){if(S)return be(12,1,c)}function sh(c,u){if(S)return be(13,1,c,u)}function oh(c){if(S)return be(14,1,c)}function $g(c,u){er("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Jg(c,u){er("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Qg(c,u){if(c==u)postMessage({cmd:"processQueuedMainThreadWork"});else if(S)postMessage({targetThread:c,cmd:"processThreadQueue"});else{var f=x.pthreads[c],y=f&&f.worker;if(!y)return;y.postMessage({cmd:"processThreadQueue"})}return 1}function Zg(){er("")}function Xg(c,u){return globalThis.DUCKDB_RUNTIME.createDirectory(o,c,u)}function ev(c,u){return globalThis.DUCKDB_RUNTIME.checkDirectory(o,c,u)}function tv(c,u){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(o,c,u)}function rv(c,u){return globalThis.DUCKDB_RUNTIME.removeDirectory(o,c,u)}function nv(c){return globalThis.DUCKDB_RUNTIME.closeFile(o,c)}function iv(c,u){return globalThis.DUCKDB_RUNTIME.checkFile(o,c,u)}function sv(c){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(o,c)}function ov(c,u,f,y){return globalThis.DUCKDB_RUNTIME.moveFile(o,c,u,f,y)}function av(c){return globalThis.DUCKDB_RUNTIME.openFile(o,c)}function cv(c,u,f,y){return globalThis.DUCKDB_RUNTIME.readFile(o,c,u,f,y)}function uv(c,u){return globalThis.DUCKDB_RUNTIME.truncateFile(o,c,u)}function lv(c,u,f,y){return globalThis.DUCKDB_RUNTIME.writeFile(o,c,u,f,y)}function dv(c,u){return globalThis.DUCKDB_RUNTIME.glob(o,c,u)}function fv(c){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(o,c)}function hv(c,u){}function pv(){return 2147483648}function yv(c,u,f){n().copyWithin(c,u,u+f)}function _v(){return Ne?Zb().cpus().length:navigator.hardwareConcurrency}function be(c,u){for(var f=arguments.length-2,y=bs(),g=f,I=ii(g*8),B=I>>3,V=0;V<f;V++){var ae=arguments[2+V];a()[B+V]=ae}var Xe=Ih(c,g,I,u);return ni(y),Xe}var Mc=[];function mv(c,u,f){Mc.length=u;for(var y=f>>3,g=0;g<u;g++)Mc[g]=a()[y+g];var I=c<0,B=I?Dg[-c-1]:Hv[c];return B.apply(null,Mc)}function bv(c){try{return Re.grow(c-It.byteLength+65535>>>16),En(Re.buffer),1}catch(u){}}function gv(c){var u=n().length;if(c=c>>>0,c<=u)return!1;var f=2147483648;if(c>f)return!1;for(var y=1;y<=4;y*=2){var g=u*(1+.2/y);g=Math.min(g,c+100663296);var I=Math.min(f,ug(Math.max(c,g),65536)),B=bv(I);if(B)return!0}return!1}var ee={inEventHandler:0,removeAllEventListeners:function(){for(var c=ee.eventHandlers.length-1;c>=0;--c)ee._removeHandler(c);ee.eventHandlers=[],ee.deferredCalls=[]},registerRemoveEventListeners:function(){ee.removeEventListenersRegistered||(pg.push(ee.removeAllEventListeners),ee.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(c,u,f){function y(B,V){if(B.length!=V.length)return!1;for(var ae in B)if(B[ae]!=V[ae])return!1;return!0}for(var g in ee.deferredCalls){var I=ee.deferredCalls[g];if(I.targetFunction==c&&y(I.argsList,f))return}ee.deferredCalls.push({targetFunction:c,precedence:u,argsList:f}),ee.deferredCalls.sort(function(B,V){return B.precedence<V.precedence})},removeDeferredCalls:function(c){for(var u=0;u<ee.deferredCalls.length;++u)ee.deferredCalls[u].targetFunction==c&&(ee.deferredCalls.splice(u,1),--u)},canPerformEventHandlerRequests:function(){return ee.inEventHandler&&ee.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(!!ee.canPerformEventHandlerRequests())for(var c=0;c<ee.deferredCalls.length;++c){var u=ee.deferredCalls[c];ee.deferredCalls.splice(c,1),--c,u.targetFunction.apply(null,u.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(c,u){for(var f=0;f<ee.eventHandlers.length;++f)ee.eventHandlers[f].target==c&&(!u||u==ee.eventHandlers[f].eventTypeString)&&ee._removeHandler(f--)},_removeHandler:function(c){var u=ee.eventHandlers[c];u.target.removeEventListener(u.eventTypeString,u.eventListenerFunc,u.useCapture),ee.eventHandlers.splice(c,1)},registerOrRemoveHandler:function(c){var u=function(g){++ee.inEventHandler,ee.currentEventHandler=c,ee.runDeferredCalls(),c.handlerFunc(g),ee.runDeferredCalls(),--ee.inEventHandler};if(c.callbackfunc)c.eventListenerFunc=u,c.target.addEventListener(c.eventTypeString,u,c.useCapture),ee.eventHandlers.push(c),ee.registerRemoveEventListeners();else for(var f=0;f<ee.eventHandlers.length;++f)ee.eventHandlers[f].target==c.target&&ee.eventHandlers[f].eventTypeString==c.eventTypeString&&ee._removeHandler(f--)},queueEventHandlerOnThread_iiii:function(c,u,f,y,g){var I=bs(),B=ii(12);i()[B>>2]=f,i()[B+4>>2]=y,i()[B+8>>2]=g,Vc(0,c,637534208,u,y,B),ni(I)},getTargetThreadForEventCallback:function(c){switch(c){case 1:return 0;case 2:return x.currentProxiedOperationCallerThread;default:return c}},getNodeNameForTarget:function(c){return c?c==window?"#window":c==screen?"#screen":c&&c.nodeName?c.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function vv(c){var u=Of(c)+1,f=Nc(u);return Af(c,f,u),f}function Tv(c,u,f,y){var g=bs(),I=ii(12),B=0;u&&(B=vv(u)),i()[I>>2]=B,i()[I+4>>2]=f,i()[I+8>>2]=y,Vc(0,c,657457152,0,B,I),ni(g)}function Iv(c,u,f,y){u=u?Xt(u):"",Tv(c,u,f,y)}function wv(c){return c>2?Xt(c):c}var Sv=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function Bv(c){c=wv(c);var u=Sv[c]||(typeof document!="undefined"?document.querySelector(c):void 0);return u}function Uc(c){return Bv(c)}function ah(c,u,f){var y=Uc(c);if(!y)return-4;if(y.canvasSharedPtr&&(i()[y.canvasSharedPtr>>2]=u,i()[y.canvasSharedPtr+4>>2]=f),y.offscreenCanvas||!y.controlTransferredOffscreen){y.offscreenCanvas&&(y=y.offscreenCanvas);var g=!1;if(y.GLctxObject&&y.GLctxObject.GLctx){var I=y.GLctxObject.GLctx.getParameter(2978);g=I[0]===0&&I[1]===0&&I[2]===y.width&&I[3]===y.height}y.width=u,y.height=f,g&&y.GLctxObject.GLctx.viewport(0,0,u,f)}else if(y.canvasSharedPtr){var B=i()[y.canvasSharedPtr+8>>2];return Iv(B,c,u,f),1}else return-4;return 0}function ch(c,u,f){return S?be(15,1,c,u,f):ah(c,u,f)}function Av(c,u,f){var y=Uc(c);return y?ah(c,u,f):ch(c,u,f)}function Ov(c){}function Ev(){if(!ps())try{S?wh(On):yo(On)}catch(c){_o(c)}}function Dv(c,u){if(!fo){if(u){c();return}try{c(),S&&Ev()}catch(f){_o(f)}}}function Fv(){Fc+=1}function Rv(){Fc-=1}function Mv(c,u,f){return Fv(),setTimeout(function(){Rv(),Dv(function(){ri.get(c)(f)})},u)}function Uv(){throw"unwind"}function Pv(c){var u=c.getExtension("ANGLE_instanced_arrays");if(u)return c.vertexAttribDivisor=function(f,y){u.vertexAttribDivisorANGLE(f,y)},c.drawArraysInstanced=function(f,y,g,I){u.drawArraysInstancedANGLE(f,y,g,I)},c.drawElementsInstanced=function(f,y,g,I,B){u.drawElementsInstancedANGLE(f,y,g,I,B)},1}function kv(c){var u=c.getExtension("OES_vertex_array_object");if(u)return c.createVertexArray=function(){return u.createVertexArrayOES()},c.deleteVertexArray=function(f){u.deleteVertexArrayOES(f)},c.bindVertexArray=function(f){u.bindVertexArrayOES(f)},c.isVertexArray=function(f){return u.isVertexArrayOES(f)},1}function Vv(c){var u=c.getExtension("WEBGL_draw_buffers");if(u)return c.drawBuffers=function(f,y){u.drawBuffersWEBGL(f,y)},1}function Nv(c){return!!(c.multiDrawWebgl=c.getExtension("WEBGL_multi_draw"))}var Se={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function(u){Se.lastError||(Se.lastError=u)},getNewId:function(c){for(var u=Se.counter++,f=c.length;f<u;f++)c[f]=null;return u},getSource:function(c,u,f,y){for(var g="",I=0;I<u;++I){var B=y?i()[y+I*4>>2]:-1;g+=Xt(i()[f+I*4>>2],B<0?void 0:B)}return g},createContext:function(c,u){c.getContextSafariWebGL2Fixed||(c.getContextSafariWebGL2Fixed=c.getContext,c.getContext=function(g,I){var B=c.getContextSafariWebGL2Fixed(g,I);return g=="webgl"==B instanceof WebGLRenderingContext?B:null});var f=c.getContext("webgl",u);if(!f)return 0;var y=Se.registerContext(f,u);return y},registerContext:function(c,u){var f=Nc(8);i()[f+4>>2]=wo();var y={handle:f,attributes:u,version:u.majorVersion,GLctx:c};return c.canvas&&(c.canvas.GLctxObject=y),Se.contexts[f]=y,(typeof u.enableExtensionsByDefault=="undefined"||u.enableExtensionsByDefault)&&Se.initExtensions(y),f},makeContextCurrent:function(c){return Se.currentContext=Se.contexts[c],o.ctx=gh=Se.currentContext&&Se.currentContext.GLctx,!(c&&!gh)},getContext:function(c){return Se.contexts[c]},deleteContext:function(c){Se.currentContext===Se.contexts[c]&&(Se.currentContext=null),typeof ee=="object"&&ee.removeAllHandlersOnTarget(Se.contexts[c].GLctx.canvas),Se.contexts[c]&&Se.contexts[c].GLctx.canvas&&(Se.contexts[c].GLctx.canvas.GLctxObject=void 0),So(Se.contexts[c].handle),Se.contexts[c]=null},initExtensions:function(c){if(c||(c=Se.currentContext),!c.initExtensionsDone){c.initExtensionsDone=!0;var u=c.GLctx;Pv(u),kv(u),Vv(u),u.disjointTimerQueryExt=u.getExtension("EXT_disjoint_timer_query"),Nv(u);var f=u.getSupportedExtensions()||[];f.forEach(function(y){!y.includes("lose_context")&&!y.includes("debug")&&u.getExtension(y)})}}},Lv=["default","low-power","high-performance"];function xv(c,u){var f=u>>2,y=i()[f+(24>>2)],g={alpha:!!i()[f+(0>>2)],depth:!!i()[f+(4>>2)],stencil:!!i()[f+(8>>2)],antialias:!!i()[f+(12>>2)],premultipliedAlpha:!!i()[f+(16>>2)],preserveDrawingBuffer:!!i()[f+(20>>2)],powerPreference:Lv[y],failIfMajorPerformanceCaveat:!!i()[f+(28>>2)],majorVersion:i()[f+(32>>2)],minorVersion:i()[f+(36>>2)],enableExtensionsByDefault:i()[f+(40>>2)],explicitSwapControl:i()[f+(44>>2)],proxyContextToMainThread:i()[f+(48>>2)],renderViaOffscreenBackBuffer:i()[f+(52>>2)]},I=Uc(c);if(!I||g.explicitSwapControl)return 0;var B=Se.createContext(I,g);return B}function Cv(c,u){return xv(c,u)}var Pc={};function jv(){return re||"./this.program"}function ms(){if(!ms.strings){var c=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",u={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:c,_:jv()};for(var f in Pc)Pc[f]===void 0?delete u[f]:u[f]=Pc[f];var y=[];for(var f in u)y.push(f+"="+u[f]);ms.strings=y}return ms.strings}function uh(c,u){if(S)return be(16,1,c,u);var f=0;return ms().forEach(function(y,g){var I=u+f;i()[c+g*4>>2]=I,cg(y,I),f+=y.length+1}),0}function lh(c,u){if(S)return be(17,1,c,u);var f=ms();i()[c>>2]=f.length;var y=0;return f.forEach(function(g){y+=g.length+1}),i()[u>>2]=y,0}function dh(c){return S?be(18,1,c):0}function fh(c,u){if(S)return be(19,1,c,u);var f=c==1||c==2?2:er();return t()[u>>0]=f,0}function hh(c,u,f,y,g,I){if(S)return be(20,1,c,u,f,y,g,I);var B=$e.getStreamFromFD(c),V=$e.doReadv(B,u,f,y);return i()[I>>2]=V,0}function ph(c,u,f,y,g,I){if(S)return be(21,1,c,u,f,y,g,I);var B=$e.getStreamFromFD(c),V=$e.doWritev(B,u,f,y);return i()[I>>2]=V,0}function yh(c,u,f,y){if(S)return be(22,1,c,u,f,y);var g=$e.getStreamFromFD(c),I=$e.doReadv(g,u,f);return i()[y>>2]=I,0}function _h(c,u,f,y,g){if(S)return be(23,1,c,u,f,y,g)}function mh(c){if(S)return be(24,1,c);var u=$e.getStreamFromFD(c);return u.stream_ops&&u.stream_ops.fsync?-u.stream_ops.fsync(u):0}function bh(c,u,f,y){if(S)return be(25,1,c,u,f,y);for(var g=0,I=0;I<f;I++){for(var B=i()[u+I*8>>2],V=i()[u+(I*8+4)>>2],ae=0;ae<V;ae++)$e.printChar(c,n()[B+ae]);g+=V}return i()[y>>2]=g,0}function qv(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var c=new Uint8Array(1);return function(){return crypto.getRandomValues(c),c[0]}}else if(Ne)try{var u=qT("crypto");return function(){return u.randomBytes(1)[0]}}catch(f){}return function(){er("randomDevice")}}function mo(c,u){mo.randomDevice||(mo.randomDevice=qv());for(var f=0;f<u;f++)t()[c+f>>0]=mo.randomDevice();return 0}function bo(c){return c%4==0&&(c%100!=0||c%400==0)}function kc(c,u){for(var f=0,y=0;y<=u;f+=c[y++]);return f}var go=[31,29,31,30,31,30,31,31,30,31,30,31],vo=[31,28,31,30,31,30,31,31,30,31,30,31];function To(c,u){for(var f=new Date(c.getTime());u>0;){var y=bo(f.getFullYear()),g=f.getMonth(),I=(y?go:vo)[g];if(u>I-f.getDate())u-=I-f.getDate()+1,f.setDate(1),g<11?f.setMonth(g+1):(f.setMonth(0),f.setFullYear(f.getFullYear()+1));else return f.setDate(f.getDate()+u),f}return f}function Wv(c,u,f,y){var g=i()[y+40>>2],I={tm_sec:i()[y>>2],tm_min:i()[y+4>>2],tm_hour:i()[y+8>>2],tm_mday:i()[y+12>>2],tm_mon:i()[y+16>>2],tm_year:i()[y+20>>2],tm_wday:i()[y+24>>2],tm_yday:i()[y+28>>2],tm_isdst:i()[y+32>>2],tm_gmtoff:i()[y+36>>2],tm_zone:g?Xt(g):""},B=Xt(f),V={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var ae in V)B=B.replace(new RegExp(ae,"g"),V[ae]);var Xe=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],st=["January","February","March","April","May","June","July","August","September","October","November","December"];function vs(O,C,ze){for(var he=typeof O=="number"?O.toString():O||"";he.length<C;)he=ze[0]+he;return he}function ut(O,C){return vs(O,C,"0")}function tr(O,C){function ze(rr){return rr<0?-1:rr>0?1:0}var he;return(he=ze(O.getFullYear()-C.getFullYear()))===0&&(he=ze(O.getMonth()-C.getMonth()))===0&&(he=ze(O.getDate()-C.getDate())),he}function We(O){switch(O.getDay()){case 0:return new Date(O.getFullYear()-1,11,29);case 1:return O;case 2:return new Date(O.getFullYear(),0,3);case 3:return new Date(O.getFullYear(),0,2);case 4:return new Date(O.getFullYear(),0,1);case 5:return new Date(O.getFullYear()-1,11,31);case 6:return new Date(O.getFullYear()-1,11,30)}}function Sr(O){var C=To(new Date(O.tm_year+1900,0,1),O.tm_yday),ze=new Date(C.getFullYear(),0,4),he=new Date(C.getFullYear()+1,0,4),rr=We(ze),qr=We(he);return tr(rr,C)<=0?tr(qr,C)<=0?C.getFullYear()+1:C.getFullYear():C.getFullYear()-1}var Ts={"%a":function(O){return Xe[O.tm_wday].substring(0,3)},"%A":function(O){return Xe[O.tm_wday]},"%b":function(O){return st[O.tm_mon].substring(0,3)},"%B":function(O){return st[O.tm_mon]},"%C":function(O){var C=O.tm_year+1900;return ut(C/100|0,2)},"%d":function(O){return ut(O.tm_mday,2)},"%e":function(O){return vs(O.tm_mday,2," ")},"%g":function(O){return Sr(O).toString().substring(2)},"%G":function(O){return Sr(O)},"%H":function(O){return ut(O.tm_hour,2)},"%I":function(O){var C=O.tm_hour;return C==0?C=12:C>12&&(C-=12),ut(C,2)},"%j":function(O){return ut(O.tm_mday+kc(bo(O.tm_year+1900)?go:vo,O.tm_mon-1),3)},"%m":function(O){return ut(O.tm_mon+1,2)},"%M":function(O){return ut(O.tm_min,2)},"%n":function(){return`
|
|
18
|
+
`},"%p":function(O){return O.tm_hour>=0&&O.tm_hour<12?"AM":"PM"},"%S":function(O){return ut(O.tm_sec,2)},"%t":function(){return" "},"%u":function(O){return O.tm_wday||7},"%U":function(O){var C=new Date(O.tm_year+1900,0,1),ze=C.getDay()===0?C:To(C,7-C.getDay()),he=new Date(O.tm_year+1900,O.tm_mon,O.tm_mday);if(tr(ze,he)<0){var rr=kc(bo(he.getFullYear())?go:vo,he.getMonth()-1)-31,qr=31-ze.getDate(),Fn=qr+rr+he.getDate();return ut(Math.ceil(Fn/7),2)}return tr(ze,C)===0?"01":"00"},"%V":function(O){var C=new Date(O.tm_year+1900,0,4),ze=new Date(O.tm_year+1901,0,4),he=We(C),rr=We(ze),qr=To(new Date(O.tm_year+1900,0,1),O.tm_yday);if(tr(qr,he)<0)return"53";if(tr(rr,qr)<=0)return"01";var Fn;return he.getFullYear()<O.tm_year+1900?Fn=O.tm_yday+32-he.getDate():Fn=O.tm_yday+1-he.getDate(),ut(Math.ceil(Fn/7),2)},"%w":function(O){return O.tm_wday},"%W":function(O){var C=new Date(O.tm_year,0,1),ze=C.getDay()===1?C:To(C,C.getDay()===0?1:7-C.getDay()+1),he=new Date(O.tm_year+1900,O.tm_mon,O.tm_mday);if(tr(ze,he)<0){var rr=kc(bo(he.getFullYear())?go:vo,he.getMonth()-1)-31,qr=31-ze.getDate(),Fn=qr+rr+he.getDate();return ut(Math.ceil(Fn/7),2)}return tr(ze,C)===0?"01":"00"},"%y":function(O){return(O.tm_year+1900).toString().substring(2)},"%Y":function(O){return O.tm_year+1900},"%z":function(O){var C=O.tm_gmtoff,ze=C>=0;return C=Math.abs(C)/60,C=C/60*100+C%60,(ze?"+":"-")+String("0000"+C).slice(-4)},"%Z":function(O){return O.tm_zone},"%%":function(){return"%"}};for(var ae in Ts)B.includes(ae)&&(B=B.replace(new RegExp(ae,"g"),Ts[ae](I)));var xc=Yv(B,!1);return xc.length>u?0:(Ef(xc,c),xc.length-1)}function zv(c,u,f,y){return Wv(c,u,f,y)}S||x.initMainThreadBlock();var gh,Hv=[null,zf,xg,$f,Jf,Qf,Zf,Xf,eh,th,rh,nh,ih,sh,oh,ch,uh,lh,dh,fh,hh,ph,yh,_h,mh,bh];function Yv(c,u,f){var y=f>0?f:Of(c)+1,g=new Array(y),I=Bf(c,g,0,g.length);return u&&(g.length=I),g}var Gv={b:kg,pa:Lg,ea:Cg,ja:jg,w:qg,ia:Wg,S:zg,Z:Yg,P:$f,i:Jf,R:Qf,Q:Zf,N:Xf,o:Gg,W:eh,K:Kg,O:th,v:rh,L:nh,q:ih,s:sh,r:oh,V:$g,U:Jg,oa:Qg,e:Zg,t:Hf,F:Xg,G:ev,D:tv,E:rv,n:nv,B:iv,I:sv,C:ov,J:av,h:cv,H:uv,m:lv,A:dv,l:fv,ba:Kf,p:hv,d:Gf,c:jf,X:pv,g:_s,da:yv,Y:_v,la:mv,fa:gv,ma:Av,k:Ov,ka:Mv,ga:Uv,na:Cv,$:uh,aa:lh,ha:yo,f:dh,ca:fh,y:hh,x:ph,u:yh,z:_h,M:mh,j:bh,T:mo,a:Re||o.wasmMemory,_:zv},xE=Eg(),Kv=o.___wasm_call_ctors=function(){return(Kv=o.___wasm_call_ctors=o.asm.qa).apply(null,arguments)},$v=o._main=function(){return($v=o._main=o.asm.ra).apply(null,arguments)},Jv=o._duckdb_web_fs_glob_add_path=function(){return(Jv=o._duckdb_web_fs_glob_add_path=o.asm.ta).apply(null,arguments)},Qv=o._duckdb_web_clear_response=function(){return(Qv=o._duckdb_web_clear_response=o.asm.ua).apply(null,arguments)},Zv=o._duckdb_web_fail_with=function(){return(Zv=o._duckdb_web_fail_with=o.asm.va).apply(null,arguments)},Xv=o._duckdb_web_reset=function(){return(Xv=o._duckdb_web_reset=o.asm.wa).apply(null,arguments)},eT=o._duckdb_web_connect=function(){return(eT=o._duckdb_web_connect=o.asm.xa).apply(null,arguments)},tT=o._duckdb_web_disconnect=function(){return(tT=o._duckdb_web_disconnect=o.asm.ya).apply(null,arguments)},rT=o._duckdb_web_flush_files=function(){return(rT=o._duckdb_web_flush_files=o.asm.za).apply(null,arguments)},nT=o._duckdb_web_flush_file=function(){return(nT=o._duckdb_web_flush_file=o.asm.Aa).apply(null,arguments)},iT=o._duckdb_web_open=function(){return(iT=o._duckdb_web_open=o.asm.Ba).apply(null,arguments)},sT=o._duckdb_web_collect_file_stats=function(){return(sT=o._duckdb_web_collect_file_stats=o.asm.Ca).apply(null,arguments)},oT=o._duckdb_web_export_file_stats=function(){return(oT=o._duckdb_web_export_file_stats=o.asm.Da).apply(null,arguments)},aT=o._duckdb_web_fs_drop_file=function(){return(aT=o._duckdb_web_fs_drop_file=o.asm.Ea).apply(null,arguments)},cT=o._duckdb_web_fs_drop_files=function(){return(cT=o._duckdb_web_fs_drop_files=o.asm.Fa).apply(null,arguments)},uT=o._duckdb_web_fs_glob_file_infos=function(){return(uT=o._duckdb_web_fs_glob_file_infos=o.asm.Ga).apply(null,arguments)},lT=o._duckdb_web_fs_get_file_info_by_id=function(){return(lT=o._duckdb_web_fs_get_file_info_by_id=o.asm.Ha).apply(null,arguments)},dT=o._duckdb_web_fs_get_file_info_by_name=function(){return(dT=o._duckdb_web_fs_get_file_info_by_name=o.asm.Ia).apply(null,arguments)},fT=o._duckdb_web_fs_set_file_descriptor=function(){return(fT=o._duckdb_web_fs_set_file_descriptor=o.asm.Ja).apply(null,arguments)},hT=o._duckdb_web_fs_register_file_url=function(){return(hT=o._duckdb_web_fs_register_file_url=o.asm.Ka).apply(null,arguments)},pT=o._duckdb_web_fs_register_file_buffer=function(){return(pT=o._duckdb_web_fs_register_file_buffer=o.asm.La).apply(null,arguments)},yT=o._duckdb_web_copy_file_to_buffer=function(){return(yT=o._duckdb_web_copy_file_to_buffer=o.asm.Ma).apply(null,arguments)},_T=o._duckdb_web_copy_file_to_path=function(){return(_T=o._duckdb_web_copy_file_to_path=o.asm.Na).apply(null,arguments)},mT=o._duckdb_web_get_version=function(){return(mT=o._duckdb_web_get_version=o.asm.Oa).apply(null,arguments)},bT=o._duckdb_web_get_feature_flags=function(){return(bT=o._duckdb_web_get_feature_flags=o.asm.Pa).apply(null,arguments)},gT=o._duckdb_web_tokenize=function(){return(gT=o._duckdb_web_tokenize=o.asm.Qa).apply(null,arguments)},vT=o._duckdb_web_prepared_create=function(){return(vT=o._duckdb_web_prepared_create=o.asm.Ra).apply(null,arguments)},TT=o._duckdb_web_prepared_close=function(){return(TT=o._duckdb_web_prepared_close=o.asm.Sa).apply(null,arguments)},IT=o._duckdb_web_prepared_run=function(){return(IT=o._duckdb_web_prepared_run=o.asm.Ta).apply(null,arguments)},wT=o._duckdb_web_prepared_send=function(){return(wT=o._duckdb_web_prepared_send=o.asm.Ua).apply(null,arguments)},ST=o._duckdb_web_query_run=function(){return(ST=o._duckdb_web_query_run=o.asm.Va).apply(null,arguments)},BT=o._duckdb_web_query_send=function(){return(BT=o._duckdb_web_query_send=o.asm.Wa).apply(null,arguments)},AT=o._duckdb_web_query_fetch_results=function(){return(AT=o._duckdb_web_query_fetch_results=o.asm.Xa).apply(null,arguments)},OT=o._duckdb_web_insert_arrow_from_ipc_stream=function(){return(OT=o._duckdb_web_insert_arrow_from_ipc_stream=o.asm.Ya).apply(null,arguments)},ET=o._duckdb_web_insert_csv_from_path=function(){return(ET=o._duckdb_web_insert_csv_from_path=o.asm.Za).apply(null,arguments)},DT=o._duckdb_web_insert_json_from_path=function(){return(DT=o._duckdb_web_insert_json_from_path=o.asm._a).apply(null,arguments)},FT=o._emscripten_tls_init=function(){return(FT=o._emscripten_tls_init=o.asm.$a).apply(null,arguments)},RT=o._emscripten_current_thread_process_queued_calls=function(){return(RT=o._emscripten_current_thread_process_queued_calls=o.asm.ab).apply(null,arguments)},vh=o._emscripten_main_browser_thread_id=function(){return(vh=o._emscripten_main_browser_thread_id=o.asm.bb).apply(null,arguments)},Th=o._emscripten_sync_run_in_main_thread_4=function(){return(Th=o._emscripten_sync_run_in_main_thread_4=o.asm.cb).apply(null,arguments)},Io=o._emscripten_main_thread_process_queued_calls=function(){return(Io=o._emscripten_main_thread_process_queued_calls=o.asm.db).apply(null,arguments)},Ih=o._emscripten_run_in_main_runtime_thread_js=function(){return(Ih=o._emscripten_run_in_main_runtime_thread_js=o.asm.eb).apply(null,arguments)},Vc=o.__emscripten_call_on_thread=function(){return(Vc=o.__emscripten_call_on_thread=o.asm.fb).apply(null,arguments)},wh=o.__emscripten_thread_exit=function(){return(wh=o.__emscripten_thread_exit=o.asm.gb).apply(null,arguments)},Sh=o._pthread_testcancel=function(){return(Sh=o._pthread_testcancel=o.asm.hb).apply(null,arguments)},Bh=o.__emscripten_thread_init=function(){return(Bh=o.__emscripten_thread_init=o.asm.ib).apply(null,arguments)},Ah=o.___errno_location=function(){return(Ah=o.___errno_location=o.asm.jb).apply(null,arguments)},wo=o._pthread_self=function(){return(wo=o._pthread_self=o.asm.kb).apply(null,arguments)},bs=o.stackSave=function(){return(bs=o.stackSave=o.asm.lb).apply(null,arguments)},ni=o.stackRestore=function(){return(ni=o.stackRestore=o.asm.mb).apply(null,arguments)},ii=o.stackAlloc=function(){return(ii=o.stackAlloc=o.asm.nb).apply(null,arguments)},Oh=o._emscripten_stack_set_limits=function(){return(Oh=o._emscripten_stack_set_limits=o.asm.ob).apply(null,arguments)},Nc=o._malloc=function(){return(Nc=o._malloc=o.asm.pb).apply(null,arguments)},So=o._free=function(){return(So=o._free=o.asm.qb).apply(null,arguments)},Eh=o._memalign=function(){return(Eh=o._memalign=o.asm.rb).apply(null,arguments)},Dh=o.__emscripten_allow_main_runtime_queued_calls=939456,si=o.__emscripten_main_thread_futex=1038800;o.ccall=ag,o.keepRuntimeAlive=ps,o.PThread=x,o.PThread=x,o.wasmMemory=Re,o.ExitStatus=gs;var Bo;function gs(c){this.name="ExitStatus",this.message="Program terminated with exit("+c+")",this.status=c}var MT=!1;ys=function c(){Bo||Lc(),Bo||(ys=c)};function UT(c){var u=o._main,f=0,y=0;try{var g=u(f,y);return Fh(g,!0),g}catch(I){return _o(I)}finally{MT=!0}}function Lc(c){if(c=c||U,Dn>0)return;if(S){d(o),Lf(),postMessage({cmd:"loaded"});return}if(mg(),Dn>0)return;function u(){Bo||(Bo=!0,o.calledRun=!0,!fo&&(Lf(),bg(),d(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),Rh&&UT(c),vg()))}o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),u()},1)):u()}o.run=Lc;function Fh(c,u){if(On=c,!u&&S)throw zf(c),"unwind";ps()||gg(),PT(c)}function PT(c){On=c,ps()||(x.terminateAllThreads(),o.onExit&&o.onExit(c),fo=!0),_e(c,new gs(c))}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var Rh=!0;return o.noInitialRun&&(Rh=!1),S&&(vf=!1,x.initWorker()),Lc(),e.ready}}(),Xb=FE;var df=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=p.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),p.Table.from(n)}send(e){let t=this._bindings.sendQuery(this._conn,e),n=new ff(this._bindings,this._conn,t),i=p.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 eg(this._bindings,this._conn,t)}insertArrowTable(e,t){let n=e.serialize("binary",!0);this.insertArrowFromIPCStream(n,t)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},ff=class{constructor(e,t,n){this.bindings=e;this.conn=t;this.header=n;this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},eg=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=p.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),p.Table.from(n)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new ff(this.bindings,this.connectionId,t),i=p.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 RE(){let r=new TextDecoder;return e=>(typeof SharedArrayBuffer!="undefined"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),r.decode(e))}var ME=RE();function jr(r,e){r.ccall("duckdb_web_fail_with",null,["string"],[e])}function us(r,e,t){let n=r.HEAPU8.subarray(e,e+t),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function se(r,e,t){return ME(r.HEAPU8.subarray(e,e+t))}var ft;(function(n){n[n.BUFFER=0]="BUFFER",n[n.NATIVE=1]="NATIVE",n[n.HTTP=3]="HTTP"})(ft||(ft={}));function ye(r,e,t,n){let i=r.stackSave(),s=r.stackAlloc(3*8);t.unshift("number"),n.unshift(s),r.ccall(e,null,t,n);let a=r.HEAPF64[(s>>3)+0],o=r.HEAPF64[(s>>3)+1],d=r.HEAPF64[(s>>3)+2];return r.stackRestore(i),[a,o,d]}function Ve(r){r.ccall("duckdb_web_clear_response",null,[],[])}var hf=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 UE=new TextEncoder,tg;(function(s){s[s.WASM_EXCEPTIONS=1]="WASM_EXCEPTIONS",s[s.WASM_THREADS=2]="WASM_THREADS",s[s.WASM_SIMD=4]="WASM_SIMD",s[s.WASM_BULK_MEMORY=8]="WASM_BULK_MEMORY",s[s.EMIT_BIGINT=16]="EMIT_BIGINT"})(tg||(tg={}));var pf=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]=ye(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));Ve(this.mod)}reset(){let[e,t,n]=ye(this.mod,"duckdb_web_reset",[],[]);if(e!==de.SUCCESS)throw new Error(se(this.mod,t,n));Ve(this.mod)}getVersion(){let[e,t,n]=ye(this.mod,"duckdb_web_get_version",[],[]);if(e!==de.SUCCESS)throw new Error(se(this.mod,t,n));let i=se(this.mod,t,n);return Ve(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,n,i]=ye(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));let s=se(this.mod,n,i);return Ve(this.mod),JSON.parse(s)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new df(this,e)}disconnect(e){this.mod.ccall("duckdb_web_disconnect",null,["number"],[e])}runQuery(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_query_run",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));let a=us(this.mod,i,s);return Ve(this.mod),a}sendQuery(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_query_send",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));let a=us(this.mod,i,s);return Ve(this.mod),a}fetchQueryResults(e){let[t,n,i]=ye(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));let s=us(this.mod,n,i);return Ve(this.mod),s}createPrepared(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));return Ve(this.mod),i}closePrepared(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));Ve(this.mod)}runPrepared(e,t,n){let[i,s,a]=ye(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==de.SUCCESS)throw new Error(se(this.mod,s,a));let o=us(this.mod,s,a);return Ve(this.mod),o}sendPrepared(e,t,n){let[i,s,a]=ye(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==de.SUCCESS)throw new Error(se(this.mod,s,a));let o=us(this.mod,s,a);return Ve(this.mod),o}insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let i=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(i,i+t.length).set(t);let a=n?JSON.stringify(n):"",[o,d,h]=ye(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,i,t.length,a]);if(o!==de.SUCCESS)throw new Error(se(this.mod,d,h))}insertCSVFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let h in n.columns)n.columnsFlat.push(as(h,n.columns[h]))}let i=Rn({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[a,o,d]=ye(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,s]);if(a!==de.SUCCESS)throw new Error(se(this.mod,o,d))}insertJSONFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let h in n.columns)n.columnsFlat.push(as(h,n.columns[h]))}let i=Rn({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[a,o,d]=ye(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,s]);if(a!==de.SUCCESS)throw new Error(se(this.mod,o,d))}globFiles(e){let[t,n,i]=ye(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));let s=se(this.mod,n,i);Ve(this.mod);let a=JSON.parse(s);return a==null?[]:a}registerFileURL(e,t){t===void 0&&(t=e);let[n,i,s]=ye(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));Ve(this.mod)}registerFileText(e,t){let n=UE.encode(t);this.registerFileBuffer(e,n)}registerFileBuffer(e,t){let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let[s,a,o]=ye(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,n,t.length]);if(s!==de.SUCCESS)throw new Error(se(this.mod,a,o));Ve(this.mod)}registerFileHandle(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,e]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));if(Ve(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(){let[e,t,n]=ye(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==de.SUCCESS)throw new Error(se(this.mod,t,n));Ve(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s));Ve(this.mod)}copyFileToBuffer(e){let[t,n,i]=ye(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));let s=this.mod.HEAPU8.subarray(n,n+i),a=new Uint8Array(s.length);return a.set(s),Ve(this.mod),a}collectFileStatistics(e,t){let[n,i,s]=ye(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(n!==de.SUCCESS)throw new Error(se(this.mod,i,s))}exportFileStatistics(e){let[t,n,i]=ye(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==de.SUCCESS)throw new Error(se(this.mod,n,i));return new hf(this.mod.HEAPU8.subarray(n,n+i))}};var yf=class extends pf{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 _f=class extends yf{constructor(e,t,n,i=null){super(e,t,n,i)}instantiateImpl(e){return Xb(Ao(Rn({},e),{instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)}))}};var ht={fileInfoCache:new Map,getFileInfo(r,e){try{let t=ht.fileInfoCache.get(e);if(t)return t;let[n,i,s]=ye(r,"duckdb_web_fs_get_file_info_by_id",["number"],[e]);if(n!==de.SUCCESS)return null;let a=se(r,i,s);Ve(r);let o=JSON.parse(a);if(o==null)return null;let d=Ao(Rn({},o),{blob:null});return ht.fileInfoCache.set(e,d),d}catch(t){return 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)=>{var t;try{ht.fileInfoCache.delete(e);let n=ht.getFileInfo(r,e);switch(n==null?void 0:n.dataProtocol){case ft.HTTP:{let i=null;try{let s=new XMLHttpRequest;s.open("HEAD",n.dataUrl,!1),s.setRequestHeader("Range","bytes=0-"),s.send(null);let a=s.getResponseHeader("Content-Length");if(s.status==206&&a!==null){let o=r._malloc(2*8);return r.HEAPF64[(o>>3)+0]=+a,r.HEAPF64[(o>>3)+1]=0,o}}catch(s){i=s,console.warn(`HEAD request with range header failed: ${s}`)}if(n.allowFullHttpReads){console.warn(`falling back to full HTTP read for: ${n.dataUrl}`);let s=new XMLHttpRequest;if(s.open("GET",n.dataUrl,!1),s.responseType="arraybuffer",s.send(null),s.status==200){let a=r._malloc(s.response.byteLength),o=new Uint8Array(s.response,0,s.response.byteLength);r.HEAPU8.set(o,a);let d=r._malloc(2*8);return r.HEAPF64[(d>>3)+0]=s.response.byteLength,r.HEAPF64[(d>>3)+1]=a,d}}if(i!=null)throw new Error(`Reading file ${n.fileName} failed with error: ${i}`);return 0}case ft.NATIVE:{let i=(t=ht._files)==null?void 0:t.get(n.fileName);if(i){let o=r._malloc(2*8);return r.HEAPF64[(o>>3)+0]=i.size,r.HEAPF64[(o>>3)+1]=0,o}console.warn(`Buffering missing file: ${n.fileName}`);let s=r._malloc(2*8),a=r._malloc(1);return r.HEAPF64[(s>>3)+0]=1,r.HEAPF64[(s>>3)+1]=a,s}}}catch(n){console.error(n.toString()),jr(r,n.toString())}return 0},glob:(r,e,t)=>{try{let n=se(r,e,t);if(n.startsWith("http")){let i=new XMLHttpRequest;if(i.open("HEAD",n,!1),i.send(null),i.status!=200&&i.status!==206){jr(r,`HEAD request failed: ${n}`);return}r.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}}catch(n){return jr(r,n.toString()),0}},checkFile:(r,e,t)=>{try{let n=se(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 s=!1;if(i.status==206)s=!0;else if(i.status==200)s=i.getResponseHeader("Accept-Ranges")==="bytes";else return!1;return!!s}}catch(n){return!1}return!1},syncFile:(r,e)=>{},closeFile:(r,e)=>{let t=ht.getFileInfo(r,e);switch(ht.fileInfoCache.delete(e),t==null?void 0:t.dataProtocol){case ft.HTTP:break;case ft.NATIVE:return}},truncateFile:(r,e,t)=>{let n=ht.getFileInfo(r,e);switch(n==null?void 0:n.dataProtocol){case ft.HTTP:jr(r,"Cannot truncate a http file");return;case ft.NATIVE:jr(r,"truncateFile not implemented");return}return 0},readFile(r,e,t,n,i){var s;try{let a=ht.getFileInfo(r,e);switch(a==null?void 0:a.dataProtocol){case ft.HTTP:{if(!a.dataUrl)throw new Error(`Missing data URL for file ${e}`);try{let o=new XMLHttpRequest;if(o.open("GET",a.dataUrl,!1),o.responseType="arraybuffer",o.setRequestHeader("Range",`bytes=${i}-${i+n-1}`),o.send(null),o.status==206||o.status==200&&n==o.response.byteLength&&i==0){let d=new Uint8Array(o.response,0,Math.min(o.response.byteLength,n));return r.HEAPU8.set(d,t),d.byteLength}else throw o.status==200?new Error(`Range request for ${a.dataUrl} did not return a partial response: ${o.status} "${o.statusText}"`):new Error(`Range request for ${a.dataUrl} did returned non-success status: ${o.status} "${o.statusText}"`)}catch(o){throw new Error(`Range request for ${a.dataUrl} failed with error: ${o}"`)}}case ft.NATIVE:{let o=(s=ht._files)==null?void 0:s.get(a.fileName);if(!o)throw new Error(`No handle available for file: ${a.fileName}`);let d=o.slice(i,i+n),h=new Uint8Array(new FileReaderSync().readAsArrayBuffer(d));return r.HEAPU8.set(h,t),h.byteLength}}return 0}catch(a){return jr(r,a.toString()),0}},writeFile:(r,e,t,n,i)=>{let s=ht.getFileInfo(r,e);switch(s==null?void 0:s.dataProtocol){case ft.HTTP:return jr(r,"Cannot write to HTTP file"),0;case ft.NATIVE:return jr(r,"writefile not implemented"),0}return 0},getLastFileModificationTime:(r,e)=>{var n;let t=ht.getFileInfo(r,e);switch(t==null?void 0:t.dataProtocol){case ft.NATIVE:{if(!((n=ht._files)==null?void 0:n.get(t.fileName)))throw Error(`No handle available for file: ${t.fileName}`);return 0}case ft.HTTP:return new Date().getTime()}return 0},checkDirectory:(r,e,t)=>{let n=se(r,e,t);return console.log(`checkDirectory: ${n}`),!1},createDirectory:(r,e,t)=>{let n=se(r,e,t);console.log(`createDirectory: ${n}`)},removeDirectory:(r,e,t)=>{let n=se(r,e,t);console.log(`removeDirectory: ${n}`)},listDirectoryEntries:(r,e,t)=>{let n=se(r,e,t);return console.log(`listDirectoryEntries: ${n}`),!1},moveFile:(r,e,t,n,i)=>{},removeFile:(r,e,t)=>{}};var rg=class extends uf{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t){return await new _f(this,ht,e,t).instantiate()}};function ng(){let r=new rg;globalThis.onmessage=async e=>{await r.onMessage(e.data)}}ng();return PE;})();
|
|
19
19
|
/*! *****************************************************************************
|
|
20
20
|
Copyright (c) Microsoft Corporation.
|
|
21
21
|
|