/* empty css                               */import{d as ft,r as It,e as Pn,p as Er,f as io,q as gl,o as m,c as g,s as b,t as U,u as dt,v as j,x as _l,y as wl,b as xt,k as we,z as cn,h as Mn,i as Is,A as L,B as Sl,C as or,w as Rr,D as Il,E as Bl,F as ut,l as St,T as Ol,G as Fl,H as Al,I as un,J as Ln,K as ei,m as Se,n as ro,L as Dl,M as Tl,a as Bs,N as Nl}from"./runtime-dom.esm-bundler.gORlFm-p.js";function xl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var so={exports:{}},W={};/** @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 ht=typeof Symbol=="function"&&Symbol.for,Cr=ht?Symbol.for("react.element"):60103,kr=ht?Symbol.for("react.portal"):60106,zi=ht?Symbol.for("react.fragment"):60107,Wi=ht?Symbol.for("react.strict_mode"):60108,Yi=ht?Symbol.for("react.profiler"):60114,Gi=ht?Symbol.for("react.provider"):60109,Hi=ht?Symbol.for("react.context"):60110,Ur=ht?Symbol.for("react.async_mode"):60111,qi=ht?Symbol.for("react.concurrent_mode"):60111,Ji=ht?Symbol.for("react.forward_ref"):60112,Ki=ht?Symbol.for("react.suspense"):60113,Ml=ht?Symbol.for("react.suspense_list"):60120,Zi=ht?Symbol.for("react.memo"):60115,Xi=ht?Symbol.for("react.lazy"):60116,Ll=ht?Symbol.for("react.block"):60121,El=ht?Symbol.for("react.fundamental"):60117,Rl=ht?Symbol.for("react.responder"):60118,Cl=ht?Symbol.for("react.scope"):60119;function Et(n){if(typeof n=="object"&&n!==null){var t=n.$$typeof;switch(t){case Cr:switch(n=n.type,n){case Ur:case qi:case zi:case Yi:case Wi:case Ki:return n;default:switch(n=n&&n.$$typeof,n){case Hi:case Ji:case Xi:case Zi:case Gi:return n;default:return t}}case kr:return t}}}function oo(n){return Et(n)===qi}W.AsyncMode=Ur;W.ConcurrentMode=qi;W.ContextConsumer=Hi;W.ContextProvider=Gi;W.Element=Cr;W.ForwardRef=Ji;W.Fragment=zi;W.Lazy=Xi;W.Memo=Zi;W.Portal=kr;W.Profiler=Yi;W.StrictMode=Wi;W.Suspense=Ki;W.isAsyncMode=function(n){return oo(n)||Et(n)===Ur};W.isConcurrentMode=oo;W.isContextConsumer=function(n){return Et(n)===Hi};W.isContextProvider=function(n){return Et(n)===Gi};W.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===Cr};W.isForwardRef=function(n){return Et(n)===Ji};W.isFragment=function(n){return Et(n)===zi};W.isLazy=function(n){return Et(n)===Xi};W.isMemo=function(n){return Et(n)===Zi};W.isPortal=function(n){return Et(n)===kr};W.isProfiler=function(n){return Et(n)===Yi};W.isStrictMode=function(n){return Et(n)===Wi};W.isSuspense=function(n){return Et(n)===Ki};W.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===zi||n===qi||n===Yi||n===Wi||n===Ki||n===Ml||typeof n=="object"&&n!==null&&(n.$$typeof===Xi||n.$$typeof===Zi||n.$$typeof===Gi||n.$$typeof===Hi||n.$$typeof===Ji||n.$$typeof===El||n.$$typeof===Rl||n.$$typeof===Cl||n.$$typeof===Ll)};W.typeOf=Et;so.exports=W;var kl=so.exports,ao=kl,Ul={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Vl={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},lo={};lo[ao.ForwardRef]=Ul;lo[ao.Memo]=Vl;var co={exports:{}},Y={};/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var Os=Object.getOwnPropertySymbols,$l=Object.prototype.hasOwnProperty,Pl=Object.prototype.propertyIsEnumerable;function jl(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function zl(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var i=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(i.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(s){r[s]=s}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Wl=zl()?Object.assign:function(n,t){for(var e,i=jl(n),r,s=1;s<arguments.length;s++){e=Object(arguments[s]);for(var o in e)$l.call(e,o)&&(i[o]=e[o]);if(Os){r=Os(e);for(var a=0;a<r.length;a++)Pl.call(e,r[a])&&(i[r[a]]=e[r[a]])}}return i};/** @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 Vr=Wl,jt=typeof Symbol=="function"&&Symbol.for,jn=jt?Symbol.for("react.element"):60103,Yl=jt?Symbol.for("react.portal"):60106,Gl=jt?Symbol.for("react.fragment"):60107,Hl=jt?Symbol.for("react.strict_mode"):60108,ql=jt?Symbol.for("react.profiler"):60114,Jl=jt?Symbol.for("react.provider"):60109,Kl=jt?Symbol.for("react.context"):60110,Zl=jt?Symbol.for("react.forward_ref"):60112,Xl=jt?Symbol.for("react.suspense"):60113,Ql=jt?Symbol.for("react.memo"):60115,tc=jt?Symbol.for("react.lazy"):60116,Fs=typeof Symbol=="function"&&Symbol.iterator;function zn(n){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+n,e=1;e<arguments.length;e++)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified React error #"+n+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var uo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ho={};function bn(n,t,e){this.props=n,this.context=t,this.refs=ho,this.updater=e||uo}bn.prototype.isReactComponent={};bn.prototype.setState=function(n,t){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error(zn(85));this.updater.enqueueSetState(this,n,t,"setState")};bn.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function fo(){}fo.prototype=bn.prototype;function $r(n,t,e){this.props=n,this.context=t,this.refs=ho,this.updater=e||uo}var Pr=$r.prototype=new fo;Pr.constructor=$r;Vr(Pr,bn.prototype);Pr.isPureReactComponent=!0;var jr={current:null},po=Object.prototype.hasOwnProperty,yo={key:!0,ref:!0,__self:!0,__source:!0};function mo(n,t,e){var i,r={},s=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)po.call(t,i)&&!yo.hasOwnProperty(i)&&(r[i]=t[i]);var a=arguments.length-2;if(a===1)r.children=e;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(n&&n.defaultProps)for(i in a=n.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:jn,type:n,key:s,ref:o,props:r,_owner:jr.current}}function ec(n,t){return{$$typeof:jn,type:n.type,key:t,ref:n.ref,props:n.props,_owner:n._owner}}function zr(n){return typeof n=="object"&&n!==null&&n.$$typeof===jn}function nc(n){var t={"=":"=0",":":"=2"};return"$"+(""+n).replace(/[=:]/g,function(e){return t[e]})}var vo=/\/+/g,ci=[];function bo(n,t,e,i){if(ci.length){var r=ci.pop();return r.result=n,r.keyPrefix=t,r.func=e,r.context=i,r.count=0,r}return{result:n,keyPrefix:t,func:e,context:i,count:0}}function go(n){n.result=null,n.keyPrefix=null,n.func=null,n.context=null,n.count=0,10>ci.length&&ci.push(n)}function mr(n,t,e,i){var r=typeof n;(r==="undefined"||r==="boolean")&&(n=null);var s=!1;if(n===null)s=!0;else switch(r){case"string":case"number":s=!0;break;case"object":switch(n.$$typeof){case jn:case Yl:s=!0}}if(s)return e(i,n,t===""?"."+ar(n,0):t),1;if(s=0,t=t===""?".":t+":",Array.isArray(n))for(var o=0;o<n.length;o++){r=n[o];var a=t+ar(r,o);s+=mr(r,a,e,i)}else if(n===null||typeof n!="object"?a=null:(a=Fs&&n[Fs]||n["@@iterator"],a=typeof a=="function"?a:null),typeof a=="function")for(n=a.call(n),o=0;!(r=n.next()).done;)r=r.value,a=t+ar(r,o++),s+=mr(r,a,e,i);else if(r==="object")throw e=""+n,Error(zn(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e,""));return s}function vr(n,t,e){return n==null?0:mr(n,"",t,e)}function ar(n,t){return typeof n=="object"&&n!==null&&n.key!=null?nc(n.key):t.toString(36)}function ic(n,t){n.func.call(n.context,t,n.count++)}function rc(n,t,e){var i=n.result,r=n.keyPrefix;n=n.func.call(n.context,t,n.count++),Array.isArray(n)?br(n,i,e,function(s){return s}):n!=null&&(zr(n)&&(n=ec(n,r+(!n.key||t&&t.key===n.key?"":(""+n.key).replace(vo,"$&/")+"/")+e)),i.push(n))}function br(n,t,e,i,r){var s="";e!=null&&(s=(""+e).replace(vo,"$&/")+"/"),t=bo(t,s,i,r),vr(n,rc,t),go(t)}var _o={current:null};function ye(){var n=_o.current;if(n===null)throw Error(zn(321));return n}var sc={ReactCurrentDispatcher:_o,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:jr,IsSomeRendererActing:{current:!1},assign:Vr};Y.Children={map:function(n,t,e){if(n==null)return n;var i=[];return br(n,i,null,t,e),i},forEach:function(n,t,e){if(n==null)return n;t=bo(null,null,t,e),vr(n,ic,t),go(t)},count:function(n){return vr(n,function(){return null},null)},toArray:function(n){var t=[];return br(n,t,null,function(e){return e}),t},only:function(n){if(!zr(n))throw Error(zn(143));return n}};Y.Component=bn;Y.Fragment=Gl;Y.Profiler=ql;Y.PureComponent=$r;Y.StrictMode=Hl;Y.Suspense=Xl;Y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sc;Y.cloneElement=function(n,t,e){if(n==null)throw Error(zn(267,n));var i=Vr({},n.props),r=n.key,s=n.ref,o=n._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=jr.current),t.key!==void 0&&(r=""+t.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(l in t)po.call(t,l)&&!yo.hasOwnProperty(l)&&(i[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)i.children=e;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];i.children=a}return{$$typeof:jn,type:n.type,key:r,ref:s,props:i,_owner:o}};Y.createContext=function(n,t){return t===void 0&&(t=null),n={$$typeof:Kl,_calculateChangedBits:t,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider={$$typeof:Jl,_context:n},n.Consumer=n};Y.createElement=mo;Y.createFactory=function(n){var t=mo.bind(null,n);return t.type=n,t};Y.createRef=function(){return{current:null}};Y.forwardRef=function(n){return{$$typeof:Zl,render:n}};Y.isValidElement=zr;Y.lazy=function(n){return{$$typeof:tc,_ctor:n,_status:-1,_result:null}};Y.memo=function(n,t){return{$$typeof:Ql,type:n,compare:t===void 0?null:t}};Y.useCallback=function(n,t){return ye().useCallback(n,t)};Y.useContext=function(n,t){return ye().useContext(n,t)};Y.useDebugValue=function(){};Y.useEffect=function(n,t){return ye().useEffect(n,t)};Y.useImperativeHandle=function(n,t,e){return ye().useImperativeHandle(n,t,e)};Y.useLayoutEffect=function(n,t){return ye().useLayoutEffect(n,t)};Y.useMemo=function(n,t){return ye().useMemo(n,t)};Y.useReducer=function(n,t,e){return ye().useReducer(n,t,e)};Y.useRef=function(n){return ye().useRef(n)};Y.useState=function(n){return ye().useState(n)};Y.version="16.14.0";co.exports=Y;var oc=co.exports;const ac=xl(oc);function w(n,t,e,i){function r(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(h){o(h)}}function l(d){try{c(i.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):r(d.value).then(a,l)}c((i=i.apply(n,t||[])).next())})}function As(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],i=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(n){return this instanceof x?(this.v=n,this):new x(n)}function te(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(n,t||[]),r,s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(y){i[y]&&(r[y]=function(_){return new Promise(function(G,et){s.push([y,_,G,et])>1||a(y,_)})})}function a(y,_){try{l(i[y](_))}catch(G){h(s[0][3],G)}}function l(y){y.value instanceof x?Promise.resolve(y.value.v).then(c,d):h(s[0][2],y)}function c(y){a("next",y)}function d(y){a("throw",y)}function h(y,_){y(_),s.shift(),s.length&&a(s[0][0],s[0][1])}}function ni(n){var t,e;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,s){t[r]=n[r]?function(o){return(e=!e)?{value:x(n[r](o)),done:!1}:s?s(o):o}:s}}function Pe(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof As=="function"?As(n):n[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=n[s]&&function(o){return new Promise(function(a,l){o=n[s](o),r(a,l,o.done,o.value)})}}function r(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}}const lc=new TextDecoder("utf-8"),gr=n=>lc.decode(n),cc=new TextEncoder,Wr=n=>cc.encode(n),[hp,uc]=(()=>{const n=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw n()}return t.asIntN=()=>{throw n()},t.asUintN=()=>{throw n()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[Wn,fp]=(()=>{const n=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw n()}static from(){throw n()}constructor(){throw n()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[Yn,pp]=(()=>{const n=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw n()}static from(){throw n()}constructor(){throw n()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),dc=n=>typeof n=="number",wo=n=>typeof n=="boolean",lt=n=>typeof n=="function",Ot=n=>n!=null&&Object(n)===n,Ie=n=>Ot(n)&&lt(n.then),Gn=n=>Ot(n)&&lt(n[Symbol.iterator]),gn=n=>Ot(n)&&lt(n[Symbol.asyncIterator]),_r=n=>Ot(n)&&Ot(n.schema),So=n=>Ot(n)&&"done"in n&&"value"in n,Io=n=>Ot(n)&&lt(n.stat)&&dc(n.fd),Bo=n=>Ot(n)&&Yr(n.body),Qi=n=>"_getDOMStream"in n&&"_getNodeStream"in n,hc=n=>Ot(n)&&lt(n.abort)&&lt(n.getWriter)&&!Qi(n),Yr=n=>Ot(n)&&lt(n.cancel)&&lt(n.getReader)&&!Qi(n),fc=n=>Ot(n)&&lt(n.end)&&lt(n.write)&&wo(n.writable)&&!Qi(n),Oo=n=>Ot(n)&&lt(n.read)&&lt(n.pipe)&&wo(n.readable)&&!Qi(n),pc=n=>Ot(n)&&lt(n.clear)&&lt(n.bytes)&&lt(n.position)&&lt(n.setPosition)&&lt(n.capacity)&&lt(n.getBufferIdentifier)&&lt(n.createLong),Gr=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function yc(n){const t=n[0]?[n[0]]:[];let e,i,r,s;for(let o,a,l=0,c=0,d=n.length;++l<d;){if(o=t[c],a=n[l],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++c]=a);continue}if({byteOffset:e,byteLength:r}=o,{byteOffset:i,byteLength:s}=a,e+r<i||i+s<e){a&&(t[++c]=a);continue}t[c]=new Uint8Array(o.buffer,e,i-e+s)}return t}function Ds(n,t,e=0,i=t.byteLength){const r=n.byteLength,s=new Uint8Array(n.buffer,n.byteOffset,r),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(i,r));return s.set(o,e),n}function ne(n,t){const e=yc(n),i=e.reduce((d,h)=>d+h.byteLength,0);let r,s,o,a=0,l=-1;const c=Math.min(t||Number.POSITIVE_INFINITY,i);for(const d=e.length;++l<d;){if(r=e[l],s=r.subarray(0,Math.min(r.length,c-a)),c<=a+s.length){s.length<r.length?e[l]=r.subarray(s.length):s.length===r.length&&l++,o?Ds(o,s,a):o=s;break}Ds(o||(o=new Uint8Array(c)),s,a),a+=s.length}return[o||new Uint8Array(0),e.slice(l),i-(o?o.byteLength:0)]}function q(n,t){let e=So(t)?t.value:t;return e instanceof n?n===Uint8Array?new n(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Wr(e)),e instanceof ArrayBuffer?new n(e):e instanceof Gr?new n(e):pc(e)?q(n,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new n(0):new n(e.buffer,e.byteOffset,e.byteLength/n.BYTES_PER_ELEMENT):n.from(e)):new n(0)}const Bn=n=>q(Int32Array,n),C=n=>q(Uint8Array,n),wr=n=>(n.next(),n);function*mc(n,t){const e=function*(r){yield r},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Gr?e(t):Gn(t)?t:e(t);return yield*wr(function*(r){let s=null;do s=r.next(yield q(n,s));while(!s.done)}(i[Symbol.iterator]())),new n}const vc=n=>mc(Uint8Array,n);function Fo(n,t){return te(this,arguments,function*(){if(Ie(t))return yield x(yield x(yield*ni(Pe(Fo(n,yield x(t))))));const i=function(o){return te(this,arguments,function*(){yield yield x(yield x(o))})},r=function(o){return te(this,arguments,function*(){yield x(yield*ni(Pe(wr(function*(a){let l=null;do l=a.next(yield l?.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Gr?i(t):Gn(t)?r(t):gn(t)?t:i(t);return yield x(yield*ni(Pe(wr(function(o){return te(this,arguments,function*(){let a=null;do a=yield x(o.next(yield yield x(q(n,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield x(new n)})}const bc=n=>Fo(Uint8Array,n);function Hr(n,t,e){if(n!==0){e=e.slice(0,t+1);for(let i=-1;++i<=t;)e[i]+=n}return e}function gc(n,t){let e=0;const i=n.length;if(i!==t.length)return!1;if(i>0)do if(n[e]!==t[e])return!1;while(++e<i);return!0}const Ct={fromIterable(n){return Zn(_c(n))},fromAsyncIterable(n){return Zn(wc(n))},fromDOMStream(n){return Zn(Sc(n))},fromNodeStream(n){return Zn(Bc(n))},toDOMStream(n,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(n,t){throw new Error('"toNodeStream" not available in this environment')}},Zn=n=>(n.next(),n);function*_c(n){let t,e=!1,i=[],r,s,o,a=0;function l(){return s==="peek"?ne(i,o)[0]:([r,i,a]=ne(i,o),r)}({cmd:s,size:o}=yield null);const c=vc(n)[Symbol.iterator]();try{do if({done:t,value:r}=Number.isNaN(o-a)?c.next():c.next(o-a),!t&&r.byteLength>0&&(i.push(r),a+=r.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o<a);while(!t)}catch(d){(e=!0)&&typeof c.throw=="function"&&c.throw(d)}finally{e===!1&&typeof c.return=="function"&&c.return(null)}return null}function wc(n){return te(this,arguments,function*(){let e,i=!1,r=[],s,o,a,l=0;function c(){return o==="peek"?ne(r,a)[0]:([s,r,l]=ne(r,a),s)}({cmd:o,size:a}=yield yield x(null));const d=bc(n)[Symbol.asyncIterator]();try{do if({done:e,value:s}=Number.isNaN(a-l)?yield x(d.next()):yield x(d.next(a-l)),!e&&s.byteLength>0&&(r.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield x(c()));while(a<l);while(!e)}catch(h){(i=!0)&&typeof d.throw=="function"&&(yield x(d.throw(h)))}finally{i===!1&&typeof d.return=="function"&&(yield x(d.return(new Uint8Array(0))))}return yield x(null)})}function Sc(n){return te(this,arguments,function*(){let e=!1,i=!1,r=[],s,o,a,l=0;function c(){return o==="peek"?ne(r,a)[0]:([s,r,l]=ne(r,a),s)}({cmd:o,size:a}=yield yield x(null));const d=new Ic(n);try{do if({done:e,value:s}=Number.isNaN(a-l)?yield x(d.read()):yield x(d.read(a-l)),!e&&s.byteLength>0&&(r.push(C(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield x(c()));while(a<l);while(!e)}catch(h){(i=!0)&&(yield x(d.cancel(h)))}finally{i===!1?yield x(d.cancel()):n.locked&&d.releaseLock()}return yield x(null)})}class Ic{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 w(this,void 0,void 0,function*(){const{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return w(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=C(e)),e})}}const lr=(n,t)=>{const e=r=>i([t,r]);let i;return[t,e,new Promise(r=>(i=r)&&n.once(t,e))]};function Bc(n){return te(this,arguments,function*(){const e=[];let i="error",r=!1,s=null,o,a,l=0,c=[],d;function h(){return o==="peek"?ne(c,a)[0]:([d,c,l]=ne(c,a),d)}if({cmd:o,size:a}=yield yield x(null),n.isTTY)return yield yield x(new Uint8Array(0)),yield x(null);try{e[0]=lr(n,"end"),e[1]=lr(n,"error");do{if(e[2]=lr(n,"readable"),[i,s]=yield x(Promise.race(e.map(_=>_[2]))),i==="error")break;if((r=i==="end")||(Number.isFinite(a-l)?(d=C(n.read(a-l)),d.byteLength<a-l&&(d=C(n.read()))):d=C(n.read()),d.byteLength>0&&(c.push(d),l+=d.byteLength)),r||a<=l)do({cmd:o,size:a}=yield yield x(h()));while(a<l)}while(!r)}finally{yield x(y(e,i==="error"?s:null))}return yield x(null);function y(_,G){return d=c=null,new Promise((et,st)=>{for(const[nt,He]of _)n.off(nt,He);try{const nt=n.destroy;nt&&nt.call(n,G),G=void 0}catch(nt){G=nt||G}finally{G!=null?st(G):et()}})}})}var Nt;(function(n){n[n.V1=0]="V1",n[n.V2=1]="V2",n[n.V3=2]="V3",n[n.V4=3]="V4",n[n.V5=4]="V5"})(Nt||(Nt={}));var Mt;(function(n){n[n.Sparse=0]="Sparse",n[n.Dense=1]="Dense"})(Mt||(Mt={}));var Bt;(function(n){n[n.HALF=0]="HALF",n[n.SINGLE=1]="SINGLE",n[n.DOUBLE=2]="DOUBLE"})(Bt||(Bt={}));var pe;(function(n){n[n.DAY=0]="DAY",n[n.MILLISECOND=1]="MILLISECOND"})(pe||(pe={}));var k;(function(n){n[n.SECOND=0]="SECOND",n[n.MILLISECOND=1]="MILLISECOND",n[n.MICROSECOND=2]="MICROSECOND",n[n.NANOSECOND=3]="NANOSECOND"})(k||(k={}));var Be;(function(n){n[n.YEAR_MONTH=0]="YEAR_MONTH",n[n.DAY_TIME=1]="DAY_TIME",n[n.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Be||(Be={}));var V;(function(n){n[n.NONE=0]="NONE",n[n.Schema=1]="Schema",n[n.DictionaryBatch=2]="DictionaryBatch",n[n.RecordBatch=3]="RecordBatch",n[n.Tensor=4]="Tensor",n[n.SparseTensor=5]="SparseTensor"})(V||(V={}));var u;(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"})(u||(u={}));var ae;(function(n){n[n.OFFSET=0]="OFFSET",n[n.DATA=1]="DATA",n[n.VALIDITY=2]="VALIDITY",n[n.TYPE=3]="TYPE"})(ae||(ae={}));const Oc=void 0;function En(n){if(n===null)return"null";if(n===Oc)return"undefined";switch(typeof n){case"number":return`${n}`;case"bigint":return`${n}`;case"string":return`"${n}"`}return typeof n[Symbol.toPrimitive]=="function"?n[Symbol.toPrimitive]("string"):ArrayBuffer.isView(n)?n instanceof Wn||n instanceof Yn?`[${[...n].map(t=>En(t))}]`:`[${n}]`:ArrayBuffer.isView(n)?`[${n}]`:JSON.stringify(n,(t,e)=>typeof e=="bigint"?`${e}`:e)}const Fc=Symbol.for("isArrowBigNum");function zt(n,...t){return t.length===0?Object.setPrototypeOf(q(this.TypedArray,n),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(n,...t),this.constructor.prototype)}zt.prototype[Fc]=!0;zt.prototype.toJSON=function(){return`"${je(this)}"`};zt.prototype.valueOf=function(){return Ao(this)};zt.prototype.toString=function(){return je(this)};zt.prototype[Symbol.toPrimitive]=function(n="default"){switch(n){case"number":return Ao(this);case"string":return je(this);case"default":return Sr(this)}return je(this)};function rn(...n){return zt.apply(this,n)}function sn(...n){return zt.apply(this,n)}function Rn(...n){return zt.apply(this,n)}Object.setPrototypeOf(rn.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(sn.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Rn.prototype,Object.create(Uint32Array.prototype));Object.assign(rn.prototype,zt.prototype,{constructor:rn,signed:!0,TypedArray:Int32Array,BigIntArray:Wn});Object.assign(sn.prototype,zt.prototype,{constructor:sn,signed:!1,TypedArray:Uint32Array,BigIntArray:Yn});Object.assign(Rn.prototype,zt.prototype,{constructor:Rn,signed:!0,TypedArray:Uint32Array,BigIntArray:Yn});function Ao(n){const{buffer:t,byteOffset:e,length:i,signed:r}=n,s=new Yn(t,e,i),o=r&&s[s.length-1]&BigInt(1)<<BigInt(63);let a=BigInt(o?1:0),l=BigInt(0);if(o){for(const c of s)a+=~c*(BigInt(1)<<BigInt(32)*l++);a*=BigInt(-1)}else for(const c of s)a+=c*(BigInt(1)<<BigInt(32)*l++);return a}let je,Sr;uc?(Sr=n=>n.byteLength===8?new n.BigIntArray(n.buffer,n.byteOffset,1)[0]:cr(n),je=n=>n.byteLength===8?`${new n.BigIntArray(n.buffer,n.byteOffset,1)[0]}`:cr(n)):(je=cr,Sr=je);function cr(n){let t="";const e=new Uint32Array(2);let i=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2);const r=new Uint32Array((i=new Uint16Array(i).reverse()).buffer);let s=-1;const o=i.length-1;do{for(e[0]=i[s=0];s<o;)i[s++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+i[s];i[s]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(r[0]||r[1]||r[2]||r[3]);return t??"0"}class qr{static new(t,e){switch(e){case!0:return new rn(t);case!1:return new sn(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case Wn:return new rn(t)}return t.byteLength===16?new Rn(t):new sn(t)}static signed(t){return new rn(t)}static unsigned(t){return new sn(t)}static decimal(t){return new Rn(t)}constructor(t,e){return qr.new(t,e)}}var Do,To,No,xo,Mo,Lo,Eo,Ro,Co,ko,Uo,Vo,$o,Po,jo,zo,Wo,Yo,Go;class S{static isNull(t){return t?.typeId===u.Null}static isInt(t){return t?.typeId===u.Int}static isFloat(t){return t?.typeId===u.Float}static isBinary(t){return t?.typeId===u.Binary}static isUtf8(t){return t?.typeId===u.Utf8}static isBool(t){return t?.typeId===u.Bool}static isDecimal(t){return t?.typeId===u.Decimal}static isDate(t){return t?.typeId===u.Date}static isTime(t){return t?.typeId===u.Time}static isTimestamp(t){return t?.typeId===u.Timestamp}static isInterval(t){return t?.typeId===u.Interval}static isList(t){return t?.typeId===u.List}static isStruct(t){return t?.typeId===u.Struct}static isUnion(t){return t?.typeId===u.Union}static isFixedSizeBinary(t){return t?.typeId===u.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===u.FixedSizeList}static isMap(t){return t?.typeId===u.Map}static isDictionary(t){return t?.typeId===u.Dictionary}static isDenseUnion(t){return S.isUnion(t)&&t.mode===Mt.Dense}static isSparseUnion(t){return S.isUnion(t)&&t.mode===Mt.Sparse}get typeId(){return u.NONE}}Do=Symbol.toStringTag;S[Do]=(n=>(n.children=null,n.ArrayType=Array,n[Symbol.toStringTag]="DataType"))(S.prototype);let Oe=class extends S{toString(){return"Null"}get typeId(){return u.Null}};To=Symbol.toStringTag;Oe[To]=(n=>n[Symbol.toStringTag]="Null")(Oe.prototype);class Fe extends S{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return u.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?Wn:Yn}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}No=Symbol.toStringTag;Fe[No]=(n=>(n.isSigned=null,n.bitWidth=null,n[Symbol.toStringTag]="Int"))(Fe.prototype);class Cn extends Fe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Cn.prototype,"ArrayType",{value:Int32Array});class kn extends S{constructor(t){super(),this.precision=t}get typeId(){return u.Float}get ArrayType(){switch(this.precision){case Bt.HALF:return Uint16Array;case Bt.SINGLE:return Float32Array;case Bt.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}xo=Symbol.toStringTag;kn[xo]=(n=>(n.precision=null,n[Symbol.toStringTag]="Float"))(kn.prototype);let ui=class extends S{constructor(){super()}get typeId(){return u.Binary}toString(){return"Binary"}};Mo=Symbol.toStringTag;ui[Mo]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Binary"))(ui.prototype);let di=class extends S{constructor(){super()}get typeId(){return u.Utf8}toString(){return"Utf8"}};Lo=Symbol.toStringTag;di[Lo]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Utf8"))(di.prototype);let hi=class extends S{constructor(){super()}get typeId(){return u.Bool}toString(){return"Bool"}};Eo=Symbol.toStringTag;hi[Eo]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Bool"))(hi.prototype);let fi=class extends S{constructor(t,e,i=128){super(),this.scale=t,this.precision=e,this.bitWidth=i}get typeId(){return u.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Ro=Symbol.toStringTag;fi[Ro]=(n=>(n.scale=null,n.precision=null,n.ArrayType=Uint32Array,n[Symbol.toStringTag]="Decimal"))(fi.prototype);class pi extends S{constructor(t){super(),this.unit=t}get typeId(){return u.Date}toString(){return`Date${(this.unit+1)*32}<${pe[this.unit]}>`}}Co=Symbol.toStringTag;pi[Co]=(n=>(n.unit=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Date"))(pi.prototype);class Un extends S{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return u.Time}toString(){return`Time${this.bitWidth}<${k[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return Wn}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}ko=Symbol.toStringTag;Un[ko]=(n=>(n.unit=null,n.bitWidth=null,n[Symbol.toStringTag]="Time"))(Un.prototype);class yi extends S{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return u.Timestamp}toString(){return`Timestamp<${k[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Uo=Symbol.toStringTag;yi[Uo]=(n=>(n.unit=null,n.timezone=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Timestamp"))(yi.prototype);class mi extends S{constructor(t){super(),this.unit=t}get typeId(){return u.Interval}toString(){return`Interval<${Be[this.unit]}>`}}Vo=Symbol.toStringTag;mi[Vo]=(n=>(n.unit=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Interval"))(mi.prototype);let vi=class extends S{constructor(t){super(),this.children=[t]}get typeId(){return u.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}};$o=Symbol.toStringTag;vi[$o]=(n=>(n.children=null,n[Symbol.toStringTag]="List"))(vi.prototype);class yt extends S{constructor(t){super(),this.children=t}get typeId(){return u.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Po=Symbol.toStringTag;yt[Po]=(n=>(n.children=null,n[Symbol.toStringTag]="Struct"))(yt.prototype);class bi extends S{constructor(t,e,i){super(),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((r,s,o)=>(r[s]=o)&&r||r,Object.create(null))}get typeId(){return u.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}jo=Symbol.toStringTag;bi[jo]=(n=>(n.mode=null,n.typeIds=null,n.children=null,n.typeIdToChildIndex=null,n.ArrayType=Int8Array,n[Symbol.toStringTag]="Union"))(bi.prototype);let gi=class extends S{constructor(t){super(),this.byteWidth=t}get typeId(){return u.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};zo=Symbol.toStringTag;gi[zo]=(n=>(n.byteWidth=null,n.ArrayType=Uint8Array,n[Symbol.toStringTag]="FixedSizeBinary"))(gi.prototype);let _i=class extends S{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return u.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}>`}};Wo=Symbol.toStringTag;_i[Wo]=(n=>(n.children=null,n.listSize=null,n[Symbol.toStringTag]="FixedSizeList"))(_i.prototype);class wi extends S{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return u.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(", ")}}>`}}Yo=Symbol.toStringTag;wi[Yo]=(n=>(n.children=null,n.keysSorted=null,n[Symbol.toStringTag]="Map_"))(wi.prototype);const Ac=(n=>()=>++n)(-1);class dn extends S{constructor(t,e,i,r){super(),this.indices=e,this.dictionary=t,this.isOrdered=r||!1,this.id=i==null?Ac():typeof i=="number"?i:i.low}get typeId(){return u.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}>`}}Go=Symbol.toStringTag;dn[Go]=(n=>(n.id=null,n.indices=null,n.isOrdered=null,n.dictionary=null,n[Symbol.toStringTag]="Dictionary"))(dn.prototype);function le(n){const t=n;switch(n.typeId){case u.Decimal:return n.bitWidth/32;case u.Timestamp:return 2;case u.Date:return 1+t.unit;case u.Interval:return 1+t.unit;case u.FixedSizeList:return t.listSize;case u.FixedSizeBinary:return t.byteWidth;default:return 1}}class R{visitMany(t,...e){return t.map((i,r)=>this.visit(i,...e.map(s=>s[r])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return Dc(this,t,e)}getVisitFnByTypeId(t,e=!0){return Xe(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 Dc(n,t,e=!0){return typeof t=="number"?Xe(n,t,e):typeof t=="string"&&t in u?Xe(n,u[t],e):t&&t instanceof S?Xe(n,Ts(t),e):t?.type&&t.type instanceof S?Xe(n,Ts(t.type),e):Xe(n,u.NONE,e)}function Xe(n,t,e=!0){let i=null;switch(t){case u.Null:i=n.visitNull;break;case u.Bool:i=n.visitBool;break;case u.Int:i=n.visitInt;break;case u.Int8:i=n.visitInt8||n.visitInt;break;case u.Int16:i=n.visitInt16||n.visitInt;break;case u.Int32:i=n.visitInt32||n.visitInt;break;case u.Int64:i=n.visitInt64||n.visitInt;break;case u.Uint8:i=n.visitUint8||n.visitInt;break;case u.Uint16:i=n.visitUint16||n.visitInt;break;case u.Uint32:i=n.visitUint32||n.visitInt;break;case u.Uint64:i=n.visitUint64||n.visitInt;break;case u.Float:i=n.visitFloat;break;case u.Float16:i=n.visitFloat16||n.visitFloat;break;case u.Float32:i=n.visitFloat32||n.visitFloat;break;case u.Float64:i=n.visitFloat64||n.visitFloat;break;case u.Utf8:i=n.visitUtf8;break;case u.Binary:i=n.visitBinary;break;case u.FixedSizeBinary:i=n.visitFixedSizeBinary;break;case u.Date:i=n.visitDate;break;case u.DateDay:i=n.visitDateDay||n.visitDate;break;case u.DateMillisecond:i=n.visitDateMillisecond||n.visitDate;break;case u.Timestamp:i=n.visitTimestamp;break;case u.TimestampSecond:i=n.visitTimestampSecond||n.visitTimestamp;break;case u.TimestampMillisecond:i=n.visitTimestampMillisecond||n.visitTimestamp;break;case u.TimestampMicrosecond:i=n.visitTimestampMicrosecond||n.visitTimestamp;break;case u.TimestampNanosecond:i=n.visitTimestampNanosecond||n.visitTimestamp;break;case u.Time:i=n.visitTime;break;case u.TimeSecond:i=n.visitTimeSecond||n.visitTime;break;case u.TimeMillisecond:i=n.visitTimeMillisecond||n.visitTime;break;case u.TimeMicrosecond:i=n.visitTimeMicrosecond||n.visitTime;break;case u.TimeNanosecond:i=n.visitTimeNanosecond||n.visitTime;break;case u.Decimal:i=n.visitDecimal;break;case u.List:i=n.visitList;break;case u.Struct:i=n.visitStruct;break;case u.Union:i=n.visitUnion;break;case u.DenseUnion:i=n.visitDenseUnion||n.visitUnion;break;case u.SparseUnion:i=n.visitSparseUnion||n.visitUnion;break;case u.Dictionary:i=n.visitDictionary;break;case u.Interval:i=n.visitInterval;break;case u.IntervalDayTime:i=n.visitIntervalDayTime||n.visitInterval;break;case u.IntervalYearMonth:i=n.visitIntervalYearMonth||n.visitInterval;break;case u.FixedSizeList:i=n.visitFixedSizeList;break;case u.Map:i=n.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${u[t]}'`)}function Ts(n){switch(n.typeId){case u.Null:return u.Null;case u.Int:{const{bitWidth:t,isSigned:e}=n;switch(t){case 8:return e?u.Int8:u.Uint8;case 16:return e?u.Int16:u.Uint16;case 32:return e?u.Int32:u.Uint32;case 64:return e?u.Int64:u.Uint64}return u.Int}case u.Float:switch(n.precision){case Bt.HALF:return u.Float16;case Bt.SINGLE:return u.Float32;case Bt.DOUBLE:return u.Float64}return u.Float;case u.Binary:return u.Binary;case u.Utf8:return u.Utf8;case u.Bool:return u.Bool;case u.Decimal:return u.Decimal;case u.Time:switch(n.unit){case k.SECOND:return u.TimeSecond;case k.MILLISECOND:return u.TimeMillisecond;case k.MICROSECOND:return u.TimeMicrosecond;case k.NANOSECOND:return u.TimeNanosecond}return u.Time;case u.Timestamp:switch(n.unit){case k.SECOND:return u.TimestampSecond;case k.MILLISECOND:return u.TimestampMillisecond;case k.MICROSECOND:return u.TimestampMicrosecond;case k.NANOSECOND:return u.TimestampNanosecond}return u.Timestamp;case u.Date:switch(n.unit){case pe.DAY:return u.DateDay;case pe.MILLISECOND:return u.DateMillisecond}return u.Date;case u.Interval:switch(n.unit){case Be.DAY_TIME:return u.IntervalDayTime;case Be.YEAR_MONTH:return u.IntervalYearMonth}return u.Interval;case u.Map:return u.Map;case u.List:return u.List;case u.Struct:return u.Struct;case u.Union:switch(n.mode){case Mt.Dense:return u.DenseUnion;case Mt.Sparse:return u.SparseUnion}return u.Union;case u.FixedSizeBinary:return u.FixedSizeBinary;case u.FixedSizeList:return u.FixedSizeList;case u.Dictionary:return u.Dictionary}throw new Error(`Unrecognized type '${u[n.typeId]}'`)}R.prototype.visitInt8=null;R.prototype.visitInt16=null;R.prototype.visitInt32=null;R.prototype.visitInt64=null;R.prototype.visitUint8=null;R.prototype.visitUint16=null;R.prototype.visitUint32=null;R.prototype.visitUint64=null;R.prototype.visitFloat16=null;R.prototype.visitFloat32=null;R.prototype.visitFloat64=null;R.prototype.visitDateDay=null;R.prototype.visitDateMillisecond=null;R.prototype.visitTimestampSecond=null;R.prototype.visitTimestampMillisecond=null;R.prototype.visitTimestampMicrosecond=null;R.prototype.visitTimestampNanosecond=null;R.prototype.visitTimeSecond=null;R.prototype.visitTimeMillisecond=null;R.prototype.visitTimeMicrosecond=null;R.prototype.visitTimeNanosecond=null;R.prototype.visitDenseUnion=null;R.prototype.visitSparseUnion=null;R.prototype.visitIntervalDayTime=null;R.prototype.visitIntervalYearMonth=null;const Ho=new Float64Array(1),Ke=new Uint32Array(Ho.buffer);function qo(n){const t=(n&31744)>>10,e=(n&1023)/1024,i=Math.pow(-1,(n&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function Tc(n){if(n!==n)return 32256;Ho[0]=n;const t=(Ke[1]&2147483648)>>16&65535;let e=Ke[1]&2146435072,i=0;return e>=1089470464?Ke[0]>0?e=31744:(e=(e&2080374784)>>16,i=(Ke[1]&1048575)>>10):e<=1056964608?(i=1048576+(Ke[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(Ke[1]&1048575)+512>>10),t|e|i&65535}class A extends R{}function N(n){return(t,e,i)=>{if(t.setValid(e,i!=null))return n(t,e,i)}}const Nc=(n,t,e)=>{n[t]=Math.trunc(e/864e5)},Jr=(n,t,e)=>{n[t]=Math.trunc(e%4294967296),n[t+1]=Math.trunc(e/4294967296)},xc=(n,t,e)=>{n[t]=Math.trunc(e*1e3%4294967296),n[t+1]=Math.trunc(e*1e3/4294967296)},Mc=(n,t,e)=>{n[t]=Math.trunc(e*1e6%4294967296),n[t+1]=Math.trunc(e*1e6/4294967296)},Jo=(n,t,e,i)=>{if(e+1<t.length){const{[e]:r,[e+1]:s}=t;n.set(i.subarray(0,s-r),r)}},Lc=({offset:n,values:t},e,i)=>{const r=n+e;i?t[r>>3]|=1<<r%8:t[r>>3]&=~(1<<r%8)},me=({values:n},t,e)=>{n[t]=e},Kr=({values:n},t,e)=>{n[t]=e},Ko=({values:n},t,e)=>{n[t]=Tc(e)},Ec=(n,t,e)=>{switch(n.type.precision){case Bt.HALF:return Ko(n,t,e);case Bt.SINGLE:case Bt.DOUBLE:return Kr(n,t,e)}},Zo=({values:n},t,e)=>{Nc(n,t,e.valueOf())},Xo=({values:n},t,e)=>{Jr(n,t*2,e.valueOf())},Rc=({stride:n,values:t},e,i)=>{t.set(i.subarray(0,n),n*e)},Cc=({values:n,valueOffsets:t},e,i)=>Jo(n,t,e,i),kc=({values:n,valueOffsets:t},e,i)=>{Jo(n,t,e,Wr(i))},Uc=(n,t,e)=>{n.type.unit===pe.DAY?Zo(n,t,e):Xo(n,t,e)},Qo=({values:n},t,e)=>Jr(n,t*2,e/1e3),ta=({values:n},t,e)=>Jr(n,t*2,e),ea=({values:n},t,e)=>xc(n,t*2,e),na=({values:n},t,e)=>Mc(n,t*2,e),Vc=(n,t,e)=>{switch(n.type.unit){case k.SECOND:return Qo(n,t,e);case k.MILLISECOND:return ta(n,t,e);case k.MICROSECOND:return ea(n,t,e);case k.NANOSECOND:return na(n,t,e)}},ia=({values:n},t,e)=>{n[t]=e},ra=({values:n},t,e)=>{n[t]=e},sa=({values:n},t,e)=>{n[t]=e},oa=({values:n},t,e)=>{n[t]=e},$c=(n,t,e)=>{switch(n.type.unit){case k.SECOND:return ia(n,t,e);case k.MILLISECOND:return ra(n,t,e);case k.MICROSECOND:return sa(n,t,e);case k.NANOSECOND:return oa(n,t,e)}},Pc=({values:n,stride:t},e,i)=>{n.set(i.subarray(0,t),t*e)},jc=(n,t,e)=>{const i=n.children[0],r=n.valueOffsets,s=Vt.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=r[t],l=r[t+1];a<l;)s(i,a++,e[++o]);else for(let o=-1,a=r[t],l=r[t+1];a<l;)s(i,a++,e.get(++o))},zc=(n,t,e)=>{const i=n.children[0],{valueOffsets:r}=n,s=Vt.getVisitFn(i);let{[t]:o,[t+1]:a}=r;const l=e instanceof Map?e.entries():Object.entries(e);for(const c of l)if(s(i,o,c),++o>=a)break},Wc=(n,t)=>(e,i,r,s)=>i&&e(i,n,t[s]),Yc=(n,t)=>(e,i,r,s)=>i&&e(i,n,t.get(s)),Gc=(n,t)=>(e,i,r,s)=>i&&e(i,n,t.get(r.name)),Hc=(n,t)=>(e,i,r,s)=>i&&e(i,n,t[r.name]),qc=(n,t,e)=>{const i=n.type.children.map(s=>Vt.getVisitFn(s.type)),r=e instanceof Map?Gc(t,e):e instanceof $?Yc(t,e):Array.isArray(e)?Wc(t,e):Hc(t,e);n.type.children.forEach((s,o)=>r(i[o],n.children[o],s,o))},Jc=(n,t,e)=>{n.type.mode===Mt.Dense?aa(n,t,e):la(n,t,e)},aa=(n,t,e)=>{const i=n.type.typeIdToChildIndex[n.typeIds[t]],r=n.children[i];Vt.visit(r,n.valueOffsets[t],e)},la=(n,t,e)=>{const i=n.type.typeIdToChildIndex[n.typeIds[t]],r=n.children[i];Vt.visit(r,t,e)},Kc=(n,t,e)=>{var i;(i=n.dictionary)===null||i===void 0||i.set(n.values[t],e)},Zc=(n,t,e)=>{n.type.unit===Be.DAY_TIME?ca(n,t,e):ua(n,t,e)},ca=({values:n},t,e)=>{n.set(e.subarray(0,2),2*t)},ua=({values:n},t,e)=>{n[t]=e[0]*12+e[1]%12},Xc=(n,t,e)=>{const{stride:i}=n,r=n.children[0],s=Vt.getVisitFn(r);if(Array.isArray(e))for(let o=-1,a=t*i;++o<i;)s(r,a+o,e[o]);else for(let o=-1,a=t*i;++o<i;)s(r,a+o,e.get(o))};A.prototype.visitBool=N(Lc);A.prototype.visitInt=N(me);A.prototype.visitInt8=N(me);A.prototype.visitInt16=N(me);A.prototype.visitInt32=N(me);A.prototype.visitInt64=N(me);A.prototype.visitUint8=N(me);A.prototype.visitUint16=N(me);A.prototype.visitUint32=N(me);A.prototype.visitUint64=N(me);A.prototype.visitFloat=N(Ec);A.prototype.visitFloat16=N(Ko);A.prototype.visitFloat32=N(Kr);A.prototype.visitFloat64=N(Kr);A.prototype.visitUtf8=N(kc);A.prototype.visitBinary=N(Cc);A.prototype.visitFixedSizeBinary=N(Rc);A.prototype.visitDate=N(Uc);A.prototype.visitDateDay=N(Zo);A.prototype.visitDateMillisecond=N(Xo);A.prototype.visitTimestamp=N(Vc);A.prototype.visitTimestampSecond=N(Qo);A.prototype.visitTimestampMillisecond=N(ta);A.prototype.visitTimestampMicrosecond=N(ea);A.prototype.visitTimestampNanosecond=N(na);A.prototype.visitTime=N($c);A.prototype.visitTimeSecond=N(ia);A.prototype.visitTimeMillisecond=N(ra);A.prototype.visitTimeMicrosecond=N(sa);A.prototype.visitTimeNanosecond=N(oa);A.prototype.visitDecimal=N(Pc);A.prototype.visitList=N(jc);A.prototype.visitStruct=N(qc);A.prototype.visitUnion=N(Jc);A.prototype.visitDenseUnion=N(aa);A.prototype.visitSparseUnion=N(la);A.prototype.visitDictionary=N(Kc);A.prototype.visitInterval=N(Zc);A.prototype.visitIntervalDayTime=N(ca);A.prototype.visitIntervalYearMonth=N(ua);A.prototype.visitFixedSizeList=N(Xc);A.prototype.visitMap=N(zc);const Vt=new A,$t=Symbol.for("parent"),on=Symbol.for("rowIndex");class Zr{constructor(t,e){return this[$t]=t,this[on]=e,new Proxy(this,new tu)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[on],e=this[$t],i=e.type.children,r={};for(let s=-1,o=i.length;++s<o;)r[i[s].name]=Ft.visit(e.children[s],t);return r}toString(){return`{${[...this].map(([t,e])=>`${En(t)}: ${En(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Qc(this[$t],this[on])}}class Qc{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,Ft.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(Zr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[$t]:{writable:!0,enumerable:!1,configurable:!1,value:null},[on]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class tu{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[$t].type.children.map(e=>e.name)}has(t,e){return t[$t].type.children.findIndex(i=>i.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[$t].type.children.findIndex(i=>i.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[$t].type.children.findIndex(r=>r.name===e);if(i!==-1){const r=Ft.visit(t[$t].children[i],t[on]);return Reflect.set(t,e,r),r}}set(t,e,i){const r=t[$t].type.children.findIndex(s=>s.name===e);return r!==-1?(Vt.visit(t[$t].children[r],t[on],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}class I extends R{}function D(n){return(t,e)=>t.getValid(e)?n(t,e):null}const eu=(n,t)=>864e5*n[t],Xr=(n,t)=>4294967296*n[t+1]+(n[t]>>>0),nu=(n,t)=>4294967296*(n[t+1]/1e3)+(n[t]>>>0)/1e3,iu=(n,t)=>4294967296*(n[t+1]/1e6)+(n[t]>>>0)/1e6,da=n=>new Date(n),ru=(n,t)=>da(eu(n,t)),su=(n,t)=>da(Xr(n,t)),ou=(n,t)=>null,ha=(n,t,e)=>{if(e+1>=t.length)return null;const i=t[e],r=t[e+1];return n.subarray(i,r)},au=({offset:n,values:t},e)=>{const i=n+e;return(t[i>>3]&1<<i%8)!==0},fa=({values:n},t)=>ru(n,t),pa=({values:n},t)=>su(n,t*2),Te=({stride:n,values:t},e)=>t[n*e],lu=({stride:n,values:t},e)=>qo(t[n*e]),ya=({values:n},t)=>n[t],cu=({stride:n,values:t},e)=>t.subarray(n*e,n*(e+1)),uu=({values:n,valueOffsets:t},e)=>ha(n,t,e),du=({values:n,valueOffsets:t},e)=>{const i=ha(n,t,e);return i!==null?gr(i):null},hu=({values:n},t)=>n[t],fu=({type:n,values:t},e)=>n.precision!==Bt.HALF?t[e]:qo(t[e]),pu=(n,t)=>n.type.unit===pe.DAY?fa(n,t):pa(n,t),ma=({values:n},t)=>1e3*Xr(n,t*2),va=({values:n},t)=>Xr(n,t*2),ba=({values:n},t)=>nu(n,t*2),ga=({values:n},t)=>iu(n,t*2),yu=(n,t)=>{switch(n.type.unit){case k.SECOND:return ma(n,t);case k.MILLISECOND:return va(n,t);case k.MICROSECOND:return ba(n,t);case k.NANOSECOND:return ga(n,t)}},_a=({values:n},t)=>n[t],wa=({values:n},t)=>n[t],Sa=({values:n},t)=>n[t],Ia=({values:n},t)=>n[t],mu=(n,t)=>{switch(n.type.unit){case k.SECOND:return _a(n,t);case k.MILLISECOND:return wa(n,t);case k.MICROSECOND:return Sa(n,t);case k.NANOSECOND:return Ia(n,t)}},vu=({values:n,stride:t},e)=>qr.decimal(n.subarray(t*e,t*(e+1))),bu=(n,t)=>{const{valueOffsets:e,stride:i,children:r}=n,{[t*i]:s,[t*i+1]:o}=e,l=r[0].slice(s,o-s);return new $([l])},gu=(n,t)=>{const{valueOffsets:e,children:i}=n,{[t]:r,[t+1]:s}=e,o=i[0];return new Qr(o.slice(r,s-r))},_u=(n,t)=>new Zr(n,t),wu=(n,t)=>n.type.mode===Mt.Dense?Ba(n,t):Oa(n,t),Ba=(n,t)=>{const e=n.type.typeIdToChildIndex[n.typeIds[t]],i=n.children[e];return Ft.visit(i,n.valueOffsets[t])},Oa=(n,t)=>{const e=n.type.typeIdToChildIndex[n.typeIds[t]],i=n.children[e];return Ft.visit(i,t)},Su=(n,t)=>{var e;return(e=n.dictionary)===null||e===void 0?void 0:e.get(n.values[t])},Iu=(n,t)=>n.type.unit===Be.DAY_TIME?Fa(n,t):Aa(n,t),Fa=({values:n},t)=>n.subarray(2*t,2*(t+1)),Aa=({values:n},t)=>{const e=n[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Bu=(n,t)=>{const{stride:e,children:i}=n,s=i[0].slice(t*e,e);return new $([s])};I.prototype.visitNull=D(ou);I.prototype.visitBool=D(au);I.prototype.visitInt=D(hu);I.prototype.visitInt8=D(Te);I.prototype.visitInt16=D(Te);I.prototype.visitInt32=D(Te);I.prototype.visitInt64=D(ya);I.prototype.visitUint8=D(Te);I.prototype.visitUint16=D(Te);I.prototype.visitUint32=D(Te);I.prototype.visitUint64=D(ya);I.prototype.visitFloat=D(fu);I.prototype.visitFloat16=D(lu);I.prototype.visitFloat32=D(Te);I.prototype.visitFloat64=D(Te);I.prototype.visitUtf8=D(du);I.prototype.visitBinary=D(uu);I.prototype.visitFixedSizeBinary=D(cu);I.prototype.visitDate=D(pu);I.prototype.visitDateDay=D(fa);I.prototype.visitDateMillisecond=D(pa);I.prototype.visitTimestamp=D(yu);I.prototype.visitTimestampSecond=D(ma);I.prototype.visitTimestampMillisecond=D(va);I.prototype.visitTimestampMicrosecond=D(ba);I.prototype.visitTimestampNanosecond=D(ga);I.prototype.visitTime=D(mu);I.prototype.visitTimeSecond=D(_a);I.prototype.visitTimeMillisecond=D(wa);I.prototype.visitTimeMicrosecond=D(Sa);I.prototype.visitTimeNanosecond=D(Ia);I.prototype.visitDecimal=D(vu);I.prototype.visitList=D(bu);I.prototype.visitStruct=D(_u);I.prototype.visitUnion=D(wu);I.prototype.visitDenseUnion=D(Ba);I.prototype.visitSparseUnion=D(Oa);I.prototype.visitDictionary=D(Su);I.prototype.visitInterval=D(Iu);I.prototype.visitIntervalDayTime=D(Fa);I.prototype.visitIntervalYearMonth=D(Aa);I.prototype.visitFixedSizeList=D(Bu);I.prototype.visitMap=D(gu);const Ft=new I,qt=Symbol.for("keys"),an=Symbol.for("vals");class Qr{constructor(t){return this[qt]=new $([t.children[0]]).memoize(),this[an]=t.children[1],new Proxy(this,new Fu)}[Symbol.iterator](){return new Ou(this[qt],this[an])}get size(){return this[qt].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[qt],e=this[an],i={};for(let r=-1,s=t.length;++r<s;)i[t.get(r)]=Ft.visit(e,r);return i}toString(){return`{${[...this].map(([t,e])=>`${En(t)}: ${En(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class Ou{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),Ft.visit(this.vals,t)]})}}class Fu{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[qt].toArray().map(String)}has(t,e){return t[qt].includes(e)}getOwnPropertyDescriptor(t,e){if(t[qt].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[qt].indexOf(e);if(i!==-1){const r=Ft.visit(Reflect.get(t,an),i);return Reflect.set(t,e,r),r}}set(t,e,i){const r=t[qt].indexOf(e);return r!==-1?(Vt.visit(Reflect.get(t,an),r,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Qr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[qt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[an]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Ns;function Da(n,t,e,i){const{length:r=0}=n;let s=typeof t!="number"?0:t,o=typeof e!="number"?r:e;return s<0&&(s=(s%r+r)%r),o<0&&(o=(o%r+r)%r),o<s&&(Ns=s,s=o,o=Ns),o>r&&(o=r),i?i(n,s,o):[s,o]}const xs=n=>n!==n;function _n(n){if(typeof n!=="object"||n===null)return xs(n)?xs:e=>e===n;if(n instanceof Date){const e=n.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(n)?e=>e?gc(n,e):!1:n instanceof Map?Du(n):Array.isArray(n)?Au(n):n instanceof $?Tu(n):Nu(n,!0)}function Au(n){const t=[];for(let e=-1,i=n.length;++e<i;)t[e]=_n(n[e]);return tr(t)}function Du(n){let t=-1;const e=[];for(const i of n.values())e[++t]=_n(i);return tr(e)}function Tu(n){const t=[];for(let e=-1,i=n.length;++e<i;)t[e]=_n(n.get(e));return tr(t)}function Nu(n,t=!1){const e=Object.keys(n);if(!t&&e.length===0)return()=>!1;const i=[];for(let r=-1,s=e.length;++r<s;)i[r]=_n(n[e[r]]);return tr(i,e)}function tr(n,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return xu(n,e);case Map:return Ms(n,e,e.keys());case Qr:case Zr:case Object:case void 0:return Ms(n,e,t||Object.keys(e))}return e instanceof $?Mu(n,e):!1}}function xu(n,t){const e=n.length;if(t.length!==e)return!1;for(let i=-1;++i<e;)if(!n[i](t[i]))return!1;return!0}function Mu(n,t){const e=n.length;if(t.length!==e)return!1;for(let i=-1;++i<e;)if(!n[i](t.get(i)))return!1;return!0}function Ms(n,t,e){const i=e[Symbol.iterator](),r=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),s=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let o=0;const a=n.length;let l=s.next(),c=i.next(),d=r.next();for(;o<a&&!c.done&&!d.done&&!l.done&&!(c.value!==d.value||!n[o](l.value));++o,c=i.next(),d=r.next(),l=s.next());return o===a&&c.done&&d.done&&l.done?!0:(i.return&&i.return(),r.return&&r.return(),s.return&&s.return(),!1)}function Ta(n,t,e,i){return(e&1<<i)!==0}function Lu(n,t,e,i){return(e&1<<i)>>i}function ts(n,t,e){const i=e.byteLength+7&-8;if(n>0||e.byteLength<i){const r=new Uint8Array(i);return r.set(n%8===0?e.subarray(n>>3):Si(new es(e,n,t,null,Ta)).subarray(0,i)),r}return e}function Si(n){const t=[];let e=0,i=0,r=0;for(const o of n)o&&(r|=1<<i),++i===8&&(t[e++]=r,r=i=0);(e===0||i>0)&&(t[e++]=r);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class es{constructor(t,e,i,r,s){this.bytes=t,this.length=i,this.context=r,this.get=s,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 Ir(n,t,e){if(e-t<=0)return 0;if(e-t<8){let s=0;for(const o of new es(n,t,e-t,n,Lu))s+=o;return s}const i=e>>3<<3,r=t+(t%8===0?0:8-t%8);return Ir(n,t,r)+Ir(n,i,e)+Eu(n,r>>3,i-r>>3)}function Eu(n,t,e){let i=0,r=Math.trunc(t);const s=new DataView(n.buffer,n.byteOffset,n.byteLength),o=e===void 0?n.byteLength:r+e;for(;o-r>=4;)i+=ur(s.getUint32(r)),r+=4;for(;o-r>=2;)i+=ur(s.getUint16(r)),r+=2;for(;o-r>=1;)i+=ur(s.getUint8(r)),r+=1;return i}function ur(n){let t=Math.trunc(n);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const Ru=-1;class K{constructor(t,e,i,r,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(r||0,-1));let l;s instanceof K?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=le(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l))),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:i,nullBitmap:r,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),r&&(t+=r.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=Ru&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-Ir(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:l}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:l,_nullCount:0})}const{nullBitmap:i,offset:r}=this,s=r+t>>3,o=(r+t)%8,a=i[s]>>o&1;return e?a===0&&(i[s]|=1<<o,this._nullCount=this.nullCount+1):a===1&&(i[s]&=~(1<<o),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,i=this.length,r=this._nullCount,s=this,o=this.children){return new K(t,e,i,r,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:r,children:s}=this,o=+(this._nullCount===0)-1,a=r===16?i:1,l=this._sliceBuffers(t,e,i,r);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===u.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,r=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);r[e>>3]=(1<<e-(e&-8))-1,i>0&&r.set(ts(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[ae.VALIDITY]=r,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,r){let s;const{buffers:o}=this;return(s=o[ae.TYPE])&&(o[ae.TYPE]=s.subarray(t,t+e)),(s=o[ae.OFFSET])&&(o[ae.OFFSET]=s.subarray(t,t+e+1))||(s=o[ae.DATA])&&(o[ae.DATA]=r===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(r=>r.slice(e,i))}}K.prototype.children=Object.freeze([]);class Dn extends R{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:i=0,["length"]:r=0}=t;return new K(e,i,r,0)}visitBool(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitInt(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitFloat(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitUtf8(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.data),s=C(t.nullBitmap),o=Bn(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new K(e,i,a,l,[o,r,s])}visitBinary(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.data),s=C(t.nullBitmap),o=Bn(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new K(e,i,a,l,[o,r,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length/le(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitDate(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length/le(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitTimestamp(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length/le(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitTime(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length/le(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitDecimal(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length/le(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitList(t){const{["type"]:e,["offset"]:i=0,["child"]:r}=t,s=C(t.nullBitmap),o=Bn(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new K(e,i,a,l,[o,void 0,s],[r])}visitStruct(t){const{["type"]:e,["offset"]:i=0,["children"]:r=[]}=t,s=C(t.nullBitmap),{length:o=r.reduce((l,{length:c})=>Math.max(l,c),0),nullCount:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,void 0,s],r)}visitUnion(t){const{["type"]:e,["offset"]:i=0,["children"]:r=[]}=t,s=C(t.nullBitmap),o=q(e.ArrayType,t.typeIds),{["length"]:a=o.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;if(S.isSparseUnion(e))return new K(e,i,a,l,[void 0,void 0,s,o],r);const c=Bn(t.valueOffsets);return new K(e,i,a,l,[c,void 0,s,o],r)}visitDictionary(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.indices.ArrayType,t.data),{["dictionary"]:o=new $([new Dn().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new K(e,i,a,l,[void 0,s,r],[],o)}visitInterval(t){const{["type"]:e,["offset"]:i=0}=t,r=C(t.nullBitmap),s=q(e.ArrayType,t.data),{["length"]:o=s.length/le(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,s,r])}visitFixedSizeList(t){const{["type"]:e,["offset"]:i=0,["child"]:r=new Dn().visit({type:e.valueType})}=t,s=C(t.nullBitmap),{["length"]:o=r.length/le(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new K(e,i,o,a,[void 0,void 0,s],[r])}visitMap(t){const{["type"]:e,["offset"]:i=0,["child"]:r=new Dn().visit({type:e.childType})}=t,s=C(t.nullBitmap),o=Bn(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new K(e,i,a,l,[o,void 0,s],[r])}}function E(n){return new Dn().visit(n)}class Ls{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 Na(n){return n.reduce((t,e)=>t+e.nullCount,0)}function xa(n){return n.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(n.length+1))}function Ma(n,t,e,i){const r=[];for(let s=-1,o=n.length;++s<o;){const a=n[s],l=t[s],{length:c}=a;if(l>=i)break;if(e>=l+c)continue;if(l>=e&&l+c<=i){r.push(a);continue}const d=Math.max(0,e-l),h=Math.min(i-l,c);r.push(a.slice(d,h-d))}return r.length===0&&r.push(n[0].slice(0,0)),r}function ns(n,t,e,i){let r=0,s=0,o=t.length-1;do{if(r>=o-1)return e<t[o]?i(n,r,e-t[r]):null;s=r+Math.trunc((o-r)*.5),e<t[s]?o=s:r=s}while(r<o)}function is(n,t){return n.getValid(t)}function ln(n){function t(e,i,r){return n(e[i],r)}return function(e){const i=this.data;return ns(i,this._offsets,e,t)}}function La(n){let t;function e(i,r,s){return n(i[r],s,t)}return function(i,r){const s=this.data;t=r;const o=ns(s,this._offsets,i,e);return t=void 0,o}}function Ea(n){let t;function e(i,r,s){let o=s,a=0,l=0;for(let c=r-1,d=i.length;++c<d;){const h=i[c];if(~(a=n(h,t,o)))return l+a;o=0,l+=h.length}return-1}return function(i,r){t=i;const s=this.data,o=typeof r!="number"?e(s,0,0):ns(s,this._offsets,r,e);return t=void 0,o}}class B extends R{}function Cu(n,t){return t===null&&n.length>0?0:-1}function ku(n,t){const{nullBitmap:e}=n;if(!e||n.nullCount<=0)return-1;let i=0;for(const r of new es(e,n.offset+(t||0),n.length,e,Ta)){if(!r)return i;++i}return-1}function M(n,t,e){if(t===void 0)return-1;if(t===null)return ku(n,e);const i=Ft.getVisitFn(n),r=_n(t);for(let s=(e||0)-1,o=n.length;++s<o;)if(r(i(n,s)))return s;return-1}function Ra(n,t,e){const i=Ft.getVisitFn(n),r=_n(t);for(let s=(e||0)-1,o=n.length;++s<o;)if(r(i(n,s)))return s;return-1}B.prototype.visitNull=Cu;B.prototype.visitBool=M;B.prototype.visitInt=M;B.prototype.visitInt8=M;B.prototype.visitInt16=M;B.prototype.visitInt32=M;B.prototype.visitInt64=M;B.prototype.visitUint8=M;B.prototype.visitUint16=M;B.prototype.visitUint32=M;B.prototype.visitUint64=M;B.prototype.visitFloat=M;B.prototype.visitFloat16=M;B.prototype.visitFloat32=M;B.prototype.visitFloat64=M;B.prototype.visitUtf8=M;B.prototype.visitBinary=M;B.prototype.visitFixedSizeBinary=M;B.prototype.visitDate=M;B.prototype.visitDateDay=M;B.prototype.visitDateMillisecond=M;B.prototype.visitTimestamp=M;B.prototype.visitTimestampSecond=M;B.prototype.visitTimestampMillisecond=M;B.prototype.visitTimestampMicrosecond=M;B.prototype.visitTimestampNanosecond=M;B.prototype.visitTime=M;B.prototype.visitTimeSecond=M;B.prototype.visitTimeMillisecond=M;B.prototype.visitTimeMicrosecond=M;B.prototype.visitTimeNanosecond=M;B.prototype.visitDecimal=M;B.prototype.visitList=M;B.prototype.visitStruct=M;B.prototype.visitUnion=M;B.prototype.visitDenseUnion=Ra;B.prototype.visitSparseUnion=Ra;B.prototype.visitDictionary=M;B.prototype.visitInterval=M;B.prototype.visitIntervalDayTime=M;B.prototype.visitIntervalYearMonth=M;B.prototype.visitFixedSizeList=M;B.prototype.visitMap=M;const Ii=new B;class O extends R{}function T(n){const{type:t}=n;if(n.nullCount===0&&n.stride===1&&(t.typeId===u.Timestamp||t instanceof Fe&&t.bitWidth!==64||t instanceof Un&&t.bitWidth!==64||t instanceof kn&&t.precision!==Bt.HALF))return new Ls(n.data.length,i=>{const r=n.data[i];return r.values.subarray(0,r.length)[Symbol.iterator]()});let e=0;return new Ls(n.data.length,i=>{const s=n.data[i].length,o=n.slice(e,e+s);return e+=s,new Uu(o)})}class Uu{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}}O.prototype.visitNull=T;O.prototype.visitBool=T;O.prototype.visitInt=T;O.prototype.visitInt8=T;O.prototype.visitInt16=T;O.prototype.visitInt32=T;O.prototype.visitInt64=T;O.prototype.visitUint8=T;O.prototype.visitUint16=T;O.prototype.visitUint32=T;O.prototype.visitUint64=T;O.prototype.visitFloat=T;O.prototype.visitFloat16=T;O.prototype.visitFloat32=T;O.prototype.visitFloat64=T;O.prototype.visitUtf8=T;O.prototype.visitBinary=T;O.prototype.visitFixedSizeBinary=T;O.prototype.visitDate=T;O.prototype.visitDateDay=T;O.prototype.visitDateMillisecond=T;O.prototype.visitTimestamp=T;O.prototype.visitTimestampSecond=T;O.prototype.visitTimestampMillisecond=T;O.prototype.visitTimestampMicrosecond=T;O.prototype.visitTimestampNanosecond=T;O.prototype.visitTime=T;O.prototype.visitTimeSecond=T;O.prototype.visitTimeMillisecond=T;O.prototype.visitTimeMicrosecond=T;O.prototype.visitTimeNanosecond=T;O.prototype.visitDecimal=T;O.prototype.visitList=T;O.prototype.visitStruct=T;O.prototype.visitUnion=T;O.prototype.visitDenseUnion=T;O.prototype.visitSparseUnion=T;O.prototype.visitDictionary=T;O.prototype.visitInterval=T;O.prototype.visitIntervalDayTime=T;O.prototype.visitIntervalYearMonth=T;O.prototype.visitFixedSizeList=T;O.prototype.visitMap=T;const rs=new O,Vu=(n,t)=>n+t;class Ne extends R{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===k.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((i,r)=>i+ie.visit(r,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((i,r)=>i+ie.visit(r,e),0)}visitDictionary(t,e){var i;return t.type.indices.bitWidth/8+(((i=t.dictionary)===null||i===void 0?void 0:i.getByteLength(t.values[e]))||0)}}const $u=({valueOffsets:n},t)=>8+(n[t+1]-n[t]),Pu=({valueOffsets:n},t)=>8+(n[t+1]-n[t]),ju=({valueOffsets:n,stride:t,children:e},i)=>{const r=e[0],{[i*t]:s}=n,{[i*t+1]:o}=n,a=ie.getVisitFn(r.type),l=r.slice(s,o-s);let c=8;for(let d=-1,h=o-s;++d<h;)c+=a(l,d);return c},zu=({stride:n,children:t},e)=>{const i=t[0],r=i.slice(e*n,n),s=ie.getVisitFn(i.type);let o=0;for(let a=-1,l=r.length;++a<l;)o+=s(r,a);return o},Wu=(n,t)=>n.type.mode===Mt.Dense?Ca(n,t):ka(n,t),Ca=({type:n,children:t,typeIds:e,valueOffsets:i},r)=>{const s=n.typeIdToChildIndex[e[r]];return 8+ie.visit(t[s],i[r])},ka=({children:n},t)=>4+ie.visitMany(n,n.map(()=>t)).reduce(Vu,0);Ne.prototype.visitUtf8=$u;Ne.prototype.visitBinary=Pu;Ne.prototype.visitList=ju;Ne.prototype.visitFixedSizeList=zu;Ne.prototype.visitUnion=Wu;Ne.prototype.visitDenseUnion=Ca;Ne.prototype.visitSparseUnion=ka;const ie=new Ne;var Ua;const Va={},$a={};class ${constructor(t){var e,i,r;const s=t[0]instanceof $?t.flatMap(a=>a.data):t;if(s.length===0||s.some(a=>!(a instanceof K)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:c,byteLength:d}=Va[o.typeId],h=s[0];this.isValid=y=>is(h,y),this.get=y=>a(h,y),this.set=(y,_)=>l(h,y,_),this.indexOf=y=>c(h,y),this.getByteLength=y=>d(h,y),this._offsets=[0,h.length];break}default:Object.setPrototypeOf(this,$a[o.typeId]),this._offsets=xa(s);break}this.data=s,this.type=o,this.stride=le(o),this.numChildren=(r=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&r!==void 0?r: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=Na(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${u[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 rs.visit(this)}concat(...t){return new $(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new $(Da(this,t,e,({data:i,_offsets:r},s,o)=>Ma(i,r,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:r,ArrayType:s}=this;switch(t.typeId){case u.Int:case u.Float:case u.Decimal:case u.Time:case u.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*r);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*r),o.offset),o.offset+=l*r,o),{array:new s(i*r),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(i=>i.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new $(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return S.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(S.isDictionary(this.type)){const t=new Bi(this.data[0].dictionary),e=this.data.map(i=>{const r=i.clone();return r.dictionary=t,r});return new $(e)}return new Bi(this)}unmemoize(){if(S.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const r=i.clone();return r.dictionary=t,r});return new $(e)}return this}}Ua=Symbol.toStringTag;$[Ua]=(n=>{n.type=S.prototype,n.data=[],n.length=0,n.stride=1,n.numChildren=0,n._nullCount=-1,n._byteLength=-1,n._offsets=new Uint32Array([0]),n[Symbol.isConcatSpreadable]=!0;const t=Object.keys(u).map(e=>u[e]).filter(e=>typeof e=="number"&&e!==u.NONE);for(const e of t){const i=Ft.getVisitFnByTypeId(e),r=Vt.getVisitFnByTypeId(e),s=Ii.getVisitFnByTypeId(e),o=ie.getVisitFnByTypeId(e);Va[e]={get:i,set:r,indexOf:s,byteLength:o},$a[e]=Object.create(n,{isValid:{value:ln(is)},get:{value:ln(Ft.getVisitFnByTypeId(e))},set:{value:La(Vt.getVisitFnByTypeId(e))},indexOf:{value:Ea(Ii.getVisitFnByTypeId(e))},getByteLength:{value:ln(ie.getVisitFnByTypeId(e))}})}return"Vector"})($.prototype);class Bi extends ${constructor(t){super(t.data);const e=this.get,i=this.set,r=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Bi(r.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new $(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class Br{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,i,r){return t.prep(8,24),t.writeInt64(r),t.pad(4),t.writeInt32(i),t.writeInt64(e),t.offset()}}const dr=2,Jt=4,ue=4,J=4,ge=new Int32Array(2),Es=new Float32Array(ge.buffer),Rs=new Float64Array(ge.buffer),Xn=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;let he=class Or{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Or.ZERO:new Or(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};he.ZERO=new he(0,0);var Fr;(function(n){n[n.UTF8_BYTES=1]="UTF8_BYTES",n[n.UTF16_STRING=2]="UTF16_STRING"})(Fr||(Fr={}));let hn=class Pa{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new Pa(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 he(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new he(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return ge[0]=this.readInt32(t),Es[0]}readFloat64(t){return ge[Xn?0:1]=this.readInt32(t),ge[Xn?1:0]=this.readInt32(t+4),Rs[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){Es[0]=e,this.writeInt32(t,ge[0])}writeFloat64(t,e){Rs[0]=e,this.writeInt32(t,ge[Xn?0:1]),this.writeInt32(t+4,ge[Xn?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+Jt+ue)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<ue;e++)t+=String.fromCharCode(this.readInt8(this.position_+Jt+e));return t}__offset(t,e){const i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+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 i=this.readInt32(t);let r="",s=0;if(t+=Jt,e===Fr.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){let o;const a=this.readUint8(t+s++);if(a<192)o=a;else{const l=this.readUint8(t+s++);if(a<224)o=(a&31)<<6|l&63;else{const c=this.readUint8(t+s++);if(a<240)o=(a&15)<<12|(l&63)<<6|c&63;else{const d=this.readUint8(t+s++);o=(a&7)<<18|(l&63)<<12|(c&63)<<6|d&63}}}o<65536?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return r}__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)+Jt}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=ue)throw new Error("FlatBuffers: file identifier must be length "+ue);for(let e=0;e<ue;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+Jt+e))return!1;return!0}createLong(t,e){return he.create(t,e)}createScalarList(t,e){const i=[];for(let r=0;r<e;++r)t(r)!==null&&i.push(t(r));return i}createObjList(t,e){const i=[];for(let r=0;r<e;++r){const s=t(r);s!==null&&i.push(s.unpack())}return i}},ja=class za{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=hn.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 i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<i+t+e;){const r=this.bb.capacity();this.bb=za.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}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,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,i){(this.force_defaults||!e.equals(i))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,i){e!=i&&(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 i=e<<1,r=hn.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r}addOffset(t){this.prep(Jt,0),this.writeInt32(this.offset()-t+Jt)}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 i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const r=2;this.addInt16(t-this.object_start);const s=(i+r)*dr;this.addInt16(s);let o=0;const a=this.space;t:for(e=0;e<this.vtables.length;e++){const l=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(l)){for(let c=dr;c<s;c+=dr)if(this.bb.readInt16(a+c)!=this.bb.readInt16(l+c))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,i){const r=i?J:0;if(e){const s=e;if(this.prep(this.minalign,Jt+ue+r),s.length!=ue)throw new Error("FlatBuffers: file identifier must be length "+ue);for(let o=ue-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,Jt+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(this.bb.readInt16(r+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(Jt,t*e),this.prep(i,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 i=0;for(;i<t.length;){let r;const s=t.charCodeAt(i++);if(s<55296||s>=56320)r=s;else{const o=t.charCodeAt(i++);r=(s<<10)+o+-56613888}r<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(r&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let i=0,r=this.space,s=this.bb.bytes();i<e.length;i++)s[r++]=e[i];return this.endVector()}createLong(t,e){return he.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let i=0;i<t.length;++i){const r=t[i];if(r!==null)e.push(this.createObjectOffset(r));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 ct{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 ct).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+J),(e||new ct).__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,i){return ct.startKeyValue(t),ct.addKey(t,e),ct.addValue(t,i),ct.endKeyValue(t)}}var fn;(function(n){n[n.V1=0]="V1",n[n.V2=1]="V2",n[n.V3=2]="V3",n[n.V4=3]="V4",n[n.V5=4]="V5"})(fn||(fn={}));var pn;(function(n){n[n.Little=0]="Little",n[n.Big=1]="Big"})(pn||(pn={}));var Oi;(function(n){n[n.DenseArray=0]="DenseArray"})(Oi||(Oi={}));class Tt{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 Tt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+J),(e||new Tt).__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,i){return Tt.startInt(t),Tt.addBitWidth(t,e),Tt.addIsSigned(t,i),Tt.endInt(t)}}class de{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 de).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+J),(e||new de).__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 Tt).__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):Oi.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,Oi.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}class Re{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 Re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+J),(e||new Re).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return Re.startBinary(t),Re.endBinary(t)}}class Ce{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 Ce).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+J),(e||new Ce).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return Ce.startBool(t),Ce.endBool(t)}}var Fi;(function(n){n[n.DAY=0]="DAY",n[n.MILLISECOND=1]="MILLISECOND"})(Fi||(Fi={}));let ii=class Qe{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 Qe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+J),(e||new Qe).__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):Fi.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Fi.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return Qe.startDate(t),Qe.addUnit(t,e),Qe.endDate(t)}};class gt{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 gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+J),(e||new gt).__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,i,r){return gt.startDecimal(t),gt.addPrecision(t,e),gt.addScale(t,i),gt.addBitWidth(t,r),gt.endDecimal(t)}}var yn;(function(n){n[n.SECOND=0]="SECOND",n[n.MILLISECOND=1]="MILLISECOND",n[n.MICROSECOND=2]="MICROSECOND",n[n.NANOSECOND=3]="NANOSECOND"})(yn||(yn={}));class Kt{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 Kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+J),(e||new Kt).__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 Kt.startFixedSizeBinary(t),Kt.addByteWidth(t,e),Kt.endFixedSizeBinary(t)}}class Zt{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 Zt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+J),(e||new Zt).__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 Zt.startFixedSizeList(t),Zt.addListSize(t,e),Zt.endFixedSizeList(t)}}var Ai;(function(n){n[n.HALF=0]="HALF",n[n.SINGLE=1]="SINGLE",n[n.DOUBLE=2]="DOUBLE"})(Ai||(Ai={}));class Xt{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 Xt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+J),(e||new Xt).__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):Ai.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Ai.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return Xt.startFloatingPoint(t),Xt.addPrecision(t,e),Xt.endFloatingPoint(t)}}var Di;(function(n){n[n.YEAR_MONTH=0]="YEAR_MONTH",n[n.DAY_TIME=1]="DAY_TIME",n[n.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Di||(Di={}));class Qt{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 Qt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+J),(e||new Qt).__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):Di.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Di.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return Qt.startInterval(t),Qt.addUnit(t,e),Qt.endInterval(t)}}class ke{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 ke).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+J),(e||new ke).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return ke.startList(t),ke.endList(t)}}let ri=class tn{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 tn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+J),(e||new tn).__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 tn.startMap(t),tn.addKeysSorted(t,e),tn.endMap(t)}};class Ue{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 Ue).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+J),(e||new Ue).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return Ue.startNull(t),Ue.endNull(t)}}class Ve{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 Ve).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+J),(e||new Ve).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return Ve.startStruct_(t),Ve.endStruct_(t)}}class kt{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 kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+J),(e||new kt).__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):yn.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,yn.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,i){return kt.startTime(t),kt.addUnit(t,e),kt.addBitWidth(t,i),kt.endTime(t)}}class Ut{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 Ut).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+J),(e||new Ut).__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):yn.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,yn.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,i){return Ut.startTimestamp(t),Ut.addUnit(t,e),Ut.addTimezone(t,i),Ut.endTimestamp(t)}}var Ti;(function(n){n[n.Sparse=0]="Sparse",n[n.Dense=1]="Dense"})(Ti||(Ti={}));class _t{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 _t).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+J),(e||new _t).__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):Ti.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,Ti.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addInt32(e[i]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,i){return _t.startUnion(t),_t.addMode(t,e),_t.addTypeIds(t,i),_t.endUnion(t)}}class $e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new $e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+J),(e||new $e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return $e.startUtf8(t),$e.endUtf8(t)}}var Q;(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.FloatingPoint=3]="FloatingPoint",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct_=13]="Struct_",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Duration=18]="Duration",n[n.LargeBinary=19]="LargeBinary",n[n.LargeUtf8=20]="LargeUtf8",n[n.LargeList=21]="LargeList"})(Q||(Q={}));let Rt=class si{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 si).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+J),(e||new si).__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):Q.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 de).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const i=this.bb.__offset(this.bb_pos,14);return i?(e||new si).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,16);return i?(e||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,Q.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},Yt=class oe{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 oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+J),(e||new oe).__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):pn.Little}fields(t,e){const i=this.bb.__offset(this.bb_pos,6);return i?(e||new Rt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,8);return i?(e||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,pn.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addInt64(e[i]);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,i,r,s){return oe.startSchema(t),oe.addEndianness(t,e),oe.addFields(t,i),oe.addCustomMetadata(t,r),oe.addFeatures(t,s),oe.endSchema(t)}};class Dt{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 Dt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+J),(e||new Dt).__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):fn.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Yt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new Br).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,10);return i?(e||new Br).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,fn.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 P{constructor(t=[],e,i){this.fields=t||[],this.metadata=e||new Map,i||(i=Ar(t)),this.dictionaries=i}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),i=this.fields.filter(r=>e.has(r.name));return new P(i,this.metadata)}selectAt(t){const e=t.map(i=>this.fields[i]).filter(Boolean);return new P(e,this.metadata)}assign(...t){const e=t[0]instanceof P?t[0]:Array.isArray(t[0])?new P(t[0]):new P(t),i=[...this.fields],r=Qn(Qn(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const l=i.findIndex(c=>c.name===a.name);return~l?(i[l]=a.clone({metadata:Qn(Qn(new Map,i[l].metadata),a.metadata)}))&&!1:!0}),o=Ar(s,new Map);return new P([...i,...s],r,new Map([...this.dictionaries,...o]))}}P.prototype.fields=null;P.prototype.metadata=null;P.prototype.dictionaries=null;class X{constructor(t,e,i=!1,r){this.name=t,this.type=e,this.nullable=i,this.metadata=r||new Map}static new(...t){let[e,i,r,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],i===void 0&&(i=t[0].type),r===void 0&&(r=t[0].nullable),s===void 0&&(s=t[0].metadata)),new X(`${e}`,i,r,s)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,i,r,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,i=this.type,r=this.nullable,s=this.metadata]=t:{name:e=this.name,type:i=this.type,nullable:r=this.nullable,metadata:s=this.metadata}=t[0],X.new(e,i,r,s)}}X.prototype.type=null;X.prototype.name=null;X.prototype.nullable=null;X.prototype.metadata=null;function Qn(n,t){return new Map([...n||new Map,...t||new Map])}function Ar(n,t=new Map){for(let e=-1,i=n.length;++e<i;){const s=n[e].type;if(S.isDictionary(s)){if(!t.has(s.id))t.set(s.id,s.dictionary);else if(t.get(s.id)!==s.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}s.children&&s.children.length>0&&Ar(s.children,t)}return t}var Cs=he,Yu=ja,Gu=hn;class Vn{constructor(t,e=Nt.V4,i,r){this.schema=t,this.version=e,i&&(this._recordBatches=i),r&&(this._dictionaryBatches=r)}static decode(t){t=new Gu(C(t));const e=Dt.getRootAsFooter(t),i=P.decode(e.schema());return new Hu(i,e)}static encode(t){const e=new Yu,i=P.encode(e,t.schema);Dt.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())Ae.encode(e,o);const r=e.endVector();Dt.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())Ae.encode(e,o);const s=e.endVector();return Dt.startFooter(e),Dt.addSchema(e,i),Dt.addVersion(e,Nt.V4),Dt.addRecordBatches(e,r),Dt.addDictionaries(e,s),Dt.finishFooterBuffer(e,Dt.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,e=-1,i=this.numRecordBatches;++e<i;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,i=this.numDictionaries;++e<i;)(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 Hu extends Vn{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 Ae.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t);if(e)return Ae.decode(e)}return null}}class Ae{constructor(t,e,i){this.metaDataLength=t,this.offset=typeof i=="number"?i:i.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new Ae(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:i}=e,r=new Cs(e.offset,0),s=new Cs(e.bodyLength,0);return Br.createBlock(t,r,i,s)}}const tt=Object.freeze({done:!0,value:void 0});class ks{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class ss{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 qu extends ss{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return w(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(tt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Ct.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Ct.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return w(this,void 0,void 0,function*(){return yield this.abort(t),tt})}return(t){return w(this,void 0,void 0,function*(){return yield this.close(),tt})}read(t){return w(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return w(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,i)=>{this.resolvers.push({resolve:e,reject:i})}):Promise.resolve(tt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class oi extends qu{write(t){if((t=C(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?gr(this.toUint8Array(!0)):this.toUint8Array(!1).then(gr)}toUint8Array(t=!1){return t?ne(this._values)[0]:w(this,void 0,void 0,function*(){var e,i;const r=[];let s=0;try{for(var o=Pe(this),a;a=yield o.next(),!a.done;){const l=a.value;r.push(l),s+=l.byteLength}}catch(l){e={error:l}}finally{try{a&&!a.done&&(i=o.return)&&(yield i.call(o))}finally{if(e)throw e.error}}return ne(r,s)[0]})}}class Ni{constructor(t){t&&(this.source=new Ju(Ct.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 mn{constructor(t){t instanceof mn?this.source=t.source:t instanceof oi?this.source=new Le(Ct.fromAsyncIterable(t)):Oo(t)?this.source=new Le(Ct.fromNodeStream(t)):Yr(t)?this.source=new Le(Ct.fromDOMStream(t)):Bo(t)?this.source=new Le(Ct.fromDOMStream(t.body)):Gn(t)?this.source=new Le(Ct.fromIterable(t)):Ie(t)?this.source=new Le(Ct.fromAsyncIterable(t)):gn(t)&&(this.source=new Le(Ct.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 Ju{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)||tt)}return(t){return Object.create(this.source.return&&this.source.return(t)||tt)}}class Le{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return w(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return w(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return w(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return w(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return w(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||tt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return w(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||tt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class Us extends Ni{constructor(t,e){super(),this.position=0,this.buffer=C(t),this.size=typeof e>"u"?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:i}=this.readAt(t,4);return new DataView(e,i).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:e,size:i,position:r}=this;return e&&r<i?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(i,r+Math.min(i-r,t)),e.subarray(r,this.position)):null}readAt(t,e){const i=this.buffer,r=Math.min(this.size,t+e);return i?i.subarray(t,r):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 xi extends mn{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=w(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return w(this,void 0,void 0,function*(){const{buffer:e,byteOffset:i}=yield this.readAt(t,4);return new DataView(e,i).getInt32(0,!0)})}seek(t){return w(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 w(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:e,size:i,position:r}=this;if(e&&r<i){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let s=r,o=0,a=0;const l=Math.min(i,s+Math.min(i-s,t)),c=new Uint8Array(Math.max(0,(this.position=l)-s));for(;(s+=a)<l&&(o+=a)<c.byteLength;)({bytesRead:a}=yield e.read(c,o,c.byteLength-o,s));return c}return null})}readAt(t,e){return w(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:i,size:r}=this;if(i&&t+e<r){const s=Math.min(r,t+e),o=new Uint8Array(s-t);return(yield i.read(o,0,e,t)).buffer}return new Uint8Array(e)})}close(){return w(this,void 0,void 0,function*(){const t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return w(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return w(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}const Ku=65536;function nn(n){return n<0&&(n=4294967295+n+1),`0x${n.toString(16)}`}const vn=8,os=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Wa{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let r=e[3]*i[3];this.buffer[0]=r&65535;let s=r>>>16;return r=e[2]*i[3],s+=r,r=e[3]*i[2]>>>0,s+=r,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0<r?Ku:0,this.buffer[1]+=s>>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[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`${nn(this.buffer[1])} ${nn(this.buffer[0])}`}}class z extends Wa{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return z.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return z.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const i=t.length,r=new z(e);for(let s=0;s<i;){const o=vn<i-s?vn:i-s,a=new z(new Uint32Array([Number.parseInt(t.slice(s,s+o),10),0])),l=new z(new Uint32Array([os[o],0]));r.times(l),r.plus(a),s+=o}return r}static convertArray(t){const e=new Uint32Array(t.length*2);for(let i=-1,r=t.length;++i<r;)z.from(t[i],new Uint32Array(e.buffer,e.byteOffset+2*i*4,2));return e}static multiply(t,e){return new z(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new z(new Uint32Array(t.buffer)).plus(e)}}class bt extends Wa{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){const e=this.buffer[1]<<0,i=t.buffer[1]<<0;return e<i||e===i&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return bt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return bt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const i=t.startsWith("-"),r=t.length,s=new bt(e);for(let o=i?1:0;o<r;){const a=vn<r-o?vn:r-o,l=new bt(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0])),c=new bt(new Uint32Array([os[a],0]));s.times(c),s.plus(l),o+=a}return i?s.negate():s}static convertArray(t){const e=new Uint32Array(t.length*2);for(let i=-1,r=t.length;++i<r;)bt.from(t[i],new Uint32Array(e.buffer,e.byteOffset+2*i*4,2));return e}static multiply(t,e){return new bt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new bt(new Uint32Array(t.buffer)).plus(e)}}class Gt{constructor(t){this.buffer=t}high(){return new bt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new bt(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 z(new Uint32Array([this.buffer[3],0])),i=new z(new Uint32Array([this.buffer[2],0])),r=new z(new Uint32Array([this.buffer[1],0])),s=new z(new Uint32Array([this.buffer[0],0])),o=new z(new Uint32Array([t.buffer[3],0])),a=new z(new Uint32Array([t.buffer[2],0])),l=new z(new Uint32Array([t.buffer[1],0])),c=new z(new Uint32Array([t.buffer[0],0]));let d=z.multiply(s,c);this.buffer[0]=d.low();const h=new z(new Uint32Array([d.high(),0]));return d=z.multiply(r,c),h.plus(d),d=z.multiply(s,l),h.plus(d),this.buffer[1]=h.low(),this.buffer[3]=h.lessThan(d)?1:0,this.buffer[2]=h.high(),new z(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(z.multiply(i,c)).plus(z.multiply(r,l)).plus(z.multiply(s,a)),this.buffer[3]+=z.multiply(e,c).plus(z.multiply(i,l)).plus(z.multiply(r,a)).plus(z.multiply(s,o)).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`${nn(this.buffer[3])} ${nn(this.buffer[2])} ${nn(this.buffer[1])} ${nn(this.buffer[0])}`}static multiply(t,e){return new Gt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Gt(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Gt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Gt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),r=t.length,s=new Gt(e);for(let o=i?1:0;o<r;){const a=vn<r-o?vn:r-o,l=new Gt(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0,0,0])),c=new Gt(new Uint32Array([os[a],0,0,0]));s.times(c),s.plus(l),o+=a}return i?s.negate():s}static convertArray(t){const e=new Uint32Array(t.length*4);for(let i=-1,r=t.length;++i<r;)Gt.from(t[i],new Uint32Array(e.buffer,e.byteOffset+4*4*i,4));return e}}class Ya extends R{constructor(t,e,i,r){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=i,this.dictionaries=r}visit(t){return super.visit(t instanceof X?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return E({type:t,length:e})}visitBool(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitInt(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitDate(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitTime(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitList(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===Mt.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:i}=this.nextFieldNode()){return E({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),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,i=this.nextBufferRange()){return e>0&&this.readData(t,i)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class Zu extends Ya{constructor(t,e,i,r){super(new Uint8Array(0),e,i,r),this.sources=t}readNullBitmap(t,e,{offset:i}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Si(this.sources[i])}readOffsets(t,{offset:e}=this.nextBufferRange()){return q(Uint8Array,q(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return q(Uint8Array,q(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:i}=this;return S.isTimestamp(t)||(S.isInt(t)||S.isTime(t))&&t.bitWidth===64||S.isDate(t)&&t.unit===pe.MILLISECOND?q(Uint8Array,bt.convertArray(i[e])):S.isDecimal(t)?q(Uint8Array,Gt.convertArray(i[e])):S.isBinary(t)||S.isFixedSizeBinary(t)?Xu(i[e]):S.isBool(t)?Si(i[e]):S.isUtf8(t)?Wr(i[e].join("")):q(Uint8Array,q(t.ArrayType,i[e].map(r=>+r)))}}function Xu(n){const t=n.join(""),e=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)e[i>>1]=Number.parseInt(t.slice(i,i+2),16);return e}class F extends R{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((i,r)=>this.compareFields(i,e[r]))}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 At(n,t){return t instanceof n.constructor}function Hn(n,t){return n===t||At(n,t)}function ve(n,t){return n===t||At(n,t)&&n.bitWidth===t.bitWidth&&n.isSigned===t.isSigned}function er(n,t){return n===t||At(n,t)&&n.precision===t.precision}function Qu(n,t){return n===t||At(n,t)&&n.byteWidth===t.byteWidth}function as(n,t){return n===t||At(n,t)&&n.unit===t.unit}function qn(n,t){return n===t||At(n,t)&&n.unit===t.unit&&n.timezone===t.timezone}function Jn(n,t){return n===t||At(n,t)&&n.unit===t.unit&&n.bitWidth===t.bitWidth}function td(n,t){return n===t||At(n,t)&&n.children.length===t.children.length&&De.compareManyFields(n.children,t.children)}function ed(n,t){return n===t||At(n,t)&&n.children.length===t.children.length&&De.compareManyFields(n.children,t.children)}function ls(n,t){return n===t||At(n,t)&&n.mode===t.mode&&n.typeIds.every((e,i)=>e===t.typeIds[i])&&De.compareManyFields(n.children,t.children)}function nd(n,t){return n===t||At(n,t)&&n.id===t.id&&n.isOrdered===t.isOrdered&&De.visit(n.indices,t.indices)&&De.visit(n.dictionary,t.dictionary)}function cs(n,t){return n===t||At(n,t)&&n.unit===t.unit}function id(n,t){return n===t||At(n,t)&&n.listSize===t.listSize&&n.children.length===t.children.length&&De.compareManyFields(n.children,t.children)}function rd(n,t){return n===t||At(n,t)&&n.keysSorted===t.keysSorted&&n.children.length===t.children.length&&De.compareManyFields(n.children,t.children)}F.prototype.visitNull=Hn;F.prototype.visitBool=Hn;F.prototype.visitInt=ve;F.prototype.visitInt8=ve;F.prototype.visitInt16=ve;F.prototype.visitInt32=ve;F.prototype.visitInt64=ve;F.prototype.visitUint8=ve;F.prototype.visitUint16=ve;F.prototype.visitUint32=ve;F.prototype.visitUint64=ve;F.prototype.visitFloat=er;F.prototype.visitFloat16=er;F.prototype.visitFloat32=er;F.prototype.visitFloat64=er;F.prototype.visitUtf8=Hn;F.prototype.visitBinary=Hn;F.prototype.visitFixedSizeBinary=Qu;F.prototype.visitDate=as;F.prototype.visitDateDay=as;F.prototype.visitDateMillisecond=as;F.prototype.visitTimestamp=qn;F.prototype.visitTimestampSecond=qn;F.prototype.visitTimestampMillisecond=qn;F.prototype.visitTimestampMicrosecond=qn;F.prototype.visitTimestampNanosecond=qn;F.prototype.visitTime=Jn;F.prototype.visitTimeSecond=Jn;F.prototype.visitTimeMillisecond=Jn;F.prototype.visitTimeMicrosecond=Jn;F.prototype.visitTimeNanosecond=Jn;F.prototype.visitDecimal=Hn;F.prototype.visitList=td;F.prototype.visitStruct=ed;F.prototype.visitUnion=ls;F.prototype.visitDenseUnion=ls;F.prototype.visitSparseUnion=ls;F.prototype.visitDictionary=nd;F.prototype.visitInterval=cs;F.prototype.visitIntervalDayTime=cs;F.prototype.visitIntervalYearMonth=cs;F.prototype.visitFixedSizeList=id;F.prototype.visitMap=rd;const De=new F;function Dr(n,t){return De.compareSchemas(n,t)}function hr(n,t){return sd(n,t.map(e=>e.data.concat()))}function sd(n,t){const e=[...n.fields],i=[],r={numBatches:t.reduce((h,y)=>Math.max(h,y.length),0)};let s=0,o=0,a=-1;const l=t.length;let c,d=[];for(;r.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<l;)d[a]=c=t[a].shift(),o=Math.min(o,c?c.length:o);Number.isFinite(o)&&(d=od(e,o,d,t,r),o>0&&(i[s++]=E({type:new yt(e),length:o,nullCount:0,children:d.slice()})))}return[n=n.assign(e),i.map(h=>new wt(n,h))]}function od(n,t,e,i,r){var s;const o=(t+63&-64)>>3;for(let a=-1,l=i.length;++a<l;){const c=e[a],d=c?.length;if(d>=t)d===t?e[a]=c:(e[a]=c.slice(0,t),r.numBatches=Math.max(r.numBatches,i[a].unshift(c.slice(t,d-t))));else{const h=n[a];n[a]=h.clone({nullable:!0}),e[a]=(s=c?._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:E({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var Ga;class pt{constructor(...t){var e,i;if(t.length===0)return this.batches=[],this.schema=new P([]),this._offsets=[0],this;let r,s;t[0]instanceof P&&(r=t.shift()),t[t.length-1]instanceof Uint32Array&&(s=t.pop());const o=l=>{if(l){if(l instanceof wt)return[l];if(l instanceof pt)return l.batches;if(l instanceof K){if(l.type instanceof yt)return[new wt(new P(l.type.children),l)]}else{if(Array.isArray(l))return l.flatMap(c=>o(c));if(typeof l[Symbol.iterator]=="function")return[...l].flatMap(c=>o(c));if(typeof l=="object"){const c=Object.keys(l),d=c.map(_=>new $([l[_]])),h=new P(c.map((_,G)=>new X(String(_),d[G].type))),[,y]=hr(h,d);return y.length===0?[new wt(l)]:y}}}return[]},a=t.flatMap(l=>o(l));if(r=(i=r??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&i!==void 0?i:new P([]),!(r instanceof P))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof wt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Dr(r,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=r,this.batches=a,this._offsets=s??xa(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=Na(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?rs.visit(new $(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
  ${this.toArray().join(`,
  `)}
]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:r})=>r));return new pt(e,i.map(r=>new wt(e,r)))}slice(t,e){const i=this.schema;[t,e]=Da({length:this.numRows},t,e);const r=Ma(this.data,this._offsets,t,e);return new pt(i,r.map(s=>new wt(i,s)))}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(i=>i.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],r=E({type:i,length:0,nullCount:0});e.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new $(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(r=>r.name===t),e)}setChildAt(t,e){let i=this.schema,r=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new $([E({type:new Oe,length:this.numRows})]));const s=i.fields.slice(),o=s[t].clone({type:e.type}),a=this.schema.fields.map((l,c)=>this.getChildAt(c));[s[t],a[t]]=[o,e],[i,r]=hr(i,a)}return new pt(i,r)}select(t){const e=this.schema.fields.reduce((i,r,s)=>i.set(r.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(r=>r.selectAt(t));return new pt(e,i)}assign(t){const e=this.schema.fields,[i,r]=t.schema.fields.reduce((a,l,c)=>{const[d,h]=a,y=e.findIndex(_=>_.name===l.name);return~y?h[y]=c:d.push(c),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,r[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new pt(...hr(s,o))}}Ga=Symbol.toStringTag;pt[Ga]=(n=>(n.schema=null,n.batches=[],n._offsets=new Uint32Array([0]),n._nullCount=-1,n[Symbol.isConcatSpreadable]=!0,n.isValid=ln(is),n.get=ln(Ft.getVisitFn(u.Struct)),n.set=La(Vt.getVisitFn(u.Struct)),n.indexOf=Ea(Ii.getVisitFn(u.Struct)),n.getByteLength=ln(ie.getVisitFn(u.Struct)),"Table"))(pt.prototype);var Ha;let wt=class Fn{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof P))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=E({nullCount:0,type:new yt(this.schema.fields),children:this.schema.fields.map(e=>E({type:e.type,nullCount:0}))})]=t,!(this.data instanceof K))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Vs(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:r,length:s}=Object.keys(e).reduce((l,c,d)=>(l.children[d]=e[c],l.length=Math.max(l.length,e[c].length),l.fields[d]=X.new({name:c,type:e[c].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new P(i),a=E({type:new yt(i),length:s,children:r,nullCount:0});[this.schema,this.data]=Vs(o,a.children,s);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=qa(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 Ft.visit(this.data,t)}set(t,e){return Vt.visit(this.data,t,e)}indexOf(t,e){return Ii.visit(this.data,t,e)}getByteLength(t){return ie.visit(this.data,t)}[Symbol.iterator](){return rs.visit(new $([this.data]))}toArray(){return[...this]}concat(...t){return new pt(this.schema,[this,...t])}slice(t,e){const[i]=new $([this.data]).slice(t,e).data;return new Fn(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new $([this.data.children[t]]):null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(r=>r.name===t),e)}setChildAt(t,e){let i=this.schema,r=this.data;if(t>-1&&t<this.numCols){e||(e=new $([E({type:new Oe,length:this.numRows})]));const s=i.fields.slice(),o=r.children.slice(),a=s[t].clone({type:e.type});[s[t],o[t]]=[a,e.data[0]],i=new P(s,new Map(this.schema.metadata)),r=E({type:new yt(s),children:o})}return new Fn(i,r)}select(t){const e=this.schema.select(t),i=new yt(e.fields),r=[];for(const s of t){const o=this.schema.fields.findIndex(a=>a.name===s);~o&&(r[o]=this.data.children[o])}return new Fn(e,E({type:i,length:this.numRows,children:r}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),r=E({type:new yt(e.fields),length:this.numRows,children:i});return new Fn(e,r)}};Ha=Symbol.toStringTag;wt[Ha]=(n=>(n._nullCount=-1,n[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(wt.prototype);function Vs(n,t,e=t.reduce((i,r)=>Math.max(i,r.length),0)){var i;const r=[...n.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of n.fields.entries()){const c=t[a];(!c||c.length!==e)&&(r[a]=l.clone({nullable:!0}),s[a]=(i=c?._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:E({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[n.assign(r),E({type:new yt(r),length:e,children:s})]}function qa(n,t,e=new Map){for(let i=-1,r=n.length;++i<r;){const o=n[i].type,a=t[i];if(S.isDictionary(o)){if(!e.has(o.id))a.dictionary&&e.set(o.id,a.dictionary);else if(e.get(o.id)!==a.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&qa(o.children,a.children,e)}return e}class us extends wt{constructor(t){const e=t.fields.map(r=>E({type:r.type})),i=E({type:new yt(t.fields),nullCount:0,children:e});super(t,i)}}var Mi;(function(n){n[n.BUFFER=0]="BUFFER"})(Mi||(Mi={}));var Li;(function(n){n[n.LZ4_FRAME=0]="LZ4_FRAME",n[n.ZSTD=1]="ZSTD"})(Li||(Li={}));class _e{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 _e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+J),(e||new _e).__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):Li.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Mi.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,Li.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Mi.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,i){return _e.startBodyCompression(t),_e.addCodec(t,e),_e.addMethod(t,i),_e.endBodyCompression(t)}}class Ja{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,i){return t.prep(8,16),t.writeInt64(i),t.writeInt64(e),t.offset()}}let Ka=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,i){return t.prep(8,16),t.writeInt64(i),t.writeInt64(e),t.offset()}},ce=class Tr{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 Tr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+J),(e||new Tr).__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 i=this.bb.__offset(this.bb_pos,6);return i?(e||new Ka).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,8);return i?(e||new Ja).__init(this.bb.__vector(this.bb_pos+i)+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 _e).__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()}},en=class Nr{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 Nr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+J),(e||new Nr).__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 ce).__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 Ei;(function(n){n[n.NONE=0]="NONE",n[n.Schema=1]="Schema",n[n.DictionaryBatch=2]="DictionaryBatch",n[n.RecordBatch=3]="RecordBatch",n[n.Tensor=4]="Tensor",n[n.SparseTensor=5]="SparseTensor"})(Ei||(Ei={}));let be=class Wt{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 Wt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+J),(e||new Wt).__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):fn.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Ei.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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,fn.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,Ei.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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,i,r,s,o){return Wt.startMessage(t),Wt.addVersion(t,e),Wt.addHeaderType(t,i),Wt.addHeader(t,r),Wt.addBodyLength(t,s),Wt.addCustomMetadata(t,o),Wt.endMessage(t)}};var ad=he;class ld extends R{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return Ue.startNull(e),Ue.endNull(e)}visitInt(t,e){return Tt.startInt(e),Tt.addBitWidth(e,t.bitWidth),Tt.addIsSigned(e,t.isSigned),Tt.endInt(e)}visitFloat(t,e){return Xt.startFloatingPoint(e),Xt.addPrecision(e,t.precision),Xt.endFloatingPoint(e)}visitBinary(t,e){return Re.startBinary(e),Re.endBinary(e)}visitBool(t,e){return Ce.startBool(e),Ce.endBool(e)}visitUtf8(t,e){return $e.startUtf8(e),$e.endUtf8(e)}visitDecimal(t,e){return gt.startDecimal(e),gt.addScale(e,t.scale),gt.addPrecision(e,t.precision),gt.addBitWidth(e,t.bitWidth),gt.endDecimal(e)}visitDate(t,e){return ii.startDate(e),ii.addUnit(e,t.unit),ii.endDate(e)}visitTime(t,e){return kt.startTime(e),kt.addUnit(e,t.unit),kt.addBitWidth(e,t.bitWidth),kt.endTime(e)}visitTimestamp(t,e){const i=t.timezone&&e.createString(t.timezone)||void 0;return Ut.startTimestamp(e),Ut.addUnit(e,t.unit),i!==void 0&&Ut.addTimezone(e,i),Ut.endTimestamp(e)}visitInterval(t,e){return Qt.startInterval(e),Qt.addUnit(e,t.unit),Qt.endInterval(e)}visitList(t,e){return ke.startList(e),ke.endList(e)}visitStruct(t,e){return Ve.startStruct_(e),Ve.endStruct_(e)}visitUnion(t,e){_t.startTypeIdsVector(e,t.typeIds.length);const i=_t.createTypeIdsVector(e,t.typeIds);return _t.startUnion(e),_t.addMode(e,t.mode),_t.addTypeIds(e,i),_t.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return de.startDictionaryEncoding(e),de.addId(e,new ad(t.id,0)),de.addIsOrdered(e,t.isOrdered),i!==void 0&&de.addIndexType(e,i),de.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return Kt.startFixedSizeBinary(e),Kt.addByteWidth(e,t.byteWidth),Kt.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Zt.startFixedSizeList(e),Zt.addListSize(e,t.listSize),Zt.endFixedSizeList(e)}visitMap(t,e){return ri.startMap(e),ri.addKeysSorted(e,t.keysSorted),ri.endMap(e)}}const fr=new ld;function cd(n,t=new Map){return new P(dd(n,t),ai(n.customMetadata),t)}function Za(n){return new Lt(n.count,Xa(n.columns),Qa(n.columns))}function ud(n){return new re(Za(n.data),n.id,n.isDelta)}function dd(n,t){return(n.fields||[]).filter(Boolean).map(e=>X.fromJSON(e,t))}function $s(n,t){return(n.children||[]).filter(Boolean).map(e=>X.fromJSON(e,t))}function Xa(n){return(n||[]).reduce((t,e)=>[...t,new Ye(e.count,hd(e.VALIDITY)),...Xa(e.children)],[])}function Qa(n,t=[]){for(let e=-1,i=(n||[]).length;++e<i;){const r=n[e];r.VALIDITY&&t.push(new ee(t.length,r.VALIDITY.length)),r.TYPE&&t.push(new ee(t.length,r.TYPE.length)),r.OFFSET&&t.push(new ee(t.length,r.OFFSET.length)),r.DATA&&t.push(new ee(t.length,r.DATA.length)),t=Qa(r.children,t)}return t}function hd(n){return(n||[]).reduce((t,e)=>t+ +(e===0),0)}function fd(n,t){let e,i,r,s,o,a;return!t||!(s=n.dictionary)?(o=js(n,$s(n,t)),r=new X(n.name,o,n.nullable,ai(n.customMetadata))):t.has(e=s.id)?(i=(i=s.indexType)?Ps(i):new Cn,a=new dn(t.get(e),i,e,s.isOrdered),r=new X(n.name,a,n.nullable,ai(n.customMetadata))):(i=(i=s.indexType)?Ps(i):new Cn,t.set(e,o=js(n,$s(n,t))),a=new dn(o,i,e,s.isOrdered),r=new X(n.name,a,n.nullable,ai(n.customMetadata))),r||null}function ai(n){return new Map(Object.entries(n||{}))}function Ps(n){return new Fe(n.isSigned,n.bitWidth)}function js(n,t){const e=n.type.name;switch(e){case"NONE":return new Oe;case"null":return new Oe;case"binary":return new ui;case"utf8":return new di;case"bool":return new hi;case"list":return new vi((t||[])[0]);case"struct":return new yt(t||[]);case"struct_":return new yt(t||[])}switch(e){case"int":{const i=n.type;return new Fe(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=n.type;return new kn(Bt[i.precision])}case"decimal":{const i=n.type;return new fi(i.scale,i.precision,i.bitWidth)}case"date":{const i=n.type;return new pi(pe[i.unit])}case"time":{const i=n.type;return new Un(k[i.unit],i.bitWidth)}case"timestamp":{const i=n.type;return new yi(k[i.unit],i.timezone)}case"interval":{const i=n.type;return new mi(Be[i.unit])}case"union":{const i=n.type;return new bi(Mt[i.mode],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=n.type;return new gi(i.byteWidth)}case"fixedsizelist":{const i=n.type;return new _i(i.listSize,(t||[])[0])}case"map":{const i=n.type;return new wi((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var ze=he,pd=ja,yd=hn;class mt{constructor(t,e,i,r){this._version=e,this._headerType=i,this.body=new Uint8Array(0),r&&(this._createHeader=()=>r),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){const i=new mt(0,Nt.V4,e);return i._createHeader=md(t,e),i}static decode(t){t=new yd(C(t));const e=be.getRootAsMessage(t),i=e.bodyLength(),r=e.version(),s=e.headerType(),o=new mt(i,r,s);return o._createHeader=vd(e,s),o}static encode(t){const e=new pd;let i=-1;return t.isSchema()?i=P.encode(e,t.header()):t.isRecordBatch()?i=Lt.encode(e,t.header()):t.isDictionaryBatch()&&(i=re.encode(e,t.header())),be.startMessage(e),be.addVersion(e,Nt.V4),be.addHeader(e,i),be.addHeaderType(e,t.headerType),be.addBodyLength(e,new ze(t.bodyLength,0)),be.finishMessageBuffer(e,be.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof P)return new mt(0,Nt.V4,V.Schema,t);if(t instanceof Lt)return new mt(e,Nt.V4,V.RecordBatch,t);if(t instanceof re)return new mt(e,Nt.V4,V.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===V.Schema}isRecordBatch(){return this.headerType===V.RecordBatch}isDictionaryBatch(){return this.headerType===V.DictionaryBatch}}class Lt{constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}}class re{constructor(t,e,i=!1){this._data=t,this._isDelta=i,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 ee{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}}class Ye{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}}function md(n,t){return()=>{switch(t){case V.Schema:return P.fromJSON(n);case V.RecordBatch:return Lt.fromJSON(n);case V.DictionaryBatch:return re.fromJSON(n)}throw new Error(`Unrecognized Message type: { name: ${V[t]}, type: ${t} }`)}}function vd(n,t){return()=>{switch(t){case V.Schema:return P.decode(n.header(new Yt));case V.RecordBatch:return Lt.decode(n.header(new ce),n.version());case V.DictionaryBatch:return re.decode(n.header(new en),n.version())}throw new Error(`Unrecognized Message type: { name: ${V[t]}, type: ${t} }`)}}X.encode=Dd;X.decode=Fd;X.fromJSON=fd;P.encode=Ad;P.decode=bd;P.fromJSON=cd;Lt.encode=Td;Lt.decode=gd;Lt.fromJSON=Za;re.encode=Nd;re.decode=_d;re.fromJSON=ud;Ye.encode=xd;Ye.decode=Sd;ee.encode=Md;ee.decode=wd;function bd(n,t=new Map){const e=Od(n,t);return new P(e,li(n),t)}function gd(n,t=Nt.V4){if(n.compression()!==null)throw new Error("Record batch compression not implemented");return new Lt(n.length(),Id(n),Bd(n,t))}function _d(n,t=Nt.V4){return new re(Lt.decode(n.data(),t),n.id(),n.isDelta())}function wd(n){return new ee(n.offset(),n.length())}function Sd(n){return new Ye(n.length(),n.nullCount())}function Id(n){const t=[];for(let e,i=-1,r=-1,s=n.nodesLength();++i<s;)(e=n.nodes(i))&&(t[++r]=Ye.decode(e));return t}function Bd(n,t){const e=[];for(let i,r=-1,s=-1,o=n.buffersLength();++r<o;)(i=n.buffers(r))&&(t<Nt.V4&&(i.bb_pos+=8*(r+1)),e[++s]=ee.decode(i));return e}function Od(n,t){const e=[];for(let i,r=-1,s=-1,o=n.fieldsLength();++r<o;)(i=n.fields(r))&&(e[++s]=X.decode(i,t));return e}function zs(n,t){const e=[];for(let i,r=-1,s=-1,o=n.childrenLength();++r<o;)(i=n.children(r))&&(e[++s]=X.decode(i,t));return e}function Fd(n,t){let e,i,r,s,o,a;return!t||!(a=n.dictionary())?(r=Ys(n,zs(n,t)),i=new X(n.name(),r,n.nullable(),li(n))):t.has(e=a.id().low)?(s=(s=a.indexType())?Ws(s):new Cn,o=new dn(t.get(e),s,e,a.isOrdered()),i=new X(n.name(),o,n.nullable(),li(n))):(s=(s=a.indexType())?Ws(s):new Cn,t.set(e,r=Ys(n,zs(n,t))),o=new dn(r,s,e,a.isOrdered()),i=new X(n.name(),o,n.nullable(),li(n))),i||null}function li(n){const t=new Map;if(n)for(let e,i,r=-1,s=Math.trunc(n.customMetadataLength());++r<s;)(e=n.customMetadata(r))&&(i=e.key())!=null&&t.set(i,e.value());return t}function Ws(n){return new Fe(n.isSigned(),n.bitWidth())}function Ys(n,t){const e=n.typeType();switch(e){case Q.NONE:return new Oe;case Q.Null:return new Oe;case Q.Binary:return new ui;case Q.Utf8:return new di;case Q.Bool:return new hi;case Q.List:return new vi((t||[])[0]);case Q.Struct_:return new yt(t||[])}switch(e){case Q.Int:{const i=n.type(new Tt);return new Fe(i.isSigned(),i.bitWidth())}case Q.FloatingPoint:{const i=n.type(new Xt);return new kn(i.precision())}case Q.Decimal:{const i=n.type(new gt);return new fi(i.scale(),i.precision(),i.bitWidth())}case Q.Date:{const i=n.type(new ii);return new pi(i.unit())}case Q.Time:{const i=n.type(new kt);return new Un(i.unit(),i.bitWidth())}case Q.Timestamp:{const i=n.type(new Ut);return new yi(i.unit(),i.timezone())}case Q.Interval:{const i=n.type(new Qt);return new mi(i.unit())}case Q.Union:{const i=n.type(new _t);return new bi(i.mode(),i.typeIdsArray()||[],t||[])}case Q.FixedSizeBinary:{const i=n.type(new Kt);return new gi(i.byteWidth())}case Q.FixedSizeList:{const i=n.type(new Zt);return new _i(i.listSize(),(t||[])[0])}case Q.Map:{const i=n.type(new ri);return new wi((t||[])[0],i.keysSorted())}}throw new Error(`Unrecognized type: "${Q[e]}" (${e})`)}function Ad(n,t){const e=t.fields.map(s=>X.encode(n,s));Yt.startFieldsVector(n,e.length);const i=Yt.createFieldsVector(n,e),r=t.metadata&&t.metadata.size>0?Yt.createCustomMetadataVector(n,[...t.metadata].map(([s,o])=>{const a=n.createString(`${s}`),l=n.createString(`${o}`);return ct.startKeyValue(n),ct.addKey(n,a),ct.addValue(n,l),ct.endKeyValue(n)})):-1;return Yt.startSchema(n),Yt.addFields(n,i),Yt.addEndianness(n,Ld?pn.Little:pn.Big),r!==-1&&Yt.addCustomMetadata(n,r),Yt.endSchema(n)}function Dd(n,t){let e=-1,i=-1,r=-1;const s=t.type;let o=t.typeId;S.isDictionary(s)?(o=s.dictionary.typeId,r=fr.visit(s,n),i=fr.visit(s.dictionary,n)):i=fr.visit(s,n);const a=(s.children||[]).map(d=>X.encode(n,d)),l=Rt.createChildrenVector(n,a),c=t.metadata&&t.metadata.size>0?Rt.createCustomMetadataVector(n,[...t.metadata].map(([d,h])=>{const y=n.createString(`${d}`),_=n.createString(`${h}`);return ct.startKeyValue(n),ct.addKey(n,y),ct.addValue(n,_),ct.endKeyValue(n)})):-1;return t.name&&(e=n.createString(t.name)),Rt.startField(n),Rt.addType(n,i),Rt.addTypeType(n,o),Rt.addChildren(n,l),Rt.addNullable(n,!!t.nullable),e!==-1&&Rt.addName(n,e),r!==-1&&Rt.addDictionary(n,r),c!==-1&&Rt.addCustomMetadata(n,c),Rt.endField(n)}function Td(n,t){const e=t.nodes||[],i=t.buffers||[];ce.startNodesVector(n,e.length);for(const o of e.slice().reverse())Ye.encode(n,o);const r=n.endVector();ce.startBuffersVector(n,i.length);for(const o of i.slice().reverse())ee.encode(n,o);const s=n.endVector();return ce.startRecordBatch(n),ce.addLength(n,new ze(t.length,0)),ce.addNodes(n,r),ce.addBuffers(n,s),ce.endRecordBatch(n)}function Nd(n,t){const e=Lt.encode(n,t.data);return en.startDictionaryBatch(n),en.addId(n,new ze(t.id,0)),en.addIsDelta(n,t.isDelta),en.addData(n,e),en.endDictionaryBatch(n)}function xd(n,t){return Ka.createFieldNode(n,new ze(t.length,0),new ze(t.nullCount,0))}function Md(n,t){return Ja.createBuffer(n,new ze(t.offset,0),new ze(t.length,0))}const Ld=(()=>{const n=new ArrayBuffer(2);return new DataView(n).setInt16(0,256,!0),new Int16Array(n)[0]===256})(),ds=n=>`Expected ${V[n]} Message in stream, but was null or length 0.`,hs=n=>`Header pointer of flatbuffer-encoded ${V[n]} Message is null or length 0.`,tl=(n,t)=>`Expected to read ${n} metadata bytes, but only read ${t}.`,el=(n,t)=>`Expected to read ${n} bytes for message body, but only read ${t}.`;class nl{constructor(t){this.source=t instanceof Ni?t:new Ni(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?tt: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(ds(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=C(this.source.read(t));if(e.byteLength<t)throw new Error(el(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=V.Schema,i=this.readMessage(e),r=i?.header();if(t&&!r)throw new Error(hs(e));return r}readMetadataLength(){const t=this.source.read(nr),e=t&&new hn(t),i=e?.readInt32(0)||0;return{done:i===0,value:i}}readMetadata(t){const e=this.source.read(t);if(!e)return tt;if(e.byteLength<t)throw new Error(tl(t,e.byteLength));return{done:!1,value:mt.decode(e)}}}class Ed{constructor(t,e){this.source=t instanceof mn?t:Io(t)?new xi(t,e):new mn(t)}[Symbol.asyncIterator](){return this}next(){return w(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?tt:t})}throw(t){return w(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return w(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return w(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(ds(t));return e.value})}readMessageBody(t){return w(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);const e=C(yield this.source.read(t));if(e.byteLength<t)throw new Error(el(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return w(this,void 0,void 0,function*(){const e=V.Schema,i=yield this.readMessage(e),r=i?.header();if(t&&!r)throw new Error(hs(e));return r})}readMetadataLength(){return w(this,void 0,void 0,function*(){const t=yield this.source.read(nr),e=t&&new hn(t),i=e?.readInt32(0)||0;return{done:i===0,value:i}})}readMetadata(t){return w(this,void 0,void 0,function*(){const e=yield this.source.read(t);if(!e)return tt;if(e.byteLength<t)throw new Error(tl(t,e.byteLength));return{done:!1,value:mt.decode(e)}})}}class Rd extends nl{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof ks?t:new ks(t)}next(){const{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:mt.fromJSON(t.schema,V.Schema)};if(this._dictionaryIndex<t.dictionaries.length){const e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:mt.fromJSON(e,V.DictionaryBatch)}}if(this._batchIndex<t.batches.length){const e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:mt.fromJSON(e,V.RecordBatch)}}return this._body=[],tt}readMessageBody(t){return e(this._body);function e(i){return(i||[]).reduce((r,s)=>[...r,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE&&[s.TYPE]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(ds(t));return e.value}readSchema(){const t=V.Schema,e=this.readMessage(t),i=e?.header();if(!e||!i)throw new Error(hs(t));return i}}const nr=4,xr="ARROW1",$n=new Uint8Array(xr.length);for(let n=0;n<xr.length;n+=1)$n[n]=xr.codePointAt(n);function fs(n,t=0){for(let e=-1,i=$n.length;++e<i;)if($n[e]!==n[t+e])return!1;return!0}const Kn=$n.length,il=Kn+nr,Cd=Kn*2+nr;class fe extends ss{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 Ie(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 Ct.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Ct.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 fe?t:_r(t)?$d(t):Io(t)?zd(t):Ie(t)?w(this,void 0,void 0,function*(){return yield fe.from(yield t)}):Bo(t)||Yr(t)||Oo(t)||gn(t)?jd(new mn(t)):Pd(new Ni(t))}static readAll(t){return t instanceof fe?t.isSync()?Gs(t):Hs(t):_r(t)||ArrayBuffer.isView(t)||Gn(t)||So(t)?Gs(t):Hs(t)}}class Ri extends fe{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return te(this,arguments,function*(){yield x(yield*ni(Pe(this[Symbol.iterator]())))})}}class Ci extends fe{constructor(t){super(t),this._impl=t}readAll(){var t,e;return w(this,void 0,void 0,function*(){const i=new Array;try{for(var r=Pe(this),s;s=yield r.next(),!s.done;){const o=s.value;i.push(o)}}catch(o){t={error:o}}finally{try{s&&!s.done&&(e=r.return)&&(yield e.call(r))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class rl extends Ri{constructor(t){super(t),this._impl=t}}class kd extends Ci{constructor(t){super(t),this._impl=t}}class sl{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 i=this._loadVectors(t,e,this.schema.fields),r=E({type:new yt(this.schema.fields),length:t.length,children:i});return new wt(this.schema,r)}_loadDictionaryBatch(t,e){const{id:i,isDelta:r}=t,{dictionaries:s,schema:o}=this,a=s.get(i);if(r||!a){const l=o.dictionaries.get(i),c=this._loadVectors(t.data,e,[l]);return(a&&r?a.concat(new $(c)):new $(c)).memoize()}return a.memoize()}_loadVectors(t,e,i){return new Ya(e,t.nodes,t.buffers,this.dictionaries).visitMany(i)}}class ki extends sl{constructor(t,e){super(e),this._reader=_r(t)?new Rd(this._handle=t):new nl(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=al(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):tt}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):tt}next(){if(this.closed)return tt;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),r=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,r)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),r=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,r);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new us(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ui extends sl{constructor(t,e){super(e),this._reader=new Ed(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return w(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 w(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=al(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return w(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):tt})}return(t){return w(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):tt})}next(){return w(this,void 0,void 0,function*(){if(this.closed)return tt;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 i=t.header(),r=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,r)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),r=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,r);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new us(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return w(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class ol extends ki{constructor(t,e){super(t instanceof Us?t:new Us(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 i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const r=this._reader.readMessage(V.RecordBatch);if(r?.isRecordBatch()){const s=r.header(),o=this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const r=this._reader.readMessage(V.DictionaryBatch);if(r?.isDictionaryBatch()){const s=r.header(),o=this._reader.readMessageBody(r.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-il,i=t.readInt32(e),r=t.readAt(e-i,i);return Vn.decode(r)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(i&&this._handle.seek(i.offset))return this._reader.readMessage(t)}return null}}class Ud extends Ui{constructor(t,...e){const i=typeof e[0]!="number"?e.shift():void 0,r=e[0]instanceof Map?e.shift():void 0;super(t instanceof xi?t:new xi(t,i),r)}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 w(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){var e;return w(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const r=yield this._reader.readMessage(V.RecordBatch);if(r?.isRecordBatch()){const s=r.header(),o=yield this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){var e;return w(this,void 0,void 0,function*(){const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const r=yield this._reader.readMessage(V.DictionaryBatch);if(r?.isDictionaryBatch()){const s=r.header(),o=yield this._reader.readMessageBody(r.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return w(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-il,i=yield t.readInt32(e),r=yield t.readAt(e-i,i);return Vn.decode(r)})}_readNextMessageAndValidate(t){return w(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 Vd extends ki{constructor(t,e){super(t,e)}_loadVectors(t,e,i){return new Zu(e,t.nodes,t.buffers,this.dictionaries).visitMany(i)}}function al(n,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:n.autoDestroy}function*Gs(n){const t=fe.from(n);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Hs(n){return te(this,arguments,function*(){const e=yield x(fe.from(n));try{if(!(yield x(e.open({autoDestroy:!1}))).closed)do yield yield x(e);while(!(yield x(e.reset().open())).closed)}finally{yield x(e.cancel())}})}function $d(n){return new Ri(new Vd(n))}function Pd(n){const t=n.peek(Kn+7&-8);return t&&t.byteLength>=4?fs(t)?new rl(new ol(n.read())):new Ri(new ki(n)):new Ri(new ki(function*(){}()))}function jd(n){return w(this,void 0,void 0,function*(){const t=yield n.peek(Kn+7&-8);return t&&t.byteLength>=4?fs(t)?new rl(new ol(yield n.read())):new Ci(new Ui(n)):new Ci(new Ui(function(){return te(this,arguments,function*(){})}()))})}function zd(n){return w(this,void 0,void 0,function*(){const{size:t}=yield n.stat(),e=new xi(n,t);return t>=Cd&&fs(yield e.readAt(0,Kn+7&-8))?new kd(new Ud(e)):new Ci(new Ui(e))})}class rt extends R{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){const e=r=>r.flatMap(s=>Array.isArray(s)?e(s):s instanceof wt?s.data.children:s.data),i=new rt;return i.visitMany(e(t)),i}visit(t){if(t instanceof $)return this.visitMany(t.data),this;const{type:e}=t;if(!S.isDictionary(e)){const{length:i,nullCount:r}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");S.isNull(e)||Pt.call(this,r<=0?new Uint8Array(0):ts(t.offset,i,t.nullBitmap)),this.nodes.push(new Ye(i,r))}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 Pt(n){const t=n.byteLength+7&-8;return this.buffers.push(n),this.bufferRegions.push(new ee(this._byteLength,t)),this._byteLength+=t,this}function Wd(n){const{type:t,length:e,typeIds:i,valueOffsets:r}=n;if(Pt.call(this,i),t.mode===Mt.Sparse)return Mr.call(this,n);if(t.mode===Mt.Dense){if(n.offset<=0)return Pt.call(this,r),Mr.call(this,n);{const s=i.reduce((d,h)=>Math.max(d,h),i[0]),o=new Int32Array(s+1),a=new Int32Array(s+1).fill(-1),l=new Int32Array(e),c=Hr(-r[0],e,r);for(let d,h,y=-1;++y<e;)(h=a[d=i[y]])===-1&&(h=a[d]=c[d]),l[y]=c[y]-h,++o[d];Pt.call(this,l);for(let d,h=-1,y=t.children.length;++h<y;)if(d=n.children[h]){const _=t.typeIds[h],G=Math.min(e,o[_]);this.visit(d.slice(a[_],G))}}}return this}function Yd(n){let t;return n.nullCount>=n.length?Pt.call(this,new Uint8Array(0)):(t=n.values)instanceof Uint8Array?Pt.call(this,ts(n.offset,n.length,t)):Pt.call(this,Si(n.values))}function xe(n){return Pt.call(this,n.values.subarray(0,n.length*n.stride))}function ll(n){const{length:t,values:e,valueOffsets:i}=n,r=i[0],s=i[t],o=Math.min(s-r,e.byteLength-r);return Pt.call(this,Hr(-i[0],t,i)),Pt.call(this,e.subarray(r,r+o)),this}function ps(n){const{length:t,valueOffsets:e}=n;return e&&Pt.call(this,Hr(e[0],t,e)),this.visit(n.children[0])}function Mr(n){return this.visitMany(n.type.children.map((t,e)=>n.children[e]).filter(Boolean))[0]}rt.prototype.visitBool=Yd;rt.prototype.visitInt=xe;rt.prototype.visitFloat=xe;rt.prototype.visitUtf8=ll;rt.prototype.visitBinary=ll;rt.prototype.visitFixedSizeBinary=xe;rt.prototype.visitDate=xe;rt.prototype.visitTimestamp=xe;rt.prototype.visitTime=xe;rt.prototype.visitDecimal=xe;rt.prototype.visitList=ps;rt.prototype.visitStruct=Mr;rt.prototype.visitUnion=Wd;rt.prototype.visitInterval=xe;rt.prototype.visitFixedSizeList=ps;rt.prototype.visitMap=ps;class cl extends ss{constructor(t){super(),this._position=0,this._started=!1,this._sink=new oi,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,Ot(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 Ie(t)?t.then(e=>this.writeAll(e)):gn(t)?bs(this,t):vs(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 oi?this._sink=t:(this._sink=new oi,t&&hc(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&fc(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||!Dr(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 pt&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof wt&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Dr(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof wt?t instanceof us||this._writeRecordBatch(t):t instanceof pt?this.writeAll(t.batches):Gn(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,r=mt.encode(t),s=r.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,l=a-s-o;return t.headerType===V.RecordBatch?this._recordBatchBlocks.push(new Ae(a,t.bodyLength,this._position)):t.headerType===V.DictionaryBatch&&this._dictionaryBlocks.push(new Ae(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(r),this._writePadding(l)}_write(t){if(this._started){const e=C(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(mt.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write($n)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:r,buffers:s}=rt.assemble(t),o=new Lt(t.numRows,i,r),a=mt.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));const{byteLength:r,nodes:s,bufferRegions:o,buffers:a}=rt.assemble(new $([t])),l=new Lt(t.length,s,o),c=new re(l,e,i),d=mt.from(c,r);return this._writeMessage(d)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,r;for(let s=-1,o=t.length;++s<o;)(e=t[s])&&(i=e.byteLength)>0&&(this._write(e),(r=(i+7&-8)-i)>0&&this._writePadding(r));return this}_writeDictionaries(t){for(let[e,i]of t.dictionaries){let r=this._dictionaryDeltaOffsets.get(e)||0;if(r===0||(i=i?.slice(r)).length>0)for(const s of i.data)this._writeDictionaryBatch(s,e,r>0),r+=s.length}return this}}class ys extends cl{static writeAll(t,e){const i=new ys(e);return Ie(t)?t.then(r=>i.writeAll(r)):gn(t)?bs(i,t):vs(i,t)}}class ms extends cl{static writeAll(t){const e=new ms;return Ie(t)?t.then(i=>e.writeAll(i)):gn(t)?bs(e,t):vs(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const e=Vn.encode(new Vn(t,Nt.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function vs(n,t){let e=t;t instanceof pt&&(e=t.batches,n.reset(void 0,t.schema));for(const i of e)n.write(i);return n.finish()}function bs(n,t){var e,i,r,s;return w(this,void 0,void 0,function*(){try{for(e=Pe(t);i=yield e.next(),!i.done;){const o=i.value;n.write(o)}}catch(o){r={error:o}}finally{try{i&&!i.done&&(s=e.return)&&(yield s.call(e))}finally{if(r)throw r.error}}return n.finish()})}function An(n){const t=fe.from(n);return Ie(t)?t.then(e=>An(e)):t.isAsync()?t.readAll().then(e=>new pt(e)):new pt(t.readAll())}function pr(n,t="stream"){return(t==="stream"?ys:ms).writeAll(n).toUint8Array(!0)}var qs=function(){function n(t,e,i,r){var s=this;this.getCell=function(o,a){var l=o<s.headerRows&&a<s.headerColumns,c=o>=s.headerRows&&a<s.headerColumns,d=o<s.headerRows&&a>=s.headerColumns;if(l){var h=["blank"];return a>0&&h.push("level"+o),{type:"blank",classNames:h.join(" "),content:""}}else if(d){var y=a-s.headerColumns,h=["col_heading","level"+o,"col"+y];return{type:"columns",classNames:h.join(" "),content:s.getContent(s.columnsTable,y,o)}}else if(c){var _=o-s.headerRows,h=["row_heading","level"+a,"row"+_];return{type:"index",id:"T_".concat(s.uuid,"level").concat(a,"_row").concat(_),classNames:h.join(" "),content:s.getContent(s.indexTable,_,a)}}else{var _=o-s.headerRows,y=a-s.headerColumns,h=["data","row"+_,"col"+y],G=s.styler?s.getContent(s.styler.displayValuesTable,_,y):s.getContent(s.dataTable,_,y);return{type:"data",id:"T_".concat(s.uuid,"row").concat(_,"_col").concat(y),classNames:h.join(" "),content:G}}},this.getContent=function(o,a,l){var c=o.getChildAt(l);if(c===null)return"";var d=s.getColumnTypeId(o,l);switch(d){case u.Timestamp:return s.nanosToDate(c.get(a));default:return c.get(a)}},this.dataTable=An(t),this.indexTable=An(e),this.columnsTable=An(i),this.styler=r?{caption:r.caption,displayValuesTable:An(r.displayValues),styles:r.styles,uuid:r.uuid}:void 0}return Object.defineProperty(n.prototype,"rows",{get:function(){return this.indexTable.numRows+this.columnsTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataRows",{get:function(){return this.dataTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"table",{get:function(){return this.dataTable},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.indexTable},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!1,configurable:!0}),n.prototype.serialize=function(){return{data:pr(this.dataTable),index:pr(this.indexTable),columns:pr(this.columnsTable)}},n.prototype.getColumnTypeId=function(t,e){return t.schema.fields[e].type.typeId},n.prototype.nanosToDate=function(t){return new Date(t/1e6)},n}(),Tn=function(){return Tn=Object.assign||function(n){for(var t,e=1,i=arguments.length;e<i;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Tn.apply(this,arguments)},Nn;(function(n){n.COMPONENT_READY="streamlit:componentReady",n.SET_COMPONENT_VALUE="streamlit:setComponentValue",n.SET_FRAME_HEIGHT="streamlit:setFrameHeight"})(Nn||(Nn={}));var Ht=function(){function n(){}return n.API_VERSION=1,n.RENDER_EVENT="streamlit:render",n.events=new EventTarget,n.registeredMessageListener=!1,n.setComponentReady=function(){n.registeredMessageListener||(window.addEventListener("message",n.onMessageEvent),n.registeredMessageListener=!0),n.sendBackMsg(Nn.COMPONENT_READY,{apiVersion:n.API_VERSION})},n.setFrameHeight=function(t){t===void 0&&(t=document.body.scrollHeight),t!==n.lastFrameHeight&&(n.lastFrameHeight=t,n.sendBackMsg(Nn.SET_FRAME_HEIGHT,{height:t}))},n.setComponentValue=function(t){var e;t instanceof qs?(e="dataframe",t=t.serialize()):Hd(t)?(e="bytes",t=new Uint8Array(t.buffer)):t instanceof ArrayBuffer?(e="bytes",t=new Uint8Array(t)):e="json",n.sendBackMsg(Nn.SET_COMPONENT_VALUE,{value:t,dataType:e})},n.onMessageEvent=function(t){var e=t.data.type;switch(e){case n.RENDER_EVENT:n.onRenderMessage(t.data);break}},n.onRenderMessage=function(t){var e=t.args;e==null&&(console.error("Got null args in onRenderMessage. This should never happen"),e={});var i=t.dfs&&t.dfs.length>0?n.argsDataframeToObject(t.dfs):{};e=Tn(Tn({},e),i);var r=!!t.disabled,s=t.theme;s&&Gd(s);var o={disabled:r,args:e,theme:s},a=new CustomEvent(n.RENDER_EVENT,{detail:o});n.events.dispatchEvent(a)},n.argsDataframeToObject=function(t){var e=t.map(function(i){var r=i.key,s=i.value;return[r,n.toArrowTable(s)]});return Object.fromEntries(e)},n.toArrowTable=function(t){var e,i=(e=t.data,e.data),r=e.index,s=e.columns,o=e.styler;return new qs(i,r,s,o)},n.sendBackMsg=function(t,e){window.parent.postMessage(Tn({isStreamlitMessage:!0,type:t},e),"*")},n}(),Gd=function(n){var t=document.createElement("style");document.head.appendChild(t),t.innerHTML=`
    :root {
      --primary-color: `.concat(n.primaryColor,`;
      --background-color: `).concat(n.backgroundColor,`;
      --secondary-background-color: `).concat(n.secondaryBackgroundColor,`;
      --text-color: `).concat(n.textColor,`;
      --font: `).concat(n.font,`;
    }

    body {
      background-color: var(--background-color);
      color: var(--text-color);
    }
  `)};function Hd(n){var t=!1;try{t=n instanceof BigInt64Array||n instanceof BigUint64Array}catch{}return n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int16Array||n instanceof Uint16Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Float32Array||n instanceof Float64Array||t}var qd=function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(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");n(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();(function(n){qd(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){Ht.setFrameHeight()},t.prototype.componentDidUpdate=function(){Ht.setFrameHeight()},t})(ac.PureComponent);const ul=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},Jd=ft({__name:"WithStreamlitConnection",setup(n,{expose:t}){t();const e=It(void 0),i=It(void 0),r=It(NaN),s=a=>{const l=a;e.value=l.detail,i.value=void 0,r.value=window.innerWidth};Pn(()=>{Ht.events.addEventListener(Ht.RENDER_EVENT,s),Ht.setComponentReady()}),Er(()=>{i.value!==void 0&&Ht.setFrameHeight()}),io(()=>{Ht.events.removeEventListener(Ht.RENDER_EVENT,s)}),gl(a=>{i.value=String(a)});const o={renderData:e,componentError:i,innerWidth:r,onRenderEvent:s};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),Kd=n=>(_l("data-v-ad0b980e"),n=n(),wl(),n),Zd={key:0},Xd=Kd(()=>b("h1",{class:"err__title"},"Component Error",-1)),Qd={class:"err__msg"};function th(n,t,e,i,r,s){return m(),g("div",null,[i.componentError!==void 0?(m(),g("div",Zd,[Xd,b("div",Qd,"Message: "+U(i.componentError),1)])):i.renderData!==void 0?dt(n.$slots,"default",{key:1,width:i.innerWidth,args:i.renderData.args,disabled:i.renderData.disabled,theme:i.renderData.theme},void 0,!0):j("",!0)])}const eh=ul(Jd,[["render",th],["__scopeId","data-v-ad0b980e"]]),nh=ft({__name:"StreamlitComponent",props:{component:{}},setup(n,{expose:t}){t();const e=n;function i(s){return{"--base":s.base,"--primary-color":s.primaryColor,"--background-color":s.backgroundColor,"--secondary-background-color":s.secondaryBackgroundColor,"--text-color":s.textColor,"--font":s.font}}const r={props:e,streamlitStyle:i,WithStreamlitConnection:eh};return Object.defineProperty(r,"__isScriptSetup",{enumerable:!1,value:!0}),r}});function ih(n,t,e,i,r,s){return m(),xt(i.WithStreamlitConnection,null,{default:we(({width:o,args:a,disabled:l,theme:c})=>[b("div",{class:"component-wrapper",style:Mn(i.streamlitStyle(c))},[(m(),xt(cn(i.props.component),{width:o,args:a,disabled:l,theme:c},null,8,["width","args","disabled","theme"]))],4)]),_:1})}const Bp=ul(nh,[["render",ih],["__scopeId","data-v-ba378196"]]),rh={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;","&":"&amp;"};let sh=0;var oh=n=>n.replace(/[<>"&]/g,t=>rh[t]||t),ah=n=>n+sh++;const Js={},lh=ft({name:"OhVueIcon",props:{name:{type:String,validator:n=>!n||n in Js||(console.warn(`Invalid prop: prop "name" is referring to an unregistered icon "${n}".
Please make sure you have imported this icon before using it.`),!1)},title:String,fill:String,scale:{type:[Number,String],default:1},animation:{validator:n=>["spin","spin-pulse","wrench","ring","pulse","flash","float"].includes(n)},hover:Boolean,flip:{validator:n=>["horizontal","vertical","both"].includes(n)},speed:{validator:n=>n==="fast"||n==="slow"},label:String,inverse:Boolean},setup(n){const t=It([]),e=Is({outerScale:1.2,x:null,y:null}),i=Is({width:0,height:0}),r=L(()=>{const et=Number(n.scale);return isNaN(et)||et<=0?(console.warn('Invalid prop: prop "scale" should be a number over 0.'),e.outerScale):et*e.outerScale}),s=L(()=>({"ov-icon":!0,"ov-inverse":n.inverse,"ov-flip-horizontal":n.flip==="horizontal","ov-flip-vertical":n.flip==="vertical","ov-flip-both":n.flip==="both","ov-spin":n.animation==="spin","ov-spin-pulse":n.animation==="spin-pulse","ov-wrench":n.animation==="wrench","ov-ring":n.animation==="ring","ov-pulse":n.animation==="pulse","ov-flash":n.animation==="flash","ov-float":n.animation==="float","ov-hover":n.hover,"ov-fast":n.speed==="fast","ov-slow":n.speed==="slow"})),o=L(()=>n.name?Js[n.name]:null),a=L(()=>o.value?`${o.value.minX} ${o.value.minY} ${o.value.width} ${o.value.height}`:`0 0 ${c.value} ${d.value}`),l=L(()=>{if(!o.value)return 1;const{width:et,height:st}=o.value;return Math.max(et,st)/16}),c=L(()=>i.width||o.value&&o.value.width/l.value*r.value||0),d=L(()=>i.height||o.value&&o.value.height/l.value*r.value||0),h=L(()=>r.value!==1&&{fontSize:r.value+"em"}),y=L(()=>{if(!o.value||!o.value.raw)return null;const et={};let st=o.value.raw;return st=st.replace(/\s(?:xml:)?id=(["']?)([^"')\s]+)\1/g,(nt,He,wn)=>{const Me=ah("vat-");return et[wn]=Me,` id="${Me}"`}),st=st.replace(/#(?:([^'")\s]+)|xpointer\(id\((['"]?)([^')]+)\2\)\))/g,(nt,He,wn,Me)=>{const qe=He||Me;return qe&&et[qe]?`#${et[qe]}`:nt}),st}),_=L(()=>o.value&&o.value.attr?o.value.attr:{}),G=()=>{if(!n.name&&n.name!==null&&t.value.length===0)return void console.warn('Invalid prop: prop "name" is required.');if(o.value)return;let et=0,st=0;t.value.forEach(nt=>{nt.outerScale=r.value,et=Math.max(et,nt.width),st=Math.max(st,nt.height)}),i.width=et,i.height=st,t.value.forEach(nt=>{nt.x=(et-nt.width)/2,nt.y=(st-nt.height)/2})};return Pn(()=>{G()}),Er(()=>{G()}),{...Sl(e),children:t,icon:o,klass:s,style:h,width:c,height:d,box:a,attribs:_,raw:y}},created(){const n=this.$parent;n&&n.children&&n.children.push(this)},render(){const n=Object.assign({role:this.$attrs.role||(this.label||this.title?"img":null),"aria-label":this.label||null,"aria-hidden":!(this.label||this.title),width:this.width,height:this.height,viewBox:this.box},this.attribs);this.attribs.stroke?n.stroke=this.fill?this.fill:"currentColor":n.fill=this.fill?this.fill:"currentColor",this.x&&(n.x=this.x.toString()),this.y&&(n.y=this.y.toString());let t={class:this.klass,style:this.style};if(t=Object.assign(t,n),this.raw){const r=this.title?`<title>${oh(this.title)}</title>${this.raw}`:this.raw;t.innerHTML=r}const e=this.title?[or("title",this.title)]:[],i=(r,s,o)=>or(r,{...s,key:`${r}-${o}`});return or("svg",t,this.raw?void 0:e.concat([this.$slots.default?this.$slots.default():this.icon?[...this.icon.paths.map((r,s)=>i("path",r,s)),...this.icon.polygons.map((r,s)=>i("polygon",r,s))]:[]]))}});function gs(n,t){t===void 0&&(t={});var e=t.insertAt;if(n&&typeof document<"u"){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}}gs(`.ov-icon {
  display: inline-block;
  overflow: visible;
  vertical-align: -0.2em;
}
`);gs(`/* ---------------- spin ---------------- */
.ov-spin:not(.ov-hover),
.ov-spin.ov-hover:hover,
.ov-parent.ov-hover:hover > .ov-spin {
  animation: ov-spin 1s linear infinite;
}

