var Pg=s=>{throw TypeError(s)};var ud=(s,t,e)=>t.has(s)||Pg("Cannot "+e);var D=(s,t,e)=>(ud(s,t,"read from private field"),e?e.call(s):t.get(s)),ct=(s,t,e)=>t.has(s)?Pg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),nt=(s,t,e,r)=>(ud(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),Ct=(s,t,e)=>(ud(s,t,"access private method"),e);var qu=(s,t,e,r)=>({set _(l){nt(s,t,l,e)},get _(){return D(s,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const h of u.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function e(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(l){if(l.ep)return;l.ep=!0;const u=e(l);fetch(l.href,u)}})();function Hc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var cd={exports:{}},Qo={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var $g;function p3(){if($g)return Qo;$g=1;var s=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function e(r,l,u){var h=null;if(u!==void 0&&(h=""+u),l.key!==void 0&&(h=""+l.key),"key"in l){u={};for(var d in l)d!=="key"&&(u[d]=l[d])}else u=l;return l=u.ref,{$$typeof:s,type:r,key:h,ref:l!==void 0?l:null,props:u}}return Qo.Fragment=t,Qo.jsx=e,Qo.jsxs=e,Qo}var Zg;function y3(){return Zg||(Zg=1,cd.exports=p3()),cd.exports}var re=y3(),hd={exports:{}},At={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Kg;function m3(){if(Kg)return At;Kg=1;var s=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),h=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,O={};function C(E,X,tt){this.props=E,this.context=X,this.refs=O,this.updater=tt||_}C.prototype.isReactComponent={},C.prototype.setState=function(E,X){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,X,"setState")},C.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function F(){}F.prototype=C.prototype;function j(E,X,tt){this.props=E,this.context=X,this.refs=O,this.updater=tt||_}var R=j.prototype=new F;R.constructor=j,T(R,C.prototype),R.isPureReactComponent=!0;var N=Array.isArray,A={H:null,A:null,T:null,S:null,V:null},W=Object.prototype.hasOwnProperty;function H(E,X,tt,J,at,Ut){return tt=Ut.ref,{$$typeof:s,type:E,key:X,ref:tt!==void 0?tt:null,props:Ut}}function q(E,X){return H(E.type,X,void 0,void 0,void 0,E.props)}function Y(E){return typeof E=="object"&&E!==null&&E.$$typeof===s}function P(E){var X={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(tt){return X[tt]})}var K=/\/+/g;function Z(E,X){return typeof E=="object"&&E!==null&&E.key!=null?P(""+E.key):X.toString(36)}function Ot(){}function ft(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(Ot,Ot):(E.status="pending",E.then(function(X){E.status==="pending"&&(E.status="fulfilled",E.value=X)},function(X){E.status==="pending"&&(E.status="rejected",E.reason=X)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function $t(E,X,tt,J,at){var Ut=typeof E;(Ut==="undefined"||Ut==="boolean")&&(E=null);var dt=!1;if(E===null)dt=!0;else switch(Ut){case"bigint":case"string":case"number":dt=!0;break;case"object":switch(E.$$typeof){case s:case t:dt=!0;break;case m:return dt=E._init,$t(dt(E._payload),X,tt,J,at)}}if(dt)return at=at(E),dt=J===""?"."+Z(E,0):J,N(at)?(tt="",dt!=null&&(tt=dt.replace(K,"$&/")+"/"),$t(at,X,tt,"",function(Xi){return Xi})):at!=null&&(Y(at)&&(at=q(at,tt+(at.key==null||E&&E.key===at.key?"":(""+at.key).replace(K,"$&/")+"/")+dt)),X.push(at)),1;dt=0;var ln=J===""?".":J+":";if(N(E))for(var oe=0;oe<E.length;oe++)J=E[oe],Ut=ln+Z(J,oe),dt+=$t(J,X,tt,Ut,at);else if(oe=S(E),typeof oe=="function")for(E=oe.call(E),oe=0;!(J=E.next()).done;)J=J.value,Ut=ln+Z(J,oe++),dt+=$t(J,X,tt,Ut,at);else if(Ut==="object"){if(typeof E.then=="function")return $t(ft(E),X,tt,J,at);throw X=String(E),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return dt}function k(E,X,tt){if(E==null)return E;var J=[],at=0;return $t(E,J,"","",function(Ut){return X.call(tt,Ut,at++)}),J}function $(E){if(E._status===-1){var X=E._result;X=X(),X.then(function(tt){(E._status===0||E._status===-1)&&(E._status=1,E._result=tt)},function(tt){(E._status===0||E._status===-1)&&(E._status=2,E._result=tt)}),E._status===-1&&(E._status=0,E._result=X)}if(E._status===1)return E._result.default;throw E._result}var rt=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function Ft(){}return At.Children={map:k,forEach:function(E,X,tt){k(E,function(){X.apply(this,arguments)},tt)},count:function(E){var X=0;return k(E,function(){X++}),X},toArray:function(E){return k(E,function(X){return X})||[]},only:function(E){if(!Y(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},At.Component=C,At.Fragment=e,At.Profiler=l,At.PureComponent=j,At.StrictMode=r,At.Suspense=y,At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,At.__COMPILER_RUNTIME={__proto__:null,c:function(E){return A.H.useMemoCache(E)}},At.cache=function(E){return function(){return E.apply(null,arguments)}},At.cloneElement=function(E,X,tt){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var J=T({},E.props),at=E.key,Ut=void 0;if(X!=null)for(dt in X.ref!==void 0&&(Ut=void 0),X.key!==void 0&&(at=""+X.key),X)!W.call(X,dt)||dt==="key"||dt==="__self"||dt==="__source"||dt==="ref"&&X.ref===void 0||(J[dt]=X[dt]);var dt=arguments.length-2;if(dt===1)J.children=tt;else if(1<dt){for(var ln=Array(dt),oe=0;oe<dt;oe++)ln[oe]=arguments[oe+2];J.children=ln}return H(E.type,at,void 0,void 0,Ut,J)},At.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:u,_context:E},E},At.createElement=function(E,X,tt){var J,at={},Ut=null;if(X!=null)for(J in X.key!==void 0&&(Ut=""+X.key),X)W.call(X,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(at[J]=X[J]);var dt=arguments.length-2;if(dt===1)at.children=tt;else if(1<dt){for(var ln=Array(dt),oe=0;oe<dt;oe++)ln[oe]=arguments[oe+2];at.children=ln}if(E&&E.defaultProps)for(J in dt=E.defaultProps,dt)at[J]===void 0&&(at[J]=dt[J]);return H(E,Ut,void 0,void 0,null,at)},At.createRef=function(){return{current:null}},At.forwardRef=function(E){return{$$typeof:d,render:E}},At.isValidElement=Y,At.lazy=function(E){return{$$typeof:m,_payload:{_status:-1,_result:E},_init:$}},At.memo=function(E,X){return{$$typeof:p,type:E,compare:X===void 0?null:X}},At.startTransition=function(E){var X=A.T,tt={};A.T=tt;try{var J=E(),at=A.S;at!==null&&at(tt,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(Ft,rt)}catch(Ut){rt(Ut)}finally{A.T=X}},At.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},At.use=function(E){return A.H.use(E)},At.useActionState=function(E,X,tt){return A.H.useActionState(E,X,tt)},At.useCallback=function(E,X){return A.H.useCallback(E,X)},At.useContext=function(E){return A.H.useContext(E)},At.useDebugValue=function(){},At.useDeferredValue=function(E,X){return A.H.useDeferredValue(E,X)},At.useEffect=function(E,X,tt){var J=A.H;if(typeof tt=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return J.useEffect(E,X)},At.useId=function(){return A.H.useId()},At.useImperativeHandle=function(E,X,tt){return A.H.useImperativeHandle(E,X,tt)},At.useInsertionEffect=function(E,X){return A.H.useInsertionEffect(E,X)},At.useLayoutEffect=function(E,X){return A.H.useLayoutEffect(E,X)},At.useMemo=function(E,X){return A.H.useMemo(E,X)},At.useOptimistic=function(E,X){return A.H.useOptimistic(E,X)},At.useReducer=function(E,X,tt){return A.H.useReducer(E,X,tt)},At.useRef=function(E){return A.H.useRef(E)},At.useState=function(E){return A.H.useState(E)},At.useSyncExternalStore=function(E,X,tt){return A.H.useSyncExternalStore(E,X,tt)},At.useTransition=function(){return A.H.useTransition()},At.version="19.1.0",At}var Jg;function vp(){return Jg||(Jg=1,hd.exports=m3()),hd.exports}var it=vp();const ji=Hc(it);var fd={exports:{}},Go={},dd={exports:{}},pd={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var tv;function g3(){return tv||(tv=1,function(s){function t(k,$){var rt=k.length;k.push($);t:for(;0<rt;){var Ft=rt-1>>>1,E=k[Ft];if(0<l(E,$))k[Ft]=$,k[rt]=E,rt=Ft;else break t}}function e(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var $=k[0],rt=k.pop();if(rt!==$){k[0]=rt;t:for(var Ft=0,E=k.length,X=E>>>1;Ft<X;){var tt=2*(Ft+1)-1,J=k[tt],at=tt+1,Ut=k[at];if(0>l(J,rt))at<E&&0>l(Ut,J)?(k[Ft]=Ut,k[at]=rt,Ft=at):(k[Ft]=J,k[tt]=rt,Ft=tt);else if(at<E&&0>l(Ut,rt))k[Ft]=Ut,k[at]=rt,Ft=at;else break t}}return $}function l(k,$){var rt=k.sortIndex-$.sortIndex;return rt!==0?rt:k.id-$.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;s.unstable_now=function(){return u.now()}}else{var h=Date,d=h.now();s.unstable_now=function(){return h.now()-d}}var y=[],p=[],m=1,v=null,S=3,_=!1,T=!1,O=!1,C=!1,F=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function N(k){for(var $=e(p);$!==null;){if($.callback===null)r(p);else if($.startTime<=k)r(p),$.sortIndex=$.expirationTime,t(y,$);else break;$=e(p)}}function A(k){if(O=!1,N(k),!T)if(e(y)!==null)T=!0,W||(W=!0,Z());else{var $=e(p);$!==null&&$t(A,$.startTime-k)}}var W=!1,H=-1,q=5,Y=-1;function P(){return C?!0:!(s.unstable_now()-Y<q)}function K(){if(C=!1,W){var k=s.unstable_now();Y=k;var $=!0;try{t:{T=!1,O&&(O=!1,j(H),H=-1),_=!0;var rt=S;try{e:{for(N(k),v=e(y);v!==null&&!(v.expirationTime>k&&P());){var Ft=v.callback;if(typeof Ft=="function"){v.callback=null,S=v.priorityLevel;var E=Ft(v.expirationTime<=k);if(k=s.unstable_now(),typeof E=="function"){v.callback=E,N(k),$=!0;break e}v===e(y)&&r(y),N(k)}else r(y);v=e(y)}if(v!==null)$=!0;else{var X=e(p);X!==null&&$t(A,X.startTime-k),$=!1}}break t}finally{v=null,S=rt,_=!1}$=void 0}}finally{$?Z():W=!1}}}var Z;if(typeof R=="function")Z=function(){R(K)};else if(typeof MessageChannel<"u"){var Ot=new MessageChannel,ft=Ot.port2;Ot.port1.onmessage=K,Z=function(){ft.postMessage(null)}}else Z=function(){F(K,0)};function $t(k,$){H=F(function(){k(s.unstable_now())},$)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(k){k.callback=null},s.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<k?Math.floor(1e3/k):5},s.unstable_getCurrentPriorityLevel=function(){return S},s.unstable_next=function(k){switch(S){case 1:case 2:case 3:var $=3;break;default:$=S}var rt=S;S=$;try{return k()}finally{S=rt}},s.unstable_requestPaint=function(){C=!0},s.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var rt=S;S=k;try{return $()}finally{S=rt}},s.unstable_scheduleCallback=function(k,$,rt){var Ft=s.unstable_now();switch(typeof rt=="object"&&rt!==null?(rt=rt.delay,rt=typeof rt=="number"&&0<rt?Ft+rt:Ft):rt=Ft,k){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=rt+E,k={id:m++,callback:$,priorityLevel:k,startTime:rt,expirationTime:E,sortIndex:-1},rt>Ft?(k.sortIndex=rt,t(p,k),e(y)===null&&k===e(p)&&(O?(j(H),H=-1):O=!0,$t(A,rt-Ft))):(k.sortIndex=E,t(y,k),T||_||(T=!0,W||(W=!0,Z()))),k},s.unstable_shouldYield=P,s.unstable_wrapCallback=function(k){var $=S;return function(){var rt=S;S=$;try{return k.apply(this,arguments)}finally{S=rt}}}}(pd)),pd}var ev;function v3(){return ev||(ev=1,dd.exports=g3()),dd.exports}var yd={exports:{}},Ue={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var nv;function b3(){if(nv)return Ue;nv=1;var s=vp();function t(y){var p="https://react.dev/errors/"+y;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+y+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e(){}var r={d:{f:e,r:function(){throw Error(t(522))},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(y,p,m){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:y,containerInfo:p,implementation:m}}var h=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(y,p){if(y==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ue.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ue.createPortal=function(y,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return u(y,p,null,m)},Ue.flushSync=function(y){var p=h.T,m=r.p;try{if(h.T=null,r.p=2,y)return y()}finally{h.T=p,r.p=m,r.d.f()}},Ue.preconnect=function(y,p){typeof y=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(y,p))},Ue.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},Ue.preinit=function(y,p){if(typeof y=="string"&&p&&typeof p.as=="string"){var m=p.as,v=d(m,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(y,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:S,fetchPriority:_}):m==="script"&&r.d.X(y,{crossOrigin:v,integrity:S,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ue.preinitModule=function(y,p){if(typeof y=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=d(p.as,p.crossOrigin);r.d.M(y,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(y)},Ue.preload=function(y,p){if(typeof y=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,v=d(m,p.crossOrigin);r.d.L(y,m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ue.preloadModule=function(y,p){if(typeof y=="string")if(p){var m=d(p.as,p.crossOrigin);r.d.m(y,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(y)},Ue.requestFormReset=function(y){r.d.r(y)},Ue.unstable_batchedUpdates=function(y,p){return y(p)},Ue.useFormState=function(y,p,m){return h.H.useFormState(y,p,m)},Ue.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ue.version="19.1.0",Ue}var iv;function S3(){if(iv)return yd.exports;iv=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(t){console.error(t)}}return s(),yd.exports=b3(),yd.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var sv;function _3(){if(sv)return Go;sv=1;var s=v3(),t=vp(),e=S3();function r(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var i=n,a=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(a=i.return),n=i.return;while(n)}return i.tag===3?a:null}function h(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function d(n){if(u(n)!==n)throw Error(r(188))}function y(n){var i=n.alternate;if(!i){if(i=u(n),i===null)throw Error(r(188));return i!==n?null:n}for(var a=n,o=i;;){var c=a.return;if(c===null)break;var f=c.alternate;if(f===null){if(o=c.return,o!==null){a=o;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===a)return d(c),n;if(f===o)return d(c),i;f=f.sibling}throw Error(r(188))}if(a.return!==o.return)a=c,o=f;else{for(var g=!1,b=c.child;b;){if(b===a){g=!0,a=c,o=f;break}if(b===o){g=!0,o=c,a=f;break}b=b.sibling}if(!g){for(b=f.child;b;){if(b===a){g=!0,a=f,o=c;break}if(b===o){g=!0,o=f,a=c;break}b=b.sibling}if(!g)throw Error(r(189))}}if(a.alternate!==o)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?n:i}function p(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=p(n),i!==null)return i;n=n.sibling}return null}var m=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),j=Symbol.for("react.consumer"),R=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function Z(n){return n===null||typeof n!="object"?null:(n=K&&n[K]||n["@@iterator"],typeof n=="function"?n:null)}var Ot=Symbol.for("react.client.reference");function ft(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Ot?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case T:return"Fragment";case C:return"Profiler";case O:return"StrictMode";case A:return"Suspense";case W:return"SuspenseList";case Y:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case _:return"Portal";case R:return(n.displayName||"Context")+".Provider";case j:return(n._context.displayName||"Context")+".Consumer";case N:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case H:return i=n.displayName||null,i!==null?i:ft(n.type)||"Memo";case q:i=n._payload,n=n._init;try{return ft(n(i))}catch{}}return null}var $t=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,rt={pending:!1,data:null,method:null,action:null},Ft=[],E=-1;function X(n){return{current:n}}function tt(n){0>E||(n.current=Ft[E],Ft[E]=null,E--)}function J(n,i){E++,Ft[E]=n.current,n.current=i}var at=X(null),Ut=X(null),dt=X(null),ln=X(null);function oe(n,i){switch(J(dt,i),J(Ut,n),J(at,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?Ag(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=Ag(i),n=Eg(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}tt(at),J(at,n)}function Xi(){tt(at),tt(Ut),tt(dt)}function Xc(n){n.memoizedState!==null&&J(ln,n);var i=at.current,a=Eg(i,n.type);i!==a&&(J(Ut,n),J(at,a))}function Dl(n){Ut.current===n&&(tt(at),tt(Ut)),ln.current===n&&(tt(ln),Ho._currentValue=rt)}var Wc=Object.prototype.hasOwnProperty,Pc=s.unstable_scheduleCallback,$c=s.unstable_cancelCallback,G2=s.unstable_shouldYield,X2=s.unstable_requestPaint,Wn=s.unstable_now,W2=s.unstable_getCurrentPriorityLevel,i0=s.unstable_ImmediatePriority,s0=s.unstable_UserBlockingPriority,Ml=s.unstable_NormalPriority,P2=s.unstable_LowPriority,r0=s.unstable_IdlePriority,$2=s.log,Z2=s.unstable_setDisableYieldValue,Xa=null,un=null;function Wi(n){if(typeof $2=="function"&&Z2(n),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(Xa,n)}catch{}}var cn=Math.clz32?Math.clz32:tS,K2=Math.log,J2=Math.LN2;function tS(n){return n>>>=0,n===0?32:31-(K2(n)/J2|0)|0}var Rl=256,Cl=4194304;function ks(n){var i=n&42;if(i!==0)return i;switch(n&-n){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:return 64;case 128:return 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 n&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Bl(n,i,a){var o=n.pendingLanes;if(o===0)return 0;var c=0,f=n.suspendedLanes,g=n.pingedLanes;n=n.warmLanes;var b=o&134217727;return b!==0?(o=b&~f,o!==0?c=ks(o):(g&=b,g!==0?c=ks(g):a||(a=b&~n,a!==0&&(c=ks(a))))):(b=o&~f,b!==0?c=ks(b):g!==0?c=ks(g):a||(a=o&~n,a!==0&&(c=ks(a)))),c===0?0:i!==0&&i!==c&&(i&f)===0&&(f=c&-c,a=i&-i,f>=a||f===32&&(a&4194048)!==0)?i:c}function Wa(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function eS(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function a0(){var n=Rl;return Rl<<=1,(Rl&4194048)===0&&(Rl=256),n}function o0(){var n=Cl;return Cl<<=1,(Cl&62914560)===0&&(Cl=4194304),n}function Zc(n){for(var i=[],a=0;31>a;a++)i.push(n);return i}function Pa(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function nS(n,i,a,o,c,f){var g=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var b=n.entanglements,w=n.expirationTimes,L=n.hiddenUpdates;for(a=g&~a;0<a;){var V=31-cn(a),G=1<<V;b[V]=0,w[V]=-1;var U=L[V];if(U!==null)for(L[V]=null,V=0;V<U.length;V++){var I=U[V];I!==null&&(I.lane&=-536870913)}a&=~G}o!==0&&l0(n,o,0),f!==0&&c===0&&n.tag!==0&&(n.suspendedLanes|=f&~(g&~i))}function l0(n,i,a){n.pendingLanes|=i,n.suspendedLanes&=~i;var o=31-cn(i);n.entangledLanes|=i,n.entanglements[o]=n.entanglements[o]|1073741824|a&4194090}function u0(n,i){var a=n.entangledLanes|=i;for(n=n.entanglements;a;){var o=31-cn(a),c=1<<o;c&i|n[o]&i&&(n[o]|=i),a&=~c}}function Kc(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Jc(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function c0(){var n=$.p;return n!==0?n:(n=window.event,n===void 0?32:qg(n.type))}function iS(n,i){var a=$.p;try{return $.p=n,i()}finally{$.p=a}}var Pi=Math.random().toString(36).slice(2),ze="__reactFiber$"+Pi,Qe="__reactProps$"+Pi,xr="__reactContainer$"+Pi,th="__reactEvents$"+Pi,sS="__reactListeners$"+Pi,rS="__reactHandles$"+Pi,h0="__reactResources$"+Pi,$a="__reactMarker$"+Pi;function eh(n){delete n[ze],delete n[Qe],delete n[th],delete n[sS],delete n[rS]}function Or(n){var i=n[ze];if(i)return i;for(var a=n.parentNode;a;){if(i=a[xr]||a[ze]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(n=Dg(n);n!==null;){if(a=n[ze])return a;n=Dg(n)}return i}n=a,a=n.parentNode}return null}function Dr(n){if(n=n[ze]||n[xr]){var i=n.tag;if(i===5||i===6||i===13||i===26||i===27||i===3)return n}return null}function Za(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(r(33))}function Mr(n){var i=n[h0];return i||(i=n[h0]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Ee(n){n[$a]=!0}var f0=new Set,d0={};function Vs(n,i){Rr(n,i),Rr(n+"Capture",i)}function Rr(n,i){for(d0[n]=i,n=0;n<i.length;n++)f0.add(i[n])}var aS=RegExp("^[: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]*$"),p0={},y0={};function oS(n){return Wc.call(y0,n)?!0:Wc.call(p0,n)?!1:aS.test(n)?y0[n]=!0:(p0[n]=!0,!1)}function Nl(n,i,a){if(oS(i))if(a===null)n.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var o=i.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+a)}}function zl(n,i,a){if(a===null)n.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+a)}}function vi(n,i,a,o){if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(i,a,""+o)}}var nh,m0;function Cr(n){if(nh===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);nh=i&&i[1]||"",m0=-1<a.stack.indexOf(`
    at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
`+nh+n+m0}var ih=!1;function sh(n,i){if(!n||ih)return"";ih=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(i){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(I){var U=I}Reflect.construct(n,[],G)}else{try{G.call()}catch(I){U=I}n.call(G.prototype)}}else{try{throw Error()}catch(I){U=I}(G=n())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(I){if(I&&U&&typeof I.stack=="string")return[I.stack,U.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=o.DetermineComponentFrameRoot(),g=f[0],b=f[1];if(g&&b){var w=g.split(`
`),L=b.split(`
`);for(c=o=0;o<w.length&&!w[o].includes("DetermineComponentFrameRoot");)o++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(o===w.length||c===L.length)for(o=w.length-1,c=L.length-1;1<=o&&0<=c&&w[o]!==L[c];)c--;for(;1<=o&&0<=c;o--,c--)if(w[o]!==L[c]){if(o!==1||c!==1)do if(o--,c--,0>c||w[o]!==L[c]){var V=`
`+w[o].replace(" at new "," at ");return n.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",n.displayName)),V}while(1<=o&&0<=c);break}}}finally{ih=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?Cr(a):""}function lS(n){switch(n.tag){case 26:case 27:case 5:return Cr(n.type);case 16:return Cr("Lazy");case 13:return Cr("Suspense");case 19:return Cr("SuspenseList");case 0:case 15:return sh(n.type,!1);case 11:return sh(n.type.render,!1);case 1:return sh(n.type,!0);case 31:return Cr("Activity");default:return""}}function g0(n){try{var i="";do i+=lS(n),n=n.return;while(n);return i}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}function En(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function v0(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function uS(n){var i=v0(n)?"checked":"value",a=Object.getOwnPropertyDescriptor(n.constructor.prototype,i),o=""+n[i];if(!n.hasOwnProperty(i)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,f=a.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return c.call(this)},set:function(g){o=""+g,f.call(this,g)}}),Object.defineProperty(n,i,{enumerable:a.enumerable}),{getValue:function(){return o},setValue:function(g){o=""+g},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Ll(n){n._valueTracker||(n._valueTracker=uS(n))}function b0(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var a=i.getValue(),o="";return n&&(o=v0(n)?n.checked?"true":"false":n.value),n=o,n!==a?(i.setValue(n),!0):!1}function Ul(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var cS=/[\n"\\]/g;function Tn(n){return n.replace(cS,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function rh(n,i,a,o,c,f,g,b){n.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?n.type=g:n.removeAttribute("type"),i!=null?g==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+En(i)):n.value!==""+En(i)&&(n.value=""+En(i)):g!=="submit"&&g!=="reset"||n.removeAttribute("value"),i!=null?ah(n,g,En(i)):a!=null?ah(n,g,En(a)):o!=null&&n.removeAttribute("value"),c==null&&f!=null&&(n.defaultChecked=!!f),c!=null&&(n.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?n.name=""+En(b):n.removeAttribute("name")}function S0(n,i,a,o,c,f,g,b){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(n.type=f),i!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||i!=null))return;a=a!=null?""+En(a):"",i=i!=null?""+En(i):a,b||i===n.value||(n.value=i),n.defaultValue=i}o=o??c,o=typeof o!="function"&&typeof o!="symbol"&&!!o,n.checked=b?n.checked:!!o,n.defaultChecked=!!o,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.name=g)}function ah(n,i,a){i==="number"&&Ul(n.ownerDocument)===n||n.defaultValue===""+a||(n.defaultValue=""+a)}function Br(n,i,a,o){if(n=n.options,i){i={};for(var c=0;c<a.length;c++)i["$"+a[c]]=!0;for(a=0;a<n.length;a++)c=i.hasOwnProperty("$"+n[a].value),n[a].selected!==c&&(n[a].selected=c),c&&o&&(n[a].defaultSelected=!0)}else{for(a=""+En(a),i=null,c=0;c<n.length;c++){if(n[c].value===a){n[c].selected=!0,o&&(n[c].defaultSelected=!0);return}i!==null||n[c].disabled||(i=n[c])}i!==null&&(i.selected=!0)}}function _0(n,i,a){if(i!=null&&(i=""+En(i),i!==n.value&&(n.value=i),a==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=a!=null?""+En(a):""}function w0(n,i,a,o){if(i==null){if(o!=null){if(a!=null)throw Error(r(92));if($t(o)){if(1<o.length)throw Error(r(93));o=o[0]}a=o}a==null&&(a=""),i=a}a=En(i),n.defaultValue=a,o=n.textContent,o===a&&o!==""&&o!==null&&(n.value=o)}function Nr(n,i){if(i){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=i;return}}n.textContent=i}var hS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function A0(n,i,a){var o=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":o?n.setProperty(i,a):typeof a!="number"||a===0||hS.has(i)?i==="float"?n.cssFloat=a:n[i]=(""+a).trim():n[i]=a+"px"}function E0(n,i,a){if(i!=null&&typeof i!="object")throw Error(r(62));if(n=n.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||i!=null&&i.hasOwnProperty(o)||(o.indexOf("--")===0?n.setProperty(o,""):o==="float"?n.cssFloat="":n[o]="");for(var c in i)o=i[c],i.hasOwnProperty(c)&&a[c]!==o&&A0(n,c,o)}else for(var f in i)i.hasOwnProperty(f)&&A0(n,f,i[f])}function oh(n){if(n.indexOf("-")===-1)return!1;switch(n){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 fS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Il(n){return dS.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}var lh=null;function uh(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var zr=null,Lr=null;function T0(n){var i=Dr(n);if(i&&(n=i.stateNode)){var a=n[Qe]||null;t:switch(n=i.stateNode,i.type){case"input":if(rh(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Tn(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var o=a[i];if(o!==n&&o.form===n.form){var c=o[Qe]||null;if(!c)throw Error(r(90));rh(o,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(i=0;i<a.length;i++)o=a[i],o.form===n.form&&b0(o)}break t;case"textarea":_0(n,a.value,a.defaultValue);break t;case"select":i=a.value,i!=null&&Br(n,!!a.multiple,i,!1)}}}var ch=!1;function x0(n,i,a){if(ch)return n(i,a);ch=!0;try{var o=n(i);return o}finally{if(ch=!1,(zr!==null||Lr!==null)&&(wu(),zr&&(i=zr,n=Lr,Lr=zr=null,T0(i),n)))for(i=0;i<n.length;i++)T0(n[i])}}function Ka(n,i){var a=n.stateNode;if(a===null)return null;var o=a[Qe]||null;if(o===null)return null;a=o[i];t:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(n=n.type,o=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!o;break t;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(r(231,i,typeof a));return a}var bi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hh=!1;if(bi)try{var Ja={};Object.defineProperty(Ja,"passive",{get:function(){hh=!0}}),window.addEventListener("test",Ja,Ja),window.removeEventListener("test",Ja,Ja)}catch{hh=!1}var $i=null,fh=null,Fl=null;function O0(){if(Fl)return Fl;var n,i=fh,a=i.length,o,c="value"in $i?$i.value:$i.textContent,f=c.length;for(n=0;n<a&&i[n]===c[n];n++);var g=a-n;for(o=1;o<=g&&i[a-o]===c[f-o];o++);return Fl=c.slice(n,1<o?1-o:void 0)}function jl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function Hl(){return!0}function D0(){return!1}function Ge(n){function i(a,o,c,f,g){this._reactName=a,this._targetInst=c,this.type=o,this.nativeEvent=f,this.target=g,this.currentTarget=null;for(var b in n)n.hasOwnProperty(b)&&(a=n[b],this[b]=a?a(f):f[b]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Hl:D0,this.isPropagationStopped=D0,this}return m(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Hl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Hl)},persist:function(){},isPersistent:Hl}),i}var qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kl=Ge(qs),to=m({},qs,{view:0,detail:0}),pS=Ge(to),dh,ph,eo,Vl=m({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mh,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==eo&&(eo&&n.type==="mousemove"?(dh=n.screenX-eo.screenX,ph=n.screenY-eo.screenY):ph=dh=0,eo=n),dh)},movementY:function(n){return"movementY"in n?n.movementY:ph}}),M0=Ge(Vl),yS=m({},Vl,{dataTransfer:0}),mS=Ge(yS),gS=m({},to,{relatedTarget:0}),yh=Ge(gS),vS=m({},qs,{animationName:0,elapsedTime:0,pseudoElement:0}),bS=Ge(vS),SS=m({},qs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),_S=Ge(SS),wS=m({},qs,{data:0}),R0=Ge(wS),AS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ES={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},TS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xS(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=TS[n])?!!i[n]:!1}function mh(){return xS}var OS=m({},to,{key:function(n){if(n.key){var i=AS[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=jl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?ES[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mh,charCode:function(n){return n.type==="keypress"?jl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?jl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),DS=Ge(OS),MS=m({},Vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),C0=Ge(MS),RS=m({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mh}),CS=Ge(RS),BS=m({},qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),NS=Ge(BS),zS=m({},Vl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),LS=Ge(zS),US=m({},qs,{newState:0,oldState:0}),IS=Ge(US),FS=[9,13,27,32],gh=bi&&"CompositionEvent"in window,no=null;bi&&"documentMode"in document&&(no=document.documentMode);var jS=bi&&"TextEvent"in window&&!no,B0=bi&&(!gh||no&&8<no&&11>=no),N0=" ",z0=!1;function L0(n,i){switch(n){case"keyup":return FS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U0(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ur=!1;function HS(n,i){switch(n){case"compositionend":return U0(i);case"keypress":return i.which!==32?null:(z0=!0,N0);case"textInput":return n=i.data,n===N0&&z0?null:n;default:return null}}function kS(n,i){if(Ur)return n==="compositionend"||!gh&&L0(n,i)?(n=O0(),Fl=fh=$i=null,Ur=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return B0&&i.locale!=="ko"?null:i.data;default:return null}}var VS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function I0(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!VS[n.type]:i==="textarea"}function F0(n,i,a,o){zr?Lr?Lr.push(o):Lr=[o]:zr=o,i=Du(i,"onChange"),0<i.length&&(a=new kl("onChange","change",null,a,o),n.push({event:a,listeners:i}))}var io=null,so=null;function qS(n){vg(n,0)}function ql(n){var i=Za(n);if(b0(i))return n}function j0(n,i){if(n==="change")return i}var H0=!1;if(bi){var vh;if(bi){var bh="oninput"in document;if(!bh){var k0=document.createElement("div");k0.setAttribute("oninput","return;"),bh=typeof k0.oninput=="function"}vh=bh}else vh=!1;H0=vh&&(!document.documentMode||9<document.documentMode)}function V0(){io&&(io.detachEvent("onpropertychange",q0),so=io=null)}function q0(n){if(n.propertyName==="value"&&ql(so)){var i=[];F0(i,so,n,uh(n)),x0(qS,i)}}function YS(n,i,a){n==="focusin"?(V0(),io=i,so=a,io.attachEvent("onpropertychange",q0)):n==="focusout"&&V0()}function QS(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ql(so)}function GS(n,i){if(n==="click")return ql(i)}function XS(n,i){if(n==="input"||n==="change")return ql(i)}function WS(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var hn=typeof Object.is=="function"?Object.is:WS;function ro(n,i){if(hn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var a=Object.keys(n),o=Object.keys(i);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var c=a[o];if(!Wc.call(i,c)||!hn(n[c],i[c]))return!1}return!0}function Y0(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Q0(n,i){var a=Y0(n);n=0;for(var o;a;){if(a.nodeType===3){if(o=n+a.textContent.length,n<=i&&o>=i)return{node:a,offset:i-n};n=o}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=Y0(a)}}function G0(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?G0(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function X0(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Ul(n.document);i instanceof n.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)n=i.contentWindow;else break;i=Ul(n.document)}return i}function Sh(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var PS=bi&&"documentMode"in document&&11>=document.documentMode,Ir=null,_h=null,ao=null,wh=!1;function W0(n,i,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;wh||Ir==null||Ir!==Ul(o)||(o=Ir,"selectionStart"in o&&Sh(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ao&&ro(ao,o)||(ao=o,o=Du(_h,"onSelect"),0<o.length&&(i=new kl("onSelect","select",null,i,a),n.push({event:i,listeners:o}),i.target=Ir)))}function Ys(n,i){var a={};return a[n.toLowerCase()]=i.toLowerCase(),a["Webkit"+n]="webkit"+i,a["Moz"+n]="moz"+i,a}var Fr={animationend:Ys("Animation","AnimationEnd"),animationiteration:Ys("Animation","AnimationIteration"),animationstart:Ys("Animation","AnimationStart"),transitionrun:Ys("Transition","TransitionRun"),transitionstart:Ys("Transition","TransitionStart"),transitioncancel:Ys("Transition","TransitionCancel"),transitionend:Ys("Transition","TransitionEnd")},Ah={},P0={};bi&&(P0=document.createElement("div").style,"AnimationEvent"in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),"TransitionEvent"in window||delete Fr.transitionend.transition);function Qs(n){if(Ah[n])return Ah[n];if(!Fr[n])return n;var i=Fr[n],a;for(a in i)if(i.hasOwnProperty(a)&&a in P0)return Ah[n]=i[a];return n}var $0=Qs("animationend"),Z0=Qs("animationiteration"),K0=Qs("animationstart"),$S=Qs("transitionrun"),ZS=Qs("transitionstart"),KS=Qs("transitioncancel"),J0=Qs("transitionend"),ty=new Map,Eh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Eh.push("scrollEnd");function jn(n,i){ty.set(n,i),Vs(i,[n])}var ey=new WeakMap;function xn(n,i){if(typeof n=="object"&&n!==null){var a=ey.get(n);return a!==void 0?a:(i={value:n,source:i,stack:g0(i)},ey.set(n,i),i)}return{value:n,source:i,stack:g0(i)}}var On=[],jr=0,Th=0;function Yl(){for(var n=jr,i=Th=jr=0;i<n;){var a=On[i];On[i++]=null;var o=On[i];On[i++]=null;var c=On[i];On[i++]=null;var f=On[i];if(On[i++]=null,o!==null&&c!==null){var g=o.pending;g===null?c.next=c:(c.next=g.next,g.next=c),o.pending=c}f!==0&&ny(a,c,f)}}function Ql(n,i,a,o){On[jr++]=n,On[jr++]=i,On[jr++]=a,On[jr++]=o,Th|=o,n.lanes|=o,n=n.alternate,n!==null&&(n.lanes|=o)}function xh(n,i,a,o){return Ql(n,i,a,o),Gl(n)}function Hr(n,i){return Ql(n,null,null,i),Gl(n)}function ny(n,i,a){n.lanes|=a;var o=n.alternate;o!==null&&(o.lanes|=a);for(var c=!1,f=n.return;f!==null;)f.childLanes|=a,o=f.alternate,o!==null&&(o.childLanes|=a),f.tag===22&&(n=f.stateNode,n===null||n._visibility&1||(c=!0)),n=f,f=f.return;return n.tag===3?(f=n.stateNode,c&&i!==null&&(c=31-cn(a),n=f.hiddenUpdates,o=n[c],o===null?n[c]=[i]:o.push(i),i.lane=a|536870912),f):null}function Gl(n){if(50<Bo)throw Bo=0,Nf=null,Error(r(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var kr={};function JS(n,i,a,o){this.tag=n,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(n,i,a,o){return new JS(n,i,a,o)}function Oh(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Si(n,i){var a=n.alternate;return a===null?(a=fn(n.tag,i,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=i,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&65011712,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,i=n.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function iy(n,i){n.flags&=65011714;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,i=a.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Xl(n,i,a,o,c,f){var g=0;if(o=n,typeof n=="function")Oh(n)&&(g=1);else if(typeof n=="string")g=e3(n,a,at.current)?26:n==="html"||n==="head"||n==="body"?27:5;else t:switch(n){case Y:return n=fn(31,a,i,c),n.elementType=Y,n.lanes=f,n;case T:return Gs(a.children,c,f,i);case O:g=8,c|=24;break;case C:return n=fn(12,a,i,c|2),n.elementType=C,n.lanes=f,n;case A:return n=fn(13,a,i,c),n.elementType=A,n.lanes=f,n;case W:return n=fn(19,a,i,c),n.elementType=W,n.lanes=f,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case F:case R:g=10;break t;case j:g=9;break t;case N:g=11;break t;case H:g=14;break t;case q:g=16,o=null;break t}g=29,a=Error(r(130,n===null?"null":typeof n,"")),o=null}return i=fn(g,a,i,c),i.elementType=n,i.type=o,i.lanes=f,i}function Gs(n,i,a,o){return n=fn(7,n,o,i),n.lanes=a,n}function Dh(n,i,a){return n=fn(6,n,null,i),n.lanes=a,n}function Mh(n,i,a){return i=fn(4,n.children!==null?n.children:[],n.key,i),i.lanes=a,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Vr=[],qr=0,Wl=null,Pl=0,Dn=[],Mn=0,Xs=null,_i=1,wi="";function Ws(n,i){Vr[qr++]=Pl,Vr[qr++]=Wl,Wl=n,Pl=i}function sy(n,i,a){Dn[Mn++]=_i,Dn[Mn++]=wi,Dn[Mn++]=Xs,Xs=n;var o=_i;n=wi;var c=32-cn(o)-1;o&=~(1<<c),a+=1;var f=32-cn(i)+c;if(30<f){var g=c-c%5;f=(o&(1<<g)-1).toString(32),o>>=g,c-=g,_i=1<<32-cn(i)+c|a<<c|o,wi=f+n}else _i=1<<f|a<<c|o,wi=n}function Rh(n){n.return!==null&&(Ws(n,1),sy(n,1,0))}function Ch(n){for(;n===Wl;)Wl=Vr[--qr],Vr[qr]=null,Pl=Vr[--qr],Vr[qr]=null;for(;n===Xs;)Xs=Dn[--Mn],Dn[Mn]=null,wi=Dn[--Mn],Dn[Mn]=null,_i=Dn[--Mn],Dn[Mn]=null}var je=null,fe=null,jt=!1,Ps=null,Pn=!1,Bh=Error(r(519));function $s(n){var i=Error(r(418,""));throw uo(xn(i,n)),Bh}function ry(n){var i=n.stateNode,a=n.type,o=n.memoizedProps;switch(i[ze]=n,i[Qe]=o,a){case"dialog":Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":case"embed":Rt("load",i);break;case"video":case"audio":for(a=0;a<zo.length;a++)Rt(zo[a],i);break;case"source":Rt("error",i);break;case"img":case"image":case"link":Rt("error",i),Rt("load",i);break;case"details":Rt("toggle",i);break;case"input":Rt("invalid",i),S0(i,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0),Ll(i);break;case"select":Rt("invalid",i);break;case"textarea":Rt("invalid",i),w0(i,o.value,o.defaultValue,o.children),Ll(i)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||o.suppressHydrationWarning===!0||wg(i.textContent,a)?(o.popover!=null&&(Rt("beforetoggle",i),Rt("toggle",i)),o.onScroll!=null&&Rt("scroll",i),o.onScrollEnd!=null&&Rt("scrollend",i),o.onClick!=null&&(i.onclick=Mu),i=!0):i=!1,i||$s(n)}function ay(n){for(je=n.return;je;)switch(je.tag){case 5:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:je=je.return}}function oo(n){if(n!==je)return!1;if(!jt)return ay(n),jt=!0,!1;var i=n.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||Pf(n.type,n.memoizedProps)),a=!a),a&&fe&&$s(n),ay(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));t:{for(n=n.nextSibling,i=0;n;){if(n.nodeType===8)if(a=n.data,a==="/$"){if(i===0){fe=kn(n.nextSibling);break t}i--}else a!=="$"&&a!=="$!"&&a!=="$?"||i++;n=n.nextSibling}fe=null}}else i===27?(i=fe,fs(n.type)?(n=Jf,Jf=null,fe=n):fe=i):fe=je?kn(n.stateNode.nextSibling):null;return!0}function lo(){fe=je=null,jt=!1}function oy(){var n=Ps;return n!==null&&(Pe===null?Pe=n:Pe.push.apply(Pe,n),Ps=null),n}function uo(n){Ps===null?Ps=[n]:Ps.push(n)}var Nh=X(null),Zs=null,Ai=null;function Zi(n,i,a){J(Nh,i._currentValue),i._currentValue=a}function Ei(n){n._currentValue=Nh.current,tt(Nh)}function zh(n,i,a){for(;n!==null;){var o=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,o!==null&&(o.childLanes|=i)):o!==null&&(o.childLanes&i)!==i&&(o.childLanes|=i),n===a)break;n=n.return}}function Lh(n,i,a,o){var c=n.child;for(c!==null&&(c.return=n);c!==null;){var f=c.dependencies;if(f!==null){var g=c.child;f=f.firstContext;t:for(;f!==null;){var b=f;f=c;for(var w=0;w<i.length;w++)if(b.context===i[w]){f.lanes|=a,b=f.alternate,b!==null&&(b.lanes|=a),zh(f.return,a,n),o||(g=null);break t}f=b.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(r(341));g.lanes|=a,f=g.alternate,f!==null&&(f.lanes|=a),zh(g,a,n),g=null}else g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===n){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}}function co(n,i,a,o){n=null;for(var c=i,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var g=c.alternate;if(g===null)throw Error(r(387));if(g=g.memoizedProps,g!==null){var b=c.type;hn(c.pendingProps.value,g.value)||(n!==null?n.push(b):n=[b])}}else if(c===ln.current){if(g=c.alternate,g===null)throw Error(r(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(n!==null?n.push(Ho):n=[Ho])}c=c.return}n!==null&&Lh(i,n,a,o),i.flags|=262144}function $l(n){for(n=n.firstContext;n!==null;){if(!hn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ks(n){Zs=n,Ai=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Le(n){return ly(Zs,n)}function Zl(n,i){return Zs===null&&Ks(n),ly(n,i)}function ly(n,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},Ai===null){if(n===null)throw Error(r(308));Ai=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Ai=Ai.next=i;return a}var t_=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(a,o){n.push(o)}};this.abort=function(){i.aborted=!0,n.forEach(function(a){return a()})}},e_=s.unstable_scheduleCallback,n_=s.unstable_NormalPriority,Se={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Uh(){return{controller:new t_,data:new Map,refCount:0}}function ho(n){n.refCount--,n.refCount===0&&e_(n_,function(){n.controller.abort()})}var fo=null,Ih=0,Yr=0,Qr=null;function i_(n,i){if(fo===null){var a=fo=[];Ih=0,Yr=Hf(),Qr={status:"pending",value:void 0,then:function(o){a.push(o)}}}return Ih++,i.then(uy,uy),i}function uy(){if(--Ih===0&&fo!==null){Qr!==null&&(Qr.status="fulfilled");var n=fo;fo=null,Yr=0,Qr=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function s_(n,i){var a=[],o={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return n.then(function(){o.status="fulfilled",o.value=i;for(var c=0;c<a.length;c++)(0,a[c])(i)},function(c){for(o.status="rejected",o.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),o}var cy=k.S;k.S=function(n,i){typeof i=="object"&&i!==null&&typeof i.then=="function"&&i_(n,i),cy!==null&&cy(n,i)};var Js=X(null);function Fh(){var n=Js.current;return n!==null?n:ie.pooledCache}function Kl(n,i){i===null?J(Js,Js.current):J(Js,i.pool)}function hy(){var n=Fh();return n===null?null:{parent:Se._currentValue,pool:n}}var po=Error(r(460)),fy=Error(r(474)),Jl=Error(r(542)),jh={then:function(){}};function dy(n){return n=n.status,n==="fulfilled"||n==="rejected"}function tu(){}function py(n,i,a){switch(a=n[a],a===void 0?n.push(i):a!==i&&(i.then(tu,tu),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,my(n),n;default:if(typeof i.status=="string")i.then(tu,tu);else{if(n=ie,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=i,n.status="pending",n.then(function(o){if(i.status==="pending"){var c=i;c.status="fulfilled",c.value=o}},function(o){if(i.status==="pending"){var c=i;c.status="rejected",c.reason=o}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,my(n),n}throw yo=i,po}}var yo=null;function yy(){if(yo===null)throw Error(r(459));var n=yo;return yo=null,n}function my(n){if(n===po||n===Jl)throw Error(r(483))}var Ki=!1;function Hh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kh(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ji(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ts(n,i,a){var o=n.updateQueue;if(o===null)return null;if(o=o.shared,(Xt&2)!==0){var c=o.pending;return c===null?i.next=i:(i.next=c.next,c.next=i),o.pending=i,i=Gl(n),ny(n,null,a),i}return Ql(n,o,i,a),Gl(n)}function mo(n,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var o=i.lanes;o&=n.pendingLanes,a|=o,i.lanes=a,u0(n,a)}}function Vh(n,i){var a=n.updateQueue,o=n.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var c=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?c=f=g:f=f.next=g,a=a.next}while(a!==null);f===null?c=f=i:f=f.next=i}else c=f=i;a={baseState:o.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=i:n.next=i,a.lastBaseUpdate=i}var qh=!1;function go(){if(qh){var n=Qr;if(n!==null)throw n}}function vo(n,i,a,o){qh=!1;var c=n.updateQueue;Ki=!1;var f=c.firstBaseUpdate,g=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var w=b,L=w.next;w.next=null,g===null?f=L:g.next=L,g=w;var V=n.alternate;V!==null&&(V=V.updateQueue,b=V.lastBaseUpdate,b!==g&&(b===null?V.firstBaseUpdate=L:b.next=L,V.lastBaseUpdate=w))}if(f!==null){var G=c.baseState;g=0,V=L=w=null,b=f;do{var U=b.lane&-536870913,I=U!==b.lane;if(I?(Lt&U)===U:(o&U)===U){U!==0&&U===Yr&&(qh=!0),V!==null&&(V=V.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});t:{var ut=n,ot=b;U=i;var Jt=a;switch(ot.tag){case 1:if(ut=ot.payload,typeof ut=="function"){G=ut.call(Jt,G,U);break t}G=ut;break t;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=ot.payload,U=typeof ut=="function"?ut.call(Jt,G,U):ut,U==null)break t;G=m({},G,U);break t;case 2:Ki=!0}}U=b.callback,U!==null&&(n.flags|=64,I&&(n.flags|=8192),I=c.callbacks,I===null?c.callbacks=[U]:I.push(U))}else I={lane:U,tag:b.tag,payload:b.payload,callback:b.callback,next:null},V===null?(L=V=I,w=G):V=V.next=I,g|=U;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;I=b,b=I.next,I.next=null,c.lastBaseUpdate=I,c.shared.pending=null}}while(!0);V===null&&(w=G),c.baseState=w,c.firstBaseUpdate=L,c.lastBaseUpdate=V,f===null&&(c.shared.lanes=0),ls|=g,n.lanes=g,n.memoizedState=G}}function gy(n,i){if(typeof n!="function")throw Error(r(191,n));n.call(i)}function vy(n,i){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)gy(a[n],i)}var Gr=X(null),eu=X(0);function by(n,i){n=Ci,J(eu,n),J(Gr,i),Ci=n|i.baseLanes}function Yh(){J(eu,Ci),J(Gr,Gr.current)}function Qh(){Ci=eu.current,tt(Gr),tt(eu)}var es=0,xt=null,Zt=null,ge=null,nu=!1,Xr=!1,tr=!1,iu=0,bo=0,Wr=null,r_=0;function ye(){throw Error(r(321))}function Gh(n,i){if(i===null)return!1;for(var a=0;a<i.length&&a<n.length;a++)if(!hn(n[a],i[a]))return!1;return!0}function Xh(n,i,a,o,c,f){return es=f,xt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,k.H=n===null||n.memoizedState===null?nm:im,tr=!1,f=a(o,c),tr=!1,Xr&&(f=_y(i,a,o,c)),Sy(n),f}function Sy(n){k.H=uu;var i=Zt!==null&&Zt.next!==null;if(es=0,ge=Zt=xt=null,nu=!1,bo=0,Wr=null,i)throw Error(r(300));n===null||Te||(n=n.dependencies,n!==null&&$l(n)&&(Te=!0))}function _y(n,i,a,o){xt=n;var c=0;do{if(Xr&&(Wr=null),bo=0,Xr=!1,25<=c)throw Error(r(301));if(c+=1,ge=Zt=null,n.updateQueue!=null){var f=n.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}k.H=f_,f=i(a,o)}while(Xr);return f}function a_(){var n=k.H,i=n.useState()[0];return i=typeof i.then=="function"?So(i):i,n=n.useState()[0],(Zt!==null?Zt.memoizedState:null)!==n&&(xt.flags|=1024),i}function Wh(){var n=iu!==0;return iu=0,n}function Ph(n,i,a){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~a}function $h(n){if(nu){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}nu=!1}es=0,ge=Zt=xt=null,Xr=!1,bo=iu=0,Wr=null}function Xe(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ge===null?xt.memoizedState=ge=n:ge=ge.next=n,ge}function ve(){if(Zt===null){var n=xt.alternate;n=n!==null?n.memoizedState:null}else n=Zt.next;var i=ge===null?xt.memoizedState:ge.next;if(i!==null)ge=i,Zt=n;else{if(n===null)throw xt.alternate===null?Error(r(467)):Error(r(310));Zt=n,n={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},ge===null?xt.memoizedState=ge=n:ge=ge.next=n}return ge}function Zh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function So(n){var i=bo;return bo+=1,Wr===null&&(Wr=[]),n=py(Wr,n,i),i=xt,(ge===null?i.memoizedState:ge.next)===null&&(i=i.alternate,k.H=i===null||i.memoizedState===null?nm:im),n}function su(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return So(n);if(n.$$typeof===R)return Le(n)}throw Error(r(438,String(n)))}function Kh(n){var i=null,a=xt.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var o=xt.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(i={data:o.data.map(function(c){return c.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=Zh(),xt.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(n),o=0;o<n;o++)a[o]=P;return i.index++,a}function Ti(n,i){return typeof i=="function"?i(n):i}function ru(n){var i=ve();return Jh(i,Zt,n)}function Jh(n,i,a){var o=n.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=a;var c=n.baseQueue,f=o.pending;if(f!==null){if(c!==null){var g=c.next;c.next=f.next,f.next=g}i.baseQueue=c=f,o.pending=null}if(f=n.baseState,c===null)n.memoizedState=f;else{i=c.next;var b=g=null,w=null,L=i,V=!1;do{var G=L.lane&-536870913;if(G!==L.lane?(Lt&G)===G:(es&G)===G){var U=L.revertLane;if(U===0)w!==null&&(w=w.next={lane:0,revertLane:0,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),G===Yr&&(V=!0);else if((es&U)===U){L=L.next,U===Yr&&(V=!0);continue}else G={lane:0,revertLane:L.revertLane,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},w===null?(b=w=G,g=f):w=w.next=G,xt.lanes|=U,ls|=U;G=L.action,tr&&a(f,G),f=L.hasEagerState?L.eagerState:a(f,G)}else U={lane:G,revertLane:L.revertLane,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},w===null?(b=w=U,g=f):w=w.next=U,xt.lanes|=G,ls|=G;L=L.next}while(L!==null&&L!==i);if(w===null?g=f:w.next=b,!hn(f,n.memoizedState)&&(Te=!0,V&&(a=Qr,a!==null)))throw a;n.memoizedState=f,n.baseState=g,n.baseQueue=w,o.lastRenderedState=f}return c===null&&(o.lanes=0),[n.memoizedState,o.dispatch]}function tf(n){var i=ve(),a=i.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=n;var o=a.dispatch,c=a.pending,f=i.memoizedState;if(c!==null){a.pending=null;var g=c=c.next;do f=n(f,g.action),g=g.next;while(g!==c);hn(f,i.memoizedState)||(Te=!0),i.memoizedState=f,i.baseQueue===null&&(i.baseState=f),a.lastRenderedState=f}return[f,o]}function wy(n,i,a){var o=xt,c=ve(),f=jt;if(f){if(a===void 0)throw Error(r(407));a=a()}else a=i();var g=!hn((Zt||c).memoizedState,a);g&&(c.memoizedState=a,Te=!0),c=c.queue;var b=Ty.bind(null,o,c,n);if(_o(2048,8,b,[n]),c.getSnapshot!==i||g||ge!==null&&ge.memoizedState.tag&1){if(o.flags|=2048,Pr(9,au(),Ey.bind(null,o,c,a,i),null),ie===null)throw Error(r(349));f||(es&124)!==0||Ay(o,i,a)}return a}function Ay(n,i,a){n.flags|=16384,n={getSnapshot:i,value:a},i=xt.updateQueue,i===null?(i=Zh(),xt.updateQueue=i,i.stores=[n]):(a=i.stores,a===null?i.stores=[n]:a.push(n))}function Ey(n,i,a,o){i.value=a,i.getSnapshot=o,xy(i)&&Oy(n)}function Ty(n,i,a){return a(function(){xy(i)&&Oy(n)})}function xy(n){var i=n.getSnapshot;n=n.value;try{var a=i();return!hn(n,a)}catch{return!0}}function Oy(n){var i=Hr(n,2);i!==null&&gn(i,n,2)}function ef(n){var i=Xe();if(typeof n=="function"){var a=n;if(n=a(),tr){Wi(!0);try{a()}finally{Wi(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:n},i}function Dy(n,i,a,o){return n.baseState=a,Jh(n,Zt,typeof o=="function"?o:Ti)}function o_(n,i,a,o,c){if(lu(n))throw Error(r(485));if(n=i.action,n!==null){var f={payload:c,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){f.listeners.push(g)}};k.T!==null?a(!0):f.isTransition=!1,o(f),a=i.pending,a===null?(f.next=i.pending=f,My(i,f)):(f.next=a.next,i.pending=a.next=f)}}function My(n,i){var a=i.action,o=i.payload,c=n.state;if(i.isTransition){var f=k.T,g={};k.T=g;try{var b=a(c,o),w=k.S;w!==null&&w(g,b),Ry(n,i,b)}catch(L){nf(n,i,L)}finally{k.T=f}}else try{f=a(c,o),Ry(n,i,f)}catch(L){nf(n,i,L)}}function Ry(n,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Cy(n,i,o)},function(o){return nf(n,i,o)}):Cy(n,i,a)}function Cy(n,i,a){i.status="fulfilled",i.value=a,By(i),n.state=a,i=n.pending,i!==null&&(a=i.next,a===i?n.pending=null:(a=a.next,i.next=a,My(n,a)))}function nf(n,i,a){var o=n.pending;if(n.pending=null,o!==null){o=o.next;do i.status="rejected",i.reason=a,By(i),i=i.next;while(i!==o)}n.action=null}function By(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function Ny(n,i){return i}function zy(n,i){if(jt){var a=ie.formState;if(a!==null){t:{var o=xt;if(jt){if(fe){e:{for(var c=fe,f=Pn;c.nodeType!==8;){if(!f){c=null;break e}if(c=kn(c.nextSibling),c===null){c=null;break e}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){fe=kn(c.nextSibling),o=c.data==="F!";break t}}$s(o)}o=!1}o&&(i=a[0])}}return a=Xe(),a.memoizedState=a.baseState=i,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ny,lastRenderedState:i},a.queue=o,a=Jy.bind(null,xt,o),o.dispatch=a,o=ef(!1),f=lf.bind(null,xt,!1,o.queue),o=Xe(),c={state:i,dispatch:null,action:n,pending:null},o.queue=c,a=o_.bind(null,xt,c,f,a),c.dispatch=a,o.memoizedState=n,[i,a,!1]}function Ly(n){var i=ve();return Uy(i,Zt,n)}function Uy(n,i,a){if(i=Jh(n,i,Ny)[0],n=ru(Ti)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var o=So(i)}catch(g){throw g===po?Jl:g}else o=i;i=ve();var c=i.queue,f=c.dispatch;return a!==i.memoizedState&&(xt.flags|=2048,Pr(9,au(),l_.bind(null,c,a),null)),[o,f,n]}function l_(n,i){n.action=i}function Iy(n){var i=ve(),a=Zt;if(a!==null)return Uy(i,a,n);ve(),i=i.memoizedState,a=ve();var o=a.queue.dispatch;return a.memoizedState=n,[i,o,!1]}function Pr(n,i,a,o){return n={tag:n,create:a,deps:o,inst:i,next:null},i=xt.updateQueue,i===null&&(i=Zh(),xt.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=n.next=n:(o=a.next,a.next=n,n.next=o,i.lastEffect=n),n}function au(){return{destroy:void 0,resource:void 0}}function Fy(){return ve().memoizedState}function ou(n,i,a,o){var c=Xe();o=o===void 0?null:o,xt.flags|=n,c.memoizedState=Pr(1|i,au(),a,o)}function _o(n,i,a,o){var c=ve();o=o===void 0?null:o;var f=c.memoizedState.inst;Zt!==null&&o!==null&&Gh(o,Zt.memoizedState.deps)?c.memoizedState=Pr(i,f,a,o):(xt.flags|=n,c.memoizedState=Pr(1|i,f,a,o))}function jy(n,i){ou(8390656,8,n,i)}function Hy(n,i){_o(2048,8,n,i)}function ky(n,i){return _o(4,2,n,i)}function Vy(n,i){return _o(4,4,n,i)}function qy(n,i){if(typeof i=="function"){n=n();var a=i(n);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Yy(n,i,a){a=a!=null?a.concat([n]):null,_o(4,4,qy.bind(null,i,n),a)}function sf(){}function Qy(n,i){var a=ve();i=i===void 0?null:i;var o=a.memoizedState;return i!==null&&Gh(i,o[1])?o[0]:(a.memoizedState=[n,i],n)}function Gy(n,i){var a=ve();i=i===void 0?null:i;var o=a.memoizedState;if(i!==null&&Gh(i,o[1]))return o[0];if(o=n(),tr){Wi(!0);try{n()}finally{Wi(!1)}}return a.memoizedState=[o,i],o}function rf(n,i,a){return a===void 0||(es&1073741824)!==0?n.memoizedState=i:(n.memoizedState=a,n=Pm(),xt.lanes|=n,ls|=n,a)}function Xy(n,i,a,o){return hn(a,i)?a:Gr.current!==null?(n=rf(n,a,o),hn(n,i)||(Te=!0),n):(es&42)===0?(Te=!0,n.memoizedState=a):(n=Pm(),xt.lanes|=n,ls|=n,i)}function Wy(n,i,a,o,c){var f=$.p;$.p=f!==0&&8>f?f:8;var g=k.T,b={};k.T=b,lf(n,!1,i,a);try{var w=c(),L=k.S;if(L!==null&&L(b,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var V=s_(w,o);wo(n,i,V,mn(n))}else wo(n,i,o,mn(n))}catch(G){wo(n,i,{then:function(){},status:"rejected",reason:G},mn())}finally{$.p=f,k.T=g}}function u_(){}function af(n,i,a,o){if(n.tag!==5)throw Error(r(476));var c=Py(n).queue;Wy(n,c,i,rt,a===null?u_:function(){return $y(n),a(o)})}function Py(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:rt,baseState:rt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:rt},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:a},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function $y(n){var i=Py(n).next.queue;wo(n,i,{},mn())}function of(){return Le(Ho)}function Zy(){return ve().memoizedState}function Ky(){return ve().memoizedState}function c_(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var a=mn();n=Ji(a);var o=ts(i,n,a);o!==null&&(gn(o,i,a),mo(o,i,a)),i={cache:Uh()},n.payload=i;return}i=i.return}}function h_(n,i,a){var o=mn();a={lane:o,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},lu(n)?tm(i,a):(a=xh(n,i,a,o),a!==null&&(gn(a,n,o),em(a,i,o)))}function Jy(n,i,a){var o=mn();wo(n,i,a,o)}function wo(n,i,a,o){var c={lane:o,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(lu(n))tm(i,c);else{var f=n.alternate;if(n.lanes===0&&(f===null||f.lanes===0)&&(f=i.lastRenderedReducer,f!==null))try{var g=i.lastRenderedState,b=f(g,a);if(c.hasEagerState=!0,c.eagerState=b,hn(b,g))return Ql(n,i,c,0),ie===null&&Yl(),!1}catch{}finally{}if(a=xh(n,i,c,o),a!==null)return gn(a,n,o),em(a,i,o),!0}return!1}function lf(n,i,a,o){if(o={lane:2,revertLane:Hf(),action:o,hasEagerState:!1,eagerState:null,next:null},lu(n)){if(i)throw Error(r(479))}else i=xh(n,a,o,2),i!==null&&gn(i,n,2)}function lu(n){var i=n.alternate;return n===xt||i!==null&&i===xt}function tm(n,i){Xr=nu=!0;var a=n.pending;a===null?i.next=i:(i.next=a.next,a.next=i),n.pending=i}function em(n,i,a){if((a&4194048)!==0){var o=i.lanes;o&=n.pendingLanes,a|=o,i.lanes=a,u0(n,a)}}var uu={readContext:Le,use:su,useCallback:ye,useContext:ye,useEffect:ye,useImperativeHandle:ye,useLayoutEffect:ye,useInsertionEffect:ye,useMemo:ye,useReducer:ye,useRef:ye,useState:ye,useDebugValue:ye,useDeferredValue:ye,useTransition:ye,useSyncExternalStore:ye,useId:ye,useHostTransitionStatus:ye,useFormState:ye,useActionState:ye,useOptimistic:ye,useMemoCache:ye,useCacheRefresh:ye},nm={readContext:Le,use:su,useCallback:function(n,i){return Xe().memoizedState=[n,i===void 0?null:i],n},useContext:Le,useEffect:jy,useImperativeHandle:function(n,i,a){a=a!=null?a.concat([n]):null,ou(4194308,4,qy.bind(null,i,n),a)},useLayoutEffect:function(n,i){return ou(4194308,4,n,i)},useInsertionEffect:function(n,i){ou(4,2,n,i)},useMemo:function(n,i){var a=Xe();i=i===void 0?null:i;var o=n();if(tr){Wi(!0);try{n()}finally{Wi(!1)}}return a.memoizedState=[o,i],o},useReducer:function(n,i,a){var o=Xe();if(a!==void 0){var c=a(i);if(tr){Wi(!0);try{a(i)}finally{Wi(!1)}}}else c=i;return o.memoizedState=o.baseState=c,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:c},o.queue=n,n=n.dispatch=h_.bind(null,xt,n),[o.memoizedState,n]},useRef:function(n){var i=Xe();return n={current:n},i.memoizedState=n},useState:function(n){n=ef(n);var i=n.queue,a=Jy.bind(null,xt,i);return i.dispatch=a,[n.memoizedState,a]},useDebugValue:sf,useDeferredValue:function(n,i){var a=Xe();return rf(a,n,i)},useTransition:function(){var n=ef(!1);return n=Wy.bind(null,xt,n.queue,!0,!1),Xe().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,a){var o=xt,c=Xe();if(jt){if(a===void 0)throw Error(r(407));a=a()}else{if(a=i(),ie===null)throw Error(r(349));(Lt&124)!==0||Ay(o,i,a)}c.memoizedState=a;var f={value:a,getSnapshot:i};return c.queue=f,jy(Ty.bind(null,o,f,n),[n]),o.flags|=2048,Pr(9,au(),Ey.bind(null,o,f,a,i),null),a},useId:function(){var n=Xe(),i=ie.identifierPrefix;if(jt){var a=wi,o=_i;a=(o&~(1<<32-cn(o)-1)).toString(32)+a,i="«"+i+"R"+a,a=iu++,0<a&&(i+="H"+a.toString(32)),i+="»"}else a=r_++,i="«"+i+"r"+a.toString(32)+"»";return n.memoizedState=i},useHostTransitionStatus:of,useFormState:zy,useActionState:zy,useOptimistic:function(n){var i=Xe();i.memoizedState=i.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=lf.bind(null,xt,!0,a),a.dispatch=i,[n,i]},useMemoCache:Kh,useCacheRefresh:function(){return Xe().memoizedState=c_.bind(null,xt)}},im={readContext:Le,use:su,useCallback:Qy,useContext:Le,useEffect:Hy,useImperativeHandle:Yy,useInsertionEffect:ky,useLayoutEffect:Vy,useMemo:Gy,useReducer:ru,useRef:Fy,useState:function(){return ru(Ti)},useDebugValue:sf,useDeferredValue:function(n,i){var a=ve();return Xy(a,Zt.memoizedState,n,i)},useTransition:function(){var n=ru(Ti)[0],i=ve().memoizedState;return[typeof n=="boolean"?n:So(n),i]},useSyncExternalStore:wy,useId:Zy,useHostTransitionStatus:of,useFormState:Ly,useActionState:Ly,useOptimistic:function(n,i){var a=ve();return Dy(a,Zt,n,i)},useMemoCache:Kh,useCacheRefresh:Ky},f_={readContext:Le,use:su,useCallback:Qy,useContext:Le,useEffect:Hy,useImperativeHandle:Yy,useInsertionEffect:ky,useLayoutEffect:Vy,useMemo:Gy,useReducer:tf,useRef:Fy,useState:function(){return tf(Ti)},useDebugValue:sf,useDeferredValue:function(n,i){var a=ve();return Zt===null?rf(a,n,i):Xy(a,Zt.memoizedState,n,i)},useTransition:function(){var n=tf(Ti)[0],i=ve().memoizedState;return[typeof n=="boolean"?n:So(n),i]},useSyncExternalStore:wy,useId:Zy,useHostTransitionStatus:of,useFormState:Iy,useActionState:Iy,useOptimistic:function(n,i){var a=ve();return Zt!==null?Dy(a,Zt,n,i):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:Kh,useCacheRefresh:Ky},$r=null,Ao=0;function cu(n){var i=Ao;return Ao+=1,$r===null&&($r=[]),py($r,n,i)}function Eo(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function hu(n,i){throw i.$$typeof===v?Error(r(525)):(n=Object.prototype.toString.call(i),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function sm(n){var i=n._init;return i(n._payload)}function rm(n){function i(M,x){if(n){var z=M.deletions;z===null?(M.deletions=[x],M.flags|=16):z.push(x)}}function a(M,x){if(!n)return null;for(;x!==null;)i(M,x),x=x.sibling;return null}function o(M){for(var x=new Map;M!==null;)M.key!==null?x.set(M.key,M):x.set(M.index,M),M=M.sibling;return x}function c(M,x){return M=Si(M,x),M.index=0,M.sibling=null,M}function f(M,x,z){return M.index=z,n?(z=M.alternate,z!==null?(z=z.index,z<x?(M.flags|=67108866,x):z):(M.flags|=67108866,x)):(M.flags|=1048576,x)}function g(M){return n&&M.alternate===null&&(M.flags|=67108866),M}function b(M,x,z,Q){return x===null||x.tag!==6?(x=Dh(z,M.mode,Q),x.return=M,x):(x=c(x,z),x.return=M,x)}function w(M,x,z,Q){var et=z.type;return et===T?V(M,x,z.props.children,Q,z.key):x!==null&&(x.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===q&&sm(et)===x.type)?(x=c(x,z.props),Eo(x,z),x.return=M,x):(x=Xl(z.type,z.key,z.props,null,M.mode,Q),Eo(x,z),x.return=M,x)}function L(M,x,z,Q){return x===null||x.tag!==4||x.stateNode.containerInfo!==z.containerInfo||x.stateNode.implementation!==z.implementation?(x=Mh(z,M.mode,Q),x.return=M,x):(x=c(x,z.children||[]),x.return=M,x)}function V(M,x,z,Q,et){return x===null||x.tag!==7?(x=Gs(z,M.mode,Q,et),x.return=M,x):(x=c(x,z),x.return=M,x)}function G(M,x,z){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=Dh(""+x,M.mode,z),x.return=M,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case S:return z=Xl(x.type,x.key,x.props,null,M.mode,z),Eo(z,x),z.return=M,z;case _:return x=Mh(x,M.mode,z),x.return=M,x;case q:var Q=x._init;return x=Q(x._payload),G(M,x,z)}if($t(x)||Z(x))return x=Gs(x,M.mode,z,null),x.return=M,x;if(typeof x.then=="function")return G(M,cu(x),z);if(x.$$typeof===R)return G(M,Zl(M,x),z);hu(M,x)}return null}function U(M,x,z,Q){var et=x!==null?x.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return et!==null?null:b(M,x,""+z,Q);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return z.key===et?w(M,x,z,Q):null;case _:return z.key===et?L(M,x,z,Q):null;case q:return et=z._init,z=et(z._payload),U(M,x,z,Q)}if($t(z)||Z(z))return et!==null?null:V(M,x,z,Q,null);if(typeof z.then=="function")return U(M,x,cu(z),Q);if(z.$$typeof===R)return U(M,x,Zl(M,z),Q);hu(M,z)}return null}function I(M,x,z,Q,et){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return M=M.get(z)||null,b(x,M,""+Q,et);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return M=M.get(Q.key===null?z:Q.key)||null,w(x,M,Q,et);case _:return M=M.get(Q.key===null?z:Q.key)||null,L(x,M,Q,et);case q:var Dt=Q._init;return Q=Dt(Q._payload),I(M,x,z,Q,et)}if($t(Q)||Z(Q))return M=M.get(z)||null,V(x,M,Q,et,null);if(typeof Q.then=="function")return I(M,x,z,cu(Q),et);if(Q.$$typeof===R)return I(M,x,z,Zl(x,Q),et);hu(x,Q)}return null}function ut(M,x,z,Q){for(var et=null,Dt=null,st=x,lt=x=0,Oe=null;st!==null&&lt<z.length;lt++){st.index>lt?(Oe=st,st=null):Oe=st.sibling;var It=U(M,st,z[lt],Q);if(It===null){st===null&&(st=Oe);break}n&&st&&It.alternate===null&&i(M,st),x=f(It,x,lt),Dt===null?et=It:Dt.sibling=It,Dt=It,st=Oe}if(lt===z.length)return a(M,st),jt&&Ws(M,lt),et;if(st===null){for(;lt<z.length;lt++)st=G(M,z[lt],Q),st!==null&&(x=f(st,x,lt),Dt===null?et=st:Dt.sibling=st,Dt=st);return jt&&Ws(M,lt),et}for(st=o(st);lt<z.length;lt++)Oe=I(st,M,lt,z[lt],Q),Oe!==null&&(n&&Oe.alternate!==null&&st.delete(Oe.key===null?lt:Oe.key),x=f(Oe,x,lt),Dt===null?et=Oe:Dt.sibling=Oe,Dt=Oe);return n&&st.forEach(function(gs){return i(M,gs)}),jt&&Ws(M,lt),et}function ot(M,x,z,Q){if(z==null)throw Error(r(151));for(var et=null,Dt=null,st=x,lt=x=0,Oe=null,It=z.next();st!==null&&!It.done;lt++,It=z.next()){st.index>lt?(Oe=st,st=null):Oe=st.sibling;var gs=U(M,st,It.value,Q);if(gs===null){st===null&&(st=Oe);break}n&&st&&gs.alternate===null&&i(M,st),x=f(gs,x,lt),Dt===null?et=gs:Dt.sibling=gs,Dt=gs,st=Oe}if(It.done)return a(M,st),jt&&Ws(M,lt),et;if(st===null){for(;!It.done;lt++,It=z.next())It=G(M,It.value,Q),It!==null&&(x=f(It,x,lt),Dt===null?et=It:Dt.sibling=It,Dt=It);return jt&&Ws(M,lt),et}for(st=o(st);!It.done;lt++,It=z.next())It=I(st,M,lt,It.value,Q),It!==null&&(n&&It.alternate!==null&&st.delete(It.key===null?lt:It.key),x=f(It,x,lt),Dt===null?et=It:Dt.sibling=It,Dt=It);return n&&st.forEach(function(d3){return i(M,d3)}),jt&&Ws(M,lt),et}function Jt(M,x,z,Q){if(typeof z=="object"&&z!==null&&z.type===T&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case S:t:{for(var et=z.key;x!==null;){if(x.key===et){if(et=z.type,et===T){if(x.tag===7){a(M,x.sibling),Q=c(x,z.props.children),Q.return=M,M=Q;break t}}else if(x.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===q&&sm(et)===x.type){a(M,x.sibling),Q=c(x,z.props),Eo(Q,z),Q.return=M,M=Q;break t}a(M,x);break}else i(M,x);x=x.sibling}z.type===T?(Q=Gs(z.props.children,M.mode,Q,z.key),Q.return=M,M=Q):(Q=Xl(z.type,z.key,z.props,null,M.mode,Q),Eo(Q,z),Q.return=M,M=Q)}return g(M);case _:t:{for(et=z.key;x!==null;){if(x.key===et)if(x.tag===4&&x.stateNode.containerInfo===z.containerInfo&&x.stateNode.implementation===z.implementation){a(M,x.sibling),Q=c(x,z.children||[]),Q.return=M,M=Q;break t}else{a(M,x);break}else i(M,x);x=x.sibling}Q=Mh(z,M.mode,Q),Q.return=M,M=Q}return g(M);case q:return et=z._init,z=et(z._payload),Jt(M,x,z,Q)}if($t(z))return ut(M,x,z,Q);if(Z(z)){if(et=Z(z),typeof et!="function")throw Error(r(150));return z=et.call(z),ot(M,x,z,Q)}if(typeof z.then=="function")return Jt(M,x,cu(z),Q);if(z.$$typeof===R)return Jt(M,x,Zl(M,z),Q);hu(M,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,x!==null&&x.tag===6?(a(M,x.sibling),Q=c(x,z),Q.return=M,M=Q):(a(M,x),Q=Dh(z,M.mode,Q),Q.return=M,M=Q),g(M)):a(M,x)}return function(M,x,z,Q){try{Ao=0;var et=Jt(M,x,z,Q);return $r=null,et}catch(st){if(st===po||st===Jl)throw st;var Dt=fn(29,st,null,M.mode);return Dt.lanes=Q,Dt.return=M,Dt}finally{}}}var Zr=rm(!0),am=rm(!1),Rn=X(null),$n=null;function ns(n){var i=n.alternate;J(_e,_e.current&1),J(Rn,n),$n===null&&(i===null||Gr.current!==null||i.memoizedState!==null)&&($n=n)}function om(n){if(n.tag===22){if(J(_e,_e.current),J(Rn,n),$n===null){var i=n.alternate;i!==null&&i.memoizedState!==null&&($n=n)}}else is()}function is(){J(_e,_e.current),J(Rn,Rn.current)}function xi(n){tt(Rn),$n===n&&($n=null),tt(_e)}var _e=X(0);function fu(n){for(var i=n;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Kf(a)))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}function uf(n,i,a,o){i=n.memoizedState,a=a(o,i),a=a==null?i:m({},i,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var cf={enqueueSetState:function(n,i,a){n=n._reactInternals;var o=mn(),c=Ji(o);c.payload=i,a!=null&&(c.callback=a),i=ts(n,c,o),i!==null&&(gn(i,n,o),mo(i,n,o))},enqueueReplaceState:function(n,i,a){n=n._reactInternals;var o=mn(),c=Ji(o);c.tag=1,c.payload=i,a!=null&&(c.callback=a),i=ts(n,c,o),i!==null&&(gn(i,n,o),mo(i,n,o))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var a=mn(),o=Ji(a);o.tag=2,i!=null&&(o.callback=i),i=ts(n,o,a),i!==null&&(gn(i,n,a),mo(i,n,a))}};function lm(n,i,a,o,c,f,g){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(o,f,g):i.prototype&&i.prototype.isPureReactComponent?!ro(a,o)||!ro(c,f):!0}function um(n,i,a,o){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,o),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,o),i.state!==n&&cf.enqueueReplaceState(i,i.state,null)}function er(n,i){var a=i;if("ref"in i){a={};for(var o in i)o!=="ref"&&(a[o]=i[o])}if(n=n.defaultProps){a===i&&(a=m({},a));for(var c in n)a[c]===void 0&&(a[c]=n[c])}return a}var du=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function cm(n){du(n)}function hm(n){console.error(n)}function fm(n){du(n)}function pu(n,i){try{var a=n.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(o){setTimeout(function(){throw o})}}function dm(n,i,a){try{var o=n.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function hf(n,i,a){return a=Ji(a),a.tag=3,a.payload={element:null},a.callback=function(){pu(n,i)},a}function pm(n){return n=Ji(n),n.tag=3,n}function ym(n,i,a,o){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var f=o.value;n.payload=function(){return c(f)},n.callback=function(){dm(i,a,o)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(n.callback=function(){dm(i,a,o),typeof c!="function"&&(us===null?us=new Set([this]):us.add(this));var b=o.stack;this.componentDidCatch(o.value,{componentStack:b!==null?b:""})})}function d_(n,i,a,o,c){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(i=a.alternate,i!==null&&co(i,a,c,!0),a=Rn.current,a!==null){switch(a.tag){case 13:return $n===null?Lf():a.alternate===null&&de===0&&(de=3),a.flags&=-257,a.flags|=65536,a.lanes=c,o===jh?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([o]):i.add(o),If(n,o,c)),!1;case 22:return a.flags|=65536,o===jh?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([o]):a.add(o)),If(n,o,c)),!1}throw Error(r(435,a.tag))}return If(n,o,c),Lf(),!1}if(jt)return i=Rn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=c,o!==Bh&&(n=Error(r(422),{cause:o}),uo(xn(n,a)))):(o!==Bh&&(i=Error(r(423),{cause:o}),uo(xn(i,a))),n=n.current.alternate,n.flags|=65536,c&=-c,n.lanes|=c,o=xn(o,a),c=hf(n.stateNode,o,c),Vh(n,c),de!==4&&(de=2)),!1;var f=Error(r(520),{cause:o});if(f=xn(f,a),Co===null?Co=[f]:Co.push(f),de!==4&&(de=2),i===null)return!0;o=xn(o,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,n=c&-c,a.lanes|=n,n=hf(a.stateNode,o,n),Vh(a,n),!1;case 1:if(i=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(us===null||!us.has(f))))return a.flags|=65536,c&=-c,a.lanes|=c,c=pm(c),ym(c,n,a,o),Vh(a,c),!1}a=a.return}while(a!==null);return!1}var mm=Error(r(461)),Te=!1;function De(n,i,a,o){i.child=n===null?am(i,null,a,o):Zr(i,n.child,a,o)}function gm(n,i,a,o,c){a=a.render;var f=i.ref;if("ref"in o){var g={};for(var b in o)b!=="ref"&&(g[b]=o[b])}else g=o;return Ks(i),o=Xh(n,i,a,g,f,c),b=Wh(),n!==null&&!Te?(Ph(n,i,c),Oi(n,i,c)):(jt&&b&&Rh(i),i.flags|=1,De(n,i,o,c),i.child)}function vm(n,i,a,o,c){if(n===null){var f=a.type;return typeof f=="function"&&!Oh(f)&&f.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=f,bm(n,i,f,o,c)):(n=Xl(a.type,null,o,i,i.mode,c),n.ref=i.ref,n.return=i,i.child=n)}if(f=n.child,!bf(n,c)){var g=f.memoizedProps;if(a=a.compare,a=a!==null?a:ro,a(g,o)&&n.ref===i.ref)return Oi(n,i,c)}return i.flags|=1,n=Si(f,o),n.ref=i.ref,n.return=i,i.child=n}function bm(n,i,a,o,c){if(n!==null){var f=n.memoizedProps;if(ro(f,o)&&n.ref===i.ref)if(Te=!1,i.pendingProps=o=f,bf(n,c))(n.flags&131072)!==0&&(Te=!0);else return i.lanes=n.lanes,Oi(n,i,c)}return ff(n,i,a,o,c)}function Sm(n,i,a){var o=i.pendingProps,c=o.children,f=n!==null?n.memoizedState:null;if(o.mode==="hidden"){if((i.flags&128)!==0){if(o=f!==null?f.baseLanes|a:a,n!==null){for(c=i.child=n.child,f=0;c!==null;)f=f|c.lanes|c.childLanes,c=c.sibling;i.childLanes=f&~o}else i.childLanes=0,i.child=null;return _m(n,i,o,a)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Kl(i,f!==null?f.cachePool:null),f!==null?by(i,f):Yh(),om(i);else return i.lanes=i.childLanes=536870912,_m(n,i,f!==null?f.baseLanes|a:a,a)}else f!==null?(Kl(i,f.cachePool),by(i,f),is(),i.memoizedState=null):(n!==null&&Kl(i,null),Yh(),is());return De(n,i,c,a),i.child}function _m(n,i,a,o){var c=Fh();return c=c===null?null:{parent:Se._currentValue,pool:c},i.memoizedState={baseLanes:a,cachePool:c},n!==null&&Kl(i,null),Yh(),om(i),n!==null&&co(n,i,o,!0),null}function yu(n,i){var a=i.ref;if(a===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(n===null||n.ref!==a)&&(i.flags|=4194816)}}function ff(n,i,a,o,c){return Ks(i),a=Xh(n,i,a,o,void 0,c),o=Wh(),n!==null&&!Te?(Ph(n,i,c),Oi(n,i,c)):(jt&&o&&Rh(i),i.flags|=1,De(n,i,a,c),i.child)}function wm(n,i,a,o,c,f){return Ks(i),i.updateQueue=null,a=_y(i,o,a,c),Sy(n),o=Wh(),n!==null&&!Te?(Ph(n,i,f),Oi(n,i,f)):(jt&&o&&Rh(i),i.flags|=1,De(n,i,a,f),i.child)}function Am(n,i,a,o,c){if(Ks(i),i.stateNode===null){var f=kr,g=a.contextType;typeof g=="object"&&g!==null&&(f=Le(g)),f=new a(o,f),i.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=cf,i.stateNode=f,f._reactInternals=i,f=i.stateNode,f.props=o,f.state=i.memoizedState,f.refs={},Hh(i),g=a.contextType,f.context=typeof g=="object"&&g!==null?Le(g):kr,f.state=i.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(uf(i,a,g,o),f.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(g=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),g!==f.state&&cf.enqueueReplaceState(f,f.state,null),vo(i,o,f,c),go(),f.state=i.memoizedState),typeof f.componentDidMount=="function"&&(i.flags|=4194308),o=!0}else if(n===null){f=i.stateNode;var b=i.memoizedProps,w=er(a,b);f.props=w;var L=f.context,V=a.contextType;g=kr,typeof V=="object"&&V!==null&&(g=Le(V));var G=a.getDerivedStateFromProps;V=typeof G=="function"||typeof f.getSnapshotBeforeUpdate=="function",b=i.pendingProps!==b,V||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b||L!==g)&&um(i,f,o,g),Ki=!1;var U=i.memoizedState;f.state=U,vo(i,o,f,c),go(),L=i.memoizedState,b||U!==L||Ki?(typeof G=="function"&&(uf(i,a,G,o),L=i.memoizedState),(w=Ki||lm(i,a,w,o,U,L,g))?(V||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(i.flags|=4194308)):(typeof f.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=o,i.memoizedState=L),f.props=o,f.state=L,f.context=g,o=w):(typeof f.componentDidMount=="function"&&(i.flags|=4194308),o=!1)}else{f=i.stateNode,kh(n,i),g=i.memoizedProps,V=er(a,g),f.props=V,G=i.pendingProps,U=f.context,L=a.contextType,w=kr,typeof L=="object"&&L!==null&&(w=Le(L)),b=a.getDerivedStateFromProps,(L=typeof b=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==G||U!==w)&&um(i,f,o,w),Ki=!1,U=i.memoizedState,f.state=U,vo(i,o,f,c),go();var I=i.memoizedState;g!==G||U!==I||Ki||n!==null&&n.dependencies!==null&&$l(n.dependencies)?(typeof b=="function"&&(uf(i,a,b,o),I=i.memoizedState),(V=Ki||lm(i,a,V,o,U,I,w)||n!==null&&n.dependencies!==null&&$l(n.dependencies))?(L||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(o,I,w),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(o,I,w)),typeof f.componentDidUpdate=="function"&&(i.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof f.componentDidUpdate!="function"||g===n.memoizedProps&&U===n.memoizedState||(i.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===n.memoizedProps&&U===n.memoizedState||(i.flags|=1024),i.memoizedProps=o,i.memoizedState=I),f.props=o,f.state=I,f.context=w,o=V):(typeof f.componentDidUpdate!="function"||g===n.memoizedProps&&U===n.memoizedState||(i.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===n.memoizedProps&&U===n.memoizedState||(i.flags|=1024),o=!1)}return f=o,yu(n,i),o=(i.flags&128)!==0,f||o?(f=i.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:f.render(),i.flags|=1,n!==null&&o?(i.child=Zr(i,n.child,null,c),i.child=Zr(i,null,a,c)):De(n,i,a,c),i.memoizedState=f.state,n=i.child):n=Oi(n,i,c),n}function Em(n,i,a,o){return lo(),i.flags|=256,De(n,i,a,o),i.child}var df={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pf(n){return{baseLanes:n,cachePool:hy()}}function yf(n,i,a){return n=n!==null?n.childLanes&~a:0,i&&(n|=Cn),n}function Tm(n,i,a){var o=i.pendingProps,c=!1,f=(i.flags&128)!==0,g;if((g=f)||(g=n!==null&&n.memoizedState===null?!1:(_e.current&2)!==0),g&&(c=!0,i.flags&=-129),g=(i.flags&32)!==0,i.flags&=-33,n===null){if(jt){if(c?ns(i):is(),jt){var b=fe,w;if(w=b){t:{for(w=b,b=Pn;w.nodeType!==8;){if(!b){b=null;break t}if(w=kn(w.nextSibling),w===null){b=null;break t}}b=w}b!==null?(i.memoizedState={dehydrated:b,treeContext:Xs!==null?{id:_i,overflow:wi}:null,retryLane:536870912,hydrationErrors:null},w=fn(18,null,null,0),w.stateNode=b,w.return=i,i.child=w,je=i,fe=null,w=!0):w=!1}w||$s(i)}if(b=i.memoizedState,b!==null&&(b=b.dehydrated,b!==null))return Kf(b)?i.lanes=32:i.lanes=536870912,null;xi(i)}return b=o.children,o=o.fallback,c?(is(),c=i.mode,b=mu({mode:"hidden",children:b},c),o=Gs(o,c,a,null),b.return=i,o.return=i,b.sibling=o,i.child=b,c=i.child,c.memoizedState=pf(a),c.childLanes=yf(n,g,a),i.memoizedState=df,o):(ns(i),mf(i,b))}if(w=n.memoizedState,w!==null&&(b=w.dehydrated,b!==null)){if(f)i.flags&256?(ns(i),i.flags&=-257,i=gf(n,i,a)):i.memoizedState!==null?(is(),i.child=n.child,i.flags|=128,i=null):(is(),c=o.fallback,b=i.mode,o=mu({mode:"visible",children:o.children},b),c=Gs(c,b,a,null),c.flags|=2,o.return=i,c.return=i,o.sibling=c,i.child=o,Zr(i,n.child,null,a),o=i.child,o.memoizedState=pf(a),o.childLanes=yf(n,g,a),i.memoizedState=df,i=c);else if(ns(i),Kf(b)){if(g=b.nextSibling&&b.nextSibling.dataset,g)var L=g.dgst;g=L,o=Error(r(419)),o.stack="",o.digest=g,uo({value:o,source:null,stack:null}),i=gf(n,i,a)}else if(Te||co(n,i,a,!1),g=(a&n.childLanes)!==0,Te||g){if(g=ie,g!==null&&(o=a&-a,o=(o&42)!==0?1:Kc(o),o=(o&(g.suspendedLanes|a))!==0?0:o,o!==0&&o!==w.retryLane))throw w.retryLane=o,Hr(n,o),gn(g,n,o),mm;b.data==="$?"||Lf(),i=gf(n,i,a)}else b.data==="$?"?(i.flags|=192,i.child=n.child,i=null):(n=w.treeContext,fe=kn(b.nextSibling),je=i,jt=!0,Ps=null,Pn=!1,n!==null&&(Dn[Mn++]=_i,Dn[Mn++]=wi,Dn[Mn++]=Xs,_i=n.id,wi=n.overflow,Xs=i),i=mf(i,o.children),i.flags|=4096);return i}return c?(is(),c=o.fallback,b=i.mode,w=n.child,L=w.sibling,o=Si(w,{mode:"hidden",children:o.children}),o.subtreeFlags=w.subtreeFlags&65011712,L!==null?c=Si(L,c):(c=Gs(c,b,a,null),c.flags|=2),c.return=i,o.return=i,o.sibling=c,i.child=o,o=c,c=i.child,b=n.child.memoizedState,b===null?b=pf(a):(w=b.cachePool,w!==null?(L=Se._currentValue,w=w.parent!==L?{parent:L,pool:L}:w):w=hy(),b={baseLanes:b.baseLanes|a,cachePool:w}),c.memoizedState=b,c.childLanes=yf(n,g,a),i.memoizedState=df,o):(ns(i),a=n.child,n=a.sibling,a=Si(a,{mode:"visible",children:o.children}),a.return=i,a.sibling=null,n!==null&&(g=i.deletions,g===null?(i.deletions=[n],i.flags|=16):g.push(n)),i.child=a,i.memoizedState=null,a)}function mf(n,i){return i=mu({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function mu(n,i){return n=fn(22,n,null,i),n.lanes=0,n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},n}function gf(n,i,a){return Zr(i,n.child,null,a),n=mf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function xm(n,i,a){n.lanes|=i;var o=n.alternate;o!==null&&(o.lanes|=i),zh(n.return,i,a)}function vf(n,i,a,o,c){var f=n.memoizedState;f===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:c}:(f.isBackwards=i,f.rendering=null,f.renderingStartTime=0,f.last=o,f.tail=a,f.tailMode=c)}function Om(n,i,a){var o=i.pendingProps,c=o.revealOrder,f=o.tail;if(De(n,i,o.children,a),o=_e.current,(o&2)!==0)o=o&1|2,i.flags|=128;else{if(n!==null&&(n.flags&128)!==0)t:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&xm(n,a,i);else if(n.tag===19)xm(n,a,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break t;for(;n.sibling===null;){if(n.return===null||n.return===i)break t;n=n.return}n.sibling.return=n.return,n=n.sibling}o&=1}switch(J(_e,o),c){case"forwards":for(a=i.child,c=null;a!==null;)n=a.alternate,n!==null&&fu(n)===null&&(c=a),a=a.sibling;a=c,a===null?(c=i.child,i.child=null):(c=a.sibling,a.sibling=null),vf(i,!1,c,a,f);break;case"backwards":for(a=null,c=i.child,i.child=null;c!==null;){if(n=c.alternate,n!==null&&fu(n)===null){i.child=c;break}n=c.sibling,c.sibling=a,a=c,c=n}vf(i,!0,a,null,f);break;case"together":vf(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Oi(n,i,a){if(n!==null&&(i.dependencies=n.dependencies),ls|=i.lanes,(a&i.childLanes)===0)if(n!==null){if(co(n,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(r(153));if(i.child!==null){for(n=i.child,a=Si(n,n.pendingProps),i.child=a,a.return=i;n.sibling!==null;)n=n.sibling,a=a.sibling=Si(n,n.pendingProps),a.return=i;a.sibling=null}return i.child}function bf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&$l(n)))}function p_(n,i,a){switch(i.tag){case 3:oe(i,i.stateNode.containerInfo),Zi(i,Se,n.memoizedState.cache),lo();break;case 27:case 5:Xc(i);break;case 4:oe(i,i.stateNode.containerInfo);break;case 10:Zi(i,i.type,i.memoizedProps.value);break;case 13:var o=i.memoizedState;if(o!==null)return o.dehydrated!==null?(ns(i),i.flags|=128,null):(a&i.child.childLanes)!==0?Tm(n,i,a):(ns(i),n=Oi(n,i,a),n!==null?n.sibling:null);ns(i);break;case 19:var c=(n.flags&128)!==0;if(o=(a&i.childLanes)!==0,o||(co(n,i,a,!1),o=(a&i.childLanes)!==0),c){if(o)return Om(n,i,a);i.flags|=128}if(c=i.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),J(_e,_e.current),o)break;return null;case 22:case 23:return i.lanes=0,Sm(n,i,a);case 24:Zi(i,Se,n.memoizedState.cache)}return Oi(n,i,a)}function Dm(n,i,a){if(n!==null)if(n.memoizedProps!==i.pendingProps)Te=!0;else{if(!bf(n,a)&&(i.flags&128)===0)return Te=!1,p_(n,i,a);Te=(n.flags&131072)!==0}else Te=!1,jt&&(i.flags&1048576)!==0&&sy(i,Pl,i.index);switch(i.lanes=0,i.tag){case 16:t:{n=i.pendingProps;var o=i.elementType,c=o._init;if(o=c(o._payload),i.type=o,typeof o=="function")Oh(o)?(n=er(o,n),i.tag=1,i=Am(null,i,o,n,a)):(i.tag=0,i=ff(null,i,o,n,a));else{if(o!=null){if(c=o.$$typeof,c===N){i.tag=11,i=gm(null,i,o,n,a);break t}else if(c===H){i.tag=14,i=vm(null,i,o,n,a);break t}}throw i=ft(o)||o,Error(r(306,i,""))}}return i;case 0:return ff(n,i,i.type,i.pendingProps,a);case 1:return o=i.type,c=er(o,i.pendingProps),Am(n,i,o,c,a);case 3:t:{if(oe(i,i.stateNode.containerInfo),n===null)throw Error(r(387));o=i.pendingProps;var f=i.memoizedState;c=f.element,kh(n,i),vo(i,o,null,a);var g=i.memoizedState;if(o=g.cache,Zi(i,Se,o),o!==f.cache&&Lh(i,[Se],a,!0),go(),o=g.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:g.cache},i.updateQueue.baseState=f,i.memoizedState=f,i.flags&256){i=Em(n,i,o,a);break t}else if(o!==c){c=xn(Error(r(424)),i),uo(c),i=Em(n,i,o,a);break t}else{switch(n=i.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(fe=kn(n.firstChild),je=i,jt=!0,Ps=null,Pn=!0,a=am(i,null,o,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(lo(),o===c){i=Oi(n,i,a);break t}De(n,i,o,a)}i=i.child}return i;case 26:return yu(n,i),n===null?(a=Bg(i.type,null,i.pendingProps,null))?i.memoizedState=a:jt||(a=i.type,n=i.pendingProps,o=Ru(dt.current).createElement(a),o[ze]=i,o[Qe]=n,Re(o,a,n),Ee(o),i.stateNode=o):i.memoizedState=Bg(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Xc(i),n===null&&jt&&(o=i.stateNode=Mg(i.type,i.pendingProps,dt.current),je=i,Pn=!0,c=fe,fs(i.type)?(Jf=c,fe=kn(o.firstChild)):fe=c),De(n,i,i.pendingProps.children,a),yu(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&jt&&((c=o=fe)&&(o=V_(o,i.type,i.pendingProps,Pn),o!==null?(i.stateNode=o,je=i,fe=kn(o.firstChild),Pn=!1,c=!0):c=!1),c||$s(i)),Xc(i),c=i.type,f=i.pendingProps,g=n!==null?n.memoizedProps:null,o=f.children,Pf(c,f)?o=null:g!==null&&Pf(c,g)&&(i.flags|=32),i.memoizedState!==null&&(c=Xh(n,i,a_,null,null,a),Ho._currentValue=c),yu(n,i),De(n,i,o,a),i.child;case 6:return n===null&&jt&&((n=a=fe)&&(a=q_(a,i.pendingProps,Pn),a!==null?(i.stateNode=a,je=i,fe=null,n=!0):n=!1),n||$s(i)),null;case 13:return Tm(n,i,a);case 4:return oe(i,i.stateNode.containerInfo),o=i.pendingProps,n===null?i.child=Zr(i,null,o,a):De(n,i,o,a),i.child;case 11:return gm(n,i,i.type,i.pendingProps,a);case 7:return De(n,i,i.pendingProps,a),i.child;case 8:return De(n,i,i.pendingProps.children,a),i.child;case 12:return De(n,i,i.pendingProps.children,a),i.child;case 10:return o=i.pendingProps,Zi(i,i.type,o.value),De(n,i,o.children,a),i.child;case 9:return c=i.type._context,o=i.pendingProps.children,Ks(i),c=Le(c),o=o(c),i.flags|=1,De(n,i,o,a),i.child;case 14:return vm(n,i,i.type,i.pendingProps,a);case 15:return bm(n,i,i.type,i.pendingProps,a);case 19:return Om(n,i,a);case 31:return o=i.pendingProps,a=i.mode,o={mode:o.mode,children:o.children},n===null?(a=mu(o,a),a.ref=i.ref,i.child=a,a.return=i,i=a):(a=Si(n.child,o),a.ref=i.ref,i.child=a,a.return=i,i=a),i;case 22:return Sm(n,i,a);case 24:return Ks(i),o=Le(Se),n===null?(c=Fh(),c===null&&(c=ie,f=Uh(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=a),c=f),i.memoizedState={parent:o,cache:c},Hh(i),Zi(i,Se,c)):((n.lanes&a)!==0&&(kh(n,i),vo(i,null,null,a),go()),c=n.memoizedState,f=i.memoizedState,c.parent!==o?(c={parent:o,cache:o},i.memoizedState=c,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=c),Zi(i,Se,o)):(o=f.cache,Zi(i,Se,o),o!==c.cache&&Lh(i,[Se],a,!0))),De(n,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function Di(n){n.flags|=4}function Mm(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Ig(i)){if(i=Rn.current,i!==null&&((Lt&4194048)===Lt?$n!==null:(Lt&62914560)!==Lt&&(Lt&536870912)===0||i!==$n))throw yo=jh,fy;n.flags|=8192}}function gu(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?o0():536870912,n.lanes|=i,ea|=i)}function To(n,i){if(!jt)switch(n.tailMode){case"hidden":i=n.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?n.tail=null:a.sibling=null;break;case"collapsed":a=n.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:o.sibling=null}}function ue(n){var i=n.alternate!==null&&n.alternate.child===n.child,a=0,o=0;if(i)for(var c=n.child;c!==null;)a|=c.lanes|c.childLanes,o|=c.subtreeFlags&65011712,o|=c.flags&65011712,c.return=n,c=c.sibling;else for(c=n.child;c!==null;)a|=c.lanes|c.childLanes,o|=c.subtreeFlags,o|=c.flags,c.return=n,c=c.sibling;return n.subtreeFlags|=o,n.childLanes=a,i}function y_(n,i,a){var o=i.pendingProps;switch(Ch(i),i.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ue(i),null;case 1:return ue(i),null;case 3:return a=i.stateNode,o=null,n!==null&&(o=n.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Ei(Se),Xi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(oo(i)?Di(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,oy())),ue(i),null;case 26:return a=i.memoizedState,n===null?(Di(i),a!==null?(ue(i),Mm(i,a)):(ue(i),i.flags&=-16777217)):a?a!==n.memoizedState?(Di(i),ue(i),Mm(i,a)):(ue(i),i.flags&=-16777217):(n.memoizedProps!==o&&Di(i),ue(i),i.flags&=-16777217),null;case 27:Dl(i),a=dt.current;var c=i.type;if(n!==null&&i.stateNode!=null)n.memoizedProps!==o&&Di(i);else{if(!o){if(i.stateNode===null)throw Error(r(166));return ue(i),null}n=at.current,oo(i)?ry(i):(n=Mg(c,o,a),i.stateNode=n,Di(i))}return ue(i),null;case 5:if(Dl(i),a=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==o&&Di(i);else{if(!o){if(i.stateNode===null)throw Error(r(166));return ue(i),null}if(n=at.current,oo(i))ry(i);else{switch(c=Ru(dt.current),n){case 1:n=c.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:n=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":n=c.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":n=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":n=c.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof o.is=="string"?c.createElement("select",{is:o.is}):c.createElement("select"),o.multiple?n.multiple=!0:o.size&&(n.size=o.size);break;default:n=typeof o.is=="string"?c.createElement(a,{is:o.is}):c.createElement(a)}}n[ze]=i,n[Qe]=o;t:for(c=i.child;c!==null;){if(c.tag===5||c.tag===6)n.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break t;for(;c.sibling===null;){if(c.return===null||c.return===i)break t;c=c.return}c.sibling.return=c.return,c=c.sibling}i.stateNode=n;t:switch(Re(n,a,o),a){case"button":case"input":case"select":case"textarea":n=!!o.autoFocus;break t;case"img":n=!0;break t;default:n=!1}n&&Di(i)}}return ue(i),i.flags&=-16777217,null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==o&&Di(i);else{if(typeof o!="string"&&i.stateNode===null)throw Error(r(166));if(n=dt.current,oo(i)){if(n=i.stateNode,a=i.memoizedProps,o=null,c=je,c!==null)switch(c.tag){case 27:case 5:o=c.memoizedProps}n[ze]=i,n=!!(n.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||wg(n.nodeValue,a)),n||$s(i)}else n=Ru(n).createTextNode(o),n[ze]=i,i.stateNode=n}return ue(i),null;case 13:if(o=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(c=oo(i),o!==null&&o.dehydrated!==null){if(n===null){if(!c)throw Error(r(318));if(c=i.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));c[ze]=i}else lo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ue(i),c=!1}else c=oy(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=c),c=!0;if(!c)return i.flags&256?(xi(i),i):(xi(i),null)}if(xi(i),(i.flags&128)!==0)return i.lanes=a,i;if(a=o!==null,n=n!==null&&n.memoizedState!==null,a){o=i.child,c=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(c=o.alternate.memoizedState.cachePool.pool);var f=null;o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048)}return a!==n&&a&&(i.child.flags|=8192),gu(i,i.updateQueue),ue(i),null;case 4:return Xi(),n===null&&Yf(i.stateNode.containerInfo),ue(i),null;case 10:return Ei(i.type),ue(i),null;case 19:if(tt(_e),c=i.memoizedState,c===null)return ue(i),null;if(o=(i.flags&128)!==0,f=c.rendering,f===null)if(o)To(c,!1);else{if(de!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(f=fu(n),f!==null){for(i.flags|=128,To(c,!1),n=f.updateQueue,i.updateQueue=n,gu(i,n),i.subtreeFlags=0,n=a,a=i.child;a!==null;)iy(a,n),a=a.sibling;return J(_e,_e.current&1|2),i.child}n=n.sibling}c.tail!==null&&Wn()>Su&&(i.flags|=128,o=!0,To(c,!1),i.lanes=4194304)}else{if(!o)if(n=fu(f),n!==null){if(i.flags|=128,o=!0,n=n.updateQueue,i.updateQueue=n,gu(i,n),To(c,!0),c.tail===null&&c.tailMode==="hidden"&&!f.alternate&&!jt)return ue(i),null}else 2*Wn()-c.renderingStartTime>Su&&a!==536870912&&(i.flags|=128,o=!0,To(c,!1),i.lanes=4194304);c.isBackwards?(f.sibling=i.child,i.child=f):(n=c.last,n!==null?n.sibling=f:i.child=f,c.last=f)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=Wn(),i.sibling=null,n=_e.current,J(_e,o?n&1|2:n&1),i):(ue(i),null);case 22:case 23:return xi(i),Qh(),o=i.memoizedState!==null,n!==null?n.memoizedState!==null!==o&&(i.flags|=8192):o&&(i.flags|=8192),o?(a&536870912)!==0&&(i.flags&128)===0&&(ue(i),i.subtreeFlags&6&&(i.flags|=8192)):ue(i),a=i.updateQueue,a!==null&&gu(i,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048),n!==null&&tt(Js),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),Ei(Se),ue(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function m_(n,i){switch(Ch(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ei(Se),Xi(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return Dl(i),null;case 13:if(xi(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(r(340));lo()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return tt(_e),null;case 4:return Xi(),null;case 10:return Ei(i.type),null;case 22:case 23:return xi(i),Qh(),n!==null&&tt(Js),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Ei(Se),null;case 25:return null;default:return null}}function Rm(n,i){switch(Ch(i),i.tag){case 3:Ei(Se),Xi();break;case 26:case 27:case 5:Dl(i);break;case 4:Xi();break;case 13:xi(i);break;case 19:tt(_e);break;case 10:Ei(i.type);break;case 22:case 23:xi(i),Qh(),n!==null&&tt(Js);break;case 24:Ei(Se)}}function xo(n,i){try{var a=i.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var c=o.next;a=c;do{if((a.tag&n)===n){o=void 0;var f=a.create,g=a.inst;o=f(),g.destroy=o}a=a.next}while(a!==c)}}catch(b){te(i,i.return,b)}}function ss(n,i,a){try{var o=i.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var f=c.next;o=f;do{if((o.tag&n)===n){var g=o.inst,b=g.destroy;if(b!==void 0){g.destroy=void 0,c=i;var w=a,L=b;try{L()}catch(V){te(c,w,V)}}}o=o.next}while(o!==f)}}catch(V){te(i,i.return,V)}}function Cm(n){var i=n.updateQueue;if(i!==null){var a=n.stateNode;try{vy(i,a)}catch(o){te(n,n.return,o)}}}function Bm(n,i,a){a.props=er(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(o){te(n,i,o)}}function Oo(n,i){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var o=n.stateNode;break;case 30:o=n.stateNode;break;default:o=n.stateNode}typeof a=="function"?n.refCleanup=a(o):a.current=o}}catch(c){te(n,i,c)}}function Zn(n,i){var a=n.ref,o=n.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(c){te(n,i,c)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){te(n,i,c)}else a.current=null}function Nm(n){var i=n.type,a=n.memoizedProps,o=n.stateNode;try{t:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break t;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(c){te(n,n.return,c)}}function Sf(n,i,a){try{var o=n.stateNode;I_(o,n.type,a,i),o[Qe]=i}catch(c){te(n,n.return,c)}}function zm(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&fs(n.type)||n.tag===4}function _f(n){t:for(;;){for(;n.sibling===null;){if(n.return===null||zm(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&fs(n.type)||n.flags&2||n.child===null||n.tag===4)continue t;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function wf(n,i,a){var o=n.tag;if(o===5||o===6)n=n.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(n,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(n),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=Mu));else if(o!==4&&(o===27&&fs(n.type)&&(a=n.stateNode,i=null),n=n.child,n!==null))for(wf(n,i,a),n=n.sibling;n!==null;)wf(n,i,a),n=n.sibling}function vu(n,i,a){var o=n.tag;if(o===5||o===6)n=n.stateNode,i?a.insertBefore(n,i):a.appendChild(n);else if(o!==4&&(o===27&&fs(n.type)&&(a=n.stateNode),n=n.child,n!==null))for(vu(n,i,a),n=n.sibling;n!==null;)vu(n,i,a),n=n.sibling}function Lm(n){var i=n.stateNode,a=n.memoizedProps;try{for(var o=n.type,c=i.attributes;c.length;)i.removeAttributeNode(c[0]);Re(i,o,a),i[ze]=n,i[Qe]=a}catch(f){te(n,n.return,f)}}var Mi=!1,me=!1,Af=!1,Um=typeof WeakSet=="function"?WeakSet:Set,xe=null;function g_(n,i){if(n=n.containerInfo,Xf=Uu,n=X0(n),Sh(n)){if("selectionStart"in n)var a={start:n.selectionStart,end:n.selectionEnd};else t:{a=(a=n.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var c=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break t}var g=0,b=-1,w=-1,L=0,V=0,G=n,U=null;e:for(;;){for(var I;G!==a||c!==0&&G.nodeType!==3||(b=g+c),G!==f||o!==0&&G.nodeType!==3||(w=g+o),G.nodeType===3&&(g+=G.nodeValue.length),(I=G.firstChild)!==null;)U=G,G=I;for(;;){if(G===n)break e;if(U===a&&++L===c&&(b=g),U===f&&++V===o&&(w=g),(I=G.nextSibling)!==null)break;G=U,U=G.parentNode}G=I}a=b===-1||w===-1?null:{start:b,end:w}}else a=null}a=a||{start:0,end:0}}else a=null;for(Wf={focusedElem:n,selectionRange:a},Uu=!1,xe=i;xe!==null;)if(i=xe,n=i.child,(i.subtreeFlags&1024)!==0&&n!==null)n.return=i,xe=n;else for(;xe!==null;){switch(i=xe,f=i.alternate,n=i.flags,i.tag){case 0:break;case 11:case 15:break;case 1:if((n&1024)!==0&&f!==null){n=void 0,a=i,c=f.memoizedProps,f=f.memoizedState,o=a.stateNode;try{var ut=er(a.type,c,a.elementType===a.type);n=o.getSnapshotBeforeUpdate(ut,f),o.__reactInternalSnapshotBeforeUpdate=n}catch(ot){te(a,a.return,ot)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,a=n.nodeType,a===9)Zf(n);else if(a===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Zf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(r(163))}if(n=i.sibling,n!==null){n.return=i.return,xe=n;break}xe=i.return}}function Im(n,i,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:rs(n,a),o&4&&xo(5,a);break;case 1:if(rs(n,a),o&4)if(n=a.stateNode,i===null)try{n.componentDidMount()}catch(g){te(a,a.return,g)}else{var c=er(a.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(c,i,n.__reactInternalSnapshotBeforeUpdate)}catch(g){te(a,a.return,g)}}o&64&&Cm(a),o&512&&Oo(a,a.return);break;case 3:if(rs(n,a),o&64&&(n=a.updateQueue,n!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{vy(n,i)}catch(g){te(a,a.return,g)}}break;case 27:i===null&&o&4&&Lm(a);case 26:case 5:rs(n,a),i===null&&o&4&&Nm(a),o&512&&Oo(a,a.return);break;case 12:rs(n,a);break;case 13:rs(n,a),o&4&&Hm(n,a),o&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=x_.bind(null,a),Y_(n,a))));break;case 22:if(o=a.memoizedState!==null||Mi,!o){i=i!==null&&i.memoizedState!==null||me,c=Mi;var f=me;Mi=o,(me=i)&&!f?as(n,a,(a.subtreeFlags&8772)!==0):rs(n,a),Mi=c,me=f}break;case 30:break;default:rs(n,a)}}function Fm(n){var i=n.alternate;i!==null&&(n.alternate=null,Fm(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&eh(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var le=null,We=!1;function Ri(n,i,a){for(a=a.child;a!==null;)jm(n,i,a),a=a.sibling}function jm(n,i,a){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Xa,a)}catch{}switch(a.tag){case 26:me||Zn(a,i),Ri(n,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:me||Zn(a,i);var o=le,c=We;fs(a.type)&&(le=a.stateNode,We=!1),Ri(n,i,a),Uo(a.stateNode),le=o,We=c;break;case 5:me||Zn(a,i);case 6:if(o=le,c=We,le=null,Ri(n,i,a),le=o,We=c,le!==null)if(We)try{(le.nodeType===9?le.body:le.nodeName==="HTML"?le.ownerDocument.body:le).removeChild(a.stateNode)}catch(f){te(a,i,f)}else try{le.removeChild(a.stateNode)}catch(f){te(a,i,f)}break;case 18:le!==null&&(We?(n=le,Og(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),Yo(n)):Og(le,a.stateNode));break;case 4:o=le,c=We,le=a.stateNode.containerInfo,We=!0,Ri(n,i,a),le=o,We=c;break;case 0:case 11:case 14:case 15:me||ss(2,a,i),me||ss(4,a,i),Ri(n,i,a);break;case 1:me||(Zn(a,i),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Bm(a,i,o)),Ri(n,i,a);break;case 21:Ri(n,i,a);break;case 22:me=(o=me)||a.memoizedState!==null,Ri(n,i,a),me=o;break;default:Ri(n,i,a)}}function Hm(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Yo(n)}catch(a){te(i,i.return,a)}}function v_(n){switch(n.tag){case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new Um),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new Um),i;default:throw Error(r(435,n.tag))}}function Ef(n,i){var a=v_(n);i.forEach(function(o){var c=O_.bind(null,n,o);a.has(o)||(a.add(o),o.then(c,c))})}function dn(n,i){var a=i.deletions;if(a!==null)for(var o=0;o<a.length;o++){var c=a[o],f=n,g=i,b=g;t:for(;b!==null;){switch(b.tag){case 27:if(fs(b.type)){le=b.stateNode,We=!1;break t}break;case 5:le=b.stateNode,We=!1;break t;case 3:case 4:le=b.stateNode.containerInfo,We=!0;break t}b=b.return}if(le===null)throw Error(r(160));jm(f,g,c),le=null,We=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(i.subtreeFlags&13878)for(i=i.child;i!==null;)km(i,n),i=i.sibling}var Hn=null;function km(n,i){var a=n.alternate,o=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:dn(i,n),pn(n),o&4&&(ss(3,n,n.return),xo(3,n),ss(5,n,n.return));break;case 1:dn(i,n),pn(n),o&512&&(me||a===null||Zn(a,a.return)),o&64&&Mi&&(n=n.updateQueue,n!==null&&(o=n.callbacks,o!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var c=Hn;if(dn(i,n),pn(n),o&512&&(me||a===null||Zn(a,a.return)),o&4){var f=a!==null?a.memoizedState:null;if(o=n.memoizedState,a===null)if(o===null)if(n.stateNode===null){t:{o=n.type,a=n.memoizedProps,c=c.ownerDocument||c;e:switch(o){case"title":f=c.getElementsByTagName("title")[0],(!f||f[$a]||f[ze]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(o),c.head.insertBefore(f,c.querySelector("head > title"))),Re(f,o,a),f[ze]=n,Ee(f),o=f;break t;case"link":var g=Lg("link","href",c).get(o+(a.href||""));if(g){for(var b=0;b<g.length;b++)if(f=g[b],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){g.splice(b,1);break e}}f=c.createElement(o),Re(f,o,a),c.head.appendChild(f);break;case"meta":if(g=Lg("meta","content",c).get(o+(a.content||""))){for(b=0;b<g.length;b++)if(f=g[b],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){g.splice(b,1);break e}}f=c.createElement(o),Re(f,o,a),c.head.appendChild(f);break;default:throw Error(r(468,o))}f[ze]=n,Ee(f),o=f}n.stateNode=o}else Ug(c,n.type,n.stateNode);else n.stateNode=zg(c,o,n.memoizedProps);else f!==o?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,o===null?Ug(c,n.type,n.stateNode):zg(c,o,n.memoizedProps)):o===null&&n.stateNode!==null&&Sf(n,n.memoizedProps,a.memoizedProps)}break;case 27:dn(i,n),pn(n),o&512&&(me||a===null||Zn(a,a.return)),a!==null&&o&4&&Sf(n,n.memoizedProps,a.memoizedProps);break;case 5:if(dn(i,n),pn(n),o&512&&(me||a===null||Zn(a,a.return)),n.flags&32){c=n.stateNode;try{Nr(c,"")}catch(I){te(n,n.return,I)}}o&4&&n.stateNode!=null&&(c=n.memoizedProps,Sf(n,c,a!==null?a.memoizedProps:c)),o&1024&&(Af=!0);break;case 6:if(dn(i,n),pn(n),o&4){if(n.stateNode===null)throw Error(r(162));o=n.memoizedProps,a=n.stateNode;try{a.nodeValue=o}catch(I){te(n,n.return,I)}}break;case 3:if(Nu=null,c=Hn,Hn=Cu(i.containerInfo),dn(i,n),Hn=c,pn(n),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Yo(i.containerInfo)}catch(I){te(n,n.return,I)}Af&&(Af=!1,Vm(n));break;case 4:o=Hn,Hn=Cu(n.stateNode.containerInfo),dn(i,n),pn(n),Hn=o;break;case 12:dn(i,n),pn(n);break;case 13:dn(i,n),pn(n),n.child.flags&8192&&n.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Rf=Wn()),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,Ef(n,o)));break;case 22:c=n.memoizedState!==null;var w=a!==null&&a.memoizedState!==null,L=Mi,V=me;if(Mi=L||c,me=V||w,dn(i,n),me=V,Mi=L,pn(n),o&8192)t:for(i=n.stateNode,i._visibility=c?i._visibility&-2:i._visibility|1,c&&(a===null||w||Mi||me||nr(n)),a=null,i=n;;){if(i.tag===5||i.tag===26){if(a===null){w=a=i;try{if(f=w.stateNode,c)g=f.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{b=w.stateNode;var G=w.memoizedProps.style,U=G!=null&&G.hasOwnProperty("display")?G.display:null;b.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(I){te(w,w.return,I)}}}else if(i.tag===6){if(a===null){w=i;try{w.stateNode.nodeValue=c?"":w.memoizedProps}catch(I){te(w,w.return,I)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break t;for(;i.sibling===null;){if(i.return===null||i.return===n)break t;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}o&4&&(o=n.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Ef(n,a))));break;case 19:dn(i,n),pn(n),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,Ef(n,o)));break;case 30:break;case 21:break;default:dn(i,n),pn(n)}}function pn(n){var i=n.flags;if(i&2){try{for(var a,o=n.return;o!==null;){if(zm(o)){a=o;break}o=o.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var c=a.stateNode,f=_f(n);vu(n,f,c);break;case 5:var g=a.stateNode;a.flags&32&&(Nr(g,""),a.flags&=-33);var b=_f(n);vu(n,b,g);break;case 3:case 4:var w=a.stateNode.containerInfo,L=_f(n);wf(n,L,w);break;default:throw Error(r(161))}}catch(V){te(n,n.return,V)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function Vm(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;Vm(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function rs(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Im(n,i.alternate,i),i=i.sibling}function nr(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:ss(4,i,i.return),nr(i);break;case 1:Zn(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&Bm(i,i.return,a),nr(i);break;case 27:Uo(i.stateNode);case 26:case 5:Zn(i,i.return),nr(i);break;case 22:i.memoizedState===null&&nr(i);break;case 30:nr(i);break;default:nr(i)}n=n.sibling}}function as(n,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var o=i.alternate,c=n,f=i,g=f.flags;switch(f.tag){case 0:case 11:case 15:as(c,f,a),xo(4,f);break;case 1:if(as(c,f,a),o=f,c=o.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){te(o,o.return,L)}if(o=f,c=o.updateQueue,c!==null){var b=o.stateNode;try{var w=c.shared.hiddenCallbacks;if(w!==null)for(c.shared.hiddenCallbacks=null,c=0;c<w.length;c++)gy(w[c],b)}catch(L){te(o,o.return,L)}}a&&g&64&&Cm(f),Oo(f,f.return);break;case 27:Lm(f);case 26:case 5:as(c,f,a),a&&o===null&&g&4&&Nm(f),Oo(f,f.return);break;case 12:as(c,f,a);break;case 13:as(c,f,a),a&&g&4&&Hm(c,f);break;case 22:f.memoizedState===null&&as(c,f,a),Oo(f,f.return);break;case 30:break;default:as(c,f,a)}i=i.sibling}}function Tf(n,i){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&ho(a))}function xf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&ho(n))}function Kn(n,i,a,o){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)qm(n,i,a,o),i=i.sibling}function qm(n,i,a,o){var c=i.flags;switch(i.tag){case 0:case 11:case 15:Kn(n,i,a,o),c&2048&&xo(9,i);break;case 1:Kn(n,i,a,o);break;case 3:Kn(n,i,a,o),c&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&ho(n)));break;case 12:if(c&2048){Kn(n,i,a,o),n=i.stateNode;try{var f=i.memoizedProps,g=f.id,b=f.onPostCommit;typeof b=="function"&&b(g,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(w){te(i,i.return,w)}}else Kn(n,i,a,o);break;case 13:Kn(n,i,a,o);break;case 23:break;case 22:f=i.stateNode,g=i.alternate,i.memoizedState!==null?f._visibility&2?Kn(n,i,a,o):Do(n,i):f._visibility&2?Kn(n,i,a,o):(f._visibility|=2,Kr(n,i,a,o,(i.subtreeFlags&10256)!==0)),c&2048&&Tf(g,i);break;case 24:Kn(n,i,a,o),c&2048&&xf(i.alternate,i);break;default:Kn(n,i,a,o)}}function Kr(n,i,a,o,c){for(c=c&&(i.subtreeFlags&10256)!==0,i=i.child;i!==null;){var f=n,g=i,b=a,w=o,L=g.flags;switch(g.tag){case 0:case 11:case 15:Kr(f,g,b,w,c),xo(8,g);break;case 23:break;case 22:var V=g.stateNode;g.memoizedState!==null?V._visibility&2?Kr(f,g,b,w,c):Do(f,g):(V._visibility|=2,Kr(f,g,b,w,c)),c&&L&2048&&Tf(g.alternate,g);break;case 24:Kr(f,g,b,w,c),c&&L&2048&&xf(g.alternate,g);break;default:Kr(f,g,b,w,c)}i=i.sibling}}function Do(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=n,o=i,c=o.flags;switch(o.tag){case 22:Do(a,o),c&2048&&Tf(o.alternate,o);break;case 24:Do(a,o),c&2048&&xf(o.alternate,o);break;default:Do(a,o)}i=i.sibling}}var Mo=8192;function Jr(n){if(n.subtreeFlags&Mo)for(n=n.child;n!==null;)Ym(n),n=n.sibling}function Ym(n){switch(n.tag){case 26:Jr(n),n.flags&Mo&&n.memoizedState!==null&&i3(Hn,n.memoizedState,n.memoizedProps);break;case 5:Jr(n);break;case 3:case 4:var i=Hn;Hn=Cu(n.stateNode.containerInfo),Jr(n),Hn=i;break;case 22:n.memoizedState===null&&(i=n.alternate,i!==null&&i.memoizedState!==null?(i=Mo,Mo=16777216,Jr(n),Mo=i):Jr(n));break;default:Jr(n)}}function Qm(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function Ro(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];xe=o,Xm(o,n)}Qm(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Gm(n),n=n.sibling}function Gm(n){switch(n.tag){case 0:case 11:case 15:Ro(n),n.flags&2048&&ss(9,n,n.return);break;case 3:Ro(n);break;case 12:Ro(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,bu(n)):Ro(n);break;default:Ro(n)}}function bu(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];xe=o,Xm(o,n)}Qm(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:ss(8,i,i.return),bu(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,bu(i));break;default:bu(i)}n=n.sibling}}function Xm(n,i){for(;xe!==null;){var a=xe;switch(a.tag){case 0:case 11:case 15:ss(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ho(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,xe=o;else t:for(a=n;xe!==null;){o=xe;var c=o.sibling,f=o.return;if(Fm(o),o===a){xe=null;break t}if(c!==null){c.return=f,xe=c;break t}xe=f}}}var b_={getCacheForType:function(n){var i=Le(Se),a=i.data.get(n);return a===void 0&&(a=n(),i.data.set(n,a)),a}},S_=typeof WeakMap=="function"?WeakMap:Map,Xt=0,ie=null,Mt=null,Lt=0,Wt=0,yn=null,os=!1,ta=!1,Of=!1,Ci=0,de=0,ls=0,ir=0,Df=0,Cn=0,ea=0,Co=null,Pe=null,Mf=!1,Rf=0,Su=1/0,_u=null,us=null,Me=0,cs=null,na=null,ia=0,Cf=0,Bf=null,Wm=null,Bo=0,Nf=null;function mn(){if((Xt&2)!==0&&Lt!==0)return Lt&-Lt;if(k.T!==null){var n=Yr;return n!==0?n:Hf()}return c0()}function Pm(){Cn===0&&(Cn=(Lt&536870912)===0||jt?a0():536870912);var n=Rn.current;return n!==null&&(n.flags|=32),Cn}function gn(n,i,a){(n===ie&&(Wt===2||Wt===9)||n.cancelPendingCommit!==null)&&(sa(n,0),hs(n,Lt,Cn,!1)),Pa(n,a),((Xt&2)===0||n!==ie)&&(n===ie&&((Xt&2)===0&&(ir|=a),de===4&&hs(n,Lt,Cn,!1)),Jn(n))}function $m(n,i,a){if((Xt&6)!==0)throw Error(r(327));var o=!a&&(i&124)===0&&(i&n.expiredLanes)===0||Wa(n,i),c=o?A_(n,i):Uf(n,i,!0),f=o;do{if(c===0){ta&&!o&&hs(n,i,0,!1);break}else{if(a=n.current.alternate,f&&!__(a)){c=Uf(n,i,!1),f=!1;continue}if(c===2){if(f=i,n.errorRecoveryDisabledLanes&f)var g=0;else g=n.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){i=g;t:{var b=n;c=Co;var w=b.current.memoizedState.isDehydrated;if(w&&(sa(b,g).flags|=256),g=Uf(b,g,!1),g!==2){if(Of&&!w){b.errorRecoveryDisabledLanes|=f,ir|=f,c=4;break t}f=Pe,Pe=c,f!==null&&(Pe===null?Pe=f:Pe.push.apply(Pe,f))}c=g}if(f=!1,c!==2)continue}}if(c===1){sa(n,0),hs(n,i,0,!0);break}t:{switch(o=n,f=c,f){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:hs(o,i,Cn,!os);break t;case 2:Pe=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(c=Rf+300-Wn(),10<c)){if(hs(o,i,Cn,!os),Bl(o,0,!0)!==0)break t;o.timeoutHandle=Tg(Zm.bind(null,o,a,Pe,_u,Mf,i,Cn,ir,ea,os,f,2,-0,0),c);break t}Zm(o,a,Pe,_u,Mf,i,Cn,ir,ea,os,f,0,-0,0)}}break}while(!0);Jn(n)}function Zm(n,i,a,o,c,f,g,b,w,L,V,G,U,I){if(n.timeoutHandle=-1,G=i.subtreeFlags,(G&8192||(G&16785408)===16785408)&&(jo={stylesheets:null,count:0,unsuspend:n3},Ym(i),G=s3(),G!==null)){n.cancelPendingCommit=G(sg.bind(null,n,i,f,a,o,c,g,b,w,V,1,U,I)),hs(n,f,g,!L);return}sg(n,i,f,a,o,c,g,b,w)}function __(n){for(var i=n;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var c=a[o],f=c.getSnapshot;c=c.value;try{if(!hn(f(),c))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function hs(n,i,a,o){i&=~Df,i&=~ir,n.suspendedLanes|=i,n.pingedLanes&=~i,o&&(n.warmLanes|=i),o=n.expirationTimes;for(var c=i;0<c;){var f=31-cn(c),g=1<<f;o[f]=-1,c&=~g}a!==0&&l0(n,a,i)}function wu(){return(Xt&6)===0?(No(0),!1):!0}function zf(){if(Mt!==null){if(Wt===0)var n=Mt.return;else n=Mt,Ai=Zs=null,$h(n),$r=null,Ao=0,n=Mt;for(;n!==null;)Rm(n.alternate,n),n=n.return;Mt=null}}function sa(n,i){var a=n.timeoutHandle;a!==-1&&(n.timeoutHandle=-1,j_(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),zf(),ie=n,Mt=a=Si(n.current,null),Lt=i,Wt=0,yn=null,os=!1,ta=Wa(n,i),Of=!1,ea=Cn=Df=ir=ls=de=0,Pe=Co=null,Mf=!1,(i&8)!==0&&(i|=i&32);var o=n.entangledLanes;if(o!==0)for(n=n.entanglements,o&=i;0<o;){var c=31-cn(o),f=1<<c;i|=n[c],o&=~f}return Ci=i,Yl(),a}function Km(n,i){xt=null,k.H=uu,i===po||i===Jl?(i=yy(),Wt=3):i===fy?(i=yy(),Wt=4):Wt=i===mm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,yn=i,Mt===null&&(de=1,pu(n,xn(i,n.current)))}function Jm(){var n=k.H;return k.H=uu,n===null?uu:n}function tg(){var n=k.A;return k.A=b_,n}function Lf(){de=4,os||(Lt&4194048)!==Lt&&Rn.current!==null||(ta=!0),(ls&134217727)===0&&(ir&134217727)===0||ie===null||hs(ie,Lt,Cn,!1)}function Uf(n,i,a){var o=Xt;Xt|=2;var c=Jm(),f=tg();(ie!==n||Lt!==i)&&(_u=null,sa(n,i)),i=!1;var g=de;t:do try{if(Wt!==0&&Mt!==null){var b=Mt,w=yn;switch(Wt){case 8:zf(),g=6;break t;case 3:case 2:case 9:case 6:Rn.current===null&&(i=!0);var L=Wt;if(Wt=0,yn=null,ra(n,b,w,L),a&&ta){g=0;break t}break;default:L=Wt,Wt=0,yn=null,ra(n,b,w,L)}}w_(),g=de;break}catch(V){Km(n,V)}while(!0);return i&&n.shellSuspendCounter++,Ai=Zs=null,Xt=o,k.H=c,k.A=f,Mt===null&&(ie=null,Lt=0,Yl()),g}function w_(){for(;Mt!==null;)eg(Mt)}function A_(n,i){var a=Xt;Xt|=2;var o=Jm(),c=tg();ie!==n||Lt!==i?(_u=null,Su=Wn()+500,sa(n,i)):ta=Wa(n,i);t:do try{if(Wt!==0&&Mt!==null){i=Mt;var f=yn;e:switch(Wt){case 1:Wt=0,yn=null,ra(n,i,f,1);break;case 2:case 9:if(dy(f)){Wt=0,yn=null,ng(i);break}i=function(){Wt!==2&&Wt!==9||ie!==n||(Wt=7),Jn(n)},f.then(i,i);break t;case 3:Wt=7;break t;case 4:Wt=5;break t;case 7:dy(f)?(Wt=0,yn=null,ng(i)):(Wt=0,yn=null,ra(n,i,f,7));break;case 5:var g=null;switch(Mt.tag){case 26:g=Mt.memoizedState;case 5:case 27:var b=Mt;if(!g||Ig(g)){Wt=0,yn=null;var w=b.sibling;if(w!==null)Mt=w;else{var L=b.return;L!==null?(Mt=L,Au(L)):Mt=null}break e}}Wt=0,yn=null,ra(n,i,f,5);break;case 6:Wt=0,yn=null,ra(n,i,f,6);break;case 8:zf(),de=6;break t;default:throw Error(r(462))}}E_();break}catch(V){Km(n,V)}while(!0);return Ai=Zs=null,k.H=o,k.A=c,Xt=a,Mt!==null?0:(ie=null,Lt=0,Yl(),de)}function E_(){for(;Mt!==null&&!G2();)eg(Mt)}function eg(n){var i=Dm(n.alternate,n,Ci);n.memoizedProps=n.pendingProps,i===null?Au(n):Mt=i}function ng(n){var i=n,a=i.alternate;switch(i.tag){case 15:case 0:i=wm(a,i,i.pendingProps,i.type,void 0,Lt);break;case 11:i=wm(a,i,i.pendingProps,i.type.render,i.ref,Lt);break;case 5:$h(i);default:Rm(a,i),i=Mt=iy(i,Ci),i=Dm(a,i,Ci)}n.memoizedProps=n.pendingProps,i===null?Au(n):Mt=i}function ra(n,i,a,o){Ai=Zs=null,$h(i),$r=null,Ao=0;var c=i.return;try{if(d_(n,c,i,a,Lt)){de=1,pu(n,xn(a,n.current)),Mt=null;return}}catch(f){if(c!==null)throw Mt=c,f;de=1,pu(n,xn(a,n.current)),Mt=null;return}i.flags&32768?(jt||o===1?n=!0:ta||(Lt&536870912)!==0?n=!1:(os=n=!0,(o===2||o===9||o===3||o===6)&&(o=Rn.current,o!==null&&o.tag===13&&(o.flags|=16384))),ig(i,n)):Au(i)}function Au(n){var i=n;do{if((i.flags&32768)!==0){ig(i,os);return}n=i.return;var a=y_(i.alternate,i,Ci);if(a!==null){Mt=a;return}if(i=i.sibling,i!==null){Mt=i;return}Mt=i=n}while(i!==null);de===0&&(de=5)}function ig(n,i){do{var a=m_(n.alternate,n);if(a!==null){a.flags&=32767,Mt=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(n=n.sibling,n!==null)){Mt=n;return}Mt=n=a}while(n!==null);de=6,Mt=null}function sg(n,i,a,o,c,f,g,b,w){n.cancelPendingCommit=null;do Eu();while(Me!==0);if((Xt&6)!==0)throw Error(r(327));if(i!==null){if(i===n.current)throw Error(r(177));if(f=i.lanes|i.childLanes,f|=Th,nS(n,a,f,g,b,w),n===ie&&(Mt=ie=null,Lt=0),na=i,cs=n,ia=a,Cf=f,Bf=c,Wm=o,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,D_(Ml,function(){return ug(),null})):(n.callbackNode=null,n.callbackPriority=0),o=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||o){o=k.T,k.T=null,c=$.p,$.p=2,g=Xt,Xt|=4;try{g_(n,i,a)}finally{Xt=g,$.p=c,k.T=o}}Me=1,rg(),ag(),og()}}function rg(){if(Me===1){Me=0;var n=cs,i=na,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var o=$.p;$.p=2;var c=Xt;Xt|=4;try{km(i,n);var f=Wf,g=X0(n.containerInfo),b=f.focusedElem,w=f.selectionRange;if(g!==b&&b&&b.ownerDocument&&G0(b.ownerDocument.documentElement,b)){if(w!==null&&Sh(b)){var L=w.start,V=w.end;if(V===void 0&&(V=L),"selectionStart"in b)b.selectionStart=L,b.selectionEnd=Math.min(V,b.value.length);else{var G=b.ownerDocument||document,U=G&&G.defaultView||window;if(U.getSelection){var I=U.getSelection(),ut=b.textContent.length,ot=Math.min(w.start,ut),Jt=w.end===void 0?ot:Math.min(w.end,ut);!I.extend&&ot>Jt&&(g=Jt,Jt=ot,ot=g);var M=Q0(b,ot),x=Q0(b,Jt);if(M&&x&&(I.rangeCount!==1||I.anchorNode!==M.node||I.anchorOffset!==M.offset||I.focusNode!==x.node||I.focusOffset!==x.offset)){var z=G.createRange();z.setStart(M.node,M.offset),I.removeAllRanges(),ot>Jt?(I.addRange(z),I.extend(x.node,x.offset)):(z.setEnd(x.node,x.offset),I.addRange(z))}}}}for(G=[],I=b;I=I.parentNode;)I.nodeType===1&&G.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<G.length;b++){var Q=G[b];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Uu=!!Xf,Wf=Xf=null}finally{Xt=c,$.p=o,k.T=a}}n.current=i,Me=2}}function ag(){if(Me===2){Me=0;var n=cs,i=na,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var o=$.p;$.p=2;var c=Xt;Xt|=4;try{Im(n,i.alternate,i)}finally{Xt=c,$.p=o,k.T=a}}Me=3}}function og(){if(Me===4||Me===3){Me=0,X2();var n=cs,i=na,a=ia,o=Wm;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Me=5:(Me=0,na=cs=null,lg(n,n.pendingLanes));var c=n.pendingLanes;if(c===0&&(us=null),Jc(a),i=i.stateNode,un&&typeof un.onCommitFiberRoot=="function")try{un.onCommitFiberRoot(Xa,i,void 0,(i.current.flags&128)===128)}catch{}if(o!==null){i=k.T,c=$.p,$.p=2,k.T=null;try{for(var f=n.onRecoverableError,g=0;g<o.length;g++){var b=o[g];f(b.value,{componentStack:b.stack})}}finally{k.T=i,$.p=c}}(ia&3)!==0&&Eu(),Jn(n),c=n.pendingLanes,(a&4194090)!==0&&(c&42)!==0?n===Nf?Bo++:(Bo=0,Nf=n):Bo=0,No(0)}}function lg(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,ho(i)))}function Eu(n){return rg(),ag(),og(),ug()}function ug(){if(Me!==5)return!1;var n=cs,i=Cf;Cf=0;var a=Jc(ia),o=k.T,c=$.p;try{$.p=32>a?32:a,k.T=null,a=Bf,Bf=null;var f=cs,g=ia;if(Me=0,na=cs=null,ia=0,(Xt&6)!==0)throw Error(r(331));var b=Xt;if(Xt|=4,Gm(f.current),qm(f,f.current,g,a),Xt=b,No(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(Xa,f)}catch{}return!0}finally{$.p=c,k.T=o,lg(n,i)}}function cg(n,i,a){i=xn(a,i),i=hf(n.stateNode,i,2),n=ts(n,i,2),n!==null&&(Pa(n,2),Jn(n))}function te(n,i,a){if(n.tag===3)cg(n,n,a);else for(;i!==null;){if(i.tag===3){cg(i,n,a);break}else if(i.tag===1){var o=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(us===null||!us.has(o))){n=xn(a,n),a=pm(2),o=ts(i,a,2),o!==null&&(ym(a,o,i,n),Pa(o,2),Jn(o));break}}i=i.return}}function If(n,i,a){var o=n.pingCache;if(o===null){o=n.pingCache=new S_;var c=new Set;o.set(i,c)}else c=o.get(i),c===void 0&&(c=new Set,o.set(i,c));c.has(a)||(Of=!0,c.add(a),n=T_.bind(null,n,i,a),i.then(n,n))}function T_(n,i,a){var o=n.pingCache;o!==null&&o.delete(i),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,ie===n&&(Lt&a)===a&&(de===4||de===3&&(Lt&62914560)===Lt&&300>Wn()-Rf?(Xt&2)===0&&sa(n,0):Df|=a,ea===Lt&&(ea=0)),Jn(n)}function hg(n,i){i===0&&(i=o0()),n=Hr(n,i),n!==null&&(Pa(n,i),Jn(n))}function x_(n){var i=n.memoizedState,a=0;i!==null&&(a=i.retryLane),hg(n,a)}function O_(n,i){var a=0;switch(n.tag){case 13:var o=n.stateNode,c=n.memoizedState;c!==null&&(a=c.retryLane);break;case 19:o=n.stateNode;break;case 22:o=n.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(i),hg(n,a)}function D_(n,i){return Pc(n,i)}var Tu=null,aa=null,Ff=!1,xu=!1,jf=!1,sr=0;function Jn(n){n!==aa&&n.next===null&&(aa===null?Tu=aa=n:aa=aa.next=n),xu=!0,Ff||(Ff=!0,R_())}function No(n,i){if(!jf&&xu){jf=!0;do for(var a=!1,o=Tu;o!==null;){if(n!==0){var c=o.pendingLanes;if(c===0)var f=0;else{var g=o.suspendedLanes,b=o.pingedLanes;f=(1<<31-cn(42|n)+1)-1,f&=c&~(g&~b),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,yg(o,f))}else f=Lt,f=Bl(o,o===ie?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(f&3)===0||Wa(o,f)||(a=!0,yg(o,f));o=o.next}while(a);jf=!1}}function M_(){fg()}function fg(){xu=Ff=!1;var n=0;sr!==0&&(F_()&&(n=sr),sr=0);for(var i=Wn(),a=null,o=Tu;o!==null;){var c=o.next,f=dg(o,i);f===0?(o.next=null,a===null?Tu=c:a.next=c,c===null&&(aa=a)):(a=o,(n!==0||(f&3)!==0)&&(xu=!0)),o=c}No(n)}function dg(n,i){for(var a=n.suspendedLanes,o=n.pingedLanes,c=n.expirationTimes,f=n.pendingLanes&-62914561;0<f;){var g=31-cn(f),b=1<<g,w=c[g];w===-1?((b&a)===0||(b&o)!==0)&&(c[g]=eS(b,i)):w<=i&&(n.expiredLanes|=b),f&=~b}if(i=ie,a=Lt,a=Bl(n,n===i?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),o=n.callbackNode,a===0||n===i&&(Wt===2||Wt===9)||n.cancelPendingCommit!==null)return o!==null&&o!==null&&$c(o),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||Wa(n,a)){if(i=a&-a,i===n.callbackPriority)return i;switch(o!==null&&$c(o),Jc(a)){case 2:case 8:a=s0;break;case 32:a=Ml;break;case 268435456:a=r0;break;default:a=Ml}return o=pg.bind(null,n),a=Pc(a,o),n.callbackPriority=i,n.callbackNode=a,i}return o!==null&&o!==null&&$c(o),n.callbackPriority=2,n.callbackNode=null,2}function pg(n,i){if(Me!==0&&Me!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(Eu()&&n.callbackNode!==a)return null;var o=Lt;return o=Bl(n,n===ie?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),o===0?null:($m(n,o,i),dg(n,Wn()),n.callbackNode!=null&&n.callbackNode===a?pg.bind(null,n):null)}function yg(n,i){if(Eu())return null;$m(n,i,!0)}function R_(){H_(function(){(Xt&6)!==0?Pc(i0,M_):fg()})}function Hf(){return sr===0&&(sr=a0()),sr}function mg(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Il(""+n)}function gg(n,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,n.id&&a.setAttribute("form",n.id),i.parentNode.insertBefore(a,i),n=new FormData(n),a.parentNode.removeChild(a),n}function C_(n,i,a,o,c){if(i==="submit"&&a&&a.stateNode===c){var f=mg((c[Qe]||null).action),g=o.submitter;g&&(i=(i=g[Qe]||null)?mg(i.formAction):g.getAttribute("formAction"),i!==null&&(f=i,g=null));var b=new kl("action","action",null,o,c);n.push({event:b,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(sr!==0){var w=g?gg(c,g):new FormData(c);af(a,{pending:!0,data:w,method:c.method,action:f},null,w)}}else typeof f=="function"&&(b.preventDefault(),w=g?gg(c,g):new FormData(c),af(a,{pending:!0,data:w,method:c.method,action:f},f,w))},currentTarget:c}]})}}for(var kf=0;kf<Eh.length;kf++){var Vf=Eh[kf],B_=Vf.toLowerCase(),N_=Vf[0].toUpperCase()+Vf.slice(1);jn(B_,"on"+N_)}jn($0,"onAnimationEnd"),jn(Z0,"onAnimationIteration"),jn(K0,"onAnimationStart"),jn("dblclick","onDoubleClick"),jn("focusin","onFocus"),jn("focusout","onBlur"),jn($S,"onTransitionRun"),jn(ZS,"onTransitionStart"),jn(KS,"onTransitionCancel"),jn(J0,"onTransitionEnd"),Rr("onMouseEnter",["mouseout","mouseover"]),Rr("onMouseLeave",["mouseout","mouseover"]),Rr("onPointerEnter",["pointerout","pointerover"]),Rr("onPointerLeave",["pointerout","pointerover"]),Vs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),z_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zo));function vg(n,i){i=(i&4)!==0;for(var a=0;a<n.length;a++){var o=n[a],c=o.event;o=o.listeners;t:{var f=void 0;if(i)for(var g=o.length-1;0<=g;g--){var b=o[g],w=b.instance,L=b.currentTarget;if(b=b.listener,w!==f&&c.isPropagationStopped())break t;f=b,c.currentTarget=L;try{f(c)}catch(V){du(V)}c.currentTarget=null,f=w}else for(g=0;g<o.length;g++){if(b=o[g],w=b.instance,L=b.currentTarget,b=b.listener,w!==f&&c.isPropagationStopped())break t;f=b,c.currentTarget=L;try{f(c)}catch(V){du(V)}c.currentTarget=null,f=w}}}}function Rt(n,i){var a=i[th];a===void 0&&(a=i[th]=new Set);var o=n+"__bubble";a.has(o)||(bg(i,n,2,!1),a.add(o))}function qf(n,i,a){var o=0;i&&(o|=4),bg(a,n,o,i)}var Ou="_reactListening"+Math.random().toString(36).slice(2);function Yf(n){if(!n[Ou]){n[Ou]=!0,f0.forEach(function(a){a!=="selectionchange"&&(z_.has(a)||qf(a,!1,n),qf(a,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Ou]||(i[Ou]=!0,qf("selectionchange",!1,i))}}function bg(n,i,a,o){switch(qg(i)){case 2:var c=o3;break;case 8:c=l3;break;default:c=sd}a=c.bind(null,i,a,n),c=void 0,!hh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(c=!0),o?c!==void 0?n.addEventListener(i,a,{capture:!0,passive:c}):n.addEventListener(i,a,!0):c!==void 0?n.addEventListener(i,a,{passive:c}):n.addEventListener(i,a,!1)}function Qf(n,i,a,o,c){var f=o;if((i&1)===0&&(i&2)===0&&o!==null)t:for(;;){if(o===null)return;var g=o.tag;if(g===3||g===4){var b=o.stateNode.containerInfo;if(b===c)break;if(g===4)for(g=o.return;g!==null;){var w=g.tag;if((w===3||w===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;b!==null;){if(g=Or(b),g===null)return;if(w=g.tag,w===5||w===6||w===26||w===27){o=f=g;continue t}b=b.parentNode}}o=o.return}x0(function(){var L=f,V=uh(a),G=[];t:{var U=ty.get(n);if(U!==void 0){var I=kl,ut=n;switch(n){case"keypress":if(jl(a)===0)break t;case"keydown":case"keyup":I=DS;break;case"focusin":ut="focus",I=yh;break;case"focusout":ut="blur",I=yh;break;case"beforeblur":case"afterblur":I=yh;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=M0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=mS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=CS;break;case $0:case Z0:case K0:I=bS;break;case J0:I=NS;break;case"scroll":case"scrollend":I=pS;break;case"wheel":I=LS;break;case"copy":case"cut":case"paste":I=_S;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=C0;break;case"toggle":case"beforetoggle":I=IS}var ot=(i&4)!==0,Jt=!ot&&(n==="scroll"||n==="scrollend"),M=ot?U!==null?U+"Capture":null:U;ot=[];for(var x=L,z;x!==null;){var Q=x;if(z=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||z===null||M===null||(Q=Ka(x,M),Q!=null&&ot.push(Lo(x,Q,z))),Jt)break;x=x.return}0<ot.length&&(U=new I(U,ut,null,a,V),G.push({event:U,listeners:ot}))}}if((i&7)===0){t:{if(U=n==="mouseover"||n==="pointerover",I=n==="mouseout"||n==="pointerout",U&&a!==lh&&(ut=a.relatedTarget||a.fromElement)&&(Or(ut)||ut[xr]))break t;if((I||U)&&(U=V.window===V?V:(U=V.ownerDocument)?U.defaultView||U.parentWindow:window,I?(ut=a.relatedTarget||a.toElement,I=L,ut=ut?Or(ut):null,ut!==null&&(Jt=u(ut),ot=ut.tag,ut!==Jt||ot!==5&&ot!==27&&ot!==6)&&(ut=null)):(I=null,ut=L),I!==ut)){if(ot=M0,Q="onMouseLeave",M="onMouseEnter",x="mouse",(n==="pointerout"||n==="pointerover")&&(ot=C0,Q="onPointerLeave",M="onPointerEnter",x="pointer"),Jt=I==null?U:Za(I),z=ut==null?U:Za(ut),U=new ot(Q,x+"leave",I,a,V),U.target=Jt,U.relatedTarget=z,Q=null,Or(V)===L&&(ot=new ot(M,x+"enter",ut,a,V),ot.target=z,ot.relatedTarget=Jt,Q=ot),Jt=Q,I&&ut)e:{for(ot=I,M=ut,x=0,z=ot;z;z=oa(z))x++;for(z=0,Q=M;Q;Q=oa(Q))z++;for(;0<x-z;)ot=oa(ot),x--;for(;0<z-x;)M=oa(M),z--;for(;x--;){if(ot===M||M!==null&&ot===M.alternate)break e;ot=oa(ot),M=oa(M)}ot=null}else ot=null;I!==null&&Sg(G,U,I,ot,!1),ut!==null&&Jt!==null&&Sg(G,Jt,ut,ot,!0)}}t:{if(U=L?Za(L):window,I=U.nodeName&&U.nodeName.toLowerCase(),I==="select"||I==="input"&&U.type==="file")var et=j0;else if(I0(U))if(H0)et=XS;else{et=QS;var Dt=YS}else I=U.nodeName,!I||I.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&oh(L.elementType)&&(et=j0):et=GS;if(et&&(et=et(n,L))){F0(G,et,a,V);break t}Dt&&Dt(n,U,L),n==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&ah(U,"number",U.value)}switch(Dt=L?Za(L):window,n){case"focusin":(I0(Dt)||Dt.contentEditable==="true")&&(Ir=Dt,_h=L,ao=null);break;case"focusout":ao=_h=Ir=null;break;case"mousedown":wh=!0;break;case"contextmenu":case"mouseup":case"dragend":wh=!1,W0(G,a,V);break;case"selectionchange":if(PS)break;case"keydown":case"keyup":W0(G,a,V)}var st;if(gh)t:{switch(n){case"compositionstart":var lt="onCompositionStart";break t;case"compositionend":lt="onCompositionEnd";break t;case"compositionupdate":lt="onCompositionUpdate";break t}lt=void 0}else Ur?L0(n,a)&&(lt="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&(lt="onCompositionStart");lt&&(B0&&a.locale!=="ko"&&(Ur||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&Ur&&(st=O0()):($i=V,fh="value"in $i?$i.value:$i.textContent,Ur=!0)),Dt=Du(L,lt),0<Dt.length&&(lt=new R0(lt,n,null,a,V),G.push({event:lt,listeners:Dt}),st?lt.data=st:(st=U0(a),st!==null&&(lt.data=st)))),(st=jS?HS(n,a):kS(n,a))&&(lt=Du(L,"onBeforeInput"),0<lt.length&&(Dt=new R0("onBeforeInput","beforeinput",null,a,V),G.push({event:Dt,listeners:lt}),Dt.data=st)),C_(G,n,L,a,V)}vg(G,i)})}function Lo(n,i,a){return{instance:n,listener:i,currentTarget:a}}function Du(n,i){for(var a=i+"Capture",o=[];n!==null;){var c=n,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Ka(n,a),c!=null&&o.unshift(Lo(n,c,f)),c=Ka(n,i),c!=null&&o.push(Lo(n,c,f))),n.tag===3)return o;n=n.return}return[]}function oa(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Sg(n,i,a,o,c){for(var f=i._reactName,g=[];a!==null&&a!==o;){var b=a,w=b.alternate,L=b.stateNode;if(b=b.tag,w!==null&&w===o)break;b!==5&&b!==26&&b!==27||L===null||(w=L,c?(L=Ka(a,f),L!=null&&g.unshift(Lo(a,L,w))):c||(L=Ka(a,f),L!=null&&g.push(Lo(a,L,w)))),a=a.return}g.length!==0&&n.push({event:i,listeners:g})}var L_=/\r\n?/g,U_=/\u0000|\uFFFD/g;function _g(n){return(typeof n=="string"?n:""+n).replace(L_,`
`).replace(U_,"")}function wg(n,i){return i=_g(i),_g(n)===i}function Mu(){}function Kt(n,i,a,o,c,f){switch(a){case"children":typeof o=="string"?i==="body"||i==="textarea"&&o===""||Nr(n,o):(typeof o=="number"||typeof o=="bigint")&&i!=="body"&&Nr(n,""+o);break;case"className":zl(n,"class",o);break;case"tabIndex":zl(n,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":zl(n,a,o);break;case"style":E0(n,o,f);break;case"data":if(i!=="object"){zl(n,"data",o);break}case"src":case"href":if(o===""&&(i!=="a"||a!=="href")){n.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){n.removeAttribute(a);break}o=Il(""+o),n.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){n.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(a==="formAction"?(i!=="input"&&Kt(n,i,"name",c.name,c,null),Kt(n,i,"formEncType",c.formEncType,c,null),Kt(n,i,"formMethod",c.formMethod,c,null),Kt(n,i,"formTarget",c.formTarget,c,null)):(Kt(n,i,"encType",c.encType,c,null),Kt(n,i,"method",c.method,c,null),Kt(n,i,"target",c.target,c,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){n.removeAttribute(a);break}o=Il(""+o),n.setAttribute(a,o);break;case"onClick":o!=null&&(n.onclick=Mu);break;case"onScroll":o!=null&&Rt("scroll",n);break;case"onScrollEnd":o!=null&&Rt("scrollend",n);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(c.children!=null)throw Error(r(60));n.innerHTML=a}}break;case"multiple":n.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":n.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){n.removeAttribute("xlink:href");break}a=Il(""+o),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(a,""+o):n.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":o===!0?n.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(a,o):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?n.setAttribute(a,o):n.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?n.removeAttribute(a):n.setAttribute(a,o);break;case"popover":Rt("beforetoggle",n),Rt("toggle",n),Nl(n,"popover",o);break;case"xlinkActuate":vi(n,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":vi(n,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":vi(n,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":vi(n,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":vi(n,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":vi(n,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":vi(n,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":vi(n,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":vi(n,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Nl(n,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=fS.get(a)||a,Nl(n,a,o))}}function Gf(n,i,a,o,c,f){switch(a){case"style":E0(n,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(c.children!=null)throw Error(r(60));n.innerHTML=a}}break;case"children":typeof o=="string"?Nr(n,o):(typeof o=="number"||typeof o=="bigint")&&Nr(n,""+o);break;case"onScroll":o!=null&&Rt("scroll",n);break;case"onScrollEnd":o!=null&&Rt("scrollend",n);break;case"onClick":o!=null&&(n.onclick=Mu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!d0.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),i=a.slice(2,c?a.length-7:void 0),f=n[Qe]||null,f=f!=null?f[a]:null,typeof f=="function"&&n.removeEventListener(i,f,c),typeof o=="function")){typeof f!="function"&&f!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(i,o,c);break t}a in n?n[a]=o:o===!0?n.setAttribute(a,""):Nl(n,a,o)}}}function Re(n,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",n),Rt("load",n);var o=!1,c=!1,f;for(f in a)if(a.hasOwnProperty(f)){var g=a[f];if(g!=null)switch(f){case"src":o=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Kt(n,i,f,g,a,null)}}c&&Kt(n,i,"srcSet",a.srcSet,a,null),o&&Kt(n,i,"src",a.src,a,null);return;case"input":Rt("invalid",n);var b=f=g=c=null,w=null,L=null;for(o in a)if(a.hasOwnProperty(o)){var V=a[o];if(V!=null)switch(o){case"name":c=V;break;case"type":g=V;break;case"checked":w=V;break;case"defaultChecked":L=V;break;case"value":f=V;break;case"defaultValue":b=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(137,i));break;default:Kt(n,i,o,V,a,null)}}S0(n,f,b,w,L,g,c,!1),Ll(n);return;case"select":Rt("invalid",n),o=g=f=null;for(c in a)if(a.hasOwnProperty(c)&&(b=a[c],b!=null))switch(c){case"value":f=b;break;case"defaultValue":g=b;break;case"multiple":o=b;default:Kt(n,i,c,b,a,null)}i=f,a=g,n.multiple=!!o,i!=null?Br(n,!!o,i,!1):a!=null&&Br(n,!!o,a,!0);return;case"textarea":Rt("invalid",n),f=c=o=null;for(g in a)if(a.hasOwnProperty(g)&&(b=a[g],b!=null))switch(g){case"value":o=b;break;case"defaultValue":c=b;break;case"children":f=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:Kt(n,i,g,b,a,null)}w0(n,o,c,f),Ll(n);return;case"option":for(w in a)if(a.hasOwnProperty(w)&&(o=a[w],o!=null))switch(w){case"selected":n.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Kt(n,i,w,o,a,null)}return;case"dialog":Rt("beforetoggle",n),Rt("toggle",n),Rt("cancel",n),Rt("close",n);break;case"iframe":case"object":Rt("load",n);break;case"video":case"audio":for(o=0;o<zo.length;o++)Rt(zo[o],n);break;case"image":Rt("error",n),Rt("load",n);break;case"details":Rt("toggle",n);break;case"embed":case"source":case"link":Rt("error",n),Rt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in a)if(a.hasOwnProperty(L)&&(o=a[L],o!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Kt(n,i,L,o,a,null)}return;default:if(oh(i)){for(V in a)a.hasOwnProperty(V)&&(o=a[V],o!==void 0&&Gf(n,i,V,o,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(o=a[b],o!=null&&Kt(n,i,b,o,a,null))}function I_(n,i,a,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,g=null,b=null,w=null,L=null,V=null;for(I in a){var G=a[I];if(a.hasOwnProperty(I)&&G!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":w=G;default:o.hasOwnProperty(I)||Kt(n,i,I,null,o,G)}}for(var U in o){var I=o[U];if(G=a[U],o.hasOwnProperty(U)&&(I!=null||G!=null))switch(U){case"type":f=I;break;case"name":c=I;break;case"checked":L=I;break;case"defaultChecked":V=I;break;case"value":g=I;break;case"defaultValue":b=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(137,i));break;default:I!==G&&Kt(n,i,U,I,o,G)}}rh(n,g,b,w,L,V,f,c);return;case"select":I=g=b=U=null;for(f in a)if(w=a[f],a.hasOwnProperty(f)&&w!=null)switch(f){case"value":break;case"multiple":I=w;default:o.hasOwnProperty(f)||Kt(n,i,f,null,o,w)}for(c in o)if(f=o[c],w=a[c],o.hasOwnProperty(c)&&(f!=null||w!=null))switch(c){case"value":U=f;break;case"defaultValue":b=f;break;case"multiple":g=f;default:f!==w&&Kt(n,i,c,f,o,w)}i=b,a=g,o=I,U!=null?Br(n,!!a,U,!1):!!o!=!!a&&(i!=null?Br(n,!!a,i,!0):Br(n,!!a,a?[]:"",!1));return;case"textarea":I=U=null;for(b in a)if(c=a[b],a.hasOwnProperty(b)&&c!=null&&!o.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Kt(n,i,b,null,o,c)}for(g in o)if(c=o[g],f=a[g],o.hasOwnProperty(g)&&(c!=null||f!=null))switch(g){case"value":U=c;break;case"defaultValue":I=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(r(91));break;default:c!==f&&Kt(n,i,g,c,o,f)}_0(n,U,I);return;case"option":for(var ut in a)if(U=a[ut],a.hasOwnProperty(ut)&&U!=null&&!o.hasOwnProperty(ut))switch(ut){case"selected":n.selected=!1;break;default:Kt(n,i,ut,null,o,U)}for(w in o)if(U=o[w],I=a[w],o.hasOwnProperty(w)&&U!==I&&(U!=null||I!=null))switch(w){case"selected":n.selected=U&&typeof U!="function"&&typeof U!="symbol";break;default:Kt(n,i,w,U,o,I)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ot in a)U=a[ot],a.hasOwnProperty(ot)&&U!=null&&!o.hasOwnProperty(ot)&&Kt(n,i,ot,null,o,U);for(L in o)if(U=o[L],I=a[L],o.hasOwnProperty(L)&&U!==I&&(U!=null||I!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,i));break;default:Kt(n,i,L,U,o,I)}return;default:if(oh(i)){for(var Jt in a)U=a[Jt],a.hasOwnProperty(Jt)&&U!==void 0&&!o.hasOwnProperty(Jt)&&Gf(n,i,Jt,void 0,o,U);for(V in o)U=o[V],I=a[V],!o.hasOwnProperty(V)||U===I||U===void 0&&I===void 0||Gf(n,i,V,U,o,I);return}}for(var M in a)U=a[M],a.hasOwnProperty(M)&&U!=null&&!o.hasOwnProperty(M)&&Kt(n,i,M,null,o,U);for(G in o)U=o[G],I=a[G],!o.hasOwnProperty(G)||U===I||U==null&&I==null||Kt(n,i,G,U,o,I)}var Xf=null,Wf=null;function Ru(n){return n.nodeType===9?n:n.ownerDocument}function Ag(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Eg(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function Pf(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var $f=null;function F_(){var n=window.event;return n&&n.type==="popstate"?n===$f?!1:($f=n,!0):($f=null,!1)}var Tg=typeof setTimeout=="function"?setTimeout:void 0,j_=typeof clearTimeout=="function"?clearTimeout:void 0,xg=typeof Promise=="function"?Promise:void 0,H_=typeof queueMicrotask=="function"?queueMicrotask:typeof xg<"u"?function(n){return xg.resolve(null).then(n).catch(k_)}:Tg;function k_(n){setTimeout(function(){throw n})}function fs(n){return n==="head"}function Og(n,i){var a=i,o=0,c=0;do{var f=a.nextSibling;if(n.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(0<o&&8>o){a=o;var g=n.ownerDocument;if(a&1&&Uo(g.documentElement),a&2&&Uo(g.body),a&4)for(a=g.head,Uo(a),g=a.firstChild;g;){var b=g.nextSibling,w=g.nodeName;g[$a]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=b}}if(c===0){n.removeChild(f),Yo(i);return}c--}else a==="$"||a==="$?"||a==="$!"?c++:o=a.charCodeAt(0)-48;else o=0;a=f}while(a);Yo(i)}function Zf(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Zf(a),eh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function V_(n,i,a,o){for(;n.nodeType===1;){var c=a;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!o&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(o){if(!n[$a])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(f=n.getAttribute("rel"),f==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(f!==c.rel||n.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||n.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||n.getAttribute("title")!==(c.title==null?null:c.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(f=n.getAttribute("src"),(f!==(c.src==null?null:c.src)||n.getAttribute("type")!==(c.type==null?null:c.type)||n.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&n.getAttribute("name")===f)return n}else return n;if(n=kn(n.nextSibling),n===null)break}return null}function q_(n,i,a){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=kn(n.nextSibling),n===null))return null;return n}function Kf(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState==="complete"}function Y_(n,i){var a=n.ownerDocument;if(n.data!=="$?"||a.readyState==="complete")i();else{var o=function(){i(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),n._reactRetry=o}}function kn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="F!"||i==="F")break;if(i==="/$")return null}}return n}var Jf=null;function Dg(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"){if(i===0)return n;i--}else a==="/$"&&i++}n=n.previousSibling}return null}function Mg(n,i,a){switch(i=Ru(a),n){case"html":if(n=i.documentElement,!n)throw Error(r(452));return n;case"head":if(n=i.head,!n)throw Error(r(453));return n;case"body":if(n=i.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function Uo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);eh(n)}var Bn=new Map,Rg=new Set;function Cu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Bi=$.d;$.d={f:Q_,r:G_,D:X_,C:W_,L:P_,m:$_,X:K_,S:Z_,M:J_};function Q_(){var n=Bi.f(),i=wu();return n||i}function G_(n){var i=Dr(n);i!==null&&i.tag===5&&i.type==="form"?$y(i):Bi.r(n)}var la=typeof document>"u"?null:document;function Cg(n,i,a){var o=la;if(o&&typeof i=="string"&&i){var c=Tn(i);c='link[rel="'+n+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Rg.has(c)||(Rg.add(c),n={rel:n,crossOrigin:a,href:i},o.querySelector(c)===null&&(i=o.createElement("link"),Re(i,"link",n),Ee(i),o.head.appendChild(i)))}}function X_(n){Bi.D(n),Cg("dns-prefetch",n,null)}function W_(n,i){Bi.C(n,i),Cg("preconnect",n,i)}function P_(n,i,a){Bi.L(n,i,a);var o=la;if(o&&n&&i){var c='link[rel="preload"][as="'+Tn(i)+'"]';i==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+Tn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+Tn(a.imageSizes)+'"]')):c+='[href="'+Tn(n)+'"]';var f=c;switch(i){case"style":f=ua(n);break;case"script":f=ca(n)}Bn.has(f)||(n=m({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:n,as:i},a),Bn.set(f,n),o.querySelector(c)!==null||i==="style"&&o.querySelector(Io(f))||i==="script"&&o.querySelector(Fo(f))||(i=o.createElement("link"),Re(i,"link",n),Ee(i),o.head.appendChild(i)))}}function $_(n,i){Bi.m(n,i);var a=la;if(a&&n){var o=i&&typeof i.as=="string"?i.as:"script",c='link[rel="modulepreload"][as="'+Tn(o)+'"][href="'+Tn(n)+'"]',f=c;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=ca(n)}if(!Bn.has(f)&&(n=m({rel:"modulepreload",href:n},i),Bn.set(f,n),a.querySelector(c)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Fo(f)))return}o=a.createElement("link"),Re(o,"link",n),Ee(o),a.head.appendChild(o)}}}function Z_(n,i,a){Bi.S(n,i,a);var o=la;if(o&&n){var c=Mr(o).hoistableStyles,f=ua(n);i=i||"default";var g=c.get(f);if(!g){var b={loading:0,preload:null};if(g=o.querySelector(Io(f)))b.loading=5;else{n=m({rel:"stylesheet",href:n,"data-precedence":i},a),(a=Bn.get(f))&&td(n,a);var w=g=o.createElement("link");Ee(w),Re(w,"link",n),w._p=new Promise(function(L,V){w.onload=L,w.onerror=V}),w.addEventListener("load",function(){b.loading|=1}),w.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Bu(g,i,o)}g={type:"stylesheet",instance:g,count:1,state:b},c.set(f,g)}}}function K_(n,i){Bi.X(n,i);var a=la;if(a&&n){var o=Mr(a).hoistableScripts,c=ca(n),f=o.get(c);f||(f=a.querySelector(Fo(c)),f||(n=m({src:n,async:!0},i),(i=Bn.get(c))&&ed(n,i),f=a.createElement("script"),Ee(f),Re(f,"link",n),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(c,f))}}function J_(n,i){Bi.M(n,i);var a=la;if(a&&n){var o=Mr(a).hoistableScripts,c=ca(n),f=o.get(c);f||(f=a.querySelector(Fo(c)),f||(n=m({src:n,async:!0,type:"module"},i),(i=Bn.get(c))&&ed(n,i),f=a.createElement("script"),Ee(f),Re(f,"link",n),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(c,f))}}function Bg(n,i,a,o){var c=(c=dt.current)?Cu(c):null;if(!c)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=ua(a.href),a=Mr(c).hoistableStyles,o=a.get(i),o||(o={type:"style",instance:null,count:0,state:null},a.set(i,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=ua(a.href);var f=Mr(c).hoistableStyles,g=f.get(n);if(g||(c=c.ownerDocument||c,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(n,g),(f=c.querySelector(Io(n)))&&!f._p&&(g.instance=f,g.state.loading=5),Bn.has(n)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Bn.set(n,a),f||t3(c,n,a,g.state))),i&&o===null)throw Error(r(528,""));return g}if(i&&o!==null)throw Error(r(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ca(a),a=Mr(c).hoistableScripts,o=a.get(i),o||(o={type:"script",instance:null,count:0,state:null},a.set(i,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function ua(n){return'href="'+Tn(n)+'"'}function Io(n){return'link[rel="stylesheet"]['+n+"]"}function Ng(n){return m({},n,{"data-precedence":n.precedence,precedence:null})}function t3(n,i,a,o){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?o.loading=1:(i=n.createElement("link"),o.preload=i,i.addEventListener("load",function(){return o.loading|=1}),i.addEventListener("error",function(){return o.loading|=2}),Re(i,"link",a),Ee(i),n.head.appendChild(i))}function ca(n){return'[src="'+Tn(n)+'"]'}function Fo(n){return"script[async]"+n}function zg(n,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var o=n.querySelector('style[data-href~="'+Tn(a.href)+'"]');if(o)return i.instance=o,Ee(o),o;var c=m({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(n.ownerDocument||n).createElement("style"),Ee(o),Re(o,"style",c),Bu(o,a.precedence,n),i.instance=o;case"stylesheet":c=ua(a.href);var f=n.querySelector(Io(c));if(f)return i.state.loading|=4,i.instance=f,Ee(f),f;o=Ng(a),(c=Bn.get(c))&&td(o,c),f=(n.ownerDocument||n).createElement("link"),Ee(f);var g=f;return g._p=new Promise(function(b,w){g.onload=b,g.onerror=w}),Re(f,"link",o),i.state.loading|=4,Bu(f,a.precedence,n),i.instance=f;case"script":return f=ca(a.src),(c=n.querySelector(Fo(f)))?(i.instance=c,Ee(c),c):(o=a,(c=Bn.get(f))&&(o=m({},a),ed(o,c)),n=n.ownerDocument||n,c=n.createElement("script"),Ee(c),Re(c,"link",o),n.head.appendChild(c),i.instance=c);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(o=i.instance,i.state.loading|=4,Bu(o,a.precedence,n));return i.instance}function Bu(n,i,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=o.length?o[o.length-1]:null,f=c,g=0;g<o.length;g++){var b=o[g];if(b.dataset.precedence===i)f=b;else if(f!==c)break}f?f.parentNode.insertBefore(n,f.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(n,i.firstChild))}function td(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function ed(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Nu=null;function Lg(n,i,a){if(Nu===null){var o=new Map,c=Nu=new Map;c.set(a,o)}else c=Nu,o=c.get(a),o||(o=new Map,c.set(a,o));if(o.has(n))return o;for(o.set(n,null),a=a.getElementsByTagName(n),c=0;c<a.length;c++){var f=a[c];if(!(f[$a]||f[ze]||n==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var g=f.getAttribute(i)||"";g=n+g;var b=o.get(g);b?b.push(f):o.set(g,[f])}}return o}function Ug(n,i,a){n=n.ownerDocument||n,n.head.insertBefore(a,i==="title"?n.querySelector("head > title"):null)}function e3(n,i,a){if(a===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return n=i.disabled,typeof i.precedence=="string"&&n==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Ig(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}var jo=null;function n3(){}function i3(n,i,a){if(jo===null)throw Error(r(475));var o=jo;if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var c=ua(a.href),f=n.querySelector(Io(c));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(o.count++,o=zu.bind(o),n.then(o,o)),i.state.loading|=4,i.instance=f,Ee(f);return}f=n.ownerDocument||n,a=Ng(a),(c=Bn.get(c))&&td(a,c),f=f.createElement("link"),Ee(f);var g=f;g._p=new Promise(function(b,w){g.onload=b,g.onerror=w}),Re(f,"link",a),i.instance=f}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(o.count++,i=zu.bind(o),n.addEventListener("load",i),n.addEventListener("error",i))}}function s3(){if(jo===null)throw Error(r(475));var n=jo;return n.stylesheets&&n.count===0&&nd(n,n.stylesheets),0<n.count?function(i){var a=setTimeout(function(){if(n.stylesheets&&nd(n,n.stylesheets),n.unsuspend){var o=n.unsuspend;n.unsuspend=null,o()}},6e4);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(a)}}:null}function zu(){if(this.count--,this.count===0){if(this.stylesheets)nd(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Lu=null;function nd(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Lu=new Map,i.forEach(r3,n),Lu=null,zu.call(n))}function r3(n,i){if(!(i.state.loading&4)){var a=Lu.get(n);if(a)var o=a.get(null);else{a=new Map,Lu.set(n,a);for(var c=n.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var g=c[f];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),o=g)}o&&a.set(null,o)}c=i.instance,g=c.getAttribute("data-precedence"),f=a.get(g)||o,f===o&&a.set(null,c),a.set(g,c),this.count++,o=zu.bind(this),c.addEventListener("load",o),c.addEventListener("error",o),f?f.parentNode.insertBefore(c,f.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(c,n.firstChild)),i.state.loading|=4}}var Ho={$$typeof:R,Provider:null,Consumer:null,_currentValue:rt,_currentValue2:rt,_threadCount:0};function a3(n,i,a,o,c,f,g,b){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Zc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zc(0),this.hiddenUpdates=Zc(null),this.identifierPrefix=o,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function Fg(n,i,a,o,c,f,g,b,w,L,V,G){return n=new a3(n,i,a,g,b,w,L,G),i=1,f===!0&&(i|=24),f=fn(3,null,null,i),n.current=f,f.stateNode=n,i=Uh(),i.refCount++,n.pooledCache=i,i.refCount++,f.memoizedState={element:o,isDehydrated:a,cache:i},Hh(f),n}function jg(n){return n?(n=kr,n):kr}function Hg(n,i,a,o,c,f){c=jg(c),o.context===null?o.context=c:o.pendingContext=c,o=Ji(i),o.payload={element:a},f=f===void 0?null:f,f!==null&&(o.callback=f),a=ts(n,o,i),a!==null&&(gn(a,n,i),mo(a,n,i))}function kg(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<i?a:i}}function id(n,i){kg(n,i),(n=n.alternate)&&kg(n,i)}function Vg(n){if(n.tag===13){var i=Hr(n,67108864);i!==null&&gn(i,n,67108864),id(n,67108864)}}var Uu=!0;function o3(n,i,a,o){var c=k.T;k.T=null;var f=$.p;try{$.p=2,sd(n,i,a,o)}finally{$.p=f,k.T=c}}function l3(n,i,a,o){var c=k.T;k.T=null;var f=$.p;try{$.p=8,sd(n,i,a,o)}finally{$.p=f,k.T=c}}function sd(n,i,a,o){if(Uu){var c=rd(o);if(c===null)Qf(n,i,o,Iu,a),Yg(n,o);else if(c3(c,n,i,a,o))o.stopPropagation();else if(Yg(n,o),i&4&&-1<u3.indexOf(n)){for(;c!==null;){var f=Dr(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var g=ks(f.pendingLanes);if(g!==0){var b=f;for(b.pendingLanes|=2,b.entangledLanes|=2;g;){var w=1<<31-cn(g);b.entanglements[1]|=w,g&=~w}Jn(f),(Xt&6)===0&&(Su=Wn()+500,No(0))}}break;case 13:b=Hr(f,2),b!==null&&gn(b,f,2),wu(),id(f,2)}if(f=rd(o),f===null&&Qf(n,i,o,Iu,a),f===c)break;c=f}c!==null&&o.stopPropagation()}else Qf(n,i,o,null,a)}}function rd(n){return n=uh(n),ad(n)}var Iu=null;function ad(n){if(Iu=null,n=Or(n),n!==null){var i=u(n);if(i===null)n=null;else{var a=i.tag;if(a===13){if(n=h(i),n!==null)return n;n=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return Iu=n,null}function qg(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(W2()){case i0:return 2;case s0:return 8;case Ml:case P2:return 32;case r0:return 268435456;default:return 32}default:return 32}}var od=!1,ds=null,ps=null,ys=null,ko=new Map,Vo=new Map,ms=[],u3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Yg(n,i){switch(n){case"focusin":case"focusout":ds=null;break;case"dragenter":case"dragleave":ps=null;break;case"mouseover":case"mouseout":ys=null;break;case"pointerover":case"pointerout":ko.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(i.pointerId)}}function qo(n,i,a,o,c,f){return n===null||n.nativeEvent!==f?(n={blockedOn:i,domEventName:a,eventSystemFlags:o,nativeEvent:f,targetContainers:[c]},i!==null&&(i=Dr(i),i!==null&&Vg(i)),n):(n.eventSystemFlags|=o,i=n.targetContainers,c!==null&&i.indexOf(c)===-1&&i.push(c),n)}function c3(n,i,a,o,c){switch(i){case"focusin":return ds=qo(ds,n,i,a,o,c),!0;case"dragenter":return ps=qo(ps,n,i,a,o,c),!0;case"mouseover":return ys=qo(ys,n,i,a,o,c),!0;case"pointerover":var f=c.pointerId;return ko.set(f,qo(ko.get(f)||null,n,i,a,o,c)),!0;case"gotpointercapture":return f=c.pointerId,Vo.set(f,qo(Vo.get(f)||null,n,i,a,o,c)),!0}return!1}function Qg(n){var i=Or(n.target);if(i!==null){var a=u(i);if(a!==null){if(i=a.tag,i===13){if(i=h(a),i!==null){n.blockedOn=i,iS(n.priority,function(){if(a.tag===13){var o=mn();o=Kc(o);var c=Hr(a,o);c!==null&&gn(c,a,o),id(a,o)}});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Fu(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var a=rd(n.nativeEvent);if(a===null){a=n.nativeEvent;var o=new a.constructor(a.type,a);lh=o,a.target.dispatchEvent(o),lh=null}else return i=Dr(a),i!==null&&Vg(i),n.blockedOn=a,!1;i.shift()}return!0}function Gg(n,i,a){Fu(n)&&a.delete(i)}function h3(){od=!1,ds!==null&&Fu(ds)&&(ds=null),ps!==null&&Fu(ps)&&(ps=null),ys!==null&&Fu(ys)&&(ys=null),ko.forEach(Gg),Vo.forEach(Gg)}function ju(n,i){n.blockedOn===i&&(n.blockedOn=null,od||(od=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,h3)))}var Hu=null;function Xg(n){Hu!==n&&(Hu=n,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Hu===n&&(Hu=null);for(var i=0;i<n.length;i+=3){var a=n[i],o=n[i+1],c=n[i+2];if(typeof o!="function"){if(ad(o||a)===null)continue;break}var f=Dr(a);f!==null&&(n.splice(i,3),i-=3,af(f,{pending:!0,data:c,method:a.method,action:o},o,c))}}))}function Yo(n){function i(w){return ju(w,n)}ds!==null&&ju(ds,n),ps!==null&&ju(ps,n),ys!==null&&ju(ys,n),ko.forEach(i),Vo.forEach(i);for(var a=0;a<ms.length;a++){var o=ms[a];o.blockedOn===n&&(o.blockedOn=null)}for(;0<ms.length&&(a=ms[0],a.blockedOn===null);)Qg(a),a.blockedOn===null&&ms.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var c=a[o],f=a[o+1],g=c[Qe]||null;if(typeof f=="function")g||Xg(a);else if(g){var b=null;if(f&&f.hasAttribute("formAction")){if(c=f,g=f[Qe]||null)b=g.formAction;else if(ad(c)!==null)continue}else b=g.action;typeof b=="function"?a[o+1]=b:(a.splice(o,3),o-=3),Xg(a)}}}function ld(n){this._internalRoot=n}ku.prototype.render=ld.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(r(409));var a=i.current,o=mn();Hg(a,o,n,i,null,null)},ku.prototype.unmount=ld.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Hg(n.current,2,null,n,null,null),wu(),i[xr]=null}};function ku(n){this._internalRoot=n}ku.prototype.unstable_scheduleHydration=function(n){if(n){var i=c0();n={blockedOn:null,target:n,priority:i};for(var a=0;a<ms.length&&i!==0&&i<ms[a].priority;a++);ms.splice(a,0,n),a===0&&Qg(n)}};var Wg=t.version;if(Wg!=="19.1.0")throw Error(r(527,Wg,"19.1.0"));$.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=y(i),n=n!==null?p(n):null,n=n===null?null:n.stateNode,n};var f3={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vu.isDisabled&&Vu.supportsFiber)try{Xa=Vu.inject(f3),un=Vu}catch{}}return Go.createRoot=function(n,i){if(!l(n))throw Error(r(299));var a=!1,o="",c=cm,f=hm,g=fm,b=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(c=i.onUncaughtError),i.onCaughtError!==void 0&&(f=i.onCaughtError),i.onRecoverableError!==void 0&&(g=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(b=i.unstable_transitionCallbacks)),i=Fg(n,1,!1,null,null,a,o,c,f,g,b,null),n[xr]=i.current,Yf(n),new ld(i)},Go.hydrateRoot=function(n,i,a){if(!l(n))throw Error(r(299));var o=!1,c="",f=cm,g=hm,b=fm,w=null,L=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(w=a.unstable_transitionCallbacks),a.formState!==void 0&&(L=a.formState)),i=Fg(n,1,!0,i,a??null,o,c,f,g,b,w,L),i.context=jg(null),a=i.current,o=mn(),o=Kc(o),c=Ji(o),c.callback=null,ts(a,c,o),a=o,i.current.lanes=a,Pa(i,a),Jn(i),n[xr]=i.current,Yf(n),new ku(i)},Go.version="19.1.0",Go}var rv;function w3(){if(rv)return fd.exports;rv=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(t){console.error(t)}}return s(),fd.exports=_3(),fd.exports}var A3=w3();const E3=Hc(A3);var md={exports:{}},Vt={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var av;function T3(){if(av)return Vt;av=1;var s=typeof Symbol=="function"&&Symbol.for,t=s?Symbol.for("react.element"):60103,e=s?Symbol.for("react.portal"):60106,r=s?Symbol.for("react.fragment"):60107,l=s?Symbol.for("react.strict_mode"):60108,u=s?Symbol.for("react.profiler"):60114,h=s?Symbol.for("react.provider"):60109,d=s?Symbol.for("react.context"):60110,y=s?Symbol.for("react.async_mode"):60111,p=s?Symbol.for("react.concurrent_mode"):60111,m=s?Symbol.for("react.forward_ref"):60112,v=s?Symbol.for("react.suspense"):60113,S=s?Symbol.for("react.suspense_list"):60120,_=s?Symbol.for("react.memo"):60115,T=s?Symbol.for("react.lazy"):60116,O=s?Symbol.for("react.block"):60121,C=s?Symbol.for("react.fundamental"):60117,F=s?Symbol.for("react.responder"):60118,j=s?Symbol.for("react.scope"):60119;function R(A){if(typeof A=="object"&&A!==null){var W=A.$$typeof;switch(W){case t:switch(A=A.type,A){case y:case p:case r:case u:case l:case v:return A;default:switch(A=A&&A.$$typeof,A){case d:case m:case T:case _:case h:return A;default:return W}}case e:return W}}}function N(A){return R(A)===p}return Vt.AsyncMode=y,Vt.ConcurrentMode=p,Vt.ContextConsumer=d,Vt.ContextProvider=h,Vt.Element=t,Vt.ForwardRef=m,Vt.Fragment=r,Vt.Lazy=T,Vt.Memo=_,Vt.Portal=e,Vt.Profiler=u,Vt.StrictMode=l,Vt.Suspense=v,Vt.isAsyncMode=function(A){return N(A)||R(A)===y},Vt.isConcurrentMode=N,Vt.isContextConsumer=function(A){return R(A)===d},Vt.isContextProvider=function(A){return R(A)===h},Vt.isElement=function(A){return typeof A=="object"&&A!==null&&A.$$typeof===t},Vt.isForwardRef=function(A){return R(A)===m},Vt.isFragment=function(A){return R(A)===r},Vt.isLazy=function(A){return R(A)===T},Vt.isMemo=function(A){return R(A)===_},Vt.isPortal=function(A){return R(A)===e},Vt.isProfiler=function(A){return R(A)===u},Vt.isStrictMode=function(A){return R(A)===l},Vt.isSuspense=function(A){return R(A)===v},Vt.isValidElementType=function(A){return typeof A=="string"||typeof A=="function"||A===r||A===p||A===u||A===l||A===v||A===S||typeof A=="object"&&A!==null&&(A.$$typeof===T||A.$$typeof===_||A.$$typeof===h||A.$$typeof===d||A.$$typeof===m||A.$$typeof===C||A.$$typeof===F||A.$$typeof===j||A.$$typeof===O)},Vt.typeOf=R,Vt}var ov;function x3(){return ov||(ov=1,md.exports=T3()),md.exports}var gd,lv;function O3(){if(lv)return gd;lv=1;var s=x3(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};u[s.ForwardRef]=r,u[s.Memo]=l;function h(T){return s.isMemo(T)?l:u[T.$$typeof]||t}var d=Object.defineProperty,y=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,m=Object.getOwnPropertyDescriptor,v=Object.getPrototypeOf,S=Object.prototype;function _(T,O,C){if(typeof O!="string"){if(S){var F=v(O);F&&F!==S&&_(T,F,C)}var j=y(O);p&&(j=j.concat(p(O)));for(var R=h(T),N=h(O),A=0;A<j.length;++A){var W=j[A];if(!e[W]&&!(C&&C[W])&&!(N&&N[W])&&!(R&&R[W])){var H=m(O,W);try{d(T,W,H)}catch{}}}}return T}return gd=_,gd}var D3=O3();const M3=Hc(D3);function ht(s,t,e,r){function l(u){return u instanceof e?u:new e(function(h){h(u)})}return new(e||(e=Promise))(function(u,h){function d(m){try{p(r.next(m))}catch(v){h(v)}}function y(m){try{p(r.throw(m))}catch(v){h(v)}}function p(m){m.done?u(m.value):l(m.value).then(d,y)}p((r=r.apply(s,t||[])).next())})}function uv(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],r=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&r>=s.length&&(s=void 0),{value:s&&s[r++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Et(s){return this instanceof Et?(this.v=s,this):new Et(s)}function di(s,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e.apply(s,t||[]),l,u=[];return l={},h("next"),h("throw"),h("return"),l[Symbol.asyncIterator]=function(){return this},l;function h(S){r[S]&&(l[S]=function(_){return new Promise(function(T,O){u.push([S,_,T,O])>1||d(S,_)})})}function d(S,_){try{y(r[S](_))}catch(T){v(u[0][3],T)}}function y(S){S.value instanceof Et?Promise.resolve(S.value.v).then(p,m):v(u[0][2],S)}function p(S){d("next",S)}function m(S){d("throw",S)}function v(S,_){S(_),u.shift(),u.length&&d(u[0][0],u[0][1])}}function Zu(s){var t,e;return t={},r("next"),r("throw",function(l){throw l}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(l,u){t[l]=s[l]?function(h){return(e=!e)?{value:Et(s[l](h)),done:!1}:u?u(h):h}:u}}function Sr(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=s[Symbol.asyncIterator],e;return t?t.call(s):(s=typeof uv=="function"?uv(s):s[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(u){e[u]=s[u]&&function(h){return new Promise(function(d,y){h=s[u](h),l(d,y,h.done,h.value)})}}function l(u,h,d,y){Promise.resolve(y).then(function(p){u({value:p,done:d})},h)}}const R3=new TextDecoder("utf-8"),Hd=s=>R3.decode(s),C3=new TextEncoder,bp=s=>C3.encode(s),[G8,B3]=(()=>{const s=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw s()}return t.asIntN=()=>{throw s()},t.asUintN=()=>{throw s()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[gl,X8]=(()=>{const s=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw s()}static from(){throw s()}constructor(){throw s()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[vl,W8]=(()=>{const s=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw s()}static from(){throw s()}constructor(){throw s()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),N3=s=>typeof s=="number",fb=s=>typeof s=="boolean",we=s=>typeof s=="function",sn=s=>s!=null&&Object(s)===s,Bs=s=>sn(s)&&we(s.then),bl=s=>sn(s)&&we(s[Symbol.iterator]),Qa=s=>sn(s)&&we(s[Symbol.asyncIterator]),kd=s=>sn(s)&&sn(s.schema),db=s=>sn(s)&&"done"in s&&"value"in s,pb=s=>sn(s)&&we(s.stat)&&N3(s.fd),yb=s=>sn(s)&&Sp(s.body),kc=s=>"_getDOMStream"in s&&"_getNodeStream"in s,z3=s=>sn(s)&&we(s.abort)&&we(s.getWriter)&&!kc(s),Sp=s=>sn(s)&&we(s.cancel)&&we(s.getReader)&&!kc(s),L3=s=>sn(s)&&we(s.end)&&we(s.write)&&fb(s.writable)&&!kc(s),mb=s=>sn(s)&&we(s.read)&&we(s.pipe)&&fb(s.readable)&&!kc(s),U3=s=>sn(s)&&we(s.clear)&&we(s.bytes)&&we(s.position)&&we(s.setPosition)&&we(s.capacity)&&we(s.getBufferIdentifier)&&we(s.createLong),_p=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function I3(s){const t=s[0]?[s[0]]:[];let e,r,l,u;for(let h,d,y=0,p=0,m=s.length;++y<m;){if(h=t[p],d=s[y],!h||!d||h.buffer!==d.buffer||d.byteOffset<h.byteOffset){d&&(t[++p]=d);continue}if({byteOffset:e,byteLength:l}=h,{byteOffset:r,byteLength:u}=d,e+l<r||r+u<e){d&&(t[++p]=d);continue}t[p]=new Uint8Array(h.buffer,e,r-e+u)}return t}function cv(s,t,e=0,r=t.byteLength){const l=s.byteLength,u=new Uint8Array(s.buffer,s.byteOffset,l),h=new Uint8Array(t.buffer,t.byteOffset,Math.min(r,l));return u.set(h,e),s}function yi(s,t){const e=I3(s),r=e.reduce((m,v)=>m+v.byteLength,0);let l,u,h,d=0,y=-1;const p=Math.min(t||Number.POSITIVE_INFINITY,r);for(const m=e.length;++y<m;){if(l=e[y],u=l.subarray(0,Math.min(l.length,p-d)),p<=d+u.length){u.length<l.length?e[y]=l.subarray(u.length):u.length===l.length&&y++,h?cv(h,u,d):h=u;break}cv(h||(h=new Uint8Array(p)),u,d),d+=u.length}return[h||new Uint8Array(0),e.slice(y),r-(h?h.byteLength:0)]}function ee(s,t){let e=db(t)?t.value:t;return e instanceof s?s===Uint8Array?new s(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=bp(e)),e instanceof ArrayBuffer?new s(e):e instanceof _p?new s(e):U3(e)?ee(s,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new s(0):new s(e.buffer,e.byteOffset,e.byteLength/s.BYTES_PER_ELEMENT):s.from(e)):new s(0)}const Xo=s=>ee(Int32Array,s),Ht=s=>ee(Uint8Array,s),Vd=s=>(s.next(),s);function*F3(s,t){const e=function*(l){yield l},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof _p?e(t):bl(t)?t:e(t);return yield*Vd(function*(l){let u=null;do u=l.next(yield ee(s,u));while(!u.done)}(r[Symbol.iterator]())),new s}const j3=s=>F3(Uint8Array,s);function gb(s,t){return di(this,arguments,function*(){if(Bs(t))return yield Et(yield Et(yield*Zu(Sr(gb(s,yield Et(t))))));const r=function(h){return di(this,arguments,function*(){yield yield Et(yield Et(h))})},l=function(h){return di(this,arguments,function*(){yield Et(yield*Zu(Sr(Vd(function*(d){let y=null;do y=d.next(yield y==null?void 0:y.value);while(!y.done)}(h[Symbol.iterator]())))))})},u=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof _p?r(t):bl(t)?l(t):Qa(t)?t:r(t);return yield Et(yield*Zu(Sr(Vd(function(h){return di(this,arguments,function*(){let d=null;do d=yield Et(h.next(yield yield Et(ee(s,d))));while(!d.done)})}(u[Symbol.asyncIterator]()))))),yield Et(new s)})}const H3=s=>gb(Uint8Array,s);function wp(s,t,e){if(s!==0){e=e.slice(0,t+1);for(let r=-1;++r<=t;)e[r]+=s}return e}function k3(s,t){let e=0;const r=s.length;if(r!==t.length)return!1;if(r>0)do if(s[e]!==t[e])return!1;while(++e<r);return!0}const Ln={fromIterable(s){return Yu(V3(s))},fromAsyncIterable(s){return Yu(q3(s))},fromDOMStream(s){return Yu(Y3(s))},fromNodeStream(s){return Yu(G3(s))},toDOMStream(s,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(s,t){throw new Error('"toNodeStream" not available in this environment')}},Yu=s=>(s.next(),s);function*V3(s){let t,e=!1,r=[],l,u,h,d=0;function y(){return u==="peek"?yi(r,h)[0]:([l,r,d]=yi(r,h),l)}({cmd:u,size:h}=yield null);const p=j3(s)[Symbol.iterator]();try{do if({done:t,value:l}=Number.isNaN(h-d)?p.next():p.next(h-d),!t&&l.byteLength>0&&(r.push(l),d+=l.byteLength),t||h<=d)do({cmd:u,size:h}=yield y());while(h<d);while(!t)}catch(m){(e=!0)&&typeof p.throw=="function"&&p.throw(m)}finally{e===!1&&typeof p.return=="function"&&p.return(null)}return null}function q3(s){return di(this,arguments,function*(){let e,r=!1,l=[],u,h,d,y=0;function p(){return h==="peek"?yi(l,d)[0]:([u,l,y]=yi(l,d),u)}({cmd:h,size:d}=yield yield Et(null));const m=H3(s)[Symbol.asyncIterator]();try{do if({done:e,value:u}=Number.isNaN(d-y)?yield Et(m.next()):yield Et(m.next(d-y)),!e&&u.byteLength>0&&(l.push(u),y+=u.byteLength),e||d<=y)do({cmd:h,size:d}=yield yield Et(p()));while(d<y);while(!e)}catch(v){(r=!0)&&typeof m.throw=="function"&&(yield Et(m.throw(v)))}finally{r===!1&&typeof m.return=="function"&&(yield Et(m.return(new Uint8Array(0))))}return yield Et(null)})}function Y3(s){return di(this,arguments,function*(){let e=!1,r=!1,l=[],u,h,d,y=0;function p(){return h==="peek"?yi(l,d)[0]:([u,l,y]=yi(l,d),u)}({cmd:h,size:d}=yield yield Et(null));const m=new Q3(s);try{do if({done:e,value:u}=Number.isNaN(d-y)?yield Et(m.read()):yield Et(m.read(d-y)),!e&&u.byteLength>0&&(l.push(Ht(u)),y+=u.byteLength),e||d<=y)do({cmd:h,size:d}=yield yield Et(p()));while(d<y);while(!e)}catch(v){(r=!0)&&(yield Et(m.cancel(v)))}finally{r===!1?yield Et(m.cancel()):s.locked&&m.releaseLock()}return yield Et(null)})}class Q3{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return ht(this,void 0,void 0,function*(){const{reader:e,source:r}=this;e&&(yield e.cancel(t).catch(()=>{})),r&&r.locked&&this.releaseLock()})}read(t){return ht(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=Ht(e)),e})}}const vd=(s,t)=>{const e=l=>r([t,l]);let r;return[t,e,new Promise(l=>(r=l)&&s.once(t,e))]};function G3(s){return di(this,arguments,function*(){const e=[];let r="error",l=!1,u=null,h,d,y=0,p=[],m;function v(){return h==="peek"?yi(p,d)[0]:([m,p,y]=yi(p,d),m)}if({cmd:h,size:d}=yield yield Et(null),s.isTTY)return yield yield Et(new Uint8Array(0)),yield Et(null);try{e[0]=vd(s,"end"),e[1]=vd(s,"error");do{if(e[2]=vd(s,"readable"),[r,u]=yield Et(Promise.race(e.map(_=>_[2]))),r==="error")break;if((l=r==="end")||(Number.isFinite(d-y)?(m=Ht(s.read(d-y)),m.byteLength<d-y&&(m=Ht(s.read()))):m=Ht(s.read()),m.byteLength>0&&(p.push(m),y+=m.byteLength)),l||d<=y)do({cmd:h,size:d}=yield yield Et(v()));while(d<y)}while(!l)}finally{yield Et(S(e,r==="error"?u:null))}return yield Et(null);function S(_,T){return m=p=null,new Promise((O,C)=>{for(const[F,j]of _)s.off(F,j);try{const F=s.destroy;F&&F.call(s,T),T=void 0}catch(F){T=F||T}finally{T!=null?C(T):O()}})}})}var _n;(function(s){s[s.V1=0]="V1",s[s.V2=1]="V2",s[s.V3=2]="V3",s[s.V4=3]="V4",s[s.V5=4]="V5"})(_n||(_n={}));var wn;(function(s){s[s.Sparse=0]="Sparse",s[s.Dense=1]="Dense"})(wn||(wn={}));var nn;(function(s){s[s.HALF=0]="HALF",s[s.SINGLE=1]="SINGLE",s[s.DOUBLE=2]="DOUBLE"})(nn||(nn={}));var Yi;(function(s){s[s.DAY=0]="DAY",s[s.MILLISECOND=1]="MILLISECOND"})(Yi||(Yi={}));var kt;(function(s){s[s.SECOND=0]="SECOND",s[s.MILLISECOND=1]="MILLISECOND",s[s.MICROSECOND=2]="MICROSECOND",s[s.NANOSECOND=3]="NANOSECOND"})(kt||(kt={}));var Ns;(function(s){s[s.YEAR_MONTH=0]="YEAR_MONTH",s[s.DAY_TIME=1]="DAY_TIME",s[s.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ns||(Ns={}));var qt;(function(s){s[s.NONE=0]="NONE",s[s.Schema=1]="Schema",s[s.DictionaryBatch=2]="DictionaryBatch",s[s.RecordBatch=3]="RecordBatch",s[s.Tensor=4]="Tensor",s[s.SparseTensor=5]="SparseTensor"})(qt||(qt={}));var B;(function(s){s[s.NONE=0]="NONE",s[s.Null=1]="Null",s[s.Int=2]="Int",s[s.Float=3]="Float",s[s.Binary=4]="Binary",s[s.Utf8=5]="Utf8",s[s.Bool=6]="Bool",s[s.Decimal=7]="Decimal",s[s.Date=8]="Date",s[s.Time=9]="Time",s[s.Timestamp=10]="Timestamp",s[s.Interval=11]="Interval",s[s.List=12]="List",s[s.Struct=13]="Struct",s[s.Union=14]="Union",s[s.FixedSizeBinary=15]="FixedSizeBinary",s[s.FixedSizeList=16]="FixedSizeList",s[s.Map=17]="Map",s[s.Dictionary=-1]="Dictionary",s[s.Int8=-2]="Int8",s[s.Int16=-3]="Int16",s[s.Int32=-4]="Int32",s[s.Int64=-5]="Int64",s[s.Uint8=-6]="Uint8",s[s.Uint16=-7]="Uint16",s[s.Uint32=-8]="Uint32",s[s.Uint64=-9]="Uint64",s[s.Float16=-10]="Float16",s[s.Float32=-11]="Float32",s[s.Float64=-12]="Float64",s[s.DateDay=-13]="DateDay",s[s.DateMillisecond=-14]="DateMillisecond",s[s.TimestampSecond=-15]="TimestampSecond",s[s.TimestampMillisecond=-16]="TimestampMillisecond",s[s.TimestampMicrosecond=-17]="TimestampMicrosecond",s[s.TimestampNanosecond=-18]="TimestampNanosecond",s[s.TimeSecond=-19]="TimeSecond",s[s.TimeMillisecond=-20]="TimeMillisecond",s[s.TimeMicrosecond=-21]="TimeMicrosecond",s[s.TimeNanosecond=-22]="TimeNanosecond",s[s.DenseUnion=-23]="DenseUnion",s[s.SparseUnion=-24]="SparseUnion",s[s.IntervalDayTime=-25]="IntervalDayTime",s[s.IntervalYearMonth=-26]="IntervalYearMonth"})(B||(B={}));var Li;(function(s){s[s.OFFSET=0]="OFFSET",s[s.DATA=1]="DATA",s[s.VALIDITY=2]="VALIDITY",s[s.TYPE=3]="TYPE"})(Li||(Li={}));const X3=void 0;function il(s){if(s===null)return"null";if(s===X3)return"undefined";switch(typeof s){case"number":return`${s}`;case"bigint":return`${s}`;case"string":return`"${s}"`}return typeof s[Symbol.toPrimitive]=="function"?s[Symbol.toPrimitive]("string"):ArrayBuffer.isView(s)?s instanceof gl||s instanceof vl?`[${[...s].map(t=>il(t))}]`:`[${s}]`:ArrayBuffer.isView(s)?`[${s}]`:JSON.stringify(s,(t,e)=>typeof e=="bigint"?`${e}`:e)}const W3=Symbol.for("isArrowBigNum");function Xn(s,...t){return t.length===0?Object.setPrototypeOf(ee(this.TypedArray,s),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(s,...t),this.constructor.prototype)}Xn.prototype[W3]=!0;Xn.prototype.toJSON=function(){return`"${_r(this)}"`};Xn.prototype.valueOf=function(){return vb(this)};Xn.prototype.toString=function(){return _r(this)};Xn.prototype[Symbol.toPrimitive]=function(s="default"){switch(s){case"number":return vb(this);case"string":return _r(this);case"default":return qd(this)}return _r(this)};function ga(...s){return Xn.apply(this,s)}function va(...s){return Xn.apply(this,s)}function sl(...s){return Xn.apply(this,s)}Object.setPrototypeOf(ga.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(va.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(sl.prototype,Object.create(Uint32Array.prototype));Object.assign(ga.prototype,Xn.prototype,{constructor:ga,signed:!0,TypedArray:Int32Array,BigIntArray:gl});Object.assign(va.prototype,Xn.prototype,{constructor:va,signed:!1,TypedArray:Uint32Array,BigIntArray:vl});Object.assign(sl.prototype,Xn.prototype,{constructor:sl,signed:!0,TypedArray:Uint32Array,BigIntArray:vl});function vb(s){const{buffer:t,byteOffset:e,length:r,signed:l}=s,u=new vl(t,e,r),h=l&&u[u.length-1]&BigInt(1)<<BigInt(63);let d=BigInt(h?1:0),y=BigInt(0);if(h){for(const p of u)d+=~p*(BigInt(1)<<BigInt(32)*y++);d*=BigInt(-1)}else for(const p of u)d+=p*(BigInt(1)<<BigInt(32)*y++);return d}let _r,qd;B3?(qd=s=>s.byteLength===8?new s.BigIntArray(s.buffer,s.byteOffset,1)[0]:bd(s),_r=s=>s.byteLength===8?`${new s.BigIntArray(s.buffer,s.byteOffset,1)[0]}`:bd(s)):(_r=bd,qd=_r);function bd(s){let t="";const e=new Uint32Array(2);let r=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2);const l=new Uint32Array((r=new Uint16Array(r).reverse()).buffer);let u=-1;const h=r.length-1;do{for(e[0]=r[u=0];u<h;)r[u++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+r[u];r[u]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(l[0]||l[1]||l[2]||l[3]);return t??"0"}class Ap{static new(t,e){switch(e){case!0:return new ga(t);case!1:return new va(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case gl:return new ga(t)}return t.byteLength===16?new sl(t):new va(t)}static signed(t){return new ga(t)}static unsigned(t){return new va(t)}static decimal(t){return new sl(t)}constructor(t,e){return Ap.new(t,e)}}var bb,Sb,_b,wb,Ab,Eb,Tb,xb,Ob,Db,Mb,Rb,Cb,Bb,Nb,zb,Lb,Ub,Ib;class pt{static isNull(t){return(t==null?void 0:t.typeId)===B.Null}static isInt(t){return(t==null?void 0:t.typeId)===B.Int}static isFloat(t){return(t==null?void 0:t.typeId)===B.Float}static isBinary(t){return(t==null?void 0:t.typeId)===B.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===B.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===B.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===B.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===B.Date}static isTime(t){return(t==null?void 0:t.typeId)===B.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===B.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===B.Interval}static isList(t){return(t==null?void 0:t.typeId)===B.List}static isStruct(t){return(t==null?void 0:t.typeId)===B.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===B.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===B.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===B.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===B.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===B.Dictionary}static isDenseUnion(t){return pt.isUnion(t)&&t.mode===wn.Dense}static isSparseUnion(t){return pt.isUnion(t)&&t.mode===wn.Sparse}get typeId(){return B.NONE}}bb=Symbol.toStringTag;pt[bb]=(s=>(s.children=null,s.ArrayType=Array,s[Symbol.toStringTag]="DataType"))(pt.prototype);let zs=class extends pt{toString(){return"Null"}get typeId(){return B.Null}};Sb=Symbol.toStringTag;zs[Sb]=(s=>s[Symbol.toStringTag]="Null")(zs.prototype);class Ls extends pt{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return B.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?gl:vl}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}_b=Symbol.toStringTag;Ls[_b]=(s=>(s.isSigned=null,s.bitWidth=null,s[Symbol.toStringTag]="Int"))(Ls.prototype);class rl extends Ls{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(rl.prototype,"ArrayType",{value:Int32Array});class al extends pt{constructor(t){super(),this.precision=t}get typeId(){return B.Float}get ArrayType(){switch(this.precision){case nn.HALF:return Uint16Array;case nn.SINGLE:return Float32Array;case nn.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}wb=Symbol.toStringTag;al[wb]=(s=>(s.precision=null,s[Symbol.toStringTag]="Float"))(al.prototype);let rc=class extends pt{constructor(){super()}get typeId(){return B.Binary}toString(){return"Binary"}};Ab=Symbol.toStringTag;rc[Ab]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Binary"))(rc.prototype);let ac=class extends pt{constructor(){super()}get typeId(){return B.Utf8}toString(){return"Utf8"}};Eb=Symbol.toStringTag;ac[Eb]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Utf8"))(ac.prototype);let oc=class extends pt{constructor(){super()}get typeId(){return B.Bool}toString(){return"Bool"}};Tb=Symbol.toStringTag;oc[Tb]=(s=>(s.ArrayType=Uint8Array,s[Symbol.toStringTag]="Bool"))(oc.prototype);let lc=class extends pt{constructor(t,e,r=128){super(),this.scale=t,this.precision=e,this.bitWidth=r}get typeId(){return B.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};xb=Symbol.toStringTag;lc[xb]=(s=>(s.scale=null,s.precision=null,s.ArrayType=Uint32Array,s[Symbol.toStringTag]="Decimal"))(lc.prototype);class uc extends pt{constructor(t){super(),this.unit=t}get typeId(){return B.Date}toString(){return`Date${(this.unit+1)*32}<${Yi[this.unit]}>`}}Ob=Symbol.toStringTag;uc[Ob]=(s=>(s.unit=null,s.ArrayType=Int32Array,s[Symbol.toStringTag]="Date"))(uc.prototype);class ol extends pt{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return B.Time}toString(){return`Time${this.bitWidth}<${kt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return gl}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}Db=Symbol.toStringTag;ol[Db]=(s=>(s.unit=null,s.bitWidth=null,s[Symbol.toStringTag]="Time"))(ol.prototype);class cc extends pt{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return B.Timestamp}toString(){return`Timestamp<${kt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}Mb=Symbol.toStringTag;cc[Mb]=(s=>(s.unit=null,s.timezone=null,s.ArrayType=Int32Array,s[Symbol.toStringTag]="Timestamp"))(cc.prototype);class hc extends pt{constructor(t){super(),this.unit=t}get typeId(){return B.Interval}toString(){return`Interval<${Ns[this.unit]}>`}}Rb=Symbol.toStringTag;hc[Rb]=(s=>(s.unit=null,s.ArrayType=Int32Array,s[Symbol.toStringTag]="Interval"))(hc.prototype);let fc=class extends pt{constructor(t){super(),this.children=[t]}get typeId(){return B.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Cb=Symbol.toStringTag;fc[Cb]=(s=>(s.children=null,s[Symbol.toStringTag]="List"))(fc.prototype);class qe extends pt{constructor(t){super(),this.children=t}get typeId(){return B.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Bb=Symbol.toStringTag;qe[Bb]=(s=>(s.children=null,s[Symbol.toStringTag]="Struct"))(qe.prototype);class dc extends pt{constructor(t,e,r){super(),this.mode=t,this.children=r,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((l,u,h)=>(l[u]=h)&&l||l,Object.create(null))}get typeId(){return B.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}Nb=Symbol.toStringTag;dc[Nb]=(s=>(s.mode=null,s.typeIds=null,s.children=null,s.typeIdToChildIndex=null,s.ArrayType=Int8Array,s[Symbol.toStringTag]="Union"))(dc.prototype);let pc=class extends pt{constructor(t){super(),this.byteWidth=t}get typeId(){return B.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};zb=Symbol.toStringTag;pc[zb]=(s=>(s.byteWidth=null,s.ArrayType=Uint8Array,s[Symbol.toStringTag]="FixedSizeBinary"))(pc.prototype);let yc=class extends pt{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return B.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Lb=Symbol.toStringTag;yc[Lb]=(s=>(s.children=null,s.listSize=null,s[Symbol.toStringTag]="FixedSizeList"))(yc.prototype);class mc extends pt{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return B.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Ub=Symbol.toStringTag;mc[Ub]=(s=>(s.children=null,s.keysSorted=null,s[Symbol.toStringTag]="Map_"))(mc.prototype);const P3=(s=>()=>++s)(-1);class Ua extends pt{constructor(t,e,r,l){super(),this.indices=e,this.dictionary=t,this.isOrdered=l||!1,this.id=r==null?P3():typeof r=="number"?r:r.low}get typeId(){return B.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Ib=Symbol.toStringTag;Ua[Ib]=(s=>(s.id=null,s.indices=null,s.isOrdered=null,s.dictionary=null,s[Symbol.toStringTag]="Dictionary"))(Ua.prototype);function Ui(s){const t=s;switch(s.typeId){case B.Decimal:return s.bitWidth/32;case B.Timestamp:return 2;case B.Date:return 1+t.unit;case B.Interval:return 1+t.unit;case B.FixedSizeList:return t.listSize;case B.FixedSizeBinary:return t.byteWidth;default:return 1}}class zt{visitMany(t,...e){return t.map((r,l)=>this.visit(r,...e.map(u=>u[l])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return $3(this,t,e)}getVisitFnByTypeId(t,e=!0){return fa(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function $3(s,t,e=!0){return typeof t=="number"?fa(s,t,e):typeof t=="string"&&t in B?fa(s,B[t],e):t&&t instanceof pt?fa(s,hv(t),e):t!=null&&t.type&&t.type instanceof pt?fa(s,hv(t.type),e):fa(s,B.NONE,e)}function fa(s,t,e=!0){let r=null;switch(t){case B.Null:r=s.visitNull;break;case B.Bool:r=s.visitBool;break;case B.Int:r=s.visitInt;break;case B.Int8:r=s.visitInt8||s.visitInt;break;case B.Int16:r=s.visitInt16||s.visitInt;break;case B.Int32:r=s.visitInt32||s.visitInt;break;case B.Int64:r=s.visitInt64||s.visitInt;break;case B.Uint8:r=s.visitUint8||s.visitInt;break;case B.Uint16:r=s.visitUint16||s.visitInt;break;case B.Uint32:r=s.visitUint32||s.visitInt;break;case B.Uint64:r=s.visitUint64||s.visitInt;break;case B.Float:r=s.visitFloat;break;case B.Float16:r=s.visitFloat16||s.visitFloat;break;case B.Float32:r=s.visitFloat32||s.visitFloat;break;case B.Float64:r=s.visitFloat64||s.visitFloat;break;case B.Utf8:r=s.visitUtf8;break;case B.Binary:r=s.visitBinary;break;case B.FixedSizeBinary:r=s.visitFixedSizeBinary;break;case B.Date:r=s.visitDate;break;case B.DateDay:r=s.visitDateDay||s.visitDate;break;case B.DateMillisecond:r=s.visitDateMillisecond||s.visitDate;break;case B.Timestamp:r=s.visitTimestamp;break;case B.TimestampSecond:r=s.visitTimestampSecond||s.visitTimestamp;break;case B.TimestampMillisecond:r=s.visitTimestampMillisecond||s.visitTimestamp;break;case B.TimestampMicrosecond:r=s.visitTimestampMicrosecond||s.visitTimestamp;break;case B.TimestampNanosecond:r=s.visitTimestampNanosecond||s.visitTimestamp;break;case B.Time:r=s.visitTime;break;case B.TimeSecond:r=s.visitTimeSecond||s.visitTime;break;case B.TimeMillisecond:r=s.visitTimeMillisecond||s.visitTime;break;case B.TimeMicrosecond:r=s.visitTimeMicrosecond||s.visitTime;break;case B.TimeNanosecond:r=s.visitTimeNanosecond||s.visitTime;break;case B.Decimal:r=s.visitDecimal;break;case B.List:r=s.visitList;break;case B.Struct:r=s.visitStruct;break;case B.Union:r=s.visitUnion;break;case B.DenseUnion:r=s.visitDenseUnion||s.visitUnion;break;case B.SparseUnion:r=s.visitSparseUnion||s.visitUnion;break;case B.Dictionary:r=s.visitDictionary;break;case B.Interval:r=s.visitInterval;break;case B.IntervalDayTime:r=s.visitIntervalDayTime||s.visitInterval;break;case B.IntervalYearMonth:r=s.visitIntervalYearMonth||s.visitInterval;break;case B.FixedSizeList:r=s.visitFixedSizeList;break;case B.Map:r=s.visitMap;break}if(typeof r=="function")return r;if(!e)return()=>null;throw new Error(`Unrecognized type '${B[t]}'`)}function hv(s){switch(s.typeId){case B.Null:return B.Null;case B.Int:{const{bitWidth:t,isSigned:e}=s;switch(t){case 8:return e?B.Int8:B.Uint8;case 16:return e?B.Int16:B.Uint16;case 32:return e?B.Int32:B.Uint32;case 64:return e?B.Int64:B.Uint64}return B.Int}case B.Float:switch(s.precision){case nn.HALF:return B.Float16;case nn.SINGLE:return B.Float32;case nn.DOUBLE:return B.Float64}return B.Float;case B.Binary:return B.Binary;case B.Utf8:return B.Utf8;case B.Bool:return B.Bool;case B.Decimal:return B.Decimal;case B.Time:switch(s.unit){case kt.SECOND:return B.TimeSecond;case kt.MILLISECOND:return B.TimeMillisecond;case kt.MICROSECOND:return B.TimeMicrosecond;case kt.NANOSECOND:return B.TimeNanosecond}return B.Time;case B.Timestamp:switch(s.unit){case kt.SECOND:return B.TimestampSecond;case kt.MILLISECOND:return B.TimestampMillisecond;case kt.MICROSECOND:return B.TimestampMicrosecond;case kt.NANOSECOND:return B.TimestampNanosecond}return B.Timestamp;case B.Date:switch(s.unit){case Yi.DAY:return B.DateDay;case Yi.MILLISECOND:return B.DateMillisecond}return B.Date;case B.Interval:switch(s.unit){case Ns.DAY_TIME:return B.IntervalDayTime;case Ns.YEAR_MONTH:return B.IntervalYearMonth}return B.Interval;case B.Map:return B.Map;case B.List:return B.List;case B.Struct:return B.Struct;case B.Union:switch(s.mode){case wn.Dense:return B.DenseUnion;case wn.Sparse:return B.SparseUnion}return B.Union;case B.FixedSizeBinary:return B.FixedSizeBinary;case B.FixedSizeList:return B.FixedSizeList;case B.Dictionary:return B.Dictionary}throw new Error(`Unrecognized type '${B[s.typeId]}'`)}zt.prototype.visitInt8=null;zt.prototype.visitInt16=null;zt.prototype.visitInt32=null;zt.prototype.visitInt64=null;zt.prototype.visitUint8=null;zt.prototype.visitUint16=null;zt.prototype.visitUint32=null;zt.prototype.visitUint64=null;zt.prototype.visitFloat16=null;zt.prototype.visitFloat32=null;zt.prototype.visitFloat64=null;zt.prototype.visitDateDay=null;zt.prototype.visitDateMillisecond=null;zt.prototype.visitTimestampSecond=null;zt.prototype.visitTimestampMillisecond=null;zt.prototype.visitTimestampMicrosecond=null;zt.prototype.visitTimestampNanosecond=null;zt.prototype.visitTimeSecond=null;zt.prototype.visitTimeMillisecond=null;zt.prototype.visitTimeMicrosecond=null;zt.prototype.visitTimeNanosecond=null;zt.prototype.visitDenseUnion=null;zt.prototype.visitSparseUnion=null;zt.prototype.visitIntervalDayTime=null;zt.prototype.visitIntervalYearMonth=null;const Fb=new Float64Array(1),ha=new Uint32Array(Fb.buffer);function jb(s){const t=(s&31744)>>10,e=(s&1023)/1024,r=Math.pow(-1,(s&32768)>>15);switch(t){case 31:return r*(e?Number.NaN:1/0);case 0:return r*(e?6103515625e-14*e:0)}return r*Math.pow(2,t-15)*(1+e)}function Z3(s){if(s!==s)return 32256;Fb[0]=s;const t=(ha[1]&2147483648)>>16&65535;let e=ha[1]&2146435072,r=0;return e>=1089470464?ha[0]>0?e=31744:(e=(e&2080374784)>>16,r=(ha[1]&1048575)>>10):e<=1056964608?(r=1048576+(ha[1]&1048575),r=1048576+(r<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,r=(ha[1]&1048575)+512>>10),t|e|r&65535}class bt extends zt{}function wt(s){return(t,e,r)=>{if(t.setValid(e,r!=null))return s(t,e,r)}}const K3=(s,t,e)=>{s[t]=Math.trunc(e/864e5)},Ep=(s,t,e)=>{s[t]=Math.trunc(e%4294967296),s[t+1]=Math.trunc(e/4294967296)},J3=(s,t,e)=>{s[t]=Math.trunc(e*1e3%4294967296),s[t+1]=Math.trunc(e*1e3/4294967296)},tw=(s,t,e)=>{s[t]=Math.trunc(e*1e6%4294967296),s[t+1]=Math.trunc(e*1e6/4294967296)},Hb=(s,t,e,r)=>{if(e+1<t.length){const{[e]:l,[e+1]:u}=t;s.set(r.subarray(0,u-l),l)}},ew=({offset:s,values:t},e,r)=>{const l=s+e;r?t[l>>3]|=1<<l%8:t[l>>3]&=~(1<<l%8)},Qi=({values:s},t,e)=>{s[t]=e},Tp=({values:s},t,e)=>{s[t]=e},kb=({values:s},t,e)=>{s[t]=Z3(e)},nw=(s,t,e)=>{switch(s.type.precision){case nn.HALF:return kb(s,t,e);case nn.SINGLE:case nn.DOUBLE:return Tp(s,t,e)}},Vb=({values:s},t,e)=>{K3(s,t,e.valueOf())},qb=({values:s},t,e)=>{Ep(s,t*2,e.valueOf())},iw=({stride:s,values:t},e,r)=>{t.set(r.subarray(0,s),s*e)},sw=({values:s,valueOffsets:t},e,r)=>Hb(s,t,e,r),rw=({values:s,valueOffsets:t},e,r)=>{Hb(s,t,e,bp(r))},aw=(s,t,e)=>{s.type.unit===Yi.DAY?Vb(s,t,e):qb(s,t,e)},Yb=({values:s},t,e)=>Ep(s,t*2,e/1e3),Qb=({values:s},t,e)=>Ep(s,t*2,e),Gb=({values:s},t,e)=>J3(s,t*2,e),Xb=({values:s},t,e)=>tw(s,t*2,e),ow=(s,t,e)=>{switch(s.type.unit){case kt.SECOND:return Yb(s,t,e);case kt.MILLISECOND:return Qb(s,t,e);case kt.MICROSECOND:return Gb(s,t,e);case kt.NANOSECOND:return Xb(s,t,e)}},Wb=({values:s},t,e)=>{s[t]=e},Pb=({values:s},t,e)=>{s[t]=e},$b=({values:s},t,e)=>{s[t]=e},Zb=({values:s},t,e)=>{s[t]=e},lw=(s,t,e)=>{switch(s.type.unit){case kt.SECOND:return Wb(s,t,e);case kt.MILLISECOND:return Pb(s,t,e);case kt.MICROSECOND:return $b(s,t,e);case kt.NANOSECOND:return Zb(s,t,e)}},uw=({values:s,stride:t},e,r)=>{s.set(r.subarray(0,t),t*e)},cw=(s,t,e)=>{const r=s.children[0],l=s.valueOffsets,u=Fn.getVisitFn(r);if(Array.isArray(e))for(let h=-1,d=l[t],y=l[t+1];d<y;)u(r,d++,e[++h]);else for(let h=-1,d=l[t],y=l[t+1];d<y;)u(r,d++,e.get(++h))},hw=(s,t,e)=>{const r=s.children[0],{valueOffsets:l}=s,u=Fn.getVisitFn(r);let{[t]:h,[t+1]:d}=l;const y=e instanceof Map?e.entries():Object.entries(e);for(const p of y)if(u(r,h,p),++h>=d)break},fw=(s,t)=>(e,r,l,u)=>r&&e(r,s,t[u]),dw=(s,t)=>(e,r,l,u)=>r&&e(r,s,t.get(u)),pw=(s,t)=>(e,r,l,u)=>r&&e(r,s,t.get(l.name)),yw=(s,t)=>(e,r,l,u)=>r&&e(r,s,t[l.name]),mw=(s,t,e)=>{const r=s.type.children.map(u=>Fn.getVisitFn(u.type)),l=e instanceof Map?pw(t,e):e instanceof Yt?dw(t,e):Array.isArray(e)?fw(t,e):yw(t,e);s.type.children.forEach((u,h)=>l(r[h],s.children[h],u,h))},gw=(s,t,e)=>{s.type.mode===wn.Dense?Kb(s,t,e):Jb(s,t,e)},Kb=(s,t,e)=>{const r=s.type.typeIdToChildIndex[s.typeIds[t]],l=s.children[r];Fn.visit(l,s.valueOffsets[t],e)},Jb=(s,t,e)=>{const r=s.type.typeIdToChildIndex[s.typeIds[t]],l=s.children[r];Fn.visit(l,t,e)},vw=(s,t,e)=>{var r;(r=s.dictionary)===null||r===void 0||r.set(s.values[t],e)},bw=(s,t,e)=>{s.type.unit===Ns.DAY_TIME?t1(s,t,e):e1(s,t,e)},t1=({values:s},t,e)=>{s.set(e.subarray(0,2),2*t)},e1=({values:s},t,e)=>{s[t]=e[0]*12+e[1]%12},Sw=(s,t,e)=>{const{stride:r}=s,l=s.children[0],u=Fn.getVisitFn(l);if(Array.isArray(e))for(let h=-1,d=t*r;++h<r;)u(l,d+h,e[h]);else for(let h=-1,d=t*r;++h<r;)u(l,d+h,e.get(h))};bt.prototype.visitBool=wt(ew);bt.prototype.visitInt=wt(Qi);bt.prototype.visitInt8=wt(Qi);bt.prototype.visitInt16=wt(Qi);bt.prototype.visitInt32=wt(Qi);bt.prototype.visitInt64=wt(Qi);bt.prototype.visitUint8=wt(Qi);bt.prototype.visitUint16=wt(Qi);bt.prototype.visitUint32=wt(Qi);bt.prototype.visitUint64=wt(Qi);bt.prototype.visitFloat=wt(nw);bt.prototype.visitFloat16=wt(kb);bt.prototype.visitFloat32=wt(Tp);bt.prototype.visitFloat64=wt(Tp);bt.prototype.visitUtf8=wt(rw);bt.prototype.visitBinary=wt(sw);bt.prototype.visitFixedSizeBinary=wt(iw);bt.prototype.visitDate=wt(aw);bt.prototype.visitDateDay=wt(Vb);bt.prototype.visitDateMillisecond=wt(qb);bt.prototype.visitTimestamp=wt(ow);bt.prototype.visitTimestampSecond=wt(Yb);bt.prototype.visitTimestampMillisecond=wt(Qb);bt.prototype.visitTimestampMicrosecond=wt(Gb);bt.prototype.visitTimestampNanosecond=wt(Xb);bt.prototype.visitTime=wt(lw);bt.prototype.visitTimeSecond=wt(Wb);bt.prototype.visitTimeMillisecond=wt(Pb);bt.prototype.visitTimeMicrosecond=wt($b);bt.prototype.visitTimeNanosecond=wt(Zb);bt.prototype.visitDecimal=wt(uw);bt.prototype.visitList=wt(cw);bt.prototype.visitStruct=wt(mw);bt.prototype.visitUnion=wt(gw);bt.prototype.visitDenseUnion=wt(Kb);bt.prototype.visitSparseUnion=wt(Jb);bt.prototype.visitDictionary=wt(vw);bt.prototype.visitInterval=wt(bw);bt.prototype.visitIntervalDayTime=wt(t1);bt.prototype.visitIntervalYearMonth=wt(e1);bt.prototype.visitFixedSizeList=wt(Sw);bt.prototype.visitMap=wt(hw);const Fn=new bt,Yn=Symbol.for("parent"),ba=Symbol.for("rowIndex");class xp{constructor(t,e){return this[Yn]=t,this[ba]=e,new Proxy(this,new ww)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[ba],e=this[Yn],r=e.type.children,l={};for(let u=-1,h=r.length;++u<h;)l[r[u].name]=rn.visit(e.children[u],t);return l}toString(){return`{${[...this].map(([t,e])=>`${il(t)}: ${il(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new _w(this[Yn],this[ba])}}class _w{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,rn.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(xp.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Yn]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ba]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class ww{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Yn].type.children.map(e=>e.name)}has(t,e){return t[Yn].type.children.findIndex(r=>r.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Yn].type.children.findIndex(r=>r.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const r=t[Yn].type.children.findIndex(l=>l.name===e);if(r!==-1){const l=rn.visit(t[Yn].children[r],t[ba]);return Reflect.set(t,e,l),l}}set(t,e,r){const l=t[Yn].type.children.findIndex(u=>u.name===e);return l!==-1?(Fn.visit(t[Yn].children[l],t[ba],r),Reflect.set(t,e,r)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,r):!1}}class yt extends zt{}function St(s){return(t,e)=>t.getValid(e)?s(t,e):null}const Aw=(s,t)=>864e5*s[t],Op=(s,t)=>4294967296*s[t+1]+(s[t]>>>0),Ew=(s,t)=>4294967296*(s[t+1]/1e3)+(s[t]>>>0)/1e3,Tw=(s,t)=>4294967296*(s[t+1]/1e6)+(s[t]>>>0)/1e6,n1=s=>new Date(s),xw=(s,t)=>n1(Aw(s,t)),Ow=(s,t)=>n1(Op(s,t)),Dw=(s,t)=>null,i1=(s,t,e)=>{if(e+1>=t.length)return null;const r=t[e],l=t[e+1];return s.subarray(r,l)},Mw=({offset:s,values:t},e)=>{const r=s+e;return(t[r>>3]&1<<r%8)!==0},s1=({values:s},t)=>xw(s,t),r1=({values:s},t)=>Ow(s,t*2),Fs=({stride:s,values:t},e)=>t[s*e],Rw=({stride:s,values:t},e)=>jb(t[s*e]),a1=({values:s},t)=>s[t],Cw=({stride:s,values:t},e)=>t.subarray(s*e,s*(e+1)),Bw=({values:s,valueOffsets:t},e)=>i1(s,t,e),Nw=({values:s,valueOffsets:t},e)=>{const r=i1(s,t,e);return r!==null?Hd(r):null},zw=({values:s},t)=>s[t],Lw=({type:s,values:t},e)=>s.precision!==nn.HALF?t[e]:jb(t[e]),Uw=(s,t)=>s.type.unit===Yi.DAY?s1(s,t):r1(s,t),o1=({values:s},t)=>1e3*Op(s,t*2),l1=({values:s},t)=>Op(s,t*2),u1=({values:s},t)=>Ew(s,t*2),c1=({values:s},t)=>Tw(s,t*2),Iw=(s,t)=>{switch(s.type.unit){case kt.SECOND:return o1(s,t);case kt.MILLISECOND:return l1(s,t);case kt.MICROSECOND:return u1(s,t);case kt.NANOSECOND:return c1(s,t)}},h1=({values:s},t)=>s[t],f1=({values:s},t)=>s[t],d1=({values:s},t)=>s[t],p1=({values:s},t)=>s[t],Fw=(s,t)=>{switch(s.type.unit){case kt.SECOND:return h1(s,t);case kt.MILLISECOND:return f1(s,t);case kt.MICROSECOND:return d1(s,t);case kt.NANOSECOND:return p1(s,t)}},jw=({values:s,stride:t},e)=>Ap.decimal(s.subarray(t*e,t*(e+1))),Hw=(s,t)=>{const{valueOffsets:e,stride:r,children:l}=s,{[t*r]:u,[t*r+1]:h}=e,y=l[0].slice(u,h-u);return new Yt([y])},kw=(s,t)=>{const{valueOffsets:e,children:r}=s,{[t]:l,[t+1]:u}=e,h=r[0];return new Dp(h.slice(l,u-l))},Vw=(s,t)=>new xp(s,t),qw=(s,t)=>s.type.mode===wn.Dense?y1(s,t):m1(s,t),y1=(s,t)=>{const e=s.type.typeIdToChildIndex[s.typeIds[t]],r=s.children[e];return rn.visit(r,s.valueOffsets[t])},m1=(s,t)=>{const e=s.type.typeIdToChildIndex[s.typeIds[t]],r=s.children[e];return rn.visit(r,t)},Yw=(s,t)=>{var e;return(e=s.dictionary)===null||e===void 0?void 0:e.get(s.values[t])},Qw=(s,t)=>s.type.unit===Ns.DAY_TIME?g1(s,t):v1(s,t),g1=({values:s},t)=>s.subarray(2*t,2*(t+1)),v1=({values:s},t)=>{const e=s[t],r=new Int32Array(2);return r[0]=Math.trunc(e/12),r[1]=Math.trunc(e%12),r},Gw=(s,t)=>{const{stride:e,children:r}=s,u=r[0].slice(t*e,e);return new Yt([u])};yt.prototype.visitNull=St(Dw);yt.prototype.visitBool=St(Mw);yt.prototype.visitInt=St(zw);yt.prototype.visitInt8=St(Fs);yt.prototype.visitInt16=St(Fs);yt.prototype.visitInt32=St(Fs);yt.prototype.visitInt64=St(a1);yt.prototype.visitUint8=St(Fs);yt.prototype.visitUint16=St(Fs);yt.prototype.visitUint32=St(Fs);yt.prototype.visitUint64=St(a1);yt.prototype.visitFloat=St(Lw);yt.prototype.visitFloat16=St(Rw);yt.prototype.visitFloat32=St(Fs);yt.prototype.visitFloat64=St(Fs);yt.prototype.visitUtf8=St(Nw);yt.prototype.visitBinary=St(Bw);yt.prototype.visitFixedSizeBinary=St(Cw);yt.prototype.visitDate=St(Uw);yt.prototype.visitDateDay=St(s1);yt.prototype.visitDateMillisecond=St(r1);yt.prototype.visitTimestamp=St(Iw);yt.prototype.visitTimestampSecond=St(o1);yt.prototype.visitTimestampMillisecond=St(l1);yt.prototype.visitTimestampMicrosecond=St(u1);yt.prototype.visitTimestampNanosecond=St(c1);yt.prototype.visitTime=St(Fw);yt.prototype.visitTimeSecond=St(h1);yt.prototype.visitTimeMillisecond=St(f1);yt.prototype.visitTimeMicrosecond=St(d1);yt.prototype.visitTimeNanosecond=St(p1);yt.prototype.visitDecimal=St(jw);yt.prototype.visitList=St(Hw);yt.prototype.visitStruct=St(Vw);yt.prototype.visitUnion=St(qw);yt.prototype.visitDenseUnion=St(y1);yt.prototype.visitSparseUnion=St(m1);yt.prototype.visitDictionary=St(Yw);yt.prototype.visitInterval=St(Qw);yt.prototype.visitIntervalDayTime=St(g1);yt.prototype.visitIntervalYearMonth=St(v1);yt.prototype.visitFixedSizeList=St(Gw);yt.prototype.visitMap=St(kw);const rn=new yt,oi=Symbol.for("keys"),Sa=Symbol.for("vals");class Dp{constructor(t){return this[oi]=new Yt([t.children[0]]).memoize(),this[Sa]=t.children[1],new Proxy(this,new Ww)}[Symbol.iterator](){return new Xw(this[oi],this[Sa])}get size(){return this[oi].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[oi],e=this[Sa],r={};for(let l=-1,u=t.length;++l<u;)r[t.get(l)]=rn.visit(e,l);return r}toString(){return`{${[...this].map(([t,e])=>`${il(t)}: ${il(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class Xw{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),rn.visit(this.vals,t)]})}}class Ww{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[oi].toArray().map(String)}has(t,e){return t[oi].includes(e)}getOwnPropertyDescriptor(t,e){if(t[oi].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const r=t[oi].indexOf(e);if(r!==-1){const l=rn.visit(Reflect.get(t,Sa),r);return Reflect.set(t,e,l),l}}set(t,e,r){const l=t[oi].indexOf(e);return l!==-1?(Fn.visit(Reflect.get(t,Sa),l,r),Reflect.set(t,e,r)):Reflect.has(t,e)?Reflect.set(t,e,r):!1}}Object.defineProperties(Dp.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[oi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Sa]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let fv;function b1(s,t,e,r){const{length:l=0}=s;let u=typeof t!="number"?0:t,h=typeof e!="number"?l:e;return u<0&&(u=(u%l+l)%l),h<0&&(h=(h%l+l)%l),h<u&&(fv=u,u=h,h=fv),h>l&&(h=l),r?r(s,u,h):[u,h]}const dv=s=>s!==s;function Ga(s){if(typeof s!=="object"||s===null)return dv(s)?dv:e=>e===s;if(s instanceof Date){const e=s.valueOf();return r=>r instanceof Date?r.valueOf()===e:!1}return ArrayBuffer.isView(s)?e=>e?k3(s,e):!1:s instanceof Map?$w(s):Array.isArray(s)?Pw(s):s instanceof Yt?Zw(s):Kw(s,!0)}function Pw(s){const t=[];for(let e=-1,r=s.length;++e<r;)t[e]=Ga(s[e]);return Vc(t)}function $w(s){let t=-1;const e=[];for(const r of s.values())e[++t]=Ga(r);return Vc(e)}function Zw(s){const t=[];for(let e=-1,r=s.length;++e<r;)t[e]=Ga(s.get(e));return Vc(t)}function Kw(s,t=!1){const e=Object.keys(s);if(!t&&e.length===0)return()=>!1;const r=[];for(let l=-1,u=e.length;++l<u;)r[l]=Ga(s[e[l]]);return Vc(r,e)}function Vc(s,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return Jw(s,e);case Map:return pv(s,e,e.keys());case Dp:case xp:case Object:case void 0:return pv(s,e,t||Object.keys(e))}return e instanceof Yt?t4(s,e):!1}}function Jw(s,t){const e=s.length;if(t.length!==e)return!1;for(let r=-1;++r<e;)if(!s[r](t[r]))return!1;return!0}function t4(s,t){const e=s.length;if(t.length!==e)return!1;for(let r=-1;++r<e;)if(!s[r](t.get(r)))return!1;return!0}function pv(s,t,e){const r=e[Symbol.iterator](),l=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),u=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let h=0;const d=s.length;let y=u.next(),p=r.next(),m=l.next();for(;h<d&&!p.done&&!m.done&&!y.done&&!(p.value!==m.value||!s[h](y.value));++h,p=r.next(),m=l.next(),y=u.next());return h===d&&p.done&&m.done&&y.done?!0:(r.return&&r.return(),l.return&&l.return(),u.return&&u.return(),!1)}function S1(s,t,e,r){return(e&1<<r)!==0}function e4(s,t,e,r){return(e&1<<r)>>r}function Mp(s,t,e){const r=e.byteLength+7&-8;if(s>0||e.byteLength<r){const l=new Uint8Array(r);return l.set(s%8===0?e.subarray(s>>3):gc(new Rp(e,s,t,null,S1)).subarray(0,r)),l}return e}function gc(s){const t=[];let e=0,r=0,l=0;for(const h of s)h&&(l|=1<<r),++r===8&&(t[e++]=l,l=r=0);(e===0||r>0)&&(t[e++]=l);const u=new Uint8Array(t.length+7&-8);return u.set(t),u}class Rp{constructor(t,e,r,l,u){this.bytes=t,this.length=r,this.context=l,this.get=u,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function Yd(s,t,e){if(e-t<=0)return 0;if(e-t<8){let u=0;for(const h of new Rp(s,t,e-t,s,e4))u+=h;return u}const r=e>>3<<3,l=t+(t%8===0?0:8-t%8);return Yd(s,t,l)+Yd(s,r,e)+n4(s,l>>3,r-l>>3)}function n4(s,t,e){let r=0,l=Math.trunc(t);const u=new DataView(s.buffer,s.byteOffset,s.byteLength),h=e===void 0?s.byteLength:l+e;for(;h-l>=4;)r+=Sd(u.getUint32(l)),l+=4;for(;h-l>=2;)r+=Sd(u.getUint16(l)),l+=2;for(;h-l>=1;)r+=Sd(u.getUint8(l)),l+=1;return r}function Sd(s){let t=Math.trunc(s);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const i4=-1;class se{constructor(t,e,r,l,u,h=[],d){this.type=t,this.children=h,this.dictionary=d,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(l||0,-1));let y;u instanceof se?(this.stride=u.stride,this.values=u.values,this.typeIds=u.typeIds,this.nullBitmap=u.nullBitmap,this.valueOffsets=u.valueOffsets):(this.stride=Ui(t),u&&((y=u[0])&&(this.valueOffsets=y),(y=u[1])&&(this.values=y),(y=u[2])&&(this.nullBitmap=y),(y=u[3])&&(this.typeIds=y))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0;const{valueOffsets:e,values:r,nullBitmap:l,typeIds:u}=this;return e&&(t+=e.byteLength),r&&(t+=r.byteLength),l&&(t+=l.byteLength),u&&(t+=u.byteLength),this.children.reduce((h,d)=>h+d.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=i4&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-Yd(e,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){const e=this.offset+t;return(this.nullBitmap[e>>3]&1<<e%8)!==0}return!0}setValid(t,e){if(!this.nullable)return e;if(!this.nullBitmap||this.nullBitmap.byteLength<=t>>3){const{nullBitmap:y}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:y,_nullCount:0})}const{nullBitmap:r,offset:l}=this,u=l+t>>3,h=(l+t)%8,d=r[u]>>h&1;return e?d===0&&(r[u]|=1<<h,this._nullCount=this.nullCount+1):d===1&&(r[u]&=~(1<<h),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,r=this.length,l=this._nullCount,u=this,h=this.children){return new se(t,e,r,l,u,h,this.dictionary)}slice(t,e){const{stride:r,typeId:l,children:u}=this,h=+(this._nullCount===0)-1,d=l===16?r:1,y=this._sliceBuffers(t,e,r,l);return this.clone(this.type,this.offset+t,e,h,y,u.length===0||this.valueOffsets?u:this._sliceChildren(u,d*t,d*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===B.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:r}=this,l=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);l[e>>3]=(1<<e-(e&-8))-1,r>0&&l.set(Mp(this.offset,e,this.nullBitmap),0);const u=this.buffers;return u[Li.VALIDITY]=l,this.clone(this.type,0,t,r+(t-e),u)}_sliceBuffers(t,e,r,l){let u;const{buffers:h}=this;return(u=h[Li.TYPE])&&(h[Li.TYPE]=u.subarray(t,t+e)),(u=h[Li.OFFSET])&&(h[Li.OFFSET]=u.subarray(t,t+e+1))||(u=h[Li.DATA])&&(h[Li.DATA]=l===6?u:u.subarray(r*t,r*(t+e))),h}_sliceChildren(t,e,r){return t.map(l=>l.slice(e,r))}}se.prototype.children=Object.freeze([]);class tl extends zt{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:r=0,["length"]:l=0}=t;return new se(e,r,l,0)}visitBool(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length>>3,["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitInt(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length,["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitFloat(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length,["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitUtf8(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.data),u=Ht(t.nullBitmap),h=Xo(t.valueOffsets),{["length"]:d=h.length-1,["nullCount"]:y=t.nullBitmap?-1:0}=t;return new se(e,r,d,y,[h,l,u])}visitBinary(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.data),u=Ht(t.nullBitmap),h=Xo(t.valueOffsets),{["length"]:d=h.length-1,["nullCount"]:y=t.nullBitmap?-1:0}=t;return new se(e,r,d,y,[h,l,u])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length/Ui(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitDate(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length/Ui(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitTimestamp(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length/Ui(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitTime(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length/Ui(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitDecimal(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length/Ui(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitList(t){const{["type"]:e,["offset"]:r=0,["child"]:l}=t,u=Ht(t.nullBitmap),h=Xo(t.valueOffsets),{["length"]:d=h.length-1,["nullCount"]:y=t.nullBitmap?-1:0}=t;return new se(e,r,d,y,[h,void 0,u],[l])}visitStruct(t){const{["type"]:e,["offset"]:r=0,["children"]:l=[]}=t,u=Ht(t.nullBitmap),{length:h=l.reduce((y,{length:p})=>Math.max(y,p),0),nullCount:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,void 0,u],l)}visitUnion(t){const{["type"]:e,["offset"]:r=0,["children"]:l=[]}=t,u=Ht(t.nullBitmap),h=ee(e.ArrayType,t.typeIds),{["length"]:d=h.length,["nullCount"]:y=t.nullBitmap?-1:0}=t;if(pt.isSparseUnion(e))return new se(e,r,d,y,[void 0,void 0,u,h],l);const p=Xo(t.valueOffsets);return new se(e,r,d,y,[p,void 0,u,h],l)}visitDictionary(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.indices.ArrayType,t.data),{["dictionary"]:h=new Yt([new tl().visit({type:e.dictionary})])}=t,{["length"]:d=u.length,["nullCount"]:y=t.nullBitmap?-1:0}=t;return new se(e,r,d,y,[void 0,u,l],[],h)}visitInterval(t){const{["type"]:e,["offset"]:r=0}=t,l=Ht(t.nullBitmap),u=ee(e.ArrayType,t.data),{["length"]:h=u.length/Ui(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,u,l])}visitFixedSizeList(t){const{["type"]:e,["offset"]:r=0,["child"]:l=new tl().visit({type:e.valueType})}=t,u=Ht(t.nullBitmap),{["length"]:h=l.length/Ui(e),["nullCount"]:d=t.nullBitmap?-1:0}=t;return new se(e,r,h,d,[void 0,void 0,u],[l])}visitMap(t){const{["type"]:e,["offset"]:r=0,["child"]:l=new tl().visit({type:e.childType})}=t,u=Ht(t.nullBitmap),h=Xo(t.valueOffsets),{["length"]:d=h.length-1,["nullCount"]:y=t.nullBitmap?-1:0}=t;return new se(e,r,d,y,[h,void 0,u],[l])}}function Nt(s){return new tl().visit(s)}class yv{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}function _1(s){return s.reduce((t,e)=>t+e.nullCount,0)}function w1(s){return s.reduce((t,e,r)=>(t[r+1]=t[r]+e.length,t),new Uint32Array(s.length+1))}function A1(s,t,e,r){const l=[];for(let u=-1,h=s.length;++u<h;){const d=s[u],y=t[u],{length:p}=d;if(y>=r)break;if(e>=y+p)continue;if(y>=e&&y+p<=r){l.push(d);continue}const m=Math.max(0,e-y),v=Math.min(r-y,p);l.push(d.slice(m,v-m))}return l.length===0&&l.push(s[0].slice(0,0)),l}function Cp(s,t,e,r){let l=0,u=0,h=t.length-1;do{if(l>=h-1)return e<t[h]?r(s,l,e-t[l]):null;u=l+Math.trunc((h-l)*.5),e<t[u]?h=u:l=u}while(l<h)}function Bp(s,t){return s.getValid(t)}function _a(s){function t(e,r,l){return s(e[r],l)}return function(e){const r=this.data;return Cp(r,this._offsets,e,t)}}function E1(s){let t;function e(r,l,u){return s(r[l],u,t)}return function(r,l){const u=this.data;t=l;const h=Cp(u,this._offsets,r,e);return t=void 0,h}}function T1(s){let t;function e(r,l,u){let h=u,d=0,y=0;for(let p=l-1,m=r.length;++p<m;){const v=r[p];if(~(d=s(v,t,h)))return y+d;h=0,y+=v.length}return-1}return function(r,l){t=r;const u=this.data,h=typeof l!="number"?e(u,0,0):Cp(u,this._offsets,l,e);return t=void 0,h}}class mt extends zt{}function s4(s,t){return t===null&&s.length>0?0:-1}function r4(s,t){const{nullBitmap:e}=s;if(!e||s.nullCount<=0)return-1;let r=0;for(const l of new Rp(e,s.offset+(t||0),s.length,e,S1)){if(!l)return r;++r}return-1}function Tt(s,t,e){if(t===void 0)return-1;if(t===null)return r4(s,e);const r=rn.getVisitFn(s),l=Ga(t);for(let u=(e||0)-1,h=s.length;++u<h;)if(l(r(s,u)))return u;return-1}function x1(s,t,e){const r=rn.getVisitFn(s),l=Ga(t);for(let u=(e||0)-1,h=s.length;++u<h;)if(l(r(s,u)))return u;return-1}mt.prototype.visitNull=s4;mt.prototype.visitBool=Tt;mt.prototype.visitInt=Tt;mt.prototype.visitInt8=Tt;mt.prototype.visitInt16=Tt;mt.prototype.visitInt32=Tt;mt.prototype.visitInt64=Tt;mt.prototype.visitUint8=Tt;mt.prototype.visitUint16=Tt;mt.prototype.visitUint32=Tt;mt.prototype.visitUint64=Tt;mt.prototype.visitFloat=Tt;mt.prototype.visitFloat16=Tt;mt.prototype.visitFloat32=Tt;mt.prototype.visitFloat64=Tt;mt.prototype.visitUtf8=Tt;mt.prototype.visitBinary=Tt;mt.prototype.visitFixedSizeBinary=Tt;mt.prototype.visitDate=Tt;mt.prototype.visitDateDay=Tt;mt.prototype.visitDateMillisecond=Tt;mt.prototype.visitTimestamp=Tt;mt.prototype.visitTimestampSecond=Tt;mt.prototype.visitTimestampMillisecond=Tt;mt.prototype.visitTimestampMicrosecond=Tt;mt.prototype.visitTimestampNanosecond=Tt;mt.prototype.visitTime=Tt;mt.prototype.visitTimeSecond=Tt;mt.prototype.visitTimeMillisecond=Tt;mt.prototype.visitTimeMicrosecond=Tt;mt.prototype.visitTimeNanosecond=Tt;mt.prototype.visitDecimal=Tt;mt.prototype.visitList=Tt;mt.prototype.visitStruct=Tt;mt.prototype.visitUnion=Tt;mt.prototype.visitDenseUnion=x1;mt.prototype.visitSparseUnion=x1;mt.prototype.visitDictionary=Tt;mt.prototype.visitInterval=Tt;mt.prototype.visitIntervalDayTime=Tt;mt.prototype.visitIntervalYearMonth=Tt;mt.prototype.visitFixedSizeList=Tt;mt.prototype.visitMap=Tt;const vc=new mt;class gt extends zt{}function _t(s){const{type:t}=s;if(s.nullCount===0&&s.stride===1&&(t.typeId===B.Timestamp||t instanceof Ls&&t.bitWidth!==64||t instanceof ol&&t.bitWidth!==64||t instanceof al&&t.precision!==nn.HALF))return new yv(s.data.length,r=>{const l=s.data[r];return l.values.subarray(0,l.length)[Symbol.iterator]()});let e=0;return new yv(s.data.length,r=>{const u=s.data[r].length,h=s.slice(e,e+u);return e+=u,new a4(h)})}class a4{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}}gt.prototype.visitNull=_t;gt.prototype.visitBool=_t;gt.prototype.visitInt=_t;gt.prototype.visitInt8=_t;gt.prototype.visitInt16=_t;gt.prototype.visitInt32=_t;gt.prototype.visitInt64=_t;gt.prototype.visitUint8=_t;gt.prototype.visitUint16=_t;gt.prototype.visitUint32=_t;gt.prototype.visitUint64=_t;gt.prototype.visitFloat=_t;gt.prototype.visitFloat16=_t;gt.prototype.visitFloat32=_t;gt.prototype.visitFloat64=_t;gt.prototype.visitUtf8=_t;gt.prototype.visitBinary=_t;gt.prototype.visitFixedSizeBinary=_t;gt.prototype.visitDate=_t;gt.prototype.visitDateDay=_t;gt.prototype.visitDateMillisecond=_t;gt.prototype.visitTimestamp=_t;gt.prototype.visitTimestampSecond=_t;gt.prototype.visitTimestampMillisecond=_t;gt.prototype.visitTimestampMicrosecond=_t;gt.prototype.visitTimestampNanosecond=_t;gt.prototype.visitTime=_t;gt.prototype.visitTimeSecond=_t;gt.prototype.visitTimeMillisecond=_t;gt.prototype.visitTimeMicrosecond=_t;gt.prototype.visitTimeNanosecond=_t;gt.prototype.visitDecimal=_t;gt.prototype.visitList=_t;gt.prototype.visitStruct=_t;gt.prototype.visitUnion=_t;gt.prototype.visitDenseUnion=_t;gt.prototype.visitSparseUnion=_t;gt.prototype.visitDictionary=_t;gt.prototype.visitInterval=_t;gt.prototype.visitIntervalDayTime=_t;gt.prototype.visitIntervalYearMonth=_t;gt.prototype.visitFixedSizeList=_t;gt.prototype.visitMap=_t;const Np=new gt,o4=(s,t)=>s+t;class js extends zt{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===kt.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((r,l)=>r+mi.visit(l,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((r,l)=>r+mi.visit(l,e),0)}visitDictionary(t,e){var r;return t.type.indices.bitWidth/8+(((r=t.dictionary)===null||r===void 0?void 0:r.getByteLength(t.values[e]))||0)}}const l4=({valueOffsets:s},t)=>8+(s[t+1]-s[t]),u4=({valueOffsets:s},t)=>8+(s[t+1]-s[t]),c4=({valueOffsets:s,stride:t,children:e},r)=>{const l=e[0],{[r*t]:u}=s,{[r*t+1]:h}=s,d=mi.getVisitFn(l.type),y=l.slice(u,h-u);let p=8;for(let m=-1,v=h-u;++m<v;)p+=d(y,m);return p},h4=({stride:s,children:t},e)=>{const r=t[0],l=r.slice(e*s,s),u=mi.getVisitFn(r.type);let h=0;for(let d=-1,y=l.length;++d<y;)h+=u(l,d);return h},f4=(s,t)=>s.type.mode===wn.Dense?O1(s,t):D1(s,t),O1=({type:s,children:t,typeIds:e,valueOffsets:r},l)=>{const u=s.typeIdToChildIndex[e[l]];return 8+mi.visit(t[u],r[l])},D1=({children:s},t)=>4+mi.visitMany(s,s.map(()=>t)).reduce(o4,0);js.prototype.visitUtf8=l4;js.prototype.visitBinary=u4;js.prototype.visitList=c4;js.prototype.visitFixedSizeList=h4;js.prototype.visitUnion=f4;js.prototype.visitDenseUnion=O1;js.prototype.visitSparseUnion=D1;const mi=new js;var M1;const R1={},C1={};class Yt{constructor(t){var e,r,l;const u=t[0]instanceof Yt?t.flatMap(d=>d.data):t;if(u.length===0||u.some(d=>!(d instanceof se)))throw new TypeError("Vector constructor expects an Array of Data instances.");const h=(e=u[0])===null||e===void 0?void 0:e.type;switch(u.length){case 0:this._offsets=[0];break;case 1:{const{get:d,set:y,indexOf:p,byteLength:m}=R1[h.typeId],v=u[0];this.isValid=S=>Bp(v,S),this.get=S=>d(v,S),this.set=(S,_)=>y(v,S,_),this.indexOf=S=>p(v,S),this.getByteLength=S=>m(v,S),this._offsets=[0,v.length];break}default:Object.setPrototypeOf(this,C1[h.typeId]),this._offsets=w1(u);break}this.data=u,this.type=h,this.stride=Ui(h),this.numChildren=(l=(r=h.children)===null||r===void 0?void 0:r.length)!==null&&l!==void 0?l:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,e)=>t+e.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=_1(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${B[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>0}getByteLength(t){return 0}[Symbol.iterator](){return Np.visit(this)}concat(...t){return new Yt(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Yt(b1(this,t,e,({data:r,_offsets:l},u,h)=>A1(r,l,u,h)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:r,stride:l,ArrayType:u}=this;switch(t.typeId){case B.Int:case B.Float:case B.Decimal:case B.Time:case B.Timestamp:switch(e.length){case 0:return new u;case 1:return e[0].values.subarray(0,r*l);default:return e.reduce((h,{values:d,length:y})=>(h.array.set(d.subarray(0,y*l),h.offset),h.offset+=y*l,h),{array:new u(r*l),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new Yt(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return pt.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(pt.isDictionary(this.type)){const t=new bc(this.data[0].dictionary),e=this.data.map(r=>{const l=r.clone();return l.dictionary=t,l});return new Yt(e)}return new bc(this)}unmemoize(){if(pt.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(r=>{const l=r.clone();return l.dictionary=t,l});return new Yt(e)}return this}}M1=Symbol.toStringTag;Yt[M1]=(s=>{s.type=pt.prototype,s.data=[],s.length=0,s.stride=1,s.numChildren=0,s._nullCount=-1,s._byteLength=-1,s._offsets=new Uint32Array([0]),s[Symbol.isConcatSpreadable]=!0;const t=Object.keys(B).map(e=>B[e]).filter(e=>typeof e=="number"&&e!==B.NONE);for(const e of t){const r=rn.getVisitFnByTypeId(e),l=Fn.getVisitFnByTypeId(e),u=vc.getVisitFnByTypeId(e),h=mi.getVisitFnByTypeId(e);R1[e]={get:r,set:l,indexOf:u,byteLength:h},C1[e]=Object.create(s,{isValid:{value:_a(Bp)},get:{value:_a(rn.getVisitFnByTypeId(e))},set:{value:E1(Fn.getVisitFnByTypeId(e))},indexOf:{value:T1(vc.getVisitFnByTypeId(e))},getByteLength:{value:_a(mi.getVisitFnByTypeId(e))}})}return"Vector"})(Yt.prototype);class bc extends Yt{constructor(t){super(t.data);const e=this.get,r=this.set,l=this.slice,u=new Array(this.length);Object.defineProperty(this,"get",{value(h){const d=u[h];if(d!==void 0)return d;const y=e.call(this,h);return u[h]=y,y}}),Object.defineProperty(this,"set",{value(h,d){r.call(this,h,d),u[h]=d}}),Object.defineProperty(this,"slice",{value:(h,d)=>new bc(l.call(this,h,d))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Yt(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class Qd{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,e,r,l){return t.prep(8,24),t.writeInt64(l),t.pad(4),t.writeInt32(r),t.writeInt64(e),t.offset()}}const _d=2,li=4,Hi=4,ne=4,Ss=new Int32Array(2),mv=new Float32Array(Ss.buffer),gv=new Float64Array(Ss.buffer),Qu=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;let Vi=class Gd{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Gd.ZERO:new Gd(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};Vi.ZERO=new Vi(0,0);var Xd;(function(s){s[s.UTF8_BYTES=1]="UTF8_BYTES",s[s.UTF16_STRING=2]="UTF16_STRING"})(Xd||(Xd={}));let Ia=class B1{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new B1(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new Vi(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new Vi(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return Ss[0]=this.readInt32(t),mv[0]}readFloat64(t){return Ss[Qu?0:1]=this.readInt32(t),Ss[Qu?1:0]=this.readInt32(t+4),gv[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){mv[0]=e,this.writeInt32(t,Ss[0])}writeFloat64(t,e){gv[0]=e,this.writeInt32(t,Ss[Qu?0:1]),this.writeInt32(t+4,Ss[Qu?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+li+Hi)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<Hi;e++)t+=String.fromCharCode(this.readInt8(this.position_+li+e));return t}__offset(t,e){const r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const r=this.readInt32(t);let l="",u=0;if(t+=li,e===Xd.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;u<r;){let h;const d=this.readUint8(t+u++);if(d<192)h=d;else{const y=this.readUint8(t+u++);if(d<224)h=(d&31)<<6|y&63;else{const p=this.readUint8(t+u++);if(d<240)h=(d&15)<<12|(y&63)<<6|p&63;else{const m=this.readUint8(t+u++);h=(d&7)<<18|(y&63)<<12|(p&63)<<6|m&63}}}h<65536?l+=String.fromCharCode(h):(h-=65536,l+=String.fromCharCode((h>>10)+55296,(h&1023)+56320))}return l}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+li}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=Hi)throw new Error("FlatBuffers: file identifier must be length "+Hi);for(let e=0;e<Hi;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+li+e))return!1;return!0}createLong(t,e){return Vi.create(t,e)}createScalarList(t,e){const r=[];for(let l=0;l<e;++l)t(l)!==null&&r.push(t(l));return r}createObjList(t,e){const r=[];for(let l=0;l<e;++l){const u=t(l);u!==null&&r.push(u.unpack())}return r}},N1=class z1{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let e;t?e=t:e=1024,this.bb=Ia.allocate(e),this.space=e}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);const r=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<r+t+e;){const l=this.bb.capacity();this.bb=z1.growByteBuffer(this.bb),this.space+=this.bb.capacity()-l}this.pad(r)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,r){(this.force_defaults||!e.equals(r))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,r){e!=r&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const r=e<<1,l=Ia.allocate(r);return l.setPosition(r-e),l.bytes().set(t.bytes(),r-e),l}addOffset(t){this.prep(li,0),this.writeInt32(this.offset()-t+li)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const r=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const l=2;this.addInt16(t-this.object_start);const u=(r+l)*_d;this.addInt16(u);let h=0;const d=this.space;t:for(e=0;e<this.vtables.length;e++){const y=this.bb.capacity()-this.vtables[e];if(u==this.bb.readInt16(y)){for(let p=_d;p<u;p+=_d)if(this.bb.readInt16(d+p)!=this.bb.readInt16(y+p))continue t;h=this.vtables[e];break}}return h?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,h-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,r){const l=r?ne:0;if(e){const u=e;if(this.prep(this.minalign,li+Hi+l),u.length!=Hi)throw new Error("FlatBuffers: file identifier must be length "+Hi);for(let h=Hi-1;h>=0;h--)this.writeInt8(u.charCodeAt(h))}this.prep(this.minalign,li+l),this.addOffset(t),l&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const r=this.bb.capacity()-t,l=r-this.bb.readInt32(r);if(!(this.bb.readInt16(l+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(li,t*e),this.prep(r,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(!t)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let r=0;for(;r<t.length;){let l;const u=t.charCodeAt(r++);if(u<55296||u>=56320)l=u;else{const h=t.charCodeAt(r++);l=(u<<10)+h+-56613888}l<128?e.push(l):(l<2048?e.push(l>>6&31|192):(l<65536?e.push(l>>12&15|224):e.push(l>>18&7|240,l>>12&63|128),e.push(l>>6&63|128)),e.push(l&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let r=0,l=this.space,u=this.bb.bytes();r<e.length;r++)u[l++]=e[r];return this.endVector()}createLong(t,e){return Vi.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let r=0;r<t.length;++r){const l=t[r];if(l!==null)e.push(this.createObjectOffset(l));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}};class Ae{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,e){return(e||new Ae).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+ne),(e||new Ae).__init(t.readInt32(t.position())+t.position(),t)}key(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,e,r){return Ae.startKeyValue(t),Ae.addKey(t,e),Ae.addValue(t,r),Ae.endKeyValue(t)}}var Fa;(function(s){s[s.V1=0]="V1",s[s.V2=1]="V2",s[s.V3=2]="V3",s[s.V4=3]="V4",s[s.V5=4]="V5"})(Fa||(Fa={}));var ja;(function(s){s[s.Little=0]="Little",s[s.Big=1]="Big"})(ja||(ja={}));var Sc;(function(s){s[s.DenseArray=0]="DenseArray"})(Sc||(Sc={}));class Sn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,e){return(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+ne),(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt32(0,e,0)}static addIsSigned(t,e){t.addFieldInt8(1,+e,0)}static endInt(t){return t.endObject()}static createInt(t,e,r){return Sn.startInt(t),Sn.addBitWidth(t,e),Sn.addIsSigned(t,r),Sn.endInt(t)}}class ki{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new ki).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+ne),(e||new ki).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}indexType(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Sn).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Sc.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,Sc.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}class ar{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,e){return(e||new ar).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+ne),(e||new ar).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return ar.startBinary(t),ar.endBinary(t)}}class or{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,e){return(e||new or).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+ne),(e||new or).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return or.startBool(t),or.endBool(t)}}var _c;(function(s){s[s.DAY=0]="DAY",s[s.MILLISECOND=1]="MILLISECOND"})(_c||(_c={}));let Ku=class da{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new da).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+ne),(e||new da).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):_c.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,_c.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return da.startDate(t),da.addUnit(t,e),da.endDate(t)}};class Je{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,e){return(e||new Je).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+ne),(e||new Je).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static addBitWidth(t,e){t.addFieldInt32(2,e,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,e,r,l){return Je.startDecimal(t),Je.addPrecision(t,e),Je.addScale(t,r),Je.addBitWidth(t,l),Je.endDecimal(t)}}var Ha;(function(s){s[s.SECOND=0]="SECOND",s[s.MILLISECOND=1]="MILLISECOND",s[s.MICROSECOND=2]="MICROSECOND",s[s.NANOSECOND=3]="NANOSECOND"})(Ha||(Ha={}));class ui{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,e){return(e||new ui).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+ne),(e||new ui).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,e){return ui.startFixedSizeBinary(t),ui.addByteWidth(t,e),ui.endFixedSizeBinary(t)}}class ci{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,e){return(e||new ci).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+ne),(e||new ci).__init(t.readInt32(t.position())+t.position(),t)}listSize(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,e){return ci.startFixedSizeList(t),ci.addListSize(t,e),ci.endFixedSizeList(t)}}var wc;(function(s){s[s.HALF=0]="HALF",s[s.SINGLE=1]="SINGLE",s[s.DOUBLE=2]="DOUBLE"})(wc||(wc={}));class hi{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new hi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+ne),(e||new hi).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):wc.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,wc.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return hi.startFloatingPoint(t),hi.addPrecision(t,e),hi.endFloatingPoint(t)}}var Ac;(function(s){s[s.YEAR_MONTH=0]="YEAR_MONTH",s[s.DAY_TIME=1]="DAY_TIME",s[s.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ac||(Ac={}));class fi{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new fi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+ne),(e||new fi).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ac.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Ac.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return fi.startInterval(t),fi.addUnit(t,e),fi.endInterval(t)}}class lr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,e){return(e||new lr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+ne),(e||new lr).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return lr.startList(t),lr.endList(t)}}let Ju=class pa{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,e){return(e||new pa).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+ne),(e||new pa).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){const t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}static createMap(t,e){return pa.startMap(t),pa.addKeysSorted(t,e),pa.endMap(t)}};class ur{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,e){return(e||new ur).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+ne),(e||new ur).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return ur.startNull(t),ur.endNull(t)}}class cr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,e){return(e||new cr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+ne),(e||new cr).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return cr.startStruct_(t),cr.endStruct_(t)}}class Un{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new Un).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+ne),(e||new Un).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ha.MILLISECOND}bitWidth(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,Ha.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,r){return Un.startTime(t),Un.addUnit(t,e),Un.addBitWidth(t,r),Un.endTime(t)}}class In{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new In).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+ne),(e||new In).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ha.SECOND}timezone(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,Ha.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,r){return In.startTimestamp(t),In.addUnit(t,e),In.addTimezone(t,r),In.endTimestamp(t)}}var Ec;(function(s){s[s.Sparse=0]="Sparse",s[s.Dense=1]="Dense"})(Ec||(Ec={}));class tn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new tn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+ne),(e||new tn).__init(t.readInt32(t.position())+t.position(),t)}mode(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ec.Sparse}typeIds(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+t*4):0}typeIdsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){const t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,e){t.addFieldInt16(0,e,Ec.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,r){return tn.startUnion(t),tn.addMode(t,e),tn.addTypeIds(t,r),tn.endUnion(t)}}class hr{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new hr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+ne),(e||new hr).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return hr.startUtf8(t),hr.endUtf8(t)}}var ce;(function(s){s[s.NONE=0]="NONE",s[s.Null=1]="Null",s[s.Int=2]="Int",s[s.FloatingPoint=3]="FloatingPoint",s[s.Binary=4]="Binary",s[s.Utf8=5]="Utf8",s[s.Bool=6]="Bool",s[s.Decimal=7]="Decimal",s[s.Date=8]="Date",s[s.Time=9]="Time",s[s.Timestamp=10]="Timestamp",s[s.Interval=11]="Interval",s[s.List=12]="List",s[s.Struct_=13]="Struct_",s[s.Union=14]="Union",s[s.FixedSizeBinary=15]="FixedSizeBinary",s[s.FixedSizeList=16]="FixedSizeList",s[s.Map=17]="Map",s[s.Duration=18]="Duration",s[s.LargeBinary=19]="LargeBinary",s[s.LargeUtf8=20]="LargeUtf8",s[s.LargeList=21]="LargeList"})(ce||(ce={}));let Nn=class tc{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new tc).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+ne),(e||new tc).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):ce.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new ki).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const r=this.bb.__offset(this.bb_pos,14);return r?(e||new tc).__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,e){const r=this.bb.__offset(this.bb_pos,16);return r?(e||new Ae).__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,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,ce.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},ei=class Ni{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new Ni).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+ne),(e||new Ni).__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):ja.Little}fields(t,e){const r=this.bb.__offset(this.bb_pos,6);return r?(e||new Nn).__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,e){const r=this.bb.__offset(this.bb_pos,8);return r?(e||new Ae).__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 e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):this.bb.createLong(0,0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,ja.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,r,l,u){return Ni.startSchema(t),Ni.addEndianness(t,e),Ni.addFields(t,r),Ni.addCustomMetadata(t,l),Ni.addFeatures(t,u),Ni.endSchema(t)}};class bn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new bn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+ne),(e||new bn).__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):Fa.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new ei).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const r=this.bb.__offset(this.bb_pos,8);return r?(e||new Qd).__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,e){const r=this.bb.__offset(this.bb_pos,10);return r?(e||new Qd).__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,e){const r=this.bb.__offset(this.bb_pos,12);return r?(e||new Ae).__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,e){t.addFieldInt16(0,e,Fa.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}class Qt{constructor(t=[],e,r){this.fields=t||[],this.metadata=e||new Map,r||(r=Wd(t)),this.dictionaries=r}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){const e=new Set(t),r=this.fields.filter(l=>e.has(l.name));return new Qt(r,this.metadata)}selectAt(t){const e=t.map(r=>this.fields[r]).filter(Boolean);return new Qt(e,this.metadata)}assign(...t){const e=t[0]instanceof Qt?t[0]:Array.isArray(t[0])?new Qt(t[0]):new Qt(t),r=[...this.fields],l=Gu(Gu(new Map,this.metadata),e.metadata),u=e.fields.filter(d=>{const y=r.findIndex(p=>p.name===d.name);return~y?(r[y]=d.clone({metadata:Gu(Gu(new Map,r[y].metadata),d.metadata)}))&&!1:!0}),h=Wd(u,new Map);return new Qt([...r,...u],l,new Map([...this.dictionaries,...h]))}}Qt.prototype.fields=null;Qt.prototype.metadata=null;Qt.prototype.dictionaries=null;class ae{constructor(t,e,r=!1,l){this.name=t,this.type=e,this.nullable=r,this.metadata=l||new Map}static new(...t){let[e,r,l,u]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],r===void 0&&(r=t[0].type),l===void 0&&(l=t[0].nullable),u===void 0&&(u=t[0].metadata)),new ae(`${e}`,r,l,u)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,r,l,u]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,r=this.type,l=this.nullable,u=this.metadata]=t:{name:e=this.name,type:r=this.type,nullable:l=this.nullable,metadata:u=this.metadata}=t[0],ae.new(e,r,l,u)}}ae.prototype.type=null;ae.prototype.name=null;ae.prototype.nullable=null;ae.prototype.metadata=null;function Gu(s,t){return new Map([...s||new Map,...t||new Map])}function Wd(s,t=new Map){for(let e=-1,r=s.length;++e<r;){const u=s[e].type;if(pt.isDictionary(u)){if(!t.has(u.id))t.set(u.id,u.dictionary);else if(t.get(u.id)!==u.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}u.children&&u.children.length>0&&Wd(u.children,t)}return t}var vv=Vi,d4=N1,p4=Ia;class ll{constructor(t,e=_n.V4,r,l){this.schema=t,this.version=e,r&&(this._recordBatches=r),l&&(this._dictionaryBatches=l)}static decode(t){t=new p4(Ht(t));const e=bn.getRootAsFooter(t),r=Qt.decode(e.schema());return new y4(r,e)}static encode(t){const e=new d4,r=Qt.encode(e,t.schema);bn.startRecordBatchesVector(e,t.numRecordBatches);for(const h of[...t.recordBatches()].slice().reverse())Us.encode(e,h);const l=e.endVector();bn.startDictionariesVector(e,t.numDictionaries);for(const h of[...t.dictionaryBatches()].slice().reverse())Us.encode(e,h);const u=e.endVector();return bn.startFooter(e),bn.addSchema(e,r),bn.addVersion(e,_n.V4),bn.addRecordBatches(e,l),bn.addDictionaries(e,u),bn.finishFooterBuffer(e,bn.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,e=-1,r=this.numRecordBatches;++e<r;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,r=this.numDictionaries;++e<r;)(t=this.getDictionaryBatch(e))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}}class y4 extends ll{constructor(t,e){super(t,e.version()),this._footer=e}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const e=this._footer.recordBatches(t);if(e)return Us.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t);if(e)return Us.decode(e)}return null}}class Us{constructor(t,e,r){this.metaDataLength=t,this.offset=typeof r=="number"?r:r.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new Us(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:r}=e,l=new vv(e.offset,0),u=new vv(e.bodyLength,0);return Qd.createBlock(t,l,r,u)}}const he=Object.freeze({done:!0,value:void 0});class bv{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class zp{tee(){return this._getDOMStream().tee()}pipe(t,e){return this._getNodeStream().pipe(t,e)}pipeTo(t,e){return this._getDOMStream().pipeTo(t,e)}pipeThrough(t,e){return this._getDOMStream().pipeThrough(t,e)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class m4 extends zp{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return ht(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(he);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Ln.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Ln.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return ht(this,void 0,void 0,function*(){return yield this.abort(t),he})}return(t){return ht(this,void 0,void 0,function*(){return yield this.close(),he})}read(t){return ht(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return ht(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,r)=>{this.resolvers.push({resolve:e,reject:r})}):Promise.resolve(he)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class ec extends m4{write(t){if((t=Ht(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Hd(this.toUint8Array(!0)):this.toUint8Array(!1).then(Hd)}toUint8Array(t=!1){return t?yi(this._values)[0]:ht(this,void 0,void 0,function*(){var e,r;const l=[];let u=0;try{for(var h=Sr(this),d;d=yield h.next(),!d.done;){const y=d.value;l.push(y),u+=y.byteLength}}catch(y){e={error:y}}finally{try{d&&!d.done&&(r=h.return)&&(yield r.call(h))}finally{if(e)throw e.error}}return yi(l,u)[0]})}}class Tc{constructor(t){t&&(this.source=new g4(Ln.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 ka{constructor(t){t instanceof ka?this.source=t.source:t instanceof ec?this.source=new rr(Ln.fromAsyncIterable(t)):mb(t)?this.source=new rr(Ln.fromNodeStream(t)):Sp(t)?this.source=new rr(Ln.fromDOMStream(t)):yb(t)?this.source=new rr(Ln.fromDOMStream(t.body)):bl(t)?this.source=new rr(Ln.fromIterable(t)):Bs(t)?this.source=new rr(Ln.fromAsyncIterable(t)):Qa(t)&&(this.source=new rr(Ln.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 g4{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||he)}return(t){return Object.create(this.source.return&&this.source.return(t)||he)}}class rr{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return ht(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return ht(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return ht(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return ht(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return ht(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||he;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return ht(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||he;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class Sv extends Tc{constructor(t,e){super(),this.position=0,this.buffer=Ht(t),this.size=typeof e>"u"?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:r}=this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:e,size:r,position:l}=this;return e&&l<r?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(r,l+Math.min(r-l,t)),e.subarray(l,this.position)):null}readAt(t,e){const r=this.buffer,l=Math.min(this.size,t+e);return r?r.subarray(t,l):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}}class xc extends ka{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=ht(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return ht(this,void 0,void 0,function*(){const{buffer:e,byteOffset:r}=yield this.readAt(t,4);return new DataView(e,r).getInt32(0,!0)})}seek(t){return ht(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return ht(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:e,size:r,position:l}=this;if(e&&l<r){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let u=l,h=0,d=0;const y=Math.min(r,u+Math.min(r-u,t)),p=new Uint8Array(Math.max(0,(this.position=y)-u));for(;(u+=d)<y&&(h+=d)<p.byteLength;)({bytesRead:d}=yield e.read(p,h,p.byteLength-h,u));return p}return null})}readAt(t,e){return ht(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:r,size:l}=this;if(r&&t+e<l){const u=Math.min(l,t+e),h=new Uint8Array(u-t);return(yield r.read(h,0,e,t)).buffer}return new Uint8Array(e)})}close(){return ht(this,void 0,void 0,function*(){const t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return ht(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return ht(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}const v4=65536;function ma(s){return s<0&&(s=4294967295+s+1),`0x${s.toString(16)}`}const Va=8,Lp=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class L1{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),r=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let l=e[3]*r[3];this.buffer[0]=l&65535;let u=l>>>16;return l=e[2]*r[3],u+=l,l=e[3]*r[2]>>>0,u+=l,this.buffer[0]+=u<<16,this.buffer[1]=u>>>0<l?v4:0,this.buffer[1]+=u>>>16,this.buffer[1]+=e[1]*r[3]+e[2]*r[2]+e[3]*r[1],this.buffer[1]+=e[0]*r[3]+e[1]*r[2]+e[2]*r[1]+e[3]*r[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${ma(this.buffer[1])} ${ma(this.buffer[0])}`}}class Pt extends L1{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return Pt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return Pt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const r=t.length,l=new Pt(e);for(let u=0;u<r;){const h=Va<r-u?Va:r-u,d=new Pt(new Uint32Array([Number.parseInt(t.slice(u,u+h),10),0])),y=new Pt(new Uint32Array([Lp[h],0]));l.times(y),l.plus(d),u+=h}return l}static convertArray(t){const e=new Uint32Array(t.length*2);for(let r=-1,l=t.length;++r<l;)Pt.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new Pt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Pt(new Uint32Array(t.buffer)).plus(e)}}class Ze extends L1{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){const e=this.buffer[1]<<0,r=t.buffer[1]<<0;return e<r||e===r&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return Ze.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return Ze.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const r=t.startsWith("-"),l=t.length,u=new Ze(e);for(let h=r?1:0;h<l;){const d=Va<l-h?Va:l-h,y=new Ze(new Uint32Array([Number.parseInt(t.slice(h,h+d),10),0])),p=new Ze(new Uint32Array([Lp[d],0]));u.times(p),u.plus(y),h+=d}return r?u.negate():u}static convertArray(t){const e=new Uint32Array(t.length*2);for(let r=-1,l=t.length;++r<l;)Ze.from(t[r],new Uint32Array(e.buffer,e.byteOffset+2*r*4,2));return e}static multiply(t,e){return new Ze(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ze(new Uint32Array(t.buffer)).plus(e)}}class ni{constructor(t){this.buffer=t}high(){return new Ze(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Ze(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){const e=new Pt(new Uint32Array([this.buffer[3],0])),r=new Pt(new Uint32Array([this.buffer[2],0])),l=new Pt(new Uint32Array([this.buffer[1],0])),u=new Pt(new Uint32Array([this.buffer[0],0])),h=new Pt(new Uint32Array([t.buffer[3],0])),d=new Pt(new Uint32Array([t.buffer[2],0])),y=new Pt(new Uint32Array([t.buffer[1],0])),p=new Pt(new Uint32Array([t.buffer[0],0]));let m=Pt.multiply(u,p);this.buffer[0]=m.low();const v=new Pt(new Uint32Array([m.high(),0]));return m=Pt.multiply(l,p),v.plus(m),m=Pt.multiply(u,y),v.plus(m),this.buffer[1]=v.low(),this.buffer[3]=v.lessThan(m)?1:0,this.buffer[2]=v.high(),new Pt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Pt.multiply(r,p)).plus(Pt.multiply(l,y)).plus(Pt.multiply(u,d)),this.buffer[3]+=Pt.multiply(e,p).plus(Pt.multiply(r,y)).plus(Pt.multiply(l,d)).plus(Pt.multiply(u,h)).low(),this}plus(t){const e=new Uint32Array(4);return e[3]=this.buffer[3]+t.buffer[3]>>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]<this.buffer[0]>>>0&&++e[1],e[1]<this.buffer[1]>>>0&&++e[2],e[2]<this.buffer[2]>>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${ma(this.buffer[3])} ${ma(this.buffer[2])} ${ma(this.buffer[1])} ${ma(this.buffer[0])}`}static multiply(t,e){return new ni(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ni(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ni.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ni.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const r=t.startsWith("-"),l=t.length,u=new ni(e);for(let h=r?1:0;h<l;){const d=Va<l-h?Va:l-h,y=new ni(new Uint32Array([Number.parseInt(t.slice(h,h+d),10),0,0,0])),p=new ni(new Uint32Array([Lp[d],0,0,0]));u.times(p),u.plus(y),h+=d}return r?u.negate():u}static convertArray(t){const e=new Uint32Array(t.length*4);for(let r=-1,l=t.length;++r<l;)ni.from(t[r],new Uint32Array(e.buffer,e.byteOffset+4*4*r,4));return e}}class U1 extends zt{constructor(t,e,r,l){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=r,this.dictionaries=l}visit(t){return super.visit(t instanceof ae?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return Nt({type:t,length:e})}visitBool(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitInt(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDate(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitTime(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitList(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===wn.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:r}=this.nextFieldNode()){return Nt({type:t,length:e,nullCount:r,nullBitmap:this.readNullBitmap(t,r),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e,r=this.nextBufferRange()){return e>0&&this.readData(t,r)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:r}=this.nextBufferRange()){return this.bytes.subarray(r,r+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class b4 extends U1{constructor(t,e,r,l){super(new Uint8Array(0),e,r,l),this.sources=t}readNullBitmap(t,e,{offset:r}=this.nextBufferRange()){return e<=0?new Uint8Array(0):gc(this.sources[r])}readOffsets(t,{offset:e}=this.nextBufferRange()){return ee(Uint8Array,ee(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return ee(Uint8Array,ee(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:r}=this;return pt.isTimestamp(t)||(pt.isInt(t)||pt.isTime(t))&&t.bitWidth===64||pt.isDate(t)&&t.unit===Yi.MILLISECOND?ee(Uint8Array,Ze.convertArray(r[e])):pt.isDecimal(t)?ee(Uint8Array,ni.convertArray(r[e])):pt.isBinary(t)||pt.isFixedSizeBinary(t)?S4(r[e]):pt.isBool(t)?gc(r[e]):pt.isUtf8(t)?bp(r[e].join("")):ee(Uint8Array,ee(t.ArrayType,r[e].map(l=>+l)))}}function S4(s){const t=s.join(""),e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r>>1]=Number.parseInt(t.slice(r,r+2),16);return e}class vt extends zt{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((r,l)=>this.compareFields(r,e[l]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function an(s,t){return t instanceof s.constructor}function Sl(s,t){return s===t||an(s,t)}function Gi(s,t){return s===t||an(s,t)&&s.bitWidth===t.bitWidth&&s.isSigned===t.isSigned}function qc(s,t){return s===t||an(s,t)&&s.precision===t.precision}function _4(s,t){return s===t||an(s,t)&&s.byteWidth===t.byteWidth}function Up(s,t){return s===t||an(s,t)&&s.unit===t.unit}function _l(s,t){return s===t||an(s,t)&&s.unit===t.unit&&s.timezone===t.timezone}function wl(s,t){return s===t||an(s,t)&&s.unit===t.unit&&s.bitWidth===t.bitWidth}function w4(s,t){return s===t||an(s,t)&&s.children.length===t.children.length&&Is.compareManyFields(s.children,t.children)}function A4(s,t){return s===t||an(s,t)&&s.children.length===t.children.length&&Is.compareManyFields(s.children,t.children)}function Ip(s,t){return s===t||an(s,t)&&s.mode===t.mode&&s.typeIds.every((e,r)=>e===t.typeIds[r])&&Is.compareManyFields(s.children,t.children)}function E4(s,t){return s===t||an(s,t)&&s.id===t.id&&s.isOrdered===t.isOrdered&&Is.visit(s.indices,t.indices)&&Is.visit(s.dictionary,t.dictionary)}function Fp(s,t){return s===t||an(s,t)&&s.unit===t.unit}function T4(s,t){return s===t||an(s,t)&&s.listSize===t.listSize&&s.children.length===t.children.length&&Is.compareManyFields(s.children,t.children)}function x4(s,t){return s===t||an(s,t)&&s.keysSorted===t.keysSorted&&s.children.length===t.children.length&&Is.compareManyFields(s.children,t.children)}vt.prototype.visitNull=Sl;vt.prototype.visitBool=Sl;vt.prototype.visitInt=Gi;vt.prototype.visitInt8=Gi;vt.prototype.visitInt16=Gi;vt.prototype.visitInt32=Gi;vt.prototype.visitInt64=Gi;vt.prototype.visitUint8=Gi;vt.prototype.visitUint16=Gi;vt.prototype.visitUint32=Gi;vt.prototype.visitUint64=Gi;vt.prototype.visitFloat=qc;vt.prototype.visitFloat16=qc;vt.prototype.visitFloat32=qc;vt.prototype.visitFloat64=qc;vt.prototype.visitUtf8=Sl;vt.prototype.visitBinary=Sl;vt.prototype.visitFixedSizeBinary=_4;vt.prototype.visitDate=Up;vt.prototype.visitDateDay=Up;vt.prototype.visitDateMillisecond=Up;vt.prototype.visitTimestamp=_l;vt.prototype.visitTimestampSecond=_l;vt.prototype.visitTimestampMillisecond=_l;vt.prototype.visitTimestampMicrosecond=_l;vt.prototype.visitTimestampNanosecond=_l;vt.prototype.visitTime=wl;vt.prototype.visitTimeSecond=wl;vt.prototype.visitTimeMillisecond=wl;vt.prototype.visitTimeMicrosecond=wl;vt.prototype.visitTimeNanosecond=wl;vt.prototype.visitDecimal=Sl;vt.prototype.visitList=w4;vt.prototype.visitStruct=A4;vt.prototype.visitUnion=Ip;vt.prototype.visitDenseUnion=Ip;vt.prototype.visitSparseUnion=Ip;vt.prototype.visitDictionary=E4;vt.prototype.visitInterval=Fp;vt.prototype.visitIntervalDayTime=Fp;vt.prototype.visitIntervalYearMonth=Fp;vt.prototype.visitFixedSizeList=T4;vt.prototype.visitMap=x4;const Is=new vt;function Pd(s,t){return Is.compareSchemas(s,t)}function wd(s,t){return O4(s,t.map(e=>e.data.concat()))}function O4(s,t){const e=[...s.fields],r=[],l={numBatches:t.reduce((v,S)=>Math.max(v,S.length),0)};let u=0,h=0,d=-1;const y=t.length;let p,m=[];for(;l.numBatches-- >0;){for(h=Number.POSITIVE_INFINITY,d=-1;++d<y;)m[d]=p=t[d].shift(),h=Math.min(h,p?p.length:h);Number.isFinite(h)&&(m=D4(e,h,m,t,l),h>0&&(r[u++]=Nt({type:new qe(e),length:h,nullCount:0,children:m.slice()})))}return[s=s.assign(e),r.map(v=>new en(s,v))]}function D4(s,t,e,r,l){var u;const h=(t+63&-64)>>3;for(let d=-1,y=r.length;++d<y;){const p=e[d],m=p==null?void 0:p.length;if(m>=t)m===t?e[d]=p:(e[d]=p.slice(0,t),l.numBatches=Math.max(l.numBatches,r[d].unshift(p.slice(t,m-t))));else{const v=s[d];s[d]=v.clone({nullable:!0}),e[d]=(u=p==null?void 0:p._changeLengthAndBackfillNullBitmap(t))!==null&&u!==void 0?u:Nt({type:v.type,length:t,nullCount:t,nullBitmap:new Uint8Array(h)})}}return e}var I1;class Ve{constructor(...t){var e,r;if(t.length===0)return this.batches=[],this.schema=new Qt([]),this._offsets=[0],this;let l,u;t[0]instanceof Qt&&(l=t.shift()),t[t.length-1]instanceof Uint32Array&&(u=t.pop());const h=y=>{if(y){if(y instanceof en)return[y];if(y instanceof Ve)return y.batches;if(y instanceof se){if(y.type instanceof qe)return[new en(new Qt(y.type.children),y)]}else{if(Array.isArray(y))return y.flatMap(p=>h(p));if(typeof y[Symbol.iterator]=="function")return[...y].flatMap(p=>h(p));if(typeof y=="object"){const p=Object.keys(y),m=p.map(_=>new Yt([y[_]])),v=new Qt(p.map((_,T)=>new ae(String(_),m[T].type))),[,S]=wd(v,m);return S.length===0?[new en(y)]:S}}}return[]},d=t.flatMap(y=>h(y));if(l=(r=l??((e=d[0])===null||e===void 0?void 0:e.schema))!==null&&r!==void 0?r:new Qt([]),!(l instanceof Qt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const y of d){if(!(y instanceof en))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Pd(l,y.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=l,this.batches=d,this._offsets=u??w1(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=_1(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?Np.visit(new Yt(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
  ${this.toArray().join(`,
  `)}
]`}concat(...t){const e=this.schema,r=this.data.concat(t.flatMap(({data:l})=>l));return new Ve(e,r.map(l=>new en(e,l)))}slice(t,e){const r=this.schema;[t,e]=b1({length:this.numRows},t,e);const l=A1(this.data,this._offsets,t,e);return new Ve(r,l.map(u=>new en(r,u)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){const e=this.data.map(r=>r.children[t]);if(e.length===0){const{type:r}=this.schema.fields[t],l=Nt({type:r,length:0,nullCount:0});e.push(l._changeLengthAndBackfillNullBitmap(this.numRows))}return new Yt(e)}return null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(l=>l.name===t),e)}setChildAt(t,e){let r=this.schema,l=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new Yt([Nt({type:new zs,length:this.numRows})]));const u=r.fields.slice(),h=u[t].clone({type:e.type}),d=this.schema.fields.map((y,p)=>this.getChildAt(p));[u[t],d[t]]=[h,e],[r,l]=wd(r,d)}return new Ve(r,l)}select(t){const e=this.schema.fields.reduce((r,l,u)=>r.set(l.name,u),new Map);return this.selectAt(t.map(r=>e.get(r)).filter(r=>r>-1))}selectAt(t){const e=this.schema.selectAt(t),r=this.batches.map(l=>l.selectAt(t));return new Ve(e,r)}assign(t){const e=this.schema.fields,[r,l]=t.schema.fields.reduce((d,y,p)=>{const[m,v]=d,S=e.findIndex(_=>_.name===y.name);return~S?v[S]=p:m.push(p),d},[[],[]]),u=this.schema.assign(t.schema),h=[...e.map((d,y)=>[y,l[y]]).map(([d,y])=>y===void 0?this.getChildAt(d):t.getChildAt(y)),...r.map(d=>t.getChildAt(d))].filter(Boolean);return new Ve(...wd(u,h))}}I1=Symbol.toStringTag;Ve[I1]=(s=>(s.schema=null,s.batches=[],s._offsets=new Uint32Array([0]),s._nullCount=-1,s[Symbol.isConcatSpreadable]=!0,s.isValid=_a(Bp),s.get=_a(rn.getVisitFn(B.Struct)),s.set=E1(Fn.getVisitFn(B.Struct)),s.indexOf=T1(vc.getVisitFn(B.Struct)),s.getByteLength=_a(mi.getVisitFn(B.Struct)),"Table"))(Ve.prototype);var F1;let en=class Po{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Qt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Nt({nullCount:0,type:new qe(this.schema.fields),children:this.schema.fields.map(e=>Nt({type:e.type,nullCount:0}))})]=t,!(this.data instanceof se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=_v(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:r,children:l,length:u}=Object.keys(e).reduce((y,p,m)=>(y.children[m]=e[p],y.length=Math.max(y.length,e[p].length),y.fields[m]=ae.new({name:p,type:e[p].type,nullable:!0}),y),{length:0,fields:new Array,children:new Array}),h=new Qt(r),d=Nt({type:new qe(r),length:u,children:l,nullCount:0});[this.schema,this.data]=_v(h,d.children,u);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=j1(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 rn.visit(this.data,t)}set(t,e){return Fn.visit(this.data,t,e)}indexOf(t,e){return vc.visit(this.data,t,e)}getByteLength(t){return mi.visit(this.data,t)}[Symbol.iterator](){return Np.visit(new Yt([this.data]))}toArray(){return[...this]}concat(...t){return new Ve(this.schema,[this,...t])}slice(t,e){const[r]=new Yt([this.data]).slice(t,e).data;return new Po(this.schema,r)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(r=>r.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new Yt([this.data.children[t]]):null}setChild(t,e){var r;return this.setChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(l=>l.name===t),e)}setChildAt(t,e){let r=this.schema,l=this.data;if(t>-1&&t<this.numCols){e||(e=new Yt([Nt({type:new zs,length:this.numRows})]));const u=r.fields.slice(),h=l.children.slice(),d=u[t].clone({type:e.type});[u[t],h[t]]=[d,e.data[0]],r=new Qt(u,new Map(this.schema.metadata)),l=Nt({type:new qe(u),children:h})}return new Po(r,l)}select(t){const e=this.schema.select(t),r=new qe(e.fields),l=[];for(const u of t){const h=this.schema.fields.findIndex(d=>d.name===u);~h&&(l[h]=this.data.children[h])}return new Po(e,Nt({type:r,length:this.numRows,children:l}))}selectAt(t){const e=this.schema.selectAt(t),r=t.map(u=>this.data.children[u]).filter(Boolean),l=Nt({type:new qe(e.fields),length:this.numRows,children:r});return new Po(e,l)}};F1=Symbol.toStringTag;en[F1]=(s=>(s._nullCount=-1,s[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(en.prototype);function _v(s,t,e=t.reduce((r,l)=>Math.max(r,l.length),0)){var r;const l=[...s.fields],u=[...t],h=(e+63&-64)>>3;for(const[d,y]of s.fields.entries()){const p=t[d];(!p||p.length!==e)&&(l[d]=y.clone({nullable:!0}),u[d]=(r=p==null?void 0:p._changeLengthAndBackfillNullBitmap(e))!==null&&r!==void 0?r:Nt({type:y.type,length:e,nullCount:e,nullBitmap:new Uint8Array(h)}))}return[s.assign(l),Nt({type:new qe(l),length:e,children:u})]}function j1(s,t,e=new Map){for(let r=-1,l=s.length;++r<l;){const h=s[r].type,d=t[r];if(pt.isDictionary(h)){if(!e.has(h.id))d.dictionary&&e.set(h.id,d.dictionary);else if(e.get(h.id)!==d.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}h.children&&h.children.length>0&&j1(h.children,d.children,e)}return e}class jp extends en{constructor(t){const e=t.fields.map(l=>Nt({type:l.type})),r=Nt({type:new qe(t.fields),nullCount:0,children:e});super(t,r)}}var Oc;(function(s){s[s.BUFFER=0]="BUFFER"})(Oc||(Oc={}));var Dc;(function(s){s[s.LZ4_FRAME=0]="LZ4_FRAME",s[s.ZSTD=1]="ZSTD"})(Dc||(Dc={}));class _s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBodyCompression(t,e){return(e||new _s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+ne),(e||new _s).__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):Dc.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Oc.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,Dc.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Oc.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,r){return _s.startBodyCompression(t),_s.addCodec(t,e),_s.addMethod(t,r),_s.endBodyCompression(t)}}class H1{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,e,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(e),t.offset()}}let k1=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,e,r){return t.prep(8,16),t.writeInt64(r),t.writeInt64(e),t.offset()}},Ii=class $d{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new $d).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+ne),(e||new $d).__init(t.readInt32(t.position())+t.position(),t)}length(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}nodes(t,e){const r=this.bb.__offset(this.bb_pos,6);return r?(e||new k1).__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,e){const r=this.bb.__offset(this.bb_pos,8);return r?(e||new H1).__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 e=this.bb.__offset(this.bb_pos,10);return e?(t||new _s).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}},ya=class Zd{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new Zd).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+ne),(e||new Zd).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}data(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Ii).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}};var Mc;(function(s){s[s.NONE=0]="NONE",s[s.Schema=1]="Schema",s[s.DictionaryBatch=2]="DictionaryBatch",s[s.RecordBatch=3]="RecordBatch",s[s.Tensor=4]="Tensor",s[s.SparseTensor=5]="SparseTensor"})(Mc||(Mc={}));let vs=class ti{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new ti).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+ne),(e||new ti).__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):Fa.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Mc.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}customMetadata(t,e){const r=this.bb.__offset(this.bb_pos,12);return r?(e||new Ae).__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,e){t.addFieldInt16(0,e,Fa.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,Mc.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,0))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,r,l,u,h){return ti.startMessage(t),ti.addVersion(t,e),ti.addHeaderType(t,r),ti.addHeader(t,l),ti.addBodyLength(t,u),ti.addCustomMetadata(t,h),ti.endMessage(t)}};var M4=Vi;class R4 extends zt{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return ur.startNull(e),ur.endNull(e)}visitInt(t,e){return Sn.startInt(e),Sn.addBitWidth(e,t.bitWidth),Sn.addIsSigned(e,t.isSigned),Sn.endInt(e)}visitFloat(t,e){return hi.startFloatingPoint(e),hi.addPrecision(e,t.precision),hi.endFloatingPoint(e)}visitBinary(t,e){return ar.startBinary(e),ar.endBinary(e)}visitBool(t,e){return or.startBool(e),or.endBool(e)}visitUtf8(t,e){return hr.startUtf8(e),hr.endUtf8(e)}visitDecimal(t,e){return Je.startDecimal(e),Je.addScale(e,t.scale),Je.addPrecision(e,t.precision),Je.addBitWidth(e,t.bitWidth),Je.endDecimal(e)}visitDate(t,e){return Ku.startDate(e),Ku.addUnit(e,t.unit),Ku.endDate(e)}visitTime(t,e){return Un.startTime(e),Un.addUnit(e,t.unit),Un.addBitWidth(e,t.bitWidth),Un.endTime(e)}visitTimestamp(t,e){const r=t.timezone&&e.createString(t.timezone)||void 0;return In.startTimestamp(e),In.addUnit(e,t.unit),r!==void 0&&In.addTimezone(e,r),In.endTimestamp(e)}visitInterval(t,e){return fi.startInterval(e),fi.addUnit(e,t.unit),fi.endInterval(e)}visitList(t,e){return lr.startList(e),lr.endList(e)}visitStruct(t,e){return cr.startStruct_(e),cr.endStruct_(e)}visitUnion(t,e){tn.startTypeIdsVector(e,t.typeIds.length);const r=tn.createTypeIdsVector(e,t.typeIds);return tn.startUnion(e),tn.addMode(e,t.mode),tn.addTypeIds(e,r),tn.endUnion(e)}visitDictionary(t,e){const r=this.visit(t.indices,e);return ki.startDictionaryEncoding(e),ki.addId(e,new M4(t.id,0)),ki.addIsOrdered(e,t.isOrdered),r!==void 0&&ki.addIndexType(e,r),ki.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ui.startFixedSizeBinary(e),ui.addByteWidth(e,t.byteWidth),ui.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return ci.startFixedSizeList(e),ci.addListSize(e,t.listSize),ci.endFixedSizeList(e)}visitMap(t,e){return Ju.startMap(e),Ju.addKeysSorted(e,t.keysSorted),Ju.endMap(e)}}const Ad=new R4;function C4(s,t=new Map){return new Qt(N4(s,t),nc(s.customMetadata),t)}function V1(s){return new An(s.count,q1(s.columns),Y1(s.columns))}function B4(s){return new gi(V1(s.data),s.id,s.isDelta)}function N4(s,t){return(s.fields||[]).filter(Boolean).map(e=>ae.fromJSON(e,t))}function wv(s,t){return(s.children||[]).filter(Boolean).map(e=>ae.fromJSON(e,t))}function q1(s){return(s||[]).reduce((t,e)=>[...t,new Tr(e.count,z4(e.VALIDITY)),...q1(e.children)],[])}function Y1(s,t=[]){for(let e=-1,r=(s||[]).length;++e<r;){const l=s[e];l.VALIDITY&&t.push(new pi(t.length,l.VALIDITY.length)),l.TYPE&&t.push(new pi(t.length,l.TYPE.length)),l.OFFSET&&t.push(new pi(t.length,l.OFFSET.length)),l.DATA&&t.push(new pi(t.length,l.DATA.length)),t=Y1(l.children,t)}return t}function z4(s){return(s||[]).reduce((t,e)=>t+ +(e===0),0)}function L4(s,t){let e,r,l,u,h,d;return!t||!(u=s.dictionary)?(h=Ev(s,wv(s,t)),l=new ae(s.name,h,s.nullable,nc(s.customMetadata))):t.has(e=u.id)?(r=(r=u.indexType)?Av(r):new rl,d=new Ua(t.get(e),r,e,u.isOrdered),l=new ae(s.name,d,s.nullable,nc(s.customMetadata))):(r=(r=u.indexType)?Av(r):new rl,t.set(e,h=Ev(s,wv(s,t))),d=new Ua(h,r,e,u.isOrdered),l=new ae(s.name,d,s.nullable,nc(s.customMetadata))),l||null}function nc(s){return new Map(Object.entries(s||{}))}function Av(s){return new Ls(s.isSigned,s.bitWidth)}function Ev(s,t){const e=s.type.name;switch(e){case"NONE":return new zs;case"null":return new zs;case"binary":return new rc;case"utf8":return new ac;case"bool":return new oc;case"list":return new fc((t||[])[0]);case"struct":return new qe(t||[]);case"struct_":return new qe(t||[])}switch(e){case"int":{const r=s.type;return new Ls(r.isSigned,r.bitWidth)}case"floatingpoint":{const r=s.type;return new al(nn[r.precision])}case"decimal":{const r=s.type;return new lc(r.scale,r.precision,r.bitWidth)}case"date":{const r=s.type;return new uc(Yi[r.unit])}case"time":{const r=s.type;return new ol(kt[r.unit],r.bitWidth)}case"timestamp":{const r=s.type;return new cc(kt[r.unit],r.timezone)}case"interval":{const r=s.type;return new hc(Ns[r.unit])}case"union":{const r=s.type;return new dc(wn[r.mode],r.typeIds||[],t||[])}case"fixedsizebinary":{const r=s.type;return new pc(r.byteWidth)}case"fixedsizelist":{const r=s.type;return new yc(r.listSize,(t||[])[0])}case"map":{const r=s.type;return new mc((t||[])[0],r.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var Ar=Vi,U4=N1,I4=Ia;class Ye{constructor(t,e,r,l){this._version=e,this._headerType=r,this.body=new Uint8Array(0),l&&(this._createHeader=()=>l),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){const r=new Ye(0,_n.V4,e);return r._createHeader=F4(t,e),r}static decode(t){t=new I4(Ht(t));const e=vs.getRootAsMessage(t),r=e.bodyLength(),l=e.version(),u=e.headerType(),h=new Ye(r,l,u);return h._createHeader=j4(e,u),h}static encode(t){const e=new U4;let r=-1;return t.isSchema()?r=Qt.encode(e,t.header()):t.isRecordBatch()?r=An.encode(e,t.header()):t.isDictionaryBatch()&&(r=gi.encode(e,t.header())),vs.startMessage(e),vs.addVersion(e,_n.V4),vs.addHeader(e,r),vs.addHeaderType(e,t.headerType),vs.addBodyLength(e,new Ar(t.bodyLength,0)),vs.finishMessageBuffer(e,vs.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Qt)return new Ye(0,_n.V4,qt.Schema,t);if(t instanceof An)return new Ye(e,_n.V4,qt.RecordBatch,t);if(t instanceof gi)return new Ye(e,_n.V4,qt.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===qt.Schema}isRecordBatch(){return this.headerType===qt.RecordBatch}isDictionaryBatch(){return this.headerType===qt.DictionaryBatch}}class An{constructor(t,e,r){this._nodes=e,this._buffers=r,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}}class gi{constructor(t,e,r=!1){this._data=t,this._isDelta=r,this._id=typeof e=="number"?e:e.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}}class pi{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}}class Tr{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}}function F4(s,t){return()=>{switch(t){case qt.Schema:return Qt.fromJSON(s);case qt.RecordBatch:return An.fromJSON(s);case qt.DictionaryBatch:return gi.fromJSON(s)}throw new Error(`Unrecognized Message type: { name: ${qt[t]}, type: ${t} }`)}}function j4(s,t){return()=>{switch(t){case qt.Schema:return Qt.decode(s.header(new ei));case qt.RecordBatch:return An.decode(s.header(new Ii),s.version());case qt.DictionaryBatch:return gi.decode(s.header(new ya),s.version())}throw new Error(`Unrecognized Message type: { name: ${qt[t]}, type: ${t} }`)}}ae.encode=$4;ae.decode=W4;ae.fromJSON=L4;Qt.encode=P4;Qt.decode=H4;Qt.fromJSON=C4;An.encode=Z4;An.decode=k4;An.fromJSON=V1;gi.encode=K4;gi.decode=V4;gi.fromJSON=B4;Tr.encode=J4;Tr.decode=Y4;pi.encode=t5;pi.decode=q4;function H4(s,t=new Map){const e=X4(s,t);return new Qt(e,ic(s),t)}function k4(s,t=_n.V4){if(s.compression()!==null)throw new Error("Record batch compression not implemented");return new An(s.length(),Q4(s),G4(s,t))}function V4(s,t=_n.V4){return new gi(An.decode(s.data(),t),s.id(),s.isDelta())}function q4(s){return new pi(s.offset(),s.length())}function Y4(s){return new Tr(s.length(),s.nullCount())}function Q4(s){const t=[];for(let e,r=-1,l=-1,u=s.nodesLength();++r<u;)(e=s.nodes(r))&&(t[++l]=Tr.decode(e));return t}function G4(s,t){const e=[];for(let r,l=-1,u=-1,h=s.buffersLength();++l<h;)(r=s.buffers(l))&&(t<_n.V4&&(r.bb_pos+=8*(l+1)),e[++u]=pi.decode(r));return e}function X4(s,t){const e=[];for(let r,l=-1,u=-1,h=s.fieldsLength();++l<h;)(r=s.fields(l))&&(e[++u]=ae.decode(r,t));return e}function Tv(s,t){const e=[];for(let r,l=-1,u=-1,h=s.childrenLength();++l<h;)(r=s.children(l))&&(e[++u]=ae.decode(r,t));return e}function W4(s,t){let e,r,l,u,h,d;return!t||!(d=s.dictionary())?(l=Ov(s,Tv(s,t)),r=new ae(s.name(),l,s.nullable(),ic(s))):t.has(e=d.id().low)?(u=(u=d.indexType())?xv(u):new rl,h=new Ua(t.get(e),u,e,d.isOrdered()),r=new ae(s.name(),h,s.nullable(),ic(s))):(u=(u=d.indexType())?xv(u):new rl,t.set(e,l=Ov(s,Tv(s,t))),h=new Ua(l,u,e,d.isOrdered()),r=new ae(s.name(),h,s.nullable(),ic(s))),r||null}function ic(s){const t=new Map;if(s)for(let e,r,l=-1,u=Math.trunc(s.customMetadataLength());++l<u;)(e=s.customMetadata(l))&&(r=e.key())!=null&&t.set(r,e.value());return t}function xv(s){return new Ls(s.isSigned(),s.bitWidth())}function Ov(s,t){const e=s.typeType();switch(e){case ce.NONE:return new zs;case ce.Null:return new zs;case ce.Binary:return new rc;case ce.Utf8:return new ac;case ce.Bool:return new oc;case ce.List:return new fc((t||[])[0]);case ce.Struct_:return new qe(t||[])}switch(e){case ce.Int:{const r=s.type(new Sn);return new Ls(r.isSigned(),r.bitWidth())}case ce.FloatingPoint:{const r=s.type(new hi);return new al(r.precision())}case ce.Decimal:{const r=s.type(new Je);return new lc(r.scale(),r.precision(),r.bitWidth())}case ce.Date:{const r=s.type(new Ku);return new uc(r.unit())}case ce.Time:{const r=s.type(new Un);return new ol(r.unit(),r.bitWidth())}case ce.Timestamp:{const r=s.type(new In);return new cc(r.unit(),r.timezone())}case ce.Interval:{const r=s.type(new fi);return new hc(r.unit())}case ce.Union:{const r=s.type(new tn);return new dc(r.mode(),r.typeIdsArray()||[],t||[])}case ce.FixedSizeBinary:{const r=s.type(new ui);return new pc(r.byteWidth())}case ce.FixedSizeList:{const r=s.type(new ci);return new yc(r.listSize(),(t||[])[0])}case ce.Map:{const r=s.type(new Ju);return new mc((t||[])[0],r.keysSorted())}}throw new Error(`Unrecognized type: "${ce[e]}" (${e})`)}function P4(s,t){const e=t.fields.map(u=>ae.encode(s,u));ei.startFieldsVector(s,e.length);const r=ei.createFieldsVector(s,e),l=t.metadata&&t.metadata.size>0?ei.createCustomMetadataVector(s,[...t.metadata].map(([u,h])=>{const d=s.createString(`${u}`),y=s.createString(`${h}`);return Ae.startKeyValue(s),Ae.addKey(s,d),Ae.addValue(s,y),Ae.endKeyValue(s)})):-1;return ei.startSchema(s),ei.addFields(s,r),ei.addEndianness(s,e5?ja.Little:ja.Big),l!==-1&&ei.addCustomMetadata(s,l),ei.endSchema(s)}function $4(s,t){let e=-1,r=-1,l=-1;const u=t.type;let h=t.typeId;pt.isDictionary(u)?(h=u.dictionary.typeId,l=Ad.visit(u,s),r=Ad.visit(u.dictionary,s)):r=Ad.visit(u,s);const d=(u.children||[]).map(m=>ae.encode(s,m)),y=Nn.createChildrenVector(s,d),p=t.metadata&&t.metadata.size>0?Nn.createCustomMetadataVector(s,[...t.metadata].map(([m,v])=>{const S=s.createString(`${m}`),_=s.createString(`${v}`);return Ae.startKeyValue(s),Ae.addKey(s,S),Ae.addValue(s,_),Ae.endKeyValue(s)})):-1;return t.name&&(e=s.createString(t.name)),Nn.startField(s),Nn.addType(s,r),Nn.addTypeType(s,h),Nn.addChildren(s,y),Nn.addNullable(s,!!t.nullable),e!==-1&&Nn.addName(s,e),l!==-1&&Nn.addDictionary(s,l),p!==-1&&Nn.addCustomMetadata(s,p),Nn.endField(s)}function Z4(s,t){const e=t.nodes||[],r=t.buffers||[];Ii.startNodesVector(s,e.length);for(const h of e.slice().reverse())Tr.encode(s,h);const l=s.endVector();Ii.startBuffersVector(s,r.length);for(const h of r.slice().reverse())pi.encode(s,h);const u=s.endVector();return Ii.startRecordBatch(s),Ii.addLength(s,new Ar(t.length,0)),Ii.addNodes(s,l),Ii.addBuffers(s,u),Ii.endRecordBatch(s)}function K4(s,t){const e=An.encode(s,t.data);return ya.startDictionaryBatch(s),ya.addId(s,new Ar(t.id,0)),ya.addIsDelta(s,t.isDelta),ya.addData(s,e),ya.endDictionaryBatch(s)}function J4(s,t){return k1.createFieldNode(s,new Ar(t.length,0),new Ar(t.nullCount,0))}function t5(s,t){return H1.createBuffer(s,new Ar(t.offset,0),new Ar(t.length,0))}const e5=(()=>{const s=new ArrayBuffer(2);return new DataView(s).setInt16(0,256,!0),new Int16Array(s)[0]===256})(),Hp=s=>`Expected ${qt[s]} Message in stream, but was null or length 0.`,kp=s=>`Header pointer of flatbuffer-encoded ${qt[s]} Message is null or length 0.`,Q1=(s,t)=>`Expected to read ${s} metadata bytes, but only read ${t}.`,G1=(s,t)=>`Expected to read ${s} bytes for message body, but only read ${t}.`;class X1{constructor(t){this.source=t instanceof Tc?t:new Tc(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?he:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(Hp(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=Ht(this.source.read(t));if(e.byteLength<t)throw new Error(G1(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=qt.Schema,r=this.readMessage(e),l=r==null?void 0:r.header();if(t&&!l)throw new Error(kp(e));return l}readMetadataLength(){const t=this.source.read(Yc),e=t&&new Ia(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}}readMetadata(t){const e=this.source.read(t);if(!e)return he;if(e.byteLength<t)throw new Error(Q1(t,e.byteLength));return{done:!1,value:Ye.decode(e)}}}class n5{constructor(t,e){this.source=t instanceof ka?t:pb(t)?new xc(t,e):new ka(t)}[Symbol.asyncIterator](){return this}next(){return ht(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done||t.value===-1&&(t=yield this.readMetadataLength()).done||(t=yield this.readMetadata(t.value)).done?he:t})}throw(t){return ht(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return ht(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return ht(this,void 0,void 0,function*(){let e;if((e=yield this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(Hp(t));return e.value})}readMessageBody(t){return ht(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);const e=Ht(yield this.source.read(t));if(e.byteLength<t)throw new Error(G1(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return ht(this,void 0,void 0,function*(){const e=qt.Schema,r=yield this.readMessage(e),l=r==null?void 0:r.header();if(t&&!l)throw new Error(kp(e));return l})}readMetadataLength(){return ht(this,void 0,void 0,function*(){const t=yield this.source.read(Yc),e=t&&new Ia(t),r=(e==null?void 0:e.readInt32(0))||0;return{done:r===0,value:r}})}readMetadata(t){return ht(this,void 0,void 0,function*(){const e=yield this.source.read(t);if(!e)return he;if(e.byteLength<t)throw new Error(Q1(t,e.byteLength));return{done:!1,value:Ye.decode(e)}})}}class i5 extends X1{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof bv?t:new bv(t)}next(){const{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Ye.fromJSON(t.schema,qt.Schema)};if(this._dictionaryIndex<t.dictionaries.length){const e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:Ye.fromJSON(e,qt.DictionaryBatch)}}if(this._batchIndex<t.batches.length){const e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:Ye.fromJSON(e,qt.RecordBatch)}}return this._body=[],he}readMessageBody(t){return e(this._body);function e(r){return(r||[]).reduce((l,u)=>[...l,...u.VALIDITY&&[u.VALIDITY]||[],...u.TYPE&&[u.TYPE]||[],...u.OFFSET&&[u.OFFSET]||[],...u.DATA&&[u.DATA]||[],...e(u.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(Hp(t));return e.value}readSchema(){const t=qt.Schema,e=this.readMessage(t),r=e==null?void 0:e.header();if(!e||!r)throw new Error(kp(t));return r}}const Yc=4,Kd="ARROW1",ul=new Uint8Array(Kd.length);for(let s=0;s<Kd.length;s+=1)ul[s]=Kd.codePointAt(s);function Vp(s,t=0){for(let e=-1,r=ul.length;++e<r;)if(ul[e]!==s[t+e])return!1;return!0}const Al=ul.length,W1=Al+Yc,s5=Al*2+Yc;class qi extends zp{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){const e=this._impl.open(t);return Bs(e)?e.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Ln.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Ln.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof qi?t:kd(t)?l5(t):pb(t)?h5(t):Bs(t)?ht(this,void 0,void 0,function*(){return yield qi.from(yield t)}):yb(t)||Sp(t)||mb(t)||Qa(t)?c5(new ka(t)):u5(new Tc(t))}static readAll(t){return t instanceof qi?t.isSync()?Dv(t):Mv(t):kd(t)||ArrayBuffer.isView(t)||bl(t)||db(t)?Dv(t):Mv(t)}}class Rc extends qi{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return di(this,arguments,function*(){yield Et(yield*Zu(Sr(this[Symbol.iterator]())))})}}class Cc extends qi{constructor(t){super(t),this._impl=t}readAll(){var t,e;return ht(this,void 0,void 0,function*(){const r=new Array;try{for(var l=Sr(this),u;u=yield l.next(),!u.done;){const h=u.value;r.push(h)}}catch(h){t={error:h}}finally{try{u&&!u.done&&(e=l.return)&&(yield e.call(l))}finally{if(t)throw t.error}}return r})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class P1 extends Rc{constructor(t){super(t),this._impl=t}}class r5 extends Cc{constructor(t){super(t),this._impl=t}}class $1{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const r=this._loadVectors(t,e,this.schema.fields),l=Nt({type:new qe(this.schema.fields),length:t.length,children:r});return new en(this.schema,l)}_loadDictionaryBatch(t,e){const{id:r,isDelta:l}=t,{dictionaries:u,schema:h}=this,d=u.get(r);if(l||!d){const y=h.dictionaries.get(r),p=this._loadVectors(t.data,e,[y]);return(d&&l?d.concat(new Yt(p)):new Yt(p)).memoize()}return d.memoize()}_loadVectors(t,e,r){return new U1(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}}class Bc extends $1{constructor(t,e){super(e),this._reader=kd(t)?new i5(this._handle=t):new X1(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=K1(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):he}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):he}next(){if(this.closed)return he;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),l=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,l)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),l=e.readMessageBody(t.bodyLength),u=this._loadDictionaryBatch(r,l);this.dictionaries.set(r.id,u)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new jp(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Nc extends $1{constructor(t,e){super(e),this._reader=new n5(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return ht(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 ht(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=K1(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return ht(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):he})}return(t){return ht(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):he})}next(){return ht(this,void 0,void 0,function*(){if(this.closed)return he;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const r=t.header(),l=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(r,l)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const r=t.header(),l=yield e.readMessageBody(t.bodyLength),u=this._loadDictionaryBatch(r,l);this.dictionaries.set(r.id,u)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new jp(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return ht(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class Z1 extends Bc{constructor(t,e){super(t instanceof Sv?t:new Sv(t),e)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(r&&this._handle.seek(r.offset)){const l=this._reader.readMessage(qt.RecordBatch);if(l!=null&&l.isRecordBatch()){const u=l.header(),h=this._reader.readMessageBody(l.bodyLength);return this._loadRecordBatch(u,h)}}return null}_readDictionaryBatch(t){var e;const r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&this._handle.seek(r.offset)){const l=this._reader.readMessage(qt.DictionaryBatch);if(l!=null&&l.isDictionaryBatch()){const u=l.header(),h=this._reader.readMessageBody(l.bodyLength),d=this._loadDictionaryBatch(u,h);this.dictionaries.set(u.id,d)}}}_readFooter(){const{_handle:t}=this,e=t.size-W1,r=t.readInt32(e),l=t.readAt(e-r,r);return ll.decode(l)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(t)}return null}}class a5 extends Nc{constructor(t,...e){const r=typeof e[0]!="number"?e.shift():void 0,l=e[0]instanceof Map?e.shift():void 0;super(t instanceof xc?t:new xc(t,r),l)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(t){const e=Object.create(null,{open:{get:()=>super.open}});return ht(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 e.open.call(this,t)})}readRecordBatch(t){var e;return ht(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());const r=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(r&&(yield this._handle.seek(r.offset))){const l=yield this._reader.readMessage(qt.RecordBatch);if(l!=null&&l.isRecordBatch()){const u=l.header(),h=yield this._reader.readMessageBody(l.bodyLength);return this._loadRecordBatch(u,h)}}return null})}_readDictionaryBatch(t){var e;return ht(this,void 0,void 0,function*(){const r=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(r&&(yield this._handle.seek(r.offset))){const l=yield this._reader.readMessage(qt.DictionaryBatch);if(l!=null&&l.isDictionaryBatch()){const u=l.header(),h=yield this._reader.readMessageBody(l.bodyLength),d=this._loadDictionaryBatch(u,h);this.dictionaries.set(u.id,d)}}})}_readFooter(){return ht(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-W1,r=yield t.readInt32(e),l=yield t.readAt(e-r,r);return ll.decode(l)})}_readNextMessageAndValidate(t){return ht(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const e=this._footer.getRecordBatch(this._recordBatchIndex);if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null})}}class o5 extends Bc{constructor(t,e){super(t,e)}_loadVectors(t,e,r){return new b4(e,t.nodes,t.buffers,this.dictionaries).visitMany(r)}}function K1(s,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:s.autoDestroy}function*Dv(s){const t=qi.from(s);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Mv(s){return di(this,arguments,function*(){const e=yield Et(qi.from(s));try{if(!(yield Et(e.open({autoDestroy:!1}))).closed)do yield yield Et(e);while(!(yield Et(e.reset().open())).closed)}finally{yield Et(e.cancel())}})}function l5(s){return new Rc(new o5(s))}function u5(s){const t=s.peek(Al+7&-8);return t&&t.byteLength>=4?Vp(t)?new P1(new Z1(s.read())):new Rc(new Bc(s)):new Rc(new Bc(function*(){}()))}function c5(s){return ht(this,void 0,void 0,function*(){const t=yield s.peek(Al+7&-8);return t&&t.byteLength>=4?Vp(t)?new P1(new Z1(yield s.read())):new Cc(new Nc(s)):new Cc(new Nc(function(){return di(this,arguments,function*(){})}()))})}function h5(s){return ht(this,void 0,void 0,function*(){const{size:t}=yield s.stat(),e=new xc(s,t);return t>=s5&&Vp(yield e.readAt(0,Al+7&-8))?new r5(new a5(e)):new Cc(new Nc(e))})}class be extends zt{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){const e=l=>l.flatMap(u=>Array.isArray(u)?e(u):u instanceof en?u.data.children:u.data),r=new be;return r.visitMany(e(t)),r}visit(t){if(t instanceof Yt)return this.visitMany(t.data),this;const{type:e}=t;if(!pt.isDictionary(e)){const{length:r,nullCount:l}=t;if(r>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");pt.isNull(e)||Gn.call(this,l<=0?new Uint8Array(0):Mp(t.offset,r,t.nullBitmap)),this.nodes.push(new Tr(r,l))}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 Gn(s){const t=s.byteLength+7&-8;return this.buffers.push(s),this.bufferRegions.push(new pi(this._byteLength,t)),this._byteLength+=t,this}function f5(s){const{type:t,length:e,typeIds:r,valueOffsets:l}=s;if(Gn.call(this,r),t.mode===wn.Sparse)return Jd.call(this,s);if(t.mode===wn.Dense){if(s.offset<=0)return Gn.call(this,l),Jd.call(this,s);{const u=r.reduce((m,v)=>Math.max(m,v),r[0]),h=new Int32Array(u+1),d=new Int32Array(u+1).fill(-1),y=new Int32Array(e),p=wp(-l[0],e,l);for(let m,v,S=-1;++S<e;)(v=d[m=r[S]])===-1&&(v=d[m]=p[m]),y[S]=p[S]-v,++h[m];Gn.call(this,y);for(let m,v=-1,S=t.children.length;++v<S;)if(m=s.children[v]){const _=t.typeIds[v],T=Math.min(e,h[_]);this.visit(m.slice(d[_],T))}}}return this}function d5(s){let t;return s.nullCount>=s.length?Gn.call(this,new Uint8Array(0)):(t=s.values)instanceof Uint8Array?Gn.call(this,Mp(s.offset,s.length,t)):Gn.call(this,gc(s.values))}function Hs(s){return Gn.call(this,s.values.subarray(0,s.length*s.stride))}function J1(s){const{length:t,values:e,valueOffsets:r}=s,l=r[0],u=r[t],h=Math.min(u-l,e.byteLength-l);return Gn.call(this,wp(-r[0],t,r)),Gn.call(this,e.subarray(l,l+h)),this}function qp(s){const{length:t,valueOffsets:e}=s;return e&&Gn.call(this,wp(e[0],t,e)),this.visit(s.children[0])}function Jd(s){return this.visitMany(s.type.children.map((t,e)=>s.children[e]).filter(Boolean))[0]}be.prototype.visitBool=d5;be.prototype.visitInt=Hs;be.prototype.visitFloat=Hs;be.prototype.visitUtf8=J1;be.prototype.visitBinary=J1;be.prototype.visitFixedSizeBinary=Hs;be.prototype.visitDate=Hs;be.prototype.visitTimestamp=Hs;be.prototype.visitTime=Hs;be.prototype.visitDecimal=Hs;be.prototype.visitList=qp;be.prototype.visitStruct=Jd;be.prototype.visitUnion=f5;be.prototype.visitInterval=Hs;be.prototype.visitFixedSizeList=qp;be.prototype.visitMap=qp;class t2 extends zp{constructor(t){super(),this._position=0,this._started=!1,this._sink=new ec,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,sn(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Bs(t)?t.then(e=>this.writeAll(e)):Qa(t)?Xp(this,t):Gp(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof ec?this._sink=t:(this._sink=new ec,t&&z3(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&L3(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!Pd(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Ve&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof en&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Pd(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof en?t instanceof jp||this._writeRecordBatch(t):t instanceof Ve?this.writeAll(t.batches):bl(t)&&this.writeAll(t)}_writeMessage(t,e=8){const r=e-1,l=Ye.encode(t),u=l.byteLength,h=this._writeLegacyIpcFormat?4:8,d=u+h+r&~r,y=d-u-h;return t.headerType===qt.RecordBatch?this._recordBatchBlocks.push(new Us(d,t.bodyLength,this._position)):t.headerType===qt.DictionaryBatch&&this._dictionaryBlocks.push(new Us(d,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(d-h)),u>0&&this._write(l),this._writePadding(y)}_write(t){if(this._started){const e=Ht(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Ye.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ul)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:r,bufferRegions:l,buffers:u}=be.assemble(t),h=new An(t.numRows,r,l),d=Ye.from(h,e);return this._writeDictionaries(t)._writeMessage(d)._writeBodyBuffers(u)}_writeDictionaryBatch(t,e,r=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));const{byteLength:l,nodes:u,bufferRegions:h,buffers:d}=be.assemble(new Yt([t])),y=new An(t.length,u,h),p=new gi(y,e,r),m=Ye.from(p,l);return this._writeMessage(m)._writeBodyBuffers(d)}_writeBodyBuffers(t){let e,r,l;for(let u=-1,h=t.length;++u<h;)(e=t[u])&&(r=e.byteLength)>0&&(this._write(e),(l=(r+7&-8)-r)>0&&this._writePadding(l));return this}_writeDictionaries(t){for(let[e,r]of t.dictionaries){let l=this._dictionaryDeltaOffsets.get(e)||0;if(l===0||(r=r==null?void 0:r.slice(l)).length>0)for(const u of r.data)this._writeDictionaryBatch(u,e,l>0),l+=u.length}return this}}class Yp extends t2{static writeAll(t,e){const r=new Yp(e);return Bs(t)?t.then(l=>r.writeAll(l)):Qa(t)?Xp(r,t):Gp(r,t)}}class Qp extends t2{static writeAll(t){const e=new Qp;return Bs(t)?t.then(r=>e.writeAll(r)):Qa(t)?Xp(e,t):Gp(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const e=ll.encode(new ll(t,_n.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function Gp(s,t){let e=t;t instanceof Ve&&(e=t.batches,s.reset(void 0,t.schema));for(const r of e)s.write(r);return s.finish()}function Xp(s,t){var e,r,l,u;return ht(this,void 0,void 0,function*(){try{for(e=Sr(t);r=yield e.next(),!r.done;){const h=r.value;s.write(h)}}catch(h){l={error:h}}finally{try{r&&!r.done&&(u=e.return)&&(yield u.call(e))}finally{if(l)throw l.error}}return s.finish()})}function $o(s){const t=qi.from(s);return Bs(t)?t.then(e=>$o(e)):t.isAsync()?t.readAll().then(e=>new Ve(e)):new Ve(t.readAll())}function Ed(s,t="stream"){return(t==="stream"?Yp:Qp).writeAll(s).toUint8Array(!0)}var Rv=function(){function s(t,e,r,l){var u=this;this.getCell=function(h,d){var y=h<u.headerRows&&d<u.headerColumns,p=h>=u.headerRows&&d<u.headerColumns,m=h<u.headerRows&&d>=u.headerColumns;if(y){var v=["blank"];return d>0&&v.push("level"+h),{type:"blank",classNames:v.join(" "),content:""}}else if(m){var S=d-u.headerColumns,v=["col_heading","level"+h,"col"+S];return{type:"columns",classNames:v.join(" "),content:u.getContent(u.columnsTable,S,h)}}else if(p){var _=h-u.headerRows,v=["row_heading","level"+d,"row"+_];return{type:"index",id:"T_".concat(u.uuid,"level").concat(d,"_row").concat(_),classNames:v.join(" "),content:u.getContent(u.indexTable,_,d)}}else{var _=h-u.headerRows,S=d-u.headerColumns,v=["data","row"+_,"col"+S],T=u.styler?u.getContent(u.styler.displayValuesTable,_,S):u.getContent(u.dataTable,_,S);return{type:"data",id:"T_".concat(u.uuid,"row").concat(_,"_col").concat(S),classNames:v.join(" "),content:T}}},this.getContent=function(h,d,y){var p=h.getChildAt(y);if(p===null)return"";var m=u.getColumnTypeId(h,y);switch(m){case B.Timestamp:return u.nanosToDate(p.get(d));default:return p.get(d)}},this.dataTable=$o(t),this.indexTable=$o(e),this.columnsTable=$o(r),this.styler=l?{caption:l.caption,displayValuesTable:$o(l.displayValues),styles:l.styles,uuid:l.uuid}:void 0}return Object.defineProperty(s.prototype,"rows",{get:function(){return this.indexTable.numRows+this.columnsTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dataRows",{get:function(){return this.dataTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"table",{get:function(){return this.dataTable},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"index",{get:function(){return this.indexTable},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!1,configurable:!0}),s.prototype.serialize=function(){return{data:Ed(this.dataTable),index:Ed(this.indexTable),columns:Ed(this.columnsTable)}},s.prototype.getColumnTypeId=function(t,e){return t.schema.fields[e].type.typeId},s.prototype.nanosToDate=function(t){return new Date(t/1e6)},s}(),el=function(){return el=Object.assign||function(s){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(s[l]=t[l])}return s},el.apply(this,arguments)},nl;(function(s){s.COMPONENT_READY="streamlit:componentReady",s.SET_COMPONENT_VALUE="streamlit:setComponentValue",s.SET_FRAME_HEIGHT="streamlit:setFrameHeight"})(nl||(nl={}));var ai=function(){function s(){}return s.API_VERSION=1,s.RENDER_EVENT="streamlit:render",s.events=new EventTarget,s.registeredMessageListener=!1,s.setComponentReady=function(){s.registeredMessageListener||(window.addEventListener("message",s.onMessageEvent),s.registeredMessageListener=!0),s.sendBackMsg(nl.COMPONENT_READY,{apiVersion:s.API_VERSION})},s.setFrameHeight=function(t){t===void 0&&(t=document.body.scrollHeight),t!==s.lastFrameHeight&&(s.lastFrameHeight=t,s.sendBackMsg(nl.SET_FRAME_HEIGHT,{height:t}))},s.setComponentValue=function(t){var e;t instanceof Rv?(e="dataframe",t=t.serialize()):y5(t)?(e="bytes",t=new Uint8Array(t.buffer)):t instanceof ArrayBuffer?(e="bytes",t=new Uint8Array(t)):e="json",s.sendBackMsg(nl.SET_COMPONENT_VALUE,{value:t,dataType:e})},s.onMessageEvent=function(t){var e=t.data.type;switch(e){case s.RENDER_EVENT:s.onRenderMessage(t.data);break}},s.onRenderMessage=function(t){var e=t.args;e==null&&(console.error("Got null args in onRenderMessage. This should never happen"),e={});var r=t.dfs&&t.dfs.length>0?s.argsDataframeToObject(t.dfs):{};e=el(el({},e),r);var l=!!t.disabled,u=t.theme;u&&p5(u);var h={disabled:l,args:e,theme:u},d=new CustomEvent(s.RENDER_EVENT,{detail:h});s.events.dispatchEvent(d)},s.argsDataframeToObject=function(t){var e=t.map(function(r){var l=r.key,u=r.value;return[l,s.toArrowTable(u)]});return Object.fromEntries(e)},s.toArrowTable=function(t){var e,r=(e=t.data,e.data),l=e.index,u=e.columns,h=e.styler;return new Rv(r,l,u,h)},s.sendBackMsg=function(t,e){window.parent.postMessage(el({isStreamlitMessage:!0,type:t},e),"*")},s}(),p5=function(s){var t=document.createElement("style");document.head.appendChild(t),t.innerHTML=`
    :root {
      --primary-color: `.concat(s.primaryColor,`;
      --background-color: `).concat(s.backgroundColor,`;
      --secondary-background-color: `).concat(s.secondaryBackgroundColor,`;
      --text-color: `).concat(s.textColor,`;
      --font: `).concat(s.font,`;
    }

    body {
      background-color: var(--background-color);
      color: var(--text-color);
    }
  `)};function y5(s){var t=!1;try{t=s instanceof BigInt64Array||s instanceof BigUint64Array}catch{}return s instanceof Int8Array||s instanceof Uint8Array||s instanceof Uint8ClampedArray||s instanceof Int16Array||s instanceof Uint16Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Float32Array||s instanceof Float64Array||t}var e2=function(){var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,l){r.__proto__=l}||function(r,l){for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(r[u]=l[u])},s(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();(function(s){e2(t,s);function t(){return s!==null&&s.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){ai.setFrameHeight()},t.prototype.componentDidUpdate=function(){ai.setFrameHeight()},t})(ji.PureComponent);function m5(s){var t=function(e){e2(r,e);function r(l){var u=e.call(this,l)||this;return u.componentDidMount=function(){ai.events.addEventListener(ai.RENDER_EVENT,u.onRenderEvent),ai.setComponentReady()},u.componentDidUpdate=function(){u.state.componentError!=null&&ai.setFrameHeight()},u.componentWillUnmount=function(){ai.events.removeEventListener(ai.RENDER_EVENT,u.onRenderEvent)},u.onRenderEvent=function(h){u.setState({renderData:h.detail})},u.state={renderData:void 0,componentError:void 0},u}return r.prototype.render=function(){return this.state.componentError!=null?ji.createElement("div",null,ji.createElement("h1",null,"Component Error"),ji.createElement("span",null,this.state.componentError.message)):this.state.renderData==null?null:ji.createElement(s,{width:window.innerWidth,disabled:this.state.renderData.disabled,args:this.state.renderData.args,theme:this.state.renderData.theme})},r.getDerivedStateFromError=function(l){return{componentError:l}},r}(ji.PureComponent);return M3(t,s)}const Zo={},Cv=(s,t)=>s.unstable_is?s.unstable_is(t):t===s,Bv=s=>"init"in s,Td=s=>!!s.write,Nv=s=>"v"in s||"e"in s,Xu=s=>{if("e"in s)throw s.e;if((Zo?"production":void 0)!=="production"&&!("v"in s))throw new Error("[Bug] atom state is not initialized");return s.v},zc=new WeakMap,zv=s=>{var t;return Lc(s)&&!!((t=zc.get(s))!=null&&t[0])},g5=s=>{const t=zc.get(s);t!=null&&t[0]&&(t[0]=!1,t[1].forEach(e=>e()))},n2=(s,t)=>{let e=zc.get(s);if(!e){e=[!0,new Set],zc.set(s,e);const r=()=>{e[0]=!1};s.then(r,r)}e[1].add(t)},Lc=s=>typeof(s==null?void 0:s.then)=="function",i2=(s,t,e)=>{e.p.has(s)||(e.p.add(s),t.then(()=>{e.p.delete(s)},()=>{e.p.delete(s)}))},xd=(s,t,e)=>{const r=e(s),l="v"in r,u=r.v;if(Lc(t))for(const h of r.d.keys())i2(s,t,e(h));r.v=t,delete r.e,(!l||!Object.is(u,r.v))&&(++r.n,Lc(u)&&g5(u))},Lv=(s,t,e)=>{var r;const l=new Set;for(const u of((r=e.get(s))==null?void 0:r.t)||[])e.has(u)&&l.add(u);for(const u of t.p)l.add(u);return l},v5=()=>{const s=new Set,t=()=>{s.forEach(e=>e())};return t.add=e=>(s.add(e),()=>{s.delete(e)}),t},Od=()=>{const s={},t=new WeakMap,e=r=>{var l,u;(l=t.get(s))==null||l.forEach(h=>h(r)),(u=t.get(r))==null||u.forEach(h=>h())};return e.add=(r,l)=>{const u=r||s,h=(t.has(u)?t:t.set(u,new Set)).get(u);return h.add(l),()=>{h==null||h.delete(l),h.size||t.delete(u)}},e},b5=s=>(s.c||(s.c=Od()),s.m||(s.m=Od()),s.u||(s.u=Od()),s.f||(s.f=v5()),s),S5=Symbol(),_5=(s=new WeakMap,t=new WeakMap,e=new WeakMap,r=new Set,l=new Set,u=new Set,h={},d=(S,..._)=>S.read(..._),y=(S,..._)=>S.write(..._),p=(S,_)=>{var T;return(T=S.unstable_onInit)==null?void 0:T.call(S,_)},m=(S,_)=>{var T;return(T=S.onMount)==null?void 0:T.call(S,_)},...v)=>{const S=v[0]||(H=>{if((Zo?"production":void 0)!=="production"&&!H)throw new Error("Atom is undefined or null");let q=s.get(H);return q||(q={d:new Map,p:new Set,n:0},s.set(H,q),p==null||p(H,W)),q}),_=v[1]||(()=>{const H=[],q=Y=>{try{Y()}catch(P){H.push(P)}};do{h.f&&q(h.f);const Y=new Set,P=Y.add.bind(Y);r.forEach(K=>{var Z;return(Z=t.get(K))==null?void 0:Z.l.forEach(P)}),r.clear(),u.forEach(P),u.clear(),l.forEach(P),l.clear(),Y.forEach(q),r.size&&T()}while(r.size||u.size||l.size);if(H.length)throw new AggregateError(H)}),T=v[2]||(()=>{const H=[],q=new WeakSet,Y=new WeakSet,P=Array.from(r);for(;P.length;){const K=P[P.length-1],Z=S(K);if(Y.has(K)){P.pop();continue}if(q.has(K)){if(e.get(K)===Z.n)H.push([K,Z]);else if((Zo?"production":void 0)!=="production"&&e.has(K))throw new Error("[Bug] invalidated atom exists");Y.add(K),P.pop();continue}q.add(K);for(const Ot of Lv(K,Z,t))q.has(Ot)||P.push(Ot)}for(let K=H.length-1;K>=0;--K){const[Z,Ot]=H[K];let ft=!1;for(const $t of Ot.d.keys())if($t!==Z&&r.has($t)){ft=!0;break}ft&&(O(Z),j(Z)),e.delete(Z)}}),O=v[3]||(H=>{var q;const Y=S(H);if(Nv(Y)&&(t.has(H)&&e.get(H)!==Y.n||Array.from(Y.d).every(([$,rt])=>O($).n===rt)))return Y;Y.d.clear();let P=!0;const K=()=>{t.has(H)&&(j(H),T(),_())},Z=$=>{var rt;if(Cv(H,$)){const E=S($);if(!Nv(E))if(Bv($))xd($,$.init,S);else throw new Error("no atom init");return Xu(E)}const Ft=O($);try{return Xu(Ft)}finally{Y.d.set($,Ft.n),zv(Y.v)&&i2(H,Y.v,Ft),(rt=t.get($))==null||rt.t.add(H),P||K()}};let Ot,ft;const $t={get signal(){return Ot||(Ot=new AbortController),Ot.signal},get setSelf(){return(Zo?"production":void 0)!=="production"&&!Td(H)&&console.warn("setSelf function cannot be used with read-only atom"),!ft&&Td(H)&&(ft=(...$)=>{if((Zo?"production":void 0)!=="production"&&P&&console.warn("setSelf function cannot be called in sync"),!P)try{return F(H,...$)}finally{T(),_()}}),ft}},k=Y.n;try{const $=d(H,Z,$t);return xd(H,$,S),Lc($)&&(n2($,()=>Ot==null?void 0:Ot.abort()),$.then(K,K)),Y}catch($){return delete Y.v,Y.e=$,++Y.n,Y}finally{P=!1,k!==Y.n&&e.get(H)===k&&(e.set(H,Y.n),r.add(H),(q=h.c)==null||q.call(h,H))}}),C=v[4]||(H=>{const q=[H];for(;q.length;){const Y=q.pop(),P=S(Y);for(const K of Lv(Y,P,t)){const Z=S(K);e.set(K,Z.n),q.push(K)}}}),F=v[5]||((H,...q)=>{let Y=!0;const P=Z=>Xu(O(Z)),K=(Z,...Ot)=>{var ft;const $t=S(Z);try{if(Cv(H,Z)){if(!Bv(Z))throw new Error("atom not writable");const k=$t.n,$=Ot[0];xd(Z,$,S),j(Z),k!==$t.n&&(r.add(Z),(ft=h.c)==null||ft.call(h,Z),C(Z));return}else return F(Z,...Ot)}finally{Y||(T(),_())}};try{return y(H,P,K,...q)}finally{Y=!1}}),j=v[6]||(H=>{var q;const Y=S(H),P=t.get(H);if(P&&!zv(Y.v)){for(const[K,Z]of Y.d)if(!P.d.has(K)){const Ot=S(K);R(K).t.add(H),P.d.add(K),Z!==Ot.n&&(r.add(K),(q=h.c)==null||q.call(h,K),C(K))}for(const K of P.d||[])if(!Y.d.has(K)){P.d.delete(K);const Z=N(K);Z==null||Z.t.delete(H)}}}),R=v[7]||(H=>{var q;const Y=S(H);let P=t.get(H);if(!P){O(H);for(const K of Y.d.keys())R(K).t.add(H);if(P={l:new Set,d:new Set(Y.d.keys()),t:new Set},t.set(H,P),(q=h.m)==null||q.call(h,H),Td(H)){const K=()=>{let Z=!0;const Ot=(...ft)=>{try{return F(H,...ft)}finally{Z||(T(),_())}};try{const ft=m(H,Ot);ft&&(P.u=()=>{Z=!0;try{ft()}finally{Z=!1}})}finally{Z=!1}};l.add(K)}}return P}),N=v[8]||(H=>{var q;const Y=S(H);let P=t.get(H);if(P&&!P.l.size&&!Array.from(P.t).some(K=>{var Z;return(Z=t.get(K))==null?void 0:Z.d.has(H)})){P.u&&u.add(P.u),P=void 0,t.delete(H),(q=h.u)==null||q.call(h,H);for(const K of Y.d.keys()){const Z=N(K);Z==null||Z.t.delete(H)}return}return P}),A=[s,t,e,r,l,u,h,d,y,p,m,S,_,T,O,C,F,j,R,N],W={get:H=>Xu(O(H)),set:(H,...q)=>{try{return F(H,...q)}finally{T(),_()}},sub:(H,q)=>{const P=R(H).l;return P.add(q),_(),()=>{P.delete(q),N(H),_()}}};return Object.defineProperty(W,S5,{value:A}),W},s2=_5,w5=b5,Uv=n2,Wp={};let A5=0;function on(s,t){const e=`atom${++A5}`,r={toString(){return(Wp?"production":void 0)!=="production"&&this.debugLabel?e+":"+this.debugLabel:e}};return typeof s=="function"?r.read=s:(r.init=s,r.read=E5,r.write=T5),t&&(r.write=t),r}function E5(s){return s(this)}function T5(s,t,e){return t(this,typeof e=="function"?e(s(this)):e)}const x5=()=>{let s=0;const t=w5({}),e=new WeakMap,r=new WeakMap,l=s2(e,r,void 0,void 0,void 0,void 0,t,void 0,(d,y,p,...m)=>s?p(d,...m):d.write(y,p,...m)),u=new Set;return t.m.add(void 0,d=>{u.add(d);const y=e.get(d);y.m=r.get(d)}),t.u.add(void 0,d=>{u.delete(d);const y=e.get(d);delete y.m}),Object.assign(l,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),e),dev4_get_mounted_atoms:()=>u,dev4_restore_atoms:d=>{const y={read:()=>null,write:(p,m)=>{++s;try{for(const[v,S]of d)"init"in v&&m(v,S)}finally{--s}}};l.set(y)}})};function r2(){return(Wp?"production":void 0)!=="production"?x5():s2()}let Wo;function O5(){return Wo||(Wo=r2(),(Wp?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Wo),globalThis.__JOTAI_DEFAULT_STORE__!==Wo&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Wo}const D5={},a2=it.createContext(void 0);function o2(s){return it.useContext(a2)||O5()}function M5({children:s,store:t}){const e=it.useRef(void 0);return!t&&!e.current&&(e.current=r2()),it.createElement(a2.Provider,{value:t||e.current},s)}const tp=s=>typeof(s==null?void 0:s.then)=="function",ep=s=>{s.status||(s.status="pending",s.then(t=>{s.status="fulfilled",s.value=t},t=>{s.status="rejected",s.reason=t}))},R5=ji.use||(s=>{if(s.status==="pending")throw s;if(s.status==="fulfilled")return s.value;throw s.status==="rejected"?s.reason:(ep(s),s)}),Dd=new WeakMap,Iv=(s,t)=>{let e=Dd.get(s);return e||(e=new Promise((r,l)=>{let u=s;const h=p=>m=>{u===p&&r(m)},d=p=>m=>{u===p&&l(m)},y=()=>{try{const p=t();tp(p)?(Dd.set(p,e),u=p,p.then(h(p),d(p)),Uv(p,y)):r(p)}catch(p){l(p)}};s.then(h(s),d(s)),Uv(s,y)}),Dd.set(s,e)),e};function qa(s,t){const{delay:e,unstable_promiseStatus:r=!ji.use}={},l=o2(),[[u,h,d],y]=it.useReducer(m=>{const v=l.get(s);return Object.is(m[0],v)&&m[1]===l&&m[2]===s?m:[v,l,s]},void 0,()=>[l.get(s),l,s]);let p=u;if((h!==l||d!==s)&&(y(),p=l.get(s)),it.useEffect(()=>{const m=l.sub(s,()=>{if(r)try{const v=l.get(s);tp(v)&&ep(Iv(v,()=>l.get(s)))}catch{}if(typeof e=="number"){setTimeout(y,e);return}y()});return y(),m},[l,s,e,r]),it.useDebugValue(p),tp(p)){const m=Iv(p,()=>l.get(s));return r&&ep(m),R5(m)}return p}function Uc(s,t){const e=o2();return it.useCallback((...l)=>{if((D5?"production":void 0)!=="production"&&!("write"in s))throw new Error("not writable atom");return e.set(s,...l)},[e,s])}function wr(s,t){return[qa(s),Uc(s)]}const C5=s=>`region-${btoa(JSON.stringify({content:s.content,start:s.start,end:s.end}))}`,B5=(s,t=50)=>{if(s.startsWith("rgba(")){const e=s.slice(5,-1).split(",");if(e.length===4){const[r,l,u,h]=e.map(d=>parseFloat(d.trim()));return`rgba(${Math.min(255,r+t)}, ${Math.min(255,l+t)}, ${Math.min(255,u+t)}, ${h})`}}else if(s.startsWith("rgb(")){const e=s.slice(4,-1).split(",");if(e.length===3){const[r,l,u]=e.map(h=>parseInt(h.trim()));return`rgb(${Math.min(255,r+t)}, ${Math.min(255,l+t)}, ${Math.min(255,u+t)})`}}else if(s.startsWith("#")){const e=s.slice(1),r=parseInt(e,16);let l=r>>16&255,u=r>>8&255,h=r&255;return l=Math.min(255,l+t),u=Math.min(255,u+t),h=Math.min(255,h+t),`#${(l<<16|u<<8|h).toString(16).padStart(6,"0")}`}return s};var Md,Fv;function N5(){return Fv||(Fv=1,Md={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}),Md}var Rd,jv;function z5(){if(jv)return Rd;jv=1;function s(t,e,r){return t*(1-r)+e*r}return Rd=s,Rd}var Cd,Hv;function L5(){if(Hv)return Cd;Hv=1;var s=N5(),t=z5();Cd=e;function e(h){var d,y,p,m,v,S,_,T,j,O,C;if(h||(h={}),T=(h.nshades||72)-1,_=h.format||"hex",S=h.colormap,S||(S="jet"),typeof S=="string"){if(S=S.toLowerCase(),!s[S])throw Error(S+" not a supported colorscale");v=s[S]}else if(Array.isArray(S))v=S.slice();else throw Error("unsupported colormap option",S);if(v.length>T+1)throw new Error(S+" map requires nshades to be at least size "+v.length);Array.isArray(h.alpha)?h.alpha.length!==2?O=[1,1]:O=h.alpha.slice():typeof h.alpha=="number"?O=[h.alpha,h.alpha]:O=[1,1],d=v.map(function(A){return Math.round(A.index*T)}),O[0]=Math.min(Math.max(O[0],0),1),O[1]=Math.min(Math.max(O[1],0),1);var F=v.map(function(A,W){var H=v[W].index,q=v[W].rgb.slice();return q.length===4&&q[3]>=0&&q[3]<=1||(q[3]=O[0]+(O[1]-O[0])*H),q}),j=[];for(C=0;C<d.length-1;++C){m=d[C+1]-d[C],y=F[C],p=F[C+1];for(var R=0;R<m;R++){var N=R/m;j.push([Math.round(t(y[0],p[0],N)),Math.round(t(y[1],p[1],N)),Math.round(t(y[2],p[2],N)),t(y[3],p[3],N)])}}return j.push(v[v.length-1].rgb.concat(O[1])),_==="hex"?j=j.map(l):_==="rgbaString"?j=j.map(u):_==="float"&&(j=j.map(r)),j}function r(h){return[h[0]/255,h[1]/255,h[2]/255,h[3]]}function l(h){for(var d,y="#",p=0;p<3;++p)d=h[p],d=d.toString(16),y+=("00"+d).substr(d.length);return y}function u(h){return"rgba("+h.join(",")+")"}return Cd}var U5=L5();const I5=Hc(U5),Qc=on([]);on(null);const F5=(s,t)=>!s||s.length===0?[]:I5({colormap:t||"magma",nshades:Math.max(s.length,10),format:"rgbaString",alpha:.2});function l2(s,t){return{...s,...t}}function j5(s){const t=s.id||C5(s);return l2(s,{id:t})}function H5(s,t){return l2(s,{color:t,lightenedColor:B5(t)})}const u2=on(null),k5=on(null,(s,t,{regions:e,colormapName:r})=>{const l=F5(e,r),u=e.map((d,y)=>H5(j5(d),l[y%l.length]));console.log("[setRegionsAtom] processed",u);const h=u.filter((d,y,p)=>y===p.findIndex(m=>m.id===d.id));t(Qc,h)});on(null,(s,t)=>{t(Qc,[])});const Pp=on(!1);on(null,(s,t,e)=>{t(Pp,e)});function Ce(s,t,e,r){return new(e||(e=Promise))(function(l,u){function h(p){try{y(r.next(p))}catch(m){u(m)}}function d(p){try{y(r.throw(p))}catch(m){u(m)}}function y(p){var m;p.done?l(p.value):(m=p.value,m instanceof e?m:new e(function(v){v(m)})).then(h,d)}y((r=r.apply(s,t||[])).next())})}let El=class{constructor(){this.listeners={}}on(t,e,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),r==null?void 0:r.once){const l=()=>{this.un(t,l),this.un(t,e)};return this.on(t,l),l}return()=>this.un(t,e)}un(t,e){var r;(r=this.listeners[t])===null||r===void 0||r.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(r=>r(...e))}};const Wu={decode:function(s,t){return Ce(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const r=e[0];if(r.some(l=>l>1||l<-1)){const l=r.length;let u=0;for(let h=0;h<l;h++){const d=Math.abs(r[h]);d>u&&(u=d)}for(const h of e)for(let d=0;d<l;d++)h[d]/=u}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function c2(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[r,l]of Object.entries(t))if(r==="children")for(const[u,h]of Object.entries(t))typeof h=="string"?e.appendChild(document.createTextNode(h)):e.appendChild(c2(u,h));else r==="style"?Object.assign(e.style,l):r==="textContent"?e.textContent=l:e.setAttribute(r,l.toString());return e}function kv(s,t,e){const r=c2(s,t||{});return e==null||e.appendChild(r),r}var V5=Object.freeze({__proto__:null,createElement:kv,default:kv});const q5={fetchBlob:function(s,t,e){return Ce(this,void 0,void 0,function*(){const r=yield fetch(s,e);if(r.status>=400)throw new Error(`Failed to fetch ${s}: ${r.status} (${r.statusText})`);return function(l,u){Ce(this,void 0,void 0,function*(){if(!l.body||!l.headers)return;const h=l.body.getReader(),d=Number(l.headers.get("Content-Length"))||0;let y=0;const p=v=>Ce(this,void 0,void 0,function*(){y+=(v==null?void 0:v.length)||0;const S=Math.round(y/d*100);u(S)}),m=()=>Ce(this,void 0,void 0,function*(){let v;try{v=yield h.read()}catch{return}v.done||(p(v.value),yield m())});m()})}(r.clone(),t),r.blob()})}};let Y5=class extends El{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,r){return this.media.addEventListener(t,e,r),()=>this.media.removeEventListener(t,e,r)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const r=this.getSrc();if(t&&r===t)return;this.revokeSrc();const l=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;r&&(this.media.src="");try{this.media.src=l}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return Ce(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}},np=class ip extends El{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const r=this.parentFromOptionsContainer(t.container);this.parent=r;const[l,u]=this.initHtml();r.appendChild(l),this.container=l,this.scrollContainer=u.querySelector(".scroll"),this.wrapper=u.querySelector(".wrapper"),this.canvasWrapper=u.querySelector(".canvases"),this.progressWrapper=u.querySelector(".progress"),this.cursor=u.querySelector(".cursor"),e&&u.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const r=this.wrapper.getBoundingClientRect(),l=e.clientX-r.left,u=e.clientY-r.top;return[l/r.width,u/r.height]};if(this.wrapper.addEventListener("click",e=>{const[r,l]=t(e);this.emit("click",r,l)}),this.wrapper.addEventListener("dblclick",e=>{const[r,l]=t(e);this.emit("dblclick",r,l)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:r,clientWidth:l}=this.scrollContainer,u=e/r,h=(e+l)/r;this.emit("scroll",u,h,e,e+l)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,r,l,u=3,h=0,d=100){if(!t)return()=>{};const y=matchMedia("(pointer: coarse)").matches;let p=()=>{};const m=v=>{if(v.button!==h)return;v.preventDefault(),v.stopPropagation();let S=v.clientX,_=v.clientY,T=!1;const O=Date.now(),C=A=>{if(A.preventDefault(),A.stopPropagation(),y&&Date.now()-O<d)return;const W=A.clientX,H=A.clientY,q=W-S,Y=H-_;if(T||Math.abs(q)>u||Math.abs(Y)>u){const P=t.getBoundingClientRect(),{left:K,top:Z}=P;T||(r==null||r(S-K,_-Z),T=!0),e(q,Y,W-K,H-Z),S=W,_=H}},F=A=>{if(T){const W=A.clientX,H=A.clientY,q=t.getBoundingClientRect(),{left:Y,top:P}=q;l==null||l(W-Y,H-P)}p()},j=A=>{A.relatedTarget&&A.relatedTarget!==document.documentElement||F(A)},R=A=>{T&&(A.stopPropagation(),A.preventDefault())},N=A=>{T&&A.preventDefault()};document.addEventListener("pointermove",C),document.addEventListener("pointerup",F),document.addEventListener("pointerout",j),document.addEventListener("pointercancel",j),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("click",R,{capture:!0}),p=()=>{document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",F),document.removeEventListener("pointerout",j),document.removeEventListener("pointercancel",j),document.removeEventListener("touchmove",N),setTimeout(()=>{document.removeEventListener("click",R,{capture:!0})},10)}};return t.addEventListener("pointerdown",m),()=>{p(),t.removeEventListener("pointerdown",m)}}(this.wrapper,(t,e,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var r;const l=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const u=this.parent.clientHeight||128;return e!=null&&e.every(h=>!h.overlay)?u/l:u}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),r=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
      <style${r?` nonce="${r}"`:""}>
        :host {
          user-select: none;
          min-width: 1px;
        }
        :host audio {
          display: block;
          width: 100%;
        }
        :host .scroll {
          overflow-x: auto;
          overflow-y: hidden;
          width: 100%;
          position: relative;
        }
        :host .noScrollbar {
          scrollbar-color: transparent;
          scrollbar-width: none;
        }
        :host .noScrollbar::-webkit-scrollbar {
          display: none;
          -webkit-appearance: none;
        }
        :host .wrapper {
          position: relative;
          overflow: visible;
          z-index: 2;
        }
        :host .canvases {
          min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;
        }
        :host .canvases > div {
          position: relative;
        }
        :host canvas {
          display: block;
          position: absolute;
          top: 0;
          image-rendering: pixelated;
        }
        :host .progress {
          pointer-events: none;
          position: absolute;
          z-index: 2;
          top: 0;
          left: 0;
          width: 0;
          height: 100%;
          overflow: hidden;
        }
        :host .progress > div {
          position: relative;
        }
        :host .cursor {
          pointer-events: none;
          position: absolute;
          z-index: 5;
          top: 0;
          left: 0;
          height: 100%;
          border-radius: 2px;
        }
      </style>

      <div class="scroll" part="scroll">
        <div class="wrapper" part="wrapper">
          <div class="canvases" part="canvases"></div>
          <div class="progress" part="progress"></div>
          <div class="cursor" part="cursor"></div>
        </div>
      </div>
    `,[t,e]}setOptions(t){if(this.options.container!==t.container){const e=this.parentFromOptionsContainer(t.container);e.appendChild(this.container),this.parent=e}t.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=t,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:e}=this.scrollContainer,r=e*t;this.setScroll(r)}destroy(){var t,e;this.subscriptions.forEach(r=>r()),this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.unsubscribeOnScroll)===null||e===void 0||e.forEach(r=>r()),this.unsubscribeOnScroll=[]}createDelay(t=10){let e,r;const l=()=>{e&&clearTimeout(e),r&&r()};return this.timeouts.push(l),()=>new Promise((u,h)=>{l(),r=h,e=setTimeout(()=>{e=void 0,r=void 0,u()},t)})}convertColorValues(t){if(!Array.isArray(t))return t||"";if(t.length<2)return t[0]||"";const e=document.createElement("canvas"),r=e.getContext("2d"),l=e.height*(window.devicePixelRatio||1),u=r.createLinearGradient(0,0,0,l),h=1/(t.length-1);return t.forEach((d,y)=>{const p=y*h;u.addColorStop(p,d)}),u}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(t,e,r,l){const u=t[0],h=t[1]||t[0],d=u.length,{width:y,height:p}=r.canvas,m=p/2,v=this.getPixelRatio(),S=e.barWidth?e.barWidth*v:1,_=e.barGap?e.barGap*v:e.barWidth?S/2:0,T=e.barRadius||0,O=y/(S+_)/d,C=T&&"roundRect"in r?"roundRect":"rect";r.beginPath();let F=0,j=0,R=0;for(let N=0;N<=d;N++){const A=Math.round(N*O);if(A>F){const q=Math.round(j*m*l),Y=q+Math.round(R*m*l)||1;let P=m-q;e.barAlign==="top"?P=0:e.barAlign==="bottom"&&(P=p-Y),r[C](F*(S+_),P,S,Y,T),F=A,j=0,R=0}const W=Math.abs(u[N]||0),H=Math.abs(h[N]||0);W>j&&(j=W),H>R&&(R=H)}r.fill(),r.closePath()}renderLineWaveform(t,e,r,l){const u=h=>{const d=t[h]||t[0],y=d.length,{height:p}=r.canvas,m=p/2,v=r.canvas.width/y;r.moveTo(0,m);let S=0,_=0;for(let T=0;T<=y;T++){const O=Math.round(T*v);if(O>S){const F=m+(Math.round(_*m*l)||1)*(h===0?-1:1);r.lineTo(S,F),S=O,_=0}const C=Math.abs(d[T]||0);C>_&&(_=C)}r.lineTo(S,m)};r.beginPath(),u(0),u(1),r.fill(),r.closePath()}renderWaveform(t,e,r){if(r.fillStyle=this.convertColorValues(e.waveColor),e.renderFunction)return void e.renderFunction(t,r);let l=e.barHeight||1;if(e.normalize){const u=Array.from(t[0]).reduce((h,d)=>Math.max(h,Math.abs(d)),0);l=u?1/u:1}e.barWidth||e.barGap||e.barAlign?this.renderBarWaveform(t,e,r,l):this.renderLineWaveform(t,e,r,l)}renderSingleCanvas(t,e,r,l,u,h,d){const y=this.getPixelRatio(),p=document.createElement("canvas");p.width=Math.round(r*y),p.height=Math.round(l*y),p.style.width=`${r}px`,p.style.height=`${l}px`,p.style.left=`${Math.round(u)}px`,h.appendChild(p);const m=p.getContext("2d");if(this.renderWaveform(t,e,m),p.width>0&&p.height>0){const v=p.cloneNode(),S=v.getContext("2d");S.drawImage(p,0,0),S.globalCompositeOperation="source-in",S.fillStyle=this.convertColorValues(e.progressColor),S.fillRect(0,0,p.width,p.height),d.appendChild(v)}}renderMultiCanvas(t,e,r,l,u,h){const d=this.getPixelRatio(),{clientWidth:y}=this.scrollContainer,p=r/d;let m=Math.min(ip.MAX_CANVAS_WIDTH,y,p),v={};if(m===0)return;if(e.barWidth||e.barGap){const C=e.barWidth||.5,F=C+(e.barGap||C/2);m%F!=0&&(m=Math.floor(m/F)*F)}const S=C=>{if(C<0||C>=_||v[C])return;v[C]=!0;const F=C*m,j=Math.min(p-F,m);if(j<=0)return;const R=t.map(N=>{const A=Math.floor(F/p*N.length),W=Math.floor((F+j)/p*N.length);return N.slice(A,W)});this.renderSingleCanvas(R,e,j,l,F,u,h)},_=Math.ceil(p/m);if(!this.isScrollable){for(let C=0;C<_;C++)S(C);return}const T=this.scrollContainer.scrollLeft/p,O=Math.floor(T*_);if(S(O-1),S(O),S(O+1),_>1){const C=this.on("scroll",()=>{const{scrollLeft:F}=this.scrollContainer,j=Math.floor(F/p*_);Object.keys(v).length>ip.MAX_NODES&&(u.innerHTML="",h.innerHTML="",v={}),S(j-1),S(j),S(j+1)});this.unsubscribeOnScroll.push(C)}}renderChannel(t,e,r,l){var{overlay:u}=e,h=function(m,v){var S={};for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&v.indexOf(_)<0&&(S[_]=m[_]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var T=0;for(_=Object.getOwnPropertySymbols(m);T<_.length;T++)v.indexOf(_[T])<0&&Object.prototype.propertyIsEnumerable.call(m,_[T])&&(S[_[T]]=m[_[T]])}return S}(e,["overlay"]);const d=document.createElement("div"),y=this.getHeight(h.height,h.splitChannels);d.style.height=`${y}px`,u&&l>0&&(d.style.marginTop=`-${y}px`),this.canvasWrapper.style.minHeight=`${y}px`,this.canvasWrapper.appendChild(d);const p=d.cloneNode();this.progressWrapper.appendChild(p),this.renderMultiCanvas(t,h,r,y,d,p)}render(t){return Ce(this,void 0,void 0,function*(){var e;this.timeouts.forEach(y=>y()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),l=this.scrollContainer.clientWidth,u=Math.ceil(t.duration*(this.options.minPxPerSec||0));this.isScrollable=u>l;const h=this.options.fillParent&&!this.isScrollable,d=(h?l:u)*r;if(this.wrapper.style.width=h?"100%":`${u}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=t,this.emit("render"),this.options.splitChannels)for(let y=0;y<t.numberOfChannels;y++){const p=Object.assign(Object.assign({},this.options),(e=this.options.splitChannels)===null||e===void 0?void 0:e[y]);this.renderChannel([t.getChannelData(y)],p,d,y)}else{const y=[t.getChannelData(0)];t.numberOfChannels>1&&y.push(t.getChannelData(1)),this.renderChannel(y,this.options,d,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){if(this.unsubscribeOnScroll.forEach(r=>r()),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:e}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:r}=this.progressWrapper.getBoundingClientRect();let l=r-e;l*=2,l=l<0?Math.floor(l):Math.ceil(l),l/=2,this.scrollContainer.scrollLeft+=l}}zoom(t){this.options.minPxPerSec=t,this.reRender()}scrollIntoView(t,e=!1){const{scrollLeft:r,scrollWidth:l,clientWidth:u}=this.scrollContainer,h=t*l,d=r,y=r+u,p=u/2;if(this.isDragging)h+30>y?this.scrollContainer.scrollLeft+=30:h-30<d&&(this.scrollContainer.scrollLeft-=30);else{(h<d||h>y)&&(this.scrollContainer.scrollLeft=h-(this.options.autoCenter?p:0));const m=h-r-p;e&&this.options.autoCenter&&m>0&&(this.scrollContainer.scrollLeft+=Math.min(m,10))}{const m=this.scrollContainer.scrollLeft,v=m/l,S=(m+u)/l;this.emit("scroll",v,S,m,m+u)}}renderProgress(t,e){if(isNaN(t))return;const r=100*t;this.canvasWrapper.style.clipPath=`polygon(${r}% 0, 100% 0, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(t,e)}exportImage(t,e,r){return Ce(this,void 0,void 0,function*(){const l=this.canvasWrapper.querySelectorAll("canvas");if(!l.length)throw new Error("No waveform data");if(r==="dataURL"){const u=Array.from(l).map(h=>h.toDataURL(t,e));return Promise.resolve(u)}return Promise.all(Array.from(l).map(u=>new Promise((h,d)=>{u.toBlob(y=>{y?h(y):d(new Error("Could not export image"))},t,e)})))})}};np.MAX_CANVAS_WIDTH=8e3,np.MAX_NODES=10;let Q5=class extends El{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}},Bd=class extends El{constructor(t=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=t,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Ce(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(t){if(this.currentSrc=t,this._duration=void 0,!t)return this.buffer=null,void this.emit("emptied");fetch(t).then(e=>{if(e.status>=400)throw new Error(`Failed to fetch ${t}: ${e.status} (${e.statusText})`);return e.arrayBuffer()}).then(e=>this.currentSrc!==t?null:this.audioContext.decodeAudioData(e)).then(e=>{this.currentSrc===t&&(this.buffer=e,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var t;if(!this.paused)return;this.paused=!1,(t=this.bufferNode)===null||t===void 0||t.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let e=this.playedDuration*this._playbackRate;(e>=this.duration||e<0)&&(e=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,e),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var t;this.paused=!0,(t=this.bufferNode)===null||t===void 0||t.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return Ce(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(t){const e=t-this.currentTime,r=this.bufferNode;r==null||r.stop(this.audioContext.currentTime+e),r==null||r.addEventListener("ended",()=>{r===this.bufferNode&&(this.bufferNode=null,this.pause())},{once:!0})}setSinkId(t){return Ce(this,void 0,void 0,function*(){return this.audioContext.setSinkId(t)})}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this.bufferNode&&(this.bufferNode.playbackRate.value=t)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(t){const e=!this.paused;e&&this._pause(),this.playedDuration=t/this._playbackRate,e&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var t,e;return(t=this._duration)!==null&&t!==void 0?t:((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t,this.emit("volumechange")}get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const e=this.buffer.numberOfChannels;for(let r=0;r<e;r++)t.push(this.buffer.getChannelData(r));return t}};const G5={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};let Ic=class h2 extends Y5{static create(t){return new h2(t)}constructor(t){const e=t.media||(t.backend==="WebAudio"?new Bd:void 0);super({media:e,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate}),this.plugins=[],this.decodedData=null,this.stopAtPosition=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},G5,t),this.timer=new Q5;const r=e?void 0:this.getMediaElement();this.renderer=new np(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const l=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:u,duration:h}=this.options;(l||u&&h)&&this.load(l,u,h).catch(()=>null)})}updateProgress(t=this.getCurrentTime()){return this.renderer.renderProgress(t/this.getDuration(),this.isPlaying()),t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t),this.emit("audioprocess",t),this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition&&this.pause()}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const t=this.updateProgress();this.emit("timeupdate",t)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("emptied",()=>{this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("ended",()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error")),this.stopAtPosition=null}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(t,e)=>{this.options.interact&&(this.seekTo(t),this.emit("interaction",t*this.getDuration()),this.emit("click",t,e))}),this.renderer.on("dblclick",(t,e)=>{this.emit("dblclick",t,e)}),this.renderer.on("scroll",(t,e,r,l)=>{const u=this.getDuration();this.emit("scroll",t*u,e*u,r,l)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",t=>{this.emit("dragstart",t)}),this.renderer.on("dragend",t=>{this.emit("dragend",t)}));{let t;this.subscriptions.push(this.renderer.on("drag",e=>{if(!this.options.interact)return;let r;this.renderer.renderProgress(e),clearTimeout(t),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),t=setTimeout(()=>{this.seekTo(e)},r),this.emit("interaction",e*this.getDuration()),this.emit("drag",e)}))}}initPlugins(){var t;!((t=this.options.plugins)===null||t===void 0)&&t.length&&this.options.plugins.forEach(e=>{this.registerPlugin(e)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(t=>t()),this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t),t.duration&&!t.peaks&&(this.decodedData=Wu.createBuffer(this.exportPeaks(),t.duration)),t.peaks&&t.duration&&(this.decodedData=Wu.createBuffer(t.peaks,t.duration)),this.renderer.setOptions(this.options),t.audioRate&&this.setPlaybackRate(t.audioRate),t.mediaControls!=null&&(this.getMediaElement().controls=t.mediaControls)}registerPlugin(t){return t._init(this),this.plugins.push(t),this.subscriptions.push(t.once("destroy",()=>{this.plugins=this.plugins.filter(e=>e!==t)})),t}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const e=t/this.getDuration();this.renderer.setScrollPercentage(e)}getActivePlugins(){return this.plugins}loadAudio(t,e,r,l){return Ce(this,void 0,void 0,function*(){var u;if(this.emit("load",t),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,!e&&!r){const d=this.options.fetchParams||{};window.AbortController&&!d.signal&&(this.abortController=new AbortController,d.signal=(u=this.abortController)===null||u===void 0?void 0:u.signal);const y=m=>this.emit("loading",m);e=yield q5.fetchBlob(t,y,d);const p=this.options.blobMimeType;p&&(e=new Blob([e],{type:p}))}this.setSrc(t,e);const h=yield new Promise(d=>{const y=l||this.getDuration();y?d(y):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>d(this.getDuration()),{once:!0}))});if(!t&&!e){const d=this.getMediaElement();d instanceof Bd&&(d.duration=h)}if(r)this.decodedData=Wu.createBuffer(r,h||0);else if(e){const d=yield e.arrayBuffer();this.decodedData=yield Wu.decode(d,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(t,e,r){return Ce(this,void 0,void 0,function*(){try{return yield this.loadAudio(t,void 0,e,r)}catch(l){throw this.emit("error",l),l}})}loadBlob(t,e,r){return Ce(this,void 0,void 0,function*(){try{return yield this.loadAudio("",t,e,r)}catch(l){throw this.emit("error",l),l}})}zoom(t){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(t),this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:e=8e3,precision:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const l=Math.min(t,this.decodedData.numberOfChannels),u=[];for(let h=0;h<l;h++){const d=this.decodedData.getChannelData(h),y=[],p=d.length/e;for(let m=0;m<e;m++){const v=d.slice(Math.floor(m*p),Math.ceil((m+1)*p));let S=0;for(let _=0;_<v.length;_++){const T=v[_];Math.abs(T)>Math.abs(S)&&(S=T)}y.push(Math.round(S*r)/r)}u.push(y)}return u}getDuration(){let t=super.getDuration()||0;return t!==0&&t!==1/0||!this.decodedData||(t=this.decodedData.duration),t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null,super.setTime(t),this.updateProgress(t),this.emit("timeupdate",t)}seekTo(t){const e=this.getDuration()*t;this.setTime(e)}play(t,e){const r=Object.create(null,{play:{get:()=>super.play}});return Ce(this,void 0,void 0,function*(){t!=null&&this.setTime(t);const l=yield r.play.call(this);return e!=null&&(this.media instanceof Bd?this.media.stopAt(e):this.stopAtPosition=e),l})}playPause(){return Ce(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents(),super.setMediaElement(t),this.initPlayerEvents()}exportImage(){return Ce(this,arguments,void 0,function*(t="image/png",e=1,r="dataURL"){return this.renderer.exportImage(t,e,r)})}destroy(){var t;this.emit("destroy"),(t=this.abortController)===null||t===void 0||t.abort(),this.plugins.forEach(e=>e.destroy()),this.subscriptions.forEach(e=>e()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}};Ic.BasePlugin=class extends El{constructor(s){super(),this.subscriptions=[],this.options=s}onInit(){}_init(s){this.wavesurfer=s,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(s=>s())}},Ic.dom=V5;let f2=class{constructor(){this.listeners={}}on(t,e,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),r==null?void 0:r.once){const l=()=>{this.un(t,l),this.un(t,e)};return this.on(t,l),l}return()=>this.un(t,e)}un(t,e){var r;(r=this.listeners[t])===null||r===void 0||r.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(r=>r(...e))}},X5=class extends f2{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}};function sc(s,t,e,r,l=3,u=0,h=100){if(!s)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let y=()=>{};const p=m=>{if(m.button!==u)return;m.preventDefault(),m.stopPropagation();let v=m.clientX,S=m.clientY,_=!1;const T=Date.now(),O=N=>{if(N.preventDefault(),N.stopPropagation(),d&&Date.now()-T<h)return;const A=N.clientX,W=N.clientY,H=A-v,q=W-S;if(_||Math.abs(H)>l||Math.abs(q)>l){const Y=s.getBoundingClientRect(),{left:P,top:K}=Y;_||(e==null||e(v-P,S-K),_=!0),t(H,q,A-P,W-K),v=A,S=W}},C=N=>{if(_){const A=N.clientX,W=N.clientY,H=s.getBoundingClientRect(),{left:q,top:Y}=H;r==null||r(A-q,W-Y)}y()},F=N=>{N.relatedTarget&&N.relatedTarget!==document.documentElement||C(N)},j=N=>{_&&(N.stopPropagation(),N.preventDefault())},R=N=>{_&&N.preventDefault()};document.addEventListener("pointermove",O),document.addEventListener("pointerup",C),document.addEventListener("pointerout",F),document.addEventListener("pointercancel",F),document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("click",j,{capture:!0}),y=()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",C),document.removeEventListener("pointerout",F),document.removeEventListener("pointercancel",F),document.removeEventListener("touchmove",R),setTimeout(()=>{document.removeEventListener("click",j,{capture:!0})},10)}};return s.addEventListener("pointerdown",p),()=>{y(),s.removeEventListener("pointerdown",p)}}function d2(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[r,l]of Object.entries(t))if(r==="children")for(const[u,h]of Object.entries(t))typeof h=="string"?e.appendChild(document.createTextNode(h)):e.appendChild(d2(u,h));else r==="style"?Object.assign(e.style,l):r==="textContent"?e.textContent=l:e.setAttribute(r,l.toString());return e}function Ko(s,t,e){const r=d2(s,t||{});return e==null||e.appendChild(r),r}let Vv=class extends f2{constructor(t,e,r=0){var l,u,h,d,y,p,m,v,S,_;super(),this.totalDuration=e,this.numberOfChannels=r,this.minLength=0,this.maxLength=1/0,this.contentEditable=!1,this.subscriptions=[],this.subscriptions=[],this.id=t.id||`region-${Math.random().toString(32).slice(2)}`,this.start=this.clampPosition(t.start),this.end=this.clampPosition((l=t.end)!==null&&l!==void 0?l:t.start),this.drag=(u=t.drag)===null||u===void 0||u,this.resize=(h=t.resize)===null||h===void 0||h,this.resizeStart=(d=t.resizeStart)===null||d===void 0||d,this.resizeEnd=(y=t.resizeEnd)===null||y===void 0||y,this.color=(p=t.color)!==null&&p!==void 0?p:"rgba(0, 0, 0, 0.1)",this.minLength=(m=t.minLength)!==null&&m!==void 0?m:this.minLength,this.maxLength=(v=t.maxLength)!==null&&v!==void 0?v:this.maxLength,this.channelIdx=(S=t.channelIdx)!==null&&S!==void 0?S:-1,this.contentEditable=(_=t.contentEditable)!==null&&_!==void 0?_:this.contentEditable,this.element=this.initElement(),this.setContent(t.content),this.setPart(),this.renderPosition(),this.initMouseEvents()}clampPosition(t){return Math.max(0,Math.min(this.totalDuration,t))}setPart(){const t=this.start===this.end;this.element.setAttribute("part",`${t?"marker":"region"} ${this.id}`)}addResizeHandles(t){const e={position:"absolute",zIndex:"2",width:"6px",height:"100%",top:"0",cursor:"ew-resize",wordBreak:"keep-all"},r=Ko("div",{part:"region-handle region-handle-left",style:Object.assign(Object.assign({},e),{left:"0",borderLeft:"2px solid rgba(0, 0, 0, 0.5)",borderRadius:"2px 0 0 2px"})},t),l=Ko("div",{part:"region-handle region-handle-right",style:Object.assign(Object.assign({},e),{right:"0",borderRight:"2px solid rgba(0, 0, 0, 0.5)",borderRadius:"0 2px 2px 0"})},t);this.subscriptions.push(sc(r,u=>this.onResize(u,"start"),()=>null,()=>this.onEndResizing(),1),sc(l,u=>this.onResize(u,"end"),()=>null,()=>this.onEndResizing(),1))}removeResizeHandles(t){const e=t.querySelector('[part*="region-handle-left"]'),r=t.querySelector('[part*="region-handle-right"]');e&&t.removeChild(e),r&&t.removeChild(r)}initElement(){const t=this.start===this.end;let e=0,r=100;this.channelIdx>=0&&this.channelIdx<this.numberOfChannels&&(r=100/this.numberOfChannels,e=r*this.channelIdx);const l=Ko("div",{style:{position:"absolute",top:`${e}%`,height:`${r}%`,backgroundColor:t?"none":this.color,borderLeft:t?"2px solid "+this.color:"none",borderRadius:"2px",boxSizing:"border-box",transition:"background-color 0.2s ease",cursor:this.drag?"grab":"default",pointerEvents:"all"}});return!t&&this.resize&&this.addResizeHandles(l),l}renderPosition(){const t=this.start/this.totalDuration,e=(this.totalDuration-this.end)/this.totalDuration;this.element.style.left=100*t+"%",this.element.style.right=100*e+"%"}toggleCursor(t){var e;this.drag&&(!((e=this.element)===null||e===void 0)&&e.style)&&(this.element.style.cursor=t?"grabbing":"grab")}initMouseEvents(){const{element:t}=this;t&&(t.addEventListener("click",e=>this.emit("click",e)),t.addEventListener("mouseenter",e=>this.emit("over",e)),t.addEventListener("mouseleave",e=>this.emit("leave",e)),t.addEventListener("dblclick",e=>this.emit("dblclick",e)),t.addEventListener("pointerdown",()=>this.toggleCursor(!0)),t.addEventListener("pointerup",()=>this.toggleCursor(!1)),this.subscriptions.push(sc(t,e=>this.onMove(e),()=>this.toggleCursor(!0),()=>{this.toggleCursor(!1),this.drag&&this.emit("update-end")})),this.contentEditable&&this.content&&(this.content.addEventListener("click",e=>this.onContentClick(e)),this.content.addEventListener("blur",()=>this.onContentBlur())))}_onUpdate(t,e){if(!this.element.parentElement)return;const{width:r}=this.element.parentElement.getBoundingClientRect(),l=t/r*this.totalDuration,u=e&&e!=="start"?this.start:this.start+l,h=e&&e!=="end"?this.end:this.end+l,d=h-u;u>=0&&h<=this.totalDuration&&u<=h&&d>=this.minLength&&d<=this.maxLength&&(this.start=u,this.end=h,this.renderPosition(),this.emit("update",e))}onMove(t){this.drag&&this._onUpdate(t)}onResize(t,e){this.resize&&(this.resizeStart||e!=="start")&&(this.resizeEnd||e!=="end")&&this._onUpdate(t,e)}onEndResizing(){this.resize&&this.emit("update-end")}onContentClick(t){t.stopPropagation(),t.target.focus(),this.emit("click",t)}onContentBlur(){this.emit("update-end")}_setTotalDuration(t){this.totalDuration=t,this.renderPosition()}play(t){this.emit("play",t&&this.end!==this.start?this.end:void 0)}setContent(t){var e;if((e=this.content)===null||e===void 0||e.remove(),t){if(typeof t=="string"){const r=this.start===this.end;this.content=Ko("div",{style:{padding:`0.2em ${r?.2:.4}em`,display:"inline-block"},textContent:t})}else this.content=t;this.contentEditable&&(this.content.contentEditable="true"),this.content.setAttribute("part","region-content"),this.element.appendChild(this.content)}else this.content=void 0}setOptions(t){var e,r;if(t.color&&(this.color=t.color,this.element.style.backgroundColor=this.color),t.drag!==void 0&&(this.drag=t.drag,this.element.style.cursor=this.drag?"grab":"default"),t.start!==void 0||t.end!==void 0){const l=this.start===this.end;this.start=this.clampPosition((e=t.start)!==null&&e!==void 0?e:this.start),this.end=this.clampPosition((r=t.end)!==null&&r!==void 0?r:l?this.start:this.end),this.renderPosition(),this.setPart()}if(t.content&&this.setContent(t.content),t.id&&(this.id=t.id,this.setPart()),t.resize!==void 0&&t.resize!==this.resize){const l=this.start===this.end;this.resize=t.resize,this.resize&&!l?this.addResizeHandles(this.element):this.removeResizeHandles(this.element)}t.resizeStart!==void 0&&(this.resizeStart=t.resizeStart),t.resizeEnd!==void 0&&(this.resizeEnd=t.resizeEnd)}remove(){this.emit("remove"),this.subscriptions.forEach(t=>t()),this.element.remove(),this.element=null}},W5=class p2 extends X5{constructor(t){super(t),this.regions=[],this.regionsContainer=this.initRegionsContainer()}static create(t){return new p2(t)}onInit(){if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");this.wavesurfer.getWrapper().appendChild(this.regionsContainer);let t=[];this.subscriptions.push(this.wavesurfer.on("timeupdate",e=>{const r=this.regions.filter(l=>l.start<=e&&(l.end===l.start?l.start+.05:l.end)>=e);r.forEach(l=>{t.includes(l)||this.emit("region-in",l)}),t.forEach(l=>{r.includes(l)||this.emit("region-out",l)}),t=r}))}initRegionsContainer(){return Ko("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",zIndex:"5",pointerEvents:"none"}})}getRegions(){return this.regions}avoidOverlapping(t){t.content&&setTimeout(()=>{const e=t.content,r=e.getBoundingClientRect(),l=this.regions.map(u=>{if(u===t||!u.content)return 0;const h=u.content.getBoundingClientRect();return r.left<h.left+h.width&&h.left<r.left+r.width?h.height:0}).reduce((u,h)=>u+h,0);e.style.marginTop=`${l}px`},10)}adjustScroll(t){var e,r;const l=(r=(e=this.wavesurfer)===null||e===void 0?void 0:e.getWrapper())===null||r===void 0?void 0:r.parentElement;if(!l)return;const{clientWidth:u,scrollWidth:h}=l;if(h<=u)return;const d=l.getBoundingClientRect(),y=t.element.getBoundingClientRect(),p=y.left-d.left,m=y.right-d.left;p<0?l.scrollLeft+=p:m>u&&(l.scrollLeft+=m-u)}virtualAppend(t,e,r){const l=()=>{if(!this.wavesurfer)return;const u=this.wavesurfer.getWidth(),h=this.wavesurfer.getScroll(),d=e.clientWidth,y=this.wavesurfer.getDuration(),p=Math.round(t.start/y*d),m=p+(Math.round((t.end-t.start)/y*d)||1)>h&&p<h+u;m&&!r.parentElement?e.appendChild(r):!m&&r.parentElement&&r.remove()};setTimeout(()=>{if(!this.wavesurfer)return;l();const u=this.wavesurfer.on("scroll",l);this.subscriptions.push(t.once("remove",u),u)},0)}saveRegion(t){this.virtualAppend(t,this.regionsContainer,t.element),this.avoidOverlapping(t),this.regions.push(t);const e=[t.on("update",r=>{r||this.adjustScroll(t),this.emit("region-update",t,r)}),t.on("update-end",()=>{this.avoidOverlapping(t),this.emit("region-updated",t)}),t.on("play",r=>{var l;(l=this.wavesurfer)===null||l===void 0||l.play(t.start,r)}),t.on("click",r=>{this.emit("region-clicked",t,r)}),t.on("dblclick",r=>{this.emit("region-double-clicked",t,r)}),t.once("remove",()=>{e.forEach(r=>r()),this.regions=this.regions.filter(r=>r!==t),this.emit("region-removed",t)})];this.subscriptions.push(...e),this.emit("region-created",t)}addRegion(t){var e,r;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");const l=this.wavesurfer.getDuration(),u=(r=(e=this.wavesurfer)===null||e===void 0?void 0:e.getDecodedData())===null||r===void 0?void 0:r.numberOfChannels,h=new Vv(t,l,u);return l?this.saveRegion(h):this.subscriptions.push(this.wavesurfer.once("ready",d=>{h._setTotalDuration(d),this.saveRegion(h)})),h}enableDragSelection(t,e=3){var r;const l=(r=this.wavesurfer)===null||r===void 0?void 0:r.getWrapper();if(!(l&&l instanceof HTMLElement))return()=>{};let u=null,h=0;return sc(l,(d,y,p)=>{u&&u._onUpdate(d,p>h?"end":"start")},d=>{var y,p;if(h=d,!this.wavesurfer)return;const m=this.wavesurfer.getDuration(),v=(p=(y=this.wavesurfer)===null||y===void 0?void 0:y.getDecodedData())===null||p===void 0?void 0:p.numberOfChannels,{width:S}=this.wavesurfer.getWrapper().getBoundingClientRect(),_=d/S*m,T=(d+5)/S*m;u=new Vv(Object.assign(Object.assign({},t),{start:_,end:T}),m,v),this.regionsContainer.appendChild(u.element)},()=>{u&&(this.saveRegion(u),u=null)},e)}clearRegions(){this.regions.slice().forEach(t=>t.remove()),this.regions=[]}destroy(){this.clearRegions(),super.destroy(),this.regionsContainer.remove()}};function P5(s,t,e,r){return new(e||(e=Promise))(function(l,u){function h(p){try{y(r.next(p))}catch(m){u(m)}}function d(p){try{y(r.throw(p))}catch(m){u(m)}}function y(p){var m;p.done?l(p.value):(m=p.value,m instanceof e?m:new e(function(v){v(m)})).then(h,d)}y((r=r.apply(s,[])).next())})}let $5=class{constructor(){this.listeners={}}on(t,e,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),r==null?void 0:r.once){const l=()=>{this.un(t,l),this.un(t,e)};return this.on(t,l),l}return()=>this.un(t,e)}un(t,e){var r;(r=this.listeners[t])===null||r===void 0||r.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(r=>r(...e))}},Z5=class extends $5{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}};function y2(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[r,l]of Object.entries(t))if(r==="children")for(const[u,h]of Object.entries(t))typeof h=="string"?e.appendChild(document.createTextNode(h)):e.appendChild(y2(u,h));else r==="style"?Object.assign(e.style,l):r==="textContent"?e.textContent=l:e.setAttribute(r,l.toString());return e}function Nd(s,t,e){const r=y2(s,t||{});return e==null||e.appendChild(r),r}function K5(s,t,e,r){switch(this.bufferSize=s,this.sampleRate=t,this.bandwidth=2/s*(t/2),this.sinTable=new Float32Array(s),this.cosTable=new Float32Array(s),this.windowValues=new Float32Array(s),this.reverseTable=new Uint32Array(s),this.peakBand=0,this.peak=0,e){case"bartlett":for(l=0;l<s;l++)this.windowValues[l]=2/(s-1)*((s-1)/2-Math.abs(l-(s-1)/2));break;case"bartlettHann":for(l=0;l<s;l++)this.windowValues[l]=.62-.48*Math.abs(l/(s-1)-.5)-.38*Math.cos(2*Math.PI*l/(s-1));break;case"blackman":for(r=r||.16,l=0;l<s;l++)this.windowValues[l]=(1-r)/2-.5*Math.cos(2*Math.PI*l/(s-1))+r/2*Math.cos(4*Math.PI*l/(s-1));break;case"cosine":for(l=0;l<s;l++)this.windowValues[l]=Math.cos(Math.PI*l/(s-1)-Math.PI/2);break;case"gauss":for(r=r||.25,l=0;l<s;l++)this.windowValues[l]=Math.pow(Math.E,-.5*Math.pow((l-(s-1)/2)/(r*(s-1)/2),2));break;case"hamming":for(l=0;l<s;l++)this.windowValues[l]=.54-.46*Math.cos(2*Math.PI*l/(s-1));break;case"hann":case void 0:for(l=0;l<s;l++)this.windowValues[l]=.5*(1-Math.cos(2*Math.PI*l/(s-1)));break;case"lanczoz":for(l=0;l<s;l++)this.windowValues[l]=Math.sin(Math.PI*(2*l/(s-1)-1))/(Math.PI*(2*l/(s-1)-1));break;case"rectangular":for(l=0;l<s;l++)this.windowValues[l]=1;break;case"triangular":for(l=0;l<s;l++)this.windowValues[l]=2/s*(s/2-Math.abs(l-(s-1)/2));break;default:throw Error("No such window function '"+e+"'")}for(var l,u=1,h=s>>1;u<s;){for(l=0;l<u;l++)this.reverseTable[l+u]=this.reverseTable[l]+h;u<<=1,h>>=1}for(l=0;l<s;l++)this.sinTable[l]=Math.sin(-Math.PI/l),this.cosTable[l]=Math.cos(-Math.PI/l);this.calculateSpectrum=function(d){var y,p,m,v=this.bufferSize,S=this.cosTable,_=this.sinTable,T=this.reverseTable,O=new Float32Array(v),C=new Float32Array(v),F=2/this.bufferSize,j=Math.sqrt,R=new Float32Array(v/2),N=Math.floor(Math.log(v)/Math.LN2);if(Math.pow(2,N)!==v)throw"Invalid buffer size, must be a power of 2.";if(v!==d.length)throw"Supplied buffer is not the same size as defined FFT. FFT Size: "+v+" Buffer Size: "+d.length;for(var A,W,H,q,Y,P,K,Z,Ot=1,ft=0;ft<v;ft++)O[ft]=d[T[ft]]*this.windowValues[T[ft]],C[ft]=0;for(;Ot<v;){A=S[Ot],W=_[Ot],H=1,q=0;for(var $t=0;$t<Ot;$t++){for(ft=$t;ft<v;)P=H*O[Y=ft+Ot]-q*C[Y],K=H*C[Y]+q*O[Y],O[Y]=O[ft]-P,C[Y]=C[ft]-K,O[ft]+=P,C[ft]+=K,ft+=Ot<<1;H=(Z=H)*A-q*W,q=Z*W+q*A}Ot<<=1}ft=0;for(var k=v/2;ft<k;ft++)(m=F*j((y=O[ft])*y+(p=C[ft])*p))>this.peak&&(this.peakBand=ft,this.peak=m),R[ft]=m;return R}}const qv=1e3*Math.log(10)/107.939;let J5=class m2 extends Z5{static create(t){return new m2(t||{})}constructor(t){var e,r;if(super(t),this.frequenciesDataUrl=t.frequenciesDataUrl,this.container=typeof t.container=="string"?document.querySelector(t.container):t.container,t.colorMap&&typeof t.colorMap!="string"){if(t.colorMap.length<256)throw new Error("Colormap must contain 256 elements");for(let l=0;l<t.colorMap.length;l++)if(t.colorMap[l].length!==4)throw new Error("ColorMap entries must contain 4 values");this.colorMap=t.colorMap}else switch(this.colorMap=t.colorMap||"roseus",this.colorMap){case"gray":this.colorMap=[];for(let l=0;l<256;l++){const u=(255-l)/256;this.colorMap.push([u,u,u,1])}break;case"igray":this.colorMap=[];for(let l=0;l<256;l++){const u=l/256;this.colorMap.push([u,u,u,1])}break;case"roseus":this.colorMap=[[.004528,.004341,.004307,1],[.005625,.006156,.00601,1],[.006628,.008293,.008161,1],[.007551,.010738,.01079,1],[.008382,.013482,.013941,1],[.009111,.01652,.017662,1],[.009727,.019846,.022009,1],[.010223,.023452,.027035,1],[.010593,.027331,.032799,1],[.010833,.031475,.039361,1],[.010941,.035875,.046415,1],[.010918,.04052,.053597,1],[.010768,.045158,.060914,1],[.010492,.049708,.068367,1],[.010098,.054171,.075954,1],[.009594,.058549,.083672,1],[.008989,.06284,.091521,1],[.008297,.067046,.099499,1],[.00753,.071165,.107603,1],[.006704,.075196,.11583,1],[.005838,.07914,.124178,1],[.004949,.082994,.132643,1],[.004062,.086758,.141223,1],[.003198,.09043,.149913,1],[.002382,.09401,.158711,1],[.001643,.097494,.167612,1],[.001009,.100883,.176612,1],[514e-6,.104174,.185704,1],[187e-6,.107366,.194886,1],[66e-6,.110457,.204151,1],[186e-6,.113445,.213496,1],[587e-6,.116329,.222914,1],[.001309,.119106,.232397,1],[.002394,.121776,.241942,1],[.003886,.124336,.251542,1],[.005831,.126784,.261189,1],[.008276,.12912,.270876,1],[.011268,.131342,.280598,1],[.014859,.133447,.290345,1],[.0191,.135435,.300111,1],[.024043,.137305,.309888,1],[.029742,.139054,.319669,1],[.036252,.140683,.329441,1],[.043507,.142189,.339203,1],[.050922,.143571,.348942,1],[.058432,.144831,.358649,1],[.066041,.145965,.368319,1],[.073744,.146974,.377938,1],[.081541,.147858,.387501,1],[.089431,.148616,.396998,1],[.097411,.149248,.406419,1],[.105479,.149754,.415755,1],[.113634,.150134,.424998,1],[.121873,.150389,.434139,1],[.130192,.150521,.443167,1],[.138591,.150528,.452075,1],[.147065,.150413,.460852,1],[.155614,.150175,.469493,1],[.164232,.149818,.477985,1],[.172917,.149343,.486322,1],[.181666,.148751,.494494,1],[.190476,.148046,.502493,1],[.199344,.147229,.510313,1],[.208267,.146302,.517944,1],[.217242,.145267,.52538,1],[.226264,.144131,.532613,1],[.235331,.142894,.539635,1],[.24444,.141559,.546442,1],[.253587,.140131,.553026,1],[.262769,.138615,.559381,1],[.271981,.137016,.5655,1],[.281222,.135335,.571381,1],[.290487,.133581,.577017,1],[.299774,.131757,.582404,1],[.30908,.129867,.587538,1],[.318399,.12792,.592415,1],[.32773,.125921,.597032,1],[.337069,.123877,.601385,1],[.346413,.121793,.605474,1],[.355758,.119678,.609295,1],[.365102,.11754,.612846,1],[.374443,.115386,.616127,1],[.383774,.113226,.619138,1],[.393096,.111066,.621876,1],[.402404,.108918,.624343,1],[.411694,.106794,.62654,1],[.420967,.104698,.628466,1],[.430217,.102645,.630123,1],[.439442,.100647,.631513,1],[.448637,.098717,.632638,1],[.457805,.096861,.633499,1],[.46694,.095095,.6341,1],[.47604,.093433,.634443,1],[.485102,.091885,.634532,1],[.494125,.090466,.63437,1],[.503104,.08919,.633962,1],[.512041,.088067,.633311,1],[.520931,.087108,.63242,1],[.529773,.086329,.631297,1],[.538564,.085738,.629944,1],[.547302,.085346,.628367,1],[.555986,.085162,.626572,1],[.564615,.08519,.624563,1],[.573187,.085439,.622345,1],[.581698,.085913,.619926,1],[.590149,.086615,.617311,1],[.598538,.087543,.614503,1],[.606862,.0887,.611511,1],[.61512,.090084,.608343,1],[.623312,.09169,.605001,1],[.631438,.093511,.601489,1],[.639492,.095546,.597821,1],[.647476,.097787,.593999,1],[.655389,.100226,.590028,1],[.66323,.102856,.585914,1],[.670995,.105669,.581667,1],[.678686,.108658,.577291,1],[.686302,.111813,.57279,1],[.69384,.115129,.568175,1],[.7013,.118597,.563449,1],[.708682,.122209,.558616,1],[.715984,.125959,.553687,1],[.723206,.12984,.548666,1],[.730346,.133846,.543558,1],[.737406,.13797,.538366,1],[.744382,.142209,.533101,1],[.751274,.146556,.527767,1],[.758082,.151008,.522369,1],[.764805,.155559,.516912,1],[.771443,.160206,.511402,1],[.777995,.164946,.505845,1],[.784459,.169774,.500246,1],[.790836,.174689,.494607,1],[.797125,.179688,.488935,1],[.803325,.184767,.483238,1],[.809435,.189925,.477518,1],[.815455,.19516,.471781,1],[.821384,.200471,.466028,1],[.827222,.205854,.460267,1],[.832968,.211308,.454505,1],[.838621,.216834,.448738,1],[.844181,.222428,.442979,1],[.849647,.22809,.43723,1],[.855019,.233819,.431491,1],[.860295,.239613,.425771,1],[.865475,.245471,.420074,1],[.870558,.251393,.414403,1],[.875545,.25738,.408759,1],[.880433,.263427,.403152,1],[.885223,.269535,.397585,1],[.889913,.275705,.392058,1],[.894503,.281934,.386578,1],[.898993,.288222,.381152,1],[.903381,.294569,.375781,1],[.907667,.300974,.370469,1],[.911849,.307435,.365223,1],[.915928,.313953,.360048,1],[.919902,.320527,.354948,1],[.923771,.327155,.349928,1],[.927533,.333838,.344994,1],[.931188,.340576,.340149,1],[.934736,.347366,.335403,1],[.938175,.354207,.330762,1],[.941504,.361101,.326229,1],[.944723,.368045,.321814,1],[.947831,.375039,.317523,1],[.950826,.382083,.313364,1],[.953709,.389175,.309345,1],[.956478,.396314,.305477,1],[.959133,.403499,.301766,1],[.961671,.410731,.298221,1],[.964093,.418008,.294853,1],[.966399,.425327,.291676,1],[.968586,.43269,.288696,1],[.970654,.440095,.285926,1],[.972603,.44754,.28338,1],[.974431,.455025,.281067,1],[.976139,.462547,.279003,1],[.977725,.470107,.277198,1],[.979188,.477703,.275666,1],[.980529,.485332,.274422,1],[.981747,.492995,.273476,1],[.98284,.50069,.272842,1],[.983808,.508415,.272532,1],[.984653,.516168,.27256,1],[.985373,.523948,.272937,1],[.985966,.531754,.273673,1],[.986436,.539582,.274779,1],[.98678,.547434,.276264,1],[.986998,.555305,.278135,1],[.987091,.563195,.280401,1],[.987061,.5711,.283066,1],[.986907,.579019,.286137,1],[.986629,.58695,.289615,1],[.986229,.594891,.293503,1],[.985709,.602839,.297802,1],[.985069,.610792,.302512,1],[.98431,.618748,.307632,1],[.983435,.626704,.313159,1],[.982445,.634657,.319089,1],[.981341,.642606,.32542,1],[.98013,.650546,.332144,1],[.978812,.658475,.339257,1],[.977392,.666391,.346753,1],[.97587,.67429,.354625,1],[.974252,.68217,.362865,1],[.972545,.690026,.371466,1],[.97075,.697856,.380419,1],[.968873,.705658,.389718,1],[.966921,.713426,.399353,1],[.964901,.721157,.409313,1],[.962815,.728851,.419594,1],[.960677,.7365,.430181,1],[.95849,.744103,.44107,1],[.956263,.751656,.452248,1],[.954009,.759153,.463702,1],[.951732,.766595,.475429,1],[.949445,.773974,.487414,1],[.947158,.781289,.499647,1],[.944885,.788535,.512116,1],[.942634,.795709,.524811,1],[.940423,.802807,.537717,1],[.938261,.809825,.550825,1],[.936163,.81676,.564121,1],[.934146,.823608,.577591,1],[.932224,.830366,.59122,1],[.930412,.837031,.604997,1],[.928727,.843599,.618904,1],[.927187,.850066,.632926,1],[.925809,.856432,.647047,1],[.92461,.862691,.661249,1],[.923607,.868843,.675517,1],[.92282,.874884,.689832,1],[.922265,.880812,.704174,1],[.921962,.886626,.718523,1],[.92193,.892323,.732859,1],[.922183,.897903,.747163,1],[.922741,.903364,.76141,1],[.92362,.908706,.77558,1],[.924837,.913928,.789648,1],[.926405,.919031,.80359,1],[.92834,.924015,.817381,1],[.930655,.928881,.830995,1],[.93336,.933631,.844405,1],[.936466,.938267,.857583,1],[.939982,.942791,.870499,1],[.943914,.947207,.883122,1],[.948267,.951519,.895421,1],[.953044,.955732,.907359,1],[.958246,.959852,.918901,1],[.963869,.963887,.930004,1],[.969909,.967845,.940623,1],[.976355,.971737,.950704,1],[.983195,.97558,.960181,1],[.990402,.979395,.968966,1],[.99793,.983217,.97692,1]];break;default:throw Error("No such colormap '"+this.colorMap+"'")}this.fftSamples=t.fftSamples||512,this.height=t.height||200,this.noverlap=t.noverlap||null,this.windowFunc=t.windowFunc||"hann",this.alpha=t.alpha,this.frequencyMin=t.frequencyMin||0,this.frequencyMax=t.frequencyMax||0,this.gainDB=(e=t.gainDB)!==null&&e!==void 0?e:20,this.rangeDB=(r=t.rangeDB)!==null&&r!==void 0?r:80,this.scale=t.scale||"mel",this.numMelFilters=this.fftSamples/2,this.numLogFilters=this.fftSamples/2,this.numBarkFilters=this.fftSamples/2,this.numErbFilters=this.fftSamples/2,this.createWrapper(),this.createCanvas()}onInit(){this.container=this.container||this.wavesurfer.getWrapper(),this.container.appendChild(this.wrapper),this.wavesurfer.options.fillParent&&Object.assign(this.wrapper.style,{width:"100%",overflowX:"hidden",overflowY:"hidden"}),this.subscriptions.push(this.wavesurfer.on("redraw",()=>this.render()))}destroy(){this.unAll(),this.wavesurfer.un("ready",this._onReady),this.wavesurfer.un("redraw",this._onRender),this.wavesurfer=null,this.util=null,this.options=null,this.wrapper&&(this.wrapper.remove(),this.wrapper=null),super.destroy()}loadFrequenciesData(t){return P5(this,void 0,void 0,function*(){const e=yield fetch(t);if(!e.ok)throw new Error("Unable to fetch frequencies data");const r=yield e.json();this.drawSpectrogram(r)})}createWrapper(){this.wrapper=Nd("div",{style:{display:"block",position:"relative",userSelect:"none"}}),this.options.labels&&(this.labelsEl=Nd("canvas",{part:"spec-labels",style:{position:"absolute",zIndex:9,width:"55px",height:"100%"}},this.wrapper)),this.wrapper.addEventListener("click",this._onWrapperClick)}createCanvas(){this.canvas=Nd("canvas",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",zIndex:4}},this.wrapper),this.spectrCc=this.canvas.getContext("2d")}render(){var t;if(this.frequenciesDataUrl)this.loadFrequenciesData(this.frequenciesDataUrl);else{const e=(t=this.wavesurfer)===null||t===void 0?void 0:t.getDecodedData();e&&this.drawSpectrogram(this.getFrequencies(e))}}drawSpectrogram(t){isNaN(t[0][0])||(t=[t]),this.wrapper.style.height=this.height*t.length+"px",this.canvas.width=this.getWidth(),this.canvas.height=this.height*t.length;const e=this.spectrCc,r=this.height,l=this.getWidth(),u=this.buffer.sampleRate/2,h=this.frequencyMin,d=this.frequencyMax;if(e){if(d>u){const y=this.colorMap[this.colorMap.length-1];e.fillStyle=`rgba(${y[0]}, ${y[1]}, ${y[2]}, ${y[3]})`,e.fillRect(0,0,l,r*t.length)}for(let y=0;y<t.length;y++){const p=this.resample(t[y]),m=p[0].length,v=new ImageData(l,m);for(let O=0;O<p.length;O++)for(let C=0;C<p[O].length;C++){const F=this.colorMap[p[O][C]],j=4*((m-C-1)*l+O);v.data[j]=255*F[0],v.data[j+1]=255*F[1],v.data[j+2]=255*F[2],v.data[j+3]=255*F[3]}const S=this.hzToScale(h)/this.hzToScale(u),_=this.hzToScale(d)/this.hzToScale(u),T=Math.min(1,_);createImageBitmap(v,0,Math.round(m*(1-T)),l,Math.round(m*(T-S))).then(O=>{e.drawImage(O,0,r*(y+1-T/_),l,r*T/_)})}this.options.labels&&this.loadLabels(this.options.labelsBackground,"12px","12px","",this.options.labelsColor,this.options.labelsHzColor||this.options.labelsColor,"center","#specLabels",t.length),this.emit("ready")}}createFilterBank(t,e,r,l){const u=r(0),h=r(e/2),d=Array.from({length:t},()=>Array(this.fftSamples/2+1).fill(0)),y=e/this.fftSamples;for(let p=0;p<t;p++){let m=l(u+p/t*(h-u)),v=Math.floor(m/y),S=v*y,_=(m-S)/((v+1)*y-S);d[p][v]=1-_,d[p][v+1]=_}return d}hzToMel(t){return 2595*Math.log10(1+t/700)}melToHz(t){return 700*(Math.pow(10,t/2595)-1)}createMelFilterBank(t,e){return this.createFilterBank(t,e,this.hzToMel,this.melToHz)}hzToLog(t){return Math.log10(Math.max(1,t))}logToHz(t){return Math.pow(10,t)}createLogFilterBank(t,e){return this.createFilterBank(t,e,this.hzToLog,this.logToHz)}hzToBark(t){let e=26.81*t/(1960+t)-.53;return e<2&&(e+=.15*(2-e)),e>20.1&&(e+=.22*(e-20.1)),e}barkToHz(t){return t<2&&(t=(t-.3)/.85),t>20.1&&(t=(t+4.422)/1.22),(t+.53)/(26.28-t)*1960}createBarkFilterBank(t,e){return this.createFilterBank(t,e,this.hzToBark,this.barkToHz)}hzToErb(t){return qv*Math.log10(1+.00437*t)}erbToHz(t){return(Math.pow(10,t/qv)-1)/.00437}createErbFilterBank(t,e){return this.createFilterBank(t,e,this.hzToErb,this.erbToHz)}hzToScale(t){switch(this.scale){case"mel":return this.hzToMel(t);case"logarithmic":return this.hzToLog(t);case"bark":return this.hzToBark(t);case"erb":return this.hzToErb(t)}return t}scaleToHz(t){switch(this.scale){case"mel":return this.melToHz(t);case"logarithmic":return this.logToHz(t);case"bark":return this.barkToHz(t);case"erb":return this.erbToHz(t)}return t}applyFilterBank(t,e){const r=e.length,l=Float32Array.from({length:r},()=>0);for(let u=0;u<r;u++)for(let h=0;h<t.length;h++)l[u]+=t[h]*e[u][h];return l}getWidth(){return this.wavesurfer.getWrapper().offsetWidth}getFrequencies(t){var e,r;const l=this.fftSamples,u=((e=this.options.splitChannels)!==null&&e!==void 0?e:!((r=this.wavesurfer)===null||r===void 0)&&r.options.splitChannels)?t.numberOfChannels:1;if(this.frequencyMax=this.frequencyMax||t.sampleRate/2,!t)return;this.buffer=t;const h=t.sampleRate,d=[];let y=this.noverlap;if(!y){const v=t.length/this.canvas.width;y=Math.max(0,Math.round(l-v))}const p=new K5(l,h,this.windowFunc,this.alpha);let m;switch(this.scale){case"mel":m=this.createFilterBank(this.numMelFilters,h,this.hzToMel,this.melToHz);break;case"logarithmic":m=this.createFilterBank(this.numLogFilters,h,this.hzToLog,this.logToHz);break;case"bark":m=this.createFilterBank(this.numBarkFilters,h,this.hzToBark,this.barkToHz);break;case"erb":m=this.createFilterBank(this.numErbFilters,h,this.hzToErb,this.erbToHz)}for(let v=0;v<u;v++){const S=t.getChannelData(v),_=[];let T=0;for(;T+l<S.length;){const O=S.slice(T,T+l),C=new Uint8Array(l/2);let F=p.calculateSpectrum(O);m&&(F=this.applyFilterBank(F,m));for(let j=0;j<l/2;j++){const R=F[j]>1e-12?F[j]:1e-12,N=20*Math.log10(R);N<-this.gainDB-this.rangeDB?C[j]=0:N>-this.gainDB?C[j]=255:C[j]=(N+this.gainDB)/this.rangeDB*255+256}_.push(C),T+=l-y}d.push(_)}return d}freqType(t){return t>=1e3?(t/1e3).toFixed(1):Math.round(t)}unitType(t){return t>=1e3?"kHz":"Hz"}getLabelFrequency(t,e){const r=this.hzToScale(this.frequencyMin),l=this.hzToScale(this.frequencyMax);return this.scaleToHz(r+t/e*(l-r))}loadLabels(t,e,r,l,u,h,d,y,p){t=t||"rgba(68,68,68,0)",e=e||"12px",r=r||"12px",l=l||"Helvetica",u=u||"#fff",h=h||"#fff",d=d||"center";const m=this.height||512,v=m/256*5;this.frequencyMin,this.frequencyMax;const S=this.labelsEl.getContext("2d"),_=window.devicePixelRatio;if(this.labelsEl.height=this.height*p*_,this.labelsEl.width=55*_,S.scale(_,_),S)for(let T=0;T<p;T++){let O;for(S.fillStyle=t,S.fillRect(0,T*m,55,(1+T)*m),S.fill(),O=0;O<=v;O++){S.textAlign=d,S.textBaseline="middle";const C=this.getLabelFrequency(O,v),F=this.freqType(C),j=this.unitType(C),R=16;let N=(1+T)*m-O/v*m;N=Math.min(Math.max(N,T*m+10),(1+T)*m-10),S.fillStyle=h,S.font=r+" "+l,S.fillText(j,R+24,N),S.fillStyle=u,S.font=e+" "+l,S.fillText(F,R,N)}}}resample(t){const e=this.getWidth(),r=[],l=1/t.length,u=1/e;let h;for(h=0;h<e;h++){const d=new Array(t[0].length);let y;for(y=0;y<t.length;y++){const v=y*l,S=v+l,_=h*u,T=_+u,O=Math.max(0,Math.min(S,T)-Math.max(v,_));let C;if(O>0)for(C=0;C<t[0].length;C++)d[C]==null&&(d[C]=0),d[C]+=O/u*t[y][C]}const p=new Uint8Array(t[0].length);let m;for(m=0;m<t[0].length;m++)p[m]=d[m];r.push(p)}return r}},t6=class{constructor(){this.listeners={}}on(t,e,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),r==null?void 0:r.once){const l=()=>{this.un(t,l),this.un(t,e)};return this.on(t,l),l}return()=>this.un(t,e)}un(t,e){var r;(r=this.listeners[t])===null||r===void 0||r.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(r=>r(...e))}},e6=class extends t6{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}};function g2(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[r,l]of Object.entries(t))if(r==="children")for(const[u,h]of Object.entries(t))typeof h=="string"?e.appendChild(document.createTextNode(h)):e.appendChild(g2(u,h));else r==="style"?Object.assign(e.style,l):r==="textContent"?e.textContent=l:e.setAttribute(r,l.toString());return e}function zd(s,t,e){return g2(s,t||{})}const n6={height:20,timeOffset:0,formatTimeCallback:s=>s/60>1?`${Math.floor(s/60)}:${`${(s=Math.round(s%60))<10?"0":""}${s}`}`:`${Math.round(1e3*s)/1e3}`};let i6=class v2 extends e6{constructor(t){super(t||{}),this.options=Object.assign({},n6,t),this.timelineWrapper=this.initTimelineWrapper()}static create(t){return new v2(t)}onInit(){var t;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");let e=this.wavesurfer.getWrapper();if(this.options.container instanceof HTMLElement)e=this.options.container;else if(typeof this.options.container=="string"){const r=document.querySelector(this.options.container);if(!r)throw Error(`No Timeline container found matching ${this.options.container}`);e=r}this.options.insertPosition?(e.firstElementChild||e).insertAdjacentElement(this.options.insertPosition,this.timelineWrapper):e.appendChild(this.timelineWrapper),this.subscriptions.push(this.wavesurfer.on("redraw",()=>this.initTimeline())),(!((t=this.wavesurfer)===null||t===void 0)&&t.getDuration()||this.options.duration)&&this.initTimeline()}destroy(){this.timelineWrapper.remove(),super.destroy()}initTimelineWrapper(){return zd("div",{part:"timeline-wrapper",style:{pointerEvents:"none"}})}defaultTimeInterval(t){return t>=25?1:5*t>=25?5:15*t>=25?15:60*Math.ceil(.5/t)}defaultPrimaryLabelInterval(t){return t>=25?10:5*t>=25?6:4}defaultSecondaryLabelInterval(t){return t>=25?5:2}virtualAppend(t,e,r){let l=!1;const u=(y,p)=>{if(!this.wavesurfer)return;const m=r.clientWidth,v=t>y&&t+m<p;v!==l&&(l=v,v?e.appendChild(r):r.remove())};if(!this.wavesurfer)return;const h=this.wavesurfer.getScroll(),d=h+this.wavesurfer.getWidth();u(h,d),this.subscriptions.push(this.wavesurfer.on("scroll",(y,p,m,v)=>{u(m,v)}))}initTimeline(){var t,e,r,l,u,h,d,y;const p=(r=(e=(t=this.wavesurfer)===null||t===void 0?void 0:t.getDuration())!==null&&e!==void 0?e:this.options.duration)!==null&&r!==void 0?r:0,m=(((l=this.wavesurfer)===null||l===void 0?void 0:l.getWrapper().scrollWidth)||this.timelineWrapper.scrollWidth)/p,v=(u=this.options.timeInterval)!==null&&u!==void 0?u:this.defaultTimeInterval(m),S=(h=this.options.primaryLabelInterval)!==null&&h!==void 0?h:this.defaultPrimaryLabelInterval(m),_=this.options.primaryLabelSpacing,T=(d=this.options.secondaryLabelInterval)!==null&&d!==void 0?d:this.defaultSecondaryLabelInterval(m),O=this.options.secondaryLabelSpacing,C=this.options.insertPosition==="beforebegin",F=zd("div",{style:Object.assign({height:`${this.options.height}px`,overflow:"hidden",fontSize:this.options.height/2+"px",whiteSpace:"nowrap"},C?{position:"absolute",top:"0",left:"0",right:"0",zIndex:"2"}:{position:"relative"})});F.setAttribute("part","timeline"),typeof this.options.style=="string"?F.setAttribute("style",F.getAttribute("style")+this.options.style):typeof this.options.style=="object"&&Object.assign(F.style,this.options.style);const j=zd("div",{style:{width:"0",height:"50%",display:"flex",flexDirection:"column",justifyContent:C?"flex-start":"flex-end",top:C?"0":"auto",bottom:C?"auto":"0",overflow:"visible",borderLeft:"1px solid currentColor",opacity:`${(y=this.options.secondaryLabelOpacity)!==null&&y!==void 0?y:.25}`,position:"absolute",zIndex:"1"}});for(let R=0,N=0;R<p;R+=v,N++){const A=j.cloneNode(),W=Math.round(100*R)%Math.round(100*S)==0||_&&N%_==0,H=Math.round(100*R)%Math.round(100*T)==0||O&&N%O==0;(W||H)&&(A.style.height="100%",A.style.textIndent="3px",A.textContent=this.options.formatTimeCallback(R),W&&(A.style.opacity="1"));const q=W?"primary":H?"secondary":"tick";A.setAttribute("part",`timeline-notch timeline-notch-${q}`);const Y=Math.round(100*(R+this.options.timeOffset))/100*m;A.style.left=`${Y}px`,this.virtualAppend(Y,F,A)}this.timelineWrapper.innerHTML="",this.timelineWrapper.appendChild(F),this.emit("ready")}},s6=class{constructor(){this.listeners={}}on(t,e,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),r==null?void 0:r.once){const l=()=>{this.un(t,l),this.un(t,e)};return this.on(t,l),l}return()=>this.un(t,e)}un(t,e){var r;(r=this.listeners[t])===null||r===void 0||r.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(r=>r(...e))}},r6=class extends s6{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}};const a6={scale:.5,deltaThreshold:5,exponentialZooming:!1,iterations:20};let o6=class b2 extends r6{constructor(t){super(t||{}),this.wrapper=void 0,this.container=null,this.accumulatedDelta=0,this.pointerTime=0,this.oldX=0,this.endZoom=0,this.startZoom=0,this.onWheel=e=>{if(this.wavesurfer&&this.container&&!(Math.abs(e.deltaX)>=Math.abs(e.deltaY))&&(e.preventDefault(),this.accumulatedDelta+=-e.deltaY,this.startZoom===0&&this.options.exponentialZooming&&(this.startZoom=this.wavesurfer.getWrapper().clientWidth/this.wavesurfer.getDuration()),this.options.deltaThreshold===0||Math.abs(this.accumulatedDelta)>=this.options.deltaThreshold)){const r=this.wavesurfer.getDuration(),l=this.wavesurfer.options.minPxPerSec===0?this.wavesurfer.getWrapper().scrollWidth/r:this.wavesurfer.options.minPxPerSec,u=e.clientX-this.container.getBoundingClientRect().left,h=this.container.clientWidth,d=this.wavesurfer.getScroll();u===this.oldX&&this.oldX!==0||(this.pointerTime=(d+u)/l),this.oldX=u;const y=this.calculateNewZoom(l,this.accumulatedDelta),p=h/y*(u/h);y*r<h?(this.wavesurfer.zoom(h/r),this.container.scrollLeft=0):(this.wavesurfer.zoom(y),this.container.scrollLeft=(this.pointerTime-p)*y),this.accumulatedDelta=0}},this.calculateNewZoom=(e,r)=>{let l;if(this.options.exponentialZooming){const u=r>0?Math.pow(this.endZoom/this.startZoom,1/(this.options.iterations-1)):Math.pow(this.startZoom/this.endZoom,1/(this.options.iterations-1));l=Math.max(0,e*u)}else l=Math.max(0,e+r*this.options.scale);return Math.min(l,this.options.maxZoom)},this.options=Object.assign({},a6,t)}static create(t){return new b2(t)}onInit(){var t;this.wrapper=(t=this.wavesurfer)===null||t===void 0?void 0:t.getWrapper(),this.wrapper&&(this.container=this.wrapper.parentElement,this.container.addEventListener("wheel",this.onWheel),this.options.maxZoom===void 0&&(this.options.maxZoom=this.container.clientWidth),this.endZoom=this.options.maxZoom)}destroy(){this.wrapper&&this.wrapper.removeEventListener("wheel",this.onWheel),super.destroy()}},l6=class{constructor(){this.listeners={}}on(t,e,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),r==null?void 0:r.once){const l=()=>{this.un(t,l),this.un(t,e)};return this.on(t,l),l}return()=>this.un(t,e)}un(t,e){var r;(r=this.listeners[t])===null||r===void 0||r.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(r=>r(...e))}},u6=class extends l6{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}};function S2(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[r,l]of Object.entries(t))if(r==="children")for(const[u,h]of Object.entries(t))typeof h=="string"?e.appendChild(document.createTextNode(h)):e.appendChild(S2(u,h));else r==="style"?Object.assign(e.style,l):r==="textContent"?e.textContent=l:e.setAttribute(r,l.toString());return e}function Yv(s,t,e){const r=S2(s,t||{});return e==null||e.appendChild(r),r}const c6={lineWidth:1,labelSize:11,formatTimeCallback:s=>`${Math.floor(s/60)}:${`0${Math.floor(s)%60}`.slice(-2)}`};let h6=class _2 extends u6{constructor(t){super(t||{}),this.unsubscribe=()=>{},this.onPointerMove=e=>{if(!this.wavesurfer)return;const r=this.wavesurfer.getWrapper().getBoundingClientRect(),{width:l}=r,u=e.clientX-r.left,h=Math.min(1,Math.max(0,u/l)),d=Math.min(l-this.options.lineWidth-1,u);this.wrapper.style.transform=`translateX(${d}px)`,this.wrapper.style.opacity="1";const y=this.wavesurfer.getDuration()||0;this.label.textContent=this.options.formatTimeCallback(y*h);const p=this.label.offsetWidth;this.label.style.transform=d+p>l?`translateX(-${p+this.options.lineWidth}px)`:"",this.emit("hover",h)},this.onPointerLeave=()=>{this.wrapper.style.opacity="0"},this.options=Object.assign({},c6,t),this.wrapper=Yv("div",{part:"hover"}),this.label=Yv("span",{part:"hover-label"},this.wrapper)}static create(t){return new _2(t)}addUnits(t){return`${t}${typeof t=="number"?"px":""}`}onInit(){if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");const t=this.wavesurfer.options,e=this.options.lineColor||t.cursorColor||t.progressColor;Object.assign(this.wrapper.style,{position:"absolute",zIndex:10,left:0,top:0,height:"100%",pointerEvents:"none",borderLeft:`${this.addUnits(this.options.lineWidth)} solid ${e}`,opacity:"0",transition:"opacity .1s ease-in"}),Object.assign(this.label.style,{display:"block",backgroundColor:this.options.labelBackground,color:this.options.labelColor,fontSize:`${this.addUnits(this.options.labelSize)}`,transition:"transform .1s ease-in",padding:"2px 3px"});const r=this.wavesurfer.getWrapper();r.appendChild(this.wrapper),r.addEventListener("pointermove",this.onPointerMove),r.addEventListener("pointerleave",this.onPointerLeave),r.addEventListener("wheel",this.onPointerMove),this.unsubscribe=()=>{r.removeEventListener("pointermove",this.onPointerMove),r.removeEventListener("pointerleave",this.onPointerLeave),r.removeEventListener("wheel",this.onPointerLeave)}}destroy(){super.destroy(),this.unsubscribe(),this.wrapper.remove()}};class Tl{constructor(){this.listeners={}}on(t,e,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),r==null?void 0:r.once){const l=()=>{this.un(t,l),this.un(t,e)};return this.on(t,l),l}return()=>this.un(t,e)}un(t,e){var r;(r=this.listeners[t])===null||r===void 0||r.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(r=>r(...e))}}class w2 extends Tl{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}}function Be(s,t,e,r){return new(e||(e=Promise))(function(l,u){function h(p){try{y(r.next(p))}catch(m){u(m)}}function d(p){try{y(r.throw(p))}catch(m){u(m)}}function y(p){var m;p.done?l(p.value):(m=p.value,m instanceof e?m:new e(function(v){v(m)})).then(h,d)}y((r=r.apply(s,t||[])).next())})}const Pu={decode:function(s,t){return Be(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const r=e[0];if(r.some(l=>l>1||l<-1)){const l=r.length;let u=0;for(let h=0;h<l;h++){const d=Math.abs(r[h]);d>u&&(u=d)}for(const h of e)for(let d=0;d<l;d++)h[d]/=u}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function A2(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[r,l]of Object.entries(t))if(r==="children")for(const[u,h]of Object.entries(t))typeof h=="string"?e.appendChild(document.createTextNode(h)):e.appendChild(A2(u,h));else r==="style"?Object.assign(e.style,l):r==="textContent"?e.textContent=l:e.setAttribute(r,l.toString());return e}function Fc(s,t,e){const r=A2(s,t||{});return e==null||e.appendChild(r),r}var f6=Object.freeze({__proto__:null,createElement:Fc,default:Fc});const d6={fetchBlob:function(s,t,e){return Be(this,void 0,void 0,function*(){const r=yield fetch(s,e);if(r.status>=400)throw new Error(`Failed to fetch ${s}: ${r.status} (${r.statusText})`);return function(l,u){Be(this,void 0,void 0,function*(){if(!l.body||!l.headers)return;const h=l.body.getReader(),d=Number(l.headers.get("Content-Length"))||0;let y=0;const p=v=>Be(this,void 0,void 0,function*(){y+=(v==null?void 0:v.length)||0;const S=Math.round(y/d*100);u(S)}),m=()=>Be(this,void 0,void 0,function*(){let v;try{v=yield h.read()}catch{return}v.done||(p(v.value),yield m())});m()})}(r.clone(),t),r.blob()})}};class p6 extends Tl{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,r){return this.media.addEventListener(t,e,r),()=>this.media.removeEventListener(t,e,r)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const r=this.getSrc();if(t&&r===t)return;this.revokeSrc();const l=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;r&&(this.media.src="");try{this.media.src=l}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return Be(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class Ya extends Tl{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const r=this.parentFromOptionsContainer(t.container);this.parent=r;const[l,u]=this.initHtml();r.appendChild(l),this.container=l,this.scrollContainer=u.querySelector(".scroll"),this.wrapper=u.querySelector(".wrapper"),this.canvasWrapper=u.querySelector(".canvases"),this.progressWrapper=u.querySelector(".progress"),this.cursor=u.querySelector(".cursor"),e&&u.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const r=this.wrapper.getBoundingClientRect(),l=e.clientX-r.left,u=e.clientY-r.top;return[l/r.width,u/r.height]};if(this.wrapper.addEventListener("click",e=>{const[r,l]=t(e);this.emit("click",r,l)}),this.wrapper.addEventListener("dblclick",e=>{const[r,l]=t(e);this.emit("dblclick",r,l)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:r,clientWidth:l}=this.scrollContainer,u=e/r,h=(e+l)/r;this.emit("scroll",u,h,e,e+l)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,r,l,u=3,h=0,d=100){if(!t)return()=>{};const y=matchMedia("(pointer: coarse)").matches;let p=()=>{};const m=v=>{if(v.button!==h)return;v.preventDefault(),v.stopPropagation();let S=v.clientX,_=v.clientY,T=!1;const O=Date.now(),C=A=>{if(A.preventDefault(),A.stopPropagation(),y&&Date.now()-O<d)return;const W=A.clientX,H=A.clientY,q=W-S,Y=H-_;if(T||Math.abs(q)>u||Math.abs(Y)>u){const P=t.getBoundingClientRect(),{left:K,top:Z}=P;T||(r==null||r(S-K,_-Z),T=!0),e(q,Y,W-K,H-Z),S=W,_=H}},F=A=>{if(T){const W=A.clientX,H=A.clientY,q=t.getBoundingClientRect(),{left:Y,top:P}=q;l==null||l(W-Y,H-P)}p()},j=A=>{A.relatedTarget&&A.relatedTarget!==document.documentElement||F(A)},R=A=>{T&&(A.stopPropagation(),A.preventDefault())},N=A=>{T&&A.preventDefault()};document.addEventListener("pointermove",C),document.addEventListener("pointerup",F),document.addEventListener("pointerout",j),document.addEventListener("pointercancel",j),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("click",R,{capture:!0}),p=()=>{document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",F),document.removeEventListener("pointerout",j),document.removeEventListener("pointercancel",j),document.removeEventListener("touchmove",N),setTimeout(()=>{document.removeEventListener("click",R,{capture:!0})},10)}};return t.addEventListener("pointerdown",m),()=>{p(),t.removeEventListener("pointerdown",m)}}(this.wrapper,(t,e,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var r;const l=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const u=this.parent.clientHeight||128;return e!=null&&e.every(h=>!h.overlay)?u/l:u}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),r=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
      <style${r?` nonce="${r}"`:""}>
        :host {
          user-select: none;
          min-width: 1px;
        }
        :host audio {
          display: block;
          width: 100%;
        }
        :host .scroll {
          overflow-x: auto;
          overflow-y: hidden;
          width: 100%;
          position: relative;
        }
        :host .noScrollbar {
          scrollbar-color: transparent;
          scrollbar-width: none;
        }
        :host .noScrollbar::-webkit-scrollbar {
          display: none;
          -webkit-appearance: none;
        }
        :host .wrapper {
          position: relative;
          overflow: visible;
          z-index: 2;
        }
        :host .canvases {
          min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;
        }
        :host .canvases > div {
          position: relative;
        }
        :host canvas {
          display: block;
          position: absolute;
          top: 0;
          image-rendering: pixelated;
        }
        :host .progress {
          pointer-events: none;
          position: absolute;
          z-index: 2;
          top: 0;
          left: 0;
          width: 0;
          height: 100%;
          overflow: hidden;
        }
        :host .progress > div {
          position: relative;
        }
        :host .cursor {
          pointer-events: none;
          position: absolute;
          z-index: 5;
          top: 0;
          left: 0;
          height: 100%;
          border-radius: 2px;
        }
      </style>

      <div class="scroll" part="scroll">
        <div class="wrapper" part="wrapper">
          <div class="canvases" part="canvases"></div>
          <div class="progress" part="progress"></div>
          <div class="cursor" part="cursor"></div>
        </div>
      </div>
    `,[t,e]}setOptions(t){if(this.options.container!==t.container){const e=this.parentFromOptionsContainer(t.container);e.appendChild(this.container),this.parent=e}t.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=t,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:e}=this.scrollContainer,r=e*t;this.setScroll(r)}destroy(){var t,e;this.subscriptions.forEach(r=>r()),this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.unsubscribeOnScroll)===null||e===void 0||e.forEach(r=>r()),this.unsubscribeOnScroll=[]}createDelay(t=10){let e,r;const l=()=>{e&&clearTimeout(e),r&&r()};return this.timeouts.push(l),()=>new Promise((u,h)=>{l(),r=h,e=setTimeout(()=>{e=void 0,r=void 0,u()},t)})}convertColorValues(t){if(!Array.isArray(t))return t||"";if(t.length<2)return t[0]||"";const e=document.createElement("canvas"),r=e.getContext("2d"),l=e.height*(window.devicePixelRatio||1),u=r.createLinearGradient(0,0,0,l),h=1/(t.length-1);return t.forEach((d,y)=>{const p=y*h;u.addColorStop(p,d)}),u}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(t,e,r,l){const u=t[0],h=t[1]||t[0],d=u.length,{width:y,height:p}=r.canvas,m=p/2,v=this.getPixelRatio(),S=e.barWidth?e.barWidth*v:1,_=e.barGap?e.barGap*v:e.barWidth?S/2:0,T=e.barRadius||0,O=y/(S+_)/d,C=T&&"roundRect"in r?"roundRect":"rect";r.beginPath();let F=0,j=0,R=0;for(let N=0;N<=d;N++){const A=Math.round(N*O);if(A>F){const q=Math.round(j*m*l),Y=q+Math.round(R*m*l)||1;let P=m-q;e.barAlign==="top"?P=0:e.barAlign==="bottom"&&(P=p-Y),r[C](F*(S+_),P,S,Y,T),F=A,j=0,R=0}const W=Math.abs(u[N]||0),H=Math.abs(h[N]||0);W>j&&(j=W),H>R&&(R=H)}r.fill(),r.closePath()}renderLineWaveform(t,e,r,l){const u=h=>{const d=t[h]||t[0],y=d.length,{height:p}=r.canvas,m=p/2,v=r.canvas.width/y;r.moveTo(0,m);let S=0,_=0;for(let T=0;T<=y;T++){const O=Math.round(T*v);if(O>S){const F=m+(Math.round(_*m*l)||1)*(h===0?-1:1);r.lineTo(S,F),S=O,_=0}const C=Math.abs(d[T]||0);C>_&&(_=C)}r.lineTo(S,m)};r.beginPath(),u(0),u(1),r.fill(),r.closePath()}renderWaveform(t,e,r){if(r.fillStyle=this.convertColorValues(e.waveColor),e.renderFunction)return void e.renderFunction(t,r);let l=e.barHeight||1;if(e.normalize){const u=Array.from(t[0]).reduce((h,d)=>Math.max(h,Math.abs(d)),0);l=u?1/u:1}e.barWidth||e.barGap||e.barAlign?this.renderBarWaveform(t,e,r,l):this.renderLineWaveform(t,e,r,l)}renderSingleCanvas(t,e,r,l,u,h,d){const y=this.getPixelRatio(),p=document.createElement("canvas");p.width=Math.round(r*y),p.height=Math.round(l*y),p.style.width=`${r}px`,p.style.height=`${l}px`,p.style.left=`${Math.round(u)}px`,h.appendChild(p);const m=p.getContext("2d");if(this.renderWaveform(t,e,m),p.width>0&&p.height>0){const v=p.cloneNode(),S=v.getContext("2d");S.drawImage(p,0,0),S.globalCompositeOperation="source-in",S.fillStyle=this.convertColorValues(e.progressColor),S.fillRect(0,0,p.width,p.height),d.appendChild(v)}}renderMultiCanvas(t,e,r,l,u,h){const d=this.getPixelRatio(),{clientWidth:y}=this.scrollContainer,p=r/d;let m=Math.min(Ya.MAX_CANVAS_WIDTH,y,p),v={};if(m===0)return;if(e.barWidth||e.barGap){const C=e.barWidth||.5,F=C+(e.barGap||C/2);m%F!=0&&(m=Math.floor(m/F)*F)}const S=C=>{if(C<0||C>=_||v[C])return;v[C]=!0;const F=C*m,j=Math.min(p-F,m);if(j<=0)return;const R=t.map(N=>{const A=Math.floor(F/p*N.length),W=Math.floor((F+j)/p*N.length);return N.slice(A,W)});this.renderSingleCanvas(R,e,j,l,F,u,h)},_=Math.ceil(p/m);if(!this.isScrollable){for(let C=0;C<_;C++)S(C);return}const T=this.scrollContainer.scrollLeft/p,O=Math.floor(T*_);if(S(O-1),S(O),S(O+1),_>1){const C=this.on("scroll",()=>{const{scrollLeft:F}=this.scrollContainer,j=Math.floor(F/p*_);Object.keys(v).length>Ya.MAX_NODES&&(u.innerHTML="",h.innerHTML="",v={}),S(j-1),S(j),S(j+1)});this.unsubscribeOnScroll.push(C)}}renderChannel(t,e,r,l){var{overlay:u}=e,h=function(m,v){var S={};for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&v.indexOf(_)<0&&(S[_]=m[_]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var T=0;for(_=Object.getOwnPropertySymbols(m);T<_.length;T++)v.indexOf(_[T])<0&&Object.prototype.propertyIsEnumerable.call(m,_[T])&&(S[_[T]]=m[_[T]])}return S}(e,["overlay"]);const d=document.createElement("div"),y=this.getHeight(h.height,h.splitChannels);d.style.height=`${y}px`,u&&l>0&&(d.style.marginTop=`-${y}px`),this.canvasWrapper.style.minHeight=`${y}px`,this.canvasWrapper.appendChild(d);const p=d.cloneNode();this.progressWrapper.appendChild(p),this.renderMultiCanvas(t,h,r,y,d,p)}render(t){return Be(this,void 0,void 0,function*(){var e;this.timeouts.forEach(y=>y()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),l=this.scrollContainer.clientWidth,u=Math.ceil(t.duration*(this.options.minPxPerSec||0));this.isScrollable=u>l;const h=this.options.fillParent&&!this.isScrollable,d=(h?l:u)*r;if(this.wrapper.style.width=h?"100%":`${u}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=t,this.emit("render"),this.options.splitChannels)for(let y=0;y<t.numberOfChannels;y++){const p=Object.assign(Object.assign({},this.options),(e=this.options.splitChannels)===null||e===void 0?void 0:e[y]);this.renderChannel([t.getChannelData(y)],p,d,y)}else{const y=[t.getChannelData(0)];t.numberOfChannels>1&&y.push(t.getChannelData(1)),this.renderChannel(y,this.options,d,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){if(this.unsubscribeOnScroll.forEach(r=>r()),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:e}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:r}=this.progressWrapper.getBoundingClientRect();let l=r-e;l*=2,l=l<0?Math.floor(l):Math.ceil(l),l/=2,this.scrollContainer.scrollLeft+=l}}zoom(t){this.options.minPxPerSec=t,this.reRender()}scrollIntoView(t,e=!1){const{scrollLeft:r,scrollWidth:l,clientWidth:u}=this.scrollContainer,h=t*l,d=r,y=r+u,p=u/2;if(this.isDragging)h+30>y?this.scrollContainer.scrollLeft+=30:h-30<d&&(this.scrollContainer.scrollLeft-=30);else{(h<d||h>y)&&(this.scrollContainer.scrollLeft=h-(this.options.autoCenter?p:0));const m=h-r-p;e&&this.options.autoCenter&&m>0&&(this.scrollContainer.scrollLeft+=Math.min(m,10))}{const m=this.scrollContainer.scrollLeft,v=m/l,S=(m+u)/l;this.emit("scroll",v,S,m,m+u)}}renderProgress(t,e){if(isNaN(t))return;const r=100*t;this.canvasWrapper.style.clipPath=`polygon(${r}% 0, 100% 0, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(t,e)}exportImage(t,e,r){return Be(this,void 0,void 0,function*(){const l=this.canvasWrapper.querySelectorAll("canvas");if(!l.length)throw new Error("No waveform data");if(r==="dataURL"){const u=Array.from(l).map(h=>h.toDataURL(t,e));return Promise.resolve(u)}return Promise.all(Array.from(l).map(u=>new Promise((h,d)=>{u.toBlob(y=>{y?h(y):d(new Error("Could not export image"))},t,e)})))})}}Ya.MAX_CANVAS_WIDTH=8e3,Ya.MAX_NODES=10;let y6=class extends Tl{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}};class Ld extends Tl{constructor(t=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=t,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Be(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(t){if(this.currentSrc=t,this._duration=void 0,!t)return this.buffer=null,void this.emit("emptied");fetch(t).then(e=>{if(e.status>=400)throw new Error(`Failed to fetch ${t}: ${e.status} (${e.statusText})`);return e.arrayBuffer()}).then(e=>this.currentSrc!==t?null:this.audioContext.decodeAudioData(e)).then(e=>{this.currentSrc===t&&(this.buffer=e,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var t;if(!this.paused)return;this.paused=!1,(t=this.bufferNode)===null||t===void 0||t.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let e=this.playedDuration*this._playbackRate;(e>=this.duration||e<0)&&(e=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,e),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var t;this.paused=!0,(t=this.bufferNode)===null||t===void 0||t.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return Be(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(t){const e=t-this.currentTime,r=this.bufferNode;r==null||r.stop(this.audioContext.currentTime+e),r==null||r.addEventListener("ended",()=>{r===this.bufferNode&&(this.bufferNode=null,this.pause())},{once:!0})}setSinkId(t){return Be(this,void 0,void 0,function*(){return this.audioContext.setSinkId(t)})}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this.bufferNode&&(this.bufferNode.playbackRate.value=t)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(t){const e=!this.paused;e&&this._pause(),this.playedDuration=t/this._playbackRate,e&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var t,e;return(t=this._duration)!==null&&t!==void 0?t:((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t,this.emit("volumechange")}get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const e=this.buffer.numberOfChannels;for(let r=0;r<e;r++)t.push(this.buffer.getChannelData(r));return t}}const m6={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class cl extends p6{static create(t){return new cl(t)}constructor(t){const e=t.media||(t.backend==="WebAudio"?new Ld:void 0);super({media:e,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate}),this.plugins=[],this.decodedData=null,this.stopAtPosition=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},m6,t),this.timer=new y6;const r=e?void 0:this.getMediaElement();this.renderer=new Ya(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const l=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:u,duration:h}=this.options;(l||u&&h)&&this.load(l,u,h).catch(()=>null)})}updateProgress(t=this.getCurrentTime()){return this.renderer.renderProgress(t/this.getDuration(),this.isPlaying()),t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t),this.emit("audioprocess",t),this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition&&this.pause()}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const t=this.updateProgress();this.emit("timeupdate",t)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("emptied",()=>{this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("ended",()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error")),this.stopAtPosition=null}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(t,e)=>{this.options.interact&&(this.seekTo(t),this.emit("interaction",t*this.getDuration()),this.emit("click",t,e))}),this.renderer.on("dblclick",(t,e)=>{this.emit("dblclick",t,e)}),this.renderer.on("scroll",(t,e,r,l)=>{const u=this.getDuration();this.emit("scroll",t*u,e*u,r,l)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",t=>{this.emit("dragstart",t)}),this.renderer.on("dragend",t=>{this.emit("dragend",t)}));{let t;this.subscriptions.push(this.renderer.on("drag",e=>{if(!this.options.interact)return;let r;this.renderer.renderProgress(e),clearTimeout(t),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),t=setTimeout(()=>{this.seekTo(e)},r),this.emit("interaction",e*this.getDuration()),this.emit("drag",e)}))}}initPlugins(){var t;!((t=this.options.plugins)===null||t===void 0)&&t.length&&this.options.plugins.forEach(e=>{this.registerPlugin(e)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(t=>t()),this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t),t.duration&&!t.peaks&&(this.decodedData=Pu.createBuffer(this.exportPeaks(),t.duration)),t.peaks&&t.duration&&(this.decodedData=Pu.createBuffer(t.peaks,t.duration)),this.renderer.setOptions(this.options),t.audioRate&&this.setPlaybackRate(t.audioRate),t.mediaControls!=null&&(this.getMediaElement().controls=t.mediaControls)}registerPlugin(t){return t._init(this),this.plugins.push(t),this.subscriptions.push(t.once("destroy",()=>{this.plugins=this.plugins.filter(e=>e!==t)})),t}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const e=t/this.getDuration();this.renderer.setScrollPercentage(e)}getActivePlugins(){return this.plugins}loadAudio(t,e,r,l){return Be(this,void 0,void 0,function*(){var u;if(this.emit("load",t),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,!e&&!r){const d=this.options.fetchParams||{};window.AbortController&&!d.signal&&(this.abortController=new AbortController,d.signal=(u=this.abortController)===null||u===void 0?void 0:u.signal);const y=m=>this.emit("loading",m);e=yield d6.fetchBlob(t,y,d);const p=this.options.blobMimeType;p&&(e=new Blob([e],{type:p}))}this.setSrc(t,e);const h=yield new Promise(d=>{const y=l||this.getDuration();y?d(y):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>d(this.getDuration()),{once:!0}))});if(!t&&!e){const d=this.getMediaElement();d instanceof Ld&&(d.duration=h)}if(r)this.decodedData=Pu.createBuffer(r,h||0);else if(e){const d=yield e.arrayBuffer();this.decodedData=yield Pu.decode(d,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(t,e,r){return Be(this,void 0,void 0,function*(){try{return yield this.loadAudio(t,void 0,e,r)}catch(l){throw this.emit("error",l),l}})}loadBlob(t,e,r){return Be(this,void 0,void 0,function*(){try{return yield this.loadAudio("",t,e,r)}catch(l){throw this.emit("error",l),l}})}zoom(t){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(t),this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:e=8e3,precision:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const l=Math.min(t,this.decodedData.numberOfChannels),u=[];for(let h=0;h<l;h++){const d=this.decodedData.getChannelData(h),y=[],p=d.length/e;for(let m=0;m<e;m++){const v=d.slice(Math.floor(m*p),Math.ceil((m+1)*p));let S=0;for(let _=0;_<v.length;_++){const T=v[_];Math.abs(T)>Math.abs(S)&&(S=T)}y.push(Math.round(S*r)/r)}u.push(y)}return u}getDuration(){let t=super.getDuration()||0;return t!==0&&t!==1/0||!this.decodedData||(t=this.decodedData.duration),t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null,super.setTime(t),this.updateProgress(t),this.emit("timeupdate",t)}seekTo(t){const e=this.getDuration()*t;this.setTime(e)}play(t,e){const r=Object.create(null,{play:{get:()=>super.play}});return Be(this,void 0,void 0,function*(){t!=null&&this.setTime(t);const l=yield r.play.call(this);return e!=null&&(this.media instanceof Ld?this.media.stopAt(e):this.stopAtPosition=e),l})}playPause(){return Be(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents(),super.setMediaElement(t),this.initPlayerEvents()}exportImage(){return Be(this,arguments,void 0,function*(t="image/png",e=1,r="dataURL"){return this.renderer.exportImage(t,e,r)})}destroy(){var t;this.emit("destroy"),(t=this.abortController)===null||t===void 0||t.abort(),this.plugins.forEach(e=>e.destroy()),this.subscriptions.forEach(e=>e()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}cl.BasePlugin=w2,cl.dom=f6;const g6={height:50,overlayColor:"rgba(100, 100, 100, 0.1)",insertPosition:"afterend"};class $p extends w2{constructor(t){super(t),this.miniWavesurfer=null,this.container=null,this.options=Object.assign({},g6,t),this.minimapWrapper=this.initMinimapWrapper(),this.overlay=this.initOverlay()}static create(t){return new $p(t)}onInit(){var t,e;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");this.options.container?(typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.options.container instanceof HTMLElement&&(this.container=this.options.container),(t=this.container)===null||t===void 0||t.appendChild(this.minimapWrapper)):(this.container=this.wavesurfer.getWrapper().parentElement,(e=this.container)===null||e===void 0||e.insertAdjacentElement(this.options.insertPosition,this.minimapWrapper)),this.initWaveSurferEvents(),Promise.resolve().then(()=>{this.initMinimap()})}initMinimapWrapper(){return Fc("div",{part:"minimap",style:{position:"relative"}})}initOverlay(){return Fc("div",{part:"minimap-overlay",style:{position:"absolute",zIndex:"2",left:"0",top:"0",bottom:"0",transition:"left 100ms ease-out",pointerEvents:"none",backgroundColor:this.options.overlayColor}},this.minimapWrapper)}initMinimap(){if(this.miniWavesurfer&&(this.miniWavesurfer.destroy(),this.miniWavesurfer=null),!this.wavesurfer)return;const t=this.wavesurfer.getDecodedData(),e=this.wavesurfer.getMediaElement();if(!t||!e)return;const r=[];for(let l=0;l<t.numberOfChannels;l++)r.push(t.getChannelData(l));this.miniWavesurfer=cl.create(Object.assign(Object.assign({},this.options),{container:this.minimapWrapper,minPxPerSec:0,fillParent:!0,media:e,peaks:r,duration:t.duration})),this.subscriptions.push(this.miniWavesurfer.on("audioprocess",l=>{this.emit("audioprocess",l)}),this.miniWavesurfer.on("click",(l,u)=>{this.emit("click",l,u)}),this.miniWavesurfer.on("dblclick",(l,u)=>{this.emit("dblclick",l,u)}),this.miniWavesurfer.on("decode",l=>{this.emit("decode",l)}),this.miniWavesurfer.on("destroy",()=>{this.emit("destroy")}),this.miniWavesurfer.on("drag",l=>{this.emit("drag",l)}),this.miniWavesurfer.on("dragend",l=>{this.emit("dragend",l)}),this.miniWavesurfer.on("dragstart",l=>{this.emit("dragstart",l)}),this.miniWavesurfer.on("interaction",()=>{this.emit("interaction")}),this.miniWavesurfer.on("init",()=>{this.emit("init")}),this.miniWavesurfer.on("ready",()=>{this.emit("ready")}),this.miniWavesurfer.on("redraw",()=>{this.emit("redraw")}),this.miniWavesurfer.on("redrawcomplete",()=>{this.emit("redrawcomplete")}),this.miniWavesurfer.on("seeking",l=>{this.emit("seeking",l)}),this.miniWavesurfer.on("timeupdate",l=>{this.emit("timeupdate",l)}))}getOverlayWidth(){var t;const e=((t=this.wavesurfer)===null||t===void 0?void 0:t.getWrapper().clientWidth)||1;return Math.round(this.minimapWrapper.clientWidth/e*100)}onRedraw(){const t=this.getOverlayWidth();this.overlay.style.width=`${t}%`}onScroll(t){if(!this.wavesurfer)return;const e=this.wavesurfer.getDuration();this.overlay.style.left=t/e*100+"%"}initWaveSurferEvents(){this.wavesurfer&&this.subscriptions.push(this.wavesurfer.on("decode",()=>{this.initMinimap()}),this.wavesurfer.on("scroll",t=>{this.onScroll(t)}),this.wavesurfer.on("redraw",()=>{this.onRedraw()}))}destroy(){var t;(t=this.miniWavesurfer)===null||t===void 0||t.destroy(),this.minimapWrapper.remove(),super.destroy()}}var v6=Object.defineProperty,b6=(s,t,e)=>t in s?v6(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Ud=(s,t,e)=>b6(s,typeof t!="symbol"?t+"":t,e);function E2(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[r,l]of Object.entries(t))if(r==="children")for(const[u,h]of Object.entries(t))typeof h=="string"?e.appendChild(document.createTextNode(h)):e.appendChild(E2(u,h));else r==="style"?Object.assign(e.style,l):r==="textContent"?e.textContent=l:e.setAttribute(r,l.toString());return e}function Qv(s,t,e){return E2(s,t||{})}class S6{constructor(){this.listeners={}}on(t,e,r){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),r!=null&&r.once){const l=()=>{this.un(t,l),this.un(t,e)};return this.on(t,l),l}return()=>this.un(t,e)}un(t,e){var r;(r=this.listeners[t])===null||r===void 0||r.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(r=>r(...e))}}class _6 extends S6{constructor(t){super(),this.subscriptions=[],this.options=t}onInit(){}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t())}}class Zp extends _6{constructor(t){super(t),Ud(this,"subscriptions",[]),Ud(this,"overlayWrapper"),Ud(this,"images",[]),this.overlayWrapper=this.initOverlayWrapper(),this.loadImages()}initOverlayWrapper(){return Qv("div",{part:"overlay-wrapper",style:{pointerEvents:"none"}})}loadImages(){const t=Array.isArray(this.options.imageUrl)?this.options.imageUrl:[this.options.imageUrl];this.images=t.map(e=>{const r=new Image;return r.src=e,r})}static create(t){if(!t)throw Error("OverlayPlugin options are required");return console.log("Creating OverlayPlugin with options:",t),new Zp(t)}initOverlay(){var t,e,r;const l=((t=this.wavesurfer)==null?void 0:t.getDuration())??((e=this.options)==null?void 0:e.duration)??0,u=(((r=this.wavesurfer)==null?void 0:r.getWrapper().scrollWidth)||this.overlayWrapper.scrollWidth)/l,h=l*u,d=(this.options.position||"overlay")==="underlay";this.overlayWrapper.innerHTML="";let y=[];if(Array.isArray(this.options.opacity))y=this.options.opacity;else{const p=this.options.opacity||.3;y=this.images.map(()=>p)}for(;y.length<this.images.length;)y.push(y[y.length-1]||.3);if(this.images.forEach((p,m)=>{const v=Qv("div",{style:{imageRendering:this.options.imageRendering||"auto",backgroundImage:`url(${p.src})`,backgroundPosition:"0 0",backgroundRepeat:"no-repeat",backgroundSize:`${h}px 100%`,width:`${h}px`,height:"100%",overflow:"hidden",backgroundColor:m===0&&this.options.backgroundColor||"transparent",whiteSpace:"nowrap",position:"absolute",top:"0",left:"0",right:"0",zIndex:d?`-${5+m}`:`${200+m}`,opacity:String(y[m])}});v.setAttribute("part",`overlay-layer-${m}`),this.overlayWrapper.appendChild(v)}),this.wavesurfer){const p=this.wavesurfer.getWrapper();d&&(p.style.position="relative",p.style.zIndex="100",p.querySelectorAll('[part="wave"], canvas').forEach(m=>{const v=m;v.style.position="relative",v.style.zIndex="150"})),p.querySelectorAll('.wavesurfer-cursor, [part="cursor"]').forEach(m=>{const v=m;v.style.position="absolute",v.style.zIndex="300"})}this.wavesurfer&&(this.subscriptions.push(this.wavesurfer.on("zoom",p=>{const m=l*p;Array.from(this.overlayWrapper.children).forEach(v=>{const S=v;S.style.width=`${m}px`,S.style.backgroundSize=`${m}px 100%`})})),this.subscriptions.push(this.wavesurfer.on("redraw",()=>{var p;const m=(p=this.wavesurfer)==null?void 0:p.getWrapper();m&&m.querySelectorAll('.wavesurfer-cursor, [part="cursor"]').forEach(v=>{const S=v;S.style.position="absolute",S.style.zIndex="300"})}))),this.emit("ready")}onInit(){var t,e;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");let r=this.wavesurfer.getWrapper();if(this.options.container instanceof HTMLElement)r=this.options.container;else if(typeof this.options.container=="string"){const l=document.querySelector(this.options.container);if(!l)throw Error(`No container found matching ${this.options.container}`);r=l}if(r.appendChild(this.overlayWrapper),this.subscriptions.push(this.wavesurfer.on("ready",()=>{this.initOverlay(),this.wavesurfer&&this.subscriptions.push(this.wavesurfer.on("redraw",()=>this.initOverlay()))})),this.options.hideWaveform){const l=(t=this.wavesurfer)==null?void 0:t.options;(e=this.wavesurfer)==null||e.setOptions({...l,waveColor:"transparent"})}}_init(t){this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t()),this.overlayWrapper.remove(),this.overlayWrapper.innerHTML=""}}const T2=[{name:"regions",options:{}},{name:"timeline",options:{height:10}},{name:"zoom",options:{exponentialZooming:!0,iterations:100}}],x2={regions:s=>W5.create(s&&Object.keys(s).length>0?s:void 0),spectrogram:s=>J5.create(s&&Object.keys(s).length>0?s:void 0),timeline:s=>i6.create(s&&Object.keys(s).length>0?s:void 0),zoom:s=>o6.create(s&&Object.keys(s).length>0?s:void 0),hover:s=>h6.create(s&&Object.keys(s).length>0?s:void 0),minimap:s=>$p.create(s||{}),overlay:s=>{const t={...s};return typeof t.imageUrl>"u"&&(t.imageUrl=""),Zp.create(t)}},xl=on(T2);on(null);const w6=on(s=>t=>{const r=s(xl).find(u=>u.name===t);if(!r)return;const l=r.options&&Object.keys(r.options).length>0?r.options:void 0;return x2[t](l)});function O2(s,t){const e=x2[s.name];if(!e)throw new Error(`Plugin ${s.name} not found`);const r=s.options&&Object.keys(s.options).length>0?s.options:void 0,l=e(r);return l.name=s.name,t.registerPlugin(l),l}function A6(s,t){console.log("unregistering plugin",s.name);const r=t.getActivePlugins().find(l=>l.name===l.name);r&&r.destroy()}function E6(s,t){!s||s.length===0||!s.length||s.forEach(e=>O2(e,t))}function T6(s){const{instance:t}=qa(Fe);if(!t)return null;const r=t.getActivePlugins().find(l=>l.name===s);return r||null}on(null,(s,t,e)=>{t(xl,e)});on(s=>t=>s(xl).some(r=>r.name===t));const Fe=on({instance:null,ready:!1});on(s=>s(Fe),(s,t,e)=>{switch(e.type){case"create":{const{container:r,audioBlob:l,options:u,plugins:h,onReady:d}=e,y=s(Fe).instance;y&&y.destroy();const p=Ic.create({container:r,normalize:!0,minPxPerSec:10,...u});E6(h&&h.length?h:T2,p),p.on("ready",()=>{t(Fe,{instance:p,ready:!0}),d()}),t(Fe,{instance:p,ready:!1}),p.loadBlob(l);return}case"loadBlob":{const{audioBlob:r}=e,l=s(Fe).instance;l&&l.loadBlob(r),t(Fe,{instance:l,ready:!1});return}case"destroy":{const r=s(Fe).instance;r&&r.destroy(),t(Fe,{instance:null,ready:!1});return}case"setOptions":{const r=s(Fe).instance;r&&r.setOptions(e.options);return}case"setReady":{const r=s(Fe).instance;t(Fe,{instance:r,ready:e.ready});return}default:return}});const x6=()=>{const[s,t]=wr(Pp),[e,r]=wr(u2),{ready:l}=qa(Fe),u=T6("regions"),[h]=wr(Qc),[d,y]=it.useState(!1);it.useEffect(()=>{u&&l&&h.length&&y(!0)},[u,l,h]);const p=()=>{if(!e)return;const _=u==null?void 0:u.getRegions();_&&_.forEach(T=>{if(!T)return;T._originalContent||(T._originalContent=T.content,T.content instanceof HTMLElement&&(T._originalContent=T.content.textContent));const O=T._originalContent,C=s&&T.id===e.id?`↻ ${O}`:O;T.setOptions({content:C})})},m=_=>{if(!_||!_.id||!h)return;const T=_.id,O=h.find(F=>F.id===T),C=u==null?void 0:u.getRegions();C&&C.forEach(F=>{if(F)if(F.id===T)F.setOptions({color:O==null?void 0:O.lightenedColor});else{const j=h.find(R=>R.id===F.id);F.setOptions({color:j==null?void 0:j.color})}})},v=_=>{!_||!_.id||!h||s||r(_)};it.useEffect(()=>{if(!u||!l||!d||!h.length)return;console.log("[useRegions] adding regions",h),u.clearRegions(),h.forEach(O=>{u.addRegion({start:O.start,end:O.end,content:O.content,id:O.id,color:O.color,drag:O.drag,resize:O.resize})});const _=O=>{v(O)},T=O=>v(O);return u.on("region-in",_),u.on("region-clicked",T),()=>{u.clearRegions(),u.unAll()}},[h,l,d]);const S=it.useCallback(_=>{if(!e||_.id!==e.id){t(!1);return}const T=u==null?void 0:u.getRegions();if(s&&T&&e){const O=T.find(C=>C.id===e.id);if(O&&typeof O.play=="function")try{O.play()}catch{}}},[s,u,e,t]);return it.useEffect(()=>{if(p(),!!u)return u.on("region-out",S),()=>{u.un("region-out",S)}},[s,S,u]),it.useEffect(()=>{e&&(t(!1),m(e))},[e]),{}};var Ol=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Er=typeof window>"u"||"Deno"in globalThis;function Ke(){}function O6(s,t){return typeof s=="function"?s(t):s}function sp(s){return typeof s=="number"&&s>=0&&s!==1/0}function D2(s,t){return Math.max(s+(t||0)-Date.now(),0)}function wa(s,t){return typeof s=="function"?s(t):s}function Qn(s,t){return typeof s=="function"?s(t):s}function Gv(s,t){const{type:e="all",exact:r,fetchStatus:l,predicate:u,queryKey:h,stale:d}=s;if(h){if(r){if(t.queryHash!==Kp(h,t.options))return!1}else if(!fl(t.queryKey,h))return!1}if(e!=="all"){const y=t.isActive();if(e==="active"&&!y||e==="inactive"&&y)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||l&&l!==t.state.fetchStatus||u&&!u(t))}function Xv(s,t){const{exact:e,status:r,predicate:l,mutationKey:u}=s;if(u){if(!t.options.mutationKey)return!1;if(e){if(hl(t.options.mutationKey)!==hl(u))return!1}else if(!fl(t.options.mutationKey,u))return!1}return!(r&&t.state.status!==r||l&&!l(t))}function Kp(s,t){return((t==null?void 0:t.queryKeyHashFn)||hl)(s)}function hl(s){return JSON.stringify(s,(t,e)=>ap(e)?Object.keys(e).sort().reduce((r,l)=>(r[l]=e[l],r),{}):e)}function fl(s,t){return s===t?!0:typeof s!=typeof t?!1:s&&t&&typeof s=="object"&&typeof t=="object"?Object.keys(t).every(e=>fl(s[e],t[e])):!1}function M2(s,t){if(s===t)return s;const e=Wv(s)&&Wv(t);if(e||ap(s)&&ap(t)){const r=e?s:Object.keys(s),l=r.length,u=e?t:Object.keys(t),h=u.length,d=e?[]:{};let y=0;for(let p=0;p<h;p++){const m=e?p:u[p];(!e&&r.includes(m)||e)&&s[m]===void 0&&t[m]===void 0?(d[m]=void 0,y++):(d[m]=M2(s[m],t[m]),d[m]===s[m]&&s[m]!==void 0&&y++)}return l===h&&y===l?s:d}return t}function rp(s,t){if(!t||Object.keys(s).length!==Object.keys(t).length)return!1;for(const e in s)if(s[e]!==t[e])return!1;return!0}function Wv(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function ap(s){if(!Pv(s))return!1;const t=s.constructor;if(t===void 0)return!0;const e=t.prototype;return!(!Pv(e)||!e.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function Pv(s){return Object.prototype.toString.call(s)==="[object Object]"}function D6(s){return new Promise(t=>{setTimeout(t,s)})}function op(s,t,e){return typeof e.structuralSharing=="function"?e.structuralSharing(s,t):e.structuralSharing!==!1?M2(s,t):t}function M6(s,t,e=0){const r=[...s,t];return e&&r.length>e?r.slice(1):r}function R6(s,t,e=0){const r=[t,...s];return e&&r.length>e?r.slice(0,-1):r}var Jp=Symbol();function R2(s,t){return!s.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!s.queryFn||s.queryFn===Jp?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function C6(s,t){return typeof s=="function"?s(...t):!!s}var fr,ws,Aa,ib,B6=(ib=class extends Ol{constructor(){super();ct(this,fr);ct(this,ws);ct(this,Aa);nt(this,Aa,t=>{if(!Er&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}onSubscribe(){D(this,ws)||this.setEventListener(D(this,Aa))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,ws))==null||t.call(this),nt(this,ws,void 0))}setEventListener(t){var e;nt(this,Aa,t),(e=D(this,ws))==null||e.call(this),nt(this,ws,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){D(this,fr)!==t&&(nt(this,fr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){var t;return typeof D(this,fr)=="boolean"?D(this,fr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fr=new WeakMap,ws=new WeakMap,Aa=new WeakMap,ib),t0=new B6,Ea,As,Ta,sb,N6=(sb=class extends Ol{constructor(){super();ct(this,Ea,!0);ct(this,As);ct(this,Ta);nt(this,Ta,t=>{if(!Er&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}})}onSubscribe(){D(this,As)||this.setEventListener(D(this,Ta))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,As))==null||t.call(this),nt(this,As,void 0))}setEventListener(t){var e;nt(this,Ta,t),(e=D(this,As))==null||e.call(this),nt(this,As,t(this.setOnline.bind(this)))}setOnline(t){D(this,Ea)!==t&&(nt(this,Ea,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return D(this,Ea)}},Ea=new WeakMap,As=new WeakMap,Ta=new WeakMap,sb),jc=new N6;function lp(){let s,t;const e=new Promise((l,u)=>{s=l,t=u});e.status="pending",e.catch(()=>{});function r(l){Object.assign(e,l),delete e.resolve,delete e.reject}return e.resolve=l=>{r({status:"fulfilled",value:l}),s(l)},e.reject=l=>{r({status:"rejected",reason:l}),t(l)},e}function z6(s){return Math.min(1e3*2**s,3e4)}function C2(s){return(s??"online")==="online"?jc.isOnline():!0}var B2=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function Id(s){return s instanceof B2}function N2(s){let t=!1,e=0,r=!1,l;const u=lp(),h=O=>{var C;r||(S(new B2(O)),(C=s.abort)==null||C.call(s))},d=()=>{t=!0},y=()=>{t=!1},p=()=>t0.isFocused()&&(s.networkMode==="always"||jc.isOnline())&&s.canRun(),m=()=>C2(s.networkMode)&&s.canRun(),v=O=>{var C;r||(r=!0,(C=s.onSuccess)==null||C.call(s,O),l==null||l(),u.resolve(O))},S=O=>{var C;r||(r=!0,(C=s.onError)==null||C.call(s,O),l==null||l(),u.reject(O))},_=()=>new Promise(O=>{var C;l=F=>{(r||p())&&O(F)},(C=s.onPause)==null||C.call(s)}).then(()=>{var O;l=void 0,r||(O=s.onContinue)==null||O.call(s)}),T=()=>{if(r)return;let O;const C=e===0?s.initialPromise:void 0;try{O=C??s.fn()}catch(F){O=Promise.reject(F)}Promise.resolve(O).then(v).catch(F=>{var W;if(r)return;const j=s.retry??(Er?0:3),R=s.retryDelay??z6,N=typeof R=="function"?R(e,F):R,A=j===!0||typeof j=="number"&&e<j||typeof j=="function"&&j(e,F);if(t||!A){S(F);return}e++,(W=s.onFail)==null||W.call(s,e,F),D6(N).then(()=>p()?void 0:_()).then(()=>{t?S(F):T()})})};return{promise:u,cancel:h,continue:()=>(l==null||l(),u),cancelRetry:d,continueRetry:y,canStart:m,start:()=>(m()?T():_().then(T),u)}}var L6=s=>setTimeout(s,0);function U6(){let s=[],t=0,e=d=>{d()},r=d=>{d()},l=L6;const u=d=>{t?s.push(d):l(()=>{e(d)})},h=()=>{const d=s;s=[],d.length&&l(()=>{r(()=>{d.forEach(y=>{e(y)})})})};return{batch:d=>{let y;t++;try{y=d()}finally{t--,t||h()}return y},batchCalls:d=>(...y)=>{u(()=>{d(...y)})},schedule:u,setNotifyFunction:d=>{e=d},setBatchNotifyFunction:d=>{r=d},setScheduler:d=>{l=d}}}var Ne=U6(),dr,rb,z2=(rb=class{constructor(){ct(this,dr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sp(this.gcTime)&&nt(this,dr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(Er?1/0:5*60*1e3))}clearGcTimeout(){D(this,dr)&&(clearTimeout(D(this,dr)),nt(this,dr,void 0))}},dr=new WeakMap,rb),xa,Oa,zn,pr,Ie,dl,yr,Vn,zi,ab,I6=(ab=class extends z2{constructor(t){super();ct(this,Vn);ct(this,xa);ct(this,Oa);ct(this,zn);ct(this,pr);ct(this,Ie);ct(this,dl);ct(this,yr);nt(this,yr,!1),nt(this,dl,t.defaultOptions),this.setOptions(t.options),this.observers=[],nt(this,pr,t.client),nt(this,zn,D(this,pr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,nt(this,xa,F6(this.options)),this.state=t.state??D(this,xa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,Ie))==null?void 0:t.promise}setOptions(t){this.options={...D(this,dl),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,zn).remove(this)}setData(t,e){const r=op(this.state.data,t,this.options);return Ct(this,Vn,zi).call(this,{data:r,type:"success",dataUpdatedAt:e==null?void 0:e.updatedAt,manual:e==null?void 0:e.manual}),r}setState(t,e){Ct(this,Vn,zi).call(this,{type:"setState",state:t,setStateOptions:e})}cancel(t){var r,l;const e=(r=D(this,Ie))==null?void 0:r.promise;return(l=D(this,Ie))==null||l.cancel(t),e?e.then(Ke).catch(Ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(D(this,xa))}isActive(){return this.observers.some(t=>Qn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Jp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!D2(this.state.dataUpdatedAt,t)}onFocus(){var e;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(e=D(this,Ie))==null||e.continue()}onOnline(){var e;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(e=D(this,Ie))==null||e.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,zn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(D(this,Ie)&&(D(this,yr)?D(this,Ie).cancel({revert:!0}):D(this,Ie).cancelRetry()),this.scheduleGc()),D(this,zn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ct(this,Vn,zi).call(this,{type:"invalidate"})}fetch(t,e){var y,p,m;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(e!=null&&e.cancelRefetch))this.cancel({silent:!0});else if(D(this,Ie))return D(this,Ie).continueRetry(),D(this,Ie).promise}if(t&&this.setOptions(t),!this.options.queryFn){const v=this.observers.find(S=>S.options.queryFn);v&&this.setOptions(v.options)}const r=new AbortController,l=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(nt(this,yr,!0),r.signal)})},u=()=>{const v=R2(this.options,e),S={client:D(this,pr),queryKey:this.queryKey,meta:this.meta};return l(S),nt(this,yr,!1),this.options.persister?this.options.persister(v,S,this):v(S)},h={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:D(this,pr),state:this.state,fetchFn:u};l(h),(y=this.options.behavior)==null||y.onFetch(h,this),nt(this,Oa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=h.fetchOptions)==null?void 0:p.meta))&&Ct(this,Vn,zi).call(this,{type:"fetch",meta:(m=h.fetchOptions)==null?void 0:m.meta});const d=v=>{var S,_,T,O;Id(v)&&v.silent||Ct(this,Vn,zi).call(this,{type:"error",error:v}),Id(v)||((_=(S=D(this,zn).config).onError)==null||_.call(S,v,this),(O=(T=D(this,zn).config).onSettled)==null||O.call(T,this.state.data,v,this)),this.scheduleGc()};return nt(this,Ie,N2({initialPromise:e==null?void 0:e.initialPromise,fn:h.fetchFn,abort:r.abort.bind(r),onSuccess:v=>{var S,_,T,O;if(v===void 0){d(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(v)}catch(C){d(C);return}(_=(S=D(this,zn).config).onSuccess)==null||_.call(S,v,this),(O=(T=D(this,zn).config).onSettled)==null||O.call(T,v,this.state.error,this),this.scheduleGc()},onError:d,onFail:(v,S)=>{Ct(this,Vn,zi).call(this,{type:"failed",failureCount:v,error:S})},onPause:()=>{Ct(this,Vn,zi).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Vn,zi).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0})),D(this,Ie).start()}},xa=new WeakMap,Oa=new WeakMap,zn=new WeakMap,pr=new WeakMap,Ie=new WeakMap,dl=new WeakMap,yr=new WeakMap,Vn=new WeakSet,zi=function(t){const e=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...L2(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const l=t.error;return Id(l)&&l.revert&&D(this,Oa)?{...D(this,Oa),fetchStatus:"idle"}:{...r,error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=e(this.state),Ne.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),D(this,zn).notify({query:this,type:"updated",action:t})})},ab);function L2(s,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:C2(t.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function F6(s){const t=typeof s.initialData=="function"?s.initialData():s.initialData,e=t!==void 0,r=e?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:e?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:e?"success":"pending",fetchStatus:"idle"}}var ii,ob,j6=(ob=class extends Ol{constructor(t={}){super();ct(this,ii);this.config=t,nt(this,ii,new Map)}build(t,e,r){const l=e.queryKey,u=e.queryHash??Kp(l,e);let h=this.get(u);return h||(h=new I6({client:t,queryKey:l,queryHash:u,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(l)}),this.add(h)),h}add(t){D(this,ii).has(t.queryHash)||(D(this,ii).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=D(this,ii).get(t.queryHash);e&&(t.destroy(),e===t&&D(this,ii).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ne.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,ii).get(t)}getAll(){return[...D(this,ii).values()]}find(t){const e={exact:!0,...t};return this.getAll().find(r=>Gv(e,r))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(r=>Gv(t,r)):e}notify(t){Ne.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Ne.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ne.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ii=new WeakMap,ob),si,He,mr,ri,bs,lb,H6=(lb=class extends z2{constructor(t){super();ct(this,ri);ct(this,si);ct(this,He);ct(this,mr);this.mutationId=t.mutationId,nt(this,He,t.mutationCache),nt(this,si,[]),this.state=t.state||k6(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,si).includes(t)||(D(this,si).push(t),this.clearGcTimeout(),D(this,He).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){nt(this,si,D(this,si).filter(e=>e!==t)),this.scheduleGc(),D(this,He).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,si).length||(this.state.status==="pending"?this.scheduleGc():D(this,He).remove(this))}continue(){var t;return((t=D(this,mr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,h,d,y,p,m,v,S,_,T,O,C,F,j,R,N,A,W,H,q;const e=()=>{Ct(this,ri,bs).call(this,{type:"continue"})};nt(this,mr,N2({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(Y,P)=>{Ct(this,ri,bs).call(this,{type:"failed",failureCount:Y,error:P})},onPause:()=>{Ct(this,ri,bs).call(this,{type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,He).canRun(this)}));const r=this.state.status==="pending",l=!D(this,mr).canStart();try{if(r)e();else{Ct(this,ri,bs).call(this,{type:"pending",variables:t,isPaused:l}),await((h=(u=D(this,He).config).onMutate)==null?void 0:h.call(u,t,this));const P=await((y=(d=this.options).onMutate)==null?void 0:y.call(d,t));P!==this.state.context&&Ct(this,ri,bs).call(this,{type:"pending",context:P,variables:t,isPaused:l})}const Y=await D(this,mr).start();return await((m=(p=D(this,He).config).onSuccess)==null?void 0:m.call(p,Y,t,this.state.context,this)),await((S=(v=this.options).onSuccess)==null?void 0:S.call(v,Y,t,this.state.context)),await((T=(_=D(this,He).config).onSettled)==null?void 0:T.call(_,Y,null,this.state.variables,this.state.context,this)),await((C=(O=this.options).onSettled)==null?void 0:C.call(O,Y,null,t,this.state.context)),Ct(this,ri,bs).call(this,{type:"success",data:Y}),Y}catch(Y){try{throw await((j=(F=D(this,He).config).onError)==null?void 0:j.call(F,Y,t,this.state.context,this)),await((N=(R=this.options).onError)==null?void 0:N.call(R,Y,t,this.state.context)),await((W=(A=D(this,He).config).onSettled)==null?void 0:W.call(A,void 0,Y,this.state.variables,this.state.context,this)),await((q=(H=this.options).onSettled)==null?void 0:q.call(H,void 0,Y,t,this.state.context)),Y}finally{Ct(this,ri,bs).call(this,{type:"error",error:Y})}}finally{D(this,He).runNext(this)}}},si=new WeakMap,He=new WeakMap,mr=new WeakMap,ri=new WeakSet,bs=function(t){const e=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Ne.batch(()=>{D(this,si).forEach(r=>{r.onMutationUpdate(t)}),D(this,He).notify({mutation:this,type:"updated",action:t})})},lb);function k6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fi,qn,pl,ub,V6=(ub=class extends Ol{constructor(t={}){super();ct(this,Fi);ct(this,qn);ct(this,pl);this.config=t,nt(this,Fi,new Set),nt(this,qn,new Map),nt(this,pl,0)}build(t,e,r){const l=new H6({mutationCache:this,mutationId:++qu(this,pl)._,options:t.defaultMutationOptions(e),state:r});return this.add(l),l}add(t){D(this,Fi).add(t);const e=$u(t);if(typeof e=="string"){const r=D(this,qn).get(e);r?r.push(t):D(this,qn).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,Fi).delete(t)){const e=$u(t);if(typeof e=="string"){const r=D(this,qn).get(e);if(r)if(r.length>1){const l=r.indexOf(t);l!==-1&&r.splice(l,1)}else r[0]===t&&D(this,qn).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=$u(t);if(typeof e=="string"){const r=D(this,qn).get(e),l=r==null?void 0:r.find(u=>u.state.status==="pending");return!l||l===t}else return!0}runNext(t){var r;const e=$u(t);if(typeof e=="string"){const l=(r=D(this,qn).get(e))==null?void 0:r.find(u=>u!==t&&u.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ne.batch(()=>{D(this,Fi).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,Fi).clear(),D(this,qn).clear()})}getAll(){return Array.from(D(this,Fi))}find(t){const e={exact:!0,...t};return this.getAll().find(r=>Xv(e,r))}findAll(t={}){return this.getAll().filter(e=>Xv(t,e))}notify(t){Ne.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Ne.batch(()=>Promise.all(t.map(e=>e.continue().catch(Ke))))}},Fi=new WeakMap,qn=new WeakMap,pl=new WeakMap,ub);function $u(s){var t;return(t=s.options.scope)==null?void 0:t.id}function $v(s){return{onFetch:(t,e)=>{var m,v,S,_,T;const r=t.options,l=(S=(v=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:v.fetchMore)==null?void 0:S.direction,u=((_=t.state.data)==null?void 0:_.pages)||[],h=((T=t.state.data)==null?void 0:T.pageParams)||[];let d={pages:[],pageParams:[]},y=0;const p=async()=>{let O=!1;const C=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(t.signal.aborted?O=!0:t.signal.addEventListener("abort",()=>{O=!0}),t.signal)})},F=R2(t.options,t.fetchOptions),j=async(R,N,A)=>{if(O)return Promise.reject();if(N==null&&R.pages.length)return Promise.resolve(R);const W={client:t.client,queryKey:t.queryKey,pageParam:N,direction:A?"backward":"forward",meta:t.options.meta};C(W);const H=await F(W),{maxPages:q}=t.options,Y=A?R6:M6;return{pages:Y(R.pages,H,q),pageParams:Y(R.pageParams,N,q)}};if(l&&u.length){const R=l==="backward",N=R?q6:Zv,A={pages:u,pageParams:h},W=N(r,A);d=await j(A,W,R)}else{const R=s??u.length;do{const N=y===0?h[0]??r.initialPageParam:Zv(r,d);if(y>0&&N==null)break;d=await j(d,N),y++}while(y<R)}return d};t.options.persister?t.fetchFn=()=>{var O,C;return(C=(O=t.options).persister)==null?void 0:C.call(O,p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},e)}:t.fetchFn=p}}}function Zv(s,{pages:t,pageParams:e}){const r=t.length-1;return t.length>0?s.getNextPageParam(t[r],t,e[r],e):void 0}function q6(s,{pages:t,pageParams:e}){var r;return t.length>0?(r=s.getPreviousPageParam)==null?void 0:r.call(s,t[0],t,e[0],e):void 0}var pe,Es,Ts,Da,Ma,xs,Ra,Ca,cb,Y6=(cb=class{constructor(s={}){ct(this,pe);ct(this,Es);ct(this,Ts);ct(this,Da);ct(this,Ma);ct(this,xs);ct(this,Ra);ct(this,Ca);nt(this,pe,s.queryCache||new j6),nt(this,Es,s.mutationCache||new V6),nt(this,Ts,s.defaultOptions||{}),nt(this,Da,new Map),nt(this,Ma,new Map),nt(this,xs,0)}mount(){qu(this,xs)._++,D(this,xs)===1&&(nt(this,Ra,t0.subscribe(async s=>{s&&(await this.resumePausedMutations(),D(this,pe).onFocus())})),nt(this,Ca,jc.subscribe(async s=>{s&&(await this.resumePausedMutations(),D(this,pe).onOnline())})))}unmount(){var s,t;qu(this,xs)._--,D(this,xs)===0&&((s=D(this,Ra))==null||s.call(this),nt(this,Ra,void 0),(t=D(this,Ca))==null||t.call(this),nt(this,Ca,void 0))}isFetching(s){return D(this,pe).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return D(this,Es).findAll({...s,status:"pending"}).length}getQueryData(s){var e;const t=this.defaultQueryOptions({queryKey:s});return(e=D(this,pe).get(t.queryHash))==null?void 0:e.state.data}ensureQueryData(s){const t=this.defaultQueryOptions(s),e=D(this,pe).build(this,t),r=e.state.data;return r===void 0?this.fetchQuery(s):(s.revalidateIfStale&&e.isStaleByTime(wa(t.staleTime,e))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(s){return D(this,pe).findAll(s).map(({queryKey:t,state:e})=>{const r=e.data;return[t,r]})}setQueryData(s,t,e){const r=this.defaultQueryOptions({queryKey:s}),l=D(this,pe).get(r.queryHash),u=l==null?void 0:l.state.data,h=O6(t,u);if(h!==void 0)return D(this,pe).build(this,r).setData(h,{...e,manual:!0})}setQueriesData(s,t,e){return Ne.batch(()=>D(this,pe).findAll(s).map(({queryKey:r})=>[r,this.setQueryData(r,t,e)]))}getQueryState(s){var e;const t=this.defaultQueryOptions({queryKey:s});return(e=D(this,pe).get(t.queryHash))==null?void 0:e.state}removeQueries(s){const t=D(this,pe);Ne.batch(()=>{t.findAll(s).forEach(e=>{t.remove(e)})})}resetQueries(s,t){const e=D(this,pe);return Ne.batch(()=>(e.findAll(s).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...s},t)))}cancelQueries(s,t={}){const e={revert:!0,...t},r=Ne.batch(()=>D(this,pe).findAll(s).map(l=>l.cancel(e)));return Promise.all(r).then(Ke).catch(Ke)}invalidateQueries(s,t={}){return Ne.batch(()=>(D(this,pe).findAll(s).forEach(e=>{e.invalidate()}),(s==null?void 0:s.refetchType)==="none"?Promise.resolve():this.refetchQueries({...s,type:(s==null?void 0:s.refetchType)??(s==null?void 0:s.type)??"active"},t)))}refetchQueries(s,t={}){const e={...t,cancelRefetch:t.cancelRefetch??!0},r=Ne.batch(()=>D(this,pe).findAll(s).filter(l=>!l.isDisabled()).map(l=>{let u=l.fetch(void 0,e);return e.throwOnError||(u=u.catch(Ke)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(r).then(Ke)}fetchQuery(s){const t=this.defaultQueryOptions(s);t.retry===void 0&&(t.retry=!1);const e=D(this,pe).build(this,t);return e.isStaleByTime(wa(t.staleTime,e))?e.fetch(t):Promise.resolve(e.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Ke).catch(Ke)}fetchInfiniteQuery(s){return s.behavior=$v(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Ke).catch(Ke)}ensureInfiniteQueryData(s){return s.behavior=$v(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return jc.isOnline()?D(this,Es).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,pe)}getMutationCache(){return D(this,Es)}getDefaultOptions(){return D(this,Ts)}setDefaultOptions(s){nt(this,Ts,s)}setQueryDefaults(s,t){D(this,Da).set(hl(s),{queryKey:s,defaultOptions:t})}getQueryDefaults(s){const t=[...D(this,Da).values()],e={};return t.forEach(r=>{fl(s,r.queryKey)&&Object.assign(e,r.defaultOptions)}),e}setMutationDefaults(s,t){D(this,Ma).set(hl(s),{mutationKey:s,defaultOptions:t})}getMutationDefaults(s){const t=[...D(this,Ma).values()],e={};return t.forEach(r=>{fl(s,r.mutationKey)&&Object.assign(e,r.defaultOptions)}),e}defaultQueryOptions(s){if(s._defaulted)return s;const t={...D(this,Ts).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return t.queryHash||(t.queryHash=Kp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Jp&&(t.enabled=!1),t}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...D(this,Ts).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){D(this,pe).clear(),D(this,Es).clear()}},pe=new WeakMap,Es=new WeakMap,Ts=new WeakMap,Da=new WeakMap,Ma=new WeakMap,xs=new WeakMap,Ra=new WeakMap,Ca=new WeakMap,cb),$e,Bt,yl,ke,gr,Ba,Os,Ds,ml,Na,za,vr,br,Ms,La,Gt,Jo,up,cp,hp,fp,dp,pp,yp,U2,hb,Q6=(hb=class extends Ol{constructor(t,e){super();ct(this,Gt);ct(this,$e);ct(this,Bt);ct(this,yl);ct(this,ke);ct(this,gr);ct(this,Ba);ct(this,Os);ct(this,Ds);ct(this,ml);ct(this,Na);ct(this,za);ct(this,vr);ct(this,br);ct(this,Ms);ct(this,La,new Set);this.options=e,nt(this,$e,t),nt(this,Ds,null),nt(this,Os,lp()),this.options.experimental_prefetchInRender||D(this,Os).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,Bt).addObserver(this),Kv(D(this,Bt),this.options)?Ct(this,Gt,Jo).call(this):this.updateResult(),Ct(this,Gt,fp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return mp(D(this,Bt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return mp(D(this,Bt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Gt,dp).call(this),Ct(this,Gt,pp).call(this),D(this,Bt).removeObserver(this)}setOptions(t){const e=this.options,r=D(this,Bt);if(this.options=D(this,$e).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qn(this.options.enabled,D(this,Bt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ct(this,Gt,yp).call(this),D(this,Bt).setOptions(this.options),e._defaulted&&!rp(this.options,e)&&D(this,$e).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,Bt),observer:this});const l=this.hasListeners();l&&Jv(D(this,Bt),r,this.options,e)&&Ct(this,Gt,Jo).call(this),this.updateResult(),l&&(D(this,Bt)!==r||Qn(this.options.enabled,D(this,Bt))!==Qn(e.enabled,D(this,Bt))||wa(this.options.staleTime,D(this,Bt))!==wa(e.staleTime,D(this,Bt)))&&Ct(this,Gt,up).call(this);const u=Ct(this,Gt,cp).call(this);l&&(D(this,Bt)!==r||Qn(this.options.enabled,D(this,Bt))!==Qn(e.enabled,D(this,Bt))||u!==D(this,Ms))&&Ct(this,Gt,hp).call(this,u)}getOptimisticResult(t){const e=D(this,$e).getQueryCache().build(D(this,$e),t),r=this.createResult(e,t);return X6(this,r)&&(nt(this,ke,r),nt(this,Ba,this.options),nt(this,gr,D(this,Bt).state)),r}getCurrentResult(){return D(this,ke)}trackResult(t,e){return new Proxy(t,{get:(r,l)=>(this.trackProp(l),e==null||e(l),Reflect.get(r,l))})}trackProp(t){D(this,La).add(t)}getCurrentQuery(){return D(this,Bt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=D(this,$e).defaultQueryOptions(t),r=D(this,$e).getQueryCache().build(D(this,$e),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return Ct(this,Gt,Jo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,ke)))}createResult(t,e){var Y;const r=D(this,Bt),l=this.options,u=D(this,ke),h=D(this,gr),d=D(this,Ba),p=t!==r?t.state:D(this,yl),{state:m}=t;let v={...m},S=!1,_;if(e._optimisticResults){const P=this.hasListeners(),K=!P&&Kv(t,e),Z=P&&Jv(t,r,e,l);(K||Z)&&(v={...v,...L2(m.data,t.options)}),e._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:T,errorUpdatedAt:O,status:C}=v;_=v.data;let F=!1;if(e.placeholderData!==void 0&&_===void 0&&C==="pending"){let P;u!=null&&u.isPlaceholderData&&e.placeholderData===(d==null?void 0:d.placeholderData)?(P=u.data,F=!0):P=typeof e.placeholderData=="function"?e.placeholderData((Y=D(this,za))==null?void 0:Y.state.data,D(this,za)):e.placeholderData,P!==void 0&&(C="success",_=op(u==null?void 0:u.data,P,e),S=!0)}if(e.select&&_!==void 0&&!F)if(u&&_===(h==null?void 0:h.data)&&e.select===D(this,ml))_=D(this,Na);else try{nt(this,ml,e.select),_=e.select(_),_=op(u==null?void 0:u.data,_,e),nt(this,Na,_),nt(this,Ds,null)}catch(P){nt(this,Ds,P)}D(this,Ds)&&(T=D(this,Ds),_=D(this,Na),O=Date.now(),C="error");const j=v.fetchStatus==="fetching",R=C==="pending",N=C==="error",A=R&&j,W=_!==void 0,q={status:C,fetchStatus:v.fetchStatus,isPending:R,isSuccess:C==="success",isError:N,isInitialLoading:A,isLoading:A,data:_,dataUpdatedAt:v.dataUpdatedAt,error:T,errorUpdatedAt:O,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:j,isRefetching:j&&!R,isLoadingError:N&&!W,isPaused:v.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:N&&W,isStale:e0(t,e),refetch:this.refetch,promise:D(this,Os)};if(this.options.experimental_prefetchInRender){const P=Ot=>{q.status==="error"?Ot.reject(q.error):q.data!==void 0&&Ot.resolve(q.data)},K=()=>{const Ot=nt(this,Os,q.promise=lp());P(Ot)},Z=D(this,Os);switch(Z.status){case"pending":t.queryHash===r.queryHash&&P(Z);break;case"fulfilled":(q.status==="error"||q.data!==Z.value)&&K();break;case"rejected":(q.status!=="error"||q.error!==Z.reason)&&K();break}}return q}updateResult(){const t=D(this,ke),e=this.createResult(D(this,Bt),this.options);if(nt(this,gr,D(this,Bt).state),nt(this,Ba,this.options),D(this,gr).data!==void 0&&nt(this,za,D(this,Bt)),rp(e,t))return;nt(this,ke,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,u=typeof l=="function"?l():l;if(u==="all"||!u&&!D(this,La).size)return!0;const h=new Set(u??D(this,La));return this.options.throwOnError&&h.add("error"),Object.keys(D(this,ke)).some(d=>{const y=d;return D(this,ke)[y]!==t[y]&&h.has(y)})};Ct(this,Gt,U2).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,Gt,fp).call(this)}},$e=new WeakMap,Bt=new WeakMap,yl=new WeakMap,ke=new WeakMap,gr=new WeakMap,Ba=new WeakMap,Os=new WeakMap,Ds=new WeakMap,ml=new WeakMap,Na=new WeakMap,za=new WeakMap,vr=new WeakMap,br=new WeakMap,Ms=new WeakMap,La=new WeakMap,Gt=new WeakSet,Jo=function(t){Ct(this,Gt,yp).call(this);let e=D(this,Bt).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(Ke)),e},up=function(){Ct(this,Gt,dp).call(this);const t=wa(this.options.staleTime,D(this,Bt));if(Er||D(this,ke).isStale||!sp(t))return;const r=D2(D(this,ke).dataUpdatedAt,t)+1;nt(this,vr,setTimeout(()=>{D(this,ke).isStale||this.updateResult()},r))},cp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,Bt)):this.options.refetchInterval)??!1},hp=function(t){Ct(this,Gt,pp).call(this),nt(this,Ms,t),!(Er||Qn(this.options.enabled,D(this,Bt))===!1||!sp(D(this,Ms))||D(this,Ms)===0)&&nt(this,br,setInterval(()=>{(this.options.refetchIntervalInBackground||t0.isFocused())&&Ct(this,Gt,Jo).call(this)},D(this,Ms)))},fp=function(){Ct(this,Gt,up).call(this),Ct(this,Gt,hp).call(this,Ct(this,Gt,cp).call(this))},dp=function(){D(this,vr)&&(clearTimeout(D(this,vr)),nt(this,vr,void 0))},pp=function(){D(this,br)&&(clearInterval(D(this,br)),nt(this,br,void 0))},yp=function(){const t=D(this,$e).getQueryCache().build(D(this,$e),this.options);if(t===D(this,Bt))return;const e=D(this,Bt);nt(this,Bt,t),nt(this,yl,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},U2=function(t){Ne.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(D(this,ke))}),D(this,$e).getQueryCache().notify({query:D(this,Bt),type:"observerResultsUpdated"})})},hb);function G6(s,t){return Qn(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&t.retryOnMount===!1)}function Kv(s,t){return G6(s,t)||s.state.data!==void 0&&mp(s,t,t.refetchOnMount)}function mp(s,t,e){if(Qn(t.enabled,s)!==!1){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&e0(s,t)}return!1}function Jv(s,t,e,r){return(s!==t||Qn(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&e0(s,e)}function e0(s,t){return Qn(t.enabled,s)!==!1&&s.isStaleByTime(wa(t.staleTime,s))}function X6(s,t){return!rp(s.getCurrentResult(),t)}var I2=it.createContext(void 0),W6=s=>{const t=it.useContext(I2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},P6=({client:s,children:t})=>(it.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),re.jsx(I2.Provider,{value:s,children:t})),F2=it.createContext(!1),$6=()=>it.useContext(F2);F2.Provider;function Z6(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var K6=it.createContext(Z6()),J6=()=>it.useContext(K6),t8=(s,t)=>{(s.suspense||s.throwOnError||s.experimental_prefetchInRender)&&(t.isReset()||(s.retryOnMount=!1))},e8=s=>{it.useEffect(()=>{s.clearReset()},[s])},n8=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:l})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(l&&s.data===void 0||C6(e,[s.error,r])),i8=s=>{const t=s.staleTime;s.suspense&&(s.staleTime=typeof t=="function"?(...e)=>Math.max(t(...e),1e3):Math.max(t??1e3,1e3),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3)))},s8=(s,t)=>s.isLoading&&s.isFetching&&!t,r8=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,tb=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function a8(s,t,e){var v,S,_,T,O;const r=W6(),l=$6(),u=J6(),h=r.defaultQueryOptions(s);(S=(v=r.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||S.call(v,h),h._optimisticResults=l?"isRestoring":"optimistic",i8(h),t8(h,u),e8(u);const d=!r.getQueryCache().get(h.queryHash),[y]=it.useState(()=>new t(r,h)),p=y.getOptimisticResult(h),m=!l&&s.subscribed!==!1;if(it.useSyncExternalStore(it.useCallback(C=>{const F=m?y.subscribe(Ne.batchCalls(C)):Ke;return y.updateResult(),F},[y,m]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),it.useEffect(()=>{y.setOptions(h)},[h,y]),r8(h,p))throw tb(h,y,u);if(n8({result:p,errorResetBoundary:u,throwOnError:h.throwOnError,query:r.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw p.error;if((T=(_=r.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||T.call(_,h,p),h.experimental_prefetchInRender&&!Er&&s8(p,l)){const C=d?tb(h,y,u):(O=r.getQueryCache().get(h.queryHash))==null?void 0:O.promise;C==null||C.catch(Ke).finally(()=>{y.updateResult()})}return h.notifyOnChangeProps?p:y.trackResult(p)}function o8(s,t){return a8(s,Q6)}async function l8(s){const t=await fetch(s);if(!t.ok)throw new Error(`Failed to fetch audio: ${t.statusText}`);return new Blob([await t.arrayBuffer()])}const u8=({containerRef:s,audioSrc:t,waveOptions:e,onReady:r})=>{const[l,u]=it.useState(0),[h,d]=it.useState(0),[y,p]=it.useState(!1),[m]=wr(xl),{data:v,isSuccess:S,isLoading:_}=o8({queryKey:["audioData",t],queryFn:()=>l8(t),staleTime:1/0}),T=Uc(Fe),{instance:O}=qa(Fe),C=it.useRef([]),F=it.useCallback(()=>{if(!s.current||!v)return;const j=Ic.create({container:s.current,normalize:!0,minPxPerSec:10,...e});C.current.forEach(R=>{const N=m.find(A=>A.name===R.name);(!N||JSON.stringify(N.options)!==JSON.stringify(R.options))&&A6(R,j)}),T({instance:j,ready:!1}),console.log("created wavesurfer",j),console.log("plugins",m),m.forEach(R=>{const N=C.current.find(A=>A.name===R.name);(!N||JSON.stringify(N.options)!==JSON.stringify(R.options))&&O2(R,j)}),C.current=m,j.on("ready",()=>{T({instance:j,ready:!0}),console.log("wavesurfer ready",j),d(j.getDuration()),r()}),j.on("audioprocess",()=>u(j.getCurrentTime())),j.on("play",()=>p(!0)),j.on("pause",()=>p(!1)),j.on("finish",()=>p(!1)),j.loadBlob(v)},[v,s,e,r,m,T,O]);return it.useEffect(()=>(O==null||O.destroy(),S&&F(),()=>{O==null||O.destroy()}),[v,S]),{waveform:O,currentTime:l,duration:h,isPlaying:y,play:()=>O==null?void 0:O.play(),pause:()=>O==null?void 0:O.pause(),skipForward:()=>O==null?void 0:O.skip(5),skipBackward:()=>O==null?void 0:O.skip(-5),seekTo:j=>O==null?void 0:O.seekTo(j),setZoom:j=>O==null?void 0:O.zoom(j),isLoading:!!_}};function gp(){return gp=Object.assign?Object.assign.bind():function(s){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[r]=e[r])}return s},gp.apply(this,arguments)}var j2=["shift","alt","meta","mod","ctrl"],c8={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Rs(s){return(c8[s]||s).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function h8(s){return j2.includes(s)}function Fd(s,t){return t===void 0&&(t=","),s.split(t)}function jd(s,t,e){t===void 0&&(t="+");var r=s.toLocaleLowerCase().split(t).map(function(h){return Rs(h)}),l={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},u=r.filter(function(h){return!j2.includes(h)});return gp({},l,{keys:u,description:e})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(s){s.key!==void 0&&H2([Rs(s.key),Rs(s.code)])}),document.addEventListener("keyup",function(s){s.key!==void 0&&k2([Rs(s.key),Rs(s.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Cs.clear()})})();var Cs=new Set;function n0(s){return Array.isArray(s)}function f8(s,t){t===void 0&&(t=",");var e=n0(s)?s:s.split(t);return e.every(function(r){return Cs.has(r.trim().toLowerCase())})}function H2(s){var t=Array.isArray(s)?s:[s];Cs.has("meta")&&Cs.forEach(function(e){return!h8(e)&&Cs.delete(e.toLowerCase())}),t.forEach(function(e){return Cs.add(e.toLowerCase())})}function k2(s){var t=Array.isArray(s)?s:[s];s==="meta"?Cs.clear():t.forEach(function(e){return Cs.delete(e.toLowerCase())})}function d8(s,t,e){(typeof e=="function"&&e(s,t)||e===!0)&&s.preventDefault()}function p8(s,t,e){return typeof e=="function"?e(s,t):e===!0||e===void 0}function y8(s){return V2(s,["input","textarea","select"])}function V2(s,t){var e=s.target;t===void 0&&(t=!1);var r=e&&e.tagName;return n0(t)?!!(r&&t&&t.some(function(l){return l.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function m8(s,t){return s.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?s.some(function(e){return t.includes(e)})||s.includes("*"):!0}var g8=function(t,e,r){r===void 0&&(r=!1);var l=e.alt,u=e.meta,h=e.mod,d=e.shift,y=e.ctrl,p=e.keys,m=t.key,v=t.code,S=t.ctrlKey,_=t.metaKey,T=t.shiftKey,O=t.altKey,C=Rs(v),F=m.toLowerCase();if(!r){if(l===!O&&F!=="alt"||d===!T&&F!=="shift")return!1;if(h){if(!_&&!S)return!1}else if(u===!_&&F!=="meta"&&F!=="os"||y===!S&&F!=="ctrl"&&F!=="control")return!1}return p&&p.length===1&&(p.includes(F)||p.includes(C))?!0:p?f8(p):!p},v8=it.createContext(void 0),b8=function(){return it.useContext(v8)};function q2(s,t){return s&&t&&typeof s=="object"&&typeof t=="object"?Object.keys(s).length===Object.keys(t).length&&Object.keys(s).reduce(function(e,r){return e&&q2(s[r],t[r])},!0):s===t}var S8=it.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),_8=function(){return it.useContext(S8)};function w8(s){var t=it.useRef(void 0);return q2(t.current,s)||(t.current=s),t.current}var eb=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},A8=typeof window<"u"?it.useLayoutEffect:it.useEffect;function vn(s,t,e,r){var l=it.useRef(null),u=it.useRef(!1),h=e instanceof Array?r instanceof Array?void 0:r:e,d=n0(s)?s.join(h==null?void 0:h.splitKey):s,y=e instanceof Array?e:r instanceof Array?r:void 0,p=it.useCallback(t,y??[]),m=it.useRef(p);y?m.current=p:m.current=t;var v=w8(h),S=_8(),_=S.enabledScopes,T=b8();return A8(function(){if(!((v==null?void 0:v.enabled)===!1||!m8(_,v==null?void 0:v.scopes))){var O=function(N,A){var W;if(A===void 0&&(A=!1),!(y8(N)&&!V2(N,v==null?void 0:v.enableOnFormTags))&&!(v!=null&&v.ignoreEventWhen!=null&&v.ignoreEventWhen(N))){if(l.current!==null&&document.activeElement!==l.current&&!l.current.contains(document.activeElement)){eb(N);return}(W=N.target)!=null&&W.isContentEditable&&!(v!=null&&v.enableOnContentEditable)||Fd(d,v==null?void 0:v.splitKey).forEach(function(H){var q,Y=jd(H,v==null?void 0:v.combinationKey);if(g8(N,Y,v==null?void 0:v.ignoreModifiers)||(q=Y.keys)!=null&&q.includes("*")){if(A&&u.current)return;if(d8(N,Y,v==null?void 0:v.preventDefault),!p8(N,Y,v==null?void 0:v.enabled)){eb(N);return}m.current(N,Y),A||(u.current=!0)}})}},C=function(N){N.key!==void 0&&(H2(Rs(N.code)),((v==null?void 0:v.keydown)===void 0&&(v==null?void 0:v.keyup)!==!0||v!=null&&v.keydown)&&O(N))},F=function(N){N.key!==void 0&&(k2(Rs(N.code)),u.current=!1,v!=null&&v.keyup&&O(N,!0))},j=l.current||(h==null?void 0:h.document)||document;return j.addEventListener("keyup",F),j.addEventListener("keydown",C),T&&Fd(d,v==null?void 0:v.splitKey).forEach(function(R){return T.addHotkey(jd(R,v==null?void 0:v.combinationKey,v==null?void 0:v.description))}),function(){j.removeEventListener("keyup",F),j.removeEventListener("keydown",C),T&&Fd(d,v==null?void 0:v.splitKey).forEach(function(R){return T.removeHotkey(jd(R,v==null?void 0:v.combinationKey,v==null?void 0:v.description))})}}},[d,v,_]),l}const E8=()=>{const[s,t]=wr(u2),[e,r]=wr(Pp),u=qa(w6)("regions"),[h,d]=it.useState(!1),y=it.useRef([]),p=it.useRef(null),{instance:m,ready:v}=qa(Fe),S=(R,{start:N,end:A})=>{R&&(R.start=N,R.end=A)},_=it.useCallback(()=>{if(!m||!v)return;const R=m.getWrapper();if(!R)return;p.current=R,R.tabIndex=0,R.style.outline="none";const N=()=>{d(!0),p.current&&p.current.focus()};R.addEventListener("click",N),R.addEventListener("mousedown",N),R.addEventListener("keydown",N,!0),R.addEventListener("mouseover",N),d(!0),R.focus();const A=W=>{R.contains(W.target)&&(d(!0),R.focus())};return document.addEventListener("keydown",A,!0),document.addEventListener("mousedown",A,!0),()=>{p.current&&(p.current.removeEventListener("click",N),p.current.removeEventListener("mousedown",N),p.current.removeEventListener("keydown",N,!0),p.current.removeEventListener("mouseover",N)),document.removeEventListener("keydown",A,!0),document.removeEventListener("mousedown",A,!0)}},[m,u]);it.useEffect(()=>_(),[_]);const T=(R,N,A)=>{y.current.push({region:R,prevStart:R.start,prevEnd:R.end}),S(R,{start:N,end:A})},O=()=>{for(let R=y.current.length-1;R>=0;R--){const{region:N,prevStart:A,prevEnd:W}=y.current[R];S(N,{start:A,end:W})}},C=()=>{if(y.current.length===0)return!1;const R=y.current.pop();if(!R)return!1;const{region:N,prevStart:A,prevEnd:W}=R;return S(N,{start:A,end:W}),t(N),!0},F=()=>{e&&r(!1)};return vn("u",R=>{R.preventDefault(),console.log("[hotkeys] Attempting to undo last region edit");const N=C();console.log(`[hotkeys] Undo ${N?"successful":"failed"}`)},{preventDefault:!0,enabled:h}),vn("r",R=>{R.preventDefault(),O()},{preventDefault:!0,enabled:h}),vn("space",R=>{R.preventDefault(),!(!m||!v)&&(m.isPlaying()?m.pause():m.play())},{preventDefault:!0,enabled:h}),vn("left",R=>{if(R.preventDefault(),F(),!m||!v)return;const N=m.getCurrentTime();m.seekTo(Math.max(0,N-.1)/m.getDuration())},{preventDefault:!0,enabled:h}),vn("right",R=>{if(R.preventDefault(),F(),!m||!v)return;const N=m.getCurrentTime(),A=m.getDuration();m.seekTo(Math.min(A,N+.1)/A)},{preventDefault:!0,enabled:h}),vn("up",R=>{let N=e;if(N&&r(!1),R.preventDefault(),!m||!v||!u)return;const A=u.getRegions().sort((Y,P)=>Y.start-P.start);if(A.length===0)return;const W=m.getCurrentTime();let H=-1;for(let Y=0;Y<A.length&&!(A[Y].start>W);Y++)H=Y;H===-1||H===0?H=A.length-1:H-=1;const q=A[H];q&&(m.seekTo(q.start/m.getDuration()),t({...q,content:typeof q.content=="string"?q.content:String(q.content??"")}),N&&r(!0))},{preventDefault:!0,enabled:h}),vn("down",R=>{if(F(),R.preventDefault(),!m||!v||!u)return;const N=u.getRegions().sort((q,Y)=>q.start-Y.start);if(N.length===0)return;const A=m.getCurrentTime();let W=-1;for(let q=0;q<N.length;q++)if(N[q].start>=A){W=q;break}W===-1&&(W=0);const H=N[W];H&&(m.seekTo(H.start/m.getDuration()),t({...H,content:typeof H.content=="string"?H.content:String(H.content??"")}))},{preventDefault:!0,enabled:h}),vn("i",R=>{if(R.preventDefault(),!m||!v||!u)return;const N=m.getCurrentTime();s&&(T(s,N,s.end),t(s))},{preventDefault:!0,enabled:h}),vn("o",R=>{if(R.preventDefault(),!m||!v||!u)return;const N=m.getCurrentTime();s&&(T(s,s.start,N),t(s))},{preventDefault:!0,enabled:h}),vn("s",R=>{F(),R.preventDefault(),!(!m||!v||!u)&&s&&(t(s),m.seekTo(s.start/m.getDuration()),m.isPlaying()||m.play())},{preventDefault:!0,enabled:h}),vn("e",R=>{F(),R.preventDefault(),!(!m||!v)&&s&&(t(s),m.seekTo(s.end/m.getDuration()),m.isPlaying()||m.play())},{preventDefault:!0,enabled:h}),vn("w",R=>{F(),R.preventDefault(),!(!m||!v)&&m.seekTo(0)},{preventDefault:!0,enabled:h}),vn("l",R=>{R.preventDefault(),r(N=>!N)},{preventDefault:!0,enabled:h}),it.useCallback(()=>{d(!0),p.current&&p.current.focus()},[])},T8=()=>it.useCallback(s=>{const t=Math.floor(s/60),e=Math.floor(s%60);return`${t}:${e.toString().padStart(2,"0")}`},[]);/**
 * @license lucide-react v0.488.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x8=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),O8=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,e,r)=>r?r.toUpperCase():e.toLowerCase()),nb=s=>{const t=O8(s);return t.charAt(0).toUpperCase()+t.slice(1)},Y2=(...s)=>s.filter((t,e,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===e).join(" ").trim();/**
 * @license lucide-react v0.488.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var D8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.488.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M8=it.forwardRef(({color:s="currentColor",size:t=24,strokeWidth:e=2,absoluteStrokeWidth:r,className:l="",children:u,iconNode:h,...d},y)=>it.createElement("svg",{ref:y,...D8,width:t,height:t,stroke:s,strokeWidth:r?Number(e)*24/Number(t):e,className:Y2("lucide",l),...d},[...h.map(([p,m])=>it.createElement(p,m)),...Array.isArray(u)?u:[u]]));/**
 * @license lucide-react v0.488.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gc=(s,t)=>{const e=it.forwardRef(({className:r,...l},u)=>it.createElement(M8,{ref:u,iconNode:t,className:Y2(`lucide-${x8(nb(s))}`,`lucide-${s}`,r),...l}));return e.displayName=nb(s),e};/**
 * @license lucide-react v0.488.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const R8=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],C8=Gc("pause",R8);/**
 * @license lucide-react v0.488.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const B8=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],N8=Gc("play",B8);/**
 * @license lucide-react v0.488.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z8=[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]],L8=Gc("skip-back",z8);/**
 * @license lucide-react v0.488.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const U8=[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]],I8=Gc("skip-forward",U8),F8=({skipBackward:s,isPlaying:t,pause:e,play:r,skipForward:l,currentTime:u,duration:h})=>{const d=T8();return re.jsx("div",{className:"flex justify-center items-center gap-2",children:re.jsxs("div",{className:"flex items-center gap-2",children:[re.jsx("button",{onClick:s,className:"bg-transparent border-none cursor-pointer p-2 flex items-center justify-center text-white",children:re.jsx(L8,{size:20})}),re.jsx("button",{onClick:t?e:r,className:"bg-transparent border-none cursor-pointer p-2 flex items-center justify-center text-white",children:t?re.jsx(C8,{size:24}):re.jsx(N8,{size:24})}),re.jsx("button",{onClick:l,className:"bg-transparent border-none cursor-pointer p-2 flex items-center justify-center text-white",children:re.jsx(I8,{size:20})}),re.jsxs("div",{className:"flex items-center gap-4 text-white",children:[re.jsx("span",{children:d(u)}),re.jsx("span",{children:"/"}),re.jsx("span",{children:d(h)})]})]})})},j8=({audioSrc:s,onReady:t,waveOptions:e,showControls:r})=>{const l=it.useRef(null),{currentTime:u,duration:h,isPlaying:d,play:y,pause:p,skipForward:m,skipBackward:v}=u8({containerRef:l,audioSrc:s,waveOptions:e,onReady:t});return E8(),x6(),re.jsxs("div",{className:"flex flex-col gap-4 p-4 w-full box-border",children:[re.jsx("div",{ref:l,id:"waveform",className:"w-full min-h-[200px] overflow-hidden"}),r&&re.jsx(F8,{currentTime:u,duration:h,isPlaying:d,pause:p,play:y,skipForward:m,skipBackward:v})]})},H8=it.memo(j8),k8=({args:s})=>{const[t,e]=it.useState(!1),[r]=wr(Qc),l=Uc(k5);it.useEffect(()=>{if(!s.regions||s.regions.length===0||!s.region_colormap)return;if(s.regions.length!==r.length){l({regions:s.regions,colormapName:s.region_colormap});return}s.regions.every((m,v)=>{const S=r[v];return m.id===S.id&&m.start===S.start&&m.end===S.end&&m.content===S.content&&m.color===S.color})||l({regions:s.regions,colormapName:s.region_colormap})},[s.regions,s.region_colormap]),it.useEffect(()=>{ai.setFrameHeight()});const u=Uc(xl);it.useEffect(()=>{if(!s.plugin_configurations||!s.plugin_configurations.plugins)return;console.log("args.plugin_configurations",s.plugin_configurations);const m=s.plugin_configurations.plugins.map(v=>v.options?{...v,options:v.options}:v);u(m)},[s.plugin_configurations]);const h=s.wave_options,d=s.audio_src,y=re.jsx(it.Suspense,{fallback:re.jsx("div",{children:"Loading..."}),children:re.jsx(H8,{audioSrc:d,waveOptions:h,onReady:()=>{t||(e(!0),setTimeout(()=>ai.setComponentValue({ready:!0,regions:s.regions}),300))},regionColormap:s.region_colormap,showControls:s.controls})});return re.jsx("div",{children:re.jsx("center",{children:y})})},V8=m5(k8),Q2=document.getElementById("root");if(!Q2)throw new Error("Failed to find the root element");const q8=new Y6,Y8=E3.createRoot(Q2);Y8.render(re.jsx(ji.StrictMode,{children:re.jsx(P6,{client:q8,children:re.jsx(M5,{children:re.jsx(V8,{})})})}));
