-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathArrow.esnext.min.js
More file actions
2 lines (2 loc) · 222 KB
/
Arrow.esnext.min.js
File metadata and controls
2 lines (2 loc) · 222 KB
1
2
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Arrow",[],e):"object"==typeof exports?exports.Arrow=e():t.Arrow=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){"use strict";r.r(e),r.d(e,"memcpy",function(){return u}),r.d(e,"joinUint8Arrays",function(){return c}),r.d(e,"toArrayBufferView",function(){return l}),r.d(e,"toInt8Array",function(){return h}),r.d(e,"toInt16Array",function(){return d}),r.d(e,"toInt32Array",function(){return f}),r.d(e,"toBigInt64Array",function(){return p}),r.d(e,"toUint8Array",function(){return y}),r.d(e,"toUint16Array",function(){return b}),r.d(e,"toUint32Array",function(){return m}),r.d(e,"toBigUint64Array",function(){return w}),r.d(e,"toFloat32Array",function(){return g}),r.d(e,"toFloat64Array",function(){return _}),r.d(e,"toUint8ClampedArray",function(){return v}),r.d(e,"toFloat16Array",function(){return I}),r.d(e,"toArrayBufferViewIterator",function(){return B}),r.d(e,"toInt8ArrayIterator",function(){return S}),r.d(e,"toInt16ArrayIterator",function(){return T}),r.d(e,"toInt32ArrayIterator",function(){return O}),r.d(e,"toUint8ArrayIterator",function(){return U}),r.d(e,"toUint16ArrayIterator",function(){return D}),r.d(e,"toUint32ArrayIterator",function(){return F}),r.d(e,"toFloat32ArrayIterator",function(){return x}),r.d(e,"toFloat64ArrayIterator",function(){return M}),r.d(e,"toUint8ClampedArrayIterator",function(){return L}),r.d(e,"toArrayBufferViewAsyncIterator",function(){return E}),r.d(e,"toInt8ArrayAsyncIterator",function(){return N}),r.d(e,"toInt16ArrayAsyncIterator",function(){return V}),r.d(e,"toInt32ArrayAsyncIterator",function(){return R}),r.d(e,"toUint8ArrayAsyncIterator",function(){return j}),r.d(e,"toUint16ArrayAsyncIterator",function(){return C}),r.d(e,"toUint32ArrayAsyncIterator",function(){return k}),r.d(e,"toFloat32ArrayAsyncIterator",function(){return P}),r.d(e,"toFloat64ArrayAsyncIterator",function(){return z}),r.d(e,"toUint8ClampedArrayAsyncIterator",function(){return Y}),r.d(e,"rebaseValueOffsets",function(){return $}),r.d(e,"compareArrayLike",function(){return W});var n=r(5),i=r(4),s=r(1),o=n.a.ByteBuffer;const a="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;function u(t,e,r=0,n=e.byteLength){const i=t.byteLength,s=new Uint8Array(t.buffer,t.byteOffset,i),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return s.set(o,r),t}function c(t,e){let r,n,i,s=function(t){let e,r,n,i,s=t[0]?[t[0]]:[];for(let o,a,u=0,c=0,l=t.length;++u<l;)o=s[c],a=t[u],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset?a&&(s[++c]=a):(({byteOffset:e,byteLength:n}=o),({byteOffset:r,byteLength:i}=a),e+n<r||r+i<e?a&&(s[++c]=a):s[c]=new Uint8Array(o.buffer,e,r-e+i));return s}(t),o=s.reduce((t,e)=>t+e.byteLength,0),a=0,c=-1,l=Math.min(e||1/0,o);for(let h=s.length;++c<h;){if(l<=a+(n=(r=s[c]).subarray(0,Math.min(r.length,l-a))).length){n.length<r.length?s[c]=r.subarray(n.length):n.length===r.length&&c++,i?u(i,n,a):i=n;break}u(i||(i=new Uint8Array(l)),n,a),a+=n.length}return[i||new Uint8Array(0),s.slice(c),o-(i?i.byteLength:0)]}function l(t,e){let r=Object(s.j)(e)?e.value:e;return r?("string"==typeof r&&(r=Object(i.b)(r)),r instanceof t?r.constructor===t?r:new t(r.buffer,r.byteOffset,r.byteLength/t.BYTES_PER_ELEMENT):r instanceof ArrayBuffer?new t(r):r instanceof a?new t(r):r instanceof o?l(t,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new t(0):new t(r.buffer,r.byteOffset,r.byteLength/t.BYTES_PER_ELEMENT):t.from(r)):new t(0)}const h=t=>l(Int8Array,t),d=t=>l(Int16Array,t),f=t=>l(Int32Array,t),p=t=>l(s.b,t),y=t=>l(Uint8Array,t),b=t=>l(Uint16Array,t),m=t=>l(Uint32Array,t),w=t=>l(s.d,t),g=t=>l(Float32Array,t),_=t=>l(Float64Array,t),v=t=>l(Uint8ClampedArray,t),I=t=>{let e=null;if(ArrayBuffer.isView(t))switch(t.constructor){case Float32Array:case Float64Array:e=t}else Object(s.i)(t)&&(e=_(t));if(e){const t=new Uint16Array(e.length);for(let r=-1,n=t.length;++r<n;)t[r]=32767*e[r]+32767;return t}return b(t)},A=t=>(t.next(),t);function*B(t,e){const r=function*(t){yield t},n="string"==typeof e?r(e):ArrayBuffer.isView(e)?r(e):e instanceof ArrayBuffer?r(e):e instanceof a?r(e):Object(s.i)(e)?e:r(e);yield*A(function*(e){let r=null;do{r=e.next(yield l(t,r))}while(!r.done)}(n[Symbol.iterator]()))}const S=t=>B(Int8Array,t),T=t=>B(Int16Array,t),O=t=>B(Int32Array,t),U=t=>B(Uint8Array,t),D=t=>B(Uint16Array,t),F=t=>B(Uint32Array,t),x=t=>B(Float32Array,t),M=t=>B(Float64Array,t),L=t=>B(Uint8ClampedArray,t);async function*E(t,e){if(Object(s.k)(e))return yield*E(t,await e);const r=async function*(t){yield await t},n="string"==typeof e?r(e):ArrayBuffer.isView(e)?r(e):e instanceof ArrayBuffer?r(e):e instanceof a?r(e):Object(s.i)(e)?async function*(t){yield*A(function*(t){let e=null;do{e=t.next(yield e&&e.value)}while(!e.done)}(t[Symbol.iterator]()))}(e):Object(s.f)(e)?e:r(e);yield*A(async function*(e){let r=null;do{r=await e.next(yield l(t,r))}while(!r.done)}(n[Symbol.asyncIterator]()))}const N=t=>E(Int8Array,t),V=t=>E(Int16Array,t),R=t=>E(Int32Array,t),j=t=>E(Uint8Array,t),C=t=>E(Uint16Array,t),k=t=>E(Uint32Array,t),P=t=>E(Float32Array,t),z=t=>E(Float64Array,t),Y=t=>E(Uint8ClampedArray,t);function $(t,e,r){if(0!==t){r=r.slice(0,e+1);for(let n=-1;++n<=e;)r[n]+=t}return r}function W(t,e){let r=0,n=t.length;if(n!==e.length)return!1;if(n>0)do{if(t[r]!==e[r])return!1}while(++r<n);return!0}},function(t,e,r){"use strict";r.d(e,"a",function(){return i}),r.d(e,"c",function(){return s}),r.d(e,"b",function(){return o}),r.d(e,"d",function(){return u}),r.d(e,"k",function(){return p}),r.d(e,"i",function(){return y}),r.d(e,"f",function(){return b}),r.d(e,"e",function(){return m}),r.d(e,"j",function(){return w}),r.d(e,"h",function(){return g}),r.d(e,"g",function(){return _}),r.d(e,"n",function(){return v}),r.d(e,"l",function(){return I}),r.d(e,"o",function(){return A}),r.d(e,"m",function(){return B});var n=r(2);const[i,s]=(()=>{const t=()=>{throw Error("BigInt is not available in this environment")};function e(){throw t()}return e.asIntN=(()=>{throw t()}),e.asUintN=(()=>{throw t()}),"undefined"!=typeof BigInt?[BigInt,!0]:[e,!1]})(),[o,a]=(()=>{const t=()=>{throw Error("BigInt64Array is not available in this environment")};return"undefined"!=typeof BigInt64Array?[BigInt64Array,!0]:[class{static get BYTES_PER_ELEMENT(){return 8}static of(){throw t()}static from(){throw t()}constructor(){throw t()}},!1]})(),[u,c]=(()=>{const t=()=>{throw Error("BigUint64Array is not available in this environment")};return"undefined"!=typeof BigUint64Array?[BigUint64Array,!0]:[class{static get BYTES_PER_ELEMENT(){return 8}static of(){throw t()}static from(){throw t()}constructor(){throw t()}},!1]})(),l=t=>"number"==typeof t,h=t=>"boolean"==typeof t,d=t=>"function"==typeof t,f=t=>null!=t&&Object(t)===t,p=t=>f(t)&&d(t.then),y=t=>f(t)&&d(t[Symbol.iterator]),b=t=>f(t)&&d(t[Symbol.asyncIterator]),m=t=>f(t)&&f(t.schema),w=t=>f(t)&&"done"in t&&"value"in t,g=t=>f(t)&&d(t.stat)&&l(t.fd),_=t=>f(t)&&I(t.body),v=t=>f(t)&&d(t.abort)&&d(t.getWriter)&&!(t instanceof n.d),I=t=>f(t)&&d(t.cancel)&&d(t.getReader)&&!(t instanceof n.d),A=t=>f(t)&&d(t.end)&&d(t.write)&&h(t.writable)&&!(t instanceof n.d),B=t=>f(t)&&d(t.read)&&d(t.pipe)&&h(t.readable)&&!(t instanceof n.d)},function(t,e,r){"use strict";r.d(e,"c",function(){return i}),r.d(e,"a",function(){return s}),r.d(e,"d",function(){return o}),r.d(e,"b",function(){return a});var n=r(3);const i=Object.freeze({done:!0,value:void 0});class s{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class o{tee(){return this._getDOMStream().tee()}pipe(t,e){return this._getNodeStream().pipe(t,e)}pipeTo(t,e){return this._getDOMStream().pipeTo(t,e)}pipeThrough(t,e){return this._getDOMStream().pipeThrough(t,e)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class a extends o{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}async cancel(t){await this.return(t)}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(i);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return n.a.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return n.a.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}async throw(t){return await this.abort(t),i}async return(t){return await this.close(),i}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}next(...t){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,e)=>{this.resolvers.push({resolve:t,reject:e})}):Promise.resolve(i)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`${this} is closed`)}}},function(t,e,r){"use strict";var n=r(0);e.a={fromIterable:t=>i(function*(t){let e,r,i,s,o=!1,a=[],u=0;function c(){return"peek"===i?Object(n.joinUint8Arrays)(a,s)[0]:([r,a,u]=Object(n.joinUint8Arrays)(a,s),r)}({cmd:i,size:s}=yield null);let l=Object(n.toUint8ArrayIterator)(t)[Symbol.iterator]();try{do{if(({done:e,value:r}=isNaN(s-u)?l.next(void 0):l.next(s-u)),!e&&r.byteLength>0&&(a.push(r),u+=r.byteLength),e||s<=u)do{({cmd:i,size:s}=yield c())}while(s<u)}while(!e)}catch(h){(o=!0)&&"function"==typeof l.throw&&l.throw(h)}finally{!1===o&&"function"==typeof l.return&&l.return()}}(t)),fromAsyncIterable:t=>i(async function*(t){let e,r,i,s,o=!1,a=[],u=0;function c(){return"peek"===i?Object(n.joinUint8Arrays)(a,s)[0]:([r,a,u]=Object(n.joinUint8Arrays)(a,s),r)}({cmd:i,size:s}=yield null);let l=Object(n.toUint8ArrayAsyncIterator)(t)[Symbol.asyncIterator]();try{do{if(({done:e,value:r}=isNaN(s-u)?await l.next(void 0):await l.next(s-u)),!e&&r.byteLength>0&&(a.push(r),u+=r.byteLength),e||s<=u)do{({cmd:i,size:s}=yield c())}while(s<u)}while(!e)}catch(h){(o=!0)&&"function"==typeof l.throw&&await l.throw(h)}finally{!1===o&&"function"==typeof l.return&&await l.return()}}(t)),fromDOMStream:t=>i(async function*(t){let e,r,i,o=!1,a=!1,u=[],c=0;function l(){return"peek"===r?Object(n.joinUint8Arrays)(u,i)[0]:([e,u,c]=Object(n.joinUint8Arrays)(u,i),e)}({cmd:r,size:i}=yield null);let h=new s(t);try{do{if(({done:o,value:e}=isNaN(i-c)?await h.read(void 0):await h.read(i-c)),!o&&e.byteLength>0&&(u.push(Object(n.toUint8Array)(e)),c+=e.byteLength),o||i<=c)do{({cmd:r,size:i}=yield l())}while(i<c)}while(!o)}catch(d){(a=!0)&&await h.cancel(d)}finally{!1===a?await h.cancel():t.locked&&h.releaseLock()}}(t)),fromNodeStream:t=>i(async function*(t){let e,r,i,s=[],a="error",u=!1,c=null,l=0,h=[];function d(){return"peek"===e?Object(n.joinUint8Arrays)(h,r)[0]:([i,h,l]=Object(n.joinUint8Arrays)(h,r),i)}if(({cmd:e,size:r}=yield null),t.isTTY)return yield new Uint8Array(0);try{s[0]=o(t,"end"),s[1]=o(t,"error");do{if(s[2]=o(t,"readable"),[a,c]=await Promise.race(s.map(t=>t[2])),"error"===a)break;if((u="end"===a)||(isFinite(r-l)?(i=Object(n.toUint8Array)(t.read(r-l))).byteLength<r-l&&(i=Object(n.toUint8Array)(t.read(void 0))):i=Object(n.toUint8Array)(t.read(void 0)),i.byteLength>0&&(h.push(i),l+=i.byteLength)),u||r<=l)do{({cmd:e,size:r}=yield d())}while(r<l)}while(!u)}finally{await function(e,r){return i=h=null,new Promise(async(n,i)=>{for(const[r,o]of e)t.off(r,o);try{const e=t.destroy;e&&e.call(t,r),r=void 0}catch(s){r=s||r}finally{null!=r?i(r):n()}})}(s,"error"===a?c:null)}}(t)),toDOMStream(t,e){throw Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw Error('"toNodeStream" not available in this environment')}};const i=t=>(t.next(),t);class s{constructor(t){this.source=t,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch(e){this.supportsBYOB=!(this.reader=this.getDefaultReader())}}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=this.byobReader=this.defaultReader=null}async cancel(t){const{reader:e,source:r}=this;e&&await e.cancel(t).catch(()=>{}),r&&r.locked&&this.releaseLock()}async read(t){if(0===t)return{done:null==this.reader,value:new Uint8Array(0)};const e=this.supportsBYOB&&"number"==typeof t?await this.readFromBYOBReader(t):await this.getDefaultReader().read();return!e.done&&(e.value=Object(n.toUint8Array)(e)),e}getDefaultReader(){return this.byobReader&&this.releaseLock(),this.defaultReader||(this.defaultReader=this.source.getReader(),this.defaultReader.closed.catch(()=>{})),this.reader=this.defaultReader}getBYOBReader(){return this.defaultReader&&this.releaseLock(),this.byobReader||(this.byobReader=this.source.getReader({mode:"byob"}),this.byobReader.closed.catch(()=>{})),this.reader=this.byobReader}async readFromBYOBReader(t){return await async function t(e,r,n,i){if(n>=i)return{done:!1,value:new Uint8Array(r,0,i)};const{done:s,value:o}=await e.read(new Uint8Array(r,n,i-n));if((n+=o.byteLength)<i&&!s)return await t(e,o.buffer,n,i);return{done:s,value:new Uint8Array(o.buffer,0,n)}}(this.getBYOBReader(),new ArrayBuffer(t),0,t)}}const o=(t,e)=>{let r,n=t=>r([e,t]);return[e,n,new Promise(i=>(r=i)&&t.once(e,n))]}},function(t,e,r){"use strict";!function(t){r.d(e,"a",function(){return a}),r.d(e,"b",function(){return u});var n=r(0),i=r(6);const s="function"==typeof t?t:null,o="function"==typeof TextDecoder&&"function"==typeof TextEncoder,a=(t=>{if(o||!s){const e=new t("utf-8");return t=>e.decode(t)}return t=>{const{buffer:e,byteOffset:r,length:i}=Object(n.toUint8Array)(t);return s.from(e,r,i).toString()}})("undefined"!=typeof TextDecoder?TextDecoder:i.a),u=(t=>{if(o||!s){const e=new t;return t=>e.encode(t)}return(t="")=>Object(n.toUint8Array)(s.from(t,"utf8"))})("undefined"!=typeof TextEncoder?TextEncoder:i.b)}(r(7).Buffer)},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n={};n.Offset,n.Table,n.SIZEOF_SHORT=2,n.SIZEOF_INT=4,n.FILE_IDENTIFIER_LENGTH=4,n.Encoding={UTF8_BYTES:1,UTF16_STRING:2},n.int32=new Int32Array(2),n.float32=new Float32Array(n.int32.buffer),n.float64=new Float64Array(n.int32.buffer),n.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],n.Long=function(t,e){this.low=0|t,this.high=0|e},n.Long.create=function(t,e){return 0==t&&0==e?n.Long.ZERO:new n.Long(t,e)},n.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},n.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},n.Long.ZERO=new n.Long(0,0),n.Builder=function(t){if(t)e=t;else var e=1024;this.bb=n.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},n.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},n.Builder.prototype.dataBuffer=function(){return this.bb},n.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},n.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var r=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<r+t+e;){var i=this.bb.capacity();this.bb=n.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)},n.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},n.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},n.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},n.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},n.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},n.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},n.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},n.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},n.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},n.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},n.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},n.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},n.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},n.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},n.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},n.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},n.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},n.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},n.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},n.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},n.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},n.Builder.prototype.nested=function(t){if(t!=this.offset())throw Error("FlatBuffers: struct must be serialized inline.")},n.Builder.prototype.notNested=function(){if(this.isNested)throw Error("FlatBuffers: object serialization must not be nested.")},n.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},n.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},n.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var r=e<<1,i=n.ByteBuffer.allocate(r);return i.setPosition(r-e),i.bytes().set(t.bytes(),r-e),i},n.Builder.prototype.addOffset=function(t){this.prep(n.SIZEOF_INT,0),this.writeInt32(this.offset()-t+n.SIZEOF_INT)},n.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},n.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var r=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(r+2)*n.SIZEOF_SHORT;this.addInt16(i);var s=0,o=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(a)){for(var u=n.SIZEOF_SHORT;u<i;u+=n.SIZEOF_SHORT)if(this.bb.readInt16(o+u)!=this.bb.readInt16(a+u))continue t;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},n.Builder.prototype.finish=function(t,e){if(e){var r=e;if(this.prep(this.minalign,n.SIZEOF_INT+n.FILE_IDENTIFIER_LENGTH),r.length!=n.FILE_IDENTIFIER_LENGTH)throw Error("FlatBuffers: file identifier must be length "+n.FILE_IDENTIFIER_LENGTH);for(var i=n.FILE_IDENTIFIER_LENGTH-1;i>=0;i--)this.writeInt8(r.charCodeAt(i))}this.prep(this.minalign,n.SIZEOF_INT),this.addOffset(t),this.bb.setPosition(this.space)},n.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,n=r-this.bb.readInt32(r);if(!(0!=this.bb.readInt16(n+e)))throw Error("FlatBuffers: field "+e+" must be set")},n.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(n.SIZEOF_INT,t*e),this.prep(r,t*e)},n.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},n.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var n,i=t.charCodeAt(r++);if(i<55296||i>=56320)n=i;else n=(i<<10)+t.charCodeAt(r++)+-56613888;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(63&n|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);r=0;for(var s=this.space,o=this.bb.bytes();r<e.length;r++)o[s++]=e[r];return this.endVector()},n.Builder.prototype.createLong=function(t,e){return n.Long.create(t,e)},n.ByteBuffer=function(t){this.bytes_=t,this.position_=0},n.ByteBuffer.allocate=function(t){return new n.ByteBuffer(new Uint8Array(t))},n.ByteBuffer.prototype.bytes=function(){return this.bytes_},n.ByteBuffer.prototype.position=function(){return this.position_},n.ByteBuffer.prototype.setPosition=function(t){this.position_=t},n.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},n.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},n.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},n.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},n.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},n.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},n.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},n.ByteBuffer.prototype.readInt64=function(t){return new n.Long(this.readInt32(t),this.readInt32(t+4))},n.ByteBuffer.prototype.readUint64=function(t){return new n.Long(this.readUint32(t),this.readUint32(t+4))},n.ByteBuffer.prototype.readFloat32=function(t){return n.int32[0]=this.readInt32(t),n.float32[0]},n.ByteBuffer.prototype.readFloat64=function(t){return n.int32[n.isLittleEndian?0:1]=this.readInt32(t),n.int32[n.isLittleEndian?1:0]=this.readInt32(t+4),n.float64[0]},n.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},n.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},n.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},n.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},n.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},n.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},n.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},n.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},n.ByteBuffer.prototype.writeFloat32=function(t,e){n.float32[0]=e,this.writeInt32(t,n.int32[0])},n.ByteBuffer.prototype.writeFloat64=function(t,e){n.float64[0]=e,this.writeInt32(t,n.int32[n.isLittleEndian?0:1]),this.writeInt32(t+4,n.int32[n.isLittleEndian?1:0])},n.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+n.SIZEOF_INT+n.FILE_IDENTIFIER_LENGTH)throw Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<n.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+n.SIZEOF_INT+e));return t},n.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},n.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},n.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),i="",s=0;if(t+=n.SIZEOF_INT,e===n.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;s<r;){var o,a=this.readUint8(t+s++);if(a<192)o=a;else{var u=this.readUint8(t+s++);if(a<224)o=(31&a)<<6|63&u;else{var c=this.readUint8(t+s++);if(a<240)o=(15&a)<<12|(63&u)<<6|63&c;else o=(7&a)<<18|(63&u)<<12|(63&c)<<6|63&this.readUint8(t+s++)}}i+=o<65536?String.fromCharCode(o):String.fromCharCode(55296+((o-=65536)>>10),56320+(1023&o))}return i},n.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},n.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+n.SIZEOF_INT},n.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},n.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=n.FILE_IDENTIFIER_LENGTH)throw Error("FlatBuffers: file identifier must be length "+n.FILE_IDENTIFIER_LENGTH);for(var e=0;e<n.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+n.SIZEOF_INT+e))return!1;return!0},n.ByteBuffer.prototype.createLong=function(t,e){return n.Long.create(t,e)}},function(t,e,r){"use strict";function n(t,e,r){return e<=t&&t<=r}function i(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}r.d(e,"b",function(){return h}),r.d(e,"a",function(){return l});var s=-1;function o(t){this.tokens=[].slice.call(t)}o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():s},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var a=-1;function u(t,e){if(t)throw TypeError("Decoder error");return e||65533}var c="utf-8";function l(t,e){if(!(this instanceof l))return new l(t,e);if((t=void 0!==t?(t+"").toLowerCase():c)!==c)throw Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function h(t,e){if(!(this instanceof h))return new h(t,e);if((t=void 0!==t?(t+"").toLowerCase():c)!==c)throw Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function d(t){var e=t.fatal,r=0,i=0,o=0,c=128,l=191;this.handler=function(t,h){if(h===s&&0!==o)return o=0,u(e);if(h===s)return a;if(0===o){if(n(h,0,127))return h;if(n(h,194,223))o=1,r=h-192;else if(n(h,224,239))224===h&&(c=160),237===h&&(l=159),o=2,r=h-224;else{if(!n(h,240,244))return u(e);240===h&&(c=144),244===h&&(l=143),o=3,r=h-240}return r<<=6*o,null}if(!n(h,c,l))return r=o=i=0,c=128,l=191,t.prepend(h),u(e);if(c=128,l=191,r+=h-128<<6*(o-(i+=1)),i!==o)return null;var d=r;return r=o=i=0,d}}function f(t){t.fatal;this.handler=function(t,e){if(e===s)return a;if(n(e,0,127))return e;var r,i;n(e,128,2047)?(r=1,i=192):n(e,2048,65535)?(r=2,i=224):n(e,65536,1114111)&&(r=3,i=240);for(var o=[(e>>6*r)+i];r>0;){var u=e>>6*(r-1);o.push(128|63&u),r-=1}return o}}l.prototype={decode:function(t,e){var r;r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=i(e),this._streaming||(this._decoder=new d({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var n,s=new o(r),u=[];!s.endOfStream()&&(n=this._decoder.handler(s,s.read()))!==a;)null!==n&&(Array.isArray(n)?u.push.apply(u,n):u.push(n));if(!this._streaming){do{if((n=this._decoder.handler(s,s.read()))===a)break;null!==n&&(Array.isArray(n)?u.push.apply(u,n):u.push(n))}while(!s.endOfStream());this._decoder=null}return u.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===u[0]?(this._BOMseen=!0,u.shift()):this._BOMseen=!0)),function(t){for(var e="",r=0;r<t.length;++r){var n=t[r];e+=n<=65535?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),56320+(1023&n))}return e}(u)}},h.prototype={encode:function(t,e){t=t?t+"":"",e=i(e),this._streaming||(this._encoder=new f(this._options)),this._streaming=!!e.stream;for(var r,n=[],s=new o(function(t){for(var e=t+"",r=e.length,n=0,i=[];n<r;){var s=e.charCodeAt(n);if(s<55296||s>57343)i.push(s);else if(56320<=s&&s<=57343)i.push(65533);else if(55296<=s&&s<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var a=1023&s,u=1023&o;i.push(65536+(a<<10)+u),n+=1}else i.push(65533)}n+=1}return i}(t));!s.endOfStream()&&(r=this._encoder.handler(s,s.read()))!==a;)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;(r=this._encoder.handler(s,s.read()))!==a;)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)}}},function(t,e,r){"use strict";!function(t){var n=r(9),i=r(10),s=r(11);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=d(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=a(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|f(e.length);return 0===(t=a(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):d(t,e);if("Buffer"===e.type&&s(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|f(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e){var r=e.length<0?0:0|f(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function f(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(n)return k(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),isNaN(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var s,o=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=(n+"").toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var l=-1;for(s=r;s<a;s++)if(c(t,s)===c(e,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*o}else-1!==l&&(s-=s-l),l=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){for(var h=!0,d=0;d<u;d++)if(c(t,s+d)!==c(e,d)){h=!1;break}if(h)return s}return-1}function w(t,e,r,n){r=+r||0;var i=t.length-r;n?(n=+n)>i&&(n=i):n=i;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(2*o,2),16);if(isNaN(a))return o;t[r+o]=a}return o}function g(t,e,r,n){return z(k(e,t.length-r),t,r,n)}function _(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function v(t,e,r,n){return _(t,e,r,n)}function I(t,e,r,n){return z(P(e),t,r,n)}function A(t,e,r,n){return z(function(t,e){for(var r,n,i,s=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function B(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var s,o,a,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(s=t[i+1]))&&(u=(31&c)<<6|63&s)>127&&(l=u);break;case 3:s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&(u=(15&c)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=t[i+1],o=t[i+2],a=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(u=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=T));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}(),e.kMaxLength=o(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return c(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return l(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch((t+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return D(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return B(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(n,i),l=t.slice(e,r),h=0;h<a;++h)if(c[h]!==l[h]){s=c[h],o=l[h];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return I(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function U(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function D(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=e;s<r;++s)i+=C(t[s]);return i}function F(t,e,r){for(var n=t.slice(e,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-r,2);i<s;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function E(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-r,4);i<s;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function N(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(t,e,r,n,s){return s||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,s){return s||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;r=new u(i,void 0);for(var s=0;s<i;++s)r[s]=this[s+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=e,i=1,s=this[t+--n];n>0&&(i*=256);)s+=this[t+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):E(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):E(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var s=0,o=1,a=0;for(this[e]=255&t;++s<r&&(o*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):E(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):E(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return V(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return V(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,s=n-r;if(this===t&&r<e&&e<n)for(i=s-1;i>=0;--i)t[i+e]=this[i+r];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+s),e);return s},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var o=u.isBuffer(t)?t:k(new u(t,n).toString()),a=o.length;for(s=0;s<r-e;++s)this[s+e]=o[s%a]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function C(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(t,e){var r;e=e||1/0;for(var n=t.length,i=null,s=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function P(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}(r(8))},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()}catch(n){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){for(var e,r=u(t),n=r[0],o=r[1],a=new s(function(t,e,r){return 3*(e+r)/4-r}(0,n,o)),c=0,l=o>0?n-4:n,h=0;h<l;h+=4)e=i[t.charCodeAt(h)]<<18|i[t.charCodeAt(h+1)]<<12|i[t.charCodeAt(h+2)]<<6|i[t.charCodeAt(h+3)],a[c++]=e>>16&255,a[c++]=e>>8&255,a[c++]=255&e;2===o&&(e=i[t.charCodeAt(h)]<<2|i[t.charCodeAt(h+1)]>>4,a[c++]=255&e);1===o&&(e=i[t.charCodeAt(h)]<<10|i[t.charCodeAt(h+1)]<<4|i[t.charCodeAt(h+2)]>>2,a[c++]=e>>8&255,a[c++]=255&e);return a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(c(t,o,o+16383>a?a:o+16383));1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,s,o=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i[45]=62,i[95]=63},function(t,e){e.read=function(t,e,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,d=r?-1:1,f=t[e+h];for(h+=d,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+t[e+h],h+=d,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+t[e+h],h+=d,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=c}return(f?-1:1)*o*Math.pow(2,s-n)},e.write=function(t,e,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,d=23===i?5.960464477539062e-8:0,f=n?0:s-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(a=isNaN(e)?1:0,o=l):(e*(u=Math.pow(2,-(o=Math.floor(Math.log(e)/Math.LN2))))<1&&(o--,u*=2),(e+=o+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*u-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&a,f+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;t[r+f]=255&o,f+=p,o/=256,c-=8);t[r+f-p]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"getBool",function(){return O}),r.d(n,"getBit",function(){return U}),r.d(n,"setBool",function(){return D}),r.d(n,"truncateBitmap",function(){return F}),r.d(n,"packBools",function(){return x}),r.d(n,"iterateBits",function(){return M}),r.d(n,"popcnt_bit_range",function(){return L}),r.d(n,"popcnt_array",function(){return E}),r.d(n,"popcnt_uint32",function(){return N});var i={};r.r(i),r.d(i,"clampIndex",function(){return ee}),r.d(i,"clampRange",function(){return ne}),r.d(i,"createElementComparator",function(){return se});var s={};r.r(s),r.d(s,"BaseInt64",function(){return ke}),r.d(s,"Uint64",function(){return Pe}),r.d(s,"Int64",function(){return ze}),r.d(s,"Int128",function(){return Ye});var o={};r.r(o),r.d(o,"bignumToString",function(){return Rr}),r.d(o,"bignumToBigInt",function(){return jr}),r.d(o,"BN",function(){return kr});var a={};r.r(a),r.d(a,"Value",function(){return qo}),r.d(a,"Literal",function(){return Xo}),r.d(a,"Col",function(){return Qo}),r.d(a,"Predicate",function(){return ta}),r.d(a,"ComparisonPredicate",function(){return ea}),r.d(a,"CombinationPredicate",function(){return ra}),r.d(a,"And",function(){return na}),r.d(a,"Or",function(){return ia}),r.d(a,"Equals",function(){return sa}),r.d(a,"LTeq",function(){return oa}),r.d(a,"GTeq",function(){return aa}),r.d(a,"Not",function(){return ua}),r.d(a,"CustomPredicate",function(){return ca}),r.d(a,"lit",function(){return la}),r.d(a,"col",function(){return ha}),r.d(a,"and",function(){return da}),r.d(a,"or",function(){return fa}),r.d(a,"custom",function(){return pa});var u,c,l,h,d,f=r(3);class p{}h=u||(u={}),l=h.apache||(h.apache={}),function(t){let e;!function(t){t[t.V1=0]="V1",t[t.V2=1]="V2",t[t.V3=2]="V3",t[t.V4=3]="V4"}(e=t.MetadataVersion||(t.MetadataVersion={}))}((c=l.arrow||(l.arrow={})).flatbuf||(c.flatbuf={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.Sparse=0]="Sparse",t[t.Dense=1]="Dense"}(e=t.UnionMode||(t.UnionMode={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.HALF=0]="HALF",t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE"}(e=t.Precision||(t.Precision={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.DAY=0]="DAY",t[t.MILLISECOND=1]="MILLISECOND"}(e=t.DateUnit||(t.DateUnit={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.SECOND=0]="SECOND",t[t.MILLISECOND=1]="MILLISECOND",t[t.MICROSECOND=2]="MICROSECOND",t[t.NANOSECOND=3]="NANOSECOND"}(e=t.TimeUnit||(t.TimeUnit={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.YEAR_MONTH=0]="YEAR_MONTH",t[t.DAY_TIME=1]="DAY_TIME"}(e=t.IntervalUnit||(t.IntervalUnit={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.FloatingPoint=3]="FloatingPoint",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct_=13]="Struct_",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map"}(e=t.Type||(t.Type={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"}(e=t.VectorType||(t.VectorType={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"}(e=t.Endianness||(t.Endianness={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}}t.Null=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}}t.Struct_=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}}t.List=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}}t.FixedSizeList=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}}t.Map=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.UnionMode.Sparse}typeIds(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(e,r){e.addFieldInt16(0,r,t.apache.arrow.flatbuf.UnionMode.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}}e.Union=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startInt(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt32(0,e,0)}static addIsSigned(t,e){t.addFieldInt8(1,+e,0)}static endInt(t){return t.endObject()}}t.Int=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.Precision.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(e,r){e.addFieldInt16(0,r,t.apache.arrow.flatbuf.Precision.HALF)}static endFloatingPoint(t){return t.endObject()}}e.FloatingPoint=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}}t.Utf8=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}}t.Binary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}}t.FixedSizeBinary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}}t.Bool=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}static startDecimal(t){t.startObject(2)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static endDecimal(t){return t.endObject()}}t.Decimal=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.DateUnit.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,t.apache.arrow.flatbuf.DateUnit.MILLISECOND)}static endDate(t){return t.endObject()}}e.Date=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.TimeUnit.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,t.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}}e.Time=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.TimeUnit.SECOND}timezone(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,t.apache.arrow.flatbuf.TimeUnit.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}}e.Timestamp=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,t.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}static endInterval(t){return t.endObject()}}e.Interval=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsVectorLayout(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):0}type(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.VectorType.OFFSET}static startVectorLayout(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt16(0,e,0)}static addType(e,r){e.addFieldInt16(1,r,t.apache.arrow.flatbuf.VectorType.OFFSET)}static endVectorLayout(t){return t.endObject()}}e.VectorLayout=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}}t.KeyValue=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}indexType(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new t.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startDictionaryEncoding(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryEncoding(t){return t.endObject()}}e.DictionaryEncoding=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):t.apache.arrow.flatbuf.Type.NONE}type(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new t.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(e,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new t.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}layout(e,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new t.apache.arrow.flatbuf.VectorLayout).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}layoutLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,18);return n?(r||new t.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(8)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(e,r){e.addFieldInt8(2,r,t.apache.arrow.flatbuf.Type.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addLayout(t,e){t.addFieldOffset(6,e,0)}static createLayoutVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startLayoutVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(7,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}}e.Field=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){t.Buffer=class{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(t,e,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(e),t.offset()}}}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.Endianness.Little}fields(e,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new t.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new t.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(3)}static addEndianness(e,r){e.addFieldInt16(0,r,t.apache.arrow.flatbuf.Endianness.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}}e.Schema=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(u||(u={})),function(t){!function(t){!function(t){!function(t){t.Schema=u.apache.arrow.flatbuf.Schema}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(d||(d={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.NONE=0]="NONE",t[t.Schema=1]="Schema",t[t.DictionaryBatch=2]="DictionaryBatch",t[t.RecordBatch=3]="RecordBatch",t[t.Tensor=4]="Tensor"}(e=t.MessageHeader||(t.MessageHeader={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(d||(d={})),function(t){!function(t){!function(t){!function(t){t.FieldNode=class{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(t,e,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(e),t.offset()}}}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(d||(d={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}nodes(e,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new t.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+n)+16*e,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){let r=this.bb.__offset(this.bb_pos,8);return r?(e||new u.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+r)+16*t,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startRecordBatch(t){t.startObject(3)}static addLength(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static endRecordBatch(t){return t.endObject()}}e.RecordBatch=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(d||(d={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}data(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new t.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}}e.DictionaryBatch=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(d||(d={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):u.apache.arrow.flatbuf.MetadataVersion.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.apache.arrow.flatbuf.MessageHeader.NONE}header(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}static startMessage(t){t.startObject(4)}static addVersion(t,e){t.addFieldInt16(0,e,u.apache.arrow.flatbuf.MetadataVersion.V1)}static addHeaderType(e,r){e.addFieldInt8(1,r,t.apache.arrow.flatbuf.MessageHeader.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,0))}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}}e.Message=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(d||(d={}));var y,b,m=u.apache.arrow.flatbuf.Type,w=u.apache.arrow.flatbuf.DateUnit,g=u.apache.arrow.flatbuf.TimeUnit,_=u.apache.arrow.flatbuf.Precision,v=u.apache.arrow.flatbuf.UnionMode,I=u.apache.arrow.flatbuf.VectorType,A=u.apache.arrow.flatbuf.IntervalUnit,B=d.apache.arrow.flatbuf.MessageHeader,S=u.apache.arrow.flatbuf.MetadataVersion;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(y||(y={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new r).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):u.apache.arrow.flatbuf.MetadataVersion.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new u.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new t.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+n)+24*e,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(e,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new t.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+n)+24*e,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(4)}static addVersion(t,e){t.addFieldInt16(0,e,u.apache.arrow.flatbuf.MetadataVersion.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}}e.Footer=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(b||(b={})),function(t){!function(t){!function(t){!function(t){t.Block=class{constructor(){this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,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(t,e,r,n){return t.prep(8,24),t.writeInt64(n),t.pad(4),t.writeInt32(r),t.writeInt64(e),t.offset()}}}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(b||(b={}));var T=r(5);function O(t,e,r,n){return 0!=(r&1<<n)}function U(t,e,r,n){return(r&1<<n)>>n}function D(t,e,r){return r?!!(t[e>>3]|=1<<e%8)||!0:!(t[e>>3]&=~(1<<e%8))&&!1}function F(t,e,r){const n=r.byteLength+7&-8;if(t>0||r.byteLength<n){const i=new Uint8Array(n);return i.set(t%8==0?r.subarray(t>>3):x(M(r,t,e,null,O)).subarray(0,n)),i}return r}function x(t){let e=[],r=0,n=0,i=0;for(const o of t)o&&(i|=1<<n),8==++n&&(e[r++]=i,i=n=0);(0===r||n>0)&&(e[r++]=i);let s=new Uint8Array(e.length+7&-8);return s.set(e),s}function*M(t,e,r,n,i){let s=e%8,o=e>>3,a=0,u=r;for(;u>0;s=0){let e=t[o++];do{yield i(n,a++,e,s)}while(--u>0&&++s<8)}}function L(t,e,r){if(r-e<=0)return 0;if(r-e<8){let n=0;for(const i of M(t,e,r-e,t,U))n+=i;return n}const n=r>>3<<3,i=e+(e%8==0?0:8-e%8);return L(t,e,i)+L(t,n,r)+E(t,i>>3,n-i>>3)}function E(t,e,r){let n=0,i=0|e;const s=new DataView(t.buffer,t.byteOffset,t.byteLength),o=void 0===r?t.byteLength:i+r;for(;o-i>=4;)n+=N(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=N(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=N(s.getUint8(i)),i+=1;return n}function N(t){let e=0|t;return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24}class V{visitMany(t,...e){return t.map((t,r)=>this.visit(t,...e.map(t=>t[r])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return function(t,e,r=!0){let n=null,i=y.NONE;e instanceof Yt?i=R(e.type):e instanceof p?i=R(e.type):e instanceof G?i=R(e):"number"!=typeof(i=e)&&(i=y[e]);switch(i){case y.Null:n=t.visitNull;break;case y.Bool:n=t.visitBool;break;case y.Int:n=t.visitInt;break;case y.Int8:n=t.visitInt8||t.visitInt;break;case y.Int16:n=t.visitInt16||t.visitInt;break;case y.Int32:n=t.visitInt32||t.visitInt;break;case y.Int64:n=t.visitInt64||t.visitInt;break;case y.Uint8:n=t.visitUint8||t.visitInt;break;case y.Uint16:n=t.visitUint16||t.visitInt;break;case y.Uint32:n=t.visitUint32||t.visitInt;break;case y.Uint64:n=t.visitUint64||t.visitInt;break;case y.Float:n=t.visitFloat;break;case y.Float16:n=t.visitFloat16||t.visitFloat;break;case y.Float32:n=t.visitFloat32||t.visitFloat;break;case y.Float64:n=t.visitFloat64||t.visitFloat;break;case y.Utf8:n=t.visitUtf8;break;case y.Binary:n=t.visitBinary;break;case y.FixedSizeBinary:n=t.visitFixedSizeBinary;break;case y.Date:n=t.visitDate;break;case y.DateDay:n=t.visitDateDay||t.visitDate;break;case y.DateMillisecond:n=t.visitDateMillisecond||t.visitDate;break;case y.Timestamp:n=t.visitTimestamp;break;case y.TimestampSecond:n=t.visitTimestampSecond||t.visitTimestamp;break;case y.TimestampMillisecond:n=t.visitTimestampMillisecond||t.visitTimestamp;break;case y.TimestampMicrosecond:n=t.visitTimestampMicrosecond||t.visitTimestamp;break;case y.TimestampNanosecond:n=t.visitTimestampNanosecond||t.visitTimestamp;break;case y.Time:n=t.visitTime;break;case y.TimeSecond:n=t.visitTimeSecond||t.visitTime;break;case y.TimeMillisecond:n=t.visitTimeMillisecond||t.visitTime;break;case y.TimeMicrosecond:n=t.visitTimeMicrosecond||t.visitTime;break;case y.TimeNanosecond:n=t.visitTimeNanosecond||t.visitTime;break;case y.Decimal:n=t.visitDecimal;break;case y.List:n=t.visitList;break;case y.Struct:n=t.visitStruct;break;case y.Union:n=t.visitUnion;break;case y.DenseUnion:n=t.visitDenseUnion||t.visitUnion;break;case y.SparseUnion:n=t.visitSparseUnion||t.visitUnion;break;case y.Dictionary:n=t.visitDictionary;break;case y.Interval:n=t.visitInterval;break;case y.IntervalDayTime:n=t.visitIntervalDayTime||t.visitInterval;break;case y.IntervalYearMonth:n=t.visitIntervalYearMonth||t.visitInterval;break;case y.FixedSizeList:n=t.visitFixedSizeList;break;case y.Map:n=t.visitMap}if("function"==typeof n)return n;if(!r)return()=>null;throw Error(`Unrecognized type '${y[i]}'`)}(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function R(t){switch(t.typeId){case y.Null:return y.Null;case y.Int:const{bitWidth:e,isSigned:r}=t;switch(e){case 8:return r?y.Int8:y.Uint8;case 16:return r?y.Int16:y.Uint16;case 32:return r?y.Int32:y.Uint32;case 64:return r?y.Int64:y.Uint64}return y.Int;case y.Float:switch(t.precision){case _.HALF:return y.Float16;case _.SINGLE:return y.Float32;case _.DOUBLE:return y.Float64}return y.Float;case y.Binary:return y.Binary;case y.Utf8:return y.Utf8;case y.Bool:return y.Bool;case y.Decimal:return y.Decimal;case y.Time:switch(t.unit){case g.SECOND:return y.TimeSecond;case g.MILLISECOND:return y.TimeMillisecond;case g.MICROSECOND:return y.TimeMicrosecond;case g.NANOSECOND:return y.TimeNanosecond}return y.Time;case y.Timestamp:switch(t.unit){case g.SECOND:return y.TimestampSecond;case g.MILLISECOND:return y.TimestampMillisecond;case g.MICROSECOND:return y.TimestampMicrosecond;case g.NANOSECOND:return y.TimestampNanosecond}return y.Timestamp;case y.Date:switch(t.unit){case w.DAY:return y.DateDay;case w.MILLISECOND:return y.DateMillisecond}return y.Date;case y.Interval:switch(t.unit){case A.DAY_TIME:return y.IntervalDayTime;case A.YEAR_MONTH:return y.IntervalYearMonth}return y.Interval;case y.Map:return y.Map;case y.List:return y.List;case y.Struct:return y.Struct;case y.Union:switch(t.mode){case v.Dense:return y.DenseUnion;case v.Sparse:return y.SparseUnion}return y.Union;case y.FixedSizeBinary:return y.FixedSizeBinary;case y.FixedSizeList:return y.FixedSizeList;case y.Dictionary:return y.Dictionary}throw Error(`Unrecognized type '${y[t.typeId]}'`)}V.prototype.visitInt8=null,V.prototype.visitInt16=null,V.prototype.visitInt32=null,V.prototype.visitInt64=null,V.prototype.visitUint8=null,V.prototype.visitUint16=null,V.prototype.visitUint32=null,V.prototype.visitUint64=null,V.prototype.visitFloat16=null,V.prototype.visitFloat32=null,V.prototype.visitFloat64=null,V.prototype.visitDateDay=null,V.prototype.visitDateMillisecond=null,V.prototype.visitTimestampSecond=null,V.prototype.visitTimestampMillisecond=null,V.prototype.visitTimestampMicrosecond=null,V.prototype.visitTimestampNanosecond=null,V.prototype.visitTimeSecond=null,V.prototype.visitTimeMillisecond=null,V.prototype.visitTimeMicrosecond=null,V.prototype.visitTimeNanosecond=null,V.prototype.visitDenseUnion=null,V.prototype.visitSparseUnion=null,V.prototype.visitIntervalDayTime=null,V.prototype.visitIntervalYearMonth=null;class j extends V{compareSchemas(t,e){return t===e||e instanceof t.constructor&&K.compareFields(t.fields,e.fields)}compareFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((t,r)=>K.compareField(t,e[r]))}compareField(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&K.visit(t.type,e.type)}}function C(t,e){return e instanceof t.constructor}function k(t,e){return t===e||C(t,e)}function P(t,e){return t===e||C(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function z(t,e){return t===e||C(t,e)&&t.precision===e.precision}function Y(t,e){return t===e||C(t,e)&&t.unit===e.unit}function $(t,e){return t===e||C(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function W(t,e){return t===e||C(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function H(t,e){return t===e||C(t,e)&&t.mode===e.mode&&t.typeIds.every((t,r)=>t===e.typeIds[r])&&K.compareFields(t.children,e.children)}function J(t,e){return t===e||C(t,e)&&t.unit===e.unit}j.prototype.visitNull=k,j.prototype.visitBool=k,j.prototype.visitInt=P,j.prototype.visitInt8=P,j.prototype.visitInt16=P,j.prototype.visitInt32=P,j.prototype.visitInt64=P,j.prototype.visitUint8=P,j.prototype.visitUint16=P,j.prototype.visitUint32=P,j.prototype.visitUint64=P,j.prototype.visitFloat=z,j.prototype.visitFloat16=z,j.prototype.visitFloat32=z,j.prototype.visitFloat64=z,j.prototype.visitUtf8=k,j.prototype.visitBinary=k,j.prototype.visitFixedSizeBinary=function(t,e){return t===e||C(t,e)&&t.byteWidth===e.byteWidth},j.prototype.visitDate=Y,j.prototype.visitDateDay=Y,j.prototype.visitDateMillisecond=Y,j.prototype.visitTimestamp=$,j.prototype.visitTimestampSecond=$,j.prototype.visitTimestampMillisecond=$,j.prototype.visitTimestampMicrosecond=$,j.prototype.visitTimestampNanosecond=$,j.prototype.visitTime=W,j.prototype.visitTimeSecond=W,j.prototype.visitTimeMillisecond=W,j.prototype.visitTimeMicrosecond=W,j.prototype.visitTimeNanosecond=W,j.prototype.visitDecimal=k,j.prototype.visitList=function(t,e){return t===e||C(t,e)&&t.children.length===e.children.length&&K.compareFields(t.children,e.children)},j.prototype.visitStruct=function(t,e){return t===e||C(t,e)&&t.children.length===e.children.length&&K.compareFields(t.children,e.children)},j.prototype.visitUnion=H,j.prototype.visitDenseUnion=H,j.prototype.visitSparseUnion=H,j.prototype.visitDictionary=function(t,e){return t===e||C(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&K.visit(t.indices,e.indices)&&K.visit(t.dictionary,e.dictionary)},j.prototype.visitInterval=J,j.prototype.visitIntervalDayTime=J,j.prototype.visitIntervalYearMonth=J,j.prototype.visitFixedSizeList=function(t,e){return t===e||C(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&K.compareFields(t.children,e.children)},j.prototype.visitMap=function(t,e){return t===e||C(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&K.compareFields(t.children,e.children)};const K=new j;class G{static isNull(t){return t&&t.typeId===y.Null}static isInt(t){return t&&t.typeId===y.Int}static isFloat(t){return t&&t.typeId===y.Float}static isBinary(t){return t&&t.typeId===y.Binary}static isUtf8(t){return t&&t.typeId===y.Utf8}static isBool(t){return t&&t.typeId===y.Bool}static isDecimal(t){return t&&t.typeId===y.Decimal}static isDate(t){return t&&t.typeId===y.Date}static isTime(t){return t&&t.typeId===y.Time}static isTimestamp(t){return t&&t.typeId===y.Timestamp}static isInterval(t){return t&&t.typeId===y.Interval}static isList(t){return t&&t.typeId===y.List}static isStruct(t){return t&&t.typeId===y.Struct}static isUnion(t){return t&&t.typeId===y.Union}static isFixedSizeBinary(t){return t&&t.typeId===y.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===y.FixedSizeList}static isMap(t){return t&&t.typeId===y.Map}static isDictionary(t){return t&&t.typeId===y.Dictionary}get typeId(){return y.NONE}compareTo(t){return K.visit(this,t)}}G[Symbol.toStringTag]=(t=>(t.children=null,t.ArrayType=Array,t[Symbol.toStringTag]="DataType"))(G.prototype);class Z extends G{toString(){return"Null"}get typeId(){return y.Null}}Z[Symbol.toStringTag]=(t=>Z.prototype[Symbol.toStringTag]="Null")();class q extends G{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return y.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:case 64:return this.isSigned?Int32Array:Uint32Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}q[Symbol.toStringTag]=(t=>(t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"))(q.prototype);class X extends q{constructor(){super(!0,8)}}class Q extends q{constructor(){super(!0,16)}}class tt extends q{constructor(){super(!0,32)}}class et extends q{constructor(){super(!0,64)}}class rt extends q{constructor(){super(!1,8)}}class nt extends q{constructor(){super(!1,16)}}class it extends q{constructor(){super(!1,32)}}class st extends q{constructor(){super(!1,64)}}Object.defineProperty(X.prototype,"ArrayType",{value:Int8Array}),Object.defineProperty(Q.prototype,"ArrayType",{value:Int16Array}),Object.defineProperty(tt.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(et.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(rt.prototype,"ArrayType",{value:Uint8Array}),Object.defineProperty(nt.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty(it.prototype,"ArrayType",{value:Uint32Array}),Object.defineProperty(st.prototype,"ArrayType",{value:Uint32Array});class ot extends G{constructor(t){super(),this.precision=t}get typeId(){return y.Float}get ArrayType(){switch(this.precision){case _.HALF:return Uint16Array;case _.SINGLE:return Float32Array;case _.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}ot[Symbol.toStringTag]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(ot.prototype);class at extends ot{constructor(){super(_.HALF)}}class ut extends ot{constructor(){super(_.SINGLE)}}class ct extends ot{constructor(){super(_.DOUBLE)}}Object.defineProperty(at.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty(ut.prototype,"ArrayType",{value:Float32Array}),Object.defineProperty(ct.prototype,"ArrayType",{value:Float64Array});class lt extends G{constructor(){super()}get typeId(){return y.Binary}toString(){return"Binary"}}lt[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))(lt.prototype);class ht extends G{constructor(){super()}get typeId(){return y.Utf8}toString(){return"Utf8"}}ht[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(ht.prototype);class dt extends G{constructor(){super()}get typeId(){return y.Bool}toString(){return"Bool"}}dt[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(dt.prototype);class ft extends G{constructor(t,e){super(),this.scale=t,this.precision=e}get typeId(){return y.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}ft[Symbol.toStringTag]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))(ft.prototype);class pt extends G{constructor(t){super(),this.unit=t}get typeId(){return y.Date}toString(){return`Date${32*(this.unit+1)}<${w[this.unit]}>`}}pt[Symbol.toStringTag]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Date"))(pt.prototype);class yt extends pt{constructor(){super(w.DAY)}}class bt extends pt{constructor(){super(w.MILLISECOND)}}class mt extends G{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return y.Time}toString(){return`Time${this.bitWidth}<${g[this.unit]}>`}}mt[Symbol.toStringTag]=(t=>(t.unit=null,t.bitWidth=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Time"))(mt.prototype);class wt extends mt{constructor(){super(g.SECOND,32)}}class gt extends mt{constructor(){super(g.MILLISECOND,32)}}class _t extends mt{constructor(){super(g.MICROSECOND,64)}}class vt extends mt{constructor(){super(g.NANOSECOND,64)}}class It extends G{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return y.Timestamp}toString(){return`Timestamp<${g[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}It[Symbol.toStringTag]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Timestamp"))(It.prototype);class At extends It{constructor(t){super(g.SECOND,t)}}class Bt extends It{constructor(t){super(g.MILLISECOND,t)}}class St extends It{constructor(t){super(g.MICROSECOND,t)}}class Tt extends It{constructor(t){super(g.NANOSECOND,t)}}class Ot extends G{constructor(t){super(),this.unit=t}get typeId(){return y.Interval}toString(){return`Interval<${A[this.unit]}>`}}Ot[Symbol.toStringTag]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(Ot.prototype);class Ut extends Ot{constructor(){super(A.DAY_TIME)}}class Dt extends Ot{constructor(){super(A.YEAR_MONTH)}}class Ft extends G{constructor(t){super(),this.children=[t]}get typeId(){return y.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}}Ft[Symbol.toStringTag]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(Ft.prototype);class xt extends G{constructor(t){super(),this.children=t,this.children=t}get typeId(){return y.Struct}toString(){return`Struct<[${this.children.map(t=>t.type).join(", ")}]>`}}xt[Symbol.toStringTag]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))(xt.prototype);class Mt extends G{constructor(t,e,r){super(),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((t,e,r)=>(t[e]=r)&&t||t,Object.create(null))}get typeId(){return y.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Mt[Symbol.toStringTag]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Union"))(Mt.prototype);class Lt extends Mt{constructor(t,e){super(v.Dense,t,e)}}class Et extends Mt{constructor(t,e){super(v.Sparse,t,e)}}class Nt extends G{constructor(t){super(),this.byteWidth=t}get typeId(){return y.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Nt[Symbol.toStringTag]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(Nt.prototype);class Vt extends G{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return y.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}>`}}Vt[Symbol.toStringTag]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(Vt.prototype);class Rt extends G{constructor(t,e=!1){super(),this.children=t,this.keysSorted=e}get typeId(){return y.Map}toString(){return`Map<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Rt[Symbol.toStringTag]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(Rt.prototype);const jt=(t=>()=>++t)(-1);class Ct extends G{constructor(t,e,r,n,i){super(),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.dictionaryVector=i,this.id=null==r?jt():"number"==typeof r?r:r.low}get typeId(){return y.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}>`}}function kt(t){let e=t;switch(t.typeId){case y.Decimal:return 4;case y.Timestamp:return 2;case y.Date:case y.Interval:return 1+e.unit;case y.Int:case y.Time:return+(e.bitWidth>32)+1;case y.FixedSizeList:return e.listSize;case y.FixedSizeBinary:return e.byteWidth;default:return 1}}Ct[Symbol.toStringTag]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t.dictionaryVector=null,t[Symbol.toStringTag]="Dictionary"))(Ct.prototype);var Pt=r(0);const zt=-1;class Yt{constructor(t,e,r,n,i,s){let o;this.type=t,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1)),this.childData=(s||[]).map(t=>t instanceof Yt?t:t.data),i instanceof Yt?(this.stride=i.stride,this.values=i.values,this.typeIds=i.typeIds,this.nullBitmap=i.nullBitmap,this.valueOffsets=i.valueOffsets):(this.stride=kt(t),i&&((o=i[0])&&(this.valueOffsets=o),(o=i[1])&&(this.values=o),(o=i[2])&&(this.nullBitmap=o),(o=i[3])&&(this.typeIds=o)))}get ArrayType(){return this.type.ArrayType}get typeId(){return this.type.typeId}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullCount(){let t,e=this._nullCount;return e<=zt&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-L(t,this.offset,this.offset+this.length)),e}clone(t,e=this.offset,r=this.length,n=this._nullCount,i=this,s=this.childData){return new Yt(t,e,r,n,i,s)}slice(t,e){const{stride:r,typeId:n,childData:i}=this,s=+(0===this._nullCount)-1,o=16===n?r:1,a=this._sliceBuffers(t,e,r,n);return this.clone(this.type,this.offset+t,e,s,a,!i.length||this.valueOffsets?i:this._sliceChildren(i,o*t,o*e))}_changeLengthAndBackfillNullBitmap(t){const{length:e,nullCount:r}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<<e-(-8&e))-1,r>0&&n.set(F(this.offset,e,this.nullBitmap),0);const i=this.buffers;return i[I.VALIDITY]=n,this.clone(this.type,0,t,r+(t-e),i)}_sliceBuffers(t,e,r,n){let i,{buffers:s}=this;return(i=s[I.TYPE])&&(s[I.TYPE]=i.subarray(t,t+e)),(i=s[I.OFFSET])&&(s[I.OFFSET]=i.subarray(t,t+e+1))||(i=s[I.DATA])&&(s[I.DATA]=6===n?i:i.subarray(r*t,r*(t+e))),s}_sliceChildren(t,e,r){return t.map(t=>t.slice(e,r))}static new(t,e,r,n,i,s){switch(i instanceof Yt?i=i.buffers:i||(i=[]),t.typeId){case y.Null:return Yt.Null(t,e,r,n||0,i[2]);case y.Int:return Yt.Int(t,e,r,n||0,i[2],i[1]||[]);case y.Dictionary:return Yt.Dictionary(t,e,r,n||0,i[2],i[1]||[]);case y.Float:return Yt.Float(t,e,r,n||0,i[2],i[1]||[]);case y.Bool:return Yt.Bool(t,e,r,n||0,i[2],i[1]||[]);case y.Decimal:return Yt.Decimal(t,e,r,n||0,i[2],i[1]||[]);case y.Date:return Yt.Date(t,e,r,n||0,i[2],i[1]||[]);case y.Time:return Yt.Time(t,e,r,n||0,i[2],i[1]||[]);case y.Timestamp:return Yt.Timestamp(t,e,r,n||0,i[2],i[1]||[]);case y.Interval:return Yt.Interval(t,e,r,n||0,i[2],i[1]||[]);case y.FixedSizeBinary:return Yt.FixedSizeBinary(t,e,r,n||0,i[2],i[1]||[]);case y.Binary:return Yt.Binary(t,e,r,n||0,i[2],i[0]||[],i[1]||[]);case y.Utf8:return Yt.Utf8(t,e,r,n||0,i[2],i[0]||[],i[1]||[]);case y.List:return Yt.List(t,e,r,n||0,i[2],i[0]||[],(s||[])[0]);case y.FixedSizeList:return Yt.FixedSizeList(t,e,r,n||0,i[2],(s||[])[0]);case y.Struct:return Yt.Struct(t,e,r,n||0,i[2],s||[]);case y.Map:return Yt.Map(t,e,r,n||0,i[2],s||[]);case y.Union:return Yt.Union(t,e,r,n||0,i[2],i[3]||[],i[1]||s,s)}throw Error(`Unrecognized typeId ${t.typeId}`)}static Null(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,void 0,Object(Pt.toUint8Array)(i)])}static Int(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Dictionary(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.indices.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Float(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Bool(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Decimal(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Date(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Time(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Timestamp(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Interval(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static FixedSizeBinary(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,Object(Pt.toArrayBufferView)(t.ArrayType,s),Object(Pt.toUint8Array)(i)])}static Binary(t,e,r,n,i,s,o){return new Yt(t,e,r,n,[Object(Pt.toInt32Array)(s),Object(Pt.toUint8Array)(o),Object(Pt.toUint8Array)(i)])}static Utf8(t,e,r,n,i,s,o){return new Yt(t,e,r,n,[Object(Pt.toInt32Array)(s),Object(Pt.toUint8Array)(o),Object(Pt.toUint8Array)(i)])}static List(t,e,r,n,i,s,o){return new Yt(t,e,r,n,[Object(Pt.toInt32Array)(s),void 0,Object(Pt.toUint8Array)(i)],[o])}static FixedSizeList(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,void 0,Object(Pt.toUint8Array)(i)],[s])}static Struct(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,void 0,Object(Pt.toUint8Array)(i)],s)}static Map(t,e,r,n,i,s){return new Yt(t,e,r,n,[void 0,void 0,Object(Pt.toUint8Array)(i)],s)}static Union(t,e,r,n,i,s,o,a){const u=[void 0,void 0,Object(Pt.toUint8Array)(i),Object(Pt.toArrayBufferView)(t.ArrayType,s)];return t.mode===v.Sparse?new Yt(t,e,r,n,u,o):(u[I.OFFSET]=Object(Pt.toInt32Array)(o),new Yt(t,e,r,n,u,a))}}Yt.prototype.childData=Object.freeze([]);const $t=void 0;function Wt(t){if(null===t)return"null";if(t===$t)return"undefined";switch(typeof t){case"number":case"bigint":return`${t}`;case"string":return`"${t}"`}return"function"==typeof t[Symbol.toPrimitive]?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?`[${t}]`:JSON.stringify(t)}const Ht=Symbol.for("length"),Jt=Symbol.for("parent"),Kt=Symbol.for("rowIndex"),Gt={enumerable:!0,configurable:!1,get:null},Zt={writable:!1,enumerable:!1,configurable:!1,value:-1},qt={writable:!1,enumerable:!1,configurable:!1,value:null};class Xt{*[Symbol.iterator](){for(let t=-1,e=this[Ht];++t<e;)yield this[t]}get(t){return this[t]}toJSON(){return G.isStruct(this[Jt].type)?[...this]:Object.getOwnPropertyNames(this).reduce((t,e)=>(t[e]=this[e])&&t||t,{})}toString(){return G.isStruct(this[Jt].type)?[...this].map(t=>Wt(t)).join(", "):Object.getOwnPropertyNames(this).reduce((t,e)=>(t[e]=Wt(this[e]))&&t||t,{})}}class Qt{constructor(t,e,r){const n=Object.create(Xt.prototype);qt.value=t,Zt.value=e.length,Object.defineProperty(n,Jt,qt),Object.defineProperty(n,Ht,Zt),e.forEach((t,e)=>{n.hasOwnProperty(t.name)||(Gt.enumerable=r,Gt.get||(Gt.get=this._bindGetter(e)),Object.defineProperty(n,t.name,Gt)),n.hasOwnProperty(e)||(Gt.enumerable=!r,Gt.get||(Gt.get=this._bindGetter(e)),Object.defineProperty(n,e,Gt)),Gt.get=null}),this.rowPrototype=n}static new(t,e,r=!1){let n,i;return Array.isArray(e)?i=e:(r=!0,i=Object.keys(n=e).map(t=>new Ie(t,n[t]))),new Qt(t,i,r)}_bindGetter(t){return function(){const e=this[Jt].getChildAt(t);return e?e.get(this[Kt]):null}}bind(t){const e=Object.create(this.rowPrototype);return e[Kt]=t,e}}var te=r(1);function ee(t,e,r){const n=t.length,i=e>-1?e:n+e%n;return r?r(t,i):i}let re;function ne(t,e,r,n){let{length:i=0}=t,s="number"!=typeof e?0:e,o="number"!=typeof r?i:r;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),o<s&&(re=s,s=o,o=re),o>i&&(o=i),n?n(t,s,o):[s,o]}const ie=te.c?Object(te.a)(0):0;function se(t){let e=typeof t;if("object"!==e||null===t)return"bigint"!==e?e=>e===t:e=>ie+e===t;if(t instanceof Date){const e=t.valueOf();return t=>t instanceof Date&&t.valueOf()===e}if(ArrayBuffer.isView(t))return e=>!!e&&Object(Pt.compareArrayLike)(t,e);if(Array.isArray(t))return function(t){const e=t.length,r=[];for(let n=-1;++n<e;)r[n]=se(t[n]);return t=>{if(!t)return!1;if(t instanceof Xt){if(t[Ht]!==e)return!1;for(let n=-1;++n<e;)if(!r[n](t.get(n)))return!1;return!0}if(t.length!==e)return!1;if(t instanceof p){for(let n=-1;++n<e;)if(!r[n](t.get(n)))return!1;return!0}for(let n=-1;++n<e;)if(!r[n](t[n]))return!1;return!0}}(t);if(t instanceof Xt)return function(t){const e=t[Ht],r=t.constructor,n=[];for(let i=-1;++i<e;)n[i]=se(t.get(i));return t=>{if(!(t instanceof r))return!1;if(t[Ht]!==e)return!1;for(let r=-1;++r<e;)if(!n[r](t.get(r)))return!1;return!0}}(t);if(t instanceof p)return function(t){const e=t.length,r=t.constructor,n=[];for(let i=-1;++i<e;)n[i]=se(t.get(i));return t=>{if(!(t instanceof r))return!1;if(t.length!==e)return!1;for(let r=-1;++r<e;)if(!n[r](t.get(r)))return!1;return!0}}(t);const r=Object.keys(t);return r.length>0?function(t,e){const r=e.length,n=[];for(let i=-1;++i<r;)n[i]=se(t[e[i]]);return t=>{if(!t||"object"!=typeof t)return!1;for(let i=-1;++i<r;)if(!n[i](t[e[i]]))return!1;return!0}}(t,r):()=>!1}class oe extends p{constructor(t,e=[],r=function(t){let e=new Uint32Array((t||[]).length+1),r=e[0]=0,n=e.length;for(let i=0;++i<n;)e[i]=r+=t[i-1].length;return e}(e)){super(),this._nullCount=-1,this._type=t,this._chunks=e,this._chunkOffsets=r,this._length=r[r.length-1],this._numChildren=(this._type.children||[]).length}static flatten(...t){return ye(p,t)}static concat(...t){const e=oe.flatten(...t);return new oe(e[0].type,e)}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 nullCount(){let t=this._nullCount;return t<0&&(this._nullCount=t=this._chunks.reduce((t,{nullCount:e})=>t+e,0)),t}get indices(){if(G.isDictionary(this._type)){if(!this._indices){const t=this._chunks;this._indices=1===t.length?t[0].indices:oe.concat(...t.map(t=>t.indices))}return this._indices}return null}get dictionary(){return G.isDictionary(this._type)?this._type.dictionaryVector:null}*[Symbol.iterator](){for(const t of this._chunks)yield*t}clone(t=this._chunks){return new oe(this._type,t)}concat(...t){return this.clone(oe.flatten(this,...t))}slice(t,e){return ne(this,t,e,this._sliceInternal)}getChildAt(t){if(t<0||t>=this._numChildren)return null;let e,r,n,i=this._children||(this._children=[]);return(e=i[t])?e:(r=(this._type.children||[])[t])&&(n=this._chunks.map(e=>e.getChildAt(t)).filter(t=>null!=t)).length>0?i[t]=new oe(r.type,n):null}search(t,e){let r=t,n=this._chunkOffsets,i=n.length-1;if(r<0)return null;if(r>=n[i])return null;if(i<=1)return e?e(this,0,r):[0,r];let s=0,o=0,a=0;do{if(s+1===i)return e?e(this,s,r-o):[s,r-o];r>=n[a=s+(i-s)/2|0]?s=a:i=a}while(r<n[i]&&r>=(o=n[s]));return null}isValid(t){return!!this.search(t,this.isValidInternal)}get(t){return this.search(t,this.getInternal)}set(t,e){this.search(t,({chunks:t},r,n)=>t[r].set(n,e))}indexOf(t,e){return e&&"number"==typeof e?this.search(e,(e,r,n)=>this.indexOfInternal(e,r,n,t)):this.indexOfInternal(this,0,Math.max(0,e||0),t)}toArray(){const{chunks:t}=this,e=t.length;let{ArrayType:r}=this._type;if(e<=0)return new r(0);if(e<=1)return t[0].toArray();let n=0,i=Array(e);for(let a=-1;++a<e;)n+=(i[a]=t[a].toArray()).length;r!==i[0].constructor&&(r=i[0].constructor);let s=new r(n),o=r===Array?ue:ae;for(let a=-1,u=0;++a<e;)u=o(i[a],s,u);return s}getInternal({_chunks:t},e,r){return t[e].get(r)}isValidInternal({_chunks:t},e,r){return t[e].isValid(r)}indexOfInternal({_chunks:t},e,r,n){let i=e-1,s=t.length,o=r,a=0,u=-1;for(;++i<s;){if(~(u=t[i].indexOf(n,o)))return a+u;o=0,a+=t[i].length}return-1}_sliceInternal(t,e,r){const n=[],{chunks:i,_chunkOffsets:s}=t;for(let o=-1,a=i.length;++o<a;){const t=i[o],a=t.length,u=s[o];if(u>=r)break;if(e>=u+a)continue;if(u>=e&&u+a<=r){n.push(t);continue}const c=Math.max(0,e-u),l=Math.min(r-u,a);n.push(t.slice(c,l))}return t.clone(n)}}const ae=(t,e,r)=>(e.set(t,r),r+t.length),ue=(t,e,r)=>{let n=r-1;for(let i=-1,s=t.length;++i<s;)e[++n]=t[i];return n};class ce extends oe{constructor(t,e=[],r){if(e=oe.flatten(...e),super(t.type,e,r),this._field=t,1===e.length&&!(this instanceof le))return new le(t,e[0],this._chunkOffsets)}static new(t,e,...r){const n=oe.flatten(Array.isArray(e)?[...e,...r]:e instanceof p?[e,...r]:[p.new(e,...r)]);if("string"==typeof t){const e=n[0].data.type;t=new Ie(t,e,n.some(({nullCount:t})=>t>0))}else!t.nullable&&n.some(({nullCount:t})=>t>0)&&(t=t.clone({nullable:!0}));return new ce(t,n)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(t=this._chunks){return new ce(this._field,t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let e,r,n,i=this._children||(this._children=[]);return(e=i[t])?e:(r=(this.type.children||[])[t])&&(n=this._chunks.map(e=>e.getChildAt(t)).filter(t=>null!=t)).length>0?i[t]=new ce(r,n):null}}class le extends ce{constructor(t,e,r){super(t,[e],r),this._chunk=e}search(t,e){return e?e(this,0,t):[0,t]}isValid(t){return this._chunk.isValid(t)}get(t){return this._chunk.get(t)}set(t,e){this._chunk.set(t,e)}indexOf(t,e){return this._chunk.indexOf(t,e)}}const he=Array.isArray,de=(t,e)=>we(t,e,[],0),fe=t=>{const[e,r]=_e(t,[[],[]]);return r.map((t,r)=>t instanceof ce?ce.new(t.field.clone(e[r]),t):t instanceof p?ce.new(e[r],t):ce.new(e[r],[]))},pe=t=>_e(t,[[],[]]),ye=(t,e)=>(function t(e,r,n,i){let s,o=i;let a=-1,u=r.length;for(;++a<u;)he(s=r[a])?o=t(e,s,n,o).length:s instanceof oe?o=t(e,s.chunks,n,o).length:s instanceof e&&(n[o++]=s);return n})(t,e,[],0),be=(t,e)=>(function t(e,r,n,i){let s,o=i;let a=-1,u=r.length;for(;++a<u;)he(s=r[a])?o=t(e,s,n,o).length:s instanceof e?o=we(p,s.schema.fields.map((t,e)=>s.getChildAt(e)),n,o).length:s instanceof p&&(n[o++]=s);return n})(t,e,[],0),me=(t,e)=>(function t(e,r,n,i){let s,o=i;let a=-1,u=r.length;for(;++a<u;)he(s=r[a])?o=t(e,s,n,o).length:s instanceof e?o=we(ce,s.schema.fields.map((t,e)=>ce.new(t,s.getChildAt(e))),n,o).length:s instanceof ce&&(n[o++]=s);return n})(t,e,[],0);function we(t,e,r,n){let i,s=n,o=-1,a=e.length;for(;++o<a;)he(i=e[o])?s=we(t,i,r,s).length:i instanceof t&&(r[s++]=i);return r}const ge=(t,[e,r],n)=>(t[0][n]=e,t[1][n]=r,t);function _e(t,e){let r,n;switch(n=t.length){case 0:return e;case 1:if(r=e[0],!t[0])return e;if(he(t[0]))return _e(t[0],e);t[0]instanceof Yt||t[0]instanceof p||t[0]instanceof G||([r,t]=Object.entries(t[0]).reduce(ge,e));break;default:he(r=t[n-1])?t=he(t[0])?t[0]:t.slice(0,n-1):(t=he(t[0])?t[0]:t,r=[])}let i,s,o=-1,a=-1,u=-1,c=t.length,[l,h]=e;for(;++u<c;)(s=t[u])instanceof ce&&(h[++a]=s)?l[++o]=s.field.clone(r[u],s.type,s.nullCount>0):(({[u]:i=u}=r),s instanceof G&&(h[++a]=s)?l[++o]=Ie.new(i,s):s&&s.type&&(h[++a]=s)&&(s instanceof Yt&&(h[a]=s=p.new(s)),l[++o]=Ie.new(i,s.type,s.nullCount>0)));return e}class ve{constructor(t=[],e,r,n){this.fields=t||[],this.metadata=e||new Map,r&&n||({dictionaries:r,dictionaryFields:n}=Be(t,r||new Map,n||new Map)),this.dictionaries=r,this.dictionaryFields=n}static from(...t){return ve.new(t[0],t[1])}static new(...t){return new ve(pe(t)[0])}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}compareTo(t){return K.compareSchemas(this,t)}select(...t){const e=t.reduce((t,e)=>(t[e]=!0)&&t,Object.create(null));return new ve(this.fields.filter(t=>e[t.name]),this.metadata)}selectAt(...t){return new ve(t.map(t=>this.fields[t]).filter(Boolean),this.metadata)}assign(...t){const e=t[0]instanceof ve?t[0]:new ve(de(Ie,t)),r=[...this.fields],n=this.dictionaryFields,i=Ae(Ae(new Map,this.metadata),e.metadata),s=e.fields.filter(t=>{const e=r.findIndex(e=>e.name===t.name);return!~e||(r[e]=t.clone({metadata:Ae(Ae(new Map,r[e].metadata),t.metadata)}))&&!1}),{dictionaries:o,dictionaryFields:a}=Be(s,new Map,new Map),u=[...a].map(([t,e])=>[t,[...n.get(t)||[],...e.map(t=>s[s.findIndex(e=>t.name===e.name)]=t.clone())]]);return new ve([...r,...s],i,new Map([...this.dictionaries,...o]),new Map([...n,...u]))}}class Ie{constructor(t,e,r=!1,n){this.name=t,this.type=e,this.nullable=r,this.metadata=n||new Map}static new(...t){let[e,r,n,i]=t;return t[0]&&"object"==typeof t[0]&&(({name:e}=t[0]),void 0===r&&(r=t[0].type),void 0===n&&(n=t[0].nullable),void 0===i&&(i=t[0].metadata)),new Ie(`${e}`,r,n,i)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}compareTo(t){return K.compareField(this,t)}clone(...t){let[e,r,n,i]=t;return t[0]&&"object"==typeof t[0]?({name:e=this.name,type:r=this.type,nullable:n=this.nullable,metadata:i=this.metadata}=t[0]):[e=this.name,r=this.type,n=this.nullable,i=this.metadata]=t,Ie.new(e,r,n,i)}}function Ae(t,e){return new Map([...t||new Map,...e||new Map])}function Be(t,e,r){for(let n=-1,i=t.length;++n<i;){const i=t[n],s=i.type;if(G.isDictionary(s))if(r.get(s.id)||r.set(s.id,[]),e.has(s.id)){if(e.get(s.id)!==s.dictionary)throw Error("Cannot create Schema containing two different dictionaries with the same Id")}else e.set(s.id,s.dictionary),r.get(s.id).push(i);s.children&&Be(s.children,e,r)}return{dictionaries:e,dictionaryFields:r}}ve.prototype.fields=null,ve.prototype.metadata=null,ve.prototype.dictionaries=null,ve.prototype.dictionaryFields=null,Ie.prototype.type=null,Ie.prototype.name=null,Ie.prototype.nullable=null,Ie.prototype.metadata=null;var Se=T.a.Long,Te=T.a.Builder,Oe=T.a.ByteBuffer,Ue=b.apache.arrow.flatbuf.Block,De=b.apache.arrow.flatbuf.Footer;class Fe{constructor(t,e=S.V4,r,n){this.schema=t,this.version=e,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}static decode(t){t=new Oe(Object(Pt.toUint8Array)(t));const e=De.getRootAsFooter(t),r=ve.decode(e.schema());return new xe(r,e)}static encode(t){const e=new Te,r=ve.encode(e,t.schema);De.startRecordBatchesVector(e,t.numRecordBatches),[...t.recordBatches()].slice().reverse().forEach(t=>Me.encode(e,t));const n=e.endVector();De.startDictionariesVector(e,t.numDictionaries),[...t.dictionaryBatches()].slice().reverse().forEach(t=>Me.encode(e,t));const i=e.endVector();return De.startFooter(e),De.addSchema(e,r),De.addVersion(e,S.V4),De.addRecordBatches(e,n),De.addDictionaries(e,i),De.finishFooterBuffer(e,De.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,e=-1,r=this.numRecordBatches;++e<r;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,r=this.numDictionaries;++e<r;)(t=this.getDictionaryBatch(e))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}}class xe extends Fe{constructor(t,e){super(t,e.version()),this._footer=e}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const e=this._footer.recordBatches(t);if(e)return Me.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t);if(e)return Me.decode(e)}return null}}class Me{static decode(t){return new Me(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:r}=e,n=new Se(e.offset,0),i=new Se(e.bodyLength,0);return Ue.createBlock(t,n,r,i)}constructor(t,e,r){this.metaDataLength=t,this.offset="number"==typeof r?r:r.low,this.bodyLength="number"==typeof e?e:e.low}}class Le extends p{constructor(t,e){super(),this._children=e,this.numChildren=t.childData.length,this._bindDataAccessors(this.data=t)}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 VectorName(){return`${y[this.typeId]}Vector`}get ArrayType(){return this.data.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(t,e=this._children){return p.new(t,e)}concat(...t){return oe.concat(this,...t)}slice(t,e){return ne(this,t,e,this._sliceInternal)}isValid(t){if(this.nullCount>0){const e=this.offset+t;return 0!==(this.nullBitmap[e>>3]&1<<e%8)}return!0}getChildAt(t){return t<0||t>=this.numChildren?null:(this._children||(this._children=[]))[t]||(this._children[t]=p.new(this.data.childData[t]))}toJSON(){return[...this]}_sliceInternal(t,e,r){return t.clone(t.data.slice(e,r-e))}_bindDataAccessors(t){}}Le.prototype[Symbol.isConcatSpreadable]=!0;class Ee extends Le{asUtf8(){return p.new(this.data.clone(new ht))}}class Ne extends Le{static from(t){let e=0,r=x(function*(){for(let r of t)e++,yield r}());return p.new(Yt.Bool(new dt,0,e,0,null,r))}}const Ve=65536;function Re(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}const je=8,Ce=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class ke{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,65535&this.buffer[1],this.buffer[0]>>>16,65535&this.buffer[0]]),r=new Uint32Array([t.buffer[1]>>>16,65535&t.buffer[1],t.buffer[0]>>>16,65535&t.buffer[0]]);let n=e[3]*r[3];this.buffer[0]=65535&n;let i=n>>>16;return i+=n=e[2]*r[3],i+=n=e[3]*r[2]>>>0,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0<n?Ve:0,this.buffer[1]+=i>>>16,this.buffer[1]+=e[1]*r[3]+e[2]*r[2]+e[3]*r[1],this.buffer[1]+=e[0]*r[3]+e[1]*r[2]+e[2]*r[1]+e[3]*r[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Re(this.buffer[1])} ${Re(this.buffer[0])}`}}class Pe extends ke{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return Pe.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return Pe.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const r=t.length;let n=new Pe(e);for(let i=0;i<r;){const e=je<r-i?je:r-i,s=new Pe(new Uint32Array([parseInt(t.substr(i,e),10),0])),o=new Pe(new Uint32Array([Ce[e],0]));n.times(o),n.plus(s),i+=e}return n}static convertArray(t){const e=new Uint32Array(2*t.length);for(let r=-1,n=t.length;++r<n;)Pe.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new Pe(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Pe(new Uint32Array(t.buffer)).plus(e)}}class ze extends ke{negate(){return this.buffer[0]=1+~this.buffer[0],this.buffer[1]=~this.buffer[1],0==this.buffer[0]&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){const e=this.buffer[1]<<0,r=t.buffer[1]<<0;return e<r||e===r&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return ze.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return ze.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const r=t.startsWith("-"),n=t.length;let i=new ze(e);for(let s=r?1:0;s<n;){const e=je<n-s?je:n-s,r=new ze(new Uint32Array([parseInt(t.substr(s,e),10),0])),o=new ze(new Uint32Array([Ce[e],0]));i.times(o),i.plus(r),s+=e}return r?i.negate():i}static convertArray(t){const e=new Uint32Array(2*t.length);for(let r=-1,n=t.length;++r<n;)ze.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new ze(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ze(new Uint32Array(t.buffer)).plus(e)}}class Ye{constructor(t){this.buffer=t}high(){return new ze(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new ze(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=1+~this.buffer[0],this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],0==this.buffer[0]&&++this.buffer[1],0==this.buffer[1]&&++this.buffer[2],0==this.buffer[2]&&++this.buffer[3],this}times(t){const e=new Pe(new Uint32Array([this.buffer[3],0])),r=new Pe(new Uint32Array([this.buffer[2],0])),n=new Pe(new Uint32Array([this.buffer[1],0])),i=new Pe(new Uint32Array([this.buffer[0],0])),s=new Pe(new Uint32Array([t.buffer[3],0])),o=new Pe(new Uint32Array([t.buffer[2],0])),a=new Pe(new Uint32Array([t.buffer[1],0])),u=new Pe(new Uint32Array([t.buffer[0],0]));let c=Pe.multiply(i,u);this.buffer[0]=c.low();let l=new Pe(new Uint32Array([c.high(),0]));return c=Pe.multiply(n,u),l.plus(c),c=Pe.multiply(i,a),l.plus(c),this.buffer[1]=l.low(),this.buffer[3]=l.lessThan(c)?1:0,this.buffer[2]=l.high(),new Pe(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Pe.multiply(r,u)).plus(Pe.multiply(n,a)).plus(Pe.multiply(i,o)),this.buffer[3]+=Pe.multiply(e,u).plus(Pe.multiply(r,a)).plus(Pe.multiply(n,o)).plus(Pe.multiply(i,s)).low(),this}plus(t){let e=new Uint32Array(4);return e[3]=this.buffer[3]+t.buffer[3]>>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]<this.buffer[0]>>>0&&++e[1],e[1]<this.buffer[1]>>>0&&++e[2],e[2]<this.buffer[2]>>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Re(this.buffer[3])} ${Re(this.buffer[2])} ${Re(this.buffer[1])} ${Re(this.buffer[0])}`}static multiply(t,e){return new Ye(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ye(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Ye.fromString("string"==typeof t?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Ye.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const r=t.startsWith("-"),n=t.length;let i=new Ye(e);for(let s=r?1:0;s<n;){const e=je<n-s?je:n-s,r=new Ye(new Uint32Array([parseInt(t.substr(s,e),10),0,0,0])),o=new Ye(new Uint32Array([Ce[e],0,0,0]));i.times(o),i.plus(r),s+=e}return r?i.negate():i}static convertArray(t){const e=new Uint32Array(4*t.length);for(let r=-1,n=t.length;++r<n;)Ye.from(t[r],new Uint32Array(e.buffer,e.byteOffset+16*r,4));return e}}class $e extends Le{static from(t,e=w.MILLISECOND){switch(e){case w.DAY:{const e=Int32Array.from(t.map(t=>t.valueOf()/864e5));return p.new(Yt.Date(new yt,0,t.length,0,null,e))}case w.MILLISECOND:{const e=ze.convertArray(t.map(t=>t.valueOf()));return p.new(Yt.Date(new bt,0,t.length,0,null,e))}}throw new TypeError(`Unrecognized date unit "${w[e]}"`)}}class We extends $e{}class He extends $e{}class Je extends Le{}class Ke extends Le{constructor(t){super(t),this.indices=p.new(t.clone(this.type.indices))}static from(t,e,r){const n=new Ct(t.type,e,null,null,t);return p.new(Yt.Dictionary(n,0,r.length,0,null,r))}get dictionary(){return this.data.type.dictionaryVector}reverseLookup(t){return this.dictionary.indexOf(t)}getKey(t){return this.indices.get(t)}getValue(t){return this.dictionary.get(t)}setKey(t,e){return this.indices.set(t,e)}setValue(t,e){return this.dictionary.set(t,e)}}Ke.prototype.indices=null;class Ge extends Le{}class Ze extends Le{}class qe extends Le{static from(t){let e=null;switch(this){case Xe:t=Object(Pt.toFloat16Array)(t);break;case Qe:t=Object(Pt.toFloat32Array)(t);break;case tr:t=Object(Pt.toFloat64Array)(t)}switch(t.constructor){case Uint16Array:e=new at;break;case Float32Array:e=new ut;break;case Float64Array:e=new ct}return null!==e?p.new(Yt.Float(e,0,t.length,0,null,t)):(()=>{throw new TypeError("Unrecognized FloatVector input")})()}}class Xe extends qe{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}}class Qe extends qe{}class tr extends qe{}class er extends Le{}class rr extends er{}class nr extends er{}class ir extends Le{static from(t,e){let r=0,n=null;switch(this){case sr:t=Object(Pt.toInt8Array)(t),e=!1;break;case or:t=Object(Pt.toInt16Array)(t),e=!1;break;case ar:t=Object(Pt.toInt32Array)(t),e=!1;break;case ur:t=Object(Pt.toInt32Array)(t),e=!0;break;case cr:t=Object(Pt.toUint8Array)(t),e=!1;break;case lr:t=Object(Pt.toUint16Array)(t),e=!1;break;case hr:t=Object(Pt.toUint32Array)(t),e=!1;break;case dr:t=Object(Pt.toUint32Array)(t),e=!0}if(!0===e)r=.5*t.length,n=t instanceof Int32Array?new et:new st;else switch(r=t.length,t.constructor){case Int8Array:n=new X;break;case Int16Array:n=new Q;break;case Int32Array:n=new tt;break;case Uint8Array:n=new rt;break;case Uint16Array:n=new nt;break;case Uint32Array:n=new it}return null!==n?p.new(Yt.Int(n,0,r,0,null,t)):(()=>{throw new TypeError("Unrecognized IntVector input")})()}}class sr extends ir{}class or extends ir{}class ar extends ir{}class ur extends ir{toBigInt64Array(){return Object(Pt.toBigInt64Array)(this.values)}}class cr extends ir{}class lr extends ir{}class hr extends ir{}class dr extends ir{toBigUint64Array(){return Object(Pt.toBigUint64Array)(this.values)}}class fr extends Le{}class pr extends Le{asStruct(){return p.new(this.data.clone(new xt(this.type.children)))}get rowProxy(){return this._rowProxy||(this._rowProxy=Qt.new(this,this.type.children||[],!0))}}class yr extends Le{}class br extends Le{asMap(t=!1){return p.new(this.data.clone(new Rt(this.type.children,t)))}get rowProxy(){return this._rowProxy||(this._rowProxy=Qt.new(this,this.type.children||[],!1))}}class mr extends Le{}class wr extends mr{}class gr extends mr{}class _r extends mr{}class vr extends mr{}class Ir extends Le{}class Ar extends Ir{}class Br extends Ir{}class Sr extends Ir{}class Tr extends Ir{}class Or extends Le{get typeIdToChildIndex(){return this.type.typeIdToChildIndex}}class Ur extends Or{get valueOffsets(){return this.data.valueOffsets}}class Dr extends Or{}var Fr=r(4);class xr extends Le{static from(t){const e=t.length,r=Object(Fr.b)(t.join("")),n=t.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(t.length+1));return p.new(Yt.Utf8(new ht,0,e,0,null,n,r))}asBinary(){return p.new(this.data.clone(new lt))}}function Mr(t,...e){const r=this.TypedArray,n=t instanceof r?t:new r(t,...e);return Object.setPrototypeOf(n,this.constructor.prototype)}function Lr(...t){return Mr.apply(this,t)}function Er(...t){return Mr.apply(this,t)}function Nr(...t){return Mr.apply(this,t)}function Vr({buffer:t,byteOffset:e,length:r,signed:n}){let i,s,o=new Int32Array(t,e,r),a=0,u=0,c=o.length;for(;u<c;)s=o[u++],i=o[u++],a+=n?(s>>>0)+i*u**32:(s>>>0)+(i>>>0)*u**32;return a}let Rr,jr;function Cr(t){let e="",r=new Uint32Array(2),n=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),s=-1,o=n.length-1;do{for(r[0]=n[s=0];s<o;)n[s++]=r[1]=r[0]/10,r[0]=(r[0]-10*r[1]<<16)+n[s];n[s]=r[1]=r[0]/10,r[0]=r[0]-10*r[1],e=`${r[0]}${e}`}while(i[0]||i[1]||i[2]||i[3]);return e||"0"}Mr.prototype.toJSON=function(){return`"${Rr(this)}"`},Mr.prototype.valueOf=function(){return Vr(this)},Mr.prototype.toString=function(){return Rr(this)},Mr.prototype[Symbol.toPrimitive]=function(t){switch(t){case"number":return Vr(this);case"string":return Rr(this);case"default":return jr(this)}return Rr(this)},Object.setPrototypeOf(Lr.prototype,Int32Array.prototype),Object.setPrototypeOf(Er.prototype,Uint32Array.prototype),Object.setPrototypeOf(Nr.prototype,Uint32Array.prototype),Lr.prototype=Object.create(Lr.prototype),Lr.prototype=Object.assign(Lr.prototype,Mr.prototype,{signed:!0,constructor:Lr,TypedArray:Int32Array,BigIntArray:te.b}),Er.prototype=Object.create(Er.prototype),Er.prototype=Object.assign(Er.prototype,Mr.prototype,{signed:!1,constructor:Er,TypedArray:Uint32Array,BigIntArray:te.d}),Nr.prototype=Object.create(Nr.prototype),Nr.prototype=Object.assign(Nr.prototype,Mr.prototype,{signed:!0,constructor:Nr,TypedArray:Uint32Array,BigIntArray:te.d}),te.c?(jr=(t=>8===t.byteLength?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:Cr(t)),Rr=(t=>8===t.byteLength?`${new t.BigIntArray(t.buffer,t.byteOffset,1)[0]}`:Cr(t))):jr=Rr=Cr;class kr{constructor(t,e){return kr.new(t,e)}static new(t,e){switch(e){case!0:return new Lr(t);case!1:return new Er(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case te.b:return new Lr(t)}return new Er(t)}static signed(t){return new Lr(t)}static unsigned(t){return new Er(t)}static decimal(t){return new Nr(t)}}class Pr extends V{}const zr=(t,e)=>4294967296*t[e+1]+(t[e]>>>0),Yr=t=>new Date(t),$r=(t,e,r)=>{const{[r]:n,[r+1]:i}=e;return null!=n&&null!=i?t.subarray(n,i):null},Wr=({values:t},e)=>((t,e)=>Yr(((t,e)=>864e5*t[e])(t,e)))(t,e),Hr=({values:t},e)=>((t,e)=>Yr(zr(t,e)))(t,2*e),Jr=({stride:t,values:e},r)=>e[t*r],Kr=({stride:t,values:e},r)=>(e[t*r]-32767)/32767,Gr=({stride:t,values:e,type:r},n)=>kr.new(e.subarray(t*n,t*(n+1)),r.isSigned),Zr=({values:t},e)=>1e3*zr(t,2*e),qr=({values:t},e)=>zr(t,2*e),Xr=({values:t},e)=>((t,e)=>t[e+1]/1e3*4294967296+(t[e]>>>0)/1e3)(t,2*e),Qr=({values:t},e)=>((t,e)=>t[e+1]/1e6*4294967296+(t[e]>>>0)/1e6)(t,2*e),tn=({values:t,stride:e},r)=>t[e*r],en=({values:t,stride:e},r)=>t[e*r],rn=({values:t},e)=>kr.signed(t.subarray(2*e,2*(e+1))),nn=({values:t},e)=>kr.signed(t.subarray(2*e,2*(e+1))),sn=(t,e)=>t.rowProxy.bind(e),on=(t,e)=>{const{typeIds:r,type:{typeIdToChildIndex:n}}=t,i=t.getChildAt(n[r[e]]);return i?i.get(t.valueOffsets[e]):null},an=(t,e)=>{const{typeIds:r,type:{typeIdToChildIndex:n}}=t,i=t.getChildAt(n[r[e]]);return i?i.get(e):null},un=({values:t},e)=>t.subarray(2*e,2*(e+1)),cn=({values:t},e)=>{const r=t[e],n=new Int32Array(2);return n[0]=r/12|0,n[1]=r%12|0,n};Pr.prototype.visitNull=((t,e)=>null),Pr.prototype.visitBool=(({offset:t,values:e},r)=>{const n=t+r;return 0!=(e[n>>3]&1<<n%8)}),Pr.prototype.visitInt=((t,e)=>t.type.bitWidth<64?Jr(t,e):Gr(t,e)),Pr.prototype.visitInt8=Jr,Pr.prototype.visitInt16=Jr,Pr.prototype.visitInt32=Jr,Pr.prototype.visitInt64=Gr,Pr.prototype.visitUint8=Jr,Pr.prototype.visitUint16=Jr,Pr.prototype.visitUint32=Jr,Pr.prototype.visitUint64=Gr,Pr.prototype.visitFloat=((t,e)=>t.type.precision!==_.HALF?Jr(t,e):Kr(t,e)),Pr.prototype.visitFloat16=Kr,Pr.prototype.visitFloat32=Jr,Pr.prototype.visitFloat64=Jr,Pr.prototype.visitUtf8=(({values:t,valueOffsets:e},r)=>{const n=$r(t,e,r);return null!==n?Object(Fr.a)(n):null}),Pr.prototype.visitBinary=(({values:t,valueOffsets:e},r)=>$r(t,e,r)),Pr.prototype.visitFixedSizeBinary=(({stride:t,values:e},r)=>e.subarray(t*r,t*(r+1))),Pr.prototype.visitDate=((t,e)=>t.type.unit===w.DAY?Wr(t,e):Hr(t,e)),Pr.prototype.visitDateDay=Wr,Pr.prototype.visitDateMillisecond=Hr,Pr.prototype.visitTimestamp=((t,e)=>{switch(t.type.unit){case g.SECOND:return Zr(t,e);case g.MILLISECOND:return qr(t,e);case g.MICROSECOND:return Xr(t,e);case g.NANOSECOND:return Qr(t,e)}}),Pr.prototype.visitTimestampSecond=Zr,Pr.prototype.visitTimestampMillisecond=qr,Pr.prototype.visitTimestampMicrosecond=Xr,Pr.prototype.visitTimestampNanosecond=Qr,Pr.prototype.visitTime=((t,e)=>{switch(t.type.unit){case g.SECOND:return tn(t,e);case g.MILLISECOND:return en(t,e);case g.MICROSECOND:return rn(t,e);case g.NANOSECOND:return nn(t,e)}}),Pr.prototype.visitTimeSecond=tn,Pr.prototype.visitTimeMillisecond=en,Pr.prototype.visitTimeMicrosecond=rn,Pr.prototype.visitTimeNanosecond=nn,Pr.prototype.visitDecimal=(({values:t},e)=>kr.decimal(t.subarray(4*e,4*(e+1)))),Pr.prototype.visitList=((t,e)=>{const r=t.getChildAt(0),{valueOffsets:n,stride:i}=t;return r.slice(n[e*i],n[e*i+1])}),Pr.prototype.visitStruct=sn,Pr.prototype.visitUnion=((t,e)=>t.type.mode===v.Dense?on(t,e):an(t,e)),Pr.prototype.visitDenseUnion=on,Pr.prototype.visitSparseUnion=an,Pr.prototype.visitDictionary=((t,e)=>t.getValue(t.getKey(e))),Pr.prototype.visitInterval=((t,e)=>t.type.unit===A.DAY_TIME?un(t,e):cn(t,e)),Pr.prototype.visitIntervalDayTime=un,Pr.prototype.visitIntervalYearMonth=cn,Pr.prototype.visitFixedSizeList=((t,e)=>{const r=t.getChildAt(0),{stride:n}=t;return r.slice(e*n,(e+1)*n)}),Pr.prototype.visitMap=sn;const ln=new Pr;class hn extends V{}const dn=(t,e,r)=>{t[e]=r%4294967296|0,t[e+1]=r/4294967296|0},fn=(t,e,r,n)=>{const{[r]:i,[r+1]:s}=e;null!=i&&null!=s&&t.set(n.subarray(0,s-i),i)},pn=({values:t},e,r)=>{((t,e,r)=>{t[e]=r/864e5|0})(t,e,r.valueOf())},yn=({values:t},e,r)=>{dn(t,2*e,r.valueOf())},bn=({stride:t,values:e},r,n)=>{e[t*r]=n},mn=({stride:t,values:e},r,n)=>{e[t*r]=32767*n+32767},wn=({stride:t,values:e},r,n)=>{e.set(n.subarray(0,t),t*r)},gn=({values:t},e,r)=>dn(t,2*e,r/1e3),_n=({values:t},e,r)=>dn(t,2*e,r),vn=({values:t},e,r)=>((t,e,r)=>{t[e]=1e3*r%4294967296|0,t[e+1]=1e3*r/4294967296|0})(t,2*e,r),In=({values:t},e,r)=>((t,e,r)=>{t[e]=1e6*r%4294967296|0,t[e+1]=1e6*r/4294967296|0})(t,2*e,r),An=({values:t,stride:e},r,n)=>{t[e*r]=n},Bn=({values:t,stride:e},r,n)=>{t[e*r]=n},Sn=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},Tn=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},On=(t,e,r)=>{t.type.children.forEach(({name:n},i)=>{const s=t.getChildAt(i);s&&s.set(e,r[n])})},Un=(t,e,r)=>{const{typeIds:n,type:{typeIdToChildIndex:i}}=t,s=t.getChildAt(i[n[e]]);s&&s.set(t.valueOffsets[e],r)},Dn=(t,e,r)=>{const{typeIds:n,type:{typeIdToChildIndex:i}}=t,s=t.getChildAt(i[n[e]]);s&&s.set(e,r)},Fn=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},xn=({values:t},e,r)=>{t[e]=12*r[0]+r[1]%12};hn.prototype.visitBool=(({offset:t,values:e},r,n)=>{const i=t+r;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)}),hn.prototype.visitInt=((t,e,r)=>{t.type.bitWidth<64?bn(t,e,r):wn(t,e,r)}),hn.prototype.visitInt8=bn,hn.prototype.visitInt16=bn,hn.prototype.visitInt32=bn,hn.prototype.visitInt64=wn,hn.prototype.visitUint8=bn,hn.prototype.visitUint16=bn,hn.prototype.visitUint32=bn,hn.prototype.visitUint64=wn,hn.prototype.visitFloat=((t,e,r)=>{t.type.precision!==_.HALF?bn(t,e,r):mn(t,e,r)}),hn.prototype.visitFloat16=mn,hn.prototype.visitFloat32=bn,hn.prototype.visitFloat64=bn,hn.prototype.visitUtf8=(({values:t,valueOffsets:e},r,n)=>{fn(t,e,r,Object(Fr.b)(n))}),hn.prototype.visitBinary=(({values:t,valueOffsets:e},r,n)=>fn(t,e,r,n)),hn.prototype.visitFixedSizeBinary=(({stride:t,values:e},r,n)=>{e.set(n.subarray(0,t),t*r)}),hn.prototype.visitDate=((t,e,r)=>{t.type.unit===w.DAY?pn(t,e,r):yn(t,e,r)}),hn.prototype.visitDateDay=pn,hn.prototype.visitDateMillisecond=yn,hn.prototype.visitTimestamp=((t,e,r)=>{switch(t.type.unit){case g.SECOND:return gn(t,e,r);case g.MILLISECOND:return _n(t,e,r);case g.MICROSECOND:return vn(t,e,r);case g.NANOSECOND:return In(t,e,r)}}),hn.prototype.visitTimestampSecond=gn,hn.prototype.visitTimestampMillisecond=_n,hn.prototype.visitTimestampMicrosecond=vn,hn.prototype.visitTimestampNanosecond=In,hn.prototype.visitTime=((t,e,r)=>{switch(t.type.unit){case g.SECOND:return An(t,e,r);case g.MILLISECOND:return Bn(t,e,r);case g.MICROSECOND:return Sn(t,e,r);case g.NANOSECOND:return Tn(t,e,r)}}),hn.prototype.visitTimeSecond=An,hn.prototype.visitTimeMillisecond=Bn,hn.prototype.visitTimeMicrosecond=Sn,hn.prototype.visitTimeNanosecond=Tn,hn.prototype.visitDecimal=(({values:t},e,r)=>{t.set(r.subarray(0,4),4*e)}),hn.prototype.visitList=((t,e,r)=>{const n=t.getChildAt(0),{valueOffsets:i,stride:s}=t;let o=-1,a=i[e*s],u=Math.min(r.length,i[e*s+1]-a);for(;a<u;)n.set(a++,r.get(++o))}),hn.prototype.visitStruct=On,hn.prototype.visitUnion=((t,e,r)=>{t.type.mode===v.Dense?Un(t,e,r):Dn(t,e,r)}),hn.prototype.visitDenseUnion=Un,hn.prototype.visitSparseUnion=Dn,hn.prototype.visitDictionary=((t,e,r)=>{const n=t.getKey(e);null!==n&&t.setValue(n,r)}),hn.prototype.visitInterval=((t,e,r)=>{t.type.unit===A.DAY_TIME?Fn(t,e,r):xn(t,e,r)}),hn.prototype.visitIntervalDayTime=Fn,hn.prototype.visitIntervalYearMonth=xn,hn.prototype.visitFixedSizeList=((t,e,r)=>{const n=t.getChildAt(0),{stride:i}=t;for(let s=-1,o=e*i;++s<i;)n.set(o+s,r.get(s))}),hn.prototype.visitMap=On;const Mn=new hn;class Ln extends V{}function En(t,e,r){if(void 0===e)return-1;if(null===e)return function(t,e){const{nullBitmap:r}=t;if(!r||t.nullCount<=0)return-1;let n=0;for(const i of M(r,t.data.offset+(e||0),t.length,r,O)){if(!i)return n;++n}return-1}(t,r);const n=se(e);for(let i=(r||0)-1,s=t.length;++i<s;)if(n(t.get(i)))return i;return-1}function Nn(t,e,r){const n=se(e);for(let i=(r||0)-1,s=t.length;++i<s;)if(n(t.get(i)))return i;return-1}Ln.prototype.visitNull=function(t,e){return null===e&&t.length>0?0:-1},Ln.prototype.visitBool=En,Ln.prototype.visitInt=En,Ln.prototype.visitInt8=En,Ln.prototype.visitInt16=En,Ln.prototype.visitInt32=En,Ln.prototype.visitInt64=En,Ln.prototype.visitUint8=En,Ln.prototype.visitUint16=En,Ln.prototype.visitUint32=En,Ln.prototype.visitUint64=En,Ln.prototype.visitFloat=En,Ln.prototype.visitFloat16=En,Ln.prototype.visitFloat32=En,Ln.prototype.visitFloat64=En,Ln.prototype.visitUtf8=En,Ln.prototype.visitBinary=En,Ln.prototype.visitFixedSizeBinary=En,Ln.prototype.visitDate=En,Ln.prototype.visitDateDay=En,Ln.prototype.visitDateMillisecond=En,Ln.prototype.visitTimestamp=En,Ln.prototype.visitTimestampSecond=En,Ln.prototype.visitTimestampMillisecond=En,Ln.prototype.visitTimestampMicrosecond=En,Ln.prototype.visitTimestampNanosecond=En,Ln.prototype.visitTime=En,Ln.prototype.visitTimeSecond=En,Ln.prototype.visitTimeMillisecond=En,Ln.prototype.visitTimeMicrosecond=En,Ln.prototype.visitTimeNanosecond=En,Ln.prototype.visitDecimal=En,Ln.prototype.visitList=En,Ln.prototype.visitStruct=En,Ln.prototype.visitUnion=En,Ln.prototype.visitDenseUnion=Nn,Ln.prototype.visitSparseUnion=Nn,Ln.prototype.visitDictionary=En,Ln.prototype.visitInterval=En,Ln.prototype.visitIntervalDayTime=En,Ln.prototype.visitIntervalYearMonth=En,Ln.prototype.visitFixedSizeList=En,Ln.prototype.visitMap=En;const Vn=new Ln;class Rn extends V{}function jn(t){if(t.nullCount>0)return function(t){const e=ln.getVisitFn(t);return M(t.nullBitmap,t.offset,t.length,t,(t,r,n,i)=>0!=(n&1<<i)?e(t,r):null)}(t);const{type:e,typeId:r,length:n}=t;return 1===t.stride&&(r===y.Timestamp||r===y.Int&&64!==e.bitWidth||r===y.Time&&64!==e.bitWidth||r===y.Float&&e.precision>0)?t.values.subarray(0,n)[Symbol.iterator]():function*(e){for(let r=-1;++r<n;)yield e(t,r)}(ln.getVisitFn(t))}Rn.prototype.visitNull=jn,Rn.prototype.visitBool=jn,Rn.prototype.visitInt=jn,Rn.prototype.visitInt8=jn,Rn.prototype.visitInt16=jn,Rn.prototype.visitInt32=jn,Rn.prototype.visitInt64=jn,Rn.prototype.visitUint8=jn,Rn.prototype.visitUint16=jn,Rn.prototype.visitUint32=jn,Rn.prototype.visitUint64=jn,Rn.prototype.visitFloat=jn,Rn.prototype.visitFloat16=jn,Rn.prototype.visitFloat32=jn,Rn.prototype.visitFloat64=jn,Rn.prototype.visitUtf8=jn,Rn.prototype.visitBinary=jn,Rn.prototype.visitFixedSizeBinary=jn,Rn.prototype.visitDate=jn,Rn.prototype.visitDateDay=jn,Rn.prototype.visitDateMillisecond=jn,Rn.prototype.visitTimestamp=jn,Rn.prototype.visitTimestampSecond=jn,Rn.prototype.visitTimestampMillisecond=jn,Rn.prototype.visitTimestampMicrosecond=jn,Rn.prototype.visitTimestampNanosecond=jn,Rn.prototype.visitTime=jn,Rn.prototype.visitTimeSecond=jn,Rn.prototype.visitTimeMillisecond=jn,Rn.prototype.visitTimeMicrosecond=jn,Rn.prototype.visitTimeNanosecond=jn,Rn.prototype.visitDecimal=jn,Rn.prototype.visitList=jn,Rn.prototype.visitStruct=jn,Rn.prototype.visitUnion=jn,Rn.prototype.visitDenseUnion=jn,Rn.prototype.visitSparseUnion=jn,Rn.prototype.visitDictionary=jn,Rn.prototype.visitInterval=jn,Rn.prototype.visitIntervalDayTime=jn,Rn.prototype.visitIntervalYearMonth=jn,Rn.prototype.visitFixedSizeList=jn,Rn.prototype.visitMap=jn;const Cn=new Rn;class kn extends V{}function Pn(t){const{type:e,length:r,stride:n}=t;switch(e.typeId){case y.Int:case y.Float:case y.Decimal:case y.Time:case y.Timestamp:return t.values.subarray(0,r*n)}return[...Cn.visit(t)]}kn.prototype.visitNull=Pn,kn.prototype.visitBool=Pn,kn.prototype.visitInt=Pn,kn.prototype.visitInt8=Pn,kn.prototype.visitInt16=Pn,kn.prototype.visitInt32=Pn,kn.prototype.visitInt64=Pn,kn.prototype.visitUint8=Pn,kn.prototype.visitUint16=Pn,kn.prototype.visitUint32=Pn,kn.prototype.visitUint64=Pn,kn.prototype.visitFloat=Pn,kn.prototype.visitFloat16=Pn,kn.prototype.visitFloat32=Pn,kn.prototype.visitFloat64=Pn,kn.prototype.visitUtf8=Pn,kn.prototype.visitBinary=Pn,kn.prototype.visitFixedSizeBinary=Pn,kn.prototype.visitDate=Pn,kn.prototype.visitDateDay=Pn,kn.prototype.visitDateMillisecond=Pn,kn.prototype.visitTimestamp=Pn,kn.prototype.visitTimestampSecond=Pn,kn.prototype.visitTimestampMillisecond=Pn,kn.prototype.visitTimestampMicrosecond=Pn,kn.prototype.visitTimestampNanosecond=Pn,kn.prototype.visitTime=Pn,kn.prototype.visitTimeSecond=Pn,kn.prototype.visitTimeMillisecond=Pn,kn.prototype.visitTimeMicrosecond=Pn,kn.prototype.visitTimeNanosecond=Pn,kn.prototype.visitDecimal=Pn,kn.prototype.visitList=Pn,kn.prototype.visitStruct=Pn,kn.prototype.visitUnion=Pn,kn.prototype.visitDenseUnion=Pn,kn.prototype.visitSparseUnion=Pn,kn.prototype.visitDictionary=Pn,kn.prototype.visitInterval=Pn,kn.prototype.visitIntervalDayTime=Pn,kn.prototype.visitIntervalYearMonth=Pn,kn.prototype.visitFixedSizeList=Pn,kn.prototype.visitMap=Pn;const zn=new kn,Yn=(t,e)=>t+e,$n=t=>`Cannot compute the byte width of variable-width column ${t}`;const Wn=new class extends V{visitNull(t){return 0}visitInt(t){return t.bitWidth/8}visitFloat(t){return t.ArrayType.BYTES_PER_ELEMENT}visitBinary(t){throw Error($n(t))}visitUtf8(t){throw Error($n(t))}visitBool(t){return 1/8}visitDecimal(t){return 16}visitDate(t){return 4*(t.unit+1)}visitTime(t){return t.bitWidth/8}visitTimestamp(t){return t.unit===g.SECOND?4:8}visitInterval(t){return 4*(t.unit+1)}visitList(t){throw Error($n(t))}visitStruct(t){return this.visitFields(t.children).reduce(Yn,0)}visitUnion(t){return this.visitFields(t.children).reduce(Yn,0)}visitFixedSizeBinary(t){return t.byteWidth}visitFixedSizeList(t){return t.listSize*this.visitFields(t.children).reduce(Yn,0)}visitMap(t){return this.visitFields(t.children).reduce(Yn,0)}visitDictionary(t){return this.visit(t.indices)}visitFields(t){return(t||[]).map(t=>this.visit(t.type))}visitSchema(t){return this.visitFields(t.fields).reduce(Yn,0)}};const Hn=new class extends V{visitNull(){return yr}visitBool(){return Ne}visitInt(){return ir}visitInt8(){return sr}visitInt16(){return or}visitInt32(){return ar}visitInt64(){return ur}visitUint8(){return cr}visitUint16(){return lr}visitUint32(){return hr}visitUint64(){return dr}visitFloat(){return qe}visitFloat16(){return Xe}visitFloat32(){return Qe}visitFloat64(){return tr}visitUtf8(){return xr}visitBinary(){return Ee}visitFixedSizeBinary(){return Ge}visitDate(){return $e}visitDateDay(){return We}visitDateMillisecond(){return He}visitTimestamp(){return mr}visitTimestampSecond(){return wr}visitTimestampMillisecond(){return gr}visitTimestampMicrosecond(){return _r}visitTimestampNanosecond(){return vr}visitTime(){return Ir}visitTimeSecond(){return Ar}visitTimeMillisecond(){return Br}visitTimeMicrosecond(){return Sr}visitTimeNanosecond(){return Tr}visitDecimal(){return Je}visitList(){return fr}visitStruct(){return br}visitUnion(){return Or}visitDenseUnion(){return Ur}visitSparseUnion(){return Dr}visitDictionary(){return Ke}visitInterval(){return er}visitIntervalDayTime(){return rr}visitIntervalYearMonth(){return nr}visitFixedSizeList(){return Ze}visitMap(){return pr}};function Jn(t){return function(){return t(this)}}function Kn(t){return function(e,r){return t(this,e,r)}}p.new=function(t,...e){return new(Hn.getVisitFn(t)())(t,...e)},Le.prototype.get=function(t){return ln.visit(this,t)},Le.prototype.set=function(t,e){return Mn.visit(this,t,e)},Le.prototype.indexOf=function(t,e){return Vn.visit(this,t,e)},Le.prototype.toArray=function(){return zn.visit(this)},Le.prototype.getByteWidth=function(){return Wn.visit(this.type)},Le.prototype[Symbol.iterator]=function(){return Cn.visit(this)},Le.prototype._bindDataAccessors=function(){const t=this.nullBitmap;t&&t.byteLength>0&&(this.get=(e=this.get,function(t){return this.isValid(t)?e.call(this,t):null}),this.set=function(t){return function(e,r){D(this.nullBitmap,this.offset+e,!(null==r))&&t.call(this,e,r)}}(this.set));var e},Object.keys(y).map(t=>y[t]).filter(t=>"number"==typeof t).filter(t=>t!==y.NONE).forEach(t=>{const e=Hn.visit(t);e.prototype.get=function(t){return function(e){return t(this,e)}}(ln.getVisitFn(t)),e.prototype.set=Kn(Mn.getVisitFn(t)),e.prototype.indexOf=Kn(Vn.getVisitFn(t)),e.prototype.toArray=Jn(zn.getVisitFn(t)),e.prototype.getByteWidth=function(t){return function(){return t(this.type)}}(Wn.getVisitFn(t)),e.prototype[Symbol.iterator]=Jn(Cn.getVisitFn(t))});const Gn=new Uint8Array(0),Zn=t=>[Gn,Gn,new Uint8Array(t),Gn];function qn(t,e){return function(t,e){const r=[...t.fields],n=[],i={numBatches:e.reduce((t,e)=>Math.max(t,e.length),0)};let s,o=0,a=0,u=-1,c=e.length,l=[];for(;i.numBatches-- >0;){for(a=1/0,u=-1;++u<c;)l[u]=s=e[u].shift(),a=Math.min(a,s?s.length:a);isFinite(a)&&(l=Xn(r,a,l,e,i),a>0&&(n[o++]=[a,l.slice()]))}return[t=new ve(r,t.metadata),n.map(e=>new Ms(t,...e))]}(t,e.map(t=>t instanceof oe?t.chunks.map(t=>t.data):[t.data]))}function Xn(t,e,r,n,i){let s,o,a=0,u=-1,c=n.length;const l=(e+63&-64)>>3;for(;++u<c;)(s=r[u])&&(a=s.length)>=e?a===e?r[u]=s:(r[u]=s.slice(0,e),s=s.slice(e,a-e),i.numBatches=Math.max(i.numBatches,n[u].unshift(s))):((o=t[u]).nullable||(t[u]=o.clone({nullable:!0})),r[u]=s?s._changeLengthAndBackfillNullBitmap(e):Yt.new(o.type,0,e,e,Zn(l)));return r}var Qn=T.a.Long,ti=u.apache.arrow.flatbuf.Null,ei=u.apache.arrow.flatbuf.Int,ri=u.apache.arrow.flatbuf.FloatingPoint,ni=u.apache.arrow.flatbuf.Binary,ii=u.apache.arrow.flatbuf.Bool,si=u.apache.arrow.flatbuf.Utf8,oi=u.apache.arrow.flatbuf.Decimal,ai=u.apache.arrow.flatbuf.Date,ui=u.apache.arrow.flatbuf.Time,ci=u.apache.arrow.flatbuf.Timestamp,li=u.apache.arrow.flatbuf.Interval,hi=u.apache.arrow.flatbuf.List,di=u.apache.arrow.flatbuf.Struct_,fi=u.apache.arrow.flatbuf.Union,pi=u.apache.arrow.flatbuf.DictionaryEncoding,yi=u.apache.arrow.flatbuf.FixedSizeBinary,bi=u.apache.arrow.flatbuf.FixedSizeList,mi=u.apache.arrow.flatbuf.Map;const wi=new class extends V{visit(t,e){return null==t||null==e?void 0:super.visit(t,e)}visitNull(t,e){return ti.startNull(e),ti.endNull(e)}visitInt(t,e){return ei.startInt(e),ei.addBitWidth(e,t.bitWidth),ei.addIsSigned(e,t.isSigned),ei.endInt(e)}visitFloat(t,e){return ri.startFloatingPoint(e),ri.addPrecision(e,t.precision),ri.endFloatingPoint(e)}visitBinary(t,e){return ni.startBinary(e),ni.endBinary(e)}visitBool(t,e){return ii.startBool(e),ii.endBool(e)}visitUtf8(t,e){return si.startUtf8(e),si.endUtf8(e)}visitDecimal(t,e){return oi.startDecimal(e),oi.addScale(e,t.scale),oi.addPrecision(e,t.precision),oi.endDecimal(e)}visitDate(t,e){return ai.startDate(e),ai.addUnit(e,t.unit),ai.endDate(e)}visitTime(t,e){return ui.startTime(e),ui.addUnit(e,t.unit),ui.addBitWidth(e,t.bitWidth),ui.endTime(e)}visitTimestamp(t,e){const r=t.timezone&&e.createString(t.timezone)||void 0;return ci.startTimestamp(e),ci.addUnit(e,t.unit),void 0!==r&&ci.addTimezone(e,r),ci.endTimestamp(e)}visitInterval(t,e){return li.startInterval(e),li.addUnit(e,t.unit),li.endInterval(e)}visitList(t,e){return hi.startList(e),hi.endList(e)}visitStruct(t,e){return di.startStruct_(e),di.endStruct_(e)}visitUnion(t,e){fi.startTypeIdsVector(e,t.typeIds.length);const r=fi.createTypeIdsVector(e,t.typeIds);return fi.startUnion(e),fi.addMode(e,t.mode),fi.addTypeIds(e,r),fi.endUnion(e)}visitDictionary(t,e){const r=this.visit(t.indices,e);return pi.startDictionaryEncoding(e),pi.addId(e,new Qn(t.id,0)),pi.addIsOrdered(e,t.isOrdered),void 0!==r&&pi.addIndexType(e,r),pi.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return yi.startFixedSizeBinary(e),yi.addByteWidth(e,t.byteWidth),yi.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return bi.startFixedSizeList(e),bi.addListSize(e,t.listSize),bi.endFixedSizeList(e)}visitMap(t,e){return mi.startMap(e),mi.addKeysSorted(e,t.keysSorted),mi.endMap(e)}};function gi(t){return new Ci(t.count,function t(e){return(e||[]).reduce((e,r)=>[...e,new zi(r.count,vi(r.VALIDITY)),...t(r.children)],[])}(t.columns),function t(e,r=[]){for(let n=-1,i=(e||[]).length;++n<i;){const i=e[n];i.VALIDITY&&r.push(new Pi(r.length,i.VALIDITY.length)),i.TYPE&&r.push(new Pi(r.length,i.TYPE.length)),i.OFFSET&&r.push(new Pi(r.length,i.OFFSET.length)),i.DATA&&r.push(new Pi(r.length,i.DATA.length)),r=t(i.children,r)}return r}(t.columns))}function _i(t,e,r){return(t.children||[]).filter(Boolean).map(t=>Ie.fromJSON(t,e,r))}function vi(t){return(t||[]).reduce((t,e)=>t+ +(0===e),0)}function Ii(t){return new Map(Object.entries(t||{}))}function Ai(t){return new q(t.isSigned,t.bitWidth)}function Bi(t,e){const r=t.type.name;switch(r){case"NONE":return new G;case"null":return new Z;case"binary":return new lt;case"utf8":return new ht;case"bool":return new dt;case"list":return new Ft((e||[])[0]);case"struct":case"struct_":return new xt(e||[])}switch(r){case"int":{const e=t.type;return new q(e.isSigned,e.bitWidth)}case"floatingpoint":{const e=t.type;return new ot(_[e.precision])}case"decimal":{const e=t.type;return new ft(e.scale,e.precision)}case"date":{const e=t.type;return new pt(w[e.unit])}case"time":{const e=t.type;return new mt(g[e.unit],e.bitWidth)}case"timestamp":{const e=t.type;return new It(g[e.unit],e.timezone)}case"interval":{const e=t.type;return new Ot(A[e.unit])}case"union":{const r=t.type;return new Mt(v[r.mode],r.typeIds||[],e||[])}case"fixedsizebinary":{const e=t.type;return new Nt(e.byteWidth)}case"fixedsizelist":{const r=t.type;return new Vt(r.listSize,(e||[])[0])}case"map":{const r=t.type;return new Rt(e||[],r.keysSorted)}}throw Error(`Unrecognized type: "${r}"`)}var Si=T.a.Long,Ti=T.a.Builder,Oi=T.a.ByteBuffer,Ui=u.apache.arrow.flatbuf.Type,Di=u.apache.arrow.flatbuf.Field,Fi=u.apache.arrow.flatbuf.Schema,xi=u.apache.arrow.flatbuf.Buffer,Mi=d.apache.arrow.flatbuf.Message,Li=u.apache.arrow.flatbuf.KeyValue,Ei=d.apache.arrow.flatbuf.FieldNode,Ni=u.apache.arrow.flatbuf.Endianness,Vi=d.apache.arrow.flatbuf.RecordBatch,Ri=d.apache.arrow.flatbuf.DictionaryBatch;class ji{constructor(t,e,r,n){this._version=e,this._headerType=r,this.body=new Uint8Array(0),n&&(this._createHeader=(()=>n)),this._bodyLength="number"==typeof t?t:t.low}static fromJSON(t,e){const r=new ji(0,S.V4,e);return r._createHeader=function(t,e){return()=>{switch(e){case B.Schema:return ve.fromJSON(t);case B.RecordBatch:return Ci.fromJSON(t);case B.DictionaryBatch:return ki.fromJSON(t)}throw Error(`Unrecognized Message type: { name: ${B[e]}, type: ${e} }`)}}(t,e),r}static decode(t){t=new Oi(Object(Pt.toUint8Array)(t));const e=Mi.getRootAsMessage(t),r=e.bodyLength(),n=e.version(),i=e.headerType(),s=new ji(r,n,i);return s._createHeader=function(t,e){return()=>{switch(e){case B.Schema:return ve.decode(t.header(new Fi));case B.RecordBatch:return Ci.decode(t.header(new Vi),t.version());case B.DictionaryBatch:return ki.decode(t.header(new Ri),t.version())}throw Error(`Unrecognized Message type: { name: ${B[e]}, type: ${e} }`)}}(e,i),s}static encode(t){let e=new Ti,r=-1;return t.isSchema()?r=ve.encode(e,t.header()):t.isRecordBatch()?r=Ci.encode(e,t.header()):t.isDictionaryBatch()&&(r=ki.encode(e,t.header())),Mi.startMessage(e),Mi.addVersion(e,S.V4),Mi.addHeader(e,r),Mi.addHeaderType(e,t.headerType),Mi.addBodyLength(e,new Si(t.bodyLength,0)),Mi.finishMessageBuffer(e,Mi.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof ve)return new ji(0,S.V4,B.Schema,t);if(t instanceof Ci)return new ji(e,S.V4,B.RecordBatch,t);if(t instanceof ki)return new ji(e,S.V4,B.DictionaryBatch,t);throw Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===B.Schema}isRecordBatch(){return this.headerType===B.RecordBatch}isDictionaryBatch(){return this.headerType===B.DictionaryBatch}}class Ci{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,r){this._nodes=e,this._buffers=r,this._length="number"==typeof t?t:t.low}}class ki{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,r=!1){this._data=t,this._isDelta=r,this._id="number"==typeof e?e:e.low}}class Pi{constructor(t,e){this.offset="number"==typeof t?t:t.low,this.length="number"==typeof e?e:e.low}}class zi{constructor(t,e){this.length="number"==typeof t?t:t.low,this.nullCount="number"==typeof e?e:e.low}}function Yi(t,e,r){const n=[];for(let i,s=-1,o=-1,a=t.childrenLength();++s<a;)(i=t.children(s))&&(n[++o]=Ie.decode(i,e,r));return n}function $i(t){const e=new Map;if(t)for(let r,n,i=-1,s=0|t.customMetadataLength();++i<s;)(r=t.customMetadata(i))&&null!=(n=r.key())&&e.set(n,r.value());return e}function Wi(t){return new q(t.isSigned(),t.bitWidth())}function Hi(t,e){const r=t.typeType();switch(r){case Ui.NONE:return new G;case Ui.Null:return new Z;case Ui.Binary:return new lt;case Ui.Utf8:return new ht;case Ui.Bool:return new dt;case Ui.List:return new Ft((e||[])[0]);case Ui.Struct_:return new xt(e||[])}switch(r){case Ui.Int:{const e=t.type(new u.apache.arrow.flatbuf.Int);return new q(e.isSigned(),e.bitWidth())}case Ui.FloatingPoint:{const e=t.type(new u.apache.arrow.flatbuf.FloatingPoint);return new ot(e.precision())}case Ui.Decimal:{const e=t.type(new u.apache.arrow.flatbuf.Decimal);return new ft(e.scale(),e.precision())}case Ui.Date:{const e=t.type(new u.apache.arrow.flatbuf.Date);return new pt(e.unit())}case Ui.Time:{const e=t.type(new u.apache.arrow.flatbuf.Time);return new mt(e.unit(),e.bitWidth())}case Ui.Timestamp:{const e=t.type(new u.apache.arrow.flatbuf.Timestamp);return new It(e.unit(),e.timezone())}case Ui.Interval:{const e=t.type(new u.apache.arrow.flatbuf.Interval);return new Ot(e.unit())}case Ui.Union:{const r=t.type(new u.apache.arrow.flatbuf.Union);return new Mt(r.mode(),r.typeIdsArray()||[],e||[])}case Ui.FixedSizeBinary:{const e=t.type(new u.apache.arrow.flatbuf.FixedSizeBinary);return new Nt(e.byteWidth())}case Ui.FixedSizeList:{const r=t.type(new u.apache.arrow.flatbuf.FixedSizeList);return new Vt(r.listSize(),(e||[])[0])}case Ui.Map:{const r=t.type(new u.apache.arrow.flatbuf.Map);return new Rt(e||[],r.keysSorted())}}throw Error(`Unrecognized type: "${Ui[r]}" (${r})`)}Ie.encode=function(t,e){let r=-1,n=-1,i=-1,s=e.type,o=e.typeId;G.isDictionary(s)?(o=s.dictionary.typeId,i=wi.visit(s,t),n=wi.visit(s.dictionary,t)):n=wi.visit(s,t);const a=(s.children||[]).map(e=>Ie.encode(t,e)),u=Di.createChildrenVector(t,a),c=e.metadata&&e.metadata.size>0?Di.createCustomMetadataVector(t,[...e.metadata].map(([e,r])=>{const n=t.createString(`${e}`),i=t.createString(`${r}`);return Li.startKeyValue(t),Li.addKey(t,n),Li.addValue(t,i),Li.endKeyValue(t)})):-1;e.name&&(r=t.createString(e.name));Di.startField(t),Di.addType(t,n),Di.addTypeType(t,o),Di.addChildren(t,u),Di.addNullable(t,!!e.nullable),-1!==r&&Di.addName(t,r);-1!==i&&Di.addDictionary(t,i);-1!==c&&Di.addCustomMetadata(t,c);return Di.endField(t)},Ie.decode=function(t,e,r){let n,i,s,o,a,u,c;e&&r&&(u=t.dictionary())?e.has(n=u.id().low)?(o=(o=u.indexType())?Wi(o):new tt,a=new Ct(e.get(n),o,n,u.isOrdered()),c=new Ie(t.name(),a,t.nullable(),$i(t)),r.get(n).push(i=c)):(o=(o=u.indexType())?Wi(o):new tt,e.set(n,s=Hi(t,Yi(t))),a=new Ct(s,o,n,u.isOrdered()),c=new Ie(t.name(),a,t.nullable(),$i(t)),r.set(n,[i=c])):(s=Hi(t,Yi(t,e,r)),i=new Ie(t.name(),s,t.nullable(),$i(t)));return i||null},Ie.fromJSON=function(t,e,r){let n,i,s,o,a,u,c;return e&&r&&(o=t.dictionary)?e.has(n=o.id)?(i=(i=o.indexType)?Ai(i):new tt,u=new Ct(e.get(n),i,n,o.isOrdered),c=new Ie(t.name,u,t.nullable,Ii(t.customMetadata)),r.get(n).push(s=c)):(i=(i=o.indexType)?Ai(i):new tt,e.set(n,a=Bi(t,_i(t))),u=new Ct(a,i,n,o.isOrdered),c=new Ie(t.name,u,t.nullable,Ii(t.customMetadata)),r.set(n,[s=c])):(a=Bi(t,_i(t,e,r)),s=new Ie(t.name,a,t.nullable,Ii(t.customMetadata))),s||null},ve.encode=function(t,e){const r=e.fields.map(e=>Ie.encode(t,e));Fi.startFieldsVector(t,r.length);const n=Fi.createFieldsVector(t,r),i=e.metadata&&e.metadata.size>0?Fi.createCustomMetadataVector(t,[...e.metadata].map(([e,r])=>{const n=t.createString(`${e}`),i=t.createString(`${r}`);return Li.startKeyValue(t),Li.addKey(t,n),Li.addValue(t,i),Li.endKeyValue(t)})):-1;Fi.startSchema(t),Fi.addFields(t,n),Fi.addEndianness(t,Ji?Ni.Little:Ni.Big),-1!==i&&Fi.addCustomMetadata(t,i);return Fi.endSchema(t)},ve.decode=function(t,e=new Map,r=new Map){const n=function(t,e,r){const n=[];for(let i,s=-1,o=-1,a=t.fieldsLength();++s<a;)(i=t.fields(s))&&(n[++o]=Ie.decode(i,e,r));return n}(t,e,r);return new ve(n,$i(t),e,r)},ve.fromJSON=function(t,e=new Map,r=new Map){return new ve(function(t,e,r){return(t.fields||[]).filter(Boolean).map(t=>Ie.fromJSON(t,e,r))}(t,e,r),Ii(t.customMetadata),e,r)},Ci.encode=function(t,e){const r=e.nodes||[],n=e.buffers||[];Vi.startNodesVector(t,r.length),r.slice().reverse().forEach(e=>zi.encode(t,e));const i=t.endVector();Vi.startBuffersVector(t,n.length),n.slice().reverse().forEach(e=>Pi.encode(t,e));const s=t.endVector();return Vi.startRecordBatch(t),Vi.addLength(t,new Si(e.length,0)),Vi.addNodes(t,i),Vi.addBuffers(t,s),Vi.endRecordBatch(t)},Ci.decode=function(t,e=S.V4){return new Ci(t.length(),function(t){const e=[];for(let r,n=-1,i=-1,s=t.nodesLength();++n<s;)(r=t.nodes(n))&&(e[++i]=zi.decode(r));return e}(t),function(t,e){const r=[];for(let n,i=-1,s=-1,o=t.buffersLength();++i<o;)(n=t.buffers(i))&&(e<S.V4&&(n.bb_pos+=8*(i+1)),r[++s]=Pi.decode(n));return r}(t,e))},Ci.fromJSON=gi,ki.encode=function(t,e){const r=Ci.encode(t,e.data);return Ri.startDictionaryBatch(t),Ri.addId(t,new Si(e.id,0)),Ri.addIsDelta(t,e.isDelta),Ri.addData(t,r),Ri.endDictionaryBatch(t)},ki.decode=function(t,e=S.V4){return new ki(Ci.decode(t.data(),e),t.id(),t.isDelta())},ki.fromJSON=function(t){return new ki(gi(t.data),t.id,t.isDelta)},zi.encode=function(t,e){return Ei.createFieldNode(t,new Si(e.length,0),new Si(e.nullCount,0))},zi.decode=function(t){return new zi(t.length(),t.nullCount())},Pi.encode=function(t,e){return xi.createBuffer(t,new Si(e.offset,0),new Si(e.length,0))},Pi.decode=function(t){return new Pi(t.offset(),t.length())};const Ji=function(){const t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]}();var Ki=r(2);class Gi extends Ki.b{write(t){if((t=Object(Pt.toUint8Array)(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Object(Fr.a)(this.toUint8Array(!0)):this.toUint8Array(!1).then(Fr.a)}toUint8Array(t=!1){return t?Object(Pt.joinUint8Arrays)(this._values)[0]:(async()=>{let t=[],e=0;for await(const r of this)t.push(r),e+=r.byteLength;return Object(Pt.joinUint8Arrays)(t,e)[0]})()}}class Zi{constructor(t){t&&(this.source=new Xi(f.a.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class qi{constructor(t){t instanceof qi?this.source=t.source:t instanceof Gi?this.source=new Qi(f.a.fromAsyncIterable(t)):Object(te.m)(t)?this.source=new Qi(f.a.fromNodeStream(t)):Object(te.l)(t)?this.source=new Qi(f.a.fromDOMStream(t)):Object(te.g)(t)?this.source=new Qi(f.a.fromDOMStream(t.body)):Object(te.i)(t)?this.source=new Qi(f.a.fromIterable(t)):Object(te.k)(t)?this.source=new Qi(f.a.fromAsyncIterable(t)):Object(te.f)(t)&&(this.source=new Qi(f.a.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class Xi{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||Ki.c)}return(t){return Object.create(this.source.return&&this.source.return(t)||Ki.c)}}class Qi{constructor(t){this.source=t,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}async cancel(t){await this.return(t)}get closed(){return this._closedPromise}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}async next(t,e="read"){return await this.source.next({cmd:e,size:t})}async throw(t){const e=this.source.throw&&await this.source.throw(t)||Ki.c;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}async return(t){const e=this.source.return&&await this.source.return(t)||Ki.c;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}}class ts extends Zi{constructor(t,e){super(),this.position=0,this.buffer=Object(Pt.toUint8Array)(t),this.size=void 0===e?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:r}=this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:e,size:r,position:n}=this;return e&&n<r?("number"!=typeof t&&(t=1/0),this.position=Math.min(r,n+Math.min(r-n,t)),e.subarray(n,this.position)):null}readAt(t,e){const r=this.buffer,n=Math.min(this.size,t+e);return r?r.subarray(t,n):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}}class es extends qi{constructor(t,e){super(),this.position=0,this._handle=t,"number"==typeof e?this.size=e:this._pending=(async()=>{delete this._pending,this.size=(await t.stat()).size})()}async readInt32(t){const{buffer:e,byteOffset:r}=await this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)}async seek(t){return this._pending&&await this._pending,this.position=Math.min(t,this.size),t<this.size}async read(t){this._pending&&await this._pending;const{_handle:e,size:r,position:n}=this;if(e&&n<r){"number"!=typeof t&&(t=1/0);let i=n,s=0,o=0,a=Math.min(r,i+Math.min(r-i,t)),u=new Uint8Array(Math.max(0,(this.position=a)-i));for(;(i+=o)<a&&(s+=o)<u.byteLength;)({bytesRead:o}=await e.read(u,s,u.byteLength-s,i));return u}return null}async readAt(t,e){this._pending&&await this._pending;const{_handle:r,size:n}=this;if(r&&t+e<n){const i=new Uint8Array(Math.min(n,t+e)-t);return(await r.read(i,0,e,t)).buffer}return new Uint8Array(e)}async close(){const t=this._handle;this._handle=null,t&&await t.close()}async throw(t){return await this.close(),{done:!0,value:t}}async return(t){return await this.close(),{done:!0,value:t}}}var rs=T.a.ByteBuffer;const ns=t=>`Expected ${B[t]} Message in stream, but was null or length 0.`,is=t=>`Header pointer of flatbuffer-encoded ${B[t]} Message is null or length 0.`,ss=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,os=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`;class as{constructor(t){this.source=t instanceof Zi?t:new Zi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?Ki.c:(t=this.readMetadata(t.value)).done?Ki.c:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(null!=t&&e.value.headerType!==t)throw Error(ns(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=Object(Pt.toUint8Array)(this.source.read(t));if(e.byteLength<t)throw Error(os(t,e.byteLength));return e.byteOffset%8==0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=B.Schema,r=this.readMessage(e),n=r&&r.header();if(t&&!n)throw Error(is(e));return n}readMetadataLength(){const t=this.source.read(ls),e=t&&new rs(t),r=+(e&&e.readInt32(0));return{done:r<=0,value:r}}readMetadata(t){const e=this.source.read(t);if(!e)return Ki.c;if(e.byteLength<t)throw Error(ss(t,e.byteLength));return{done:!1,value:ji.decode(e)}}}class us{constructor(t,e){this.source=t instanceof qi?t:Object(te.h)(t)?new es(t,e):new qi(t)}[Symbol.asyncIterator](){return this}async next(){let t;return(t=await this.readMetadataLength()).done?Ki.c:(t=await this.readMetadata(t.value)).done?Ki.c:t}async throw(t){return await this.source.throw(t)}async return(t){return await this.source.return(t)}async readMessage(t){let e;if((e=await this.next()).done)return null;if(null!=t&&e.value.headerType!==t)throw Error(ns(t));return e.value}async readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=Object(Pt.toUint8Array)(await this.source.read(t));if(e.byteLength<t)throw Error(os(t,e.byteLength));return e.byteOffset%8==0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}async readSchema(t=!1){const e=B.Schema,r=await this.readMessage(e),n=r&&r.header();if(t&&!n)throw Error(is(e));return n}async readMetadataLength(){const t=await this.source.read(ls),e=t&&new rs(t),r=+(e&&e.readInt32(0));return{done:r<=0,value:r}}async readMetadata(t){const e=await this.source.read(t);if(!e)return Ki.c;if(e.byteLength<t)throw Error(ss(t,e.byteLength));return{done:!1,value:ji.decode(e)}}}class cs extends as{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Ki.a?t:new Ki.a(t)}next(){const{_json:t,_batchIndex:e,_dictionaryIndex:r}=this,n=t.batches.length,i=t.dictionaries.length;if(!this._schema){return this._schema=!0,{value:ji.fromJSON(t.schema,B.Schema),done:e>=n&&r>=i}}if(r<i){const e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:ji.fromJSON(e,B.DictionaryBatch)}}if(e<n){const e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:ji.fromJSON(e,B.RecordBatch)}}return this._body=[],Ki.c}readMessageBody(t){return function t(e){return(e||[]).reduce((e,r)=>[...e,...r.VALIDITY&&[r.VALIDITY]||[],...r.TYPE&&[r.TYPE]||[],...r.OFFSET&&[r.OFFSET]||[],...r.DATA&&[r.DATA]||[],...t(r.children)],[])}(this._body)}readMessage(t){let e;if((e=this.next()).done)return null;if(null!=t&&e.value.headerType!==t)throw Error(ns(t));return e.value}readSchema(){const t=B.Schema,e=this.readMessage(t),r=e&&e.header();if(!e||!r)throw Error(is(t));return r}}const ls=4,hs=new Uint8Array(6);for(let ga=0;ga<6;ga+=1)hs[ga]="ARROW1".charCodeAt(ga);function ds(t,e=0){for(let r=-1,n=hs.length;++r<n;)if(hs[r]!==t[e+r])return!1;return!0}const fs=hs.length,ps=fs+ls,ys=2*fs+ls;class bs extends V{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){const e=new bs,r=be(Ms,t),[n=e]=e.visitMany(r);return n}visit(t){if(!G.isDictionary(t.type)){const{data:e,length:r,nullCount:n}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");ms.call(this,n<=0?new Uint8Array(0):F(e.offset,r,e.nullBitmap)).nodes.push(new zi(r,n))}return super.visit(t)}visitNull(t){return ms.call(this,new Uint8Array(0))}visitDictionary(t){return this.visit(t.indices)}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function ms(t){const e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new Pi(this._byteLength,e)),this._byteLength+=e,this}function ws(t){return ms.call(this,t.values.subarray(0,t.length*t.stride))}function gs(t){const{length:e,values:r,valueOffsets:n}=t,i=n[0],s=n[e],o=Math.min(s-i,r.byteLength-i);return ms.call(this,Object(Pt.rebaseValueOffsets)(-n[0],e,n)),ms.call(this,r.subarray(i,i+o)),this}function _s(t){const{length:e,valueOffsets:r}=t;return r&&ms.call(this,Object(Pt.rebaseValueOffsets)(r[0],e,r)),this.visit(t.getChildAt(0))}function vs(t){return this.visitMany(t.type.children.map((e,r)=>t.getChildAt(r)).filter(Boolean))[0]}bs.prototype.visitBool=function(t){let e;return t.nullCount>=t.length?ms.call(this,new Uint8Array(0)):(e=t.values)instanceof Uint8Array?ms.call(this,F(t.offset,t.length,e)):ms.call(this,x(t))},bs.prototype.visitInt=ws,bs.prototype.visitFloat=ws,bs.prototype.visitUtf8=gs,bs.prototype.visitBinary=gs,bs.prototype.visitFixedSizeBinary=ws,bs.prototype.visitDate=ws,bs.prototype.visitTimestamp=ws,bs.prototype.visitTime=ws,bs.prototype.visitDecimal=ws,bs.prototype.visitList=_s,bs.prototype.visitStruct=vs,bs.prototype.visitUnion=function(t){const{type:e,length:r,typeIds:n,valueOffsets:i}=t;if(ms.call(this,n),e.mode===v.Sparse)return vs.call(this,t);if(e.mode===v.Dense){if(t.offset<=0)return ms.call(this,i),vs.call(this,t);{const s=n.reduce((t,e)=>Math.max(t,e),n[0]),o=new Int32Array(s+1),a=new Int32Array(s+1).fill(-1),u=new Int32Array(r),c=Object(Pt.rebaseValueOffsets)(-i[0],r,i);for(let t,e,i=-1;++i<r;)-1===(e=a[t=n[i]])&&(e=a[t]=c[t]),u[i]=c[i]-e,++o[t];ms.call(this,u);for(let n,i=-1,l=e.children.length;++i<l;)if(n=t.getChildAt(i)){const t=e.typeIds[i],s=Math.min(r,o[t]);this.visit(n.slice(a[t],s))}}}return this},bs.prototype.visitInterval=ws,bs.prototype.visitFixedSizeList=_s,bs.prototype.visitMap=vs;class Is extends V{visit(t){return null==t?void 0:super.visit(t)}visitNull({typeId:t}){return{name:m[t].toLowerCase()}}visitInt({typeId:t,bitWidth:e,isSigned:r}){return{name:m[t].toLowerCase(),bitWidth:e,isSigned:r}}visitFloat({typeId:t,precision:e}){return{name:m[t].toLowerCase(),precision:_[e]}}visitBinary({typeId:t}){return{name:m[t].toLowerCase()}}visitBool({typeId:t}){return{name:m[t].toLowerCase()}}visitUtf8({typeId:t}){return{name:m[t].toLowerCase()}}visitDecimal({typeId:t,scale:e,precision:r}){return{name:m[t].toLowerCase(),scale:e,precision:r}}visitDate({typeId:t,unit:e}){return{name:m[t].toLowerCase(),unit:w[e]}}visitTime({typeId:t,unit:e,bitWidth:r}){return{name:m[t].toLowerCase(),unit:g[e],bitWidth:r}}visitTimestamp({typeId:t,timezone:e,unit:r}){return{name:m[t].toLowerCase(),unit:g[r],timezone:e}}visitInterval({typeId:t,unit:e}){return{name:m[t].toLowerCase(),unit:A[e]}}visitList({typeId:t}){return{name:m[t].toLowerCase()}}visitStruct({typeId:t}){return{name:m[t].toLowerCase()}}visitUnion({typeId:t,mode:e,typeIds:r}){return{name:m[t].toLowerCase(),mode:v[e],typeIds:[...r]}}visitDictionary(t){return this.visit(t.dictionary)}visitFixedSizeBinary({typeId:t,byteWidth:e}){return{name:m[t].toLowerCase(),byteWidth:e}}visitFixedSizeList({typeId:t,listSize:e}){return{name:m[t].toLowerCase(),listSize:e}}visitMap({typeId:t,keysSorted:e}){return{name:m[t].toLowerCase(),keysSorted:e}}}class As extends V{static assemble(...t){return(new As).visitMany(me(Ms,t))}visit(t){const{data:e,name:r,length:n}=t,{offset:i,nullCount:s,nullBitmap:o}=e,a=G.isDictionary(t.type)?t.type.indices:t.type,u=Object.assign([],e.buffers,{[I.VALIDITY]:void 0});return{name:r,count:n,VALIDITY:s<=0?Array.from({length:n},()=>1):[...M(o,i,n,null,U)],...super.visit(p.new(e.clone(a,i,n,0,u)))}}visitNull(){return{DATA:[]}}visitBool({values:t,offset:e,length:r}){return{DATA:[...M(t,e,r,null,O)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...Ss(t.values,2)]}}visitFloat(t){return{DATA:[...t.values]}}visitUtf8(t){return{DATA:[...t],OFFSET:[...t.valueOffsets]}}visitBinary(t){return{DATA:[...Bs(t)],OFFSET:[...t.valueOffsets]}}visitFixedSizeBinary(t){return{DATA:[...Bs(t)]}}visitDate(t){return{DATA:t.type.unit===w.DAY?[...t.values]:[...Ss(t.values,2)]}}visitTimestamp(t){return{DATA:[...Ss(t.values,2)]}}visitTime(t){return{DATA:t.type.unit<g.MICROSECOND?[...t.values]:[...Ss(t.values,2)]}}visitDecimal(t){return{DATA:[...Ss(t.values,4)]}}visitList(t){return{OFFSET:[...t.valueOffsets],children:t.type.children.map((e,r)=>this.visit(new ce(e,[t.getChildAt(r)])))}}visitStruct(t){return{children:t.type.children.map((e,r)=>this.visit(new ce(e,[t.getChildAt(r)])))}}visitUnion(t){return{TYPE:[...t.typeIds],OFFSET:t.type.mode===v.Dense?[...t.valueOffsets]:void 0,children:t.type.children.map((e,r)=>this.visit(new ce(e,[t.getChildAt(r)])))}}visitInterval(t){return{DATA:[...t.values]}}visitFixedSizeList(t){return{children:t.type.children.map((e,r)=>this.visit(new ce(e,[t.getChildAt(r)])))}}visitMap(t){return{children:t.type.children.map((e,r)=>this.visit(new ce(e,[t.getChildAt(r)])))}}}function*Bs(t){for(const e of t)yield e.reduce((t,e)=>`${t}${("0"+(255&e).toString(16)).slice(-2)}`,"").toUpperCase()}function*Ss(t,e){for(let r=-1,n=t.length/e;++r<n;)yield`${kr.new(t.subarray((r+0)*e,(r+1)*e),!1)}`}class Ts extends Ki.d{constructor(t){super(),this._position=0,this._started=!1,this._sink=new Gi,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._autoDestroy=!t||"boolean"!=typeof t.autoDestroy||t.autoDestroy}static throughNode(t){throw Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Object(te.k)(t)?t.then(t=>this.writeAll(t)):Object(te.f)(t)?async function(t,e){for await(const r of e)t.write(r);return t.finish()}(this,t):function(t,e){let r=e;e instanceof xs&&(r=e.chunks,t.reset(void 0,e.schema));for(const n of r)t.write(n);return t.finish()}(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof Gi?this._sink=t:(this._sink=new Gi,t&&Object(te.n)(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Object(te.o)(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],e&&e.compareTo(this._schema)||(null===e?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(!this._sink)throw Error("RecordBatchWriter is closed");if(null==t)return this.finish()&&void 0;if(t instanceof xs&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof Ms&&!(e=t.schema))return this.finish()&&void 0;if(e&&!e.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof Ms?this._writeRecordBatch(t):t instanceof xs?this.writeAll(t.chunks):Object(te.i)(t)&&this.writeAll(t)}_writeMessage(t,e=8){const r=e-1,n=ji.encode(t),i=n.byteLength,s=i+4+r&~r,o=s-i-4;return t.headerType===B.RecordBatch?this._recordBatchBlocks.push(new Me(s,t.bodyLength,this._position)):t.headerType===B.DictionaryBatch&&this._dictionaryBlocks.push(new Me(s,t.bodyLength,this._position)),this._write(Int32Array.of(s-4)),i>0&&this._write(n),this._writePadding(o)}_write(t){if(this._started){const e=Object(Pt.toUint8Array)(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(ji.from(t))._writeDictionaries(t.dictionaryFields)}_writeFooter(){return this._writePadding(4)}_writeMagic(){return this._write(hs)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:r,bufferRegions:n,buffers:i}=bs.assemble(t),s=new Ci(t.length,r,n),o=ji.from(s,e);return this._writeMessage(o)._writeBodyBuffers(i)}_writeDictionaryBatch(t,e,r=!1){const{byteLength:n,nodes:i,bufferRegions:s,buffers:o}=bs.assemble(t),a=new Ci(t.length,i,s),u=new ki(a,e,r),c=ji.from(u,n);return this._writeMessage(c)._writeBodyBuffers(o)}_writeBodyBuffers(t){let e,r,n;for(let i=-1,s=t.length;++i<s;)(e=t[i])&&(r=e.byteLength)>0&&(this._write(e),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(t){for(const[e,r]of t){const t=r[0].type.dictionaryVector;if(t instanceof oe){const r=t.chunks;for(let t=-1,n=r.length;++t<n;)this._writeDictionaryBatch(r[t],e,t>0)}else this._writeDictionaryBatch(t,e,!1)}return this}}class Os extends Ts{static writeAll(t,e){return new Os(e).writeAll(t)}}class Us extends Ts{constructor(){super(),this._autoDestroy=!0}static writeAll(t){return(new Us).writeAll(t)}_writeSchema(t){return this._writeMagic()._writePadding(2)._writeDictionaries(t.dictionaryFields)}_writeFooter(){const t=Fe.encode(new Fe(this._schema,S.V4,this._recordBatchBlocks,this._dictionaryBlocks));return this._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}}class Ds extends Ts{constructor(){super(),this._autoDestroy=!0}static writeAll(t){return(new Ds).writeAll(t)}_writeMessage(){return this}_writeSchema(t){return this._write(`{\n "schema": ${JSON.stringify({fields:t.fields.map(Fs)},null,2)}`)._writeDictionaries(t.dictionaryFields)}_writeDictionaries(t){return this._write(',\n "dictionaries": [\n'),super._writeDictionaries(t),this._write("\n ]")}_writeDictionaryBatch(t,e,r=!1){return this._write(0===this._dictionaryBlocks.length?" ":",\n "),this._write(`${function(t,e,r,n=!1){const i=t.dictionaryFields.get(r)[0],s=new Ie(i.name,i.type.dictionary,i.nullable,i.metadata),o=As.assemble(new ce(s,[e]));return JSON.stringify({id:r,isDelta:n,data:{count:e.length,columns:o}},null,2)}(this._schema,t,e,r)}`),this._dictionaryBlocks.push(new Me(0,0,0)),this}_writeRecordBatch(t){return this._write(0===this._recordBatchBlocks.length?',\n "batches": [\n ':",\n "),this._write(`${function(t){return JSON.stringify({count:t.length,columns:As.assemble(t)},null,2)}(t)}`),this._recordBatchBlocks.push(new Me(0,0,0)),this}close(){return this._recordBatchBlocks.length>0&&this._write("\n ]"),this._schema&&this._write("\n}"),super.close()}}function Fs({name:t,type:e,nullable:r}){const n=new Is;return{name:t,nullable:r,type:n.visit(e),children:(e.children||[]).map(Fs),dictionary:G.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}class xs extends oe{constructor(...t){let e=null;t[0]instanceof ve&&(e=t.shift());let r=de(Ms,t);if(!e&&!(e=r[0]&&r[0].schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");r[0]||(r[0]=new Ms(e,0,e.fields.map(t=>Yt.new(t.type,0,0)))),super(new xt(e.fields),r),this._schema=e,this._chunks=r}static empty(){return new xs(new ve([]),[])}static from(t){if(!t)return xs.empty();let e=Ns.from(t);return Object(te.k)(e)?(async()=>await xs.from(await e))():e.isSync()&&(e=e.open())?e.schema?new xs(e.schema,[...e]):xs.empty():(async t=>{const e=await t,r=e.schema,n=[];if(r){for await(let t of e)n.push(t);return new xs(r,n)}return xs.empty()})(e.open())}static async fromAsync(t){return await xs.from(t)}static fromStruct(t){return xs.new(t.data.childData,t.type.children)}static new(...t){return new xs(...(e=fe(t),qn(new ve(e.map(({field:t})=>t)),e)));var e}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(t=this._chunks){return new xs(this._schema,t)}getColumn(t){return this.getColumnAt(this.getColumnIndex(t))}getColumnAt(t){return this.getChildAt(t)}getColumnIndex(t){return this._schema.fields.findIndex(e=>e.name===t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let e,r;const n=this._schema.fields,i=this._children||(this._children=[]);if(r=i[t])return r;if(e=n[t]){const r=this._chunks.map(e=>e.getChildAt(t)).filter(t=>null!=t);if(r.length>0)return i[t]=new ce(e,r)}return null}serialize(t="binary",e=!0){return(e?Os:Us).writeAll(this._chunks).toUint8Array(!0)}count(){return this._length}select(...t){const e=this._schema.fields.reduce((t,e,r)=>t.set(e.name,r),new Map);return this.selectAt(...t.map(t=>e.get(t)).filter(t=>t>-1))}selectAt(...t){const e=this._schema.selectAt(...t);return new xs(e,this._chunks.map(({length:r,data:{childData:n}})=>new Ms(e,r,t.map(t=>n[t]).filter(Boolean))))}assign(t){const e=this._schema.fields,[r,n]=t.schema.fields.reduce((t,r,n)=>{const[i,s]=t,o=e.findIndex(t=>t.name===r.name);return~o?s[o]=n:i.push(n),t},[[],[]]),i=this._schema.assign(t.schema),s=[...e.map((e,r,i,s=n[r])=>void 0===s?this.getColumnAt(r):t.getColumnAt(s)),...r.map(e=>t.getColumnAt(e))].filter(Boolean);return new xs(...qn(i,s))}}class Ms extends br{constructor(...t){let e,r,n=t[0];if(t[1]instanceof Yt)[,e,r]=t;else{const r=n.fields,[,i,s]=t;e=Yt.Struct(new xt(r),0,i,0,null,s)}super(e,r),this._schema=n}static from(...t){return Ms.new(t[0],t[1])}static new(...t){const[e,r]=pe(t),n=r.filter(t=>t instanceof p);return new Ms(...function(t,e,r=e.reduce((t,e)=>Math.max(t,e.length),0)){let n,i,s=-1,o=e.length;const a=[...t.fields],u=[],c=(r+63&-64)>>3;for(;++s<o;)(n=e[s])&&n.length===r?u[s]=n:((i=a[s]).nullable||(a[s]=a[s].clone({nullable:!0})),u[s]=n?n._changeLengthAndBackfillNullBitmap(r):Yt.new(i.type,0,r,r,Zn(c)));return[new ve(a),r,u]}(new ve(e),n.map(t=>t.data)))}clone(t,e=this._children){return new Ms(this._schema,t,e)}concat(...t){const e=this._schema,r=oe.flatten(this,...t);return new xs(e,r.map(({data:t})=>new Ms(e,t)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}select(...t){const e=this._schema.fields.reduce((t,e,r)=>t.set(e.name,r),new Map);return this.selectAt(...t.map(t=>e.get(t)).filter(t=>t>-1))}selectAt(...t){const e=this._schema.selectAt(...t),r=t.map(t=>this.data.childData[t]).filter(Boolean);return new Ms(e,this.length,r)}}class Ls extends V{constructor(t,e,r){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r}visit(t){return super.visit(t instanceof Ie?t.type:t)}visitNull(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Null(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Bool(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Int(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Float(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Utf8(t,0,e,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}visitBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Binary(t,0,e,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}visitFixedSizeBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.FixedSizeBinary(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Date(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Timestamp(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Time(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Decimal(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.List(t,0,e,r,this.readNullBitmap(t,r),this.readOffsets(t),this.visit(t.children[0]))}visitStruct(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Struct(t,0,e,r,this.readNullBitmap(t,r),this.visitMany(t.children))}visitUnion(t){return t.mode===v.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Union(t,0,e,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.readOffsets(t),this.visitMany(t.children))}visitSparseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Union(t,0,e,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.visitMany(t.children))}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Dictionary(t,0,e,r,this.readNullBitmap(t,r),this.readData(t.indices))}visitInterval(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Interval(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.FixedSizeList(t,0,e,r,this.readNullBitmap(t,r),this.visit(t.children[0]))}visitMap(t,{length:e,nullCount:r}=this.nextFieldNode()){return Yt.Map(t,0,e,r,this.readNullBitmap(t,r),this.visitMany(t.children))}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e,r=this.nextBufferRange()){return e>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+e)}}class Es extends Ls{constructor(t,e,r){super(new Uint8Array(0),e,r),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):x(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return Object(Pt.toArrayBufferView)(Uint8Array,Object(Pt.toArrayBufferView)(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return Object(Pt.toArrayBufferView)(Uint8Array,Object(Pt.toArrayBufferView)(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:r}=this;return G.isTimestamp(t)?Object(Pt.toArrayBufferView)(Uint8Array,ze.convertArray(r[e])):(G.isInt(t)||G.isTime(t))&&64===t.bitWidth?Object(Pt.toArrayBufferView)(Uint8Array,ze.convertArray(r[e])):G.isDate(t)&&t.unit===w.MILLISECOND?Object(Pt.toArrayBufferView)(Uint8Array,ze.convertArray(r[e])):G.isDecimal(t)?Object(Pt.toArrayBufferView)(Uint8Array,Ye.convertArray(r[e])):G.isBinary(t)||G.isFixedSizeBinary(t)?function(t){const e=t.join(""),r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n>>1]=parseInt(e.substr(n,2),16);return r}(r[e]):G.isBool(t)?x(r[e]):G.isUtf8(t)?Object(Fr.b)(r[e].join("")):Object(Pt.toArrayBufferView)(Uint8Array,Object(Pt.toArrayBufferView)(t.ArrayType,r[e].map(t=>+t)))}}class Ns extends Ki.d{constructor(t){super(),this._impl=t}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(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){const e=this._impl.open(t);return Object(te.k)(e)?e.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return f.a.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return f.a.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Ns?t:Object(te.e)(t)?function(t){return new Vs(new Ws(t))}(t):Object(te.h)(t)?async function(t){const{size:e}=await t.stat(),r=new es(t,e);if(e>=ys&&ds(await r.readAt(0,fs+7&-8)))return new Cs(new $s(r));return new Rs(new zs(r))}(t):Object(te.k)(t)?(async()=>await Ns.from(await t))():Object(te.g)(t)||Object(te.l)(t)||Object(te.m)(t)||Object(te.f)(t)?async function(t){const e=await t.peek(fs+7&-8);return e&&e.byteLength>=4?ds(e)?new js(new Ys(await t.read())):new Rs(new zs(t)):new Rs(new zs(async function*(){}()))}(new qi(t)):function(t){const e=t.peek(fs+7&-8);return e&&e.byteLength>=4?ds(e)?new js(new Ys(t.read())):new Vs(new Ps(t)):new Vs(new Ps(function*(){}()))}(new Zi(t))}static readAll(t){return t instanceof Ns?t.isSync()?Js(t):Ks(t):Object(te.e)(t)||ArrayBuffer.isView(t)||Object(te.i)(t)||Object(te.j)(t)?Js(t):Ks(t)}}class Vs extends Ns{constructor(t){super(t),this._impl=t}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}}class Rs extends Ns{constructor(t){super(t),this._impl=t}[Symbol.iterator](){throw Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class js extends Vs{constructor(t){super(t),this._impl=t}}class Cs extends Rs{constructor(t){super(t),this._impl=t}}class ks{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){return new Ms(this.schema,t.length,this._loadVectors(t,e,this.schema.fields))}_loadDictionaryBatch(t,e){const{id:r,isDelta:n,data:i}=t,{dictionaries:s,schema:o}=this;if(n||!s.get(r)){const t=o.dictionaries.get(r),a=n?s.get(r).concat(p.new(this._loadVectors(i,e,[t])[0])):p.new(this._loadVectors(i,e,[t])[0]);return(o.dictionaryFields.get(r)||[]).forEach(({type:t})=>t.dictionaryVector=a),a}return s.get(r)}_loadVectors(t,e,r){return new Ls(e,t.nodes,t.buffers).visitMany(r)}}class Ps extends ks{constructor(t,e){super(e),this._reader=Object(te.e)(t)?new cs(this._handle=t):new as(this._handle=t)}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(t){return this.closed||(this.autoDestroy=Hs(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):Ki.c}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Ki.c}next(){if(this.closed)return Ki.c;let t,{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else{if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),n=e.readMessageBody(t.bodyLength),i=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,i)}}return this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class zs extends ks{constructor(t,e){super(e),this._reader=new us(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}async cancel(){!this.closed&&(this.closed=!0)&&(await this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}async open(t){return this.closed||(this.autoDestroy=Hs(this,t),this.schema||(this.schema=await this._reader.readSchema())||await this.cancel()),this}async throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.throw(t):Ki.c}async return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(t):Ki.c}async next(){if(this.closed)return Ki.c;let t,{_reader:e}=this;for(;t=await this._readNextMessageAndValidate();)if(t.isSchema())await this.reset(t.header());else{if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),n=await e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,n)}}if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),n=await e.readMessageBody(t.bodyLength),i=this._loadDictionaryBatch(r,n);this.dictionaries.set(r.id,i)}}return await this.return()}async _readNextMessageAndValidate(t){return await this._reader.readMessage(t)}}class Ys extends Ps{constructor(t,e){super(t instanceof ts?t:new ts(t),e)}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(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){if(this.closed)return null;this._footer||this.open();const e=this._footer&&this._footer.getRecordBatch(t);if(e&&this._handle.seek(e.offset)){const t=this._reader.readMessage(B.RecordBatch);if(t&&t.isRecordBatch()){const e=t.header(),r=this._reader.readMessageBody(t.bodyLength);return this._loadRecordBatch(e,r)}}return null}_readDictionaryBatch(t){const e=this._footer&&this._footer.getDictionaryBatch(t);if(e&&this._handle.seek(e.offset)){const t=this._reader.readMessage(B.DictionaryBatch);if(t&&t.isDictionaryBatch()){const e=t.header(),r=this._reader.readMessageBody(t.bodyLength),n=this._loadDictionaryBatch(e,r);this.dictionaries.set(e.id,n)}}}_readFooter(){const{_handle:t}=this,e=t.size-ps,r=t.readInt32(e),n=t.readAt(e-r,r);return Fe.decode(n)}_readNextMessageAndValidate(t){if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const e=this._footer&&this._footer.getRecordBatch(this._recordBatchIndex);if(e&&this._handle.seek(e.offset))return this._reader.readMessage(t)}return null}}class $s extends zs{constructor(t,...e){const r="number"!=typeof e[0]?e.shift():void 0,n=e[0]instanceof Map?e.shift():void 0;super(t instanceof es?t:new es(t,r),n)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}async open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=await this._readFooter()).schema;for(const t of this._footer.dictionaryBatches())t&&await this._readDictionaryBatch(this._dictionaryIndex++)}return await super.open(t)}async readRecordBatch(t){if(this.closed)return null;this._footer||await this.open();const e=this._footer&&this._footer.getRecordBatch(t);if(e&&await this._handle.seek(e.offset)){const t=await this._reader.readMessage(B.RecordBatch);if(t&&t.isRecordBatch()){const e=t.header(),r=await this._reader.readMessageBody(t.bodyLength);return this._loadRecordBatch(e,r)}}return null}async _readDictionaryBatch(t){const e=this._footer&&this._footer.getDictionaryBatch(t);if(e&&await this._handle.seek(e.offset)){const t=await this._reader.readMessage(B.DictionaryBatch);if(t&&t.isDictionaryBatch()){const e=t.header(),r=await this._reader.readMessageBody(t.bodyLength),n=this._loadDictionaryBatch(e,r);this.dictionaries.set(e.id,n)}}}async _readFooter(){const{_handle:t}=this;t._pending&&await t._pending;const e=t.size-ps,r=await t.readInt32(e),n=await t.readAt(e-r,r);return Fe.decode(n)}async _readNextMessageAndValidate(t){if(this._footer||await this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const e=this._footer.getRecordBatch(this._recordBatchIndex);if(e&&await this._handle.seek(e.offset))return await this._reader.readMessage(t)}return null}}class Ws extends Ps{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new Es(e,t.nodes,t.buffers).visitMany(r)}}function Hs(t,e){return e&&"boolean"==typeof e.autoDestroy?e.autoDestroy:t.autoDestroy}function*Js(t){const e=Ns.from(t);try{if(!e.open({autoDestroy:!1}).closed)do{yield e}while(!e.reset().open().closed)}finally{e.cancel()}}async function*Ks(t){const e=await Ns.from(t);try{if(!(await e.open({autoDestroy:!1})).closed)do{yield e}while(!(await e.reset().open()).closed)}finally{await e.cancel()}}class Gs{constructor(t){this.length=0,this.nullCount=0,this.offset=0,this._bytesUsed=0,this._bytesReserved=0;const e=t.type,r=t.nullValues;this.stride=kt(this._type=e),this.children=(e.children||[]).map(t=>new Gs(t.type)),this.nullValues=Object.freeze(r||[]),this.nullBitmap=new Uint8Array(0),this.nullValues.length&&(this._isValid=eo(this.nullValues),this.children.forEach(t=>{t._isValid=this._isValid,t.nullValues=this.nullValues,t.nullBitmap=new Uint8Array(0)}))}get type(){return this._type}get bytesUsed(){return this._bytesUsed}get bytesReserved(){return this._bytesReserved}get ArrayType(){return this._type.ArrayType}*readAll(t,e=1/0){for(const r of t)this.write(r).length>=e&&(yield this.flush());this.finish().length>0&&(yield this.flush())}async*readAllAsync(t,e=1/0){for await(const r of t)this.write(r).length>=e&&(yield this.flush());this.finish().length>0&&(yield this.flush())}isValid(t){return this._isValid(t)}write(t){const e=this.length;return this.writeValid(this.isValid(t),e)&&this.writeValue(t,e),this._updateBytesUsed(e,this.length=e+1)}writeValue(t,e){this._setValue(this,e,t)}writeValid(t,e){return t||++this.nullCount,D(this._getNullBitmap(e),e,t),t}_updateBytesUsed(t,e){return t%512||(this._bytesUsed+=64),this}flush(){const{length:t,nullCount:e}=this;let{valueOffsets:r,values:n,nullBitmap:i,typeIds:s}=this;r?(r=to(r,Qs(t,4)),n&&(n=to(n,Qs(r[t],n.BYTES_PER_ELEMENT)))):n&&(n=to(n,Qs(t*this.stride,n.BYTES_PER_ELEMENT))),i&&(i=0===e?new Uint8Array(0):to(i,Qs(t>>3,1)||64)),s&&(s=to(s,Qs(t,1)));const o=Yt.new(this._type,0,t,e,[r,n,i,s],this.children.map(t=>t.flush()));return this.reset(),o}finish(){return this.children.forEach(t=>t.finish()),this}reset(){return this.length=0,this.nullCount=0,this._bytesUsed=0,this._bytesReserved=0,this.values&&(this.values=this.values.subarray(0,0)),this.typeIds&&(this.typeIds=this.typeIds.subarray(0,0)),this.nullBitmap&&(this.nullBitmap=this.nullBitmap.subarray(0,0)),this.valueOffsets&&(this.valueOffsets=this.valueOffsets.subarray(0,0)),this}_getNullBitmap(t){let e=this.nullBitmap;return t>>3>=e.length&&(t=Qs(t,1)||32,this.nullBitmap=e=Object(Pt.memcpy)(new Uint8Array(2*t),e)),e}_getValueOffsets(t){let e=this.valueOffsets;return t>=e.length-1&&(t=Qs(t,4)||8,this.valueOffsets=e=Object(Pt.memcpy)(new Int32Array(2*t),e)),e}_getValues(t){let{stride:e,values:r}=this;if(t*e>=r.length){let{ArrayType:n}=this,i=n.BYTES_PER_ELEMENT;t=Qs(t,i)||32/i,this.values=r=Object(Pt.memcpy)(new n(t*e*2),r)}return r}_getValuesBitmap(t){let e=this.values;return t>>3>=e.length&&(t=Qs(t,1)||32,this.values=e=Object(Pt.memcpy)(new Uint8Array(2*t),e)),e}_getTypeIds(t){let e=this.typeIds;return t>=e.length&&(t=Qs(t,1)||32,this.typeIds=e=Object(Pt.memcpy)(new Int8Array(2*t),e)),e}}Gs.prototype._isValid=eo([null,void 0]);class Zs extends Gs{constructor(t){super(t),this.values=new this.ArrayType(0),this.BYTES_PER_ELEMENT=this.stride*this.ArrayType.BYTES_PER_ELEMENT}get bytesReserved(){return this.values.byteLength+this.nullBitmap.byteLength}writeValue(t,e){return this._getValues(e),super.writeValue(t,e)}_updateBytesUsed(t,e){return this._bytesUsed+=this.BYTES_PER_ELEMENT,super._updateBytesUsed(t,e)}}class qs extends Gs{constructor(t){super(t),this.valueOffsets=new Int32Array(0)}get bytesReserved(){return this.valueOffsets.byteLength+this.nullBitmap.byteLength+Qs(this.valueOffsets[this.length],1)}writeValid(t,e){if(!super.writeValid(t,e)){const t=this._getValueOffsets(e);t[e+1]=t[e]}return t}writeValue(t,e){const r=this._getValueOffsets(e);r[e+1]=r[e]+t.length,(this._values||(this._values=new Map)).set(e,t),this._bytesUsed+=t.length,this._bytesReserved+=t.length}_updateBytesUsed(t,e){return this._bytesUsed+=4,super._updateBytesUsed(t,e)}flush(){return this.values=new Uint8Array(Qs(this.valueOffsets[this.length],1)),this._values&&((t,e)=>{let r,n=-1;for(;++n<e;)void 0!==(r=t.get(n))&&super.writeValue(r,n)})(this._values,this.length),this._values=void 0,super.flush()}}class Xs extends Gs{get bytesUsed(){return this.children.reduce((t,{bytesUsed:e})=>t+e,this._bytesUsed)}get bytesReserved(){return this.children.reduce((t,{bytesReserved:e})=>t+e,this.nullBitmap.byteLength)}getChildAt(t){return this.children[t]}}function Qs(t,e){return(t*e+63&-64)/e}function to(t,e=0){return t.length>=e?t.subarray(0,e):Object(Pt.memcpy)(new t.constructor(e),t,0)}function eo(t){if(!t||t.length<=0)return function(t){return!0};let e="",r=t.filter(t=>t==t);return r.length>0&&(e=`\n switch (x) {${r.map(t=>`\n case ${function(t){return"bigint"!=typeof t?Wt(t):te.c?`${Wt(t)}n`:`"${Wt(t)}"`}(t)}:`).join("")}\n return false;\n }`),t.length!==r.length&&(e=`if (x !== x) return false;\n${e}`),Function("x",`${e}\nreturn true;`)}class ro extends qs{writeValue(t,e=this.length){return super.writeValue(t,e)}}class no extends Gs{constructor(t){super(t),this.values=new Uint8Array(0)}writeValue(t,e){return this._getValuesBitmap(e),super.writeValue(t,e)}_updateBytesUsed(t,e){return t%512||(this._bytesUsed+=64),super._updateBytesUsed(t,e)}}class io extends Zs{}class so extends io{}class oo extends io{}class ao extends Zs{}class uo extends Gs{constructor(t){super(t),this.hashmap=Object.create(null);const{type:e,nullValues:r}=t;this._hash=t.dictionaryHashFunction||co,this.indices=Gs.new({type:e.indices,nullValues:r}),this.dictionary=Gs.new({type:e.dictionary,nullValues:[]})}get values(){return this.indices&&this.indices.values}get nullBitmap(){return this.indices&&this.indices.nullBitmap}set values(t){this.indices&&(this.indices.values=t)}set nullBitmap(t){this.indices&&(this.indices.nullBitmap=t)}setHashFunction(t){return this._hash=t,this}reset(){return this.length=0,this.indices.reset(),this.dictionary.reset(),this}flush(){const t=this.indices,e=t.flush().clone(this.type);return this.length=t.length,e}finish(){return this.type.dictionaryVector=p.new(this.dictionary.finish().flush()),super.finish()}write(t){return this.indices.length=super.write(t).length,this}writeValid(t,e){return this.indices.writeValid(t,e)}writeValue(t,e){let r=this._hash(t),n=this.hashmap;return void 0===n[r]&&(n[r]=this.dictionary.write(t).length-1),this.indices.writeValue(n[r],e)}*readAll(t,e=1/0){const r=[];for(const n of super.readAll(t,e))r.push(n);yield*r}async*readAllAsync(t,e=1/0){const r=[];for await(const n of super.readAllAsync(t,e))r.push(n);yield*r}}function co(t){"string"==typeof t||(t=`${t}`);let e=6,r=t.length;for(;r>0;)e=Math.imul(e^t.charCodeAt(--r),81);return e^e>>>9}class lo extends Zs{}class ho extends Xs{constructor(){super(...arguments),this.row=new fo}writeValue(t,e){const r=this.row;r.values=t,super.writeValue(r,e),r.values=null}}class fo{constructor(){this.values=null}get(t){return this.values?this.values[t]:null}}class po extends Zs{}class yo extends po{}class bo extends po{}class mo extends po{}class wo extends Zs{}class go extends wo{}class _o extends wo{}class vo extends Zs{}class Io extends vo{}class Ao extends vo{}class Bo extends vo{}class So extends vo{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(Fo)),super(t)}isValid(t){return this._isValid(Fo(t))}}class To extends vo{}class Oo extends vo{}class Uo extends vo{}class Do extends vo{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(Fo)),super(t)}isValid(t){return this._isValid(Fo(t))}}const Fo=(t=>e=>(ArrayBuffer.isView(e)&&(t.buffer=e.buffer,t.byteOffset=e.byteOffset,t.byteLength=e.byteLength,e=jr(t),t.buffer=null),e))({BigIntArray:te.b});class xo extends Xs{constructor(){super(...arguments),this.row=new Mo}writeValue(t,e){const r=this.row;r.values=t,super.writeValue(r,e),r.values=null}}class Mo{constructor(){this.values=null}get(t){return this.values?this.values[t]:null}}class Lo extends Xs{}class Eo extends Gs{writeValue(t){return t}writeValid(t){return t}}class No extends Xs{}class Vo extends Zs{}class Ro extends Vo{}class jo extends Vo{}class Co extends Vo{}class ko extends Vo{}class Po extends Zs{}class zo extends Po{}class Yo extends Po{}class $o extends Po{}class Wo extends Po{}class Ho extends Xs{constructor(t){super(t),this.typeIds=new Int8Array(0)}get bytesReserved(){return this.children.reduce((t,{bytesReserved:e})=>t+e,this.typeIds.byteLength+this.nullBitmap.byteLength)}write(t,e){const r=this.length;return this.writeValid(this.isValid(t),r)&&this.writeValue(t,r,e),this.length=r+1,this}appendChild(t,e=`${this.children.length}`){const r=this.children.push(t),{type:{children:n,mode:i,typeIds:s}}=this,o=[...n,new Ie(e,t.type)];return this._type=new Mt(i,[...s,r],o),r}writeValue(t,e,r){return this._getTypeIds(e)[e]=r,super.writeValue(t,e)}_updateBytesUsed(t,e){return this._bytesUsed+=1,super._updateBytesUsed(t,e)}}class Jo extends Ho{}class Ko extends Ho{constructor(t){super(t),this.valueOffsets=new Int32Array(0)}writeValue(t,e,r){return this._getValueOffsets(e)[e]=this.getChildAt(r).length,super.writeValue(t,e,r)}_updateBytesUsed(t,e){return this._bytesUsed+=4,super._updateBytesUsed(t,e)}}class Go extends qs{writeValue(t,e=this.length){return super.writeValue(Object(Fr.b)(t),e)}}const Zo=new class extends V{visitNull(){return Eo}visitBool(){return no}visitInt(){return vo}visitInt8(){return Io}visitInt16(){return Ao}visitInt32(){return Bo}visitInt64(){return So}visitUint8(){return To}visitUint16(){return Oo}visitUint32(){return Uo}visitUint64(){return Do}visitFloat(){return po}visitFloat16(){return yo}visitFloat32(){return bo}visitFloat64(){return mo}visitUtf8(){return Go}visitBinary(){return ro}visitFixedSizeBinary(){return lo}visitDate(){return io}visitDateDay(){return so}visitDateMillisecond(){return oo}visitTimestamp(){return Vo}visitTimestampSecond(){return Ro}visitTimestampMillisecond(){return jo}visitTimestampMicrosecond(){return Co}visitTimestampNanosecond(){return ko}visitTime(){return Po}visitTimeSecond(){return zo}visitTimeMillisecond(){return Yo}visitTimeMicrosecond(){return $o}visitTimeNanosecond(){return Wo}visitDecimal(){return ao}visitList(){return xo}visitStruct(){return No}visitUnion(){return Ho}visitDenseUnion(){return Ko}visitSparseUnion(){return Jo}visitDictionary(){return uo}visitInterval(){return wo}visitIntervalDayTime(){return go}visitIntervalYearMonth(){return _o}visitFixedSizeList(){return ho}visitMap(){return Lo}};Gs.new=function(t){return new(Zo.getVisitFn(t.type)())(t)},Object.keys(y).map(t=>y[t]).filter(t=>"number"==typeof t).filter(t=>t!==y.NONE).forEach(t=>{Zo.visit(t).prototype._setValue=Mn.getVisitFn(t)}),Go.prototype._setValue=Mn.getVisitFn(y.Binary);class qo{eq(t){return t instanceof qo||(t=new Xo(t)),new sa(this,t)}le(t){return t instanceof qo||(t=new Xo(t)),new oa(this,t)}ge(t){return t instanceof qo||(t=new Xo(t)),new aa(this,t)}lt(t){return new ua(this.ge(t))}gt(t){return new ua(this.le(t))}ne(t){return new ua(this.eq(t))}}class Xo extends qo{constructor(t){super(),this.v=t}}class Qo extends qo{constructor(t){super(),this.name=t}bind(t){if(!this.colidx){this.colidx=-1;const e=t.schema.fields;for(let t=-1;++t<e.length;)if(e[t].name===this.name){this.colidx=t;break}if(this.colidx<0)throw Error(`Failed to bind Col "${this.name}"`)}const e=this.vector=t.getChildAt(this.colidx);return t=>e.get(t)}}class ta{and(...t){return new na(this,...t)}or(...t){return new ia(this,...t)}not(){return new ua(this)}}class ea extends ta{constructor(t,e){super(),this.left=t,this.right=e}bind(t){return this.left instanceof Xo?this.right instanceof Xo?this._bindLitLit(t,this.left,this.right):this._bindLitCol(t,this.left,this.right):this.right instanceof Xo?this._bindColLit(t,this.left,this.right):this._bindColCol(t,this.left,this.right)}}class ra extends ta{constructor(...t){super(),this.children=t}}ra.prototype.children=Object.freeze([]);class na extends ra{constructor(...t){t=t.reduce((t,e)=>t.concat(e instanceof na?e.children:e),[]),super(...t)}bind(t){const e=this.children.map(e=>e.bind(t));return(t,r)=>e.every(e=>e(t,r))}}class ia extends ra{constructor(...t){t=t.reduce((t,e)=>t.concat(e instanceof ia?e.children:e),[]),super(...t)}bind(t){const e=this.children.map(e=>e.bind(t));return(t,r)=>e.some(e=>e(t,r))}}class sa extends ea{_bindLitLit(t,e,r){const n=e.v==r.v;return()=>n}_bindColCol(t,e,r){const n=e.bind(t),i=r.bind(t);return(t,e)=>n(t,e)==i(t,e)}_bindColLit(t,e,r){const n=e.bind(t);if(e.vector instanceof Ke){let t;const n=e.vector;return n.dictionary!==this.lastDictionary?(t=n.reverseLookup(r.v),this.lastDictionary=n.dictionary,this.lastKey=t):t=this.lastKey,-1===t?()=>!1:e=>n.getKey(e)===t}return(t,e)=>n(t,e)==r.v}_bindLitCol(t,e,r){return this._bindColLit(t,r,e)}}class oa extends ea{_bindLitLit(t,e,r){const n=e.v<=r.v;return()=>n}_bindColCol(t,e,r){const n=e.bind(t),i=r.bind(t);return(t,e)=>n(t,e)<=i(t,e)}_bindColLit(t,e,r){const n=e.bind(t);return(t,e)=>n(t,e)<=r.v}_bindLitCol(t,e,r){const n=r.bind(t);return(t,r)=>e.v<=n(t,r)}}class aa extends ea{_bindLitLit(t,e,r){const n=e.v>=r.v;return()=>n}_bindColCol(t,e,r){const n=e.bind(t),i=r.bind(t);return(t,e)=>n(t,e)>=i(t,e)}_bindColLit(t,e,r){const n=e.bind(t);return(t,e)=>n(t,e)>=r.v}_bindLitCol(t,e,r){const n=r.bind(t);return(t,r)=>e.v>=n(t,r)}}class ua extends ta{constructor(t){super(),this.child=t}bind(t){const e=this.child.bind(t);return(t,r)=>!e(t,r)}}class ca extends ta{constructor(t,e){super(),this.next=t,this.bind_=e}bind(t){return this.bind_(t),this.next}}function la(t){return new Xo(t)}function ha(t){return new Qo(t)}function da(...t){return new na(...t)}function fa(...t){return new ia(...t)}function pa(t,e){return new ca(t,e)}xs.prototype.countBy=function(t){return new ya(this.chunks).countBy(t)},xs.prototype.scan=function(t,e){return new ya(this.chunks).scan(t,e)},xs.prototype.filter=function(t){return new ya(this.chunks).filter(t)};class ya extends xs{filter(t){return new ma(this.chunks,t)}scan(t,e){const r=this.chunks,n=r.length;for(let i=-1;++i<n;){const n=r[i];e&&e(n);for(let e=-1,r=n.length;++e<r;)t(e,n)}}countBy(t){const e=this.chunks,r=e.length,n="string"==typeof t?new Qo(t):t;n.bind(e[r-1]);const i=n.vector;if(!G.isDictionary(i.type))throw Error("countBy currently only supports dictionary-encoded columns");const s=Math.ceil(Math.log(i.dictionary.length)/Math.log(256)),o=new(4==s?Uint32Array:s>=2?Uint16Array:Uint8Array)(i.dictionary.length);for(let a=-1;++a<r;){const t=e[a];n.bind(t);const r=n.vector.indices;for(let e=-1,n=t.length;++e<n;){let t=r.get(e);null!==t&&o[t]++}}return new ba(i.dictionary,ir.from(o))}}class ba extends xs{constructor(t,e){const r=new ve([new Ie("values",t.type),new Ie("counts",e.type)]);super(new Ms(r,e.length,[t,e]))}toJSON(){const t=this.getColumnAt(0),e=this.getColumnAt(1),r={};for(let n=-1;++n<this.length;)r[t.get(n)]=e.get(n);return r}}class ma extends ya{constructor(t,e){super(t),this._predicate=e}scan(t,e){const r=this._chunks,n=r.length;for(let i=-1;++i<n;){const n=r[i];e&&e(n);const s=this._predicate.bind(n);for(let e=-1,r=n.length;++e<r;)s(e,n)&&t(e,n)}}count(){let t=0;const e=this._chunks,r=e.length;for(let n=-1;++n<r;){const r=e[n],i=this._predicate.bind(r);for(let e=-1,n=r.length;++e<n;)i(e,r)&&++t}return t}*[Symbol.iterator](){const t=this._chunks,e=t.length;for(let r=-1;++r<e;){const e=t[r],n=this._predicate.bind(e);for(let t=-1,r=e.length;++t<r;)n(t,e)&&(yield e.get(t))}}filter(t){return new ma(this._chunks,this._predicate.and(t))}countBy(t){const e=this._chunks,r=e.length,n="string"==typeof t?new Qo(t):t;n.bind(e[r-1]);const i=n.vector;if(!G.isDictionary(i.type))throw Error("countBy currently only supports dictionary-encoded columns");const s=Math.ceil(Math.log(i.dictionary.length)/Math.log(256)),o=new(4==s?Uint32Array:s>=2?Uint16Array:Uint8Array)(i.dictionary.length);for(let a=-1;++a<r;){const t=e[a],r=this._predicate.bind(t);n.bind(t);const i=n.vector.indices;for(let e=-1,n=t.length;++e<n;){let n=i.get(e);null!==n&&r(e,t)&&o[n]++}}return new ba(i.dictionary,ir.from(o))}}const wa={...o,...s,...n,...Pt,...i};r.d(e,"ArrowType",function(){return m}),r.d(e,"DateUnit",function(){return w}),r.d(e,"IntervalUnit",function(){return A}),r.d(e,"MessageHeader",function(){return B}),r.d(e,"MetadataVersion",function(){return S}),r.d(e,"Precision",function(){return _}),r.d(e,"TimeUnit",function(){return g}),r.d(e,"Type",function(){return y}),r.d(e,"UnionMode",function(){return v}),r.d(e,"VectorType",function(){return I}),r.d(e,"Data",function(){return Yt}),r.d(e,"DataType",function(){return G}),r.d(e,"Null",function(){return Z}),r.d(e,"Bool",function(){return dt}),r.d(e,"Int",function(){return q}),r.d(e,"Int8",function(){return X}),r.d(e,"Int16",function(){return Q}),r.d(e,"Int32",function(){return tt}),r.d(e,"Int64",function(){return et}),r.d(e,"Uint8",function(){return rt}),r.d(e,"Uint16",function(){return nt}),r.d(e,"Uint32",function(){return it}),r.d(e,"Uint64",function(){return st}),r.d(e,"Float",function(){return ot}),r.d(e,"Float16",function(){return at}),r.d(e,"Float32",function(){return ut}),r.d(e,"Float64",function(){return ct}),r.d(e,"Utf8",function(){return ht}),r.d(e,"Binary",function(){return lt}),r.d(e,"FixedSizeBinary",function(){return Nt}),r.d(e,"Date_",function(){return pt}),r.d(e,"DateDay",function(){return yt}),r.d(e,"DateMillisecond",function(){return bt}),r.d(e,"Timestamp",function(){return It}),r.d(e,"TimestampSecond",function(){return At}),r.d(e,"TimestampMillisecond",function(){return Bt}),r.d(e,"TimestampMicrosecond",function(){return St}),r.d(e,"TimestampNanosecond",function(){return Tt}),r.d(e,"Time",function(){return mt}),r.d(e,"TimeSecond",function(){return wt}),r.d(e,"TimeMillisecond",function(){return gt}),r.d(e,"TimeMicrosecond",function(){return _t}),r.d(e,"TimeNanosecond",function(){return vt}),r.d(e,"Decimal",function(){return ft}),r.d(e,"List",function(){return Ft}),r.d(e,"Struct",function(){return xt}),r.d(e,"Union",function(){return Mt}),r.d(e,"DenseUnion",function(){return Lt}),r.d(e,"SparseUnion",function(){return Et}),r.d(e,"Dictionary",function(){return Ct}),r.d(e,"Interval",function(){return Ot}),r.d(e,"IntervalDayTime",function(){return Ut}),r.d(e,"IntervalYearMonth",function(){return Dt}),r.d(e,"FixedSizeList",function(){return Vt}),r.d(e,"Map_",function(){return Rt}),r.d(e,"Table",function(){return xs}),r.d(e,"Column",function(){return ce}),r.d(e,"Schema",function(){return ve}),r.d(e,"Field",function(){return Ie}),r.d(e,"Visitor",function(){return V}),r.d(e,"Vector",function(){return p}),r.d(e,"BaseVector",function(){return Le}),r.d(e,"BinaryVector",function(){return Ee}),r.d(e,"BoolVector",function(){return Ne}),r.d(e,"Chunked",function(){return oe}),r.d(e,"DateVector",function(){return $e}),r.d(e,"DateDayVector",function(){return We}),r.d(e,"DateMillisecondVector",function(){return He}),r.d(e,"DecimalVector",function(){return Je}),r.d(e,"DictionaryVector",function(){return Ke}),r.d(e,"FixedSizeBinaryVector",function(){return Ge}),r.d(e,"FixedSizeListVector",function(){return Ze}),r.d(e,"FloatVector",function(){return qe}),r.d(e,"Float16Vector",function(){return Xe}),r.d(e,"Float32Vector",function(){return Qe}),r.d(e,"Float64Vector",function(){return tr}),r.d(e,"IntervalVector",function(){return er}),r.d(e,"IntervalDayTimeVector",function(){return rr}),r.d(e,"IntervalYearMonthVector",function(){return nr}),r.d(e,"IntVector",function(){return ir}),r.d(e,"Int8Vector",function(){return sr}),r.d(e,"Int16Vector",function(){return or}),r.d(e,"Int32Vector",function(){return ar}),r.d(e,"Int64Vector",function(){return ur}),r.d(e,"Uint8Vector",function(){return cr}),r.d(e,"Uint16Vector",function(){return lr}),r.d(e,"Uint32Vector",function(){return hr}),r.d(e,"Uint64Vector",function(){return dr}),r.d(e,"ListVector",function(){return fr}),r.d(e,"MapVector",function(){return pr}),r.d(e,"NullVector",function(){return yr}),r.d(e,"StructVector",function(){return br}),r.d(e,"TimestampVector",function(){return mr}),r.d(e,"TimestampSecondVector",function(){return wr}),r.d(e,"TimestampMillisecondVector",function(){return gr}),r.d(e,"TimestampMicrosecondVector",function(){return _r}),r.d(e,"TimestampNanosecondVector",function(){return vr}),r.d(e,"TimeVector",function(){return Ir}),r.d(e,"TimeSecondVector",function(){return Ar}),r.d(e,"TimeMillisecondVector",function(){return Br}),r.d(e,"TimeMicrosecondVector",function(){return Sr}),r.d(e,"TimeNanosecondVector",function(){return Tr}),r.d(e,"UnionVector",function(){return Or}),r.d(e,"DenseUnionVector",function(){return Ur}),r.d(e,"SparseUnionVector",function(){return Dr}),r.d(e,"Utf8Vector",function(){return xr}),r.d(e,"ByteStream",function(){return Zi}),r.d(e,"AsyncByteStream",function(){return qi}),r.d(e,"AsyncByteQueue",function(){return Gi}),r.d(e,"RecordBatchReader",function(){return Ns}),r.d(e,"RecordBatchFileReader",function(){return js}),r.d(e,"RecordBatchStreamReader",function(){return Vs}),r.d(e,"AsyncRecordBatchFileReader",function(){return Cs}),r.d(e,"AsyncRecordBatchStreamReader",function(){return Rs}),r.d(e,"RecordBatchWriter",function(){return Ts}),r.d(e,"RecordBatchFileWriter",function(){return Us}),r.d(e,"RecordBatchStreamWriter",function(){return Os}),r.d(e,"RecordBatchJSONWriter",function(){return Ds}),r.d(e,"MessageReader",function(){return as}),r.d(e,"AsyncMessageReader",function(){return us}),r.d(e,"JSONMessageReader",function(){return cs}),r.d(e,"Message",function(){return ji}),r.d(e,"RecordBatch",function(){return Ms}),r.d(e,"DataFrame",function(){return ya}),r.d(e,"FilteredDataFrame",function(){return ma}),r.d(e,"CountByResult",function(){return ba}),r.d(e,"predicate",function(){return a}),r.d(e,"util",function(){return wa}),r.d(e,"Builder",function(){return Gs}),r.d(e,"BinaryBuilder",function(){return ro}),r.d(e,"BoolBuilder",function(){return no}),r.d(e,"DateBuilder",function(){return io}),r.d(e,"DateDayBuilder",function(){return so}),r.d(e,"DateMillisecondBuilder",function(){return oo}),r.d(e,"DecimalBuilder",function(){return ao}),r.d(e,"DictionaryBuilder",function(){return uo}),r.d(e,"FixedSizeBinaryBuilder",function(){return lo}),r.d(e,"FixedSizeListBuilder",function(){return ho}),r.d(e,"FloatBuilder",function(){return po}),r.d(e,"Float16Builder",function(){return yo}),r.d(e,"Float32Builder",function(){return bo}),r.d(e,"Float64Builder",function(){return mo}),r.d(e,"IntervalBuilder",function(){return wo}),r.d(e,"IntervalDayTimeBuilder",function(){return go}),r.d(e,"IntervalYearMonthBuilder",function(){return _o}),r.d(e,"IntBuilder",function(){return vo}),r.d(e,"Int8Builder",function(){return Io}),r.d(e,"Int16Builder",function(){return Ao}),r.d(e,"Int32Builder",function(){return Bo}),r.d(e,"Int64Builder",function(){return So}),r.d(e,"Uint8Builder",function(){return To}),r.d(e,"Uint16Builder",function(){return Oo}),r.d(e,"Uint32Builder",function(){return Uo}),r.d(e,"Uint64Builder",function(){return Do}),r.d(e,"ListBuilder",function(){return xo}),r.d(e,"MapBuilder",function(){return Lo}),r.d(e,"NullBuilder",function(){return Eo}),r.d(e,"StructBuilder",function(){return No}),r.d(e,"TimestampBuilder",function(){return Vo}),r.d(e,"TimestampSecondBuilder",function(){return Ro}),r.d(e,"TimestampMillisecondBuilder",function(){return jo}),r.d(e,"TimestampMicrosecondBuilder",function(){return Co}),r.d(e,"TimestampNanosecondBuilder",function(){return ko}),r.d(e,"TimeBuilder",function(){return Po}),r.d(e,"TimeSecondBuilder",function(){return zo}),r.d(e,"TimeMillisecondBuilder",function(){return Yo}),r.d(e,"TimeMicrosecondBuilder",function(){return $o}),r.d(e,"TimeNanosecondBuilder",function(){return Wo}),r.d(e,"UnionBuilder",function(){return Ho}),r.d(e,"DenseUnionBuilder",function(){return Ko}),r.d(e,"SparseUnionBuilder",function(){return Jo}),r.d(e,"Utf8Builder",function(){return Go}),f.a.toDOMStream=function(t,e){if(Object(te.f)(t))return function(t,e){let r=null;const n=e&&"bytes"===e.type||!1,i=e&&e.highWaterMark||2**24;return new ReadableStream({...e,async start(e){await s(e,r||(r=t[Symbol.asyncIterator]()))},async pull(t){r?await s(t,r):t.close()},async cancel(){r&&r.return&&await r.return(),r=null}},{highWaterMark:n?i:void 0,...e});async function s(t,e){let r,i=null,s=t.desiredSize||null;for(;!(i=await e.next(n?s:null)).done;)if(ArrayBuffer.isView(i.value)&&(r=Object(Pt.toUint8Array)(i.value))&&(null!=s&&n&&(s=s-r.byteLength+1),i.value=r),t.enqueue(i.value),null!=s&&--s<=0)return;t.close()}}(t,e);if(Object(te.i)(t))return function(t,e){let r=null;const n=e&&"bytes"===e.type||!1,i=e&&e.highWaterMark||2**24;return new ReadableStream({...e,start(e){s(e,r||(r=t[Symbol.iterator]()))},pull(t){r?s(t,r):t.close()},cancel(){r&&r.return&&r.return(),r=null}},{highWaterMark:n?i:void 0,...e});function s(t,e){let r,i=null,s=t.desiredSize||null;for(;!(i=e.next(n?s:null)).done;)if(ArrayBuffer.isView(i.value)&&(r=Object(Pt.toUint8Array)(i.value))&&(null!=s&&n&&(s=s-r.byteLength+1),i.value=r),t.enqueue(i.value),null!=s&&--s<=0)return;t.close()}}(t,e);throw Error("toDOMStream() must be called with an Iterable or AsyncIterable")},Ns.throughDOM=function(t,e){const r=new Gi;let n=null;const i=new ReadableStream({async cancel(){await r.close()},async start(t){await s(t,n||(n=await async function(){return await(await Ns.from(r)).open(e)}()))},async pull(t){n?await s(t,n):t.close()}});return{writable:new WritableStream(r,{highWaterMark:16384,...t}),readable:i};async function s(t,e){let r=t.desiredSize,n=null;for(;!(n=await e.next()).done;)if(t.enqueue(n.value),null!=r&&--r<=0)return;t.close()}},Ts.throughDOM=function(t,e){const r=new this(t),n=new qi(r),i=new ReadableStream({type:"bytes",async cancel(){await n.cancel()},async pull(t){await s(t)},async start(t){await s(t)}},{highWaterMark:16384,...e});return{writable:new WritableStream(r,t),readable:i};async function s(t){let e=null,r=t.desiredSize;for(;e=await n.read(r||null);)if(t.enqueue(e),null!=r&&(r-=e.byteLength)<=0)return;t.close()}}}])});
//# sourceMappingURL=Arrow.esnext.min.js.map