.ov-spin:not(.ov-hover).ov-fast,
.ov-spin.ov-hover.ov-fast:hover,
.ov-parent.ov-hover:hover > .ov-spin.ov-fast {
  animation: ov-spin 0.7s linear infinite;
}

.ov-spin:not(.ov-hover).ov-slow,
.ov-spin.ov-hover.ov-slow:hover,
.ov-parent.ov-hover:hover > .ov-spin.ov-slow {
  animation: ov-spin 2s linear infinite;
}

/* ---------------- spin-pulse ---------------- */

.ov-spin-pulse:not(.ov-hover),
.ov-spin-pulse.ov-hover:hover,
.ov-parent.ov-hover:hover > .ov-spin-pulse {
  animation: ov-spin 1s infinite steps(8);
}

.ov-spin-pulse:not(.ov-hover).ov-fast,
.ov-spin-pulse.ov-hover.ov-fast:hover,
.ov-parent.ov-hover:hover > .ov-spin-pulse.ov-fast {
  animation: ov-spin 0.7s infinite steps(8);
}

.ov-spin-pulse:not(.ov-hover).ov-slow,
.ov-spin-pulse.ov-hover.ov-slow:hover,
.ov-parent.ov-hover:hover > .ov-spin-pulse.ov-slow {
  animation: ov-spin 2s infinite steps(8);
}

