diff --git a/.gitignore b/.gitignore index a100b943..3b773338 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,7 @@ package-lock.json # Virtual Env -env/* \ No newline at end of file +env/* + +# example folder +examples/ \ No newline at end of file diff --git a/README.md b/README.md index e11cf98d..149cf06d 100644 --- a/README.md +++ b/README.md @@ -34,21 +34,56 @@ selected_points = plotly_events(fig, click_event=False, hover_event=True) What the component returns: ``` Returns -------- -list of dict - List of dictionaries containing point details (in case multiple overlapping points have been clicked). - - Details can be found here: - https://plotly.com/javascript/plotlyjs-events/#event-data - - Format of dict: + ------- + list of dict + List of dictionaries containing point details (in case multiple overlapping + points have been clicked). + + Details can be found here: + https://plotly.com/javascript/plotlyjs-events/#event-data + + Format of dict: + { + x: float (x value of point), + y: float (y value of point), + z: float (z value of point), # optional enabled using with_z + curveNumber: (index of curve), + pointNumber: (index of selected point), + pointIndex: (index of selected point) + } + + If measurement is enabled: + { + x: float (x value of point), + y: float (y value of point), + z: float (z value of point), # optional enabled using with_z + curveNumber: (index of curve), + pointNumber: (index of selected point), + pointIndex: (index of selected point) + }, + { + measurePointsX: (list of measurement points x value), + measurePointsY: (list of measurement points y value), + measurePointsZ: (list of measurement poitns z value), + dx: (delta x of measurement points, 0 when only one point is clicked), + dy: (delta y of measurement points, 0 when only one point is clicked), + dz: (delta z of measurement points, 0 when only one point is clicked) + dxyz: (delta xyz of measurement points, 0 when only one points is clicked) + dxy: (delta xy of measurement points, 0 when only one point is clicked), + dxz: (delta xz of measurement points, 0 when only one point is clicked), + dyz: (delta yz of measurement points, 0 when only one point is clicked) + } + If get_relayout is enabled, additional returns will happen when the chart is moved around { - x: int (x value of point), - y: int (y value of point), - curveNumber: (index of curve), - pointNumber: (index of selected point), - pointIndex: (index of selected point) + cameraLayout: { + x: float (x camera position) + y: float (y camera position) + z: float (z camera position) + } } + different dictionaries will be returned so you need to handle them + + ``` diff --git a/example.gif b/example.gif index b584444a..b6fafbb3 100644 Binary files a/example.gif and b/example.gif differ diff --git a/src/streamlit_plotly_events.egg-info/PKG-INFO b/src/streamlit_plotly_events.egg-info/PKG-INFO new file mode 100644 index 00000000..509897d8 --- /dev/null +++ b/src/streamlit_plotly_events.egg-info/PKG-INFO @@ -0,0 +1,14 @@ +Metadata-Version: 2.1 +Name: streamlit-plotly-events +Version: 0.0.6 +Summary: Plotly chart component for Streamlit that also allows for events to bubble back up to Streamlit. +Home-page: https://github.com/null-jones/streamlit-plotly-events +Author: Ellie Jones +Author-email: ellie@altaml.com +Requires-Python: >=3.6 +Description-Content-Type: text/plain +License-File: LICENSE +Requires-Dist: streamlit>=0.63 +Requires-Dist: plotly>=4.14.3 + +Plotly chart component for Streamlit that also allows for events to bubble back up to Streamlit. diff --git a/src/streamlit_plotly_events.egg-info/SOURCES.txt b/src/streamlit_plotly_events.egg-info/SOURCES.txt new file mode 100644 index 00000000..9f3cb1c2 --- /dev/null +++ b/src/streamlit_plotly_events.egg-info/SOURCES.txt @@ -0,0 +1,21 @@ +LICENSE +MANIFEST.in +README.md +setup.py +src/streamlit_plotly_events/__init__.py +src/streamlit_plotly_events.egg-info/PKG-INFO +src/streamlit_plotly_events.egg-info/SOURCES.txt +src/streamlit_plotly_events.egg-info/dependency_links.txt +src/streamlit_plotly_events.egg-info/requires.txt +src/streamlit_plotly_events.egg-info/top_level.txt +src/streamlit_plotly_events/frontend/build/asset-manifest.json +src/streamlit_plotly_events/frontend/build/index.html +src/streamlit_plotly_events/frontend/build/precache-manifest.73c82ebc749cad31f76721ccef17783d.js +src/streamlit_plotly_events/frontend/build/service-worker.js +src/streamlit_plotly_events/frontend/build/static/js/2.9330ddf9.chunk.js +src/streamlit_plotly_events/frontend/build/static/js/2.9330ddf9.chunk.js.LICENSE.txt +src/streamlit_plotly_events/frontend/build/static/js/2.9330ddf9.chunk.js.map +src/streamlit_plotly_events/frontend/build/static/js/main.0d52cef4.chunk.js +src/streamlit_plotly_events/frontend/build/static/js/main.0d52cef4.chunk.js.map +src/streamlit_plotly_events/frontend/build/static/js/runtime-main.44d30fc2.js +src/streamlit_plotly_events/frontend/build/static/js/runtime-main.44d30fc2.js.map \ No newline at end of file diff --git a/src/streamlit_plotly_events.egg-info/dependency_links.txt b/src/streamlit_plotly_events.egg-info/dependency_links.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/streamlit_plotly_events.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/src/streamlit_plotly_events.egg-info/requires.txt b/src/streamlit_plotly_events.egg-info/requires.txt new file mode 100644 index 00000000..425c3181 --- /dev/null +++ b/src/streamlit_plotly_events.egg-info/requires.txt @@ -0,0 +1,2 @@ +streamlit>=0.63 +plotly>=4.14.3 diff --git a/src/streamlit_plotly_events.egg-info/top_level.txt b/src/streamlit_plotly_events.egg-info/top_level.txt new file mode 100644 index 00000000..a3c2343a --- /dev/null +++ b/src/streamlit_plotly_events.egg-info/top_level.txt @@ -0,0 +1 @@ +streamlit_plotly_events diff --git a/src/streamlit_plotly_events/__init__.py b/src/streamlit_plotly_events/__init__.py index abd03c49..4ced4539 100644 --- a/src/streamlit_plotly_events/__init__.py +++ b/src/streamlit_plotly_events/__init__.py @@ -6,7 +6,7 @@ # the component, and True when we're ready to package and distribute it. # (This is, of course, optional - there are innumerable ways to manage your # release process.) -_RELEASE = False +_RELEASE = True # Declare a Streamlit component. `declare_component` returns a function # that is used to create instances of the component. We're naming this @@ -47,11 +47,17 @@ def plotly_events( plot_fig, click_event=True, + with_z=False, select_event=False, hover_event=False, override_height=450, override_width="100%", key=None, + plot_clicked_point: bool = False, + clicked_point_size: float = 0.0, + measure_mode: bool = False, + measure_line_width: float = 4.0, + get_relayout: bool = False, ): """Create a new instance of "plotly_events". @@ -73,6 +79,16 @@ def plotly_events( An optional key that uniquely identifies this component. If this is None, and the component's arguments are changed, the component will be re-mounted in the Streamlit frontend and lose its current state. + plot_clicked_point: bool + An optional key if you want the clicked point on the chart to have a red point drawn + to indicate where you clicked (Stable for Scatter 3d plots not yet tested on other types) + clicked_point_size: float + What size to plot the clicked point, will work make a difference when plot_clicked_point is True + measure_mode: bool + Plot measurements after clicking 2 points on the chart, will modify the return value of the component + Measurement and plotting is done is in component space so no need to rerun + measure_line_width: float + What line width to plot when measurement is done, Returns ------- @@ -85,13 +101,45 @@ def plotly_events( Format of dict: { - x: int (x value of point), - y: int (y value of point), + x: float (x value of point), + y: float (y value of point), + z: float (z value of point), # optional enabled using with_z curveNumber: (index of curve), pointNumber: (index of selected point), pointIndex: (index of selected point) } + If measurement is enabled: + { + x: float (x value of point), + y: float (y value of point), + z: float (z value of point), # optional enabled using with_z + curveNumber: (index of curve), + pointNumber: (index of selected point), + pointIndex: (index of selected point) + }, + { + measurePointsX: (list of measurement points x value), + measurePointsY: (list of measurement points y value), + measurePointsZ: (list of measurement poitns z value), + dx: (delta x of measurement points, 0 when only one point is clicked), + dy: (delta y of measurement points, 0 when only one point is clicked), + dz: (delta z of measurement points, 0 when only one point is clicked) + dxyz: (delta xyz of measurement points, 0 when only one points is clicked) + dxy: (delta xy of measurement points, 0 when only one point is clicked), + dxz: (delta xz of measurement points, 0 when only one point is clicked), + dyz: (delta yz of measurement points, 0 when only one point is clicked) + } + If get_relayout is enabled, additional returns will happen when the chart is moved around + { + cameraLayout: { + x: float (x camera position) + y: float (y camera position) + z: float (z camera position) + } + } + different dictionaries will be returned so you need to handle them + """ # kwargs will be exposed to frontend in "args" component_value = _component_func( @@ -100,9 +148,15 @@ def plotly_events( override_width=override_width, key=key, click_event=click_event, + with_z=with_z, select_event=select_event, hover_event=hover_event, - default="[]", # Default return empty JSON list + default="[]", + plot_clicked_point=plot_clicked_point, + clicked_point_size=clicked_point_size, + measure_mode=measure_mode, + measure_line_width=measure_line_width, + get_relayout=get_relayout ) # Parse component_value since it's JSON and return to Streamlit @@ -126,7 +180,7 @@ def plotly_events( # Here we add columns to check auto-resize/etc st.subheader("Plotly Bar Chart (With columns)") - _, c2, _ = st.beta_columns((1, 6, 1)) + _, c2, _ = st.columns((1, 6, 1)) with c2: fig2 = px.bar(x=[0, 1, 2, 3], y=[0, 1, 2, 3]) plot_name_holder2 = st.empty() diff --git a/src/streamlit_plotly_events/frontend/build/asset-manifest.json b/src/streamlit_plotly_events/frontend/build/asset-manifest.json new file mode 100644 index 00000000..cc573bab --- /dev/null +++ b/src/streamlit_plotly_events/frontend/build/asset-manifest.json @@ -0,0 +1,19 @@ +{ + "files": { + "main.js": "./static/js/main.b4df662e.chunk.js", + "main.js.map": "./static/js/main.b4df662e.chunk.js.map", + "runtime-main.js": "./static/js/runtime-main.44d30fc2.js", + "runtime-main.js.map": "./static/js/runtime-main.44d30fc2.js.map", + "static/js/2.9330ddf9.chunk.js": "./static/js/2.9330ddf9.chunk.js", + "static/js/2.9330ddf9.chunk.js.map": "./static/js/2.9330ddf9.chunk.js.map", + "index.html": "./index.html", + "precache-manifest.9c7844760ffbfd02bfd7cf00c7dc1f22.js": "./precache-manifest.9c7844760ffbfd02bfd7cf00c7dc1f22.js", + "service-worker.js": "./service-worker.js", + "static/js/2.9330ddf9.chunk.js.LICENSE.txt": "./static/js/2.9330ddf9.chunk.js.LICENSE.txt" + }, + "entrypoints": [ + "static/js/runtime-main.44d30fc2.js", + "static/js/2.9330ddf9.chunk.js", + "static/js/main.b4df662e.chunk.js" + ] +} \ No newline at end of file diff --git a/src/streamlit_plotly_events/frontend/build/index.html b/src/streamlit_plotly_events/frontend/build/index.html new file mode 100644 index 00000000..11ad3e2f --- /dev/null +++ b/src/streamlit_plotly_events/frontend/build/index.html @@ -0,0 +1 @@ +Streamlit Component
\ No newline at end of file diff --git a/src/streamlit_plotly_events/frontend/build/precache-manifest.9c7844760ffbfd02bfd7cf00c7dc1f22.js b/src/streamlit_plotly_events/frontend/build/precache-manifest.9c7844760ffbfd02bfd7cf00c7dc1f22.js new file mode 100644 index 00000000..9eb59cee --- /dev/null +++ b/src/streamlit_plotly_events/frontend/build/precache-manifest.9c7844760ffbfd02bfd7cf00c7dc1f22.js @@ -0,0 +1,22 @@ +self.__precacheManifest = (self.__precacheManifest || []).concat([ + { + "revision": "e1e87c1e8266a15892e8ee1f57cd1934", + "url": "./index.html" + }, + { + "revision": "0657f05f98f6fe46de1c", + "url": "./static/js/2.9330ddf9.chunk.js" + }, + { + "revision": "177510fbe674e77c7ff004960ab47a68", + "url": "./static/js/2.9330ddf9.chunk.js.LICENSE.txt" + }, + { + "revision": "7f4eec1dbcb1d3e044c4", + "url": "./static/js/main.b4df662e.chunk.js" + }, + { + "revision": "7e9d84e346ce158d1e50", + "url": "./static/js/runtime-main.44d30fc2.js" + } +]); \ No newline at end of file diff --git a/src/streamlit_plotly_events/frontend/build/service-worker.js b/src/streamlit_plotly_events/frontend/build/service-worker.js new file mode 100644 index 00000000..e8f51825 --- /dev/null +++ b/src/streamlit_plotly_events/frontend/build/service-worker.js @@ -0,0 +1,39 @@ +/** + * Welcome to your Workbox-powered service worker! + * + * You'll need to register this file in your web app and you should + * disable HTTP caching for this file too. + * See https://goo.gl/nhQhGp + * + * The rest of the code is auto-generated. Please don't update this file + * directly; instead, make changes to your Workbox build configuration + * and re-run your build process. + * See https://goo.gl/2aRDsh + */ + +importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); + +importScripts( + "./precache-manifest.9c7844760ffbfd02bfd7cf00c7dc1f22.js" +); + +self.addEventListener('message', (event) => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } +}); + +workbox.core.clientsClaim(); + +/** + * The workboxSW.precacheAndRoute() method efficiently caches and responds to + * requests for URLs in the manifest. + * See https://goo.gl/S9QRab + */ +self.__precacheManifest = [].concat(self.__precacheManifest || []); +workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); + +workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("./index.html"), { + + blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/], +}); diff --git a/src/streamlit_plotly_events/frontend/build/static/js/2.9330ddf9.chunk.js b/src/streamlit_plotly_events/frontend/build/static/js/2.9330ddf9.chunk.js new file mode 100644 index 00000000..d735920d --- /dev/null +++ b/src/streamlit_plotly_events/frontend/build/static/js/2.9330ddf9.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.9330ddf9.chunk.js.LICENSE.txt */ +(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[2],[function(t,e,r){"use strict";t.exports=r(7)},function(t,e,r){"use strict";r.d(e,"b",(function(){return cc})),r.d(e,"c",(function(){return uc})),r.d(e,"a",(function(){return oc}));var n={};r.r(n),r.d(n,"memcpy",(function(){return pt})),r.d(n,"joinUint8Arrays",(function(){return dt})),r.d(n,"toArrayBufferView",(function(){return gt})),r.d(n,"toInt8Array",(function(){return mt})),r.d(n,"toInt16Array",(function(){return yt})),r.d(n,"toInt32Array",(function(){return vt})),r.d(n,"toBigInt64Array",(function(){return bt})),r.d(n,"toUint8Array",(function(){return xt})),r.d(n,"toUint16Array",(function(){return _t})),r.d(n,"toUint32Array",(function(){return wt})),r.d(n,"toBigUint64Array",(function(){return Tt})),r.d(n,"toFloat32Array",(function(){return kt})),r.d(n,"toFloat64Array",(function(){return At})),r.d(n,"toUint8ClampedArray",(function(){return Mt})),r.d(n,"toArrayBufferViewIterator",(function(){return Et})),r.d(n,"toInt8ArrayIterator",(function(){return Ct})),r.d(n,"toInt16ArrayIterator",(function(){return Lt})),r.d(n,"toInt32ArrayIterator",(function(){return It})),r.d(n,"toUint8ArrayIterator",(function(){return Ot})),r.d(n,"toUint16ArrayIterator",(function(){return Pt})),r.d(n,"toUint32ArrayIterator",(function(){return Dt})),r.d(n,"toFloat32ArrayIterator",(function(){return zt})),r.d(n,"toFloat64ArrayIterator",(function(){return Rt})),r.d(n,"toUint8ClampedArrayIterator",(function(){return Ft})),r.d(n,"toArrayBufferViewAsyncIterator",(function(){return Bt})),r.d(n,"toInt8ArrayAsyncIterator",(function(){return Nt})),r.d(n,"toInt16ArrayAsyncIterator",(function(){return jt})),r.d(n,"toInt32ArrayAsyncIterator",(function(){return Ut})),r.d(n,"toUint8ArrayAsyncIterator",(function(){return Vt})),r.d(n,"toUint16ArrayAsyncIterator",(function(){return Ht})),r.d(n,"toUint32ArrayAsyncIterator",(function(){return qt})),r.d(n,"toFloat32ArrayAsyncIterator",(function(){return Gt})),r.d(n,"toFloat64ArrayAsyncIterator",(function(){return Yt})),r.d(n,"toUint8ClampedArrayAsyncIterator",(function(){return Wt})),r.d(n,"rebaseValueOffsets",(function(){return Zt})),r.d(n,"compareArrayLike",(function(){return Xt}));var i={};r.r(i),r.d(i,"getBool",(function(){return ge})),r.d(i,"getBit",(function(){return me})),r.d(i,"setBool",(function(){return ye})),r.d(i,"truncateBitmap",(function(){return ve})),r.d(i,"packBools",(function(){return be})),r.d(i,"iterateBits",(function(){return xe})),r.d(i,"popcnt_bit_range",(function(){return _e})),r.d(i,"popcnt_array",(function(){return we})),r.d(i,"popcnt_uint32",(function(){return Te}));var a={};r.r(a),r.d(a,"uint16ToFloat64",(function(){return Ur})),r.d(a,"float64ToUint16",(function(){return Vr}));var o={};r.r(o),r.d(o,"isArrowBigNumSymbol",(function(){return Wr})),r.d(o,"bignumToString",(function(){return $r})),r.d(o,"bignumToBigInt",(function(){return tn})),r.d(o,"BN",(function(){return rn}));var s={};r.r(s),r.d(s,"clampIndex",(function(){return Un})),r.d(s,"clampRange",(function(){return Hn})),r.d(s,"createElementComparator",(function(){return Yn}));var l={};r.r(l),r.d(l,"BaseInt64",(function(){return aa})),r.d(l,"Uint64",(function(){return oa})),r.d(l,"Int64",(function(){return sa})),r.d(l,"Int128",(function(){return la}));var c=r(4),u=r.n(c),f=r(0),h=r.n(f);const p=new WeakMap,d=new WeakMap;function g(t){const e=p.get(t);return console.assert(null!=e,"'this' is expected an Event object, but got",t),e}function m(t){null==t.passiveListener?t.event.cancelable&&(t.canceled=!0,"function"===typeof t.event.preventDefault&&t.event.preventDefault()):"undefined"!==typeof console&&"function"===typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",t.passiveListener)}function y(t,e){p.set(this,{eventTarget:t,event:e,eventPhase:2,currentTarget:t,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:e.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const r=Object.keys(e);for(let n=0;n0){const t=new Array(arguments.length);for(let e=0;e>>0)+4294967296*this.high},C.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},C.Long.ZERO=new C.Long(0,0),C.Builder=function(t){if(t)e=t;else var e=1024;this.bb=C.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},C.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},C.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},C.Builder.prototype.dataBuffer=function(){return this.bb},C.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},C.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=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 n=(r+2)*C.SIZEOF_SHORT;this.addInt16(n);var i=0,a=this.space;t:for(e=0;e=0;n--)this.writeInt8(r.charCodeAt(n))}this.prep(this.minalign,C.SIZEOF_INT),this.addOffset(t),this.bb.setPosition(this.space)},C.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 new Error("FlatBuffers: field "+e+" must be set")},C.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(C.SIZEOF_INT,t*e),this.prep(r,t*e)},C.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},C.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r=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 a=this.space,o=this.bb.bytes();r>24},C.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},C.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},C.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},C.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},C.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},C.ByteBuffer.prototype.readInt64=function(t){return new C.Long(this.readInt32(t),this.readInt32(t+4))},C.ByteBuffer.prototype.readUint64=function(t){return new C.Long(this.readUint32(t),this.readUint32(t+4))},C.ByteBuffer.prototype.readFloat32=function(t){return C.int32[0]=this.readInt32(t),C.float32[0]},C.ByteBuffer.prototype.readFloat64=function(t){return C.int32[C.isLittleEndian?0:1]=this.readInt32(t),C.int32[C.isLittleEndian?1:0]=this.readInt32(t+4),C.float64[0]},C.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},C.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},C.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},C.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},C.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},C.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},C.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},C.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},C.ByteBuffer.prototype.writeFloat32=function(t,e){C.float32[0]=e,this.writeInt32(t,C.int32[0])},C.ByteBuffer.prototype.writeFloat64=function(t,e){C.float64[0]=e,this.writeInt32(t,C.int32[C.isLittleEndian?0:1]),this.writeInt32(t+4,C.int32[C.isLittleEndian?1:0])},C.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return n},C.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},C.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+C.SIZEOF_INT},C.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},C.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=C.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+C.FILE_IDENTIFIER_LENGTH);for(var e=0;e>6*r)+n];r>0;){var a=e>>6*(r-1);i.push(128|63&a),r-=1}return i}}D.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 R({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(e.stream);for(var n,i=new O(r),a=[];!i.endOfStream()&&-1!==(n=this._decoder.handler(i,i.read()));)null!==n&&(Array.isArray(n)?a.push.apply(a,n):a.push(n));if(!this._streaming){do{if(-1===(n=this._decoder.handler(i,i.read())))break;null!==n&&(Array.isArray(n)?a.push.apply(a,n):a.push(n))}while(!i.endOfStream());this._decoder=null}return a.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0)),function(t){for(var e="",r=0;r>10),56320+(1023&n)))}return e}(a)}},z.prototype={encode:function(t,e){t=t?String(t):"",e=I(e),this._streaming||(this._encoder=new F(this._options)),this._streaming=Boolean(e.stream);for(var r,n=[],i=new O(function(t){for(var e=String(t),r=e.length,n=0,i=[];n57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=1023&a,l=1023&o;i.push(65536+(s<<10)+l),n+=1}else i.push(65533)}n+=1}return i}(t));!i.endOfStream()&&-1!==(r=this._encoder.handler(i,i.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(i,i.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)}};const B="function"===typeof Buffer?Buffer:null,N="function"===typeof TextDecoder&&"function"===typeof TextEncoder,j=(t=>{if(N||!B){const e=new t("utf-8");return t=>e.decode(t)}return t=>{const{buffer:e,byteOffset:r,length:n}=xt(t);return B.from(e,r,n).toString()}})("undefined"!==typeof TextDecoder?TextDecoder:D),U=(t=>{if(N||!B){const e=new t;return t=>e.encode(t)}return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return xt(B.from(t,"utf8"))}})("undefined"!==typeof TextEncoder?TextEncoder:z),V=Object.freeze({done:!0,value:void 0});class H{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class q{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 G extends q{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(V);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Jt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Jt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}async throw(t){return await this.abort(t),V}async return(t){return await this.close(),V}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}next(){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(V)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("".concat(this," is closed"))}}const[Y,W]=(()=>{const t=()=>{throw new 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]})(),[Z,X]=(()=>{const t=()=>{throw new 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]})(),[J,K]=(()=>{const t=()=>{throw new 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]})(),Q=t=>"number"===typeof t,$=t=>"boolean"===typeof t,tt=t=>"function"===typeof t,et=t=>null!=t&&Object(t)===t,rt=t=>et(t)&&tt(t.then),nt=t=>et(t)&&tt(t[Symbol.iterator]),it=t=>et(t)&&tt(t[Symbol.asyncIterator]),at=t=>et(t)&&et(t.schema),ot=t=>et(t)&&"done"in t&&"value"in t,st=t=>et(t)&&tt(t.stat)&&Q(t.fd),lt=t=>et(t)&&ct(t.body),ct=t=>et(t)&&tt(t.cancel)&&tt(t.getReader)&&!(t instanceof q),ut=t=>et(t)&&tt(t.read)&&tt(t.pipe)&&$(t.readable)&&!(t instanceof q);var ft=C.ByteBuffer;const ht="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;function pt(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.byteLength;const i=t.byteLength,a=new Uint8Array(t.buffer,t.byteOffset,i),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return a.set(o,r),t}function dt(t,e){let r,n,i,a=function(t){let e,r,n,i,a=t[0]?[t[0]]:[];for(let o,s,l=0,c=0,u=t.length;++lt+e.byteLength,0),s=0,l=-1,c=Math.min(e||1/0,o);for(let u=a.length;++lgt(Int8Array,t),yt=t=>gt(Int16Array,t),vt=t=>gt(Int32Array,t),bt=t=>gt(Z,t),xt=t=>gt(Uint8Array,t),_t=t=>gt(Uint16Array,t),wt=t=>gt(Uint32Array,t),Tt=t=>gt(J,t),kt=t=>gt(Float32Array,t),At=t=>gt(Float64Array,t),Mt=t=>gt(Uint8ClampedArray,t),St=t=>(t.next(),t);function*Et(t,e){const r=function*(t){yield t},n="string"===typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ht?r(e):nt(e)?e:r(e);yield*St(function*(e){let r=null;do{r=e.next(yield gt(t,r))}while(!r.done)}(n[Symbol.iterator]()))}const Ct=t=>Et(Int8Array,t),Lt=t=>Et(Int16Array,t),It=t=>Et(Int32Array,t),Ot=t=>Et(Uint8Array,t),Pt=t=>Et(Uint16Array,t),Dt=t=>Et(Uint32Array,t),zt=t=>Et(Float32Array,t),Rt=t=>Et(Float64Array,t),Ft=t=>Et(Uint8ClampedArray,t);async function*Bt(t,e){if(rt(e))return yield*Bt(t,await e);const r=async function*(t){yield await t},n="string"===typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof ht?r(e):nt(e)?async function*(t){yield*St(function*(t){let e=null;do{e=t.next(yield e&&e.value)}while(!e.done)}(t[Symbol.iterator]()))}(e):it(e)?e:r(e);yield*St(async function*(e){let r=null;do{r=await e.next(yield gt(t,r))}while(!r.done)}(n[Symbol.asyncIterator]()))}const Nt=t=>Bt(Int8Array,t),jt=t=>Bt(Int16Array,t),Ut=t=>Bt(Int32Array,t),Vt=t=>Bt(Uint8Array,t),Ht=t=>Bt(Uint16Array,t),qt=t=>Bt(Uint32Array,t),Gt=t=>Bt(Float32Array,t),Yt=t=>Bt(Float64Array,t),Wt=t=>Bt(Uint8ClampedArray,t);function Zt(t,e,r){if(0!==t){r=r.slice(0,e+1);for(let n=-1;++n<=e;)r[n]+=t}return r}function Xt(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(++rKt(function*(t){let e,r,n,i,a=!1,o=[],s=0;({cmd:n,size:i}=yield null);let l=Ot(t)[Symbol.iterator]();try{do{if(({done:e,value:r}=isNaN(i-s)?l.next(void 0):l.next(i-s)),!e&&r.byteLength>0&&(o.push(r),s+=r.byteLength),e||i<=s)do{({cmd:n,size:i}=yield"peek"===n?dt(o,i)[0]:([r,o,s]=dt(o,i),r))}while(iKt(async function*(t){let e,r,n,i,a=!1,o=[],s=0;({cmd:n,size:i}=yield null);let l=Vt(t)[Symbol.asyncIterator]();try{do{if(({done:e,value:r}=isNaN(i-s)?await l.next(void 0):await l.next(i-s)),!e&&r.byteLength>0&&(o.push(r),s+=r.byteLength),e||i<=s)do{({cmd:n,size:i}=yield"peek"===n?dt(o,i)[0]:([r,o,s]=dt(o,i),r))}while(iKt(async function*(t){let e,r,n,i=!1,a=!1,o=[],s=0;({cmd:r,size:n}=yield null);let l=new Qt(t);try{do{if(({done:i,value:e}=isNaN(n-s)?await l.read(void 0):await l.read(n-s)),!i&&e.byteLength>0&&(o.push(xt(e)),s+=e.byteLength),i||n<=s)do{({cmd:r,size:n}=yield"peek"===r?dt(o,n)[0]:([e,o,s]=dt(o,n),e))}while(nKt(async function*(t){let e,r,n,i=[],a="error",o=!1,s=null,l=0,c=[];if(({cmd:e,size:r}=yield null),t.isTTY)return yield new Uint8Array(0);try{i[0]=$t(t,"end"),i[1]=$t(t,"error");do{if(i[2]=$t(t,"readable"),[a,s]=await Promise.race(i.map(t=>t[2])),"error"===a)break;if((o="end"===a)||(isFinite(r-l)?(n=xt(t.read(r-l)),n.byteLength0&&(c.push(n),l+=n.byteLength)),o||r<=l)do{({cmd:e,size:r}=yield"peek"===e?dt(c,r)[0]:([n,c,l]=dt(c,r),n))}while(r{for(const[r,o]of e)t.off(r,o);try{const e=t.destroy;e&&e.call(t,r),r=void 0}catch(a){r=a||r}finally{null!=r?i(r):n()}})}(i,"error"===a?s:null)}}(t)),toDOMStream(t,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw new Error('"toNodeStream" not available in this environment')}};const Kt=t=>(t.next(),t);class Qt{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=xt(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:a,value:o}=await e.read(new Uint8Array(r,n,i-n));if((n+=o.byteLength){let r,n=t=>r([e,t]);return[e,n,new Promise(i=>(r=i)&&t.once(e,n))]};class te{}var ee,re,ne,ie,ae;ie=ee||(ee={}),ne=ie.apache||(ie.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={}))}((re=ne.arrow||(ne.arrow={})).flatbuf||(re.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={}))}(ee||(ee={})),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={}))}(ee||(ee={})),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={}))}(ee||(ee={})),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={}))}(ee||(ee={})),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={}))}(ee||(ee={})),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",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList"}(e=t.Type||(t.Type={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),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={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createNull(t){return e.startNull(t),e.endNull(t)}}t.Null=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}}t.Struct_=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createList(t){return e.startList(t),e.endList(t)}}t.List=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeList(t){t.startObject(0)}static endLargeList(t){return t.endObject()}static createLargeList(t){return e.startLargeList(t),e.endLargeList(t)}}t.LargeList=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createFixedSizeList(t,r){return e.startFixedSizeList(t),e.addListSize(t,r),e.endFixedSizeList(t)}}t.FixedSizeList=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createMap(t,r){return e.startMap(t),e.addKeysSorted(t,r),e.endMap(t)}}t.Map=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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()}static createUnion(t,e,n){return r.startUnion(t),r.addMode(t,e),r.addTypeIds(t,n),r.endUnion(t)}}e.Union=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createInt(t,r,n){return e.startInt(t),e.addBitWidth(t,r),e.addIsSigned(t,n),e.endInt(t)}}t.Int=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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()}static createFloatingPoint(t,e){return r.startFloatingPoint(t),r.addPrecision(t,e),r.endFloatingPoint(t)}}e.FloatingPoint=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}}t.Utf8=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}}t.Binary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}}t.LargeUtf8=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}}t.LargeBinary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createFixedSizeBinary(t,r){return e.startFixedSizeBinary(t),e.addByteWidth(t,r),e.endFixedSizeBinary(t)}}t.FixedSizeBinary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createBool(t){return e.startBool(t),e.endBool(t)}}t.Bool=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createDecimal(t,r,n){return e.startDecimal(t),e.addPrecision(t,r),e.addScale(t,n),e.endDecimal(t)}}t.Decimal=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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()}static createDate(t,e){return r.startDate(t),r.addUnit(t,e),r.endDate(t)}}e.Date=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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()}static createTime(t,e,n){return r.startTime(t),r.addUnit(t,e),r.addBitWidth(t,n),r.endTime(t)}}e.Time=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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()}static createTimestamp(t,e,n){return r.startTimestamp(t),r.addUnit(t,e),r.addTimezone(t,n),r.endTimestamp(t)}}e.Timestamp=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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()}static createInterval(t,e){return r.startInterval(t),r.addUnit(t,e),r.endInterval(t)}}e.Interval=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDuration(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}static startDuration(t){t.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,t.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return r.startDuration(t),r.addUnit(t,e),r.endDuration(t)}}e.Duration=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,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()}static createKeyValue(t,r,n){return e.startKeyValue(t),e.addKey(t,r),e.addValue(t,n),e.endKeyValue(t)}}t.KeyValue=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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()}static createDictionaryEncoding(t,e,n,i){return r.startDictionaryEncoding(t),r.addId(t,e),r.addIndexType(t,n),r.addIsOrdered(t,i),r.endDictionaryEncoding(t)}}e.DictionaryEncoding=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,16);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,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}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 addCustomMetadata(t,e){t.addFieldOffset(6,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()}static createField(t,e,n,i,a,o,s,l){return r.startField(t),r.addName(t,e),r.addNullable(t,n),r.addTypeType(t,i),r.addType(t,a),r.addDictionary(t,o),r.addChildren(t,s),r.addCustomMetadata(t,l),r.endField(t)}}e.Field=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){t.Buffer=class{constructor(){this.bb=null,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={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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)}static createSchema(t,e,n,i){return r.startSchema(t),r.addEndianness(t,e),r.addFields(t,n),r.addCustomMetadata(t,i),r.endSchema(t)}}e.Schema=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){t.Schema=ee.apache.arrow.flatbuf.Schema}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ae||(ae={})),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",t[t.SparseTensor=5]="SparseTensor"}(e=t.MessageHeader||(t.MessageHeader={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ae||(ae={})),function(t){!function(t){!function(t){!function(t){t.FieldNode=class{constructor(){this.bb=null,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={}))}(ae||(ae={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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 ee.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()}static createRecordBatch(t,e,n,i){return r.startRecordBatch(t),r.addLength(t,e),r.addNodes(t,n),r.addBuffers(t,i),r.endRecordBatch(t)}}e.RecordBatch=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ae||(ae={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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()}static createDictionaryBatch(t,e,n,i){return r.startDictionaryBatch(t),r.addId(t,e),r.addData(t,n),r.addIsDelta(t,i),r.endDictionaryBatch(t)}}e.DictionaryBatch=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ae||(ae={})),function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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):ee.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)}customMetadata(t,e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new ee.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ee.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 addCustomMetadata(t,e){t.addFieldOffset(4,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 endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static createMessage(t,e,n,i,a,o){return r.startMessage(t),r.addVersion(t,e),r.addHeaderType(t,n),r.addHeader(t,i),r.addBodyLength(t,a),r.addCustomMetadata(t,o),r.endMessage(t)}}e.Message=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ae||(ae={}));ee.apache.arrow.flatbuf.Type;var oe,se,le=ee.apache.arrow.flatbuf.DateUnit,ce=ee.apache.arrow.flatbuf.TimeUnit,ue=ee.apache.arrow.flatbuf.Precision,fe=ee.apache.arrow.flatbuf.UnionMode,he=ee.apache.arrow.flatbuf.IntervalUnit,pe=ae.apache.arrow.flatbuf.MessageHeader,de=ee.apache.arrow.flatbuf.MetadataVersion;function ge(t,e,r,n){return 0!==(r&1<>n}function ye(t,e,r){return r?!!(t[e>>3]|=1<>3]&=~(1<0||r.byteLength>3):be(xe(r,t,e,null,ge)).subarray(0,n)),i}return r}function be(t){let e=[],r=0,n=0,i=0;for(const o of t)o&&(i|=1<0)&&(e[r++]=i);let a=new Uint8Array(e.length+7&-8);return a.set(e),a}function*xe(t,e,r,n,i){let a=e%8,o=e>>3,s=0,l=r;for(;l>0;a=0){let e=t[o++];do{yield i(n,s++,e,a)}while(--l>0&&++a<8)}}function _e(t,e,r){if(r-e<=0)return 0;if(r-e<8){let n=0;for(const i of xe(t,e,r-e,t,me))n+=i;return n}const n=r>>3<<3,i=e+(e%8===0?0:8-e%8);return _e(t,e,i)+_e(t,n,r)+we(t,i>>3,n-i>>3)}function we(t,e,r){let n=0,i=0|e;const a=new DataView(t.buffer,t.byteOffset,t.byteLength),o=void 0===r?t.byteLength:i+r;for(;o-i>=4;)n+=Te(a.getUint32(i)),i+=4;for(;o-i>=2;)n+=Te(a.getUint16(i)),i+=2;for(;o-i>=1;)n+=Te(a.getUint8(i)),i+=1;return n}function Te(t){let e=0|t;return e-=e>>>1&1431655765,e=(858993459&e)+(e>>>2&858993459),16843009*(e+(e>>>4)&252645135)>>>24}!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"}(oe||(oe={})),function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"}(se||(se={}));class ke{visitMany(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;nthis.visit(t,...r.map(t=>t[e])))}visit(){for(var t=arguments.length,e=new Array(t),r=0;r2&&void 0!==arguments[2])||arguments[2],n=null,i=oe.NONE;e instanceof br||e instanceof te?i=Ae(e.type):e instanceof Fe?i=Ae(e):"number"!==typeof(i=e)&&(i=oe[e]);switch(i){case oe.Null:n=t.visitNull;break;case oe.Bool:n=t.visitBool;break;case oe.Int:n=t.visitInt;break;case oe.Int8:n=t.visitInt8||t.visitInt;break;case oe.Int16:n=t.visitInt16||t.visitInt;break;case oe.Int32:n=t.visitInt32||t.visitInt;break;case oe.Int64:n=t.visitInt64||t.visitInt;break;case oe.Uint8:n=t.visitUint8||t.visitInt;break;case oe.Uint16:n=t.visitUint16||t.visitInt;break;case oe.Uint32:n=t.visitUint32||t.visitInt;break;case oe.Uint64:n=t.visitUint64||t.visitInt;break;case oe.Float:n=t.visitFloat;break;case oe.Float16:n=t.visitFloat16||t.visitFloat;break;case oe.Float32:n=t.visitFloat32||t.visitFloat;break;case oe.Float64:n=t.visitFloat64||t.visitFloat;break;case oe.Utf8:n=t.visitUtf8;break;case oe.Binary:n=t.visitBinary;break;case oe.FixedSizeBinary:n=t.visitFixedSizeBinary;break;case oe.Date:n=t.visitDate;break;case oe.DateDay:n=t.visitDateDay||t.visitDate;break;case oe.DateMillisecond:n=t.visitDateMillisecond||t.visitDate;break;case oe.Timestamp:n=t.visitTimestamp;break;case oe.TimestampSecond:n=t.visitTimestampSecond||t.visitTimestamp;break;case oe.TimestampMillisecond:n=t.visitTimestampMillisecond||t.visitTimestamp;break;case oe.TimestampMicrosecond:n=t.visitTimestampMicrosecond||t.visitTimestamp;break;case oe.TimestampNanosecond:n=t.visitTimestampNanosecond||t.visitTimestamp;break;case oe.Time:n=t.visitTime;break;case oe.TimeSecond:n=t.visitTimeSecond||t.visitTime;break;case oe.TimeMillisecond:n=t.visitTimeMillisecond||t.visitTime;break;case oe.TimeMicrosecond:n=t.visitTimeMicrosecond||t.visitTime;break;case oe.TimeNanosecond:n=t.visitTimeNanosecond||t.visitTime;break;case oe.Decimal:n=t.visitDecimal;break;case oe.List:n=t.visitList;break;case oe.Struct:n=t.visitStruct;break;case oe.Union:n=t.visitUnion;break;case oe.DenseUnion:n=t.visitDenseUnion||t.visitUnion;break;case oe.SparseUnion:n=t.visitSparseUnion||t.visitUnion;break;case oe.Dictionary:n=t.visitDictionary;break;case oe.Interval:n=t.visitInterval;break;case oe.IntervalDayTime:n=t.visitIntervalDayTime||t.visitInterval;break;case oe.IntervalYearMonth:n=t.visitIntervalYearMonth||t.visitInterval;break;case oe.FixedSizeList:n=t.visitFixedSizeList;break;case oe.Map:n=t.visitMap}if("function"===typeof n)return n;if(!r)return()=>null;throw new Error("Unrecognized type '".concat(oe[i],"'"))}(this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}visitNull(t){return null}visitBool(t){return null}visitInt(t){return null}visitFloat(t){return null}visitUtf8(t){return null}visitBinary(t){return null}visitFixedSizeBinary(t){return null}visitDate(t){return null}visitTimestamp(t){return null}visitTime(t){return null}visitDecimal(t){return null}visitList(t){return null}visitStruct(t){return null}visitUnion(t){return null}visitDictionary(t){return null}visitInterval(t){return null}visitFixedSizeList(t){return null}visitMap(t){return null}}function Ae(t){switch(t.typeId){case oe.Null:return oe.Null;case oe.Int:const{bitWidth:e,isSigned:r}=t;switch(e){case 8:return r?oe.Int8:oe.Uint8;case 16:return r?oe.Int16:oe.Uint16;case 32:return r?oe.Int32:oe.Uint32;case 64:return r?oe.Int64:oe.Uint64}return oe.Int;case oe.Float:switch(t.precision){case ue.HALF:return oe.Float16;case ue.SINGLE:return oe.Float32;case ue.DOUBLE:return oe.Float64}return oe.Float;case oe.Binary:return oe.Binary;case oe.Utf8:return oe.Utf8;case oe.Bool:return oe.Bool;case oe.Decimal:return oe.Decimal;case oe.Time:switch(t.unit){case ce.SECOND:return oe.TimeSecond;case ce.MILLISECOND:return oe.TimeMillisecond;case ce.MICROSECOND:return oe.TimeMicrosecond;case ce.NANOSECOND:return oe.TimeNanosecond}return oe.Time;case oe.Timestamp:switch(t.unit){case ce.SECOND:return oe.TimestampSecond;case ce.MILLISECOND:return oe.TimestampMillisecond;case ce.MICROSECOND:return oe.TimestampMicrosecond;case ce.NANOSECOND:return oe.TimestampNanosecond}return oe.Timestamp;case oe.Date:switch(t.unit){case le.DAY:return oe.DateDay;case le.MILLISECOND:return oe.DateMillisecond}return oe.Date;case oe.Interval:switch(t.unit){case he.DAY_TIME:return oe.IntervalDayTime;case he.YEAR_MONTH:return oe.IntervalYearMonth}return oe.Interval;case oe.Map:return oe.Map;case oe.List:return oe.List;case oe.Struct:return oe.Struct;case oe.Union:switch(t.mode){case fe.Dense:return oe.DenseUnion;case fe.Sparse:return oe.SparseUnion}return oe.Union;case oe.FixedSizeBinary:return oe.FixedSizeBinary;case oe.FixedSizeList:return oe.FixedSizeList;case oe.Dictionary:return oe.Dictionary}throw new Error("Unrecognized type '".concat(oe[t.typeId],"'"))}ke.prototype.visitInt8=null,ke.prototype.visitInt16=null,ke.prototype.visitInt32=null,ke.prototype.visitInt64=null,ke.prototype.visitUint8=null,ke.prototype.visitUint16=null,ke.prototype.visitUint32=null,ke.prototype.visitUint64=null,ke.prototype.visitFloat16=null,ke.prototype.visitFloat32=null,ke.prototype.visitFloat64=null,ke.prototype.visitDateDay=null,ke.prototype.visitDateMillisecond=null,ke.prototype.visitTimestampSecond=null,ke.prototype.visitTimestampMillisecond=null,ke.prototype.visitTimestampMicrosecond=null,ke.prototype.visitTimestampNanosecond=null,ke.prototype.visitTimeSecond=null,ke.prototype.visitTimeMillisecond=null,ke.prototype.visitTimeMicrosecond=null,ke.prototype.visitTimeNanosecond=null,ke.prototype.visitDenseUnion=null,ke.prototype.visitSparseUnion=null,ke.prototype.visitIntervalDayTime=null,ke.prototype.visitIntervalYearMonth=null;class Me extends ke{compareSchemas(t,e){return t===e||e instanceof t.constructor&&Re.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)=>Re.compareField(t,e[r]))}compareField(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&Re.visit(t.type,e.type)}}function Se(t,e){return e instanceof t.constructor}function Ee(t,e){return t===e||Se(t,e)}function Ce(t,e){return t===e||Se(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function Le(t,e){return t===e||Se(t,e)&&t.precision===e.precision}function Ie(t,e){return t===e||Se(t,e)&&t.unit===e.unit}function Oe(t,e){return t===e||Se(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function Pe(t,e){return t===e||Se(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function De(t,e){return t===e||Se(t,e)&&t.mode===e.mode&&t.typeIds.every((t,r)=>t===e.typeIds[r])&&Re.compareFields(t.children,e.children)}function ze(t,e){return t===e||Se(t,e)&&t.unit===e.unit}Me.prototype.visitNull=Ee,Me.prototype.visitBool=Ee,Me.prototype.visitInt=Ce,Me.prototype.visitInt8=Ce,Me.prototype.visitInt16=Ce,Me.prototype.visitInt32=Ce,Me.prototype.visitInt64=Ce,Me.prototype.visitUint8=Ce,Me.prototype.visitUint16=Ce,Me.prototype.visitUint32=Ce,Me.prototype.visitUint64=Ce,Me.prototype.visitFloat=Le,Me.prototype.visitFloat16=Le,Me.prototype.visitFloat32=Le,Me.prototype.visitFloat64=Le,Me.prototype.visitUtf8=Ee,Me.prototype.visitBinary=Ee,Me.prototype.visitFixedSizeBinary=function(t,e){return t===e||Se(t,e)&&t.byteWidth===e.byteWidth},Me.prototype.visitDate=Ie,Me.prototype.visitDateDay=Ie,Me.prototype.visitDateMillisecond=Ie,Me.prototype.visitTimestamp=Oe,Me.prototype.visitTimestampSecond=Oe,Me.prototype.visitTimestampMillisecond=Oe,Me.prototype.visitTimestampMicrosecond=Oe,Me.prototype.visitTimestampNanosecond=Oe,Me.prototype.visitTime=Pe,Me.prototype.visitTimeSecond=Pe,Me.prototype.visitTimeMillisecond=Pe,Me.prototype.visitTimeMicrosecond=Pe,Me.prototype.visitTimeNanosecond=Pe,Me.prototype.visitDecimal=Ee,Me.prototype.visitList=function(t,e){return t===e||Se(t,e)&&t.children.length===e.children.length&&Re.compareFields(t.children,e.children)},Me.prototype.visitStruct=function(t,e){return t===e||Se(t,e)&&t.children.length===e.children.length&&Re.compareFields(t.children,e.children)},Me.prototype.visitUnion=De,Me.prototype.visitDenseUnion=De,Me.prototype.visitSparseUnion=De,Me.prototype.visitDictionary=function(t,e){return t===e||Se(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&Re.visit(t.indices,e.indices)&&Re.visit(t.dictionary,e.dictionary)},Me.prototype.visitInterval=ze,Me.prototype.visitIntervalDayTime=ze,Me.prototype.visitIntervalYearMonth=ze,Me.prototype.visitFixedSizeList=function(t,e){return t===e||Se(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&Re.compareFields(t.children,e.children)},Me.prototype.visitMap=function(t,e){return t===e||Se(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&Re.compareFields(t.children,e.children)};const Re=new Me;class Fe{static isNull(t){return t&&t.typeId===oe.Null}static isInt(t){return t&&t.typeId===oe.Int}static isFloat(t){return t&&t.typeId===oe.Float}static isBinary(t){return t&&t.typeId===oe.Binary}static isUtf8(t){return t&&t.typeId===oe.Utf8}static isBool(t){return t&&t.typeId===oe.Bool}static isDecimal(t){return t&&t.typeId===oe.Decimal}static isDate(t){return t&&t.typeId===oe.Date}static isTime(t){return t&&t.typeId===oe.Time}static isTimestamp(t){return t&&t.typeId===oe.Timestamp}static isInterval(t){return t&&t.typeId===oe.Interval}static isList(t){return t&&t.typeId===oe.List}static isStruct(t){return t&&t.typeId===oe.Struct}static isUnion(t){return t&&t.typeId===oe.Union}static isFixedSizeBinary(t){return t&&t.typeId===oe.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===oe.FixedSizeList}static isMap(t){return t&&t.typeId===oe.Map}static isDictionary(t){return t&&t.typeId===oe.Dictionary}get typeId(){return oe.NONE}compareTo(t){return Re.visit(this,t)}}var Be;Fe[Symbol.toStringTag]=((Be=Fe.prototype).children=null,Be.ArrayType=Array,Be[Symbol.toStringTag]="DataType");class Ne extends Fe{toString(){return"Null"}get typeId(){return oe.Null}}Ne[Symbol.toStringTag]=(t=>t[Symbol.toStringTag]="Null")(Ne.prototype);class je extends Fe{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return oe.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 new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}je[Symbol.toStringTag]=(t=>(t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"))(je.prototype);class Ue extends je{constructor(){super(!0,8)}}class Ve extends je{constructor(){super(!0,16)}}class He extends je{constructor(){super(!0,32)}}class qe extends je{constructor(){super(!0,64)}}class Ge extends je{constructor(){super(!1,8)}}class Ye extends je{constructor(){super(!1,16)}}class We extends je{constructor(){super(!1,32)}}class Ze extends je{constructor(){super(!1,64)}}Object.defineProperty(Ue.prototype,"ArrayType",{value:Int8Array}),Object.defineProperty(Ve.prototype,"ArrayType",{value:Int16Array}),Object.defineProperty(He.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(qe.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(Ge.prototype,"ArrayType",{value:Uint8Array}),Object.defineProperty(Ye.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty(We.prototype,"ArrayType",{value:Uint32Array}),Object.defineProperty(Ze.prototype,"ArrayType",{value:Uint32Array});class Xe extends Fe{constructor(t){super(),this.precision=t}get typeId(){return oe.Float}get ArrayType(){switch(this.precision){case ue.HALF:return Uint16Array;case ue.SINGLE:return Float32Array;case ue.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}}Xe[Symbol.toStringTag]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(Xe.prototype);class Je extends Xe{constructor(){super(ue.HALF)}}class Ke extends Xe{constructor(){super(ue.SINGLE)}}class Qe extends Xe{constructor(){super(ue.DOUBLE)}}Object.defineProperty(Je.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty(Ke.prototype,"ArrayType",{value:Float32Array}),Object.defineProperty(Qe.prototype,"ArrayType",{value:Float64Array});class $e extends Fe{constructor(){super()}get typeId(){return oe.Binary}toString(){return"Binary"}}$e[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))($e.prototype);class tr extends Fe{constructor(){super()}get typeId(){return oe.Utf8}toString(){return"Utf8"}}tr[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(tr.prototype);class er extends Fe{constructor(){super()}get typeId(){return oe.Bool}toString(){return"Bool"}}er[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(er.prototype);class rr extends Fe{constructor(t,e){super(),this.scale=t,this.precision=e}get typeId(){return oe.Decimal}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}}rr[Symbol.toStringTag]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))(rr.prototype);class nr extends Fe{constructor(t){super(),this.unit=t}get typeId(){return oe.Date}toString(){return"Date".concat(32*(this.unit+1),"<").concat(le[this.unit],">")}}nr[Symbol.toStringTag]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Date"))(nr.prototype);class ir extends nr{constructor(){super(le.DAY)}}class ar extends nr{constructor(){super(le.MILLISECOND)}}class or extends Fe{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return oe.Time}toString(){return"Time".concat(this.bitWidth,"<").concat(ce[this.unit],">")}}or[Symbol.toStringTag]=(t=>(t.unit=null,t.bitWidth=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Time"))(or.prototype);class sr extends Fe{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return oe.Timestamp}toString(){return"Timestamp<".concat(ce[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}}sr[Symbol.toStringTag]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Timestamp"))(sr.prototype);class lr extends Fe{constructor(t){super(),this.unit=t}get typeId(){return oe.Interval}toString(){return"Interval<".concat(he[this.unit],">")}}lr[Symbol.toStringTag]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(lr.prototype);class cr extends Fe{constructor(t){super(),this.children=[t]}get typeId(){return oe.List}toString(){return"List<".concat(this.valueType,">")}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}cr[Symbol.toStringTag]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(cr.prototype);class ur extends Fe{constructor(t){super(),this.children=t}get typeId(){return oe.Struct}toString(){return"Struct<{".concat(this.children.map(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}}ur[Symbol.toStringTag]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))(ur.prototype);class fr extends Fe{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 oe.Union}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(t=>"".concat(t.type)).join(" | "),">")}}fr[Symbol.toStringTag]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"))(fr.prototype);class hr extends Fe{constructor(t){super(),this.byteWidth=t}get typeId(){return oe.FixedSizeBinary}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}}hr[Symbol.toStringTag]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(hr.prototype);class pr extends Fe{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return oe.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}pr[Symbol.toStringTag]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(pr.prototype);class dr extends Fe{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.children=[t],this.keysSorted=e}get typeId(){return oe.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}toString(){return"Map<{".concat(this.children[0].type.children.map(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}}dr[Symbol.toStringTag]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(dr.prototype);const gr=(mr=-1,()=>++mr);var mr;class yr extends Fe{constructor(t,e,r,n){super(),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=null==r?gr():"number"===typeof r?r:r.low}get typeId(){return oe.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return"Dictionary<".concat(this.indices,", ").concat(this.dictionary,">")}}function vr(t){let e=t;switch(t.typeId){case oe.Decimal:return 4;case oe.Timestamp:return 2;case oe.Date:case oe.Interval:return 1+e.unit;case oe.Int:case oe.Time:return+(e.bitWidth>32)+1;case oe.FixedSizeList:return e.listSize;case oe.FixedSizeBinary:return e.byteWidth;default:return 1}}yr[Symbol.toStringTag]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"))(yr.prototype);class br{constructor(t,e,r,n,i,a,o){let s;this.type=t,this.dictionary=o,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=(a||[]).map(t=>t instanceof br?t:t.data),i instanceof br?(this.stride=i.stride,this.values=i.values,this.typeIds=i.typeIds,this.nullBitmap=i.nullBitmap,this.valueOffsets=i.valueOffsets):(this.stride=vr(t),i&&((s=i[0])&&(this.valueOffsets=s),(s=i[1])&&(this.values=s),(s=i[2])&&(this.nullBitmap=s),(s=i[3])&&(this.typeIds=s)))}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:e,values:r,nullBitmap:n,typeIds:i}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),this.childData.reduce((t,e)=>t+e.byteLength,t)}get nullCount(){let t,e=this._nullCount;return e<=-1&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-_e(t,this.offset,this.offset+this.length)),e}clone(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.offset,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.length,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._nullCount,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.childData;return new br(t,e,r,n,i,a,this.dictionary)}slice(t,e){const{stride:r,typeId:n,childData:i}=this,a=+(0===this._nullCount)-1,o=16===n?r:1,s=this._sliceBuffers(t,e,r,n);return this.clone(this.type,this.offset+t,e,a,s,!i.length||this.valueOffsets?i:this._sliceChildren(i,o*t,o*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===oe.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:r}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(ve(this.offset,e,this.nullBitmap),0);const i=this.buffers;return i[se.VALIDITY]=n,this.clone(this.type,0,t,r+(t-e),i)}_sliceBuffers(t,e,r,n){let i,{buffers:a}=this;return(i=a[se.TYPE])&&(a[se.TYPE]=i.subarray(t,t+e)),(i=a[se.OFFSET])&&(a[se.OFFSET]=i.subarray(t,t+e+1))||(i=a[se.DATA])&&(a[se.DATA]=6===n?i:i.subarray(r*t,r*(t+e))),a}_sliceChildren(t,e,r){return t.map(t=>t.slice(e,r))}static new(t,e,r,n,i,a,o){switch(i instanceof br?i=i.buffers:i||(i=[]),t.typeId){case oe.Null:return br.Null(t,e,r);case oe.Int:return br.Int(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.Dictionary:return br.Dictionary(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[],o);case oe.Float:return br.Float(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.Bool:return br.Bool(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.Decimal:return br.Decimal(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.Date:return br.Date(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.Time:return br.Time(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.Timestamp:return br.Timestamp(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.Interval:return br.Interval(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.FixedSizeBinary:return br.FixedSizeBinary(t,e,r,n||0,i[se.VALIDITY],i[se.DATA]||[]);case oe.Binary:return br.Binary(t,e,r,n||0,i[se.VALIDITY],i[se.OFFSET]||[],i[se.DATA]||[]);case oe.Utf8:return br.Utf8(t,e,r,n||0,i[se.VALIDITY],i[se.OFFSET]||[],i[se.DATA]||[]);case oe.List:return br.List(t,e,r,n||0,i[se.VALIDITY],i[se.OFFSET]||[],(a||[])[0]);case oe.FixedSizeList:return br.FixedSizeList(t,e,r,n||0,i[se.VALIDITY],(a||[])[0]);case oe.Struct:return br.Struct(t,e,r,n||0,i[se.VALIDITY],a||[]);case oe.Map:return br.Map(t,e,r,n||0,i[se.VALIDITY],i[se.OFFSET]||[],(a||[])[0]);case oe.Union:return br.Union(t,e,r,n||0,i[se.VALIDITY],i[se.TYPE]||[],i[se.OFFSET]||a,a)}throw new Error("Unrecognized typeId ".concat(t.typeId))}static Null(t,e,r){return new br(t,e,r,0)}static Int(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static Dictionary(t,e,r,n,i,a,o){return new br(t,e,r,n,[void 0,gt(t.indices.ArrayType,a),xt(i)],[],o)}static Float(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static Bool(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static Decimal(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static Date(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static Time(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static Timestamp(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static Interval(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static FixedSizeBinary(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,gt(t.ArrayType,a),xt(i)])}static Binary(t,e,r,n,i,a,o){return new br(t,e,r,n,[vt(a),xt(o),xt(i)])}static Utf8(t,e,r,n,i,a,o){return new br(t,e,r,n,[vt(a),xt(o),xt(i)])}static List(t,e,r,n,i,a,o){return new br(t,e,r,n,[vt(a),void 0,xt(i)],[o])}static FixedSizeList(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,void 0,xt(i)],[a])}static Struct(t,e,r,n,i,a){return new br(t,e,r,n,[void 0,void 0,xt(i)],a)}static Map(t,e,r,n,i,a,o){return new br(t,e,r,n,[vt(a),void 0,xt(i)],[o])}static Union(t,e,r,n,i,a,o,s){const l=[void 0,void 0,xt(i),gt(t.ArrayType,a)];return t.mode===fe.Sparse?new br(t,e,r,n,l,o):(l[se.OFFSET]=vt(o),new br(t,e,r,n,l,s))}}br.prototype.childData=Object.freeze([]);function xr(t){if(null===t)return"null";if(void 0===t)return"undefined";switch(typeof t){case"number":case"bigint":return"".concat(t);case"string":return'"'.concat(t,'"')}return"function"===typeof t[Symbol.toPrimitive]?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?"[".concat(t,"]"):JSON.stringify(t)}function _r(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) {".concat(r.map(t=>"\n case ".concat(function(t){if("bigint"!==typeof t)return xr(t);if(W)return"".concat(xr(t),"n");return'"'.concat(xr(t),'"')}(t),":")).join(""),"\n return false;\n }")),t.length!==r.length&&(e="if (x !== x) return false;\n".concat(e)),new Function("x","".concat(e,"\nreturn true;"))}const wr=(t,e)=>(t*e+63&-64||64)/e;class Tr{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.buffer=t,this.stride=e,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=t.length/e|0)}get byteLength(){return this.length*this.stride*this.BYTES_PER_ELEMENT|0}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,e){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;const e=this.stride,r=this.length*e,n=this.buffer.length;r>=n&&this._resize(wr(0===n?1*r:2*r,this.BYTES_PER_ELEMENT))}return this}flush(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length;t=wr(t*this.stride,this.BYTES_PER_ELEMENT);const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.length>=e?t.subarray(0,e):pt(new t.constructor(e),t,0)}(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=pt(new this.ArrayType(t),this.buffer)}}Tr.prototype.offset=0;class kr extends Tr{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,e){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=e,this}}class Ar extends kr{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array(0),1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,e){const{buffer:r}=this.reserve(t-this.length+1),n=t>>3,i=t%8,a=r[n]>>i&1;return e?0===a&&(r[n]|=1<0&&void 0!==arguments[0]?arguments[0]:new Int32Array(1),1)}append(t){return this.set(this.length-1,t)}set(t,e){const r=this.length-1,n=this.reserve(t-r+1).buffer;return r0&&void 0!==arguments[0]?arguments[0]:this.length-1;return t>this.length&&this.set(t-1,0),super.flush(t+1)}}class Sr extends Tr{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?Z:J)}set(t,e){switch(this.reserve(t-this.length+1),typeof e){case"bigint":this.buffer64[t]=e;break;case"number":this.buffer[t*this.stride]=e;break;default:this.buffer.set(e,t*this.stride)}return this}_resize(t){const e=super._resize(t),r=e.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return W&&(this.buffer64=new this.ArrayType64(e.buffer,e.byteOffset,r)),e}}class Er{constructor(t){let{type:e,nullValues:r}=t;this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=r,this.stride=vr(e),this._nulls=new Ar,r&&r.length>0&&(this._isValid=_r(r))}static new(t){}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}static throughIterable(t){return function(t){const{queueingStrategy:e="count"}=t,{highWaterMark:r=("bytes"!==e?1e3:16384)}=t,n="bytes"!==e?"length":"byteLength";return function*(e){let i=0,a=Er.new(t);for(const t of e)a.append(t)[n]>=r&&++i&&(yield a.toVector());(a.finish().length>0||0===i)&&(yield a.toVector())}}(t)}static throughAsyncIterable(t){return function(t){const{queueingStrategy:e="count"}=t,{highWaterMark:r=("bytes"!==e?1e3:16384)}=t,n="bytes"!==e?"length":"byteLength";return async function*(e){let i=0,a=Er.new(t);for await(const t of e)a.append(t)[n]>=r&&++i&&(yield a.toVector());(a.finish().length>0||0===i)&&(yield a.toVector())}}(t)}toVector(){return te.new(this.flush())}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),this._typeIds&&(t+=this._typeIds.byteLength),this.children.reduce((t,e)=>t+e.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((t,e)=>t+e.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,e){return this.setValid(t,this.isValid(e))&&this.setValue(t,e),this}setValue(t,e){this._setValue(this,t,e)}setValid(t,e){return this.length=this._nulls.set(t,+e).length,e}addChild(t){arguments.length>1&&void 0!==arguments[1]||"".concat(this.numChildren);throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}getChildAt(t){return this.children[t]||null}flush(){const t=[],e=this._values,r=this._offsets,n=this._typeIds,{length:i,nullCount:a}=this;n?(t[se.TYPE]=n.flush(i),r&&(t[se.OFFSET]=r.flush(i))):r?(e&&(t[se.DATA]=e.flush(r.last())),t[se.OFFSET]=r.flush(i)):e&&(t[se.DATA]=e.flush(i)),a>0&&(t[se.VALIDITY]=this._nulls.flush(i));const o=br.new(this.type,0,i,a,t,this.children.map(t=>t.flush()));return this.clear(),o}finish(){return this.finished=!0,this.children.forEach(t=>t.finish()),this}clear(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach(t=>t.clear()),this}}Er.prototype.length=1,Er.prototype.stride=1,Er.prototype.children=null,Er.prototype.finished=!1,Er.prototype.nullValues=null,Er.prototype._isValid=()=>!0;class Cr extends Er{constructor(t){super(t),this._values=new kr(new this.ArrayType(0),this.stride)}setValue(t,e){const r=this._values;return r.reserve(t-r.length+1),super.setValue(t,e)}}class Lr extends Er{constructor(t){super(t),this._pendingLength=0,this._offsets=new Mr}setValue(t,e){const r=this._pending||(this._pending=new Map),n=r.get(t);n&&(this._pendingLength-=n.length),this._pendingLength+=e.length,r.set(t,e)}setValid(t,e){return!!super.setValid(t,e)||((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){const t=this._pending,e=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,e),this}}class Ir extends Er{constructor(t){super(t),this._values=new Ar}setValue(t,e){this._values.set(t,+e)}}class Or extends Er{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}}class Pr extends Cr{}class Dr extends Pr{}class zr extends Pr{}class Rr extends Cr{}class Fr extends Er{constructor(t){let{type:e,nullValues:r,dictionaryHashFunction:n}=t;super({type:new yr(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Er.new({type:this.type.indices,nullValues:r}),this.dictionary=Er.new({type:this.type.dictionary,nullValues:null}),"function"===typeof n&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,e){const r=this.indices;return e=r.setValid(t,e),this.length=r.length,e}setValue(t,e){let r=this._keysToIndices,n=this.valueToKey(e),i=r[n];return void 0===i&&(r[n]=i=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,i)}flush(){const t=this.type,e=this._dictionary,r=this.dictionary.toVector(),n=this.indices.flush().clone(t);return n.dictionary=e?e.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return"string"===typeof t?t:"".concat(t)}}class Br extends Cr{}const Nr=new Float64Array(1),jr=new Uint32Array(Nr.buffer);function Ur(t){let e=(31744&t)>>10,r=(1023&t)/1024,n=(-1)**((32768&t)>>15);switch(e){case 31:return n*(r?NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*2**(e-15)*(1+r)}function Vr(t){if(t!==t)return 32256;Nr[0]=t;let e=(2147483648&jr[1])>>16&65535,r=2146435072&jr[1],n=0;return r>=1089470464?jr[0]>0?r=31744:(r=(2080374784&r)>>16,n=(1048575&jr[1])>>10):r<=1056964608?(n=1048576+(1048575&jr[1]),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=512+(1048575&jr[1])>>10),e|r|65535&n}class Hr extends Cr{}class qr extends Hr{setValue(t,e){this._values.set(t,Vr(e))}}class Gr extends Hr{setValue(t,e){this._values.set(t,e)}}class Yr extends Hr{setValue(t,e){this._values.set(t,e)}}const Wr=Symbol.for("isArrowBigNum");function Zr(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n>>=0),l+=(r>>>0)+e*c**32;return l}let $r,tn;function en(t){let e="",r=new Uint32Array(2),n=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),a=-1,o=n.length-1;do{for(r[0]=n[a=0];a0&&void 0!==arguments[0]?arguments[0]:"default";switch(t){case"number":return Qr(this);case"string":return $r(this);case"default":return tn(this)}return $r(this)},Object.setPrototypeOf(Xr.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Jr.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(Kr.prototype,Object.create(Uint32Array.prototype)),Object.assign(Xr.prototype,Zr.prototype,{constructor:Xr,signed:!0,TypedArray:Int32Array,BigIntArray:Z}),Object.assign(Jr.prototype,Zr.prototype,{constructor:Jr,signed:!1,TypedArray:Uint32Array,BigIntArray:J}),Object.assign(Kr.prototype,Zr.prototype,{constructor:Kr,signed:!0,TypedArray:Uint32Array,BigIntArray:J}),W?(tn=t=>8===t.byteLength?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:en(t),$r=t=>8===t.byteLength?"".concat(new t.BigIntArray(t.buffer,t.byteOffset,1)[0]):en(t)):($r=en,tn=$r);class rn{constructor(t,e){return rn.new(t,e)}static new(t,e){switch(e){case!0:return new Xr(t);case!1:return new Jr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case Z:return new Xr(t)}return 16===t.byteLength?new Kr(t):new Jr(t)}static signed(t){return new Xr(t)}static unsigned(t){return new Jr(t)}static decimal(t){return new Kr(t)}}class nn extends Cr{setValue(t,e){this._values.set(t,e)}}class an extends nn{}class on extends nn{}class sn extends nn{}class ln extends nn{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(pn)),super(t),this._values=new Sr(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(t){return super.isValid(pn(t))}}class cn extends nn{}class un extends nn{}class fn extends nn{}class hn extends nn{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(pn)),super(t),this._values=new Sr(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(t){return super.isValid(pn(t))}}const pn=(dn={BigIntArray:Z},t=>(ArrayBuffer.isView(t)&&(dn.buffer=t.buffer,dn.byteOffset=t.byteOffset,dn.byteLength=t.byteLength,t=tn(dn),dn.buffer=null),t));var dn;class gn extends Cr{}class mn extends gn{}class yn extends gn{}class vn extends gn{}class bn extends gn{}class xn extends Cr{}class _n extends xn{}class wn extends xn{}class Tn extends xn{}class kn extends xn{}class An extends Cr{}class Mn extends An{}class Sn extends An{}class En extends Lr{constructor(t){super(t),this._values=new Tr(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+4*this.length;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,xt(e))}_flushPending(t,e){const r=this._offsets,n=this._values.reserve(e).buffer;let i,a=0,o=0,s=0;for([a,i]of t)void 0===i?r.set(a,0):(o=i.length,n.set(i,s),r.set(a,o),s+=o)}}class Cn extends Lr{constructor(t){super(t),this._values=new Tr(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+4*this.length;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,U(e))}_flushPending(t,e){}}Cn.prototype._flushPending=En.prototype._flushPending;class Ln{get length(){return this._values.length}get(t){return this._values[t]}clear(){return this._values=null,this}bind(t){return t instanceof te?t:(this._values=t,this)}}const In=Symbol.for("parent"),On=Symbol.for("rowIndex"),Pn=Symbol.for("keyToIdx"),Dn=Symbol.for("idxToVal"),zn=Symbol.for("nodejs.util.inspect.custom");class Rn{constructor(t,e){this[In]=t,this.size=e}entries(){return this[Symbol.iterator]()}has(t){return void 0!==this.get(t)}get(t){let e=void 0;if(null!==t&&void 0!==t){const r=this[Pn]||(this[Pn]=new Map);let n=r.get(t);if(void 0!==n){const t=this[Dn]||(this[Dn]=new Array(this.size));void 0!==(e=t[n])||(t[n]=e=this.getValue(n))}else if((n=this.getIndex(t))>-1){r.set(t,n);const i=this[Dn]||(this[Dn]=new Array(this.size));void 0!==(e=i[n])||(i[n]=e=this.getValue(n))}}return e}set(t,e){if(null!==t&&void 0!==t){const r=this[Pn]||(this[Pn]=new Map);let n=r.get(t);if(void 0===n&&r.set(t,n=this.getIndex(t)),n>-1){(this[Dn]||(this[Dn]=new Array(this.size)))[n]=this.setValue(n,e)}}return this}clear(){throw new Error("Clearing ".concat(this[Symbol.toStringTag]," not supported."))}delete(t){throw new Error("Deleting ".concat(this[Symbol.toStringTag]," values not supported."))}*[Symbol.iterator](){const t=this.keys(),e=this.values(),r=this[Pn]||(this[Pn]=new Map),n=this[Dn]||(this[Dn]=new Array(this.size));for(let i,a,o,s,l=0;!(o=t.next()).done&&!(s=e.next()).done;++l)i=o.value,a=s.value,n[l]=a,r.has(i)||r.set(i,l),yield[i,a]}forEach(t,e){const r=this.keys(),n=this.values(),i=void 0===e?t:(r,n,i)=>t.call(e,r,n,i),a=this[Pn]||(this[Pn]=new Map),o=this[Dn]||(this[Dn]=new Array(this.size));for(let s,l,c,u,f=0;!(c=r.next()).done&&!(u=n.next()).done;++f)s=c.value,l=u.value,o[f]=l,a.has(s)||a.set(s,f),i(l,s,this)}toArray(){return[...this.values()]}toJSON(){const t={};return this.forEach((e,r)=>t[r]=e),t}inspect(){return this.toString()}[zn](){return this.toString()}toString(){const t=[];return this.forEach((e,r)=>{r=xr(r),e=xr(e),t.push("".concat(r,": ").concat(e))}),"{ ".concat(t.join(", ")," }")}}Rn[Symbol.toStringTag]=(t=>(Object.defineProperties(t,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[In]:{writable:!0,enumerable:!1,configurable:!1,value:null},[On]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),t[Symbol.toStringTag]="Row"))(Rn.prototype);class Fn extends Rn{constructor(t){return super(t,t.length),jn(this)}keys(){return this[In].getChildAt(0)[Symbol.iterator]()}values(){return this[In].getChildAt(1)[Symbol.iterator]()}getKey(t){return this[In].getChildAt(0).get(t)}getIndex(t){return this[In].getChildAt(0).indexOf(t)}getValue(t){return this[In].getChildAt(1).get(t)}setValue(t,e){this[In].getChildAt(1).set(t,e)}}class Bn extends Rn{constructor(t){return super(t,t.type.children.length),Nn(this)}*keys(){for(const t of this[In].type.children)yield t.name}*values(){for(const t of this[In].type.children)yield this[t.name]}getKey(t){return this[In].type.children[t].name}getIndex(t){return this[In].type.children.findIndex(e=>e.name===t)}getValue(t){return this[In].getChildAt(t).get(this[On])}setValue(t,e){return this[In].getChildAt(t).set(this[On],e)}}Object.setPrototypeOf(Rn.prototype,Map.prototype);const Nn=(()=>{const t={enumerable:!0,configurable:!1,get:null,set:null};return e=>{let r=-1,n=e[Pn]||(e[Pn]=new Map);const i=t=>function(){return this.get(t)},a=t=>function(e){return this.set(t,e)};for(const o of e.keys())n.set(o,++r),t.get=i(o),t.set=a(o),e.hasOwnProperty(o)||(t.enumerable=!0,Object.defineProperty(e,o,t)),e.hasOwnProperty(r)||(t.enumerable=!1,Object.defineProperty(e,r,t));return t.get=t.set=null,e}})(),jn=(()=>{if("undefined"===typeof Proxy)return Nn;const t=Rn.prototype.has,e=Rn.prototype.get,r=Rn.prototype.set,n=Rn.prototype.getKey,i={isExtensible:()=>!1,deleteProperty:()=>!1,preventExtensions:()=>!0,ownKeys:t=>[...t.keys()].map(t=>"".concat(t)),has(t,e){switch(e){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case In:case On:case Dn:case Pn:case zn:return!0}return"number"!==typeof e||t.has(e)||(e=t.getKey(e)),t.has(e)},get(r,i,a){switch(i){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case In:case On:case Dn:case Pn:case zn:return Reflect.get(r,i,a)}return"number"!==typeof i||t.call(a,i)||(i=n.call(a,i)),e.call(a,i)},set(e,i,a,o){switch(i){case In:case On:case Dn:case Pn:return Reflect.set(e,i,a,o);case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:return!1}return"number"!==typeof i||t.call(o,i)||(i=n.call(o,i)),!!t.call(o,i)&&!!r.call(o,i,a)}};return t=>new Proxy(t,i)})();function Un(t,e,r){const n=t.length,i=e>-1?e:n+e%n;return r?r(t,i):i}let Vn;function Hn(t,e,r,n){let{length:i=0}=t,a="number"!==typeof e?0:e,o="number"!==typeof r?i:r;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(t,a,o):[a,o]}const qn=W?Y(0):0,Gn=t=>t!==t;function Yn(t){let e=typeof t;if("object"!==e||null===t)return Gn(t)?Gn:"bigint"!==e?e=>e===t:e=>qn+e===t;if(t instanceof Date){const e=t.valueOf();return t=>t instanceof Date&&t.valueOf()===e}return ArrayBuffer.isView(t)?e=>!!e&&Xt(t,e):t instanceof Map?function(t){let e=-1;const r=[];return t.forEach(t=>r[++e]=Yn(t)),Wn(r)}(t):Array.isArray(t)?function(t){const e=[];for(let r=-1,n=t.length;++r!1;const r=[];for(let n=-1,i=e.length;++n{if(!r||"object"!==typeof r)return!1;switch(r.constructor){case Array:return function(t,e){const r=t.length;if(e.length!==r)return!1;for(let n=-1;++n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t){let e=new Uint32Array((t||[]).length+1),r=e[0]=0,n=e.length;for(let i=0;++i")}get data(){return this._chunks[0]?this._chunks[0].data:null}get ArrayType(){return this._type.ArrayType}get numChildren(){return this._numChildren}get stride(){return this._chunks[0]?this._chunks[0].stride:1}get byteLength(){return this._chunks.reduce((t,e)=>t+e.byteLength,0)}get nullCount(){let t=this._nullCount;return t<0&&(this._nullCount=t=this._chunks.reduce((t,e)=>{let{nullCount:r}=e;return t+r},0)),t}get indices(){if(Fe.isDictionary(this._type)){if(!this._indices){const t=this._chunks;this._indices=1===t.length?t[0].indices:Xn.concat(...t.map(t=>t.indices))}return this._indices}return null}get dictionary(){return Fe.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}*[Symbol.iterator](){for(const t of this._chunks)yield*t}clone(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new Xn(this._type,t)}concat(){for(var t=arguments.length,e=new Array(t),r=0;r=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),n.length>0)?i[t]=new Xn(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 a=0,o=0,s=0;do{if(a+1===i)return e?e(this,a,r-o):[a,r-o];s=a+(i-a)/2|0,r>=n[s]?a=s:i=s}while(r=(o=n[a]));return null}isValid(t){return!!this.search(t,this.isValidInternal)}get(t){return this.search(t,this.getInternal)}set(t,e){this.search(t,(t,r,n)=>{let{chunks:i}=t;return i[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 r=this._type.ArrayType;if(e<=0)return new r(0);if(e<=1)return t[0].toArray();let n=0,i=new Array(e);for(let s=-1;++s=r)break;if(e>=l+s)continue;if(l>=e&&l+s<=r){n.push(t);continue}const c=Math.max(0,e-l),u=Math.min(r-l,s);n.push(t.slice(c,u))}return t.clone(n)}}const Jn=(t,e,r)=>(e.set(t,r),r+t.length),Kn=(t,e,r)=>{let n=r;for(let i=-1,a=t.length;++i1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;if(e=Xn.flatten(...e),super(t.type,e,r),this._field=t,1===e.length&&!(this instanceof $n))return new $n(t,e[0],this._chunkOffsets)}static new(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i{let{nullCount:e}=t;return e>0})&&(t=t.clone({nullable:!0}));return new Qn(t,a)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new Qn(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),n.length>0)?i[t]=new Qn(r,n):null}}class $n extends Qn{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 ti=Array.isArray,ei=(t,e)=>ai(t,e,[],0),ri=t=>si(t,[[],[]]),ni=(t,e)=>function t(e,r,n,i){let a,o=i,s=-1,l=r.length;for(;++sfunction t(e,r,n,i){let a,o=i,s=-1,l=r.length;for(;++sa.getChildAt(e)),n,o).length:a instanceof te&&(n[o++]=a);return n}(t,e,[],0);function ai(t,e,r,n){let i,a=n,o=-1,s=e.length;for(;++o{let[n,i]=e;return t[0][r]=n,t[1][r]=i,t};function si(t,e){let r,n;switch(n=t.length){case 0:return e;case 1:if(r=e[0],!t[0])return e;if(ti(t[0]))return si(t[0],e);t[0]instanceof br||t[0]instanceof te||t[0]instanceof Fe||([r,t]=Object.entries(t[0]).reduce(oi,e));break;default:ti(r=t[n-1])?t=ti(t[0])?t[0]:t.slice(0,n-1):(t=ti(t[0])?t[0]:t,r=[])}let i,a,o=-1,s=-1,l=-1,c=t.length,[u,f]=e;for(;++l0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;this.fields=t||[],this.metadata=e||new Map,r||(r=fi(t)),this.dictionaries=r}static from(){return li.new(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1])}static new(){for(var t=arguments.length,e=new Array(t),r=0;r"".concat(e,": ").concat(t)).join(", ")," }>")}compareTo(t){return Re.compareSchemas(this,t)}select(){for(var t=arguments.length,e=new Array(t),r=0;r(t[e]=!0)&&t,Object.create(null));return new li(this.fields.filter(t=>n[t.name]),this.metadata)}selectAt(){for(var t=arguments.length,e=new Array(t),r=0;rthis.fields[t]).filter(Boolean),this.metadata)}assign(){for(var t=arguments.length,e=new Array(t),r=0;r{const e=i.findIndex(e=>e.name===t.name);return!~e||(i[e]=t.clone({metadata:ui(ui(new Map,i[e].metadata),t.metadata)}))&&!1}),s=fi(o,new Map);return new li([...i,...o],a,new Map([...this.dictionaries,...s]))}}class ci{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;this.name=t,this.type=e,this.nullable=r,this.metadata=n||new Map}static new(){for(var t=arguments.length,e=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:new Map;for(let r=-1,n=t.length;++r0&&fi(n.children,e)}return e}li.prototype.fields=null,li.prototype.metadata=null,li.prototype.dictionaries=null,ci.prototype.type=null,ci.prototype.name=null,ci.prototype.nullable=null,ci.prototype.metadata=null;class hi extends Lr{constructor(t){super(t),this._run=new Ln,this._offsets=new Mr}addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new cr(new ci(e,t.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(t){const e=this._run,r=this._offsets,n=this._setValue;let i,a=0;for([a,i]of t)void 0===i?r.set(a,0):(r.set(a,i.length),n(this,a,e.bind(i)))}}class pi extends Er{constructor(){super(...arguments),this._run=new Ln}setValue(t,e){super.setValue(t,this._run.bind(e))}addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");const r=this.children.push(t);return this.type=new pr(this.type.listSize,new ci(e,t.type,!0)),r}clear(){return this._run.clear(),super.clear()}}class di extends Lr{set(t,e){return super.set(t,e)}setValue(t,e){e=e instanceof Map?e:new Map(Object.entries(e));const r=this._pending||(this._pending=new Map),n=r.get(t);n&&(this._pendingLength-=n.size),this._pendingLength+=e.size,r.set(t,e)}addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.numChildren);if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new dr(new ci(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const e=this._offsets,r=this._setValue;t.forEach((t,n)=>{void 0===t?e.set(n,0):(e.set(n,t.size),r(this,n,t))})}}class gi extends Er{addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.numChildren);const r=this.children.push(t);return this.type=new ur([...this.type.children,new ci(e,t.type,!0)]),r}}class mi extends Er{constructor(t){super(t),this._typeIds=new kr(new Int8Array(0),1),"function"===typeof t.valueToChildTypeId&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,e){return this.set(this.length,t,e)}set(t,e,r){return void 0===r&&(r=this._valueToChildTypeId(this,e,t)),this.setValid(t,this.isValid(e))&&this.setValue(t,e,r),this}setValue(t,e,r){this._typeIds.set(t,r),super.setValue(t,e)}addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.children.length);const r=this.children.push(t),{type:{children:n,mode:i,typeIds:a}}=this,o=[...n,new ci(e,t.type)];return this.type=new fr(i,[...a,r],o),r}_valueToChildTypeId(t,e,r){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}}class yi extends mi{}class vi extends mi{constructor(t){super(t),this._offsets=new kr(new Int32Array(0))}setValue(t,e,r){const n=this.type.typeIdToChildIndex[r];return this._offsets.set(t,this.getChildAt(n).length),super.setValue(t,e,r)}}class bi extends ke{}const xi=(t,e,r)=>{t[e]=r%4294967296|0,t[e+1]=r/4294967296|0},_i=(t,e,r,n)=>{const{[r]:i,[r+1]:a}=e;null!=i&&null!=a&&t.set(n.subarray(0,a-i),i)},wi=(t,e,r)=>{let{values:n}=t;((t,e,r)=>{t[e]=r/864e5|0})(n,e,r.valueOf())},Ti=(t,e,r)=>{let{values:n}=t;xi(n,2*e,r.valueOf())},ki=(t,e,r)=>{let{stride:n,values:i}=t;i[n*e]=r},Ai=(t,e,r)=>{let{stride:n,values:i}=t;i[n*e]=Vr(r)},Mi=(t,e,r)=>{switch(typeof r){case"bigint":t.values64[e]=r;break;case"number":t.values[e*t.stride]=r;break;default:const n=r,{stride:i,ArrayType:a}=t,o=gt(a,n);t.values.set(o.subarray(0,i),i*e)}},Si=(t,e,r)=>{let{values:n}=t;return xi(n,2*e,r/1e3)},Ei=(t,e,r)=>{let{values:n}=t;return xi(n,2*e,r)},Ci=(t,e,r)=>{let{values:n}=t;return((t,e,r)=>{t[e]=1e3*r%4294967296|0,t[e+1]=1e3*r/4294967296|0})(n,2*e,r)},Li=(t,e,r)=>{let{values:n}=t;return((t,e,r)=>{t[e]=1e6*r%4294967296|0,t[e+1]=1e6*r/4294967296|0})(n,2*e,r)},Ii=(t,e,r)=>{let{values:n,stride:i}=t;n[i*e]=r},Oi=(t,e,r)=>{let{values:n,stride:i}=t;n[i*e]=r},Pi=(t,e,r)=>{let{values:n}=t;n.set(r.subarray(0,2),2*e)},Di=(t,e,r)=>{let{values:n}=t;n.set(r.subarray(0,2),2*e)},zi=(t,e,r)=>{const n=t.typeIdToChildIndex[t.typeIds[e]],i=t.getChildAt(n);i&&i.set(t.valueOffsets[e],r)},Ri=(t,e,r)=>{const n=t.typeIdToChildIndex[t.typeIds[e]],i=t.getChildAt(n);i&&i.set(e,r)},Fi=(t,e,r)=>{let{values:n}=t;n.set(r.subarray(0,2),2*e)},Bi=(t,e,r)=>{let{values:n}=t;n[e]=12*r[0]+r[1]%12};bi.prototype.visitBool=(t,e,r)=>{let{offset:n,values:i}=t;const a=n+e;r?i[a>>3]|=1<>3]&=~(1<{t.type.bitWidth<64?ki(t,e,r):Mi(t,e,r)},bi.prototype.visitInt8=ki,bi.prototype.visitInt16=ki,bi.prototype.visitInt32=ki,bi.prototype.visitInt64=Mi,bi.prototype.visitUint8=ki,bi.prototype.visitUint16=ki,bi.prototype.visitUint32=ki,bi.prototype.visitUint64=Mi,bi.prototype.visitFloat=(t,e,r)=>{t.type.precision!==ue.HALF?ki(t,e,r):Ai(t,e,r)},bi.prototype.visitFloat16=Ai,bi.prototype.visitFloat32=ki,bi.prototype.visitFloat64=ki,bi.prototype.visitUtf8=(t,e,r)=>{let{values:n,valueOffsets:i}=t;_i(n,i,e,U(r))},bi.prototype.visitBinary=(t,e,r)=>{let{values:n,valueOffsets:i}=t;return _i(n,i,e,r)},bi.prototype.visitFixedSizeBinary=(t,e,r)=>{let{stride:n,values:i}=t;i.set(r.subarray(0,n),n*e)},bi.prototype.visitDate=(t,e,r)=>{t.type.unit===le.DAY?wi(t,e,r):Ti(t,e,r)},bi.prototype.visitDateDay=wi,bi.prototype.visitDateMillisecond=Ti,bi.prototype.visitTimestamp=(t,e,r)=>{switch(t.type.unit){case ce.SECOND:return Si(t,e,r);case ce.MILLISECOND:return Ei(t,e,r);case ce.MICROSECOND:return Ci(t,e,r);case ce.NANOSECOND:return Li(t,e,r)}},bi.prototype.visitTimestampSecond=Si,bi.prototype.visitTimestampMillisecond=Ei,bi.prototype.visitTimestampMicrosecond=Ci,bi.prototype.visitTimestampNanosecond=Li,bi.prototype.visitTime=(t,e,r)=>{switch(t.type.unit){case ce.SECOND:return Ii(t,e,r);case ce.MILLISECOND:return Oi(t,e,r);case ce.MICROSECOND:return Pi(t,e,r);case ce.NANOSECOND:return Di(t,e,r)}},bi.prototype.visitTimeSecond=Ii,bi.prototype.visitTimeMillisecond=Oi,bi.prototype.visitTimeMicrosecond=Pi,bi.prototype.visitTimeNanosecond=Di,bi.prototype.visitDecimal=(t,e,r)=>{let{values:n}=t;n.set(r.subarray(0,4),4*e)},bi.prototype.visitList=(t,e,r)=>{const n=t.getChildAt(0),i=t.valueOffsets;for(let a=-1,o=i[e],s=i[e+1];o{const n=r instanceof Map?(i=e,a=r,(t,e,r)=>t&&t.set(i,a.get(e.name))):r instanceof te?((t,e)=>(r,n,i)=>r&&r.set(t,e.get(i)))(e,r):Array.isArray(r)?((t,e)=>(r,n,i)=>r&&r.set(t,e[i]))(e,r):((t,e)=>(r,n,i)=>r&&r.set(t,e[n.name]))(e,r);var i,a;t.type.children.forEach((e,r)=>n(t.getChildAt(r),e,r))},bi.prototype.visitUnion=(t,e,r)=>{t.type.mode===fe.Dense?zi(t,e,r):Ri(t,e,r)},bi.prototype.visitDenseUnion=zi,bi.prototype.visitSparseUnion=Ri,bi.prototype.visitDictionary=(t,e,r)=>{const n=t.getKey(e);null!==n&&t.setValue(n,r)},bi.prototype.visitInterval=(t,e,r)=>{t.type.unit===he.DAY_TIME?Fi(t,e,r):Bi(t,e,r)},bi.prototype.visitIntervalDayTime=Fi,bi.prototype.visitIntervalYearMonth=Bi,bi.prototype.visitFixedSizeList=(t,e,r)=>{const n=t.getChildAt(0),{stride:i}=t;for(let a=-1,o=e*i;++a{const n=t.getChildAt(0),i=t.valueOffsets,a=r instanceof Map?[...r]:Object.entries(r);for(let o=-1,s=i[e],l=i[e+1];s0){const i=e.children||[],a={nullValues:e.nullValues},o=Array.isArray(i)?(t,e)=>i[e]||a:t=>{let{name:e}=t;return i[e]||a};r.children.forEach((e,r)=>{const{type:i}=e,a=o(e,r);n.children.push(t({...a,type:i}))})}return n},Object.keys(oe).map(t=>oe[t]).filter(t=>"number"===typeof t&&t!==oe.NONE).forEach(t=>{ji.visit(t).prototype._setValue=Ni.getVisitFn(t)}),Cn.prototype._setValue=Ni.visitBinary,function(t){!function(e){!function(e){!function(e){class r{constructor(){this.bb=null,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):ee.apache.arrow.flatbuf.MetadataVersion.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new ee.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,ee.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)}static createFooter(t,e,n,i,a){return r.startFooter(t),r.addVersion(t,e),r.addSchema(t,n),r.addDictionaries(t,i),r.addRecordBatches(t,a),r.endFooter(t)}}e.Footer=r}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Ui||(Ui={})),function(t){!function(t){!function(t){!function(t){t.Block=class{constructor(){this.bb=null,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={}))}(Ui||(Ui={}));var Vi=C.Long,Hi=C.Builder,qi=C.ByteBuffer,Gi=Ui.apache.arrow.flatbuf.Block,Yi=Ui.apache.arrow.flatbuf.Footer;class Wi{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:de.V4,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.schema=t,this.version=e,r&&(this._recordBatches=r),n&&(this._dictionaryBatches=n)}static decode(t){t=new qi(xt(t));const e=Yi.getRootAsFooter(t),r=li.decode(e.schema());return new Zi(r,e)}static encode(t){const e=new Hi,r=li.encode(e,t.schema);Yi.startRecordBatchesVector(e,t.numRecordBatches),[...t.recordBatches()].slice().reverse().forEach(t=>Xi.encode(e,t));const n=e.endVector();Yi.startDictionariesVector(e,t.numDictionaries),[...t.dictionaryBatches()].slice().reverse().forEach(t=>Xi.encode(e,t));const i=e.endVector();return Yi.startFooter(e),Yi.addSchema(e,r),Yi.addVersion(e,de.V4),Yi.addRecordBatches(e,n),Yi.addDictionaries(e,i),Yi.finishFooterBuffer(e,Yi.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=0&&t=0&&t=0&&t=0&&t0)return super.write(t)}toString(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?j(this.toUint8Array(!0)):this.toUint8Array(!1).then(j)}toUint8Array(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?dt(this._values)[0]:(async()=>{let t=[],e=0;for await(const r of this)t.push(r),e+=r.byteLength;return dt(t,e)[0]})()}}class Ki{constructor(t){t&&(this.source=new $i(Jt.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 Ji?this.source=new ta(Jt.fromAsyncIterable(t)):ut(t)?this.source=new ta(Jt.fromNodeStream(t)):ct(t)?this.source=new ta(Jt.fromDOMStream(t)):lt(t)?this.source=new ta(Jt.fromDOMStream(t.body)):nt(t)?this.source=new ta(Jt.fromIterable(t)):(rt(t)||it(t))&&(this.source=new ta(Jt.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 $i{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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"read";return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||V)}return(t){return Object.create(this.source.return&&this.source.return(t)||V)}}class ta{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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"read";return await this.source.next({cmd:e,size:t})}async throw(t){const e=this.source.throw&&await this.source.throw(t)||V;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)||V;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}}class ea extends Ki{constructor(t,e){super(),this.position=0,this.buffer=xt(t),this.size="undefined"===typeof 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=(await t.stat()).size,delete this._pending})()}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>>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 n=e[2]*r[3],i+=n,n=e[3]*r[2]>>>0,i+=n,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>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>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return oa.fromString("string"===typeof t?t:t.toString(),e)}static fromNumber(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return oa.fromString(t.toString(),e)}static fromString(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);const r=t.length;let n=new oa(e);for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return sa.fromString("string"===typeof t?t:t.toString(),e)}static fromNumber(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return sa.fromString(t.toString(),e)}static fromString(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);const r=t.startsWith("-"),n=t.length;let i=new sa(e);for(let a=r?1:0;a>>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]>>0&&++e[1],e[1]>>0&&++e[2],e[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"".concat(na(this.buffer[3])," ").concat(na(this.buffer[2])," ").concat(na(this.buffer[1])," ").concat(na(this.buffer[0]))}static multiply(t,e){return new la(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new la(new Uint32Array(t.buffer)).plus(e)}static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4);return la.fromString("string"===typeof t?t:t.toString(),e)}static fromNumber(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4);return la.fromString(t.toString(),e)}static fromString(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4);const r=t.startsWith("-"),n=t.length;let i=new la(e);for(let a=r?1:0;a1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Null(t,0,e)}visitBool(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Bool(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitInt(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Int(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitFloat(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Float(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitUtf8(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Utf8(t,0,e,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}visitBinary(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Binary(t,0,e,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}visitFixedSizeBinary(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.FixedSizeBinary(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitDate(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Date(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitTimestamp(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Timestamp(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitTime(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Time(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitDecimal(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Decimal(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitList(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.List(t,0,e,r,this.readNullBitmap(t,r),this.readOffsets(t),this.visit(t.children[0]))}visitStruct(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Struct(t,0,e,r,this.readNullBitmap(t,r),this.visitMany(t.children))}visitUnion(t){return t.mode===fe.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Union(t,0,e,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.readOffsets(t),this.visitMany(t.children))}visitSparseUnion(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Union(t,0,e,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.visitMany(t.children))}visitDictionary(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Dictionary(t,0,e,r,this.readNullBitmap(t,r),this.readData(t.indices),this.readDictionary(t))}visitInterval(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Interval(t,0,e,r,this.readNullBitmap(t,r),this.readData(t))}visitFixedSizeList(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.FixedSizeList(t,0,e,r,this.readNullBitmap(t,r),this.visit(t.children[0]))}visitMap(t){let{length:e,nullCount:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return br.Map(t,0,e,r,this.readNullBitmap(t,r),this.readOffsets(t),this.visit(t.children[0]))}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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){let{length:e,offset:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange();return this.bytes.subarray(r,r+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class ua extends ca{constructor(t,e,r,n){super(new Uint8Array(0),e,r,n),this.sources=t}readNullBitmap(t,e){let{offset:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.nextBufferRange();return e<=0?new Uint8Array(0):be(this.sources[r])}readOffsets(t){let{offset:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange();return gt(Uint8Array,gt(Int32Array,this.sources[e]))}readTypeIds(t){let{offset:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange();return gt(Uint8Array,gt(t.ArrayType,this.sources[e]))}readData(t){let{offset:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange();const{sources:r}=this;return Fe.isTimestamp(t)||(Fe.isInt(t)||Fe.isTime(t))&&64===t.bitWidth||Fe.isDate(t)&&t.unit===le.MILLISECOND?gt(Uint8Array,sa.convertArray(r[e])):Fe.isDecimal(t)?gt(Uint8Array,la.convertArray(r[e])):Fe.isBinary(t)||Fe.isFixedSizeBinary(t)?function(t){const e=t.join(""),r=new Uint8Array(e.length/2);for(let n=0;n>1]=parseInt(e.substr(n,2),16);return r}(r[e]):Fe.isBool(t)?be(r[e]):Fe.isUtf8(t)?U(r[e].join("")):gt(Uint8Array,gt(t.ArrayType,r[e].map(t=>+t)))}}var fa=C.Long,ha=ee.apache.arrow.flatbuf.Null,pa=ee.apache.arrow.flatbuf.Int,da=ee.apache.arrow.flatbuf.FloatingPoint,ga=ee.apache.arrow.flatbuf.Binary,ma=ee.apache.arrow.flatbuf.Bool,ya=ee.apache.arrow.flatbuf.Utf8,va=ee.apache.arrow.flatbuf.Decimal,ba=ee.apache.arrow.flatbuf.Date,xa=ee.apache.arrow.flatbuf.Time,_a=ee.apache.arrow.flatbuf.Timestamp,wa=ee.apache.arrow.flatbuf.Interval,Ta=ee.apache.arrow.flatbuf.List,ka=ee.apache.arrow.flatbuf.Struct_,Aa=ee.apache.arrow.flatbuf.Union,Ma=ee.apache.arrow.flatbuf.DictionaryEncoding,Sa=ee.apache.arrow.flatbuf.FixedSizeBinary,Ea=ee.apache.arrow.flatbuf.FixedSizeList,Ca=ee.apache.arrow.flatbuf.Map;const La=new class extends ke{visit(t,e){return null==t||null==e?void 0:super.visit(t,e)}visitNull(t,e){return ha.startNull(e),ha.endNull(e)}visitInt(t,e){return pa.startInt(e),pa.addBitWidth(e,t.bitWidth),pa.addIsSigned(e,t.isSigned),pa.endInt(e)}visitFloat(t,e){return da.startFloatingPoint(e),da.addPrecision(e,t.precision),da.endFloatingPoint(e)}visitBinary(t,e){return ga.startBinary(e),ga.endBinary(e)}visitBool(t,e){return ma.startBool(e),ma.endBool(e)}visitUtf8(t,e){return ya.startUtf8(e),ya.endUtf8(e)}visitDecimal(t,e){return va.startDecimal(e),va.addScale(e,t.scale),va.addPrecision(e,t.precision),va.endDecimal(e)}visitDate(t,e){return ba.startDate(e),ba.addUnit(e,t.unit),ba.endDate(e)}visitTime(t,e){return xa.startTime(e),xa.addUnit(e,t.unit),xa.addBitWidth(e,t.bitWidth),xa.endTime(e)}visitTimestamp(t,e){const r=t.timezone&&e.createString(t.timezone)||void 0;return _a.startTimestamp(e),_a.addUnit(e,t.unit),void 0!==r&&_a.addTimezone(e,r),_a.endTimestamp(e)}visitInterval(t,e){return wa.startInterval(e),wa.addUnit(e,t.unit),wa.endInterval(e)}visitList(t,e){return Ta.startList(e),Ta.endList(e)}visitStruct(t,e){return ka.startStruct_(e),ka.endStruct_(e)}visitUnion(t,e){Aa.startTypeIdsVector(e,t.typeIds.length);const r=Aa.createTypeIdsVector(e,t.typeIds);return Aa.startUnion(e),Aa.addMode(e,t.mode),Aa.addTypeIds(e,r),Aa.endUnion(e)}visitDictionary(t,e){const r=this.visit(t.indices,e);return Ma.startDictionaryEncoding(e),Ma.addId(e,new fa(t.id,0)),Ma.addIsOrdered(e,t.isOrdered),void 0!==r&&Ma.addIndexType(e,r),Ma.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return Sa.startFixedSizeBinary(e),Sa.addByteWidth(e,t.byteWidth),Sa.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Ea.startFixedSizeList(e),Ea.addListSize(e,t.listSize),Ea.endFixedSizeList(e)}visitMap(t,e){return Ca.startMap(e),Ca.addKeysSorted(e,t.keysSorted),Ca.endMap(e)}};function Ia(t){return new Ka(t.count,function t(e){return(e||[]).reduce((e,r)=>{return[...e,new to(r.count,(n=r.VALIDITY,(n||[]).reduce((t,e)=>t+ +(0===e),0))),...t(r.children)];var n},[])}(t.columns),function t(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(let n=-1,i=(e||[]).length;++nci.fromJSON(t,e))}function Pa(t,e){return(t.children||[]).filter(Boolean).map(t=>ci.fromJSON(t,e))}function Da(t){return new Map(Object.entries(t||{}))}function za(t){return new je(t.isSigned,t.bitWidth)}function Ra(t,e){const r=t.type.name;switch(r){case"NONE":case"null":return new Ne;case"binary":return new $e;case"utf8":return new tr;case"bool":return new er;case"list":return new cr((e||[])[0]);case"struct":case"struct_":return new ur(e||[])}switch(r){case"int":{const e=t.type;return new je(e.isSigned,e.bitWidth)}case"floatingpoint":{const e=t.type;return new Xe(ue[e.precision])}case"decimal":{const e=t.type;return new rr(e.scale,e.precision)}case"date":{const e=t.type;return new nr(le[e.unit])}case"time":{const e=t.type;return new or(ce[e.unit],e.bitWidth)}case"timestamp":{const e=t.type;return new sr(ce[e.unit],e.timezone)}case"interval":{const e=t.type;return new lr(he[e.unit])}case"union":{const r=t.type;return new fr(fe[r.mode],r.typeIds||[],e||[])}case"fixedsizebinary":{const e=t.type;return new hr(e.byteWidth)}case"fixedsizelist":{const r=t.type;return new pr(r.listSize,(e||[])[0])}case"map":{const r=t.type;return new dr((e||[])[0],r.keysSorted)}}throw new Error('Unrecognized type: "'.concat(r,'"'))}var Fa=C.Long,Ba=C.Builder,Na=C.ByteBuffer,ja=ee.apache.arrow.flatbuf.Type,Ua=ee.apache.arrow.flatbuf.Field,Va=ee.apache.arrow.flatbuf.Schema,Ha=ee.apache.arrow.flatbuf.Buffer,qa=ae.apache.arrow.flatbuf.Message,Ga=ee.apache.arrow.flatbuf.KeyValue,Ya=ae.apache.arrow.flatbuf.FieldNode,Wa=ee.apache.arrow.flatbuf.Endianness,Za=ae.apache.arrow.flatbuf.RecordBatch,Xa=ae.apache.arrow.flatbuf.DictionaryBatch;class Ja{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 Ja(0,de.V4,e);return r._createHeader=function(t,e){return()=>{switch(e){case pe.Schema:return li.fromJSON(t);case pe.RecordBatch:return Ka.fromJSON(t);case pe.DictionaryBatch:return Qa.fromJSON(t)}throw new Error("Unrecognized Message type: { name: ".concat(pe[e],", type: ").concat(e," }"))}}(t,e),r}static decode(t){t=new Na(xt(t));const e=qa.getRootAsMessage(t),r=e.bodyLength(),n=e.version(),i=e.headerType(),a=new Ja(r,n,i);return a._createHeader=function(t,e){return()=>{switch(e){case pe.Schema:return li.decode(t.header(new Va));case pe.RecordBatch:return Ka.decode(t.header(new Za),t.version());case pe.DictionaryBatch:return Qa.decode(t.header(new Xa),t.version())}throw new Error("Unrecognized Message type: { name: ".concat(pe[e],", type: ").concat(e," }"))}}(e,i),a}static encode(t){let e=new Ba,r=-1;return t.isSchema()?r=li.encode(e,t.header()):t.isRecordBatch()?r=Ka.encode(e,t.header()):t.isDictionaryBatch()&&(r=Qa.encode(e,t.header())),qa.startMessage(e),qa.addVersion(e,de.V4),qa.addHeader(e,r),qa.addHeaderType(e,t.headerType),qa.addBodyLength(e,new Fa(t.bodyLength,0)),qa.finishMessageBuffer(e,qa.endMessage(e)),e.asUint8Array()}static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t instanceof li)return new Ja(0,de.V4,pe.Schema,t);if(t instanceof Ka)return new Ja(e,de.V4,pe.RecordBatch,t);if(t instanceof Qa)return new Ja(e,de.V4,pe.DictionaryBatch,t);throw new Error("Unrecognized Message header: ".concat(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===pe.Schema}isRecordBatch(){return this.headerType===pe.RecordBatch}isDictionaryBatch(){return this.headerType===pe.DictionaryBatch}}class Ka{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 Qa{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){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._data=t,this._isDelta=r,this._id="number"===typeof e?e:e.low}}class $a{constructor(t,e){this.offset="number"===typeof t?t:t.low,this.length="number"===typeof e?e:e.low}}class to{constructor(t,e){this.length="number"===typeof t?t:t.low,this.nullCount="number"===typeof e?e:e.low}}function eo(t){const e=[];for(let r,n=-1,i=-1,a=t.nodesLength();++nci.encode(t,e)),l=Ua.createChildrenVector(t,s),c=e.metadata&&e.metadata.size>0?Ua.createCustomMetadataVector(t,[...e.metadata].map(e=>{let[r,n]=e;const i=t.createString("".concat(r)),a=t.createString("".concat(n));return Ga.startKeyValue(t),Ga.addKey(t,i),Ga.addValue(t,a),Ga.endKeyValue(t)})):-1;e.name&&(r=t.createString(e.name));Ua.startField(t),Ua.addType(t,n),Ua.addTypeType(t,o),Ua.addChildren(t,l),Ua.addNullable(t,!!e.nullable),-1!==r&&Ua.addName(t,r);-1!==i&&Ua.addDictionary(t,i);-1!==c&&Ua.addCustomMetadata(t,c);return Ua.endField(t)},ci.decode=function(t,e){let r,n,i,a,o,s;e&&(s=t.dictionary())?e.has(r=s.id().low)?(a=(a=s.indexType())?oo(a):new He,o=new yr(e.get(r),a,r,s.isOrdered()),n=new ci(t.name(),o,t.nullable(),ao(t))):(a=(a=s.indexType())?oo(a):new He,e.set(r,i=so(t,io(t,e))),o=new yr(i,a,r,s.isOrdered()),n=new ci(t.name(),o,t.nullable(),ao(t))):(i=so(t,io(t,e)),n=new ci(t.name(),i,t.nullable(),ao(t)));return n||null},ci.fromJSON=function(t,e){let r,n,i,a,o,s;return e&&(a=t.dictionary)?e.has(r=a.id)?(n=(n=a.indexType)?za(n):new He,s=new yr(e.get(r),n,r,a.isOrdered),i=new ci(t.name,s,t.nullable,Da(t.customMetadata))):(n=(n=a.indexType)?za(n):new He,e.set(r,o=Ra(t,Pa(t,e))),s=new yr(o,n,r,a.isOrdered),i=new ci(t.name,s,t.nullable,Da(t.customMetadata))):(o=Ra(t,Pa(t,e)),i=new ci(t.name,o,t.nullable,Da(t.customMetadata))),i||null},li.encode=function(t,e){const r=e.fields.map(e=>ci.encode(t,e));Va.startFieldsVector(t,r.length);const n=Va.createFieldsVector(t,r),i=e.metadata&&e.metadata.size>0?Va.createCustomMetadataVector(t,[...e.metadata].map(e=>{let[r,n]=e;const i=t.createString("".concat(r)),a=t.createString("".concat(n));return Ga.startKeyValue(t),Ga.addKey(t,i),Ga.addValue(t,a),Ga.endKeyValue(t)})):-1;Va.startSchema(t),Va.addFields(t,n),Va.addEndianness(t,lo?Wa.Little:Wa.Big),-1!==i&&Va.addCustomMetadata(t,i);return Va.endSchema(t)},li.decode=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map;const r=no(t,e);return new li(r,ao(t),e)},li.fromJSON=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map;return new li(Oa(t,e),Da(t.customMetadata),e)},Ka.encode=function(t,e){const r=e.nodes||[],n=e.buffers||[];Za.startNodesVector(t,r.length),r.slice().reverse().forEach(e=>to.encode(t,e));const i=t.endVector();Za.startBuffersVector(t,n.length),n.slice().reverse().forEach(e=>$a.encode(t,e));const a=t.endVector();return Za.startRecordBatch(t),Za.addLength(t,new Fa(e.length,0)),Za.addNodes(t,i),Za.addBuffers(t,a),Za.endRecordBatch(t)},Ka.decode=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:de.V4;return new Ka(t.length(),eo(t),ro(t,e))},Ka.fromJSON=Ia,Qa.encode=function(t,e){const r=Ka.encode(t,e.data);return Xa.startDictionaryBatch(t),Xa.addId(t,new Fa(e.id,0)),Xa.addIsDelta(t,e.isDelta),Xa.addData(t,r),Xa.endDictionaryBatch(t)},Qa.decode=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:de.V4;return new Qa(Ka.decode(t.data(),e),t.id(),t.isDelta())},Qa.fromJSON=function(t){return new Qa(Ia(t.data),t.id,t.isDelta)},to.encode=function(t,e){return Ya.createFieldNode(t,new Fa(e.length,0),new Fa(e.nullCount,0))},to.decode=function(t){return new to(t.length(),t.nullCount())},$a.encode=function(t,e){return Ha.createBuffer(t,new Fa(e.offset,0),new Fa(e.length,0))},$a.decode=function(t){return new $a(t.offset(),t.length())};const lo=function(){const t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]}();var co=C.ByteBuffer;const uo=t=>"Expected ".concat(pe[t]," Message in stream, but was null or length 0."),fo=t=>"Header pointer of flatbuffer-encoded ".concat(pe[t]," Message is null or length 0."),ho=(t,e)=>"Expected to read ".concat(t," metadata bytes, but only read ").concat(e,"."),po=(t,e)=>"Expected to read ".concat(t," bytes for message body, but only read ").concat(e,".");class go{constructor(t){this.source=t instanceof Ki?t:new Ki(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||-1===t.value&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?V: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 new Error(uo(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=xt(this.source.read(t));if(e.byteLength0&&void 0!==arguments[0]&&arguments[0];const e=pe.Schema,r=this.readMessage(e),n=r&&r.header();if(t&&!n)throw new Error(fo(e));return n}readMetadataLength(){const t=this.source.read(vo),e=t&&new co(t),r=e&&e.readInt32(0)||0;return{done:0===r,value:r}}readMetadata(t){const e=this.source.read(t);if(!e)return V;if(e.byteLength0&&void 0!==arguments[0]&&arguments[0];const e=pe.Schema,r=await this.readMessage(e),n=r&&r.header();if(t&&!n)throw new Error(fo(e));return n}async readMetadataLength(){const t=await this.source.read(vo),e=t&&new co(t),r=e&&e.readInt32(0)||0;return{done:0===r,value:r}}async readMetadata(t){const e=await this.source.read(t);if(!e)return V;if(e.byteLength[...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 new Error(uo(t));return e.value}readSchema(){const t=pe.Schema,e=this.readMessage(t),r=e&&e.header();if(!e||!r)throw new Error(fo(t));return r}}const vo=4,bo=new Uint8Array("ARROW1".length);for(let fc=0;fc<"ARROW1".length;fc+=1)bo[fc]="ARROW1".charCodeAt(fc);function xo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let r=-1,n=bo.length;++r2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");Fe.isNull(t.type)||Ao.call(this,n<=0?new Uint8Array(0):ve(e.offset,r,e.nullBitmap)),this.nodes.push(new to(r,n))}return super.visit(t)}visitNull(t){return this}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 Ao(t){const e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new $a(this._byteLength,e)),this._byteLength+=e,this}function Mo(t){return Ao.call(this,t.values.subarray(0,t.length*t.stride))}function So(t){const{length:e,values:r,valueOffsets:n}=t,i=n[0],a=n[e],o=Math.min(a-i,r.byteLength-i);return Ao.call(this,Zt(-n[0],e,n)),Ao.call(this,r.subarray(i,i+o)),this}function Eo(t){const{length:e,valueOffsets:r}=t;return r&&Ao.call(this,Zt(r[0],e,r)),this.visit(t.getChildAt(0))}function Co(t){return this.visitMany(t.type.children.map((e,r)=>t.getChildAt(r)).filter(Boolean))[0]}ko.prototype.visitBool=function(t){let e;return t.nullCount>=t.length?Ao.call(this,new Uint8Array(0)):(e=t.values)instanceof Uint8Array?Ao.call(this,ve(t.offset,t.length,e)):Ao.call(this,be(t))},ko.prototype.visitInt=Mo,ko.prototype.visitFloat=Mo,ko.prototype.visitUtf8=So,ko.prototype.visitBinary=So,ko.prototype.visitFixedSizeBinary=Mo,ko.prototype.visitDate=Mo,ko.prototype.visitTimestamp=Mo,ko.prototype.visitTime=Mo,ko.prototype.visitDecimal=Mo,ko.prototype.visitList=Eo,ko.prototype.visitStruct=Co,ko.prototype.visitUnion=function(t){const{type:e,length:r,typeIds:n,valueOffsets:i}=t;if(Ao.call(this,n),e.mode===fe.Sparse)return Co.call(this,t);if(e.mode===fe.Dense){if(t.offset<=0)return Ao.call(this,i),Co.call(this,t);{const a=n.reduce((t,e)=>Math.max(t,e),n[0]),o=new Int32Array(a+1),s=new Int32Array(a+1).fill(-1),l=new Int32Array(r),c=Zt(-i[0],r,i);for(let t,e,i=-1;++i0&&void 0!==arguments[0]&&arguments[0];return this._sink.toString(t)}toUint8Array(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._sink.toUint8Array(t)}writeAll(t){return rt(t)?t.then(t=>this.writeAll(t)):it(t)?Do(this,t):Po(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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._sink,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var r;return t===this._sink||t instanceof Ji?this._sink=t:(this._sink=new Ji,t&&(et(r=t)&&tt(r.abort)&&tt(r.getWriter)&&!(r instanceof q))?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&(t=>et(t)&&tt(t.end)&&tt(t.write)&&$(t.writable)&&!(t instanceof q))(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,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 new Error("RecordBatchWriter is closed");if(null===t||void 0===t)return this.finish()&&void 0;if(t instanceof _l&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof wl&&!(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 wl?t instanceof Tl||this._writeRecordBatch(t):t instanceof _l?this.writeAll(t.chunks):nt(t)&&this.writeAll(t)}_writeMessage(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:8)-1,r=Ja.encode(t),n=r.byteLength,i=this._writeLegacyIpcFormat?4:8,a=n+i+e&~e,o=a-n-i;return t.headerType===pe.RecordBatch?this._recordBatchBlocks.push(new Xi(a,t.bodyLength,this._position)):t.headerType===pe.DictionaryBatch&&this._dictionaryBlocks.push(new Xi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-i)),n>0&&this._write(r),this._writePadding(o)}_write(t){if(this._started){const e=xt(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Ja.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(bo)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:r,bufferRegions:n,buffers:i}=ko.assemble(t),a=new Ka(t.length,r,n),o=Ja.from(a,e);return this._writeDictionaries(t)._writeMessage(o)._writeBodyBuffers(i)}_writeDictionaryBatch(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));const{byteLength:n,nodes:i,bufferRegions:a,buffers:o}=ko.assemble(t),s=new Ka(t.length,i,a),l=new Qa(s,e,r),c=Ja.from(l,n);return this._writeMessage(c)._writeBodyBuffers(o)}_writeBodyBuffers(t){let e,r,n;for(let i=-1,a=t.length;++i0&&(this._write(e),(n=(r+7&-8)-r)>0&&this._writePadding(n));return this}_writeDictionaries(t){for(let[e,r]of t.dictionaries){let t=this._dictionaryDeltaOffsets.get(e)||0;if(0===t||(r=r.slice(t)).length>0){const n="chunks"in r?r.chunks:[r];for(const r of n)this._writeDictionaryBatch(r,e,t>0),t+=r.length}}return this}}class Io extends Lo{static writeAll(t,e){const r=new Io(e);return rt(t)?t.then(t=>r.writeAll(t)):it(t)?Do(r,t):Po(r,t)}}class Oo extends Lo{constructor(){super(),this._autoDestroy=!0}static writeAll(t){const e=new Oo;return rt(t)?t.then(t=>e.writeAll(t)):it(t)?Do(e,t):Po(e,t)}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const e=Wi.encode(new Wi(t,de.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function Po(t,e){let r=e;e instanceof _l&&(r=e.chunks,t.reset(void 0,e.schema));for(const n of r)t.write(n);return t.finish()}async function Do(t,e){for await(const r of e)t.write(r);return t.finish()}const zo=new Uint8Array(0),Ro=t=>[zo,zo,new Uint8Array(t),zo];function Fo(t,e){return function(t,e){const r=[...t.fields],n=[],i={numBatches:e.reduce((t,e)=>Math.max(t,e.length),0)};let a,o=0,s=0,l=-1,c=e.length,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,l=-1;++l0&&(n[o++]=[s,u.slice()]))}return[t=new li(r,t.metadata),n.map(e=>new wl(t,...e))]}(t,e.map(t=>t instanceof Xn?t.chunks.map(t=>t.data):[t.data]))}function Bo(t,e,r,n,i){let a,o,s=0,l=-1,c=n.length;const u=(e+63&-64)>>3;for(;++l=e?s===e?r[l]=a:(r[l]=a.slice(0,e),a=a.slice(e,s-e),i.numBatches=Math.max(i.numBatches,n[l].unshift(a))):((o=t[l]).nullable||(t[l]=o.clone({nullable:!0})),r[l]=a?a._changeLengthAndBackfillNullBitmap(e):br.new(o.type,0,e,e,Ro(u)));return r}class No extends te{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 byteLength(){return this.data.byteLength}get VectorName(){return"".concat(oe[this.typeId],"Vector")}get ArrayType(){return this.type.ArrayType}get values(){return this.data.values}get typeIds(){return this.data.typeIds}get nullBitmap(){return this.data.nullBitmap}get valueOffsets(){return this.data.valueOffsets}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}clone(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._children;return te.new(t,e)}concat(){for(var t=arguments.length,e=new Array(t),r=0;r0){const e=this.offset+t;return 0!==(this.nullBitmap[e>>3]&1<=this.numChildren?null:(this._children||(this._children=[]))[t]||(this._children[t]=te.new(this.data.childData[t]))}toJSON(){return[...this]}_sliceInternal(t,e,r){return t.clone(t.data.slice(e,r-e),null)}_bindDataAccessors(t){}}No.prototype[Symbol.isConcatSpreadable]=!0;class jo extends No{asUtf8(){return te.new(this.data.clone(new tr))}}class Uo extends No{static from(t){return xl(()=>new er,t)}}class Vo extends No{static from(){for(var t=arguments.length,e=new Array(t),r=0;re[1]===le.DAY?new ir:new ar,e[0]):xl(()=>new ar,e[0])}}class Ho extends Vo{}class qo extends Vo{}class Go extends No{}class Yo extends No{constructor(t){super(t),this.indices=te.new(t.clone(this.type.indices))}static from(){for(var t=arguments.length,e=new Array(t),r=0;re[0].type,e[0])}get dictionary(){return this.data.dictionary}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)}}Yo.prototype.indices=null;class Wo extends No{}class Zo extends No{}class Xo extends No{static from(t){let e=es(this);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let r=ts(t.constructor)||e;if(null===e&&(e=r),e&&e===r){let r=new e,n=t.byteLength/r.ArrayType.BYTES_PER_ELEMENT;if(!$o(e,t.constructor))return te.new(br.Float(r,0,n,0,null,t))}}if(e)return xl(()=>new e,t);if(t instanceof DataView||t instanceof ArrayBuffer)throw new TypeError("Cannot infer float type from instance of ".concat(t.constructor.name));throw new TypeError("Unrecognized FloatVector input")}}class Jo extends Xo{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}}class Ko extends Xo{}class Qo extends Xo{}const $o=(t,e)=>t===Je&&e!==Uint16Array,ts=t=>{switch(t){case Uint16Array:return Je;case Float32Array:return Ke;case Float64Array:return Qe;default:return null}},es=t=>{switch(t){case Jo:return Je;case Ko:return Ke;case Qo:return Qe;default:return null}};class rs extends No{}class ns extends rs{}class is extends rs{}class as extends No{static from(){for(var t=arguments.length,e=new Array(t),r=0;rnew a,n);if(n instanceof DataView||n instanceof ArrayBuffer)throw new TypeError("Cannot infer integer type from instance of ".concat(n.constructor.name));throw new TypeError("Unrecognized IntVector input")}}class os extends as{}class ss extends as{}class ls extends as{}class cs extends as{toBigInt64Array(){return bt(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}}class us extends as{}class fs extends as{}class hs extends as{}class ps extends as{toBigUint64Array(){return Tt(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}}const ds=(t,e)=>(t===qe||t===Ze)&&(e===Int32Array||e===Uint32Array),gs=(t,e)=>{switch(t){case Int8Array:return Ue;case Int16Array:return Ve;case Int32Array:return e?qe:He;case Z:return qe;case Uint8Array:return Ge;case Uint16Array:return Ye;case Uint32Array:return e?Ze:We;case J:return Ze;default:return null}},ms=(t,e)=>{switch(t){case os:return Ue;case ss:return Ve;case ls:return e?qe:He;case cs:return qe;case us:return Ge;case fs:return Ye;case hs:return e?Ze:We;case ps:return Ze;default:return null}};class ys extends No{}class vs extends No{asList(){const t=this.type.children[0];return te.new(this.data.clone(new cr(t)))}bind(t){const e=this.getChildAt(0),{[t]:r,[t+1]:n}=this.valueOffsets;return new Fn(e.slice(r,n))}}class bs extends No{}const xs=Symbol.for("rowIndex");class _s extends No{bind(t){const e=this._row||(this._row=new Bn(this)),r=Object.create(e);return r[xs]=t,r}}class ws extends No{}class Ts extends ws{}class ks extends ws{}class As extends ws{}class Ms extends ws{}class Ss extends No{}class Es extends Ss{}class Cs extends Ss{}class Ls extends Ss{}class Is extends Ss{}class Os extends No{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}}class Ps extends Os{get valueOffsets(){return this.data.valueOffsets}}class Ds extends Os{}class zs extends No{static from(t){return xl(()=>new tr,t)}asBinary(){return te.new(this.data.clone(new $e))}}function Rs(t){return function(){return t(this)}}function Fs(t){return function(e,r){return t(this,e,r)}}class Bs extends ke{}const Ns=(t,e)=>4294967296*t[e+1]+(t[e]>>>0),js=t=>new Date(t),Us=(t,e,r)=>{const{[r]:n,[r+1]:i}=e;return null!=n&&null!=i?t.subarray(n,i):null},Vs=(t,e)=>{let{values:r}=t;return((t,e)=>js(((t,e)=>864e5*t[e])(t,e)))(r,e)},Hs=(t,e)=>{let{values:r}=t;return((t,e)=>js(Ns(t,e)))(r,2*e)},qs=(t,e)=>{let{stride:r,values:n}=t;return n[r*e]},Gs=(t,e)=>{let{stride:r,values:n}=t;return Ur(n[r*e])},Ys=(t,e)=>{let{stride:r,values:n,type:i}=t;return rn.new(n.subarray(r*e,r*(e+1)),i.isSigned)},Ws=(t,e)=>{let{values:r}=t;return 1e3*Ns(r,2*e)},Zs=(t,e)=>{let{values:r}=t;return Ns(r,2*e)},Xs=(t,e)=>{let{values:r}=t;return((t,e)=>t[e+1]/1e3*4294967296+(t[e]>>>0)/1e3)(r,2*e)},Js=(t,e)=>{let{values:r}=t;return((t,e)=>t[e+1]/1e6*4294967296+(t[e]>>>0)/1e6)(r,2*e)},Ks=(t,e)=>{let{values:r,stride:n}=t;return r[n*e]},Qs=(t,e)=>{let{values:r,stride:n}=t;return r[n*e]},$s=(t,e)=>{let{values:r}=t;return rn.signed(r.subarray(2*e,2*(e+1)))},tl=(t,e)=>{let{values:r}=t;return rn.signed(r.subarray(2*e,2*(e+1)))},el=(t,e)=>{const r=t.typeIdToChildIndex[t.typeIds[e]],n=t.getChildAt(r);return n?n.get(t.valueOffsets[e]):null},rl=(t,e)=>{const r=t.typeIdToChildIndex[t.typeIds[e]],n=t.getChildAt(r);return n?n.get(e):null},nl=(t,e)=>{let{values:r}=t;return r.subarray(2*e,2*(e+1))},il=(t,e)=>{let{values:r}=t;const n=r[e],i=new Int32Array(2);return i[0]=n/12|0,i[1]=n%12|0,i};Bs.prototype.visitNull=(t,e)=>null,Bs.prototype.visitBool=(t,e)=>{let{offset:r,values:n}=t;const i=r+e;return 0!==(n[i>>3]&1<t.type.bitWidth<64?qs(t,e):Ys(t,e),Bs.prototype.visitInt8=qs,Bs.prototype.visitInt16=qs,Bs.prototype.visitInt32=qs,Bs.prototype.visitInt64=Ys,Bs.prototype.visitUint8=qs,Bs.prototype.visitUint16=qs,Bs.prototype.visitUint32=qs,Bs.prototype.visitUint64=Ys,Bs.prototype.visitFloat=(t,e)=>t.type.precision!==ue.HALF?qs(t,e):Gs(t,e),Bs.prototype.visitFloat16=Gs,Bs.prototype.visitFloat32=qs,Bs.prototype.visitFloat64=qs,Bs.prototype.visitUtf8=(t,e)=>{let{values:r,valueOffsets:n}=t;const i=Us(r,n,e);return null!==i?j(i):null},Bs.prototype.visitBinary=(t,e)=>{let{values:r,valueOffsets:n}=t;return Us(r,n,e)},Bs.prototype.visitFixedSizeBinary=(t,e)=>{let{stride:r,values:n}=t;return n.subarray(r*e,r*(e+1))},Bs.prototype.visitDate=(t,e)=>t.type.unit===le.DAY?Vs(t,e):Hs(t,e),Bs.prototype.visitDateDay=Vs,Bs.prototype.visitDateMillisecond=Hs,Bs.prototype.visitTimestamp=(t,e)=>{switch(t.type.unit){case ce.SECOND:return Ws(t,e);case ce.MILLISECOND:return Zs(t,e);case ce.MICROSECOND:return Xs(t,e);case ce.NANOSECOND:return Js(t,e)}},Bs.prototype.visitTimestampSecond=Ws,Bs.prototype.visitTimestampMillisecond=Zs,Bs.prototype.visitTimestampMicrosecond=Xs,Bs.prototype.visitTimestampNanosecond=Js,Bs.prototype.visitTime=(t,e)=>{switch(t.type.unit){case ce.SECOND:return Ks(t,e);case ce.MILLISECOND:return Qs(t,e);case ce.MICROSECOND:return $s(t,e);case ce.NANOSECOND:return tl(t,e)}},Bs.prototype.visitTimeSecond=Ks,Bs.prototype.visitTimeMillisecond=Qs,Bs.prototype.visitTimeMicrosecond=$s,Bs.prototype.visitTimeNanosecond=tl,Bs.prototype.visitDecimal=(t,e)=>{let{values:r}=t;return rn.decimal(r.subarray(4*e,4*(e+1)))},Bs.prototype.visitList=(t,e)=>{const r=t.getChildAt(0),{valueOffsets:n,stride:i}=t;return r.slice(n[e*i],n[e*i+1])},Bs.prototype.visitStruct=(t,e)=>t.bind(e),Bs.prototype.visitUnion=(t,e)=>t.type.mode===fe.Dense?el(t,e):rl(t,e),Bs.prototype.visitDenseUnion=el,Bs.prototype.visitSparseUnion=rl,Bs.prototype.visitDictionary=(t,e)=>t.getValue(t.getKey(e)),Bs.prototype.visitInterval=(t,e)=>t.type.unit===he.DAY_TIME?nl(t,e):il(t,e),Bs.prototype.visitIntervalDayTime=nl,Bs.prototype.visitIntervalYearMonth=il,Bs.prototype.visitFixedSizeList=(t,e)=>{const r=t.getChildAt(0),{stride:n}=t;return r.slice(e*n,(e+1)*n)},Bs.prototype.visitMap=(t,e)=>t.bind(e);const al=new Bs;class ol extends ke{}function sl(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 xe(r,t.data.offset+(e||0),t.length,r,ge)){if(!i)return n;++n}return-1}(t,r);const n=Yn(e);for(let i=(r||0)-1,a=t.length;++i0?0:-1},ol.prototype.visitBool=sl,ol.prototype.visitInt=sl,ol.prototype.visitInt8=sl,ol.prototype.visitInt16=sl,ol.prototype.visitInt32=sl,ol.prototype.visitInt64=sl,ol.prototype.visitUint8=sl,ol.prototype.visitUint16=sl,ol.prototype.visitUint32=sl,ol.prototype.visitUint64=sl,ol.prototype.visitFloat=sl,ol.prototype.visitFloat16=sl,ol.prototype.visitFloat32=sl,ol.prototype.visitFloat64=sl,ol.prototype.visitUtf8=sl,ol.prototype.visitBinary=sl,ol.prototype.visitFixedSizeBinary=sl,ol.prototype.visitDate=sl,ol.prototype.visitDateDay=sl,ol.prototype.visitDateMillisecond=sl,ol.prototype.visitTimestamp=sl,ol.prototype.visitTimestampSecond=sl,ol.prototype.visitTimestampMillisecond=sl,ol.prototype.visitTimestampMicrosecond=sl,ol.prototype.visitTimestampNanosecond=sl,ol.prototype.visitTime=sl,ol.prototype.visitTimeSecond=sl,ol.prototype.visitTimeMillisecond=sl,ol.prototype.visitTimeMicrosecond=sl,ol.prototype.visitTimeNanosecond=sl,ol.prototype.visitDecimal=sl,ol.prototype.visitList=sl,ol.prototype.visitStruct=sl,ol.prototype.visitUnion=sl,ol.prototype.visitDenseUnion=ll,ol.prototype.visitSparseUnion=ll,ol.prototype.visitDictionary=sl,ol.prototype.visitInterval=sl,ol.prototype.visitIntervalDayTime=sl,ol.prototype.visitIntervalYearMonth=sl,ol.prototype.visitFixedSizeList=sl,ol.prototype.visitMap=sl;const cl=new ol;class ul extends ke{}function fl(t){if(t.nullCount>0)return function(t){const e=al.getVisitFn(t);return xe(t.nullBitmap,t.offset,t.length,t,(t,r,n,i)=>0!==(n&1<0)?t.values.subarray(0,n)[Symbol.iterator]():function*(e){for(let r=-1;++rt+e,yl=t=>"Cannot compute the byte width of variable-width column ".concat(t);const vl=new class extends ke{visitNull(t){return 0}visitInt(t){return t.bitWidth/8}visitFloat(t){return t.ArrayType.BYTES_PER_ELEMENT}visitBinary(t){throw new Error(yl(t))}visitUtf8(t){throw new Error(yl(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===ce.SECOND?4:8}visitInterval(t){return 4*(t.unit+1)}visitList(t){throw new Error(yl(t))}visitStruct(t){return this.visitFields(t.children).reduce(ml,0)}visitUnion(t){return this.visitFields(t.children).reduce(ml,0)}visitFixedSizeBinary(t){return t.byteWidth}visitFixedSizeList(t){return t.listSize*this.visitFields(t.children).reduce(ml,0)}visitMap(t){return this.visitFields(t.children).reduce(ml,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(ml,0)}};const bl=new class extends ke{visitNull(){return bs}visitBool(){return Uo}visitInt(){return as}visitInt8(){return os}visitInt16(){return ss}visitInt32(){return ls}visitInt64(){return cs}visitUint8(){return us}visitUint16(){return fs}visitUint32(){return hs}visitUint64(){return ps}visitFloat(){return Xo}visitFloat16(){return Jo}visitFloat32(){return Ko}visitFloat64(){return Qo}visitUtf8(){return zs}visitBinary(){return jo}visitFixedSizeBinary(){return Wo}visitDate(){return Vo}visitDateDay(){return Ho}visitDateMillisecond(){return qo}visitTimestamp(){return ws}visitTimestampSecond(){return Ts}visitTimestampMillisecond(){return ks}visitTimestampMicrosecond(){return As}visitTimestampNanosecond(){return Ms}visitTime(){return Ss}visitTimeSecond(){return Es}visitTimeMillisecond(){return Cs}visitTimeMicrosecond(){return Ls}visitTimeNanosecond(){return Is}visitDecimal(){return Go}visitList(){return ys}visitStruct(){return _s}visitUnion(){return Os}visitDenseUnion(){return Ps}visitSparseUnion(){return Ds}visitDictionary(){return Yo}visitInterval(){return rs}visitIntervalDayTime(){return ns}visitIntervalYearMonth(){return is}visitFixedSizeList(){return Zo}visitMap(){return vs}};function xl(t,e){if(nt(e))return te.from({nullValues:[null,void 0],type:t(),values:e});if(it(e))return te.from({nullValues:[null,void 0],type:t(),values:e});const{values:r=[],type:n=t(),nullValues:i=[null,void 0]}={...e};return nt(r),te.from({nullValues:i,...e,type:n})}te.new=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n{const n=Er.throughAsyncIterable(r);for await(const r of n(e))t.push(r);return 1===t.length?t[0]:Xn.concat(t)})([])},No.prototype.get=function(t){return al.visit(this,t)},No.prototype.set=function(t,e){return Ni.visit(this,t,e)},No.prototype.indexOf=function(t,e){return cl.visit(this,t,e)},No.prototype.toArray=function(){return gl.visit(this)},No.prototype.getByteWidth=function(){return vl.visit(this.type)},No.prototype[Symbol.iterator]=function(){return hl.visit(this)},No.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){ye(this.nullBitmap,this.offset+e,!(null===r||void 0===r))&&t.call(this,e,r)}}(this.set));var e},Object.keys(oe).map(t=>oe[t]).filter(t=>"number"===typeof t).filter(t=>t!==oe.NONE).forEach(t=>{const e=bl.visit(t);var r;e.prototype.get=(r=al.getVisitFn(t),function(t){return r(this,t)}),e.prototype.set=Fs(Ni.getVisitFn(t)),e.prototype.indexOf=Fs(cl.getVisitFn(t)),e.prototype.toArray=Rs(gl.getVisitFn(t)),e.prototype.getByteWidth=function(t){return function(){return t(this.type)}}(vl.getVisitFn(t)),e.prototype[Symbol.iterator]=Rs(hl.getVisitFn(t))});class _l extends Xn{constructor(){let t=null;for(var e=arguments.length,r=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:new li([]);return new _l(t,[])}static from(t){if(!t)return _l.empty();if("object"===typeof t){let e=nt(t.values)?function(t){const{type:e}=t;if(e instanceof ur)return _l.fromStruct(_s.from(t));return null}(t):it(t.values)?function(t){const{type:e}=t;if(e instanceof ur)return _s.from(t).then(t=>_l.fromStruct(t));return null}(t):null;if(null!==e)return e}let e=Al.from(t);return rt(e)?(async()=>await _l.from(await e))():e.isSync()&&(e=e.open())?e.schema?new _l(e.schema,[...e]):_l.empty():(async t=>{const e=await t,r=e.schema,n=[];if(r){for await(let t of e)n.push(t);return new _l(r,n)}return _l.empty()})(e.open())}static async fromAsync(t){return await _l.from(t)}static fromStruct(t){return _l.new(t.data.childData,t.type.children)}static new(){for(var t=arguments.length,e=new Array(t),r=0;r{const[e,r]=si(t,[[],[]]);return r.map((t,r)=>t instanceof Qn?Qn.new(t.field.clone(e[r]),t):t instanceof te?Qn.new(e[r],t):Qn.new(e[r],[]))})(e),Fo(new li(n.map(t=>{let{field:e}=t;return e})),n)));var n}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new _l(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 Qn(e,r)}return null}serialize(){return(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?Io:Oo).writeAll(this).toUint8Array(!0)}count(){return this._length}select(){const t=this._schema.fields.reduce((t,e,r)=>t.set(e.name,r),new Map);for(var e=arguments.length,r=new Array(e),n=0;nt.get(e)).filter(t=>t>-1))}selectAt(){for(var t=arguments.length,e=new Array(t),r=0;r{let{length:r,data:{childData:i}}=t;return new wl(n,r,e.map(t=>i[t]).filter(Boolean))}))}assign(t){var e=this;const r=this._schema.fields,[n,i]=t.schema.fields.reduce((t,e,n)=>{const[i,a]=t,o=r.findIndex(t=>t.name===e.name);return~o?a[o]=n:i.push(n),t},[[],[]]),a=this._schema.assign(t.schema),o=[...r.map((function(r,n,a){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i[n];return void 0===o?e.getColumnAt(n):t.getColumnAt(o)})),...n.map(e=>t.getColumnAt(e))].filter(Boolean);return new _l(...Fo(a,o))}}class wl extends _s{constructor(){let t;for(var e=arguments.length,r=new Array(e),n=0;nt instanceof te);return new wl(...function(t,e){let r,n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.reduce((t,e)=>Math.max(t,e.length),0),a=-1,o=e.length;const s=[...t.fields],l=[],c=(i+63&-64)>>3;for(;++at.data)))}clone(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._children;return new wl(this._schema,t,e)}concat(){for(var t=arguments.length,e=new Array(t),r=0;r{let{data:e}=t;return new wl(n,e)}))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=kl.collect(this))}select(){const t=this._schema.fields.reduce((t,e,r)=>t.set(e.name,r),new Map);for(var e=arguments.length,r=new Array(e),n=0;nt.get(e)).filter(t=>t>-1))}selectAt(){for(var t=arguments.length,e=new Array(t),r=0;rthis.data.childData[t]).filter(Boolean);return new wl(n,this.length,i)}}class Tl extends wl{constructor(t){super(t,0,t.fields.map(t=>br.new(t.type,0,0,0)))}}class kl extends ke{constructor(){super(...arguments),this.dictionaries=new Map}static collect(t){return(new kl).visit(t.data,new ur(t.schema.fields)).dictionaries}visit(t,e){return Fe.isDictionary(e)?this.visitDictionary(t,e):(t.childData.forEach((t,r)=>this.visit(t,e.children[r].type)),this)}visitDictionary(t,e){const r=t.dictionary;return r&&r.length>0&&this.dictionaries.set(e.id,r),this}}class Al extends q{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 rt(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 Jt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Jt.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Al?t:at(t)?function(t){return new Ml(new zl(t))}(t):st(t)?async function(t){const{size:e}=await t.stat(),r=new ra(t,e);if(e>=To&&xo(await r.readAt(0,_o+7&-8)))return new Cl(new Dl(r));return new Sl(new Ol(r))}(t):rt(t)?(async()=>await Al.from(await t))():lt(t)||ct(t)||ut(t)||it(t)?async function(t){const e=await t.peek(_o+7&-8);return e&&e.byteLength>=4?xo(e)?new El(new Pl(await t.read())):new Sl(new Ol(t)):new Sl(new Ol(async function*(){}()))}(new Qi(t)):function(t){const e=t.peek(_o+7&-8);return e&&e.byteLength>=4?xo(e)?new El(new Pl(t.read())):new Ml(new Il(t)):new Ml(new Il(function*(){}()))}(new Ki(t))}static readAll(t){return t instanceof Al?t.isSync()?Fl(t):Bl(t):at(t)||ArrayBuffer.isView(t)||nt(t)||ot(t)?Fl(t):Bl(t)}}class Ml extends Al{constructor(t){super(t),this._impl=t}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}}class Sl extends Al{constructor(t){super(t),this._impl=t}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class El extends Ml{constructor(t){super(t),this._impl=t}}class Cl extends Sl{constructor(t){super(t),this._impl=t}}class Ll{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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 wl(this.schema,t.length,this._loadVectors(t,e,this.schema.fields))}_loadDictionaryBatch(t,e){const{id:r,isDelta:n,data:i}=t,{dictionaries:a,schema:o}=this,s=a.get(r);if(n||!s){const t=o.dictionaries.get(r);return s&&n?s.concat(te.new(this._loadVectors(i,e,[t])[0])):te.new(this._loadVectors(i,e,[t])[0])}return s}_loadVectors(t,e,r){return new ca(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}}class Il extends Ll{constructor(t,e){super(e),this._reader=at(t)?new yo(this._handle=t):new go(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=Rl(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):V}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):V}next(){if(this.closed)return V;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.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new Tl(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ol extends Ll{constructor(t,e){super(e),this._reader=new mo(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=Rl(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):V}async return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(t):V}async next(){if(this.closed)return V;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 this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new Tl(this.schema)}):await this.return()}async _readNextMessageAndValidate(t){return await this._reader.readMessage(t)}}class Pl extends Il{constructor(t,e){super(t instanceof ea?t:new ea(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(pe.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(pe.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-wo,r=t.readInt32(e),n=t.readAt(e-r,r);return Wi.decode(n)}_readNextMessageAndValidate(t){if(this._footer||this.open(),this._footer&&this._recordBatchIndex1?e-1:0),n=1;n{this._builder.clear()},pull:t=>{this._maybeFlush(this._builder,this._controller=t)},start:t=>{this._maybeFlush(this._builder,this._controller=t)}},{highWaterMark:a,size:"bytes"!==n?jl:Ul}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:o,size:t=>this._writeValueAndReturnChunkSize(t)})}_writeValueAndReturnChunkSize(t){const e=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-e}_maybeFlush(t,e){null!==e&&(this._bufferedSize>=e.desiredSize&&++this._numChunks&&this._enqueue(e,t.toVector()),t.finished&&((t.length>0||0===this._numChunks)&&++this._numChunks&&this._enqueue(e,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(e,null)))}_enqueue(t,e){this._bufferedSize=0,this._controller=null,null===e?t.close():t.enqueue(e)}}const jl=t=>t.length,Ul=t=>t.byteLength;class Vl{eq(t){return t instanceof Vl||(t=new Hl(t)),new Jl(this,t)}le(t){return t instanceof Vl||(t=new Hl(t)),new Kl(this,t)}ge(t){return t instanceof Vl||(t=new Hl(t)),new Ql(this,t)}lt(t){return new $l(this.ge(t))}gt(t){return new $l(this.le(t))}ne(t){return new $l(this.eq(t))}}class Hl extends Vl{constructor(t){super(),this.v=t}}class ql extends Vl{constructor(t){super(),this.name=t}bind(t){if(!this.colidx){this.colidx=-1;const e=t.schema.fields;for(let t=-1;++te.get(t)}}class Gl{and(){for(var t=arguments.length,e=new Array(t),r=0;rt.concat(e instanceof Zl?e.children:e),[]),super(...e)}bind(t){const e=this.children.map(e=>e.bind(t));return(t,r)=>e.every(e=>e(t,r))}}class Xl extends Wl{constructor(){for(var t=arguments.length,e=new Array(t),r=0;rt.concat(e instanceof Xl?e.children:e),[]),super(...e)}bind(t){const e=this.children.map(e=>e.bind(t));return(t,r)=>e.some(e=>e(t,r))}}class Jl extends Yl{_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 Yo){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 Kl extends Yl{_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 Ql extends Yl{_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 $l extends Gl{constructor(t){super(),this.child=t}bind(t){const e=this.child.bind(t);return(t,r)=>!e(t,r)}}_l.prototype.countBy=function(t){return new tc(this.chunks).countBy(t)},_l.prototype.scan=function(t,e){return new tc(this.chunks).scan(t,e)},_l.prototype.scanReverse=function(t,e){return new tc(this.chunks).scanReverse(t,e)},_l.prototype.filter=function(t){return new tc(this.chunks).filter(t)};class tc extends _l{filter(t){return new rc(this.chunks,t)}scan(t,e){const r=this.chunks,n=r.length;for(let i=-1;++i=0;){const i=r[n];e&&e(i);for(let e=i.length;--e>=0;)t(e,i)}}countBy(t){const e=this.chunks,r=e.length,n="string"===typeof t?new ql(t):t;n.bind(e[r-1]);const i=n.vector;if(!Fe.isDictionary(i.type))throw new Error("countBy currently only supports dictionary-encoded columns");const a=Math.ceil(Math.log(i.length)/Math.log(256)),o=new(4==a?Uint32Array:a>=2?Uint16Array:Uint8Array)(i.dictionary.length);for(let s=-1;++s=0;){const i=r[n],a=this._predicate.bind(i);let o=!1;for(let r=i.length;--r>=0;)a(r,i)&&(e&&!o&&(e(i),o=!0),t(r,i))}}count(){let t=0;const e=this._chunks,r=e.length;for(let n=-1;++n=2?Uint16Array:Uint8Array)(i.dictionary.length);for(let s=-1;++s=i.headerRows&&e=i.headerColumns;if(r){var o=["blank"];return e>0&&o.push("level"+t),{type:"blank",classNames:o.join(" "),content:""}}if(a)return{type:"columns",classNames:(o=["col_heading","level"+t,"col"+(l=e-i.headerColumns)]).join(" "),content:i.getContent(i.columnsTable,l,t)};if(n){o=["row_heading","level"+e,"row"+(s=t-i.headerRows)];return{type:"index",id:"T_"+i.uuid+"level"+e+"_row"+s,classNames:o.join(" "),content:i.getContent(i.indexTable,s,e)}}o=["data","row"+(s=t-i.headerRows),"col"+(l=e-i.headerColumns)];var s,l,c=i.styler?i.getContent(i.styler.displayValuesTable,s,l):i.getContent(i.dataTable,s,l);return{type:"data",id:"T_"+i.uuid+"row"+s+"_col"+l,classNames:o.join(" "),content:c}},this.getContent=function(t,e,r){var n=t.getColumnAt(r);if(null===n)return"";switch(i.getColumnTypeId(t,r)){case oe.Timestamp:return i.nanosToDate(n.get(e));default:return n.get(e)}},this.dataTable=_l.from(t),this.indexTable=_l.from(e),this.columnsTable=_l.from(r),this.styler=n?{caption:n.caption,displayValuesTable:_l.from(n.displayValues),styles:n.styles,uuid:n.uuid}:void 0}return Object.defineProperty(t.prototype,"rows",{get:function(){return this.indexTable.length+this.columnsTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataRows",{get:function(){return this.dataTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"table",{get:function(){return this.dataTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.indexTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!0,configurable:!0}),t.prototype.serialize=function(){return{data:this.dataTable.serialize(),index:this.indexTable.serialize(),columns:this.columnsTable.serialize()}},t.prototype.getColumnTypeId=function(t,e){return t.schema.fields[e].type.typeId},t.prototype.nanosToDate=function(t){return new Date(t/1e6)},t}(),ac=function(){return(ac=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0?t.argsDataframeToObject(e.dfs):{};r=ac(ac({},r),n);var i=Boolean(e.disabled),a=e.theme;a&&sc(a);var o={disabled:i,args:r,theme:a},s=new CustomEvent(t.RENDER_EVENT,{detail:o});t.events.dispatchEvent(s)},t.argsDataframeToObject=function(e){var r=e.map((function(e){var r=e.key,n=e.value;return[r,t.toArrowTable(n)]}));return Object.fromEntries(r)},t.toArrowTable=function(t){var e=t.data,r=e.data,n=e.index,i=e.columns,a=e.styler;return new ic(r,n,i,a)},t.sendBackMsg=function(t,e){window.parent.postMessage(ac({isStreamlitMessage:!0,type:t},e),"*")},t}(),sc=function(t){var e=document.createElement("style");document.head.appendChild(e),e.innerHTML="\n :root {\n --primary-color: "+t.primaryColor+";\n --background-color: "+t.backgroundColor+";\n --secondary-background-color: "+t.secondaryBackgroundColor+";\n --text-color: "+t.textColor+";\n --font: "+t.font+";\n }\n\n body {\n background-color: var(--background-color);\n color: var(--text-color);\n }\n "};var lc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lc(e,t),e.prototype.componentDidMount=function(){oc.setFrameHeight()},e.prototype.componentDidUpdate=function(){oc.setFrameHeight()},e}(h.a.PureComponent);function uc(t){var e=function(e){function r(r){var n=e.call(this,r)||this;return n.componentDidMount=function(){oc.events.addEventListener(oc.RENDER_EVENT,n.onRenderEvent),oc.setComponentReady()},n.componentDidUpdate=function(){null!=n.state.componentError&&oc.setFrameHeight()},n.componentWillUnmount=function(){oc.events.removeEventListener(oc.RENDER_EVENT,n.onRenderEvent)},n.onRenderEvent=function(t){var e=t;n.setState({renderData:e.detail})},n.render=function(){return null!=n.state.componentError?h.a.createElement("div",null,h.a.createElement("h1",null,"Component Error"),h.a.createElement("span",null,n.state.componentError.message)):null==n.state.renderData?null:h.a.createElement(t,{width:window.innerWidth,disabled:n.state.renderData.disabled,args:n.state.renderData.args,theme:n.state.renderData.theme})},n.state={renderData:void 0,componentError:void 0},n}return lc(r,e),r.getDerivedStateFromError=function(t){return{componentError:t}},r}(h.a.PureComponent);return u()(e,t)}},function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),c=1;cL.length&&L.push(t)}function P(t,e,r){return null==t?0:function t(e,r,n,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case a:case o:l=!0}}if(l)return n(i,e,""===r?"."+D(e,0):r),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c