(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Md(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _l={exports:{}},q={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var mt=typeof Symbol=="function"&&Symbol.for,la=mt?Symbol.for("react.element"):60103,fa=mt?Symbol.for("react.portal"):60106,hs=mt?Symbol.for("react.fragment"):60107,ds=mt?Symbol.for("react.strict_mode"):60108,ps=mt?Symbol.for("react.profiler"):60114,ys=mt?Symbol.for("react.provider"):60109,bs=mt?Symbol.for("react.context"):60110,ha=mt?Symbol.for("react.async_mode"):60111,ms=mt?Symbol.for("react.concurrent_mode"):60111,gs=mt?Symbol.for("react.forward_ref"):60112,vs=mt?Symbol.for("react.suspense"):60113,Nd=mt?Symbol.for("react.suspense_list"):60120,ws=mt?Symbol.for("react.memo"):60115,_s=mt?Symbol.for("react.lazy"):60116,Cd=mt?Symbol.for("react.block"):60121,Rd=mt?Symbol.for("react.fundamental"):60117,Vd=mt?Symbol.for("react.responder"):60118,jd=mt?Symbol.for("react.scope"):60119;function Vt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case la:switch(e=e.type,e){case ha:case ms:case hs:case ps:case ds:case vs:return e;default:switch(e=e&&e.$$typeof,e){case bs:case gs:case _s:case ws:case ys:return e;default:return t}}case fa:return t}}}function Sl(e){return Vt(e)===ms}q.AsyncMode=ha;q.ConcurrentMode=ms;q.ContextConsumer=bs;q.ContextProvider=ys;q.Element=la;q.ForwardRef=gs;q.Fragment=hs;q.Lazy=_s;q.Memo=ws;q.Portal=fa;q.Profiler=ps;q.StrictMode=ds;q.Suspense=vs;q.isAsyncMode=function(e){return Sl(e)||Vt(e)===ha};q.isConcurrentMode=Sl;q.isContextConsumer=function(e){return Vt(e)===bs};q.isContextProvider=function(e){return Vt(e)===ys};q.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===la};q.isForwardRef=function(e){return Vt(e)===gs};q.isFragment=function(e){return Vt(e)===hs};q.isLazy=function(e){return Vt(e)===_s};q.isMemo=function(e){return Vt(e)===ws};q.isPortal=function(e){return Vt(e)===fa};q.isProfiler=function(e){return Vt(e)===ps};q.isStrictMode=function(e){return Vt(e)===ds};q.isSuspense=function(e){return Vt(e)===vs};q.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===hs||e===ms||e===ps||e===ds||e===vs||e===Nd||typeof e=="object"&&e!==null&&(e.$$typeof===_s||e.$$typeof===ws||e.$$typeof===ys||e.$$typeof===bs||e.$$typeof===gs||e.$$typeof===Rd||e.$$typeof===Vd||e.$$typeof===jd||e.$$typeof===Cd)};q.typeOf=Vt;(function(e){e.exports=q})(_l);var Il=_l.exports,Pd={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},zd={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Tl={};Tl[Il.ForwardRef]=Pd;Tl[Il.Memo]=zd;var Al={exports:{}},Q={};/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var Mc=Object.getOwnPropertySymbols,Wd=Object.prototype.hasOwnProperty,$d=Object.prototype.propertyIsEnumerable;function Yd(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Gd(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Kd=Gd()?Object.assign:function(e,t){for(var n,r=Yd(e),i,o=1;o<arguments.length;o++){n=Object(arguments[o]);for(var s in n)Wd.call(n,s)&&(r[s]=n[s]);if(Mc){i=Mc(n);for(var a=0;a<i.length;a++)$d.call(n,i[a])&&(r[i[a]]=n[i[a]])}}return r};/** @license React v16.14.0
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var da=Kd,ie=typeof Symbol=="function"&&Symbol.for,Kr=ie?Symbol.for("react.element"):60103,Zd=ie?Symbol.for("react.portal"):60106,Hd=ie?Symbol.for("react.fragment"):60107,Jd=ie?Symbol.for("react.strict_mode"):60108,Xd=ie?Symbol.for("react.profiler"):60114,qd=ie?Symbol.for("react.provider"):60109,Qd=ie?Symbol.for("react.context"):60110,tp=ie?Symbol.for("react.forward_ref"):60112,ep=ie?Symbol.for("react.suspense"):60113,np=ie?Symbol.for("react.memo"):60115,rp=ie?Symbol.for("react.lazy"):60116,Nc=typeof Symbol=="function"&&Symbol.iterator;function Zr(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Bl={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ol={};function fr(e,t,n){this.props=e,this.context=t,this.refs=Ol,this.updater=n||Bl}fr.prototype.isReactComponent={};fr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(Zr(85));this.updater.enqueueSetState(this,e,t,"setState")};fr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Fl(){}Fl.prototype=fr.prototype;function pa(e,t,n){this.props=e,this.context=t,this.refs=Ol,this.updater=n||Bl}var ya=pa.prototype=new Fl;ya.constructor=pa;da(ya,fr.prototype);ya.isPureReactComponent=!0;var ba={current:null},xl=Object.prototype.hasOwnProperty,Ll={key:!0,ref:!0,__self:!0,__source:!0};function Dl(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)xl.call(t,r)&&!Ll.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Kr,type:e,key:o,ref:s,props:i,_owner:ba.current}}function ip(e,t){return{$$typeof:Kr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ma(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kr}function sp(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(n){return t[n]})}var kl=/\/+/g,Ri=[];function El(e,t,n,r){if(Ri.length){var i=Ri.pop();return i.result=e,i.keyPrefix=t,i.func=n,i.context=r,i.count=0,i}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function Ul(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>Ri.length&&Ri.push(e)}function Do(e,t,n,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Kr:case Zd:o=!0}}if(o)return n(r,e,t===""?"."+Js(e,0):t),1;if(o=0,t=t===""?".":t+":",Array.isArray(e))for(var s=0;s<e.length;s++){i=e[s];var a=t+Js(i,s);o+=Do(i,a,n,r)}else if(e===null||typeof e!="object"?a=null:(a=Nc&&e[Nc]||e["@@iterator"],a=typeof a=="function"?a:null),typeof a=="function")for(e=a.call(e),s=0;!(i=e.next()).done;)i=i.value,a=t+Js(i,s++),o+=Do(i,a,n,r);else if(i==="object")throw n=""+e,Error(Zr(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return o}function ko(e,t,n){return e==null?0:Do(e,"",t,n)}function Js(e,t){return typeof e=="object"&&e!==null&&e.key!=null?sp(e.key):t.toString(36)}function op(e,t){e.func.call(e.context,t,e.count++)}function ap(e,t,n){var r=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Eo(e,r,n,function(o){return o}):e!=null&&(ma(e)&&(e=ip(e,i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(kl,"$&/")+"/")+n)),r.push(e))}function Eo(e,t,n,r,i){var o="";n!=null&&(o=(""+n).replace(kl,"$&/")+"/"),t=El(t,o,r,i),ko(e,ap,t),Ul(t)}var Ml={current:null};function Ue(){var e=Ml.current;if(e===null)throw Error(Zr(321));return e}var cp={ReactCurrentDispatcher:Ml,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:ba,IsSomeRendererActing:{current:!1},assign:da};Q.Children={map:function(e,t,n){if(e==null)return e;var r=[];return Eo(e,r,null,t,n),r},forEach:function(e,t,n){if(e==null)return e;t=El(null,null,t,n),ko(e,op,t),Ul(t)},count:function(e){return ko(e,function(){return null},null)},toArray:function(e){var t=[];return Eo(e,t,null,function(n){return n}),t},only:function(e){if(!ma(e))throw Error(Zr(143));return e}};Q.Component=fr;Q.Fragment=Hd;Q.Profiler=Xd;Q.PureComponent=pa;Q.StrictMode=Jd;Q.Suspense=ep;Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cp;Q.cloneElement=function(e,t,n){if(e==null)throw Error(Zr(267,e));var r=da({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=ba.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)xl.call(t,c)&&!Ll.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Kr,type:e.type,key:i,ref:o,props:r,_owner:s}};Q.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Qd,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:qd,_context:e},e.Consumer=e};Q.createElement=Dl;Q.createFactory=function(e){var t=Dl.bind(null,e);return t.type=e,t};Q.createRef=function(){return{current:null}};Q.forwardRef=function(e){return{$$typeof:tp,render:e}};Q.isValidElement=ma;Q.lazy=function(e){return{$$typeof:rp,_ctor:e,_status:-1,_result:null}};Q.memo=function(e,t){return{$$typeof:np,type:e,compare:t===void 0?null:t}};Q.useCallback=function(e,t){return Ue().useCallback(e,t)};Q.useContext=function(e,t){return Ue().useContext(e,t)};Q.useDebugValue=function(){};Q.useEffect=function(e,t){return Ue().useEffect(e,t)};Q.useImperativeHandle=function(e,t,n){return Ue().useImperativeHandle(e,t,n)};Q.useLayoutEffect=function(e,t){return Ue().useLayoutEffect(e,t)};Q.useMemo=function(e,t){return Ue().useMemo(e,t)};Q.useReducer=function(e,t,n){return Ue().useReducer(e,t,n)};Q.useRef=function(e){return Ue().useRef(e)};Q.useState=function(e){return Ue().useState(e)};Q.version="16.14.0";(function(e){e.exports=Q})(Al);const up=Md(Al.exports),Nl=new WeakMap,Uo=new WeakMap;function it(e){const t=Nl.get(e);return console.assert(t!=null,"'this' is expected an Event object, but got",e),t}function Cc(e){if(e.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}!e.event.cancelable||(e.canceled=!0,typeof e.event.preventDefault=="function"&&e.event.preventDefault())}function Zn(e,t){Nl.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=Object.keys(t);for(let r=0;r<n.length;++r){const i=n[r];i in this||Object.defineProperty(this,i,Cl(i))}}Zn.prototype={get type(){return it(this).event.type},get target(){return it(this).eventTarget},get currentTarget(){return it(this).currentTarget},composedPath(){const e=it(this).currentTarget;return e==null?[]:[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return it(this).eventPhase},stopPropagation(){const e=it(this);e.stopped=!0,typeof e.event.stopPropagation=="function"&&e.event.stopPropagation()},stopImmediatePropagation(){const e=it(this);e.stopped=!0,e.immediateStopped=!0,typeof e.event.stopImmediatePropagation=="function"&&e.event.stopImmediatePropagation()},get bubbles(){return Boolean(it(this).event.bubbles)},get cancelable(){return Boolean(it(this).event.cancelable)},preventDefault(){Cc(it(this))},get defaultPrevented(){return it(this).canceled},get composed(){return Boolean(it(this).event.composed)},get timeStamp(){return it(this).timeStamp},get srcElement(){return it(this).eventTarget},get cancelBubble(){return it(this).stopped},set cancelBubble(e){if(!e)return;const t=it(this);t.stopped=!0,typeof t.event.cancelBubble=="boolean"&&(t.event.cancelBubble=!0)},get returnValue(){return!it(this).canceled},set returnValue(e){e||Cc(it(this))},initEvent(){}};Object.defineProperty(Zn.prototype,"constructor",{value:Zn,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(Zn.prototype,window.Event.prototype),Uo.set(window.Event.prototype,Zn));function Cl(e){return{get(){return it(this).event[e]},set(t){it(this).event[e]=t},configurable:!0,enumerable:!0}}function lp(e){return{value(){const t=it(this).event;return t[e].apply(t,arguments)},configurable:!0,enumerable:!0}}function fp(e,t){const n=Object.keys(t);if(n.length===0)return e;function r(i,o){e.call(this,i,o)}r.prototype=Object.create(e.prototype,{constructor:{value:r,configurable:!0,writable:!0}});for(let i=0;i<n.length;++i){const o=n[i];if(!(o in e.prototype)){const a=typeof Object.getOwnPropertyDescriptor(t,o).value=="function";Object.defineProperty(r.prototype,o,a?lp(o):Cl(o))}}return r}function Rl(e){if(e==null||e===Object.prototype)return Zn;let t=Uo.get(e);return t==null&&(t=fp(Rl(Object.getPrototypeOf(e)),e),Uo.set(e,t)),t}function hp(e,t){const n=Rl(Object.getPrototypeOf(t));return new n(e,t)}function dp(e){return it(e).immediateStopped}function pp(e,t){it(e).eventPhase=t}function yp(e,t){it(e).currentTarget=t}function Rc(e,t){it(e).passiveListener=t}const Vl=new WeakMap,Vc=1,jc=2,Fi=3;function xi(e){return e!==null&&typeof e=="object"}function Br(e){const t=Vl.get(e);if(t==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return t}function bp(e){return{get(){let n=Br(this).get(e);for(;n!=null;){if(n.listenerType===Fi)return n.listener;n=n.next}return null},set(t){typeof t!="function"&&!xi(t)&&(t=null);const n=Br(this);let r=null,i=n.get(e);for(;i!=null;)i.listenerType===Fi?r!==null?r.next=i.next:i.next!==null?n.set(e,i.next):n.delete(e):r=i,i=i.next;if(t!==null){const o={listener:t,listenerType:Fi,passive:!1,once:!1,next:null};r===null?n.set(e,o):r.next=o}},configurable:!0,enumerable:!0}}function mp(e,t){Object.defineProperty(e,`on${t}`,bp(t))}function Pc(e){function t(){He.call(this)}t.prototype=Object.create(He.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let n=0;n<e.length;++n)mp(t.prototype,e[n]);return t}function He(){if(this instanceof He){Vl.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Pc(arguments[0]);if(arguments.length>0){const e=new Array(arguments.length);for(let t=0;t<arguments.length;++t)e[t]=arguments[t];return Pc(e)}throw new TypeError("Cannot call a class as a function")}He.prototype={addEventListener(e,t,n){if(t==null)return;if(typeof t!="function"&&!xi(t))throw new TypeError("'listener' should be a function or an object.");const r=Br(this),i=xi(n),s=Boolean(i?n.capture:n)?Vc:jc,a={listener:t,listenerType:s,passive:i&&Boolean(n.passive),once:i&&Boolean(n.once),next:null};let c=r.get(e);if(c===void 0){r.set(e,a);return}let u=null;for(;c!=null;){if(c.listener===t&&c.listenerType===s)return;u=c,c=c.next}u.next=a},removeEventListener(e,t,n){if(t==null)return;const r=Br(this),o=(xi(n)?Boolean(n.capture):Boolean(n))?Vc:jc;let s=null,a=r.get(e);for(;a!=null;){if(a.listener===t&&a.listenerType===o){s!==null?s.next=a.next:a.next!==null?r.set(e,a.next):r.delete(e);return}s=a,a=a.next}},dispatchEvent(e){if(e==null||typeof e.type!="string")throw new TypeError('"event.type" should be a string.');const t=Br(this),n=e.type;let r=t.get(n);if(r==null)return!0;const i=hp(this,e);let o=null;for(;r!=null;){if(r.once?o!==null?o.next=r.next:r.next!==null?t.set(n,r.next):t.delete(n):o=r,Rc(i,r.passive?r.listener:null),typeof r.listener=="function")try{r.listener.call(this,i)}catch(s){typeof console<"u"&&typeof console.error=="function"&&console.error(s)}else r.listenerType!==Fi&&typeof r.listener.handleEvent=="function"&&r.listener.handleEvent(i);if(dp(i))break;r=r.next}return Rc(i,null),pp(i,0),yp(i,null),!i.defaultPrevented}};Object.defineProperty(He.prototype,"constructor",{value:He,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(He.prototype,window.EventTarget.prototype);var y={};y.SIZEOF_SHORT=2;y.SIZEOF_INT=4;y.FILE_IDENTIFIER_LENGTH=4;y.Encoding={UTF8_BYTES:1,UTF16_STRING:2};y.int32=new Int32Array(2);y.float32=new Float32Array(y.int32.buffer);y.float64=new Float64Array(y.int32.buffer);y.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;y.Long=function(e,t){this.low=e|0,this.high=t|0};y.Long.create=function(e,t){return e==0&&t==0?y.Long.ZERO:new y.Long(e,t)};y.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};y.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high};y.Long.ZERO=new y.Long(0,0);y.Builder=function(e){if(e)var t=e;else var t=1024;this.bb=y.ByteBuffer.allocate(t),this.space=t,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};y.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};y.Builder.prototype.forceDefaults=function(e){this.force_defaults=e};y.Builder.prototype.dataBuffer=function(){return this.bb};y.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};y.Builder.prototype.prep=function(e,t){e>this.minalign&&(this.minalign=e);for(var n=~(this.bb.capacity()-this.space+t)+1&e-1;this.space<n+e+t;){var r=this.bb.capacity();this.bb=y.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(n)};y.Builder.prototype.pad=function(e){for(var t=0;t<e;t++)this.bb.writeInt8(--this.space,0)};y.Builder.prototype.writeInt8=function(e){this.bb.writeInt8(this.space-=1,e)};y.Builder.prototype.writeInt16=function(e){this.bb.writeInt16(this.space-=2,e)};y.Builder.prototype.writeInt32=function(e){this.bb.writeInt32(this.space-=4,e)};y.Builder.prototype.writeInt64=function(e){this.bb.writeInt64(this.space-=8,e)};y.Builder.prototype.writeFloat32=function(e){this.bb.writeFloat32(this.space-=4,e)};y.Builder.prototype.writeFloat64=function(e){this.bb.writeFloat64(this.space-=8,e)};y.Builder.prototype.addInt8=function(e){this.prep(1,0),this.writeInt8(e)};y.Builder.prototype.addInt16=function(e){this.prep(2,0),this.writeInt16(e)};y.Builder.prototype.addInt32=function(e){this.prep(4,0),this.writeInt32(e)};y.Builder.prototype.addInt64=function(e){this.prep(8,0),this.writeInt64(e)};y.Builder.prototype.addFloat32=function(e){this.prep(4,0),this.writeFloat32(e)};y.Builder.prototype.addFloat64=function(e){this.prep(8,0),this.writeFloat64(e)};y.Builder.prototype.addFieldInt8=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))};y.Builder.prototype.addFieldInt16=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))};y.Builder.prototype.addFieldInt32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))};y.Builder.prototype.addFieldInt64=function(e,t,n){(this.force_defaults||!t.equals(n))&&(this.addInt64(t),this.slot(e))};y.Builder.prototype.addFieldFloat32=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))};y.Builder.prototype.addFieldFloat64=function(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))};y.Builder.prototype.addFieldOffset=function(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))};y.Builder.prototype.addFieldStruct=function(e,t,n){t!=n&&(this.nested(t),this.slot(e))};y.Builder.prototype.nested=function(e){if(e!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};y.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};y.Builder.prototype.slot=function(e){this.vtable[e]=this.offset()};y.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};y.Builder.growByteBuffer=function(e){var t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=t<<1,r=y.ByteBuffer.allocate(n);return r.setPosition(n-t),r.bytes().set(e.bytes(),n-t),r};y.Builder.prototype.addOffset=function(e){this.prep(y.SIZEOF_INT,0),this.writeInt32(this.offset()-e+y.SIZEOF_INT)};y.Builder.prototype.startObject=function(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(var t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()};y.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var e=this.offset(),t=this.vtable_in_use-1;t>=0&&this.vtable[t]==0;t--);for(var n=t+1;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);var r=2;this.addInt16(e-this.object_start);var i=(n+r)*y.SIZEOF_SHORT;this.addInt16(i);var o=0,s=this.space;t:for(t=0;t<this.vtables.length;t++){var a=this.bb.capacity()-this.vtables[t];if(i==this.bb.readInt16(a)){for(var c=y.SIZEOF_SHORT;c<i;c+=y.SIZEOF_SHORT)if(this.bb.readInt16(s+c)!=this.bb.readInt16(a+c))continue t;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e};y.Builder.prototype.finish=function(e,t){if(t){var n=t;if(this.prep(this.minalign,y.SIZEOF_INT+y.FILE_IDENTIFIER_LENGTH),n.length!=y.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+y.FILE_IDENTIFIER_LENGTH);for(var r=y.FILE_IDENTIFIER_LENGTH-1;r>=0;r--)this.writeInt8(n.charCodeAt(r))}this.prep(this.minalign,y.SIZEOF_INT),this.addOffset(e),this.bb.setPosition(this.space)};y.Builder.prototype.requiredField=function(e,t){var n=this.bb.capacity()-e,r=n-this.bb.readInt32(n),i=this.bb.readInt16(r+t)!=0;if(!i)throw new Error("FlatBuffers: field "+t+" must be set")};y.Builder.prototype.startVector=function(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(y.SIZEOF_INT,e*t),this.prep(n,e*t)};y.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};y.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var t=e;else for(var t=[],n=0;n<e.length;){var r,i=e.charCodeAt(n++);if(i<55296||i>=56320)r=i;else{var o=e.charCodeAt(n++);r=(i<<10)+o+(65536-(55296<<10)-56320)}r<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(r&63|128))}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);for(var n=0,s=this.space,a=this.bb.bytes();n<t.length;n++)a[s++]=t[n];return this.endVector()};y.Builder.prototype.createLong=function(e,t){return y.Long.create(e,t)};y.ByteBuffer=function(e){this.bytes_=e,this.position_=0};y.ByteBuffer.allocate=function(e){return new y.ByteBuffer(new Uint8Array(e))};y.ByteBuffer.prototype.clear=function(){this.position_=0};y.ByteBuffer.prototype.bytes=function(){return this.bytes_};y.ByteBuffer.prototype.position=function(){return this.position_};y.ByteBuffer.prototype.setPosition=function(e){this.position_=e};y.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};y.ByteBuffer.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24};y.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]};y.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16};y.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8};y.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24};y.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0};y.ByteBuffer.prototype.readInt64=function(e){return new y.Long(this.readInt32(e),this.readInt32(e+4))};y.ByteBuffer.prototype.readUint64=function(e){return new y.Long(this.readUint32(e),this.readUint32(e+4))};y.ByteBuffer.prototype.readFloat32=function(e){return y.int32[0]=this.readInt32(e),y.float32[0]};y.ByteBuffer.prototype.readFloat64=function(e){return y.int32[y.isLittleEndian?0:1]=this.readInt32(e),y.int32[y.isLittleEndian?1:0]=this.readInt32(e+4),y.float64[0]};y.ByteBuffer.prototype.writeInt8=function(e,t){this.bytes_[e]=t};y.ByteBuffer.prototype.writeUint8=function(e,t){this.bytes_[e]=t};y.ByteBuffer.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8};y.ByteBuffer.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8};y.ByteBuffer.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24};y.ByteBuffer.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24};y.ByteBuffer.prototype.writeInt64=function(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)};y.ByteBuffer.prototype.writeUint64=function(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)};y.ByteBuffer.prototype.writeFloat32=function(e,t){y.float32[0]=t,this.writeInt32(e,y.int32[0])};y.ByteBuffer.prototype.writeFloat64=function(e,t){y.float64[0]=t,this.writeInt32(e,y.int32[y.isLittleEndian?0:1]),this.writeInt32(e+4,y.int32[y.isLittleEndian?1:0])};y.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+y.SIZEOF_INT+y.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var e="",t=0;t<y.FILE_IDENTIFIER_LENGTH;t++)e+=String.fromCharCode(this.readInt8(this.position_+y.SIZEOF_INT+t));return e};y.ByteBuffer.prototype.__offset=function(e,t){var n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0};y.ByteBuffer.prototype.__union=function(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e};y.ByteBuffer.prototype.__string=function(e,t){e+=this.readInt32(e);var n=this.readInt32(e),r="",i=0;if(e+=y.SIZEOF_INT,t===y.Encoding.UTF8_BYTES)return this.bytes_.subarray(e,e+n);for(;i<n;){var o,s=this.readUint8(e+i++);if(s<192)o=s;else{var a=this.readUint8(e+i++);if(s<224)o=(s&31)<<6|a&63;else{var c=this.readUint8(e+i++);if(s<240)o=(s&15)<<12|(a&63)<<6|c&63;else{var u=this.readUint8(e+i++);o=(s&7)<<18|(a&63)<<12|(c&63)<<6|u&63}}}o<65536?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode((o>>10)+55296,(o&(1<<10)-1)+56320))}return r};y.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)};y.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+y.SIZEOF_INT};y.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))};y.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=y.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+y.FILE_IDENTIFIER_LENGTH);for(var t=0;t<y.FILE_IDENTIFIER_LENGTH;t++)if(e.charCodeAt(t)!=this.readInt8(this.position_+y.SIZEOF_INT+t))return!1;return!0};y.ByteBuffer.prototype.createLong=function(e,t){return y.Long.create(e,t)};function Te(e,t,n){return t<=e&&e<=n}function Ss(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function gp(e){for(var t=String(e),n=t.length,r=0,i=[];r<n;){var o=t.charCodeAt(r);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)i.push(65533);else{var s=e.charCodeAt(r+1);if(56320<=s&&s<=57343){var a=o&1023,c=s&1023;i.push(65536+(a<<10)+c),r+=1}else i.push(65533)}r+=1}return i}function vp(e){for(var t="",n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t}var Vi=-1;function ga(e){this.tokens=[].slice.call(e)}ga.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Vi},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var Hn=-1;function Xs(e,t){if(e)throw TypeError("Decoder error");return t||65533}var ji="utf-8";function Pi(e,t){if(!(this instanceof Pi))return new Pi(e,t);if(e=e!==void 0?String(e).toLowerCase():ji,e!==ji)throw new Error("Encoding not supported. Only utf-8 is supported");t=Ss(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}Pi.prototype={decode:function(t,n){var r;typeof t=="object"&&t instanceof ArrayBuffer?r=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):r=new Uint8Array(0),n=Ss(n),this._streaming||(this._decoder=new wp({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(n.stream);for(var i=new ga(r),o=[],s;!i.endOfStream()&&(s=this._decoder.handler(i,i.read()),s!==Hn);)s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s));if(!this._streaming){do{if(s=this._decoder.handler(i,i.read()),s===Hn)break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}while(!i.endOfStream());this._decoder=null}return o.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(o[0]===65279?(this._BOMseen=!0,o.shift()):this._BOMseen=!0),vp(o)}};function zi(e,t){if(!(this instanceof zi))return new zi(e,t);if(e=e!==void 0?String(e).toLowerCase():ji,e!==ji)throw new Error("Encoding not supported. Only utf-8 is supported");t=Ss(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}zi.prototype={encode:function(t,n){t=t?String(t):"",n=Ss(n),this._streaming||(this._encoder=new _p(this._options)),this._streaming=Boolean(n.stream);for(var r=[],i=new ga(gp(t)),o;!i.endOfStream()&&(o=this._encoder.handler(i,i.read()),o!==Hn);)Array.isArray(o)?r.push.apply(r,o):r.push(o);if(!this._streaming){for(;o=this._encoder.handler(i,i.read()),o!==Hn;)Array.isArray(o)?r.push.apply(r,o):r.push(o);this._encoder=null}return new Uint8Array(r)}};function wp(e){var t=e.fatal,n=0,r=0,i=0,o=128,s=191;this.handler=function(a,c){if(c===Vi&&i!==0)return i=0,Xs(t);if(c===Vi)return Hn;if(i===0){if(Te(c,0,127))return c;if(Te(c,194,223))i=1,n=c-192;else if(Te(c,224,239))c===224&&(o=160),c===237&&(s=159),i=2,n=c-224;else if(Te(c,240,244))c===240&&(o=144),c===244&&(s=143),i=3,n=c-240;else return Xs(t);return n=n<<6*i,null}if(!Te(c,o,s))return n=i=r=0,o=128,s=191,a.prepend(c),Xs(t);if(o=128,s=191,r+=1,n+=c-128<<6*(i-r),r!==i)return null;var u=n;return n=i=r=0,u}}function _p(e){e.fatal,this.handler=function(t,n){if(n===Vi)return Hn;if(Te(n,0,127))return n;var r,i;Te(n,128,2047)?(r=1,i=192):Te(n,2048,65535)?(r=2,i=224):Te(n,65536,1114111)&&(r=3,i=240);for(var o=[(n>>6*r)+i];r>0;){var s=n>>6*(r-1);o.push(128|s&63),r-=1}return o}}const Wi=typeof Buffer=="function"?Buffer:null,jl=typeof TextDecoder=="function"&&typeof TextEncoder=="function",Mo=(e=>{if(jl||!Wi){const t=new e("utf-8");return n=>t.decode(n)}return t=>{const{buffer:n,byteOffset:r,length:i}=j(t);return Wi.from(n,r,i).toString()}})(typeof TextDecoder<"u"?TextDecoder:Pi),Is=(e=>{if(jl||!Wi){const t=new e;return n=>t.encode(n)}return(t="")=>j(Wi.from(t,"utf8"))})(typeof TextEncoder<"u"?TextEncoder:zi),at=Object.freeze({done:!0,value:void 0});class zc{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class An{tee(){return this._getDOMStream().tee()}pipe(t,n){return this._getNodeStream().pipe(t,n)}pipeTo(t,n){return this._getDOMStream().pipeTo(t,n)}pipeThrough(t,n){return this._getDOMStream().pipeThrough(t,n)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class Sp extends An{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(at);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Mt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Mt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}async throw(t){return await this.abort(t),at}async return(t){return await this.close(),at}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(at)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error(`${this} is closed`)}}const[Ip,Ts]=(()=>{const e=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw e()}return t.asIntN=()=>{throw e()},t.asUintN=()=>{throw e()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[hr,C_]=(()=>{const e=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Hr,R_]=(()=>{const e=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw e()}static from(){throw e()}constructor(){throw e()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),Tp=e=>typeof e=="number",Pl=e=>typeof e=="boolean",Yt=e=>typeof e=="function",Ct=e=>e!=null&&Object(e)===e,Je=e=>Ct(e)&&Yt(e.then),te=e=>Ct(e)&&Yt(e[Symbol.iterator]),Me=e=>Ct(e)&&Yt(e[Symbol.asyncIterator]),No=e=>Ct(e)&&Ct(e.schema),zl=e=>Ct(e)&&"done"in e&&"value"in e,Wl=e=>Ct(e)&&Yt(e.stat)&&Tp(e.fd),$l=e=>Ct(e)&&va(e.body),Ap=e=>Ct(e)&&Yt(e.abort)&&Yt(e.getWriter)&&!(e instanceof An),va=e=>Ct(e)&&Yt(e.cancel)&&Yt(e.getReader)&&!(e instanceof An),Bp=e=>Ct(e)&&Yt(e.end)&&Yt(e.write)&&Pl(e.writable)&&!(e instanceof An),Yl=e=>Ct(e)&&Yt(e.read)&&Yt(e.pipe)&&Pl(e.readable)&&!(e instanceof An);var Op=y.ByteBuffer;const wa=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Fp(e){let t=e[0]?[e[0]]:[],n,r,i,o;for(let s,a,c=0,u=0,l=e.length;++c<l;){if(s=t[u],a=e[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++u]=a);continue}if({byteOffset:n,byteLength:i}=s,{byteOffset:r,byteLength:o}=a,n+i<r||r+o<n){a&&(t[++u]=a);continue}t[u]=new Uint8Array(s.buffer,n,r-n+o)}return t}function kr(e,t,n=0,r=t.byteLength){const i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,i));return o.set(s,n),e}function ee(e,t){let n=Fp(e),r=n.reduce((l,f)=>l+f.byteLength,0),i,o,s,a=0,c=-1,u=Math.min(t||1/0,r);for(let l=n.length;++c<l;){if(i=n[c],o=i.subarray(0,Math.min(i.length,u-a)),u<=a+o.length){o.length<i.length?n[c]=i.subarray(o.length):o.length===i.length&&c++,s?kr(s,o,a):s=o;break}kr(s||(s=new Uint8Array(u)),o,a),a+=o.length}return[s||new Uint8Array(0),n.slice(c),r-(s?s.byteLength:0)]}function R(e,t){let n=zl(t)?t.value:t;return n instanceof e?e===Uint8Array?new e(n.buffer,n.byteOffset,n.byteLength):n:n?(typeof n=="string"&&(n=Is(n)),n instanceof ArrayBuffer?new e(n):n instanceof wa?new e(n):n instanceof Op?R(e,n.bytes()):ArrayBuffer.isView(n)?n.byteLength<=0?new e(0):new e(n.buffer,n.byteOffset,n.byteLength/e.BYTES_PER_ELEMENT):e.from(n)):new e(0)}const xp=e=>R(Int8Array,e),Lp=e=>R(Int16Array,e),Nn=e=>R(Int32Array,e),Gl=e=>R(hr,e),j=e=>R(Uint8Array,e),Dp=e=>R(Uint16Array,e),kp=e=>R(Uint32Array,e),Kl=e=>R(Hr,e),Ep=e=>R(Float32Array,e),Up=e=>R(Float64Array,e),Mp=e=>R(Uint8ClampedArray,e),Co=e=>(e.next(),e);function*be(e,t){const n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof wa?n(t):te(t)?t:n(t);yield*Co(function*(i){let o=null;do o=i.next(yield R(e,o));while(!o.done)}(r[Symbol.iterator]()))}const Np=e=>be(Int8Array,e),Cp=e=>be(Int16Array,e),Rp=e=>be(Int32Array,e),Zl=e=>be(Uint8Array,e),Vp=e=>be(Uint16Array,e),jp=e=>be(Uint32Array,e),Pp=e=>be(Float32Array,e),zp=e=>be(Float64Array,e),Wp=e=>be(Uint8ClampedArray,e);async function*se(e,t){if(Je(t))return yield*se(e,await t);const n=async function*(o){yield await o},r=async function*(o){yield*Co(function*(s){let a=null;do a=s.next(yield a&&a.value);while(!a.done)}(o[Symbol.iterator]()))},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof wa?n(t):te(t)?r(t):Me(t)?t:n(t);yield*Co(async function*(o){let s=null;do s=await o.next(yield R(e,s));while(!s.done)}(i[Symbol.asyncIterator]()))}const $p=e=>se(Int8Array,e),Yp=e=>se(Int16Array,e),Gp=e=>se(Int32Array,e),Hl=e=>se(Uint8Array,e),Kp=e=>se(Uint16Array,e),Zp=e=>se(Uint32Array,e),Hp=e=>se(Float32Array,e),Jp=e=>se(Float64Array,e),Xp=e=>se(Uint8ClampedArray,e);function As(e,t,n){if(e!==0){n=n.slice(0,t+1);for(let r=-1;++r<=t;)n[r]+=e}return n}function Jl(e,t){let n=0,r=e.length;if(r!==t.length)return!1;if(r>0)do if(e[n]!==t[n])return!1;while(++n<r);return!0}const qp=Object.freeze(Object.defineProperty({__proto__:null,memcpy:kr,joinUint8Arrays:ee,toArrayBufferView:R,toInt8Array:xp,toInt16Array:Lp,toInt32Array:Nn,toBigInt64Array:Gl,toUint8Array:j,toUint16Array:Dp,toUint32Array:kp,toBigUint64Array:Kl,toFloat32Array:Ep,toFloat64Array:Up,toUint8ClampedArray:Mp,toArrayBufferViewIterator:be,toInt8ArrayIterator:Np,toInt16ArrayIterator:Cp,toInt32ArrayIterator:Rp,toUint8ArrayIterator:Zl,toUint16ArrayIterator:Vp,toUint32ArrayIterator:jp,toFloat32ArrayIterator:Pp,toFloat64ArrayIterator:zp,toUint8ClampedArrayIterator:Wp,toArrayBufferViewAsyncIterator:se,toInt8ArrayAsyncIterator:$p,toInt16ArrayAsyncIterator:Yp,toInt32ArrayAsyncIterator:Gp,toUint8ArrayAsyncIterator:Hl,toUint16ArrayAsyncIterator:Kp,toUint32ArrayAsyncIterator:Zp,toFloat32ArrayAsyncIterator:Hp,toFloat64ArrayAsyncIterator:Jp,toUint8ClampedArrayAsyncIterator:Xp,rebaseValueOffsets:As,compareArrayLike:Jl},Symbol.toStringTag,{value:"Module"})),Mt={fromIterable(e){return pi(Qp(e))},fromAsyncIterable(e){return pi(ty(e))},fromDOMStream(e){return pi(ey(e))},fromNodeStream(e){return pi(ry(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},pi=e=>(e.next(),e);function*Qp(e){let t,n=!1,r=[],i,o,s,a=0;function c(){return o==="peek"?ee(r,s)[0]:([i,r,a]=ee(r,s),i)}({cmd:o,size:s}=yield null);let u=Zl(e)[Symbol.iterator]();try{do if({done:t,value:i}=isNaN(s-a)?u.next(void 0):u.next(s-a),!t&&i.byteLength>0&&(r.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(l){(n=!0)&&typeof u.throw=="function"&&u.throw(l)}finally{n===!1&&typeof u.return=="function"&&u.return()}}async function*ty(e){let t,n=!1,r=[],i,o,s,a=0;function c(){return o==="peek"?ee(r,s)[0]:([i,r,a]=ee(r,s),i)}({cmd:o,size:s}=yield null);let u=Hl(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=isNaN(s-a)?await u.next(void 0):await u.next(s-a),!t&&i.byteLength>0&&(r.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(l){(n=!0)&&typeof u.throw=="function"&&await u.throw(l)}finally{n===!1&&typeof u.return=="function"&&await u.return()}}async function*ey(e){let t=!1,n=!1,r=[],i,o,s,a=0;function c(){return o==="peek"?ee(r,s)[0]:([i,r,a]=ee(r,s),i)}({cmd:o,size:s}=yield null);let u=new ny(e);try{do if({done:t,value:i}=isNaN(s-a)?await u.read(void 0):await u.read(s-a),!t&&i.byteLength>0&&(r.push(j(i)),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(l){(n=!0)&&await u.cancel(l)}finally{n===!1?await u.cancel():e.locked&&u.releaseLock()}}class ny{constructor(t){this.source=t,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch{this.supportsBYOB=!(this.reader=this.getDefaultReader())}}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=this.byobReader=this.defaultReader=null}async cancel(t){const{reader:n,source:r}=this;n&&await n.cancel(t).catch(()=>{}),r&&r.locked&&this.releaseLock()}async read(t){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const n=!this.supportsBYOB||typeof t!="number"?await this.getDefaultReader().read():await this.readFromBYOBReader(t);return!n.done&&(n.value=j(n)),n}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 Xl(this.getBYOBReader(),new ArrayBuffer(t),0,t)}}async function Xl(e,t,n,r){if(n>=r)return{done:!1,value:new Uint8Array(t,0,r)};const{done:i,value:o}=await e.read(new Uint8Array(t,n,r-n));return(n+=o.byteLength)<r&&!i?await Xl(e,o.buffer,n,r):{done:i,value:new Uint8Array(o.buffer,0,n)}}const qs=(e,t)=>{let n=i=>r([t,i]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};async function*ry(e){let t=[],n="error",r=!1,i=null,o,s,a=0,c=[],u;function l(){return o==="peek"?ee(c,s)[0]:([u,c,a]=ee(c,s),u)}if({cmd:o,size:s}=yield null,e.isTTY)return yield new Uint8Array(0);try{t[0]=qs(e,"end"),t[1]=qs(e,"error");do{if(t[2]=qs(e,"readable"),[n,i]=await Promise.race(t.map(p=>p[2])),n==="error")break;if((r=n==="end")||(isFinite(s-a)?(u=j(e.read(s-a)),u.byteLength<s-a&&(u=j(e.read(void 0)))):u=j(e.read(void 0)),u.byteLength>0&&(c.push(u),a+=u.byteLength)),r||s<=a)do({cmd:o,size:s}=yield l());while(s<a)}while(!r)}finally{await f(t,n==="error"?i:null)}function f(p,h){return u=c=null,new Promise(async(m,_)=>{for(const[b,v]of p)e.off(b,v);try{const b=e.destroy;b&&b.call(e,h),h=void 0}catch(b){h=b||h}finally{h!=null?_(h):m()}})}}class z{}var w;(function(e){(function(t){(function(n){(function(r){(function(i){i[i.V1=0]="V1",i[i.V2=1]="V2",i[i.V3=2]="V3",i[i.V4=3]="V4"})(r.MetadataVersion||(r.MetadataVersion={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(r.UnionMode||(r.UnionMode={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(r.Precision||(r.Precision={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(r.DateUnit||(r.DateUnit={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(r.TimeUnit||(r.TimeUnit={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){(function(i){i[i.YEAR_MONTH=0]="YEAR_MONTH",i[i.DAY_TIME=1]="DAY_TIME"})(r.IntervalUnit||(r.IntervalUnit={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.FloatingPoint=3]="FloatingPoint",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct_=13]="Struct_",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.LargeBinary=19]="LargeBinary",i[i.LargeUtf8=20]="LargeUtf8",i[i.LargeList=21]="LargeList"})(r.Type||(r.Type={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(r.Endianness||(r.Endianness={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsNull(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startNull(s){s.startObject(0)}static endNull(s){return s.endObject()}static createNull(s){return i.startNull(s),i.endNull(s)}}r.Null=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsStruct_(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startStruct_(s){s.startObject(0)}static endStruct_(s){return s.endObject()}static createStruct_(s){return i.startStruct_(s),i.endStruct_(s)}}r.Struct_=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsList(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startList(s){s.startObject(0)}static endList(s){return s.endObject()}static createList(s){return i.startList(s),i.endList(s)}}r.List=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsLargeList(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startLargeList(s){s.startObject(0)}static endLargeList(s){return s.endObject()}static createLargeList(s){return i.startLargeList(s),i.endLargeList(s)}}r.LargeList=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsFixedSizeList(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}listSize(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}static startFixedSizeList(s){s.startObject(1)}static addListSize(s,a){s.addFieldInt32(0,a,0)}static endFixedSizeList(s){return s.endObject()}static createFixedSizeList(s,a){return i.startFixedSizeList(s),i.addListSize(s,a),i.endFixedSizeList(s)}}r.FixedSizeList=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsMap(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}keysSorted(){let s=this.bb.__offset(this.bb_pos,4);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startMap(s){s.startObject(1)}static addKeysSorted(s,a){s.addFieldInt8(0,+a,0)}static endMap(s){return s.endObject()}static createMap(s,a){return i.startMap(s),i.addKeysSorted(s,a),i.endMap(s)}}r.Map=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsUnion(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}mode(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):e.apache.arrow.flatbuf.UnionMode.Sparse}typeIds(s){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readInt32(this.bb.__vector(this.bb_pos+a)+s*4):0}typeIdsLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}typeIdsArray(){let s=this.bb.__offset(this.bb_pos,6);return s?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+s),this.bb.__vector_len(this.bb_pos+s)):null}static startUnion(s){s.startObject(2)}static addMode(s,a){s.addFieldInt16(0,a,e.apache.arrow.flatbuf.UnionMode.Sparse)}static addTypeIds(s,a){s.addFieldOffset(1,a,0)}static createTypeIdsVector(s,a){s.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)s.addInt32(a[c]);return s.endVector()}static startTypeIdsVector(s,a){s.startVector(4,a,4)}static endUnion(s){return s.endObject()}static createUnion(s,a,c){return i.startUnion(s),i.addMode(s,a),i.addTypeIds(s,c),i.endUnion(s)}}r.Union=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsInt(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}bitWidth(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}isSigned(){let s=this.bb.__offset(this.bb_pos,6);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startInt(s){s.startObject(2)}static addBitWidth(s,a){s.addFieldInt32(0,a,0)}static addIsSigned(s,a){s.addFieldInt8(1,+a,0)}static endInt(s){return s.endObject()}static createInt(s,a,c){return i.startInt(s),i.addBitWidth(s,a),i.addIsSigned(s,c),i.endInt(s)}}r.Int=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsFloatingPoint(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}precision(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):e.apache.arrow.flatbuf.Precision.HALF}static startFloatingPoint(s){s.startObject(1)}static addPrecision(s,a){s.addFieldInt16(0,a,e.apache.arrow.flatbuf.Precision.HALF)}static endFloatingPoint(s){return s.endObject()}static createFloatingPoint(s,a){return i.startFloatingPoint(s),i.addPrecision(s,a),i.endFloatingPoint(s)}}r.FloatingPoint=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsUtf8(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startUtf8(s){s.startObject(0)}static endUtf8(s){return s.endObject()}static createUtf8(s){return i.startUtf8(s),i.endUtf8(s)}}r.Utf8=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsBinary(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startBinary(s){s.startObject(0)}static endBinary(s){return s.endObject()}static createBinary(s){return i.startBinary(s),i.endBinary(s)}}r.Binary=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsLargeUtf8(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startLargeUtf8(s){s.startObject(0)}static endLargeUtf8(s){return s.endObject()}static createLargeUtf8(s){return i.startLargeUtf8(s),i.endLargeUtf8(s)}}r.LargeUtf8=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsLargeBinary(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startLargeBinary(s){s.startObject(0)}static endLargeBinary(s){return s.endObject()}static createLargeBinary(s){return i.startLargeBinary(s),i.endLargeBinary(s)}}r.LargeBinary=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsFixedSizeBinary(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}byteWidth(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}static startFixedSizeBinary(s){s.startObject(1)}static addByteWidth(s,a){s.addFieldInt32(0,a,0)}static endFixedSizeBinary(s){return s.endObject()}static createFixedSizeBinary(s,a){return i.startFixedSizeBinary(s),i.addByteWidth(s,a),i.endFixedSizeBinary(s)}}r.FixedSizeBinary=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsBool(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}static startBool(s){s.startObject(0)}static endBool(s){return s.endObject()}static createBool(s){return i.startBool(s),i.endBool(s)}}r.Bool=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsDecimal(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}precision(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}scale(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readInt32(this.bb_pos+s):0}static startDecimal(s){s.startObject(2)}static addPrecision(s,a){s.addFieldInt32(0,a,0)}static addScale(s,a){s.addFieldInt32(1,a,0)}static endDecimal(s){return s.endObject()}static createDecimal(s,a,c){return i.startDecimal(s),i.addPrecision(s,a),i.addScale(s,c),i.endDecimal(s)}}r.Decimal=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsDate(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):e.apache.arrow.flatbuf.DateUnit.MILLISECOND}static startDate(s){s.startObject(1)}static addUnit(s,a){s.addFieldInt16(0,a,e.apache.arrow.flatbuf.DateUnit.MILLISECOND)}static endDate(s){return s.endObject()}static createDate(s,a){return i.startDate(s),i.addUnit(s,a),i.endDate(s)}}r.Date=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsTime(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):e.apache.arrow.flatbuf.TimeUnit.MILLISECOND}bitWidth(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readInt32(this.bb_pos+s):32}static startTime(s){s.startObject(2)}static addUnit(s,a){s.addFieldInt16(0,a,e.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static addBitWidth(s,a){s.addFieldInt32(1,a,32)}static endTime(s){return s.endObject()}static createTime(s,a,c){return i.startTime(s),i.addUnit(s,a),i.addBitWidth(s,c),i.endTime(s)}}r.Time=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsTimestamp(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):e.apache.arrow.flatbuf.TimeUnit.SECOND}timezone(s){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,s):null}static startTimestamp(s){s.startObject(2)}static addUnit(s,a){s.addFieldInt16(0,a,e.apache.arrow.flatbuf.TimeUnit.SECOND)}static addTimezone(s,a){s.addFieldOffset(1,a,0)}static endTimestamp(s){return s.endObject()}static createTimestamp(s,a,c){return i.startTimestamp(s),i.addUnit(s,a),i.addTimezone(s,c),i.endTimestamp(s)}}r.Timestamp=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsInterval(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):e.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}static startInterval(s){s.startObject(1)}static addUnit(s,a){s.addFieldInt16(0,a,e.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}static endInterval(s){return s.endObject()}static createInterval(s,a){return i.startInterval(s),i.addUnit(s,a),i.endInterval(s)}}r.Interval=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsDuration(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):e.apache.arrow.flatbuf.TimeUnit.MILLISECOND}static startDuration(s){s.startObject(1)}static addUnit(s,a){s.addFieldInt16(0,a,e.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static endDuration(s){return s.endObject()}static createDuration(s,a){return i.startDuration(s),i.addUnit(s,a),i.endDuration(s)}}r.Duration=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsKeyValue(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}key(s){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,s):null}value(s){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,s):null}static startKeyValue(s){s.startObject(2)}static addKey(s,a){s.addFieldOffset(0,a,0)}static addValue(s,a){s.addFieldOffset(1,a,0)}static endKeyValue(s){return s.endObject()}static createKeyValue(s,a,c){return i.startKeyValue(s),i.addKey(s,a),i.addValue(s,c),i.endKeyValue(s)}}r.KeyValue=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsDictionaryEncoding(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}id(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}indexType(s){let a=this.bb.__offset(this.bb_pos,6);return a?(s||new e.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}isOrdered(){let s=this.bb.__offset(this.bb_pos,8);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startDictionaryEncoding(s){s.startObject(3)}static addId(s,a){s.addFieldInt64(0,a,s.createLong(0,0))}static addIndexType(s,a){s.addFieldOffset(1,a,0)}static addIsOrdered(s,a){s.addFieldInt8(2,+a,0)}static endDictionaryEncoding(s){return s.endObject()}static createDictionaryEncoding(s,a,c,u){return i.startDictionaryEncoding(s),i.addId(s,a),i.addIndexType(s,c),i.addIsOrdered(s,u),i.endDictionaryEncoding(s)}}r.DictionaryEncoding=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsField(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}name(s){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,s):null}nullable(){let s=this.bb.__offset(this.bb_pos,6);return s?!!this.bb.readInt8(this.bb_pos+s):!1}typeType(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.readUint8(this.bb_pos+s):e.apache.arrow.flatbuf.Type.NONE}type(s){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.__union(s,this.bb_pos+a):null}dictionary(s){let a=this.bb.__offset(this.bb_pos,12);return a?(s||new e.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}children(s,a){let c=this.bb.__offset(this.bb_pos,14);return c?(a||new e.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+s*4),this.bb):null}childrenLength(){let s=this.bb.__offset(this.bb_pos,14);return s?this.bb.__vector_len(this.bb_pos+s):0}customMetadata(s,a){let c=this.bb.__offset(this.bb_pos,16);return c?(a||new e.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.__vector_len(this.bb_pos+s):0}static startField(s){s.startObject(7)}static addName(s,a){s.addFieldOffset(0,a,0)}static addNullable(s,a){s.addFieldInt8(1,+a,0)}static addTypeType(s,a){s.addFieldInt8(2,a,e.apache.arrow.flatbuf.Type.NONE)}static addType(s,a){s.addFieldOffset(3,a,0)}static addDictionary(s,a){s.addFieldOffset(4,a,0)}static addChildren(s,a){s.addFieldOffset(5,a,0)}static createChildrenVector(s,a){s.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)s.addOffset(a[c]);return s.endVector()}static startChildrenVector(s,a){s.startVector(4,a,4)}static addCustomMetadata(s,a){s.addFieldOffset(6,a,0)}static createCustomMetadataVector(s,a){s.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)s.addOffset(a[c]);return s.endVector()}static startCustomMetadataVector(s,a){s.startVector(4,a,4)}static endField(s){return s.endObject()}static createField(s,a,c,u,l,f,p,h){return i.startField(s),i.addName(s,a),i.addNullable(s,c),i.addTypeType(s,u),i.addType(s,l),i.addDictionary(s,f),i.addChildren(s,p),i.addCustomMetadata(s,h),i.endField(s)}}r.Field=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(s,a,c){return s.prep(8,16),s.writeInt64(c),s.writeInt64(a),s.offset()}}r.Buffer=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsSchema(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}endianness(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):e.apache.arrow.flatbuf.Endianness.Little}fields(s,a){let c=this.bb.__offset(this.bb_pos,6);return c?(a||new e.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+s*4),this.bb):null}fieldsLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}customMetadata(s,a){let c=this.bb.__offset(this.bb_pos,8);return c?(a||new e.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}static startSchema(s){s.startObject(3)}static addEndianness(s,a){s.addFieldInt16(0,a,e.apache.arrow.flatbuf.Endianness.Little)}static addFields(s,a){s.addFieldOffset(1,a,0)}static createFieldsVector(s,a){s.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)s.addOffset(a[c]);return s.endVector()}static startFieldsVector(s,a){s.startVector(4,a,4)}static addCustomMetadata(s,a){s.addFieldOffset(2,a,0)}static createCustomMetadataVector(s,a){s.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)s.addOffset(a[c]);return s.endVector()}static startCustomMetadataVector(s,a){s.startVector(4,a,4)}static endSchema(s){return s.endObject()}static finishSchemaBuffer(s,a){s.finish(a)}static createSchema(s,a,c,u){return i.startSchema(s),i.addEndianness(s,a),i.addFields(s,c),i.addCustomMetadata(s,u),i.endSchema(s)}}r.Schema=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(w||(w={}));var wt;(function(e){(function(t){(function(n){(function(r){r.Schema=w.apache.arrow.flatbuf.Schema})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(wt||(wt={}));(function(e){(function(t){(function(n){(function(r){(function(i){i[i.NONE=0]="NONE",i[i.Schema=1]="Schema",i[i.DictionaryBatch=2]="DictionaryBatch",i[i.RecordBatch=3]="RecordBatch",i[i.Tensor=4]="Tensor",i[i.SparseTensor=5]="SparseTensor"})(r.MessageHeader||(r.MessageHeader={}))})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(wt||(wt={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(s,a,c){return s.prep(8,16),s.writeInt64(c),s.writeInt64(a),s.offset()}}r.FieldNode=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(wt||(wt={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsRecordBatch(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}length(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}nodes(s,a){let c=this.bb.__offset(this.bb_pos,6);return c?(a||new e.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+c)+s*16,this.bb):null}nodesLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}buffers(s,a){let c=this.bb.__offset(this.bb_pos,8);return c?(a||new w.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+c)+s*16,this.bb):null}buffersLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}static startRecordBatch(s){s.startObject(3)}static addLength(s,a){s.addFieldInt64(0,a,s.createLong(0,0))}static addNodes(s,a){s.addFieldOffset(1,a,0)}static startNodesVector(s,a){s.startVector(16,a,8)}static addBuffers(s,a){s.addFieldOffset(2,a,0)}static startBuffersVector(s,a){s.startVector(16,a,8)}static endRecordBatch(s){return s.endObject()}static createRecordBatch(s,a,c,u){return i.startRecordBatch(s),i.addLength(s,a),i.addNodes(s,c),i.addBuffers(s,u),i.endRecordBatch(s)}}r.RecordBatch=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(wt||(wt={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsDictionaryBatch(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}id(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}data(s){let a=this.bb.__offset(this.bb_pos,6);return a?(s||new e.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}isDelta(){let s=this.bb.__offset(this.bb_pos,8);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startDictionaryBatch(s){s.startObject(3)}static addId(s,a){s.addFieldInt64(0,a,s.createLong(0,0))}static addData(s,a){s.addFieldOffset(1,a,0)}static addIsDelta(s,a){s.addFieldInt8(2,+a,0)}static endDictionaryBatch(s){return s.endObject()}static createDictionaryBatch(s,a,c,u){return i.startDictionaryBatch(s),i.addId(s,a),i.addData(s,c),i.addIsDelta(s,u),i.endDictionaryBatch(s)}}r.DictionaryBatch=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(wt||(wt={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsMessage(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}version(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):w.apache.arrow.flatbuf.MetadataVersion.V1}headerType(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readUint8(this.bb_pos+s):e.apache.arrow.flatbuf.MessageHeader.NONE}header(s){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__union(s,this.bb_pos+a):null}bodyLength(){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}customMetadata(s,a){let c=this.bb.__offset(this.bb_pos,12);return c?(a||new w.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+c)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,12);return s?this.bb.__vector_len(this.bb_pos+s):0}static startMessage(s){s.startObject(5)}static addVersion(s,a){s.addFieldInt16(0,a,w.apache.arrow.flatbuf.MetadataVersion.V1)}static addHeaderType(s,a){s.addFieldInt8(1,a,e.apache.arrow.flatbuf.MessageHeader.NONE)}static addHeader(s,a){s.addFieldOffset(2,a,0)}static addBodyLength(s,a){s.addFieldInt64(3,a,s.createLong(0,0))}static addCustomMetadata(s,a){s.addFieldOffset(4,a,0)}static createCustomMetadataVector(s,a){s.startVector(4,a.length,4);for(let c=a.length-1;c>=0;c--)s.addOffset(a[c]);return s.endVector()}static startCustomMetadataVector(s,a){s.startVector(4,a,4)}static endMessage(s){return s.endObject()}static finishMessageBuffer(s,a){s.finish(a)}static createMessage(s,a,c,u,l,f){return i.startMessage(s),i.addVersion(s,a),i.addHeaderType(s,c),i.addHeader(s,u),i.addBodyLength(s,l),i.addCustomMetadata(s,f),i.endMessage(s)}}r.Message=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(wt||(wt={}));w.apache.arrow.flatbuf.Type;var de=w.apache.arrow.flatbuf.DateUnit,H=w.apache.arrow.flatbuf.TimeUnit,$t=w.apache.arrow.flatbuf.Precision,Le=w.apache.arrow.flatbuf.UnionMode,Jn=w.apache.arrow.flatbuf.IntervalUnit,et=wt.apache.arrow.flatbuf.MessageHeader,Ht=w.apache.arrow.flatbuf.MetadataVersion,d;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"})(d||(d={}));var T;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(T||(T={}));function _a(e,t,n,r){return(n&1<<r)!==0}function ql(e,t,n,r){return(n&1<<r)>>r}function Ql(e,t,n){return n?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function Bs(e,t,n){const r=n.byteLength+7&-8;if(e>0||n.byteLength<r){const i=new Uint8Array(r);return i.set(e%8===0?n.subarray(e>>3):Er(Jr(n,e,t,null,_a)).subarray(0,r)),i}return n}function Er(e){let t=[],n=0,r=0,i=0;for(const s of e)s&&(i|=1<<r),++r===8&&(t[n++]=i,i=r=0);(n===0||r>0)&&(t[n++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}function*Jr(e,t,n,r,i){let o=t%8,s=t>>3,a=0,c=n;for(;c>0;o=0){let u=e[s++];do yield i(r,a++,u,o);while(--c>0&&++o<8)}}function $i(e,t,n){if(n-t<=0)return 0;if(n-t<8){let o=0;for(const s of Jr(e,t,n-t,e,ql))o+=s;return o}const r=n>>3<<3,i=t+(t%8===0?0:8-t%8);return $i(e,t,i)+$i(e,r,n)+tf(e,i>>3,r-i>>3)}function tf(e,t,n){let r=0,i=t|0;const o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=n===void 0?e.byteLength:i+n;for(;s-i>=4;)r+=Li(o.getUint32(i)),i+=4;for(;s-i>=2;)r+=Li(o.getUint16(i)),i+=2;for(;s-i>=1;)r+=Li(o.getUint8(i)),i+=1;return r}function Li(e){let t=e|0;return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const iy=Object.freeze(Object.defineProperty({__proto__:null,getBool:_a,getBit:ql,setBool:Ql,truncateBitmap:Bs,packBools:Er,iterateBits:Jr,popcnt_bit_range:$i,popcnt_array:tf,popcnt_uint32:Li},Symbol.toStringTag,{value:"Module"}));class V{visitMany(t,...n){return t.map((r,i)=>this.visit(r,...n.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return sy(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}}function sy(e,t,n=!0){let r=null,i=d.NONE;switch(t instanceof I||t instanceof z?i=Qs(t.type):t instanceof U?i=Qs(t):typeof(i=t)!="number"&&(i=d[t]),i){case d.Null:r=e.visitNull;break;case d.Bool:r=e.visitBool;break;case d.Int:r=e.visitInt;break;case d.Int8:r=e.visitInt8||e.visitInt;break;case d.Int16:r=e.visitInt16||e.visitInt;break;case d.Int32:r=e.visitInt32||e.visitInt;break;case d.Int64:r=e.visitInt64||e.visitInt;break;case d.Uint8:r=e.visitUint8||e.visitInt;break;case d.Uint16:r=e.visitUint16||e.visitInt;break;case d.Uint32:r=e.visitUint32||e.visitInt;break;case d.Uint64:r=e.visitUint64||e.visitInt;break;case d.Float:r=e.visitFloat;break;case d.Float16:r=e.visitFloat16||e.visitFloat;break;case d.Float32:r=e.visitFloat32||e.visitFloat;break;case d.Float64:r=e.visitFloat64||e.visitFloat;break;case d.Utf8:r=e.visitUtf8;break;case d.Binary:r=e.visitBinary;break;case d.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case d.Date:r=e.visitDate;break;case d.DateDay:r=e.visitDateDay||e.visitDate;break;case d.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case d.Timestamp:r=e.visitTimestamp;break;case d.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case d.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case d.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case d.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case d.Time:r=e.visitTime;break;case d.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case d.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case d.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case d.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case d.Decimal:r=e.visitDecimal;break;case d.List:r=e.visitList;break;case d.Struct:r=e.visitStruct;break;case d.Union:r=e.visitUnion;break;case d.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case d.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case d.Dictionary:r=e.visitDictionary;break;case d.Interval:r=e.visitInterval;break;case d.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case d.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case d.FixedSizeList:r=e.visitFixedSizeList;break;case d.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${d[i]}'`)}function Qs(e){switch(e.typeId){case d.Null:return d.Null;case d.Int:const{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?d.Int8:d.Uint8;case 16:return n?d.Int16:d.Uint16;case 32:return n?d.Int32:d.Uint32;case 64:return n?d.Int64:d.Uint64}return d.Int;case d.Float:switch(e.precision){case $t.HALF:return d.Float16;case $t.SINGLE:return d.Float32;case $t.DOUBLE:return d.Float64}return d.Float;case d.Binary:return d.Binary;case d.Utf8:return d.Utf8;case d.Bool:return d.Bool;case d.Decimal:return d.Decimal;case d.Time:switch(e.unit){case H.SECOND:return d.TimeSecond;case H.MILLISECOND:return d.TimeMillisecond;case H.MICROSECOND:return d.TimeMicrosecond;case H.NANOSECOND:return d.TimeNanosecond}return d.Time;case d.Timestamp:switch(e.unit){case H.SECOND:return d.TimestampSecond;case H.MILLISECOND:return d.TimestampMillisecond;case H.MICROSECOND:return d.TimestampMicrosecond;case H.NANOSECOND:return d.TimestampNanosecond}return d.Timestamp;case d.Date:switch(e.unit){case de.DAY:return d.DateDay;case de.MILLISECOND:return d.DateMillisecond}return d.Date;case d.Interval:switch(e.unit){case Jn.DAY_TIME:return d.IntervalDayTime;case Jn.YEAR_MONTH:return d.IntervalYearMonth}return d.Interval;case d.Map:return d.Map;case d.List:return d.List;case d.Struct:return d.Struct;case d.Union:switch(e.mode){case Le.Dense:return d.DenseUnion;case Le.Sparse:return d.SparseUnion}return d.Union;case d.FixedSizeBinary:return d.FixedSizeBinary;case d.FixedSizeList:return d.FixedSizeList;case d.Dictionary:return d.Dictionary}throw new Error(`Unrecognized type '${d[e.typeId]}'`)}V.prototype.visitInt8=null;V.prototype.visitInt16=null;V.prototype.visitInt32=null;V.prototype.visitInt64=null;V.prototype.visitUint8=null;V.prototype.visitUint16=null;V.prototype.visitUint32=null;V.prototype.visitUint64=null;V.prototype.visitFloat16=null;V.prototype.visitFloat32=null;V.prototype.visitFloat64=null;V.prototype.visitDateDay=null;V.prototype.visitDateMillisecond=null;V.prototype.visitTimestampSecond=null;V.prototype.visitTimestampMillisecond=null;V.prototype.visitTimestampMicrosecond=null;V.prototype.visitTimestampNanosecond=null;V.prototype.visitTimeSecond=null;V.prototype.visitTimeMillisecond=null;V.prototype.visitTimeMicrosecond=null;V.prototype.visitTimeNanosecond=null;V.prototype.visitDenseUnion=null;V.prototype.visitSparseUnion=null;V.prototype.visitIntervalDayTime=null;V.prototype.visitIntervalYearMonth=null;class B extends V{compareSchemas(t,n){return t===n||n instanceof t.constructor&&Nt.compareFields(t.fields,n.fields)}compareFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,i)=>Nt.compareField(r,n[i]))}compareField(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&Nt.visit(t.type,n.type)}}function kt(e,t){return t instanceof e.constructor}function Xr(e,t){return e===t||kt(e,t)}function Ne(e,t){return e===t||kt(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Os(e,t){return e===t||kt(e,t)&&e.precision===t.precision}function oy(e,t){return e===t||kt(e,t)&&e.byteWidth===t.byteWidth}function Sa(e,t){return e===t||kt(e,t)&&e.unit===t.unit}function qr(e,t){return e===t||kt(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Qr(e,t){return e===t||kt(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function ay(e,t){return e===t||kt(e,t)&&e.children.length===t.children.length&&Nt.compareFields(e.children,t.children)}function cy(e,t){return e===t||kt(e,t)&&e.children.length===t.children.length&&Nt.compareFields(e.children,t.children)}function Ia(e,t){return e===t||kt(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&Nt.compareFields(e.children,t.children)}function uy(e,t){return e===t||kt(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Nt.visit(e.indices,t.indices)&&Nt.visit(e.dictionary,t.dictionary)}function Ta(e,t){return e===t||kt(e,t)&&e.unit===t.unit}function ly(e,t){return e===t||kt(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Nt.compareFields(e.children,t.children)}function fy(e,t){return e===t||kt(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Nt.compareFields(e.children,t.children)}B.prototype.visitNull=Xr;B.prototype.visitBool=Xr;B.prototype.visitInt=Ne;B.prototype.visitInt8=Ne;B.prototype.visitInt16=Ne;B.prototype.visitInt32=Ne;B.prototype.visitInt64=Ne;B.prototype.visitUint8=Ne;B.prototype.visitUint16=Ne;B.prototype.visitUint32=Ne;B.prototype.visitUint64=Ne;B.prototype.visitFloat=Os;B.prototype.visitFloat16=Os;B.prototype.visitFloat32=Os;B.prototype.visitFloat64=Os;B.prototype.visitUtf8=Xr;B.prototype.visitBinary=Xr;B.prototype.visitFixedSizeBinary=oy;B.prototype.visitDate=Sa;B.prototype.visitDateDay=Sa;B.prototype.visitDateMillisecond=Sa;B.prototype.visitTimestamp=qr;B.prototype.visitTimestampSecond=qr;B.prototype.visitTimestampMillisecond=qr;B.prototype.visitTimestampMicrosecond=qr;B.prototype.visitTimestampNanosecond=qr;B.prototype.visitTime=Qr;B.prototype.visitTimeSecond=Qr;B.prototype.visitTimeMillisecond=Qr;B.prototype.visitTimeMicrosecond=Qr;B.prototype.visitTimeNanosecond=Qr;B.prototype.visitDecimal=Xr;B.prototype.visitList=ay;B.prototype.visitStruct=cy;B.prototype.visitUnion=Ia;B.prototype.visitDenseUnion=Ia;B.prototype.visitSparseUnion=Ia;B.prototype.visitDictionary=uy;B.prototype.visitInterval=Ta;B.prototype.visitIntervalDayTime=Ta;B.prototype.visitIntervalYearMonth=Ta;B.prototype.visitFixedSizeList=ly;B.prototype.visitMap=fy;const Nt=new B;class U{static isNull(t){return t&&t.typeId===d.Null}static isInt(t){return t&&t.typeId===d.Int}static isFloat(t){return t&&t.typeId===d.Float}static isBinary(t){return t&&t.typeId===d.Binary}static isUtf8(t){return t&&t.typeId===d.Utf8}static isBool(t){return t&&t.typeId===d.Bool}static isDecimal(t){return t&&t.typeId===d.Decimal}static isDate(t){return t&&t.typeId===d.Date}static isTime(t){return t&&t.typeId===d.Time}static isTimestamp(t){return t&&t.typeId===d.Timestamp}static isInterval(t){return t&&t.typeId===d.Interval}static isList(t){return t&&t.typeId===d.List}static isStruct(t){return t&&t.typeId===d.Struct}static isUnion(t){return t&&t.typeId===d.Union}static isFixedSizeBinary(t){return t&&t.typeId===d.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===d.FixedSizeList}static isMap(t){return t&&t.typeId===d.Map}static isDictionary(t){return t&&t.typeId===d.Dictionary}get typeId(){return d.NONE}compareTo(t){return Nt.visit(this,t)}}U[Symbol.toStringTag]=(e=>(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(U.prototype);class Xn extends U{toString(){return"Null"}get typeId(){return d.Null}}Xn[Symbol.toStringTag]=(e=>e[Symbol.toStringTag]="Null")(Xn.prototype);class Dt extends U{constructor(t,n){super(),this.isSigned=t,this.bitWidth=n}get typeId(){return d.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?Int32Array:Uint32Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}Dt[Symbol.toStringTag]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Dt.prototype);class Aa extends Dt{constructor(){super(!0,8)}}class Ba extends Dt{constructor(){super(!0,16)}}class mn extends Dt{constructor(){super(!0,32)}}class qn extends Dt{constructor(){super(!0,64)}}class Oa extends Dt{constructor(){super(!1,8)}}class Fa extends Dt{constructor(){super(!1,16)}}class xa extends Dt{constructor(){super(!1,32)}}class Qn extends Dt{constructor(){super(!1,64)}}Object.defineProperty(Aa.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Ba.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(mn.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(qn.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Oa.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Fa.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(xa.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Qn.prototype,"ArrayType",{value:Uint32Array});class gn extends U{constructor(t){super(),this.precision=t}get typeId(){return d.Float}get ArrayType(){switch(this.precision){case $t.HALF:return Uint16Array;case $t.SINGLE:return Float32Array;case $t.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}gn[Symbol.toStringTag]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(gn.prototype);class Fs extends gn{constructor(){super($t.HALF)}}class La extends gn{constructor(){super($t.SINGLE)}}class Da extends gn{constructor(){super($t.DOUBLE)}}Object.defineProperty(Fs.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(La.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Da.prototype,"ArrayType",{value:Float64Array});class Ur extends U{constructor(){super()}get typeId(){return d.Binary}toString(){return"Binary"}}Ur[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Ur.prototype);class tr extends U{constructor(){super()}get typeId(){return d.Utf8}toString(){return"Utf8"}}tr[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(tr.prototype);class Mr extends U{constructor(){super()}get typeId(){return d.Bool}toString(){return"Bool"}}Mr[Symbol.toStringTag]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Mr.prototype);class Yi extends U{constructor(t,n){super(),this.scale=t,this.precision=n}get typeId(){return d.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}Yi[Symbol.toStringTag]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Yi.prototype);class er extends U{constructor(t){super(),this.unit=t}get typeId(){return d.Date}toString(){return`Date${(this.unit+1)*32}<${de[this.unit]}>`}}er[Symbol.toStringTag]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(er.prototype);class hy extends er{constructor(){super(de.DAY)}}class Wc extends er{constructor(){super(de.MILLISECOND)}}class Gi extends U{constructor(t,n){super(),this.unit=t,this.bitWidth=n}get typeId(){return d.Time}toString(){return`Time${this.bitWidth}<${H[this.unit]}>`}}Gi[Symbol.toStringTag]=(e=>(e.unit=null,e.bitWidth=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Time"))(Gi.prototype);class Ki extends U{constructor(t,n){super(),this.unit=t,this.timezone=n}get typeId(){return d.Timestamp}toString(){return`Timestamp<${H[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Ki[Symbol.toStringTag]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(Ki.prototype);class Zi extends U{constructor(t){super(),this.unit=t}get typeId(){return d.Interval}toString(){return`Interval<${Jn[this.unit]}>`}}Zi[Symbol.toStringTag]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Zi.prototype);class nr extends U{constructor(t){super(),this.children=[t]}get typeId(){return d.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}nr[Symbol.toStringTag]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(nr.prototype);class ne extends U{constructor(t){super(),this.children=t}get typeId(){return d.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}ne[Symbol.toStringTag]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(ne.prototype);class Nr extends U{constructor(t,n,r){super(),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}get typeId(){return d.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Nr[Symbol.toStringTag]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Nr.prototype);class Hi extends U{constructor(t){super(),this.byteWidth=t}get typeId(){return d.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Hi[Symbol.toStringTag]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(Hi.prototype);class Cr extends U{constructor(t,n){super(),this.listSize=t,this.children=[n]}get typeId(){return d.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}Cr[Symbol.toStringTag]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(Cr.prototype);class Rr extends U{constructor(t,n=!1){super(),this.children=[t],this.keysSorted=n}get typeId(){return d.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Rr[Symbol.toStringTag]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(Rr.prototype);const dy=(e=>()=>++e)(-1);class Xe extends U{constructor(t,n,r,i){super(),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?dy():typeof r=="number"?r:r.low}get typeId(){return d.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Xe[Symbol.toStringTag]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(Xe.prototype);function ef(e){let t=e;switch(e.typeId){case d.Decimal:return 4;case d.Timestamp:return 2;case d.Date:return 1+t.unit;case d.Interval:return 1+t.unit;case d.Int:return 1+ +(t.bitWidth>32);case d.Time:return 1+ +(t.bitWidth>32);case d.FixedSizeList:return t.listSize;case d.FixedSizeBinary:return t.byteWidth;default:return 1}}const py=-1;class I{constructor(t,n,r,i,o,s,a){this.type=t,this.dictionary=a,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1)),this.childData=(s||[]).map(u=>u instanceof I?u:u.data);let c;o instanceof I?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets):(this.stride=ef(t),o&&((c=o[0])&&(this.valueOffsets=c),(c=o[1])&&(this.values=c),(c=o[2])&&(this.nullBitmap=c),(c=o[3])&&(this.typeIds=c)))}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:n,values:r,nullBitmap:i,typeIds:o}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),this.childData.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){let t=this._nullCount,n;return t<=py&&(n=this.nullBitmap)&&(this._nullCount=t=this.length-$i(n,this.offset,this.offset+this.length)),t}clone(t,n=this.offset,r=this.length,i=this._nullCount,o=this,s=this.childData){return new I(t,n,r,i,o,s,this.dictionary)}slice(t,n){const{stride:r,typeId:i,childData:o}=this,s=+(this._nullCount===0)-1,a=i===16?r:1,c=this._sliceBuffers(t,n,r,i);return this.clone(this.type,this.offset+t,n,s,c,!o.length||this.valueOffsets?o:this._sliceChildren(o,a*t,a*n))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===d.Null)return this.clone(this.type,0,t,0);const{length:n,nullCount:r}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,n>>3);i[n>>3]=(1<<n-(n&-8))-1,r>0&&i.set(Bs(this.offset,n,this.nullBitmap),0);const o=this.buffers;return o[T.VALIDITY]=i,this.clone(this.type,0,t,r+(t-n),o)}_sliceBuffers(t,n,r,i){let o,{buffers:s}=this;return(o=s[T.TYPE])&&(s[T.TYPE]=o.subarray(t,t+n)),(o=s[T.OFFSET])&&(s[T.OFFSET]=o.subarray(t,t+n+1))||(o=s[T.DATA])&&(s[T.DATA]=i===6?o:o.subarray(r*t,r*(t+n))),s}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}static new(t,n,r,i,o,s,a){switch(o instanceof I?o=o.buffers:o||(o=[]),t.typeId){case d.Null:return I.Null(t,n,r);case d.Int:return I.Int(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Dictionary:return I.Dictionary(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[],a);case d.Float:return I.Float(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Bool:return I.Bool(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Decimal:return I.Decimal(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Date:return I.Date(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Time:return I.Time(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Timestamp:return I.Timestamp(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Interval:return I.Interval(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.FixedSizeBinary:return I.FixedSizeBinary(t,n,r,i||0,o[T.VALIDITY],o[T.DATA]||[]);case d.Binary:return I.Binary(t,n,r,i||0,o[T.VALIDITY],o[T.OFFSET]||[],o[T.DATA]||[]);case d.Utf8:return I.Utf8(t,n,r,i||0,o[T.VALIDITY],o[T.OFFSET]||[],o[T.DATA]||[]);case d.List:return I.List(t,n,r,i||0,o[T.VALIDITY],o[T.OFFSET]||[],(s||[])[0]);case d.FixedSizeList:return I.FixedSizeList(t,n,r,i||0,o[T.VALIDITY],(s||[])[0]);case d.Struct:return I.Struct(t,n,r,i||0,o[T.VALIDITY],s||[]);case d.Map:return I.Map(t,n,r,i||0,o[T.VALIDITY],o[T.OFFSET]||[],(s||[])[0]);case d.Union:return I.Union(t,n,r,i||0,o[T.VALIDITY],o[T.TYPE]||[],o[T.OFFSET]||s,s)}throw new Error(`Unrecognized typeId ${t.typeId}`)}static Null(t,n,r){return new I(t,n,r,0)}static Int(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static Dictionary(t,n,r,i,o,s,a){return new I(t,n,r,i,[void 0,R(t.indices.ArrayType,s),j(o)],[],a)}static Float(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static Bool(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static Decimal(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static Date(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static Time(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static Timestamp(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static Interval(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static FixedSizeBinary(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,R(t.ArrayType,s),j(o)])}static Binary(t,n,r,i,o,s,a){return new I(t,n,r,i,[Nn(s),j(a),j(o)])}static Utf8(t,n,r,i,o,s,a){return new I(t,n,r,i,[Nn(s),j(a),j(o)])}static List(t,n,r,i,o,s,a){return new I(t,n,r,i,[Nn(s),void 0,j(o)],[a])}static FixedSizeList(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,void 0,j(o)],[s])}static Struct(t,n,r,i,o,s){return new I(t,n,r,i,[void 0,void 0,j(o)],s)}static Map(t,n,r,i,o,s,a){return new I(t,n,r,i,[Nn(s),void 0,j(o)],[a])}static Union(t,n,r,i,o,s,a,c){const u=[void 0,void 0,j(o),R(t.ArrayType,s)];return t.mode===Le.Sparse?new I(t,n,r,i,u,a):(u[T.OFFSET]=Nn(a),new I(t,n,r,i,u,c))}}I.prototype.childData=Object.freeze([]);const yy=void 0;function Or(e){if(e===null)return"null";if(e===yy)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e)}function by(e){if(!e||e.length<=0)return function(i){return!0};let t="",n=e.filter(r=>r===r);return n.length>0&&(t=`
    switch (x) {${n.map(r=>`
        case ${my(r)}:`).join("")}
            return false;
    }`),e.length!==n.length&&(t=`if (x !== x) return false;
${t}`),new Function("x",`${t}
return true;`)}function my(e){return typeof e!="bigint"?Or(e):Ts?`${Or(e)}n`:`"${Or(e)}"`}const to=(e,t)=>(e*t+63&-64||64)/t,gy=(e,t=0)=>e.length>=t?e.subarray(0,t):kr(new e.constructor(t),e,0);class ti{constructor(t,n=1){this.buffer=t,this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=t.length/n|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,n){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;const n=this.stride,r=this.length*n,i=this.buffer.length;r>=i&&this._resize(i===0?to(r*1,this.BYTES_PER_ELEMENT):to(r*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=to(t*this.stride,this.BYTES_PER_ELEMENT);const n=gy(this.buffer,t);return this.clear(),n}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=kr(new this.ArrayType(t),this.buffer)}}ti.prototype.offset=0;class ei extends ti{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,n){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=n,this}}class nf extends ei{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,n){const{buffer:r}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=r[i]>>o&1;return n?s===0&&(r[i]|=1<<o,++this.numValid):s===1&&(r[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}}class rf extends ei{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,n){const r=this.length-1,i=this.reserve(t-r+1).buffer;return r<t++&&i.fill(i[r],r,t),i[t]=i[t-1]+n,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}}class sf extends ti{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?hr:Hr)}set(t,n){switch(this.reserve(t-this.length+1),typeof n){case"bigint":this.buffer64[t]=n;break;case"number":this.buffer[t*this.stride]=n;break;default:this.buffer.set(n,t*this.stride)}return this}_resize(t){const n=super._resize(t),r=n.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return Ts&&(this.buffer64=new this.ArrayType64(n.buffer,n.byteOffset,r)),n}}class ct{constructor({type:t,nullValues:n}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=n,this.stride=ef(t),this._nulls=new nf,n&&n.length>0&&(this._isValid=by(n))}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 vy(t)}static throughAsyncIterable(t){return wy(t)}toVector(){return z.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((n,r)=>n+r.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((n,r)=>n+r.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,n){return this.setValid(t,this.isValid(n))&&this.setValue(t,n),this}setValue(t,n){this._setValue(this,t,n)}setValid(t,n){return this.length=this._nulls.set(t,+n).length,n}addChild(t,n=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){const t=[],n=this._values,r=this._offsets,i=this._typeIds,{length:o,nullCount:s}=this;i?(t[T.TYPE]=i.flush(o),r&&(t[T.OFFSET]=r.flush(o))):r?(n&&(t[T.DATA]=n.flush(r.last())),t[T.OFFSET]=r.flush(o)):n&&(t[T.DATA]=n.flush(o)),s>0&&(t[T.VALIDITY]=this._nulls.flush(o));const a=I.new(this.type,0,o,s,t,this.children.map(c=>c.flush()));return this.clear(),a}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}}ct.prototype.length=1;ct.prototype.stride=1;ct.prototype.children=null;ct.prototype.finished=!1;ct.prototype.nullValues=null;ct.prototype._isValid=()=>!0;class en extends ct{constructor(t){super(t),this._values=new ei(new this.ArrayType(0),this.stride)}setValue(t,n){const r=this._values;return r.reserve(t-r.length+1),super.setValue(t,n)}}class xs extends ct{constructor(t){super(t),this._pendingLength=0,this._offsets=new rf}setValue(t,n){const r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=n.length,r.set(t,n)}setValid(t,n){return super.setValid(t,n)?!0:((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,n=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,n),this}}function vy(e){const{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:n=t!=="bytes"?1e3:2**14}=e,r=t!=="bytes"?"length":"byteLength";return function*(i){let o=0,s=ct.new(e);for(const a of i)s.append(a)[r]>=n&&++o&&(yield s.toVector());(s.finish().length>0||o===0)&&(yield s.toVector())}}function wy(e){const{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:n=t!=="bytes"?1e3:2**14}=e,r=t!=="bytes"?"length":"byteLength";return async function*(i){let o=0,s=ct.new(e);for await(const a of i)s.append(a)[r]>=n&&++o&&(yield s.toVector());(s.finish().length>0||o===0)&&(yield s.toVector())}}class _y extends ct{constructor(t){super(t),this._values=new nf}setValue(t,n){this._values.set(t,+n)}}class Sy extends ct{setValue(t,n){}setValid(t,n){return this.length=Math.max(t+1,this.length),n}}class ka extends en{}class Iy extends ka{}class Ty extends ka{}class Ay extends en{}class By extends ct{constructor({type:t,nullValues:n,dictionaryHashFunction:r}){super({type:new Xe(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=ct.new({type:this.type.indices,nullValues:n}),this.dictionary=ct.new({type:this.type.dictionary,nullValues:null}),typeof r=="function"&&(this.valueToKey=r)}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,n){const r=this.indices;return n=r.setValid(t,n),this.length=r.length,n}setValue(t,n){let r=this._keysToIndices,i=this.valueToKey(n),o=r[i];return o===void 0&&(r[i]=o=this._dictionaryOffset+this.dictionary.append(n).length-1),this.indices.setValue(t,o)}flush(){const t=this.type,n=this._dictionary,r=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=n?n.concat(r):r,this.finished||(this._dictionaryOffset+=r.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}class Oy extends en{}const of=new Float64Array(1),Dn=new Uint32Array(of.buffer);function af(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function Ea(e){if(e!==e)return 32256;of[0]=e;let t=(Dn[1]&2147483648)>>16&65535,n=Dn[1]&2146435072,r=0;return n>=1089470464?Dn[0]>0?n=31744:(n=(n&2080374784)>>16,r=(Dn[1]&1048575)>>10):n<=1056964608?(r=1048576+(Dn[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(Dn[1]&1048575)+512>>10),t|n|r&65535}const Fy=Object.freeze(Object.defineProperty({__proto__:null,uint16ToFloat64:af,float64ToUint16:Ea},Symbol.toStringTag,{value:"Module"}));class Ls extends en{}class xy extends Ls{setValue(t,n){this._values.set(t,Ea(n))}}class Ly extends Ls{setValue(t,n){this._values.set(t,n)}}class Dy extends Ls{setValue(t,n){this._values.set(t,n)}}const cf=Symbol.for("isArrowBigNum");function oe(e,...t){return t.length===0?Object.setPrototypeOf(R(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}oe.prototype[cf]=!0;oe.prototype.toJSON=function(){return`"${Ge(this)}"`};oe.prototype.valueOf=function(){return uf(this)};oe.prototype.toString=function(){return Ge(this)};oe.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return uf(this);case"string":return Ge(this);case"default":return jr(this)}return Ge(this)};function zn(...e){return oe.apply(this,e)}function Wn(...e){return oe.apply(this,e)}function Vr(...e){return oe.apply(this,e)}Object.setPrototypeOf(zn.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Wn.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Vr.prototype,Object.create(Uint32Array.prototype));Object.assign(zn.prototype,oe.prototype,{constructor:zn,signed:!0,TypedArray:Int32Array,BigIntArray:hr});Object.assign(Wn.prototype,oe.prototype,{constructor:Wn,signed:!1,TypedArray:Uint32Array,BigIntArray:Hr});Object.assign(Vr.prototype,oe.prototype,{constructor:Vr,signed:!0,TypedArray:Uint32Array,BigIntArray:Hr});function uf(e){let{buffer:t,byteOffset:n,length:r,signed:i}=e,o=new Int32Array(t,n,r),s=0,a=0,c=o.length,u,l;for(;a<c;)l=o[a++],u=o[a++],i||(u=u>>>0),s+=(l>>>0)+u*a**32;return s}let Ge,jr;Ts?(jr=e=>e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:eo(e),Ge=e=>e.byteLength===8?`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`:eo(e)):(Ge=eo,jr=Ge);function eo(e){let t="",n=new Uint32Array(2),r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((r=new Uint16Array(r).reverse()).buffer),o=-1,s=r.length-1;do{for(n[0]=r[o=0];o<s;)r[o++]=n[1]=n[0]/10,n[0]=(n[0]-n[1]*10<<16)+r[o];r[o]=n[1]=n[0]/10,n[0]=n[0]-n[1]*10,t=`${n[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t||"0"}class Bn{constructor(t,n){return Bn.new(t,n)}static new(t,n){switch(n){case!0:return new zn(t);case!1:return new Wn(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case hr:return new zn(t)}return t.byteLength===16?new Vr(t):new Wn(t)}static signed(t){return new zn(t)}static unsigned(t){return new Wn(t)}static decimal(t){return new Vr(t)}}const ky=Object.freeze(Object.defineProperty({__proto__:null,isArrowBigNumSymbol:cf,get bignumToString(){return Ge},get bignumToBigInt(){return jr},BN:Bn},Symbol.toStringTag,{value:"Module"}));class Ce extends en{setValue(t,n){this._values.set(t,n)}}class Ey extends Ce{}class Uy extends Ce{}class My extends Ce{}class Ny extends Ce{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(Ji)),super(t),this._values=new sf(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(t){return super.isValid(Ji(t))}}class Cy extends Ce{}class Ry extends Ce{}class Vy extends Ce{}class jy extends Ce{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(Ji)),super(t),this._values=new sf(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(t){return super.isValid(Ji(t))}}const Ji=(e=>t=>(ArrayBuffer.isView(t)&&(e.buffer=t.buffer,e.byteOffset=t.byteOffset,e.byteLength=t.byteLength,t=jr(e),e.buffer=null),t))({BigIntArray:hr});class ni extends en{}class Py extends ni{}class zy extends ni{}class Wy extends ni{}class $y extends ni{}class ri extends en{}class Yy extends ri{}class Gy extends ri{}class Ky extends ri{}class Zy extends ri{}class Ua extends en{}class Hy extends Ua{}class Jy extends Ua{}class lf extends xs{constructor(t){super(t),this._values=new ti(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,j(n))}_flushPending(t,n){const r=this._offsets,i=this._values.reserve(n).buffer;let o=0,s=0,a=0,c;for([o,c]of t)c===void 0?r.set(o,0):(s=c.length,i.set(c,a),r.set(o,s),a+=s)}}class Ma extends xs{constructor(t){super(t),this._values=new ti(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,n){return super.setValue(t,Is(n))}_flushPending(t,n){}}Ma.prototype._flushPending=lf.prototype._flushPending;class ff{get length(){return this._values.length}get(t){return this._values[t]}clear(){return this._values=null,this}bind(t){return t instanceof z?t:(this._values=t,this)}}const gt=Symbol.for("parent"),$n=Symbol.for("rowIndex"),Ut=Symbol.for("keyToIdx"),Et=Symbol.for("idxToVal"),Ro=Symbol.for("nodejs.util.inspect.custom");class Be{constructor(t,n){this[gt]=t,this.size=n}entries(){return this[Symbol.iterator]()}has(t){return this.get(t)!==void 0}get(t){let n;if(t!=null){const r=this[Ut]||(this[Ut]=new Map);let i=r.get(t);if(i!==void 0){const o=this[Et]||(this[Et]=new Array(this.size));(n=o[i])!==void 0||(o[i]=n=this.getValue(i))}else if((i=this.getIndex(t))>-1){r.set(t,i);const o=this[Et]||(this[Et]=new Array(this.size));(n=o[i])!==void 0||(o[i]=n=this.getValue(i))}}return n}set(t,n){if(t!=null){const r=this[Ut]||(this[Ut]=new Map);let i=r.get(t);if(i===void 0&&r.set(t,i=this.getIndex(t)),i>-1){const o=this[Et]||(this[Et]=new Array(this.size));o[i]=this.setValue(i,n)}}return this}clear(){throw new Error(`Clearing ${this[Symbol.toStringTag]} not supported.`)}delete(t){throw new Error(`Deleting ${this[Symbol.toStringTag]} values not supported.`)}*[Symbol.iterator](){const t=this.keys(),n=this.values(),r=this[Ut]||(this[Ut]=new Map),i=this[Et]||(this[Et]=new Array(this.size));for(let o,s,a=0,c,u;!((c=t.next()).done||(u=n.next()).done);++a)o=c.value,s=u.value,i[a]=s,r.has(o)||r.set(o,a),yield[o,s]}forEach(t,n){const r=this.keys(),i=this.values(),o=n===void 0?t:(c,u,l)=>t.call(n,c,u,l),s=this[Ut]||(this[Ut]=new Map),a=this[Et]||(this[Et]=new Array(this.size));for(let c,u,l=0,f,p;!((f=r.next()).done||(p=i.next()).done);++l)c=f.value,u=p.value,a[l]=u,s.has(c)||s.set(c,l),o(u,c,this)}toArray(){return[...this.values()]}toJSON(){const t={};return this.forEach((n,r)=>t[r]=n),t}inspect(){return this.toString()}[Ro](){return this.toString()}toString(){const t=[];return this.forEach((n,r)=>{r=Or(r),n=Or(n),t.push(`${r}: ${n}`)}),`{ ${t.join(", ")} }`}}Be[Symbol.toStringTag]=(e=>(Object.defineProperties(e,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[gt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[$n]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),e[Symbol.toStringTag]="Row"))(Be.prototype);class hf extends Be{constructor(t){return super(t,t.length),Xy(this)}keys(){return this[gt].getChildAt(0)[Symbol.iterator]()}values(){return this[gt].getChildAt(1)[Symbol.iterator]()}getKey(t){return this[gt].getChildAt(0).get(t)}getIndex(t){return this[gt].getChildAt(0).indexOf(t)}getValue(t){return this[gt].getChildAt(1).get(t)}setValue(t,n){this[gt].getChildAt(1).set(t,n)}}class df extends Be{constructor(t){return super(t,t.type.children.length),pf(this)}*keys(){for(const t of this[gt].type.children)yield t.name}*values(){for(const t of this[gt].type.children)yield this[t.name]}getKey(t){return this[gt].type.children[t].name}getIndex(t){return this[gt].type.children.findIndex(n=>n.name===t)}getValue(t){return this[gt].getChildAt(t).get(this[$n])}setValue(t,n){return this[gt].getChildAt(t).set(this[$n],n)}}Object.setPrototypeOf(Be.prototype,Map.prototype);const pf=(()=>{const e={enumerable:!0,configurable:!1,get:null,set:null};return t=>{let n=-1,r=t[Ut]||(t[Ut]=new Map);const i=s=>function(){return this.get(s)},o=s=>function(a){return this.set(s,a)};for(const s of t.keys())r.set(s,++n),e.get=i(s),e.set=o(s),t.hasOwnProperty(s)||(e.enumerable=!0,Object.defineProperty(t,s,e)),t.hasOwnProperty(n)||(e.enumerable=!1,Object.defineProperty(t,n,e));return e.get=e.set=null,t}})(),Xy=(()=>{if(typeof Proxy>"u")return pf;const e=Be.prototype.has,t=Be.prototype.get,n=Be.prototype.set,r=Be.prototype.getKey,i={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(o){return[...o.keys()].map(s=>`${s}`)},has(o,s){switch(s){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 gt:case $n:case Et:case Ut:case Ro:return!0}return typeof s=="number"&&!o.has(s)&&(s=o.getKey(s)),o.has(s)},get(o,s,a){switch(s){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 gt:case $n:case Et:case Ut:case Ro:return Reflect.get(o,s,a)}return typeof s=="number"&&!e.call(a,s)&&(s=r.call(a,s)),t.call(a,s)},set(o,s,a,c){switch(s){case gt:case $n:case Et:case Ut:return Reflect.set(o,s,a,c);case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:return!1}return typeof s=="number"&&!e.call(c,s)&&(s=r.call(c,s)),e.call(c,s)?!!n.call(c,s,a):!1}};return o=>new Proxy(o,i)})();function qy(e,t,n){const r=e.length,i=t>-1?t:r+t%r;return n?n(e,i):i}let $c;function Na(e,t,n,r){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof n!="number"?i:n;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&($c=o,o=s,s=$c),s>i&&(s=i),r?r(e,o,s):[o,s]}const Qy=Ts?Ip(0):0,Yc=e=>e!==e;function On(e){let t=typeof e;if(t!=="object"||e===null)return Yc(e)?Yc:t!=="bigint"?n=>n===e:n=>Qy+n===e;if(e instanceof Date){const n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?Jl(e,n):!1:e instanceof Map?eb(e):Array.isArray(e)?tb(e):e instanceof z?nb(e):rb(e)}function tb(e){const t=[];for(let n=-1,r=e.length;++n<r;)t[n]=On(e[n]);return Ds(t)}function eb(e){let t=-1;const n=[];return e.forEach(r=>n[++t]=On(r)),Ds(n)}function nb(e){const t=[];for(let n=-1,r=e.length;++n<r;)t[n]=On(e.get(n));return Ds(t)}function rb(e){const t=Object.keys(e);if(t.length===0)return()=>!1;const n=[];for(let r=-1,i=t.length;++r<i;)n[r]=On(e[t[r]]);return Ds(n,t)}function Ds(e,t){return n=>{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return ib(e,n);case Map:case hf:case df:return Gc(e,n,n.keys());case Object:case void 0:return Gc(e,n,t||Object.keys(n))}return n instanceof z?sb(e,n):!1}}function ib(e,t){const n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t[r]))return!1;return!0}function sb(e,t){const n=e.length;if(t.length!==n)return!1;for(let r=-1;++r<n;)if(!e[r](t.get(r)))return!1;return!0}function Gc(e,t,n){const r=n[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let s=0,a=e.length,c=o.next(),u=r.next(),l=i.next();for(;s<a&&!u.done&&!l.done&&!c.done&&!(u.value!==l.value||!e[s](c.value));++s,u=r.next(),l=i.next(),c=o.next());return s===a&&u.done&&l.done&&c.done?!0:(r.return&&r.return(),i.return&&i.return(),o.return&&o.return(),!1)}const ob=Object.freeze(Object.defineProperty({__proto__:null,clampIndex:qy,clampRange:Na,createElementComparator:On},Symbol.toStringTag,{value:"Module"}));class vt extends z{constructor(t,n=[],r=ab(n)){super(),this._nullCount=-1,this._type=t,this._chunks=n,this._chunkOffsets=r,this._length=r[r.length-1],this._numChildren=(this._type.children||[]).length}static flatten(...t){return fb(z,t)}static concat(...t){const n=vt.flatten(...t);return new vt(n[0].type,n)}get type(){return this._type}get length(){return this._length}get chunks(){return this._chunks}get typeId(){return this._type.typeId}get VectorName(){return`Chunked<${this._type}>`}get data(){return this._chunks[0]?this._chunks[0].data:null}get ArrayType(){return this._type.ArrayType}get numChildren(){return this._numChildren}get stride(){return this._chunks[0]?this._chunks[0].stride:1}get byteLength(){return this._chunks.reduce((t,n)=>t+n.byteLength,0)}get nullCount(){let t=this._nullCount;return t<0&&(this._nullCount=t=this._chunks.reduce((n,{nullCount:r})=>n+r,0)),t}get indices(){if(U.isDictionary(this._type)){if(!this._indices){const t=this._chunks;this._indices=t.length===1?t[0].indices:vt.concat(...t.map(n=>n.indices))}return this._indices}return null}get dictionary(){return U.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}*[Symbol.iterator](){for(const t of this._chunks)yield*t}clone(t=this._chunks){return new vt(this._type,t)}concat(...t){return this.clone(vt.flatten(this,...t))}slice(t,n){return Na(this,t,n,this._sliceInternal)}getChildAt(t){if(t<0||t>=this._numChildren)return null;let n=this._children||(this._children=[]),r,i,o;return(r=n[t])?r:(i=(this._type.children||[])[t])&&(o=this._chunks.map(s=>s.getChildAt(t)).filter(s=>s!=null),o.length>0)?n[t]=new vt(i.type,o):null}search(t,n){let r=t,i=this._chunkOffsets,o=i.length-1;if(r<0||r>=i[o])return null;if(o<=1)return n?n(this,0,r):[0,r];let s=0,a=0,c=0;do{if(s+1===o)return n?n(this,s,r-a):[s,r-a];c=s+(o-s)/2|0,r>=i[c]?s=c:o=c}while(r<i[o]&&r>=(a=i[s]));return null}isValid(t){return!!this.search(t,this.isValidInternal)}get(t){return this.search(t,this.getInternal)}set(t,n){this.search(t,({chunks:r},i,o)=>r[i].set(o,n))}indexOf(t,n){return n&&typeof n=="number"?this.search(n,(r,i,o)=>this.indexOfInternal(r,i,o,t)):this.indexOfInternal(this,0,Math.max(0,n||0),t)}toArray(){const{chunks:t}=this,n=t.length;let r=this._type.ArrayType;if(n<=0)return new r(0);if(n<=1)return t[0].toArray();let i=0,o=new Array(n);for(let c=-1;++c<n;)i+=(o[c]=t[c].toArray()).length;r!==o[0].constructor&&(r=o[0].constructor);let s=new r(i),a=r===Array?ub:cb;for(let c=-1,u=0;++c<n;)u=a(o[c],s,u);return s}getInternal({_chunks:t},n,r){return t[n].get(r)}isValidInternal({_chunks:t},n,r){return t[n].isValid(r)}indexOfInternal({_chunks:t},n,r,i){let o=n-1,s=t.length,a=r,c=0,u=-1;for(;++o<s;){if(~(u=t[o].indexOf(i,a)))return c+u;a=0,c+=t[o].length}return-1}_sliceInternal(t,n,r){const i=[],{chunks:o,_chunkOffsets:s}=t;for(let a=-1,c=o.length;++a<c;){const u=o[a],l=u.length,f=s[a];if(f>=r)break;if(n>=f+l)continue;if(f>=n&&f+l<=r){i.push(u);continue}const p=Math.max(0,n-f),h=Math.min(r-f,l);i.push(u.slice(p,h))}return t.clone(i)}}function ab(e){let t=new Uint32Array((e||[]).length+1),n=t[0]=0,r=t.length;for(let i=0;++i<r;)t[i]=n+=e[i-1].length;return t}const cb=(e,t,n)=>(t.set(e,n),n+e.length),ub=(e,t,n)=>{let r=n;for(let i=-1,o=e.length;++i<o;)t[r++]=e[i];return r};class Jt extends vt{constructor(t,n=[],r){if(n=vt.flatten(...n),super(t.type,n,r),this._field=t,n.length===1&&!(this instanceof Kc))return new Kc(t,n[0],this._chunkOffsets)}static new(t,n,...r){const i=vt.flatten(Array.isArray(n)?[...n,...r]:n instanceof z?[n,...r]:[z.new(n,...r)]);if(typeof t=="string"){const o=i[0].data.type;t=new W(t,o,!0)}else!t.nullable&&i.some(({nullCount:o})=>o>0)&&(t=t.clone({nullable:!0}));return new Jt(t,i)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(t=this._chunks){return new Jt(this._field,t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let n=this._children||(this._children=[]),r,i,o;return(r=n[t])?r:(i=(this.type.children||[])[t])&&(o=this._chunks.map(s=>s.getChildAt(t)).filter(s=>s!=null),o.length>0)?n[t]=new Jt(i,o):null}}class Kc extends Jt{constructor(t,n,r){super(t,[n],r),this._chunk=n}search(t,n){return n?n(this,0,t):[0,t]}isValid(t){return this._chunk.isValid(t)}get(t){return this._chunk.get(t)}set(t,n){this._chunk.set(t,n)}indexOf(t,n){return this._chunk.indexOf(t,n)}}const hn=Array.isArray,yf=(e,t)=>Ca(e,t,[],0),lb=e=>{const[t,n]=Ra(e,[[],[]]);return n.map((r,i)=>r instanceof Jt?Jt.new(r.field.clone(t[i]),r):r instanceof z?Jt.new(t[i],r):Jt.new(t[i],[]))},bf=e=>Ra(e,[[],[]]),fb=(e,t)=>Vo(e,t,[],0),hb=(e,t)=>mf(e,t,[],0);function Ca(e,t,n,r){let i,o=r,s=-1,a=t.length;for(;++s<a;)hn(i=t[s])?o=Ca(e,i,n,o).length:i instanceof e&&(n[o++]=i);return n}function Vo(e,t,n,r){let i,o=r,s=-1,a=t.length;for(;++s<a;)hn(i=t[s])?o=Vo(e,i,n,o).length:i instanceof vt?o=Vo(e,i.chunks,n,o).length:i instanceof e&&(n[o++]=i);return n}function mf(e,t,n,r){let i,o=r,s=-1,a=t.length;for(;++s<a;)hn(i=t[s])?o=mf(e,i,n,o).length:i instanceof e?o=Ca(z,i.schema.fields.map((c,u)=>i.getChildAt(u)),n,o).length:i instanceof z&&(n[o++]=i);return n}const db=(e,[t,n],r)=>(e[0][r]=t,e[1][r]=n,e);function Ra(e,t){let n,r;switch(r=e.length){case 0:return t;case 1:if(n=t[0],!e[0])return t;if(hn(e[0]))return Ra(e[0],t);e[0]instanceof I||e[0]instanceof z||e[0]instanceof U||([n,e]=Object.entries(e[0]).reduce(db,t));break;default:hn(n=e[r-1])?e=hn(e[0])?e[0]:e.slice(0,r-1):(e=hn(e[0])?e[0]:e,n=[])}let i=-1,o=-1,s=-1,a=e.length,c,u,[l,f]=t;for(;++s<a;)u=e[s],u instanceof Jt&&(f[++o]=u)?l[++i]=u.field.clone(n[s],u.type,!0):({[s]:c=s}=n,u instanceof U&&(f[++o]=u)?l[++i]=W.new(c,u,!0):u&&u.type&&(f[++o]=u)&&(u instanceof I&&(f[o]=u=z.new(u)),l[++i]=W.new(c,u.type,!0)));return t}class J{constructor(t=[],n,r){this.fields=t||[],this.metadata=n||new Map,r||(r=jo(t)),this.dictionaries=r}static from(...t){return J.new(t[0],t[1])}static new(...t){return new J(bf(t)[0])}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}compareTo(t){return Nt.compareSchemas(this,t)}select(...t){const n=t.reduce((r,i)=>(r[i]=!0)&&r,Object.create(null));return new J(this.fields.filter(r=>n[r.name]),this.metadata)}selectAt(...t){return new J(t.map(n=>this.fields[n]).filter(Boolean),this.metadata)}assign(...t){const n=t[0]instanceof J?t[0]:new J(yf(W,t)),r=[...this.fields],i=yi(yi(new Map,this.metadata),n.metadata),o=n.fields.filter(a=>{const c=r.findIndex(u=>u.name===a.name);return~c?(r[c]=a.clone({metadata:yi(yi(new Map,r[c].metadata),a.metadata)}))&&!1:!0}),s=jo(o,new Map);return new J([...r,...o],i,new Map([...this.dictionaries,...s]))}}class W{constructor(t,n,r=!1,i){this.name=t,this.type=n,this.nullable=r,this.metadata=i||new Map}static new(...t){let[n,r,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new W(`${n}`,r,i,o)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}compareTo(t){return Nt.compareField(this,t)}clone(...t){let[n,r,i,o]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,i=this.nullable,o=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],W.new(n,r,i,o)}}function yi(e,t){return new Map([...e||new Map,...t||new Map])}function jo(e,t=new Map){for(let n=-1,r=e.length;++n<r;){const o=e[n].type;if(U.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&jo(o.children,t)}return t}J.prototype.fields=null;J.prototype.metadata=null;J.prototype.dictionaries=null;W.prototype.type=null;W.prototype.name=null;W.prototype.nullable=null;W.prototype.metadata=null;class pb extends xs{constructor(t){super(t),this._run=new ff,this._offsets=new rf}addChild(t,n="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new nr(new W(n,t.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(t){const n=this._run,r=this._offsets,i=this._setValue;let o=0,s;for([o,s]of t)s===void 0?r.set(o,0):(r.set(o,s.length),i(this,o,n.bind(s)))}}class yb extends ct{constructor(){super(...arguments),this._run=new ff}setValue(t,n){super.setValue(t,this._run.bind(n))}addChild(t,n="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");const r=this.children.push(t);return this.type=new Cr(this.type.listSize,new W(n,t.type,!0)),r}clear(){return this._run.clear(),super.clear()}}class bb extends xs{set(t,n){return super.set(t,n)}setValue(t,n){n=n instanceof Map?n:new Map(Object.entries(n));const r=this._pending||(this._pending=new Map),i=r.get(t);i&&(this._pendingLength-=i.size),this._pendingLength+=n.size,r.set(t,n)}addChild(t,n=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Rr(new W(n,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const n=this._offsets,r=this._setValue;t.forEach((i,o)=>{i===void 0?n.set(o,0):(n.set(o,i.size),r(this,o,i))})}}class mb extends ct{addChild(t,n=`${this.numChildren}`){const r=this.children.push(t);return this.type=new ne([...this.type.children,new W(n,t.type,!0)]),r}}class Va extends ct{constructor(t){super(t),this._typeIds=new ei(new Int8Array(0),1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,n){return this.set(this.length,t,n)}set(t,n,r){return r===void 0&&(r=this._valueToChildTypeId(this,n,t)),this.setValid(t,this.isValid(n))&&this.setValue(t,n,r),this}setValue(t,n,r){this._typeIds.set(t,r),super.setValue(t,n)}addChild(t,n=`${this.children.length}`){const r=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new W(n,t.type)];return this.type=new Nr(o,[...s,r],a),r}_valueToChildTypeId(t,n,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 gb extends Va{}class vb extends Va{constructor(t){super(t),this._offsets=new ei(new Int32Array(0))}setValue(t,n,r){const i=this.type.typeIdToChildIndex[r];return this._offsets.set(t,this.getChildAt(i).length),super.setValue(t,n,r)}}class D extends V{}const wb=(e,t,n)=>{e[t]=n/864e5|0},ja=(e,t,n)=>{e[t]=n%4294967296|0,e[t+1]=n/4294967296|0},_b=(e,t,n)=>{e[t]=n*1e3%4294967296|0,e[t+1]=n*1e3/4294967296|0},Sb=(e,t,n)=>{e[t]=n*1e6%4294967296|0,e[t+1]=n*1e6/4294967296|0},gf=(e,t,n,r)=>{const{[n]:i,[n+1]:o}=t;i!=null&&o!=null&&e.set(r.subarray(0,o-i),i)},Ib=({offset:e,values:t},n,r)=>{const i=e+n;r?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},vf=({values:e},t,n)=>{wb(e,t,n.valueOf())},wf=({values:e},t,n)=>{ja(e,t*2,n.valueOf())},me=({stride:e,values:t},n,r)=>{t[e*n]=r},_f=({stride:e,values:t},n,r)=>{t[e*n]=Ea(r)},Pa=(e,t,n)=>{switch(typeof n){case"bigint":e.values64[t]=n;break;case"number":e.values[t*e.stride]=n;break;default:const r=n,{stride:i,ArrayType:o}=e,s=R(o,r);e.values.set(s.subarray(0,i),i*t)}},Tb=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},Ab=({values:e,valueOffsets:t},n,r)=>gf(e,t,n,r),Bb=({values:e,valueOffsets:t},n,r)=>{gf(e,t,n,Is(r))},Ob=(e,t,n)=>{e.type.bitWidth<64?me(e,t,n):Pa(e,t,n)},Fb=(e,t,n)=>{e.type.precision!==$t.HALF?me(e,t,n):_f(e,t,n)},xb=(e,t,n)=>{e.type.unit===de.DAY?vf(e,t,n):wf(e,t,n)},Sf=({values:e},t,n)=>ja(e,t*2,n/1e3),If=({values:e},t,n)=>ja(e,t*2,n),Tf=({values:e},t,n)=>_b(e,t*2,n),Af=({values:e},t,n)=>Sb(e,t*2,n),Lb=(e,t,n)=>{switch(e.type.unit){case H.SECOND:return Sf(e,t,n);case H.MILLISECOND:return If(e,t,n);case H.MICROSECOND:return Tf(e,t,n);case H.NANOSECOND:return Af(e,t,n)}},Bf=({values:e,stride:t},n,r)=>{e[t*n]=r},Of=({values:e,stride:t},n,r)=>{e[t*n]=r},Ff=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},xf=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Db=(e,t,n)=>{switch(e.type.unit){case H.SECOND:return Bf(e,t,n);case H.MILLISECOND:return Of(e,t,n);case H.MICROSECOND:return Ff(e,t,n);case H.NANOSECOND:return xf(e,t,n)}},kb=({values:e},t,n)=>{e.set(n.subarray(0,4),4*t)},Eb=(e,t,n)=>{const r=e.getChildAt(0),i=e.valueOffsets;for(let o=-1,s=i[t],a=i[t+1];s<a;)r.set(s++,n.get(++o))},Ub=(e,t,n)=>{const r=e.getChildAt(0),i=e.valueOffsets,o=n instanceof Map?[...n]:Object.entries(n);for(let s=-1,a=i[t],c=i[t+1];a<c;)r.set(a++,o[++s])},Mb=(e,t)=>(n,r,i)=>n&&n.set(e,t[i]),Nb=(e,t)=>(n,r,i)=>n&&n.set(e,t.get(i)),Cb=(e,t)=>(n,r,i)=>n&&n.set(e,t.get(r.name)),Rb=(e,t)=>(n,r,i)=>n&&n.set(e,t[r.name]),Vb=(e,t,n)=>{const r=n instanceof Map?Cb(t,n):n instanceof z?Nb(t,n):Array.isArray(n)?Mb(t,n):Rb(t,n);e.type.children.forEach((i,o)=>r(e.getChildAt(o),i,o))},jb=(e,t,n)=>{e.type.mode===Le.Dense?Lf(e,t,n):Df(e,t,n)},Lf=(e,t,n)=>{const r=e.typeIdToChildIndex[e.typeIds[t]],i=e.getChildAt(r);i&&i.set(e.valueOffsets[t],n)},Df=(e,t,n)=>{const r=e.typeIdToChildIndex[e.typeIds[t]],i=e.getChildAt(r);i&&i.set(t,n)},Pb=(e,t,n)=>{const r=e.getKey(t);r!==null&&e.setValue(r,n)},zb=(e,t,n)=>{e.type.unit===Jn.DAY_TIME?kf(e,t,n):Ef(e,t,n)},kf=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Ef=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Wb=(e,t,n)=>{const r=e.getChildAt(0),{stride:i}=e;for(let o=-1,s=t*i;++o<i;)r.set(s+o,n.get(o))};D.prototype.visitBool=Ib;D.prototype.visitInt=Ob;D.prototype.visitInt8=me;D.prototype.visitInt16=me;D.prototype.visitInt32=me;D.prototype.visitInt64=Pa;D.prototype.visitUint8=me;D.prototype.visitUint16=me;D.prototype.visitUint32=me;D.prototype.visitUint64=Pa;D.prototype.visitFloat=Fb;D.prototype.visitFloat16=_f;D.prototype.visitFloat32=me;D.prototype.visitFloat64=me;D.prototype.visitUtf8=Bb;D.prototype.visitBinary=Ab;D.prototype.visitFixedSizeBinary=Tb;D.prototype.visitDate=xb;D.prototype.visitDateDay=vf;D.prototype.visitDateMillisecond=wf;D.prototype.visitTimestamp=Lb;D.prototype.visitTimestampSecond=Sf;D.prototype.visitTimestampMillisecond=If;D.prototype.visitTimestampMicrosecond=Tf;D.prototype.visitTimestampNanosecond=Af;D.prototype.visitTime=Db;D.prototype.visitTimeSecond=Bf;D.prototype.visitTimeMillisecond=Of;D.prototype.visitTimeMicrosecond=Ff;D.prototype.visitTimeNanosecond=xf;D.prototype.visitDecimal=kb;D.prototype.visitList=Eb;D.prototype.visitStruct=Vb;D.prototype.visitUnion=jb;D.prototype.visitDenseUnion=Lf;D.prototype.visitSparseUnion=Df;D.prototype.visitDictionary=Pb;D.prototype.visitInterval=zb;D.prototype.visitIntervalDayTime=kf;D.prototype.visitIntervalYearMonth=Ef;D.prototype.visitFixedSizeList=Wb;D.prototype.visitMap=Ub;const ks=new D;class $b extends V{visitNull(){return Sy}visitBool(){return _y}visitInt(){return Ce}visitInt8(){return Ey}visitInt16(){return Uy}visitInt32(){return My}visitInt64(){return Ny}visitUint8(){return Cy}visitUint16(){return Ry}visitUint32(){return Vy}visitUint64(){return jy}visitFloat(){return Ls}visitFloat16(){return xy}visitFloat32(){return Ly}visitFloat64(){return Dy}visitUtf8(){return Ma}visitBinary(){return lf}visitFixedSizeBinary(){return Oy}visitDate(){return ka}visitDateDay(){return Iy}visitDateMillisecond(){return Ty}visitTimestamp(){return ri}visitTimestampSecond(){return Yy}visitTimestampMillisecond(){return Gy}visitTimestampMicrosecond(){return Ky}visitTimestampNanosecond(){return Zy}visitTime(){return ni}visitTimeSecond(){return Py}visitTimeMillisecond(){return zy}visitTimeMicrosecond(){return Wy}visitTimeNanosecond(){return $y}visitDecimal(){return Ay}visitList(){return pb}visitStruct(){return mb}visitUnion(){return Va}visitDenseUnion(){return vb}visitSparseUnion(){return gb}visitDictionary(){return By}visitInterval(){return Ua}visitIntervalDayTime(){return Hy}visitIntervalYearMonth(){return Jy}visitFixedSizeList(){return yb}visitMap(){return bb}}const Uf=new $b;ct.new=Mf;function Mf(e){const t=e.type,n=new(Uf.getVisitFn(t)())(e);if(t.children&&t.children.length>0){const r=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(r)?(s,a)=>r[a]||i:({name:s})=>r[s]||i;t.children.forEach((s,a)=>{const{type:c}=s,u=o(s,a);n.children.push(Mf({...u,type:c}))})}return n}Object.keys(d).map(e=>d[e]).filter(e=>typeof e=="number"&&e!==d.NONE).forEach(e=>{const t=Uf.visit(e);t.prototype._setValue=ks.getVisitFn(e)});Ma.prototype._setValue=ks.visitBinary;var rr;(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}static getRootAsFooter(s,a){return(a||new i).__init(s.readInt32(s.position())+s.position(),s)}version(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):w.apache.arrow.flatbuf.MetadataVersion.V1}schema(s){let a=this.bb.__offset(this.bb_pos,6);return a?(s||new w.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}dictionaries(s,a){let c=this.bb.__offset(this.bb_pos,8);return c?(a||new e.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+c)+s*24,this.bb):null}dictionariesLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}recordBatches(s,a){let c=this.bb.__offset(this.bb_pos,10);return c?(a||new e.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+c)+s*24,this.bb):null}recordBatchesLength(){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.__vector_len(this.bb_pos+s):0}static startFooter(s){s.startObject(4)}static addVersion(s,a){s.addFieldInt16(0,a,w.apache.arrow.flatbuf.MetadataVersion.V1)}static addSchema(s,a){s.addFieldOffset(1,a,0)}static addDictionaries(s,a){s.addFieldOffset(2,a,0)}static startDictionariesVector(s,a){s.startVector(24,a,8)}static addRecordBatches(s,a){s.addFieldOffset(3,a,0)}static startRecordBatchesVector(s,a){s.startVector(24,a,8)}static endFooter(s){return s.endObject()}static finishFooterBuffer(s,a){s.finish(a)}static createFooter(s,a,c,u,l){return i.startFooter(s),i.addVersion(s,a),i.addSchema(s,c),i.addDictionaries(s,u),i.addRecordBatches(s,l),i.endFooter(s)}}r.Footer=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(rr||(rr={}));(function(e){(function(t){(function(n){(function(r){class i{constructor(){this.bb=null,this.bb_pos=0}__init(s,a){return this.bb_pos=s,this.bb=a,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static createBlock(s,a,c,u){return s.prep(8,24),s.writeInt64(u),s.pad(4),s.writeInt32(c),s.writeInt64(a),s.offset()}}r.Block=i})(n.flatbuf||(n.flatbuf={}))})(t.arrow||(t.arrow={}))})(e.apache||(e.apache={}))})(rr||(rr={}));var Zc=y.Long,Yb=y.Builder,Gb=y.ByteBuffer,Kb=rr.apache.arrow.flatbuf.Block,ue=rr.apache.arrow.flatbuf.Footer;class Pr{constructor(t,n=Ht.V4,r,i){this.schema=t,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}static decode(t){t=new Gb(j(t));const n=ue.getRootAsFooter(t),r=J.decode(n.schema());return new Zb(r,n)}static encode(t){const n=new Yb,r=J.encode(n,t.schema);ue.startRecordBatchesVector(n,t.numRecordBatches),[...t.recordBatches()].slice().reverse().forEach(s=>qe.encode(n,s));const i=n.endVector();ue.startDictionariesVector(n,t.numDictionaries),[...t.dictionaryBatches()].slice().reverse().forEach(s=>qe.encode(n,s));const o=n.endVector();return ue.startFooter(n),ue.addSchema(n,r),ue.addVersion(n,Ht.V4),ue.addRecordBatches(n,i),ue.addDictionaries(n,o),ue.finishFooterBuffer(n,ue.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n<r;)(t=this.getRecordBatch(n))&&(yield t)}*dictionaryBatches(){for(let t,n=-1,r=this.numDictionaries;++n<r;)(t=this.getDictionaryBatch(n))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}}class Zb extends Pr{constructor(t,n){super(t,n.version()),this._footer=n}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const n=this._footer.recordBatches(t);if(n)return qe.decode(n)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const n=this._footer.dictionaries(t);if(n)return qe.decode(n)}return null}}class qe{static decode(t){return new qe(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,n){const{metaDataLength:r}=n,i=new Zc(n.offset,0),o=new Zc(n.bodyLength,0);return Kb.createBlock(t,i,r,o)}constructor(t,n,r){this.metaDataLength=t,this.offset=typeof r=="number"?r:r.low,this.bodyLength=typeof n=="number"?n:n.low}}class Fr extends Sp{write(t){if((t=j(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Mo(this.toUint8Array(!0)):this.toUint8Array(!1).then(Mo)}toUint8Array(t=!1){return t?ee(this._values)[0]:(async()=>{let n=[],r=0;for await(const i of this)n.push(i),r+=i.byteLength;return ee(n,r)[0]})()}}class Xi{constructor(t){t&&(this.source=new Hb(Mt.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 vn{constructor(t){t instanceof vn?this.source=t.source:t instanceof Fr?this.source=new an(Mt.fromAsyncIterable(t)):Yl(t)?this.source=new an(Mt.fromNodeStream(t)):va(t)?this.source=new an(Mt.fromDOMStream(t)):$l(t)?this.source=new an(Mt.fromDOMStream(t.body)):te(t)?this.source=new an(Mt.fromIterable(t)):Je(t)?this.source=new an(Mt.fromAsyncIterable(t)):Me(t)&&(this.source=new an(Mt.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 Hb{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,n="read"){return this.source.next({cmd:n,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||at)}return(t){return Object.create(this.source.return&&this.source.return(t)||at)}}class an{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}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,n="read"){return await this.source.next({cmd:n,size:t})}async throw(t){const n=this.source.throw&&await this.source.throw(t)||at;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)}async return(t){const n=this.source.return&&await this.source.return(t)||at;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)}}class Hc extends Xi{constructor(t,n){super(),this.position=0,this.buffer=j(t),this.size=typeof n>"u"?this.buffer.byteLength:n}readInt32(t){const{buffer:n,byteOffset:r}=this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:n,size:r,position:i}=this;return n&&i<r?(typeof t!="number"&&(t=1/0),this.position=Math.min(r,i+Math.min(r-i,t)),n.subarray(i,this.position)):null}readAt(t,n){const r=this.buffer,i=Math.min(this.size,t+n);return r?r.subarray(t,i):new Uint8Array(n)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}}class qi extends vn{constructor(t,n){super(),this.position=0,this._handle=t,typeof n=="number"?this.size=n:this._pending=(async()=>{this.size=(await t.stat()).size,delete this._pending})()}async readInt32(t){const{buffer:n,byteOffset:r}=await this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}async seek(t){return this._pending&&await this._pending,this.position=Math.min(t,this.size),t<this.size}async read(t){this._pending&&await this._pending;const{_handle:n,size:r,position:i}=this;if(n&&i<r){typeof t!="number"&&(t=1/0);let o=i,s=0,a=0,c=Math.min(r,o+Math.min(r-o,t)),u=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<u.byteLength;)({bytesRead:a}=await n.read(u,s,u.byteLength-s,o));return u}return null}async readAt(t,n){this._pending&&await this._pending;const{_handle:r,size:i}=this;if(r&&t+n<i){const o=Math.min(i,t+n),s=new Uint8Array(o-t);return(await r.read(s,0,n,t)).buffer}return new Uint8Array(n)}async close(){const t=this._handle;this._handle=null,t&&await t.close()}async throw(t){return await this.close(),{done:!0,value:t}}async return(t){return await this.close(),{done:!0,value:t}}}const Jb=1<<16;function Vn(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const ir=8,za=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Wa{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const n=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=n[3]*r[3];this.buffer[0]=i&65535;let o=i>>>16;return i=n[2]*r[3],o+=i,i=n[3]*r[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?Jb:0,this.buffer[1]+=o>>>16,this.buffer[1]+=n[1]*r[3]+n[2]*r[2]+n[3]*r[1],this.buffer[1]+=n[0]*r[3]+n[1]*r[2]+n[2]*r[1]+n[3]*r[0]<<16,this}_plus(t){const n=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],n<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=n}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Vn(this.buffer[1])} ${Vn(this.buffer[0])}`}}class K extends Wa{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,n=new Uint32Array(2)){return K.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return K.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){const r=t.length;let i=new K(n);for(let o=0;o<r;){const s=ir<r-o?ir:r-o,a=new K(new Uint32Array([parseInt(t.substr(o,s),10),0])),c=new K(new Uint32Array([za[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){const n=new Uint32Array(t.length*2);for(let r=-1,i=t.length;++r<i;)K.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new K(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new K(new Uint32Array(t.buffer)).plus(n)}}class St extends Wa{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){const n=this.buffer[1]<<0,r=t.buffer[1]<<0;return n<r||n===r&&this.buffer[0]<t.buffer[0]}static from(t,n=new Uint32Array(2)){return St.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(2)){return St.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(2)){const r=t.startsWith("-"),i=t.length;let o=new St(n);for(let s=r?1:0;s<i;){const a=ir<i-s?ir:i-s,c=new St(new Uint32Array([parseInt(t.substr(s,a),10),0])),u=new St(new Uint32Array([za[a],0]));o.times(u),o.plus(c),s+=a}return r?o.negate():o}static convertArray(t){const n=new Uint32Array(t.length*2);for(let r=-1,i=t.length;++r<i;)St.from(t[r],new Uint32Array(n.buffer,n.byteOffset+2*r*4,2));return n}static multiply(t,n){return new St(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new St(new Uint32Array(t.buffer)).plus(n)}}class Zt{constructor(t){this.buffer=t}high(){return new St(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new St(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){const n=new K(new Uint32Array([this.buffer[3],0])),r=new K(new Uint32Array([this.buffer[2],0])),i=new K(new Uint32Array([this.buffer[1],0])),o=new K(new Uint32Array([this.buffer[0],0])),s=new K(new Uint32Array([t.buffer[3],0])),a=new K(new Uint32Array([t.buffer[2],0])),c=new K(new Uint32Array([t.buffer[1],0])),u=new K(new Uint32Array([t.buffer[0],0]));let l=K.multiply(o,u);this.buffer[0]=l.low();let f=new K(new Uint32Array([l.high(),0]));return l=K.multiply(i,u),f.plus(l),l=K.multiply(o,c),f.plus(l),this.buffer[1]=f.low(),this.buffer[3]=f.lessThan(l)?1:0,this.buffer[2]=f.high(),new K(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(K.multiply(r,u)).plus(K.multiply(i,c)).plus(K.multiply(o,a)),this.buffer[3]+=K.multiply(n,u).plus(K.multiply(r,c)).plus(K.multiply(i,a)).plus(K.multiply(o,s)).low(),this}plus(t){let n=new Uint32Array(4);return n[3]=this.buffer[3]+t.buffer[3]>>>0,n[2]=this.buffer[2]+t.buffer[2]>>>0,n[1]=this.buffer[1]+t.buffer[1]>>>0,n[0]=this.buffer[0]+t.buffer[0]>>>0,n[0]<this.buffer[0]>>>0&&++n[1],n[1]<this.buffer[1]>>>0&&++n[2],n[2]<this.buffer[2]>>>0&&++n[3],this.buffer[3]=n[3],this.buffer[2]=n[2],this.buffer[1]=n[1],this.buffer[0]=n[0],this}hex(){return`${Vn(this.buffer[3])} ${Vn(this.buffer[2])} ${Vn(this.buffer[1])} ${Vn(this.buffer[0])}`}static multiply(t,n){return new Zt(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new Zt(new Uint32Array(t.buffer)).plus(n)}static from(t,n=new Uint32Array(4)){return Zt.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return Zt.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){const r=t.startsWith("-"),i=t.length;let o=new Zt(n);for(let s=r?1:0;s<i;){const a=ir<i-s?ir:i-s,c=new Zt(new Uint32Array([parseInt(t.substr(s,a),10),0,0,0])),u=new Zt(new Uint32Array([za[a],0,0,0]));o.times(u),o.plus(c),s+=a}return r?o.negate():o}static convertArray(t){const n=new Uint32Array(t.length*4);for(let r=-1,i=t.length;++r<i;)Zt.from(t[r],new Uint32Array(n.buffer,n.byteOffset+4*4*r,4));return n}}const Xb=Object.freeze(Object.defineProperty({__proto__:null,BaseInt64:Wa,Uint64:K,Int64:St,Int128:Zt},Symbol.toStringTag,{value:"Module"}));class Nf extends V{constructor(t,n,r,i){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=n,this.buffers=r,this.dictionaries=i}visit(t){return super.visit(t instanceof W?t.type:t)}visitNull(t,{length:n}=this.nextFieldNode()){return I.Null(t,0,n)}visitBool(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Bool(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitInt(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Int(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitFloat(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Float(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitUtf8(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Utf8(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}visitBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Binary(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.readData(t))}visitFixedSizeBinary(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.FixedSizeBinary(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitDate(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Date(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitTimestamp(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Timestamp(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitTime(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Time(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitDecimal(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Decimal(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitList(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.List(t,0,n,r,this.readNullBitmap(t,r),this.readOffsets(t),this.visit(t.children[0]))}visitStruct(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Struct(t,0,n,r,this.readNullBitmap(t,r),this.visitMany(t.children))}visitUnion(t){return t.mode===Le.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Union(t,0,n,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.readOffsets(t),this.visitMany(t.children))}visitSparseUnion(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Union(t,0,n,r,this.readNullBitmap(t,r),this.readTypeIds(t),this.visitMany(t.children))}visitDictionary(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Dictionary(t,0,n,r,this.readNullBitmap(t,r),this.readData(t.indices),this.readDictionary(t))}visitInterval(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Interval(t,0,n,r,this.readNullBitmap(t,r),this.readData(t))}visitFixedSizeList(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.FixedSizeList(t,0,n,r,this.readNullBitmap(t,r),this.visit(t.children[0]))}visitMap(t,{length:n,nullCount:r}=this.nextFieldNode()){return I.Map(t,0,n,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,n,r=this.nextBufferRange()){return n>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,n){return this.readData(t,n)}readTypeIds(t,n){return this.readData(t,n)}readData(t,{length:n,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+n)}readDictionary(t){return this.dictionaries.get(t.id)}}class qb extends Nf{constructor(t,n,r,i){super(new Uint8Array(0),n,r,i),this.sources=t}readNullBitmap(t,n,{offset:r}=this.nextBufferRange()){return n<=0?new Uint8Array(0):Er(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return R(Uint8Array,R(Int32Array,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return R(Uint8Array,R(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){const{sources:r}=this;return U.isTimestamp(t)||(U.isInt(t)||U.isTime(t))&&t.bitWidth===64||U.isDate(t)&&t.unit===de.MILLISECOND?R(Uint8Array,St.convertArray(r[n])):U.isDecimal(t)?R(Uint8Array,Zt.convertArray(r[n])):U.isBinary(t)||U.isFixedSizeBinary(t)?Qb(r[n]):U.isBool(t)?Er(r[n]):U.isUtf8(t)?Is(r[n].join("")):R(Uint8Array,R(t.ArrayType,r[n].map(i=>+i)))}}function Qb(e){const t=e.join(""),n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r>>1]=parseInt(t.substr(r,2),16);return n}var tm=y.Long,Jc=w.apache.arrow.flatbuf.Null,bi=w.apache.arrow.flatbuf.Int,no=w.apache.arrow.flatbuf.FloatingPoint,Xc=w.apache.arrow.flatbuf.Binary,qc=w.apache.arrow.flatbuf.Bool,Qc=w.apache.arrow.flatbuf.Utf8,mi=w.apache.arrow.flatbuf.Decimal,ro=w.apache.arrow.flatbuf.Date,gi=w.apache.arrow.flatbuf.Time,vi=w.apache.arrow.flatbuf.Timestamp,io=w.apache.arrow.flatbuf.Interval,tu=w.apache.arrow.flatbuf.List,eu=w.apache.arrow.flatbuf.Struct_,kn=w.apache.arrow.flatbuf.Union,vr=w.apache.arrow.flatbuf.DictionaryEncoding,so=w.apache.arrow.flatbuf.FixedSizeBinary,oo=w.apache.arrow.flatbuf.FixedSizeList,ao=w.apache.arrow.flatbuf.Map;class em extends V{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return Jc.startNull(n),Jc.endNull(n)}visitInt(t,n){return bi.startInt(n),bi.addBitWidth(n,t.bitWidth),bi.addIsSigned(n,t.isSigned),bi.endInt(n)}visitFloat(t,n){return no.startFloatingPoint(n),no.addPrecision(n,t.precision),no.endFloatingPoint(n)}visitBinary(t,n){return Xc.startBinary(n),Xc.endBinary(n)}visitBool(t,n){return qc.startBool(n),qc.endBool(n)}visitUtf8(t,n){return Qc.startUtf8(n),Qc.endUtf8(n)}visitDecimal(t,n){return mi.startDecimal(n),mi.addScale(n,t.scale),mi.addPrecision(n,t.precision),mi.endDecimal(n)}visitDate(t,n){return ro.startDate(n),ro.addUnit(n,t.unit),ro.endDate(n)}visitTime(t,n){return gi.startTime(n),gi.addUnit(n,t.unit),gi.addBitWidth(n,t.bitWidth),gi.endTime(n)}visitTimestamp(t,n){const r=t.timezone&&n.createString(t.timezone)||void 0;return vi.startTimestamp(n),vi.addUnit(n,t.unit),r!==void 0&&vi.addTimezone(n,r),vi.endTimestamp(n)}visitInterval(t,n){return io.startInterval(n),io.addUnit(n,t.unit),io.endInterval(n)}visitList(t,n){return tu.startList(n),tu.endList(n)}visitStruct(t,n){return eu.startStruct_(n),eu.endStruct_(n)}visitUnion(t,n){kn.startTypeIdsVector(n,t.typeIds.length);const r=kn.createTypeIdsVector(n,t.typeIds);return kn.startUnion(n),kn.addMode(n,t.mode),kn.addTypeIds(n,r),kn.endUnion(n)}visitDictionary(t,n){const r=this.visit(t.indices,n);return vr.startDictionaryEncoding(n),vr.addId(n,new tm(t.id,0)),vr.addIsOrdered(n,t.isOrdered),r!==void 0&&vr.addIndexType(n,r),vr.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return so.startFixedSizeBinary(n),so.addByteWidth(n,t.byteWidth),so.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return oo.startFixedSizeList(n),oo.addListSize(n,t.listSize),oo.endFixedSizeList(n)}visitMap(t,n){return ao.startMap(n),ao.addKeysSorted(n,t.keysSorted),ao.endMap(n)}}const co=new em;function nm(e,t=new Map){return new J(im(e,t),Di(e.customMetadata),t)}function Cf(e){return new Rt(e.count,Rf(e.columns),Vf(e.columns))}function rm(e){return new pe(Cf(e.data),e.id,e.isDelta)}function im(e,t){return(e.fields||[]).filter(Boolean).map(n=>W.fromJSON(n,t))}function nu(e,t){return(e.children||[]).filter(Boolean).map(n=>W.fromJSON(n,t))}function Rf(e){return(e||[]).reduce((t,n)=>[...t,new Fn(n.count,sm(n.VALIDITY)),...Rf(n.children)],[])}function Vf(e,t=[]){for(let n=-1,r=(e||[]).length;++n<r;){const i=e[n];i.VALIDITY&&t.push(new fe(t.length,i.VALIDITY.length)),i.TYPE&&t.push(new fe(t.length,i.TYPE.length)),i.OFFSET&&t.push(new fe(t.length,i.OFFSET.length)),i.DATA&&t.push(new fe(t.length,i.DATA.length)),t=Vf(i.children,t)}return t}function sm(e){return(e||[]).reduce((t,n)=>t+ +(n===0),0)}function om(e,t){let n,r,i,o,s,a;return!t||!(o=e.dictionary)?(s=iu(e,nu(e,t)),i=new W(e.name,s,e.nullable,Di(e.customMetadata))):t.has(n=o.id)?(r=(r=o.indexType)?ru(r):new mn,a=new Xe(t.get(n),r,n,o.isOrdered),i=new W(e.name,a,e.nullable,Di(e.customMetadata))):(r=(r=o.indexType)?ru(r):new mn,t.set(n,s=iu(e,nu(e,t))),a=new Xe(s,r,n,o.isOrdered),i=new W(e.name,a,e.nullable,Di(e.customMetadata))),i||null}function Di(e){return new Map(Object.entries(e||{}))}function ru(e){return new Dt(e.isSigned,e.bitWidth)}function iu(e,t){const n=e.type.name;switch(n){case"NONE":return new Xn;case"null":return new Xn;case"binary":return new Ur;case"utf8":return new tr;case"bool":return new Mr;case"list":return new nr((t||[])[0]);case"struct":return new ne(t||[]);case"struct_":return new ne(t||[])}switch(n){case"int":{const r=e.type;return new Dt(r.isSigned,r.bitWidth)}case"floatingpoint":{const r=e.type;return new gn($t[r.precision])}case"decimal":{const r=e.type;return new Yi(r.scale,r.precision)}case"date":{const r=e.type;return new er(de[r.unit])}case"time":{const r=e.type;return new Gi(H[r.unit],r.bitWidth)}case"timestamp":{const r=e.type;return new Ki(H[r.unit],r.timezone)}case"interval":{const r=e.type;return new Zi(Jn[r.unit])}case"union":{const r=e.type;return new Nr(Le[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{const r=e.type;return new Hi(r.byteWidth)}case"fixedsizelist":{const r=e.type;return new Cr(r.listSize,(t||[])[0])}case"map":{const r=e.type;return new Rr((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var wn=y.Long,am=y.Builder,cm=y.ByteBuffer,dt=w.apache.arrow.flatbuf.Type,Kt=w.apache.arrow.flatbuf.Field,Se=w.apache.arrow.flatbuf.Schema,um=w.apache.arrow.flatbuf.Buffer,Re=wt.apache.arrow.flatbuf.Message,$e=w.apache.arrow.flatbuf.KeyValue,lm=wt.apache.arrow.flatbuf.FieldNode,su=w.apache.arrow.flatbuf.Endianness,ze=wt.apache.arrow.flatbuf.RecordBatch,Cn=wt.apache.arrow.flatbuf.DictionaryBatch;class It{constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,n){const r=new It(0,Ht.V4,n);return r._createHeader=fm(t,n),r}static decode(t){t=new cm(j(t));const n=Re.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),o=n.headerType(),s=new It(r,i,o);return s._createHeader=hm(n,o),s}static encode(t){let n=new am,r=-1;return t.isSchema()?r=J.encode(n,t.header()):t.isRecordBatch()?r=Rt.encode(n,t.header()):t.isDictionaryBatch()&&(r=pe.encode(n,t.header())),Re.startMessage(n),Re.addVersion(n,Ht.V4),Re.addHeader(n,r),Re.addHeaderType(n,t.headerType),Re.addBodyLength(n,new wn(t.bodyLength,0)),Re.finishMessageBuffer(n,Re.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof J)return new It(0,Ht.V4,et.Schema,t);if(t instanceof Rt)return new It(n,Ht.V4,et.RecordBatch,t);if(t instanceof pe)return new It(n,Ht.V4,et.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===et.Schema}isRecordBatch(){return this.headerType===et.RecordBatch}isDictionaryBatch(){return this.headerType===et.DictionaryBatch}}class Rt{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=typeof t=="number"?t:t.low}}class pe{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,n,r=!1){this._data=t,this._isDelta=r,this._id=typeof n=="number"?n:n.low}}class fe{constructor(t,n){this.offset=typeof t=="number"?t:t.low,this.length=typeof n=="number"?n:n.low}}class Fn{constructor(t,n){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof n=="number"?n:n.low}}function fm(e,t){return()=>{switch(t){case et.Schema:return J.fromJSON(e);case et.RecordBatch:return Rt.fromJSON(e);case et.DictionaryBatch:return pe.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${et[t]}, type: ${t} }`)}}function hm(e,t){return()=>{switch(t){case et.Schema:return J.decode(e.header(new Se));case et.RecordBatch:return Rt.decode(e.header(new ze),e.version());case et.DictionaryBatch:return pe.decode(e.header(new Cn),e.version())}throw new Error(`Unrecognized Message type: { name: ${et[t]}, type: ${t} }`)}}W.encode=Im;W.decode=_m;W.fromJSON=om;J.encode=Sm;J.decode=dm;J.fromJSON=nm;Rt.encode=Tm;Rt.decode=pm;Rt.fromJSON=Cf;pe.encode=Am;pe.decode=ym;pe.fromJSON=rm;Fn.encode=Bm;Fn.decode=mm;fe.encode=Om;fe.decode=bm;function dm(e,t=new Map){const n=wm(e,t);return new J(n,ki(e),t)}function pm(e,t=Ht.V4){return new Rt(e.length(),gm(e),vm(e,t))}function ym(e,t=Ht.V4){return new pe(Rt.decode(e.data(),t),e.id(),e.isDelta())}function bm(e){return new fe(e.offset(),e.length())}function mm(e){return new Fn(e.length(),e.nullCount())}function gm(e){const t=[];for(let n,r=-1,i=-1,o=e.nodesLength();++r<o;)(n=e.nodes(r))&&(t[++i]=Fn.decode(n));return t}function vm(e,t){const n=[];for(let r,i=-1,o=-1,s=e.buffersLength();++i<s;)(r=e.buffers(i))&&(t<Ht.V4&&(r.bb_pos+=8*(i+1)),n[++o]=fe.decode(r));return n}function wm(e,t){const n=[];for(let r,i=-1,o=-1,s=e.fieldsLength();++i<s;)(r=e.fields(i))&&(n[++o]=W.decode(r,t));return n}function ou(e,t){const n=[];for(let r,i=-1,o=-1,s=e.childrenLength();++i<s;)(r=e.children(i))&&(n[++o]=W.decode(r,t));return n}function _m(e,t){let n,r,i,o,s,a;return!t||!(a=e.dictionary())?(i=cu(e,ou(e,t)),r=new W(e.name(),i,e.nullable(),ki(e))):t.has(n=a.id().low)?(o=(o=a.indexType())?au(o):new mn,s=new Xe(t.get(n),o,n,a.isOrdered()),r=new W(e.name(),s,e.nullable(),ki(e))):(o=(o=a.indexType())?au(o):new mn,t.set(n,i=cu(e,ou(e,t))),s=new Xe(i,o,n,a.isOrdered()),r=new W(e.name(),s,e.nullable(),ki(e))),r||null}function ki(e){const t=new Map;if(e)for(let n,r,i=-1,o=e.customMetadataLength()|0;++i<o;)(n=e.customMetadata(i))&&(r=n.key())!=null&&t.set(r,n.value());return t}function au(e){return new Dt(e.isSigned(),e.bitWidth())}function cu(e,t){const n=e.typeType();switch(n){case dt.NONE:return new Xn;case dt.Null:return new Xn;case dt.Binary:return new Ur;case dt.Utf8:return new tr;case dt.Bool:return new Mr;case dt.List:return new nr((t||[])[0]);case dt.Struct_:return new ne(t||[])}switch(n){case dt.Int:{const r=e.type(new w.apache.arrow.flatbuf.Int);return new Dt(r.isSigned(),r.bitWidth())}case dt.FloatingPoint:{const r=e.type(new w.apache.arrow.flatbuf.FloatingPoint);return new gn(r.precision())}case dt.Decimal:{const r=e.type(new w.apache.arrow.flatbuf.Decimal);return new Yi(r.scale(),r.precision())}case dt.Date:{const r=e.type(new w.apache.arrow.flatbuf.Date);return new er(r.unit())}case dt.Time:{const r=e.type(new w.apache.arrow.flatbuf.Time);return new Gi(r.unit(),r.bitWidth())}case dt.Timestamp:{const r=e.type(new w.apache.arrow.flatbuf.Timestamp);return new Ki(r.unit(),r.timezone())}case dt.Interval:{const r=e.type(new w.apache.arrow.flatbuf.Interval);return new Zi(r.unit())}case dt.Union:{const r=e.type(new w.apache.arrow.flatbuf.Union);return new Nr(r.mode(),r.typeIdsArray()||[],t||[])}case dt.FixedSizeBinary:{const r=e.type(new w.apache.arrow.flatbuf.FixedSizeBinary);return new Hi(r.byteWidth())}case dt.FixedSizeList:{const r=e.type(new w.apache.arrow.flatbuf.FixedSizeList);return new Cr(r.listSize(),(t||[])[0])}case dt.Map:{const r=e.type(new w.apache.arrow.flatbuf.Map);return new Rr((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${dt[n]}" (${n})`)}function Sm(e,t){const n=t.fields.map(o=>W.encode(e,o));Se.startFieldsVector(e,n.length);const r=Se.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?Se.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{const a=e.createString(`${o}`),c=e.createString(`${s}`);return $e.startKeyValue(e),$e.addKey(e,a),$e.addValue(e,c),$e.endKeyValue(e)})):-1;return Se.startSchema(e),Se.addFields(e,r),Se.addEndianness(e,Fm?su.Little:su.Big),i!==-1&&Se.addCustomMetadata(e,i),Se.endSchema(e)}function Im(e,t){let n=-1,r=-1,i=-1,o=t.type,s=t.typeId;U.isDictionary(o)?(s=o.dictionary.typeId,i=co.visit(o,e),r=co.visit(o.dictionary,e)):r=co.visit(o,e);const a=(o.children||[]).map(l=>W.encode(e,l)),c=Kt.createChildrenVector(e,a),u=t.metadata&&t.metadata.size>0?Kt.createCustomMetadataVector(e,[...t.metadata].map(([l,f])=>{const p=e.createString(`${l}`),h=e.createString(`${f}`);return $e.startKeyValue(e),$e.addKey(e,p),$e.addValue(e,h),$e.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),Kt.startField(e),Kt.addType(e,r),Kt.addTypeType(e,s),Kt.addChildren(e,c),Kt.addNullable(e,!!t.nullable),n!==-1&&Kt.addName(e,n),i!==-1&&Kt.addDictionary(e,i),u!==-1&&Kt.addCustomMetadata(e,u),Kt.endField(e)}function Tm(e,t){const n=t.nodes||[],r=t.buffers||[];ze.startNodesVector(e,n.length),n.slice().reverse().forEach(s=>Fn.encode(e,s));const i=e.endVector();ze.startBuffersVector(e,r.length),r.slice().reverse().forEach(s=>fe.encode(e,s));const o=e.endVector();return ze.startRecordBatch(e),ze.addLength(e,new wn(t.length,0)),ze.addNodes(e,i),ze.addBuffers(e,o),ze.endRecordBatch(e)}function Am(e,t){const n=Rt.encode(e,t.data);return Cn.startDictionaryBatch(e),Cn.addId(e,new wn(t.id,0)),Cn.addIsDelta(e,t.isDelta),Cn.addData(e,n),Cn.endDictionaryBatch(e)}function Bm(e,t){return lm.createFieldNode(e,new wn(t.length,0),new wn(t.nullCount,0))}function Om(e,t){return um.createBuffer(e,new wn(t.offset,0),new wn(t.length,0))}const Fm=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256}();var jf=y.ByteBuffer;const $a=e=>`Expected ${et[e]} Message in stream, but was null or length 0.`,Ya=e=>`Header pointer of flatbuffer-encoded ${et[e]} Message is null or length 0.`,Pf=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,zf=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;class Wf{constructor(t){this.source=t instanceof Xi?t:new Xi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?at:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error($a(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const n=j(this.source.read(t));if(n.byteLength<t)throw new Error(zf(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}readSchema(t=!1){const n=et.Schema,r=this.readMessage(n),i=r&&r.header();if(t&&!i)throw new Error(Ya(n));return i}readMetadataLength(){const t=this.source.read(Es),n=t&&new jf(t),r=n&&n.readInt32(0)||0;return{done:r===0,value:r}}readMetadata(t){const n=this.source.read(t);if(!n)return at;if(n.byteLength<t)throw new Error(Pf(t,n.byteLength));return{done:!1,value:It.decode(n)}}}class xm{constructor(t,n){this.source=t instanceof vn?t:Wl(t)?new qi(t,n):new vn(t)}[Symbol.asyncIterator](){return this}async next(){let t;return(t=await this.readMetadataLength()).done||t.value===-1&&(t=await this.readMetadataLength()).done||(t=await this.readMetadata(t.value)).done?at:t}async throw(t){return await this.source.throw(t)}async return(t){return await this.source.return(t)}async readMessage(t){let n;if((n=await this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error($a(t));return n.value}async readMessageBody(t){if(t<=0)return new Uint8Array(0);const n=j(await this.source.read(t));if(n.byteLength<t)throw new Error(zf(t,n.byteLength));return n.byteOffset%8===0&&n.byteOffset+n.byteLength<=n.buffer.byteLength?n:n.slice()}async readSchema(t=!1){const n=et.Schema,r=await this.readMessage(n),i=r&&r.header();if(t&&!i)throw new Error(Ya(n));return i}async readMetadataLength(){const t=await this.source.read(Es),n=t&&new jf(t),r=n&&n.readInt32(0)||0;return{done:r===0,value:r}}async readMetadata(t){const n=await this.source.read(t);if(!n)return at;if(n.byteLength<t)throw new Error(Pf(t,n.byteLength));return{done:!1,value:It.decode(n)}}}class Lm extends Wf{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof zc?t:new zc(t)}next(){const{_json:t}=this;if(!this._schema){this._schema=!0;const n=It.fromJSON(t.schema,et.Schema);return{done:!1,value:n}}if(this._dictionaryIndex<t.dictionaries.length){const n=t.dictionaries[this._dictionaryIndex++];this._body=n.data.columns;const r=It.fromJSON(n,et.DictionaryBatch);return{done:!1,value:r}}if(this._batchIndex<t.batches.length){const n=t.batches[this._batchIndex++];this._body=n.columns;const r=It.fromJSON(n,et.RecordBatch);return{done:!1,value:r}}return this._body=[],at}readMessageBody(t){return n(this._body);function n(r){return(r||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE&&[o.TYPE]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...n(o.children)],[])}}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error($a(t));return n.value}readSchema(){const t=et.Schema,n=this.readMessage(t),r=n&&n.header();if(!n||!r)throw new Error(Ya(t));return r}}const Es=4,Po="ARROW1",zr=new Uint8Array(Po.length);for(let e=0;e<Po.length;e+=1)zr[e]=Po.charCodeAt(e);function Ga(e,t=0){for(let n=-1,r=zr.length;++n<r;)if(zr[n]!==e[t+n])return!1;return!0}const ii=zr.length,$f=ii+Es,Dm=ii*2+Es;class ht extends V{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){const n=new ht,r=hb(xt,t),[i=n]=n.visitMany(r);return i}visit(t){if(!U.isDictionary(t.type)){const{data:n,length:r,nullCount:i}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");U.isNull(t.type)||qt.call(this,i<=0?new Uint8Array(0):Bs(n.offset,r,n.nullBitmap)),this.nodes.push(new Fn(r,i))}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 qt(e){const t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new fe(this._byteLength,t)),this._byteLength+=t,this}function km(e){const{type:t,length:n,typeIds:r,valueOffsets:i}=e;if(qt.call(this,r),t.mode===Le.Sparse)return zo.call(this,e);if(t.mode===Le.Dense){if(e.offset<=0)return qt.call(this,i),zo.call(this,e);{const o=r.reduce((l,f)=>Math.max(l,f),r[0]),s=new Int32Array(o+1),a=new Int32Array(o+1).fill(-1),c=new Int32Array(n),u=As(-i[0],n,i);for(let l,f,p=-1;++p<n;)(f=a[l=r[p]])===-1&&(f=a[l]=u[l]),c[p]=u[p]-f,++s[l];qt.call(this,c);for(let l,f=-1,p=t.children.length;++f<p;)if(l=e.getChildAt(f)){const h=t.typeIds[f],m=Math.min(n,s[h]);this.visit(l.slice(a[h],m))}}}return this}function Em(e){let t;return e.nullCount>=e.length?qt.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?qt.call(this,Bs(e.offset,e.length,t)):qt.call(this,Er(e))}function nn(e){return qt.call(this,e.values.subarray(0,e.length*e.stride))}function Yf(e){const{length:t,values:n,valueOffsets:r}=e,i=r[0],o=r[t],s=Math.min(o-i,n.byteLength-i);return qt.call(this,As(-r[0],t,r)),qt.call(this,n.subarray(i,i+s)),this}function Ka(e){const{length:t,valueOffsets:n}=e;return n&&qt.call(this,As(n[0],t,n)),this.visit(e.getChildAt(0))}function zo(e){return this.visitMany(e.type.children.map((t,n)=>e.getChildAt(n)).filter(Boolean))[0]}ht.prototype.visitBool=Em;ht.prototype.visitInt=nn;ht.prototype.visitFloat=nn;ht.prototype.visitUtf8=Yf;ht.prototype.visitBinary=Yf;ht.prototype.visitFixedSizeBinary=nn;ht.prototype.visitDate=nn;ht.prototype.visitTimestamp=nn;ht.prototype.visitTime=nn;ht.prototype.visitDecimal=nn;ht.prototype.visitList=Ka;ht.prototype.visitStruct=zo;ht.prototype.visitUnion=km;ht.prototype.visitInterval=nn;ht.prototype.visitFixedSizeList=Ka;ht.prototype.visitMap=Ka;class Za extends An{constructor(t){super(),this._position=0,this._started=!1,this._sink=new Fr,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Ct(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Je(t)?t.then(n=>this.writeAll(n)):Me(t)?qa(this,t):Xa(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,n=null){return t===this._sink||t instanceof Fr?this._sink=t:(this._sink=new Fr,t&&Ap(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Bp(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,(!n||!n.compareTo(this._schema))&&(n===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof G&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof xt&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!n.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof xt?t instanceof Cs||this._writeRecordBatch(t):t instanceof G?this.writeAll(t.chunks):te(t)&&this.writeAll(t)}_writeMessage(t,n=8){const r=n-1,i=It.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+r&~r,c=a-o-s;return t.headerType===et.RecordBatch?this._recordBatchBlocks.push(new qe(a,t.bodyLength,this._position)):t.headerType===et.DictionaryBatch&&this._dictionaryBlocks.push(new qe(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){const n=j(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(It.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(zr)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:n,nodes:r,bufferRegions:i,buffers:o}=ht.assemble(t),s=new Rt(t.length,r,i),a=It.from(s,n);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(o)}_writeDictionaryBatch(t,n,r=!1){this._dictionaryDeltaOffsets.set(n,t.length+(this._dictionaryDeltaOffsets.get(n)||0));const{byteLength:i,nodes:o,bufferRegions:s,buffers:a}=ht.assemble(t),c=new Rt(t.length,o,s),u=new pe(c,n,r),l=It.from(u,i);return this._writeMessage(l)._writeBodyBuffers(a)}_writeBodyBuffers(t){let n,r,i;for(let o=-1,s=t.length;++o<s;)(n=t[o])&&(r=n.byteLength)>0&&(this._write(n),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[n,r]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(n)||0;if(i===0||(r=r.slice(i)).length>0){const o="chunks"in r?r.chunks:[r];for(const s of o)this._writeDictionaryBatch(s,n,i>0),i+=s.length}}return this}}class Ha extends Za{static writeAll(t,n){const r=new Ha(n);return Je(t)?t.then(i=>r.writeAll(i)):Me(t)?qa(r,t):Xa(r,t)}}class Ja extends Za{constructor(){super(),this._autoDestroy=!0}static writeAll(t){const n=new Ja;return Je(t)?t.then(r=>n.writeAll(r)):Me(t)?qa(n,t):Xa(n,t)}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const n=Pr.encode(new Pr(t,Ht.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}}function Xa(e,t){let n=t;t instanceof G&&(n=t.chunks,e.reset(void 0,t.schema));for(const r of n)e.write(r);return e.finish()}async function qa(e,t){for await(const n of t)e.write(n);return e.finish()}const uo=new Uint8Array(0),Gf=e=>[uo,uo,new Uint8Array(e),uo];function Um(e,t,n=t.reduce((r,i)=>Math.max(r,i.length),0)){let r,i,o=-1,s=t.length;const a=[...e.fields],c=[],u=(n+63&-64)>>3;for(;++o<s;)(r=t[o])&&r.length===n?c[o]=r:((i=a[o]).nullable||(a[o]=a[o].clone({nullable:!0})),c[o]=r?r._changeLengthAndBackfillNullBitmap(n):I.new(i.type,0,n,n,Gf(u)));return[new J(a),n,c]}function Mm(e){return Kf(new J(e.map(({field:t})=>t)),e)}function Kf(e,t){return Nm(e,t.map(n=>n instanceof vt?n.chunks.map(r=>r.data):[n.data]))}function Nm(e,t){const n=[...e.fields],r=[],i={numBatches:t.reduce((f,p)=>Math.max(f,p.length),0)};let o=0,s=0,a=-1,c=t.length,u,l=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)l[a]=u=t[a].shift(),s=Math.min(s,u?u.length:s);isFinite(s)&&(l=Cm(n,s,l,t,i),s>0&&(r[o++]=[s,l.slice()]))}return[e=new J(n,e.metadata),r.map(f=>new xt(e,...f))]}function Cm(e,t,n,r,i){let o,s,a=0,c=-1,u=r.length;const l=(t+63&-64)>>3;for(;++c<u;)(o=n[c])&&(a=o.length)>=t?a===t?n[c]=o:(n[c]=o.slice(0,t),o=o.slice(t,a-t),i.numBatches=Math.max(i.numBatches,r[c].unshift(o))):((s=e[c]).nullable||(e[c]=s.clone({nullable:!0})),n[c]=o?o._changeLengthAndBackfillNullBitmap(t):I.new(s.type,0,t,t,Gf(l)));return n}class rt extends z{constructor(t,n){super(),this._children=n,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`${d[this.typeId]}Vector`}get ArrayType(){return this.type.ArrayType}get values(){return this.data.values}get typeIds(){return this.data.typeIds}get nullBitmap(){return this.data.nullBitmap}get valueOffsets(){return this.data.valueOffsets}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}clone(t,n=this._children){return z.new(t,n)}concat(...t){return vt.concat(this,...t)}slice(t,n){return Na(this,t,n,this._sliceInternal)}isValid(t){if(this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}getChildAt(t){return t<0||t>=this.numChildren?null:(this._children||(this._children=[]))[t]||(this._children[t]=z.new(this.data.childData[t]))}toJSON(){return[...this]}_sliceInternal(t,n,r){return t.clone(t.data.slice(n,r-n),null)}_bindDataAccessors(t){}}rt.prototype[Symbol.isConcatSpreadable]=!0;class Rm extends rt{asUtf8(){return z.new(this.data.clone(new tr))}}class Vm extends rt{static from(t){return _n(()=>new Mr,t)}}class Qa extends rt{static from(...t){return t.length===2?_n(()=>t[1]===de.DAY?new hy:new Wc,t[0]):_n(()=>new Wc,t[0])}}class jm extends Qa{}class Pm extends Qa{}class zm extends rt{}class tc extends rt{constructor(t){super(t),this.indices=z.new(t.clone(this.type.indices))}static from(...t){if(t.length===3){const[n,r,i]=t,o=new Xe(n.type,r,null,null);return z.new(I.Dictionary(o,0,i.length,0,null,i,n))}return _n(()=>t[0].type,t[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,n){return this.indices.set(t,n)}setValue(t,n){return this.dictionary.set(t,n)}}tc.prototype.indices=null;class Wm extends rt{}class $m extends rt{}class Us extends rt{static from(t){let n=Km(this);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let r=Gm(t.constructor)||n;if(n===null&&(n=r),n&&n===r){let i=new n,o=t.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!Ym(n,t.constructor))return z.new(I.Float(i,0,o,0,null,t))}}if(n)return _n(()=>new n,t);throw t instanceof DataView||t instanceof ArrayBuffer?new TypeError(`Cannot infer float type from instance of ${t.constructor.name}`):new TypeError("Unrecognized FloatVector input")}}class Zf extends Us{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}}class Hf extends Us{}class Jf extends Us{}const Ym=(e,t)=>e===Fs&&t!==Uint16Array,Gm=e=>{switch(e){case Uint16Array:return Fs;case Float32Array:return La;case Float64Array:return Da;default:return null}},Km=e=>{switch(e){case Zf:return Fs;case Hf:return La;case Jf:return Da;default:return null}};class ec extends rt{}class Zm extends ec{}class Hm extends ec{}class ae extends rt{static from(...t){let[n,r=!1]=t,i=qm(this,r);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)){let o=Xm(n.constructor,r)||i;if(i===null&&(i=o),i&&i===o){let s=new i,a=n.byteLength/s.ArrayType.BYTES_PER_ELEMENT;return Jm(i,n.constructor)&&(a*=.5),z.new(I.Int(s,0,a,0,null,n))}}if(i)return _n(()=>new i,n);throw n instanceof DataView||n instanceof ArrayBuffer?new TypeError(`Cannot infer integer type from instance of ${n.constructor.name}`):new TypeError("Unrecognized IntVector input")}}class Xf extends ae{}class qf extends ae{}class Qf extends ae{}class th extends ae{toBigInt64Array(){return Gl(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}}class eh extends ae{}class nh extends ae{}class rh extends ae{}class ih extends ae{toBigUint64Array(){return Kl(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}}const Jm=(e,t)=>(e===qn||e===Qn)&&(t===Int32Array||t===Uint32Array),Xm=(e,t)=>{switch(e){case Int8Array:return Aa;case Int16Array:return Ba;case Int32Array:return t?qn:mn;case hr:return qn;case Uint8Array:return Oa;case Uint16Array:return Fa;case Uint32Array:return t?Qn:xa;case Hr:return Qn;default:return null}},qm=(e,t)=>{switch(e){case Xf:return Aa;case qf:return Ba;case Qf:return t?qn:mn;case th:return qn;case eh:return Oa;case nh:return Fa;case rh:return t?Qn:xa;case ih:return Qn;default:return null}};class Qm extends rt{}class tg extends rt{asList(){const t=this.type.children[0];return z.new(this.data.clone(new nr(t)))}bind(t){const n=this.getChildAt(0),{[t]:r,[t+1]:i}=this.valueOffsets;return new hf(n.slice(r,i))}}class eg extends rt{}const ng=Symbol.for("rowIndex");class Ms extends rt{bind(t){const n=this._row||(this._row=new df(this)),r=Object.create(n);return r[ng]=t,r}}class si extends rt{}class rg extends si{}class ig extends si{}class sg extends si{}class og extends si{}class oi extends rt{}class ag extends oi{}class cg extends oi{}class ug extends oi{}class lg extends oi{}class nc extends rt{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}}class fg extends nc{get valueOffsets(){return this.data.valueOffsets}}class hg extends nc{}class dg extends rt{static from(t){return _n(()=>new tr,t)}asBinary(){return z.new(this.data.clone(new Ur))}}function uu(e){return function(){return e(this)}}function pg(e){return function(t){return e(this,t)}}function lu(e){return function(t,n){return e(this,t,n)}}class O extends V{}const yg=(e,t)=>864e5*e[t],rc=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),bg=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,mg=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,sh=e=>new Date(e),gg=(e,t)=>sh(yg(e,t)),vg=(e,t)=>sh(rc(e,t)),wg=(e,t)=>null,oh=(e,t,n)=>{const{[n]:r,[n+1]:i}=t;return r!=null&&i!=null?e.subarray(r,i):null},_g=({offset:e,values:t},n)=>{const r=e+n;return(t[r>>3]&1<<r%8)!==0},ah=({values:e},t)=>gg(e,t),ch=({values:e},t)=>vg(e,t*2),ge=({stride:e,values:t},n)=>t[e*n],uh=({stride:e,values:t},n)=>af(t[e*n]),ic=({stride:e,values:t,type:n},r)=>Bn.new(t.subarray(e*r,e*(r+1)),n.isSigned),Sg=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),Ig=({values:e,valueOffsets:t},n)=>oh(e,t,n),Tg=({values:e,valueOffsets:t},n)=>{const r=oh(e,t,n);return r!==null?Mo(r):null},Ag=(e,t)=>e.type.bitWidth<64?ge(e,t):ic(e,t),Bg=(e,t)=>e.type.precision!==$t.HALF?ge(e,t):uh(e,t),Og=(e,t)=>e.type.unit===de.DAY?ah(e,t):ch(e,t),lh=({values:e},t)=>1e3*rc(e,t*2),fh=({values:e},t)=>rc(e,t*2),hh=({values:e},t)=>bg(e,t*2),dh=({values:e},t)=>mg(e,t*2),Fg=(e,t)=>{switch(e.type.unit){case H.SECOND:return lh(e,t);case H.MILLISECOND:return fh(e,t);case H.MICROSECOND:return hh(e,t);case H.NANOSECOND:return dh(e,t)}},ph=({values:e,stride:t},n)=>e[t*n],yh=({values:e,stride:t},n)=>e[t*n],bh=({values:e},t)=>Bn.signed(e.subarray(2*t,2*(t+1))),mh=({values:e},t)=>Bn.signed(e.subarray(2*t,2*(t+1))),xg=(e,t)=>{switch(e.type.unit){case H.SECOND:return ph(e,t);case H.MILLISECOND:return yh(e,t);case H.MICROSECOND:return bh(e,t);case H.NANOSECOND:return mh(e,t)}},Lg=({values:e},t)=>Bn.decimal(e.subarray(4*t,4*(t+1))),Dg=(e,t)=>{const n=e.getChildAt(0),{valueOffsets:r,stride:i}=e;return n.slice(r[t*i],r[t*i+1])},kg=(e,t)=>e.bind(t),Eg=(e,t)=>e.bind(t),Ug=(e,t)=>e.type.mode===Le.Dense?gh(e,t):vh(e,t),gh=(e,t)=>{const n=e.typeIdToChildIndex[e.typeIds[t]],r=e.getChildAt(n);return r?r.get(e.valueOffsets[t]):null},vh=(e,t)=>{const n=e.typeIdToChildIndex[e.typeIds[t]],r=e.getChildAt(n);return r?r.get(t):null},Mg=(e,t)=>e.getValue(e.getKey(t)),Ng=(e,t)=>e.type.unit===Jn.DAY_TIME?wh(e,t):_h(e,t),wh=({values:e},t)=>e.subarray(2*t,2*(t+1)),_h=({values:e},t)=>{const n=e[t],r=new Int32Array(2);return r[0]=n/12|0,r[1]=n%12|0,r},Cg=(e,t)=>{const n=e.getChildAt(0),{stride:r}=e;return n.slice(t*r,(t+1)*r)};O.prototype.visitNull=wg;O.prototype.visitBool=_g;O.prototype.visitInt=Ag;O.prototype.visitInt8=ge;O.prototype.visitInt16=ge;O.prototype.visitInt32=ge;O.prototype.visitInt64=ic;O.prototype.visitUint8=ge;O.prototype.visitUint16=ge;O.prototype.visitUint32=ge;O.prototype.visitUint64=ic;O.prototype.visitFloat=Bg;O.prototype.visitFloat16=uh;O.prototype.visitFloat32=ge;O.prototype.visitFloat64=ge;O.prototype.visitUtf8=Tg;O.prototype.visitBinary=Ig;O.prototype.visitFixedSizeBinary=Sg;O.prototype.visitDate=Og;O.prototype.visitDateDay=ah;O.prototype.visitDateMillisecond=ch;O.prototype.visitTimestamp=Fg;O.prototype.visitTimestampSecond=lh;O.prototype.visitTimestampMillisecond=fh;O.prototype.visitTimestampMicrosecond=hh;O.prototype.visitTimestampNanosecond=dh;O.prototype.visitTime=xg;O.prototype.visitTimeSecond=ph;O.prototype.visitTimeMillisecond=yh;O.prototype.visitTimeMicrosecond=bh;O.prototype.visitTimeNanosecond=mh;O.prototype.visitDecimal=Lg;O.prototype.visitList=Dg;O.prototype.visitStruct=Eg;O.prototype.visitUnion=Ug;O.prototype.visitDenseUnion=gh;O.prototype.visitSparseUnion=vh;O.prototype.visitDictionary=Mg;O.prototype.visitInterval=Ng;O.prototype.visitIntervalDayTime=wh;O.prototype.visitIntervalYearMonth=_h;O.prototype.visitFixedSizeList=Cg;O.prototype.visitMap=kg;const Ns=new O;class F extends V{}function Rg(e,t){return t===null&&e.length>0?0:-1}function Vg(e,t){const{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(const i of Jr(n,e.data.offset+(t||0),e.length,n,_a)){if(!i)return r;++r}return-1}function C(e,t,n){if(t===void 0)return-1;if(t===null)return Vg(e,n);const r=On(t);for(let i=(n||0)-1,o=e.length;++i<o;)if(r(e.get(i)))return i;return-1}function Sh(e,t,n){const r=On(t);for(let i=(n||0)-1,o=e.length;++i<o;)if(r(e.get(i)))return i;return-1}F.prototype.visitNull=Rg;F.prototype.visitBool=C;F.prototype.visitInt=C;F.prototype.visitInt8=C;F.prototype.visitInt16=C;F.prototype.visitInt32=C;F.prototype.visitInt64=C;F.prototype.visitUint8=C;F.prototype.visitUint16=C;F.prototype.visitUint32=C;F.prototype.visitUint64=C;F.prototype.visitFloat=C;F.prototype.visitFloat16=C;F.prototype.visitFloat32=C;F.prototype.visitFloat64=C;F.prototype.visitUtf8=C;F.prototype.visitBinary=C;F.prototype.visitFixedSizeBinary=C;F.prototype.visitDate=C;F.prototype.visitDateDay=C;F.prototype.visitDateMillisecond=C;F.prototype.visitTimestamp=C;F.prototype.visitTimestampSecond=C;F.prototype.visitTimestampMillisecond=C;F.prototype.visitTimestampMicrosecond=C;F.prototype.visitTimestampNanosecond=C;F.prototype.visitTime=C;F.prototype.visitTimeSecond=C;F.prototype.visitTimeMillisecond=C;F.prototype.visitTimeMicrosecond=C;F.prototype.visitTimeNanosecond=C;F.prototype.visitDecimal=C;F.prototype.visitList=C;F.prototype.visitStruct=C;F.prototype.visitUnion=C;F.prototype.visitDenseUnion=Sh;F.prototype.visitSparseUnion=Sh;F.prototype.visitDictionary=C;F.prototype.visitInterval=C;F.prototype.visitIntervalDayTime=C;F.prototype.visitIntervalYearMonth=C;F.prototype.visitFixedSizeList=C;F.prototype.visitMap=C;const Ih=new F;class x extends V{}function jg(e){const t=Ns.getVisitFn(e);return Jr(e.nullBitmap,e.offset,e.length,e,(n,r,i,o)=>(i&1<<o)!==0?t(n,r):null)}function k(e){if(e.nullCount>0)return jg(e);const{type:t,typeId:n,length:r}=e;return e.stride===1&&(n===d.Timestamp||n===d.Int&&t.bitWidth!==64||n===d.Time&&t.bitWidth!==64||n===d.Float&&t.precision>0)?e.values.subarray(0,r)[Symbol.iterator]():function*(i){for(let o=-1;++o<r;)yield i(e,o)}(Ns.getVisitFn(e))}x.prototype.visitNull=k;x.prototype.visitBool=k;x.prototype.visitInt=k;x.prototype.visitInt8=k;x.prototype.visitInt16=k;x.prototype.visitInt32=k;x.prototype.visitInt64=k;x.prototype.visitUint8=k;x.prototype.visitUint16=k;x.prototype.visitUint32=k;x.prototype.visitUint64=k;x.prototype.visitFloat=k;x.prototype.visitFloat16=k;x.prototype.visitFloat32=k;x.prototype.visitFloat64=k;x.prototype.visitUtf8=k;x.prototype.visitBinary=k;x.prototype.visitFixedSizeBinary=k;x.prototype.visitDate=k;x.prototype.visitDateDay=k;x.prototype.visitDateMillisecond=k;x.prototype.visitTimestamp=k;x.prototype.visitTimestampSecond=k;x.prototype.visitTimestampMillisecond=k;x.prototype.visitTimestampMicrosecond=k;x.prototype.visitTimestampNanosecond=k;x.prototype.visitTime=k;x.prototype.visitTimeSecond=k;x.prototype.visitTimeMillisecond=k;x.prototype.visitTimeMicrosecond=k;x.prototype.visitTimeNanosecond=k;x.prototype.visitDecimal=k;x.prototype.visitList=k;x.prototype.visitStruct=k;x.prototype.visitUnion=k;x.prototype.visitDenseUnion=k;x.prototype.visitSparseUnion=k;x.prototype.visitDictionary=k;x.prototype.visitInterval=k;x.prototype.visitIntervalDayTime=k;x.prototype.visitIntervalYearMonth=k;x.prototype.visitFixedSizeList=k;x.prototype.visitMap=k;const sc=new x;class L extends V{}function E(e){const{type:t,length:n,stride:r}=e;switch(t.typeId){case d.Int:case d.Float:case d.Decimal:case d.Time:case d.Timestamp:return e.values.subarray(0,n*r)}return[...sc.visit(e)]}L.prototype.visitNull=E;L.prototype.visitBool=E;L.prototype.visitInt=E;L.prototype.visitInt8=E;L.prototype.visitInt16=E;L.prototype.visitInt32=E;L.prototype.visitInt64=E;L.prototype.visitUint8=E;L.prototype.visitUint16=E;L.prototype.visitUint32=E;L.prototype.visitUint64=E;L.prototype.visitFloat=E;L.prototype.visitFloat16=E;L.prototype.visitFloat32=E;L.prototype.visitFloat64=E;L.prototype.visitUtf8=E;L.prototype.visitBinary=E;L.prototype.visitFixedSizeBinary=E;L.prototype.visitDate=E;L.prototype.visitDateDay=E;L.prototype.visitDateMillisecond=E;L.prototype.visitTimestamp=E;L.prototype.visitTimestampSecond=E;L.prototype.visitTimestampMillisecond=E;L.prototype.visitTimestampMicrosecond=E;L.prototype.visitTimestampNanosecond=E;L.prototype.visitTime=E;L.prototype.visitTimeSecond=E;L.prototype.visitTimeMillisecond=E;L.prototype.visitTimeMicrosecond=E;L.prototype.visitTimeNanosecond=E;L.prototype.visitDecimal=E;L.prototype.visitList=E;L.prototype.visitStruct=E;L.prototype.visitUnion=E;L.prototype.visitDenseUnion=E;L.prototype.visitSparseUnion=E;L.prototype.visitDictionary=E;L.prototype.visitInterval=E;L.prototype.visitIntervalDayTime=E;L.prototype.visitIntervalYearMonth=E;L.prototype.visitFixedSizeList=E;L.prototype.visitMap=E;const Th=new L,wr=(e,t)=>e+t,lo=e=>`Cannot compute the byte width of variable-width column ${e}`;class Pg extends V{visitNull(t){return 0}visitInt(t){return t.bitWidth/8}visitFloat(t){return t.ArrayType.BYTES_PER_ELEMENT}visitBinary(t){throw new Error(lo(t))}visitUtf8(t){throw new Error(lo(t))}visitBool(t){return 1/8}visitDecimal(t){return 16}visitDate(t){return(t.unit+1)*4}visitTime(t){return t.bitWidth/8}visitTimestamp(t){return t.unit===H.SECOND?4:8}visitInterval(t){return(t.unit+1)*4}visitList(t){throw new Error(lo(t))}visitStruct(t){return this.visitFields(t.children).reduce(wr,0)}visitUnion(t){return this.visitFields(t.children).reduce(wr,0)}visitFixedSizeBinary(t){return t.byteWidth}visitFixedSizeList(t){return t.listSize*this.visitFields(t.children).reduce(wr,0)}visitMap(t){return this.visitFields(t.children).reduce(wr,0)}visitDictionary(t){return this.visit(t.indices)}visitFields(t){return(t||[]).map(n=>this.visit(n.type))}visitSchema(t){return this.visitFields(t.fields).reduce(wr,0)}}const Ah=new Pg;class zg extends V{visitNull(){return eg}visitBool(){return Vm}visitInt(){return ae}visitInt8(){return Xf}visitInt16(){return qf}visitInt32(){return Qf}visitInt64(){return th}visitUint8(){return eh}visitUint16(){return nh}visitUint32(){return rh}visitUint64(){return ih}visitFloat(){return Us}visitFloat16(){return Zf}visitFloat32(){return Hf}visitFloat64(){return Jf}visitUtf8(){return dg}visitBinary(){return Rm}visitFixedSizeBinary(){return Wm}visitDate(){return Qa}visitDateDay(){return jm}visitDateMillisecond(){return Pm}visitTimestamp(){return si}visitTimestampSecond(){return rg}visitTimestampMillisecond(){return ig}visitTimestampMicrosecond(){return sg}visitTimestampNanosecond(){return og}visitTime(){return oi}visitTimeSecond(){return ag}visitTimeMillisecond(){return cg}visitTimeMicrosecond(){return ug}visitTimeNanosecond(){return lg}visitDecimal(){return zm}visitList(){return Qm}visitStruct(){return Ms}visitUnion(){return nc}visitDenseUnion(){return fg}visitSparseUnion(){return hg}visitDictionary(){return tc}visitInterval(){return ec}visitIntervalDayTime(){return Zm}visitIntervalYearMonth(){return Hm}visitFixedSizeList(){return $m}visitMap(){return tg}}const Bh=new zg;z.new=Wg;z.from=$g;function Wg(e,...t){return new(Bh.getVisitFn(e)())(e,...t)}function _n(e,t){if(te(t))return z.from({nullValues:[null,void 0],type:e(),values:t});if(Me(t))return z.from({nullValues:[null,void 0],type:e(),values:t});const{values:n=[],type:r=e(),nullValues:i=[null,void 0]}={...t};return te(n)?z.from({nullValues:i,...t,type:r}):z.from({nullValues:i,...t,type:r})}function $g(e){const{values:t=[],...n}={nullValues:[null,void 0],...e};if(te(t)){const r=[...ct.throughIterable(n)(t)];return r.length===1?r[0]:vt.concat(r)}return(async r=>{const i=ct.throughAsyncIterable(n);for await(const o of i(t))r.push(o);return r.length===1?r[0]:vt.concat(r)})([])}rt.prototype.get=function(t){return Ns.visit(this,t)};rt.prototype.set=function(t,n){return ks.visit(this,t,n)};rt.prototype.indexOf=function(t,n){return Ih.visit(this,t,n)};rt.prototype.toArray=function(){return Th.visit(this)};rt.prototype.getByteWidth=function(){return Ah.visit(this.type)};rt.prototype[Symbol.iterator]=function(){return sc.visit(this)};rt.prototype._bindDataAccessors=Zg;Object.keys(d).map(e=>d[e]).filter(e=>typeof e=="number").filter(e=>e!==d.NONE).forEach(e=>{const t=Bh.visit(e);t.prototype.get=pg(Ns.getVisitFn(e)),t.prototype.set=lu(ks.getVisitFn(e)),t.prototype.indexOf=lu(Ih.getVisitFn(e)),t.prototype.toArray=uu(Th.getVisitFn(e)),t.prototype.getByteWidth=Yg(Ah.getVisitFn(e)),t.prototype[Symbol.iterator]=uu(sc.getVisitFn(e))});function Yg(e){return function(){return e(this.type)}}function Gg(e){return function(t){return this.isValid(t)?e.call(this,t):null}}function Kg(e){return function(t,n){Ql(this.nullBitmap,this.offset+t,n!=null)&&e.call(this,t,n)}}function Zg(){const e=this.nullBitmap;e&&e.byteLength>0&&(this.get=Gg(this.get),this.set=Kg(this.set))}class G extends vt{constructor(...t){let n=null;t[0]instanceof J&&(n=t.shift());let r=yf(xt,t);if(!n&&!(n=r[0]&&r[0].schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");r[0]||(r[0]=new Cs(n)),super(new ne(n.fields),r),this._schema=n,this._chunks=r}static empty(t=new J([])){return new G(t,[])}static from(t){if(!t)return G.empty();if(typeof t=="object"){let r=te(t.values)?Hg(t):Me(t.values)?Jg(t):null;if(r!==null)return r}let n=Qt.from(t);return Je(n)?(async()=>await G.from(await n))():n.isSync()&&(n=n.open())?n.schema?new G(n.schema,[...n]):G.empty():(async r=>{const i=await r,o=i.schema,s=[];if(o){for await(let a of i)s.push(a);return new G(o,s)}return G.empty()})(n.open())}static async fromAsync(t){return await G.from(t)}static fromStruct(t){return G.new(t.data.childData,t.type.children)}static new(...t){return new G(...Mm(lb(t)))}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(t=this._chunks){return new G(this._schema,t)}getColumn(t){return this.getColumnAt(this.getColumnIndex(t))}getColumnAt(t){return this.getChildAt(t)}getColumnIndex(t){return this._schema.fields.findIndex(n=>n.name===t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let n,r;const i=this._schema.fields,o=this._children||(this._children=[]);if(r=o[t])return r;if(n=i[t]){const s=this._chunks.map(a=>a.getChildAt(t)).filter(a=>a!=null);if(s.length>0)return o[t]=new Jt(n,s)}return null}serialize(t="binary",n=!0){return(n?Ha:Ja).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...t){const n=this._schema.fields.reduce((r,i,o)=>r.set(i.name,o),new Map);return this.selectAt(...t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(...t){const n=this._schema.selectAt(...t);return new G(n,this._chunks.map(({length:r,data:{childData:i}})=>new xt(n,r,t.map(o=>i[o]).filter(Boolean))))}assign(t){const n=this._schema.fields,[r,i]=t.schema.fields.reduce((a,c,u)=>{const[l,f]=a,p=n.findIndex(h=>h.name===c.name);return~p?f[p]=u:l.push(u),a},[[],[]]),o=this._schema.assign(t.schema),s=[...n.map((a,c,u,l=i[c])=>l===void 0?this.getColumnAt(c):t.getColumnAt(l)),...r.map(a=>t.getColumnAt(a))].filter(Boolean);return new G(...Kf(o,s))}}function Hg(e){const{type:t}=e;return t instanceof ne?G.fromStruct(Ms.from(e)):null}function Jg(e){const{type:t}=e;return t instanceof ne?Ms.from(e).then(n=>G.fromStruct(n)):null}class xt extends Ms{constructor(...t){let n,r=t[0],i;if(t[1]instanceof I)[,n,i]=t;else{const o=r.fields,[,s,a]=t;n=I.Struct(new ne(o),0,s,0,null,a)}super(n,i),this._schema=r}static from(t){return te(t.values),G.from(t)}static new(...t){const[n,r]=bf(t),i=r.filter(o=>o instanceof z);return new xt(...Um(new J(n),i.map(o=>o.data)))}clone(t,n=this._children){return new xt(this._schema,t,n)}concat(...t){const n=this._schema,r=vt.flatten(this,...t);return new G(n,r.map(({data:i})=>new xt(n,i)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=oc.collect(this))}select(...t){const n=this._schema.fields.reduce((r,i,o)=>r.set(i.name,o),new Map);return this.selectAt(...t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(...t){const n=this._schema.selectAt(...t),r=t.map(i=>this.data.childData[i]).filter(Boolean);return new xt(n,this.length,r)}}class Cs extends xt{constructor(t){super(t,0,t.fields.map(n=>I.new(n.type,0,0,0)))}}class oc extends V{constructor(){super(...arguments),this.dictionaries=new Map}static collect(t){return new oc().visit(t.data,new ne(t.schema.fields)).dictionaries}visit(t,n){return U.isDictionary(n)?this.visitDictionary(t,n):(t.childData.forEach((r,i)=>this.visit(r,n.children[i].type)),this)}visitDictionary(t,n){const r=t.dictionary;return r&&r.length>0&&this.dictionaries.set(n.id,r),this}}class Qt extends An{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 n=this._impl.open(t);return Je(n)?n.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 Mt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Mt.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,n){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Qt?t:No(t)?t0(t):Wl(t)?r0(t):Je(t)?(async()=>await Qt.from(await t))():$l(t)||va(t)||Yl(t)||Me(t)?n0(new vn(t)):e0(new Xi(t))}static readAll(t){return t instanceof Qt?t.isSync()?fu(t):hu(t):No(t)||ArrayBuffer.isView(t)||te(t)||zl(t)?fu(t):hu(t)}}class Qi extends Qt{constructor(t){super(t),this._impl=t}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}}class ts extends Qt{constructor(t){super(t),this._impl=t}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Oh extends Qi{constructor(t){super(t),this._impl=t}}class Xg extends ts{constructor(t){super(t),this._impl=t}}class Fh{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,n){return new xt(this.schema,t.length,this._loadVectors(t,n,this.schema.fields))}_loadDictionaryBatch(t,n){const{id:r,isDelta:i,data:o}=t,{dictionaries:s,schema:a}=this,c=s.get(r);if(i||!c){const u=a.dictionaries.get(r);return c&&i?c.concat(z.new(this._loadVectors(o,n,[u])[0])):z.new(this._loadVectors(o,n,[u])[0])}return c}_loadVectors(t,n,r){return new Nf(n,t.nodes,t.buffers,this.dictionaries).visitMany(r)}}class es extends Fh{constructor(t,n){super(n),this._reader=No(t)?new Lm(this._handle=t):new Wf(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=Lh(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):at}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):at}next(){if(this.closed)return at;let t,{_reader:n}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),i=n.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,i);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),i=n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Cs(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class ns extends Fh{constructor(t,n){super(n),this._reader=new xm(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=Lh(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):at}async return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(t):at}async next(){if(this.closed)return at;let t,{_reader:n}=this;for(;t=await this._readNextMessageAndValidate();)if(t.isSchema())await this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),i=await n.readMessageBody(t.bodyLength),o=this._loadRecordBatch(r,i);return{done:!1,value:o}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),i=await n.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Cs(this.schema)}):await this.return()}async _readNextMessageAndValidate(t){return await this._reader.readMessage(t)}}class xh extends es{constructor(t,n){super(t instanceof Hc?t:new Hc(t),n)}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 n of this._footer.dictionaryBatches())n&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){if(this.closed)return null;this._footer||this.open();const n=this._footer&&this._footer.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const r=this._reader.readMessage(et.RecordBatch);if(r&&r.isRecordBatch()){const i=r.header(),o=this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(i,o)}}return null}_readDictionaryBatch(t){const n=this._footer&&this._footer.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const r=this._reader.readMessage(et.DictionaryBatch);if(r&&r.isDictionaryBatch()){const i=r.header(),o=this._reader.readMessageBody(r.bodyLength),s=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,s)}}}_readFooter(){const{_handle:t}=this,n=t.size-$f,r=t.readInt32(n),i=t.readAt(n-r,r);return Pr.decode(i)}_readNextMessageAndValidate(t){if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const n=this._footer&&this._footer.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}}class qg extends ns{constructor(t,...n){const r=typeof n[0]!="number"?n.shift():void 0,i=n[0]instanceof Map?n.shift():void 0;super(t instanceof qi?t:new qi(t,r),i)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}async open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=await this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&await this._readDictionaryBatch(this._dictionaryIndex++)}return await super.open(t)}async readRecordBatch(t){if(this.closed)return null;this._footer||await this.open();const n=this._footer&&this._footer.getRecordBatch(t);if(n&&await this._handle.seek(n.offset)){const r=await this._reader.readMessage(et.RecordBatch);if(r&&r.isRecordBatch()){const i=r.header(),o=await this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(i,o)}}return null}async _readDictionaryBatch(t){const n=this._footer&&this._footer.getDictionaryBatch(t);if(n&&await this._handle.seek(n.offset)){const r=await this._reader.readMessage(et.DictionaryBatch);if(r&&r.isDictionaryBatch()){const i=r.header(),o=await this._reader.readMessageBody(r.bodyLength),s=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,s)}}}async _readFooter(){const{_handle:t}=this;t._pending&&await t._pending;const n=t.size-$f,r=await t.readInt32(n),i=await t.readAt(n-r,r);return Pr.decode(i)}async _readNextMessageAndValidate(t){if(this._footer||await this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const n=this._footer.getRecordBatch(this._recordBatchIndex);if(n&&await this._handle.seek(n.offset))return await this._reader.readMessage(t)}return null}}class Qg extends es{constructor(t,n){super(t,n)}_loadVectors(t,n,r){return new qb(n,t.nodes,t.buffers,this.dictionaries).visitMany(r)}}function Lh(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*fu(e){const t=Qt.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}async function*hu(e){const t=await Qt.from(e);try{if(!(await t.open({autoDestroy:!1})).closed)do yield t;while(!(await t.reset().open()).closed)}finally{await t.cancel()}}function t0(e){return new Qi(new Qg(e))}function e0(e){const t=e.peek(ii+7&-8);return t&&t.byteLength>=4?Ga(t)?new Oh(new xh(e.read())):new Qi(new es(e)):new Qi(new es(function*(){}()))}async function n0(e){const t=await e.peek(ii+7&-8);return t&&t.byteLength>=4?Ga(t)?new Oh(new xh(await e.read())):new ts(new ns(e)):new ts(new ns(async function*(){}()))}async function r0(e){const{size:t}=await e.stat(),n=new qi(e,t);return t>=Dm&&Ga(await n.readAt(0,ii+7&-8))?new Xg(new qg(n)):new ts(new ns(n))}function i0(e,t){if(Me(e))return o0(e,t);if(te(e))return s0(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function s0(e,t){let n=null;const r=t&&t.type==="bytes"||!1,i=t&&t.highWaterMark||2**24;return new ReadableStream({...t,start(s){o(s,n||(n=e[Symbol.iterator]()))},pull(s){n?o(s,n):s.close()},cancel(){(n&&n.return&&n.return()||!0)&&(n=null)}},{highWaterMark:r?i:void 0,...t});function o(s,a){let c,u=null,l=s.desiredSize||null;for(;!(u=a.next(r?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=j(u.value))&&(l!=null&&r&&(l=l-c.byteLength+1),u.value=c),s.enqueue(u.value),l!=null&&--l<=0)return;s.close()}}function o0(e,t){let n=null;const r=t&&t.type==="bytes"||!1,i=t&&t.highWaterMark||2**24;return new ReadableStream({...t,async start(s){await o(s,n||(n=e[Symbol.asyncIterator]()))},async pull(s){n?await o(s,n):s.close()},async cancel(){(n&&n.return&&await n.return()||!0)&&(n=null)}},{highWaterMark:r?i:void 0,...t});async function o(s,a){let c,u=null,l=s.desiredSize||null;for(;!(u=await a.next(r?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=j(u.value))&&(l!=null&&r&&(l=l-c.byteLength+1),u.value=c),s.enqueue(u.value),l!=null&&--l<=0)return;s.close()}}function a0(e){return new c0(e)}class c0{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;const{["readableStrategy"]:n,["writableStrategy"]:r,["queueingStrategy"]:i="count",...o}=t;this._controller=null,this._builder=ct.new(o),this._getSize=i!=="bytes"?du:pu;const{["highWaterMark"]:s=i==="bytes"?2**14:1e3}={...n},{["highWaterMark"]:a=i==="bytes"?2**14:1e3}={...r};this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:s,size:i!=="bytes"?du:pu}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){const n=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-n}_maybeFlush(t,n){n!==null&&(this._bufferedSize>=n.desiredSize&&++this._numChunks&&this._enqueue(n,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(n,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(n,null)))}_enqueue(t,n){this._bufferedSize=0,this._controller=null,n===null?t.close():t.enqueue(n)}}const du=e=>e.length,pu=e=>e.byteLength;function u0(e,t){const n=new Fr;let r=null;const i=new ReadableStream({async cancel(){await n.close()},async start(a){await s(a,r||(r=await o()))},async pull(a){r?await s(a,r):a.close()}});return{writable:new WritableStream(n,{highWaterMark:2**14,...e}),readable:i};async function o(){return await(await Qt.from(n)).open(t)}async function s(a,c){let u=a.desiredSize,l=null;for(;!(l=await c.next()).done;)if(a.enqueue(l.value),u!=null&&--u<=0)return;a.close()}}function l0(e,t){const n=new this(e),r=new vn(n),i=new ReadableStream({type:"bytes",async cancel(){await r.cancel()},async pull(s){await o(s)},async start(s){await o(s)}},{highWaterMark:2**14,...t});return{writable:new WritableStream(n,e),readable:i};async function o(s){let a=null,c=s.desiredSize;for(;a=await r.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()}}class Yn{eq(t){return t instanceof Yn||(t=new Gn(t)),new f0(this,t)}le(t){return t instanceof Yn||(t=new Gn(t)),new h0(this,t)}ge(t){return t instanceof Yn||(t=new Gn(t)),new d0(this,t)}lt(t){return new Ei(this.ge(t))}gt(t){return new Ei(this.le(t))}ne(t){return new Ei(this.eq(t))}}class Gn extends Yn{constructor(t){super(),this.v=t}}class Dh extends Yn{constructor(t){super(),this.name=t}bind(t){if(!this.colidx){this.colidx=-1;const r=t.schema.fields;for(let i=-1;++i<r.length;)if(r[i].name===this.name){this.colidx=i;break}if(this.colidx<0)throw new Error(`Failed to bind Col "${this.name}"`)}const n=this.vector=t.getChildAt(this.colidx);return r=>n.get(r)}}class ac{and(...t){return new lc(this,...t)}or(...t){return new fc(this,...t)}not(){return new Ei(this)}}class cc extends ac{constructor(t,n){super(),this.left=t,this.right=n}bind(t){return this.left instanceof Gn?this.right instanceof Gn?this._bindLitLit(t,this.left,this.right):this._bindLitCol(t,this.left,this.right):this.right instanceof Gn?this._bindColLit(t,this.left,this.right):this._bindColCol(t,this.left,this.right)}}class uc extends ac{constructor(...t){super(),this.children=t}}uc.prototype.children=Object.freeze([]);class lc extends uc{constructor(...t){t=t.reduce((n,r)=>n.concat(r instanceof lc?r.children:r),[]),super(...t)}bind(t){const n=this.children.map(r=>r.bind(t));return(r,i)=>n.every(o=>o(r,i))}}class fc extends uc{constructor(...t){t=t.reduce((n,r)=>n.concat(r instanceof fc?r.children:r),[]),super(...t)}bind(t){const n=this.children.map(r=>r.bind(t));return(r,i)=>n.some(o=>o(r,i))}}class f0 extends cc{_bindLitLit(t,n,r){const i=n.v==r.v;return()=>i}_bindColCol(t,n,r){const i=n.bind(t),o=r.bind(t);return(s,a)=>i(s,a)==o(s,a)}_bindColLit(t,n,r){const i=n.bind(t);if(n.vector instanceof tc){let o;const s=n.vector;return s.dictionary!==this.lastDictionary?(o=s.reverseLookup(r.v),this.lastDictionary=s.dictionary,this.lastKey=o):o=this.lastKey,o===-1?()=>!1:a=>s.getKey(a)===o}else return(o,s)=>i(o,s)==r.v}_bindLitCol(t,n,r){return this._bindColLit(t,r,n)}}class h0 extends cc{_bindLitLit(t,n,r){const i=n.v<=r.v;return()=>i}_bindColCol(t,n,r){const i=n.bind(t),o=r.bind(t);return(s,a)=>i(s,a)<=o(s,a)}_bindColLit(t,n,r){const i=n.bind(t);return(o,s)=>i(o,s)<=r.v}_bindLitCol(t,n,r){const i=r.bind(t);return(o,s)=>n.v<=i(o,s)}}class d0 extends cc{_bindLitLit(t,n,r){const i=n.v>=r.v;return()=>i}_bindColCol(t,n,r){const i=n.bind(t),o=r.bind(t);return(s,a)=>i(s,a)>=o(s,a)}_bindColLit(t,n,r){const i=n.bind(t);return(o,s)=>i(o,s)>=r.v}_bindLitCol(t,n,r){const i=r.bind(t);return(o,s)=>n.v>=i(o,s)}}class Ei extends ac{constructor(t){super(),this.child=t}bind(t){const n=this.child.bind(t);return(r,i)=>!n(r,i)}}G.prototype.countBy=function(e){return new ai(this.chunks).countBy(e)};G.prototype.scan=function(e,t){return new ai(this.chunks).scan(e,t)};G.prototype.scanReverse=function(e,t){return new ai(this.chunks).scanReverse(e,t)};G.prototype.filter=function(e){return new ai(this.chunks).filter(e)};class ai extends G{filter(t){return new hc(this.chunks,t)}scan(t,n){const r=this.chunks,i=r.length;for(let o=-1;++o<i;){const s=r[o];n&&n(s);for(let a=-1,c=s.length;++a<c;)t(a,s)}}scanReverse(t,n){const r=this.chunks,i=r.length;for(let o=i;--o>=0;){const s=r[o];n&&n(s);for(let a=s.length;--a>=0;)t(a,s)}}countBy(t){const n=this.chunks,r=n.length,i=typeof t=="string"?new Dh(t):t;i.bind(n[r-1]);const o=i.vector;if(!U.isDictionary(o.type))throw new Error("countBy currently only supports dictionary-encoded columns");const s=Math.ceil(Math.log(o.length)/Math.log(256)),a=s==4?Uint32Array:s>=2?Uint16Array:Uint8Array,c=new a(o.dictionary.length);for(let u=-1;++u<r;){const l=n[u];i.bind(l);const f=i.vector.indices;for(let p=-1,h=l.length;++p<h;){let m=f.get(p);m!==null&&c[m]++}}return new kh(o.dictionary,ae.from(c))}}class kh extends G{constructor(t,n){const r=new J([new W("values",t.type),new W("counts",n.type)]);super(new xt(r,n.length,[t,n]))}toJSON(){const t=this.getColumnAt(0),n=this.getColumnAt(1),r={};for(let i=-1;++i<this.length;)r[t.get(i)]=n.get(i);return r}}class hc extends ai{constructor(t,n){super(t),this._predicate=n}scan(t,n){const r=this._chunks,i=r.length;for(let o=-1;++o<i;){const s=r[o],a=this._predicate.bind(s);let c=!1;for(let u=-1,l=s.length;++u<l;)a(u,s)&&(n&&!c&&(n(s),c=!0),t(u,s))}}scanReverse(t,n){const r=this._chunks,i=r.length;for(let o=i;--o>=0;){const s=r[o],a=this._predicate.bind(s);let c=!1;for(let u=s.length;--u>=0;)a(u,s)&&(n&&!c&&(n(s),c=!0),t(u,s))}}count(){let t=0;const n=this._chunks,r=n.length;for(let i=-1;++i<r;){const o=n[i],s=this._predicate.bind(o);for(let a=-1,c=o.length;++a<c;)s(a,o)&&++t}return t}*[Symbol.iterator](){const t=this._chunks,n=t.length;for(let r=-1;++r<n;){const i=t[r],o=this._predicate.bind(i);for(let s=-1,a=i.length;++s<a;)o(s,i)&&(yield i.get(s))}}filter(t){return new hc(this._chunks,this._predicate.and(t))}countBy(t){const n=this._chunks,r=n.length,i=typeof t=="string"?new Dh(t):t;i.bind(n[r-1]);const o=i.vector;if(!U.isDictionary(o.type))throw new Error("countBy currently only supports dictionary-encoded columns");const s=Math.ceil(Math.log(o.length)/Math.log(256)),a=s==4?Uint32Array:s>=2?Uint16Array:Uint8Array,c=new a(o.dictionary.length);for(let u=-1;++u<r;){const l=n[u],f=this._predicate.bind(l);i.bind(l);const p=i.vector.indices;for(let h=-1,m=l.length;++h<m;){let _=p.get(h);_!==null&&f(h,l)&&c[_]++}}return new kh(o.dictionary,ae.from(c))}}({...ky,...Xb,...iy,...Fy,...qp,...ob});Mt.toDOMStream=i0;ct.throughDOM=a0;Qt.throughDOM=u0;Za.throughDOM=l0;/**
 * @license
 * Copyright 2018-2021 Streamlit Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var yu=function(){function e(t,n,r,i){var o=this;this.getCell=function(s,a){var c=s<o.headerRows&&a<o.headerColumns,u=s>=o.headerRows&&a<o.headerColumns,l=s<o.headerRows&&a>=o.headerColumns;if(c){var f=["blank"];return a>0&&f.push("level"+s),{type:"blank",classNames:f.join(" "),content:""}}else if(l){var p=a-o.headerColumns,f=["col_heading","level"+s,"col"+p];return{type:"columns",classNames:f.join(" "),content:o.getContent(o.columnsTable,p,s)}}else if(u){var h=s-o.headerRows,f=["row_heading","level"+a,"row"+h];return{type:"index",id:"T_"+o.uuid+"level"+a+"_row"+h,classNames:f.join(" "),content:o.getContent(o.indexTable,h,a)}}else{var h=s-o.headerRows,p=a-o.headerColumns,f=["data","row"+h,"col"+p],m=o.styler?o.getContent(o.styler.displayValuesTable,h,p):o.getContent(o.dataTable,h,p);return{type:"data",id:"T_"+o.uuid+"row"+h+"_col"+p,classNames:f.join(" "),content:m}}},this.getContent=function(s,a,c){var u=s.getColumnAt(c);if(u===null)return"";var l=o.getColumnTypeId(s,c);switch(l){case d.Timestamp:return o.nanosToDate(u.get(a));default:return u.get(a)}},this.dataTable=G.from(t),this.indexTable=G.from(n),this.columnsTable=G.from(r),this.styler=i?{caption:i.caption,displayValuesTable:G.from(i.displayValues),styles:i.styles,uuid:i.uuid}:void 0}return Object.defineProperty(e.prototype,"rows",{get:function(){return this.indexTable.length+this.columnsTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataRows",{get:function(){return this.dataTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"table",{get:function(){return this.dataTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.indexTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!0,configurable:!0}),e.prototype.serialize=function(){return{data:this.dataTable.serialize(),index:this.indexTable.serialize(),columns:this.columnsTable.serialize()}},e.prototype.getColumnTypeId=function(t,n){return t.schema.fields[n].type.typeId},e.prototype.nanosToDate=function(t){return new Date(t/1e6)},e}();/**
 * @license
 * Copyright 2018-2021 Streamlit Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var xr=globalThis&&globalThis.__assign||function(){return xr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},xr.apply(this,arguments)},Lr;(function(e){e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight"})(Lr||(Lr={}));var re=function(){function e(){}return e.API_VERSION=1,e.RENDER_EVENT="streamlit:render",e.events=new He,e.registeredMessageListener=!1,e.setComponentReady=function(){e.registeredMessageListener||(window.addEventListener("message",e.onMessageEvent),e.registeredMessageListener=!0),e.sendBackMsg(Lr.COMPONENT_READY,{apiVersion:e.API_VERSION})},e.setFrameHeight=function(t){t===void 0&&(t=document.body.scrollHeight),t!==e.lastFrameHeight&&(e.lastFrameHeight=t,e.sendBackMsg(Lr.SET_FRAME_HEIGHT,{height:t}))},e.setComponentValue=function(t){var n;t instanceof yu?(n="dataframe",t=t.serialize()):y0(t)?(n="bytes",t=new Uint8Array(t.buffer)):t instanceof ArrayBuffer?(n="bytes",t=new Uint8Array(t)):n="json",e.sendBackMsg(Lr.SET_COMPONENT_VALUE,{value:t,dataType:n})},e.onMessageEvent=function(t){var n=t.data.type;switch(n){case e.RENDER_EVENT:e.onRenderMessage(t.data);break}},e.onRenderMessage=function(t){var n=t.args;n==null&&(console.error("Got null args in onRenderMessage. This should never happen"),n={});var r=t.dfs&&t.dfs.length>0?e.argsDataframeToObject(t.dfs):{};n=xr(xr({},n),r);var i=Boolean(t.disabled),o=t.theme;o&&p0(o);var s={disabled:i,args:n,theme:o},a=new CustomEvent(e.RENDER_EVENT,{detail:s});e.events.dispatchEvent(a)},e.argsDataframeToObject=function(t){var n=t.map(function(r){var i=r.key,o=r.value;return[i,e.toArrowTable(o)]});return Object.fromEntries(n)},e.toArrowTable=function(t){var n=t.data,r=n.data,i=n.index,o=n.columns,s=n.styler;return new yu(r,i,o,s)},e.sendBackMsg=function(t,n){window.parent.postMessage(xr({isStreamlitMessage:!0,type:t},n),"*")},e}(),p0=function(e){var t=document.createElement("style");document.head.appendChild(t),t.innerHTML=`
    :root {
      --primary-color: `+e.primaryColor+`;
      --background-color: `+e.backgroundColor+`;
      --secondary-background-color: `+e.secondaryBackgroundColor+`;
      --text-color: `+e.textColor+`;
      --font: `+e.font+`;
    }

    body {
      background-color: var(--background-color);
      color: var(--text-color);
    }
  `};function y0(e){var t=!1;try{t=e instanceof BigInt64Array||e instanceof BigUint64Array}catch{}return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||t}/**
 * @license
 * Copyright 2018-2021 Streamlit Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var b0=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){b0(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){re.setFrameHeight()},t.prototype.componentDidUpdate=function(){re.setFrameHeight()},t})(up.PureComponent);var Wo=function(e,t){return Wo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Wo(e,t)};function xn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Wo(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var M=function(){return M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},M.apply(this,arguments)};function Bt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function $(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(u){try{c(r.next(u))}catch(l){o(l)}}function a(u){try{c(r.throw(u))}catch(l){o(l)}}function c(u){var l;u.done?i(u.value):(l=u.value,l instanceof n?l:new n(function(f){f(l)})).then(s,a)}c((r=r.apply(e,t||[])).next())})}function Y(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,r=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||l[0]!==6&&l[0]!==2)){s=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){s.label=l[1];break}if(l[0]===6&&s.label<i[1]){s.label=i[1],i=l;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(l);break}i[2]&&s.ops.pop(),s.trys.pop();continue}l=t.call(e,s)}catch(f){l=[6,f],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([c,u])}}}function sr(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function $o(e,t,n){if(n||arguments.length===2)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var he=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function dr(e,t){return e(t={exports:{}},t.exports),t.exports}var Ve,Ui,wi=function(e){return e&&e.Math==Math&&e},N=wi(typeof globalThis=="object"&&globalThis)||wi(typeof window=="object"&&window)||wi(typeof self=="object"&&self)||wi(typeof he=="object"&&he)||function(){return this}()||Function("return this")(),st=function(e){try{return!!e()}catch{return!0}},X=!st(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),ci=!st(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),_i=Function.prototype.call,Tt=ci?_i.bind(_i):function(){return _i.apply(_i,arguments)},bu={}.propertyIsEnumerable,mu=Object.getOwnPropertyDescriptor,m0=mu&&!bu.call({1:2},1)?function(e){var t=mu(this,e);return!!t&&t.enumerable}:bu,pc={f:m0},Sn=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Eh=Function,Uh=Eh.prototype,g0=Uh.bind,Yo=Uh.call,v0=ci&&g0.bind(Yo,Yo),P=function(e){return e instanceof Eh?ci?v0(e):function(){return Yo.apply(e,arguments)}:void 0},w0=P({}.toString),_0=P("".slice),Fe=function(e){return _0(w0(e),8,-1)},fo=Object,S0=P("".split),Mh=st(function(){return!fo("z").propertyIsEnumerable(0)})?function(e){return Fe(e)=="String"?S0(e,""):fo(e)}:fo,pr=function(e){return e==null},I0=TypeError,ui=function(e){if(pr(e))throw I0("Can't call method on "+e);return e},ve=function(e){return Mh(ui(e))},ho=typeof document=="object"&&document.all,Rs={all:ho,IS_HTMLDDA:ho===void 0&&ho!==void 0},T0=Rs.all,nt=Rs.IS_HTMLDDA?function(e){return typeof e=="function"||e===T0}:function(e){return typeof e=="function"},A0=Rs.all,ot=Rs.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:nt(e)||e===A0}:function(e){return typeof e=="object"?e!==null:nt(e)},B0=function(e){return nt(e)?e:void 0},ce=function(e,t){return arguments.length<2?B0(N[e]):N[e]&&N[e][t]},In=P({}.isPrototypeOf),po=ce("navigator","userAgent")||"",gu=N.process,vu=N.Deno,wu=gu&&gu.versions||vu&&vu.version,_u=wu&&wu.v8;_u&&(Ui=(Ve=_u.split("."))[0]>0&&Ve[0]<4?1:+(Ve[0]+Ve[1])),!Ui&&po&&(!(Ve=po.match(/Edge\/(\d+)/))||Ve[1]>=74)&&(Ve=po.match(/Chrome\/(\d+)/))&&(Ui=+Ve[1]);var rs=Ui,Pt=!!Object.getOwnPropertySymbols&&!st(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&rs&&rs<41}),yc=Pt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",O0=Object,or=yc?function(e){return typeof e=="symbol"}:function(e){var t=ce("Symbol");return nt(t)&&In(t.prototype,O0(e))},F0=String,yr=function(e){try{return F0(e)}catch{return"Object"}},x0=TypeError,bc=function(e){if(nt(e))return e;throw x0(yr(e)+" is not a function")},is=function(e,t){var n=e[t];return pr(n)?void 0:bc(n)},L0=TypeError,D0=Object.defineProperty,mc=function(e,t){try{D0(N,e,{value:t,configurable:!0,writable:!0})}catch{N[e]=t}return t},Ke=N["__core-js_shared__"]||mc("__core-js_shared__",{}),rn=dr(function(e){(e.exports=function(t,n){return Ke[t]||(Ke[t]=n!==void 0?n:{})})("versions",[]).push({version:"3.25.4",mode:"global",copyright:"\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.4/LICENSE",source:"https://github.com/zloirock/core-js"})}),k0=Object,br=function(e){return k0(ui(e))},E0=P({}.hasOwnProperty),A=Object.hasOwn||function(e,t){return E0(br(e),t)},U0=0,M0=Math.random(),N0=P(1 .toString),ar=function(e){return"Symbol("+(e===void 0?"":e)+")_"+N0(++U0+M0,36)},_r=rn("wks"),pn=N.Symbol,Su=pn&&pn.for,C0=yc?pn:pn&&pn.withoutSetter||ar,lt=function(e){if(!A(_r,e)||!Pt&&typeof _r[e]!="string"){var t="Symbol."+e;Pt&&A(pn,e)?_r[e]=pn[e]:_r[e]=yc&&Su?Su(t):C0(t)}return _r[e]},R0=TypeError,V0=lt("toPrimitive"),j0=function(e,t){if(!ot(e)||or(e))return e;var n,r=is(e,V0);if(r){if(t===void 0&&(t="default"),n=Tt(r,e,t),!ot(n)||or(n))return n;throw R0("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var s,a;if(o==="string"&&nt(s=i.toString)&&!ot(a=Tt(s,i))||nt(s=i.valueOf)&&!ot(a=Tt(s,i))||o!=="string"&&nt(s=i.toString)&&!ot(a=Tt(s,i)))return a;throw L0("Can't convert object to primitive value")}(e,t)},Tn=function(e){var t=j0(e,"string");return or(t)?t:t+""},Go=N.document,P0=ot(Go)&&ot(Go.createElement),Nh=function(e){return P0?Go.createElement(e):{}},Ch=!X&&!st(function(){return Object.defineProperty(Nh("div"),"a",{get:function(){return 7}}).a!=7}),Iu=Object.getOwnPropertyDescriptor,li={f:X?Iu:function(e,t){if(e=ve(e),t=Tn(t),Ch)try{return Iu(e,t)}catch{}if(A(e,t))return Sn(!Tt(pc.f,e,t),e[t])}},Rh=X&&st(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),z0=String,W0=TypeError,yt=function(e){if(ot(e))return e;throw W0(z0(e)+" is not an object")},$0=TypeError,yo=Object.defineProperty,Y0=Object.getOwnPropertyDescriptor,_t={f:X?Rh?function(e,t,n){if(yt(e),t=Tn(t),yt(n),typeof e=="function"&&t==="prototype"&&"value"in n&&"writable"in n&&!n.writable){var r=Y0(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return yo(e,t,n)}:yo:function(e,t,n){if(yt(e),t=Tn(t),yt(n),Ch)try{return yo(e,t,n)}catch{}if("get"in n||"set"in n)throw $0("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},Vs=X?function(e,t,n){return _t.f(e,t,Sn(1,n))}:function(e,t,n){return e[t]=n,e},Vh=Function.prototype,G0=X&&Object.getOwnPropertyDescriptor,bo=A(Vh,"name"),gc={EXISTS:bo,PROPER:bo&&function(){}.name==="something",CONFIGURABLE:bo&&(!X||X&&G0(Vh,"name").configurable)},K0=P(Function.toString);nt(Ke.inspectSource)||(Ke.inspectSource=function(e){return K0(e)});var ss,Dr,os,jh=Ke.inspectSource,Tu=N.WeakMap,Z0=nt(Tu)&&/native code/.test(String(Tu)),Au=rn("keys"),js=function(e){return Au[e]||(Au[e]=ar(e))},mr={},Ko=N.TypeError,H0=N.WeakMap;if(Z0||Ke.state){var cn=Ke.state||(Ke.state=new H0),J0=P(cn.get),Bu=P(cn.has),X0=P(cn.set);ss=function(e,t){if(Bu(cn,e))throw Ko("Object already initialized");return t.facade=e,X0(cn,e,t),t},Dr=function(e){return J0(cn,e)||{}},os=function(e){return Bu(cn,e)}}else{var En=js("state");mr[En]=!0,ss=function(e,t){if(A(e,En))throw Ko("Object already initialized");return t.facade=e,Vs(e,En,t),t},Dr=function(e){return A(e,En)?e[En]:{}},os=function(e){return A(e,En)}}var Gt={set:ss,get:Dr,has:os,enforce:function(e){return os(e)?Dr(e):ss(e,{})},getterFor:function(e){return function(t){var n;if(!ot(t)||(n=Dr(t)).type!==e)throw Ko("Incompatible receiver, "+e+" required");return n}}},q0=dr(function(e){var t=gc.CONFIGURABLE,n=Gt.enforce,r=Gt.get,i=Object.defineProperty,o=X&&!st(function(){return i(function(){},"length",{value:8}).length!==8}),s=String(String).split("String"),a=e.exports=function(c,u,l){String(u).slice(0,7)==="Symbol("&&(u="["+String(u).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),l&&l.getter&&(u="get "+u),l&&l.setter&&(u="set "+u),(!A(c,"name")||t&&c.name!==u)&&(X?i(c,"name",{value:u,configurable:!0}):c.name=u),o&&l&&A(l,"arity")&&c.length!==l.arity&&i(c,"length",{value:l.arity});try{l&&A(l,"constructor")&&l.constructor?X&&i(c,"prototype",{writable:!1}):c.prototype&&(c.prototype=void 0)}catch{}var f=n(c);return A(f,"source")||(f.source=s.join(typeof u=="string"?u:"")),c};Function.prototype.toString=a(function(){return nt(this)&&r(this).source||jh(this)},"toString")}),At=function(e,t,n,r){r||(r={});var i=r.enumerable,o=r.name!==void 0?r.name:t;if(nt(n)&&q0(n,o,r),r.global)i?e[t]=n:mc(t,n);else{try{r.unsafe?e[t]&&(i=!0):delete e[t]}catch{}i?e[t]=n:_t.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},Q0=Math.ceil,tv=Math.floor,ev=Math.trunc||function(e){var t=+e;return(t>0?tv:Q0)(t)},vc=function(e){var t=+e;return t!=t||t===0?0:ev(t)},nv=Math.max,rv=Math.min,Zo=function(e,t){var n=vc(e);return n<0?nv(n+t,0):rv(n,t)},iv=Math.min,Ph=function(e){return e>0?iv(vc(e),9007199254740991):0},gr=function(e){return Ph(e.length)},Ou=function(e){return function(t,n,r){var i,o=ve(t),s=gr(o),a=Zo(r,s);if(e&&n!=n){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===n)return e||a||0;return!e&&-1}},zh={includes:Ou(!0),indexOf:Ou(!1)},sv=zh.indexOf,Fu=P([].push),Wh=function(e,t){var n,r=ve(e),i=0,o=[];for(n in r)!A(mr,n)&&A(r,n)&&Fu(o,n);for(;t.length>i;)A(r,n=t[i++])&&(~sv(o,n)||Fu(o,n));return o},as=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ov=as.concat("length","prototype"),Wr={f:Object.getOwnPropertyNames||function(e){return Wh(e,ov)}},Ps={f:Object.getOwnPropertySymbols},av=P([].concat),cv=ce("Reflect","ownKeys")||function(e){var t=Wr.f(yt(e)),n=Ps.f;return n?av(t,n(e)):t},$h=function(e,t,n){for(var r=cv(t),i=_t.f,o=li.f,s=0;s<r.length;s++){var a=r[s];A(e,a)||n&&A(n,a)||i(e,a,o(t,a))}},uv=/#|\.prototype\./,fi=function(e,t){var n=fv[lv(e)];return n==dv||n!=hv&&(nt(t)?st(t):!!t)},lv=fi.normalize=function(e){return String(e).replace(uv,".").toLowerCase()},fv=fi.data={},hv=fi.NATIVE="N",dv=fi.POLYFILL="P",Ho=fi,pv=li.f,bt=function(e,t){var n,r,i,o,s,a=e.target,c=e.global,u=e.stat;if(n=c?N:u?N[a]||mc(a,{}):(N[a]||{}).prototype)for(r in t){if(o=t[r],i=e.dontCallGetSet?(s=pv(n,r))&&s.value:n[r],!Ho(c?r:a+(u?".":"#")+r,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;$h(o,i)}(e.sham||i&&i.sham)&&Vs(o,"sham",!0),At(n,r,o,e)}},Yh={};Yh[lt("toStringTag")]="z";var mo,wc=String(Yh)==="[object z]",yv=lt("toStringTag"),bv=Object,mv=Fe(function(){return arguments}())=="Arguments",Ln=wc?Fe:function(e){var t,n,r;return e===void 0?"Undefined":e===null?"Null":typeof(n=function(i,o){try{return i[o]}catch{}}(t=bv(e),yv))=="string"?n:mv?Fe(t):(r=Fe(t))=="Object"&&nt(t.callee)?"Arguments":r},gv=String,De=function(e){if(Ln(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return gv(e)},vv=lt("match"),wv=TypeError,Gh=function(e){if(function(t){var n;return ot(t)&&((n=t[vv])!==void 0?!!n:Fe(t)=="RegExp")}(e))throw wv("The method doesn't accept regular expressions");return e},_v=lt("match"),Kh=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[_v]=!1,"/./"[e](t)}catch{}}return!1},Sv=li.f,xu=P("".startsWith),Iv=P("".slice),Tv=Math.min,Zh=Kh("startsWith"),Av=!(Zh||(mo=Sv(String.prototype,"startsWith"),!mo||mo.writable));bt({target:"String",proto:!0,forced:!Av&&!Zh},{startsWith:function(e){var t=De(ui(this));Gh(e);var n=Ph(Tv(arguments.length>1?arguments[1]:void 0,t.length)),r=De(e);return xu?xu(t,r,n):Iv(t,n,n+r.length)===r}});var _c=function(e,t){return P(N[e].prototype[t])};_c("String","startsWith");var cs=Array.isArray||function(e){return Fe(e)=="Array"},Bv=TypeError,Lu=function(e){if(e>9007199254740991)throw Bv("Maximum allowed index exceeded");return e},$r=function(e,t,n){var r=Tn(t);r in e?_t.f(e,r,Sn(0,n)):e[r]=n},Hh=function(){},Ov=[],Jh=ce("Reflect","construct"),Sc=/^\s*(?:class|function)\b/,Fv=P(Sc.exec),xv=!Sc.exec(Hh),Sr=function(e){if(!nt(e))return!1;try{return Jh(Hh,Ov,e),!0}catch{return!1}},Xh=function(e){if(!nt(e))return!1;switch(Ln(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return xv||!!Fv(Sc,jh(e))}catch{return!0}};Xh.sham=!0;var Du,Ic=!Jh||st(function(){var e;return Sr(Sr.call)||!Sr(Object)||!Sr(function(){e=!0})||e})?Xh:Sr,Lv=lt("species"),ku=Array,qh=function(e,t){return new(function(n){var r;return cs(n)&&(r=n.constructor,(Ic(r)&&(r===ku||cs(r.prototype))||ot(r)&&(r=r[Lv])===null)&&(r=void 0)),r===void 0?ku:r}(e))(t===0?0:t)},Dv=lt("species"),Qh=lt("isConcatSpreadable"),kv=rs>=51||!st(function(){var e=[];return e[Qh]=!1,e.concat()[0]!==e}),Ev=(Du="concat",rs>=51||!st(function(){var e=[];return(e.constructor={})[Dv]=function(){return{foo:1}},e[Du](Boolean).foo!==1})),Uv=function(e){if(!ot(e))return!1;var t=e[Qh];return t!==void 0?!!t:cs(e)};bt({target:"Array",proto:!0,arity:1,forced:!kv||!Ev},{concat:function(e){var t,n,r,i,o,s=br(this),a=qh(s,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(Uv(o=t===-1?s:arguments[t]))for(i=gr(o),Lu(c+i),n=0;n<i;n++,c++)n in o&&$r(a,c,o[n]);else Lu(c+1),$r(a,c++,o);return a.length=c,a}});var Mv=wc?{}.toString:function(){return"[object "+Ln(this)+"]"};wc||At(Object.prototype,"toString",Mv,{unsafe:!0});var Si,Tc=Object.keys||function(e){return Wh(e,as)},Nv=X&&!Rh?Object.defineProperties:function(e,t){yt(e);for(var n,r=ve(t),i=Tc(t),o=i.length,s=0;o>s;)_t.f(e,n=i[s++],r[n]);return e},td={f:Nv},Cv=ce("document","documentElement"),ed=js("IE_PROTO"),go=function(){},nd=function(e){return"<script>"+e+"<\/script>"},Eu=function(e){e.write(nd("")),e.close();var t=e.parentWindow.Object;return e=null,t},Mi=function(){try{Si=new ActiveXObject("htmlfile")}catch{}var e,t;Mi=typeof document<"u"?document.domain&&Si?Eu(Si):((t=Nh("iframe")).style.display="none",Cv.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(nd("document.F=Object")),e.close(),e.F):Eu(Si);for(var n=as.length;n--;)delete Mi.prototype[as[n]];return Mi()};mr[ed]=!0;var Qe=Object.create||function(e,t){var n;return e!==null?(go.prototype=yt(e),n=new go,go.prototype=null,n[ed]=e):n=Mi(),t===void 0?n:td.f(n,t)},Rv=Array,Vv=Math.max,rd=Wr.f,id=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],jv=function(e){try{return rd(e)}catch{return function(n,r,i){for(var o=gr(n),s=Zo(r,o),a=Zo(i===void 0?o:i,o),c=Rv(Vv(a-s,0)),u=0;s<a;s++,u++)$r(c,u,n[s]);return c.length=u,c}(id)}},Ac={f:function(e){return id&&Fe(e)=="Window"?jv(e):rd(ve(e))}},sd={f:lt},Yr=N,Pv=_t.f,Ot=function(e){var t=Yr.Symbol||(Yr.Symbol={});A(t,e)||Pv(t,e,{value:sd.f(e)})},od=function(){var e=ce("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,r=lt("toPrimitive");t&&!t[r]&&At(t,r,function(i){return Tt(n,this)},{arity:1})},zv=_t.f,Uu=lt("toStringTag"),Ye=function(e,t,n){e&&!n&&(e=e.prototype),e&&!A(e,Uu)&&zv(e,Uu,{configurable:!0,value:t})},Wv=P(P.bind),zs=function(e,t){return bc(e),t===void 0?e:ci?Wv(e,t):function(){return e.apply(t,arguments)}},Mu=P([].push),je=function(e){var t=e==1,n=e==2,r=e==3,i=e==4,o=e==6,s=e==7,a=e==5||o;return function(c,u,l,f){for(var p,h,m=br(c),_=Mh(m),b=zs(u,l),v=gr(_),g=0,S=f||qh,tt=t?S(c,v):n||s?S(c,0):void 0;v>g;g++)if((a||g in _)&&(h=b(p=_[g],g,m),e))if(t)tt[g]=h;else if(h)switch(e){case 3:return!0;case 5:return p;case 6:return g;case 2:Mu(tt,p)}else switch(e){case 4:return!1;case 7:Mu(tt,p)}return o?-1:r||i?i:tt}},Ws={forEach:je(0),map:je(1),filter:je(2),some:je(3),every:je(4),find:je(5),findIndex:je(6),filterReject:je(7)}.forEach,Ft=js("hidden"),$v=Gt.set,Nu=Gt.getterFor("Symbol"),zt=Object.prototype,jn=N.Symbol,Ar=jn&&jn.prototype,Yv=N.TypeError,vo=N.QObject,ad=li.f,We=_t.f,cd=Ac.f,Gv=pc.f,ud=P([].push),ke=rn("symbols"),hi=rn("op-symbols"),Kv=rn("wks"),wo=!vo||!vo.prototype||!vo.prototype.findChild,Jo=X&&st(function(){return Qe(We({},"a",{get:function(){return We(this,"a",{value:7}).a}})).a!=7})?function(e,t,n){var r=ad(zt,t);r&&delete zt[t],We(e,t,n),r&&e!==zt&&We(zt,t,r)}:We,_o=function(e,t){var n=ke[e]=Qe(Ar);return $v(n,{type:"Symbol",tag:e,description:t}),X||(n.description=t),n},us=function(e,t,n){e===zt&&us(hi,t,n),yt(e);var r=Tn(t);return yt(n),A(ke,r)?(n.enumerable?(A(e,Ft)&&e[Ft][r]&&(e[Ft][r]=!1),n=Qe(n,{enumerable:Sn(0,!1)})):(A(e,Ft)||We(e,Ft,Sn(1,{})),e[Ft][r]=!0),Jo(e,r,n)):We(e,r,n)},So=function(e,t){yt(e);var n=ve(t),r=Tc(n).concat(ld(n));return Ws(r,function(i){X&&!Tt(Xo,n,i)||us(e,i,n[i])}),e},Xo=function(e){var t=Tn(e),n=Tt(Gv,this,t);return!(this===zt&&A(ke,t)&&!A(hi,t))&&(!(n||!A(this,t)||!A(ke,t)||A(this,Ft)&&this[Ft][t])||n)},Cu=function(e,t){var n=ve(e),r=Tn(t);if(n!==zt||!A(ke,r)||A(hi,r)){var i=ad(n,r);return!i||!A(ke,r)||A(n,Ft)&&n[Ft][r]||(i.enumerable=!0),i}},Ru=function(e){var t=cd(ve(e)),n=[];return Ws(t,function(r){A(ke,r)||A(mr,r)||ud(n,r)}),n},ld=function(e){var t=e===zt,n=cd(t?hi:ve(e)),r=[];return Ws(n,function(i){!A(ke,i)||t&&!A(zt,i)||ud(r,ke[i])}),r};Pt||(Ar=(jn=function(){if(In(Ar,this))throw Yv("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?De(arguments[0]):void 0,t=ar(e),n=function(r){this===zt&&Tt(n,hi,r),A(this,Ft)&&A(this[Ft],t)&&(this[Ft][t]=!1),Jo(this,t,Sn(1,r))};return X&&wo&&Jo(zt,t,{configurable:!0,set:n}),_o(t,e)}).prototype,At(Ar,"toString",function(){return Nu(this).tag}),At(jn,"withoutSetter",function(e){return _o(ar(e),e)}),pc.f=Xo,_t.f=us,td.f=So,li.f=Cu,Wr.f=Ac.f=Ru,Ps.f=ld,sd.f=function(e){return _o(lt(e),e)},X&&(We(Ar,"description",{configurable:!0,get:function(){return Nu(this).description}}),At(zt,"propertyIsEnumerable",Xo,{unsafe:!0}))),bt({global:!0,constructor:!0,wrap:!0,forced:!Pt,sham:!Pt},{Symbol:jn}),Ws(Tc(Kv),function(e){Ot(e)}),bt({target:"Symbol",stat:!0,forced:!Pt},{useSetter:function(){wo=!0},useSimple:function(){wo=!1}}),bt({target:"Object",stat:!0,forced:!Pt,sham:!X},{create:function(e,t){return t===void 0?Qe(e):So(Qe(e),t)},defineProperty:us,defineProperties:So,getOwnPropertyDescriptor:Cu}),bt({target:"Object",stat:!0,forced:!Pt},{getOwnPropertyNames:Ru}),od(),Ye(jn,"Symbol"),mr[Ft]=!0;var fd=Pt&&!!Symbol.for&&!!Symbol.keyFor,Io=rn("string-to-symbol-registry"),Zv=rn("symbol-to-string-registry");bt({target:"Symbol",stat:!0,forced:!fd},{for:function(e){var t=De(e);if(A(Io,t))return Io[t];var n=ce("Symbol")(t);return Io[t]=n,Zv[n]=t,n}});var Vu=rn("symbol-to-string-registry");bt({target:"Symbol",stat:!0,forced:!fd},{keyFor:function(e){if(!or(e))throw TypeError(yr(e)+" is not a symbol");if(A(Vu,e))return Vu[e]}});var hd=Function.prototype,ju=hd.apply,Pu=hd.call,dd=typeof Reflect=="object"&&Reflect.apply||(ci?Pu.bind(ju):function(){return Pu.apply(ju,arguments)}),Bc=P([].slice),Ze=ce("JSON","stringify"),Ii=P(/./.exec),zu=P("".charAt),Hv=P("".charCodeAt),Jv=P("".replace),Xv=P(1 .toString),qv=/[\uD800-\uDFFF]/g,Wu=/^[\uD800-\uDBFF]$/,$u=/^[\uDC00-\uDFFF]$/,Yu=!Pt||st(function(){var e=ce("Symbol")();return Ze([e])!="[null]"||Ze({a:e})!="{}"||Ze(Object(e))!="{}"}),Gu=st(function(){return Ze("\uDF06\uD834")!=='"\\udf06\\ud834"'||Ze("\uDEAD")!=='"\\udead"'}),Qv=function(e,t){var n=Bc(arguments),r=t;if((ot(t)||e!==void 0)&&!or(e))return cs(t)||(t=function(i,o){if(nt(r)&&(o=Tt(r,this,i,o)),!or(o))return o}),n[1]=t,dd(Ze,null,n)},tw=function(e,t,n){var r=zu(n,t-1),i=zu(n,t+1);return Ii(Wu,e)&&!Ii($u,i)||Ii($u,e)&&!Ii(Wu,r)?"\\u"+Xv(Hv(e,0),16):e};Ze&&bt({target:"JSON",stat:!0,arity:3,forced:Yu||Gu},{stringify:function(e,t,n){var r=Bc(arguments),i=dd(Yu?Qv:Ze,null,r);return Gu&&typeof i=="string"?Jv(i,qv,tw):i}});var ew=!Pt||st(function(){Ps.f(1)});bt({target:"Object",stat:!0,forced:ew},{getOwnPropertySymbols:function(e){var t=Ps.f;return t?t(br(e)):[]}}),Ot("asyncIterator");var nw=_t.f,Ie=N.Symbol,un=Ie&&Ie.prototype;if(X&&nt(Ie)&&(!("description"in un)||Ie().description!==void 0)){var Ku={},Ti=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:De(arguments[0]),t=In(un,this)?new Ie(e):e===void 0?Ie():Ie(e);return e===""&&(Ku[t]=!0),t};$h(Ti,Ie),Ti.prototype=un,un.constructor=Ti;var rw=String(Ie("test"))=="Symbol(test)",iw=P(un.valueOf),sw=P(un.toString),ow=/^Symbol\((.*)\)[^)]+$/,aw=P("".replace),cw=P("".slice);nw(un,"description",{configurable:!0,get:function(){var e=iw(this);if(A(Ku,e))return"";var t=sw(e),n=rw?cw(t,7,-1):aw(t,ow,"$1");return n===""?void 0:n}}),bt({global:!0,constructor:!0,forced:!0},{Symbol:Ti})}Ot("hasInstance"),Ot("isConcatSpreadable"),Ot("iterator"),Ot("match"),Ot("matchAll"),Ot("replace"),Ot("search"),Ot("species"),Ot("split"),Ot("toPrimitive"),od(),Ot("toStringTag"),Ye(ce("Symbol"),"Symbol"),Ot("unscopables"),Ye(N.JSON,"JSON",!0),Ye(Math,"Math",!0),bt({global:!0},{Reflect:{}}),Ye(N.Reflect,"Reflect",!0),Yr.Symbol;var yn,Zu,Hu,uw=P("".charAt),Ju=P("".charCodeAt),lw=P("".slice),Xu=function(e){return function(t,n){var r,i,o=De(ui(t)),s=vc(n),a=o.length;return s<0||s>=a?e?"":void 0:(r=Ju(o,s))<55296||r>56319||s+1===a||(i=Ju(o,s+1))<56320||i>57343?e?uw(o,s):r:e?lw(o,s,s+2):i-56320+(r-55296<<10)+65536}},fw={codeAt:Xu(!1),charAt:Xu(!0)},hw=!st(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),qu=js("IE_PROTO"),qo=Object,dw=qo.prototype,tn=hw?qo.getPrototypeOf:function(e){var t=br(e);if(A(t,qu))return t[qu];var n=t.constructor;return nt(n)&&t instanceof n?n.prototype:t instanceof qo?dw:null},Qo=lt("iterator"),pd=!1;[].keys&&("next"in(Hu=[].keys())?(Zu=tn(tn(Hu)))!==Object.prototype&&(yn=Zu):pd=!0);var pw=!ot(yn)||st(function(){var e={};return yn[Qo].call(e)!==e});pw&&(yn={}),nt(yn[Qo])||At(yn,Qo,function(){return this});var Oc={IteratorPrototype:yn,BUGGY_SAFARI_ITERATORS:pd},cr={},yw=Oc.IteratorPrototype,bw=function(){return this},mw=String,gw=TypeError,ye=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=P(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch{}return function(r,i){return yt(r),function(o){if(typeof o=="object"||nt(o))return o;throw gw("Can't set "+mw(o)+" as a prototype")}(i),t?e(r,i):r.__proto__=i,r}}():void 0),vw=gc.PROPER,ww=gc.CONFIGURABLE,Qu=Oc.IteratorPrototype,Ai=Oc.BUGGY_SAFARI_ITERATORS,Ir=lt("iterator"),_w=function(){return this},Fc=function(e,t,n,r,i,o,s){(function(v,g,S,tt){var Z=g+" Iterator";v.prototype=Qe(yw,{next:Sn(+!tt,S)}),Ye(v,Z,!1),cr[Z]=bw})(n,t,r);var a,c,u,l=function(v){if(v===i&&_)return _;if(!Ai&&v in h)return h[v];switch(v){case"keys":case"values":case"entries":return function(){return new n(this,v)}}return function(){return new n(this)}},f=t+" Iterator",p=!1,h=e.prototype,m=h[Ir]||h["@@iterator"]||i&&h[i],_=!Ai&&m||l(i),b=t=="Array"&&h.entries||m;if(b&&(a=tn(b.call(new e)))!==Object.prototype&&a.next&&(tn(a)!==Qu&&(ye?ye(a,Qu):nt(a[Ir])||At(a,Ir,_w)),Ye(a,f,!0)),vw&&i=="values"&&m&&m.name!=="values"&&(ww?Vs(h,"name","values"):(p=!0,_=function(){return Tt(m,this)})),i)if(c={values:l("values"),keys:o?_:l("keys"),entries:l("entries")},s)for(u in c)(Ai||p||!(u in h))&&At(h,u,c[u]);else bt({target:t,proto:!0,forced:Ai||p},c);return h[Ir]!==_&&At(h,Ir,_,{name:i}),cr[t]=_,c},ur=function(e,t){return{value:e,done:t}},Sw=fw.charAt,Iw=Gt.set,Tw=Gt.getterFor("String Iterator");Fc(String,"String",function(e){Iw(this,{type:"String Iterator",string:De(e),index:0})},function(){var e,t=Tw(this),n=t.string,r=t.index;return r>=n.length?ur(void 0,!0):(e=Sw(n,r),t.index+=e.length,ur(e,!1))});var ta=function(e,t,n){var r,i;yt(e);try{if(!(r=is(e,"return"))){if(t==="throw")throw n;return n}r=Tt(r,e)}catch(o){i=!0,r=o}if(t==="throw")throw n;if(i)throw r;return yt(r),n},Aw=function(e,t,n,r){try{return r?t(yt(n)[0],n[1]):t(n)}catch(i){ta(e,"throw",i)}},Bw=lt("iterator"),Ow=Array.prototype,yd=function(e){return e!==void 0&&(cr.Array===e||Ow[Bw]===e)},Fw=lt("iterator"),xc=function(e){if(!pr(e))return is(e,Fw)||is(e,"@@iterator")||cr[Ln(e)]},xw=TypeError,bd=function(e,t){var n=arguments.length<2?xc(e):t;if(bc(n))return yt(Tt(n,e));throw xw(yr(e)+" is not iterable")},tl=Array,md=lt("iterator"),gd=!1;try{var Lw=0,el={next:function(){return{done:!!Lw++}},return:function(){gd=!0}};el[md]=function(){return this},Array.from(el,function(){throw 2})}catch{}var vd=function(e,t){if(!t&&!gd)return!1;var n=!1;try{var r={};r[md]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},Dw=!vd(function(e){Array.from(e)});bt({target:"Array",stat:!0,forced:Dw},{from:function(e){var t=br(e),n=Ic(this),r=arguments.length,i=r>1?arguments[1]:void 0,o=i!==void 0;o&&(i=zs(i,r>2?arguments[2]:void 0));var s,a,c,u,l,f,p=xc(t),h=0;if(!p||this===tl&&yd(p))for(s=gr(t),a=n?new this(s):tl(s);s>h;h++)f=o?i(t[h],h):t[h],$r(a,h,f);else for(l=(u=bd(t,p)).next,a=n?new this:[];!(c=Tt(l,u)).done;h++)f=o?Aw(u,i,[c.value,h],!0):c.value,$r(a,h,f);return a.length=h,a}}),Yr.Array.from;var Lt,Kn,ls,kw=typeof ArrayBuffer<"u"&&typeof DataView<"u",Ew=_t.f,wd=Gt.enforce,Uw=Gt.get,fs=N.Int8Array,ea=fs&&fs.prototype,nl=N.Uint8ClampedArray,rl=nl&&nl.prototype,le=fs&&tn(fs),Xt=ea&&tn(ea),Mw=Object.prototype,na=N.TypeError,il=lt("toStringTag"),ra=ar("TYPED_ARRAY_TAG"),xe=kw&&!!ye&&Ln(N.opera)!=="Opera",_d=!1,Oe={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Lc={BigInt64Array:8,BigUint64Array:8},Sd=function(e){var t=tn(e);if(ot(t)){var n=Uw(t);return n&&A(n,"TypedArrayConstructor")?n.TypedArrayConstructor:Sd(t)}},sl=function(e){if(!ot(e))return!1;var t=Ln(e);return A(Oe,t)||A(Lc,t)};for(Lt in Oe)(ls=(Kn=N[Lt])&&Kn.prototype)?wd(ls).TypedArrayConstructor=Kn:xe=!1;for(Lt in Lc)(ls=(Kn=N[Lt])&&Kn.prototype)&&(wd(ls).TypedArrayConstructor=Kn);if((!xe||!nt(le)||le===Function.prototype)&&(le=function(){throw na("Incorrect invocation")},xe))for(Lt in Oe)N[Lt]&&ye(N[Lt],le);if((!xe||!Xt||Xt===Mw)&&(Xt=le.prototype,xe))for(Lt in Oe)N[Lt]&&ye(N[Lt].prototype,Xt);if(xe&&tn(rl)!==Xt&&ye(rl,Xt),X&&!A(Xt,il))for(Lt in _d=!0,Ew(Xt,il,{get:function(){return ot(this)?this[ra]:void 0}}),Oe)N[Lt]&&Vs(N[Lt],ra,Lt);var $s={NATIVE_ARRAY_BUFFER_VIEWS:xe,TYPED_ARRAY_TAG:_d&&ra,aTypedArray:function(e){if(sl(e))return e;throw na("Target is not a typed array")},aTypedArrayConstructor:function(e){if(nt(e)&&(!ye||In(le,e)))return e;throw na(yr(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(X){if(n)for(var i in Oe){var o=N[i];if(o&&A(o.prototype,e))try{delete o.prototype[e]}catch{try{o.prototype[e]=t}catch{}}}Xt[e]&&!n||At(Xt,e,n?t:xe&&ea[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(X){if(ye){if(n){for(r in Oe)if((i=N[r])&&A(i,e))try{delete i[e]}catch{}}if(le[e]&&!n)return;try{return At(le,e,n?t:xe&&le[e]||t)}catch{}}for(r in Oe)!(i=N[r])||i[e]&&!n||At(i,e,t)}},getTypedArrayConstructor:Sd,isView:function(e){if(!ot(e))return!1;var t=Ln(e);return t==="DataView"||A(Oe,t)||A(Lc,t)},isTypedArray:sl,TypedArray:le,TypedArrayPrototype:Xt},Nw=TypeError,Cw=lt("species"),Rw=function(e,t){var n,r=yt(e).constructor;return r===void 0||pr(n=yt(r)[Cw])?t:function(i){if(Ic(i))return i;throw Nw(yr(i)+" is not a constructor")}(n)},Vw=$s.aTypedArrayConstructor,jw=$s.getTypedArrayConstructor,Pw=$s.aTypedArray;(0,$s.exportTypedArrayMethod)("slice",function(e,t){for(var n,r=Bc(Pw(this),e,t),i=Vw(Rw(n=this,jw(n))),o=0,s=r.length,a=new i(s);s>o;)a[o]=r[o++];return a},st(function(){new Int8Array(1).slice()}));var zw=_t.f,ia=lt("unscopables"),sa=Array.prototype;sa[ia]==null&&zw(sa,ia,{configurable:!0,value:Qe(null)});var Ni=function(e){sa[ia][e]=!0},Ww=zh.includes,$w=st(function(){return!Array(1).includes()});bt({target:"Array",proto:!0,forced:$w},{includes:function(e){return Ww(this,e,arguments.length>1?arguments[1]:void 0)}}),Ni("includes"),_c("Array","includes");var Yw=P("".indexOf);bt({target:"String",proto:!0,forced:!Kh("includes")},{includes:function(e){return!!~Yw(De(ui(this)),De(Gh(e)),arguments.length>1?arguments[1]:void 0)}}),_c("String","includes");var Gw=_t.f,Kw=Gt.set,Zw=Gt.getterFor("Array Iterator");Fc(Array,"Array",function(e,t){Kw(this,{type:"Array Iterator",target:ve(e),index:0,kind:t})},function(){var e=Zw(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,ur(void 0,!0)):ur(n=="keys"?r:n=="values"?t[r]:[r,t[r]],!1)},"values");var ol=cr.Arguments=cr.Array;if(Ni("keys"),Ni("values"),Ni("entries"),X&&ol.name!=="values")try{Gw(ol,"name",{value:"values"})}catch{}var al=st(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),Bi=Object.isExtensible,To=st(function(){Bi(1)})||al?function(e){return!!ot(e)&&(!al||Fe(e)!="ArrayBuffer")&&(!Bi||Bi(e))}:Bi,Hw=!st(function(){return Object.isExtensible(Object.preventExtensions({}))}),Pn=dr(function(e){var t=_t.f,n=!1,r=ar("meta"),i=0,o=function(a){t(a,r,{value:{objectID:"O"+i++,weakData:{}}})},s=e.exports={enable:function(){s.enable=function(){},n=!0;var a=Wr.f,c=P([].splice),u={};u[r]=1,a(u).length&&(Wr.f=function(l){for(var f=a(l),p=0,h=f.length;p<h;p++)if(f[p]===r){c(f,p,1);break}return f},bt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ac.f}))},fastKey:function(a,c){if(!ot(a))return typeof a=="symbol"?a:(typeof a=="string"?"S":"P")+a;if(!A(a,r)){if(!To(a))return"F";if(!c)return"E";o(a)}return a[r].objectID},getWeakData:function(a,c){if(!A(a,r)){if(!To(a))return!0;if(!c)return!1;o(a)}return a[r].weakData},onFreeze:function(a){return Hw&&n&&To(a)&&!A(a,r)&&o(a),a}};mr[r]=!0});Pn.enable,Pn.fastKey,Pn.getWeakData,Pn.onFreeze;var Jw=TypeError,Ci=function(e,t){this.stopped=e,this.result=t},cl=Ci.prototype,Id=function(e,t,n){var r,i,o,s,a,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_RECORD),h=!(!n||!n.IS_ITERATOR),m=!(!n||!n.INTERRUPTED),_=zs(t,l),b=function(g){return r&&ta(r,"normal",g),new Ci(!0,g)},v=function(g){return f?(yt(g),m?_(g[0],g[1],b):_(g[0],g[1])):m?_(g,b):_(g)};if(p)r=e.iterator;else if(h)r=e;else{if(!(i=xc(e)))throw Jw(yr(e)+" is not iterable");if(yd(i)){for(o=0,s=gr(e);s>o;o++)if((a=v(e[o]))&&In(cl,a))return a;return new Ci(!1)}r=bd(e,i)}for(c=p?e.next:r.next;!(u=Tt(c,r)).done;){try{a=v(u.value)}catch(g){ta(r,"throw",g)}if(typeof a=="object"&&a&&In(cl,a))return a}return new Ci(!1)},Xw=TypeError,Td=function(e,t){if(In(t,e))return e;throw Xw("Incorrect invocation")},ul=function(e,t,n){for(var r in t)At(e,r,t[r],n);return e},ll=lt("species"),qw=_t.f,fl=Pn.fastKey,hl=Gt.set,Ao=Gt.getterFor,Qw={getConstructor:function(e,t,n,r){var i=e(function(u,l){Td(u,o),hl(u,{type:t,index:Qe(null),first:void 0,last:void 0,size:0}),X||(u.size=0),pr(l)||Id(l,u[r],{that:u,AS_ENTRIES:n})}),o=i.prototype,s=Ao(t),a=function(u,l,f){var p,h,m=s(u),_=c(u,l);return _?_.value=f:(m.last=_={index:h=fl(l,!0),key:l,value:f,previous:p=m.last,next:void 0,removed:!1},m.first||(m.first=_),p&&(p.next=_),X?m.size++:u.size++,h!=="F"&&(m.index[h]=_)),u},c=function(u,l){var f,p=s(u),h=fl(l);if(h!=="F")return p.index[h];for(f=p.first;f;f=f.next)if(f.key==l)return f};return ul(o,{clear:function(){for(var u=s(this),l=u.index,f=u.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete l[f.index],f=f.next;u.first=u.last=void 0,X?u.size=0:this.size=0},delete:function(u){var l=this,f=s(l),p=c(l,u);if(p){var h=p.next,m=p.previous;delete f.index[p.index],p.removed=!0,m&&(m.next=h),h&&(h.previous=m),f.first==p&&(f.first=h),f.last==p&&(f.last=m),X?f.size--:l.size--}return!!p},forEach:function(u){for(var l,f=s(this),p=zs(u,arguments.length>1?arguments[1]:void 0);l=l?l.next:f.first;)for(p(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(u){return!!c(this,u)}}),ul(o,n?{get:function(u){var l=c(this,u);return l&&l.value},set:function(u,l){return a(this,u===0?0:u,l)}}:{add:function(u){return a(this,u=u===0?0:u,u)}}),X&&qw(o,"size",{get:function(){return s(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=Ao(t),o=Ao(r);Fc(e,t,function(s,a){hl(this,{type:r,target:s,state:i(s),kind:a,last:void 0})},function(){for(var s=o(this),a=s.kind,c=s.last;c&&c.removed;)c=c.previous;return s.target&&(s.last=c=c?c.next:s.state.first)?ur(a=="keys"?c.key:a=="values"?c.value:[c.key,c.value],!1):(s.target=void 0,ur(void 0,!0))},n?"entries":"values",!n,!0),function(s){var a=ce(s),c=_t.f;X&&a&&!a[ll]&&c(a,ll,{configurable:!0,get:function(){return this}})}(t)}};function Ad(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}function Bd(e){return new this(function(t,n){if(!e||e.length===void 0)return n(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(r.length===0)return t([]);var i=r.length;function o(a,c){if(c&&(typeof c=="object"||typeof c=="function")){var u=c.then;if(typeof u=="function")return void u.call(c,function(l){o(a,l)},function(l){r[a]={status:"rejected",reason:l},--i==0&&t(r)})}r[a]={status:"fulfilled",value:c},--i==0&&t(r)}for(var s=0;s<r.length;s++)o(s,r[s])})}(function(e,t,n){var r=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=r?"set":"add",s=N[e],a=s&&s.prototype,c=s,u={},l=function(b){var v=P(a[b]);At(a,b,b=="add"?function(g){return v(this,g===0?0:g),this}:b=="delete"?function(g){return!(i&&!ot(g))&&v(this,g===0?0:g)}:b=="get"?function(g){return i&&!ot(g)?void 0:v(this,g===0?0:g)}:b=="has"?function(g){return!(i&&!ot(g))&&v(this,g===0?0:g)}:function(g,S){return v(this,g===0?0:g,S),this})};if(Ho(e,!nt(s)||!(i||a.forEach&&!st(function(){new s().entries().next()}))))c=n.getConstructor(t,e,r,o),Pn.enable();else if(Ho(e,!0)){var f=new c,p=f[o](i?{}:-0,1)!=f,h=st(function(){f.has(1)}),m=vd(function(b){new s(b)}),_=!i&&st(function(){for(var b=new s,v=5;v--;)b[o](v,v);return!b.has(-0)});m||((c=t(function(b,v){Td(b,a);var g=function(S,tt,Z){var pt,jt;return ye&&nt(pt=tt.constructor)&&pt!==Z&&ot(jt=pt.prototype)&&jt!==Z.prototype&&ye(S,jt),S}(new s,b,c);return pr(v)||Id(v,g[o],{that:g,AS_ENTRIES:r}),g})).prototype=a,a.constructor=c),(h||_)&&(l("delete"),l("has"),r&&l("get")),(_||p)&&l(o),i&&a.clear&&delete a.clear}u[e]=c,bt({global:!0,constructor:!0,forced:c!=s},u),Ye(c,e),i||n.setStrong(c,e,r)})("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},Qw),Yr.Set;var t_=setTimeout;function dl(e){return Boolean(e&&e.length!==void 0)}function e_(){}function ut(e){if(!(this instanceof ut))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Fd(e,this)}function Od(e,t){for(;e._state===3;)e=e._value;e._state!==0?(e._handled=!0,ut._immediateFn(function(){var n=e._state===1?t.onFulfilled:t.onRejected;if(n!==null){var r;try{r=n(e._value)}catch(i){return void Gr(t.promise,i)}oa(t.promise,r)}else(e._state===1?oa:Gr)(t.promise,e._value)})):e._deferreds.push(t)}function oa(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var n=t.then;if(t instanceof ut)return e._state=3,e._value=t,void aa(e);if(typeof n=="function")return void Fd((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,aa(e)}catch(o){Gr(e,o)}var r,i}function Gr(e,t){e._state=2,e._value=t,aa(e)}function aa(e){e._state===2&&e._deferreds.length===0&&ut._immediateFn(function(){e._handled||ut._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)Od(e,e._deferreds[t]);e._deferreds=null}function n_(e,t,n){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=n}function Fd(e,t){var n=!1;try{e(function(r){n||(n=!0,oa(t,r))},function(r){n||(n=!0,Gr(t,r))})}catch(r){if(n)return;n=!0,Gr(t,r)}}ut.prototype.catch=function(e){return this.then(null,e)},ut.prototype.then=function(e,t){var n=new this.constructor(e_);return Od(this,new n_(e,t,n)),n},ut.prototype.finally=Ad,ut.all=function(e){return new ut(function(t,n){if(!dl(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(r.length===0)return t([]);var i=r.length;function o(a,c){try{if(c&&(typeof c=="object"||typeof c=="function")){var u=c.then;if(typeof u=="function")return void u.call(c,function(l){o(a,l)},n)}r[a]=c,--i==0&&t(r)}catch(l){n(l)}}for(var s=0;s<r.length;s++)o(s,r[s])})},ut.allSettled=Bd,ut.resolve=function(e){return e&&typeof e=="object"&&e.constructor===ut?e:new ut(function(t){t(e)})},ut.reject=function(e){return new ut(function(t,n){n(e)})},ut.race=function(e){return new ut(function(t,n){if(!dl(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,i=e.length;r<i;r++)ut.resolve(e[r]).then(t,n)})},ut._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){t_(e,0)},ut._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Un=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}();typeof Un.Promise!="function"?Un.Promise=ut:(Un.Promise.prototype.finally||(Un.Promise.prototype.finally=Ad),Un.Promise.allSettled||(Un.Promise.allSettled=Bd)),function(e){function t(h){for(var m=0,_=Math.min(65536,h.length+1),b=new Uint16Array(_),v=[],g=0;;){var S=m<h.length;if(!S||g>=_-1){var tt=b.subarray(0,g);if(v.push(String.fromCharCode.apply(null,tt)),!S)return v.join("");h=h.subarray(m),m=0,g=0}var Z=h[m++];if((128&Z)==0)b[g++]=Z;else if((224&Z)==192){var pt=63&h[m++];b[g++]=(31&Z)<<6|pt}else if((240&Z)==224){pt=63&h[m++];var jt=63&h[m++];b[g++]=(31&Z)<<12|pt<<6|jt}else if((248&Z)==240){var we=(7&Z)<<18|(pt=63&h[m++])<<12|(jt=63&h[m++])<<6|63&h[m++];we>65535&&(we-=65536,b[g++]=we>>>10&1023|55296,we=56320|1023&we),b[g++]=we}}}var n="Failed to ",r=function(h,m,_){if(h)throw new Error("".concat(n).concat(m,": the '").concat(_,"' option is unsupported."))},i=typeof Buffer=="function"&&Buffer.from,o=i?function(h){return Buffer.from(h)}:function(h){for(var m=0,_=h.length,b=0,v=Math.max(32,_+(_>>>1)+7),g=new Uint8Array(v>>>3<<3);m<_;){var S=h.charCodeAt(m++);if(S>=55296&&S<=56319){if(m<_){var tt=h.charCodeAt(m);(64512&tt)==56320&&(++m,S=((1023&S)<<10)+(1023&tt)+65536)}if(S>=55296&&S<=56319)continue}if(b+4>g.length){v+=8,v=(v*=1+m/h.length*2)>>>3<<3;var Z=new Uint8Array(v);Z.set(g),g=Z}if((4294967168&S)!=0){if((4294965248&S)==0)g[b++]=S>>>6&31|192;else if((4294901760&S)==0)g[b++]=S>>>12&15|224,g[b++]=S>>>6&63|128;else{if((4292870144&S)!=0)continue;g[b++]=S>>>18&7|240,g[b++]=S>>>12&63|128,g[b++]=S>>>6&63|128}g[b++]=63&S|128}else g[b++]=S}return g.slice?g.slice(0,b):g.subarray(0,b)};function s(){this.encoding="utf-8"}s.prototype.encode=function(h,m){return r(m&&m.stream,"encode","stream"),o(h)};var a=!i&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",c=["utf-8","utf8","unicode-1-1-utf-8"],u=t;i?u=function(h,m){return(h instanceof Buffer?h:Buffer.from(h.buffer,h.byteOffset,h.byteLength)).toString(m)}:a&&(u=function(h){try{return function(m){var _;try{var b=new Blob([m],{type:"text/plain;charset=UTF-8"});_=URL.createObjectURL(b);var v=new XMLHttpRequest;return v.open("GET",_,!1),v.send(),v.responseText}finally{_&&URL.revokeObjectURL(_)}}(h)}catch{return t(h)}});var l="construct 'TextDecoder'",f="".concat(n," ").concat(l,": the ");function p(h,m){if(r(m&&m.fatal,l,"fatal"),h=h||"utf-8",!(i?Buffer.isEncoding(h):c.indexOf(h.toLowerCase())!==-1))throw new RangeError("".concat(f," encoding label provided ('").concat(h,"') is invalid."));this.encoding=h,this.fatal=!1,this.ignoreBOM=!1}p.prototype.decode=function(h,m){var _;return r(m&&m.stream,"decode","stream"),_=h instanceof Uint8Array?h:h.buffer instanceof ArrayBuffer?new Uint8Array(h.buffer):new Uint8Array(h),u(_,this.encoding)},e.TextEncoder=e.TextEncoder||s,e.TextDecoder=e.TextDecoder||p}(typeof window<"u"?window:he),function(){function e(b,v){if(!(b instanceof v))throw new TypeError("Cannot call a class as a function")}function t(b,v){for(var g=0;g<v.length;g++){var S=v[g];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}function n(b,v,g){return v&&t(b.prototype,v),g&&t(b,g),b}function r(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(v&&v.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),v&&o(b,v)}function i(b){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},i(b)}function o(b,v){return o=Object.setPrototypeOf||function(g,S){return g.__proto__=S,g},o(b,v)}function s(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function c(b,v){return!v||typeof v!="object"&&typeof v!="function"?a(b):v}function u(b){var v=s();return function(){var g,S=i(b);if(v){var tt=i(this).constructor;g=Reflect.construct(S,arguments,tt)}else g=S.apply(this,arguments);return c(this,g)}}function l(b,v){for(;!Object.prototype.hasOwnProperty.call(b,v)&&(b=i(b))!==null;);return b}function f(b,v,g){return f=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(S,tt,Z){var pt=l(S,tt);if(pt){var jt=Object.getOwnPropertyDescriptor(pt,tt);return jt.get?jt.get.call(Z):jt.value}},f(b,v,g||b)}var p=function(){function b(){e(this,b),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(b,[{key:"addEventListener",value:function(v,g,S){v in this.listeners||(this.listeners[v]=[]),this.listeners[v].push({callback:g,options:S})}},{key:"removeEventListener",value:function(v,g){if(v in this.listeners){for(var S=this.listeners[v],tt=0,Z=S.length;tt<Z;tt++)if(S[tt].callback===g)return void S.splice(tt,1)}}},{key:"dispatchEvent",value:function(v){if(v.type in this.listeners){for(var g=this.listeners[v.type].slice(),S=0,tt=g.length;S<tt;S++){var Z=g[S];try{Z.callback.call(this,v)}catch(pt){Promise.resolve().then(function(){throw pt})}Z.options&&Z.options.once&&this.removeEventListener(v.type,Z.callback)}return!v.defaultPrevented}}}]),b}(),h=function(b){r(g,b);var v=u(g);function g(){var S;return e(this,g),(S=v.call(this)).listeners||p.call(a(S)),Object.defineProperty(a(S),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(a(S),"onabort",{value:null,writable:!0,configurable:!0}),S}return n(g,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(S){S.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,S)),f(i(g.prototype),"dispatchEvent",this).call(this,S)}}]),g}(p),m=function(){function b(){e(this,b),Object.defineProperty(this,"signal",{value:new h,writable:!0,configurable:!0})}return n(b,[{key:"abort",value:function(){var v;try{v=new Event("abort")}catch{typeof document<"u"?document.createEvent?(v=document.createEvent("Event")).initEvent("abort",!1,!1):(v=document.createEventObject()).type="abort":v={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(v)}},{key:"toString",value:function(){return"[object AbortController]"}}]),b}();function _(b){return b.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof b.Request=="function"&&!b.Request.prototype.hasOwnProperty("signal")||!b.AbortController}typeof Symbol<"u"&&Symbol.toStringTag&&(m.prototype[Symbol.toStringTag]="AbortController",h.prototype[Symbol.toStringTag]="AbortSignal"),function(b){_(b)&&(b.AbortController=m,b.AbortSignal=h)}(typeof self<"u"?self:he)}();var ln=dr(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function r(){var i=this;this.locked=new Map,this.addToLocked=function(o,s){var a=i.locked.get(o);a===void 0?s===void 0?i.locked.set(o,[]):i.locked.set(o,[s]):s!==void 0&&(a.unshift(s),i.locked.set(o,a))},this.isLocked=function(o){return i.locked.has(o)},this.lock=function(o){return new Promise(function(s,a){i.isLocked(o)?i.addToLocked(o,s):(i.addToLocked(o),s())})},this.unlock=function(o){var s=i.locked.get(o);if(s!==void 0&&s.length!==0){var a=s.pop();i.locked.set(o,s),a!==void 0&&setTimeout(a,0)}else i.locked.delete(o)}}return r.getInstance=function(){return r.instance===void 0&&(r.instance=new r),r.instance},r}();t.default=function(){return n.getInstance()}});dc(ln);var r_=dr(function(e,t){var n=he&&he.__awaiter||function(c,u,l,f){return new(l||(l=Promise))(function(p,h){function m(v){try{b(f.next(v))}catch(g){h(g)}}function _(v){try{b(f.throw(v))}catch(g){h(g)}}function b(v){v.done?p(v.value):new l(function(g){g(v.value)}).then(m,_)}b((f=f.apply(c,u||[])).next())})},r=he&&he.__generator||function(c,u){var l,f,p,h,m={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return h={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function _(b){return function(v){return function(g){if(l)throw new TypeError("Generator is already executing.");for(;m;)try{if(l=1,f&&(p=2&g[0]?f.return:g[0]?f.throw||((p=f.return)&&p.call(f),0):f.next)&&!(p=p.call(f,g[1])).done)return p;switch(f=0,p&&(g=[2&g[0],p.value]),g[0]){case 0:case 1:p=g;break;case 4:return m.label++,{value:g[1],done:!1};case 5:m.label++,f=g[1],g=[0];continue;case 7:g=m.ops.pop(),m.trys.pop();continue;default:if(p=m.trys,!((p=p.length>0&&p[p.length-1])||g[0]!==6&&g[0]!==2)){m=0;continue}if(g[0]===3&&(!p||g[1]>p[0]&&g[1]<p[3])){m.label=g[1];break}if(g[0]===6&&m.label<p[1]){m.label=p[1],p=g;break}if(p&&m.label<p[2]){m.label=p[2],m.ops.push(g);break}p[2]&&m.ops.pop(),m.trys.pop();continue}g=u.call(c,m)}catch(S){g=[6,S],f=0}finally{l=p=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([b,v])}}};Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key";function o(c){return new Promise(function(u){return setTimeout(u,c)})}function s(c){for(var u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",l="",f=0;f<c;f++)l+=u[Math.floor(Math.random()*u.length)];return l}var a=function(){function c(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+s(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(u,l){return l===void 0&&(l=5e3),n(this,void 0,void 0,function(){var f,p,h,m,_,b;return r(this,function(v){switch(v.label){case 0:f=Date.now()+s(4),p=Date.now()+l,h=i+"-"+u,m=window.localStorage,v.label=1;case 1:return Date.now()<p?[4,o(30)]:[3,8];case 2:return v.sent(),m.getItem(h)!==null?[3,5]:(_=this.id+"-"+u+"-"+f,[4,o(Math.floor(25*Math.random()))]);case 3:return v.sent(),m.setItem(h,JSON.stringify({id:this.id,iat:f,timeoutKey:_,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return v.sent(),(b=m.getItem(h))!==null&&(b=JSON.parse(b)).id===this.id&&b.iat===f?(this.acquiredIatSet.add(f),this.refreshLockWhileAcquired(h,f),[2,!0]):[3,7];case 5:return c.lockCorrector(),[4,this.waitForSomethingToChange(p)];case 6:v.sent(),v.label=7;case 7:return f=Date.now()+s(4),[3,1];case 8:return[2,!1]}})})},c.prototype.refreshLockWhileAcquired=function(u,l){return n(this,void 0,void 0,function(){var f=this;return r(this,function(p){return setTimeout(function(){return n(f,void 0,void 0,function(){var h,m;return r(this,function(_){switch(_.label){case 0:return[4,ln.default().lock(l)];case 1:return _.sent(),this.acquiredIatSet.has(l)?(h=window.localStorage,(m=h.getItem(u))===null?(ln.default().unlock(l),[2]):((m=JSON.parse(m)).timeRefreshed=Date.now(),h.setItem(u,JSON.stringify(m)),ln.default().unlock(l),this.refreshLockWhileAcquired(u,l),[2])):(ln.default().unlock(l),[2])}})})},1e3),[2]})})},c.prototype.waitForSomethingToChange=function(u){return n(this,void 0,void 0,function(){return r(this,function(l){switch(l.label){case 0:return[4,new Promise(function(f){var p=!1,h=Date.now(),m=!1;function _(){if(m||(window.removeEventListener("storage",_),c.removeFromWaiting(_),clearTimeout(b),m=!0),!p){p=!0;var v=50-(Date.now()-h);v>0?setTimeout(f,v):f()}}window.addEventListener("storage",_),c.addToWaiting(_);var b=setTimeout(_,Math.max(0,u-Date.now()))})];case 1:return l.sent(),[2]}})})},c.addToWaiting=function(u){this.removeFromWaiting(u),c.waiters!==void 0&&c.waiters.push(u)},c.removeFromWaiting=function(u){c.waiters!==void 0&&(c.waiters=c.waiters.filter(function(l){return l!==u}))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach(function(u){return u()})},c.prototype.releaseLock=function(u){return n(this,void 0,void 0,function(){return r(this,function(l){switch(l.label){case 0:return[4,this.releaseLock__private__(u)];case 1:return[2,l.sent()]}})})},c.prototype.releaseLock__private__=function(u){return n(this,void 0,void 0,function(){var l,f,p;return r(this,function(h){switch(h.label){case 0:return l=window.localStorage,f=i+"-"+u,(p=l.getItem(f))===null?[2]:(p=JSON.parse(p)).id!==this.id?[3,2]:[4,ln.default().lock(p.iat)];case 1:h.sent(),this.acquiredIatSet.delete(p.iat),l.removeItem(f),ln.default().unlock(p.iat),c.notifyWaiters(),h.label=2;case 2:return[2]}})})},c.lockCorrector=function(){for(var u=Date.now()-5e3,l=window.localStorage,f=Object.keys(l),p=!1,h=0;h<f.length;h++){var m=f[h];if(m.includes(i)){var _=l.getItem(m);_!==null&&((_=JSON.parse(_)).timeRefreshed===void 0&&_.timeAcquired<u||_.timeRefreshed!==void 0&&_.timeRefreshed<u)&&(l.removeItem(m),p=!0)}}p&&c.notifyWaiters()},c.waiters=void 0,c}();t.default=a}),i_=dc(r_),s_={timeoutInSeconds:60},o_=["login_required","consent_required","interaction_required","account_selection_required","access_denied"],xd={name:"auth0-spa-js",version:"1.22.6"},Ld=function(){return Date.now()},Ee=function(e){function t(n,r){var i=e.call(this,r)||this;return i.error=n,i.error_description=r,Object.setPrototypeOf(i,t.prototype),i}return xn(t,e),t.fromPayload=function(n){return new t(n.error,n.error_description)},t}(Error),a_=function(e){function t(n,r,i,o){o===void 0&&(o=null);var s=e.call(this,n,r)||this;return s.state=i,s.appState=o,Object.setPrototypeOf(s,t.prototype),s}return xn(t,e),t}(Ee),ca=function(e){function t(){var n=e.call(this,"timeout","Timeout")||this;return Object.setPrototypeOf(n,t.prototype),n}return xn(t,e),t}(Ee),c_=function(e){function t(n){var r=e.call(this)||this;return r.popup=n,Object.setPrototypeOf(r,t.prototype),r}return xn(t,e),t}(ca),u_=function(e){function t(n){var r=e.call(this,"cancelled","Popup closed")||this;return r.popup=n,Object.setPrototypeOf(r,t.prototype),r}return xn(t,e),t}(Ee),l_=function(e){function t(n,r,i){var o=e.call(this,n,r)||this;return o.mfa_token=i,Object.setPrototypeOf(o,t.prototype),o}return xn(t,e),t}(Ee),f_=function(e){function t(n,r){var i=e.call(this,"missing_refresh_token","Missing Refresh Token (audience: '".concat(yl(n,["default"]),"', scope: '").concat(yl(r),"')"))||this;return i.audience=n,i.scope=r,Object.setPrototypeOf(i,t.prototype),i}return xn(t,e),t}(Ee),h_=function(e){return new Promise(function(t,n){var r,i=setInterval(function(){e.popup&&e.popup.closed&&(clearInterval(i),clearTimeout(o),window.removeEventListener("message",r,!1),n(new u_(e.popup)))},1e3),o=setTimeout(function(){clearInterval(i),n(new c_(e.popup)),window.removeEventListener("message",r,!1)},1e3*(e.timeoutInSeconds||60));r=function(s){if(s.data&&s.data.type==="authorization_response"){if(clearTimeout(o),clearInterval(i),window.removeEventListener("message",r,!1),e.popup.close(),s.data.response.error)return n(Ee.fromPayload(s.data.response));t(s.data.response)}},window.addEventListener("message",r)})},Dc=function(){return window.crypto||window.msCrypto},Dd=function(){var e=Dc();return e.subtle||e.webkitSubtle},_e=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(Dc().getRandomValues(new Uint8Array(43))).forEach(function(n){return t+=e[n%e.length]}),t},Mn=function(e){return btoa(e)},ua=function(e){return Object.keys(e).filter(function(t){return e[t]!==void 0}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},Bo=function(e){return $(void 0,void 0,void 0,function(){var t;return Y(this,function(n){switch(n.label){case 0:return t=Dd().digest({name:"SHA-256"},new TextEncoder().encode(e)),window.msCrypto?[2,new Promise(function(r,i){t.oncomplete=function(o){r(o.target.result)},t.onerror=function(o){i(o.error)},t.onabort=function(){i("The digest operation was aborted")}})]:[4,t];case 1:return[2,n.sent()]}})})},pl=function(e){return function(t){return decodeURIComponent(atob(t).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},Oo=function(e){var t=new Uint8Array(e);return function(n){var r={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,function(i){return r[i]})}(window.btoa(String.fromCharCode.apply(String,$o([],sr(Array.from(t)),!1))))};function yl(e,t){return t===void 0&&(t=[]),e&&!t.includes(e)?e:""}var d_=function(e,t){return $(void 0,void 0,void 0,function(){var n,r;return Y(this,function(i){switch(i.label){case 0:return[4,(o=e,s=t,s=s||{},new Promise(function(a,c){var u=new XMLHttpRequest,l=[],f=[],p={},h=function(){return{ok:(u.status/100|0)==2,statusText:u.statusText,status:u.status,url:u.responseURL,text:function(){return Promise.resolve(u.responseText)},json:function(){return Promise.resolve(u.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([u.response]))},clone:h,headers:{keys:function(){return l},entries:function(){return f},get:function(_){return p[_.toLowerCase()]},has:function(_){return _.toLowerCase()in p}}}};for(var m in u.open(s.method||"get",o,!0),u.onload=function(){u.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,b,v){l.push(b=b.toLowerCase()),f.push([b,v]),p[b]=p[b]?p[b]+","+v:v}),a(h())},u.onerror=c,u.withCredentials=s.credentials=="include",s.headers)u.setRequestHeader(m,s.headers[m]);u.send(s.body||null)}))];case 1:return n=i.sent(),r={ok:n.ok},[4,n.json()];case 2:return[2,(r.json=i.sent(),r)]}var o,s})})},p_=function(e,t,n){return $(void 0,void 0,void 0,function(){var r,i;return Y(this,function(o){return r=new AbortController,t.signal=r.signal,[2,Promise.race([d_(e,t),new Promise(function(s,a){i=setTimeout(function(){r.abort(),a(new Error("Timeout when executing 'fetch'"))},n)})]).finally(function(){clearTimeout(i)})]})})},y_=function(e,t,n,r,i,o,s){return $(void 0,void 0,void 0,function(){return Y(this,function(a){return[2,(c={auth:{audience:t,scope:n},timeout:i,fetchUrl:e,fetchOptions:r,useFormData:s},u=o,new Promise(function(l,f){var p=new MessageChannel;p.port1.onmessage=function(h){h.data.error?f(new Error(h.data.error)):l(h.data),p.port1.close()},u.postMessage(c,[p.port2])}))];var c,u})})},b_=function(e,t,n,r,i,o,s){return s===void 0&&(s=1e4),$(void 0,void 0,void 0,function(){return Y(this,function(a){return i?[2,y_(e,t,n,r,s,i,o)]:[2,p_(e,r,s)]})})};function m_(e,t,n,r,i,o,s){return $(this,void 0,void 0,function(){var a,c,u,l,f,p,h,m,_;return Y(this,function(b){switch(b.label){case 0:a=null,u=0,b.label=1;case 1:if(!(u<3))return[3,6];b.label=2;case 2:return b.trys.push([2,4,,5]),[4,b_(e,n,r,i,o,s,t)];case 3:return c=b.sent(),a=null,[3,6];case 4:return l=b.sent(),a=l,[3,5];case 5:return u++,[3,1];case 6:if(a)throw a.message=a.message||"Failed to fetch",a;if(f=c.json,p=f.error,h=f.error_description,m=Bt(f,["error","error_description"]),!c.ok)throw _=h||"HTTP error. Unable to fetch ".concat(e),p==="mfa_required"?new l_(p,_,m.mfa_token):new Ee(p||"request_error",_);return[2,m]}})})}function Oi(e,t){var n=e.baseUrl,r=e.timeout,i=e.audience,o=e.scope,s=e.auth0Client,a=e.useFormData,c=Bt(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);return $(this,void 0,void 0,function(){var u;return Y(this,function(l){switch(l.label){case 0:return u=a?ua(c):JSON.stringify(c),[4,m_("".concat(n,"/oauth/token"),r,i||"default",o,{method:"POST",body:u,headers:{"Content-Type":a?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(s||xd))}},t,a)];case 1:return[2,l.sent()]}})})}var g_=function(e){return Array.from(new Set(e))},Pe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g_(e.join(" ").trim().split(/\s+/)).join(" ")},fn=function(){function e(t,n){n===void 0&&(n="@@auth0spajs@@"),this.prefix=n,this.client_id=t.client_id,this.scope=t.scope,this.audience=t.audience}return e.prototype.toKey=function(){return"".concat(this.prefix,"::").concat(this.client_id,"::").concat(this.audience,"::").concat(this.scope)},e.fromKey=function(t){var n=sr(t.split("::"),4),r=n[0],i=n[1],o=n[2];return new e({client_id:i,scope:n[3],audience:o},r)},e.fromCacheEntry=function(t){return new e({scope:t.scope,audience:t.audience,client_id:t.client_id})},e}(),v_=function(){function e(){}return e.prototype.set=function(t,n){localStorage.setItem(t,JSON.stringify(n))},e.prototype.get=function(t){var n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}},e.prototype.remove=function(t){localStorage.removeItem(t)},e.prototype.allKeys=function(){return Object.keys(window.localStorage).filter(function(t){return t.startsWith("@@auth0spajs@@")})},e}(),w_=function(){var e;this.enclosedCache=(e={},{set:function(t,n){e[t]=n},get:function(t){var n=e[t];if(n)return n},remove:function(t){delete e[t]},allKeys:function(){return Object.keys(e)}})},__=function(){function e(t,n,r){this.cache=t,this.keyManifest=n,this.nowProvider=r,this.nowProvider=this.nowProvider||Ld}return e.prototype.get=function(t,n){var r;return n===void 0&&(n=0),$(this,void 0,void 0,function(){var i,o,s,a,c;return Y(this,function(u){switch(u.label){case 0:return[4,this.cache.get(t.toKey())];case 1:return(i=u.sent())?[3,4]:[4,this.getCacheKeys()];case 2:return(o=u.sent())?(s=this.matchExistingCacheKey(t,o))?[4,this.cache.get(s)]:[3,4]:[2];case 3:i=u.sent(),u.label=4;case 4:return i?[4,this.nowProvider()]:[2];case 5:return a=u.sent(),c=Math.floor(a/1e3),i.expiresAt-n<c?i.body.refresh_token?(i.body={refresh_token:i.body.refresh_token},[4,this.cache.set(t.toKey(),i)]):[3,7]:[3,10];case 6:return u.sent(),[2,i.body];case 7:return[4,this.cache.remove(t.toKey())];case 8:return u.sent(),[4,(r=this.keyManifest)===null||r===void 0?void 0:r.remove(t.toKey())];case 9:return u.sent(),[2];case 10:return[2,i.body]}})})},e.prototype.set=function(t){var n;return $(this,void 0,void 0,function(){var r,i;return Y(this,function(o){switch(o.label){case 0:return r=new fn({client_id:t.client_id,scope:t.scope,audience:t.audience}),[4,this.wrapCacheEntry(t)];case 1:return i=o.sent(),[4,this.cache.set(r.toKey(),i)];case 2:return o.sent(),[4,(n=this.keyManifest)===null||n===void 0?void 0:n.add(r.toKey())];case 3:return o.sent(),[2]}})})},e.prototype.clear=function(t){var n;return $(this,void 0,void 0,function(){var r,i=this;return Y(this,function(o){switch(o.label){case 0:return[4,this.getCacheKeys()];case 1:return(r=o.sent())?[4,r.filter(function(s){return!t||s.includes(t)}).reduce(function(s,a){return $(i,void 0,void 0,function(){return Y(this,function(c){switch(c.label){case 0:return[4,s];case 1:return c.sent(),[4,this.cache.remove(a)];case 2:return c.sent(),[2]}})})},Promise.resolve())]:[2];case 2:return o.sent(),[4,(n=this.keyManifest)===null||n===void 0?void 0:n.clear()];case 3:return o.sent(),[2]}})})},e.prototype.clearSync=function(t){var n=this,r=this.cache.allKeys();r&&r.filter(function(i){return!t||i.includes(t)}).forEach(function(i){n.cache.remove(i)})},e.prototype.wrapCacheEntry=function(t){return $(this,void 0,void 0,function(){var n,r,i;return Y(this,function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return n=o.sent(),r=Math.floor(n/1e3)+t.expires_in,i=Math.min(r,t.decodedToken.claims.exp),[2,{body:t,expiresAt:i}]}})})},e.prototype.getCacheKeys=function(){var t;return $(this,void 0,void 0,function(){var n;return Y(this,function(r){switch(r.label){case 0:return this.keyManifest?[4,this.keyManifest.get()]:[3,2];case 1:return n=(t=r.sent())===null||t===void 0?void 0:t.keys,[3,4];case 2:return[4,this.cache.allKeys()];case 3:n=r.sent(),r.label=4;case 4:return[2,n]}})})},e.prototype.matchExistingCacheKey=function(t,n){return n.filter(function(r){var i=fn.fromKey(r),o=new Set(i.scope&&i.scope.split(" ")),s=t.scope.split(" "),a=i.scope&&s.reduce(function(c,u){return c&&o.has(u)},!0);return i.prefix==="@@auth0spajs@@"&&i.client_id===t.client_id&&i.audience===t.audience&&a})[0]},e}(),S_=function(){function e(t,n){this.storage=t,this.clientId=n,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId),this.transaction=this.storage.get(this.storageKey)}return e.prototype.create=function(t){this.transaction=t,this.storage.save(this.storageKey,t,{daysUntilExpire:1})},e.prototype.get=function(){return this.transaction},e.prototype.remove=function(){delete this.transaction,this.storage.remove(this.storageKey)},e}(),Tr=function(e){return typeof e=="number"},I_=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],T_=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(a){var c=a.split("."),u=sr(c,3),l=u[0],f=u[1],p=u[2];if(c.length!==3||!l||!f||!p)throw new Error("ID token could not be decoded");var h=JSON.parse(pl(f)),m={__raw:a},_={};return Object.keys(h).forEach(function(b){m[b]=h[b],I_.includes(b)||(_[b]=h[b])}),{encoded:{header:l,payload:f,signature:p},header:JSON.parse(pl(l)),claims:m,user:_}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Tr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!Tr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Tr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=e.leeway||60,r=new Date(e.now||Date.now()),i=new Date(0),o=new Date(0),s=new Date(0);if(s.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),i.setUTCSeconds(t.claims.exp+n),o.setUTCSeconds(t.claims.nbf-n),r>i)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(r,") is after expiration time (").concat(i,")"));if(Tr(t.claims.nbf)&&r<o)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time (".concat(r,") is before ").concat(o));if(Tr(t.claims.auth_time)&&r>s)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (".concat(r,") is after last auth at ").concat(s));if(e.organizationId){if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e.organizationId!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(e.organizationId,'", found "').concat(t.claims.org_id,'"'))}return t},dn=dr(function(e,t){var n=he&&he.__assign||function(){return n=Object.assign||function(c){for(var u,l=1,f=arguments.length;l<f;l++)for(var p in u=arguments[l])Object.prototype.hasOwnProperty.call(u,p)&&(c[p]=u[p]);return c},n.apply(this,arguments)};function r(c,u){if(!u)return"";var l="; "+c;return u===!0?l:l+"="+u}function i(c,u,l){return encodeURIComponent(c).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(u).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(f){if(typeof f.expires=="number"){var p=new Date;p.setMilliseconds(p.getMilliseconds()+864e5*f.expires),f.expires=p}return r("Expires",f.expires?f.expires.toUTCString():"")+r("Domain",f.domain)+r("Path",f.path)+r("Secure",f.secure)+r("SameSite",f.sameSite)}(l)}function o(c){for(var u={},l=c?c.split("; "):[],f=/(%[\dA-F]{2})+/gi,p=0;p<l.length;p++){var h=l[p].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{u[h[0].replace(f,decodeURIComponent)]=m.replace(f,decodeURIComponent)}catch{}}return u}function s(){return o(document.cookie)}function a(c,u,l){document.cookie=i(c,u,n({path:"/"},l))}t.__esModule=!0,t.encode=i,t.parse=o,t.getAll=s,t.get=function(c){return s()[c]},t.set=a,t.remove=function(c,u){a(c,"",n(n({},u),{expires:-1}))}});dc(dn),dn.encode,dn.parse,dn.getAll;var A_=dn.get,kd=dn.set,Ed=dn.remove,Rn={get:function(e){var t=A_(e);if(t!==void 0)return JSON.parse(t)},save:function(e,t,n){var r={};window.location.protocol==="https:"&&(r={secure:!0,sameSite:"none"}),n!=null&&n.daysUntilExpire&&(r.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(r.domain=n.cookieDomain),kd(e,JSON.stringify(t),r)},remove:function(e,t){var n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Ed(e,n)}},B_={get:function(e){var t=Rn.get(e);return t||Rn.get("".concat("_legacy_").concat(e))},save:function(e,t,n){var r={};window.location.protocol==="https:"&&(r={secure:!0}),n!=null&&n.daysUntilExpire&&(r.expires=n.daysUntilExpire),kd("".concat("_legacy_").concat(e),JSON.stringify(t),r),Rn.save(e,t,n)},remove:function(e,t){var n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Ed(e,n),Rn.remove(e,t),Rn.remove("".concat("_legacy_").concat(e),t)}},O_={get:function(e){if(typeof sessionStorage<"u"){var t=sessionStorage.getItem(e);if(t!==void 0)return JSON.parse(t)}},save:function(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove:function(e){sessionStorage.removeItem(e)}};function F_(e,t,n){var r=t===void 0?null:t,i=function(c,u){var l=atob(c);if(u){for(var f=new Uint8Array(l.length),p=0,h=l.length;p<h;++p)f[p]=l.charCodeAt(p);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return l}(e,n!==void 0&&n),o=i.indexOf(`
`,10)+1,s=i.substring(o)+(r?"//# sourceMappingURL="+r:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var bl,ml,gl,Fo,x_=(bl=" ",ml=null,gl=!1,function(e){return Fo=Fo||F_(bl,ml,gl),new Worker(Fo,e)}),xo={},L_=function(){function e(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}return e.prototype.add=function(t){var n;return $(this,void 0,void 0,function(){var r,i;return Y(this,function(o){switch(o.label){case 0:return i=Set.bind,[4,this.cache.get(this.manifestKey)];case 1:return(r=new(i.apply(Set,[void 0,((n=o.sent())===null||n===void 0?void 0:n.keys)||[]]))).add(t),[4,this.cache.set(this.manifestKey,{keys:$o([],sr(r),!1)})];case 2:return o.sent(),[2]}})})},e.prototype.remove=function(t){return $(this,void 0,void 0,function(){var n,r;return Y(this,function(i){switch(i.label){case 0:return[4,this.cache.get(this.manifestKey)];case 1:return(n=i.sent())?((r=new Set(n.keys)).delete(t),r.size>0?[4,this.cache.set(this.manifestKey,{keys:$o([],sr(r),!1)})]:[3,3]):[3,5];case 2:case 4:return[2,i.sent()];case 3:return[4,this.cache.remove(this.manifestKey)];case 5:return[2]}})})},e.prototype.get=function(){return this.cache.get(this.manifestKey)},e.prototype.clear=function(){return this.cache.remove(this.manifestKey)},e.prototype.createManifestKeyFrom=function(t){return"".concat("@@auth0spajs@@","::").concat(t)},e}(),Lo=new i_,D_={memory:function(){return new w_().enclosedCache},localstorage:function(){return new v_}},vl=function(e){return D_[e]},k_=function(){return!/Trident.*rv:11\.0/.test(navigator.userAgent)},E_=function(){function e(t){var n,r,i,o,s=this;if(this.options=t,this._releaseLockOnPageHide=function(){return $(s,void 0,void 0,function(){return Y(this,function(u){switch(u.label){case 0:return[4,Lo.releaseLock("auth0.lock.getTokenSilently")];case 1:return u.sent(),window.removeEventListener("pagehide",this._releaseLockOnPageHide),[2]}})})},typeof window<"u"&&function(){if(!Dc())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Dd()===void 0)throw new Error(`
      auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
    `)}(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)i=t.cache;else{if(this.cacheLocation=t.cacheLocation||"memory",!vl(this.cacheLocation))throw new Error('Invalid cache location "'.concat(this.cacheLocation,'"'));i=vl(this.cacheLocation)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Rn:B_,this.orgHintCookieName=(o=this.options.client_id,"auth0.".concat(o,".organization_hint")),this.isAuthenticatedCookieName=function(u){return"auth0.".concat(u,".is.authenticated")}(this.options.client_id),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;var a,c=t.useCookiesForTransactions?this.cookieStorage:O_;this.scope=this.options.scope,this.transactionManager=new S_(c,this.options.client_id),this.nowProvider=this.options.nowProvider||Ld,this.cacheManager=new __(i,i.allKeys?null:new L_(i,this.options.client_id),this.nowProvider),this.domainUrl=(a=this.options.domain,/^https?:\/\//.test(a)?a:"https://".concat(a)),this.tokenIssuer=function(u,l){return u?u.startsWith("https://")?u:"https://".concat(u,"/"):"".concat(l,"/")}(this.options.issuer,this.domainUrl),this.defaultScope=Pe("openid",((r=(n=this.options)===null||n===void 0?void 0:n.advancedOptions)===null||r===void 0?void 0:r.defaultScope)!==void 0?this.options.advancedOptions.defaultScope:"openid profile email"),this.options.useRefreshTokens&&(this.scope=Pe(this.scope,"offline_access")),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&this.cacheLocation==="memory"&&k_()&&(this.worker=new x_),this.customOptions=function(u){return u.advancedOptions,u.audience,u.auth0Client,u.authorizeTimeoutInSeconds,u.cacheLocation,u.cache,u.client_id,u.domain,u.issuer,u.leeway,u.max_age,u.nowProvider,u.redirect_uri,u.scope,u.useRefreshTokens,u.useRefreshTokensFallback,u.useCookiesForTransactions,u.useFormData,Bt(u,["advancedOptions","audience","auth0Client","authorizeTimeoutInSeconds","cacheLocation","cache","client_id","domain","issuer","leeway","max_age","nowProvider","redirect_uri","scope","useRefreshTokens","useRefreshTokensFallback","useCookiesForTransactions","useFormData"])}(t),this.useRefreshTokensFallback=this.options.useRefreshTokensFallback!==!1}return e.prototype._url=function(t){var n=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||xd)));return"".concat(this.domainUrl).concat(t,"&auth0Client=").concat(n)},e.prototype._getParams=function(t,n,r,i,o){var s=this.options;s.useRefreshTokens,s.useCookiesForTransactions,s.useFormData,s.auth0Client,s.cacheLocation,s.advancedOptions,s.detailedResponse,s.nowProvider,s.authorizeTimeoutInSeconds,s.legacySameSiteCookie,s.sessionCheckExpiryDays,s.domain,s.leeway,s.httpTimeoutInSeconds;var a=Bt(s,["useRefreshTokens","useCookiesForTransactions","useFormData","auth0Client","cacheLocation","advancedOptions","detailedResponse","nowProvider","authorizeTimeoutInSeconds","legacySameSiteCookie","sessionCheckExpiryDays","domain","leeway","httpTimeoutInSeconds"]);return M(M(M({},a),t),{scope:Pe(this.defaultScope,this.scope,t.scope),response_type:"code",response_mode:"query",state:n,nonce:r,redirect_uri:o||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(t){return this._url("/authorize?".concat(ua(t)))},e.prototype._verifyIdToken=function(t,n,r){return $(this,void 0,void 0,function(){var i;return Y(this,function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return i=o.sent(),[2,T_({iss:this.tokenIssuer,aud:this.options.client_id,id_token:t,nonce:n,organizationId:r,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age),now:i})]}})})},e.prototype._parseNumber=function(t){return typeof t!="string"?t:parseInt(t,10)||void 0},e.prototype._processOrgIdHint=function(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})},e.prototype.buildAuthorizeUrl=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,i,o,s,a,c,u,l,f,p,h;return Y(this,function(m){switch(m.label){case 0:return n=t.redirect_uri,r=t.appState,i=Bt(t,["redirect_uri","appState"]),o=Mn(_e()),s=Mn(_e()),a=_e(),[4,Bo(a)];case 1:return c=m.sent(),u=Oo(c),l=t.fragment?"#".concat(t.fragment):"",f=this._getParams(i,o,s,u,n),p=this._authorizeUrl(f),h=t.organization||this.options.organization,this.transactionManager.create(M({nonce:s,code_verifier:a,appState:r,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:o},h&&{organizationId:h})),[2,p+l]}})})},e.prototype.loginWithPopup=function(t,n){return $(this,void 0,void 0,function(){var r,i,o,s,a,c,u,l,f,p,h,m,_;return Y(this,function(b){switch(b.label){case 0:if(t=t||{},!(n=n||{}).popup&&(n.popup=function(v){var g=window.screenX+(window.innerWidth-400)/2,S=window.screenY+(window.innerHeight-600)/2;return window.open(v,"auth0:authorize:popup","left=".concat(g,",top=").concat(S,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))}(""),!n.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");return r=Bt(t,[]),i=Mn(_e()),o=Mn(_e()),s=_e(),[4,Bo(s)];case 1:return a=b.sent(),c=Oo(a),u=this._getParams(r,i,o,c,this.options.redirect_uri||window.location.origin),l=this._authorizeUrl(M(M({},u),{response_mode:"web_message"})),n.popup.location.href=l,[4,h_(M(M({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(f=b.sent(),i!==f.state)throw new Error("Invalid state");return[4,Oi({audience:u.audience,scope:u.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:s,code:f.code,grant_type:"authorization_code",redirect_uri:u.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},this.worker)];case 3:return p=b.sent(),h=t.organization||this.options.organization,[4,this._verifyIdToken(p.id_token,o,h)];case 4:return m=b.sent(),_=M(M({},p),{decodedToken:m,scope:u.scope,audience:u.audience||"default",client_id:this.options.client_id}),[4,this.cacheManager.set(_)];case 5:return b.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(m.claims.org_id),[2]}})})},e.prototype.getUser=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,i;return Y(this,function(o){switch(o.label){case 0:return n=t.audience||this.options.audience||"default",r=Pe(this.defaultScope,this.scope,t.scope),[4,this.cacheManager.get(new fn({client_id:this.options.client_id,audience:n,scope:r}))];case 1:return[2,(i=o.sent())&&i.decodedToken&&i.decodedToken.user]}})})},e.prototype.getIdTokenClaims=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,i;return Y(this,function(o){switch(o.label){case 0:return n=t.audience||this.options.audience||"default",r=Pe(this.defaultScope,this.scope,t.scope),[4,this.cacheManager.get(new fn({client_id:this.options.client_id,audience:n,scope:r}))];case 1:return[2,(i=o.sent())&&i.decodedToken&&i.decodedToken.claims]}})})},e.prototype.loginWithRedirect=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,i;return Y(this,function(o){switch(o.label){case 0:return n=t.redirectMethod,r=Bt(t,["redirectMethod"]),[4,this.buildAuthorizeUrl(r)];case 1:return i=o.sent(),window.location[n||"assign"](i),[2]}})})},e.prototype.handleRedirectCallback=function(t){return t===void 0&&(t=window.location.href),$(this,void 0,void 0,function(){var n,r,i,o,s,a,c,u,l,f;return Y(this,function(p){switch(p.label){case 0:if((n=t.split("?").slice(1)).length===0)throw new Error("There are no query params available for parsing.");if(r=function(h){h.indexOf("#")>-1&&(h=h.substr(0,h.indexOf("#")));var m=h.split("&"),_={};return m.forEach(function(b){var v=sr(b.split("="),2),g=v[0],S=v[1];_[g]=decodeURIComponent(S)}),_.expires_in&&(_.expires_in=parseInt(_.expires_in)),_}(n.join("")),i=r.state,o=r.code,s=r.error,a=r.error_description,!(c=this.transactionManager.get()))throw new Error("Invalid state");if(this.transactionManager.remove(),s)throw new a_(s,a,i,c.appState);if(!c.code_verifier||c.state&&c.state!==i)throw new Error("Invalid state");return u={audience:c.audience,scope:c.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:c.code_verifier,grant_type:"authorization_code",code:o,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},c.redirect_uri!==void 0&&(u.redirect_uri=c.redirect_uri),[4,Oi(u,this.worker)];case 1:return l=p.sent(),[4,this._verifyIdToken(l.id_token,c.nonce,c.organizationId)];case 2:return f=p.sent(),[4,this.cacheManager.set(M(M(M(M({},l),{decodedToken:f,audience:c.audience,scope:c.scope}),l.scope?{oauthTokenScope:l.scope}:null),{client_id:this.options.client_id}))];case 3:return p.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(f.claims.org_id),[2,{appState:c.appState}]}})})},e.prototype.checkSession=function(t){return $(this,void 0,void 0,function(){var n;return Y(this,function(r){switch(r.label){case 0:if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return[2];this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.getTokenSilently(t)];case 2:return r.sent(),[3,4];case 3:if(n=r.sent(),!o_.includes(n.error))throw n;return[3,4];case 4:return[2]}})})},e.prototype.getTokenSilently=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,i,o,s=this;return Y(this,function(a){switch(a.label){case 0:return n=M(M({audience:this.options.audience,ignoreCache:!1},t),{scope:Pe(this.defaultScope,this.scope,t.scope)}),r=n.ignoreCache,i=Bt(n,["ignoreCache"]),[4,(c=function(){return s._getTokenSilently(M({ignoreCache:r},i))},u="".concat(this.options.client_id,"::").concat(i.audience,"::").concat(i.scope),l=xo[u],l||(l=c().finally(function(){delete xo[u],l=null}),xo[u]=l),l)];case 1:return o=a.sent(),[2,t.detailedResponse?o:o.access_token]}var c,u,l})})},e.prototype._getTokenSilently=function(t){return t===void 0&&(t={}),$(this,void 0,void 0,function(){var n,r,i,o,s,a,c,u,l;return Y(this,function(f){switch(f.label){case 0:return n=t.ignoreCache,r=Bt(t,["ignoreCache"]),n?[3,2]:[4,this._getEntryFromCache({scope:r.scope,audience:r.audience||"default",client_id:this.options.client_id})];case 1:if(i=f.sent())return[2,i];f.label=2;case 2:return[4,(p=function(){return Lo.acquireLock("auth0.lock.getTokenSilently",5e3)},h=10,h===void 0&&(h=3),$(void 0,void 0,void 0,function(){var m;return Y(this,function(_){switch(_.label){case 0:m=0,_.label=1;case 1:return m<h?[4,p()]:[3,4];case 2:if(_.sent())return[2,!0];_.label=3;case 3:return m++,[3,1];case 4:return[2,!1]}})}))];case 3:if(!f.sent())return[3,15];f.label=4;case 4:return f.trys.push([4,,12,14]),window.addEventListener("pagehide",this._releaseLockOnPageHide),n?[3,6]:[4,this._getEntryFromCache({scope:r.scope,audience:r.audience||"default",client_id:this.options.client_id})];case 5:if(i=f.sent())return[2,i];f.label=6;case 6:return this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(r)]:[3,8];case 7:return s=f.sent(),[3,10];case 8:return[4,this._getTokenFromIFrame(r)];case 9:s=f.sent(),f.label=10;case 10:return o=s,[4,this.cacheManager.set(M({client_id:this.options.client_id},o))];case 11:return f.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),a=o.id_token,c=o.access_token,u=o.oauthTokenScope,l=o.expires_in,[2,M(M({id_token:a,access_token:c},u?{scope:u}:null),{expires_in:l})];case 12:return[4,Lo.releaseLock("auth0.lock.getTokenSilently")];case 13:return f.sent(),window.removeEventListener("pagehide",this._releaseLockOnPageHide),[7];case 14:return[3,16];case 15:throw new ca;case 16:return[2]}var p,h})})},e.prototype.getTokenWithPopup=function(t,n){return t===void 0&&(t={}),n===void 0&&(n={}),$(this,void 0,void 0,function(){return Y(this,function(r){switch(r.label){case 0:return t.audience=t.audience||this.options.audience,t.scope=Pe(this.defaultScope,this.scope,t.scope),n=M(M({},s_),n),[4,this.loginWithPopup(t,n)];case 1:return r.sent(),[4,this.cacheManager.get(new fn({scope:t.scope,audience:t.audience||"default",client_id:this.options.client_id}))];case 2:return[2,r.sent().access_token]}})})},e.prototype.isAuthenticated=function(){return $(this,void 0,void 0,function(){return Y(this,function(t){switch(t.label){case 0:return[4,this.getUser()];case 1:return[2,!!t.sent()]}})})},e.prototype.buildLogoutUrl=function(t){t===void 0&&(t={}),t.client_id!==null?t.client_id=t.client_id||this.options.client_id:delete t.client_id;var n=t.federated,r=Bt(t,["federated"]),i=n?"&federated":"";return this._url("/v2/logout?".concat(ua(r)))+i},e.prototype.logout=function(t){var n=this;t===void 0&&(t={});var r=t.localOnly,i=Bt(t,["localOnly"]);if(r&&i.federated)throw new Error("It is invalid to set both the `federated` and `localOnly` options to `true`");var o=function(){if(n.cookieStorage.remove(n.orgHintCookieName,{cookieDomain:n.options.cookieDomain}),n.cookieStorage.remove(n.isAuthenticatedCookieName,{cookieDomain:n.options.cookieDomain}),!r){var s=n.buildLogoutUrl(i);window.location.assign(s)}};if(this.options.cache)return this.cacheManager.clear().then(function(){return o()});this.cacheManager.clearSync(),o()},e.prototype._getTokenFromIFrame=function(t){return $(this,void 0,void 0,function(){var n,r,i,o,s,a,c,u,l,f,p,h,m,_,b,v,g;return Y(this,function(S){switch(S.label){case 0:return n=Mn(_e()),r=Mn(_e()),i=_e(),[4,Bo(i)];case 1:o=S.sent(),s=Oo(o),a=Bt(t,["detailedResponse"]),c=this._getParams(a,n,r,s,t.redirect_uri||this.options.redirect_uri||window.location.origin),(u=this.cookieStorage.get(this.orgHintCookieName))&&!c.organization&&(c.organization=u),l=this._authorizeUrl(M(M({},c),{prompt:"none",response_mode:"web_message"})),S.label=2;case 2:if(S.trys.push([2,6,,7]),window.crossOriginIsolated)throw new Ee("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");return f=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,(tt=l,Z=this.domainUrl,pt=f,pt===void 0&&(pt=60),new Promise(function(jt,we){var sn=window.document.createElement("iframe");sn.setAttribute("width","0"),sn.setAttribute("height","0"),sn.style.display="none";var di,Ec=function(){window.document.body.contains(sn)&&(window.document.body.removeChild(sn),window.removeEventListener("message",di,!1))},Ud=setTimeout(function(){we(new ca),Ec()},1e3*pt);di=function(on){if(on.origin==Z&&on.data&&on.data.type==="authorization_response"){var Uc=on.source;Uc&&Uc.close(),on.data.response.error?we(Ee.fromPayload(on.data.response)):jt(on.data.response),clearTimeout(Ud),window.removeEventListener("message",di,!1),setTimeout(Ec,2e3)}},window.addEventListener("message",di,!1),window.document.body.appendChild(sn),sn.setAttribute("src",tt)}))];case 3:if(p=S.sent(),n!==p.state)throw new Error("Invalid state");return h=t.scope,m=t.audience,_=Bt(t,["scope","audience","redirect_uri","ignoreCache","timeoutInSeconds","detailedResponse"]),[4,Oi(M(M(M({},this.customOptions),_),{scope:h,audience:m,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:i,code:p.code,grant_type:"authorization_code",redirect_uri:c.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:_.timeout||this.httpTimeoutMs}),this.worker)];case 4:return b=S.sent(),[4,this._verifyIdToken(b.id_token,r)];case 5:return v=S.sent(),this._processOrgIdHint(v.claims.org_id),[2,M(M({},b),{decodedToken:v,scope:c.scope,oauthTokenScope:b.scope,audience:c.audience||"default"})];case 6:throw(g=S.sent()).error==="login_required"&&this.logout({localOnly:!0}),g;case 7:return[2]}var tt,Z,pt})})},e.prototype._getTokenUsingRefreshToken=function(t){return $(this,void 0,void 0,function(){var n,r,i,o,s,a,c,u,l;return Y(this,function(f){switch(f.label){case 0:return t.scope=Pe(this.defaultScope,this.options.scope,t.scope),[4,this.cacheManager.get(new fn({scope:t.scope,audience:t.audience||"default",client_id:this.options.client_id}))];case 1:return(n=f.sent())&&n.refresh_token||this.worker?[3,4]:this.useRefreshTokensFallback?[4,this._getTokenFromIFrame(t)]:[3,3];case 2:return[2,f.sent()];case 3:throw new f_(t.audience||"default",t.scope);case 4:r=t.redirect_uri||this.options.redirect_uri||window.location.origin,o=t.scope,s=t.audience,a=Bt(t,["scope","audience","ignoreCache","timeoutInSeconds","detailedResponse"]),c=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null,f.label=5;case 5:return f.trys.push([5,7,,10]),[4,Oi(M(M(M(M(M({},this.customOptions),a),{audience:s,scope:o,baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:r}),c&&{timeout:c}),{auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs}),this.worker)];case 6:return i=f.sent(),[3,10];case 7:return((u=f.sent()).message.indexOf("Missing Refresh Token")>-1||u.message&&u.message.indexOf("invalid refresh token")>-1)&&this.useRefreshTokensFallback?[4,this._getTokenFromIFrame(t)]:[3,9];case 8:return[2,f.sent()];case 9:throw u;case 10:return[4,this._verifyIdToken(i.id_token)];case 11:return l=f.sent(),[2,M(M({},i),{decodedToken:l,scope:t.scope,oauthTokenScope:i.scope,audience:t.audience||"default"})]}})})},e.prototype._getEntryFromCache=function(t){var n=t.scope,r=t.audience,i=t.client_id;return $(this,void 0,void 0,function(){var o,s,a,c,u;return Y(this,function(l){switch(l.label){case 0:return[4,this.cacheManager.get(new fn({scope:n,audience:r,client_id:i}),60)];case 1:return(o=l.sent())&&o.access_token?(s=o.id_token,a=o.access_token,c=o.oauthTokenScope,u=o.expires_in,[2,M(M({id_token:s,access_token:a},c?{scope:c}:null),{expires_in:u})]):[2]}})})},e}();function U_(e){return $(this,void 0,void 0,function(){var t;return Y(this,function(n){switch(n.label){case 0:return[4,(t=new E_(e)).checkSession()];case 1:return n.sent(),[2,t]}})})}const kc=document.body.appendChild(document.createElement("div")),ft=kc.appendChild(document.createElement("button"));ft.className="log";ft.textContent="Login";kc.style="display: flex; flex-direction: column; color: rgb(104, 85, 224); font-weight: 600; margin: 0; padding: 10px";const wl=kc.appendChild(document.createTextNode(""));let Ys,Gs,bn,Ae,Wt;const Ks=()=>{if(window.parent!==window){const e=new URL(document.location.href),t=e.origin,n=decodeURIComponent(e.pathname);return t+n}else return window.location.origin},Zs=async()=>{Wt||(Wt=await U_({domain:Gs,client_id:Ys,redirect_uri:Ks(),audience:bn,useRefreshTokens:!0,cacheLocation:"localstorage"}))},Hs=async()=>{await Zs(),Wt.logout({returnTo:Ks()}),re.setComponentValue(null),ft.textContent="Login",ft.removeEventListener("click",Hs),ft.addEventListener("click",lr)},lr=async()=>{Ae&&console.log(`Starting session
Configuration:
  Client Id:`+Ys+`
  Domain:`,Gs+`
  Audience:`,bn+`
  Callback urls set to: `,Ks()+`
`),ft.textContent="working...",await Zs();try{await Wt.loginWithPopup(),wl.textContent=""}catch(r){console.log(r),wl.textContent="Popup blocked, please try again or enable popups"+String.fromCharCode(160);return}const e=await Wt.getUser();Ae&&console.log("user:",e);let t=!1;try{t=await Wt.getTokenSilently({audience:bn,scope:"read:current_user"})}catch(r){if(r.error==="consent_required"||r.error==="login_required")Ae&&console.log("asking user for permission to their profile"),t=await Wt.getTokenWithPopup({audience:bn,scope:"read:current_user"}),Ae&&console.log("token:",t);else{console.error(r),re.setComponentValue(null),ft.textContent="Login";return}}let n=JSON.parse(JSON.stringify(e));n.token=t,Ae&&console.log("user:",n),re.setComponentValue(n),ft.textContent="Logout",ft.removeEventListener("click",lr),ft.addEventListener("click",Hs)},M_=async()=>{Ae&&console.log(`Resuming session
Configuration:
  Client Id:`+Ys+`
  Domain:`,Gs+`
  Audience:`,bn+`
  Callback urls set to: `,Ks()+`
`),ft.textContent="working...",await Zs();const e=await Wt.getUser()||{};Ae&&console.log("user",e);let t=!1;try{t=await Wt.getTokenSilently({audience:bn,scope:"read:current_user"})}catch(r){console.error(r),re.setComponentValue(null),ft.textContent="Login";return}let n=JSON.parse(JSON.stringify(e));n.token=t,Ae&&console.log("user:",n),re.setComponentValue(n),ft.textContent="Logout",ft.removeEventListener("click",lr),ft.addEventListener("click",Hs)};ft.addEventListener("click",lr);async function N_(e){const t=e.detail;Ys=t.args.client_id,Gs=t.args.domain,bn=t.args.audience,Ae=t.args.debug_logs,Wt?await Wt.isAuthenticated()||(ft.removeEventListener("click",lr),ft.removeEventListener("click",Hs),ft.textContent="Login",ft.addEventListener("click",lr)):(await Zs(),await Wt.isAuthenticated()&&await M_()),re.setFrameHeight()}re.events.addEventListener(re.RENDER_EVENT,N_);re.setComponentReady();