@keyframes ov-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ---------------- wrench ---------------- */
.ov-wrench:not(.ov-hover),
.ov-wrench.ov-hover:hover,
.ov-parent.ov-hover:hover > .ov-wrench {
  animation: ov-wrench 2.5s ease infinite;
}

.ov-wrench:not(.ov-hover).ov-fast,
.ov-wrench.ov-hover.ov-fast:hover,
.ov-parent.ov-hover:hover > .ov-wrench.ov-fast {
  animation: ov-wrench 1.2s ease infinite;
}

.ov-wrench:not(.ov-hover).ov-slow,
.ov-wrench.ov-hover.ov-slow:hover,
.ov-parent.ov-hover:hover > .ov-wrench.ov-slow {
  animation: ov-wrench 3.7s ease infinite;
}

@keyframes ov-wrench {
  0% {
    transform: rotate(-12deg);
  }

  8% {
    transform: rotate(12deg);
  }

  10%, 28%, 30%, 48%, 50%, 68% {
    transform: rotate(24deg);
  }

  18%, 20%, 38%, 40%, 58%, 60% {
    transform: rotate(-24deg);
  }

  75%, 100% {
    transform: rotate(0deg);
  }
}

/* ---------------- ring ---------------- */
.ov-ring:not(.ov-hover),
.ov-ring.ov-hover:hover,
.ov-parent.ov-hover:hover > .ov-ring {
  animation: ov-ring 2s ease infinite;
}

