(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function e(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(a){if(a.ep)return;a.ep=!0;const c=e(a);fetch(a.href,c)}})();var Ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Nh={exports:{}},pt={};/** @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 Ut=typeof Symbol=="function"&&Symbol.for,Yu=Ut?Symbol.for("react.element"):60103,Gu=Ut?Symbol.for("react.portal"):60106,Po=Ut?Symbol.for("react.fragment"):60107,zo=Ut?Symbol.for("react.strict_mode"):60108,$o=Ut?Symbol.for("react.profiler"):60114,Vo=Ut?Symbol.for("react.provider"):60109,Wo=Ut?Symbol.for("react.context"):60110,Ku=Ut?Symbol.for("react.async_mode"):60111,ko=Ut?Symbol.for("react.concurrent_mode"):60111,jo=Ut?Symbol.for("react.forward_ref"):60112,Ho=Ut?Symbol.for("react.suspense"):60113,Rw=Ut?Symbol.for("react.suspense_list"):60120,Yo=Ut?Symbol.for("react.memo"):60115,Go=Ut?Symbol.for("react.lazy"):60116,Nw=Ut?Symbol.for("react.block"):60121,Ew=Ut?Symbol.for("react.fundamental"):60117,Cw=Ut?Symbol.for("react.responder"):60118,Uw=Ut?Symbol.for("react.scope"):60119;function ve(r){if(typeof r=="object"&&r!==null){var t=r.$$typeof;switch(t){case Yu:switch(r=r.type,r){case Ku:case ko:case Po:case $o:case zo:case Ho:return r;default:switch(r=r&&r.$$typeof,r){case Wo:case jo:case Go:case Yo:case Vo:return r;default:return t}}case Gu:return t}}}function Eh(r){return ve(r)===ko}pt.AsyncMode=Ku;pt.ConcurrentMode=ko;pt.ContextConsumer=Wo;pt.ContextProvider=Vo;pt.Element=Yu;pt.ForwardRef=jo;pt.Fragment=Po;pt.Lazy=Go;pt.Memo=Yo;pt.Portal=Gu;pt.Profiler=$o;pt.StrictMode=zo;pt.Suspense=Ho;pt.isAsyncMode=function(r){return Eh(r)||ve(r)===Ku};pt.isConcurrentMode=Eh;pt.isContextConsumer=function(r){return ve(r)===Wo};pt.isContextProvider=function(r){return ve(r)===Vo};pt.isElement=function(r){return typeof r=="object"&&r!==null&&r.$$typeof===Yu};pt.isForwardRef=function(r){return ve(r)===jo};pt.isFragment=function(r){return ve(r)===Po};pt.isLazy=function(r){return ve(r)===Go};pt.isMemo=function(r){return ve(r)===Yo};pt.isPortal=function(r){return ve(r)===Gu};pt.isProfiler=function(r){return ve(r)===$o};pt.isStrictMode=function(r){return ve(r)===zo};pt.isSuspense=function(r){return ve(r)===Ho};pt.isValidElementType=function(r){return typeof r=="string"||typeof r=="function"||r===Po||r===ko||r===$o||r===zo||r===Ho||r===Rw||typeof r=="object"&&r!==null&&(r.$$typeof===Go||r.$$typeof===Yo||r.$$typeof===Vo||r.$$typeof===Wo||r.$$typeof===jo||r.$$typeof===Ew||r.$$typeof===Cw||r.$$typeof===Uw||r.$$typeof===Nw)};pt.typeOf=ve;Nh.exports=pt;var Pw=Nh.exports,Ch=Pw,zw={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},$w={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Uh={};Uh[Ch.ForwardRef]=zw;Uh[Ch.Memo]=$w;var Ph={exports:{}},yt={};/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var uh=Object.getOwnPropertySymbols,Vw=Object.prototype.hasOwnProperty,Ww=Object.prototype.propertyIsEnumerable;function kw(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function jw(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var s=Object.getOwnPropertyNames(t).map(function(c){return t[c]});if(s.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(c){a[c]=c}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Hw=jw()?Object.assign:function(r,t){for(var e,s=kw(r),a,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var l in e)Vw.call(e,l)&&(s[l]=e[l]);if(uh){a=uh(e);for(var d=0;d<a.length;d++)Ww.call(e,a[d])&&(s[a[d]]=e[a[d]])}}return s};/** @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 Ju=Hw,We=typeof Symbol=="function"&&Symbol.for,Gi=We?Symbol.for("react.element"):60103,Yw=We?Symbol.for("react.portal"):60106,Gw=We?Symbol.for("react.fragment"):60107,Kw=We?Symbol.for("react.strict_mode"):60108,Jw=We?Symbol.for("react.profiler"):60114,qw=We?Symbol.for("react.provider"):60109,Zw=We?Symbol.for("react.context"):60110,Xw=We?Symbol.for("react.forward_ref"):60112,Qw=We?Symbol.for("react.suspense"):60113,t1=We?Symbol.for("react.memo"):60115,e1=We?Symbol.for("react.lazy"):60116,ch=typeof Symbol=="function"&&Symbol.iterator;function Ki(r){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+r,e=1;e<arguments.length;e++)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified React error #"+r+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var zh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$h={};function ai(r,t,e){this.props=r,this.context=t,this.refs=$h,this.updater=e||zh}ai.prototype.isReactComponent={};ai.prototype.setState=function(r,t){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error(Ki(85));this.updater.enqueueSetState(this,r,t,"setState")};ai.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function Vh(){}Vh.prototype=ai.prototype;function qu(r,t,e){this.props=r,this.context=t,this.refs=$h,this.updater=e||zh}var Zu=qu.prototype=new Vh;Zu.constructor=qu;Ju(Zu,ai.prototype);Zu.isPureReactComponent=!0;var Xu={current:null},Wh=Object.prototype.hasOwnProperty,kh={key:!0,ref:!0,__self:!0,__source:!0};function jh(r,t,e){var s,a={},c=null,l=null;if(t!=null)for(s in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(c=""+t.key),t)Wh.call(t,s)&&!kh.hasOwnProperty(s)&&(a[s]=t[s]);var d=arguments.length-2;if(d===1)a.children=e;else if(1<d){for(var g=Array(d),w=0;w<d;w++)g[w]=arguments[w+2];a.children=g}if(r&&r.defaultProps)for(s in d=r.defaultProps,d)a[s]===void 0&&(a[s]=d[s]);return{$$typeof:Gi,type:r,key:c,ref:l,props:a,_owner:Xu.current}}function n1(r,t){return{$$typeof:Gi,type:r.type,key:t,ref:r.ref,props:r.props,_owner:r._owner}}function Qu(r){return typeof r=="object"&&r!==null&&r.$$typeof===Gi}function r1(r){var t={"=":"=0",":":"=2"};return"$"+(""+r).replace(/[=:]/g,function(e){return t[e]})}var Hh=/\/+/g,oo=[];function Yh(r,t,e,s){if(oo.length){var a=oo.pop();return a.result=r,a.keyPrefix=t,a.func=e,a.context=s,a.count=0,a}return{result:r,keyPrefix:t,func:e,context:s,count:0}}function Gh(r){r.result=null,r.keyPrefix=null,r.func=null,r.context=null,r.count=0,10>oo.length&&oo.push(r)}function xu(r,t,e,s){var a=typeof r;(a==="undefined"||a==="boolean")&&(r=null);var c=!1;if(r===null)c=!0;else switch(a){case"string":case"number":c=!0;break;case"object":switch(r.$$typeof){case Gi:case Yw:c=!0}}if(c)return e(s,r,t===""?"."+bu(r,0):t),1;if(c=0,t=t===""?".":t+":",Array.isArray(r))for(var l=0;l<r.length;l++){a=r[l];var d=t+bu(a,l);c+=xu(a,d,e,s)}else if(r===null||typeof r!="object"?d=null:(d=ch&&r[ch]||r["@@iterator"],d=typeof d=="function"?d:null),typeof d=="function")for(r=d.call(r),l=0;!(a=r.next()).done;)a=a.value,d=t+bu(a,l++),c+=xu(a,d,e,s);else if(a==="object")throw e=""+r,Error(Ki(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e,""));return c}function Tu(r,t,e){return r==null?0:xu(r,"",t,e)}function bu(r,t){return typeof r=="object"&&r!==null&&r.key!=null?r1(r.key):t.toString(36)}function i1(r,t){r.func.call(r.context,t,r.count++)}function s1(r,t,e){var s=r.result,a=r.keyPrefix;r=r.func.call(r.context,t,r.count++),Array.isArray(r)?Lu(r,s,e,function(c){return c}):r!=null&&(Qu(r)&&(r=n1(r,a+(!r.key||t&&t.key===r.key?"":(""+r.key).replace(Hh,"$&/")+"/")+e)),s.push(r))}function Lu(r,t,e,s,a){var c="";e!=null&&(c=(""+e).replace(Hh,"$&/")+"/"),t=Yh(t,c,s,a),Tu(r,s1,t),Gh(t)}var Kh={current:null};function Ln(){var r=Kh.current;if(r===null)throw Error(Ki(321));return r}var o1={ReactCurrentDispatcher:Kh,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:Xu,IsSomeRendererActing:{current:!1},assign:Ju};yt.Children={map:function(r,t,e){if(r==null)return r;var s=[];return Lu(r,s,null,t,e),s},forEach:function(r,t,e){if(r==null)return r;t=Yh(null,null,t,e),Tu(r,i1,t),Gh(t)},count:function(r){return Tu(r,function(){return null},null)},toArray:function(r){var t=[];return Lu(r,t,null,function(e){return e}),t},only:function(r){if(!Qu(r))throw Error(Ki(143));return r}};yt.Component=ai;yt.Fragment=Gw;yt.Profiler=Jw;yt.PureComponent=qu;yt.StrictMode=Kw;yt.Suspense=Qw;yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=o1;yt.cloneElement=function(r,t,e){if(r==null)throw Error(Ki(267,r));var s=Ju({},r.props),a=r.key,c=r.ref,l=r._owner;if(t!=null){if(t.ref!==void 0&&(c=t.ref,l=Xu.current),t.key!==void 0&&(a=""+t.key),r.type&&r.type.defaultProps)var d=r.type.defaultProps;for(g in t)Wh.call(t,g)&&!kh.hasOwnProperty(g)&&(s[g]=t[g]===void 0&&d!==void 0?d[g]:t[g])}var g=arguments.length-2;if(g===1)s.children=e;else if(1<g){d=Array(g);for(var w=0;w<g;w++)d[w]=arguments[w+2];s.children=d}return{$$typeof:Gi,type:r.type,key:a,ref:c,props:s,_owner:l}};yt.createContext=function(r,t){return t===void 0&&(t=null),r={$$typeof:Zw,_calculateChangedBits:t,_currentValue:r,_currentValue2:r,_threadCount:0,Provider:null,Consumer:null},r.Provider={$$typeof:qw,_context:r},r.Consumer=r};yt.createElement=jh;yt.createFactory=function(r){var t=jh.bind(null,r);return t.type=r,t};yt.createRef=function(){return{current:null}};yt.forwardRef=function(r){return{$$typeof:Xw,render:r}};yt.isValidElement=Qu;yt.lazy=function(r){return{$$typeof:e1,_ctor:r,_status:-1,_result:null}};yt.memo=function(r,t){return{$$typeof:t1,type:r,compare:t===void 0?null:t}};yt.useCallback=function(r,t){return Ln().useCallback(r,t)};yt.useContext=function(r,t){return Ln().useContext(r,t)};yt.useDebugValue=function(){};yt.useEffect=function(r,t){return Ln().useEffect(r,t)};yt.useImperativeHandle=function(r,t,e){return Ln().useImperativeHandle(r,t,e)};yt.useLayoutEffect=function(r,t){return Ln().useLayoutEffect(r,t)};yt.useMemo=function(r,t){return Ln().useMemo(r,t)};yt.useReducer=function(r,t,e){return Ln().useReducer(r,t,e)};yt.useRef=function(r){return Ln().useRef(r)};yt.useState=function(r){return Ln().useState(r)};yt.version="16.14.0";Ph.exports=yt;var a1=Ph.exports;const u1=Rh(a1);function C(r,t,e,s){function a(c){return c instanceof e?c:new e(function(l){l(c)})}return new(e||(e=Promise))(function(c,l){function d(O){try{w(s.next(O))}catch(D){l(D)}}function g(O){try{w(s.throw(O))}catch(D){l(D)}}function w(O){O.done?c(O.value):a(O.value).then(d,g)}w((s=s.apply(r,t||[])).next())})}function lh(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],s=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&s>=r.length&&(r=void 0),{value:r&&r[s++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(r){return this instanceof J?(this.v=r,this):new J(r)}function on(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=e.apply(r,t||[]),a,c=[];return a={},l("next"),l("throw"),l("return"),a[Symbol.asyncIterator]=function(){return this},a;function l(M){s[M]&&(a[M]=function(X){return new Promise(function(At,Nn){c.push([M,X,At,Nn])>1||d(M,X)})})}function d(M,X){try{g(s[M](X))}catch(At){D(c[0][3],At)}}function g(M){M.value instanceof J?Promise.resolve(M.value.v).then(w,O):D(c[0][2],M)}function w(M){d("next",M)}function O(M){d("throw",M)}function D(M,X){M(X),c.shift(),c.length&&d(c[0][0],c[0][1])}}function Qs(r){var t,e;return t={},s("next"),s("throw",function(a){throw a}),s("return"),t[Symbol.iterator]=function(){return this},t;function s(a,c){t[a]=r[a]?function(l){return(e=!e)?{value:J(r[a](l)),done:!1}:c?c(l):l}:c}}function wr(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof lh=="function"?lh(r):r[Symbol.iterator](),e={},s("next"),s("throw"),s("return"),e[Symbol.asyncIterator]=function(){return this},e);function s(c){e[c]=r[c]&&function(l){return new Promise(function(d,g){l=r[c](l),a(d,g,l.done,l.value)})}}function a(c,l,d,g){Promise.resolve(g).then(function(w){c({value:w,done:d})},l)}}const c1=new TextDecoder("utf-8"),Mu=r=>c1.decode(r),l1=new TextEncoder,tc=r=>l1.encode(r),[tA,f1]=(()=>{const r=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw r()}return t.asIntN=()=>{throw r()},t.asUintN=()=>{throw r()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[Ji,eA]=(()=>{const r=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[qi,nA]=(()=>{const r=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw r()}static from(){throw r()}constructor(){throw r()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),h1=r=>typeof r=="number",Jh=r=>typeof r=="boolean",Nt=r=>typeof r=="function",se=r=>r!=null&&Object(r)===r,Kn=r=>se(r)&&Nt(r.then),Zi=r=>se(r)&&Nt(r[Symbol.iterator]),ui=r=>se(r)&&Nt(r[Symbol.asyncIterator]),Ru=r=>se(r)&&se(r.schema),qh=r=>se(r)&&"done"in r&&"value"in r,Zh=r=>se(r)&&Nt(r.stat)&&h1(r.fd),Xh=r=>se(r)&&ec(r.body),Ko=r=>"_getDOMStream"in r&&"_getNodeStream"in r,d1=r=>se(r)&&Nt(r.abort)&&Nt(r.getWriter)&&!Ko(r),ec=r=>se(r)&&Nt(r.cancel)&&Nt(r.getReader)&&!Ko(r),p1=r=>se(r)&&Nt(r.end)&&Nt(r.write)&&Jh(r.writable)&&!Ko(r),Qh=r=>se(r)&&Nt(r.read)&&Nt(r.pipe)&&Jh(r.readable)&&!Ko(r),y1=r=>se(r)&&Nt(r.clear)&&Nt(r.bytes)&&Nt(r.position)&&Nt(r.setPosition)&&Nt(r.capacity)&&Nt(r.getBufferIdentifier)&&Nt(r.createLong),nc=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function g1(r){const t=r[0]?[r[0]]:[];let e,s,a,c;for(let l,d,g=0,w=0,O=r.length;++g<O;){if(l=t[w],d=r[g],!l||!d||l.buffer!==d.buffer||d.byteOffset<l.byteOffset){d&&(t[++w]=d);continue}if({byteOffset:e,byteLength:a}=l,{byteOffset:s,byteLength:c}=d,e+a<s||s+c<e){d&&(t[++w]=d);continue}t[w]=new Uint8Array(l.buffer,e,s-e+c)}return t}function fh(r,t,e=0,s=t.byteLength){const a=r.byteLength,c=new Uint8Array(r.buffer,r.byteOffset,a),l=new Uint8Array(t.buffer,t.byteOffset,Math.min(s,a));return c.set(l,e),r}function un(r,t){const e=g1(r),s=e.reduce((O,D)=>O+D.byteLength,0);let a,c,l,d=0,g=-1;const w=Math.min(t||Number.POSITIVE_INFINITY,s);for(const O=e.length;++g<O;){if(a=e[g],c=a.subarray(0,Math.min(a.length,w-d)),w<=d+c.length){c.length<a.length?e[g]=a.subarray(c.length):c.length===a.length&&g++,l?fh(l,c,d):l=c;break}fh(l||(l=new Uint8Array(w)),c,d),d+=c.length}return[l||new Uint8Array(0),e.slice(g),s-(l?l.byteLength:0)]}function _t(r,t){let e=qh(t)?t.value:t;return e instanceof r?r===Uint8Array?new r(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=tc(e)),e instanceof ArrayBuffer?new r(e):e instanceof nc?new r(e):y1(e)?_t(r,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new r(0):new r(e.buffer,e.byteOffset,e.byteLength/r.BYTES_PER_ELEMENT):r.from(e)):new r(0)}const Ni=r=>_t(Int32Array,r),ot=r=>_t(Uint8Array,r),Nu=r=>(r.next(),r);function*_1(r,t){const e=function*(a){yield a},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof nc?e(t):Zi(t)?t:e(t);return yield*Nu(function*(a){let c=null;do c=a.next(yield _t(r,c));while(!c.done)}(s[Symbol.iterator]())),new r}const m1=r=>_1(Uint8Array,r);function td(r,t){return on(this,arguments,function*(){if(Kn(t))return yield J(yield J(yield*Qs(wr(td(r,yield J(t))))));const s=function(l){return on(this,arguments,function*(){yield yield J(yield J(l))})},a=function(l){return on(this,arguments,function*(){yield J(yield*Qs(wr(Nu(function*(d){let g=null;do g=d.next(yield g==null?void 0:g.value);while(!g.done)}(l[Symbol.iterator]())))))})},c=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof nc?s(t):Zi(t)?a(t):ui(t)?t:s(t);return yield J(yield*Qs(wr(Nu(function(l){return on(this,arguments,function*(){let d=null;do d=yield J(l.next(yield yield J(_t(r,d))));while(!d.done)})}(c[Symbol.asyncIterator]()))))),yield J(new r)})}const v1=r=>td(Uint8Array,r);function rc(r,t,e){if(r!==0){e=e.slice(0,t+1);for(let s=-1;++s<=t;)e[s]+=r}return e}function b1(r,t){let e=0;const s=r.length;if(s!==t.length)return!1;if(s>0)do if(r[e]!==t[e])return!1;while(++e<s);return!0}const xe={fromIterable(r){return qs(w1(r))},fromAsyncIterable(r){return qs(S1(r))},fromDOMStream(r){return qs(I1(r))},fromNodeStream(r){return qs(B1(r))},toDOMStream(r,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,t){throw new Error('"toNodeStream" not available in this environment')}},qs=r=>(r.next(),r);function*w1(r){let t,e=!1,s=[],a,c,l,d=0;function g(){return c==="peek"?un(s,l)[0]:([a,s,d]=un(s,l),a)}({cmd:c,size:l}=yield null);const w=m1(r)[Symbol.iterator]();try{do if({done:t,value:a}=Number.isNaN(l-d)?w.next():w.next(l-d),!t&&a.byteLength>0&&(s.push(a),d+=a.byteLength),t||l<=d)do({cmd:c,size:l}=yield g());while(l<d);while(!t)}catch(O){(e=!0)&&typeof w.throw=="function"&&w.throw(O)}finally{e===!1&&typeof w.return=="function"&&w.return(null)}return null}function S1(r){return on(this,arguments,function*(){let e,s=!1,a=[],c,l,d,g=0;function w(){return l==="peek"?un(a,d)[0]:([c,a,g]=un(a,d),c)}({cmd:l,size:d}=yield yield J(null));const O=v1(r)[Symbol.asyncIterator]();try{do if({done:e,value:c}=Number.isNaN(d-g)?yield J(O.next()):yield J(O.next(d-g)),!e&&c.byteLength>0&&(a.push(c),g+=c.byteLength),e||d<=g)do({cmd:l,size:d}=yield yield J(w()));while(d<g);while(!e)}catch(D){(s=!0)&&typeof O.throw=="function"&&(yield J(O.throw(D)))}finally{s===!1&&typeof O.return=="function"&&(yield J(O.return(new Uint8Array(0))))}return yield J(null)})}function I1(r){return on(this,arguments,function*(){let e=!1,s=!1,a=[],c,l,d,g=0;function w(){return l==="peek"?un(a,d)[0]:([c,a,g]=un(a,d),c)}({cmd:l,size:d}=yield yield J(null));const O=new A1(r);try{do if({done:e,value:c}=Number.isNaN(d-g)?yield J(O.read()):yield J(O.read(d-g)),!e&&c.byteLength>0&&(a.push(ot(c)),g+=c.byteLength),e||d<=g)do({cmd:l,size:d}=yield yield J(w()));while(d<g);while(!e)}catch(D){(s=!0)&&(yield J(O.cancel(D)))}finally{s===!1?yield J(O.cancel()):r.locked&&O.releaseLock()}return yield J(null)})}class A1{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return C(this,void 0,void 0,function*(){const{reader:e,source:s}=this;e&&(yield e.cancel(t).catch(()=>{})),s&&s.locked&&this.releaseLock()})}read(t){return C(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=ot(e)),e})}}const wu=(r,t)=>{const e=a=>s([t,a]);let s;return[t,e,new Promise(a=>(s=a)&&r.once(t,e))]};function B1(r){return on(this,arguments,function*(){const e=[];let s="error",a=!1,c=null,l,d,g=0,w=[],O;function D(){return l==="peek"?un(w,d)[0]:([O,w,g]=un(w,d),O)}if({cmd:l,size:d}=yield yield J(null),r.isTTY)return yield yield J(new Uint8Array(0)),yield J(null);try{e[0]=wu(r,"end"),e[1]=wu(r,"error");do{if(e[2]=wu(r,"readable"),[s,c]=yield J(Promise.race(e.map(X=>X[2]))),s==="error")break;if((a=s==="end")||(Number.isFinite(d-g)?(O=ot(r.read(d-g)),O.byteLength<d-g&&(O=ot(r.read()))):O=ot(r.read()),O.byteLength>0&&(w.push(O),g+=O.byteLength)),a||d<=g)do({cmd:l,size:d}=yield yield J(D()));while(d<g)}while(!a)}finally{yield J(M(e,s==="error"?c:null))}return yield J(null);function M(X,At){return O=w=null,new Promise((Nn,Kt)=>{for(const[Jt,ns]of X)r.off(Jt,ns);try{const Jt=r.destroy;Jt&&Jt.call(r,At),At=void 0}catch(Jt){At=Jt||At}finally{At!=null?Kt(At):Nn()}})}})}var ge;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(ge||(ge={}));var _e;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(_e||(_e={}));var ie;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(ie||(ie={}));var Tn;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Tn||(Tn={}));var at;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(at||(at={}));var Jn;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Jn||(Jn={}));var ct;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(ct||(ct={}));var b;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth"})(b||(b={}));var In;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(In||(In={}));const O1=void 0;function $i(r){if(r===null)return"null";if(r===O1)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof Ji||r instanceof qi?`[${[...r].map(t=>$i(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const F1=Symbol.for("isArrowBigNum");function ke(r,...t){return t.length===0?Object.setPrototypeOf(_t(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ke.prototype[F1]=!0;ke.prototype.toJSON=function(){return`"${Sr(this)}"`};ke.prototype.valueOf=function(){return ed(this)};ke.prototype.toString=function(){return Sr(this)};ke.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return ed(this);case"string":return Sr(this);case"default":return Eu(this)}return Sr(this)};function Jr(...r){return ke.apply(this,r)}function qr(...r){return ke.apply(this,r)}function Vi(...r){return ke.apply(this,r)}Object.setPrototypeOf(Jr.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(qr.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Vi.prototype,Object.create(Uint32Array.prototype));Object.assign(Jr.prototype,ke.prototype,{constructor:Jr,signed:!0,TypedArray:Int32Array,BigIntArray:Ji});Object.assign(qr.prototype,ke.prototype,{constructor:qr,signed:!1,TypedArray:Uint32Array,BigIntArray:qi});Object.assign(Vi.prototype,ke.prototype,{constructor:Vi,signed:!0,TypedArray:Uint32Array,BigIntArray:qi});function ed(r){const{buffer:t,byteOffset:e,length:s,signed:a}=r,c=new qi(t,e,s),l=a&&c[c.length-1]&BigInt(1)<<BigInt(63);let d=BigInt(l?1:0),g=BigInt(0);if(l){for(const w of c)d+=~w*(BigInt(1)<<BigInt(32)*g++);d*=BigInt(-1)}else for(const w of c)d+=w*(BigInt(1)<<BigInt(32)*g++);return d}let Sr,Eu;f1?(Eu=r=>r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Su(r),Sr=r=>r.byteLength===8?`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`:Su(r)):(Sr=Su,Eu=Sr);function Su(r){let t="";const e=new Uint32Array(2);let s=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);const a=new Uint32Array((s=new Uint16Array(s).reverse()).buffer);let c=-1;const l=s.length-1;do{for(e[0]=s[c=0];c<l;)s[c++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+s[c];s[c]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(a[0]||a[1]||a[2]||a[3]);return t??"0"}class ic{static new(t,e){switch(e){case!0:return new Jr(t);case!1:return new qr(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case Ji:return new Jr(t)}return t.byteLength===16?new Vi(t):new qr(t)}static signed(t){return new Jr(t)}static unsigned(t){return new qr(t)}static decimal(t){return new Vi(t)}constructor(t,e){return ic.new(t,e)}}var nd,rd,id,sd,od,ad,ud,cd,ld,fd,hd,dd,pd,yd,gd,_d,md,vd,bd;class P{static isNull(t){return(t==null?void 0:t.typeId)===b.Null}static isInt(t){return(t==null?void 0:t.typeId)===b.Int}static isFloat(t){return(t==null?void 0:t.typeId)===b.Float}static isBinary(t){return(t==null?void 0:t.typeId)===b.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===b.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===b.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===b.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===b.Date}static isTime(t){return(t==null?void 0:t.typeId)===b.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===b.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===b.Interval}static isList(t){return(t==null?void 0:t.typeId)===b.List}static isStruct(t){return(t==null?void 0:t.typeId)===b.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===b.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===b.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===b.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===b.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===b.Dictionary}static isDenseUnion(t){return P.isUnion(t)&&t.mode===_e.Dense}static isSparseUnion(t){return P.isUnion(t)&&t.mode===_e.Sparse}get typeId(){return b.NONE}}nd=Symbol.toStringTag;P[nd]=(r=>(r.children=null,r.ArrayType=Array,r[Symbol.toStringTag]="DataType"))(P.prototype);let qn=class extends P{toString(){return"Null"}get typeId(){return b.Null}};rd=Symbol.toStringTag;qn[rd]=(r=>r[Symbol.toStringTag]="Null")(qn.prototype);class Zn extends P{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return b.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?Ji:qi}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}id=Symbol.toStringTag;Zn[id]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Zn.prototype);class Wi extends Zn{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Wi.prototype,"ArrayType",{value:Int32Array});class ki extends P{constructor(t){super(),this.precision=t}get typeId(){return b.Float}get ArrayType(){switch(this.precision){case ie.HALF:return Uint16Array;case ie.SINGLE:return Float32Array;case ie.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}sd=Symbol.toStringTag;ki[sd]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(ki.prototype);let ao=class extends P{constructor(){super()}get typeId(){return b.Binary}toString(){return"Binary"}};od=Symbol.toStringTag;ao[od]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(ao.prototype);let uo=class extends P{constructor(){super()}get typeId(){return b.Utf8}toString(){return"Utf8"}};ad=Symbol.toStringTag;uo[ad]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(uo.prototype);let co=class extends P{constructor(){super()}get typeId(){return b.Bool}toString(){return"Bool"}};ud=Symbol.toStringTag;co[ud]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(co.prototype);let lo=class extends P{constructor(t,e,s=128){super(),this.scale=t,this.precision=e,this.bitWidth=s}get typeId(){return b.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};cd=Symbol.toStringTag;lo[cd]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(lo.prototype);class fo extends P{constructor(t){super(),this.unit=t}get typeId(){return b.Date}toString(){return`Date${(this.unit+1)*32}<${Tn[this.unit]}>`}}ld=Symbol.toStringTag;fo[ld]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Date"))(fo.prototype);class ji extends P{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return b.Time}toString(){return`Time${this.bitWidth}<${at[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return Ji}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}fd=Symbol.toStringTag;ji[fd]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(ji.prototype);class ho extends P{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return b.Timestamp}toString(){return`Timestamp<${at[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}hd=Symbol.toStringTag;ho[hd]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Timestamp"))(ho.prototype);class po extends P{constructor(t){super(),this.unit=t}get typeId(){return b.Interval}toString(){return`Interval<${Jn[this.unit]}>`}}dd=Symbol.toStringTag;po[dd]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(po.prototype);let yo=class extends P{constructor(t){super(),this.children=[t]}get typeId(){return b.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}};pd=Symbol.toStringTag;yo[pd]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(yo.prototype);class Yt extends P{constructor(t){super(),this.children=t}get typeId(){return b.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}yd=Symbol.toStringTag;Yt[yd]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(Yt.prototype);class go extends P{constructor(t,e,s){super(),this.mode=t,this.children=s,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((a,c,l)=>(a[c]=l)&&a||a,Object.create(null))}get typeId(){return b.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}gd=Symbol.toStringTag;go[gd]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(go.prototype);let _o=class extends P{constructor(t){super(),this.byteWidth=t}get typeId(){return b.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};_d=Symbol.toStringTag;_o[_d]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(_o.prototype);let mo=class extends P{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return b.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}>`}};md=Symbol.toStringTag;mo[md]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(mo.prototype);class vo extends P{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return b.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}vd=Symbol.toStringTag;vo[vd]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(vo.prototype);const D1=(r=>()=>++r)(-1);class ti extends P{constructor(t,e,s,a){super(),this.indices=e,this.dictionary=t,this.isOrdered=a||!1,this.id=s==null?D1():typeof s=="number"?s:s.low}get typeId(){return b.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}>`}}bd=Symbol.toStringTag;ti[bd]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(ti.prototype);function An(r){const t=r;switch(r.typeId){case b.Decimal:return r.bitWidth/32;case b.Timestamp:return 2;case b.Date:return 1+t.unit;case b.Interval:return 1+t.unit;case b.FixedSizeList:return t.listSize;case b.FixedSizeBinary:return t.byteWidth;default:return 1}}class it{visitMany(t,...e){return t.map((s,a)=>this.visit(s,...e.map(c=>c[a])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return x1(this,t,e)}getVisitFnByTypeId(t,e=!0){return jr(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function x1(r,t,e=!0){return typeof t=="number"?jr(r,t,e):typeof t=="string"&&t in b?jr(r,b[t],e):t&&t instanceof P?jr(r,hh(t),e):t!=null&&t.type&&t.type instanceof P?jr(r,hh(t.type),e):jr(r,b.NONE,e)}function jr(r,t,e=!0){let s=null;switch(t){case b.Null:s=r.visitNull;break;case b.Bool:s=r.visitBool;break;case b.Int:s=r.visitInt;break;case b.Int8:s=r.visitInt8||r.visitInt;break;case b.Int16:s=r.visitInt16||r.visitInt;break;case b.Int32:s=r.visitInt32||r.visitInt;break;case b.Int64:s=r.visitInt64||r.visitInt;break;case b.Uint8:s=r.visitUint8||r.visitInt;break;case b.Uint16:s=r.visitUint16||r.visitInt;break;case b.Uint32:s=r.visitUint32||r.visitInt;break;case b.Uint64:s=r.visitUint64||r.visitInt;break;case b.Float:s=r.visitFloat;break;case b.Float16:s=r.visitFloat16||r.visitFloat;break;case b.Float32:s=r.visitFloat32||r.visitFloat;break;case b.Float64:s=r.visitFloat64||r.visitFloat;break;case b.Utf8:s=r.visitUtf8;break;case b.Binary:s=r.visitBinary;break;case b.FixedSizeBinary:s=r.visitFixedSizeBinary;break;case b.Date:s=r.visitDate;break;case b.DateDay:s=r.visitDateDay||r.visitDate;break;case b.DateMillisecond:s=r.visitDateMillisecond||r.visitDate;break;case b.Timestamp:s=r.visitTimestamp;break;case b.TimestampSecond:s=r.visitTimestampSecond||r.visitTimestamp;break;case b.TimestampMillisecond:s=r.visitTimestampMillisecond||r.visitTimestamp;break;case b.TimestampMicrosecond:s=r.visitTimestampMicrosecond||r.visitTimestamp;break;case b.TimestampNanosecond:s=r.visitTimestampNanosecond||r.visitTimestamp;break;case b.Time:s=r.visitTime;break;case b.TimeSecond:s=r.visitTimeSecond||r.visitTime;break;case b.TimeMillisecond:s=r.visitTimeMillisecond||r.visitTime;break;case b.TimeMicrosecond:s=r.visitTimeMicrosecond||r.visitTime;break;case b.TimeNanosecond:s=r.visitTimeNanosecond||r.visitTime;break;case b.Decimal:s=r.visitDecimal;break;case b.List:s=r.visitList;break;case b.Struct:s=r.visitStruct;break;case b.Union:s=r.visitUnion;break;case b.DenseUnion:s=r.visitDenseUnion||r.visitUnion;break;case b.SparseUnion:s=r.visitSparseUnion||r.visitUnion;break;case b.Dictionary:s=r.visitDictionary;break;case b.Interval:s=r.visitInterval;break;case b.IntervalDayTime:s=r.visitIntervalDayTime||r.visitInterval;break;case b.IntervalYearMonth:s=r.visitIntervalYearMonth||r.visitInterval;break;case b.FixedSizeList:s=r.visitFixedSizeList;break;case b.Map:s=r.visitMap;break}if(typeof s=="function")return s;if(!e)return()=>null;throw new Error(`Unrecognized type '${b[t]}'`)}function hh(r){switch(r.typeId){case b.Null:return b.Null;case b.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?b.Int8:b.Uint8;case 16:return e?b.Int16:b.Uint16;case 32:return e?b.Int32:b.Uint32;case 64:return e?b.Int64:b.Uint64}return b.Int}case b.Float:switch(r.precision){case ie.HALF:return b.Float16;case ie.SINGLE:return b.Float32;case ie.DOUBLE:return b.Float64}return b.Float;case b.Binary:return b.Binary;case b.Utf8:return b.Utf8;case b.Bool:return b.Bool;case b.Decimal:return b.Decimal;case b.Time:switch(r.unit){case at.SECOND:return b.TimeSecond;case at.MILLISECOND:return b.TimeMillisecond;case at.MICROSECOND:return b.TimeMicrosecond;case at.NANOSECOND:return b.TimeNanosecond}return b.Time;case b.Timestamp:switch(r.unit){case at.SECOND:return b.TimestampSecond;case at.MILLISECOND:return b.TimestampMillisecond;case at.MICROSECOND:return b.TimestampMicrosecond;case at.NANOSECOND:return b.TimestampNanosecond}return b.Timestamp;case b.Date:switch(r.unit){case Tn.DAY:return b.DateDay;case Tn.MILLISECOND:return b.DateMillisecond}return b.Date;case b.Interval:switch(r.unit){case Jn.DAY_TIME:return b.IntervalDayTime;case Jn.YEAR_MONTH:return b.IntervalYearMonth}return b.Interval;case b.Map:return b.Map;case b.List:return b.List;case b.Struct:return b.Struct;case b.Union:switch(r.mode){case _e.Dense:return b.DenseUnion;case _e.Sparse:return b.SparseUnion}return b.Union;case b.FixedSizeBinary:return b.FixedSizeBinary;case b.FixedSizeList:return b.FixedSizeList;case b.Dictionary:return b.Dictionary}throw new Error(`Unrecognized type '${b[r.typeId]}'`)}it.prototype.visitInt8=null;it.prototype.visitInt16=null;it.prototype.visitInt32=null;it.prototype.visitInt64=null;it.prototype.visitUint8=null;it.prototype.visitUint16=null;it.prototype.visitUint32=null;it.prototype.visitUint64=null;it.prototype.visitFloat16=null;it.prototype.visitFloat32=null;it.prototype.visitFloat64=null;it.prototype.visitDateDay=null;it.prototype.visitDateMillisecond=null;it.prototype.visitTimestampSecond=null;it.prototype.visitTimestampMillisecond=null;it.prototype.visitTimestampMicrosecond=null;it.prototype.visitTimestampNanosecond=null;it.prototype.visitTimeSecond=null;it.prototype.visitTimeMillisecond=null;it.prototype.visitTimeMicrosecond=null;it.prototype.visitTimeNanosecond=null;it.prototype.visitDenseUnion=null;it.prototype.visitSparseUnion=null;it.prototype.visitIntervalDayTime=null;it.prototype.visitIntervalYearMonth=null;const wd=new Float64Array(1),kr=new Uint32Array(wd.buffer);function Sd(r){const t=(r&31744)>>10,e=(r&1023)/1024,s=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return s*(e?Number.NaN:1/0);case 0:return s*(e?6103515625e-14*e:0)}return s*Math.pow(2,t-15)*(1+e)}function T1(r){if(r!==r)return 32256;wd[0]=r;const t=(kr[1]&2147483648)>>16&65535;let e=kr[1]&2146435072,s=0;return e>=1089470464?kr[0]>0?e=31744:(e=(e&2080374784)>>16,s=(kr[1]&1048575)>>10):e<=1056964608?(s=1048576+(kr[1]&1048575),s=1048576+(s<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,s=(kr[1]&1048575)+512>>10),t|e|s&65535}class j extends it{}function G(r){return(t,e,s)=>{if(t.setValid(e,s!=null))return r(t,e,s)}}const L1=(r,t,e)=>{r[t]=Math.trunc(e/864e5)},sc=(r,t,e)=>{r[t]=Math.trunc(e%4294967296),r[t+1]=Math.trunc(e/4294967296)},M1=(r,t,e)=>{r[t]=Math.trunc(e*1e3%4294967296),r[t+1]=Math.trunc(e*1e3/4294967296)},R1=(r,t,e)=>{r[t]=Math.trunc(e*1e6%4294967296),r[t+1]=Math.trunc(e*1e6/4294967296)},Id=(r,t,e,s)=>{if(e+1<t.length){const{[e]:a,[e+1]:c}=t;r.set(s.subarray(0,c-a),a)}},N1=({offset:r,values:t},e,s)=>{const a=r+e;s?t[a>>3]|=1<<a%8:t[a>>3]&=~(1<<a%8)},Mn=({values:r},t,e)=>{r[t]=e},oc=({values:r},t,e)=>{r[t]=e},Ad=({values:r},t,e)=>{r[t]=T1(e)},E1=(r,t,e)=>{switch(r.type.precision){case ie.HALF:return Ad(r,t,e);case ie.SINGLE:case ie.DOUBLE:return oc(r,t,e)}},Bd=({values:r},t,e)=>{L1(r,t,e.valueOf())},Od=({values:r},t,e)=>{sc(r,t*2,e.valueOf())},C1=({stride:r,values:t},e,s)=>{t.set(s.subarray(0,r),r*e)},U1=({values:r,valueOffsets:t},e,s)=>Id(r,t,e,s),P1=({values:r,valueOffsets:t},e,s)=>{Id(r,t,e,tc(s))},z1=(r,t,e)=>{r.type.unit===Tn.DAY?Bd(r,t,e):Od(r,t,e)},Fd=({values:r},t,e)=>sc(r,t*2,e/1e3),Dd=({values:r},t,e)=>sc(r,t*2,e),xd=({values:r},t,e)=>M1(r,t*2,e),Td=({values:r},t,e)=>R1(r,t*2,e),$1=(r,t,e)=>{switch(r.type.unit){case at.SECOND:return Fd(r,t,e);case at.MILLISECOND:return Dd(r,t,e);case at.MICROSECOND:return xd(r,t,e);case at.NANOSECOND:return Td(r,t,e)}},Ld=({values:r},t,e)=>{r[t]=e},Md=({values:r},t,e)=>{r[t]=e},Rd=({values:r},t,e)=>{r[t]=e},Nd=({values:r},t,e)=>{r[t]=e},V1=(r,t,e)=>{switch(r.type.unit){case at.SECOND:return Ld(r,t,e);case at.MILLISECOND:return Md(r,t,e);case at.MICROSECOND:return Rd(r,t,e);case at.NANOSECOND:return Nd(r,t,e)}},W1=({values:r,stride:t},e,s)=>{r.set(s.subarray(0,t),t*e)},k1=(r,t,e)=>{const s=r.children[0],a=r.valueOffsets,c=Me.getVisitFn(s);if(Array.isArray(e))for(let l=-1,d=a[t],g=a[t+1];d<g;)c(s,d++,e[++l]);else for(let l=-1,d=a[t],g=a[t+1];d<g;)c(s,d++,e.get(++l))},j1=(r,t,e)=>{const s=r.children[0],{valueOffsets:a}=r,c=Me.getVisitFn(s);let{[t]:l,[t+1]:d}=a;const g=e instanceof Map?e.entries():Object.entries(e);for(const w of g)if(c(s,l,w),++l>=d)break},H1=(r,t)=>(e,s,a,c)=>s&&e(s,r,t[c]),Y1=(r,t)=>(e,s,a,c)=>s&&e(s,r,t.get(c)),G1=(r,t)=>(e,s,a,c)=>s&&e(s,r,t.get(a.name)),K1=(r,t)=>(e,s,a,c)=>s&&e(s,r,t[a.name]),J1=(r,t,e)=>{const s=r.type.children.map(c=>Me.getVisitFn(c.type)),a=e instanceof Map?G1(t,e):e instanceof lt?Y1(t,e):Array.isArray(e)?H1(t,e):K1(t,e);r.type.children.forEach((c,l)=>a(s[l],r.children[l],c,l))},q1=(r,t,e)=>{r.type.mode===_e.Dense?Ed(r,t,e):Cd(r,t,e)},Ed=(r,t,e)=>{const s=r.type.typeIdToChildIndex[r.typeIds[t]],a=r.children[s];Me.visit(a,r.valueOffsets[t],e)},Cd=(r,t,e)=>{const s=r.type.typeIdToChildIndex[r.typeIds[t]],a=r.children[s];Me.visit(a,t,e)},Z1=(r,t,e)=>{var s;(s=r.dictionary)===null||s===void 0||s.set(r.values[t],e)},X1=(r,t,e)=>{r.type.unit===Jn.DAY_TIME?Ud(r,t,e):Pd(r,t,e)},Ud=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},Pd=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Q1=(r,t,e)=>{const{stride:s}=r,a=r.children[0],c=Me.getVisitFn(a);if(Array.isArray(e))for(let l=-1,d=t*s;++l<s;)c(a,d+l,e[l]);else for(let l=-1,d=t*s;++l<s;)c(a,d+l,e.get(l))};j.prototype.visitBool=G(N1);j.prototype.visitInt=G(Mn);j.prototype.visitInt8=G(Mn);j.prototype.visitInt16=G(Mn);j.prototype.visitInt32=G(Mn);j.prototype.visitInt64=G(Mn);j.prototype.visitUint8=G(Mn);j.prototype.visitUint16=G(Mn);j.prototype.visitUint32=G(Mn);j.prototype.visitUint64=G(Mn);j.prototype.visitFloat=G(E1);j.prototype.visitFloat16=G(Ad);j.prototype.visitFloat32=G(oc);j.prototype.visitFloat64=G(oc);j.prototype.visitUtf8=G(P1);j.prototype.visitBinary=G(U1);j.prototype.visitFixedSizeBinary=G(C1);j.prototype.visitDate=G(z1);j.prototype.visitDateDay=G(Bd);j.prototype.visitDateMillisecond=G(Od);j.prototype.visitTimestamp=G($1);j.prototype.visitTimestampSecond=G(Fd);j.prototype.visitTimestampMillisecond=G(Dd);j.prototype.visitTimestampMicrosecond=G(xd);j.prototype.visitTimestampNanosecond=G(Td);j.prototype.visitTime=G(V1);j.prototype.visitTimeSecond=G(Ld);j.prototype.visitTimeMillisecond=G(Md);j.prototype.visitTimeMicrosecond=G(Rd);j.prototype.visitTimeNanosecond=G(Nd);j.prototype.visitDecimal=G(W1);j.prototype.visitList=G(k1);j.prototype.visitStruct=G(J1);j.prototype.visitUnion=G(q1);j.prototype.visitDenseUnion=G(Ed);j.prototype.visitSparseUnion=G(Cd);j.prototype.visitDictionary=G(Z1);j.prototype.visitInterval=G(X1);j.prototype.visitIntervalDayTime=G(Ud);j.prototype.visitIntervalYearMonth=G(Pd);j.prototype.visitFixedSizeList=G(Q1);j.prototype.visitMap=G(j1);const Me=new j,$e=Symbol.for("parent"),Zr=Symbol.for("rowIndex");class ac{constructor(t,e){return this[$e]=t,this[Zr]=e,new Proxy(this,new eS)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Zr],e=this[$e],s=e.type.children,a={};for(let c=-1,l=s.length;++c<l;)a[s[c].name]=oe.visit(e.children[c],t);return a}toString(){return`{${[...this].map(([t,e])=>`${$i(t)}: ${$i(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new tS(this[$e],this[Zr])}}class tS{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,oe.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(ac.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[$e]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Zr]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class eS{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[$e].type.children.map(e=>e.name)}has(t,e){return t[$e].type.children.findIndex(s=>s.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[$e].type.children.findIndex(s=>s.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const s=t[$e].type.children.findIndex(a=>a.name===e);if(s!==-1){const a=oe.visit(t[$e].children[s],t[Zr]);return Reflect.set(t,e,a),a}}set(t,e,s){const a=t[$e].type.children.findIndex(c=>c.name===e);return a!==-1?(Me.visit(t[$e].children[a],t[Zr],s),Reflect.set(t,e,s)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,s):!1}}class z extends it{}function H(r){return(t,e)=>t.getValid(e)?r(t,e):null}const nS=(r,t)=>864e5*r[t],uc=(r,t)=>4294967296*r[t+1]+(r[t]>>>0),rS=(r,t)=>4294967296*(r[t+1]/1e3)+(r[t]>>>0)/1e3,iS=(r,t)=>4294967296*(r[t+1]/1e6)+(r[t]>>>0)/1e6,zd=r=>new Date(r),sS=(r,t)=>zd(nS(r,t)),oS=(r,t)=>zd(uc(r,t)),aS=(r,t)=>null,$d=(r,t,e)=>{if(e+1>=t.length)return null;const s=t[e],a=t[e+1];return r.subarray(s,a)},uS=({offset:r,values:t},e)=>{const s=r+e;return(t[s>>3]&1<<s%8)!==0},Vd=({values:r},t)=>sS(r,t),Wd=({values:r},t)=>oS(r,t*2),er=({stride:r,values:t},e)=>t[r*e],cS=({stride:r,values:t},e)=>Sd(t[r*e]),kd=({values:r},t)=>r[t],lS=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),fS=({values:r,valueOffsets:t},e)=>$d(r,t,e),hS=({values:r,valueOffsets:t},e)=>{const s=$d(r,t,e);return s!==null?Mu(s):null},dS=({values:r},t)=>r[t],pS=({type:r,values:t},e)=>r.precision!==ie.HALF?t[e]:Sd(t[e]),yS=(r,t)=>r.type.unit===Tn.DAY?Vd(r,t):Wd(r,t),jd=({values:r},t)=>1e3*uc(r,t*2),Hd=({values:r},t)=>uc(r,t*2),Yd=({values:r},t)=>rS(r,t*2),Gd=({values:r},t)=>iS(r,t*2),gS=(r,t)=>{switch(r.type.unit){case at.SECOND:return jd(r,t);case at.MILLISECOND:return Hd(r,t);case at.MICROSECOND:return Yd(r,t);case at.NANOSECOND:return Gd(r,t)}},Kd=({values:r},t)=>r[t],Jd=({values:r},t)=>r[t],qd=({values:r},t)=>r[t],Zd=({values:r},t)=>r[t],_S=(r,t)=>{switch(r.type.unit){case at.SECOND:return Kd(r,t);case at.MILLISECOND:return Jd(r,t);case at.MICROSECOND:return qd(r,t);case at.NANOSECOND:return Zd(r,t)}},mS=({values:r,stride:t},e)=>ic.decimal(r.subarray(t*e,t*(e+1))),vS=(r,t)=>{const{valueOffsets:e,stride:s,children:a}=r,{[t*s]:c,[t*s+1]:l}=e,g=a[0].slice(c,l-c);return new lt([g])},bS=(r,t)=>{const{valueOffsets:e,children:s}=r,{[t]:a,[t+1]:c}=e,l=s[0];return new cc(l.slice(a,c-a))},wS=(r,t)=>new ac(r,t),SS=(r,t)=>r.type.mode===_e.Dense?Xd(r,t):Qd(r,t),Xd=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],s=r.children[e];return oe.visit(s,r.valueOffsets[t])},Qd=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],s=r.children[e];return oe.visit(s,t)},IS=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},AS=(r,t)=>r.type.unit===Jn.DAY_TIME?tp(r,t):ep(r,t),tp=({values:r},t)=>r.subarray(2*t,2*(t+1)),ep=({values:r},t)=>{const e=r[t],s=new Int32Array(2);return s[0]=Math.trunc(e/12),s[1]=Math.trunc(e%12),s},BS=(r,t)=>{const{stride:e,children:s}=r,c=s[0].slice(t*e,e);return new lt([c])};z.prototype.visitNull=H(aS);z.prototype.visitBool=H(uS);z.prototype.visitInt=H(dS);z.prototype.visitInt8=H(er);z.prototype.visitInt16=H(er);z.prototype.visitInt32=H(er);z.prototype.visitInt64=H(kd);z.prototype.visitUint8=H(er);z.prototype.visitUint16=H(er);z.prototype.visitUint32=H(er);z.prototype.visitUint64=H(kd);z.prototype.visitFloat=H(pS);z.prototype.visitFloat16=H(cS);z.prototype.visitFloat32=H(er);z.prototype.visitFloat64=H(er);z.prototype.visitUtf8=H(hS);z.prototype.visitBinary=H(fS);z.prototype.visitFixedSizeBinary=H(lS);z.prototype.visitDate=H(yS);z.prototype.visitDateDay=H(Vd);z.prototype.visitDateMillisecond=H(Wd);z.prototype.visitTimestamp=H(gS);z.prototype.visitTimestampSecond=H(jd);z.prototype.visitTimestampMillisecond=H(Hd);z.prototype.visitTimestampMicrosecond=H(Yd);z.prototype.visitTimestampNanosecond=H(Gd);z.prototype.visitTime=H(_S);z.prototype.visitTimeSecond=H(Kd);z.prototype.visitTimeMillisecond=H(Jd);z.prototype.visitTimeMicrosecond=H(qd);z.prototype.visitTimeNanosecond=H(Zd);z.prototype.visitDecimal=H(mS);z.prototype.visitList=H(vS);z.prototype.visitStruct=H(wS);z.prototype.visitUnion=H(SS);z.prototype.visitDenseUnion=H(Xd);z.prototype.visitSparseUnion=H(Qd);z.prototype.visitDictionary=H(IS);z.prototype.visitInterval=H(AS);z.prototype.visitIntervalDayTime=H(tp);z.prototype.visitIntervalYearMonth=H(ep);z.prototype.visitFixedSizeList=H(BS);z.prototype.visitMap=H(bS);const oe=new z,Qe=Symbol.for("keys"),Xr=Symbol.for("vals");class cc{constructor(t){return this[Qe]=new lt([t.children[0]]).memoize(),this[Xr]=t.children[1],new Proxy(this,new FS)}[Symbol.iterator](){return new OS(this[Qe],this[Xr])}get size(){return this[Qe].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Qe],e=this[Xr],s={};for(let a=-1,c=t.length;++a<c;)s[t.get(a)]=oe.visit(e,a);return s}toString(){return`{${[...this].map(([t,e])=>`${$i(t)}: ${$i(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class OS{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),oe.visit(this.vals,t)]})}}class FS{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Qe].toArray().map(String)}has(t,e){return t[Qe].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Qe].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const s=t[Qe].indexOf(e);if(s!==-1){const a=oe.visit(Reflect.get(t,Xr),s);return Reflect.set(t,e,a),a}}set(t,e,s){const a=t[Qe].indexOf(e);return a!==-1?(Me.visit(Reflect.get(t,Xr),a,s),Reflect.set(t,e,s)):Reflect.has(t,e)?Reflect.set(t,e,s):!1}}Object.defineProperties(cc.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Qe]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xr]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let dh;function np(r,t,e,s){const{length:a=0}=r;let c=typeof t!="number"?0:t,l=typeof e!="number"?a:e;return c<0&&(c=(c%a+a)%a),l<0&&(l=(l%a+a)%a),l<c&&(dh=c,c=l,l=dh),l>a&&(l=a),s?s(r,c,l):[c,l]}const ph=r=>r!==r;function ci(r){if(typeof r!=="object"||r===null)return ph(r)?ph:e=>e===r;if(r instanceof Date){const e=r.valueOf();return s=>s instanceof Date?s.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?b1(r,e):!1:r instanceof Map?xS(r):Array.isArray(r)?DS(r):r instanceof lt?TS(r):LS(r,!0)}function DS(r){const t=[];for(let e=-1,s=r.length;++e<s;)t[e]=ci(r[e]);return Jo(t)}function xS(r){let t=-1;const e=[];for(const s of r.values())e[++t]=ci(s);return Jo(e)}function TS(r){const t=[];for(let e=-1,s=r.length;++e<s;)t[e]=ci(r.get(e));return Jo(t)}function LS(r,t=!1){const e=Object.keys(r);if(!t&&e.length===0)return()=>!1;const s=[];for(let a=-1,c=e.length;++a<c;)s[a]=ci(r[e[a]]);return Jo(s,e)}function Jo(r,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return MS(r,e);case Map:return yh(r,e,e.keys());case cc:case ac:case Object:case void 0:return yh(r,e,t||Object.keys(e))}return e instanceof lt?RS(r,e):!1}}function MS(r,t){const e=r.length;if(t.length!==e)return!1;for(let s=-1;++s<e;)if(!r[s](t[s]))return!1;return!0}function RS(r,t){const e=r.length;if(t.length!==e)return!1;for(let s=-1;++s<e;)if(!r[s](t.get(s)))return!1;return!0}function yh(r,t,e){const s=e[Symbol.iterator](),a=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),c=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let l=0;const d=r.length;let g=c.next(),w=s.next(),O=a.next();for(;l<d&&!w.done&&!O.done&&!g.done&&!(w.value!==O.value||!r[l](g.value));++l,w=s.next(),O=a.next(),g=c.next());return l===d&&w.done&&O.done&&g.done?!0:(s.return&&s.return(),a.return&&a.return(),c.return&&c.return(),!1)}function rp(r,t,e,s){return(e&1<<s)!==0}function NS(r,t,e,s){return(e&1<<s)>>s}function lc(r,t,e){const s=e.byteLength+7&-8;if(r>0||e.byteLength<s){const a=new Uint8Array(s);return a.set(r%8===0?e.subarray(r>>3):bo(new fc(e,r,t,null,rp)).subarray(0,s)),a}return e}function bo(r){const t=[];let e=0,s=0,a=0;for(const l of r)l&&(a|=1<<s),++s===8&&(t[e++]=a,a=s=0);(e===0||s>0)&&(t[e++]=a);const c=new Uint8Array(t.length+7&-8);return c.set(t),c}class fc{constructor(t,e,s,a,c){this.bytes=t,this.length=s,this.context=a,this.get=c,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function Cu(r,t,e){if(e-t<=0)return 0;if(e-t<8){let c=0;for(const l of new fc(r,t,e-t,r,NS))c+=l;return c}const s=e>>3<<3,a=t+(t%8===0?0:8-t%8);return Cu(r,t,a)+Cu(r,s,e)+ES(r,a>>3,s-a>>3)}function ES(r,t,e){let s=0,a=Math.trunc(t);const c=new DataView(r.buffer,r.byteOffset,r.byteLength),l=e===void 0?r.byteLength:a+e;for(;l-a>=4;)s+=Iu(c.getUint32(a)),a+=4;for(;l-a>=2;)s+=Iu(c.getUint16(a)),a+=2;for(;l-a>=1;)s+=Iu(c.getUint8(a)),a+=1;return s}function Iu(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const CS=-1;class bt{constructor(t,e,s,a,c,l=[],d){this.type=t,this.children=l,this.dictionary=d,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(s||0,0)),this._nullCount=Math.floor(Math.max(a||0,-1));let g;c instanceof bt?(this.stride=c.stride,this.values=c.values,this.typeIds=c.typeIds,this.nullBitmap=c.nullBitmap,this.valueOffsets=c.valueOffsets):(this.stride=An(t),c&&((g=c[0])&&(this.valueOffsets=g),(g=c[1])&&(this.values=g),(g=c[2])&&(this.nullBitmap=g),(g=c[3])&&(this.typeIds=g))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}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;const{valueOffsets:e,values:s,nullBitmap:a,typeIds:c}=this;return e&&(t+=e.byteLength),s&&(t+=s.byteLength),a&&(t+=a.byteLength),c&&(t+=c.byteLength),this.children.reduce((l,d)=>l+d.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=CS&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-Cu(e,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){const e=this.offset+t;return(this.nullBitmap[e>>3]&1<<e%8)!==0}return!0}setValid(t,e){if(!this.nullable)return e;if(!this.nullBitmap||this.nullBitmap.byteLength<=t>>3){const{nullBitmap:g}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:g,_nullCount:0})}const{nullBitmap:s,offset:a}=this,c=a+t>>3,l=(a+t)%8,d=s[c]>>l&1;return e?d===0&&(s[c]|=1<<l,this._nullCount=this.nullCount+1):d===1&&(s[c]&=~(1<<l),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,s=this.length,a=this._nullCount,c=this,l=this.children){return new bt(t,e,s,a,c,l,this.dictionary)}slice(t,e){const{stride:s,typeId:a,children:c}=this,l=+(this._nullCount===0)-1,d=a===16?s:1,g=this._sliceBuffers(t,e,s,a);return this.clone(this.type,this.offset+t,e,l,g,c.length===0||this.valueOffsets?c:this._sliceChildren(c,d*t,d*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===b.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:s}=this,a=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);a[e>>3]=(1<<e-(e&-8))-1,s>0&&a.set(lc(this.offset,e,this.nullBitmap),0);const c=this.buffers;return c[In.VALIDITY]=a,this.clone(this.type,0,t,s+(t-e),c)}_sliceBuffers(t,e,s,a){let c;const{buffers:l}=this;return(c=l[In.TYPE])&&(l[In.TYPE]=c.subarray(t,t+e)),(c=l[In.OFFSET])&&(l[In.OFFSET]=c.subarray(t,t+e+1))||(c=l[In.DATA])&&(l[In.DATA]=a===6?c:c.subarray(s*t,s*(t+e))),l}_sliceChildren(t,e,s){return t.map(a=>a.slice(e,s))}}bt.prototype.children=Object.freeze([]);class Ui extends it{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:s=0,["length"]:a=0}=t;return new bt(e,s,a,0)}visitBool(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length>>3,["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitInt(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length,["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitFloat(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length,["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitUtf8(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.data),c=ot(t.nullBitmap),l=Ni(t.valueOffsets),{["length"]:d=l.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(e,s,d,g,[l,a,c])}visitBinary(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.data),c=ot(t.nullBitmap),l=Ni(t.valueOffsets),{["length"]:d=l.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(e,s,d,g,[l,a,c])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length/An(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitDate(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length/An(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitTimestamp(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length/An(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitTime(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length/An(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitDecimal(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length/An(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitList(t){const{["type"]:e,["offset"]:s=0,["child"]:a}=t,c=ot(t.nullBitmap),l=Ni(t.valueOffsets),{["length"]:d=l.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(e,s,d,g,[l,void 0,c],[a])}visitStruct(t){const{["type"]:e,["offset"]:s=0,["children"]:a=[]}=t,c=ot(t.nullBitmap),{length:l=a.reduce((g,{length:w})=>Math.max(g,w),0),nullCount:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,void 0,c],a)}visitUnion(t){const{["type"]:e,["offset"]:s=0,["children"]:a=[]}=t,c=ot(t.nullBitmap),l=_t(e.ArrayType,t.typeIds),{["length"]:d=l.length,["nullCount"]:g=t.nullBitmap?-1:0}=t;if(P.isSparseUnion(e))return new bt(e,s,d,g,[void 0,void 0,c,l],a);const w=Ni(t.valueOffsets);return new bt(e,s,d,g,[w,void 0,c,l],a)}visitDictionary(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.indices.ArrayType,t.data),{["dictionary"]:l=new lt([new Ui().visit({type:e.dictionary})])}=t,{["length"]:d=c.length,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(e,s,d,g,[void 0,c,a],[],l)}visitInterval(t){const{["type"]:e,["offset"]:s=0}=t,a=ot(t.nullBitmap),c=_t(e.ArrayType,t.data),{["length"]:l=c.length/An(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,c,a])}visitFixedSizeList(t){const{["type"]:e,["offset"]:s=0,["child"]:a=new Ui().visit({type:e.valueType})}=t,c=ot(t.nullBitmap),{["length"]:l=a.length/An(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new bt(e,s,l,d,[void 0,void 0,c],[a])}visitMap(t){const{["type"]:e,["offset"]:s=0,["child"]:a=new Ui().visit({type:e.childType})}=t,c=ot(t.nullBitmap),l=Ni(t.valueOffsets),{["length"]:d=l.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(e,s,d,g,[l,void 0,c],[a])}}function rt(r){return new Ui().visit(r)}class gh{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}function ip(r){return r.reduce((t,e)=>t+e.nullCount,0)}function sp(r){return r.reduce((t,e,s)=>(t[s+1]=t[s]+e.length,t),new Uint32Array(r.length+1))}function op(r,t,e,s){const a=[];for(let c=-1,l=r.length;++c<l;){const d=r[c],g=t[c],{length:w}=d;if(g>=s)break;if(e>=g+w)continue;if(g>=e&&g+w<=s){a.push(d);continue}const O=Math.max(0,e-g),D=Math.min(s-g,w);a.push(d.slice(O,D-O))}return a.length===0&&a.push(r[0].slice(0,0)),a}function hc(r,t,e,s){let a=0,c=0,l=t.length-1;do{if(a>=l-1)return e<t[l]?s(r,a,e-t[a]):null;c=a+Math.trunc((l-a)*.5),e<t[c]?l=c:a=c}while(a<l)}function dc(r,t){return r.getValid(t)}function Qr(r){function t(e,s,a){return r(e[s],a)}return function(e){const s=this.data;return hc(s,this._offsets,e,t)}}function ap(r){let t;function e(s,a,c){return r(s[a],c,t)}return function(s,a){const c=this.data;t=a;const l=hc(c,this._offsets,s,e);return t=void 0,l}}function up(r){let t;function e(s,a,c){let l=c,d=0,g=0;for(let w=a-1,O=s.length;++w<O;){const D=s[w];if(~(d=r(D,t,l)))return g+d;l=0,g+=D.length}return-1}return function(s,a){t=s;const c=this.data,l=typeof a!="number"?e(c,0,0):hc(c,this._offsets,a,e);return t=void 0,l}}class $ extends it{}function US(r,t){return t===null&&r.length>0?0:-1}function PS(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let s=0;for(const a of new fc(e,r.offset+(t||0),r.length,e,rp)){if(!a)return s;++s}return-1}function Z(r,t,e){if(t===void 0)return-1;if(t===null)return PS(r,e);const s=oe.getVisitFn(r),a=ci(t);for(let c=(e||0)-1,l=r.length;++c<l;)if(a(s(r,c)))return c;return-1}function cp(r,t,e){const s=oe.getVisitFn(r),a=ci(t);for(let c=(e||0)-1,l=r.length;++c<l;)if(a(s(r,c)))return c;return-1}$.prototype.visitNull=US;$.prototype.visitBool=Z;$.prototype.visitInt=Z;$.prototype.visitInt8=Z;$.prototype.visitInt16=Z;$.prototype.visitInt32=Z;$.prototype.visitInt64=Z;$.prototype.visitUint8=Z;$.prototype.visitUint16=Z;$.prototype.visitUint32=Z;$.prototype.visitUint64=Z;$.prototype.visitFloat=Z;$.prototype.visitFloat16=Z;$.prototype.visitFloat32=Z;$.prototype.visitFloat64=Z;$.prototype.visitUtf8=Z;$.prototype.visitBinary=Z;$.prototype.visitFixedSizeBinary=Z;$.prototype.visitDate=Z;$.prototype.visitDateDay=Z;$.prototype.visitDateMillisecond=Z;$.prototype.visitTimestamp=Z;$.prototype.visitTimestampSecond=Z;$.prototype.visitTimestampMillisecond=Z;$.prototype.visitTimestampMicrosecond=Z;$.prototype.visitTimestampNanosecond=Z;$.prototype.visitTime=Z;$.prototype.visitTimeSecond=Z;$.prototype.visitTimeMillisecond=Z;$.prototype.visitTimeMicrosecond=Z;$.prototype.visitTimeNanosecond=Z;$.prototype.visitDecimal=Z;$.prototype.visitList=Z;$.prototype.visitStruct=Z;$.prototype.visitUnion=Z;$.prototype.visitDenseUnion=cp;$.prototype.visitSparseUnion=cp;$.prototype.visitDictionary=Z;$.prototype.visitInterval=Z;$.prototype.visitIntervalDayTime=Z;$.prototype.visitIntervalYearMonth=Z;$.prototype.visitFixedSizeList=Z;$.prototype.visitMap=Z;const wo=new $;class V extends it{}function Y(r){const{type:t}=r;if(r.nullCount===0&&r.stride===1&&(t.typeId===b.Timestamp||t instanceof Zn&&t.bitWidth!==64||t instanceof ji&&t.bitWidth!==64||t instanceof ki&&t.precision!==ie.HALF))return new gh(r.data.length,s=>{const a=r.data[s];return a.values.subarray(0,a.length)[Symbol.iterator]()});let e=0;return new gh(r.data.length,s=>{const c=r.data[s].length,l=r.slice(e,e+c);return e+=c,new zS(l)})}class zS{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}}V.prototype.visitNull=Y;V.prototype.visitBool=Y;V.prototype.visitInt=Y;V.prototype.visitInt8=Y;V.prototype.visitInt16=Y;V.prototype.visitInt32=Y;V.prototype.visitInt64=Y;V.prototype.visitUint8=Y;V.prototype.visitUint16=Y;V.prototype.visitUint32=Y;V.prototype.visitUint64=Y;V.prototype.visitFloat=Y;V.prototype.visitFloat16=Y;V.prototype.visitFloat32=Y;V.prototype.visitFloat64=Y;V.prototype.visitUtf8=Y;V.prototype.visitBinary=Y;V.prototype.visitFixedSizeBinary=Y;V.prototype.visitDate=Y;V.prototype.visitDateDay=Y;V.prototype.visitDateMillisecond=Y;V.prototype.visitTimestamp=Y;V.prototype.visitTimestampSecond=Y;V.prototype.visitTimestampMillisecond=Y;V.prototype.visitTimestampMicrosecond=Y;V.prototype.visitTimestampNanosecond=Y;V.prototype.visitTime=Y;V.prototype.visitTimeSecond=Y;V.prototype.visitTimeMillisecond=Y;V.prototype.visitTimeMicrosecond=Y;V.prototype.visitTimeNanosecond=Y;V.prototype.visitDecimal=Y;V.prototype.visitList=Y;V.prototype.visitStruct=Y;V.prototype.visitUnion=Y;V.prototype.visitDenseUnion=Y;V.prototype.visitSparseUnion=Y;V.prototype.visitDictionary=Y;V.prototype.visitInterval=Y;V.prototype.visitIntervalDayTime=Y;V.prototype.visitIntervalYearMonth=Y;V.prototype.visitFixedSizeList=Y;V.prototype.visitMap=Y;const pc=new V,$S=(r,t)=>r+t;class nr extends it{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===at.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((s,a)=>s+cn.visit(a,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((s,a)=>s+cn.visit(a,e),0)}visitDictionary(t,e){var s;return t.type.indices.bitWidth/8+(((s=t.dictionary)===null||s===void 0?void 0:s.getByteLength(t.values[e]))||0)}}const VS=({valueOffsets:r},t)=>8+(r[t+1]-r[t]),WS=({valueOffsets:r},t)=>8+(r[t+1]-r[t]),kS=({valueOffsets:r,stride:t,children:e},s)=>{const a=e[0],{[s*t]:c}=r,{[s*t+1]:l}=r,d=cn.getVisitFn(a.type),g=a.slice(c,l-c);let w=8;for(let O=-1,D=l-c;++O<D;)w+=d(g,O);return w},jS=({stride:r,children:t},e)=>{const s=t[0],a=s.slice(e*r,r),c=cn.getVisitFn(s.type);let l=0;for(let d=-1,g=a.length;++d<g;)l+=c(a,d);return l},HS=(r,t)=>r.type.mode===_e.Dense?lp(r,t):fp(r,t),lp=({type:r,children:t,typeIds:e,valueOffsets:s},a)=>{const c=r.typeIdToChildIndex[e[a]];return 8+cn.visit(t[c],s[a])},fp=({children:r},t)=>4+cn.visitMany(r,r.map(()=>t)).reduce($S,0);nr.prototype.visitUtf8=VS;nr.prototype.visitBinary=WS;nr.prototype.visitList=kS;nr.prototype.visitFixedSizeList=jS;nr.prototype.visitUnion=HS;nr.prototype.visitDenseUnion=lp;nr.prototype.visitSparseUnion=fp;const cn=new nr;var hp;const dp={},pp={};class lt{constructor(t){var e,s,a;const c=t[0]instanceof lt?t.flatMap(d=>d.data):t;if(c.length===0||c.some(d=>!(d instanceof bt)))throw new TypeError("Vector constructor expects an Array of Data instances.");const l=(e=c[0])===null||e===void 0?void 0:e.type;switch(c.length){case 0:this._offsets=[0];break;case 1:{const{get:d,set:g,indexOf:w,byteLength:O}=dp[l.typeId],D=c[0];this.isValid=M=>dc(D,M),this.get=M=>d(D,M),this.set=(M,X)=>g(D,M,X),this.indexOf=M=>w(D,M),this.getByteLength=M=>O(D,M),this._offsets=[0,D.length];break}default:Object.setPrototypeOf(this,pp[l.typeId]),this._offsets=sp(c);break}this.data=c,this.type=l,this.stride=An(l),this.numChildren=(a=(s=l.children)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,e)=>t+e.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=ip(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${b[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>0}getByteLength(t){return 0}[Symbol.iterator](){return pc.visit(this)}concat(...t){return new lt(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new lt(np(this,t,e,({data:s,_offsets:a},c,l)=>op(s,a,c,l)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:s,stride:a,ArrayType:c}=this;switch(t.typeId){case b.Int:case b.Float:case b.Decimal:case b.Time:case b.Timestamp:switch(e.length){case 0:return new c;case 1:return e[0].values.subarray(0,s*a);default:return e.reduce((l,{values:d,length:g})=>(l.array.set(d.subarray(0,g*a),l.offset),l.offset+=g*a,l),{array:new c(s*a),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(s=>s.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new lt(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return P.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(P.isDictionary(this.type)){const t=new So(this.data[0].dictionary),e=this.data.map(s=>{const a=s.clone();return a.dictionary=t,a});return new lt(e)}return new So(this)}unmemoize(){if(P.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(s=>{const a=s.clone();return a.dictionary=t,a});return new lt(e)}return this}}hp=Symbol.toStringTag;lt[hp]=(r=>{r.type=P.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._nullCount=-1,r._byteLength=-1,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(b).map(e=>b[e]).filter(e=>typeof e=="number"&&e!==b.NONE);for(const e of t){const s=oe.getVisitFnByTypeId(e),a=Me.getVisitFnByTypeId(e),c=wo.getVisitFnByTypeId(e),l=cn.getVisitFnByTypeId(e);dp[e]={get:s,set:a,indexOf:c,byteLength:l},pp[e]=Object.create(r,{isValid:{value:Qr(dc)},get:{value:Qr(oe.getVisitFnByTypeId(e))},set:{value:ap(Me.getVisitFnByTypeId(e))},indexOf:{value:up(wo.getVisitFnByTypeId(e))},getByteLength:{value:Qr(cn.getVisitFnByTypeId(e))}})}return"Vector"})(lt.prototype);class So extends lt{constructor(t){super(t.data);const e=this.get,s=this.set,a=this.slice,c=new Array(this.length);Object.defineProperty(this,"get",{value(l){const d=c[l];if(d!==void 0)return d;const g=e.call(this,l);return c[l]=g,g}}),Object.defineProperty(this,"set",{value(l,d){s.call(this,l,d),c[l]=d}}),Object.defineProperty(this,"slice",{value:(l,d)=>new So(a.call(this,l,d))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new lt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class Uu{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,e,s,a){return t.prep(8,24),t.writeInt64(a),t.pad(4),t.writeInt32(s),t.writeInt64(e),t.offset()}}const Au=2,tn=4,On=4,mt=4,Yn=new Int32Array(2),_h=new Float32Array(Yn.buffer),mh=new Float64Array(Yn.buffer),Zs=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;let Dn=class Pu{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Pu.ZERO:new Pu(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};Dn.ZERO=new Dn(0,0);var zu;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(zu||(zu={}));let ei=class yp{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new yp(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new Dn(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new Dn(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return Yn[0]=this.readInt32(t),_h[0]}readFloat64(t){return Yn[Zs?0:1]=this.readInt32(t),Yn[Zs?1:0]=this.readInt32(t+4),mh[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){_h[0]=e,this.writeInt32(t,Yn[0])}writeFloat64(t,e){mh[0]=e,this.writeInt32(t,Yn[Zs?0:1]),this.writeInt32(t+4,Yn[Zs?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+tn+On)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<On;e++)t+=String.fromCharCode(this.readInt8(this.position_+tn+e));return t}__offset(t,e){const s=t-this.readInt32(t);return e<this.readInt16(s)?this.readInt16(s+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const s=this.readInt32(t);let a="",c=0;if(t+=tn,e===zu.UTF8_BYTES)return this.bytes_.subarray(t,t+s);for(;c<s;){let l;const d=this.readUint8(t+c++);if(d<192)l=d;else{const g=this.readUint8(t+c++);if(d<224)l=(d&31)<<6|g&63;else{const w=this.readUint8(t+c++);if(d<240)l=(d&15)<<12|(g&63)<<6|w&63;else{const O=this.readUint8(t+c++);l=(d&7)<<18|(g&63)<<12|(w&63)<<6|O&63}}}l<65536?a+=String.fromCharCode(l):(l-=65536,a+=String.fromCharCode((l>>10)+55296,(l&1023)+56320))}return a}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+tn}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=On)throw new Error("FlatBuffers: file identifier must be length "+On);for(let e=0;e<On;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+tn+e))return!1;return!0}createLong(t,e){return Dn.create(t,e)}createScalarList(t,e){const s=[];for(let a=0;a<e;++a)t(a)!==null&&s.push(t(a));return s}createObjList(t,e){const s=[];for(let a=0;a<e;++a){const c=t(a);c!==null&&s.push(c.unpack())}return s}},gp=class _p{constructor(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,this.string_maps=null;let e;t?e=t:e=1024,this.bb=ei.allocate(e),this.space=e}clear(){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,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);const s=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<s+t+e;){const a=this.bb.capacity();this.bb=_p.growByteBuffer(this.bb),this.space+=this.bb.capacity()-a}this.pad(s)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,s){(this.force_defaults||e!=s)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,s){(this.force_defaults||e!=s)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,s){(this.force_defaults||e!=s)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,s){(this.force_defaults||!e.equals(s))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,s){(this.force_defaults||e!=s)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,s){(this.force_defaults||e!=s)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,s){(this.force_defaults||e!=s)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,s){e!=s&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const s=e<<1,a=ei.allocate(s);return a.setPosition(s-e),a.bytes().set(t.bytes(),s-e),a}addOffset(t){this.prep(tn,0),this.writeInt32(this.offset()-t+tn)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const s=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const a=2;this.addInt16(t-this.object_start);const c=(s+a)*Au;this.addInt16(c);let l=0;const d=this.space;t:for(e=0;e<this.vtables.length;e++){const g=this.bb.capacity()-this.vtables[e];if(c==this.bb.readInt16(g)){for(let w=Au;w<c;w+=Au)if(this.bb.readInt16(d+w)!=this.bb.readInt16(g+w))continue t;l=this.vtables[e];break}}return l?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,l-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,s){const a=s?mt:0;if(e){const c=e;if(this.prep(this.minalign,tn+On+a),c.length!=On)throw new Error("FlatBuffers: file identifier must be length "+On);for(let l=On-1;l>=0;l--)this.writeInt8(c.charCodeAt(l))}this.prep(this.minalign,tn+a),this.addOffset(t),a&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const s=this.bb.capacity()-t,a=s-this.bb.readInt32(s);if(!(this.bb.readInt16(a+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,s){this.notNested(),this.vector_num_elems=e,this.prep(tn,t*e),this.prep(s,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(!t)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let s=0;for(;s<t.length;){let a;const c=t.charCodeAt(s++);if(c<55296||c>=56320)a=c;else{const l=t.charCodeAt(s++);a=(c<<10)+l+-56613888}a<128?e.push(a):(a<2048?e.push(a>>6&31|192):(a<65536?e.push(a>>12&15|224):e.push(a>>18&7|240,a>>12&63|128),e.push(a>>6&63|128)),e.push(a&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let s=0,a=this.space,c=this.bb.bytes();s<e.length;s++)c[a++]=e[s];return this.endVector()}createLong(t,e){return Dn.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let s=0;s<t.length;++s){const a=t[s];if(a!==null)e.push(this.createObjectOffset(a));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}};class Et{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,e){return(e||new Et).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+mt),(e||new Et).__init(t.readInt32(t.position())+t.position(),t)}key(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,e,s){return Et.startKeyValue(t),Et.addKey(t,e),Et.addValue(t,s),Et.endKeyValue(t)}}var ni;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(ni||(ni={}));var ri;(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(ri||(ri={}));var Io;(function(r){r[r.DenseArray=0]="DenseArray"})(Io||(Io={}));class ye{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,e){return(e||new ye).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+mt),(e||new ye).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt32(0,e,0)}static addIsSigned(t,e){t.addFieldInt8(1,+e,0)}static endInt(t){return t.endObject()}static createInt(t,e,s){return ye.startInt(t),ye.addBitWidth(t,e),ye.addIsSigned(t,s),ye.endInt(t)}}class Fn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new Fn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+mt),(e||new Fn).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}indexType(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new ye).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Io.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,Io.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}class yr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,e){return(e||new yr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+mt),(e||new yr).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return yr.startBinary(t),yr.endBinary(t)}}class gr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,e){return(e||new gr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+mt),(e||new gr).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return gr.startBool(t),gr.endBool(t)}}var Ao;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Ao||(Ao={}));let to=class Hr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new Hr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+mt),(e||new Hr).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ao.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Ao.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return Hr.startDate(t),Hr.addUnit(t,e),Hr.endDate(t)}};class ee{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,e){return(e||new ee).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+mt),(e||new ee).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static addBitWidth(t,e){t.addFieldInt32(2,e,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,e,s,a){return ee.startDecimal(t),ee.addPrecision(t,e),ee.addScale(t,s),ee.addBitWidth(t,a),ee.endDecimal(t)}}var ii;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(ii||(ii={}));class en{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,e){return(e||new en).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+mt),(e||new en).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,e){return en.startFixedSizeBinary(t),en.addByteWidth(t,e),en.endFixedSizeBinary(t)}}class nn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,e){return(e||new nn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+mt),(e||new nn).__init(t.readInt32(t.position())+t.position(),t)}listSize(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,e){return nn.startFixedSizeList(t),nn.addListSize(t,e),nn.endFixedSizeList(t)}}var Bo;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(Bo||(Bo={}));class rn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new rn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+mt),(e||new rn).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Bo.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Bo.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return rn.startFloatingPoint(t),rn.addPrecision(t,e),rn.endFloatingPoint(t)}}var Oo;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Oo||(Oo={}));class sn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new sn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+mt),(e||new sn).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Oo.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Oo.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return sn.startInterval(t),sn.addUnit(t,e),sn.endInterval(t)}}class _r{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,e){return(e||new _r).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+mt),(e||new _r).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return _r.startList(t),_r.endList(t)}}let eo=class Yr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,e){return(e||new Yr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+mt),(e||new Yr).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){const t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}static createMap(t,e){return Yr.startMap(t),Yr.addKeysSorted(t,e),Yr.endMap(t)}};class mr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,e){return(e||new mr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+mt),(e||new mr).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return mr.startNull(t),mr.endNull(t)}}class vr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,e){return(e||new vr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+mt),(e||new vr).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return vr.startStruct_(t),vr.endStruct_(t)}}class Te{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new Te).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+mt),(e||new Te).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ii.MILLISECOND}bitWidth(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,ii.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,s){return Te.startTime(t),Te.addUnit(t,e),Te.addBitWidth(t,s),Te.endTime(t)}}class Le{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new Le).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+mt),(e||new Le).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ii.SECOND}timezone(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,ii.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,s){return Le.startTimestamp(t),Le.addUnit(t,e),Le.addTimezone(t,s),Le.endTimestamp(t)}}var Fo;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(Fo||(Fo={}));class ne{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new ne).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+mt),(e||new ne).__init(t.readInt32(t.position())+t.position(),t)}mode(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Fo.Sparse}typeIds(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+t*4):0}typeIdsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){const t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,e){t.addFieldInt16(0,e,Fo.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let s=e.length-1;s>=0;s--)t.addInt32(e[s]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,s){return ne.startUnion(t),ne.addMode(t,e),ne.addTypeIds(t,s),ne.endUnion(t)}}class br{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new br).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+mt),(e||new br).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return br.startUtf8(t),br.endUtf8(t)}}var Ot;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList"})(Ot||(Ot={}));let De=class no{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new no).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+mt),(e||new no).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Ot.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new Fn).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const s=this.bb.__offset(this.bb_pos,14);return s?(e||new no).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const s=this.bb.__offset(this.bb_pos,16);return s?(e||new Et).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,Ot.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let s=e.length-1;s>=0;s--)t.addOffset(e[s]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let s=e.length-1;s>=0;s--)t.addOffset(e[s]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},Ze=class Sn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+mt),(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ri.Little}fields(t,e){const s=this.bb.__offset(this.bb_pos,6);return s?(e||new De).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const s=this.bb.__offset(this.bb_pos,8);return s?(e||new Et).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):this.bb.createLong(0,0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,ri.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let s=e.length-1;s>=0;s--)t.addOffset(e[s]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let s=e.length-1;s>=0;s--)t.addOffset(e[s]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let s=e.length-1;s>=0;s--)t.addInt64(e[s]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,s,a,c){return Sn.startSchema(t),Sn.addEndianness(t,e),Sn.addFields(t,s),Sn.addCustomMetadata(t,a),Sn.addFeatures(t,c),Sn.endSchema(t)}};class pe{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new pe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+mt),(e||new pe).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ni.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Ze).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const s=this.bb.__offset(this.bb_pos,8);return s?(e||new Uu).__init(this.bb.__vector(this.bb_pos+s)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const s=this.bb.__offset(this.bb_pos,10);return s?(e||new Uu).__init(this.bb.__vector(this.bb_pos+s)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const s=this.bb.__offset(this.bb_pos,12);return s?(e||new Et).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ni.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let s=e.length-1;s>=0;s--)t.addOffset(e[s]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}class ft{constructor(t=[],e,s){this.fields=t||[],this.metadata=e||new Map,s||(s=$u(t)),this.dictionaries=s}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){const e=new Set(t),s=this.fields.filter(a=>e.has(a.name));return new ft(s,this.metadata)}selectAt(t){const e=t.map(s=>this.fields[s]).filter(Boolean);return new ft(e,this.metadata)}assign(...t){const e=t[0]instanceof ft?t[0]:Array.isArray(t[0])?new ft(t[0]):new ft(t),s=[...this.fields],a=Xs(Xs(new Map,this.metadata),e.metadata),c=e.fields.filter(d=>{const g=s.findIndex(w=>w.name===d.name);return~g?(s[g]=d.clone({metadata:Xs(Xs(new Map,s[g].metadata),d.metadata)}))&&!1:!0}),l=$u(c,new Map);return new ft([...s,...c],a,new Map([...this.dictionaries,...l]))}}ft.prototype.fields=null;ft.prototype.metadata=null;ft.prototype.dictionaries=null;class St{constructor(t,e,s=!1,a){this.name=t,this.type=e,this.nullable=s,this.metadata=a||new Map}static new(...t){let[e,s,a,c]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],s===void 0&&(s=t[0].type),a===void 0&&(a=t[0].nullable),c===void 0&&(c=t[0].metadata)),new St(`${e}`,s,a,c)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,s,a,c]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,s=this.type,a=this.nullable,c=this.metadata]=t:{name:e=this.name,type:s=this.type,nullable:a=this.nullable,metadata:c=this.metadata}=t[0],St.new(e,s,a,c)}}St.prototype.type=null;St.prototype.name=null;St.prototype.nullable=null;St.prototype.metadata=null;function Xs(r,t){return new Map([...r||new Map,...t||new Map])}function $u(r,t=new Map){for(let e=-1,s=r.length;++e<s;){const c=r[e].type;if(P.isDictionary(c)){if(!t.has(c.id))t.set(c.id,c.dictionary);else if(t.get(c.id)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}c.children&&c.children.length>0&&$u(c.children,t)}return t}var vh=Dn,YS=gp,GS=ei;class Hi{constructor(t,e=ge.V4,s,a){this.schema=t,this.version=e,s&&(this._recordBatches=s),a&&(this._dictionaryBatches=a)}static decode(t){t=new GS(ot(t));const e=pe.getRootAsFooter(t),s=ft.decode(e.schema());return new KS(s,e)}static encode(t){const e=new YS,s=ft.encode(e,t.schema);pe.startRecordBatchesVector(e,t.numRecordBatches);for(const l of[...t.recordBatches()].slice().reverse())Xn.encode(e,l);const a=e.endVector();pe.startDictionariesVector(e,t.numDictionaries);for(const l of[...t.dictionaryBatches()].slice().reverse())Xn.encode(e,l);const c=e.endVector();return pe.startFooter(e),pe.addSchema(e,s),pe.addVersion(e,ge.V4),pe.addRecordBatches(e,a),pe.addDictionaries(e,c),pe.finishFooterBuffer(e,pe.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,e=-1,s=this.numRecordBatches;++e<s;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,s=this.numDictionaries;++e<s;)(t=this.getDictionaryBatch(e))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}}class KS extends Hi{constructor(t,e){super(t,e.version()),this._footer=e}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const e=this._footer.recordBatches(t);if(e)return Xn.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t);if(e)return Xn.decode(e)}return null}}class Xn{constructor(t,e,s){this.metaDataLength=t,this.offset=typeof s=="number"?s:s.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new Xn(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:s}=e,a=new vh(e.offset,0),c=new vh(e.bodyLength,0);return Uu.createBlock(t,a,s,c)}}const Ft=Object.freeze({done:!0,value:void 0});class bh{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class yc{tee(){return this._getDOMStream().tee()}pipe(t,e){return this._getNodeStream().pipe(t,e)}pipeTo(t,e){return this._getDOMStream().pipeTo(t,e)}pipeThrough(t,e){return this._getDOMStream().pipeThrough(t,e)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class JS extends yc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return C(this,void 0,void 0,function*(){yield 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(Ft);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return xe.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return xe.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return C(this,void 0,void 0,function*(){return yield this.abort(t),Ft})}return(t){return C(this,void 0,void 0,function*(){return yield this.close(),Ft})}read(t){return C(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return C(this,void 0,void 0,function*(){return(yield 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((e,s)=>{this.resolvers.push({resolve:e,reject:s})}):Promise.resolve(Ft)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class ro extends JS{write(t){if((t=ot(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Mu(this.toUint8Array(!0)):this.toUint8Array(!1).then(Mu)}toUint8Array(t=!1){return t?un(this._values)[0]:C(this,void 0,void 0,function*(){var e,s;const a=[];let c=0;try{for(var l=wr(this),d;d=yield l.next(),!d.done;){const g=d.value;a.push(g),c+=g.byteLength}}catch(g){e={error:g}}finally{try{d&&!d.done&&(s=l.return)&&(yield s.call(l))}finally{if(e)throw e.error}}return un(a,c)[0]})}}class Do{constructor(t){t&&(this.source=new qS(xe.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 si{constructor(t){t instanceof si?this.source=t.source:t instanceof ro?this.source=new pr(xe.fromAsyncIterable(t)):Qh(t)?this.source=new pr(xe.fromNodeStream(t)):ec(t)?this.source=new pr(xe.fromDOMStream(t)):Xh(t)?this.source=new pr(xe.fromDOMStream(t.body)):Zi(t)?this.source=new pr(xe.fromIterable(t)):Kn(t)?this.source=new pr(xe.fromAsyncIterable(t)):ui(t)&&(this.source=new pr(xe.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 qS{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||Ft)}return(t){return Object.create(this.source.return&&this.source.return(t)||Ft)}}class pr{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return C(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return C(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return C(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return C(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return C(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||Ft;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return C(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||Ft;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class wh extends Do{constructor(t,e){super(),this.position=0,this.buffer=ot(t),this.size=typeof e>"u"?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:s}=this.readAt(t,4);return new DataView(e,s).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:e,size:s,position:a}=this;return e&&a<s?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(s,a+Math.min(s-a,t)),e.subarray(a,this.position)):null}readAt(t,e){const s=this.buffer,a=Math.min(this.size,t+e);return s?s.subarray(t,a):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}}class xo extends si{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=C(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return C(this,void 0,void 0,function*(){const{buffer:e,byteOffset:s}=yield this.readAt(t,4);return new DataView(e,s).getInt32(0,!0)})}seek(t){return C(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return C(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:e,size:s,position:a}=this;if(e&&a<s){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let c=a,l=0,d=0;const g=Math.min(s,c+Math.min(s-c,t)),w=new Uint8Array(Math.max(0,(this.position=g)-c));for(;(c+=d)<g&&(l+=d)<w.byteLength;)({bytesRead:d}=yield e.read(w,l,w.byteLength-l,c));return w}return null})}readAt(t,e){return C(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:s,size:a}=this;if(s&&t+e<a){const c=Math.min(a,t+e),l=new Uint8Array(c-t);return(yield s.read(l,0,e,t)).buffer}return new Uint8Array(e)})}close(){return C(this,void 0,void 0,function*(){const t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return C(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return C(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}const ZS=65536;function Kr(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const oi=8,gc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class mp{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),s=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let a=e[3]*s[3];this.buffer[0]=a&65535;let c=a>>>16;return a=e[2]*s[3],c+=a,a=e[3]*s[2]>>>0,c+=a,this.buffer[0]+=c<<16,this.buffer[1]=c>>>0<a?ZS:0,this.buffer[1]+=c>>>16,this.buffer[1]+=e[1]*s[3]+e[2]*s[2]+e[3]*s[1],this.buffer[1]+=e[0]*s[3]+e[1]*s[2]+e[2]*s[1]+e[3]*s[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Kr(this.buffer[1])} ${Kr(this.buffer[0])}`}}class dt extends mp{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return dt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return dt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const s=t.length,a=new dt(e);for(let c=0;c<s;){const l=oi<s-c?oi:s-c,d=new dt(new Uint32Array([Number.parseInt(t.slice(c,c+l),10),0])),g=new dt(new Uint32Array([gc[l],0]));a.times(g),a.plus(d),c+=l}return a}static convertArray(t){const e=new Uint32Array(t.length*2);for(let s=-1,a=t.length;++s<a;)dt.from(t[s],new Uint32Array(e.buffer,e.byteOffset+2*s*4,2));return e}static multiply(t,e){return new dt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new dt(new Uint32Array(t.buffer)).plus(e)}}class te extends mp{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 e=this.buffer[1]<<0,s=t.buffer[1]<<0;return e<s||e===s&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return te.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return te.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const s=t.startsWith("-"),a=t.length,c=new te(e);for(let l=s?1:0;l<a;){const d=oi<a-l?oi:a-l,g=new te(new Uint32Array([Number.parseInt(t.slice(l,l+d),10),0])),w=new te(new Uint32Array([gc[d],0]));c.times(w),c.plus(g),l+=d}return s?c.negate():c}static convertArray(t){const e=new Uint32Array(t.length*2);for(let s=-1,a=t.length;++s<a;)te.from(t[s],new Uint32Array(e.buffer,e.byteOffset+2*s*4,2));return e}static multiply(t,e){return new te(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new te(new Uint32Array(t.buffer)).plus(e)}}class Xe{constructor(t){this.buffer=t}high(){return new te(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new te(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 e=new dt(new Uint32Array([this.buffer[3],0])),s=new dt(new Uint32Array([this.buffer[2],0])),a=new dt(new Uint32Array([this.buffer[1],0])),c=new dt(new Uint32Array([this.buffer[0],0])),l=new dt(new Uint32Array([t.buffer[3],0])),d=new dt(new Uint32Array([t.buffer[2],0])),g=new dt(new Uint32Array([t.buffer[1],0])),w=new dt(new Uint32Array([t.buffer[0],0]));let O=dt.multiply(c,w);this.buffer[0]=O.low();const D=new dt(new Uint32Array([O.high(),0]));return O=dt.multiply(a,w),D.plus(O),O=dt.multiply(c,g),D.plus(O),this.buffer[1]=D.low(),this.buffer[3]=D.lessThan(O)?1:0,this.buffer[2]=D.high(),new dt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(dt.multiply(s,w)).plus(dt.multiply(a,g)).plus(dt.multiply(c,d)),this.buffer[3]+=dt.multiply(e,w).plus(dt.multiply(s,g)).plus(dt.multiply(a,d)).plus(dt.multiply(c,l)).low(),this}plus(t){const e=new Uint32Array(4);return e[3]=this.buffer[3]+t.buffer[3]>>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]<this.buffer[0]>>>0&&++e[1],e[1]<this.buffer[1]>>>0&&++e[2],e[2]<this.buffer[2]>>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Kr(this.buffer[3])} ${Kr(this.buffer[2])} ${Kr(this.buffer[1])} ${Kr(this.buffer[0])}`}static multiply(t,e){return new Xe(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Xe(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Xe.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Xe.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const s=t.startsWith("-"),a=t.length,c=new Xe(e);for(let l=s?1:0;l<a;){const d=oi<a-l?oi:a-l,g=new Xe(new Uint32Array([Number.parseInt(t.slice(l,l+d),10),0,0,0])),w=new Xe(new Uint32Array([gc[d],0,0,0]));c.times(w),c.plus(g),l+=d}return s?c.negate():c}static convertArray(t){const e=new Uint32Array(t.length*4);for(let s=-1,a=t.length;++s<a;)Xe.from(t[s],new Uint32Array(e.buffer,e.byteOffset+4*4*s,4));return e}}class vp extends it{constructor(t,e,s,a){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=s,this.dictionaries=a}visit(t){return super.visit(t instanceof St?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return rt({type:t,length:e})}visitBool(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitInt(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitDate(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitTime(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitList(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===_e.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:s}=this.nextFieldNode()){return rt({type:t,length:e,nullCount:s,nullBitmap:this.readNullBitmap(t,s),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e,s=this.nextBufferRange()){return e>0&&this.readData(t,s)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:s}=this.nextBufferRange()){return this.bytes.subarray(s,s+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class XS extends vp{constructor(t,e,s,a){super(new Uint8Array(0),e,s,a),this.sources=t}readNullBitmap(t,e,{offset:s}=this.nextBufferRange()){return e<=0?new Uint8Array(0):bo(this.sources[s])}readOffsets(t,{offset:e}=this.nextBufferRange()){return _t(Uint8Array,_t(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return _t(Uint8Array,_t(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:s}=this;return P.isTimestamp(t)||(P.isInt(t)||P.isTime(t))&&t.bitWidth===64||P.isDate(t)&&t.unit===Tn.MILLISECOND?_t(Uint8Array,te.convertArray(s[e])):P.isDecimal(t)?_t(Uint8Array,Xe.convertArray(s[e])):P.isBinary(t)||P.isFixedSizeBinary(t)?QS(s[e]):P.isBool(t)?bo(s[e]):P.isUtf8(t)?tc(s[e].join("")):_t(Uint8Array,_t(t.ArrayType,s[e].map(a=>+a)))}}function QS(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let s=0;s<t.length;s+=2)e[s>>1]=Number.parseInt(t.slice(s,s+2),16);return e}class W extends it{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((s,a)=>this.compareFields(s,e[a]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function ae(r,t){return t instanceof r.constructor}function Xi(r,t){return r===t||ae(r,t)}function Rn(r,t){return r===t||ae(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function qo(r,t){return r===t||ae(r,t)&&r.precision===t.precision}function tI(r,t){return r===t||ae(r,t)&&r.byteWidth===t.byteWidth}function _c(r,t){return r===t||ae(r,t)&&r.unit===t.unit}function Qi(r,t){return r===t||ae(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function ts(r,t){return r===t||ae(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function eI(r,t){return r===t||ae(r,t)&&r.children.length===t.children.length&&Qn.compareManyFields(r.children,t.children)}function nI(r,t){return r===t||ae(r,t)&&r.children.length===t.children.length&&Qn.compareManyFields(r.children,t.children)}function mc(r,t){return r===t||ae(r,t)&&r.mode===t.mode&&r.typeIds.every((e,s)=>e===t.typeIds[s])&&Qn.compareManyFields(r.children,t.children)}function rI(r,t){return r===t||ae(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Qn.visit(r.indices,t.indices)&&Qn.visit(r.dictionary,t.dictionary)}function vc(r,t){return r===t||ae(r,t)&&r.unit===t.unit}function iI(r,t){return r===t||ae(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Qn.compareManyFields(r.children,t.children)}function sI(r,t){return r===t||ae(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Qn.compareManyFields(r.children,t.children)}W.prototype.visitNull=Xi;W.prototype.visitBool=Xi;W.prototype.visitInt=Rn;W.prototype.visitInt8=Rn;W.prototype.visitInt16=Rn;W.prototype.visitInt32=Rn;W.prototype.visitInt64=Rn;W.prototype.visitUint8=Rn;W.prototype.visitUint16=Rn;W.prototype.visitUint32=Rn;W.prototype.visitUint64=Rn;W.prototype.visitFloat=qo;W.prototype.visitFloat16=qo;W.prototype.visitFloat32=qo;W.prototype.visitFloat64=qo;W.prototype.visitUtf8=Xi;W.prototype.visitBinary=Xi;W.prototype.visitFixedSizeBinary=tI;W.prototype.visitDate=_c;W.prototype.visitDateDay=_c;W.prototype.visitDateMillisecond=_c;W.prototype.visitTimestamp=Qi;W.prototype.visitTimestampSecond=Qi;W.prototype.visitTimestampMillisecond=Qi;W.prototype.visitTimestampMicrosecond=Qi;W.prototype.visitTimestampNanosecond=Qi;W.prototype.visitTime=ts;W.prototype.visitTimeSecond=ts;W.prototype.visitTimeMillisecond=ts;W.prototype.visitTimeMicrosecond=ts;W.prototype.visitTimeNanosecond=ts;W.prototype.visitDecimal=Xi;W.prototype.visitList=eI;W.prototype.visitStruct=nI;W.prototype.visitUnion=mc;W.prototype.visitDenseUnion=mc;W.prototype.visitSparseUnion=mc;W.prototype.visitDictionary=rI;W.prototype.visitInterval=vc;W.prototype.visitIntervalDayTime=vc;W.prototype.visitIntervalYearMonth=vc;W.prototype.visitFixedSizeList=iI;W.prototype.visitMap=sI;const Qn=new W;function Vu(r,t){return Qn.compareSchemas(r,t)}function Bu(r,t){return oI(r,t.map(e=>e.data.concat()))}function oI(r,t){const e=[...r.fields],s=[],a={numBatches:t.reduce((D,M)=>Math.max(D,M.length),0)};let c=0,l=0,d=-1;const g=t.length;let w,O=[];for(;a.numBatches-- >0;){for(l=Number.POSITIVE_INFINITY,d=-1;++d<g;)O[d]=w=t[d].shift(),l=Math.min(l,w?w.length:l);Number.isFinite(l)&&(O=aI(e,l,O,t,a),l>0&&(s[c++]=rt({type:new Yt(e),length:l,nullCount:0,children:O.slice()})))}return[r=r.assign(e),s.map(D=>new re(r,D))]}function aI(r,t,e,s,a){var c;const l=(t+63&-64)>>3;for(let d=-1,g=s.length;++d<g;){const w=e[d],O=w==null?void 0:w.length;if(O>=t)O===t?e[d]=w:(e[d]=w.slice(0,t),a.numBatches=Math.max(a.numBatches,s[d].unshift(w.slice(t,O-t))));else{const D=r[d];r[d]=D.clone({nullable:!0}),e[d]=(c=w==null?void 0:w._changeLengthAndBackfillNullBitmap(t))!==null&&c!==void 0?c:rt({type:D.type,length:t,nullCount:t,nullBitmap:new Uint8Array(l)})}}return e}var bp;class Ht{constructor(...t){var e,s;if(t.length===0)return this.batches=[],this.schema=new ft([]),this._offsets=[0],this;let a,c;t[0]instanceof ft&&(a=t.shift()),t[t.length-1]instanceof Uint32Array&&(c=t.pop());const l=g=>{if(g){if(g instanceof re)return[g];if(g instanceof Ht)return g.batches;if(g instanceof bt){if(g.type instanceof Yt)return[new re(new ft(g.type.children),g)]}else{if(Array.isArray(g))return g.flatMap(w=>l(w));if(typeof g[Symbol.iterator]=="function")return[...g].flatMap(w=>l(w));if(typeof g=="object"){const w=Object.keys(g),O=w.map(X=>new lt([g[X]])),D=new ft(w.map((X,At)=>new St(String(X),O[At].type))),[,M]=Bu(D,O);return M.length===0?[new re(g)]:M}}}return[]},d=t.flatMap(g=>l(g));if(a=(s=a??((e=d[0])===null||e===void 0?void 0:e.schema))!==null&&s!==void 0?s:new ft([]),!(a instanceof ft))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const g of d){if(!(g instanceof re))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Vu(a,g.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=a,this.batches=d,this._offsets=c??sp(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=ip(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?pc.visit(new lt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
  ${this.toArray().join(`,
  `)}
]`}concat(...t){const e=this.schema,s=this.data.concat(t.flatMap(({data:a})=>a));return new Ht(e,s.map(a=>new re(e,a)))}slice(t,e){const s=this.schema;[t,e]=np({length:this.numRows},t,e);const a=op(this.data,this._offsets,t,e);return new Ht(s,a.map(c=>new re(s,c)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){const e=this.data.map(s=>s.children[t]);if(e.length===0){const{type:s}=this.schema.fields[t],a=rt({type:s,length:0,nullCount:0});e.push(a._changeLengthAndBackfillNullBitmap(this.numRows))}return new lt(e)}return null}setChild(t,e){var s;return this.setChildAt((s=this.schema.fields)===null||s===void 0?void 0:s.findIndex(a=>a.name===t),e)}setChildAt(t,e){let s=this.schema,a=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new lt([rt({type:new qn,length:this.numRows})]));const c=s.fields.slice(),l=c[t].clone({type:e.type}),d=this.schema.fields.map((g,w)=>this.getChildAt(w));[c[t],d[t]]=[l,e],[s,a]=Bu(s,d)}return new Ht(s,a)}select(t){const e=this.schema.fields.reduce((s,a,c)=>s.set(a.name,c),new Map);return this.selectAt(t.map(s=>e.get(s)).filter(s=>s>-1))}selectAt(t){const e=this.schema.selectAt(t),s=this.batches.map(a=>a.selectAt(t));return new Ht(e,s)}assign(t){const e=this.schema.fields,[s,a]=t.schema.fields.reduce((d,g,w)=>{const[O,D]=d,M=e.findIndex(X=>X.name===g.name);return~M?D[M]=w:O.push(w),d},[[],[]]),c=this.schema.assign(t.schema),l=[...e.map((d,g)=>[g,a[g]]).map(([d,g])=>g===void 0?this.getChildAt(d):t.getChildAt(g)),...s.map(d=>t.getChildAt(d))].filter(Boolean);return new Ht(...Bu(c,l))}}bp=Symbol.toStringTag;Ht[bp]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Qr(dc),r.get=Qr(oe.getVisitFn(b.Struct)),r.set=ap(Me.getVisitFn(b.Struct)),r.indexOf=up(wo.getVisitFn(b.Struct)),r.getByteLength=Qr(cn.getVisitFn(b.Struct)),"Table"))(Ht.prototype);var wp;let re=class Ei{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof ft))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=rt({nullCount:0,type:new Yt(this.schema.fields),children:this.schema.fields.map(e=>rt({type:e.type,nullCount:0}))})]=t,!(this.data instanceof bt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Sh(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:s,children:a,length:c}=Object.keys(e).reduce((g,w,O)=>(g.children[O]=e[w],g.length=Math.max(g.length,e[w].length),g.fields[O]=St.new({name:w,type:e[w].type,nullable:!0}),g),{length:0,fields:new Array,children:new Array}),l=new ft(s),d=rt({type:new Yt(s),length:c,children:a,nullCount:0});[this.schema,this.data]=Sh(l,d.children,c);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=Sp(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return oe.visit(this.data,t)}set(t,e){return Me.visit(this.data,t,e)}indexOf(t,e){return wo.visit(this.data,t,e)}getByteLength(t){return cn.visit(this.data,t)}[Symbol.iterator](){return pc.visit(new lt([this.data]))}toArray(){return[...this]}concat(...t){return new Ht(this.schema,[this,...t])}slice(t,e){const[s]=new lt([this.data]).slice(t,e).data;return new Ei(this.schema,s)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(s=>s.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new lt([this.data.children[t]]):null}setChild(t,e){var s;return this.setChildAt((s=this.schema.fields)===null||s===void 0?void 0:s.findIndex(a=>a.name===t),e)}setChildAt(t,e){let s=this.schema,a=this.data;if(t>-1&&t<this.numCols){e||(e=new lt([rt({type:new qn,length:this.numRows})]));const c=s.fields.slice(),l=a.children.slice(),d=c[t].clone({type:e.type});[c[t],l[t]]=[d,e.data[0]],s=new ft(c,new Map(this.schema.metadata)),a=rt({type:new Yt(c),children:l})}return new Ei(s,a)}select(t){const e=this.schema.select(t),s=new Yt(e.fields),a=[];for(const c of t){const l=this.schema.fields.findIndex(d=>d.name===c);~l&&(a[l]=this.data.children[l])}return new Ei(e,rt({type:s,length:this.numRows,children:a}))}selectAt(t){const e=this.schema.selectAt(t),s=t.map(c=>this.data.children[c]).filter(Boolean),a=rt({type:new Yt(e.fields),length:this.numRows,children:s});return new Ei(e,a)}};wp=Symbol.toStringTag;re[wp]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(re.prototype);function Sh(r,t,e=t.reduce((s,a)=>Math.max(s,a.length),0)){var s;const a=[...r.fields],c=[...t],l=(e+63&-64)>>3;for(const[d,g]of r.fields.entries()){const w=t[d];(!w||w.length!==e)&&(a[d]=g.clone({nullable:!0}),c[d]=(s=w==null?void 0:w._changeLengthAndBackfillNullBitmap(e))!==null&&s!==void 0?s:rt({type:g.type,length:e,nullCount:e,nullBitmap:new Uint8Array(l)}))}return[r.assign(a),rt({type:new Yt(a),length:e,children:c})]}function Sp(r,t,e=new Map){for(let s=-1,a=r.length;++s<a;){const l=r[s].type,d=t[s];if(P.isDictionary(l)){if(!e.has(l.id))d.dictionary&&e.set(l.id,d.dictionary);else if(e.get(l.id)!==d.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}l.children&&l.children.length>0&&Sp(l.children,d.children,e)}return e}class bc extends re{constructor(t){const e=t.fields.map(a=>rt({type:a.type})),s=rt({type:new Yt(t.fields),nullCount:0,children:e});super(t,s)}}var To;(function(r){r[r.BUFFER=0]="BUFFER"})(To||(To={}));var Lo;(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(Lo||(Lo={}));class Gn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBodyCompression(t,e){return(e||new Gn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+mt),(e||new Gn).__init(t.readInt32(t.position())+t.position(),t)}codec(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Lo.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):To.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,Lo.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,To.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,s){return Gn.startBodyCompression(t),Gn.addCodec(t,e),Gn.addMethod(t,s),Gn.endBodyCompression(t)}}class Ip{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,e,s){return t.prep(8,16),t.writeInt64(s),t.writeInt64(e),t.offset()}}let Ap=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,e,s){return t.prep(8,16),t.writeInt64(s),t.writeInt64(e),t.offset()}},Bn=class Wu{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new Wu).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+mt),(e||new Wu).__init(t.readInt32(t.position())+t.position(),t)}length(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}nodes(t,e){const s=this.bb.__offset(this.bb_pos,6);return s?(e||new Ap).__init(this.bb.__vector(this.bb_pos+s)+t*16,this.bb):null}nodesLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){const s=this.bb.__offset(this.bb_pos,8);return s?(e||new Ip).__init(this.bb.__vector(this.bb_pos+s)+t*16,this.bb):null}buffersLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){const e=this.bb.__offset(this.bb_pos,10);return e?(t||new Gn).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}},Gr=class ku{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new ku).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+mt),(e||new ku).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}data(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Bn).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}};var Mo;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(Mo||(Mo={}));let Hn=class qe{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new qe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+mt),(e||new qe).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ni.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Mo.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}customMetadata(t,e){const s=this.bb.__offset(this.bb_pos,12);return s?(e||new Et).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ni.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,Mo.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,0))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let s=e.length-1;s>=0;s--)t.addOffset(e[s]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,s,a,c,l){return qe.startMessage(t),qe.addVersion(t,e),qe.addHeaderType(t,s),qe.addHeader(t,a),qe.addBodyLength(t,c),qe.addCustomMetadata(t,l),qe.endMessage(t)}};var uI=Dn;class cI extends it{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return mr.startNull(e),mr.endNull(e)}visitInt(t,e){return ye.startInt(e),ye.addBitWidth(e,t.bitWidth),ye.addIsSigned(e,t.isSigned),ye.endInt(e)}visitFloat(t,e){return rn.startFloatingPoint(e),rn.addPrecision(e,t.precision),rn.endFloatingPoint(e)}visitBinary(t,e){return yr.startBinary(e),yr.endBinary(e)}visitBool(t,e){return gr.startBool(e),gr.endBool(e)}visitUtf8(t,e){return br.startUtf8(e),br.endUtf8(e)}visitDecimal(t,e){return ee.startDecimal(e),ee.addScale(e,t.scale),ee.addPrecision(e,t.precision),ee.addBitWidth(e,t.bitWidth),ee.endDecimal(e)}visitDate(t,e){return to.startDate(e),to.addUnit(e,t.unit),to.endDate(e)}visitTime(t,e){return Te.startTime(e),Te.addUnit(e,t.unit),Te.addBitWidth(e,t.bitWidth),Te.endTime(e)}visitTimestamp(t,e){const s=t.timezone&&e.createString(t.timezone)||void 0;return Le.startTimestamp(e),Le.addUnit(e,t.unit),s!==void 0&&Le.addTimezone(e,s),Le.endTimestamp(e)}visitInterval(t,e){return sn.startInterval(e),sn.addUnit(e,t.unit),sn.endInterval(e)}visitList(t,e){return _r.startList(e),_r.endList(e)}visitStruct(t,e){return vr.startStruct_(e),vr.endStruct_(e)}visitUnion(t,e){ne.startTypeIdsVector(e,t.typeIds.length);const s=ne.createTypeIdsVector(e,t.typeIds);return ne.startUnion(e),ne.addMode(e,t.mode),ne.addTypeIds(e,s),ne.endUnion(e)}visitDictionary(t,e){const s=this.visit(t.indices,e);return Fn.startDictionaryEncoding(e),Fn.addId(e,new uI(t.id,0)),Fn.addIsOrdered(e,t.isOrdered),s!==void 0&&Fn.addIndexType(e,s),Fn.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return en.startFixedSizeBinary(e),en.addByteWidth(e,t.byteWidth),en.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return nn.startFixedSizeList(e),nn.addListSize(e,t.listSize),nn.endFixedSizeList(e)}visitMap(t,e){return eo.startMap(e),eo.addKeysSorted(e,t.keysSorted),eo.endMap(e)}}const Ou=new cI;function lI(r,t=new Map){return new ft(hI(r,t),io(r.customMetadata),t)}function Bp(r){return new me(r.count,Op(r.columns),Fp(r.columns))}function fI(r){return new ln(Bp(r.data),r.id,r.isDelta)}function hI(r,t){return(r.fields||[]).filter(Boolean).map(e=>St.fromJSON(e,t))}function Ih(r,t){return(r.children||[]).filter(Boolean).map(e=>St.fromJSON(e,t))}function Op(r){return(r||[]).reduce((t,e)=>[...t,new Ar(e.count,dI(e.VALIDITY)),...Op(e.children)],[])}function Fp(r,t=[]){for(let e=-1,s=(r||[]).length;++e<s;){const a=r[e];a.VALIDITY&&t.push(new an(t.length,a.VALIDITY.length)),a.TYPE&&t.push(new an(t.length,a.TYPE.length)),a.OFFSET&&t.push(new an(t.length,a.OFFSET.length)),a.DATA&&t.push(new an(t.length,a.DATA.length)),t=Fp(a.children,t)}return t}function dI(r){return(r||[]).reduce((t,e)=>t+ +(e===0),0)}function pI(r,t){let e,s,a,c,l,d;return!t||!(c=r.dictionary)?(l=Bh(r,Ih(r,t)),a=new St(r.name,l,r.nullable,io(r.customMetadata))):t.has(e=c.id)?(s=(s=c.indexType)?Ah(s):new Wi,d=new ti(t.get(e),s,e,c.isOrdered),a=new St(r.name,d,r.nullable,io(r.customMetadata))):(s=(s=c.indexType)?Ah(s):new Wi,t.set(e,l=Bh(r,Ih(r,t))),d=new ti(l,s,e,c.isOrdered),a=new St(r.name,d,r.nullable,io(r.customMetadata))),a||null}function io(r){return new Map(Object.entries(r||{}))}function Ah(r){return new Zn(r.isSigned,r.bitWidth)}function Bh(r,t){const e=r.type.name;switch(e){case"NONE":return new qn;case"null":return new qn;case"binary":return new ao;case"utf8":return new uo;case"bool":return new co;case"list":return new yo((t||[])[0]);case"struct":return new Yt(t||[]);case"struct_":return new Yt(t||[])}switch(e){case"int":{const s=r.type;return new Zn(s.isSigned,s.bitWidth)}case"floatingpoint":{const s=r.type;return new ki(ie[s.precision])}case"decimal":{const s=r.type;return new lo(s.scale,s.precision,s.bitWidth)}case"date":{const s=r.type;return new fo(Tn[s.unit])}case"time":{const s=r.type;return new ji(at[s.unit],s.bitWidth)}case"timestamp":{const s=r.type;return new ho(at[s.unit],s.timezone)}case"interval":{const s=r.type;return new po(Jn[s.unit])}case"union":{const s=r.type;return new go(_e[s.mode],s.typeIds||[],t||[])}case"fixedsizebinary":{const s=r.type;return new _o(s.byteWidth)}case"fixedsizelist":{const s=r.type;return new mo(s.listSize,(t||[])[0])}case"map":{const s=r.type;return new vo((t||[])[0],s.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var Ir=Dn,yI=gp,gI=ei;class Gt{constructor(t,e,s,a){this._version=e,this._headerType=s,this.body=new Uint8Array(0),a&&(this._createHeader=()=>a),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){const s=new Gt(0,ge.V4,e);return s._createHeader=_I(t,e),s}static decode(t){t=new gI(ot(t));const e=Hn.getRootAsMessage(t),s=e.bodyLength(),a=e.version(),c=e.headerType(),l=new Gt(s,a,c);return l._createHeader=mI(e,c),l}static encode(t){const e=new yI;let s=-1;return t.isSchema()?s=ft.encode(e,t.header()):t.isRecordBatch()?s=me.encode(e,t.header()):t.isDictionaryBatch()&&(s=ln.encode(e,t.header())),Hn.startMessage(e),Hn.addVersion(e,ge.V4),Hn.addHeader(e,s),Hn.addHeaderType(e,t.headerType),Hn.addBodyLength(e,new Ir(t.bodyLength,0)),Hn.finishMessageBuffer(e,Hn.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof ft)return new Gt(0,ge.V4,ct.Schema,t);if(t instanceof me)return new Gt(e,ge.V4,ct.RecordBatch,t);if(t instanceof ln)return new Gt(e,ge.V4,ct.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===ct.Schema}isRecordBatch(){return this.headerType===ct.RecordBatch}isDictionaryBatch(){return this.headerType===ct.DictionaryBatch}}class me{constructor(t,e,s){this._nodes=e,this._buffers=s,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}}class ln{constructor(t,e,s=!1){this._data=t,this._isDelta=s,this._id=typeof e=="number"?e:e.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}}class an{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}}class Ar{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}}function _I(r,t){return()=>{switch(t){case ct.Schema:return ft.fromJSON(r);case ct.RecordBatch:return me.fromJSON(r);case ct.DictionaryBatch:return ln.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${ct[t]}, type: ${t} }`)}}function mI(r,t){return()=>{switch(t){case ct.Schema:return ft.decode(r.header(new Ze));case ct.RecordBatch:return me.decode(r.header(new Bn),r.version());case ct.DictionaryBatch:return ln.decode(r.header(new Gr),r.version())}throw new Error(`Unrecognized Message type: { name: ${ct[t]}, type: ${t} }`)}}St.encode=xI;St.decode=FI;St.fromJSON=pI;ft.encode=DI;ft.decode=vI;ft.fromJSON=lI;me.encode=TI;me.decode=bI;me.fromJSON=Bp;ln.encode=LI;ln.decode=wI;ln.fromJSON=fI;Ar.encode=MI;Ar.decode=II;an.encode=RI;an.decode=SI;function vI(r,t=new Map){const e=OI(r,t);return new ft(e,so(r),t)}function bI(r,t=ge.V4){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new me(r.length(),AI(r),BI(r,t))}function wI(r,t=ge.V4){return new ln(me.decode(r.data(),t),r.id(),r.isDelta())}function SI(r){return new an(r.offset(),r.length())}function II(r){return new Ar(r.length(),r.nullCount())}function AI(r){const t=[];for(let e,s=-1,a=-1,c=r.nodesLength();++s<c;)(e=r.nodes(s))&&(t[++a]=Ar.decode(e));return t}function BI(r,t){const e=[];for(let s,a=-1,c=-1,l=r.buffersLength();++a<l;)(s=r.buffers(a))&&(t<ge.V4&&(s.bb_pos+=8*(a+1)),e[++c]=an.decode(s));return e}function OI(r,t){const e=[];for(let s,a=-1,c=-1,l=r.fieldsLength();++a<l;)(s=r.fields(a))&&(e[++c]=St.decode(s,t));return e}function Oh(r,t){const e=[];for(let s,a=-1,c=-1,l=r.childrenLength();++a<l;)(s=r.children(a))&&(e[++c]=St.decode(s,t));return e}function FI(r,t){let e,s,a,c,l,d;return!t||!(d=r.dictionary())?(a=Dh(r,Oh(r,t)),s=new St(r.name(),a,r.nullable(),so(r))):t.has(e=d.id().low)?(c=(c=d.indexType())?Fh(c):new Wi,l=new ti(t.get(e),c,e,d.isOrdered()),s=new St(r.name(),l,r.nullable(),so(r))):(c=(c=d.indexType())?Fh(c):new Wi,t.set(e,a=Dh(r,Oh(r,t))),l=new ti(a,c,e,d.isOrdered()),s=new St(r.name(),l,r.nullable(),so(r))),s||null}function so(r){const t=new Map;if(r)for(let e,s,a=-1,c=Math.trunc(r.customMetadataLength());++a<c;)(e=r.customMetadata(a))&&(s=e.key())!=null&&t.set(s,e.value());return t}function Fh(r){return new Zn(r.isSigned(),r.bitWidth())}function Dh(r,t){const e=r.typeType();switch(e){case Ot.NONE:return new qn;case Ot.Null:return new qn;case Ot.Binary:return new ao;case Ot.Utf8:return new uo;case Ot.Bool:return new co;case Ot.List:return new yo((t||[])[0]);case Ot.Struct_:return new Yt(t||[])}switch(e){case Ot.Int:{const s=r.type(new ye);return new Zn(s.isSigned(),s.bitWidth())}case Ot.FloatingPoint:{const s=r.type(new rn);return new ki(s.precision())}case Ot.Decimal:{const s=r.type(new ee);return new lo(s.scale(),s.precision(),s.bitWidth())}case Ot.Date:{const s=r.type(new to);return new fo(s.unit())}case Ot.Time:{const s=r.type(new Te);return new ji(s.unit(),s.bitWidth())}case Ot.Timestamp:{const s=r.type(new Le);return new ho(s.unit(),s.timezone())}case Ot.Interval:{const s=r.type(new sn);return new po(s.unit())}case Ot.Union:{const s=r.type(new ne);return new go(s.mode(),s.typeIdsArray()||[],t||[])}case Ot.FixedSizeBinary:{const s=r.type(new en);return new _o(s.byteWidth())}case Ot.FixedSizeList:{const s=r.type(new nn);return new mo(s.listSize(),(t||[])[0])}case Ot.Map:{const s=r.type(new eo);return new vo((t||[])[0],s.keysSorted())}}throw new Error(`Unrecognized type: "${Ot[e]}" (${e})`)}function DI(r,t){const e=t.fields.map(c=>St.encode(r,c));Ze.startFieldsVector(r,e.length);const s=Ze.createFieldsVector(r,e),a=t.metadata&&t.metadata.size>0?Ze.createCustomMetadataVector(r,[...t.metadata].map(([c,l])=>{const d=r.createString(`${c}`),g=r.createString(`${l}`);return Et.startKeyValue(r),Et.addKey(r,d),Et.addValue(r,g),Et.endKeyValue(r)})):-1;return Ze.startSchema(r),Ze.addFields(r,s),Ze.addEndianness(r,NI?ri.Little:ri.Big),a!==-1&&Ze.addCustomMetadata(r,a),Ze.endSchema(r)}function xI(r,t){let e=-1,s=-1,a=-1;const c=t.type;let l=t.typeId;P.isDictionary(c)?(l=c.dictionary.typeId,a=Ou.visit(c,r),s=Ou.visit(c.dictionary,r)):s=Ou.visit(c,r);const d=(c.children||[]).map(O=>St.encode(r,O)),g=De.createChildrenVector(r,d),w=t.metadata&&t.metadata.size>0?De.createCustomMetadataVector(r,[...t.metadata].map(([O,D])=>{const M=r.createString(`${O}`),X=r.createString(`${D}`);return Et.startKeyValue(r),Et.addKey(r,M),Et.addValue(r,X),Et.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),De.startField(r),De.addType(r,s),De.addTypeType(r,l),De.addChildren(r,g),De.addNullable(r,!!t.nullable),e!==-1&&De.addName(r,e),a!==-1&&De.addDictionary(r,a),w!==-1&&De.addCustomMetadata(r,w),De.endField(r)}function TI(r,t){const e=t.nodes||[],s=t.buffers||[];Bn.startNodesVector(r,e.length);for(const l of e.slice().reverse())Ar.encode(r,l);const a=r.endVector();Bn.startBuffersVector(r,s.length);for(const l of s.slice().reverse())an.encode(r,l);const c=r.endVector();return Bn.startRecordBatch(r),Bn.addLength(r,new Ir(t.length,0)),Bn.addNodes(r,a),Bn.addBuffers(r,c),Bn.endRecordBatch(r)}function LI(r,t){const e=me.encode(r,t.data);return Gr.startDictionaryBatch(r),Gr.addId(r,new Ir(t.id,0)),Gr.addIsDelta(r,t.isDelta),Gr.addData(r,e),Gr.endDictionaryBatch(r)}function MI(r,t){return Ap.createFieldNode(r,new Ir(t.length,0),new Ir(t.nullCount,0))}function RI(r,t){return Ip.createBuffer(r,new Ir(t.offset,0),new Ir(t.length,0))}const NI=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),wc=r=>`Expected ${ct[r]} Message in stream, but was null or length 0.`,Sc=r=>`Header pointer of flatbuffer-encoded ${ct[r]} Message is null or length 0.`,Dp=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,xp=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class Tp{constructor(t){this.source=t instanceof Do?t:new Do(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?Ft:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(wc(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ot(this.source.read(t));if(e.byteLength<t)throw new Error(xp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=ct.Schema,s=this.readMessage(e),a=s==null?void 0:s.header();if(t&&!a)throw new Error(Sc(e));return a}readMetadataLength(){const t=this.source.read(Zo),e=t&&new ei(t),s=(e==null?void 0:e.readInt32(0))||0;return{done:s===0,value:s}}readMetadata(t){const e=this.source.read(t);if(!e)return Ft;if(e.byteLength<t)throw new Error(Dp(t,e.byteLength));return{done:!1,value:Gt.decode(e)}}}class EI{constructor(t,e){this.source=t instanceof si?t:Zh(t)?new xo(t,e):new si(t)}[Symbol.asyncIterator](){return this}next(){return C(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done||t.value===-1&&(t=yield this.readMetadataLength()).done||(t=yield this.readMetadata(t.value)).done?Ft:t})}throw(t){return C(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return C(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return C(this,void 0,void 0,function*(){let e;if((e=yield this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(wc(t));return e.value})}readMessageBody(t){return C(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);const e=ot(yield this.source.read(t));if(e.byteLength<t)throw new Error(xp(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return C(this,void 0,void 0,function*(){const e=ct.Schema,s=yield this.readMessage(e),a=s==null?void 0:s.header();if(t&&!a)throw new Error(Sc(e));return a})}readMetadataLength(){return C(this,void 0,void 0,function*(){const t=yield this.source.read(Zo),e=t&&new ei(t),s=(e==null?void 0:e.readInt32(0))||0;return{done:s===0,value:s}})}readMetadata(t){return C(this,void 0,void 0,function*(){const e=yield this.source.read(t);if(!e)return Ft;if(e.byteLength<t)throw new Error(Dp(t,e.byteLength));return{done:!1,value:Gt.decode(e)}})}}class CI extends Tp{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof bh?t:new bh(t)}next(){const{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Gt.fromJSON(t.schema,ct.Schema)};if(this._dictionaryIndex<t.dictionaries.length){const e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:Gt.fromJSON(e,ct.DictionaryBatch)}}if(this._batchIndex<t.batches.length){const e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:Gt.fromJSON(e,ct.RecordBatch)}}return this._body=[],Ft}readMessageBody(t){return e(this._body);function e(s){return(s||[]).reduce((a,c)=>[...a,...c.VALIDITY&&[c.VALIDITY]||[],...c.TYPE&&[c.TYPE]||[],...c.OFFSET&&[c.OFFSET]||[],...c.DATA&&[c.DATA]||[],...e(c.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(wc(t));return e.value}readSchema(){const t=ct.Schema,e=this.readMessage(t),s=e==null?void 0:e.header();if(!e||!s)throw new Error(Sc(t));return s}}const Zo=4,ju="ARROW1",Yi=new Uint8Array(ju.length);for(let r=0;r<ju.length;r+=1)Yi[r]=ju.codePointAt(r);function Ic(r,t=0){for(let e=-1,s=Yi.length;++e<s;)if(Yi[e]!==r[t+e])return!1;return!0}const es=Yi.length,Lp=es+Zo,UI=es*2+Zo;class xn extends yc{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){const e=this._impl.open(t);return Kn(e)?e.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return xe.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return xe.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof xn?t:Ru(t)?VI(t):Zh(t)?jI(t):Kn(t)?C(this,void 0,void 0,function*(){return yield xn.from(yield t)}):Xh(t)||ec(t)||Qh(t)||ui(t)?kI(new si(t)):WI(new Do(t))}static readAll(t){return t instanceof xn?t.isSync()?xh(t):Th(t):Ru(t)||ArrayBuffer.isView(t)||Zi(t)||qh(t)?xh(t):Th(t)}}class Ro extends xn{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return on(this,arguments,function*(){yield J(yield*Qs(wr(this[Symbol.iterator]())))})}}class No extends xn{constructor(t){super(t),this._impl=t}readAll(){var t,e;return C(this,void 0,void 0,function*(){const s=new Array;try{for(var a=wr(this),c;c=yield a.next(),!c.done;){const l=c.value;s.push(l)}}catch(l){t={error:l}}finally{try{c&&!c.done&&(e=a.return)&&(yield e.call(a))}finally{if(t)throw t.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Mp extends Ro{constructor(t){super(t),this._impl=t}}class PI extends No{constructor(t){super(t),this._impl=t}}class Rp{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const s=this._loadVectors(t,e,this.schema.fields),a=rt({type:new Yt(this.schema.fields),length:t.length,children:s});return new re(this.schema,a)}_loadDictionaryBatch(t,e){const{id:s,isDelta:a}=t,{dictionaries:c,schema:l}=this,d=c.get(s);if(a||!d){const g=l.dictionaries.get(s),w=this._loadVectors(t.data,e,[g]);return(d&&a?d.concat(new lt(w)):new lt(w)).memoize()}return d.memoize()}_loadVectors(t,e,s){return new vp(e,t.nodes,t.buffers,this.dictionaries).visitMany(s)}}class Eo extends Rp{constructor(t,e){super(e),this._reader=Ru(t)?new CI(this._handle=t):new Tp(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=Ep(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):Ft}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Ft}next(){if(this.closed)return Ft;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const s=t.header(),a=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(s,a)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const s=t.header(),a=e.readMessageBody(t.bodyLength),c=this._loadDictionaryBatch(s,a);this.dictionaries.set(s.id,c)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new bc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Co extends Rp{constructor(t,e){super(e),this._reader=new EI(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return C(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return C(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Ep(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return C(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Ft})}return(t){return C(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Ft})}next(){return C(this,void 0,void 0,function*(){if(this.closed)return Ft;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const s=t.header(),a=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(s,a)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const s=t.header(),a=yield e.readMessageBody(t.bodyLength),c=this._loadDictionaryBatch(s,a);this.dictionaries.set(s.id,c)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new bc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return C(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class Np extends Eo{constructor(t,e){super(t instanceof wh?t:new wh(t),e)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const s=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(s&&this._handle.seek(s.offset)){const a=this._reader.readMessage(ct.RecordBatch);if(a!=null&&a.isRecordBatch()){const c=a.header(),l=this._reader.readMessageBody(a.bodyLength);return this._loadRecordBatch(c,l)}}return null}_readDictionaryBatch(t){var e;const s=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(s&&this._handle.seek(s.offset)){const a=this._reader.readMessage(ct.DictionaryBatch);if(a!=null&&a.isDictionaryBatch()){const c=a.header(),l=this._reader.readMessageBody(a.bodyLength),d=this._loadDictionaryBatch(c,l);this.dictionaries.set(c.id,d)}}}_readFooter(){const{_handle:t}=this,e=t.size-Lp,s=t.readInt32(e),a=t.readAt(e-s,s);return Hi.decode(a)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const s=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(s&&this._handle.seek(s.offset))return this._reader.readMessage(t)}return null}}class zI extends Co{constructor(t,...e){const s=typeof e[0]!="number"?e.shift():void 0,a=e[0]instanceof Map?e.shift():void 0;super(t instanceof xo?t:new xo(t,s),a)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(t){const e=Object.create(null,{open:{get:()=>super.open}});return C(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const s of this._footer.dictionaryBatches())s&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){var e;return C(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());const s=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(s&&(yield this._handle.seek(s.offset))){const a=yield this._reader.readMessage(ct.RecordBatch);if(a!=null&&a.isRecordBatch()){const c=a.header(),l=yield this._reader.readMessageBody(a.bodyLength);return this._loadRecordBatch(c,l)}}return null})}_readDictionaryBatch(t){var e;return C(this,void 0,void 0,function*(){const s=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(s&&(yield this._handle.seek(s.offset))){const a=yield this._reader.readMessage(ct.DictionaryBatch);if(a!=null&&a.isDictionaryBatch()){const c=a.header(),l=yield this._reader.readMessageBody(a.bodyLength),d=this._loadDictionaryBatch(c,l);this.dictionaries.set(c.id,d)}}})}_readFooter(){return C(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-Lp,s=yield t.readInt32(e),a=yield t.readAt(e-s,s);return Hi.decode(a)})}_readNextMessageAndValidate(t){return C(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const e=this._footer.getRecordBatch(this._recordBatchIndex);if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null})}}class $I extends Eo{constructor(t,e){super(t,e)}_loadVectors(t,e,s){return new XS(e,t.nodes,t.buffers,this.dictionaries).visitMany(s)}}function Ep(r,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:r.autoDestroy}function*xh(r){const t=xn.from(r);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Th(r){return on(this,arguments,function*(){const e=yield J(xn.from(r));try{if(!(yield J(e.open({autoDestroy:!1}))).closed)do yield yield J(e);while(!(yield J(e.reset().open())).closed)}finally{yield J(e.cancel())}})}function VI(r){return new Ro(new $I(r))}function WI(r){const t=r.peek(es+7&-8);return t&&t.byteLength>=4?Ic(t)?new Mp(new Np(r.read())):new Ro(new Eo(r)):new Ro(new Eo(function*(){}()))}function kI(r){return C(this,void 0,void 0,function*(){const t=yield r.peek(es+7&-8);return t&&t.byteLength>=4?Ic(t)?new Mp(new Np(yield r.read())):new No(new Co(r)):new No(new Co(function(){return on(this,arguments,function*(){})}()))})}function jI(r){return C(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new xo(r,t);return t>=UI&&Ic(yield e.readAt(0,es+7&-8))?new PI(new zI(e)):new No(new Co(e))})}class Lt extends it{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){const e=a=>a.flatMap(c=>Array.isArray(c)?e(c):c instanceof re?c.data.children:c.data),s=new Lt;return s.visitMany(e(t)),s}visit(t){if(t instanceof lt)return this.visitMany(t.data),this;const{type:e}=t;if(!P.isDictionary(e)){const{length:s,nullCount:a}=t;if(s>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");P.isNull(e)||Ve.call(this,a<=0?new Uint8Array(0):lc(t.offset,s,t.nullBitmap)),this.nodes.push(new Ar(s,a))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function Ve(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new an(this._byteLength,t)),this._byteLength+=t,this}function HI(r){const{type:t,length:e,typeIds:s,valueOffsets:a}=r;if(Ve.call(this,s),t.mode===_e.Sparse)return Hu.call(this,r);if(t.mode===_e.Dense){if(r.offset<=0)return Ve.call(this,a),Hu.call(this,r);{const c=s.reduce((O,D)=>Math.max(O,D),s[0]),l=new Int32Array(c+1),d=new Int32Array(c+1).fill(-1),g=new Int32Array(e),w=rc(-a[0],e,a);for(let O,D,M=-1;++M<e;)(D=d[O=s[M]])===-1&&(D=d[O]=w[O]),g[M]=w[M]-D,++l[O];Ve.call(this,g);for(let O,D=-1,M=t.children.length;++D<M;)if(O=r.children[D]){const X=t.typeIds[D],At=Math.min(e,l[X]);this.visit(O.slice(d[X],At))}}}return this}function YI(r){let t;return r.nullCount>=r.length?Ve.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?Ve.call(this,lc(r.offset,r.length,t)):Ve.call(this,bo(r.values))}function rr(r){return Ve.call(this,r.values.subarray(0,r.length*r.stride))}function Cp(r){const{length:t,values:e,valueOffsets:s}=r,a=s[0],c=s[t],l=Math.min(c-a,e.byteLength-a);return Ve.call(this,rc(-s[0],t,s)),Ve.call(this,e.subarray(a,a+l)),this}function Ac(r){const{length:t,valueOffsets:e}=r;return e&&Ve.call(this,rc(e[0],t,e)),this.visit(r.children[0])}function Hu(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}Lt.prototype.visitBool=YI;Lt.prototype.visitInt=rr;Lt.prototype.visitFloat=rr;Lt.prototype.visitUtf8=Cp;Lt.prototype.visitBinary=Cp;Lt.prototype.visitFixedSizeBinary=rr;Lt.prototype.visitDate=rr;Lt.prototype.visitTimestamp=rr;Lt.prototype.visitTime=rr;Lt.prototype.visitDecimal=rr;Lt.prototype.visitList=Ac;Lt.prototype.visitStruct=Hu;Lt.prototype.visitUnion=HI;Lt.prototype.visitInterval=rr;Lt.prototype.visitFixedSizeList=Ac;Lt.prototype.visitMap=Ac;class Up extends yc{constructor(t){super(),this._position=0,this._started=!1,this._sink=new ro,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,se(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,e){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 Kn(t)?t.then(e=>this.writeAll(e)):ui(t)?Dc(this,t):Fc(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof ro?this._sink=t:(this._sink=new ro,t&&d1(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&p1(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!Vu(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Ht&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof re&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Vu(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof re?t instanceof bc||this._writeRecordBatch(t):t instanceof Ht?this.writeAll(t.batches):Zi(t)&&this.writeAll(t)}_writeMessage(t,e=8){const s=e-1,a=Gt.encode(t),c=a.byteLength,l=this._writeLegacyIpcFormat?4:8,d=c+l+s&~s,g=d-c-l;return t.headerType===ct.RecordBatch?this._recordBatchBlocks.push(new Xn(d,t.bodyLength,this._position)):t.headerType===ct.DictionaryBatch&&this._dictionaryBlocks.push(new Xn(d,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(d-l)),c>0&&this._write(a),this._writePadding(g)}_write(t){if(this._started){const e=ot(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Gt.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Yi)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:s,bufferRegions:a,buffers:c}=Lt.assemble(t),l=new me(t.numRows,s,a),d=Gt.from(l,e);return this._writeDictionaries(t)._writeMessage(d)._writeBodyBuffers(c)}_writeDictionaryBatch(t,e,s=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));const{byteLength:a,nodes:c,bufferRegions:l,buffers:d}=Lt.assemble(new lt([t])),g=new me(t.length,c,l),w=new ln(g,e,s),O=Gt.from(w,a);return this._writeMessage(O)._writeBodyBuffers(d)}_writeBodyBuffers(t){let e,s,a;for(let c=-1,l=t.length;++c<l;)(e=t[c])&&(s=e.byteLength)>0&&(this._write(e),(a=(s+7&-8)-s)>0&&this._writePadding(a));return this}_writeDictionaries(t){for(let[e,s]of t.dictionaries){let a=this._dictionaryDeltaOffsets.get(e)||0;if(a===0||(s=s==null?void 0:s.slice(a)).length>0)for(const c of s.data)this._writeDictionaryBatch(c,e,a>0),a+=c.length}return this}}class Bc extends Up{static writeAll(t,e){const s=new Bc(e);return Kn(t)?t.then(a=>s.writeAll(a)):ui(t)?Dc(s,t):Fc(s,t)}}class Oc extends Up{static writeAll(t){const e=new Oc;return Kn(t)?t.then(s=>e.writeAll(s)):ui(t)?Dc(e,t):Fc(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const e=Hi.encode(new Hi(t,ge.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function Fc(r,t){let e=t;t instanceof Ht&&(e=t.batches,r.reset(void 0,t.schema));for(const s of e)r.write(s);return r.finish()}function Dc(r,t){var e,s,a,c;return C(this,void 0,void 0,function*(){try{for(e=wr(t);s=yield e.next(),!s.done;){const l=s.value;r.write(l)}}catch(l){a={error:l}}finally{try{s&&!s.done&&(c=e.return)&&(yield c.call(e))}finally{if(a)throw a.error}}return r.finish()})}function Ci(r){const t=xn.from(r);return Kn(t)?t.then(e=>Ci(e)):t.isAsync()?t.readAll().then(e=>new Ht(e)):new Ht(t.readAll())}function Fu(r,t="stream"){return(t==="stream"?Bc:Oc).writeAll(r).toUint8Array(!0)}var Lh=function(){function r(t,e,s,a){var c=this;this.getCell=function(l,d){var g=l<c.headerRows&&d<c.headerColumns,w=l>=c.headerRows&&d<c.headerColumns,O=l<c.headerRows&&d>=c.headerColumns;if(g){var D=["blank"];return d>0&&D.push("level"+l),{type:"blank",classNames:D.join(" "),content:""}}else if(O){var M=d-c.headerColumns,D=["col_heading","level"+l,"col"+M];return{type:"columns",classNames:D.join(" "),content:c.getContent(c.columnsTable,M,l)}}else if(w){var X=l-c.headerRows,D=["row_heading","level"+d,"row"+X];return{type:"index",id:"T_".concat(c.uuid,"level").concat(d,"_row").concat(X),classNames:D.join(" "),content:c.getContent(c.indexTable,X,d)}}else{var X=l-c.headerRows,M=d-c.headerColumns,D=["data","row"+X,"col"+M],At=c.styler?c.getContent(c.styler.displayValuesTable,X,M):c.getContent(c.dataTable,X,M);return{type:"data",id:"T_".concat(c.uuid,"row").concat(X,"_col").concat(M),classNames:D.join(" "),content:At}}},this.getContent=function(l,d,g){var w=l.getChildAt(g);if(w===null)return"";var O=c.getColumnTypeId(l,g);switch(O){case b.Timestamp:return c.nanosToDate(w.get(d));default:return w.get(d)}},this.dataTable=Ci(t),this.indexTable=Ci(e),this.columnsTable=Ci(s),this.styler=a?{caption:a.caption,displayValuesTable:Ci(a.displayValues),styles:a.styles,uuid:a.uuid}:void 0}return Object.defineProperty(r.prototype,"rows",{get:function(){return this.indexTable.numRows+this.columnsTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dataRows",{get:function(){return this.dataTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"table",{get:function(){return this.dataTable},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"index",{get:function(){return this.indexTable},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!1,configurable:!0}),r.prototype.serialize=function(){return{data:Fu(this.dataTable),index:Fu(this.indexTable),columns:Fu(this.columnsTable)}},r.prototype.getColumnTypeId=function(t,e){return t.schema.fields[e].type.typeId},r.prototype.nanosToDate=function(t){return new Date(t/1e6)},r}(),Pi=function(){return Pi=Object.assign||function(r){for(var t,e=1,s=arguments.length;e<s;e++){t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},Pi.apply(this,arguments)},zi;(function(r){r.COMPONENT_READY="streamlit:componentReady",r.SET_COMPONENT_VALUE="streamlit:setComponentValue",r.SET_FRAME_HEIGHT="streamlit:setFrameHeight"})(zi||(zi={}));var tr=function(){function r(){}return r.API_VERSION=1,r.RENDER_EVENT="streamlit:render",r.events=new EventTarget,r.registeredMessageListener=!1,r.setComponentReady=function(){r.registeredMessageListener||(window.addEventListener("message",r.onMessageEvent),r.registeredMessageListener=!0),r.sendBackMsg(zi.COMPONENT_READY,{apiVersion:r.API_VERSION})},r.setFrameHeight=function(t){t===void 0&&(t=document.body.scrollHeight),t!==r.lastFrameHeight&&(r.lastFrameHeight=t,r.sendBackMsg(zi.SET_FRAME_HEIGHT,{height:t}))},r.setComponentValue=function(t){var e;t instanceof Lh?(e="dataframe",t=t.serialize()):KI(t)?(e="bytes",t=new Uint8Array(t.buffer)):t instanceof ArrayBuffer?(e="bytes",t=new Uint8Array(t)):e="json",r.sendBackMsg(zi.SET_COMPONENT_VALUE,{value:t,dataType:e})},r.onMessageEvent=function(t){var e=t.data.type;switch(e){case r.RENDER_EVENT:r.onRenderMessage(t.data);break}},r.onRenderMessage=function(t){var e=t.args;e==null&&(console.error("Got null args in onRenderMessage. This should never happen"),e={});var s=t.dfs&&t.dfs.length>0?r.argsDataframeToObject(t.dfs):{};e=Pi(Pi({},e),s);var a=!!t.disabled,c=t.theme;c&&GI(c);var l={disabled:a,args:e,theme:c},d=new CustomEvent(r.RENDER_EVENT,{detail:l});r.events.dispatchEvent(d)},r.argsDataframeToObject=function(t){var e=t.map(function(s){var a=s.key,c=s.value;return[a,r.toArrowTable(c)]});return Object.fromEntries(e)},r.toArrowTable=function(t){var e,s=(e=t.data,e.data),a=e.index,c=e.columns,l=e.styler;return new Lh(s,a,c,l)},r.sendBackMsg=function(t,e){window.parent.postMessage(Pi({isStreamlitMessage:!0,type:t},e),"*")},r}(),GI=function(r){var t=document.createElement("style");document.head.appendChild(t),t.innerHTML=`
    :root {
      --primary-color: `.concat(r.primaryColor,`;
      --background-color: `).concat(r.backgroundColor,`;
      --secondary-background-color: `).concat(r.secondaryBackgroundColor,`;
      --text-color: `).concat(r.textColor,`;
      --font: `).concat(r.font,`;
    }

    body {
      background-color: var(--background-color);
      color: var(--text-color);
    }
  `)};function KI(r){var t=!1;try{t=r instanceof BigInt64Array||r instanceof BigUint64Array}catch{}return r instanceof Int8Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array||t}var JI=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,a){s.__proto__=a}||function(s,a){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(s[c]=a[c])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}}();(function(r){JI(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){tr.setFrameHeight()},t.prototype.componentDidUpdate=function(){tr.setFrameHeight()},t})(u1.PureComponent);var Uo={exports:{}};/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */Uo.exports;(function(r,t){(function(){var e,s="4.17.21",a=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",d="Invalid `variable` option passed into `_.template`",g="__lodash_hash_undefined__",w=500,O="__lodash_placeholder__",D=1,M=2,X=4,At=1,Nn=2,Kt=1,Jt=2,ns=4,je=8,Br=16,He=32,Or=64,fn=128,li=256,Xo=512,Pp=30,zp="...",$p=800,Vp=16,xc=1,Wp=2,kp=3,ir=1/0,En=9007199254740991,jp=17976931348623157e292,rs=NaN,Ye=4294967295,Hp=Ye-1,Yp=Ye>>>1,Gp=[["ary",fn],["bind",Kt],["bindKey",Jt],["curry",je],["curryRight",Br],["flip",Xo],["partial",He],["partialRight",Or],["rearg",li]],Fr="[object Arguments]",is="[object Array]",Kp="[object AsyncFunction]",fi="[object Boolean]",hi="[object Date]",Jp="[object DOMException]",ss="[object Error]",os="[object Function]",Tc="[object GeneratorFunction]",Re="[object Map]",di="[object Number]",qp="[object Null]",hn="[object Object]",Lc="[object Promise]",Zp="[object Proxy]",pi="[object RegExp]",Ne="[object Set]",yi="[object String]",as="[object Symbol]",Xp="[object Undefined]",gi="[object WeakMap]",Qp="[object WeakSet]",_i="[object ArrayBuffer]",Dr="[object DataView]",Qo="[object Float32Array]",ta="[object Float64Array]",ea="[object Int8Array]",na="[object Int16Array]",ra="[object Int32Array]",ia="[object Uint8Array]",sa="[object Uint8ClampedArray]",oa="[object Uint16Array]",aa="[object Uint32Array]",ty=/\b__p \+= '';/g,ey=/\b(__p \+=) '' \+/g,ny=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mc=/&(?:amp|lt|gt|quot|#39);/g,Rc=/[&<>"']/g,ry=RegExp(Mc.source),iy=RegExp(Rc.source),sy=/<%-([\s\S]+?)%>/g,oy=/<%([\s\S]+?)%>/g,Nc=/<%=([\s\S]+?)%>/g,ay=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uy=/^\w*$/,cy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ua=/[\\^$.*+?()[\]{}|]/g,ly=RegExp(ua.source),ca=/^\s+/,fy=/\s/,hy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dy=/\{\n\/\* \[wrapped with (.+)\] \*/,py=/,? & /,yy=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gy=/[()=,{}\[\]\/\s]/,_y=/\\(\\)?/g,my=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ec=/\w*$/,vy=/^[-+]0x[0-9a-f]+$/i,by=/^0b[01]+$/i,wy=/^\[object .+?Constructor\]$/,Sy=/^0o[0-7]+$/i,Iy=/^(?:0|[1-9]\d*)$/,Ay=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,us=/($^)/,By=/['\n\r\u2028\u2029\\]/g,cs="\\ud800-\\udfff",Oy="\\u0300-\\u036f",Fy="\\ufe20-\\ufe2f",Dy="\\u20d0-\\u20ff",Cc=Oy+Fy+Dy,Uc="\\u2700-\\u27bf",Pc="a-z\\xdf-\\xf6\\xf8-\\xff",xy="\\xac\\xb1\\xd7\\xf7",Ty="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ly="\\u2000-\\u206f",My=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zc="A-Z\\xc0-\\xd6\\xd8-\\xde",$c="\\ufe0e\\ufe0f",Vc=xy+Ty+Ly+My,la="['’]",Ry="["+cs+"]",Wc="["+Vc+"]",ls="["+Cc+"]",kc="\\d+",Ny="["+Uc+"]",jc="["+Pc+"]",Hc="[^"+cs+Vc+kc+Uc+Pc+zc+"]",fa="\\ud83c[\\udffb-\\udfff]",Ey="(?:"+ls+"|"+fa+")",Yc="[^"+cs+"]",ha="(?:\\ud83c[\\udde6-\\uddff]){2}",da="[\\ud800-\\udbff][\\udc00-\\udfff]",xr="["+zc+"]",Gc="\\u200d",Kc="(?:"+jc+"|"+Hc+")",Cy="(?:"+xr+"|"+Hc+")",Jc="(?:"+la+"(?:d|ll|m|re|s|t|ve))?",qc="(?:"+la+"(?:D|LL|M|RE|S|T|VE))?",Zc=Ey+"?",Xc="["+$c+"]?",Uy="(?:"+Gc+"(?:"+[Yc,ha,da].join("|")+")"+Xc+Zc+")*",Py="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qc=Xc+Zc+Uy,$y="(?:"+[Ny,ha,da].join("|")+")"+Qc,Vy="(?:"+[Yc+ls+"?",ls,ha,da,Ry].join("|")+")",Wy=RegExp(la,"g"),ky=RegExp(ls,"g"),pa=RegExp(fa+"(?="+fa+")|"+Vy+Qc,"g"),jy=RegExp([xr+"?"+jc+"+"+Jc+"(?="+[Wc,xr,"$"].join("|")+")",Cy+"+"+qc+"(?="+[Wc,xr+Kc,"$"].join("|")+")",xr+"?"+Kc+"+"+Jc,xr+"+"+qc,zy,Py,kc,$y].join("|"),"g"),Hy=RegExp("["+Gc+cs+Cc+$c+"]"),Yy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gy=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ky=-1,wt={};wt[Qo]=wt[ta]=wt[ea]=wt[na]=wt[ra]=wt[ia]=wt[sa]=wt[oa]=wt[aa]=!0,wt[Fr]=wt[is]=wt[_i]=wt[fi]=wt[Dr]=wt[hi]=wt[ss]=wt[os]=wt[Re]=wt[di]=wt[hn]=wt[pi]=wt[Ne]=wt[yi]=wt[gi]=!1;var vt={};vt[Fr]=vt[is]=vt[_i]=vt[Dr]=vt[fi]=vt[hi]=vt[Qo]=vt[ta]=vt[ea]=vt[na]=vt[ra]=vt[Re]=vt[di]=vt[hn]=vt[pi]=vt[Ne]=vt[yi]=vt[as]=vt[ia]=vt[sa]=vt[oa]=vt[aa]=!0,vt[ss]=vt[os]=vt[gi]=!1;var Jy={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"},qy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zy={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Xy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qy=parseFloat,tg=parseInt,tl=typeof Ri=="object"&&Ri&&Ri.Object===Object&&Ri,eg=typeof self=="object"&&self&&self.Object===Object&&self,Pt=tl||eg||Function("return this")(),ya=t&&!t.nodeType&&t,sr=ya&&!0&&r&&!r.nodeType&&r,el=sr&&sr.exports===ya,ga=el&&tl.process,be=function(){try{var m=sr&&sr.require&&sr.require("util").types;return m||ga&&ga.binding&&ga.binding("util")}catch{}}(),nl=be&&be.isArrayBuffer,rl=be&&be.isDate,il=be&&be.isMap,sl=be&&be.isRegExp,ol=be&&be.isSet,al=be&&be.isTypedArray;function ue(m,I,S){switch(S.length){case 0:return m.call(I);case 1:return m.call(I,S[0]);case 2:return m.call(I,S[0],S[1]);case 3:return m.call(I,S[0],S[1],S[2])}return m.apply(I,S)}function ng(m,I,S,T){for(var U=-1,st=m==null?0:m.length;++U<st;){var Mt=m[U];I(T,Mt,S(Mt),m)}return T}function we(m,I){for(var S=-1,T=m==null?0:m.length;++S<T&&I(m[S],S,m)!==!1;);return m}function rg(m,I){for(var S=m==null?0:m.length;S--&&I(m[S],S,m)!==!1;);return m}function ul(m,I){for(var S=-1,T=m==null?0:m.length;++S<T;)if(!I(m[S],S,m))return!1;return!0}function Cn(m,I){for(var S=-1,T=m==null?0:m.length,U=0,st=[];++S<T;){var Mt=m[S];I(Mt,S,m)&&(st[U++]=Mt)}return st}function fs(m,I){var S=m==null?0:m.length;return!!S&&Tr(m,I,0)>-1}function _a(m,I,S){for(var T=-1,U=m==null?0:m.length;++T<U;)if(S(I,m[T]))return!0;return!1}function It(m,I){for(var S=-1,T=m==null?0:m.length,U=Array(T);++S<T;)U[S]=I(m[S],S,m);return U}function Un(m,I){for(var S=-1,T=I.length,U=m.length;++S<T;)m[U+S]=I[S];return m}function ma(m,I,S,T){var U=-1,st=m==null?0:m.length;for(T&&st&&(S=m[++U]);++U<st;)S=I(S,m[U],U,m);return S}function ig(m,I,S,T){var U=m==null?0:m.length;for(T&&U&&(S=m[--U]);U--;)S=I(S,m[U],U,m);return S}function va(m,I){for(var S=-1,T=m==null?0:m.length;++S<T;)if(I(m[S],S,m))return!0;return!1}var sg=ba("length");function og(m){return m.split("")}function ag(m){return m.match(yy)||[]}function cl(m,I,S){var T;return S(m,function(U,st,Mt){if(I(U,st,Mt))return T=st,!1}),T}function hs(m,I,S,T){for(var U=m.length,st=S+(T?1:-1);T?st--:++st<U;)if(I(m[st],st,m))return st;return-1}function Tr(m,I,S){return I===I?vg(m,I,S):hs(m,ll,S)}function ug(m,I,S,T){for(var U=S-1,st=m.length;++U<st;)if(T(m[U],I))return U;return-1}function ll(m){return m!==m}function fl(m,I){var S=m==null?0:m.length;return S?Sa(m,I)/S:rs}function ba(m){return function(I){return I==null?e:I[m]}}function wa(m){return function(I){return m==null?e:m[I]}}function hl(m,I,S,T,U){return U(m,function(st,Mt,gt){S=T?(T=!1,st):I(S,st,Mt,gt)}),S}function cg(m,I){var S=m.length;for(m.sort(I);S--;)m[S]=m[S].value;return m}function Sa(m,I){for(var S,T=-1,U=m.length;++T<U;){var st=I(m[T]);st!==e&&(S=S===e?st:S+st)}return S}function Ia(m,I){for(var S=-1,T=Array(m);++S<m;)T[S]=I(S);return T}function lg(m,I){return It(I,function(S){return[S,m[S]]})}function dl(m){return m&&m.slice(0,_l(m)+1).replace(ca,"")}function ce(m){return function(I){return m(I)}}function Aa(m,I){return It(I,function(S){return m[S]})}function mi(m,I){return m.has(I)}function pl(m,I){for(var S=-1,T=m.length;++S<T&&Tr(I,m[S],0)>-1;);return S}function yl(m,I){for(var S=m.length;S--&&Tr(I,m[S],0)>-1;);return S}function fg(m,I){for(var S=m.length,T=0;S--;)m[S]===I&&++T;return T}var hg=wa(Jy),dg=wa(qy);function pg(m){return"\\"+Xy[m]}function yg(m,I){return m==null?e:m[I]}function Lr(m){return Hy.test(m)}function gg(m){return Yy.test(m)}function _g(m){for(var I,S=[];!(I=m.next()).done;)S.push(I.value);return S}function Ba(m){var I=-1,S=Array(m.size);return m.forEach(function(T,U){S[++I]=[U,T]}),S}function gl(m,I){return function(S){return m(I(S))}}function Pn(m,I){for(var S=-1,T=m.length,U=0,st=[];++S<T;){var Mt=m[S];(Mt===I||Mt===O)&&(m[S]=O,st[U++]=S)}return st}function ds(m){var I=-1,S=Array(m.size);return m.forEach(function(T){S[++I]=T}),S}function mg(m){var I=-1,S=Array(m.size);return m.forEach(function(T){S[++I]=[T,T]}),S}function vg(m,I,S){for(var T=S-1,U=m.length;++T<U;)if(m[T]===I)return T;return-1}function bg(m,I,S){for(var T=S+1;T--;)if(m[T]===I)return T;return T}function Mr(m){return Lr(m)?Sg(m):sg(m)}function Ee(m){return Lr(m)?Ig(m):og(m)}function _l(m){for(var I=m.length;I--&&fy.test(m.charAt(I)););return I}var wg=wa(Zy);function Sg(m){for(var I=pa.lastIndex=0;pa.test(m);)++I;return I}function Ig(m){return m.match(pa)||[]}function Ag(m){return m.match(jy)||[]}var Bg=function m(I){I=I==null?Pt:Rr.defaults(Pt.Object(),I,Rr.pick(Pt,Gy));var S=I.Array,T=I.Date,U=I.Error,st=I.Function,Mt=I.Math,gt=I.Object,Oa=I.RegExp,Og=I.String,Se=I.TypeError,ps=S.prototype,Fg=st.prototype,Nr=gt.prototype,ys=I["__core-js_shared__"],gs=Fg.toString,ht=Nr.hasOwnProperty,Dg=0,ml=function(){var n=/[^.]+$/.exec(ys&&ys.keys&&ys.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),_s=Nr.toString,xg=gs.call(gt),Tg=Pt._,Lg=Oa("^"+gs.call(ht).replace(ua,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ms=el?I.Buffer:e,zn=I.Symbol,vs=I.Uint8Array,vl=ms?ms.allocUnsafe:e,bs=gl(gt.getPrototypeOf,gt),bl=gt.create,wl=Nr.propertyIsEnumerable,ws=ps.splice,Sl=zn?zn.isConcatSpreadable:e,vi=zn?zn.iterator:e,or=zn?zn.toStringTag:e,Ss=function(){try{var n=fr(gt,"defineProperty");return n({},"",{}),n}catch{}}(),Mg=I.clearTimeout!==Pt.clearTimeout&&I.clearTimeout,Rg=T&&T.now!==Pt.Date.now&&T.now,Ng=I.setTimeout!==Pt.setTimeout&&I.setTimeout,Is=Mt.ceil,As=Mt.floor,Fa=gt.getOwnPropertySymbols,Eg=ms?ms.isBuffer:e,Il=I.isFinite,Cg=ps.join,Ug=gl(gt.keys,gt),Rt=Mt.max,$t=Mt.min,Pg=T.now,zg=I.parseInt,Al=Mt.random,$g=ps.reverse,Da=fr(I,"DataView"),bi=fr(I,"Map"),xa=fr(I,"Promise"),Er=fr(I,"Set"),wi=fr(I,"WeakMap"),Si=fr(gt,"create"),Bs=wi&&new wi,Cr={},Vg=hr(Da),Wg=hr(bi),kg=hr(xa),jg=hr(Er),Hg=hr(wi),Os=zn?zn.prototype:e,Ii=Os?Os.valueOf:e,Bl=Os?Os.toString:e;function h(n){if(Dt(n)&&!k(n)&&!(n instanceof et)){if(n instanceof Ie)return n;if(ht.call(n,"__wrapped__"))return Ff(n)}return new Ie(n)}var Ur=function(){function n(){}return function(i){if(!Bt(i))return{};if(bl)return bl(i);n.prototype=i;var o=new n;return n.prototype=e,o}}();function Fs(){}function Ie(n,i){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=e}h.templateSettings={escape:sy,evaluate:oy,interpolate:Nc,variable:"",imports:{_:h}},h.prototype=Fs.prototype,h.prototype.constructor=h,Ie.prototype=Ur(Fs.prototype),Ie.prototype.constructor=Ie;function et(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ye,this.__views__=[]}function Yg(){var n=new et(this.__wrapped__);return n.__actions__=qt(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=qt(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=qt(this.__views__),n}function Gg(){if(this.__filtered__){var n=new et(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Kg(){var n=this.__wrapped__.value(),i=this.__dir__,o=k(n),u=i<0,f=o?n.length:0,p=o_(0,f,this.__views__),y=p.start,_=p.end,v=_-y,A=u?_:y-1,B=this.__iteratees__,F=B.length,x=0,L=$t(v,this.__takeCount__);if(!o||!u&&f==v&&L==v)return Jl(n,this.__actions__);var N=[];t:for(;v--&&x<L;){A+=i;for(var q=-1,E=n[A];++q<F;){var tt=B[q],nt=tt.iteratee,he=tt.type,jt=nt(E);if(he==Wp)E=jt;else if(!jt){if(he==xc)continue t;break t}}N[x++]=E}return N}et.prototype=Ur(Fs.prototype),et.prototype.constructor=et;function ar(n){var i=-1,o=n==null?0:n.length;for(this.clear();++i<o;){var u=n[i];this.set(u[0],u[1])}}function Jg(){this.__data__=Si?Si(null):{},this.size=0}function qg(n){var i=this.has(n)&&delete this.__data__[n];return this.size-=i?1:0,i}function Zg(n){var i=this.__data__;if(Si){var o=i[n];return o===g?e:o}return ht.call(i,n)?i[n]:e}function Xg(n){var i=this.__data__;return Si?i[n]!==e:ht.call(i,n)}function Qg(n,i){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=Si&&i===e?g:i,this}ar.prototype.clear=Jg,ar.prototype.delete=qg,ar.prototype.get=Zg,ar.prototype.has=Xg,ar.prototype.set=Qg;function dn(n){var i=-1,o=n==null?0:n.length;for(this.clear();++i<o;){var u=n[i];this.set(u[0],u[1])}}function t0(){this.__data__=[],this.size=0}function e0(n){var i=this.__data__,o=Ds(i,n);if(o<0)return!1;var u=i.length-1;return o==u?i.pop():ws.call(i,o,1),--this.size,!0}function n0(n){var i=this.__data__,o=Ds(i,n);return o<0?e:i[o][1]}function r0(n){return Ds(this.__data__,n)>-1}function i0(n,i){var o=this.__data__,u=Ds(o,n);return u<0?(++this.size,o.push([n,i])):o[u][1]=i,this}dn.prototype.clear=t0,dn.prototype.delete=e0,dn.prototype.get=n0,dn.prototype.has=r0,dn.prototype.set=i0;function pn(n){var i=-1,o=n==null?0:n.length;for(this.clear();++i<o;){var u=n[i];this.set(u[0],u[1])}}function s0(){this.size=0,this.__data__={hash:new ar,map:new(bi||dn),string:new ar}}function o0(n){var i=$s(this,n).delete(n);return this.size-=i?1:0,i}function a0(n){return $s(this,n).get(n)}function u0(n){return $s(this,n).has(n)}function c0(n,i){var o=$s(this,n),u=o.size;return o.set(n,i),this.size+=o.size==u?0:1,this}pn.prototype.clear=s0,pn.prototype.delete=o0,pn.prototype.get=a0,pn.prototype.has=u0,pn.prototype.set=c0;function ur(n){var i=-1,o=n==null?0:n.length;for(this.__data__=new pn;++i<o;)this.add(n[i])}function l0(n){return this.__data__.set(n,g),this}function f0(n){return this.__data__.has(n)}ur.prototype.add=ur.prototype.push=l0,ur.prototype.has=f0;function Ce(n){var i=this.__data__=new dn(n);this.size=i.size}function h0(){this.__data__=new dn,this.size=0}function d0(n){var i=this.__data__,o=i.delete(n);return this.size=i.size,o}function p0(n){return this.__data__.get(n)}function y0(n){return this.__data__.has(n)}function g0(n,i){var o=this.__data__;if(o instanceof dn){var u=o.__data__;if(!bi||u.length<a-1)return u.push([n,i]),this.size=++o.size,this;o=this.__data__=new pn(u)}return o.set(n,i),this.size=o.size,this}Ce.prototype.clear=h0,Ce.prototype.delete=d0,Ce.prototype.get=p0,Ce.prototype.has=y0,Ce.prototype.set=g0;function Ol(n,i){var o=k(n),u=!o&&dr(n),f=!o&&!u&&jn(n),p=!o&&!u&&!f&&Vr(n),y=o||u||f||p,_=y?Ia(n.length,Og):[],v=_.length;for(var A in n)(i||ht.call(n,A))&&!(y&&(A=="length"||f&&(A=="offset"||A=="parent")||p&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||mn(A,v)))&&_.push(A);return _}function Fl(n){var i=n.length;return i?n[$a(0,i-1)]:e}function _0(n,i){return Vs(qt(n),cr(i,0,n.length))}function m0(n){return Vs(qt(n))}function Ta(n,i,o){(o!==e&&!Ue(n[i],o)||o===e&&!(i in n))&&yn(n,i,o)}function Ai(n,i,o){var u=n[i];(!(ht.call(n,i)&&Ue(u,o))||o===e&&!(i in n))&&yn(n,i,o)}function Ds(n,i){for(var o=n.length;o--;)if(Ue(n[o][0],i))return o;return-1}function v0(n,i,o,u){return $n(n,function(f,p,y){i(u,f,o(f),y)}),u}function Dl(n,i){return n&&Ke(i,Ct(i),n)}function b0(n,i){return n&&Ke(i,Xt(i),n)}function yn(n,i,o){i=="__proto__"&&Ss?Ss(n,i,{configurable:!0,enumerable:!0,value:o,writable:!0}):n[i]=o}function La(n,i){for(var o=-1,u=i.length,f=S(u),p=n==null;++o<u;)f[o]=p?e:fu(n,i[o]);return f}function cr(n,i,o){return n===n&&(o!==e&&(n=n<=o?n:o),i!==e&&(n=n>=i?n:i)),n}function Ae(n,i,o,u,f,p){var y,_=i&D,v=i&M,A=i&X;if(o&&(y=f?o(n,u,f,p):o(n)),y!==e)return y;if(!Bt(n))return n;var B=k(n);if(B){if(y=u_(n),!_)return qt(n,y)}else{var F=Vt(n),x=F==os||F==Tc;if(jn(n))return Xl(n,_);if(F==hn||F==Fr||x&&!f){if(y=v||x?{}:mf(n),!_)return v?Z0(n,b0(y,n)):q0(n,Dl(y,n))}else{if(!vt[F])return f?n:{};y=c_(n,F,_)}}p||(p=new Ce);var L=p.get(n);if(L)return L;p.set(n,y),Gf(n)?n.forEach(function(E){y.add(Ae(E,i,o,E,n,p))}):Hf(n)&&n.forEach(function(E,tt){y.set(tt,Ae(E,i,o,tt,n,p))});var N=A?v?Za:qa:v?Xt:Ct,q=B?e:N(n);return we(q||n,function(E,tt){q&&(tt=E,E=n[tt]),Ai(y,tt,Ae(E,i,o,tt,n,p))}),y}function w0(n){var i=Ct(n);return function(o){return xl(o,n,i)}}function xl(n,i,o){var u=o.length;if(n==null)return!u;for(n=gt(n);u--;){var f=o[u],p=i[f],y=n[f];if(y===e&&!(f in n)||!p(y))return!1}return!0}function Tl(n,i,o){if(typeof n!="function")throw new Se(l);return Li(function(){n.apply(e,o)},i)}function Bi(n,i,o,u){var f=-1,p=fs,y=!0,_=n.length,v=[],A=i.length;if(!_)return v;o&&(i=It(i,ce(o))),u?(p=_a,y=!1):i.length>=a&&(p=mi,y=!1,i=new ur(i));t:for(;++f<_;){var B=n[f],F=o==null?B:o(B);if(B=u||B!==0?B:0,y&&F===F){for(var x=A;x--;)if(i[x]===F)continue t;v.push(B)}else p(i,F,u)||v.push(B)}return v}var $n=rf(Ge),Ll=rf(Ra,!0);function S0(n,i){var o=!0;return $n(n,function(u,f,p){return o=!!i(u,f,p),o}),o}function xs(n,i,o){for(var u=-1,f=n.length;++u<f;){var p=n[u],y=i(p);if(y!=null&&(_===e?y===y&&!fe(y):o(y,_)))var _=y,v=p}return v}function I0(n,i,o,u){var f=n.length;for(o=K(o),o<0&&(o=-o>f?0:f+o),u=u===e||u>f?f:K(u),u<0&&(u+=f),u=o>u?0:Jf(u);o<u;)n[o++]=i;return n}function Ml(n,i){var o=[];return $n(n,function(u,f,p){i(u,f,p)&&o.push(u)}),o}function zt(n,i,o,u,f){var p=-1,y=n.length;for(o||(o=f_),f||(f=[]);++p<y;){var _=n[p];i>0&&o(_)?i>1?zt(_,i-1,o,u,f):Un(f,_):u||(f[f.length]=_)}return f}var Ma=sf(),Rl=sf(!0);function Ge(n,i){return n&&Ma(n,i,Ct)}function Ra(n,i){return n&&Rl(n,i,Ct)}function Ts(n,i){return Cn(i,function(o){return vn(n[o])})}function lr(n,i){i=Wn(i,n);for(var o=0,u=i.length;n!=null&&o<u;)n=n[Je(i[o++])];return o&&o==u?n:e}function Nl(n,i,o){var u=i(n);return k(n)?u:Un(u,o(n))}function Wt(n){return n==null?n===e?Xp:qp:or&&or in gt(n)?s_(n):m_(n)}function Na(n,i){return n>i}function A0(n,i){return n!=null&&ht.call(n,i)}function B0(n,i){return n!=null&&i in gt(n)}function O0(n,i,o){return n>=$t(i,o)&&n<Rt(i,o)}function Ea(n,i,o){for(var u=o?_a:fs,f=n[0].length,p=n.length,y=p,_=S(p),v=1/0,A=[];y--;){var B=n[y];y&&i&&(B=It(B,ce(i))),v=$t(B.length,v),_[y]=!o&&(i||f>=120&&B.length>=120)?new ur(y&&B):e}B=n[0];var F=-1,x=_[0];t:for(;++F<f&&A.length<v;){var L=B[F],N=i?i(L):L;if(L=o||L!==0?L:0,!(x?mi(x,N):u(A,N,o))){for(y=p;--y;){var q=_[y];if(!(q?mi(q,N):u(n[y],N,o)))continue t}x&&x.push(N),A.push(L)}}return A}function F0(n,i,o,u){return Ge(n,function(f,p,y){i(u,o(f),p,y)}),u}function Oi(n,i,o){i=Wn(i,n),n=Sf(n,i);var u=n==null?n:n[Je(Oe(i))];return u==null?e:ue(u,n,o)}function El(n){return Dt(n)&&Wt(n)==Fr}function D0(n){return Dt(n)&&Wt(n)==_i}function x0(n){return Dt(n)&&Wt(n)==hi}function Fi(n,i,o,u,f){return n===i?!0:n==null||i==null||!Dt(n)&&!Dt(i)?n!==n&&i!==i:T0(n,i,o,u,Fi,f)}function T0(n,i,o,u,f,p){var y=k(n),_=k(i),v=y?is:Vt(n),A=_?is:Vt(i);v=v==Fr?hn:v,A=A==Fr?hn:A;var B=v==hn,F=A==hn,x=v==A;if(x&&jn(n)){if(!jn(i))return!1;y=!0,B=!1}if(x&&!B)return p||(p=new Ce),y||Vr(n)?yf(n,i,o,u,f,p):r_(n,i,v,o,u,f,p);if(!(o&At)){var L=B&&ht.call(n,"__wrapped__"),N=F&&ht.call(i,"__wrapped__");if(L||N){var q=L?n.value():n,E=N?i.value():i;return p||(p=new Ce),f(q,E,o,u,p)}}return x?(p||(p=new Ce),i_(n,i,o,u,f,p)):!1}function L0(n){return Dt(n)&&Vt(n)==Re}function Ca(n,i,o,u){var f=o.length,p=f,y=!u;if(n==null)return!p;for(n=gt(n);f--;){var _=o[f];if(y&&_[2]?_[1]!==n[_[0]]:!(_[0]in n))return!1}for(;++f<p;){_=o[f];var v=_[0],A=n[v],B=_[1];if(y&&_[2]){if(A===e&&!(v in n))return!1}else{var F=new Ce;if(u)var x=u(A,B,v,n,i,F);if(!(x===e?Fi(B,A,At|Nn,u,F):x))return!1}}return!0}function Cl(n){if(!Bt(n)||d_(n))return!1;var i=vn(n)?Lg:wy;return i.test(hr(n))}function M0(n){return Dt(n)&&Wt(n)==pi}function R0(n){return Dt(n)&&Vt(n)==Ne}function N0(n){return Dt(n)&&Gs(n.length)&&!!wt[Wt(n)]}function Ul(n){return typeof n=="function"?n:n==null?Qt:typeof n=="object"?k(n)?$l(n[0],n[1]):zl(n):oh(n)}function Ua(n){if(!Ti(n))return Ug(n);var i=[];for(var o in gt(n))ht.call(n,o)&&o!="constructor"&&i.push(o);return i}function E0(n){if(!Bt(n))return __(n);var i=Ti(n),o=[];for(var u in n)u=="constructor"&&(i||!ht.call(n,u))||o.push(u);return o}function Pa(n,i){return n<i}function Pl(n,i){var o=-1,u=Zt(n)?S(n.length):[];return $n(n,function(f,p,y){u[++o]=i(f,p,y)}),u}function zl(n){var i=Qa(n);return i.length==1&&i[0][2]?bf(i[0][0],i[0][1]):function(o){return o===n||Ca(o,n,i)}}function $l(n,i){return eu(n)&&vf(i)?bf(Je(n),i):function(o){var u=fu(o,n);return u===e&&u===i?hu(o,n):Fi(i,u,At|Nn)}}function Ls(n,i,o,u,f){n!==i&&Ma(i,function(p,y){if(f||(f=new Ce),Bt(p))C0(n,i,y,o,Ls,u,f);else{var _=u?u(ru(n,y),p,y+"",n,i,f):e;_===e&&(_=p),Ta(n,y,_)}},Xt)}function C0(n,i,o,u,f,p,y){var _=ru(n,o),v=ru(i,o),A=y.get(v);if(A){Ta(n,o,A);return}var B=p?p(_,v,o+"",n,i,y):e,F=B===e;if(F){var x=k(v),L=!x&&jn(v),N=!x&&!L&&Vr(v);B=v,x||L||N?k(_)?B=_:xt(_)?B=qt(_):L?(F=!1,B=Xl(v,!0)):N?(F=!1,B=Ql(v,!0)):B=[]:Mi(v)||dr(v)?(B=_,dr(_)?B=qf(_):(!Bt(_)||vn(_))&&(B=mf(v))):F=!1}F&&(y.set(v,B),f(B,v,u,p,y),y.delete(v)),Ta(n,o,B)}function Vl(n,i){var o=n.length;if(o)return i+=i<0?o:0,mn(i,o)?n[i]:e}function Wl(n,i,o){i.length?i=It(i,function(p){return k(p)?function(y){return lr(y,p.length===1?p[0]:p)}:p}):i=[Qt];var u=-1;i=It(i,ce(R()));var f=Pl(n,function(p,y,_){var v=It(i,function(A){return A(p)});return{criteria:v,index:++u,value:p}});return cg(f,function(p,y){return J0(p,y,o)})}function U0(n,i){return kl(n,i,function(o,u){return hu(n,u)})}function kl(n,i,o){for(var u=-1,f=i.length,p={};++u<f;){var y=i[u],_=lr(n,y);o(_,y)&&Di(p,Wn(y,n),_)}return p}function P0(n){return function(i){return lr(i,n)}}function za(n,i,o,u){var f=u?ug:Tr,p=-1,y=i.length,_=n;for(n===i&&(i=qt(i)),o&&(_=It(n,ce(o)));++p<y;)for(var v=0,A=i[p],B=o?o(A):A;(v=f(_,B,v,u))>-1;)_!==n&&ws.call(_,v,1),ws.call(n,v,1);return n}function jl(n,i){for(var o=n?i.length:0,u=o-1;o--;){var f=i[o];if(o==u||f!==p){var p=f;mn(f)?ws.call(n,f,1):ka(n,f)}}return n}function $a(n,i){return n+As(Al()*(i-n+1))}function z0(n,i,o,u){for(var f=-1,p=Rt(Is((i-n)/(o||1)),0),y=S(p);p--;)y[u?p:++f]=n,n+=o;return y}function Va(n,i){var o="";if(!n||i<1||i>En)return o;do i%2&&(o+=n),i=As(i/2),i&&(n+=n);while(i);return o}function Q(n,i){return iu(wf(n,i,Qt),n+"")}function $0(n){return Fl(Wr(n))}function V0(n,i){var o=Wr(n);return Vs(o,cr(i,0,o.length))}function Di(n,i,o,u){if(!Bt(n))return n;i=Wn(i,n);for(var f=-1,p=i.length,y=p-1,_=n;_!=null&&++f<p;){var v=Je(i[f]),A=o;if(v==="__proto__"||v==="constructor"||v==="prototype")return n;if(f!=y){var B=_[v];A=u?u(B,v,_):e,A===e&&(A=Bt(B)?B:mn(i[f+1])?[]:{})}Ai(_,v,A),_=_[v]}return n}var Hl=Bs?function(n,i){return Bs.set(n,i),n}:Qt,W0=Ss?function(n,i){return Ss(n,"toString",{configurable:!0,enumerable:!1,value:pu(i),writable:!0})}:Qt;function k0(n){return Vs(Wr(n))}function Be(n,i,o){var u=-1,f=n.length;i<0&&(i=-i>f?0:f+i),o=o>f?f:o,o<0&&(o+=f),f=i>o?0:o-i>>>0,i>>>=0;for(var p=S(f);++u<f;)p[u]=n[u+i];return p}function j0(n,i){var o;return $n(n,function(u,f,p){return o=i(u,f,p),!o}),!!o}function Ms(n,i,o){var u=0,f=n==null?u:n.length;if(typeof i=="number"&&i===i&&f<=Yp){for(;u<f;){var p=u+f>>>1,y=n[p];y!==null&&!fe(y)&&(o?y<=i:y<i)?u=p+1:f=p}return f}return Wa(n,i,Qt,o)}function Wa(n,i,o,u){var f=0,p=n==null?0:n.length;if(p===0)return 0;i=o(i);for(var y=i!==i,_=i===null,v=fe(i),A=i===e;f<p;){var B=As((f+p)/2),F=o(n[B]),x=F!==e,L=F===null,N=F===F,q=fe(F);if(y)var E=u||N;else A?E=N&&(u||x):_?E=N&&x&&(u||!L):v?E=N&&x&&!L&&(u||!q):L||q?E=!1:E=u?F<=i:F<i;E?f=B+1:p=B}return $t(p,Hp)}function Yl(n,i){for(var o=-1,u=n.length,f=0,p=[];++o<u;){var y=n[o],_=i?i(y):y;if(!o||!Ue(_,v)){var v=_;p[f++]=y===0?0:y}}return p}function Gl(n){return typeof n=="number"?n:fe(n)?rs:+n}function le(n){if(typeof n=="string")return n;if(k(n))return It(n,le)+"";if(fe(n))return Bl?Bl.call(n):"";var i=n+"";return i=="0"&&1/n==-ir?"-0":i}function Vn(n,i,o){var u=-1,f=fs,p=n.length,y=!0,_=[],v=_;if(o)y=!1,f=_a;else if(p>=a){var A=i?null:e_(n);if(A)return ds(A);y=!1,f=mi,v=new ur}else v=i?[]:_;t:for(;++u<p;){var B=n[u],F=i?i(B):B;if(B=o||B!==0?B:0,y&&F===F){for(var x=v.length;x--;)if(v[x]===F)continue t;i&&v.push(F),_.push(B)}else f(v,F,o)||(v!==_&&v.push(F),_.push(B))}return _}function ka(n,i){return i=Wn(i,n),n=Sf(n,i),n==null||delete n[Je(Oe(i))]}function Kl(n,i,o,u){return Di(n,i,o(lr(n,i)),u)}function Rs(n,i,o,u){for(var f=n.length,p=u?f:-1;(u?p--:++p<f)&&i(n[p],p,n););return o?Be(n,u?0:p,u?p+1:f):Be(n,u?p+1:0,u?f:p)}function Jl(n,i){var o=n;return o instanceof et&&(o=o.value()),ma(i,function(u,f){return f.func.apply(f.thisArg,Un([u],f.args))},o)}function ja(n,i,o){var u=n.length;if(u<2)return u?Vn(n[0]):[];for(var f=-1,p=S(u);++f<u;)for(var y=n[f],_=-1;++_<u;)_!=f&&(p[f]=Bi(p[f]||y,n[_],i,o));return Vn(zt(p,1),i,o)}function ql(n,i,o){for(var u=-1,f=n.length,p=i.length,y={};++u<f;){var _=u<p?i[u]:e;o(y,n[u],_)}return y}function Ha(n){return xt(n)?n:[]}function Ya(n){return typeof n=="function"?n:Qt}function Wn(n,i){return k(n)?n:eu(n,i)?[n]:Of(ut(n))}var H0=Q;function kn(n,i,o){var u=n.length;return o=o===e?u:o,!i&&o>=u?n:Be(n,i,o)}var Zl=Mg||function(n){return Pt.clearTimeout(n)};function Xl(n,i){if(i)return n.slice();var o=n.length,u=vl?vl(o):new n.constructor(o);return n.copy(u),u}function Ga(n){var i=new n.constructor(n.byteLength);return new vs(i).set(new vs(n)),i}function Y0(n,i){var o=i?Ga(n.buffer):n.buffer;return new n.constructor(o,n.byteOffset,n.byteLength)}function G0(n){var i=new n.constructor(n.source,Ec.exec(n));return i.lastIndex=n.lastIndex,i}function K0(n){return Ii?gt(Ii.call(n)):{}}function Ql(n,i){var o=i?Ga(n.buffer):n.buffer;return new n.constructor(o,n.byteOffset,n.length)}function tf(n,i){if(n!==i){var o=n!==e,u=n===null,f=n===n,p=fe(n),y=i!==e,_=i===null,v=i===i,A=fe(i);if(!_&&!A&&!p&&n>i||p&&y&&v&&!_&&!A||u&&y&&v||!o&&v||!f)return 1;if(!u&&!p&&!A&&n<i||A&&o&&f&&!u&&!p||_&&o&&f||!y&&f||!v)return-1}return 0}function J0(n,i,o){for(var u=-1,f=n.criteria,p=i.criteria,y=f.length,_=o.length;++u<y;){var v=tf(f[u],p[u]);if(v){if(u>=_)return v;var A=o[u];return v*(A=="desc"?-1:1)}}return n.index-i.index}function ef(n,i,o,u){for(var f=-1,p=n.length,y=o.length,_=-1,v=i.length,A=Rt(p-y,0),B=S(v+A),F=!u;++_<v;)B[_]=i[_];for(;++f<y;)(F||f<p)&&(B[o[f]]=n[f]);for(;A--;)B[_++]=n[f++];return B}function nf(n,i,o,u){for(var f=-1,p=n.length,y=-1,_=o.length,v=-1,A=i.length,B=Rt(p-_,0),F=S(B+A),x=!u;++f<B;)F[f]=n[f];for(var L=f;++v<A;)F[L+v]=i[v];for(;++y<_;)(x||f<p)&&(F[L+o[y]]=n[f++]);return F}function qt(n,i){var o=-1,u=n.length;for(i||(i=S(u));++o<u;)i[o]=n[o];return i}function Ke(n,i,o,u){var f=!o;o||(o={});for(var p=-1,y=i.length;++p<y;){var _=i[p],v=u?u(o[_],n[_],_,o,n):e;v===e&&(v=n[_]),f?yn(o,_,v):Ai(o,_,v)}return o}function q0(n,i){return Ke(n,tu(n),i)}function Z0(n,i){return Ke(n,gf(n),i)}function Ns(n,i){return function(o,u){var f=k(o)?ng:v0,p=i?i():{};return f(o,n,R(u,2),p)}}function Pr(n){return Q(function(i,o){var u=-1,f=o.length,p=f>1?o[f-1]:e,y=f>2?o[2]:e;for(p=n.length>3&&typeof p=="function"?(f--,p):e,y&&kt(o[0],o[1],y)&&(p=f<3?e:p,f=1),i=gt(i);++u<f;){var _=o[u];_&&n(i,_,u,p)}return i})}function rf(n,i){return function(o,u){if(o==null)return o;if(!Zt(o))return n(o,u);for(var f=o.length,p=i?f:-1,y=gt(o);(i?p--:++p<f)&&u(y[p],p,y)!==!1;);return o}}function sf(n){return function(i,o,u){for(var f=-1,p=gt(i),y=u(i),_=y.length;_--;){var v=y[n?_:++f];if(o(p[v],v,p)===!1)break}return i}}function X0(n,i,o){var u=i&Kt,f=xi(n);function p(){var y=this&&this!==Pt&&this instanceof p?f:n;return y.apply(u?o:this,arguments)}return p}function of(n){return function(i){i=ut(i);var o=Lr(i)?Ee(i):e,u=o?o[0]:i.charAt(0),f=o?kn(o,1).join(""):i.slice(1);return u[n]()+f}}function zr(n){return function(i){return ma(ih(rh(i).replace(Wy,"")),n,"")}}function xi(n){return function(){var i=arguments;switch(i.length){case 0:return new n;case 1:return new n(i[0]);case 2:return new n(i[0],i[1]);case 3:return new n(i[0],i[1],i[2]);case 4:return new n(i[0],i[1],i[2],i[3]);case 5:return new n(i[0],i[1],i[2],i[3],i[4]);case 6:return new n(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return new n(i[0],i[1],i[2],i[3],i[4],i[5],i[6])}var o=Ur(n.prototype),u=n.apply(o,i);return Bt(u)?u:o}}function Q0(n,i,o){var u=xi(n);function f(){for(var p=arguments.length,y=S(p),_=p,v=$r(f);_--;)y[_]=arguments[_];var A=p<3&&y[0]!==v&&y[p-1]!==v?[]:Pn(y,v);if(p-=A.length,p<o)return ff(n,i,Es,f.placeholder,e,y,A,e,e,o-p);var B=this&&this!==Pt&&this instanceof f?u:n;return ue(B,this,y)}return f}function af(n){return function(i,o,u){var f=gt(i);if(!Zt(i)){var p=R(o,3);i=Ct(i),o=function(_){return p(f[_],_,f)}}var y=n(i,o,u);return y>-1?f[p?i[y]:y]:e}}function uf(n){return _n(function(i){var o=i.length,u=o,f=Ie.prototype.thru;for(n&&i.reverse();u--;){var p=i[u];if(typeof p!="function")throw new Se(l);if(f&&!y&&zs(p)=="wrapper")var y=new Ie([],!0)}for(u=y?u:o;++u<o;){p=i[u];var _=zs(p),v=_=="wrapper"?Xa(p):e;v&&nu(v[0])&&v[1]==(fn|je|He|li)&&!v[4].length&&v[9]==1?y=y[zs(v[0])].apply(y,v[3]):y=p.length==1&&nu(p)?y[_]():y.thru(p)}return function(){var A=arguments,B=A[0];if(y&&A.length==1&&k(B))return y.plant(B).value();for(var F=0,x=o?i[F].apply(this,A):B;++F<o;)x=i[F].call(this,x);return x}})}function Es(n,i,o,u,f,p,y,_,v,A){var B=i&fn,F=i&Kt,x=i&Jt,L=i&(je|Br),N=i&Xo,q=x?e:xi(n);function E(){for(var tt=arguments.length,nt=S(tt),he=tt;he--;)nt[he]=arguments[he];if(L)var jt=$r(E),de=fg(nt,jt);if(u&&(nt=ef(nt,u,f,L)),p&&(nt=nf(nt,p,y,L)),tt-=de,L&&tt<A){var Tt=Pn(nt,jt);return ff(n,i,Es,E.placeholder,o,nt,Tt,_,v,A-tt)}var Pe=F?o:this,wn=x?Pe[n]:n;return tt=nt.length,_?nt=v_(nt,_):N&&tt>1&&nt.reverse(),B&&v<tt&&(nt.length=v),this&&this!==Pt&&this instanceof E&&(wn=q||xi(wn)),wn.apply(Pe,nt)}return E}function cf(n,i){return function(o,u){return F0(o,n,i(u),{})}}function Cs(n,i){return function(o,u){var f;if(o===e&&u===e)return i;if(o!==e&&(f=o),u!==e){if(f===e)return u;typeof o=="string"||typeof u=="string"?(o=le(o),u=le(u)):(o=Gl(o),u=Gl(u)),f=n(o,u)}return f}}function Ka(n){return _n(function(i){return i=It(i,ce(R())),Q(function(o){var u=this;return n(i,function(f){return ue(f,u,o)})})})}function Us(n,i){i=i===e?" ":le(i);var o=i.length;if(o<2)return o?Va(i,n):i;var u=Va(i,Is(n/Mr(i)));return Lr(i)?kn(Ee(u),0,n).join(""):u.slice(0,n)}function t_(n,i,o,u){var f=i&Kt,p=xi(n);function y(){for(var _=-1,v=arguments.length,A=-1,B=u.length,F=S(B+v),x=this&&this!==Pt&&this instanceof y?p:n;++A<B;)F[A]=u[A];for(;v--;)F[A++]=arguments[++_];return ue(x,f?o:this,F)}return y}function lf(n){return function(i,o,u){return u&&typeof u!="number"&&kt(i,o,u)&&(o=u=e),i=bn(i),o===e?(o=i,i=0):o=bn(o),u=u===e?i<o?1:-1:bn(u),z0(i,o,u,n)}}function Ps(n){return function(i,o){return typeof i=="string"&&typeof o=="string"||(i=Fe(i),o=Fe(o)),n(i,o)}}function ff(n,i,o,u,f,p,y,_,v,A){var B=i&je,F=B?y:e,x=B?e:y,L=B?p:e,N=B?e:p;i|=B?He:Or,i&=~(B?Or:He),i&ns||(i&=~(Kt|Jt));var q=[n,i,f,L,F,N,x,_,v,A],E=o.apply(e,q);return nu(n)&&If(E,q),E.placeholder=u,Af(E,n,i)}function Ja(n){var i=Mt[n];return function(o,u){if(o=Fe(o),u=u==null?0:$t(K(u),292),u&&Il(o)){var f=(ut(o)+"e").split("e"),p=i(f[0]+"e"+(+f[1]+u));return f=(ut(p)+"e").split("e"),+(f[0]+"e"+(+f[1]-u))}return i(o)}}var e_=Er&&1/ds(new Er([,-0]))[1]==ir?function(n){return new Er(n)}:_u;function hf(n){return function(i){var o=Vt(i);return o==Re?Ba(i):o==Ne?mg(i):lg(i,n(i))}}function gn(n,i,o,u,f,p,y,_){var v=i&Jt;if(!v&&typeof n!="function")throw new Se(l);var A=u?u.length:0;if(A||(i&=~(He|Or),u=f=e),y=y===e?y:Rt(K(y),0),_=_===e?_:K(_),A-=f?f.length:0,i&Or){var B=u,F=f;u=f=e}var x=v?e:Xa(n),L=[n,i,o,u,f,B,F,p,y,_];if(x&&g_(L,x),n=L[0],i=L[1],o=L[2],u=L[3],f=L[4],_=L[9]=L[9]===e?v?0:n.length:Rt(L[9]-A,0),!_&&i&(je|Br)&&(i&=~(je|Br)),!i||i==Kt)var N=X0(n,i,o);else i==je||i==Br?N=Q0(n,i,_):(i==He||i==(Kt|He))&&!f.length?N=t_(n,i,o,u):N=Es.apply(e,L);var q=x?Hl:If;return Af(q(N,L),n,i)}function df(n,i,o,u){return n===e||Ue(n,Nr[o])&&!ht.call(u,o)?i:n}function pf(n,i,o,u,f,p){return Bt(n)&&Bt(i)&&(p.set(i,n),Ls(n,i,e,pf,p),p.delete(i)),n}function n_(n){return Mi(n)?e:n}function yf(n,i,o,u,f,p){var y=o&At,_=n.length,v=i.length;if(_!=v&&!(y&&v>_))return!1;var A=p.get(n),B=p.get(i);if(A&&B)return A==i&&B==n;var F=-1,x=!0,L=o&Nn?new ur:e;for(p.set(n,i),p.set(i,n);++F<_;){var N=n[F],q=i[F];if(u)var E=y?u(q,N,F,i,n,p):u(N,q,F,n,i,p);if(E!==e){if(E)continue;x=!1;break}if(L){if(!va(i,function(tt,nt){if(!mi(L,nt)&&(N===tt||f(N,tt,o,u,p)))return L.push(nt)})){x=!1;break}}else if(!(N===q||f(N,q,o,u,p))){x=!1;break}}return p.delete(n),p.delete(i),x}function r_(n,i,o,u,f,p,y){switch(o){case Dr:if(n.byteLength!=i.byteLength||n.byteOffset!=i.byteOffset)return!1;n=n.buffer,i=i.buffer;case _i:return!(n.byteLength!=i.byteLength||!p(new vs(n),new vs(i)));case fi:case hi:case di:return Ue(+n,+i);case ss:return n.name==i.name&&n.message==i.message;case pi:case yi:return n==i+"";case Re:var _=Ba;case Ne:var v=u&At;if(_||(_=ds),n.size!=i.size&&!v)return!1;var A=y.get(n);if(A)return A==i;u|=Nn,y.set(n,i);var B=yf(_(n),_(i),u,f,p,y);return y.delete(n),B;case as:if(Ii)return Ii.call(n)==Ii.call(i)}return!1}function i_(n,i,o,u,f,p){var y=o&At,_=qa(n),v=_.length,A=qa(i),B=A.length;if(v!=B&&!y)return!1;for(var F=v;F--;){var x=_[F];if(!(y?x in i:ht.call(i,x)))return!1}var L=p.get(n),N=p.get(i);if(L&&N)return L==i&&N==n;var q=!0;p.set(n,i),p.set(i,n);for(var E=y;++F<v;){x=_[F];var tt=n[x],nt=i[x];if(u)var he=y?u(nt,tt,x,i,n,p):u(tt,nt,x,n,i,p);if(!(he===e?tt===nt||f(tt,nt,o,u,p):he)){q=!1;break}E||(E=x=="constructor")}if(q&&!E){var jt=n.constructor,de=i.constructor;jt!=de&&"constructor"in n&&"constructor"in i&&!(typeof jt=="function"&&jt instanceof jt&&typeof de=="function"&&de instanceof de)&&(q=!1)}return p.delete(n),p.delete(i),q}function _n(n){return iu(wf(n,e,Tf),n+"")}function qa(n){return Nl(n,Ct,tu)}function Za(n){return Nl(n,Xt,gf)}var Xa=Bs?function(n){return Bs.get(n)}:_u;function zs(n){for(var i=n.name+"",o=Cr[i],u=ht.call(Cr,i)?o.length:0;u--;){var f=o[u],p=f.func;if(p==null||p==n)return f.name}return i}function $r(n){var i=ht.call(h,"placeholder")?h:n;return i.placeholder}function R(){var n=h.iteratee||yu;return n=n===yu?Ul:n,arguments.length?n(arguments[0],arguments[1]):n}function $s(n,i){var o=n.__data__;return h_(i)?o[typeof i=="string"?"string":"hash"]:o.map}function Qa(n){for(var i=Ct(n),o=i.length;o--;){var u=i[o],f=n[u];i[o]=[u,f,vf(f)]}return i}function fr(n,i){var o=yg(n,i);return Cl(o)?o:e}function s_(n){var i=ht.call(n,or),o=n[or];try{n[or]=e;var u=!0}catch{}var f=_s.call(n);return u&&(i?n[or]=o:delete n[or]),f}var tu=Fa?function(n){return n==null?[]:(n=gt(n),Cn(Fa(n),function(i){return wl.call(n,i)}))}:mu,gf=Fa?function(n){for(var i=[];n;)Un(i,tu(n)),n=bs(n);return i}:mu,Vt=Wt;(Da&&Vt(new Da(new ArrayBuffer(1)))!=Dr||bi&&Vt(new bi)!=Re||xa&&Vt(xa.resolve())!=Lc||Er&&Vt(new Er)!=Ne||wi&&Vt(new wi)!=gi)&&(Vt=function(n){var i=Wt(n),o=i==hn?n.constructor:e,u=o?hr(o):"";if(u)switch(u){case Vg:return Dr;case Wg:return Re;case kg:return Lc;case jg:return Ne;case Hg:return gi}return i});function o_(n,i,o){for(var u=-1,f=o.length;++u<f;){var p=o[u],y=p.size;switch(p.type){case"drop":n+=y;break;case"dropRight":i-=y;break;case"take":i=$t(i,n+y);break;case"takeRight":n=Rt(n,i-y);break}}return{start:n,end:i}}function a_(n){var i=n.match(dy);return i?i[1].split(py):[]}function _f(n,i,o){i=Wn(i,n);for(var u=-1,f=i.length,p=!1;++u<f;){var y=Je(i[u]);if(!(p=n!=null&&o(n,y)))break;n=n[y]}return p||++u!=f?p:(f=n==null?0:n.length,!!f&&Gs(f)&&mn(y,f)&&(k(n)||dr(n)))}function u_(n){var i=n.length,o=new n.constructor(i);return i&&typeof n[0]=="string"&&ht.call(n,"index")&&(o.index=n.index,o.input=n.input),o}function mf(n){return typeof n.constructor=="function"&&!Ti(n)?Ur(bs(n)):{}}function c_(n,i,o){var u=n.constructor;switch(i){case _i:return Ga(n);case fi:case hi:return new u(+n);case Dr:return Y0(n,o);case Qo:case ta:case ea:case na:case ra:case ia:case sa:case oa:case aa:return Ql(n,o);case Re:return new u;case di:case yi:return new u(n);case pi:return G0(n);case Ne:return new u;case as:return K0(n)}}function l_(n,i){var o=i.length;if(!o)return n;var u=o-1;return i[u]=(o>1?"& ":"")+i[u],i=i.join(o>2?", ":" "),n.replace(hy,`{
/* [wrapped with `+i+`] */
`)}function f_(n){return k(n)||dr(n)||!!(Sl&&n&&n[Sl])}function mn(n,i){var o=typeof n;return i=i??En,!!i&&(o=="number"||o!="symbol"&&Iy.test(n))&&n>-1&&n%1==0&&n<i}function kt(n,i,o){if(!Bt(o))return!1;var u=typeof i;return(u=="number"?Zt(o)&&mn(i,o.length):u=="string"&&i in o)?Ue(o[i],n):!1}function eu(n,i){if(k(n))return!1;var o=typeof n;return o=="number"||o=="symbol"||o=="boolean"||n==null||fe(n)?!0:uy.test(n)||!ay.test(n)||i!=null&&n in gt(i)}function h_(n){var i=typeof n;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?n!=="__proto__":n===null}function nu(n){var i=zs(n),o=h[i];if(typeof o!="function"||!(i in et.prototype))return!1;if(n===o)return!0;var u=Xa(o);return!!u&&n===u[0]}function d_(n){return!!ml&&ml in n}var p_=ys?vn:vu;function Ti(n){var i=n&&n.constructor,o=typeof i=="function"&&i.prototype||Nr;return n===o}function vf(n){return n===n&&!Bt(n)}function bf(n,i){return function(o){return o==null?!1:o[n]===i&&(i!==e||n in gt(o))}}function y_(n){var i=Hs(n,function(u){return o.size===w&&o.clear(),u}),o=i.cache;return i}function g_(n,i){var o=n[1],u=i[1],f=o|u,p=f<(Kt|Jt|fn),y=u==fn&&o==je||u==fn&&o==li&&n[7].length<=i[8]||u==(fn|li)&&i[7].length<=i[8]&&o==je;if(!(p||y))return n;u&Kt&&(n[2]=i[2],f|=o&Kt?0:ns);var _=i[3];if(_){var v=n[3];n[3]=v?ef(v,_,i[4]):_,n[4]=v?Pn(n[3],O):i[4]}return _=i[5],_&&(v=n[5],n[5]=v?nf(v,_,i[6]):_,n[6]=v?Pn(n[5],O):i[6]),_=i[7],_&&(n[7]=_),u&fn&&(n[8]=n[8]==null?i[8]:$t(n[8],i[8])),n[9]==null&&(n[9]=i[9]),n[0]=i[0],n[1]=f,n}function __(n){var i=[];if(n!=null)for(var o in gt(n))i.push(o);return i}function m_(n){return _s.call(n)}function wf(n,i,o){return i=Rt(i===e?n.length-1:i,0),function(){for(var u=arguments,f=-1,p=Rt(u.length-i,0),y=S(p);++f<p;)y[f]=u[i+f];f=-1;for(var _=S(i+1);++f<i;)_[f]=u[f];return _[i]=o(y),ue(n,this,_)}}function Sf(n,i){return i.length<2?n:lr(n,Be(i,0,-1))}function v_(n,i){for(var o=n.length,u=$t(i.length,o),f=qt(n);u--;){var p=i[u];n[u]=mn(p,o)?f[p]:e}return n}function ru(n,i){if(!(i==="constructor"&&typeof n[i]=="function")&&i!="__proto__")return n[i]}var If=Bf(Hl),Li=Ng||function(n,i){return Pt.setTimeout(n,i)},iu=Bf(W0);function Af(n,i,o){var u=i+"";return iu(n,l_(u,b_(a_(u),o)))}function Bf(n){var i=0,o=0;return function(){var u=Pg(),f=Vp-(u-o);if(o=u,f>0){if(++i>=$p)return arguments[0]}else i=0;return n.apply(e,arguments)}}function Vs(n,i){var o=-1,u=n.length,f=u-1;for(i=i===e?u:i;++o<i;){var p=$a(o,f),y=n[p];n[p]=n[o],n[o]=y}return n.length=i,n}var Of=y_(function(n){var i=[];return n.charCodeAt(0)===46&&i.push(""),n.replace(cy,function(o,u,f,p){i.push(f?p.replace(_y,"$1"):u||o)}),i});function Je(n){if(typeof n=="string"||fe(n))return n;var i=n+"";return i=="0"&&1/n==-ir?"-0":i}function hr(n){if(n!=null){try{return gs.call(n)}catch{}try{return n+""}catch{}}return""}function b_(n,i){return we(Gp,function(o){var u="_."+o[0];i&o[1]&&!fs(n,u)&&n.push(u)}),n.sort()}function Ff(n){if(n instanceof et)return n.clone();var i=new Ie(n.__wrapped__,n.__chain__);return i.__actions__=qt(n.__actions__),i.__index__=n.__index__,i.__values__=n.__values__,i}function w_(n,i,o){(o?kt(n,i,o):i===e)?i=1:i=Rt(K(i),0);var u=n==null?0:n.length;if(!u||i<1)return[];for(var f=0,p=0,y=S(Is(u/i));f<u;)y[p++]=Be(n,f,f+=i);return y}function S_(n){for(var i=-1,o=n==null?0:n.length,u=0,f=[];++i<o;){var p=n[i];p&&(f[u++]=p)}return f}function I_(){var n=arguments.length;if(!n)return[];for(var i=S(n-1),o=arguments[0],u=n;u--;)i[u-1]=arguments[u];return Un(k(o)?qt(o):[o],zt(i,1))}var A_=Q(function(n,i){return xt(n)?Bi(n,zt(i,1,xt,!0)):[]}),B_=Q(function(n,i){var o=Oe(i);return xt(o)&&(o=e),xt(n)?Bi(n,zt(i,1,xt,!0),R(o,2)):[]}),O_=Q(function(n,i){var o=Oe(i);return xt(o)&&(o=e),xt(n)?Bi(n,zt(i,1,xt,!0),e,o):[]});function F_(n,i,o){var u=n==null?0:n.length;return u?(i=o||i===e?1:K(i),Be(n,i<0?0:i,u)):[]}function D_(n,i,o){var u=n==null?0:n.length;return u?(i=o||i===e?1:K(i),i=u-i,Be(n,0,i<0?0:i)):[]}function x_(n,i){return n&&n.length?Rs(n,R(i,3),!0,!0):[]}function T_(n,i){return n&&n.length?Rs(n,R(i,3),!0):[]}function L_(n,i,o,u){var f=n==null?0:n.length;return f?(o&&typeof o!="number"&&kt(n,i,o)&&(o=0,u=f),I0(n,i,o,u)):[]}function Df(n,i,o){var u=n==null?0:n.length;if(!u)return-1;var f=o==null?0:K(o);return f<0&&(f=Rt(u+f,0)),hs(n,R(i,3),f)}function xf(n,i,o){var u=n==null?0:n.length;if(!u)return-1;var f=u-1;return o!==e&&(f=K(o),f=o<0?Rt(u+f,0):$t(f,u-1)),hs(n,R(i,3),f,!0)}function Tf(n){var i=n==null?0:n.length;return i?zt(n,1):[]}function M_(n){var i=n==null?0:n.length;return i?zt(n,ir):[]}function R_(n,i){var o=n==null?0:n.length;return o?(i=i===e?1:K(i),zt(n,i)):[]}function N_(n){for(var i=-1,o=n==null?0:n.length,u={};++i<o;){var f=n[i];u[f[0]]=f[1]}return u}function Lf(n){return n&&n.length?n[0]:e}function E_(n,i,o){var u=n==null?0:n.length;if(!u)return-1;var f=o==null?0:K(o);return f<0&&(f=Rt(u+f,0)),Tr(n,i,f)}function C_(n){var i=n==null?0:n.length;return i?Be(n,0,-1):[]}var U_=Q(function(n){var i=It(n,Ha);return i.length&&i[0]===n[0]?Ea(i):[]}),P_=Q(function(n){var i=Oe(n),o=It(n,Ha);return i===Oe(o)?i=e:o.pop(),o.length&&o[0]===n[0]?Ea(o,R(i,2)):[]}),z_=Q(function(n){var i=Oe(n),o=It(n,Ha);return i=typeof i=="function"?i:e,i&&o.pop(),o.length&&o[0]===n[0]?Ea(o,e,i):[]});function $_(n,i){return n==null?"":Cg.call(n,i)}function Oe(n){var i=n==null?0:n.length;return i?n[i-1]:e}function V_(n,i,o){var u=n==null?0:n.length;if(!u)return-1;var f=u;return o!==e&&(f=K(o),f=f<0?Rt(u+f,0):$t(f,u-1)),i===i?bg(n,i,f):hs(n,ll,f,!0)}function W_(n,i){return n&&n.length?Vl(n,K(i)):e}var k_=Q(Mf);function Mf(n,i){return n&&n.length&&i&&i.length?za(n,i):n}function j_(n,i,o){return n&&n.length&&i&&i.length?za(n,i,R(o,2)):n}function H_(n,i,o){return n&&n.length&&i&&i.length?za(n,i,e,o):n}var Y_=_n(function(n,i){var o=n==null?0:n.length,u=La(n,i);return jl(n,It(i,function(f){return mn(f,o)?+f:f}).sort(tf)),u});function G_(n,i){var o=[];if(!(n&&n.length))return o;var u=-1,f=[],p=n.length;for(i=R(i,3);++u<p;){var y=n[u];i(y,u,n)&&(o.push(y),f.push(u))}return jl(n,f),o}function su(n){return n==null?n:$g.call(n)}function K_(n,i,o){var u=n==null?0:n.length;return u?(o&&typeof o!="number"&&kt(n,i,o)?(i=0,o=u):(i=i==null?0:K(i),o=o===e?u:K(o)),Be(n,i,o)):[]}function J_(n,i){return Ms(n,i)}function q_(n,i,o){return Wa(n,i,R(o,2))}function Z_(n,i){var o=n==null?0:n.length;if(o){var u=Ms(n,i);if(u<o&&Ue(n[u],i))return u}return-1}function X_(n,i){return Ms(n,i,!0)}function Q_(n,i,o){return Wa(n,i,R(o,2),!0)}function tm(n,i){var o=n==null?0:n.length;if(o){var u=Ms(n,i,!0)-1;if(Ue(n[u],i))return u}return-1}function em(n){return n&&n.length?Yl(n):[]}function nm(n,i){return n&&n.length?Yl(n,R(i,2)):[]}function rm(n){var i=n==null?0:n.length;return i?Be(n,1,i):[]}function im(n,i,o){return n&&n.length?(i=o||i===e?1:K(i),Be(n,0,i<0?0:i)):[]}function sm(n,i,o){var u=n==null?0:n.length;return u?(i=o||i===e?1:K(i),i=u-i,Be(n,i<0?0:i,u)):[]}function om(n,i){return n&&n.length?Rs(n,R(i,3),!1,!0):[]}function am(n,i){return n&&n.length?Rs(n,R(i,3)):[]}var um=Q(function(n){return Vn(zt(n,1,xt,!0))}),cm=Q(function(n){var i=Oe(n);return xt(i)&&(i=e),Vn(zt(n,1,xt,!0),R(i,2))}),lm=Q(function(n){var i=Oe(n);return i=typeof i=="function"?i:e,Vn(zt(n,1,xt,!0),e,i)});function fm(n){return n&&n.length?Vn(n):[]}function hm(n,i){return n&&n.length?Vn(n,R(i,2)):[]}function dm(n,i){return i=typeof i=="function"?i:e,n&&n.length?Vn(n,e,i):[]}function ou(n){if(!(n&&n.length))return[];var i=0;return n=Cn(n,function(o){if(xt(o))return i=Rt(o.length,i),!0}),Ia(i,function(o){return It(n,ba(o))})}function Rf(n,i){if(!(n&&n.length))return[];var o=ou(n);return i==null?o:It(o,function(u){return ue(i,e,u)})}var pm=Q(function(n,i){return xt(n)?Bi(n,i):[]}),ym=Q(function(n){return ja(Cn(n,xt))}),gm=Q(function(n){var i=Oe(n);return xt(i)&&(i=e),ja(Cn(n,xt),R(i,2))}),_m=Q(function(n){var i=Oe(n);return i=typeof i=="function"?i:e,ja(Cn(n,xt),e,i)}),mm=Q(ou);function vm(n,i){return ql(n||[],i||[],Ai)}function bm(n,i){return ql(n||[],i||[],Di)}var wm=Q(function(n){var i=n.length,o=i>1?n[i-1]:e;return o=typeof o=="function"?(n.pop(),o):e,Rf(n,o)});function Nf(n){var i=h(n);return i.__chain__=!0,i}function Sm(n,i){return i(n),n}function Ws(n,i){return i(n)}var Im=_n(function(n){var i=n.length,o=i?n[0]:0,u=this.__wrapped__,f=function(p){return La(p,n)};return i>1||this.__actions__.length||!(u instanceof et)||!mn(o)?this.thru(f):(u=u.slice(o,+o+(i?1:0)),u.__actions__.push({func:Ws,args:[f],thisArg:e}),new Ie(u,this.__chain__).thru(function(p){return i&&!p.length&&p.push(e),p}))});function Am(){return Nf(this)}function Bm(){return new Ie(this.value(),this.__chain__)}function Om(){this.__values__===e&&(this.__values__=Kf(this.value()));var n=this.__index__>=this.__values__.length,i=n?e:this.__values__[this.__index__++];return{done:n,value:i}}function Fm(){return this}function Dm(n){for(var i,o=this;o instanceof Fs;){var u=Ff(o);u.__index__=0,u.__values__=e,i?f.__wrapped__=u:i=u;var f=u;o=o.__wrapped__}return f.__wrapped__=n,i}function xm(){var n=this.__wrapped__;if(n instanceof et){var i=n;return this.__actions__.length&&(i=new et(this)),i=i.reverse(),i.__actions__.push({func:Ws,args:[su],thisArg:e}),new Ie(i,this.__chain__)}return this.thru(su)}function Tm(){return Jl(this.__wrapped__,this.__actions__)}var Lm=Ns(function(n,i,o){ht.call(n,o)?++n[o]:yn(n,o,1)});function Mm(n,i,o){var u=k(n)?ul:S0;return o&&kt(n,i,o)&&(i=e),u(n,R(i,3))}function Rm(n,i){var o=k(n)?Cn:Ml;return o(n,R(i,3))}var Nm=af(Df),Em=af(xf);function Cm(n,i){return zt(ks(n,i),1)}function Um(n,i){return zt(ks(n,i),ir)}function Pm(n,i,o){return o=o===e?1:K(o),zt(ks(n,i),o)}function Ef(n,i){var o=k(n)?we:$n;return o(n,R(i,3))}function Cf(n,i){var o=k(n)?rg:Ll;return o(n,R(i,3))}var zm=Ns(function(n,i,o){ht.call(n,o)?n[o].push(i):yn(n,o,[i])});function $m(n,i,o,u){n=Zt(n)?n:Wr(n),o=o&&!u?K(o):0;var f=n.length;return o<0&&(o=Rt(f+o,0)),Ks(n)?o<=f&&n.indexOf(i,o)>-1:!!f&&Tr(n,i,o)>-1}var Vm=Q(function(n,i,o){var u=-1,f=typeof i=="function",p=Zt(n)?S(n.length):[];return $n(n,function(y){p[++u]=f?ue(i,y,o):Oi(y,i,o)}),p}),Wm=Ns(function(n,i,o){yn(n,o,i)});function ks(n,i){var o=k(n)?It:Pl;return o(n,R(i,3))}function km(n,i,o,u){return n==null?[]:(k(i)||(i=i==null?[]:[i]),o=u?e:o,k(o)||(o=o==null?[]:[o]),Wl(n,i,o))}var jm=Ns(function(n,i,o){n[o?0:1].push(i)},function(){return[[],[]]});function Hm(n,i,o){var u=k(n)?ma:hl,f=arguments.length<3;return u(n,R(i,4),o,f,$n)}function Ym(n,i,o){var u=k(n)?ig:hl,f=arguments.length<3;return u(n,R(i,4),o,f,Ll)}function Gm(n,i){var o=k(n)?Cn:Ml;return o(n,Ys(R(i,3)))}function Km(n){var i=k(n)?Fl:$0;return i(n)}function Jm(n,i,o){(o?kt(n,i,o):i===e)?i=1:i=K(i);var u=k(n)?_0:V0;return u(n,i)}function qm(n){var i=k(n)?m0:k0;return i(n)}function Zm(n){if(n==null)return 0;if(Zt(n))return Ks(n)?Mr(n):n.length;var i=Vt(n);return i==Re||i==Ne?n.size:Ua(n).length}function Xm(n,i,o){var u=k(n)?va:j0;return o&&kt(n,i,o)&&(i=e),u(n,R(i,3))}var Qm=Q(function(n,i){if(n==null)return[];var o=i.length;return o>1&&kt(n,i[0],i[1])?i=[]:o>2&&kt(i[0],i[1],i[2])&&(i=[i[0]]),Wl(n,zt(i,1),[])}),js=Rg||function(){return Pt.Date.now()};function tv(n,i){if(typeof i!="function")throw new Se(l);return n=K(n),function(){if(--n<1)return i.apply(this,arguments)}}function Uf(n,i,o){return i=o?e:i,i=n&&i==null?n.length:i,gn(n,fn,e,e,e,e,i)}function Pf(n,i){var o;if(typeof i!="function")throw new Se(l);return n=K(n),function(){return--n>0&&(o=i.apply(this,arguments)),n<=1&&(i=e),o}}var au=Q(function(n,i,o){var u=Kt;if(o.length){var f=Pn(o,$r(au));u|=He}return gn(n,u,i,o,f)}),zf=Q(function(n,i,o){var u=Kt|Jt;if(o.length){var f=Pn(o,$r(zf));u|=He}return gn(i,u,n,o,f)});function $f(n,i,o){i=o?e:i;var u=gn(n,je,e,e,e,e,e,i);return u.placeholder=$f.placeholder,u}function Vf(n,i,o){i=o?e:i;var u=gn(n,Br,e,e,e,e,e,i);return u.placeholder=Vf.placeholder,u}function Wf(n,i,o){var u,f,p,y,_,v,A=0,B=!1,F=!1,x=!0;if(typeof n!="function")throw new Se(l);i=Fe(i)||0,Bt(o)&&(B=!!o.leading,F="maxWait"in o,p=F?Rt(Fe(o.maxWait)||0,i):p,x="trailing"in o?!!o.trailing:x);function L(Tt){var Pe=u,wn=f;return u=f=e,A=Tt,y=n.apply(wn,Pe),y}function N(Tt){return A=Tt,_=Li(tt,i),B?L(Tt):y}function q(Tt){var Pe=Tt-v,wn=Tt-A,ah=i-Pe;return F?$t(ah,p-wn):ah}function E(Tt){var Pe=Tt-v,wn=Tt-A;return v===e||Pe>=i||Pe<0||F&&wn>=p}function tt(){var Tt=js();if(E(Tt))return nt(Tt);_=Li(tt,q(Tt))}function nt(Tt){return _=e,x&&u?L(Tt):(u=f=e,y)}function he(){_!==e&&Zl(_),A=0,u=v=f=_=e}function jt(){return _===e?y:nt(js())}function de(){var Tt=js(),Pe=E(Tt);if(u=arguments,f=this,v=Tt,Pe){if(_===e)return N(v);if(F)return Zl(_),_=Li(tt,i),L(v)}return _===e&&(_=Li(tt,i)),y}return de.cancel=he,de.flush=jt,de}var ev=Q(function(n,i){return Tl(n,1,i)}),nv=Q(function(n,i,o){return Tl(n,Fe(i)||0,o)});function rv(n){return gn(n,Xo)}function Hs(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new Se(l);var o=function(){var u=arguments,f=i?i.apply(this,u):u[0],p=o.cache;if(p.has(f))return p.get(f);var y=n.apply(this,u);return o.cache=p.set(f,y)||p,y};return o.cache=new(Hs.Cache||pn),o}Hs.Cache=pn;function Ys(n){if(typeof n!="function")throw new Se(l);return function(){var i=arguments;switch(i.length){case 0:return!n.call(this);case 1:return!n.call(this,i[0]);case 2:return!n.call(this,i[0],i[1]);case 3:return!n.call(this,i[0],i[1],i[2])}return!n.apply(this,i)}}function iv(n){return Pf(2,n)}var sv=H0(function(n,i){i=i.length==1&&k(i[0])?It(i[0],ce(R())):It(zt(i,1),ce(R()));var o=i.length;return Q(function(u){for(var f=-1,p=$t(u.length,o);++f<p;)u[f]=i[f].call(this,u[f]);return ue(n,this,u)})}),uu=Q(function(n,i){var o=Pn(i,$r(uu));return gn(n,He,e,i,o)}),kf=Q(function(n,i){var o=Pn(i,$r(kf));return gn(n,Or,e,i,o)}),ov=_n(function(n,i){return gn(n,li,e,e,e,i)});function av(n,i){if(typeof n!="function")throw new Se(l);return i=i===e?i:K(i),Q(n,i)}function uv(n,i){if(typeof n!="function")throw new Se(l);return i=i==null?0:Rt(K(i),0),Q(function(o){var u=o[i],f=kn(o,0,i);return u&&Un(f,u),ue(n,this,f)})}function cv(n,i,o){var u=!0,f=!0;if(typeof n!="function")throw new Se(l);return Bt(o)&&(u="leading"in o?!!o.leading:u,f="trailing"in o?!!o.trailing:f),Wf(n,i,{leading:u,maxWait:i,trailing:f})}function lv(n){return Uf(n,1)}function fv(n,i){return uu(Ya(i),n)}function hv(){if(!arguments.length)return[];var n=arguments[0];return k(n)?n:[n]}function dv(n){return Ae(n,X)}function pv(n,i){return i=typeof i=="function"?i:e,Ae(n,X,i)}function yv(n){return Ae(n,D|X)}function gv(n,i){return i=typeof i=="function"?i:e,Ae(n,D|X,i)}function _v(n,i){return i==null||xl(n,i,Ct(i))}function Ue(n,i){return n===i||n!==n&&i!==i}var mv=Ps(Na),vv=Ps(function(n,i){return n>=i}),dr=El(function(){return arguments}())?El:function(n){return Dt(n)&&ht.call(n,"callee")&&!wl.call(n,"callee")},k=S.isArray,bv=nl?ce(nl):D0;function Zt(n){return n!=null&&Gs(n.length)&&!vn(n)}function xt(n){return Dt(n)&&Zt(n)}function wv(n){return n===!0||n===!1||Dt(n)&&Wt(n)==fi}var jn=Eg||vu,Sv=rl?ce(rl):x0;function Iv(n){return Dt(n)&&n.nodeType===1&&!Mi(n)}function Av(n){if(n==null)return!0;if(Zt(n)&&(k(n)||typeof n=="string"||typeof n.splice=="function"||jn(n)||Vr(n)||dr(n)))return!n.length;var i=Vt(n);if(i==Re||i==Ne)return!n.size;if(Ti(n))return!Ua(n).length;for(var o in n)if(ht.call(n,o))return!1;return!0}function Bv(n,i){return Fi(n,i)}function Ov(n,i,o){o=typeof o=="function"?o:e;var u=o?o(n,i):e;return u===e?Fi(n,i,e,o):!!u}function cu(n){if(!Dt(n))return!1;var i=Wt(n);return i==ss||i==Jp||typeof n.message=="string"&&typeof n.name=="string"&&!Mi(n)}function Fv(n){return typeof n=="number"&&Il(n)}function vn(n){if(!Bt(n))return!1;var i=Wt(n);return i==os||i==Tc||i==Kp||i==Zp}function jf(n){return typeof n=="number"&&n==K(n)}function Gs(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=En}function Bt(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}function Dt(n){return n!=null&&typeof n=="object"}var Hf=il?ce(il):L0;function Dv(n,i){return n===i||Ca(n,i,Qa(i))}function xv(n,i,o){return o=typeof o=="function"?o:e,Ca(n,i,Qa(i),o)}function Tv(n){return Yf(n)&&n!=+n}function Lv(n){if(p_(n))throw new U(c);return Cl(n)}function Mv(n){return n===null}function Rv(n){return n==null}function Yf(n){return typeof n=="number"||Dt(n)&&Wt(n)==di}function Mi(n){if(!Dt(n)||Wt(n)!=hn)return!1;var i=bs(n);if(i===null)return!0;var o=ht.call(i,"constructor")&&i.constructor;return typeof o=="function"&&o instanceof o&&gs.call(o)==xg}var lu=sl?ce(sl):M0;function Nv(n){return jf(n)&&n>=-En&&n<=En}var Gf=ol?ce(ol):R0;function Ks(n){return typeof n=="string"||!k(n)&&Dt(n)&&Wt(n)==yi}function fe(n){return typeof n=="symbol"||Dt(n)&&Wt(n)==as}var Vr=al?ce(al):N0;function Ev(n){return n===e}function Cv(n){return Dt(n)&&Vt(n)==gi}function Uv(n){return Dt(n)&&Wt(n)==Qp}var Pv=Ps(Pa),zv=Ps(function(n,i){return n<=i});function Kf(n){if(!n)return[];if(Zt(n))return Ks(n)?Ee(n):qt(n);if(vi&&n[vi])return _g(n[vi]());var i=Vt(n),o=i==Re?Ba:i==Ne?ds:Wr;return o(n)}function bn(n){if(!n)return n===0?n:0;if(n=Fe(n),n===ir||n===-ir){var i=n<0?-1:1;return i*jp}return n===n?n:0}function K(n){var i=bn(n),o=i%1;return i===i?o?i-o:i:0}function Jf(n){return n?cr(K(n),0,Ye):0}function Fe(n){if(typeof n=="number")return n;if(fe(n))return rs;if(Bt(n)){var i=typeof n.valueOf=="function"?n.valueOf():n;n=Bt(i)?i+"":i}if(typeof n!="string")return n===0?n:+n;n=dl(n);var o=by.test(n);return o||Sy.test(n)?tg(n.slice(2),o?2:8):vy.test(n)?rs:+n}function qf(n){return Ke(n,Xt(n))}function $v(n){return n?cr(K(n),-En,En):n===0?n:0}function ut(n){return n==null?"":le(n)}var Vv=Pr(function(n,i){if(Ti(i)||Zt(i)){Ke(i,Ct(i),n);return}for(var o in i)ht.call(i,o)&&Ai(n,o,i[o])}),Zf=Pr(function(n,i){Ke(i,Xt(i),n)}),Js=Pr(function(n,i,o,u){Ke(i,Xt(i),n,u)}),Wv=Pr(function(n,i,o,u){Ke(i,Ct(i),n,u)}),kv=_n(La);function jv(n,i){var o=Ur(n);return i==null?o:Dl(o,i)}var Hv=Q(function(n,i){n=gt(n);var o=-1,u=i.length,f=u>2?i[2]:e;for(f&&kt(i[0],i[1],f)&&(u=1);++o<u;)for(var p=i[o],y=Xt(p),_=-1,v=y.length;++_<v;){var A=y[_],B=n[A];(B===e||Ue(B,Nr[A])&&!ht.call(n,A))&&(n[A]=p[A])}return n}),Yv=Q(function(n){return n.push(e,pf),ue(Xf,e,n)});function Gv(n,i){return cl(n,R(i,3),Ge)}function Kv(n,i){return cl(n,R(i,3),Ra)}function Jv(n,i){return n==null?n:Ma(n,R(i,3),Xt)}function qv(n,i){return n==null?n:Rl(n,R(i,3),Xt)}function Zv(n,i){return n&&Ge(n,R(i,3))}function Xv(n,i){return n&&Ra(n,R(i,3))}function Qv(n){return n==null?[]:Ts(n,Ct(n))}function tb(n){return n==null?[]:Ts(n,Xt(n))}function fu(n,i,o){var u=n==null?e:lr(n,i);return u===e?o:u}function eb(n,i){return n!=null&&_f(n,i,A0)}function hu(n,i){return n!=null&&_f(n,i,B0)}var nb=cf(function(n,i,o){i!=null&&typeof i.toString!="function"&&(i=_s.call(i)),n[i]=o},pu(Qt)),rb=cf(function(n,i,o){i!=null&&typeof i.toString!="function"&&(i=_s.call(i)),ht.call(n,i)?n[i].push(o):n[i]=[o]},R),ib=Q(Oi);function Ct(n){return Zt(n)?Ol(n):Ua(n)}function Xt(n){return Zt(n)?Ol(n,!0):E0(n)}function sb(n,i){var o={};return i=R(i,3),Ge(n,function(u,f,p){yn(o,i(u,f,p),u)}),o}function ob(n,i){var o={};return i=R(i,3),Ge(n,function(u,f,p){yn(o,f,i(u,f,p))}),o}var ab=Pr(function(n,i,o){Ls(n,i,o)}),Xf=Pr(function(n,i,o,u){Ls(n,i,o,u)}),ub=_n(function(n,i){var o={};if(n==null)return o;var u=!1;i=It(i,function(p){return p=Wn(p,n),u||(u=p.length>1),p}),Ke(n,Za(n),o),u&&(o=Ae(o,D|M|X,n_));for(var f=i.length;f--;)ka(o,i[f]);return o});function cb(n,i){return Qf(n,Ys(R(i)))}var lb=_n(function(n,i){return n==null?{}:U0(n,i)});function Qf(n,i){if(n==null)return{};var o=It(Za(n),function(u){return[u]});return i=R(i),kl(n,o,function(u,f){return i(u,f[0])})}function fb(n,i,o){i=Wn(i,n);var u=-1,f=i.length;for(f||(f=1,n=e);++u<f;){var p=n==null?e:n[Je(i[u])];p===e&&(u=f,p=o),n=vn(p)?p.call(n):p}return n}function hb(n,i,o){return n==null?n:Di(n,i,o)}function db(n,i,o,u){return u=typeof u=="function"?u:e,n==null?n:Di(n,i,o,u)}var th=hf(Ct),eh=hf(Xt);function pb(n,i,o){var u=k(n),f=u||jn(n)||Vr(n);if(i=R(i,4),o==null){var p=n&&n.constructor;f?o=u?new p:[]:Bt(n)?o=vn(p)?Ur(bs(n)):{}:o={}}return(f?we:Ge)(n,function(y,_,v){return i(o,y,_,v)}),o}function yb(n,i){return n==null?!0:ka(n,i)}function gb(n,i,o){return n==null?n:Kl(n,i,Ya(o))}function _b(n,i,o,u){return u=typeof u=="function"?u:e,n==null?n:Kl(n,i,Ya(o),u)}function Wr(n){return n==null?[]:Aa(n,Ct(n))}function mb(n){return n==null?[]:Aa(n,Xt(n))}function vb(n,i,o){return o===e&&(o=i,i=e),o!==e&&(o=Fe(o),o=o===o?o:0),i!==e&&(i=Fe(i),i=i===i?i:0),cr(Fe(n),i,o)}function bb(n,i,o){return i=bn(i),o===e?(o=i,i=0):o=bn(o),n=Fe(n),O0(n,i,o)}function wb(n,i,o){if(o&&typeof o!="boolean"&&kt(n,i,o)&&(i=o=e),o===e&&(typeof i=="boolean"?(o=i,i=e):typeof n=="boolean"&&(o=n,n=e)),n===e&&i===e?(n=0,i=1):(n=bn(n),i===e?(i=n,n=0):i=bn(i)),n>i){var u=n;n=i,i=u}if(o||n%1||i%1){var f=Al();return $t(n+f*(i-n+Qy("1e-"+((f+"").length-1))),i)}return $a(n,i)}var Sb=zr(function(n,i,o){return i=i.toLowerCase(),n+(o?nh(i):i)});function nh(n){return du(ut(n).toLowerCase())}function rh(n){return n=ut(n),n&&n.replace(Ay,hg).replace(ky,"")}function Ib(n,i,o){n=ut(n),i=le(i);var u=n.length;o=o===e?u:cr(K(o),0,u);var f=o;return o-=i.length,o>=0&&n.slice(o,f)==i}function Ab(n){return n=ut(n),n&&iy.test(n)?n.replace(Rc,dg):n}function Bb(n){return n=ut(n),n&&ly.test(n)?n.replace(ua,"\\$&"):n}var Ob=zr(function(n,i,o){return n+(o?"-":"")+i.toLowerCase()}),Fb=zr(function(n,i,o){return n+(o?" ":"")+i.toLowerCase()}),Db=of("toLowerCase");function xb(n,i,o){n=ut(n),i=K(i);var u=i?Mr(n):0;if(!i||u>=i)return n;var f=(i-u)/2;return Us(As(f),o)+n+Us(Is(f),o)}function Tb(n,i,o){n=ut(n),i=K(i);var u=i?Mr(n):0;return i&&u<i?n+Us(i-u,o):n}function Lb(n,i,o){n=ut(n),i=K(i);var u=i?Mr(n):0;return i&&u<i?Us(i-u,o)+n:n}function Mb(n,i,o){return o||i==null?i=0:i&&(i=+i),zg(ut(n).replace(ca,""),i||0)}function Rb(n,i,o){return(o?kt(n,i,o):i===e)?i=1:i=K(i),Va(ut(n),i)}function Nb(){var n=arguments,i=ut(n[0]);return n.length<3?i:i.replace(n[1],n[2])}var Eb=zr(function(n,i,o){return n+(o?"_":"")+i.toLowerCase()});function Cb(n,i,o){return o&&typeof o!="number"&&kt(n,i,o)&&(i=o=e),o=o===e?Ye:o>>>0,o?(n=ut(n),n&&(typeof i=="string"||i!=null&&!lu(i))&&(i=le(i),!i&&Lr(n))?kn(Ee(n),0,o):n.split(i,o)):[]}var Ub=zr(function(n,i,o){return n+(o?" ":"")+du(i)});function Pb(n,i,o){return n=ut(n),o=o==null?0:cr(K(o),0,n.length),i=le(i),n.slice(o,o+i.length)==i}function zb(n,i,o){var u=h.templateSettings;o&&kt(n,i,o)&&(i=e),n=ut(n),i=Js({},i,u,df);var f=Js({},i.imports,u.imports,df),p=Ct(f),y=Aa(f,p),_,v,A=0,B=i.interpolate||us,F="__p += '",x=Oa((i.escape||us).source+"|"+B.source+"|"+(B===Nc?my:us).source+"|"+(i.evaluate||us).source+"|$","g"),L="//# sourceURL="+(ht.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ky+"]")+`
`;n.replace(x,function(E,tt,nt,he,jt,de){return nt||(nt=he),F+=n.slice(A,de).replace(By,pg),tt&&(_=!0,F+=`' +
__e(`+tt+`) +
'`),jt&&(v=!0,F+=`';
`+jt+`;
__p += '`),nt&&(F+=`' +
((__t = (`+nt+`)) == null ? '' : __t) +
'`),A=de+E.length,E}),F+=`';
`;var N=ht.call(i,"variable")&&i.variable;if(!N)F=`with (obj) {
`+F+`
}
`;else if(gy.test(N))throw new U(d);F=(v?F.replace(ty,""):F).replace(ey,"$1").replace(ny,"$1;"),F="function("+(N||"obj")+`) {
`+(N?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(v?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+F+`return __p
}`;var q=sh(function(){return st(p,L+"return "+F).apply(e,y)});if(q.source=F,cu(q))throw q;return q}function $b(n){return ut(n).toLowerCase()}function Vb(n){return ut(n).toUpperCase()}function Wb(n,i,o){if(n=ut(n),n&&(o||i===e))return dl(n);if(!n||!(i=le(i)))return n;var u=Ee(n),f=Ee(i),p=pl(u,f),y=yl(u,f)+1;return kn(u,p,y).join("")}function kb(n,i,o){if(n=ut(n),n&&(o||i===e))return n.slice(0,_l(n)+1);if(!n||!(i=le(i)))return n;var u=Ee(n),f=yl(u,Ee(i))+1;return kn(u,0,f).join("")}function jb(n,i,o){if(n=ut(n),n&&(o||i===e))return n.replace(ca,"");if(!n||!(i=le(i)))return n;var u=Ee(n),f=pl(u,Ee(i));return kn(u,f).join("")}function Hb(n,i){var o=Pp,u=zp;if(Bt(i)){var f="separator"in i?i.separator:f;o="length"in i?K(i.length):o,u="omission"in i?le(i.omission):u}n=ut(n);var p=n.length;if(Lr(n)){var y=Ee(n);p=y.length}if(o>=p)return n;var _=o-Mr(u);if(_<1)return u;var v=y?kn(y,0,_).join(""):n.slice(0,_);if(f===e)return v+u;if(y&&(_+=v.length-_),lu(f)){if(n.slice(_).search(f)){var A,B=v;for(f.global||(f=Oa(f.source,ut(Ec.exec(f))+"g")),f.lastIndex=0;A=f.exec(B);)var F=A.index;v=v.slice(0,F===e?_:F)}}else if(n.indexOf(le(f),_)!=_){var x=v.lastIndexOf(f);x>-1&&(v=v.slice(0,x))}return v+u}function Yb(n){return n=ut(n),n&&ry.test(n)?n.replace(Mc,wg):n}var Gb=zr(function(n,i,o){return n+(o?" ":"")+i.toUpperCase()}),du=of("toUpperCase");function ih(n,i,o){return n=ut(n),i=o?e:i,i===e?gg(n)?Ag(n):ag(n):n.match(i)||[]}var sh=Q(function(n,i){try{return ue(n,e,i)}catch(o){return cu(o)?o:new U(o)}}),Kb=_n(function(n,i){return we(i,function(o){o=Je(o),yn(n,o,au(n[o],n))}),n});function Jb(n){var i=n==null?0:n.length,o=R();return n=i?It(n,function(u){if(typeof u[1]!="function")throw new Se(l);return[o(u[0]),u[1]]}):[],Q(function(u){for(var f=-1;++f<i;){var p=n[f];if(ue(p[0],this,u))return ue(p[1],this,u)}})}function qb(n){return w0(Ae(n,D))}function pu(n){return function(){return n}}function Zb(n,i){return n==null||n!==n?i:n}var Xb=uf(),Qb=uf(!0);function Qt(n){return n}function yu(n){return Ul(typeof n=="function"?n:Ae(n,D))}function tw(n){return zl(Ae(n,D))}function ew(n,i){return $l(n,Ae(i,D))}var nw=Q(function(n,i){return function(o){return Oi(o,n,i)}}),rw=Q(function(n,i){return function(o){return Oi(n,o,i)}});function gu(n,i,o){var u=Ct(i),f=Ts(i,u);o==null&&!(Bt(i)&&(f.length||!u.length))&&(o=i,i=n,n=this,f=Ts(i,Ct(i)));var p=!(Bt(o)&&"chain"in o)||!!o.chain,y=vn(n);return we(f,function(_){var v=i[_];n[_]=v,y&&(n.prototype[_]=function(){var A=this.__chain__;if(p||A){var B=n(this.__wrapped__),F=B.__actions__=qt(this.__actions__);return F.push({func:v,args:arguments,thisArg:n}),B.__chain__=A,B}return v.apply(n,Un([this.value()],arguments))})}),n}function iw(){return Pt._===this&&(Pt._=Tg),this}function _u(){}function sw(n){return n=K(n),Q(function(i){return Vl(i,n)})}var ow=Ka(It),aw=Ka(ul),uw=Ka(va);function oh(n){return eu(n)?ba(Je(n)):P0(n)}function cw(n){return function(i){return n==null?e:lr(n,i)}}var lw=lf(),fw=lf(!0);function mu(){return[]}function vu(){return!1}function hw(){return{}}function dw(){return""}function pw(){return!0}function yw(n,i){if(n=K(n),n<1||n>En)return[];var o=Ye,u=$t(n,Ye);i=R(i),n-=Ye;for(var f=Ia(u,i);++o<n;)i(o);return f}function gw(n){return k(n)?It(n,Je):fe(n)?[n]:qt(Of(ut(n)))}function _w(n){var i=++Dg;return ut(n)+i}var mw=Cs(function(n,i){return n+i},0),vw=Ja("ceil"),bw=Cs(function(n,i){return n/i},1),ww=Ja("floor");function Sw(n){return n&&n.length?xs(n,Qt,Na):e}function Iw(n,i){return n&&n.length?xs(n,R(i,2),Na):e}function Aw(n){return fl(n,Qt)}function Bw(n,i){return fl(n,R(i,2))}function Ow(n){return n&&n.length?xs(n,Qt,Pa):e}function Fw(n,i){return n&&n.length?xs(n,R(i,2),Pa):e}var Dw=Cs(function(n,i){return n*i},1),xw=Ja("round"),Tw=Cs(function(n,i){return n-i},0);function Lw(n){return n&&n.length?Sa(n,Qt):0}function Mw(n,i){return n&&n.length?Sa(n,R(i,2)):0}return h.after=tv,h.ary=Uf,h.assign=Vv,h.assignIn=Zf,h.assignInWith=Js,h.assignWith=Wv,h.at=kv,h.before=Pf,h.bind=au,h.bindAll=Kb,h.bindKey=zf,h.castArray=hv,h.chain=Nf,h.chunk=w_,h.compact=S_,h.concat=I_,h.cond=Jb,h.conforms=qb,h.constant=pu,h.countBy=Lm,h.create=jv,h.curry=$f,h.curryRight=Vf,h.debounce=Wf,h.defaults=Hv,h.defaultsDeep=Yv,h.defer=ev,h.delay=nv,h.difference=A_,h.differenceBy=B_,h.differenceWith=O_,h.drop=F_,h.dropRight=D_,h.dropRightWhile=x_,h.dropWhile=T_,h.fill=L_,h.filter=Rm,h.flatMap=Cm,h.flatMapDeep=Um,h.flatMapDepth=Pm,h.flatten=Tf,h.flattenDeep=M_,h.flattenDepth=R_,h.flip=rv,h.flow=Xb,h.flowRight=Qb,h.fromPairs=N_,h.functions=Qv,h.functionsIn=tb,h.groupBy=zm,h.initial=C_,h.intersection=U_,h.intersectionBy=P_,h.intersectionWith=z_,h.invert=nb,h.invertBy=rb,h.invokeMap=Vm,h.iteratee=yu,h.keyBy=Wm,h.keys=Ct,h.keysIn=Xt,h.map=ks,h.mapKeys=sb,h.mapValues=ob,h.matches=tw,h.matchesProperty=ew,h.memoize=Hs,h.merge=ab,h.mergeWith=Xf,h.method=nw,h.methodOf=rw,h.mixin=gu,h.negate=Ys,h.nthArg=sw,h.omit=ub,h.omitBy=cb,h.once=iv,h.orderBy=km,h.over=ow,h.overArgs=sv,h.overEvery=aw,h.overSome=uw,h.partial=uu,h.partialRight=kf,h.partition=jm,h.pick=lb,h.pickBy=Qf,h.property=oh,h.propertyOf=cw,h.pull=k_,h.pullAll=Mf,h.pullAllBy=j_,h.pullAllWith=H_,h.pullAt=Y_,h.range=lw,h.rangeRight=fw,h.rearg=ov,h.reject=Gm,h.remove=G_,h.rest=av,h.reverse=su,h.sampleSize=Jm,h.set=hb,h.setWith=db,h.shuffle=qm,h.slice=K_,h.sortBy=Qm,h.sortedUniq=em,h.sortedUniqBy=nm,h.split=Cb,h.spread=uv,h.tail=rm,h.take=im,h.takeRight=sm,h.takeRightWhile=om,h.takeWhile=am,h.tap=Sm,h.throttle=cv,h.thru=Ws,h.toArray=Kf,h.toPairs=th,h.toPairsIn=eh,h.toPath=gw,h.toPlainObject=qf,h.transform=pb,h.unary=lv,h.union=um,h.unionBy=cm,h.unionWith=lm,h.uniq=fm,h.uniqBy=hm,h.uniqWith=dm,h.unset=yb,h.unzip=ou,h.unzipWith=Rf,h.update=gb,h.updateWith=_b,h.values=Wr,h.valuesIn=mb,h.without=pm,h.words=ih,h.wrap=fv,h.xor=ym,h.xorBy=gm,h.xorWith=_m,h.zip=mm,h.zipObject=vm,h.zipObjectDeep=bm,h.zipWith=wm,h.entries=th,h.entriesIn=eh,h.extend=Zf,h.extendWith=Js,gu(h,h),h.add=mw,h.attempt=sh,h.camelCase=Sb,h.capitalize=nh,h.ceil=vw,h.clamp=vb,h.clone=dv,h.cloneDeep=yv,h.cloneDeepWith=gv,h.cloneWith=pv,h.conformsTo=_v,h.deburr=rh,h.defaultTo=Zb,h.divide=bw,h.endsWith=Ib,h.eq=Ue,h.escape=Ab,h.escapeRegExp=Bb,h.every=Mm,h.find=Nm,h.findIndex=Df,h.findKey=Gv,h.findLast=Em,h.findLastIndex=xf,h.findLastKey=Kv,h.floor=ww,h.forEach=Ef,h.forEachRight=Cf,h.forIn=Jv,h.forInRight=qv,h.forOwn=Zv,h.forOwnRight=Xv,h.get=fu,h.gt=mv,h.gte=vv,h.has=eb,h.hasIn=hu,h.head=Lf,h.identity=Qt,h.includes=$m,h.indexOf=E_,h.inRange=bb,h.invoke=ib,h.isArguments=dr,h.isArray=k,h.isArrayBuffer=bv,h.isArrayLike=Zt,h.isArrayLikeObject=xt,h.isBoolean=wv,h.isBuffer=jn,h.isDate=Sv,h.isElement=Iv,h.isEmpty=Av,h.isEqual=Bv,h.isEqualWith=Ov,h.isError=cu,h.isFinite=Fv,h.isFunction=vn,h.isInteger=jf,h.isLength=Gs,h.isMap=Hf,h.isMatch=Dv,h.isMatchWith=xv,h.isNaN=Tv,h.isNative=Lv,h.isNil=Rv,h.isNull=Mv,h.isNumber=Yf,h.isObject=Bt,h.isObjectLike=Dt,h.isPlainObject=Mi,h.isRegExp=lu,h.isSafeInteger=Nv,h.isSet=Gf,h.isString=Ks,h.isSymbol=fe,h.isTypedArray=Vr,h.isUndefined=Ev,h.isWeakMap=Cv,h.isWeakSet=Uv,h.join=$_,h.kebabCase=Ob,h.last=Oe,h.lastIndexOf=V_,h.lowerCase=Fb,h.lowerFirst=Db,h.lt=Pv,h.lte=zv,h.max=Sw,h.maxBy=Iw,h.mean=Aw,h.meanBy=Bw,h.min=Ow,h.minBy=Fw,h.stubArray=mu,h.stubFalse=vu,h.stubObject=hw,h.stubString=dw,h.stubTrue=pw,h.multiply=Dw,h.nth=W_,h.noConflict=iw,h.noop=_u,h.now=js,h.pad=xb,h.padEnd=Tb,h.padStart=Lb,h.parseInt=Mb,h.random=wb,h.reduce=Hm,h.reduceRight=Ym,h.repeat=Rb,h.replace=Nb,h.result=fb,h.round=xw,h.runInContext=m,h.sample=Km,h.size=Zm,h.snakeCase=Eb,h.some=Xm,h.sortedIndex=J_,h.sortedIndexBy=q_,h.sortedIndexOf=Z_,h.sortedLastIndex=X_,h.sortedLastIndexBy=Q_,h.sortedLastIndexOf=tm,h.startCase=Ub,h.startsWith=Pb,h.subtract=Tw,h.sum=Lw,h.sumBy=Mw,h.template=zb,h.times=yw,h.toFinite=bn,h.toInteger=K,h.toLength=Jf,h.toLower=$b,h.toNumber=Fe,h.toSafeInteger=$v,h.toString=ut,h.toUpper=Vb,h.trim=Wb,h.trimEnd=kb,h.trimStart=jb,h.truncate=Hb,h.unescape=Yb,h.uniqueId=_w,h.upperCase=Gb,h.upperFirst=du,h.each=Ef,h.eachRight=Cf,h.first=Lf,gu(h,function(){var n={};return Ge(h,function(i,o){ht.call(h.prototype,o)||(n[o]=i)}),n}(),{chain:!1}),h.VERSION=s,we(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){h[n].placeholder=h}),we(["drop","take"],function(n,i){et.prototype[n]=function(o){o=o===e?1:Rt(K(o),0);var u=this.__filtered__&&!i?new et(this):this.clone();return u.__filtered__?u.__takeCount__=$t(o,u.__takeCount__):u.__views__.push({size:$t(o,Ye),type:n+(u.__dir__<0?"Right":"")}),u},et.prototype[n+"Right"]=function(o){return this.reverse()[n](o).reverse()}}),we(["filter","map","takeWhile"],function(n,i){var o=i+1,u=o==xc||o==kp;et.prototype[n]=function(f){var p=this.clone();return p.__iteratees__.push({iteratee:R(f,3),type:o}),p.__filtered__=p.__filtered__||u,p}}),we(["head","last"],function(n,i){var o="take"+(i?"Right":"");et.prototype[n]=function(){return this[o](1).value()[0]}}),we(["initial","tail"],function(n,i){var o="drop"+(i?"":"Right");et.prototype[n]=function(){return this.__filtered__?new et(this):this[o](1)}}),et.prototype.compact=function(){return this.filter(Qt)},et.prototype.find=function(n){return this.filter(n).head()},et.prototype.findLast=function(n){return this.reverse().find(n)},et.prototype.invokeMap=Q(function(n,i){return typeof n=="function"?new et(this):this.map(function(o){return Oi(o,n,i)})}),et.prototype.reject=function(n){return this.filter(Ys(R(n)))},et.prototype.slice=function(n,i){n=K(n);var o=this;return o.__filtered__&&(n>0||i<0)?new et(o):(n<0?o=o.takeRight(-n):n&&(o=o.drop(n)),i!==e&&(i=K(i),o=i<0?o.dropRight(-i):o.take(i-n)),o)},et.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},et.prototype.toArray=function(){return this.take(Ye)},Ge(et.prototype,function(n,i){var o=/^(?:filter|find|map|reject)|While$/.test(i),u=/^(?:head|last)$/.test(i),f=h[u?"take"+(i=="last"?"Right":""):i],p=u||/^find/.test(i);f&&(h.prototype[i]=function(){var y=this.__wrapped__,_=u?[1]:arguments,v=y instanceof et,A=_[0],B=v||k(y),F=function(tt){var nt=f.apply(h,Un([tt],_));return u&&x?nt[0]:nt};B&&o&&typeof A=="function"&&A.length!=1&&(v=B=!1);var x=this.__chain__,L=!!this.__actions__.length,N=p&&!x,q=v&&!L;if(!p&&B){y=q?y:new et(this);var E=n.apply(y,_);return E.__actions__.push({func:Ws,args:[F],thisArg:e}),new Ie(E,x)}return N&&q?n.apply(this,_):(E=this.thru(F),N?u?E.value()[0]:E.value():E)})}),we(["pop","push","shift","sort","splice","unshift"],function(n){var i=ps[n],o=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",u=/^(?:pop|shift)$/.test(n);h.prototype[n]=function(){var f=arguments;if(u&&!this.__chain__){var p=this.value();return i.apply(k(p)?p:[],f)}return this[o](function(y){return i.apply(k(y)?y:[],f)})}}),Ge(et.prototype,function(n,i){var o=h[i];if(o){var u=o.name+"";ht.call(Cr,u)||(Cr[u]=[]),Cr[u].push({name:i,func:o})}}),Cr[Es(e,Jt).name]=[{name:"wrapper",func:e}],et.prototype.clone=Yg,et.prototype.reverse=Gg,et.prototype.value=Kg,h.prototype.at=Im,h.prototype.chain=Am,h.prototype.commit=Bm,h.prototype.next=Om,h.prototype.plant=Dm,h.prototype.reverse=xm,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=Tm,h.prototype.first=h.prototype.head,vi&&(h.prototype[vi]=Fm),h},Rr=Bg();sr?((sr.exports=Rr)._=Rr,ya._=Rr):Pt._=Rr}).call(Ri)})(Uo,Uo.exports);var qI=Uo.exports;const ZI=Rh(qI);var Mh=!0,Du={},ze;function XI(){return{homes:[{walls:ze.getHomes()[0].walls.flat(1).map(r=>[r.xStart,r.yStart,r.xEnd,r.yEnd,r.thickness,r.height]),rooms:ze.getHomes()[0].rooms.map(r=>r.getPoints()),furnitures:ze.getHomes()[0].furniture.map(r=>({id:r.catalogId,x:r.x,y:r.y,elevation:r.getElevation()}))}]}}function QI(r){const t=r.detail;var e=window.location.href.substring(0,window.location.href.lastIndexOf("/")+1);ze||(ze=new SweetHome3DJSApplication({furnitureCatalogURLs:[e+"lib/resources/DefaultFurnitureCatalog.json"],furnitureResourcesURLBase:e,texturesCatalogURLs:[e+"lib/resources/DefaultTexturesCatalog.json"],texturesResourcesURLBase:e,writeHomeWithWorker:!1,compressionLevel:5,autoRecovery:!1,defaultHomeName:"home-d78b0c75-7b64-4a70-a722-37c8dd6a2b81"}),ze.addHome(ze.createHome())),Mh&&(Mh=!1,t.args.state.homes[0].walls.forEach(s=>{ze.getHomes()[0].addWall(new Wall(s[0],s[1],s[2],s[3],s[4],s[5]))}),t.args.state.homes[0].rooms.forEach(s=>{var a=new Room(s);a.setCeilingVisible(!1),ze.getHomes()[0].addRoom(a)}),t.args.state.homes[0].furnitures.forEach(s=>{var a=new HomePieceOfFurniture(ze.preferences.furnitureCatalog.getPieceOfFurnitureWithId(s.id));a.setX(s.x),a.setY(s.y),a.setElevation(s.elevation),ze.getHomes()[0].addPieceOfFurniture(a)})),t.args.out_state&&setInterval(function(){var s=XI();ZI.isEqual(s,Du)||(console.log("change"),Du=s,tr.setComponentValue(Du))},1e3),tr.setFrameHeight()}tr.events.addEventListener(tr.RENDER_EVENT,QI);tr.setComponentReady();tr.setFrameHeight();
