diff --git "a/dist/assets/index-DBxDuz_B.js" "b/dist/assets/index-DBxDuz_B.js" new file mode 100644--- /dev/null +++ "b/dist/assets/index-DBxDuz_B.js" @@ -0,0 +1,43 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var eh={exports:{}},Ml={},nh={exports:{}},Q={};/** + * @license React + * 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 xs=Symbol.for("react.element"),Og=Symbol.for("react.portal"),Dg=Symbol.for("react.fragment"),Rg=Symbol.for("react.strict_mode"),Fg=Symbol.for("react.profiler"),Ag=Symbol.for("react.provider"),xg=Symbol.for("react.context"),Bg=Symbol.for("react.forward_ref"),Cg=Symbol.for("react.suspense"),Lg=Symbol.for("react.memo"),Mg=Symbol.for("react.lazy"),_d=Symbol.iterator;function Pg(e){return e===null||typeof e!="object"?null:(e=_d&&e[_d]||e["@@iterator"],typeof e=="function"?e:null)}var rh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ih=Object.assign,sh={};function Ri(e,t,n){this.props=e,this.context=t,this.refs=sh,this.updater=n||rh}Ri.prototype.isReactComponent={};Ri.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ri.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function oh(){}oh.prototype=Ri.prototype;function qu(e,t,n){this.props=e,this.context=t,this.refs=sh,this.updater=n||rh}var Xu=qu.prototype=new oh;Xu.constructor=qu;ih(Xu,Ri.prototype);Xu.isPureReactComponent=!0;var Sd=Array.isArray,lh=Object.prototype.hasOwnProperty,Zu={current:null},ah={key:!0,ref:!0,__self:!0,__source:!0};function uh(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)lh.call(t,r)&&!ah.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,Rt=I[Z];if(0>>1;Zi(ra,V))pri(Ys,ra)?(I[Z]=Ys,I[pr]=V,Z=pr):(I[Z]=ra,I[hr]=V,Z=hr);else if(pri(Ys,V))I[Z]=Ys,I[pr]=V,Z=pr;else break t}}return M}function i(I,M){var V=I.sortIndex-M.sortIndex;return V!==0?V:I.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,h=null,y=3,g=!1,v=!1,w=!1,O=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(I){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=I)r(u),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(u)}}function _(I){if(w=!1,m(I),!v)if(n(a)!==null)v=!0,Rn(b);else{var M=n(u);M!==null&&Ur(_,M.startTime-I)}}function b(I,M){v=!1,w&&(w=!1,p(T),T=-1),g=!0;var V=y;try{for(m(M),h=n(a);h!==null&&(!(h.expirationTime>M)||I&&!jt());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,y=h.priorityLevel;var Rt=Z(h.expirationTime<=M);M=e.unstable_now(),typeof Rt=="function"?h.callback=Rt:h===n(a)&&r(a),m(M)}else r(a);h=n(a)}if(h!==null)var Hs=!0;else{var hr=n(u);hr!==null&&Ur(_,hr.startTime-M),Hs=!1}return Hs}finally{h=null,y=V,g=!1}}var N=!1,k=null,T=-1,dt=5,Y=-1;function jt(){return!(e.unstable_now()-YI||125Z?(I.sortIndex=V,t(u,I),n(a)===null&&I===n(u)&&(w?(p(T),T=-1):w=!0,Ur(_,V-Z))):(I.sortIndex=Rt,t(a,I),v||g||(v=!0,Rn(b))),I},e.unstable_shouldYield=jt,e.unstable_wrapCallback=function(I){var M=y;return function(){var V=y;y=M;try{return I.apply(this,arguments)}finally{y=V}}}})(ph);hh.exports=ph;var Kg=hh.exports;/** + * @license React + * react-dom.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 Jg=J,he=Kg;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$a=Object.prototype.hasOwnProperty,qg=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Id={},Ed={};function Xg(e){return $a.call(Ed,e)?!0:$a.call(Id,e)?!1:qg.test(e)?Ed[e]=!0:(Id[e]=!0,!1)}function Zg(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tv(e,t,n,r){if(t===null||typeof t>"u"||Zg(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Qt(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Lt[e]=new Qt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Lt[t]=new Qt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Lt[e]=new Qt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Lt[e]=new Qt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Lt[e]=new Qt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Lt[e]=new Qt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Lt[e]=new Qt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Lt[e]=new Qt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Lt[e]=new Qt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ec=/[\-:]([a-z])/g;function nc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ec,nc);Lt[t]=new Qt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ec,nc);Lt[t]=new Qt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ec,nc);Lt[t]=new Qt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Lt[e]=new Qt(e,1,!1,e.toLowerCase(),null,!1,!1)});Lt.xlinkHref=new Qt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Lt[e]=new Qt(e,1,!1,e.toLowerCase(),null,!0,!0)});function rc(e,t,n,r){var i=Lt.hasOwnProperty(t)?Lt[t]:null;(i!==null?i.type!==0:r||!(2l||i[o]!==s[l]){var a=` +`+i[o].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{oa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gi(e):""}function ev(e){switch(e.tag){case 5:return Gi(e.type);case 16:return Gi("Lazy");case 13:return Gi("Suspense");case 19:return Gi("SuspenseList");case 0:case 2:case 15:return e=la(e.type,!1),e;case 11:return e=la(e.type.render,!1),e;case 1:return e=la(e.type,!0),e;default:return""}}function Ga(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Gr:return"Fragment";case Yr:return"Portal";case Wa:return"Profiler";case ic:return"StrictMode";case Ha:return"Suspense";case Ya:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gh:return(e.displayName||"Context")+".Consumer";case mh:return(e._context.displayName||"Context")+".Provider";case sc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oc:return t=e.displayName||null,t!==null?t:Ga(e.type)||"Memo";case Cn:t=e._payload,e=e._init;try{return Ga(e(t))}catch{}}return null}function nv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ga(t);case 8:return t===ic?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function qn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rv(e){var t=wh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ks(e){e._valueTracker||(e._valueTracker=rv(e))}function _h(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=wh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Qa(e,t){var n=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function kd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Sh(e,t){t=t.checked,t!=null&&rc(e,"checked",t,!1)}function Ka(e,t){Sh(e,t);var n=qn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ja(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ja(e,t.type,qn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Td(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ja(e,t,n){(t!=="number"||Lo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qi=Array.isArray;function si(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Js.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function us(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iv=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){iv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});function Nh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xi.hasOwnProperty(e)&&Xi[e]?(""+t).trim():t+"px"}function kh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Nh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var sv=St({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Za(e,t){if(t){if(sv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62))}}function tu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var eu=null;function lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nu=null,oi=null,li=null;function Rd(e){if(e=Ls(e)){if(typeof nu!="function")throw Error(S(280));var t=e.stateNode;t&&(t=Vl(t),nu(e.stateNode,e.type,t))}}function Th(e){oi?li?li.push(e):li=[e]:oi=e}function Oh(){if(oi){var e=oi,t=li;if(li=oi=null,Rd(e),t)for(e=0;e>>=0,e===0?32:31-(mv(e)/gv|0)|0}var qs=64,Xs=4194304;function Ki(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Ki(l):(s&=o,s!==0&&(r=Ki(s)))}else o=n&~i,o!==0?r=Ki(o):s!==0&&(r=Ki(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Bs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Be(t),e[t]=n}function Sv(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ts),Ud=" ",zd=!1;function Qh(e,t){switch(e){case"keyup":return Kv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qr=!1;function qv(e,t){switch(e){case"compositionend":return Kh(t);case"keypress":return t.which!==32?null:(zd=!0,Ud);case"textInput":return e=t.data,e===Ud&&zd?null:e;default:return null}}function Xv(e,t){if(Qr)return e==="compositionend"||!yc&&Qh(e,t)?(e=Yh(),vo=fc=jn=null,Qr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Wd(n)}}function Zh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tp(){for(var e=window,t=Lo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lo(e.document)}return t}function mc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function l0(e){var t=tp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Zh(n.ownerDocument.documentElement,n)){if(r!==null&&mc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Hd(n,s);var o=Hd(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Kr=null,au=null,ns=null,uu=!1;function Yd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uu||Kr==null||Kr!==Lo(r)||(r=Kr,"selectionStart"in r&&mc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ns&&ys(ns,r)||(ns=r,r=$o(au,"onSelect"),0Xr||(e.current=yu[Xr],yu[Xr]=null,Xr--)}function ct(e,t){Xr++,yu[Xr]=e.current,e.current=t}var Xn={},zt=ar(Xn),ne=ar(!1),Fr=Xn;function vi(e,t){var n=e.type.contextTypes;if(!n)return Xn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function re(e){return e=e.childContextTypes,e!=null}function Ho(){pt(ne),pt(zt)}function Zd(e,t,n){if(zt.current!==Xn)throw Error(S(168));ct(zt,t),ct(ne,n)}function up(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(S(108,nv(e)||"Unknown",i));return St({},n,r)}function Yo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xn,Fr=zt.current,ct(zt,e),ct(ne,ne.current),!0}function tf(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=up(e,t,Fr),r.__reactInternalMemoizedMergedChildContext=e,pt(ne),pt(zt),ct(zt,e)):pt(ne),ct(ne,n)}var pn=null,$l=!1,Sa=!1;function cp(e){pn===null?pn=[e]:pn.push(e)}function w0(e){$l=!0,cp(e)}function ur(){if(!Sa&&pn!==null){Sa=!0;var e=0,t=ot;try{var n=pn;for(ot=1;e>=o,i-=o,gn=1<<32-Be(t)+i|n<T?(dt=k,k=null):dt=k.sibling;var Y=y(p,k,m[T],_);if(Y===null){k===null&&(k=dt);break}e&&k&&Y.alternate===null&&t(p,k),f=s(Y,f,T),N===null?b=Y:N.sibling=Y,N=Y,k=dt}if(T===m.length)return n(p,k),gt&&mr(p,T),b;if(k===null){for(;TT?(dt=k,k=null):dt=k.sibling;var jt=y(p,k,Y.value,_);if(jt===null){k===null&&(k=dt);break}e&&k&&jt.alternate===null&&t(p,k),f=s(jt,f,T),N===null?b=jt:N.sibling=jt,N=jt,k=dt}if(Y.done)return n(p,k),gt&&mr(p,T),b;if(k===null){for(;!Y.done;T++,Y=m.next())Y=h(p,Y.value,_),Y!==null&&(f=s(Y,f,T),N===null?b=Y:N.sibling=Y,N=Y);return gt&&mr(p,T),b}for(k=r(p,k);!Y.done;T++,Y=m.next())Y=g(k,p,T,Y.value,_),Y!==null&&(e&&Y.alternate!==null&&k.delete(Y.key===null?T:Y.key),f=s(Y,f,T),N===null?b=Y:N.sibling=Y,N=Y);return e&&k.forEach(function(et){return t(p,et)}),gt&&mr(p,T),b}function O(p,f,m,_){if(typeof m=="object"&&m!==null&&m.type===Gr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Qs:t:{for(var b=m.key,N=f;N!==null;){if(N.key===b){if(b=m.type,b===Gr){if(N.tag===7){n(p,N.sibling),f=i(N,m.props.children),f.return=p,p=f;break t}}else if(N.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Cn&&rf(b)===N.type){n(p,N.sibling),f=i(N,m.props),f.ref=ji(p,N,m),f.return=p,p=f;break t}n(p,N);break}else t(p,N);N=N.sibling}m.type===Gr?(f=Dr(m.props.children,p.mode,_,m.key),f.return=p,p=f):(_=ko(m.type,m.key,m.props,null,p.mode,_),_.ref=ji(p,f,m),_.return=p,p=_)}return o(p);case Yr:t:{for(N=m.key;f!==null;){if(f.key===N)if(f.tag===4&&f.stateNode.containerInfo===m.containerInfo&&f.stateNode.implementation===m.implementation){n(p,f.sibling),f=i(f,m.children||[]),f.return=p,p=f;break t}else{n(p,f);break}else t(p,f);f=f.sibling}f=Da(m,p.mode,_),f.return=p,p=f}return o(p);case Cn:return N=m._init,O(p,f,N(m._payload),_)}if(Qi(m))return v(p,f,m,_);if(Li(m))return w(p,f,m,_);so(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,f!==null&&f.tag===6?(n(p,f.sibling),f=i(f,m),f.return=p,p=f):(n(p,f),f=Oa(m,p.mode,_),f.return=p,p=f),o(p)):n(p,f)}return O}var _i=pp(!0),yp=pp(!1),Ko=ar(null),Jo=null,ei=null,_c=null;function Sc(){_c=ei=Jo=null}function bc(e){var t=Ko.current;pt(Ko),e._currentValue=t}function vu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ui(e,t){Jo=e,_c=ei=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ee=!0),e.firstContext=null)}function ke(e){var t=e._currentValue;if(_c!==e)if(e={context:e,memoizedValue:t,next:null},ei===null){if(Jo===null)throw Error(S(308));ei=e,Jo.dependencies={lanes:0,firstContext:e}}else ei=ei.next=e;return t}var _r=null;function Ic(e){_r===null?_r=[e]:_r.push(e)}function mp(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ic(t)):(n.next=i.next,i.next=n),t.interleaved=n,bn(e,r)}function bn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ln=!1;function Ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function wn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,bn(e,n)}return i=r.interleaved,i===null?(t.next=t,Ic(r)):(t.next=i.next,i.next=t),r.interleaved=t,bn(e,n)}function _o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,uc(e,n)}}function sf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function qo(e,t,n,r){var i=e.updateQueue;Ln=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?s=u:o.next=u,o=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==o&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(s!==null){var h=i.baseState;o=0,c=u=a=null,l=s;do{var y=l.lane,g=l.eventTime;if((r&y)===y){c!==null&&(c=c.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});t:{var v=e,w=l;switch(y=t,g=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){h=v.call(g,h,y);break t}h=v;break t;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,y=typeof v=="function"?v.call(g,h,y):v,y==null)break t;h=St({},h,y);break t;case 2:Ln=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,y=i.effects,y===null?i.effects=[l]:y.push(l))}else g={eventTime:g,lane:y,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=g,a=h):c=c.next=g,o|=y;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;y=l,l=y.next,y.next=null,i.lastBaseUpdate=y,i.shared.pending=null}}while(!0);if(c===null&&(a=h),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Br|=o,e.lanes=o,e.memoizedState=h}}function of(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ia.transition;Ia.transition={};try{e(!1),t()}finally{ot=n,Ia.transition=r}}function Bp(){return Te().memoizedState}function I0(e,t,n){var r=Kn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cp(e))Lp(t,n);else if(n=mp(e,t,n,r),n!==null){var i=Ht();Ce(n,e,r,i),Mp(n,t,r)}}function E0(e,t,n){var r=Kn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cp(e))Lp(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,Me(l,o)){var a=t.interleaved;a===null?(i.next=i,Ic(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=mp(e,t,i,r),n!==null&&(i=Ht(),Ce(n,e,r,i),Mp(n,t,r))}}function Cp(e){var t=e.alternate;return e===_t||t!==null&&t===_t}function Lp(e,t){rs=Zo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Mp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,uc(e,n)}}var tl={readContext:ke,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useInsertionEffect:Mt,useLayoutEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useMutableSource:Mt,useSyncExternalStore:Mt,useId:Mt,unstable_isNewReconciler:!1},N0={readContext:ke,useCallback:function(e,t){return Ve().memoizedState=[e,t===void 0?null:t],e},useContext:ke,useEffect:af,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bo(4194308,4,Dp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bo(4194308,4,e,t)},useInsertionEffect:function(e,t){return bo(4,2,e,t)},useMemo:function(e,t){var n=Ve();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ve();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=I0.bind(null,_t,e),[r.memoizedState,e]},useRef:function(e){var t=Ve();return e={current:e},t.memoizedState=e},useState:lf,useDebugValue:Ac,useDeferredValue:function(e){return Ve().memoizedState=e},useTransition:function(){var e=lf(!1),t=e[0];return e=b0.bind(null,e[1]),Ve().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=_t,i=Ve();if(gt){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),At===null)throw Error(S(349));xr&30||Sp(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,af(Ip.bind(null,r,s,e),[e]),r.flags|=2048,Is(9,bp.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ve(),t=At.identifierPrefix;if(gt){var n=vn,r=gn;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ss++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[He]=t,e[vs]=r,Gp(e,t,!1,!1),t.stateNode=e;t:{switch(o=tu(n,r),n){case"dialog":ht("cancel",e),ht("close",e),i=r;break;case"iframe":case"object":case"embed":ht("load",e),i=r;break;case"video":case"audio":for(i=0;iIi&&(t.flags|=128,r=!0,Vi(s,!1),t.lanes=4194304)}else{if(!r)if(e=Xo(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!gt)return Pt(t),null}else 2*It()-s.renderingStartTime>Ii&&n!==1073741824&&(t.flags|=128,r=!0,Vi(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=It(),t.sibling=null,n=vt.current,ct(vt,r?n&1|2:n&1),t):(Pt(t),null);case 22:case 23:return Pc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ue&1073741824&&(Pt(t),t.subtreeFlags&6&&(t.flags|=8192)):Pt(t),null;case 24:return null;case 25:return null}throw Error(S(156,t.tag))}function x0(e,t){switch(vc(t),t.tag){case 1:return re(t.type)&&Ho(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Si(),pt(ne),pt(zt),Tc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return kc(t),null;case 13:if(pt(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(vt),null;case 4:return Si(),null;case 10:return bc(t.type._context),null;case 22:case 23:return Pc(),null;case 24:return null;default:return null}}var lo=!1,Ut=!1,B0=typeof WeakSet=="function"?WeakSet:Set,E=null;function ni(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){bt(e,t,r)}else n.current=null}function Tu(e,t,n){try{n()}catch(r){bt(e,t,r)}}var wf=!1;function C0(e,t){if(cu=jo,e=tp(),mc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var o=0,l=-1,a=-1,u=0,c=0,h=e,y=null;e:for(;;){for(var g;h!==n||i!==0&&h.nodeType!==3||(l=o+i),h!==s||r!==0&&h.nodeType!==3||(a=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)y=h,h=g;for(;;){if(h===e)break e;if(y===n&&++u===i&&(l=o),y===s&&++c===r&&(a=o),(g=h.nextSibling)!==null)break;h=y,y=h.parentNode}h=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(du={focusedElem:e,selectionRange:n},jo=!1,E=t;E!==null;)if(t=E,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,E=e;else for(;E!==null;){t=E;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,O=v.memoizedState,p=t.stateNode,f=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:Re(t.type,w),O);p.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(_){bt(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,E=e;break}E=t.return}return v=wf,wf=!1,v}function is(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Tu(t,n,s)}i=i.next}while(i!==r)}}function Yl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ou(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Jp(e){var t=e.alternate;t!==null&&(e.alternate=null,Jp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[He],delete t[vs],delete t[pu],delete t[g0],delete t[v0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qp(e){return e.tag===5||e.tag===3||e.tag===4}function _f(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||qp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Du(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wo));else if(r!==4&&(e=e.child,e!==null))for(Du(e,t,n),e=e.sibling;e!==null;)Du(e,t,n),e=e.sibling}function Ru(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ru(e,t,n),e=e.sibling;e!==null;)Ru(e,t,n),e=e.sibling}var xt=null,Fe=!1;function Fn(e,t,n){for(n=n.child;n!==null;)Xp(e,t,n),n=n.sibling}function Xp(e,t,n){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 5:Ut||ni(n,t);case 6:var r=xt,i=Fe;xt=null,Fn(e,t,n),xt=r,Fe=i,xt!==null&&(Fe?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(Fe?(e=xt,n=n.stateNode,e.nodeType===8?_a(e.parentNode,n):e.nodeType===1&&_a(e,n),hs(e)):_a(xt,n.stateNode));break;case 4:r=xt,i=Fe,xt=n.stateNode.containerInfo,Fe=!0,Fn(e,t,n),xt=r,Fe=i;break;case 0:case 11:case 14:case 15:if(!Ut&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Tu(n,t,o),i=i.next}while(i!==r)}Fn(e,t,n);break;case 1:if(!Ut&&(ni(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){bt(n,t,l)}Fn(e,t,n);break;case 21:Fn(e,t,n);break;case 22:n.mode&1?(Ut=(r=Ut)||n.memoizedState!==null,Fn(e,t,n),Ut=r):Fn(e,t,n);break;default:Fn(e,t,n)}}function Sf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new B0),t.forEach(function(r){var i=W0.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function De(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=It()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*M0(r/1960))-r,10e?16:e,Vn===null)var r=!1;else{if(e=Vn,Vn=null,rl=0,X&6)throw Error(S(331));var i=X;for(X|=4,E=e.current;E!==null;){var s=E,o=s.child;if(E.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aIt()-Lc?Or(e,0):Cc|=n),ie(e,t)}function oy(e,t){t===0&&(e.mode&1?(t=Xs,Xs<<=1,!(Xs&130023424)&&(Xs=4194304)):t=1);var n=Ht();e=bn(e,t),e!==null&&(Bs(e,t,n),ie(e,n))}function $0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),oy(e,n)}function W0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(S(314))}r!==null&&r.delete(t),oy(e,n)}var ly;ly=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ne.current)ee=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ee=!1,F0(e,t,n);ee=!!(e.flags&131072)}else ee=!1,gt&&t.flags&1048576&&dp(t,Qo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Io(e,t),e=t.pendingProps;var i=vi(t,zt.current);ui(t,n),i=Dc(null,t,r,e,i,n);var s=Rc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,re(r)?(s=!0,Yo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ec(t),i.updater=Hl,t.stateNode=i,i._reactInternals=t,_u(t,r,e,n),t=Iu(null,t,r,!0,s,n)):(t.tag=0,gt&&s&&gc(t),Vt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;t:{switch(Io(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Y0(r),e=Re(r,e),i){case 0:t=bu(null,t,r,e,n);break t;case 1:t=mf(null,t,r,e,n);break t;case 11:t=pf(null,t,r,e,n);break t;case 14:t=yf(null,t,r,Re(r.type,e),n);break t}throw Error(S(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Re(r,i),bu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Re(r,i),mf(e,t,r,i,n);case 3:t:{if(Wp(t),e===null)throw Error(S(387));r=t.pendingProps,s=t.memoizedState,i=s.element,gp(e,t),qo(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=bi(Error(S(423)),t),t=gf(e,t,r,n,i);break t}else if(r!==i){i=bi(Error(S(424)),t),t=gf(e,t,r,n,i);break t}else for(de=Yn(t.stateNode.containerInfo.firstChild),fe=t,gt=!0,xe=null,n=yp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wi(),r===i){t=In(e,t,n);break t}Vt(e,t,r,n)}t=t.child}return t;case 5:return vp(t),e===null&&gu(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,fu(r,i)?o=null:s!==null&&fu(r,s)&&(t.flags|=32),$p(e,t),Vt(e,t,o,n),t.child;case 6:return e===null&&gu(t),null;case 13:return Hp(e,t,n);case 4:return Nc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_i(t,null,r,n):Vt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Re(r,i),pf(e,t,r,i,n);case 7:return Vt(e,t,t.pendingProps,n),t.child;case 8:return Vt(e,t,t.pendingProps.children,n),t.child;case 12:return Vt(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,ct(Ko,r._currentValue),r._currentValue=o,s!==null)if(Me(s.value,o)){if(s.children===i.children&&!ne.current){t=In(e,t,n);break t}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=wn(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),vu(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(S(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),vu(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Vt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ui(t,n),i=ke(i),r=r(i),t.flags|=1,Vt(e,t,r,n),t.child;case 14:return r=t.type,i=Re(r,t.pendingProps),i=Re(r.type,i),yf(e,t,r,i,n);case 15:return jp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Re(r,i),Io(e,t),t.tag=1,re(r)?(e=!0,Yo(t)):e=!1,ui(t,n),Pp(t,r,i),_u(t,r,i,n),Iu(null,t,r,!0,e,n);case 19:return Yp(e,t,n);case 22:return Vp(e,t,n)}throw Error(S(156,t.tag))};function ay(e,t){return Ch(e,t)}function H0(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ie(e,t,n,r){return new H0(e,t,n,r)}function zc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Y0(e){if(typeof e=="function")return zc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sc)return 11;if(e===oc)return 14}return 2}function Jn(e,t){var n=e.alternate;return n===null?(n=Ie(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ko(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")zc(e)&&(o=1);else if(typeof e=="string")o=5;else t:switch(e){case Gr:return Dr(n.children,i,s,t);case ic:o=8,i|=8;break;case Wa:return e=Ie(12,n,t,i|2),e.elementType=Wa,e.lanes=s,e;case Ha:return e=Ie(13,n,t,i),e.elementType=Ha,e.lanes=s,e;case Ya:return e=Ie(19,n,t,i),e.elementType=Ya,e.lanes=s,e;case vh:return Ql(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mh:o=10;break t;case gh:o=9;break t;case sc:o=11;break t;case oc:o=14;break t;case Cn:o=16,r=null;break t}throw Error(S(130,e==null?e:typeof e,""))}return t=Ie(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Dr(e,t,n,r){return e=Ie(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Ie(22,e,r,t),e.elementType=vh,e.lanes=n,e.stateNode={isHidden:!1},e}function Oa(e,t,n){return e=Ie(6,e,null,t),e.lanes=n,e}function Da(e,t,n){return t=Ie(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function G0(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ua(0),this.expirationTimes=ua(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ua(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function jc(e,t,n,r,i,s,o,l,a){return e=new G0(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ie(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ec(s),e}function Q0(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fy)}catch(e){console.error(e)}}fy(),fh.exports=ye;var Z0=fh.exports,hy,Df=Z0;hy=Df.createRoot,Df.hydrateRoot;function U(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function l(c){try{u(r.next(c))}catch(h){o(h)}}function a(c){try{u(r.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(l,a)}u((r=r.apply(e,t||[])).next())})}function Rf(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(e){return this instanceof W?(this.v=e,this):new W(e)}function Ze(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(g){return function(v){return Promise.resolve(v).then(g,h)}}function l(g,v){r[g]&&(i[g]=function(w){return new Promise(function(O,p){s.push([g,w,O,p])>1||a(g,w)})},v&&(i[g]=v(i[g])))}function a(g,v){try{u(r[g](v))}catch(w){y(s[0][3],w)}}function u(g){g.value instanceof W?Promise.resolve(g.value.v).then(c,h):y(s[0][2],g)}function c(g){a("next",g)}function h(g){a("throw",g)}function y(g,v){g(v),s.shift(),s.length&&a(s[0][0],s[0][1])}}function To(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,s){t[i]=e[i]?function(o){return(n=!n)?{value:W(e[i](o)),done:!1}:s?s(o):o}:s}}function Rr(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Rf=="function"?Rf(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=e[s]&&function(o){return new Promise(function(l,a){o=e[s](o),i(l,a,o.done,o.value)})}}function i(s,o,l,a){Promise.resolve(a).then(function(u){s({value:u,done:l})},o)}}const tw=new TextDecoder("utf-8"),Cu=e=>tw.decode(e),ew=new TextEncoder,Hc=e=>ew.encode(e),nw=e=>typeof e=="number",py=e=>typeof e=="boolean",Tt=e=>typeof e=="function",oe=e=>e!=null&&Object(e)===e,Lr=e=>oe(e)&&Tt(e.then),Ps=e=>oe(e)&&Tt(e[Symbol.iterator]),xi=e=>oe(e)&&Tt(e[Symbol.asyncIterator]),Lu=e=>oe(e)&&oe(e.schema),yy=e=>oe(e)&&"done"in e&&"value"in e,my=e=>oe(e)&&Tt(e.stat)&&nw(e.fd),gy=e=>oe(e)&&Yc(e.body),Zl=e=>"_getDOMStream"in e&&"_getNodeStream"in e,rw=e=>oe(e)&&Tt(e.abort)&&Tt(e.getWriter)&&!Zl(e),Yc=e=>oe(e)&&Tt(e.cancel)&&Tt(e.getReader)&&!Zl(e),iw=e=>oe(e)&&Tt(e.end)&&Tt(e.write)&&py(e.writable)&&!Zl(e),vy=e=>oe(e)&&Tt(e.read)&&Tt(e.pipe)&&py(e.readable)&&!Zl(e),sw=e=>oe(e)&&Tt(e.clear)&&Tt(e.bytes)&&Tt(e.position)&&Tt(e.setPosition)&&Tt(e.capacity)&&Tt(e.getBufferIdentifier)&&Tt(e.createLong),Gc=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function ow(e){const t=e[0]?[e[0]]:[];let n,r,i,s;for(let o,l,a=0,u=0,c=e.length;++ac+h.byteLength,0);let i,s,o,l=0,a=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,r);for(const c=n.length;++alt(Int32Array,e),tt=e=>lt(Uint8Array,e),Mu=e=>(e.next(),e);function*lw(e,t){const n=function*(i){yield i},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Gc?n(t):Ps(t)?t:n(t);return yield*Mu(function*(i){let s=null;do s=i.next(yield lt(e,s));while(!s.done)}(r[Symbol.iterator]())),new e}const aw=e=>lw(Uint8Array,e);function wy(e,t){return Ze(this,arguments,function*(){if(Lr(t))return yield W(yield W(yield*To(Rr(wy(e,yield W(t))))));const r=function(o){return Ze(this,arguments,function*(){yield yield W(yield W(o))})},i=function(o){return Ze(this,arguments,function*(){yield W(yield*To(Rr(Mu(function*(l){let a=null;do a=l.next(yield a==null?void 0:a.value);while(!a.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Gc?r(t):Ps(t)?i(t):xi(t)?t:r(t);return yield W(yield*To(Rr(Mu(function(o){return Ze(this,arguments,function*(){let l=null;do l=yield W(o.next(yield yield W(lt(e,l))));while(!l.done)})}(s[Symbol.asyncIterator]()))))),yield W(new e)})}const uw=e=>wy(Uint8Array,e);function _y(e,t,n){if(e!==0){n=n.slice(0,t);for(let r=-1,i=n.length;++r0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*dw(e){let t,n=!1,r=[],i,s,o,l=0;function a(){return s==="peek"?rn(r,o)[0]:([i,r,l]=rn(r,o),i)}({cmd:s,size:o}=yield null);const u=aw(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-l)?u.next():u.next(o-l),!t&&i.byteLength>0&&(r.push(i),l+=i.byteLength),t||o<=l)do({cmd:s,size:o}=yield a());while(o0&&(i.push(s),a+=s.byteLength),n||l<=a)do({cmd:o,size:l}=yield yield W(u()));while(l0&&(i.push(tt(s)),a+=s.byteLength),n||l<=a)do({cmd:o,size:l}=yield yield W(u()));while(l{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return U(this,void 0,void 0,function*(){const{reader:n,source:r}=this;n&&(yield n.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return U(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const n=yield this.reader.read();return!n.done&&(n.value=tt(n)),n})}}const Ra=(e,t)=>{const n=i=>r([t,i]);let r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function yw(e){return Ze(this,arguments,function*(){const n=[];let r="error",i=!1,s=null,o,l,a=0,u=[],c;function h(){return o==="peek"?rn(u,l)[0]:([c,u,a]=rn(u,l),c)}if({cmd:o,size:l}=yield yield W(null),e.isTTY)return yield yield W(new Uint8Array(0)),yield W(null);try{n[0]=Ra(e,"end"),n[1]=Ra(e,"error");do{if(n[2]=Ra(e,"readable"),[r,s]=yield W(Promise.race(n.map(g=>g[2]))),r==="error")break;if((i=r==="end")||(Number.isFinite(l-a)?(c=tt(e.read(l-a)),c.byteLength0&&(u.push(c),a+=c.byteLength)),i||l<=a)do({cmd:o,size:l}=yield yield W(h()));while(l{for(const[p,f]of g)e.off(p,f);try{const p=e.destroy;p&&p.call(e,v),v=void 0}catch(p){v=p||v}finally{v!=null?O(v):w()}})}})}var Bt;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(Bt||(Bt={}));var Yt;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Yt||(Yt={}));var se;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(se||(se={}));var En;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(En||(En={}));var z;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(z||(z={}));var Zn;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Zn||(Zn={}));var nt;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(nt||(nt={}));var d;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond"})(d||(d={}));var dn;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(dn||(dn={}));const mw=void 0;function Ns(e){if(e===null)return"null";if(e===mw)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>Ns(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,n)=>typeof n=="bigint"?`${n}`:n)}const gw=Symbol.for("isArrowBigNum");function Ue(e,...t){return t.length===0?Object.setPrototypeOf(lt(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Ue.prototype[gw]=!0;Ue.prototype.toJSON=function(){return`"${Ts(this)}"`};Ue.prototype.valueOf=function(){return Sy(this)};Ue.prototype.toString=function(){return Ts(this)};Ue.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return Sy(this);case"string":return Ts(this);case"default":return vw(this)}return Ts(this)};function di(...e){return Ue.apply(this,e)}function fi(...e){return Ue.apply(this,e)}function ks(...e){return Ue.apply(this,e)}Object.setPrototypeOf(di.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(fi.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ks.prototype,Object.create(Uint32Array.prototype));Object.assign(di.prototype,Ue.prototype,{constructor:di,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(fi.prototype,Ue.prototype,{constructor:fi,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ks.prototype,Ue.prototype,{constructor:ks,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function Sy(e){const{buffer:t,byteOffset:n,length:r,signed:i}=e,s=new BigUint64Array(t,n,r),o=i&&s.at(-1)&BigInt(1)<{if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return Fa(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return Fa(e);t=t.slice();let r=1;for(let s=0;se.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:Ts(e);function Fa(e){let t="";const n=new Uint32Array(2);let r=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);const i=new Uint32Array((r=new Uint16Array(r).reverse()).buffer);let s=-1;const o=r.length-1;do{for(n[0]=r[s=0];sNumber.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}var by,Iy,Ey,Ny,ky,Ty,Oy,Dy,Ry,Fy,Ay,xy,By,Cy,Ly,My,Py,Uy,zy,jy;class D{static isNull(t){return(t==null?void 0:t.typeId)===d.Null}static isInt(t){return(t==null?void 0:t.typeId)===d.Int}static isFloat(t){return(t==null?void 0:t.typeId)===d.Float}static isBinary(t){return(t==null?void 0:t.typeId)===d.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===d.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===d.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===d.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===d.Date}static isTime(t){return(t==null?void 0:t.typeId)===d.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===d.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===d.Interval}static isDuration(t){return(t==null?void 0:t.typeId)===d.Duration}static isList(t){return(t==null?void 0:t.typeId)===d.List}static isStruct(t){return(t==null?void 0:t.typeId)===d.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===d.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===d.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===d.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===d.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===d.Dictionary}static isDenseUnion(t){return D.isUnion(t)&&t.mode===Yt.Dense}static isSparseUnion(t){return D.isUnion(t)&&t.mode===Yt.Sparse}get typeId(){return d.NONE}}by=Symbol.toStringTag;D[by]=(e=>(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(D.prototype);let tr=class extends D{toString(){return"Null"}get typeId(){return d.Null}};Iy=Symbol.toStringTag;tr[Iy]=(e=>e[Symbol.toStringTag]="Null")(tr.prototype);class er extends D{constructor(t,n){super(),this.isSigned=t,this.bitWidth=n}get typeId(){return d.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}Ey=Symbol.toStringTag;er[Ey]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(er.prototype);class Os extends er{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Os.prototype,"ArrayType",{value:Int32Array});class Ds extends D{constructor(t){super(),this.precision=t}get typeId(){return d.Float}get ArrayType(){switch(this.precision){case se.HALF:return Uint16Array;case se.SINGLE:return Float32Array;case se.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}Ny=Symbol.toStringTag;Ds[Ny]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Ds.prototype);let ol=class extends D{constructor(){super()}get typeId(){return d.Binary}toString(){return"Binary"}};ky=Symbol.toStringTag;ol[ky]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(ol.prototype);let ll=class extends D{constructor(){super()}get typeId(){return d.Utf8}toString(){return"Utf8"}};Ty=Symbol.toStringTag;ll[Ty]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(ll.prototype);let al=class extends D{constructor(){super()}get typeId(){return d.Bool}toString(){return"Bool"}};Oy=Symbol.toStringTag;al[Oy]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(al.prototype);let ul=class extends D{constructor(t,n,r=128){super(),this.scale=t,this.precision=n,this.bitWidth=r}get typeId(){return d.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Dy=Symbol.toStringTag;ul[Dy]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(ul.prototype);class cl extends D{constructor(t){super(),this.unit=t}get typeId(){return d.Date}toString(){return`Date${(this.unit+1)*32}<${En[this.unit]}>`}}Ry=Symbol.toStringTag;cl[Ry]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(cl.prototype);class Rs extends D{constructor(t,n){super(),this.unit=t,this.bitWidth=n}get typeId(){return d.Time}toString(){return`Time${this.bitWidth}<${z[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}Fy=Symbol.toStringTag;Rs[Fy]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Rs.prototype);class dl extends D{constructor(t,n){super(),this.unit=t,this.timezone=n}get typeId(){return d.Timestamp}toString(){return`Timestamp<${z[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Ay=Symbol.toStringTag;dl[Ay]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(dl.prototype);class fl extends D{constructor(t){super(),this.unit=t}get typeId(){return d.Interval}toString(){return`Interval<${Zn[this.unit]}>`}}xy=Symbol.toStringTag;fl[xy]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(fl.prototype);let hl=class extends D{constructor(t){super(),this.unit=t}get typeId(){return d.Duration}toString(){return`Duration<${z[this.unit]}>`}};By=Symbol.toStringTag;hl[By]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(hl.prototype);let pl=class extends D{constructor(t){super(),this.children=[t]}get typeId(){return d.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Cy=Symbol.toStringTag;pl[Cy]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(pl.prototype);class $t extends D{constructor(t){super(),this.children=t}get typeId(){return d.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Ly=Symbol.toStringTag;$t[Ly]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))($t.prototype);class yl extends D{constructor(t,n,r){super(),this.mode=t,this.children=r,this.typeIds=n=Int32Array.from(n),this.typeIdToChildIndex=n.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}get typeId(){return d.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}My=Symbol.toStringTag;yl[My]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(yl.prototype);let ml=class extends D{constructor(t){super(),this.byteWidth=t}get typeId(){return d.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Py=Symbol.toStringTag;ml[Py]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(ml.prototype);let gl=class extends D{constructor(t,n){super(),this.listSize=t,this.children=[n]}get typeId(){return d.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Uy=Symbol.toStringTag;gl[Uy]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(gl.prototype);class vl extends D{constructor(t,n=!1){var r,i,s;if(super(),this.children=[t],this.keysSorted=n,t&&(t.name="entries",!((r=t==null?void 0:t.type)===null||r===void 0)&&r.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const l=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];l&&(l.name="value")}}get typeId(){return d.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}zy=Symbol.toStringTag;vl[zy]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(vl.prototype);const ww=(e=>()=>++e)(-1);class Ei extends D{constructor(t,n,r,i){super(),this.indices=n,this.dictionary=t,this.isOrdered=i||!1,this.id=r==null?ww():Pe(r)}get typeId(){return d.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}jy=Symbol.toStringTag;Ei[jy]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(Ei.prototype);function fn(e){const t=e;switch(e.typeId){case d.Decimal:return e.bitWidth/32;case d.Timestamp:return 2;case d.Date:return 1+t.unit;case d.Interval:return 1+t.unit;case d.FixedSizeList:return t.listSize;case d.FixedSizeBinary:return t.byteWidth;default:return 1}}class H{visitMany(t,...n){return t.map((r,i)=>this.visit(r,...n.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,n=!0){return _w(this,t,n)}getVisitFnByTypeId(t,n=!0){return Vr(this,t,n)}visitNull(t,...n){return null}visitBool(t,...n){return null}visitInt(t,...n){return null}visitFloat(t,...n){return null}visitUtf8(t,...n){return null}visitBinary(t,...n){return null}visitFixedSizeBinary(t,...n){return null}visitDate(t,...n){return null}visitTimestamp(t,...n){return null}visitTime(t,...n){return null}visitDecimal(t,...n){return null}visitList(t,...n){return null}visitStruct(t,...n){return null}visitUnion(t,...n){return null}visitDictionary(t,...n){return null}visitInterval(t,...n){return null}visitDuration(t,...n){return null}visitFixedSizeList(t,...n){return null}visitMap(t,...n){return null}}function _w(e,t,n=!0){return typeof t=="number"?Vr(e,t,n):typeof t=="string"&&t in d?Vr(e,d[t],n):t&&t instanceof D?Vr(e,Af(t),n):t!=null&&t.type&&t.type instanceof D?Vr(e,Af(t.type),n):Vr(e,d.NONE,n)}function Vr(e,t,n=!0){let r=null;switch(t){case d.Null:r=e.visitNull;break;case d.Bool:r=e.visitBool;break;case d.Int:r=e.visitInt;break;case d.Int8:r=e.visitInt8||e.visitInt;break;case d.Int16:r=e.visitInt16||e.visitInt;break;case d.Int32:r=e.visitInt32||e.visitInt;break;case d.Int64:r=e.visitInt64||e.visitInt;break;case d.Uint8:r=e.visitUint8||e.visitInt;break;case d.Uint16:r=e.visitUint16||e.visitInt;break;case d.Uint32:r=e.visitUint32||e.visitInt;break;case d.Uint64:r=e.visitUint64||e.visitInt;break;case d.Float:r=e.visitFloat;break;case d.Float16:r=e.visitFloat16||e.visitFloat;break;case d.Float32:r=e.visitFloat32||e.visitFloat;break;case d.Float64:r=e.visitFloat64||e.visitFloat;break;case d.Utf8:r=e.visitUtf8;break;case d.Binary:r=e.visitBinary;break;case d.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case d.Date:r=e.visitDate;break;case d.DateDay:r=e.visitDateDay||e.visitDate;break;case d.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case d.Timestamp:r=e.visitTimestamp;break;case d.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case d.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case d.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case d.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case d.Time:r=e.visitTime;break;case d.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case d.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case d.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case d.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case d.Decimal:r=e.visitDecimal;break;case d.List:r=e.visitList;break;case d.Struct:r=e.visitStruct;break;case d.Union:r=e.visitUnion;break;case d.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case d.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case d.Dictionary:r=e.visitDictionary;break;case d.Interval:r=e.visitInterval;break;case d.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case d.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case d.Duration:r=e.visitDuration;break;case d.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case d.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case d.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case d.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case d.FixedSizeList:r=e.visitFixedSizeList;break;case d.Map:r=e.visitMap;break}if(typeof r=="function")return r;if(!n)return()=>null;throw new Error(`Unrecognized type '${d[t]}'`)}function Af(e){switch(e.typeId){case d.Null:return d.Null;case d.Int:{const{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?d.Int8:d.Uint8;case 16:return n?d.Int16:d.Uint16;case 32:return n?d.Int32:d.Uint32;case 64:return n?d.Int64:d.Uint64}return d.Int}case d.Float:switch(e.precision){case se.HALF:return d.Float16;case se.SINGLE:return d.Float32;case se.DOUBLE:return d.Float64}return d.Float;case d.Binary:return d.Binary;case d.Utf8:return d.Utf8;case d.Bool:return d.Bool;case d.Decimal:return d.Decimal;case d.Time:switch(e.unit){case z.SECOND:return d.TimeSecond;case z.MILLISECOND:return d.TimeMillisecond;case z.MICROSECOND:return d.TimeMicrosecond;case z.NANOSECOND:return d.TimeNanosecond}return d.Time;case d.Timestamp:switch(e.unit){case z.SECOND:return d.TimestampSecond;case z.MILLISECOND:return d.TimestampMillisecond;case z.MICROSECOND:return d.TimestampMicrosecond;case z.NANOSECOND:return d.TimestampNanosecond}return d.Timestamp;case d.Date:switch(e.unit){case En.DAY:return d.DateDay;case En.MILLISECOND:return d.DateMillisecond}return d.Date;case d.Interval:switch(e.unit){case Zn.DAY_TIME:return d.IntervalDayTime;case Zn.YEAR_MONTH:return d.IntervalYearMonth}return d.Interval;case d.Duration:switch(e.unit){case z.SECOND:return d.DurationSecond;case z.MILLISECOND:return d.DurationMillisecond;case z.MICROSECOND:return d.DurationMicrosecond;case z.NANOSECOND:return d.DurationNanosecond}return d.Duration;case d.Map:return d.Map;case d.List:return d.List;case d.Struct:return d.Struct;case d.Union:switch(e.mode){case Yt.Dense:return d.DenseUnion;case Yt.Sparse:return d.SparseUnion}return d.Union;case d.FixedSizeBinary:return d.FixedSizeBinary;case d.FixedSizeList:return d.FixedSizeList;case d.Dictionary:return d.Dictionary}throw new Error(`Unrecognized type '${d[e.typeId]}'`)}H.prototype.visitInt8=null;H.prototype.visitInt16=null;H.prototype.visitInt32=null;H.prototype.visitInt64=null;H.prototype.visitUint8=null;H.prototype.visitUint16=null;H.prototype.visitUint32=null;H.prototype.visitUint64=null;H.prototype.visitFloat16=null;H.prototype.visitFloat32=null;H.prototype.visitFloat64=null;H.prototype.visitDateDay=null;H.prototype.visitDateMillisecond=null;H.prototype.visitTimestampSecond=null;H.prototype.visitTimestampMillisecond=null;H.prototype.visitTimestampMicrosecond=null;H.prototype.visitTimestampNanosecond=null;H.prototype.visitTimeSecond=null;H.prototype.visitTimeMillisecond=null;H.prototype.visitTimeMicrosecond=null;H.prototype.visitTimeNanosecond=null;H.prototype.visitDenseUnion=null;H.prototype.visitSparseUnion=null;H.prototype.visitIntervalDayTime=null;H.prototype.visitIntervalYearMonth=null;H.prototype.visitDuration=null;H.prototype.visitDurationSecond=null;H.prototype.visitDurationMillisecond=null;H.prototype.visitDurationMicrosecond=null;H.prototype.visitDurationNanosecond=null;const Vy=new Float64Array(1),jr=new Uint32Array(Vy.buffer);function $y(e){const t=(e&31744)>>10,n=(e&1023)/1024,r=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return r*(n?Number.NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*Math.pow(2,t-15)*(1+n)}function Sw(e){if(e!==e)return 32256;Vy[0]=e;const t=(jr[1]&2147483648)>>16&65535;let n=jr[1]&2146435072,r=0;return n>=1089470464?jr[0]>0?n=31744:(n=(n&2080374784)>>16,r=(jr[1]&1048575)>>10):n<=1056964608?(r=1048576+(jr[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(jr[1]&1048575)+512>>10),t|n|r&65535}class B extends H{}function P(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const bw=(e,t,n)=>{e[t]=Math.trunc(n/864e5)},Kc=(e,t,n)=>{e[t]=Math.trunc(n%4294967296),e[t+1]=Math.trunc(n/4294967296)},Iw=(e,t,n)=>{e[t]=Math.trunc(n*1e3%4294967296),e[t+1]=Math.trunc(n*1e3/4294967296)},Ew=(e,t,n)=>{e[t]=Math.trunc(n*1e6%4294967296),e[t+1]=Math.trunc(n*1e6/4294967296)},Wy=(e,t,n,r)=>{if(n+1{const i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},Jc=({values:e},t,n)=>{e[t]=n},Hy=({values:e},t,n)=>{e[t]=Sw(n)},kw=(e,t,n)=>{switch(e.type.precision){case se.HALF:return Hy(e,t,n);case se.SINGLE:case se.DOUBLE:return Jc(e,t,n)}},Yy=({values:e},t,n)=>{bw(e,t,n.valueOf())},Gy=({values:e},t,n)=>{Kc(e,t*2,n.valueOf())},Tw=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},Ow=({values:e,valueOffsets:t},n,r)=>Wy(e,t,n,r),Dw=({values:e,valueOffsets:t},n,r)=>{Wy(e,t,n,Hc(r))},Rw=(e,t,n)=>{e.type.unit===En.DAY?Yy(e,t,n):Gy(e,t,n)},Qy=({values:e},t,n)=>Kc(e,t*2,n/1e3),Ky=({values:e},t,n)=>Kc(e,t*2,n),Jy=({values:e},t,n)=>Iw(e,t*2,n),qy=({values:e},t,n)=>Ew(e,t*2,n),Fw=(e,t,n)=>{switch(e.type.unit){case z.SECOND:return Qy(e,t,n);case z.MILLISECOND:return Ky(e,t,n);case z.MICROSECOND:return Jy(e,t,n);case z.NANOSECOND:return qy(e,t,n)}},Xy=({values:e},t,n)=>{e[t]=n},Zy=({values:e},t,n)=>{e[t]=n},tm=({values:e},t,n)=>{e[t]=n},em=({values:e},t,n)=>{e[t]=n},Aw=(e,t,n)=>{switch(e.type.unit){case z.SECOND:return Xy(e,t,n);case z.MILLISECOND:return Zy(e,t,n);case z.MICROSECOND:return tm(e,t,n);case z.NANOSECOND:return em(e,t,n)}},xw=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},Bw=(e,t,n)=>{const r=e.children[0],i=e.valueOffsets,s=Oe.getVisitFn(r);if(Array.isArray(n))for(let o=-1,l=i[t],a=i[t+1];l{const r=e.children[0],{valueOffsets:i}=e,s=Oe.getVisitFn(r);let{[t]:o,[t+1]:l}=i;const a=n instanceof Map?n.entries():Object.entries(n);for(const u of a)if(s(r,o,u),++o>=l)break},Lw=(e,t)=>(n,r,i,s)=>r&&n(r,e,t[s]),Mw=(e,t)=>(n,r,i,s)=>r&&n(r,e,t.get(s)),Pw=(e,t)=>(n,r,i,s)=>r&&n(r,e,t.get(i.name)),Uw=(e,t)=>(n,r,i,s)=>r&&n(r,e,t[i.name]),zw=(e,t,n)=>{const r=e.type.children.map(s=>Oe.getVisitFn(s.type)),i=n instanceof Map?Pw(t,n):n instanceof rt?Mw(t,n):Array.isArray(n)?Lw(t,n):Uw(t,n);e.type.children.forEach((s,o)=>i(r[o],e.children[o],s,o))},jw=(e,t,n)=>{e.type.mode===Yt.Dense?nm(e,t,n):rm(e,t,n)},nm=(e,t,n)=>{const r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Oe.visit(i,e.valueOffsets[t],n)},rm=(e,t,n)=>{const r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Oe.visit(i,t,n)},Vw=(e,t,n)=>{var r;(r=e.dictionary)===null||r===void 0||r.set(e.values[t],n)},$w=(e,t,n)=>{e.type.unit===Zn.DAY_TIME?im(e,t,n):sm(e,t,n)},im=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},sm=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},om=({values:e},t,n)=>{e[t]=n},lm=({values:e},t,n)=>{e[t]=n},am=({values:e},t,n)=>{e[t]=n},um=({values:e},t,n)=>{e[t]=n},Ww=(e,t,n)=>{switch(e.type.unit){case z.SECOND:return om(e,t,n);case z.MILLISECOND:return lm(e,t,n);case z.MICROSECOND:return am(e,t,n);case z.NANOSECOND:return um(e,t,n)}},Hw=(e,t,n)=>{const{stride:r}=e,i=e.children[0],s=Oe.getVisitFn(i);if(Array.isArray(n))for(let o=-1,l=t*r;++o`${Ns(t)}: ${Ns(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Yw(this[Ae],this[hi])}}class Yw{constructor(t,n){this.childIndex=0,this.children=t.children,this.rowIndex=n,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return tn.name)}has(t,n){return t[Ae].type.children.findIndex(r=>r.name===n)!==-1}getOwnPropertyDescriptor(t,n){if(t[Ae].type.children.findIndex(r=>r.name===n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];const r=t[Ae].type.children.findIndex(i=>i.name===n);if(r!==-1){const i=le.visit(t[Ae].children[r],t[hi]);return Reflect.set(t,n,i),i}}set(t,n,r){const i=t[Ae].type.children.findIndex(s=>s.name===n);return i!==-1?(Oe.visit(t[Ae].children[i],t[hi],r),Reflect.set(t,n,r)):Reflect.has(t,n)||typeof n=="symbol"?Reflect.set(t,n,r):!1}}class R extends H{}function C(e){return(t,n)=>t.getValid(n)?e(t,n):null}const Qw=(e,t)=>864e5*e[t],Xc=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),Kw=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,Jw=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,cm=e=>new Date(e),qw=(e,t)=>cm(Qw(e,t)),Xw=(e,t)=>cm(Xc(e,t)),Zw=(e,t)=>null,dm=(e,t,n)=>{if(n+1>=t.length)return null;const r=t[n],i=t[n+1];return e.subarray(r,i)},t_=({offset:e,values:t},n)=>{const r=e+n;return(t[r>>3]&1<qw(e,t),hm=({values:e},t)=>Xw(e,t*2),cr=({stride:e,values:t},n)=>t[e*n],e_=({stride:e,values:t},n)=>$y(t[e*n]),pm=({values:e},t)=>e[t],n_=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),r_=({values:e,valueOffsets:t},n)=>dm(e,t,n),i_=({values:e,valueOffsets:t},n)=>{const r=dm(e,t,n);return r!==null?Cu(r):null},s_=({values:e},t)=>e[t],o_=({type:e,values:t},n)=>e.precision!==se.HALF?t[n]:$y(t[n]),l_=(e,t)=>e.type.unit===En.DAY?fm(e,t):hm(e,t),ym=({values:e},t)=>1e3*Xc(e,t*2),mm=({values:e},t)=>Xc(e,t*2),gm=({values:e},t)=>Kw(e,t*2),vm=({values:e},t)=>Jw(e,t*2),a_=(e,t)=>{switch(e.type.unit){case z.SECOND:return ym(e,t);case z.MILLISECOND:return mm(e,t);case z.MICROSECOND:return gm(e,t);case z.NANOSECOND:return vm(e,t)}},wm=({values:e},t)=>e[t],_m=({values:e},t)=>e[t],Sm=({values:e},t)=>e[t],bm=({values:e},t)=>e[t],u_=(e,t)=>{switch(e.type.unit){case z.SECOND:return wm(e,t);case z.MILLISECOND:return _m(e,t);case z.MICROSECOND:return Sm(e,t);case z.NANOSECOND:return bm(e,t)}},c_=({values:e,stride:t},n)=>Qc.decimal(e.subarray(t*n,t*(n+1))),d_=(e,t)=>{const{valueOffsets:n,stride:r,children:i}=e,{[t*r]:s,[t*r+1]:o}=n,a=i[0].slice(s,o-s);return new rt([a])},f_=(e,t)=>{const{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:s}=n,o=r[0];return new Zc(o.slice(i,s-i))},h_=(e,t)=>new qc(e,t),p_=(e,t)=>e.type.mode===Yt.Dense?Im(e,t):Em(e,t),Im=(e,t)=>{const n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return le.visit(r,e.valueOffsets[t])},Em=(e,t)=>{const n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return le.visit(r,t)},y_=(e,t)=>{var n;return(n=e.dictionary)===null||n===void 0?void 0:n.get(e.values[t])},m_=(e,t)=>e.type.unit===Zn.DAY_TIME?Nm(e,t):km(e,t),Nm=({values:e},t)=>e.subarray(2*t,2*(t+1)),km=({values:e},t)=>{const n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},Tm=({values:e},t)=>e[t],Om=({values:e},t)=>e[t],Dm=({values:e},t)=>e[t],Rm=({values:e},t)=>e[t],g_=(e,t)=>{switch(e.type.unit){case z.SECOND:return Tm(e,t);case z.MILLISECOND:return Om(e,t);case z.MICROSECOND:return Dm(e,t);case z.NANOSECOND:return Rm(e,t)}},v_=(e,t)=>{const{stride:n,children:r}=e,s=r[0].slice(t*n,n);return new rt([s])};R.prototype.visitNull=C(Zw);R.prototype.visitBool=C(t_);R.prototype.visitInt=C(s_);R.prototype.visitInt8=C(cr);R.prototype.visitInt16=C(cr);R.prototype.visitInt32=C(cr);R.prototype.visitInt64=C(pm);R.prototype.visitUint8=C(cr);R.prototype.visitUint16=C(cr);R.prototype.visitUint32=C(cr);R.prototype.visitUint64=C(pm);R.prototype.visitFloat=C(o_);R.prototype.visitFloat16=C(e_);R.prototype.visitFloat32=C(cr);R.prototype.visitFloat64=C(cr);R.prototype.visitUtf8=C(i_);R.prototype.visitBinary=C(r_);R.prototype.visitFixedSizeBinary=C(n_);R.prototype.visitDate=C(l_);R.prototype.visitDateDay=C(fm);R.prototype.visitDateMillisecond=C(hm);R.prototype.visitTimestamp=C(a_);R.prototype.visitTimestampSecond=C(ym);R.prototype.visitTimestampMillisecond=C(mm);R.prototype.visitTimestampMicrosecond=C(gm);R.prototype.visitTimestampNanosecond=C(vm);R.prototype.visitTime=C(u_);R.prototype.visitTimeSecond=C(wm);R.prototype.visitTimeMillisecond=C(_m);R.prototype.visitTimeMicrosecond=C(Sm);R.prototype.visitTimeNanosecond=C(bm);R.prototype.visitDecimal=C(c_);R.prototype.visitList=C(d_);R.prototype.visitStruct=C(h_);R.prototype.visitUnion=C(p_);R.prototype.visitDenseUnion=C(Im);R.prototype.visitSparseUnion=C(Em);R.prototype.visitDictionary=C(y_);R.prototype.visitInterval=C(m_);R.prototype.visitIntervalDayTime=C(Nm);R.prototype.visitIntervalYearMonth=C(km);R.prototype.visitDuration=C(g_);R.prototype.visitDurationSecond=C(Tm);R.prototype.visitDurationMillisecond=C(Om);R.prototype.visitDurationMicrosecond=C(Dm);R.prototype.visitDurationNanosecond=C(Rm);R.prototype.visitFixedSizeList=C(v_);R.prototype.visitMap=C(f_);const le=new R,Ye=Symbol.for("keys"),pi=Symbol.for("vals");class Zc{constructor(t){return this[Ye]=new rt([t.children[0]]).memoize(),this[pi]=t.children[1],new Proxy(this,new __)}[Symbol.iterator](){return new w_(this[Ye],this[pi])}get size(){return this[Ye].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ye],n=this[pi],r={};for(let i=-1,s=t.length;++i`${Ns(t)}: ${Ns(n)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class w_{constructor(t,n){this.keys=t,this.vals=n,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),le.visit(this.vals,t)]})}}class __{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ye].toArray().map(String)}has(t,n){return t[Ye].includes(n)}getOwnPropertyDescriptor(t,n){if(t[Ye].indexOf(n)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,n){if(Reflect.has(t,n))return t[n];const r=t[Ye].indexOf(n);if(r!==-1){const i=le.visit(Reflect.get(t,pi),r);return Reflect.set(t,n,i),i}}set(t,n,r){const i=t[Ye].indexOf(n);return i!==-1?(Oe.visit(Reflect.get(t,pi),i,r),Reflect.set(t,n,r)):Reflect.has(t,n)?Reflect.set(t,n,r):!1}}Object.defineProperties(Zc.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ye]:{writable:!0,enumerable:!1,configurable:!1,value:null},[pi]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let xf;function Fm(e,t,n,r){const{length:i=0}=e;let s=typeof t!="number"?0:t,o=typeof n!="number"?i:n;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,s,o):[s,o]}const Bf=e=>e!==e;function Bi(e){if(typeof e!=="object"||e===null)return Bf(e)?Bf:n=>n===e;if(e instanceof Date){const n=e.valueOf();return r=>r instanceof Date?r.valueOf()===n:!1}return ArrayBuffer.isView(e)?n=>n?cw(e,n):!1:e instanceof Map?b_(e):Array.isArray(e)?S_(e):e instanceof rt?I_(e):E_(e,!0)}function S_(e){const t=[];for(let n=-1,r=e.length;++n!1;const r=[];for(let i=-1,s=n.length;++i{if(!n||typeof n!="object")return!1;switch(n.constructor){case Array:return N_(e,n);case Map:return Cf(e,n,n.keys());case Zc:case qc:case Object:case void 0:return Cf(e,n,t||Object.keys(n))}return n instanceof rt?k_(e,n):!1}}function N_(e,t){const n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function wl(e,t,n){const r=n.byteLength+7&-8;if(e>0||n.byteLength>3):_l(new td(n,e,t,null,Am)).subarray(0,r)),i}return n}function _l(e){const t=[];let n=0,r=0,i=0;for(const o of e)o&&(i|=1<0)&&(t[n++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class td{constructor(t,n,r,i,s){this.bytes=t,this.length=r,this.context=i,this.get=s,this.bit=n%8,this.byteIndex=n>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return Pu(e,t,i)+Pu(e,r,n)+O_(e,i>>3,r-i>>3)}function O_(e,t,n){let r=0,i=Math.trunc(t);const s=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=Aa(s.getUint32(i)),i+=4;for(;o-i>=2;)r+=Aa(s.getUint16(i)),i+=2;for(;o-i>=1;)r+=Aa(s.getUint8(i)),i+=1;return r}function Aa(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const D_=-1;class ut{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return D.isSparseUnion(t)?this.children.some(n=>n.nullable):D.isDenseUnion(t)?this.children.some(n=>n.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:n,values:r,nullBitmap:i,typeIds:s}=this;return n&&(t+=n.byteLength),r&&(t+=r.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,l)=>o+l.byteLength,t)}get nullCount(){if(D.isUnion(this.type))return this.children.reduce((r,i)=>r+i.nullCount,0);let t=this._nullCount,n;return t<=D_&&(n=this.nullBitmap)&&(this._nullCount=t=this.length-Pu(n,this.offset,this.offset+this.length)),t}constructor(t,n,r,i,s,o=[],l){this.type=t,this.children=o,this.dictionary=l,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let a;s instanceof ut?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=fn(t),s&&((a=s[0])&&(this.valueOffsets=a),(a=s[1])&&(this.values=a),(a=s[2])&&(this.nullBitmap=a),(a=s[3])&&(this.typeIds=a)))}getValid(t){const{type:n}=this;if(D.isUnion(n)){const r=n,i=this.children[r.typeIdToChildIndex[this.typeIds[t]]],s=r.mode===Yt.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const r=this.offset+t;return(this.nullBitmap[r>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+l+63&-64)>>3).fill(255),this.nullCount>0&&s.set(wl(o,l,this.nullBitmap),0),Object.assign(this,{nullBitmap:s,_nullCount:-1}));const h=s[c];r=(h&u)!==0,n?s[c]=h|u:s[c]=h&~u}return r!==!!n&&(this._nullCount=this.nullCount+(n?-1:1)),n}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,s=this,o=this.children){return new ut(t,n,r,i,s,o,this.dictionary)}slice(t,n){const{stride:r,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,l=i===16?r:1,a=this._sliceBuffers(t,n,r,i);return this.clone(this.type,this.offset+t,n,o,a,s.length===0||this.valueOffsets?s:this._sliceChildren(s,l*t,l*n))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===d.Null)return this.clone(this.type,0,t,0);const{length:n,nullCount:r}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,n>>3);i[n>>3]=(1<0&&i.set(wl(this.offset,n,this.nullBitmap),0);const s=this.buffers;return s[dn.VALIDITY]=i,this.clone(this.type,0,t,r+(t-n),s)}_sliceBuffers(t,n,r,i){let s;const{buffers:o}=this;return(s=o[dn.TYPE])&&(o[dn.TYPE]=s.subarray(t,t+n)),(s=o[dn.OFFSET])&&(o[dn.OFFSET]=s.subarray(t,t+n+1))||(s=o[dn.DATA])&&(o[dn.DATA]=i===6?s:s.subarray(r*t,r*(t+n))),o}_sliceChildren(t,n,r){return t.map(i=>i.slice(n,r))}}ut.prototype.children=Object.freeze([]);class ls extends H{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:n,["offset"]:r=0,["length"]:i=0}=t;return new ut(n,r,i,i)}visitBool(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitInt(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitFloat(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitUtf8(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.data),s=tt(t.nullBitmap),o=Wi(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ut(n,r,l,a,[o,i,s])}visitBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.data),s=tt(t.nullBitmap),o=Wi(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ut(n,r,l,a,[o,i,s])}visitFixedSizeBinary(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length/fn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitDate(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length/fn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitTimestamp(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length/fn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitTime(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length/fn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitDecimal(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length/fn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitList(t){const{["type"]:n,["offset"]:r=0,["child"]:i}=t,s=tt(t.nullBitmap),o=Wi(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ut(n,r,l,a,[o,void 0,s],[i])}visitStruct(t){const{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,s=tt(t.nullBitmap),{length:o=i.reduce((a,{length:u})=>Math.max(a,u),0),nullCount:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,void 0,s],i)}visitUnion(t){const{["type"]:n,["offset"]:r=0,["children"]:i=[]}=t,s=lt(n.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:l=-1}=t;if(D.isSparseUnion(n))return new ut(n,r,o,l,[void 0,void 0,void 0,s],i);const a=Wi(t.valueOffsets);return new ut(n,r,o,l,[a,void 0,void 0,s],i)}visitDictionary(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.indices.ArrayType,t.data),{["dictionary"]:o=new rt([new ls().visit({type:n.dictionary})])}=t,{["length"]:l=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ut(n,r,l,a,[void 0,s,i],[],o)}visitInterval(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length/fn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitDuration(t){const{["type"]:n,["offset"]:r=0}=t,i=tt(t.nullBitmap),s=lt(n.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,s,i])}visitFixedSizeList(t){const{["type"]:n,["offset"]:r=0,["child"]:i=new ls().visit({type:n.valueType})}=t,s=tt(t.nullBitmap),{["length"]:o=i.length/fn(n),["nullCount"]:l=t.nullBitmap?-1:0}=t;return new ut(n,r,o,l,[void 0,void 0,s],[i])}visitMap(t){const{["type"]:n,["offset"]:r=0,["child"]:i=new ls().visit({type:n.childType})}=t,s=tt(t.nullBitmap),o=Wi(t.valueOffsets),{["length"]:l=o.length-1,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ut(n,r,l,a,[o,void 0,s],[i])}}const R_=new ls;function K(e){return R_.visit(e)}class Lf{constructor(t=0,n){this.numChunks=t,this.getChunkIterator=n,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext+n.nullCount,0)}function Bm(e){return e.reduce((t,n,r)=>(t[r+1]=t[r]+n.length,t),new Uint32Array(e.length+1))}function Cm(e,t,n,r){const i=[];for(let s=-1,o=e.length;++s=r)break;if(n>=a+u)continue;if(a>=n&&a+u<=r){i.push(l);continue}const c=Math.max(0,n-a),h=Math.min(r-a,u);i.push(l.slice(c,h-c))}return i.length===0&&i.push(e[0].slice(0,0)),i}function ed(e,t,n,r){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function A_(e,t){const{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(const i of new td(n,e.offset+(t||0),e.length,n,Am)){if(!i)return r;++r}return-1}function j(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case d.Union:break;case d.Dictionary:break;default:return A_(e,n)}const r=le.getVisitFn(e),i=Bi(t);for(let s=(n||0)-1,o=e.length;++s{const i=e.data[r];return i.values.subarray(0,i.length)[Symbol.iterator]()});let n=0;return new Lf(e.data.length,r=>{const s=e.data[r].length,o=e.slice(n,n+s);return n+=s,new x_(o)})}class x_{constructor(t){this.vector=t,this.index=0}next(){return this.indexe+t;class dr extends H{visitNull(t,n){return 0}visitInt(t,n){return t.type.bitWidth/8}visitFloat(t,n){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,n){return 1/8}visitDecimal(t,n){return t.type.bitWidth/8}visitDate(t,n){return(t.type.unit+1)*4}visitTime(t,n){return t.type.bitWidth/8}visitTimestamp(t,n){return t.type.unit===z.SECOND?4:8}visitInterval(t,n){return(t.type.unit+1)*4}visitDuration(t,n){return 8}visitStruct(t,n){return t.children.reduce((r,i)=>r+sn.visit(i,n),0)}visitFixedSizeBinary(t,n){return t.type.byteWidth}visitMap(t,n){return 8+t.children.reduce((r,i)=>r+sn.visit(i,n),0)}visitDictionary(t,n){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[n]))||0)}}const C_=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),L_=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),M_=({valueOffsets:e,stride:t,children:n},r)=>{const i=n[0],{[r*t]:s}=e,{[r*t+1]:o}=e,l=sn.getVisitFn(i.type),a=i.slice(s,o-s);let u=8;for(let c=-1,h=o-s;++c{const r=t[0],i=r.slice(n*e,e),s=sn.getVisitFn(r.type);let o=0;for(let l=-1,a=i.length;++le.type.mode===Yt.Dense?Um(e,t):zm(e,t),Um=({type:e,children:t,typeIds:n,valueOffsets:r},i)=>{const s=e.typeIdToChildIndex[n[i]];return 8+sn.visit(t[s],r[i])},zm=({children:e},t)=>4+sn.visitMany(e,e.map(()=>t)).reduce(B_,0);dr.prototype.visitUtf8=C_;dr.prototype.visitBinary=L_;dr.prototype.visitList=M_;dr.prototype.visitFixedSizeList=P_;dr.prototype.visitUnion=U_;dr.prototype.visitDenseUnion=Um;dr.prototype.visitSparseUnion=zm;const sn=new dr;var jm;const Vm={},$m={};class rt{constructor(t){var n,r,i;const s=t[0]instanceof rt?t.flatMap(l=>l.data):t;if(s.length===0||s.some(l=>!(l instanceof ut)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(n=s[0])===null||n===void 0?void 0:n.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:l,set:a,indexOf:u,byteLength:c}=Vm[o.typeId],h=s[0];this.isValid=y=>nd(h,y),this.get=y=>l(h,y),this.set=(y,g)=>a(h,y,g),this.indexOf=y=>u(h,y),this.getByteLength=y=>c(h,y),this._offsets=[0,h.length];break}default:Object.setPrototypeOf(this,$m[o.typeId]),this._offsets=Bm(s);break}this.data=s,this.type=o,this.stride=fn(o),this.numChildren=(i=(r=o.children)===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,n)=>t+n.byteLength,0)}get nullCount(){return xm(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${d[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}includes(t,n){return this.indexOf(t,n)>-1}getByteLength(t){return 0}[Symbol.iterator](){return rd.visit(this)}concat(...t){return new rt(this.data.concat(t.flatMap(n=>n.data).flat(Number.POSITIVE_INFINITY)))}slice(t,n){return new rt(Fm(this,t,n,({data:r,_offsets:i},s,o)=>Cm(r,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:n,length:r,stride:i,ArrayType:s}=this;switch(t.typeId){case d.Int:case d.Float:case d.Decimal:case d.Time:case d.Timestamp:switch(n.length){case 0:return new s;case 1:return n[0].values.subarray(0,r*i);default:return n.reduce((o,{values:l,length:a})=>(o.array.set(l.subarray(0,a*i),o.offset),o.offset+=a*i,o),{array:new s(r*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var n;return this.getChildAt((n=this.type.children)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&tn[t])):null}get isMemoized(){return D.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(D.isDictionary(this.type)){const t=new bl(this.data[0].dictionary),n=this.data.map(r=>{const i=r.clone();return i.dictionary=t,i});return new rt(n)}return new bl(this)}unmemoize(){if(D.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),n=this.data.map(r=>{const i=r.clone();return i.dictionary=t,i});return new rt(n)}return this}}jm=Symbol.toStringTag;rt[jm]=(e=>{e.type=D.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;const t=Object.keys(d).map(n=>d[n]).filter(n=>typeof n=="number"&&n!==d.NONE);for(const n of t){const r=le.getVisitFnByTypeId(n),i=Oe.getVisitFnByTypeId(n),s=Sl.getVisitFnByTypeId(n),o=sn.getVisitFnByTypeId(n);Vm[n]={get:r,set:i,indexOf:s,byteLength:o},$m[n]=Object.create(e,{isValid:{value:yi(nd)},get:{value:yi(le.getVisitFnByTypeId(n))},set:{value:Lm(Oe.getVisitFnByTypeId(n))},indexOf:{value:Mm(Sl.getVisitFnByTypeId(n))},getByteLength:{value:yi(sn.getVisitFnByTypeId(n))}})}return"Vector"})(rt.prototype);class bl extends rt{constructor(t){super(t.data);const n=this.get,r=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const l=s[o];if(l!==void 0)return l;const a=n.call(this,o);return s[o]=a,a}}),Object.defineProperty(this,"set",{value(o,l){r.call(this,o,l),s[o]=l}}),Object.defineProperty(this,"slice",{value:(o,l)=>new bl(i.call(this,o,l))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new rt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class Uu{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,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,n,r,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(r),t.writeInt64(BigInt(n??0)),t.offset()}}const xa=2,Ge=4,yn=4,at=4,Mn=new Int32Array(2),Mf=new Float32Array(Mn.buffer),Pf=new Float64Array(Mn.buffer),fo=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var zu;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(zu||(zu={}));let Ni=class Wm{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Wm(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 BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}writeUint16(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8}writeInt32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeUint32(t,n){this.bytes_[t]=n,this.bytes_[t+1]=n>>8,this.bytes_[t+2]=n>>16,this.bytes_[t+3]=n>>24}writeInt64(t,n){this.writeInt32(t,Number(BigInt.asIntN(32,n))),this.writeInt32(t+4,Number(BigInt.asIntN(32,n>>BigInt(32))))}writeUint64(t,n){this.writeUint32(t,Number(BigInt.asUintN(32,n))),this.writeUint32(t+4,Number(BigInt.asUintN(32,n>>BigInt(32))))}writeFloat32(t,n){Mf[0]=n,this.writeInt32(t,Mn[0])}writeFloat64(t,n){Pf[0]=n,this.writeInt32(t,Mn[fo?0:1]),this.writeInt32(t+4,Mn[fo?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[n]==0;n--);const r=n+1;for(;n>=0;n--)this.addInt16(this.vtable[n]!=0?t-this.vtable[n]:0);const i=2;this.addInt16(t-this.object_start);const s=(r+i)*xa;this.addInt16(s);let o=0;const l=this.space;t:for(n=0;n=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,Ge+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,n){this.finish(t,n,!0)}requiredField(t,n){const r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(n=0;r--)t.addInt32(n[r]);return t.endVector()}static startTypeIdsVector(t,n){t.startVector(4,n,4)}static endUnion(t){return t.endObject()}static createUnion(t,n,r){return Zt.startUnion(t),Zt.addMode(t,n),Zt.addTypeIds(t,r),Zt.endUnion(t)}}class Tr{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsUtf8(t,n){return(n||new Tr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+at),(n||new Tr).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Tr.startUtf8(t),Tr.endUtf8(t)}}var mt;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded"})(mt||(mt={}));let ge=class Ro{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsField(t,n){return(n||new Ro).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+at),(n||new Ro).__init(t.readInt32(t.position())+t.position(),t)}name(t){const n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb_pos+n,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):mt.NONE}type(t){const n=this.bb.__offset(this.bb_pos,10);return n?this.bb.__union(t,this.bb_pos+n):null}dictionary(t){const n=this.bb.__offset(this.bb_pos,12);return n?(t||new mn).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}children(t,n){const r=this.bb.__offset(this.bb_pos,14);return r?(n||new Ro).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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,n){const r=this.bb.__offset(this.bb_pos,16);return r?(n||new Ot).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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,n){t.addFieldOffset(0,n,0)}static addNullable(t,n){t.addFieldInt8(1,+n,0)}static addTypeType(t,n){t.addFieldInt8(2,n,mt.NONE)}static addType(t,n){t.addFieldOffset(3,n,0)}static addDictionary(t,n){t.addFieldOffset(4,n,0)}static addChildren(t,n){t.addFieldOffset(5,n,0)}static createChildrenVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startChildrenVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(6,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endField(t){return t.endObject()}},$e=class un{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsSchema(t,n){return(n||new un).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+at),(n||new un).__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):Ti.Little}fields(t,n){const r=this.bb.__offset(this.bb_pos,6);return r?(n||new ge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new Ot).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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 n=this.bb.__offset(this.bb_pos,10);return n?this.bb.readInt64(this.bb.__vector(this.bb_pos+n)+t*8):BigInt(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,n){t.addFieldInt16(0,n,Ti.Little)}static addFields(t,n){t.addFieldOffset(1,n,0)}static createFieldsVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startFieldsVector(t,n){t.startVector(4,n,4)}static addCustomMetadata(t,n){t.addFieldOffset(2,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static addFeatures(t,n){t.addFieldOffset(3,n,0)}static createFeaturesVector(t,n){t.startVector(8,n.length,8);for(let r=n.length-1;r>=0;r--)t.addInt64(n[r]);return t.endVector()}static startFeaturesVector(t,n){t.startVector(8,n,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,n){t.finish(n)}static finishSizePrefixedSchemaBuffer(t,n){t.finish(n,void 0,!0)}static createSchema(t,n,r,i,s){return un.startSchema(t),un.addEndianness(t,n),un.addFields(t,r),un.addCustomMetadata(t,i),un.addFeatures(t,s),un.endSchema(t)}};class ae{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsFooter(t,n){return(n||new ae).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+at),(n||new ae).__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):ki.V1}schema(t){const n=this.bb.__offset(this.bb_pos,6);return n?(t||new $e).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dictionaries(t,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new Uu).__init(this.bb.__vector(this.bb_pos+r)+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,n){const r=this.bb.__offset(this.bb_pos,10);return r?(n||new Uu).__init(this.bb.__vector(this.bb_pos+r)+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,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new Ot).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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,n){t.addFieldInt16(0,n,ki.V1)}static addSchema(t,n){t.addFieldOffset(1,n,0)}static addDictionaries(t,n){t.addFieldOffset(2,n,0)}static startDictionariesVector(t,n){t.startVector(24,n,8)}static addRecordBatches(t,n){t.addFieldOffset(3,n,0)}static startRecordBatchesVector(t,n){t.startVector(24,n,8)}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,n){t.finish(n)}static finishSizePrefixedFooterBuffer(t,n){t.finish(n,void 0,!0)}}class it{constructor(t=[],n,r,i=Bt.V5){this.fields=t||[],this.metadata=n||new Map,r||(r=ju(t)),this.dictionaries=r,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,n)=>`${n}: ${t}`).join(", ")} }>`}select(t){const n=new Set(t),r=this.fields.filter(i=>n.has(i.name));return new it(r,this.metadata)}selectAt(t){const n=t.map(r=>this.fields[r]).filter(Boolean);return new it(n,this.metadata)}assign(...t){const n=t[0]instanceof it?t[0]:Array.isArray(t[0])?new it(t[0]):new it(t),r=[...this.fields],i=ho(ho(new Map,this.metadata),n.metadata),s=n.fields.filter(l=>{const a=r.findIndex(u=>u.name===l.name);return~a?(r[a]=l.clone({metadata:ho(ho(new Map,r[a].metadata),l.metadata)}))&&!1:!0}),o=ju(s,new Map);return new it([...r,...s],i,new Map([...this.dictionaries,...o]))}}it.prototype.fields=null;it.prototype.metadata=null;it.prototype.dictionaries=null;class yt{static new(...t){let[n,r,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new yt(`${n}`,r,i,s)}constructor(t,n,r=!1,i){this.name=t,this.type=n,this.nullable=r,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,s]=t;return!t[0]||typeof t[0]!="object"?[n=this.name,r=this.type,i=this.nullable,s=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],yt.new(n,r,i,s)}}yt.prototype.type=null;yt.prototype.name=null;yt.prototype.nullable=null;yt.prototype.metadata=null;function ho(e,t){return new Map([...e||new Map,...t||new Map])}function ju(e,t=new Map){for(let n=-1,r=e.length;++n0&&ju(s.children,t)}return t}var z_=Hm,j_=Ni;class Fs{static decode(t){t=new j_(tt(t));const n=ae.getRootAsFooter(t),r=it.decode(n.schema(),new Map,n.version());return new V_(r,n)}static encode(t){const n=new z_,r=it.encode(n,t.schema);ae.startRecordBatchesVector(n,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())rr.encode(n,o);const i=n.endVector();ae.startDictionariesVector(n,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())rr.encode(n,o);const s=n.endVector();return ae.startFooter(n),ae.addSchema(n,r),ae.addVersion(n,Bt.V5),ae.addRecordBatches(n,i),ae.addDictionaries(n,s),ae.finishFooterBuffer(n,ae.endFooter(n)),n.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,n=Bt.V5,r,i){this.schema=t,this.version=n,r&&(this._recordBatches=r),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,n=-1,r=this.numRecordBatches;++n=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return U(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(wt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return ve.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return ve.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return U(this,void 0,void 0,function*(){return yield this.abort(t),wt})}return(t){return U(this,void 0,void 0,function*(){return yield this.close(),wt})}read(t){return U(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return U(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((n,r)=>{this.resolvers.push({resolve:n,reject:r})}):Promise.resolve(wt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Fo extends $_{write(t){if((t=tt(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Cu(this.toUint8Array(!0)):this.toUint8Array(!1).then(Cu)}toUint8Array(t=!1){return t?rn(this._values)[0]:U(this,void 0,void 0,function*(){var n,r,i,s;const o=[];let l=0;try{for(var a=!0,u=Rr(this),c;c=yield u.next(),n=c.done,!n;a=!0){s=c.value,a=!1;const h=s;o.push(h),l+=h.byteLength}}catch(h){r={error:h}}finally{try{!a&&!n&&(i=u.return)&&(yield i.call(u))}finally{if(r)throw r.error}}return rn(o,l)[0]})}}class Ol{constructor(t){t&&(this.source=new W_(ve.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 Oi{constructor(t){t instanceof Oi?this.source=t.source:t instanceof Fo?this.source=new yr(ve.fromAsyncIterable(t)):vy(t)?this.source=new yr(ve.fromNodeStream(t)):Yc(t)?this.source=new yr(ve.fromDOMStream(t)):gy(t)?this.source=new yr(ve.fromDOMStream(t.body)):Ps(t)?this.source=new yr(ve.fromIterable(t)):Lr(t)?this.source=new yr(ve.fromAsyncIterable(t)):xi(t)&&(this.source=new yr(ve.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 W_{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,n="read"){return this.source.next({cmd:n,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||wt)}return(t){return Object.create(this.source.return&&this.source.return(t)||wt)}}class yr{constructor(t){this.source=t,this._closedPromise=new Promise(n=>this._closedPromiseResolve=n)}cancel(t){return U(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return U(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return U(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,n="read"){return U(this,void 0,void 0,function*(){return yield this.source.next({cmd:n,size:t})})}throw(t){return U(this,void 0,void 0,function*(){const n=this.source.throw&&(yield this.source.throw(t))||wt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}return(t){return U(this,void 0,void 0,function*(){const n=this.source.return&&(yield this.source.return(t))||wt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(n)})}}class zf extends Ol{constructor(t,n){super(),this.position=0,this.buffer=tt(t),this.size=n===void 0?this.buffer.byteLength:n}readInt32(t){const{buffer:n,byteOffset:r}=this.readAt(t,4);return new DataView(n,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=n[3]*r[3];this.buffer[0]=i&65535;let s=i>>>16;return i=n[2]*r[3],s+=i,i=n[3]*r[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=n[1]*r[3]+n[2]*r[2]+n[3]*r[1],this.buffer[1]+=n[0]*r[3]+n[1]*r[2]+n[2]*r[1]+n[3]*r[0]<<16,this}_plus(t){const n=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],n>>0&&++this.buffer[1],this.buffer[0]=n}lessThan(t){return this.buffer[1]>>0,n[2]=this.buffer[2]+t.buffer[2]>>>0,n[1]=this.buffer[1]+t.buffer[1]>>>0,n[0]=this.buffer[0]+t.buffer[0]>>>0,n[0]>>0&&++n[1],n[1]>>0&&++n[2],n[2]>>0&&++n[3],this.buffer[3]=n[3],this.buffer[2]=n[2],this.buffer[1]=n[1],this.buffer[0]=n[0],this}hex(){return`${ii(this.buffer[3])} ${ii(this.buffer[2])} ${ii(this.buffer[1])} ${ii(this.buffer[0])}`}static multiply(t,n){return new We(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new We(new Uint32Array(t.buffer)).plus(n)}static from(t,n=new Uint32Array(4)){return We.fromString(typeof t=="string"?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return We.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){const r=t.startsWith("-"),i=t.length,s=new We(n);for(let o=r?1:0;o0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,n){return this.readData(t,n)}readTypeIds(t,n){return this.readData(t,n)}readData(t,{length:n,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+n)}readDictionary(t){return this.dictionaries.get(t.id)}}class Y_ extends Qm{constructor(t,n,r,i,s){super(new Uint8Array(0),n,r,i,s),this.sources=t}readNullBitmap(t,n,{offset:r}=this.nextBufferRange()){return n<=0?new Uint8Array(0):_l(this.sources[r])}readOffsets(t,{offset:n}=this.nextBufferRange()){return lt(Uint8Array,lt(Int32Array,this.sources[n]))}readTypeIds(t,{offset:n}=this.nextBufferRange()){return lt(Uint8Array,lt(t.ArrayType,this.sources[n]))}readData(t,{offset:n}=this.nextBufferRange()){const{sources:r}=this;return D.isTimestamp(t)||(D.isInt(t)||D.isTime(t))&&t.bitWidth===64||D.isDuration(t)||D.isDate(t)&&t.unit===En.MILLISECOND?lt(Uint8Array,Jt.convertArray(r[n])):D.isDecimal(t)?lt(Uint8Array,We.convertArray(r[n])):D.isBinary(t)||D.isFixedSizeBinary(t)?G_(r[n]):D.isBool(t)?_l(r[n]):D.isUtf8(t)?Hc(r[n].join("")):lt(Uint8Array,lt(t.ArrayType,r[n].map(i=>+i)))}}function G_(e){const t=e.join(""),n=new Uint8Array(t.length/2);for(let r=0;r>1]=Number.parseInt(t.slice(r,r+2),16);return n}class x extends H{compareSchemas(t,n){return t===n||n instanceof t.constructor&&this.compareManyFields(t.fields,n.fields)}compareManyFields(t,n){return t===n||Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((r,i)=>this.compareFields(r,n[i]))}compareFields(t,n){return t===n||n instanceof t.constructor&&t.name===n.name&&t.nullable===n.nullable&&this.visit(t.type,n.type)}}function Kt(e,t){return t instanceof e.constructor}function Us(e,t){return e===t||Kt(e,t)}function Tn(e,t){return e===t||Kt(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function ea(e,t){return e===t||Kt(e,t)&&e.precision===t.precision}function Q_(e,t){return e===t||Kt(e,t)&&e.byteWidth===t.byteWidth}function od(e,t){return e===t||Kt(e,t)&&e.unit===t.unit}function zs(e,t){return e===t||Kt(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function js(e,t){return e===t||Kt(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function K_(e,t){return e===t||Kt(e,t)&&e.children.length===t.children.length&&ir.compareManyFields(e.children,t.children)}function J_(e,t){return e===t||Kt(e,t)&&e.children.length===t.children.length&&ir.compareManyFields(e.children,t.children)}function ld(e,t){return e===t||Kt(e,t)&&e.mode===t.mode&&e.typeIds.every((n,r)=>n===t.typeIds[r])&&ir.compareManyFields(e.children,t.children)}function q_(e,t){return e===t||Kt(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&ir.visit(e.indices,t.indices)&&ir.visit(e.dictionary,t.dictionary)}function ad(e,t){return e===t||Kt(e,t)&&e.unit===t.unit}function Vs(e,t){return e===t||Kt(e,t)&&e.unit===t.unit}function X_(e,t){return e===t||Kt(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&ir.compareManyFields(e.children,t.children)}function Z_(e,t){return e===t||Kt(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&ir.compareManyFields(e.children,t.children)}x.prototype.visitNull=Us;x.prototype.visitBool=Us;x.prototype.visitInt=Tn;x.prototype.visitInt8=Tn;x.prototype.visitInt16=Tn;x.prototype.visitInt32=Tn;x.prototype.visitInt64=Tn;x.prototype.visitUint8=Tn;x.prototype.visitUint16=Tn;x.prototype.visitUint32=Tn;x.prototype.visitUint64=Tn;x.prototype.visitFloat=ea;x.prototype.visitFloat16=ea;x.prototype.visitFloat32=ea;x.prototype.visitFloat64=ea;x.prototype.visitUtf8=Us;x.prototype.visitBinary=Us;x.prototype.visitFixedSizeBinary=Q_;x.prototype.visitDate=od;x.prototype.visitDateDay=od;x.prototype.visitDateMillisecond=od;x.prototype.visitTimestamp=zs;x.prototype.visitTimestampSecond=zs;x.prototype.visitTimestampMillisecond=zs;x.prototype.visitTimestampMicrosecond=zs;x.prototype.visitTimestampNanosecond=zs;x.prototype.visitTime=js;x.prototype.visitTimeSecond=js;x.prototype.visitTimeMillisecond=js;x.prototype.visitTimeMicrosecond=js;x.prototype.visitTimeNanosecond=js;x.prototype.visitDecimal=Us;x.prototype.visitList=K_;x.prototype.visitStruct=J_;x.prototype.visitUnion=ld;x.prototype.visitDenseUnion=ld;x.prototype.visitSparseUnion=ld;x.prototype.visitDictionary=q_;x.prototype.visitInterval=ad;x.prototype.visitIntervalDayTime=ad;x.prototype.visitIntervalYearMonth=ad;x.prototype.visitDuration=Vs;x.prototype.visitDurationSecond=Vs;x.prototype.visitDurationMillisecond=Vs;x.prototype.visitDurationMicrosecond=Vs;x.prototype.visitDurationNanosecond=Vs;x.prototype.visitFixedSizeList=X_;x.prototype.visitMap=Z_;const ir=new x;function Vu(e,t){return ir.compareSchemas(e,t)}function Ba(e,t){return t1(e,t.map(n=>n.data.concat()))}function t1(e,t){const n=[...e.fields],r=[],i={numBatches:t.reduce((h,y)=>Math.max(h,y.length),0)};let s=0,o=0,l=-1;const a=t.length;let u,c=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,l=-1;++l0&&(r[s++]=K({type:new $t(n),length:o,nullCount:0,children:c.slice()})))}return[e=e.assign(n),r.map(h=>new te(e,h))]}function e1(e,t,n,r,i){var s;const o=(t+63&-64)>>3;for(let l=-1,a=r.length;++l=t)c===t?n[l]=u:(n[l]=u.slice(0,t),i.numBatches=Math.max(i.numBatches,r[l].unshift(u.slice(t,c-t))));else{const h=e[l];e[l]=h.clone({nullable:!0}),n[l]=(s=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:K({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var Km;let sr=class vr{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new it([]),this._offsets=[0],this;let i,s;t[0]instanceof it&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=a=>{if(a){if(a instanceof te)return[a];if(a instanceof vr)return a.batches;if(a instanceof ut){if(a.type instanceof $t)return[new te(new it(a.type.children),a)]}else{if(Array.isArray(a))return a.flatMap(u=>o(u));if(typeof a[Symbol.iterator]=="function")return[...a].flatMap(u=>o(u));if(typeof a=="object"){const u=Object.keys(a),c=u.map(g=>new rt([a[g]])),h=new it(u.map((g,v)=>new yt(String(g),c[v].type))),[,y]=Ba(h,c);return y.length===0?[new te(a)]:y}}}return[]},l=t.flatMap(a=>o(a));if(i=(r=i??((n=l[0])===null||n===void 0?void 0:n.schema))!==null&&r!==void 0?r:new it([]),!(i instanceof it))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const a of l){if(!(a instanceof te))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Vu(i,a.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=l,this._offsets=s??Bm(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,n)=>t+n.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=xm(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,n){}indexOf(t,n){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?rd.visit(new rt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ + ${this.toArray().join(`, + `)} +]`}concat(...t){const n=this.schema,r=this.data.concat(t.flatMap(({data:i})=>i));return new vr(n,r.map(i=>new te(n,i)))}slice(t,n){const r=this.schema;[t,n]=Fm({length:this.numRows},t,n);const i=Cm(this.data,this._offsets,t,n);return new vr(r,i.map(s=>new te(r,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(n=>n.name===t))}getChildAt(t){if(t>-1&&tr.children[t]);if(n.length===0){const{type:r}=this.schema.fields[t],i=K({type:r,length:0,nullCount:0});n.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new rt(n)}return null}setChild(t,n){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(i=>i.name===t),n)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],l[t]]=[o,n],[r,i]=Ba(r,l)}return new vr(r,i)}select(t){const n=this.schema.fields.reduce((r,i,s)=>r.set(i.name,s),new Map);return this.selectAt(t.map(r=>n.get(r)).filter(r=>r>-1))}selectAt(t){const n=this.schema.selectAt(t),r=this.batches.map(i=>i.selectAt(t));return new vr(n,r)}assign(t){const n=this.schema.fields,[r,i]=t.schema.fields.reduce((l,a,u)=>{const[c,h]=l,y=n.findIndex(g=>g.name===a.name);return~y?h[y]=u:c.push(u),l},[[],[]]),s=this.schema.assign(t.schema),o=[...n.map((l,a)=>[a,i[a]]).map(([l,a])=>a===void 0?this.getChildAt(l):t.getChildAt(a)),...r.map(l=>t.getChildAt(l))].filter(Boolean);return new vr(...Ba(s,o))}};Km=Symbol.toStringTag;sr[Km]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=yi(nd),e.get=yi(le.getVisitFn(d.Struct)),e.set=Lm(Oe.getVisitFn(d.Struct)),e.indexOf=Mm(Sl.getVisitFn(d.Struct)),e.getByteLength=yi(sn.getVisitFn(d.Struct)),"Table"))(sr.prototype);var Jm;let te=class qi{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof it))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=K({nullCount:0,type:new $t(this.schema.fields),children:this.schema.fields.map(n=>K({type:n.type,nullCount:0}))})]=t,!(this.data instanceof ut))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=jf(this.schema,this.data.children);break}case 1:{const[n]=t,{fields:r,children:i,length:s}=Object.keys(n).reduce((a,u,c)=>(a.children[c]=n[u],a.length=Math.max(a.length,n[u].length),a.fields[c]=yt.new({name:u,type:n[u].type,nullable:!0}),a),{length:0,fields:new Array,children:new Array}),o=new it(r),l=K({type:new $t(r),length:s,children:i,nullCount:0});[this.schema,this.data]=jf(o,l.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=qm(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 le.visit(this.data,t)}set(t,n){return Oe.visit(this.data,t,n)}indexOf(t,n){return Sl.visit(this.data,t,n)}getByteLength(t){return sn.visit(this.data,t)}[Symbol.iterator](){return rd.visit(new rt([this.data]))}toArray(){return[...this]}concat(...t){return new sr(this.schema,[this,...t])}slice(t,n){const[r]=new rt([this.data]).slice(t,n).data;return new qi(this.schema,r)}getChild(t){var n;return this.getChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&ti.name===t),n)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&tl.name===s);~o&&(i[o]=this.data.children[o])}return new qi(n,K({type:r,length:this.numRows,children:i}))}selectAt(t){const n=this.schema.selectAt(t),r=t.map(s=>this.data.children[s]).filter(Boolean),i=K({type:new $t(n.fields),length:this.numRows,children:r});return new qi(n,i)}};Jm=Symbol.toStringTag;te[Jm]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(te.prototype);function jf(e,t,n=t.reduce((r,i)=>Math.max(r,i.length),0)){var r;const i=[...e.fields],s=[...t],o=(n+63&-64)>>3;for(const[l,a]of e.fields.entries()){const u=t[l];(!u||u.length!==n)&&(i[l]=a.clone({nullable:!0}),s[l]=(r=u==null?void 0:u._changeLengthAndBackfillNullBitmap(n))!==null&&r!==void 0?r:K({type:a.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),K({type:new $t(i),length:n,children:s})]}function qm(e,t,n=new Map){var r,i;if(((r=e==null?void 0:e.length)!==null&&r!==void 0?r:0)>0&&(e==null?void 0:e.length)===(t==null?void 0:t.length))for(let s=-1,o=e.length;++sK({type:i.type})),r=K({type:new $t(t.fields),nullCount:0,children:n});super(t,r)}}var Rl;(function(e){e[e.BUFFER=0]="BUFFER"})(Rl||(Rl={}));var Fl;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Fl||(Fl={}));class Pn{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsBodyCompression(t,n){return(n||new Pn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,n){return t.setPosition(t.position()+at),(n||new Pn).__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):Fl.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Rl.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,n){t.addFieldInt8(0,n,Fl.LZ4_FRAME)}static addMethod(t,n){t.addFieldInt8(1,n,Rl.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,n,r){return Pn.startBodyCompression(t),Pn.addCodec(t,n),Pn.addMethod(t,r),Pn.endBodyCompression(t)}}class Xm{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,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,n,r){return t.prep(8,16),t.writeInt64(BigInt(r??0)),t.writeInt64(BigInt(n??0)),t.offset()}}let Zm=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,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,n,r){return t.prep(8,16),t.writeInt64(BigInt(r??0)),t.writeInt64(BigInt(n??0)),t.offset()}},hn=class $u{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsRecordBatch(t,n){return(n||new $u).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,n){return t.setPosition(t.position()+at),(n||new $u).__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):BigInt("0")}nodes(t,n){const r=this.bb.__offset(this.bb_pos,6);return r?(n||new Zm).__init(this.bb.__vector(this.bb_pos+r)+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,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new Xm).__init(this.bb.__vector(this.bb_pos+r)+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 n=this.bb.__offset(this.bb_pos,10);return n?(t||new Pn).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,n){t.addFieldInt64(0,n,BigInt("0"))}static addNodes(t,n){t.addFieldOffset(1,n,0)}static startNodesVector(t,n){t.startVector(16,n,8)}static addBuffers(t,n){t.addFieldOffset(2,n,0)}static startBuffersVector(t,n){t.startVector(16,n,8)}static addCompression(t,n){t.addFieldOffset(3,n,0)}static endRecordBatch(t){return t.endObject()}},Hr=class Wu{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsDictionaryBatch(t,n){return(n||new Wu).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,n){return t.setPosition(t.position()+at),(n||new Wu).__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):BigInt("0")}data(t){const n=this.bb.__offset(this.bb_pos,6);return n?(t||new hn).__init(this.bb.__indirect(this.bb_pos+n),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,n){t.addFieldInt64(0,n,BigInt("0"))}static addData(t,n){t.addFieldOffset(1,n,0)}static addIsDelta(t,n){t.addFieldInt8(2,+n,0)}static endDictionaryBatch(t){return t.endObject()}};var Al;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(Al||(Al={}));let An=class je{constructor(){this.bb=null,this.bb_pos=0}__init(t,n){return this.bb_pos=t,this.bb=n,this}static getRootAsMessage(t,n){return(n||new je).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+at),(n||new je).__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):ki.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Al.NONE}header(t){const n=this.bb.__offset(this.bb_pos,8);return n?this.bb.__union(t,this.bb_pos+n):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new Ot).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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,n){t.addFieldInt16(0,n,ki.V1)}static addHeaderType(t,n){t.addFieldInt8(1,n,Al.NONE)}static addHeader(t,n){t.addFieldOffset(2,n,0)}static addBodyLength(t,n){t.addFieldInt64(3,n,BigInt("0"))}static addCustomMetadata(t,n){t.addFieldOffset(4,n,0)}static createCustomMetadataVector(t,n){t.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)t.addOffset(n[r]);return t.endVector()}static startCustomMetadataVector(t,n){t.startVector(4,n,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,n){t.finish(n)}static finishSizePrefixedMessageBuffer(t,n){t.finish(n,void 0,!0)}static createMessage(t,n,r,i,s,o){return je.startMessage(t),je.addVersion(t,n),je.addHeaderType(t,r),je.addHeader(t,i),je.addBodyLength(t,s),je.addCustomMetadata(t,o),je.endMessage(t)}};class n1 extends H{visit(t,n){return t==null||n==null?void 0:super.visit(t,n)}visitNull(t,n){return Nr.startNull(n),Nr.endNull(n)}visitInt(t,n){return ce.startInt(n),ce.addBitWidth(n,t.bitWidth),ce.addIsSigned(n,t.isSigned),ce.endInt(n)}visitFloat(t,n){return qe.startFloatingPoint(n),qe.addPrecision(n,t.precision),qe.endFloatingPoint(n)}visitBinary(t,n){return br.startBinary(n),br.endBinary(n)}visitBool(t,n){return Ir.startBool(n),Ir.endBool(n)}visitUtf8(t,n){return Tr.startUtf8(n),Tr.endUtf8(n)}visitDecimal(t,n){return qt.startDecimal(n),qt.addScale(n,t.scale),qt.addPrecision(n,t.precision),qt.addBitWidth(n,t.bitWidth),qt.endDecimal(n)}visitDate(t,n){return Oo.startDate(n),Oo.addUnit(n,t.unit),Oo.endDate(n)}visitTime(t,n){return Se.startTime(n),Se.addUnit(n,t.unit),Se.addBitWidth(n,t.bitWidth),Se.endTime(n)}visitTimestamp(t,n){const r=t.timezone&&n.createString(t.timezone)||void 0;return be.startTimestamp(n),be.addUnit(n,t.unit),r!==void 0&&be.addTimezone(n,r),be.endTimestamp(n)}visitInterval(t,n){return Xe.startInterval(n),Xe.addUnit(n,t.unit),Xe.endInterval(n)}visitDuration(t,n){return Qe.startDuration(n),Qe.addUnit(n,t.unit),Qe.endDuration(n)}visitList(t,n){return Er.startList(n),Er.endList(n)}visitStruct(t,n){return kr.startStruct_(n),kr.endStruct_(n)}visitUnion(t,n){Zt.startTypeIdsVector(n,t.typeIds.length);const r=Zt.createTypeIdsVector(n,t.typeIds);return Zt.startUnion(n),Zt.addMode(n,t.mode),Zt.addTypeIds(n,r),Zt.endUnion(n)}visitDictionary(t,n){const r=this.visit(t.indices,n);return mn.startDictionaryEncoding(n),mn.addId(n,BigInt(t.id)),mn.addIsOrdered(n,t.isOrdered),r!==void 0&&mn.addIndexType(n,r),mn.endDictionaryEncoding(n)}visitFixedSizeBinary(t,n){return Ke.startFixedSizeBinary(n),Ke.addByteWidth(n,t.byteWidth),Ke.endFixedSizeBinary(n)}visitFixedSizeList(t,n){return Je.startFixedSizeList(n),Je.addListSize(n,t.listSize),Je.endFixedSizeList(n)}visitMap(t,n){return Do.startMap(n),Do.addKeysSorted(n,t.keysSorted),Do.endMap(n)}}const Ca=new n1;function r1(e,t=new Map){return new it(s1(e,t),Ao(e.metadata),t)}function tg(e){return new pe(e.count,eg(e.columns),ng(e.columns))}function i1(e){return new on(tg(e.data),e.id,e.isDelta)}function s1(e,t){return(e.fields||[]).filter(Boolean).map(n=>yt.fromJSON(n,t))}function Vf(e,t){return(e.children||[]).filter(Boolean).map(n=>yt.fromJSON(n,t))}function eg(e){return(e||[]).reduce((t,n)=>[...t,new or(n.count,o1(n.VALIDITY)),...eg(n.children)],[])}function ng(e,t=[]){for(let n=-1,r=(e||[]).length;++nt+ +(n===0),0)}function l1(e,t){let n,r,i,s,o,l;return!t||!(s=e.dictionary)?(o=Wf(e,Vf(e,t)),i=new yt(e.name,o,e.nullable,Ao(e.metadata))):t.has(n=s.id)?(r=(r=s.indexType)?$f(r):new Os,l=new Ei(t.get(n),r,n,s.isOrdered),i=new yt(e.name,l,e.nullable,Ao(e.metadata))):(r=(r=s.indexType)?$f(r):new Os,t.set(n,o=Wf(e,Vf(e,t))),l=new Ei(o,r,n,s.isOrdered),i=new yt(e.name,l,e.nullable,Ao(e.metadata))),i||null}function Ao(e=[]){return new Map(e.map(({key:t,value:n})=>[t,n]))}function $f(e){return new er(e.isSigned,e.bitWidth)}function Wf(e,t){const n=e.type.name;switch(n){case"NONE":return new tr;case"null":return new tr;case"binary":return new ol;case"utf8":return new ll;case"bool":return new al;case"list":return new pl((t||[])[0]);case"struct":return new $t(t||[]);case"struct_":return new $t(t||[])}switch(n){case"int":{const r=e.type;return new er(r.isSigned,r.bitWidth)}case"floatingpoint":{const r=e.type;return new Ds(se[r.precision])}case"decimal":{const r=e.type;return new ul(r.scale,r.precision,r.bitWidth)}case"date":{const r=e.type;return new cl(En[r.unit])}case"time":{const r=e.type;return new Rs(z[r.unit],r.bitWidth)}case"timestamp":{const r=e.type;return new dl(z[r.unit],r.timezone)}case"interval":{const r=e.type;return new fl(Zn[r.unit])}case"duration":{const r=e.type;return new hl(z[r.unit])}case"union":{const r=e.type,[i,...s]=(r.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new yl(Yt[o],r.typeIds||[],t||[])}case"fixedsizebinary":{const r=e.type;return new ml(r.byteWidth)}case"fixedsizelist":{const r=e.type;return new gl(r.listSize,(t||[])[0])}case"map":{const r=e.type;return new vl((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${n}"`)}var a1=Hm,u1=Ni;class Wt{static fromJSON(t,n){const r=new Wt(0,Bt.V5,n);return r._createHeader=c1(t,n),r}static decode(t){t=new u1(tt(t));const n=An.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),s=n.headerType(),o=new Wt(r,i,s);return o._createHeader=d1(n,s),o}static encode(t){const n=new a1;let r=-1;return t.isSchema()?r=it.encode(n,t.header()):t.isRecordBatch()?r=pe.encode(n,t.header()):t.isDictionaryBatch()&&(r=on.encode(n,t.header())),An.startMessage(n),An.addVersion(n,Bt.V5),An.addHeader(n,r),An.addHeaderType(n,t.headerType),An.addBodyLength(n,BigInt(t.bodyLength)),An.finishMessageBuffer(n,An.endMessage(n)),n.asUint8Array()}static from(t,n=0){if(t instanceof it)return new Wt(0,Bt.V5,nt.Schema,t);if(t instanceof pe)return new Wt(n,Bt.V5,nt.RecordBatch,t);if(t instanceof on)return new Wt(n,Bt.V5,nt.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===nt.Schema}isRecordBatch(){return this.headerType===nt.RecordBatch}isDictionaryBatch(){return this.headerType===nt.DictionaryBatch}constructor(t,n,r,i){this._version=n,this._headerType=r,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Pe(t)}}class pe{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,n,r){this._nodes=n,this._buffers=r,this._length=Pe(t)}}class on{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,n,r=!1){this._data=t,this._isDelta=r,this._id=Pe(n)}}class tn{constructor(t,n){this.offset=Pe(t),this.length=Pe(n)}}class or{constructor(t,n){this.length=Pe(t),this.nullCount=Pe(n)}}function c1(e,t){return()=>{switch(t){case nt.Schema:return it.fromJSON(e);case nt.RecordBatch:return pe.fromJSON(e);case nt.DictionaryBatch:return on.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${nt[t]}, type: ${t} }`)}}function d1(e,t){return()=>{switch(t){case nt.Schema:return it.decode(e.header(new $e),new Map,e.version());case nt.RecordBatch:return pe.decode(e.header(new hn),e.version());case nt.DictionaryBatch:return on.decode(e.header(new Hr),e.version())}throw new Error(`Unrecognized Message type: { name: ${nt[t]}, type: ${t} }`)}}yt.encode=b1;yt.decode=_1;yt.fromJSON=l1;it.encode=S1;it.decode=f1;it.fromJSON=r1;pe.encode=I1;pe.decode=h1;pe.fromJSON=tg;on.encode=E1;on.decode=p1;on.fromJSON=i1;or.encode=N1;or.decode=m1;tn.encode=k1;tn.decode=y1;function f1(e,t=new Map,n=Bt.V5){const r=w1(e,t);return new it(r,xo(e),t,n)}function h1(e,t=Bt.V5){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new pe(e.length(),g1(e),v1(e,t))}function p1(e,t=Bt.V5){return new on(pe.decode(e.data(),t),e.id(),e.isDelta())}function y1(e){return new tn(e.offset(),e.length())}function m1(e){return new or(e.length(),e.nullCount())}function g1(e){const t=[];for(let n,r=-1,i=-1,s=e.nodesLength();++ryt.encode(e,s));$e.startFieldsVector(e,n.length);const r=$e.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?$e.createCustomMetadataVector(e,[...t.metadata].map(([s,o])=>{const l=e.createString(`${s}`),a=e.createString(`${o}`);return Ot.startKeyValue(e),Ot.addKey(e,l),Ot.addValue(e,a),Ot.endKeyValue(e)})):-1;return $e.startSchema(e),$e.addFields(e,r),$e.addEndianness(e,T1?Ti.Little:Ti.Big),i!==-1&&$e.addCustomMetadata(e,i),$e.endSchema(e)}function b1(e,t){let n=-1,r=-1,i=-1;const s=t.type;let o=t.typeId;D.isDictionary(s)?(o=s.dictionary.typeId,i=Ca.visit(s,e),r=Ca.visit(s.dictionary,e)):r=Ca.visit(s,e);const l=(s.children||[]).map(c=>yt.encode(e,c)),a=ge.createChildrenVector(e,l),u=t.metadata&&t.metadata.size>0?ge.createCustomMetadataVector(e,[...t.metadata].map(([c,h])=>{const y=e.createString(`${c}`),g=e.createString(`${h}`);return Ot.startKeyValue(e),Ot.addKey(e,y),Ot.addValue(e,g),Ot.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),ge.startField(e),ge.addType(e,r),ge.addTypeType(e,o),ge.addChildren(e,a),ge.addNullable(e,!!t.nullable),n!==-1&&ge.addName(e,n),i!==-1&&ge.addDictionary(e,i),u!==-1&&ge.addCustomMetadata(e,u),ge.endField(e)}function I1(e,t){const n=t.nodes||[],r=t.buffers||[];hn.startNodesVector(e,n.length);for(const o of n.slice().reverse())or.encode(e,o);const i=e.endVector();hn.startBuffersVector(e,r.length);for(const o of r.slice().reverse())tn.encode(e,o);const s=e.endVector();return hn.startRecordBatch(e),hn.addLength(e,BigInt(t.length)),hn.addNodes(e,i),hn.addBuffers(e,s),hn.endRecordBatch(e)}function E1(e,t){const n=pe.encode(e,t.data);return Hr.startDictionaryBatch(e),Hr.addId(e,BigInt(t.id)),Hr.addIsDelta(e,t.isDelta),Hr.addData(e,n),Hr.endDictionaryBatch(e)}function N1(e,t){return Zm.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function k1(e,t){return Xm.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const T1=(()=>{const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),cd=e=>`Expected ${nt[e]} Message in stream, but was null or length 0.`,dd=e=>`Header pointer of flatbuffer-encoded ${nt[e]} Message is null or length 0.`,rg=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,ig=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;class sg{constructor(t){this.source=t instanceof Ol?t:new Ol(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?wt:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(cd(t));return n.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const n=tt(this.source.read(t));if(n.byteLength[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...n(s.children)],[])}}readMessage(t){let n;if((n=this.next()).done)return null;if(t!=null&&n.value.headerType!==t)throw new Error(cd(t));return n.value}readSchema(){const t=nt.Schema,n=this.readMessage(t),r=n==null?void 0:n.header();if(!n||!r)throw new Error(dd(t));return r}}const na=4,Hu="ARROW1",As=new Uint8Array(Hu.length);for(let e=0;ethis):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 ve.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return ve.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Ne?t:Lu(t)?B1(t):my(t)?M1(t):Lr(t)?U(this,void 0,void 0,function*(){return yield Ne.from(yield t)}):gy(t)||Yc(t)||vy(t)||xi(t)?L1(new Oi(t)):C1(new Ol(t))}static readAll(t){return t instanceof Ne?t.isSync()?Qf(t):Kf(t):Lu(t)||ArrayBuffer.isView(t)||Ps(t)||yy(t)?Qf(t):Kf(t)}}class xl extends Ne{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Ze(this,arguments,function*(){yield W(yield*To(Rr(this[Symbol.iterator]())))})}}class Bl extends Ne{constructor(t){super(t),this._impl=t}readAll(){var t,n,r,i;return U(this,void 0,void 0,function*(){const s=new Array;try{for(var o=!0,l=Rr(this),a;a=yield l.next(),t=a.done,!t;o=!0){i=a.value,o=!1;const u=i;s.push(u)}}catch(u){n={error:u}}finally{try{!o&&!t&&(r=l.return)&&(yield r.call(l))}finally{if(n)throw n.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class lg extends xl{constructor(t){super(t),this._impl=t}}class F1 extends Bl{constructor(t){super(t),this._impl=t}}class ag{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,n){const r=this._loadVectors(t,n,this.schema.fields),i=K({type:new $t(this.schema.fields),length:t.length,children:r});return new te(this.schema,i)}_loadDictionaryBatch(t,n){const{id:r,isDelta:i}=t,{dictionaries:s,schema:o}=this,l=s.get(r);if(i||!l){const a=o.dictionaries.get(r),u=this._loadVectors(t.data,n,[a]);return(l&&i?l.concat(new rt(u)):new rt(u)).memoize()}return l.memoize()}_loadVectors(t,n,r){return new Qm(n,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(r)}}class Cl extends ag{constructor(t,n){super(n),this._reader=Lu(t)?new D1(this._handle=t):new sg(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=cg(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):wt}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):wt}next(){if(this.closed)return wt;let t;const{_reader:n}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),i=n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),i=n.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ud(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ll extends ag{constructor(t,n){super(n),this._reader=new O1(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return U(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 U(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=cg(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return U(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):wt})}return(t){return U(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):wt})}next(){return U(this,void 0,void 0,function*(){if(this.closed)return wt;let t;const{_reader:n}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),i=yield n.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),i=yield n.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(r,i);this.dictionaries.set(r.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ud(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return U(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class ug extends Cl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,n){super(t instanceof zf?t:new zf(t),n)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var n;if(this.closed)return null;this._footer||this.open();const r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){const i=this._reader.readMessage(nt.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var n;const r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){const i=this._reader.readMessage(nt.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength),l=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,l)}}}_readFooter(){const{_handle:t}=this,n=t.size-og,r=t.readInt32(n),i=t.readAt(n-r,r);return Fs.decode(i)}_readNextMessageAndValidate(t){var n;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return U(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const r of this._footer.dictionaryBatches())r&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield n.open.call(this,t)})}readRecordBatch(t){var n;return U(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());const r=(n=this._footer)===null||n===void 0?void 0:n.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){const i=yield this._reader.readMessage(nt.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){var n;return U(this,void 0,void 0,function*(){const r=(n=this._footer)===null||n===void 0?void 0:n.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){const i=yield this._reader.readMessage(nt.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),l=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,l)}}})}_readFooter(){return U(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const n=t.size-og,r=yield t.readInt32(n),i=yield t.readAt(n-r,r);return Fs.decode(i)})}_readNextMessageAndValidate(t){return U(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?fd(t)?new lg(new ug(e.read())):new xl(new Cl(e)):new xl(new Cl(function*(){}()))}function L1(e){return U(this,void 0,void 0,function*(){const t=yield e.peek($s+7&-8);return t&&t.byteLength>=4?fd(t)?new lg(new ug(yield e.read())):new Bl(new Ll(e)):new Bl(new Ll(function(){return Ze(this,arguments,function*(){})}()))})}function M1(e){return U(this,void 0,void 0,function*(){const{size:t}=yield e.stat(),n=new Dl(e,t);return t>=R1&&fd(yield n.readAt(0,$s+7&-8))?new F1(new A1(n)):new Bl(new Ll(n))})}class Et extends H{static assemble(...t){const n=i=>i.flatMap(s=>Array.isArray(s)?n(s):s instanceof te?s.data.children:s.data),r=new Et;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof rt)return this.visitMany(t.data),this;const{type:n}=t;if(!D.isDictionary(n)){const{length:r}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(D.isUnion(n))this.nodes.push(new or(r,0));else{const{nullCount:i}=t;D.isNull(n)||Le.call(this,i<=0?new Uint8Array(0):wl(t.offset,r,t.nullBitmap)),this.nodes.push(new or(r,i))}}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 Le(e){const t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new tn(this._byteLength,t)),this._byteLength+=t,this}function P1(e){var t;const{type:n,length:r,typeIds:i,valueOffsets:s}=e;if(Le.call(this,i),n.mode===Yt.Sparse)return Yu.call(this,e);if(n.mode===Yt.Dense){if(e.offset<=0)return Le.call(this,s),Yu.call(this,e);{const o=new Int32Array(r),l=Object.create(null),a=Object.create(null);for(let u,c,h=-1;++h{const h=n.typeIds[c],y=l[h],g=a[h];return u.slice(y,Math.min(r,g))}))}}return this}function U1(e){let t;return e.nullCount>=e.length?Le.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?Le.call(this,wl(e.offset,e.length,t)):Le.call(this,_l(e.values))}function On(e){return Le.call(this,e.values.subarray(0,e.length*e.stride))}function dg(e){const{length:t,values:n,valueOffsets:r}=e,{[0]:i,[t]:s}=r,o=Math.min(s-i,n.byteLength-i);return Le.call(this,_y(-i,t+1,r)),Le.call(this,n.subarray(i,i+o)),this}function hd(e){const{length:t,valueOffsets:n}=e;if(n){const{[0]:r,[t]:i}=n;return Le.call(this,_y(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function Yu(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Et.prototype.visitBool=U1;Et.prototype.visitInt=On;Et.prototype.visitFloat=On;Et.prototype.visitUtf8=dg;Et.prototype.visitBinary=dg;Et.prototype.visitFixedSizeBinary=On;Et.prototype.visitDate=On;Et.prototype.visitTimestamp=On;Et.prototype.visitTime=On;Et.prototype.visitDecimal=On;Et.prototype.visitList=hd;Et.prototype.visitStruct=Yu;Et.prototype.visitUnion=P1;Et.prototype.visitInterval=On;Et.prototype.visitDuration=On;Et.prototype.visitFixedSizeList=hd;Et.prototype.visitMap=hd;class fg extends id{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,n){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Fo,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,oe(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Lr(t)?t.then(n=>this.writeAll(n)):xi(t)?gd(this,t):md(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,n=null){return t===this._sink||t instanceof Fo?this._sink=t:(this._sink=new Fo,t&&rw(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&iw(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!n||!Vu(n,this._schema))&&(n==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=n,this._writeSchema(n))),this}write(t){let n=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof sr&&!(n=t.schema))return this.finish()&&void 0;if(t instanceof te&&!(n=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(n&&!Vu(n,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,n)}t instanceof te?t instanceof ud||this._writeRecordBatch(t):t instanceof sr?this.writeAll(t.batches):Ps(t)&&this.writeAll(t)}_writeMessage(t,n=8){const r=n-1,i=Wt.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,l=s+o+r&~r,a=l-s-o;return t.headerType===nt.RecordBatch?this._recordBatchBlocks.push(new rr(l,t.bodyLength,this._position)):t.headerType===nt.DictionaryBatch&&this._dictionaryBlocks.push(new rr(l,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(l-o)),s>0&&this._write(i),this._writePadding(a)}_write(t){if(this._started){const n=tt(t);n&&n.byteLength>0&&(this._sink.write(n),this._position+=n.byteLength)}return this}_writeSchema(t){return this._writeMessage(Wt.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(As)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:n,nodes:r,bufferRegions:i,buffers:s}=Et.assemble(t),o=new pe(t.numRows,r,i),l=Wt.from(o,n);return this._writeDictionaries(t)._writeMessage(l)._writeBodyBuffers(s)}_writeDictionaryBatch(t,n,r=!1){this._dictionaryDeltaOffsets.set(n,t.length+(this._dictionaryDeltaOffsets.get(n)||0));const{byteLength:i,nodes:s,bufferRegions:o,buffers:l}=Et.assemble(new rt([t])),a=new pe(t.length,s,o),u=new on(a,n,r),c=Wt.from(u,i);return this._writeMessage(c)._writeBodyBuffers(l)}_writeBodyBuffers(t){let n,r,i;for(let s=-1,o=t.length;++s0&&(this._write(n),(i=(r+7&-8)-r)>0&&this._writePadding(i));return this}_writeDictionaries(t){for(let[n,r]of t.dictionaries){let i=this._dictionaryDeltaOffsets.get(n)||0;if(i===0||(r=r==null?void 0:r.slice(i)).length>0)for(const s of r.data)this._writeDictionaryBatch(s,n,i>0),i+=s.length}return this}}class pd extends fg{static writeAll(t,n){const r=new pd(n);return Lr(t)?t.then(i=>r.writeAll(i)):xi(t)?gd(r,t):md(r,t)}}class yd extends fg{static writeAll(t){const n=new yd;return Lr(t)?t.then(r=>n.writeAll(r)):xi(t)?gd(n,t):md(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const n=Fs.encode(new Fs(t,Bt.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(n)._write(Int32Array.of(n.byteLength))._writeMagic()}}function md(e,t){let n=t;t instanceof sr&&(n=t.batches,e.reset(void 0,t.schema));for(const r of n)e.write(r);return e.finish()}function gd(e,t){var n,r,i,s,o,l,a;return U(this,void 0,void 0,function*(){try{for(n=!0,r=Rr(t);i=yield r.next(),s=i.done,!s;n=!0){a=i.value,n=!1;const u=a;e.write(u)}}catch(u){o={error:u}}finally{try{!n&&!s&&(l=r.return)&&(yield l.call(r))}finally{if(o)throw o.error}}return e.finish()})}function z1(e,t="stream"){return(t==="stream"?pd:yd).writeAll(e).toUint8Array(!0)}var j1=Object.create,hg=Object.defineProperty,V1=Object.getOwnPropertyDescriptor,$1=Object.getOwnPropertyNames,W1=Object.getPrototypeOf,H1=Object.prototype.hasOwnProperty,Y1=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),G1=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $1(t))!H1.call(e,i)&&i!==n&&hg(e,i,{get:()=>t[i],enumerable:!(r=V1(t,i))||r.enumerable});return e},Q1=(e,t,n)=>(n=e!=null?j1(W1(e)):{},G1(!e||!e.__esModule?hg(n,"default",{value:e,enumerable:!0}):n,e)),K1=Y1((e,t)=>{t.exports=Worker}),J1=(e=>(e[e.UNDEFINED=0]="UNDEFINED",e[e.AUTOMATIC=1]="AUTOMATIC",e[e.READ_ONLY=2]="READ_ONLY",e[e.READ_WRITE=3]="READ_WRITE",e))(J1||{}),q1=(e=>(e[e.IDENTIFIER=0]="IDENTIFIER",e[e.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",e[e.STRING_CONSTANT=2]="STRING_CONSTANT",e[e.OPERATOR=3]="OPERATOR",e[e.KEYWORD=4]="KEYWORD",e[e.COMMENT=5]="COMMENT",e))(q1||{}),X1=(e=>(e[e.NONE=0]="NONE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARNING=3]="WARNING",e[e.ERROR=4]="ERROR",e))(X1||{}),Z1=(e=>(e[e.NONE=0]="NONE",e[e.CONNECT=1]="CONNECT",e[e.DISCONNECT=2]="DISCONNECT",e[e.OPEN=3]="OPEN",e[e.QUERY=4]="QUERY",e[e.INSTANTIATE=5]="INSTANTIATE",e))(Z1||{}),tS=(e=>(e[e.NONE=0]="NONE",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR",e[e.START=3]="START",e[e.RUN=4]="RUN",e[e.CAPTURE=5]="CAPTURE",e))(tS||{}),eS=(e=>(e[e.NONE=0]="NONE",e[e.WEB_WORKER=1]="WEB_WORKER",e[e.NODE_WORKER=2]="NODE_WORKER",e[e.BINDINGS=3]="BINDINGS",e[e.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",e))(eS||{}),nS=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},rS=(e=>(e[e.SUCCESS=0]="SUCCESS",e))(rS||{}),iS=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=Ne.from(t);return console.assert(n.isSync(),"Reader is not sync"),console.assert(n.isFile(),"Reader is not file"),new sr(n)}async send(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.startPendingQuery(this._conn,e);for(;t==null;)t=await this._bindings.pollPendingQuery(this._conn);let n=new pg(this._bindings,this._conn,t),r=await Ne.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new sS(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=z1(e,"stream");await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},pg=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight!=null?(e=await this._inFlight,this._inFlight=null):e=await this.db.fetchQueryResults(this.conn),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},sS=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=Ne.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new sr(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new pg(this.bindings,this.connectionId,t),r=await Ne.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},oS=(e=>(e.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",e.CLOSE_PREPARED="CLOSE_PREPARED",e.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",e.CONNECT="CONNECT",e.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",e.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",e.CREATE_PREPARED="CREATE_PREPARED",e.DISCONNECT="DISCONNECT",e.DROP_FILE="DROP_FILE",e.DROP_FILES="DROP_FILES",e.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",e.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",e.FLUSH_FILES="FLUSH_FILES",e.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",e.GET_TABLE_NAMES="GET_TABLE_NAMES",e.GET_VERSION="GET_VERSION",e.GLOB_FILE_INFOS="GLOB_FILE_INFOS",e.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",e.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",e.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",e.INSTANTIATE="INSTANTIATE",e.OPEN="OPEN",e.PING="PING",e.POLL_PENDING_QUERY="POLL_PENDING_QUERY",e.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",e.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",e.REGISTER_FILE_URL="REGISTER_FILE_URL",e.RESET="RESET",e.RUN_PREPARED="RUN_PREPARED",e.RUN_QUERY="RUN_QUERY",e.SEND_PREPARED="SEND_PREPARED",e.START_PENDING_QUERY="START_PENDING_QUERY",e.TOKENIZE="TOKENIZE",e))(oS||{}),lS=(e=>(e.CONNECTION_INFO="CONNECTION_INFO",e.ERROR="ERROR",e.FEATURE_FLAGS="FEATURE_FLAGS",e.FILE_BUFFER="FILE_BUFFER",e.FILE_INFOS="FILE_INFOS",e.FILE_SIZE="FILE_SIZE",e.FILE_STATISTICS="FILE_STATISTICS",e.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",e.LOG="LOG",e.OK="OK",e.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",e.QUERY_PLAN="QUERY_PLAN",e.QUERY_RESULT="QUERY_RESULT",e.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",e.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",e.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",e.REGISTERED_FILE="REGISTERED_FILE",e.SCRIPT_TOKENS="SCRIPT_TOKENS",e.SUCCESS="SUCCESS",e.TABLE_NAMES="TABLE_NAMES",e.VERSION_STRING="VERSION_STRING",e))(lS||{}),q=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((n,r)=>{this.promiseResolver=n,this.promiseRejecter=r})}};function Bo(e){switch(e.typeId){case d.Binary:return{sqlType:"binary"};case d.Bool:return{sqlType:"bool"};case d.Date:return{sqlType:"date"};case d.DateDay:return{sqlType:"date32[d]"};case d.DateMillisecond:return{sqlType:"date64[ms]"};case d.Decimal:{let t=e;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case d.Float:return{sqlType:"float"};case d.Float16:return{sqlType:"float16"};case d.Float32:return{sqlType:"float32"};case d.Float64:return{sqlType:"float64"};case d.Int:return{sqlType:"int32"};case d.Int16:return{sqlType:"int16"};case d.Int32:return{sqlType:"int32"};case d.Int64:return{sqlType:"int64"};case d.Uint16:return{sqlType:"uint16"};case d.Uint32:return{sqlType:"uint32"};case d.Uint64:return{sqlType:"uint64"};case d.Uint8:return{sqlType:"uint8"};case d.IntervalDayTime:return{sqlType:"interval[dt]"};case d.IntervalYearMonth:return{sqlType:"interval[m]"};case d.List:return{sqlType:"list",valueType:Bo(e.valueType)};case d.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:e.byteWidth};case d.Null:return{sqlType:"null"};case d.Utf8:return{sqlType:"utf8"};case d.Struct:return{sqlType:"struct",fields:e.children.map(t=>Gu(t.name,t.type))};case d.Map:{let t=e;return{sqlType:"map",keyType:Bo(t.keyType),valueType:Bo(t.valueType)}}case d.Time:return{sqlType:"time[s]"};case d.TimeMicrosecond:return{sqlType:"time[us]"};case d.TimeMillisecond:return{sqlType:"time[ms]"};case d.TimeNanosecond:return{sqlType:"time[ns]"};case d.TimeSecond:return{sqlType:"time[s]"};case d.Timestamp:return{sqlType:"timestamp",timezone:e.timezone||void 0};case d.TimestampSecond:return{sqlType:"timestamp[s]",timezone:e.timezone||void 0};case d.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:e.timezone||void 0};case d.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:e.timezone||void 0};case d.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(e.toString()))}function Gu(e,t){let n=Bo(t);return n.name=e,n}var aS=new TextEncoder,uS=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,n)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case"LOG":{this._logger.log(n.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(n.data);return}}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn("unassociated response: [".concat(n.requestId,", ").concat(n.type.toString(),"]"));return}if(this._pendingRequests.delete(n.requestId),n.type=="ERROR"){let i=new Error(n.data.message);i.name=n.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=n.data.stack),r.promiseRejecter(i);return}switch(r.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(n.type=="OK"){r.promiseResolver(n.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],n.type=="OK"){r.promiseResolver(n.data);return}break;case"GLOB_FILE_INFOS":if(n.type=="FILE_INFOS"){r.promiseResolver(n.data);return}break;case"GET_VERSION":if(n.type=="VERSION_STRING"){r.promiseResolver(n.data);return}break;case"GET_FEATURE_FLAGS":if(n.type=="FEATURE_FLAGS"){r.promiseResolver(n.data);return}break;case"GET_TABLE_NAMES":if(n.type=="TABLE_NAMES"){r.promiseResolver(n.data);return}break;case"TOKENIZE":if(n.type=="SCRIPT_TOKENS"){r.promiseResolver(n.data);return}break;case"COPY_FILE_TO_BUFFER":if(n.type=="FILE_BUFFER"){r.promiseResolver(n.data);return}break;case"EXPORT_FILE_STATISTICS":if(n.type=="FILE_STATISTICS"){r.promiseResolver(n.data);return}break;case"CONNECT":if(n.type=="CONNECTION_INFO"){r.promiseResolver(n.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(n.type=="QUERY_RESULT"){r.promiseResolver(n.data);return}break;case"SEND_PREPARED":if(n.type=="QUERY_RESULT_HEADER"){r.promiseResolver(n.data);return}break;case"START_PENDING_QUERY":if(n.type=="QUERY_RESULT_HEADER_OR_NULL"){r.promiseResolver(n.data);return}break;case"POLL_PENDING_QUERY":if(n.type=="QUERY_RESULT_HEADER_OR_NULL"){r.promiseResolver(n.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],n.type=="SUCCESS"){r.promiseResolver(n.data);return}break;case"FETCH_QUERY_RESULTS":if(n.type=="QUERY_RESULT_CHUNK"){r.promiseResolver(n.data);return}break;case"CREATE_PREPARED":if(n.type=="PREPARED_STATEMENT_ID"){r.promiseResolver(n.data);return}break}r.promiseRejecter(new Error("unexpected response type: ".concat(n.type.toString())))}onError(e){console.error(e),console.error("error in duckdb worker: ".concat(e.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let e=new q("RESET",null);return await this.postTask(e)}async ping(){let e=new q("PING",null);await this.postTask(e)}async dropFile(e){let t=new q("DROP_FILE",e);return await this.postTask(t)}async dropFiles(){let e=new q("DROP_FILES",null);return await this.postTask(e)}async flushFiles(){let e=new q("FLUSH_FILES",null);return await this.postTask(e)}async instantiate(e,t=null,n=r=>{}){this._onInstantiationProgress.push(n);let r=new q("INSTANTIATE",[e,t]);return await this.postTask(r)}async getVersion(){let e=new q("GET_VERSION",null);return await this.postTask(e)}async getFeatureFlags(){let e=new q("GET_FEATURE_FLAGS",null);return await this.postTask(e)}async open(e){let t=new q("OPEN",e);await this.postTask(t)}async tokenize(e){let t=new q("TOKENIZE",e);return await this.postTask(t)}async connectInternal(){let e=new q("CONNECT",null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new iS(this,e)}async disconnect(e){let t=new q("DISCONNECT",e);await this.postTask(t)}async runQuery(e,t){let n=new q("RUN_QUERY",[e,t]);return await this.postTask(n)}async startPendingQuery(e,t){let n=new q("START_PENDING_QUERY",[e,t]);return await this.postTask(n)}async pollPendingQuery(e){let t=new q("POLL_PENDING_QUERY",e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new q("CANCEL_PENDING_QUERY",e);return await this.postTask(t)}async fetchQueryResults(e){let t=new q("FETCH_QUERY_RESULTS",e);return await this.postTask(t)}async getTableNames(e,t){let n=new q("GET_TABLE_NAMES",[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new q("CREATE_PREPARED",[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new q("CLOSE_PREPARED",[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new q("RUN_PREPARED",[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new q("SEND_PREPARED",[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new q("GLOB_FILE_INFOS",e);return await this.postTask(t)}async registerFileText(e,t){let n=aS.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new q("REGISTER_FILE_URL",[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){let t=new q("REGISTER_FILE_BUFFER",[e,new Uint8Array]);await this.postTask(t)}async registerFileBuffer(e,t){let n=new q("REGISTER_FILE_BUFFER",[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new q("REGISTER_FILE_HANDLE",[e,t,n,r]);await this.postTask(i,[])}async collectFileStatistics(e,t){let n=new q("COLLECT_FILE_STATISTICS",[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new q("EXPORT_FILE_STATISTICS",e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new q("COPY_FILE_TO_BUFFER",e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new q("COPY_FILE_TO_PATH",[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new q("INSERT_ARROW_FROM_IPC_STREAM",[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let i=[];for(let s in n.columns){let o=n.columns[s];i.push(Gu(s,o))}n.columnsFlat=i,delete n.columns}let r=new q("IMPORT_CSV_FROM_PATH",[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let i=[];for(let s in n.columns){let o=n.columns[s];i.push(Gu(s,o))}n.columnsFlat=i,delete n.columns}let r=new q("IMPORT_JSON_FROM_PATH",[e,t,n]);await this.postTask(r)}},cS=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),dS=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),fS=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),hS=()=>(async e=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),pS={name:"@duckdb/duckdb-wasm",version:"1.28.1-dev106.0",description:"DuckDB powered by WebAssembly",license:"MIT",repository:{type:"git",url:"https://github.com/duckdb/duckdb-wasm.git"},keywords:["sql","duckdb","relational","database","data","query","wasm","analytics","olap","arrow","parquet","json","csv"],dependencies:{"apache-arrow":"^14.0.1"},devDependencies:{"@types/emscripten":"^1.39.10","@types/jasmine":"^5.1.4","@typescript-eslint/eslint-plugin":"^6.18.0","@typescript-eslint/parser":"^6.18.0",esbuild:"^0.20.0",eslint:"^8.56.0","eslint-plugin-jasmine":"^4.1.3","eslint-plugin-react":"^7.33.2","fast-glob":"^3.3.2",jasmine:"^5.1.0","jasmine-core":"^5.1.1","jasmine-spec-reporter":"^7.0.0","js-sha256":"^0.11.0",karma:"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-coverage":"^2.2.1","karma-firefox-launcher":"^2.1.2","karma-jasmine":"^5.1.0","karma-jasmine-html-reporter":"^2.1.0","karma-sourcemap-loader":"^0.4.0","karma-spec-reporter":"^0.0.36","make-dir":"^4.0.0",nyc:"^15.1.0",prettier:"^3.2.4",puppeteer:"^21.7.0",rimraf:"^5.0.5",s3rver:"^3.7.1",typedoc:"^0.25.7",typescript:"^5.3.3","wasm-feature-detect":"^1.6.1","web-worker":"^1.2.0"},scripts:{"build:debug":"node bundle.mjs debug && tsc --emitDeclarationOnly","build:release":"node bundle.mjs release && tsc --emitDeclarationOnly",docs:"typedoc",report:"node ./coverage.mjs","test:node":"node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:node:debug":"node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:node:coverage":"nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs","test:firefox":"karma start ./karma/tests-firefox.cjs","test:chrome":"karma start ./karma/tests-chrome.cjs","test:chrome:eh":"karma start ./karma/tests-chrome-eh.cjs","test:chrome:coverage":"karma start ./karma/tests-chrome-coverage.cjs","test:browser":"karma start ./karma/tests-all.cjs","test:browser:debug":"karma start ./karma/tests-debug.cjs",test:"npm run test:chrome && npm run test:node","test:coverage":"npm run test:chrome:coverage && npm run test:node:coverage && npm run report",lint:"eslint src test"},files:["dist","!dist/types/test"],main:"dist/duckdb-browser.cjs",module:"dist/duckdb-browser.mjs",types:"dist/duckdb-browser.d.ts",jsdelivr:"dist/duckdb-browser.cjs",unpkg:"dist/duckdb-browser.mjs",sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":"./dist/duckdb-mvp.wasm","./dist/duckdb-eh.wasm":"./dist/duckdb-eh.wasm","./dist/duckdb-coi.wasm":"./dist/duckdb-coi.wasm","./dist/duckdb-browser":"./dist/duckdb-browser.mjs","./dist/duckdb-browser.cjs":"./dist/duckdb-browser.cjs","./dist/duckdb-browser.mjs":"./dist/duckdb-browser.mjs","./dist/duckdb-browser-blocking":"./dist/duckdb-browser-blocking.mjs","./dist/duckdb-browser-blocking.mjs":"./dist/duckdb-browser-blocking.mjs","./dist/duckdb-browser-blocking.cjs":"./dist/duckdb-browser-blocking.cjs","./dist/duckdb-browser-coi.pthread.worker.js":"./dist/duckdb-browser-coi.pthread.worker.js","./dist/duckdb-browser-coi.worker.js":"./dist/duckdb-browser-coi.worker.js","./dist/duckdb-browser-eh.worker.js":"./dist/duckdb-browser-eh.worker.js","./dist/duckdb-browser-mvp.worker.js":"./dist/duckdb-browser-mvp.worker.js","./dist/duckdb-node":"./dist/duckdb-node.cjs","./dist/duckdb-node.cjs":"./dist/duckdb-node.cjs","./dist/duckdb-node-blocking":"./dist/duckdb-node-blocking.cjs","./dist/duckdb-node-blocking.cjs":"./dist/duckdb-node-blocking.cjs","./dist/duckdb-node-eh.worker.cjs":"./dist/duckdb-node-eh.worker.cjs","./dist/duckdb-node-mvp.worker.cjs":"./dist/duckdb-node-mvp.worker.cjs","./blocking":{browser:{types:"./dist/duckdb-browser-blocking.d.ts",import:"./dist/duckdb-browser-blocking.mjs",require:"./dist/duckdb-browser-blocking.cjs"},node:{types:"./dist/duckdb-node-blocking.d.ts",require:"./dist/duckdb-node-blocking.cjs",import:"./dist/duckdb-node-blocking.cjs"},types:"./dist/duckdb-browser-blocking.d.ts",import:"./dist/duckdb-browser-blocking.mjs",require:"./dist/duckdb-browser-blocking.cjs"},".":{browser:{types:"./dist/duckdb-browser.d.ts",import:"./dist/duckdb-browser.mjs",require:"./dist/duckdb-browser.cjs"},node:{types:"./dist/duckdb-node.d.ts",import:"./dist/duckdb-node.cjs",require:"./dist/duckdb-node.cjs"},types:"./dist/duckdb-browser.d.ts",import:"./dist/duckdb-browser.mjs",require:"./dist/duckdb-browser.cjs"}}},vd=pS.version.split(".");vd[0];vd[1];vd[2];var yS=()=>typeof navigator>"u",La=null,Ma=null,Pa=null,Ua=null,za=null;async function mS(){return La==null&&(La=typeof BigInt64Array<"u"),Ma==null&&(Ma=await dS()),Pa==null&&(Pa=await hS()),Ua==null&&(Ua=await fS()),za==null&&(za=await cS()),{bigInt64Array:La,crossOriginIsolated:yS()||globalThis.crossOriginIsolated||!1,wasmExceptions:Ma,wasmSIMD:Ua,wasmThreads:Pa,wasmBulkMemory:za}}async function gS(e){let t=await mS();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}Q1(K1());function vS(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}vS();var wS=(e=>(e[e.BUFFER=0]="BUFFER",e[e.NODE_FS=1]="NODE_FS",e[e.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",e[e.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",e[e.HTTP=4]="HTTP",e[e.S3=5]="S3",e))(wS||{});const _S=!0,po=e=>`https://cdn.jsdelivr.net/npm/@duckdb/duckdb-wasm/dist/${e}`,ja={mvp:{mainModule:po("duckdb-mvp.wasm"),mainWorker:po("duckdb-browser-mvp.worker.js")},eh:{mainModule:po("duckdb-eh.wasm"),mainWorker:po("duckdb-browser-eh.worker.js")}},SS=async()=>{const e=typeof ja=="function"?await ja():ja,t=await gS(e);let n=t.mainWorker;if(n.startsWith("http")&&_S){const o=await fetch(n).then(l=>l.text());n=`data:text/javascript;base64,${btoa(o)}`}const r=new Worker(n),i=new nS,s=new uS(i,r);return await s.instantiate(t.mainModule,t.pthreadWorker),s};function yg(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=NS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(wd);return l[0]===""&&l.length!==1&&l.shift(),mg(l,t)||ES(o)},getConflictingClassGroupIds:(o,l)=>{const a=n[o]||[];return l&&r[o]?[...a,...r[o]]:a}}},mg=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?mg(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(wd);return(o=t.validators.find(({validator:l})=>l(s)))==null?void 0:o.classGroupId},Jf=/^\[(.+)\]$/,ES=e=>{if(Jf.test(e)){const t=Jf.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},NS=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return TS(Object.entries(e.classGroups),n).forEach(([s,o])=>{Qu(o,r,s,t)}),r},Qu=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:qf(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(kS(i)){Qu(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Qu(o,qf(t,s),n,r)})})},qf=(e,t)=>{let n=e;return t.split(wd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},kS=e=>e.isThemeGetter,TS=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,l])=>[t+o,l])):s);return[n,i]}):e,OS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},gg="!",DS=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=l=>{const a=[];let u=0,c=0,h;for(let O=0;Oc?h-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:w}};return n?l=>n({className:l,parseClassName:o}):o},RS=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},FS=e=>({cache:OS(e.cacheSize),parseClassName:DS(e),...IS(e)}),AS=/\s+/,xS=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(AS);let l="";for(let a=o.length-1;a>=0;a-=1){const u=o[a],{modifiers:c,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:g}=n(u);let v=!!g,w=r(v?y.substring(0,g):y);if(!w){if(!v){l=u+(l.length>0?" "+l:l);continue}if(w=r(y),!w){l=u+(l.length>0?" "+l:l);continue}v=!1}const O=RS(c).join(":"),p=h?O+gg:O,f=p+w;if(s.includes(f))continue;s.push(f);const m=i(w,v);for(let _=0;_0?" "+l:l)}return l};function BS(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rh(c),e());return n=FS(u),r=n.cache.get,i=n.cache.set,s=l,l(a)}function l(a){const u=r(a);if(u)return u;const c=xS(a,n);return i(a,c),c}return function(){return s(BS.apply(null,arguments))}}const ft=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wg=/^\[(?:([a-z-]+):)?(.+)\]$/i,LS=/^\d+\/\d+$/,MS=new Set(["px","full","screen"]),PS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,US=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,jS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,an=e=>mi(e)||MS.has(e)||LS.test(e),xn=e=>Ci(e,"length",JS),mi=e=>!!e&&!Number.isNaN(Number(e)),Va=e=>Ci(e,"number",mi),Hi=e=>!!e&&Number.isInteger(Number(e)),$S=e=>e.endsWith("%")&&mi(e.slice(0,-1)),$=e=>wg.test(e),Bn=e=>PS.test(e),WS=new Set(["length","size","percentage"]),HS=e=>Ci(e,WS,_g),YS=e=>Ci(e,"position",_g),GS=new Set(["image","url"]),QS=e=>Ci(e,GS,XS),KS=e=>Ci(e,"",qS),Yi=()=>!0,Ci=(e,t,n)=>{const r=wg.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},JS=e=>US.test(e)&&!zS.test(e),_g=()=>!1,qS=e=>jS.test(e),XS=e=>VS.test(e),ZS=()=>{const e=ft("colors"),t=ft("spacing"),n=ft("blur"),r=ft("brightness"),i=ft("borderColor"),s=ft("borderRadius"),o=ft("borderSpacing"),l=ft("borderWidth"),a=ft("contrast"),u=ft("grayscale"),c=ft("hueRotate"),h=ft("invert"),y=ft("gap"),g=ft("gradientColorStops"),v=ft("gradientColorStopPositions"),w=ft("inset"),O=ft("margin"),p=ft("opacity"),f=ft("padding"),m=ft("saturate"),_=ft("scale"),b=ft("sepia"),N=ft("skew"),k=ft("space"),T=ft("translate"),dt=()=>["auto","contain","none"],Y=()=>["auto","hidden","clip","visible","scroll"],jt=()=>["auto",$,t],et=()=>[$,t],Dn=()=>["",an,xn],fr=()=>["auto",mi,$],Ws=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Rn=()=>["solid","dashed","dotted","double","none"],Ur=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",$],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[mi,$];return{cacheSize:500,separator:":",theme:{colors:[Yi],spacing:[an,xn],blur:["none","",Bn,$],brightness:Z(),borderColor:[e],borderRadius:["none","","full",Bn,$],borderSpacing:et(),borderWidth:Dn(),contrast:Z(),grayscale:M(),hueRotate:Z(),invert:M(),gap:et(),gradientColorStops:[e],gradientColorStopPositions:[$S,xn],inset:jt(),margin:jt(),opacity:Z(),padding:et(),saturate:Z(),scale:Z(),sepia:M(),skew:Z(),space:et(),translate:et()},classGroups:{aspect:[{aspect:["auto","square","video",$]}],container:["container"],columns:[{columns:[Bn]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ws(),$]}],overflow:[{overflow:Y()}],"overflow-x":[{"overflow-x":Y()}],"overflow-y":[{"overflow-y":Y()}],overscroll:[{overscroll:dt()}],"overscroll-x":[{"overscroll-x":dt()}],"overscroll-y":[{"overscroll-y":dt()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Hi,$]}],basis:[{basis:jt()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",Hi,$]}],"grid-cols":[{"grid-cols":[Yi]}],"col-start-end":[{col:["auto",{span:["full",Hi,$]},$]}],"col-start":[{"col-start":fr()}],"col-end":[{"col-end":fr()}],"grid-rows":[{"grid-rows":[Yi]}],"row-start-end":[{row:["auto",{span:[Hi,$]},$]}],"row-start":[{"row-start":fr()}],"row-end":[{"row-end":fr()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[O]}],mx:[{mx:[O]}],my:[{my:[O]}],ms:[{ms:[O]}],me:[{me:[O]}],mt:[{mt:[O]}],mr:[{mr:[O]}],mb:[{mb:[O]}],ml:[{ml:[O]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$,t]}],"min-w":[{"min-w":[$,t,"min","max","fit"]}],"max-w":[{"max-w":[$,t,"none","full","min","max","fit","prose",{screen:[Bn]},Bn]}],h:[{h:[$,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Bn,xn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Va]}],"font-family":[{font:[Yi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$]}],"line-clamp":[{"line-clamp":["none",mi,Va]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",an,$]}],"list-image":[{"list-image":["none",$]}],"list-style-type":[{list:["none","disc","decimal",$]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Rn(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",an,xn]}],"underline-offset":[{"underline-offset":["auto",an,$]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:et()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ws(),YS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",HS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},QS]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...Rn(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:Rn()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Rn()]}],"outline-offset":[{"outline-offset":[an,$]}],"outline-w":[{outline:[an,xn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Dn()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[an,xn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Bn,KS]}],"shadow-color":[{shadow:[Yi]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...Ur(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ur()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",Bn,$]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[h]}],saturate:[{saturate:[m]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",$]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",$]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Hi,$]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":et()}],"scroll-mx":[{"scroll-mx":et()}],"scroll-my":[{"scroll-my":et()}],"scroll-ms":[{"scroll-ms":et()}],"scroll-me":[{"scroll-me":et()}],"scroll-mt":[{"scroll-mt":et()}],"scroll-mr":[{"scroll-mr":et()}],"scroll-mb":[{"scroll-mb":et()}],"scroll-ml":[{"scroll-ml":et()}],"scroll-p":[{"scroll-p":et()}],"scroll-px":[{"scroll-px":et()}],"scroll-py":[{"scroll-py":et()}],"scroll-ps":[{"scroll-ps":et()}],"scroll-pe":[{"scroll-pe":et()}],"scroll-pt":[{"scroll-pt":et()}],"scroll-pr":[{"scroll-pr":et()}],"scroll-pb":[{"scroll-pb":et()}],"scroll-pl":[{"scroll-pl":et()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[an,xn,Va]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},tb=CS(ZS);function ln(...e){return tb(bS(e))}const eb=J.forwardRef(({className:e,...t},n)=>G.jsx("div",{className:"relative w-full overflow-auto",children:G.jsx("table",{ref:n,className:ln("w-full caption-bottom text-sm",e),...t})}));eb.displayName="Table";const Sg=J.forwardRef(({className:e,...t},n)=>G.jsx("thead",{ref:n,className:ln("[&_tr]:border-b",e),...t}));Sg.displayName="TableHeader";const bg=J.forwardRef(({className:e,...t},n)=>G.jsx("tbody",{ref:n,className:ln("[&_tr:last-child]:border-0",e),...t}));bg.displayName="TableBody";const nb=J.forwardRef(({className:e,...t},n)=>G.jsx("tfoot",{ref:n,className:ln("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));nb.displayName="TableFooter";const Ku=J.forwardRef(({className:e,...t},n)=>G.jsx("tr",{ref:n,className:ln("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ku.displayName="TableRow";const Ig=J.forwardRef(({className:e,...t},n)=>G.jsx("th",{ref:n,className:ln("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ig.displayName="TableHead";const Eg=J.forwardRef(({className:e,...t},n)=>G.jsx("td",{ref:n,className:ln("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Eg.displayName="TableCell";const rb=J.forwardRef(({className:e,...t},n)=>G.jsx("caption",{ref:n,className:ln("mt-4 text-sm text-muted-foreground",e),...t}));rb.displayName="TableCaption";const ib=({data:e})=>{const t=J.useMemo(()=>Object.keys(e[0]),[e]);return e.length===0?null:G.jsxs("table",{className:"text-xs",children:[G.jsx(Sg,{children:G.jsx(Ku,{children:t.map(n=>G.jsx(Ig,{children:n},n))})}),G.jsx(bg,{children:e.map((n,r)=>G.jsx(Ku,{children:t.map(i=>G.jsx(Eg,{children:String(n[i])},`${r}-${i}`))},r))})]})};function sb(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ob(...e){return t=>e.forEach(n=>sb(n,t))}var Ng=J.forwardRef((e,t)=>{const{children:n,...r}=e,i=J.Children.toArray(n),s=i.find(ab);if(s){const o=s.props.children,l=i.map(a=>a===s?J.Children.count(o)>1?J.Children.only(null):J.isValidElement(o)?o.props.children:null:a);return G.jsx(Ju,{...r,ref:t,children:J.isValidElement(o)?J.cloneElement(o,void 0,l):null})}return G.jsx(Ju,{...r,ref:t,children:n})});Ng.displayName="Slot";var Ju=J.forwardRef((e,t)=>{const{children:n,...r}=e;if(J.isValidElement(n)){const i=cb(n);return J.cloneElement(n,{...ub(r,n.props),ref:t?ob(t,i):i})}return J.Children.count(n)>1?J.Children.only(null):null});Ju.displayName="SlotClone";var lb=({children:e})=>G.jsx(G.Fragment,{children:e});function ab(e){return J.isValidElement(e)&&e.type===lb}function ub(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{s(...l),i(...l)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function cb(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function kg(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,Zf=db,fb=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Zf(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],h=s==null?void 0:s[u];if(c===null)return null;const y=Xf(c)||Xf(h);return i[u][y]}),l=n&&Object.entries(n).reduce((u,c)=>{let[h,y]=c;return y===void 0||(u[h]=y),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:h,className:y,...g}=c;return Object.entries(g).every(v=>{let[w,O]=v;return Array.isArray(O)?O.includes({...s,...l}[w]):{...s,...l}[w]===O})?[...u,h,y]:u},[]);return Zf(e,o,a,n==null?void 0:n.class,n==null?void 0:n.className)},hb=fb("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Co=J.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const o=r?Ng:"button";return G.jsx(o,{className:ln(hb({variant:t,size:n,className:e})),ref:s,...i})});Co.displayName="Button";const Tg=J.forwardRef(({className:e,...t},n)=>G.jsx("textarea",{className:ln("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Tg.displayName="Textarea";const th="https://huggingface.co/datasets/openai/openai_humaneval/resolve/main/openai_humaneval/test-00000-of-00001.parquet",pb=e=>e.toArray().map(t=>t.toJSON());function yb(){const[e,t]=J.useState(!1),[n,r]=J.useState(""),[i,s]=J.useState(""),[o,l]=J.useState(null),[a,u]=J.useState(null),[c,h]=J.useState(null);J.useEffect(()=>{const g={killed:!1};return(async()=>{const w=await SS();if(g.killed){w.terminate();return}l(w)})(),()=>{g.killed=!0,l(w=>(w&&w.terminate(),null))}},[]),J.useEffect(()=>{if(o&&n){t(!0),u(null),h(null),console.log("Loading",n);const g={conn:null,killed:!1};return o.connect().then(v=>{if(g.killed){v.close();return}g.conn=v,v.query(`LOAD parquet;LOAD httpfs;SELECT * FROM '${n}' LIMIT 10`).then(w=>u(pb(w))).catch(w=>{console.error(w),h(w.message),u(null)}).finally(()=>{v.close(),t(!1)})}),()=>{g.killed=!0,g.conn&&(console.log("Closing connection"),g.conn.close())}}else o&&(console.log("Resetting db"),o.reset())},[o,n]);const y=g=>{g.preventDefault(),r(i)};return G.jsxs("section",{className:"flex flex-col gap-4 w-full pt-10 px-4 lg:pt-[15%] items-center min-h-screen",children:[G.jsx("h1",{className:"text-4xl font-bold",children:"📣🦆 Quack"}),G.jsx("h2",{className:"text-2xl font-medium",children:"View Parquet Datasets via URL"}),G.jsxs("form",{onSubmit:y,className:"lg:w-1/2 w-full flex flex-col gap-2",children:[G.jsx(Tg,{rows:2,name:"textField",onChange:g=>s(g.target.value),value:i,className:"w-full lg:w-full"}),G.jsxs("div",{className:"flex flex-row justify-between gap-2",children:[G.jsx(Co,{className:"w-full",type:"submit",disabled:!i||i===n,children:"Load"}),G.jsx(Co,{variant:"secondary",type:"button",onClick:()=>{s(th),r(th)},children:"Load Default"}),G.jsx(Co,{type:"button",variant:"destructive",onClick:()=>{s(""),u(null),r("")},children:"Clear"})]})]}),G.jsxs("div",{className:"flex flex-col gap-2 w-full max-w-full overflow-x-auto bg-secondary rounded",children:[e&&G.jsx("p",{className:"text-lg font-medium self-center",children:"Loading..."}),c&&G.jsx("p",{style:{color:"red"},children:c}),a&&G.jsx(ib,{data:a})]})]})}hy(document.getElementById("root")).render(G.jsx(J.StrictMode,{children:G.jsx(yb,{})}));