.ov-ring:not(.ov-hover).ov-fast,
.ov-ring.ov-hover.ov-fast:hover,
.ov-parent.ov-hover:hover > .ov-ring.ov-fast {
  animation: ov-ring 1s ease infinite;
}

.ov-ring:not(.ov-hover).ov-slow,
.ov-ring.ov-hover.ov-slow:hover,
.ov-parent.ov-hover:hover > .ov-ring.ov-slow {
  animation: ov-ring 3s ease infinite;
}

@keyframes ov-ring {
  0% {
    transform: rotate(-15deg);
  }

  2% {
    transform: rotate(15deg);
  }

  4%, 12% {
    transform: rotate(-18deg);
  }

  6% {
    transform: rotate(18deg);
  }

  8% {
    transform: rotate(-22deg);
  }

  10% {
    transform: rotate(22deg);
  }

  12% {
    transform: rotate(-18deg);
  }

  14% {
    transform: rotate(18deg);
  }

  16% {
    transform: rotate(-12deg);
  }

  18% {
    transform: rotate(12deg);
  }

  20%, 100% {
    transform: rotate(0deg);
  }
}

/* ---------------- pulse ---------------- */
.ov-pulse:not(.ov-hover),
.ov-pulse.ov-hover:hover,
.ov-parent.ov-hover:hover > .ov-pulse {
  animation: ov-pulse 2s linear infinite;
}

.ov-pulse:not(.ov-hover).ov-fast,
.ov-pulse.ov-hover.ov-fast:hover,
.ov-parent.ov-hover:hover > .ov-pulse.ov-fast {
  animation: ov-pulse 1s linear infinite;
}

.ov-pulse:not(.ov-hover).ov-slow,
.ov-pulse.ov-hover.ov-slow:hover,
.ov-parent.ov-hover:hover > .ov-pulse.ov-slow {
  animation: ov-pulse 3s linear infinite;
}

@keyframes ov-pulse {
  0% {
    transform: scale(1.1);
  }

  50% {
    transform: scale(0.8);
  }

  100% {
    transform: scale(1.1);
  }
}

/* ---------------- flash ---------------- */
.ov-flash:not(.ov-hover),
.ov-flash.ov-hover:hover,
.ov-parent.ov-hover:hover > .ov-flash {
  animation: ov-flash 2s ease infinite;
}

.ov-flash:not(.ov-hover).ov-fast,
.ov-flash.ov-hover.ov-fast:hover,
.ov-parent.ov-hover:hover > .ov-flash.ov-fast {
  animation: ov-flash 1s ease infinite;
}

.ov-flash:not(.ov-hover).ov-slow,
.ov-flash.ov-hover.ov-slow:hover,
.ov-parent.ov-hover:hover > .ov-flash.ov-slow {
  animation: ov-flash 3s ease infinite;
}

@keyframes ov-flash {
  0%, 100%, 50%{
    opacity: 1;
  }
  25%, 75%{
    opacity: 0;
  }
}

/* ---------------- float ---------------- */
.ov-float:not(.ov-hover),
.ov-float.ov-hover:hover,
.ov-parent.ov-hover:hover > .ov-float {
  animation: ov-float 2s linear infinite;
}

.ov-float:not(.ov-hover).ov-fast,
.ov-float.ov-hover.ov-fast:hover,
.ov-parent.ov-hover:hover > .ov-float.ov-fast {
  animation: ov-float 1s linear infinite;
}

.ov-float:not(.ov-hover).ov-slow,
.ov-float.ov-hover.ov-slow:hover,
.ov-parent.ov-hover:hover > .ov-float.ov-slow {
  animation: ov-float 3s linear infinite;
}

@keyframes ov-float {
  0%, 100% {
    transform: translateY(-3px);
  }
  50% {
    transform: translateY(3px);
  }
}
`);gs(`.ov-flip-horizontal {
  transform: scale(-1, 1);
}

.ov-flip-vertical {
  transform: scale(1, -1);
}

.ov-flip-both {
  transform: scale(-1, -1);
}

.ov-inverse {
  color: #fff;
}
`);const ch="abcdefghijklmnopqrstuvwyz0123456789",Ks=ch.repeat(10),uh=()=>{const n=Math.floor(Math.random()*Ks.length);return Ks[n]},Ge=(n="",t="")=>(n?n+"-":"")+dh(5)+(t?"-"+t:""),dh=n=>Array.from({length:n}).map(uh).join(""),hh=()=>{const n=It(),t=It(!1),e=It(!1),i=()=>{if(!n.value)return;n.value.style.setProperty("--collapser","none");const r=n.value.offsetHeight;n.value.style.setProperty("--collapse",-r+"px"),n.value.style.setProperty("--collapser","")};return{collapse:n,collapsing:t,cssExpanded:e,doExpand:r=>{n.value&&(r===!0&&n.value.style.setProperty("--collapse-max-height","none"),window.requestAnimationFrame(()=>{t.value=!0,i(),window.requestAnimationFrame(()=>{e.value=r})}))},adjust:i,onTransitionEnd:r=>{t.value=!1,n.value&&r===!1&&n.value.style.removeProperty("--collapse-max-height")}}},fh=["id"],ph={class:"alert-content"},yh={class:"fr-alert__description"},Op=ft({__name:"DsfrAlert",props:{closed:{type:Boolean},closeable:{type:Boolean},id:{default:()=>Ge("basic","alert")},title:{default:""},description:{},small:{type:Boolean},titleTag:{default:"h3"},type:{default:"info"}},emits:["close"],setup(n,{emit:t}){const e=n,i=t,r=()=>i("close"),s=L(()=>[`fr-alert--${e.type}`,{"fr-alert--sm":e.small}]);return(o,a)=>(m(),xt(Ol,{name:"slide-fade"},{default:we(()=>[o.closed?j("",!0):(m(),g("div",{key:0,id:o.id,class:ut(["fr-alert",s.value])},[b("div",ph,[o.small?j("",!0):(m(),xt(cn(o.titleTag),{key:0,class:"fr-alert__title"},{default:we(()=>[St(U(o.title),1)]),_:1})),b("p",yh,[dt(o.$slots,"default",{},()=>[St(U(o.description),1)])])]),o.closeable?(m(),g("button",{key:0,class:"fr-btn fr-btn--close",title:"Fermer","aria-label":"Fermer",onClick:r})):j("",!0)],10,fh))]),_:3}))}}),mh=["title"],Fp=ft({__name:"DsfrBadge",props:{label:{},type:{default:"info"},noIcon:{type:Boolean},small:{type:Boolean},ellipsis:{type:Boolean}},setup(n){return(t,e)=>(m(),g("p",{class:ut(["fr-badge",{[`fr-badge--${t.type}`]:t.type,"fr-badge--no-icon":t.noIcon,"fr-badge--sm":t.small}]),title:t.ellipsis?t.label:void 0},[b("span",{class:ut(t.ellipsis?"fr-ellipsis":"")},U(t.label),3)],10,mh))}}),vh={role:"navigation",class:"fr-breadcrumb","aria-label":"vous êtes ici :"},bh=["aria-expanded","aria-controls"],gh=["id"],_h={class:"fr-breadcrumb__list"},wh=["aria-current"],Ap=ft({__name:"DsfrBreadcrumb",props:{breadcrumbId:{default:()=>Ge("breadcrumb")},links:{default:()=>[{text:""}]}},setup(n){const{collapse:t,collapsing:e,cssExpanded:i,doExpand:r,onTransitionEnd:s}=hh(),o=It(!1);return Rr(o,(a,l)=>{a!==l&&r(a)}),(a,l)=>(m(),g("nav",vh,[Fl(b("button",{class:"fr-breadcrumb__button","aria-expanded":o.value,"aria-controls":a.breadcrumbId,onClick:l[0]||(l[0]=c=>o.value=!o.value)}," Voir le fil d’Ariane ",8,bh),[[Al,!o.value]]),b("div",{id:a.breadcrumbId,ref_key:"collapse",ref:t,class:ut(["fr-collapse",{"fr-collapse--expanded":ei(i),"fr-collapsing":ei(e)}]),onTransitionend:l[1]||(l[1]=c=>ei(s)(o.value))},[b("ol",_h,[(m(!0),g(un,null,Ln(a.links,(c,d)=>(m(),g("li",{key:d,class:"fr-breadcrumb__item","data-testid":"lis"},[c.to?(m(),xt(cn("RouterLink"),{key:0,class:"fr-breadcrumb__link",to:c.to,"aria-current":d===a.links.length-1?"page":void 0},{default:we(()=>[St(U(c.text),1)]),_:2},1032,["to","aria-current"])):j("",!0),c.to?j("",!0):(m(),g("a",{key:1,class:"fr-breadcrumb__link","aria-current":d===a.links.length-1?"page":void 0},U(c.text),9,wh))]))),128))])],42,gh)]))}}),Sh=["title","disabled","aria-disabled"],Ih={key:1},Bh=ft({__name:"DsfrButton",props:{disabled:{type:Boolean},label:{default:void 0},secondary:{type:Boolean},tertiary:{type:Boolean},iconRight:{type:Boolean},iconOnly:{type:Boolean},noOutline:{type:Boolean},size:{default:"md"},icon:{default:void 0},onClick:{type:Function,default:()=>{}}},setup(n,{expose:t}){const e=n,i=L(()=>["sm","small"].includes(e.size)),r=L(()=>["md","medium"].includes(e.size)),s=L(()=>["lg","large"].includes(e.size)),o=It(null);t({focus:()=>{var d;(d=o.value)==null||d.focus()}});const a=L(()=>typeof e.icon=="string"&&e.icon.startsWith("fr-icon-")),l=L(()=>e.iconOnly?1.25:.8325),c=L(()=>typeof e.icon=="string"?{scale:l.value,name:e.icon}:{scale:l.value,...e.icon});return(d,h)=>(m(),g("button",{ref_key:"btn",ref:o,class:ut({"fr-btn":!0,"fr-btn--secondary":d.secondary&&!d.tertiary,"fr-btn--tertiary":d.tertiary&&!d.secondary&&!d.noOutline,"fr-btn--tertiary-no-outline":d.tertiary&&!d.secondary&&d.noOutline,"fr-btn--sm":i.value,"fr-btn--md":r.value,"fr-btn--lg":s.value,"fr-btn--icon-right":!d.iconOnly&&a.value&&d.iconRight,"fr-btn--icon-left":!d.iconOnly&&a.value&&!d.iconRight,"inline-flex":!a.value,reverse:d.iconRight&&!a.value,"justify-center":!a.value&&d.iconOnly,[d.icon]:a.value}),title:d.iconOnly?d.label:void 0,disabled:d.disabled,"aria-disabled":d.disabled,style:Mn(!a.value&&d.iconOnly?{"padding-inline":"0.5rem"}:{}),onClick:h[0]||(h[0]=y=>d.onClick?d.onClick(y):()=>{})},[d.icon&&!a.value?(m(),xt(ei(lh),ro(Se({key:0},c.value)),null,16)):j("",!0),d.iconOnly?j("",!0):(m(),g("span",Ih,[St(U(d.label)+" ",1),dt(d.$slots,"default",{},void 0,!0)]))],14,Sh))}}),_s=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},Dp=_s(Bh,[["__scopeId","data-v-7fc52401"]]),Oh=["id","name","checked","data-testid","data-test"],Fh=["for"],Ah={key:0,class:"required"},Dh={key:0,class:"fr-hint-text"},Th={key:0,class:"fr-messages-group","aria-live":"assertive"},Tp=ft({__name:"DsfrCheckbox",props:{id:{default:()=>Ge("basic","checkbox")},name:{},required:{type:Boolean},modelValue:{type:Boolean},small:{type:Boolean},inline:{type:Boolean},label:{default:""},errorMessage:{default:""},validMessage:{default:""},hint:{default:""}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=t,r=L(()=>e.errorMessage||e.validMessage),s=L(()=>e.errorMessage?"fr-error-text":"fr-valid-text"),o=a=>{i("update:modelValue",a.target.checked)};return(a,l)=>(m(),g("div",{class:ut(["fr-fieldset__element",{"fr-fieldset__element--inline":a.inline}])},[b("div",{class:ut(["fr-checkbox-group",{"fr-checkbox-group--error":a.errorMessage,"fr-checkbox-group--valid":a.validMessage,"fr-checkbox-group--sm":a.small}])},[b("input",Se({id:a.id,name:a.name,type:"checkbox",checked:a.modelValue},a.$attrs,{"data-testid":`input-checkbox-${a.id}`,"data-test":`input-checkbox-${a.id}`,onChange:l[0]||(l[0]=c=>o(c))}),null,16,Oh),b("label",{for:a.id,class:"fr-label"},[dt(a.$slots,"label",{},()=>[St(U(a.label)+" ",1),dt(a.$slots,"required-tip",{},()=>[a.required?(m(),g("span",Ah," *")):j("",!0)])]),a.hint?(m(),g("span",Dh,U(a.hint),1)):j("",!0)],8,Fh),r.value?(m(),g("div",Th,[b("p",{class:ut(["fr-message--info flex items-center",s.value])},U(r.value),3)])):j("",!0)],2)],2))}}),Nh=["innerHTML"],xh=ft({__name:"DsfrLogo",props:{small:{type:Boolean},large:{type:Boolean},logoText:{default:()=>"Gouvernement"}},setup(n){const t=n,e=L(()=>t.logoText instanceof Array?t.logoText.join("<br>"):t.logoText);return(i,r)=>(m(),g("p",{class:ut(["fr-logo",{"fr-logo--sm":i.small&&!i.large,"fr-logo--lg":i.large&&!i.small}]),innerHTML:e.value},null,10,Nh))}}),Mh={class:"fr-footer__partners"},Lh={key:0,class:"fr-footer__partners-title"},Eh={class:"fr-footer__partners-logos"},Rh={key:0,class:"fr-footer__partners-main"},Ch=["href"],kh=["src","alt"],Uh={class:"fr-footer__partners-sub"},Vh=["href"],$h=["src","alt"],Ph=ft({__name:"DsfrFooterPartners",props:{mainPartner:{default:void 0},subPartners:{default:()=>[]},title:{default:""}},setup(n){return(t,e)=>(m(),g("div",Mh,[t.title?(m(),g("h4",Lh,U(t.title),1)):j("",!0),b("div",Eh,[t.mainPartner?(m(),g("div",Rh,[b("a",{class:"fr-footer__partners-link",href:t.mainPartner.href,target:"_blank",rel:"noopener noreferrer"},[b("img",{class:"fr-footer__logo",src:t.mainPartner.logo,alt:t.mainPartner.name},null,8,kh)],8,Ch)])):j("",!0),b("div",Uh,[b("ul",null,[(m(!0),g(un,null,Ln(t.subPartners,(i,r)=>(m(),g("li",{key:r},[b("a",{class:"fr-footer__partners-link",href:i.href,target:"_blank",rel:"noopener noreferrer"},[b("img",{class:"fr-footer__logo",src:i.logo,alt:i.name},null,8,$h)],8,Vh)]))),128))])])])]))}}),jh={id:"footer",class:"fr-footer",role:"contentinfo"},zh={key:0,class:"fr-footer__top"},Wh={class:"fr-container"},Yh={class:"fr-grid-row fr-grid-row--start fr-grid-row--gutters"},Gh={class:"fr-container"},Hh={class:"fr-footer__body"},qh={class:"fr-footer__brand fr-enlarge-link"},Jh=["src","alt"],Kh={class:"fr-footer__content"},Zh={class:"fr-footer__content-desc"},Xh={class:"fr-footer__content-list"},Qh=["href"],tf={class:"fr-footer__bottom"},ef={class:"fr-footer__bottom-list"},nf=["href","data-testid"],rf={key:0,class:"fr-footer__bottom-copy"},sf=ft({__name:"DsfrFooter",props:{a11yCompliance:{default:"non conforme"},a11yComplianceLink:{default:"/a11y"},legalLink:{default:"/mentions-legales"},homeLink:{default:"/"},partners:{default:()=>{}},personalDataLink:{default:"/donnees-personnelles"},cookiesLink:{default:"/cookies"},logoText:{default:()=>["République","Française"]},descText:{default:void 0},beforeMandatoryLinks:{default:()=>[]},afterMandatoryLinks:{default:()=>[]},mandatoryLinks:{default:n=>[{label:`Accessibilité : ${n.a11yCompliance}`,to:n.a11yComplianceLink},{label:"Mentions légales",to:n.legalLink},{label:"Données personnelles",to:n.personalDataLink},{label:"Gestion des cookies",to:n.cookiesLink}]},ecosystemLinks:{default:()=>[{label:"legifrance.gouv.fr",href:"https://legifrance.gouv.fr"},{label:"gouvernement.fr",href:"https://gouvernement.fr"},{label:"service-public.fr",href:"https://service-public.fr"},{label:"data.gouv.fr",href:"https://data.gouv.fr"}]},operatorLinkText:{default:"Revenir à l’accueil"},operatorTo:{default:"/"},operatorImgStyle:{default:void 0},operatorImgSrc:{default:void 0},operatorImgAlt:{default:""},licenceTo:{default:"https://github.com/etalab/licence-ouverte/blob/master/LO.md"},licenceLinkProps:{default:()=>{}},licenceText:{default:"Sauf mention contraire, tous les textes de ce site sont sous"},licenceName:{default:"licence etalab-2.0"}},setup(n){const t=n,e=L(()=>[...t.beforeMandatoryLinks,...t.mandatoryLinks,...t.afterMandatoryLinks]),i=Dl(),r=L(()=>{var l;return(l=i["footer-link-lists"])==null?void 0:l.call(i).length}),s=L(()=>{const l=t.licenceTo||t.licenceLinkProps.to;return l&&typeof l=="string"&&l.startsWith("http")}),o=L(()=>s.value?"":t.licenceTo),a=L(()=>s.value?t.licenceTo:"");return(l,c)=>{const d=Tl("RouterLink");return m(),g("footer",jh,[r.value?(m(),g("div",zh,[b("div",Wh,[b("div",Yh,[dt(l.$slots,"footer-link-lists",{},void 0,!0)])])])):j("",!0),b("div",Gh,[b("div",Hh,[b("div",qh,[Bs(d,{to:l.homeLink,title:"Retour à l’accueil"},{default:we(()=>[Bs(xh,{"logo-text":l.logoText},null,8,["logo-text"])]),_:1},8,["to"]),l.operatorImgSrc?(m(),xt(d,{key:0,class:"fr-footer__brand-link",to:l.operatorTo,title:l.operatorLinkText},{default:we(()=>[b("img",{class:"fr-footer__logo fr-responsive-img",style:Mn([typeof l.operatorImgStyle=="string"?l.operatorImgStyle:"",{"margin-left":"0.5px",padding:"1rem",...typeof l.operatorImgStyle=="object"?l.operatorImgStyle:{},"max-width":"12.5rem"}]),src:l.operatorImgSrc,alt:l.operatorImgAlt},null,12,Jh)]),_:1},8,["to","title"])):j("",!0)]),b("div",Kh,[b("p",Zh,[dt(l.$slots,"description",{},()=>[St(U(l.descText),1)],!0)]),b("ul",Xh,[(m(!0),g(un,null,Ln(l.ecosystemLinks,(h,y)=>(m(),g("li",{key:y,class:"fr-footer__content-item"},[b("a",{class:"fr-footer__content-link",href:h.href,target:"_blank",rel:"noopener noreferrer"},U(h.label),9,Qh)]))),128))])])]),l.partners?(m(),xt(Ph,ro(Se({key:0},l.partners)),null,16)):j("",!0),b("div",tf,[b("ul",ef,[(m(!0),g(un,null,Ln(e.value,(h,y)=>(m(),g("li",{key:y,class:"fr-footer__bottom-item"},[typeof h.to=="string"&&h.to.startsWith("http")?(m(),g("a",{key:0,class:"fr-footer__bottom-link",href:h.to,"data-testid":h.to},U(h.label),9,nf)):(m(),xt(d,{key:1,class:"fr-footer__bottom-link",to:h.to??"#","data-testid":h.to},{default:we(()=>[St(U(h.label),1)]),_:2},1032,["to","data-testid"]))]))),128))]),l.licenceText?(m(),g("div",rf,[b("p",null,[St(U(l.licenceText)+" ",1),(m(),xt(cn(s.value?"a":"RouterLink"),Se({class:"fr-link-licence no-content-after",to:s.value?null:o.value,href:a.value,target:s.value?"_blank":void 0,rel:"noopener noreferrer"},l.licenceLinkProps),{default:we(()=>[St(U(l.licenceName),1)]),_:1},16,["to","href","target"]))])])):j("",!0)])])])}}}),Np=_s(sf,[["__scopeId","data-v-078e0714"]]),of=["for"],af={key:0,class:"required"},lf={key:0,class:"fr-hint-text"},cf=ft({inheritAttrs:!1,__name:"DsfrInput",props:{id:{default:()=>Ge("basic","input")},descriptionId:{default:void 0},hint:{default:""},isInvalid:{type:Boolean},isValid:{type:Boolean},isTextarea:{type:Boolean},isWithWrapper:{type:Boolean},labelVisible:{type:Boolean},label:{default:""},labelClass:{default:""},modelValue:{default:""},wrapperClass:{default:""}},setup(n,{expose:t}){const e=n,i=Nl(),r=It(null),s=()=>{var c;return(c=r.value)==null?void 0:c.focus()},o=L(()=>e.isTextarea?"textarea":"input"),a=L(()=>e.isWithWrapper||i.type==="date"||!!e.wrapperClass),l=L(()=>["fr-label",{invisible:!e.labelVisible},e.labelClass]);return t({focus:s}),(c,d)=>(m(),g(un,null,[b("label",{class:ut(l.value),for:c.id},[dt(c.$slots,"label",{},()=>[St(U(c.label)+" ",1),dt(c.$slots,"required-tip",{},()=>[c.$attrs.required?(m(),g("span",af," *")):j("",!0)],!0)],!0),c.hint?(m(),g("span",lf,U(c.hint),1)):j("",!0)],10,of),a.value?(m(),g("div",{key:1,class:ut([{"fr-input-wrap":c.isWithWrapper||c.$attrs.type==="date"},c.wrapperClass])},[(m(),xt(cn(o.value),Se({id:c.id},c.$attrs,{ref_key:"__input",ref:r,class:["fr-input",{"fr-input--error":c.isInvalid,"fr-input--valid":c.isValid}],value:c.modelValue,"aria-describedby":c.descriptionId||void 0,onInput:d[1]||(d[1]=h=>c.$emit("update:modelValue",h.target.value))}),null,16,["id","class","value","aria-describedby"]))],2)):(m(),xt(cn(o.value),Se({key:0,id:c.id},c.$attrs,{ref_key:"__input",ref:r,class:["fr-input",{"fr-input--error":c.isInvalid,"fr-input--valid":c.isValid}],value:c.modelValue,"aria-describedby":c.descriptionId||void 0,onInput:d[0]||(d[0]=h=>c.$emit("update:modelValue",h.target.value))}),null,16,["id","class","value","aria-describedby"]))],64))}}),xp=_s(cf,[["__scopeId","data-v-74e3acc7"]]);/*!
* tabbable 6.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/var dl=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Vi=dl.join(","),hl=typeof Element>"u",We=hl?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$i=!hl&&Element.prototype.getRootNode?function(n){var t;return n==null||(t=n.getRootNode)===null||t===void 0?void 0:t.call(n)}:function(n){return n?.ownerDocument},Pi=function n(t,e){var i;e===void 0&&(e=!0);var r=t==null||(i=t.getAttribute)===null||i===void 0?void 0:i.call(t,"inert"),s=r===""||r==="true",o=s||e&&t&&n(t.parentNode);return o},uf=function(n){var t,e=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return e===""||e==="true"},fl=function(n,t,e){if(Pi(n))return[];var i=Array.prototype.slice.apply(n.querySelectorAll(Vi));return t&&We.call(n,Vi)&&i.unshift(n),i=i.filter(e),i},pl=function n(t,e,i){for(var r=[],s=Array.from(t);s.length;){var o=s.shift();if(!Pi(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=n(l,!0,i);i.flatten?r.push.apply(r,c):r.push({scopeParent:o,candidates:c})}else{var d=We.call(o,Vi);d&&i.filter(o)&&(e||!t.includes(o))&&r.push(o);var h=o.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(o),y=!Pi(h,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(o));if(h&&y){var _=n(h===!0?o.children:h.children,!0,i);i.flatten?r.push.apply(r,_):r.push({scopeParent:o,candidates:_})}else s.unshift.apply(s,o.children)}}return r},yl=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},Ee=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||uf(n))&&!yl(n)?0:n.tabIndex},df=function(n,t){var e=Ee(n);return e<0&&t&&!yl(n)?0:e},hf=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},ml=function(n){return n.tagName==="INPUT"},ff=function(n){return ml(n)&&n.type==="hidden"},pf=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(e){return e.tagName==="SUMMARY"});return t},yf=function(n,t){for(var e=0;e<n.length;e++)if(n[e].checked&&n[e].form===t)return n[e]},mf=function(n){if(!n.name)return!0;var t=n.form||$i(n),e=function(s){return t.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=e(window.CSS.escape(n.name));else try{i=e(n.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var r=yf(i,n.form);return!r||r===n},vf=function(n){return ml(n)&&n.type==="radio"},bf=function(n){return vf(n)&&!mf(n)},gf=function(n){var t,e=n&&$i(n),i=(t=e)===null||t===void 0?void 0:t.host,r=!1;if(e&&e!==n){var s,o,a;for(r=!!((s=i)!==null&&s!==void 0&&(o=s.ownerDocument)!==null&&o!==void 0&&o.contains(i)||n!=null&&(a=n.ownerDocument)!==null&&a!==void 0&&a.contains(n));!r&&i;){var l,c,d;e=$i(i),i=(l=e)===null||l===void 0?void 0:l.host,r=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return r},Zs=function(n){var t=n.getBoundingClientRect(),e=t.width,i=t.height;return e===0&&i===0},_f=function(n,t){var e=t.displayCheck,i=t.getShadowRoot;if(getComputedStyle(n).visibility==="hidden")return!0;var r=We.call(n,"details>summary:first-of-type"),s=r?n.parentElement:n;if(We.call(s,"details:not([open]) *"))return!0;if(!e||e==="full"||e==="legacy-full"){if(typeof i=="function"){for(var o=n;n;){var a=n.parentElement,l=$i(n);if(a&&!a.shadowRoot&&i(a)===!0)return Zs(n);n.assignedSlot?n=n.assignedSlot:!a&&l!==n.ownerDocument?n=l.host:n=a}n=o}if(gf(n))return!n.getClientRects().length;if(e!=="legacy-full")return!0}else if(e==="non-zero-area")return Zs(n);return!1},wf=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var e=0;e<t.children.length;e++){var i=t.children.item(e);if(i.tagName==="LEGEND")return We.call(t,"fieldset[disabled] *")?!0:!i.contains(n)}return!0}t=t.parentElement}return!1},ji=function(n,t){return!(t.disabled||Pi(t)||ff(t)||_f(t,n)||pf(t)||wf(t))},Lr=function(n,t){return!(bf(t)||Ee(t)<0||!ji(n,t))},Sf=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},If=function n(t){var e=[],i=[];return t.forEach(function(r,s){var o=!!r.scopeParent,a=o?r.scopeParent:r,l=df(a,o),c=o?n(r.candidates):a;l===0?o?e.push.apply(e,c):e.push(a):i.push({documentOrder:s,tabIndex:l,item:r,isScope:o,content:c})}),i.sort(hf).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(e)},Bf=function(n,t){t=t||{};var e;return t.getShadowRoot?e=pl([n],t.includeContainer,{filter:Lr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Sf}):e=fl(n,t.includeContainer,Lr.bind(null,t)),If(e)},Of=function(n,t){t=t||{};var e;return t.getShadowRoot?e=pl([n],t.includeContainer,{filter:ji.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):e=fl(n,t.includeContainer,ji.bind(null,t)),e},Ze=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return We.call(n,Vi)===!1?!1:Lr(t,n)},Ff=dl.concat("iframe").join(","),yr=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return We.call(n,Ff)===!1?!1:ji(t,n)};/*!
* focus-trap 7.5.4
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/function Xs(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),e.push.apply(e,i)}return e}function Qs(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Xs(Object(e),!0).forEach(function(i){Af(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Xs(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function Af(n,t,e){return t=Tf(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function Df(n,t){if(typeof n!="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Tf(n){var t=Df(n,"string");return typeof t=="symbol"?t:String(t)}var to={activateTrap:function(n,t){if(n.length>0){var e=n[n.length-1];e!==t&&e.pause()}var i=n.indexOf(t);i===-1||n.splice(i,1),n.push(t)},deactivateTrap:function(n,t){var e=n.indexOf(t);e!==-1&&n.splice(e,1),n.length>0&&n[n.length-1].unpause()}},Nf=function(n){return n.tagName&&n.tagName.toLowerCase()==="input"&&typeof n.select=="function"},xf=function(n){return n?.key==="Escape"||n?.key==="Esc"||n?.keyCode===27},xn=function(n){return n?.key==="Tab"||n?.keyCode===9},Mf=function(n){return xn(n)&&!n.shiftKey},Lf=function(n){return xn(n)&&n.shiftKey},eo=function(n){return setTimeout(n,0)},no=function(n,t){var e=-1;return n.every(function(i,r){return t(i)?(e=r,!1):!0}),e},On=function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];return typeof n=="function"?n.apply(void 0,e):n},ti=function(n){return n.target.shadowRoot&&typeof n.composedPath=="function"?n.composedPath()[0]:n.target},Ef=[],Rf=function(n,t){var e=t?.document||document,i=t?.trapStack||Ef,r=Qs({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Mf,isKeyBackward:Lf},t),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,a=function(p,f,v){return p&&p[f]!==void 0?p[f]:r[v||f]},l=function(p,f){var v=typeof f?.composedPath=="function"?f.composedPath():void 0;return s.containerGroups.findIndex(function(Z){var H=Z.container,it=Z.tabbableNodes;return H.contains(p)||v?.includes(H)||it.find(function(ot){return ot===p})})},c=function(p){var f=r[p];if(typeof f=="function"){for(var v=arguments.length,Z=new Array(v>1?v-1:0),H=1;H<v;H++)Z[H-1]=arguments[H];f=f.apply(void 0,Z)}if(f===!0&&(f=void 0),!f){if(f===void 0||f===!1)return f;throw new Error("`".concat(p,"` was specified but was not a node, or did not return a node"))}var it=f;if(typeof f=="string"&&(it=e.querySelector(f),!it))throw new Error("`".concat(p,"` as selector refers to no known node"));return it},d=function(){var p=c("initialFocus");if(p===!1)return!1;if(p===void 0||!yr(p,r.tabbableOptions))if(l(e.activeElement)>=0)p=e.activeElement;else{var f=s.tabbableGroups[0],v=f&&f.firstTabbableNode;p=v||c("fallbackFocus")}if(!p)throw new Error("Your focus-trap needs to have at least one focusable element");return p},h=function(){if(s.containerGroups=s.containers.map(function(p){var f=Bf(p,r.tabbableOptions),v=Of(p,r.tabbableOptions),Z=f.length>0?f[0]:void 0,H=f.length>0?f[f.length-1]:void 0,it=v.find(function(at){return Ze(at)}),ot=v.slice().reverse().find(function(at){return Ze(at)}),vt=!!f.find(function(at){return Ee(at)>0});return{container:p,tabbableNodes:f,focusableNodes:v,posTabIndexesFound:vt,firstTabbableNode:Z,lastTabbableNode:H,firstDomTabbableNode:it,lastDomTabbableNode:ot,nextTabbableNode:function(at){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,In=f.indexOf(at);return In<0?Je?v.slice(v.indexOf(at)+1).find(function(se){return Ze(se)}):v.slice(0,v.indexOf(at)).reverse().find(function(se){return Ze(se)}):f[In+(Je?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(p){return p.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(p){return p.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},y=function p(f){var v=f.activeElement;if(v)return v.shadowRoot&&v.shadowRoot.activeElement!==null?p(v.shadowRoot):v},_=function p(f){if(f!==!1&&f!==y(document)){if(!f||!f.focus){p(d());return}f.focus({preventScroll:!!r.preventScroll}),s.mostRecentlyFocusedNode=f,Nf(f)&&f.select()}},G=function(p){var f=c("setReturnFocus",p);return f||(f===!1?!1:p)},et=function(p){var f=p.target,v=p.event,Z=p.isBackward,H=Z===void 0?!1:Z;f=f||ti(v),h();var it=null;if(s.tabbableGroups.length>0){var ot=l(f,v),vt=ot>=0?s.containerGroups[ot]:void 0;if(ot<0)H?it=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:it=s.tabbableGroups[0].firstTabbableNode;else if(H){var at=no(s.tabbableGroups,function(rr){var sr=rr.firstTabbableNode;return f===sr});if(at<0&&(vt.container===f||yr(f,r.tabbableOptions)&&!Ze(f,r.tabbableOptions)&&!vt.nextTabbableNode(f,!1))&&(at=ot),at>=0){var Je=at===0?s.tabbableGroups.length-1:at-1,In=s.tabbableGroups[Je];it=Ee(f)>=0?In.lastTabbableNode:In.lastDomTabbableNode}else xn(v)||(it=vt.nextTabbableNode(f,!1))}else{var se=no(s.tabbableGroups,function(rr){var sr=rr.lastTabbableNode;return f===sr});if(se<0&&(vt.container===f||yr(f,r.tabbableOptions)&&!Ze(f,r.tabbableOptions)&&!vt.nextTabbableNode(f))&&(se=ot),se>=0){var bl=se===s.tabbableGroups.length-1?0:se+1,Ss=s.tabbableGroups[bl];it=Ee(f)>=0?Ss.firstTabbableNode:Ss.firstDomTabbableNode}else xn(v)||(it=vt.nextTabbableNode(f))}}else it=c("fallbackFocus");return it},st=function(p){var f=ti(p);if(!(l(f,p)>=0)){if(On(r.clickOutsideDeactivates,p)){o.deactivate({returnFocus:r.returnFocusOnDeactivate});return}On(r.allowOutsideClick,p)||p.preventDefault()}},nt=function(p){var f=ti(p),v=l(f,p)>=0;if(v||f instanceof Document)v&&(s.mostRecentlyFocusedNode=f);else{p.stopImmediatePropagation();var Z,H=!0;if(s.mostRecentlyFocusedNode)if(Ee(s.mostRecentlyFocusedNode)>0){var it=l(s.mostRecentlyFocusedNode),ot=s.containerGroups[it].tabbableNodes;if(ot.length>0){var vt=ot.findIndex(function(at){return at===s.mostRecentlyFocusedNode});vt>=0&&(r.isKeyForward(s.recentNavEvent)?vt+1<ot.length&&(Z=ot[vt+1],H=!1):vt-1>=0&&(Z=ot[vt-1],H=!1))}}else s.containerGroups.some(function(at){return at.tabbableNodes.some(function(Je){return Ee(Je)>0})})||(H=!1);else H=!1;H&&(Z=et({target:s.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(s.recentNavEvent)})),_(Z||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},He=function(p){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=p;var v=et({event:p,isBackward:f});v&&(xn(p)&&p.preventDefault(),_(v))},wn=function(p){if(xf(p)&&On(r.escapeDeactivates,p)!==!1){p.preventDefault(),o.deactivate();return}(r.isKeyForward(p)||r.isKeyBackward(p))&&He(p,r.isKeyBackward(p))},Me=function(p){var f=ti(p);l(f,p)>=0||On(r.clickOutsideDeactivates,p)||On(r.allowOutsideClick,p)||(p.preventDefault(),p.stopImmediatePropagation())},qe=function(){if(s.active)return to.activateTrap(i,o),s.delayInitialFocusTimer=r.delayInitialFocus?eo(function(){_(d())}):_(d()),e.addEventListener("focusin",nt,!0),e.addEventListener("mousedown",st,{capture:!0,passive:!1}),e.addEventListener("touchstart",st,{capture:!0,passive:!1}),e.addEventListener("click",Me,{capture:!0,passive:!1}),e.addEventListener("keydown",wn,{capture:!0,passive:!1}),o},ws=function(){if(s.active)return e.removeEventListener("focusin",nt,!0),e.removeEventListener("mousedown",st,!0),e.removeEventListener("touchstart",st,!0),e.removeEventListener("click",Me,!0),e.removeEventListener("keydown",wn,!0),o},vl=function(p){var f=p.some(function(v){var Z=Array.from(v.removedNodes);return Z.some(function(H){return H===s.mostRecentlyFocusedNode})});f&&_(d())},ir=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(vl):void 0,Sn=function(){ir&&(ir.disconnect(),s.active&&!s.paused&&s.containers.map(function(p){ir.observe(p,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(p){if(s.active)return this;var f=a(p,"onActivate"),v=a(p,"onPostActivate"),Z=a(p,"checkCanFocusTrap");Z||h(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=e.activeElement,f?.();var H=function(){Z&&h(),qe(),Sn(),v?.()};return Z?(Z(s.containers.concat()).then(H,H),this):(H(),this)},deactivate:function(p){if(!s.active)return this;var f=Qs({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},p);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,ws(),s.active=!1,s.paused=!1,Sn(),to.deactivateTrap(i,o);var v=a(f,"onDeactivate"),Z=a(f,"onPostDeactivate"),H=a(f,"checkCanReturnFocus"),it=a(f,"returnFocus","returnFocusOnDeactivate");v?.();var ot=function(){eo(function(){it&&_(G(s.nodeFocusedBeforeActivation)),Z?.()})};return it&&H?(H(G(s.nodeFocusedBeforeActivation)).then(ot,ot),this):(ot(),this)},pause:function(p){if(s.paused||!s.active)return this;var f=a(p,"onPause"),v=a(p,"onPostPause");return s.paused=!0,f?.(),ws(),Sn(),v?.(),this},unpause:function(p){if(!s.paused||!s.active)return this;var f=a(p,"onUnpause"),v=a(p,"onPostUnpause");return s.paused=!1,f?.(),h(),qe(),Sn(),v?.(),this},updateContainerElements:function(p){var f=[].concat(p).filter(Boolean);return s.containers=f.map(function(v){return typeof v=="string"?e.querySelector(v):v}),s.active&&h(),Sn(),this}},o.updateContainerElements(n),o};/*!
  * focus-trap-vue v4.0.2
  * (c) 2023 Eduardo San Martin Morote
  * @license MIT
  */const Cf={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object};ft({props:Object.assign({active:{type:Boolean,default:!0}},Cf),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(n,{slots:t,emit:e}){let i;const r=It(null),s=L(()=>{const a=r.value;return a&&(a instanceof HTMLElement?a:a.$el)});function o(){return i||(i=Rf(s.value,{escapeDeactivates:n.escapeDeactivates,allowOutsideClick:n.allowOutsideClick,returnFocusOnDeactivate:n.returnFocusOnDeactivate,clickOutsideDeactivates:n.clickOutsideDeactivates,onActivate:()=>{e("update:active",!0),e("activate")},onDeactivate:()=>{e("update:active",!1),e("deactivate")},onPostActivate:()=>e("postActivate"),onPostDeactivate:()=>e("postDeactivate"),initialFocus:n.initialFocus,fallbackFocus:n.fallbackFocus,tabbableOptions:n.tabbableOptions,delayInitialFocus:n.delayInitialFocus,preventScroll:n.preventScroll}))}return Pn(()=>{Rr(()=>n.active,a=>{a&&s.value?o().activate():i&&(i.deactivate(),(!s.value||s.value.nodeType===Node.COMMENT_NODE)&&(i=null))},{immediate:!0,flush:"post"})}),io(()=>{i&&i.deactivate(),i=null}),{activate(){o().activate()},deactivate(){i&&i.deactivate()},renderImpl(){if(!t.default)return null;const a=t.default().filter(l=>l.type!==Il);return!a||!a.length||a.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),a):Bl(a[0],{ref:r})}}}});const kf=["aria-label"],Uf={class:"fr-content-media__img"},Vf=["src","alt","title","ratio"],$f={class:"fr-content-media__caption"},Mp=ft({__name:"DsfrPicture",props:{alt:{default:""},legend:{default:""},size:{default:"medium"},src:{},title:{default:""},ratio:{default:"16x9"}},setup(n){return(t,e)=>(m(),g("figure",{class:ut(["fr-content-media",{"fr-content-media--sm":t.size=="small","fr-content-media--lg":t.size=="large"}]),role:"group","aria-label":t.legend},[b("div",Uf,[dt(t.$slots,"default",{},()=>[t.src?(m(),g("img",{key:0,src:t.src,class:ut(["fr-responsive-img",`fr-ratio-${t.ratio}`]),alt:t.alt,title:t.title,ratio:t.ratio},null,10,Vf)):j("",!0)])]),b("figcaption",$f,U(t.legend),1)],10,kf))}}),Pf=["id","name","value","checked"],jf=["for"],zf={key:0,class:"required"},Wf={key:0,class:"fr-hint-text"},Yf={key:0,class:"fr-radio-rich__pictogram"},Gf=["src"],Hf=ft({__name:"DsfrRadioButton",props:{id:{default:()=>Ge("basic","checkbox")},name:{},modelValue:{default:""},small:{type:Boolean},inline:{type:Boolean},value:{},label:{default:""},hint:{default:""},img:{default:""}},emits:["update:modelValue"],setup(n){const t=n,e=L(()=>!!t.img);return(i,r)=>(m(),g("div",{class:ut(["fr-fieldset__element",{"fr-fieldset__element--inline":i.inline}])},[b("div",{class:ut(["fr-radio-group",{"fr-radio-rich":e.value,"fr-radio-group--sm":i.small}])},[b("input",Se({id:i.id,type:"radio",name:i.name,value:i.value,checked:i.modelValue===i.value},i.$attrs,{onClick:r[0]||(r[0]=s=>i.$emit("update:modelValue",i.value))}),null,16,Pf),b("label",{for:i.id,class:"fr-label"},[dt(i.$slots,"label",{},()=>[St(U(i.label)+" ",1),dt(i.$slots,"required-tip",{},()=>[i.$attrs.required?(m(),g("span",zf," *")):j("",!0)])]),i.hint?(m(),g("span",Wf,U(i.hint),1)):j("",!0)],8,jf),i.img?(m(),g("div",Yf,[b("img",{src:i.img,alt:""},null,8,Gf)])):j("",!0)],2)],2))}}),qf={class:"fr-form-group"},Jf=["disabled","aria-labelledby","role"],Kf=["id"],Zf={key:0,class:"required"},Xf=["id"],Qf={class:"line-1"},Lp=ft({__name:"DsfrRadioButtonSet",props:{titleId:{default:()=>Ge("radio-button","group")},disabled:{type:Boolean},required:{type:Boolean},small:{type:Boolean},inline:{type:Boolean},name:{default:"no-name"},errorMessage:{default:""},validMessage:{default:""},legend:{default:""},modelValue:{},options:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=t,r=L(()=>e.errorMessage||e.validMessage),s=L(()=>e.errorMessage?"fr-error-text":"fr-valid-text"),o=a=>{a!==e.modelValue&&i("update:modelValue",a)};return(a,l)=>(m(),g("div",qf,[b("fieldset",{class:ut(["fr-fieldset",{"fr-fieldset--error":a.errorMessage,"fr-fieldset--valid":a.validMessage}]),disabled:a.disabled,"aria-labelledby":`${a.titleId} messages-${a.titleId}`,role:a.errorMessage||a.validMessage?"group":void 0},[a.legend?(m(),g("legend",{key:0,id:a.titleId,class:"fr-fieldset__legend fr-fieldset__legend--regular"},[dt(a.$slots,"legend",{},()=>[St(U(a.legend)+" ",1),dt(a.$slots,"required-tip",{},()=>[a.required?(m(),g("span",Zf," *")):j("",!0)])])],8,Kf)):j("",!0),dt(a.$slots,"default",{},()=>[(m(!0),g(un,null,Ln(a.options,(c,d)=>(m(),xt(Hf,Se({key:c.value||d,name:a.name},c,{small:a.small,inline:a.inline,"model-value":a.modelValue,"onUpdate:modelValue":l[0]||(l[0]=h=>o(h))}),null,16,["name","small","inline","model-value"]))),128))]),r.value?(m(),g("div",{key:1,id:`messages-${a.titleId}`,class:"fr-messages-group","aria-live":"assertive"},[b("p",{class:ut(["fr-message--info flex items-center",s.value])},[b("span",Qf,U(r.value),1)],2)],8,Xf)):j("",!0)],10,Jf)]))}}),tp=["id"],ep=["id"],np={class:"fr-hint-text"},ip=["data-fr-prefix","data-fr-suffix"],rp=["id","min","max","step","value","disabled","aria-labelledby","aria-describedby"],sp=["id","min","max","step","value","disabled","aria-labelledby","aria-describedby"],op={key:1,class:"fr-range__min","aria-hidden":"true","data-fr-js-range-limit":"true"},ap={key:2,class:"fr-range__max","aria-hidden":"true","data-fr-js-range-limit":"true"},lp=["id"],cp=["id"],Ep=ft({__name:"DsfrRange",props:{id:{default:()=>Ge("range")},min:{default:0},max:{default:100},modelValue:{default:0},lowerValue:{default:void 0},label:{},hint:{default:void 0},message:{default:void 0},prefix:{default:void 0},suffix:{default:void 0},small:{type:Boolean},hideIndicators:{type:Boolean},step:{default:void 0},disabled:{type:Boolean}},emits:["update:modelValue","update:lowerValue"],setup(n,{emit:t}){const e=n,i=t,r=It(),s=It(),o=It(),a=L(()=>e.lowerValue!==void 0),l=L(()=>e.lowerValue===void 0?`transform: translateX(${(e.modelValue-e.min)/(e.max-e.min)*o.value}px) translateX(-${e.modelValue}%);`:`transform: translateX(${(e.modelValue+e.lowerValue-e.min)/2/(e.max-e.min)*o.value}px) translateX(-${e.lowerValue+(e.modelValue-e.lowerValue)/2}%);`),c=L(()=>{const h=(e.modelValue-e.min)/(e.max-e.min)*o.value-(a.value?12:0),y=((e.lowerValue??0)-e.min)/(e.max-e.min)*o.value;return{"--progress-right":h+24+"px",...a.value?{"--progress-left":y+12+"px"}:{}}});Rr([()=>e.modelValue,()=>e.lowerValue],([h,y])=>{y!==void 0&&(a.value&&h<y&&i("update:lowerValue",h),a.value&&y>h&&i("update:modelValue",y))});const d=L(()=>(e.prefix??"").concat(a.value?`${e.lowerValue} - `:"").concat(""+e.modelValue).concat(e.suffix??""));return Pn(()=>{var h;o.value=(h=r.value)==null?void 0:h.offsetWidth}),(h,y)=>(m(),g("div",{id:`${h.id}-group`,class:ut(["fr-range-group",{"fr-range-group--error":h.message}])},[b("label",{id:`${h.id}-label`,class:"fr-label"},[dt(h.$slots,"label",{},()=>[St(U(h.label),1)]),b("span",np,[dt(h.$slots,"hint",{},()=>[St(U(h.hint),1)])])],8,ep),b("div",{class:ut(["fr-range",{"fr-range--sm":h.small,"fr-range--double":a.value,"fr-range-group--disabled":h.disabled}]),"data-fr-js-range":"true","data-fr-prefix":h.prefix??void 0,"data-fr-suffix":h.suffix??void 0,style:Mn(c.value)},[b("span",{ref_key:"output",ref:s,class:"fr-range__output","data-fr-js-range-output":"true",style:Mn(l.value)},U(d.value),5),a.value?(m(),g("input",{key:0,id:`${h.id}-2`,type:"range",min:h.min,max:h.max,step:h.step,value:h.lowerValue,disabled:h.disabled,"aria-labelledby":`${h.id}-label`,"aria-describedby":`${h.id}-messages`,onInput:y[0]||(y[0]=_=>{var G;return i("update:lowerValue",+((G=_.target)==null?void 0:G.value))})},null,40,rp)):j("",!0),b("input",{id:h.id,ref_key:"input",ref:r,type:"range",min:h.min,max:h.max,step:h.step,value:h.modelValue,disabled:h.disabled,"aria-labelledby":`${h.id}-label`,"aria-describedby":`${h.id}-messages`,onInput:y[1]||(y[1]=_=>{var G;return i("update:modelValue",+((G=_.target)==null?void 0:G.value))})},null,40,sp),h.hideIndicators?j("",!0):(m(),g("span",op,U(h.min),1)),h.hideIndicators?j("",!0):(m(),g("span",ap,U(h.max),1))],14,ip),b("div",{id:`${h.id}-messages`,class:"fr-messages-group","aria-live":"polite"},[dt(h.$slots,"messages",{},()=>[h.message?(m(),g("p",{key:0,id:`${h.id}-message-error`,class:"fr-message fr-message--error"},U(h.message),9,cp)):j("",!0)])],8,lp)],10,tp))}});function Rp(){Pn(()=>{Ht.setFrameHeight()}),Er(()=>{Ht.setFrameHeight()})}export{Dp as A,Ep as E,xp as G,Bp as S,ul as _,Ht as a,Tp as b,Np as c,Mp as e,Op as f,Fp as h,Ap as k,Rp as u,Lp as w};
