var rV=Object.defineProperty;var DP=e=>{throw TypeError(e)};var aV=(e,t,n)=>t in e?rV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Dw=(e,t,n)=>aV(e,typeof t!="symbol"?t+"":t,n),Iw=(e,t,n)=>t.has(e)||DP("Cannot "+n);var W=(e,t,n)=>(Iw(e,t,"read from private field"),n?n.call(e):t.get(e)),je=(e,t,n)=>t.has(e)?DP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Se=(e,t,n,r)=>(Iw(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),He=(e,t,n)=>(Iw(e,t,"access private method"),n);var Av=(e,t,n,r)=>({set _(a){Se(e,t,a,n)},get _(){return W(e,t,r)}});function iV(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function ci(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lw={exports:{}},th={};/**
 * @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 IP;function oV(){if(IP)return th;IP=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var s=null;if(i!==void 0&&(s=""+i),a.key!==void 0&&(s=""+a.key),"key"in a){i={};for(var c in a)c!=="key"&&(i[c]=a[c])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:s,ref:a!==void 0?a:null,props:i}}return th.Fragment=t,th.jsx=n,th.jsxs=n,th}var LP;function sV(){return LP||(LP=1,Lw.exports=oV()),Lw.exports}var p=sV(),zw={exports:{}},Ge={};/**
 * @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 zP;function lV(){if(zP)return Ge;zP=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),v=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=v&&B[v]||B["@@iterator"],typeof B=="function"?B:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function E(B,$,X){this.props=B,this.context=$,this.refs=S,this.updater=X||b}E.prototype.isReactComponent={},E.prototype.setState=function(B,$){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,$,"setState")},E.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function O(){}O.prototype=E.prototype;function j(B,$,X){this.props=B,this.context=$,this.refs=S,this.updater=X||b}var A=j.prototype=new O;A.constructor=j,w(A,E.prototype),A.isPureReactComponent=!0;var N=Array.isArray;function T(){}var P={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function D(B,$,X){var Z=X.ref;return{$$typeof:e,type:B,key:$,ref:Z!==void 0?Z:null,props:X}}function K(B,$){return D(B.type,$,B.props)}function z(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function I(B){var $={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(X){return $[X]})}var G=/\/+/g;function L(B,$){return typeof B=="object"&&B!==null&&B.key!=null?I(""+B.key):$.toString(36)}function Y(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(T,T):(B.status="pending",B.then(function($){B.status==="pending"&&(B.status="fulfilled",B.value=$)},function($){B.status==="pending"&&(B.status="rejected",B.reason=$)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function k(B,$,X,Z,ee){var le=typeof B;(le==="undefined"||le==="boolean")&&(B=null);var ie=!1;if(B===null)ie=!0;else switch(le){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(B.$$typeof){case e:case t:ie=!0;break;case m:return ie=B._init,k(ie(B._payload),$,X,Z,ee)}}if(ie)return ee=ee(B),ie=Z===""?"."+L(B,0):Z,N(ee)?(X="",ie!=null&&(X=ie.replace(G,"$&/")+"/"),k(ee,$,X,"",function(re){return re})):ee!=null&&(z(ee)&&(ee=K(ee,X+(ee.key==null||B&&B.key===ee.key?"":(""+ee.key).replace(G,"$&/")+"/")+ie)),$.push(ee)),1;ie=0;var ae=Z===""?".":Z+":";if(N(B))for(var J=0;J<B.length;J++)Z=B[J],le=ae+L(Z,J),ie+=k(Z,$,X,le,ee);else if(J=g(B),typeof J=="function")for(B=J.call(B),J=0;!(Z=B.next()).done;)Z=Z.value,le=ae+L(Z,J++),ie+=k(Z,$,X,le,ee);else if(le==="object"){if(typeof B.then=="function")return k(Y(B),$,X,Z,ee);throw $=String(B),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ie}function H(B,$,X){if(B==null)return B;var Z=[],ee=0;return k(B,Z,"","",function(le){return $.call(X,le,ee++)}),Z}function q(B){if(B._status===-1){var $=B._result;$=$(),$.then(function(X){(B._status===0||B._status===-1)&&(B._status=1,B._result=X)},function(X){(B._status===0||B._status===-1)&&(B._status=2,B._result=X)}),B._status===-1&&(B._status=0,B._result=$)}if(B._status===1)return B._result.default;throw B._result}var F=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},V={map:H,forEach:function(B,$,X){H(B,function(){$.apply(this,arguments)},X)},count:function(B){var $=0;return H(B,function(){$++}),$},toArray:function(B){return H(B,function($){return $})||[]},only:function(B){if(!z(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ge.Activity=f,Ge.Children=V,Ge.Component=E,Ge.Fragment=n,Ge.Profiler=a,Ge.PureComponent=j,Ge.StrictMode=r,Ge.Suspense=u,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(B){return P.H.useMemoCache(B)}},Ge.cache=function(B){return function(){return B.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(B,$,X){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var Z=w({},B.props),ee=B.key;if($!=null)for(le in $.key!==void 0&&(ee=""+$.key),$)!R.call($,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&$.ref===void 0||(Z[le]=$[le]);var le=arguments.length-2;if(le===1)Z.children=X;else if(1<le){for(var ie=Array(le),ae=0;ae<le;ae++)ie[ae]=arguments[ae+2];Z.children=ie}return D(B.type,ee,Z)},Ge.createContext=function(B){return B={$$typeof:s,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:i,_context:B},B},Ge.createElement=function(B,$,X){var Z,ee={},le=null;if($!=null)for(Z in $.key!==void 0&&(le=""+$.key),$)R.call($,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ee[Z]=$[Z]);var ie=arguments.length-2;if(ie===1)ee.children=X;else if(1<ie){for(var ae=Array(ie),J=0;J<ie;J++)ae[J]=arguments[J+2];ee.children=ae}if(B&&B.defaultProps)for(Z in ie=B.defaultProps,ie)ee[Z]===void 0&&(ee[Z]=ie[Z]);return D(B,le,ee)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(B){return{$$typeof:c,render:B}},Ge.isValidElement=z,Ge.lazy=function(B){return{$$typeof:m,_payload:{_status:-1,_result:B},_init:q}},Ge.memo=function(B,$){return{$$typeof:d,type:B,compare:$===void 0?null:$}},Ge.startTransition=function(B){var $=P.T,X={};P.T=X;try{var Z=B(),ee=P.S;ee!==null&&ee(X,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(T,F)}catch(le){F(le)}finally{$!==null&&X.types!==null&&($.types=X.types),P.T=$}},Ge.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ge.use=function(B){return P.H.use(B)},Ge.useActionState=function(B,$,X){return P.H.useActionState(B,$,X)},Ge.useCallback=function(B,$){return P.H.useCallback(B,$)},Ge.useContext=function(B){return P.H.useContext(B)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(B,$){return P.H.useDeferredValue(B,$)},Ge.useEffect=function(B,$){return P.H.useEffect(B,$)},Ge.useEffectEvent=function(B){return P.H.useEffectEvent(B)},Ge.useId=function(){return P.H.useId()},Ge.useImperativeHandle=function(B,$,X){return P.H.useImperativeHandle(B,$,X)},Ge.useInsertionEffect=function(B,$){return P.H.useInsertionEffect(B,$)},Ge.useLayoutEffect=function(B,$){return P.H.useLayoutEffect(B,$)},Ge.useMemo=function(B,$){return P.H.useMemo(B,$)},Ge.useOptimistic=function(B,$){return P.H.useOptimistic(B,$)},Ge.useReducer=function(B,$,X){return P.H.useReducer(B,$,X)},Ge.useRef=function(B){return P.H.useRef(B)},Ge.useState=function(B){return P.H.useState(B)},Ge.useSyncExternalStore=function(B,$,X){return P.H.useSyncExternalStore(B,$,X)},Ge.useTransition=function(){return P.H.useTransition()},Ge.version="19.2.4",Ge}var $P;function Fd(){return $P||($P=1,zw.exports=lV()),zw.exports}var x=Fd();const be=ci(x),aj=iV({__proto__:null,default:be},[x]);var $w={exports:{}},nh={},Bw={exports:{}},Uw={};/**
 * @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 BP;function cV(){return BP||(BP=1,(function(e){function t(k,H){var q=k.length;k.push(H);e:for(;0<q;){var F=q-1>>>1,V=k[F];if(0<a(V,H))k[F]=H,k[q]=V,q=F;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var H=k[0],q=k.pop();if(q!==H){k[0]=q;e:for(var F=0,V=k.length,B=V>>>1;F<B;){var $=2*(F+1)-1,X=k[$],Z=$+1,ee=k[Z];if(0>a(X,q))Z<V&&0>a(ee,X)?(k[F]=ee,k[Z]=q,F=Z):(k[F]=X,k[$]=q,F=$);else if(Z<V&&0>a(ee,q))k[F]=ee,k[Z]=q,F=Z;else break e}}return H}function a(k,H){var q=k.sortIndex-H.sortIndex;return q!==0?q:k.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var u=[],d=[],m=1,f=null,v=3,g=!1,b=!1,w=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function A(k){for(var H=n(d);H!==null;){if(H.callback===null)r(d);else if(H.startTime<=k)r(d),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(d)}}function N(k){if(w=!1,A(k),!b)if(n(u)!==null)b=!0,T||(T=!0,I());else{var H=n(d);H!==null&&Y(N,H.startTime-k)}}var T=!1,P=-1,R=5,D=-1;function K(){return S?!0:!(e.unstable_now()-D<R)}function z(){if(S=!1,T){var k=e.unstable_now();D=k;var H=!0;try{e:{b=!1,w&&(w=!1,O(P),P=-1),g=!0;var q=v;try{t:{for(A(k),f=n(u);f!==null&&!(f.expirationTime>k&&K());){var F=f.callback;if(typeof F=="function"){f.callback=null,v=f.priorityLevel;var V=F(f.expirationTime<=k);if(k=e.unstable_now(),typeof V=="function"){f.callback=V,A(k),H=!0;break t}f===n(u)&&r(u),A(k)}else r(u);f=n(u)}if(f!==null)H=!0;else{var B=n(d);B!==null&&Y(N,B.startTime-k),H=!1}}break e}finally{f=null,v=q,g=!1}H=void 0}}finally{H?I():T=!1}}}var I;if(typeof j=="function")I=function(){j(z)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,L=G.port2;G.port1.onmessage=z,I=function(){L.postMessage(null)}}else I=function(){E(z,0)};function Y(k,H){P=E(function(){k(e.unstable_now())},H)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.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"):R=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(k){switch(v){case 1:case 2:case 3:var H=3;break;default:H=v}var q=v;v=H;try{return k()}finally{v=q}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(k,H){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var q=v;v=k;try{return H()}finally{v=q}},e.unstable_scheduleCallback=function(k,H,q){var F=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?F+q:F):q=F,k){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=q+V,k={id:m++,callback:H,priorityLevel:k,startTime:q,expirationTime:V,sortIndex:-1},q>F?(k.sortIndex=q,t(d,k),n(u)===null&&k===n(d)&&(w?(O(P),P=-1):w=!0,Y(N,q-F))):(k.sortIndex=V,t(u,k),b||g||(b=!0,T||(T=!0,I()))),k},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(k){var H=v;return function(){var q=v;v=H;try{return k.apply(this,arguments)}finally{v=q}}}})(Uw)),Uw}var UP;function uV(){return UP||(UP=1,Bw.exports=cV()),Bw.exports}var Hw={exports:{}},ur={};/**
 * @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 HP;function dV(){if(HP)return ur;HP=1;var e=Fd();function t(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(u,d,m){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:f==null?null:""+f,children:u,containerInfo:d,implementation:m}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ur.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ur.createPortal=function(u,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return i(u,d,null,m)},ur.flushSync=function(u){var d=s.T,m=r.p;try{if(s.T=null,r.p=2,u)return u()}finally{s.T=d,r.p=m,r.d.f()}},ur.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},ur.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},ur.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var m=d.as,f=c(m,d.crossOrigin),v=typeof d.integrity=="string"?d.integrity:void 0,g=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:f,integrity:v,fetchPriority:g}):m==="script"&&r.d.X(u,{crossOrigin:f,integrity:v,fetchPriority:g,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ur.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},ur.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,f=c(m,d.crossOrigin);r.d.L(u,m,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ur.preloadModule=function(u,d){if(typeof u=="string")if(d){var m=c(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},ur.requestFormReset=function(u){r.d.r(u)},ur.unstable_batchedUpdates=function(u,d){return u(d)},ur.useFormState=function(u,d,m){return s.H.useFormState(u,d,m)},ur.useFormStatus=function(){return s.H.useHostTransitionStatus()},ur.version="19.2.4",ur}var FP;function vz(){if(FP)return Hw.exports;FP=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hw.exports=dV(),Hw.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 qP;function fV(){if(qP)return nh;qP=1;var e=uV(),t=Fd(),n=vz();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var l=o,h=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(h=l.return),o=l.return;while(o)}return l.tag===3?h:null}function s(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function c(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(i(o)!==o)throw Error(r(188))}function d(o){var l=o.alternate;if(!l){if(l=i(o),l===null)throw Error(r(188));return l!==o?null:o}for(var h=o,y=l;;){var _=h.return;if(_===null)break;var C=_.alternate;if(C===null){if(y=_.return,y!==null){h=y;continue}break}if(_.child===C.child){for(C=_.child;C;){if(C===h)return u(_),o;if(C===y)return u(_),l;C=C.sibling}throw Error(r(188))}if(h.return!==y.return)h=_,y=C;else{for(var M=!1,U=_.child;U;){if(U===h){M=!0,h=_,y=C;break}if(U===y){M=!0,y=_,h=C;break}U=U.sibling}if(!M){for(U=C.child;U;){if(U===h){M=!0,h=C,y=_;break}if(U===y){M=!0,y=C,h=_;break}U=U.sibling}if(!M)throw Error(r(189))}}if(h.alternate!==y)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?o:l}function m(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=m(o),l!==null)return l;o=o.sibling}return null}var f=Object.assign,v=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),j=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function I(o){return o===null||typeof o!="object"?null:(o=z&&o[z]||o["@@iterator"],typeof o=="function"?o:null)}var G=Symbol.for("react.client.reference");function L(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===G?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case w:return"Fragment";case E:return"Profiler";case S:return"StrictMode";case N:return"Suspense";case T:return"SuspenseList";case D:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case j:return o.displayName||"Context";case O:return(o._context.displayName||"Context")+".Consumer";case A:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case P:return l=o.displayName||null,l!==null?l:L(o.type)||"Memo";case R:l=o._payload,o=o._init;try{return L(o(l))}catch{}}return null}var Y=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},F=[],V=-1;function B(o){return{current:o}}function $(o){0>V||(o.current=F[V],F[V]=null,V--)}function X(o,l){V++,F[V]=o.current,o.current=l}var Z=B(null),ee=B(null),le=B(null),ie=B(null);function ae(o,l){switch(X(le,l),X(ee,o),X(Z,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?aP(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=aP(l),o=iP(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}$(Z),X(Z,o)}function J(){$(Z),$(ee),$(le)}function re(o){o.memoizedState!==null&&X(ie,o);var l=Z.current,h=iP(l,o.type);l!==h&&(X(ee,o),X(Z,h))}function fe(o){ee.current===o&&($(Z),$(ee)),ie.current===o&&($(ie),Qf._currentValue=q)}var ne,xe;function ye(o){if(ne===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);ne=l&&l[1]||"",xe=-1<h.stack.indexOf(`
    at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ne+o+xe}var De=!1;function Me(o,l){if(!o||De)return"";De=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(l){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(he){var de=he}Reflect.construct(o,[],ve)}else{try{ve.call()}catch(he){de=he}o.call(ve.prototype)}}else{try{throw Error()}catch(he){de=he}(ve=o())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(he){if(he&&de&&typeof he.stack=="string")return[he.stack,de.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=y.DetermineComponentFrameRoot(),M=C[0],U=C[1];if(M&&U){var Q=M.split(`
`),ue=U.split(`
`);for(_=y=0;y<Q.length&&!Q[y].includes("DetermineComponentFrameRoot");)y++;for(;_<ue.length&&!ue[_].includes("DetermineComponentFrameRoot");)_++;if(y===Q.length||_===ue.length)for(y=Q.length-1,_=ue.length-1;1<=y&&0<=_&&Q[y]!==ue[_];)_--;for(;1<=y&&0<=_;y--,_--)if(Q[y]!==ue[_]){if(y!==1||_!==1)do if(y--,_--,0>_||Q[y]!==ue[_]){var me=`
`+Q[y].replace(" at new "," at ");return o.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",o.displayName)),me}while(1<=y&&0<=_);break}}}finally{De=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?ye(h):""}function Ke(o,l){switch(o.tag){case 26:case 27:case 5:return ye(o.type);case 16:return ye("Lazy");case 13:return o.child!==l&&l!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Me(o.type,!1);case 11:return Me(o.type.render,!1);case 1:return Me(o.type,!0);case 31:return ye("Activity");default:return""}}function Je(o){try{var l="",h=null;do l+=Ke(o,h),h=o,o=o.return;while(o);return l}catch(y){return`
Error generating stack: `+y.message+`
`+y.stack}}var nt=Object.prototype.hasOwnProperty,pn=e.unstable_scheduleCallback,Bn=e.unstable_cancelCallback,Et=e.unstable_shouldYield,vn=e.unstable_requestPaint,It=e.unstable_now,Sr=e.unstable_getCurrentPriorityLevel,dn=e.unstable_ImmediatePriority,Mr=e.unstable_UserBlockingPriority,Er=e.unstable_NormalPriority,ga=e.unstable_LowPriority,Un=e.unstable_IdlePriority,ya=e.log,_r=e.unstable_setDisableYieldValue,kr=null,we=null;function xt(o){if(typeof ya=="function"&&_r(o),we&&typeof we.setStrictMode=="function")try{we.setStrictMode(kr,o)}catch{}}var ht=Math.clz32?Math.clz32:Ct,Xr=Math.log,ge=Math.LN2;function Ct(o){return o>>>=0,o===0?32:31-(Xr(o)/ge|0)|0}var Rr=256,Ua=262144,Ha=4194304;function ir(o){var l=o&42;if(l!==0)return l;switch(o&-o){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:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function qe(o,l,h){var y=o.pendingLanes;if(y===0)return 0;var _=0,C=o.suspendedLanes,M=o.pingedLanes;o=o.warmLanes;var U=y&134217727;return U!==0?(y=U&~C,y!==0?_=ir(y):(M&=U,M!==0?_=ir(M):h||(h=U&~o,h!==0&&(_=ir(h))))):(U=y&~C,U!==0?_=ir(U):M!==0?_=ir(M):h||(h=y&~o,h!==0&&(_=ir(h)))),_===0?0:l!==0&&l!==_&&(l&C)===0&&(C=_&-_,h=l&-l,C>=h||C===32&&(h&4194048)!==0)?l:_}function Lt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function gn(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 Hn(){var o=Ha;return Ha<<=1,(Ha&62914560)===0&&(Ha=4194304),o}function vi(o){for(var l=[],h=0;31>h;h++)l.push(o);return l}function $t(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function or(o,l,h,y,_,C){var M=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var U=o.entanglements,Q=o.expirationTimes,ue=o.hiddenUpdates;for(h=M&~h;0<h;){var me=31-ht(h),ve=1<<me;U[me]=0,Q[me]=-1;var de=ue[me];if(de!==null)for(ue[me]=null,me=0;me<de.length;me++){var he=de[me];he!==null&&(he.lane&=-536870913)}h&=~ve}y!==0&&Wi(o,y,0),C!==0&&_===0&&o.tag!==0&&(o.suspendedLanes|=C&~(M&~l))}function Wi(o,l,h){o.pendingLanes|=l,o.suspendedLanes&=~l;var y=31-ht(l);o.entangledLanes|=l,o.entanglements[y]=o.entanglements[y]|1073741824|h&261930}function sr(o,l){var h=o.entangledLanes|=l;for(o=o.entanglements;h;){var y=31-ht(h),_=1<<y;_&l|o[y]&l&&(o[y]|=l),h&=~_}}function lr(o,l){var h=l&-l;return h=(h&42)!==0?1:is(h),(h&(o.suspendedLanes|l))!==0?0:h}function is(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Wr(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function uf(){var o=H.p;return o!==0?o:(o=window.event,o===void 0?32:AP(o.type))}function up(o,l){var h=H.p;try{return H.p=o,l()}finally{H.p=h}}var gi=Math.random().toString(36).slice(2),An="__reactFiber$"+gi,cr="__reactProps$"+gi,Qi="__reactContainer$"+gi,nu="__reactEvents$"+gi,dp="__reactListeners$"+gi,Cx="__reactHandles$"+gi,fp="__reactResources$"+gi,Pl="__reactMarker$"+gi;function df(o){delete o[An],delete o[cr],delete o[nu],delete o[dp],delete o[Cx]}function os(o){var l=o[An];if(l)return l;for(var h=o.parentNode;h;){if(l=h[Qi]||h[An]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(o=fP(o);o!==null;){if(h=o[An])return h;o=fP(o)}return l}o=h,h=o.parentNode}return null}function ss(o){if(o=o[An]||o[Qi]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function ls(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function cs(o){var l=o[fp];return l||(l=o[fp]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function yn(o){o[Pl]=!0}var hp=new Set,mp={};function Zi(o,l){us(o,l),us(o+"Capture",l)}function us(o,l){for(mp[o]=l,o=0;o<l.length;o++)hp.add(l[o])}var Ox=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]*$"),ff={},pp={};function Ax(o){return nt.call(pp,o)?!0:nt.call(ff,o)?!1:Ox.test(o)?pp[o]=!0:(ff[o]=!0,!1)}function ru(o,l,h){if(Ax(l))if(h===null)o.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var y=l.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+h)}}function au(o,l,h){if(h===null)o.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+h)}}function Fa(o,l,h,y){if(y===null)o.removeAttribute(h);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(l,h,""+y)}}function Dr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function vp(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Nx(o,l,h){var y=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var _=y.get,C=y.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return _.call(this)},set:function(M){h=""+M,C.call(this,M)}}),Object.defineProperty(o,l,{enumerable:y.enumerable}),{getValue:function(){return h},setValue:function(M){h=""+M},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function ds(o){if(!o._valueTracker){var l=vp(o)?"checked":"value";o._valueTracker=Nx(o,l,""+o[l])}}function gp(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var h=l.getValue(),y="";return o&&(y=vp(o)?o.checked?"true":"false":o.value),o=y,o!==h?(l.setValue(o),!0):!1}function Ml(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var Tx=/[\n"\\]/g;function Ir(o){return o.replace(Tx,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function kl(o,l,h,y,_,C,M,U){o.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?o.type=M:o.removeAttribute("type"),l!=null?M==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+Dr(l)):o.value!==""+Dr(l)&&(o.value=""+Dr(l)):M!=="submit"&&M!=="reset"||o.removeAttribute("value"),l!=null?hf(o,M,Dr(l)):h!=null?hf(o,M,Dr(h)):y!=null&&o.removeAttribute("value"),_==null&&C!=null&&(o.defaultChecked=!!C),_!=null&&(o.checked=_&&typeof _!="function"&&typeof _!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?o.name=""+Dr(U):o.removeAttribute("name")}function yp(o,l,h,y,_,C,M,U){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.type=C),l!=null||h!=null){if(!(C!=="submit"&&C!=="reset"||l!=null)){ds(o);return}h=h!=null?""+Dr(h):"",l=l!=null?""+Dr(l):h,U||l===o.value||(o.value=l),o.defaultValue=l}y=y??_,y=typeof y!="function"&&typeof y!="symbol"&&!!y,o.checked=U?o.checked:!!y,o.defaultChecked=!!y,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(o.name=M),ds(o)}function hf(o,l,h){l==="number"&&Ml(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Ji(o,l,h,y){if(o=o.options,l){l={};for(var _=0;_<h.length;_++)l["$"+h[_]]=!0;for(h=0;h<o.length;h++)_=l.hasOwnProperty("$"+o[h].value),o[h].selected!==_&&(o[h].selected=_),_&&y&&(o[h].defaultSelected=!0)}else{for(h=""+Dr(h),l=null,_=0;_<o.length;_++){if(o[_].value===h){o[_].selected=!0,y&&(o[_].defaultSelected=!0);return}l!==null||o[_].disabled||(l=o[_])}l!==null&&(l.selected=!0)}}function JA(o,l,h){if(l!=null&&(l=""+Dr(l),l!==o.value&&(o.value=l),h==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=h!=null?""+Dr(h):""}function eN(o,l,h,y){if(l==null){if(y!=null){if(h!=null)throw Error(r(92));if(Y(y)){if(1<y.length)throw Error(r(93));y=y[0]}h=y}h==null&&(h=""),l=h}h=Dr(l),o.defaultValue=h,y=o.textContent,y===h&&y!==""&&y!==null&&(o.value=y),ds(o)}function iu(o,l){if(l){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=l;return}}o.textContent=l}var Z9=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 tN(o,l,h){var y=l.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?y?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":y?o.setProperty(l,h):typeof h!="number"||h===0||Z9.has(l)?l==="float"?o.cssFloat=h:o[l]=(""+h).trim():o[l]=h+"px"}function nN(o,l,h){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,h!=null){for(var y in h)!h.hasOwnProperty(y)||l!=null&&l.hasOwnProperty(y)||(y.indexOf("--")===0?o.setProperty(y,""):y==="float"?o.cssFloat="":o[y]="");for(var _ in l)y=l[_],l.hasOwnProperty(_)&&h[_]!==y&&tN(o,_,y)}else for(var C in l)l.hasOwnProperty(C)&&tN(o,C,l[C])}function Px(o){if(o.indexOf("-")===-1)return!1;switch(o){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 J9=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"]]),e7=/^[\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 xp(o){return e7.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function eo(){}var Mx=null;function kx(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var ou=null,su=null;function rN(o){var l=ss(o);if(l&&(o=l.stateNode)){var h=o[cr]||null;e:switch(o=l.stateNode,l.type){case"input":if(kl(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),l=h.name,h.type==="radio"&&l!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Ir(""+l)+'"][type="radio"]'),l=0;l<h.length;l++){var y=h[l];if(y!==o&&y.form===o.form){var _=y[cr]||null;if(!_)throw Error(r(90));kl(y,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(l=0;l<h.length;l++)y=h[l],y.form===o.form&&gp(y)}break e;case"textarea":JA(o,h.value,h.defaultValue);break e;case"select":l=h.value,l!=null&&Ji(o,!!h.multiple,l,!1)}}}var Rx=!1;function aN(o,l,h){if(Rx)return o(l,h);Rx=!0;try{var y=o(l);return y}finally{if(Rx=!1,(ou!==null||su!==null)&&(ov(),ou&&(l=ou,o=su,su=ou=null,rN(l),o)))for(l=0;l<o.length;l++)rN(o[l])}}function mf(o,l){var h=o.stateNode;if(h===null)return null;var y=h[cr]||null;if(y===null)return null;h=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(o=o.type,y=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!y;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var to=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dx=!1;if(to)try{var pf={};Object.defineProperty(pf,"passive",{get:function(){Dx=!0}}),window.addEventListener("test",pf,pf),window.removeEventListener("test",pf,pf)}catch{Dx=!1}var fs=null,Ix=null,bp=null;function iN(){if(bp)return bp;var o,l=Ix,h=l.length,y,_="value"in fs?fs.value:fs.textContent,C=_.length;for(o=0;o<h&&l[o]===_[o];o++);var M=h-o;for(y=1;y<=M&&l[h-y]===_[C-y];y++);return bp=_.slice(o,1<y?1-y:void 0)}function wp(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Sp(){return!0}function oN(){return!1}function Lr(o){function l(h,y,_,C,M){this._reactName=h,this._targetInst=_,this.type=y,this.nativeEvent=C,this.target=M,this.currentTarget=null;for(var U in o)o.hasOwnProperty(U)&&(h=o[U],this[U]=h?h(C):C[U]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Sp:oN,this.isPropagationStopped=oN,this}return f(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Sp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Sp)},persist:function(){},isPersistent:Sp}),l}var Rl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ep=Lr(Rl),vf=f({},Rl,{view:0,detail:0}),t7=Lr(vf),Lx,zx,gf,_p=f({},vf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bx,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==gf&&(gf&&o.type==="mousemove"?(Lx=o.screenX-gf.screenX,zx=o.screenY-gf.screenY):zx=Lx=0,gf=o),Lx)},movementY:function(o){return"movementY"in o?o.movementY:zx}}),sN=Lr(_p),n7=f({},_p,{dataTransfer:0}),r7=Lr(n7),a7=f({},vf,{relatedTarget:0}),$x=Lr(a7),i7=f({},Rl,{animationName:0,elapsedTime:0,pseudoElement:0}),o7=Lr(i7),s7=f({},Rl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),l7=Lr(s7),c7=f({},Rl,{data:0}),lN=Lr(c7),u7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},d7={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"},f7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function h7(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=f7[o])?!!l[o]:!1}function Bx(){return h7}var m7=f({},vf,{key:function(o){if(o.key){var l=u7[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=wp(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?d7[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bx,charCode:function(o){return o.type==="keypress"?wp(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?wp(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),p7=Lr(m7),v7=f({},_p,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cN=Lr(v7),g7=f({},vf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bx}),y7=Lr(g7),x7=f({},Rl,{propertyName:0,elapsedTime:0,pseudoElement:0}),b7=Lr(x7),w7=f({},_p,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),S7=Lr(w7),E7=f({},Rl,{newState:0,oldState:0}),_7=Lr(E7),j7=[9,13,27,32],Ux=to&&"CompositionEvent"in window,yf=null;to&&"documentMode"in document&&(yf=document.documentMode);var C7=to&&"TextEvent"in window&&!yf,uN=to&&(!Ux||yf&&8<yf&&11>=yf),dN=" ",fN=!1;function hN(o,l){switch(o){case"keyup":return j7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mN(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var lu=!1;function O7(o,l){switch(o){case"compositionend":return mN(l);case"keypress":return l.which!==32?null:(fN=!0,dN);case"textInput":return o=l.data,o===dN&&fN?null:o;default:return null}}function A7(o,l){if(lu)return o==="compositionend"||!Ux&&hN(o,l)?(o=iN(),bp=Ix=fs=null,lu=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return uN&&l.locale!=="ko"?null:l.data;default:return null}}var N7={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 pN(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!N7[o.type]:l==="textarea"}function vN(o,l,h,y){ou?su?su.push(y):su=[y]:ou=y,l=hv(l,"onChange"),0<l.length&&(h=new Ep("onChange","change",null,h,y),o.push({event:h,listeners:l}))}var xf=null,bf=null;function T7(o){Z2(o,0)}function jp(o){var l=ls(o);if(gp(l))return o}function gN(o,l){if(o==="change")return l}var yN=!1;if(to){var Hx;if(to){var Fx="oninput"in document;if(!Fx){var xN=document.createElement("div");xN.setAttribute("oninput","return;"),Fx=typeof xN.oninput=="function"}Hx=Fx}else Hx=!1;yN=Hx&&(!document.documentMode||9<document.documentMode)}function bN(){xf&&(xf.detachEvent("onpropertychange",wN),bf=xf=null)}function wN(o){if(o.propertyName==="value"&&jp(bf)){var l=[];vN(l,bf,o,kx(o)),aN(T7,l)}}function P7(o,l,h){o==="focusin"?(bN(),xf=l,bf=h,xf.attachEvent("onpropertychange",wN)):o==="focusout"&&bN()}function M7(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return jp(bf)}function k7(o,l){if(o==="click")return jp(l)}function R7(o,l){if(o==="input"||o==="change")return jp(l)}function D7(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Qr=typeof Object.is=="function"?Object.is:D7;function wf(o,l){if(Qr(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var h=Object.keys(o),y=Object.keys(l);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var _=h[y];if(!nt.call(l,_)||!Qr(o[_],l[_]))return!1}return!0}function SN(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function EN(o,l){var h=SN(o);o=0;for(var y;h;){if(h.nodeType===3){if(y=o+h.textContent.length,o<=l&&y>=l)return{node:h,offset:l-o};o=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=SN(h)}}function _N(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?_N(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function jN(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Ml(o.document);l instanceof o.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)o=l.contentWindow;else break;l=Ml(o.document)}return l}function qx(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var I7=to&&"documentMode"in document&&11>=document.documentMode,cu=null,Kx=null,Sf=null,Vx=!1;function CN(o,l,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Vx||cu==null||cu!==Ml(y)||(y=cu,"selectionStart"in y&&qx(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Sf&&wf(Sf,y)||(Sf=y,y=hv(Kx,"onSelect"),0<y.length&&(l=new Ep("onSelect","select",null,l,h),o.push({event:l,listeners:y}),l.target=cu)))}function Dl(o,l){var h={};return h[o.toLowerCase()]=l.toLowerCase(),h["Webkit"+o]="webkit"+l,h["Moz"+o]="moz"+l,h}var uu={animationend:Dl("Animation","AnimationEnd"),animationiteration:Dl("Animation","AnimationIteration"),animationstart:Dl("Animation","AnimationStart"),transitionrun:Dl("Transition","TransitionRun"),transitionstart:Dl("Transition","TransitionStart"),transitioncancel:Dl("Transition","TransitionCancel"),transitionend:Dl("Transition","TransitionEnd")},Yx={},ON={};to&&(ON=document.createElement("div").style,"AnimationEvent"in window||(delete uu.animationend.animation,delete uu.animationiteration.animation,delete uu.animationstart.animation),"TransitionEvent"in window||delete uu.transitionend.transition);function Il(o){if(Yx[o])return Yx[o];if(!uu[o])return o;var l=uu[o],h;for(h in l)if(l.hasOwnProperty(h)&&h in ON)return Yx[o]=l[h];return o}var AN=Il("animationend"),NN=Il("animationiteration"),TN=Il("animationstart"),L7=Il("transitionrun"),z7=Il("transitionstart"),$7=Il("transitioncancel"),PN=Il("transitionend"),MN=new Map,Gx="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(" ");Gx.push("scrollEnd");function qa(o,l){MN.set(o,l),Zi(l,[o])}var Cp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},xa=[],du=0,Xx=0;function Op(){for(var o=du,l=Xx=du=0;l<o;){var h=xa[l];xa[l++]=null;var y=xa[l];xa[l++]=null;var _=xa[l];xa[l++]=null;var C=xa[l];if(xa[l++]=null,y!==null&&_!==null){var M=y.pending;M===null?_.next=_:(_.next=M.next,M.next=_),y.pending=_}C!==0&&kN(h,_,C)}}function Ap(o,l,h,y){xa[du++]=o,xa[du++]=l,xa[du++]=h,xa[du++]=y,Xx|=y,o.lanes|=y,o=o.alternate,o!==null&&(o.lanes|=y)}function Wx(o,l,h,y){return Ap(o,l,h,y),Np(o)}function Ll(o,l){return Ap(o,null,null,l),Np(o)}function kN(o,l,h){o.lanes|=h;var y=o.alternate;y!==null&&(y.lanes|=h);for(var _=!1,C=o.return;C!==null;)C.childLanes|=h,y=C.alternate,y!==null&&(y.childLanes|=h),C.tag===22&&(o=C.stateNode,o===null||o._visibility&1||(_=!0)),o=C,C=C.return;return o.tag===3?(C=o.stateNode,_&&l!==null&&(_=31-ht(h),o=C.hiddenUpdates,y=o[_],y===null?o[_]=[l]:y.push(l),l.lane=h|536870912),C):null}function Np(o){if(50<qf)throw qf=0,iw=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var fu={};function B7(o,l,h,y){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(o,l,h,y){return new B7(o,l,h,y)}function Qx(o){return o=o.prototype,!(!o||!o.isReactComponent)}function no(o,l){var h=o.alternate;return h===null?(h=Zr(o.tag,l,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=l,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,l=o.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function RN(o,l){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,l=h.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function Tp(o,l,h,y,_,C){var M=0;if(y=o,typeof o=="function")Qx(o)&&(M=1);else if(typeof o=="string")M=KK(o,h,Z.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case D:return o=Zr(31,h,l,_),o.elementType=D,o.lanes=C,o;case w:return zl(h.children,_,C,l);case S:M=8,_|=24;break;case E:return o=Zr(12,h,l,_|2),o.elementType=E,o.lanes=C,o;case N:return o=Zr(13,h,l,_),o.elementType=N,o.lanes=C,o;case T:return o=Zr(19,h,l,_),o.elementType=T,o.lanes=C,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case j:M=10;break e;case O:M=9;break e;case A:M=11;break e;case P:M=14;break e;case R:M=16,y=null;break e}M=29,h=Error(r(130,o===null?"null":typeof o,"")),y=null}return l=Zr(M,h,l,_),l.elementType=o,l.type=y,l.lanes=C,l}function zl(o,l,h,y){return o=Zr(7,o,y,l),o.lanes=h,o}function Zx(o,l,h){return o=Zr(6,o,null,l),o.lanes=h,o}function DN(o){var l=Zr(18,null,null,0);return l.stateNode=o,l}function Jx(o,l,h){return l=Zr(4,o.children!==null?o.children:[],o.key,l),l.lanes=h,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var IN=new WeakMap;function ba(o,l){if(typeof o=="object"&&o!==null){var h=IN.get(o);return h!==void 0?h:(l={value:o,source:l,stack:Je(l)},IN.set(o,l),l)}return{value:o,source:l,stack:Je(l)}}var hu=[],mu=0,Pp=null,Ef=0,wa=[],Sa=0,hs=null,yi=1,xi="";function ro(o,l){hu[mu++]=Ef,hu[mu++]=Pp,Pp=o,Ef=l}function LN(o,l,h){wa[Sa++]=yi,wa[Sa++]=xi,wa[Sa++]=hs,hs=o;var y=yi;o=xi;var _=32-ht(y)-1;y&=~(1<<_),h+=1;var C=32-ht(l)+_;if(30<C){var M=_-_%5;C=(y&(1<<M)-1).toString(32),y>>=M,_-=M,yi=1<<32-ht(l)+_|h<<_|y,xi=C+o}else yi=1<<C|h<<_|y,xi=o}function eb(o){o.return!==null&&(ro(o,1),LN(o,1,0))}function tb(o){for(;o===Pp;)Pp=hu[--mu],hu[mu]=null,Ef=hu[--mu],hu[mu]=null;for(;o===hs;)hs=wa[--Sa],wa[Sa]=null,xi=wa[--Sa],wa[Sa]=null,yi=wa[--Sa],wa[Sa]=null}function zN(o,l){wa[Sa++]=yi,wa[Sa++]=xi,wa[Sa++]=hs,yi=l.id,xi=l.overflow,hs=o}var Qn=null,Bt=null,ot=!1,ms=null,Ea=!1,nb=Error(r(519));function ps(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _f(ba(l,o)),nb}function $N(o){var l=o.stateNode,h=o.type,y=o.memoizedProps;switch(l[An]=o,l[cr]=y,h){case"dialog":tt("cancel",l),tt("close",l);break;case"iframe":case"object":case"embed":tt("load",l);break;case"video":case"audio":for(h=0;h<Vf.length;h++)tt(Vf[h],l);break;case"source":tt("error",l);break;case"img":case"image":case"link":tt("error",l),tt("load",l);break;case"details":tt("toggle",l);break;case"input":tt("invalid",l),yp(l,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":tt("invalid",l);break;case"textarea":tt("invalid",l),eN(l,y.value,y.defaultValue,y.children)}h=y.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||l.textContent===""+h||y.suppressHydrationWarning===!0||nP(l.textContent,h)?(y.popover!=null&&(tt("beforetoggle",l),tt("toggle",l)),y.onScroll!=null&&tt("scroll",l),y.onScrollEnd!=null&&tt("scrollend",l),y.onClick!=null&&(l.onclick=eo),l=!0):l=!1,l||ps(o,!0)}function BN(o){for(Qn=o.return;Qn;)switch(Qn.tag){case 5:case 31:case 13:Ea=!1;return;case 27:case 3:Ea=!0;return;default:Qn=Qn.return}}function pu(o){if(o!==Qn)return!1;if(!ot)return BN(o),ot=!0,!1;var l=o.tag,h;if((h=l!==3&&l!==27)&&((h=l===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||bw(o.type,o.memoizedProps)),h=!h),h&&Bt&&ps(o),BN(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Bt=dP(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Bt=dP(o)}else l===27?(l=Bt,Ns(o.type)?(o=jw,jw=null,Bt=o):Bt=l):Bt=Qn?ja(o.stateNode.nextSibling):null;return!0}function $l(){Bt=Qn=null,ot=!1}function rb(){var o=ms;return o!==null&&(Ur===null?Ur=o:Ur.push.apply(Ur,o),ms=null),o}function _f(o){ms===null?ms=[o]:ms.push(o)}var ab=B(null),Bl=null,ao=null;function vs(o,l,h){X(ab,l._currentValue),l._currentValue=h}function io(o){o._currentValue=ab.current,$(ab)}function ib(o,l,h){for(;o!==null;){var y=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),o===h)break;o=o.return}}function ob(o,l,h,y){var _=o.child;for(_!==null&&(_.return=o);_!==null;){var C=_.dependencies;if(C!==null){var M=_.child;C=C.firstContext;e:for(;C!==null;){var U=C;C=_;for(var Q=0;Q<l.length;Q++)if(U.context===l[Q]){C.lanes|=h,U=C.alternate,U!==null&&(U.lanes|=h),ib(C.return,h,o),y||(M=null);break e}C=U.next}}else if(_.tag===18){if(M=_.return,M===null)throw Error(r(341));M.lanes|=h,C=M.alternate,C!==null&&(C.lanes|=h),ib(M,h,o),M=null}else M=_.child;if(M!==null)M.return=_;else for(M=_;M!==null;){if(M===o){M=null;break}if(_=M.sibling,_!==null){_.return=M.return,M=_;break}M=M.return}_=M}}function vu(o,l,h,y){o=null;for(var _=l,C=!1;_!==null;){if(!C){if((_.flags&524288)!==0)C=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var M=_.alternate;if(M===null)throw Error(r(387));if(M=M.memoizedProps,M!==null){var U=_.type;Qr(_.pendingProps.value,M.value)||(o!==null?o.push(U):o=[U])}}else if(_===ie.current){if(M=_.alternate,M===null)throw Error(r(387));M.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(o!==null?o.push(Qf):o=[Qf])}_=_.return}o!==null&&ob(l,o,h,y),l.flags|=262144}function Mp(o){for(o=o.firstContext;o!==null;){if(!Qr(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Ul(o){Bl=o,ao=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Zn(o){return UN(Bl,o)}function kp(o,l){return Bl===null&&Ul(o),UN(o,l)}function UN(o,l){var h=l._currentValue;if(l={context:l,memoizedValue:h,next:null},ao===null){if(o===null)throw Error(r(308));ao=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else ao=ao.next=l;return h}var U7=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(h,y){o.push(y)}};this.abort=function(){l.aborted=!0,o.forEach(function(h){return h()})}},H7=e.unstable_scheduleCallback,F7=e.unstable_NormalPriority,xn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sb(){return{controller:new U7,data:new Map,refCount:0}}function jf(o){o.refCount--,o.refCount===0&&H7(F7,function(){o.controller.abort()})}var Cf=null,lb=0,gu=0,yu=null;function q7(o,l){if(Cf===null){var h=Cf=[];lb=0,gu=dw(),yu={status:"pending",value:void 0,then:function(y){h.push(y)}}}return lb++,l.then(HN,HN),l}function HN(){if(--lb===0&&Cf!==null){yu!==null&&(yu.status="fulfilled");var o=Cf;Cf=null,gu=0,yu=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function K7(o,l){var h=[],y={status:"pending",value:null,reason:null,then:function(_){h.push(_)}};return o.then(function(){y.status="fulfilled",y.value=l;for(var _=0;_<h.length;_++)(0,h[_])(l)},function(_){for(y.status="rejected",y.reason=_,_=0;_<h.length;_++)(0,h[_])(void 0)}),y}var FN=k.S;k.S=function(o,l){C2=It(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&q7(o,l),FN!==null&&FN(o,l)};var Hl=B(null);function cb(){var o=Hl.current;return o!==null?o:Rt.pooledCache}function Rp(o,l){l===null?X(Hl,Hl.current):X(Hl,l.pool)}function qN(){var o=cb();return o===null?null:{parent:xn._currentValue,pool:o}}var xu=Error(r(460)),ub=Error(r(474)),Dp=Error(r(542)),Ip={then:function(){}};function KN(o){return o=o.status,o==="fulfilled"||o==="rejected"}function VN(o,l,h){switch(h=o[h],h===void 0?o.push(l):h!==l&&(l.then(eo,eo),l=h),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,GN(o),o;default:if(typeof l.status=="string")l.then(eo,eo);else{if(o=Rt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(y){if(l.status==="pending"){var _=l;_.status="fulfilled",_.value=y}},function(y){if(l.status==="pending"){var _=l;_.status="rejected",_.reason=y}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,GN(o),o}throw ql=l,xu}}function Fl(o){try{var l=o._init;return l(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(ql=h,xu):h}}var ql=null;function YN(){if(ql===null)throw Error(r(459));var o=ql;return ql=null,o}function GN(o){if(o===xu||o===Dp)throw Error(r(483))}var bu=null,Of=0;function Lp(o){var l=Of;return Of+=1,bu===null&&(bu=[]),VN(bu,o,l)}function Af(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function zp(o,l){throw l.$$typeof===v?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function XN(o){function l(oe,te){if(o){var ce=oe.deletions;ce===null?(oe.deletions=[te],oe.flags|=16):ce.push(te)}}function h(oe,te){if(!o)return null;for(;te!==null;)l(oe,te),te=te.sibling;return null}function y(oe){for(var te=new Map;oe!==null;)oe.key!==null?te.set(oe.key,oe):te.set(oe.index,oe),oe=oe.sibling;return te}function _(oe,te){return oe=no(oe,te),oe.index=0,oe.sibling=null,oe}function C(oe,te,ce){return oe.index=ce,o?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<te?(oe.flags|=67108866,te):ce):(oe.flags|=67108866,te)):(oe.flags|=1048576,te)}function M(oe){return o&&oe.alternate===null&&(oe.flags|=67108866),oe}function U(oe,te,ce,pe){return te===null||te.tag!==6?(te=Zx(ce,oe.mode,pe),te.return=oe,te):(te=_(te,ce),te.return=oe,te)}function Q(oe,te,ce,pe){var $e=ce.type;return $e===w?me(oe,te,ce.props.children,pe,ce.key):te!==null&&(te.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===R&&Fl($e)===te.type)?(te=_(te,ce.props),Af(te,ce),te.return=oe,te):(te=Tp(ce.type,ce.key,ce.props,null,oe.mode,pe),Af(te,ce),te.return=oe,te)}function ue(oe,te,ce,pe){return te===null||te.tag!==4||te.stateNode.containerInfo!==ce.containerInfo||te.stateNode.implementation!==ce.implementation?(te=Jx(ce,oe.mode,pe),te.return=oe,te):(te=_(te,ce.children||[]),te.return=oe,te)}function me(oe,te,ce,pe,$e){return te===null||te.tag!==7?(te=zl(ce,oe.mode,pe,$e),te.return=oe,te):(te=_(te,ce),te.return=oe,te)}function ve(oe,te,ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Zx(""+te,oe.mode,ce),te.return=oe,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case g:return ce=Tp(te.type,te.key,te.props,null,oe.mode,ce),Af(ce,te),ce.return=oe,ce;case b:return te=Jx(te,oe.mode,ce),te.return=oe,te;case R:return te=Fl(te),ve(oe,te,ce)}if(Y(te)||I(te))return te=zl(te,oe.mode,ce,null),te.return=oe,te;if(typeof te.then=="function")return ve(oe,Lp(te),ce);if(te.$$typeof===j)return ve(oe,kp(oe,te),ce);zp(oe,te)}return null}function de(oe,te,ce,pe){var $e=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return $e!==null?null:U(oe,te,""+ce,pe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case g:return ce.key===$e?Q(oe,te,ce,pe):null;case b:return ce.key===$e?ue(oe,te,ce,pe):null;case R:return ce=Fl(ce),de(oe,te,ce,pe)}if(Y(ce)||I(ce))return $e!==null?null:me(oe,te,ce,pe,null);if(typeof ce.then=="function")return de(oe,te,Lp(ce),pe);if(ce.$$typeof===j)return de(oe,te,kp(oe,ce),pe);zp(oe,ce)}return null}function he(oe,te,ce,pe,$e){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return oe=oe.get(ce)||null,U(te,oe,""+pe,$e);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case g:return oe=oe.get(pe.key===null?ce:pe.key)||null,Q(te,oe,pe,$e);case b:return oe=oe.get(pe.key===null?ce:pe.key)||null,ue(te,oe,pe,$e);case R:return pe=Fl(pe),he(oe,te,ce,pe,$e)}if(Y(pe)||I(pe))return oe=oe.get(ce)||null,me(te,oe,pe,$e,null);if(typeof pe.then=="function")return he(oe,te,ce,Lp(pe),$e);if(pe.$$typeof===j)return he(oe,te,ce,kp(te,pe),$e);zp(te,pe)}return null}function Ne(oe,te,ce,pe){for(var $e=null,pt=null,Re=te,We=te=0,at=null;Re!==null&&We<ce.length;We++){Re.index>We?(at=Re,Re=null):at=Re.sibling;var vt=de(oe,Re,ce[We],pe);if(vt===null){Re===null&&(Re=at);break}o&&Re&&vt.alternate===null&&l(oe,Re),te=C(vt,te,We),pt===null?$e=vt:pt.sibling=vt,pt=vt,Re=at}if(We===ce.length)return h(oe,Re),ot&&ro(oe,We),$e;if(Re===null){for(;We<ce.length;We++)Re=ve(oe,ce[We],pe),Re!==null&&(te=C(Re,te,We),pt===null?$e=Re:pt.sibling=Re,pt=Re);return ot&&ro(oe,We),$e}for(Re=y(Re);We<ce.length;We++)at=he(Re,oe,We,ce[We],pe),at!==null&&(o&&at.alternate!==null&&Re.delete(at.key===null?We:at.key),te=C(at,te,We),pt===null?$e=at:pt.sibling=at,pt=at);return o&&Re.forEach(function(Rs){return l(oe,Rs)}),ot&&ro(oe,We),$e}function Ue(oe,te,ce,pe){if(ce==null)throw Error(r(151));for(var $e=null,pt=null,Re=te,We=te=0,at=null,vt=ce.next();Re!==null&&!vt.done;We++,vt=ce.next()){Re.index>We?(at=Re,Re=null):at=Re.sibling;var Rs=de(oe,Re,vt.value,pe);if(Rs===null){Re===null&&(Re=at);break}o&&Re&&Rs.alternate===null&&l(oe,Re),te=C(Rs,te,We),pt===null?$e=Rs:pt.sibling=Rs,pt=Rs,Re=at}if(vt.done)return h(oe,Re),ot&&ro(oe,We),$e;if(Re===null){for(;!vt.done;We++,vt=ce.next())vt=ve(oe,vt.value,pe),vt!==null&&(te=C(vt,te,We),pt===null?$e=vt:pt.sibling=vt,pt=vt);return ot&&ro(oe,We),$e}for(Re=y(Re);!vt.done;We++,vt=ce.next())vt=he(Re,oe,We,vt.value,pe),vt!==null&&(o&&vt.alternate!==null&&Re.delete(vt.key===null?We:vt.key),te=C(vt,te,We),pt===null?$e=vt:pt.sibling=vt,pt=vt);return o&&Re.forEach(function(nV){return l(oe,nV)}),ot&&ro(oe,We),$e}function Nt(oe,te,ce,pe){if(typeof ce=="object"&&ce!==null&&ce.type===w&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case g:e:{for(var $e=ce.key;te!==null;){if(te.key===$e){if($e=ce.type,$e===w){if(te.tag===7){h(oe,te.sibling),pe=_(te,ce.props.children),pe.return=oe,oe=pe;break e}}else if(te.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===R&&Fl($e)===te.type){h(oe,te.sibling),pe=_(te,ce.props),Af(pe,ce),pe.return=oe,oe=pe;break e}h(oe,te);break}else l(oe,te);te=te.sibling}ce.type===w?(pe=zl(ce.props.children,oe.mode,pe,ce.key),pe.return=oe,oe=pe):(pe=Tp(ce.type,ce.key,ce.props,null,oe.mode,pe),Af(pe,ce),pe.return=oe,oe=pe)}return M(oe);case b:e:{for($e=ce.key;te!==null;){if(te.key===$e)if(te.tag===4&&te.stateNode.containerInfo===ce.containerInfo&&te.stateNode.implementation===ce.implementation){h(oe,te.sibling),pe=_(te,ce.children||[]),pe.return=oe,oe=pe;break e}else{h(oe,te);break}else l(oe,te);te=te.sibling}pe=Jx(ce,oe.mode,pe),pe.return=oe,oe=pe}return M(oe);case R:return ce=Fl(ce),Nt(oe,te,ce,pe)}if(Y(ce))return Ne(oe,te,ce,pe);if(I(ce)){if($e=I(ce),typeof $e!="function")throw Error(r(150));return ce=$e.call(ce),Ue(oe,te,ce,pe)}if(typeof ce.then=="function")return Nt(oe,te,Lp(ce),pe);if(ce.$$typeof===j)return Nt(oe,te,kp(oe,ce),pe);zp(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,te!==null&&te.tag===6?(h(oe,te.sibling),pe=_(te,ce),pe.return=oe,oe=pe):(h(oe,te),pe=Zx(ce,oe.mode,pe),pe.return=oe,oe=pe),M(oe)):h(oe,te)}return function(oe,te,ce,pe){try{Of=0;var $e=Nt(oe,te,ce,pe);return bu=null,$e}catch(Re){if(Re===xu||Re===Dp)throw Re;var pt=Zr(29,Re,null,oe.mode);return pt.lanes=pe,pt.return=oe,pt}finally{}}}var Kl=XN(!0),WN=XN(!1),gs=!1;function db(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fb(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function ys(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function xs(o,l,h){var y=o.updateQueue;if(y===null)return null;if(y=y.shared,(bt&2)!==0){var _=y.pending;return _===null?l.next=l:(l.next=_.next,_.next=l),y.pending=l,l=Np(o),kN(o,null,h),l}return Ap(o,y,l,h),Np(o)}function Nf(o,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194048)!==0)){var y=l.lanes;y&=o.pendingLanes,h|=y,l.lanes=h,sr(o,h)}}function hb(o,l){var h=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var _=null,C=null;if(h=h.firstBaseUpdate,h!==null){do{var M={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};C===null?_=C=M:C=C.next=M,h=h.next}while(h!==null);C===null?_=C=l:C=C.next=l}else _=C=l;h={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:C,shared:y.shared,callbacks:y.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=l:o.next=l,h.lastBaseUpdate=l}var mb=!1;function Tf(){if(mb){var o=yu;if(o!==null)throw o}}function Pf(o,l,h,y){mb=!1;var _=o.updateQueue;gs=!1;var C=_.firstBaseUpdate,M=_.lastBaseUpdate,U=_.shared.pending;if(U!==null){_.shared.pending=null;var Q=U,ue=Q.next;Q.next=null,M===null?C=ue:M.next=ue,M=Q;var me=o.alternate;me!==null&&(me=me.updateQueue,U=me.lastBaseUpdate,U!==M&&(U===null?me.firstBaseUpdate=ue:U.next=ue,me.lastBaseUpdate=Q))}if(C!==null){var ve=_.baseState;M=0,me=ue=Q=null,U=C;do{var de=U.lane&-536870913,he=de!==U.lane;if(he?(rt&de)===de:(y&de)===de){de!==0&&de===gu&&(mb=!0),me!==null&&(me=me.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ne=o,Ue=U;de=l;var Nt=h;switch(Ue.tag){case 1:if(Ne=Ue.payload,typeof Ne=="function"){ve=Ne.call(Nt,ve,de);break e}ve=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Ue.payload,de=typeof Ne=="function"?Ne.call(Nt,ve,de):Ne,de==null)break e;ve=f({},ve,de);break e;case 2:gs=!0}}de=U.callback,de!==null&&(o.flags|=64,he&&(o.flags|=8192),he=_.callbacks,he===null?_.callbacks=[de]:he.push(de))}else he={lane:de,tag:U.tag,payload:U.payload,callback:U.callback,next:null},me===null?(ue=me=he,Q=ve):me=me.next=he,M|=de;if(U=U.next,U===null){if(U=_.shared.pending,U===null)break;he=U,U=he.next,he.next=null,_.lastBaseUpdate=he,_.shared.pending=null}}while(!0);me===null&&(Q=ve),_.baseState=Q,_.firstBaseUpdate=ue,_.lastBaseUpdate=me,C===null&&(_.shared.lanes=0),_s|=M,o.lanes=M,o.memoizedState=ve}}function QN(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function ZN(o,l){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)QN(h[o],l)}var wu=B(null),$p=B(0);function JN(o,l){o=po,X($p,o),X(wu,l),po=o|l.baseLanes}function pb(){X($p,po),X(wu,wu.current)}function vb(){po=$p.current,$(wu),$($p)}var Jr=B(null),_a=null;function bs(o){var l=o.alternate;X(fn,fn.current&1),X(Jr,o),_a===null&&(l===null||wu.current!==null||l.memoizedState!==null)&&(_a=o)}function gb(o){X(fn,fn.current),X(Jr,o),_a===null&&(_a=o)}function eT(o){o.tag===22?(X(fn,fn.current),X(Jr,o),_a===null&&(_a=o)):ws()}function ws(){X(fn,fn.current),X(Jr,Jr.current)}function ea(o){$(Jr),_a===o&&(_a=null),$(fn)}var fn=B(0);function Bp(o){for(var l=o;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Ew(h)||_w(h)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var oo=0,Xe=null,Ot=null,bn=null,Up=!1,Su=!1,Vl=!1,Hp=0,Mf=0,Eu=null,V7=0;function en(){throw Error(r(321))}function yb(o,l){if(l===null)return!1;for(var h=0;h<l.length&&h<o.length;h++)if(!Qr(o[h],l[h]))return!1;return!0}function xb(o,l,h,y,_,C){return oo=C,Xe=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,k.H=o===null||o.memoizedState===null?LT:Rb,Vl=!1,C=h(y,_),Vl=!1,Su&&(C=nT(l,h,y,_)),tT(o),C}function tT(o){k.H=Df;var l=Ot!==null&&Ot.next!==null;if(oo=0,bn=Ot=Xe=null,Up=!1,Mf=0,Eu=null,l)throw Error(r(300));o===null||wn||(o=o.dependencies,o!==null&&Mp(o)&&(wn=!0))}function nT(o,l,h,y){Xe=o;var _=0;do{if(Su&&(Eu=null),Mf=0,Su=!1,25<=_)throw Error(r(301));if(_+=1,bn=Ot=null,o.updateQueue!=null){var C=o.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}k.H=zT,C=l(h,y)}while(Su);return C}function Y7(){var o=k.H,l=o.useState()[0];return l=typeof l.then=="function"?kf(l):l,o=o.useState()[0],(Ot!==null?Ot.memoizedState:null)!==o&&(Xe.flags|=1024),l}function bb(){var o=Hp!==0;return Hp=0,o}function wb(o,l,h){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~h}function Sb(o){if(Up){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Up=!1}oo=0,bn=Ot=Xe=null,Su=!1,Mf=Hp=0,Eu=null}function jr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bn===null?Xe.memoizedState=bn=o:bn=bn.next=o,bn}function hn(){if(Ot===null){var o=Xe.alternate;o=o!==null?o.memoizedState:null}else o=Ot.next;var l=bn===null?Xe.memoizedState:bn.next;if(l!==null)bn=l,Ot=o;else{if(o===null)throw Xe.alternate===null?Error(r(467)):Error(r(310));Ot=o,o={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},bn===null?Xe.memoizedState=bn=o:bn=bn.next=o}return bn}function Fp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function kf(o){var l=Mf;return Mf+=1,Eu===null&&(Eu=[]),o=VN(Eu,o,l),l=Xe,(bn===null?l.memoizedState:bn.next)===null&&(l=l.alternate,k.H=l===null||l.memoizedState===null?LT:Rb),o}function qp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return kf(o);if(o.$$typeof===j)return Zn(o)}throw Error(r(438,String(o)))}function Eb(o){var l=null,h=Xe.updateQueue;if(h!==null&&(l=h.memoCache),l==null){var y=Xe.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(l={data:y.data.map(function(_){return _.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),h===null&&(h=Fp(),Xe.updateQueue=h),h.memoCache=l,h=l.data[l.index],h===void 0)for(h=l.data[l.index]=Array(o),y=0;y<o;y++)h[y]=K;return l.index++,h}function so(o,l){return typeof l=="function"?l(o):l}function Kp(o){var l=hn();return _b(l,Ot,o)}function _b(o,l,h){var y=o.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=h;var _=o.baseQueue,C=y.pending;if(C!==null){if(_!==null){var M=_.next;_.next=C.next,C.next=M}l.baseQueue=_=C,y.pending=null}if(C=o.baseState,_===null)o.memoizedState=C;else{l=_.next;var U=M=null,Q=null,ue=l,me=!1;do{var ve=ue.lane&-536870913;if(ve!==ue.lane?(rt&ve)===ve:(oo&ve)===ve){var de=ue.revertLane;if(de===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),ve===gu&&(me=!0);else if((oo&de)===de){ue=ue.next,de===gu&&(me=!0);continue}else ve={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Q===null?(U=Q=ve,M=C):Q=Q.next=ve,Xe.lanes|=de,_s|=de;ve=ue.action,Vl&&h(C,ve),C=ue.hasEagerState?ue.eagerState:h(C,ve)}else de={lane:ve,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Q===null?(U=Q=de,M=C):Q=Q.next=de,Xe.lanes|=ve,_s|=ve;ue=ue.next}while(ue!==null&&ue!==l);if(Q===null?M=C:Q.next=U,!Qr(C,o.memoizedState)&&(wn=!0,me&&(h=yu,h!==null)))throw h;o.memoizedState=C,o.baseState=M,o.baseQueue=Q,y.lastRenderedState=C}return _===null&&(y.lanes=0),[o.memoizedState,y.dispatch]}function jb(o){var l=hn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var y=h.dispatch,_=h.pending,C=l.memoizedState;if(_!==null){h.pending=null;var M=_=_.next;do C=o(C,M.action),M=M.next;while(M!==_);Qr(C,l.memoizedState)||(wn=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),h.lastRenderedState=C}return[C,y]}function rT(o,l,h){var y=Xe,_=hn(),C=ot;if(C){if(h===void 0)throw Error(r(407));h=h()}else h=l();var M=!Qr((Ot||_).memoizedState,h);if(M&&(_.memoizedState=h,wn=!0),_=_.queue,Ab(oT.bind(null,y,_,o),[o]),_.getSnapshot!==l||M||bn!==null&&bn.memoizedState.tag&1){if(y.flags|=2048,_u(9,{destroy:void 0},iT.bind(null,y,_,h,l),null),Rt===null)throw Error(r(349));C||(oo&127)!==0||aT(y,l,h)}return h}function aT(o,l,h){o.flags|=16384,o={getSnapshot:l,value:h},l=Xe.updateQueue,l===null?(l=Fp(),Xe.updateQueue=l,l.stores=[o]):(h=l.stores,h===null?l.stores=[o]:h.push(o))}function iT(o,l,h,y){l.value=h,l.getSnapshot=y,sT(l)&&lT(o)}function oT(o,l,h){return h(function(){sT(l)&&lT(o)})}function sT(o){var l=o.getSnapshot;o=o.value;try{var h=l();return!Qr(o,h)}catch{return!0}}function lT(o){var l=Ll(o,2);l!==null&&Hr(l,o,2)}function Cb(o){var l=jr();if(typeof o=="function"){var h=o;if(o=h(),Vl){xt(!0);try{h()}finally{xt(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:o},l}function cT(o,l,h,y){return o.baseState=h,_b(o,Ot,typeof y=="function"?y:so)}function G7(o,l,h,y,_){if(Gp(o))throw Error(r(485));if(o=l.action,o!==null){var C={payload:_,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){C.listeners.push(M)}};k.T!==null?h(!0):C.isTransition=!1,y(C),h=l.pending,h===null?(C.next=l.pending=C,uT(l,C)):(C.next=h.next,l.pending=h.next=C)}}function uT(o,l){var h=l.action,y=l.payload,_=o.state;if(l.isTransition){var C=k.T,M={};k.T=M;try{var U=h(_,y),Q=k.S;Q!==null&&Q(M,U),dT(o,l,U)}catch(ue){Ob(o,l,ue)}finally{C!==null&&M.types!==null&&(C.types=M.types),k.T=C}}else try{C=h(_,y),dT(o,l,C)}catch(ue){Ob(o,l,ue)}}function dT(o,l,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){fT(o,l,y)},function(y){return Ob(o,l,y)}):fT(o,l,h)}function fT(o,l,h){l.status="fulfilled",l.value=h,hT(l),o.state=h,l=o.pending,l!==null&&(h=l.next,h===l?o.pending=null:(h=h.next,l.next=h,uT(o,h)))}function Ob(o,l,h){var y=o.pending;if(o.pending=null,y!==null){y=y.next;do l.status="rejected",l.reason=h,hT(l),l=l.next;while(l!==y)}o.action=null}function hT(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function mT(o,l){return l}function pT(o,l){if(ot){var h=Rt.formState;if(h!==null){e:{var y=Xe;if(ot){if(Bt){t:{for(var _=Bt,C=Ea;_.nodeType!==8;){if(!C){_=null;break t}if(_=ja(_.nextSibling),_===null){_=null;break t}}C=_.data,_=C==="F!"||C==="F"?_:null}if(_){Bt=ja(_.nextSibling),y=_.data==="F!";break e}}ps(y)}y=!1}y&&(l=h[0])}}return h=jr(),h.memoizedState=h.baseState=l,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mT,lastRenderedState:l},h.queue=y,h=RT.bind(null,Xe,y),y.dispatch=h,y=Cb(!1),C=kb.bind(null,Xe,!1,y.queue),y=jr(),_={state:l,dispatch:null,action:o,pending:null},y.queue=_,h=G7.bind(null,Xe,_,C,h),_.dispatch=h,y.memoizedState=o,[l,h,!1]}function vT(o){var l=hn();return gT(l,Ot,o)}function gT(o,l,h){if(l=_b(o,l,mT)[0],o=Kp(so)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var y=kf(l)}catch(M){throw M===xu?Dp:M}else y=l;l=hn();var _=l.queue,C=_.dispatch;return h!==l.memoizedState&&(Xe.flags|=2048,_u(9,{destroy:void 0},X7.bind(null,_,h),null)),[y,C,o]}function X7(o,l){o.action=l}function yT(o){var l=hn(),h=Ot;if(h!==null)return gT(l,h,o);hn(),l=l.memoizedState,h=hn();var y=h.queue.dispatch;return h.memoizedState=o,[l,y,!1]}function _u(o,l,h,y){return o={tag:o,create:h,deps:y,inst:l,next:null},l=Xe.updateQueue,l===null&&(l=Fp(),Xe.updateQueue=l),h=l.lastEffect,h===null?l.lastEffect=o.next=o:(y=h.next,h.next=o,o.next=y,l.lastEffect=o),o}function xT(){return hn().memoizedState}function Vp(o,l,h,y){var _=jr();Xe.flags|=o,_.memoizedState=_u(1|l,{destroy:void 0},h,y===void 0?null:y)}function Yp(o,l,h,y){var _=hn();y=y===void 0?null:y;var C=_.memoizedState.inst;Ot!==null&&y!==null&&yb(y,Ot.memoizedState.deps)?_.memoizedState=_u(l,C,h,y):(Xe.flags|=o,_.memoizedState=_u(1|l,C,h,y))}function bT(o,l){Vp(8390656,8,o,l)}function Ab(o,l){Yp(2048,8,o,l)}function W7(o){Xe.flags|=4;var l=Xe.updateQueue;if(l===null)l=Fp(),Xe.updateQueue=l,l.events=[o];else{var h=l.events;h===null?l.events=[o]:h.push(o)}}function wT(o){var l=hn().memoizedState;return W7({ref:l,nextImpl:o}),function(){if((bt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function ST(o,l){return Yp(4,2,o,l)}function ET(o,l){return Yp(4,4,o,l)}function _T(o,l){if(typeof l=="function"){o=o();var h=l(o);return function(){typeof h=="function"?h():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function jT(o,l,h){h=h!=null?h.concat([o]):null,Yp(4,4,_T.bind(null,l,o),h)}function Nb(){}function CT(o,l){var h=hn();l=l===void 0?null:l;var y=h.memoizedState;return l!==null&&yb(l,y[1])?y[0]:(h.memoizedState=[o,l],o)}function OT(o,l){var h=hn();l=l===void 0?null:l;var y=h.memoizedState;if(l!==null&&yb(l,y[1]))return y[0];if(y=o(),Vl){xt(!0);try{o()}finally{xt(!1)}}return h.memoizedState=[y,l],y}function Tb(o,l,h){return h===void 0||(oo&1073741824)!==0&&(rt&261930)===0?o.memoizedState=l:(o.memoizedState=h,o=A2(),Xe.lanes|=o,_s|=o,h)}function AT(o,l,h,y){return Qr(h,l)?h:wu.current!==null?(o=Tb(o,h,y),Qr(o,l)||(wn=!0),o):(oo&42)===0||(oo&1073741824)!==0&&(rt&261930)===0?(wn=!0,o.memoizedState=h):(o=A2(),Xe.lanes|=o,_s|=o,l)}function NT(o,l,h,y,_){var C=H.p;H.p=C!==0&&8>C?C:8;var M=k.T,U={};k.T=U,kb(o,!1,l,h);try{var Q=_(),ue=k.S;if(ue!==null&&ue(U,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var me=K7(Q,y);Rf(o,l,me,ra(o))}else Rf(o,l,y,ra(o))}catch(ve){Rf(o,l,{then:function(){},status:"rejected",reason:ve},ra())}finally{H.p=C,M!==null&&U.types!==null&&(M.types=U.types),k.T=M}}function Q7(){}function Pb(o,l,h,y){if(o.tag!==5)throw Error(r(476));var _=TT(o).queue;NT(o,_,l,q,h===null?Q7:function(){return PT(o),h(y)})}function TT(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:q},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:h},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function PT(o){var l=TT(o);l.next===null&&(l=o.alternate.memoizedState),Rf(o,l.next.queue,{},ra())}function Mb(){return Zn(Qf)}function MT(){return hn().memoizedState}function kT(){return hn().memoizedState}function Z7(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var h=ra();o=ys(h);var y=xs(l,o,h);y!==null&&(Hr(y,l,h),Nf(y,l,h)),l={cache:sb()},o.payload=l;return}l=l.return}}function J7(o,l,h){var y=ra();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Gp(o)?DT(l,h):(h=Wx(o,l,h,y),h!==null&&(Hr(h,o,y),IT(h,l,y)))}function RT(o,l,h){var y=ra();Rf(o,l,h,y)}function Rf(o,l,h,y){var _={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Gp(o))DT(l,_);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var M=l.lastRenderedState,U=C(M,h);if(_.hasEagerState=!0,_.eagerState=U,Qr(U,M))return Ap(o,l,_,0),Rt===null&&Op(),!1}catch{}finally{}if(h=Wx(o,l,_,y),h!==null)return Hr(h,o,y),IT(h,l,y),!0}return!1}function kb(o,l,h,y){if(y={lane:2,revertLane:dw(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},Gp(o)){if(l)throw Error(r(479))}else l=Wx(o,h,y,2),l!==null&&Hr(l,o,2)}function Gp(o){var l=o.alternate;return o===Xe||l!==null&&l===Xe}function DT(o,l){Su=Up=!0;var h=o.pending;h===null?l.next=l:(l.next=h.next,h.next=l),o.pending=l}function IT(o,l,h){if((h&4194048)!==0){var y=l.lanes;y&=o.pendingLanes,h|=y,l.lanes=h,sr(o,h)}}var Df={readContext:Zn,use:qp,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useLayoutEffect:en,useInsertionEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useSyncExternalStore:en,useId:en,useHostTransitionStatus:en,useFormState:en,useActionState:en,useOptimistic:en,useMemoCache:en,useCacheRefresh:en};Df.useEffectEvent=en;var LT={readContext:Zn,use:qp,useCallback:function(o,l){return jr().memoizedState=[o,l===void 0?null:l],o},useContext:Zn,useEffect:bT,useImperativeHandle:function(o,l,h){h=h!=null?h.concat([o]):null,Vp(4194308,4,_T.bind(null,l,o),h)},useLayoutEffect:function(o,l){return Vp(4194308,4,o,l)},useInsertionEffect:function(o,l){Vp(4,2,o,l)},useMemo:function(o,l){var h=jr();l=l===void 0?null:l;var y=o();if(Vl){xt(!0);try{o()}finally{xt(!1)}}return h.memoizedState=[y,l],y},useReducer:function(o,l,h){var y=jr();if(h!==void 0){var _=h(l);if(Vl){xt(!0);try{h(l)}finally{xt(!1)}}}else _=l;return y.memoizedState=y.baseState=_,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:_},y.queue=o,o=o.dispatch=J7.bind(null,Xe,o),[y.memoizedState,o]},useRef:function(o){var l=jr();return o={current:o},l.memoizedState=o},useState:function(o){o=Cb(o);var l=o.queue,h=RT.bind(null,Xe,l);return l.dispatch=h,[o.memoizedState,h]},useDebugValue:Nb,useDeferredValue:function(o,l){var h=jr();return Tb(h,o,l)},useTransition:function(){var o=Cb(!1);return o=NT.bind(null,Xe,o.queue,!0,!1),jr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,h){var y=Xe,_=jr();if(ot){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),Rt===null)throw Error(r(349));(rt&127)!==0||aT(y,l,h)}_.memoizedState=h;var C={value:h,getSnapshot:l};return _.queue=C,bT(oT.bind(null,y,C,o),[o]),y.flags|=2048,_u(9,{destroy:void 0},iT.bind(null,y,C,h,l),null),h},useId:function(){var o=jr(),l=Rt.identifierPrefix;if(ot){var h=xi,y=yi;h=(y&~(1<<32-ht(y)-1)).toString(32)+h,l="_"+l+"R_"+h,h=Hp++,0<h&&(l+="H"+h.toString(32)),l+="_"}else h=V7++,l="_"+l+"r_"+h.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:Mb,useFormState:pT,useActionState:pT,useOptimistic:function(o){var l=jr();l.memoizedState=l.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=h,l=kb.bind(null,Xe,!0,h),h.dispatch=l,[o,l]},useMemoCache:Eb,useCacheRefresh:function(){return jr().memoizedState=Z7.bind(null,Xe)},useEffectEvent:function(o){var l=jr(),h={impl:o};return l.memoizedState=h,function(){if((bt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Rb={readContext:Zn,use:qp,useCallback:CT,useContext:Zn,useEffect:Ab,useImperativeHandle:jT,useInsertionEffect:ST,useLayoutEffect:ET,useMemo:OT,useReducer:Kp,useRef:xT,useState:function(){return Kp(so)},useDebugValue:Nb,useDeferredValue:function(o,l){var h=hn();return AT(h,Ot.memoizedState,o,l)},useTransition:function(){var o=Kp(so)[0],l=hn().memoizedState;return[typeof o=="boolean"?o:kf(o),l]},useSyncExternalStore:rT,useId:MT,useHostTransitionStatus:Mb,useFormState:vT,useActionState:vT,useOptimistic:function(o,l){var h=hn();return cT(h,Ot,o,l)},useMemoCache:Eb,useCacheRefresh:kT};Rb.useEffectEvent=wT;var zT={readContext:Zn,use:qp,useCallback:CT,useContext:Zn,useEffect:Ab,useImperativeHandle:jT,useInsertionEffect:ST,useLayoutEffect:ET,useMemo:OT,useReducer:jb,useRef:xT,useState:function(){return jb(so)},useDebugValue:Nb,useDeferredValue:function(o,l){var h=hn();return Ot===null?Tb(h,o,l):AT(h,Ot.memoizedState,o,l)},useTransition:function(){var o=jb(so)[0],l=hn().memoizedState;return[typeof o=="boolean"?o:kf(o),l]},useSyncExternalStore:rT,useId:MT,useHostTransitionStatus:Mb,useFormState:yT,useActionState:yT,useOptimistic:function(o,l){var h=hn();return Ot!==null?cT(h,Ot,o,l):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:Eb,useCacheRefresh:kT};zT.useEffectEvent=wT;function Db(o,l,h,y){l=o.memoizedState,h=h(y,l),h=h==null?l:f({},l,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var Ib={enqueueSetState:function(o,l,h){o=o._reactInternals;var y=ra(),_=ys(y);_.payload=l,h!=null&&(_.callback=h),l=xs(o,_,y),l!==null&&(Hr(l,o,y),Nf(l,o,y))},enqueueReplaceState:function(o,l,h){o=o._reactInternals;var y=ra(),_=ys(y);_.tag=1,_.payload=l,h!=null&&(_.callback=h),l=xs(o,_,y),l!==null&&(Hr(l,o,y),Nf(l,o,y))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var h=ra(),y=ys(h);y.tag=2,l!=null&&(y.callback=l),l=xs(o,y,h),l!==null&&(Hr(l,o,h),Nf(l,o,h))}};function $T(o,l,h,y,_,C,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,C,M):l.prototype&&l.prototype.isPureReactComponent?!wf(h,y)||!wf(_,C):!0}function BT(o,l,h,y){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,y),l.state!==o&&Ib.enqueueReplaceState(l,l.state,null)}function Yl(o,l){var h=l;if("ref"in l){h={};for(var y in l)y!=="ref"&&(h[y]=l[y])}if(o=o.defaultProps){h===l&&(h=f({},h));for(var _ in o)h[_]===void 0&&(h[_]=o[_])}return h}function UT(o){Cp(o)}function HT(o){console.error(o)}function FT(o){Cp(o)}function Xp(o,l){try{var h=o.onUncaughtError;h(l.value,{componentStack:l.stack})}catch(y){setTimeout(function(){throw y})}}function qT(o,l,h){try{var y=o.onCaughtError;y(h.value,{componentStack:h.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Lb(o,l,h){return h=ys(h),h.tag=3,h.payload={element:null},h.callback=function(){Xp(o,l)},h}function KT(o){return o=ys(o),o.tag=3,o}function VT(o,l,h,y){var _=h.type.getDerivedStateFromError;if(typeof _=="function"){var C=y.value;o.payload=function(){return _(C)},o.callback=function(){qT(l,h,y)}}var M=h.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(o.callback=function(){qT(l,h,y),typeof _!="function"&&(js===null?js=new Set([this]):js.add(this));var U=y.stack;this.componentDidCatch(y.value,{componentStack:U!==null?U:""})})}function eK(o,l,h,y,_){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(l=h.alternate,l!==null&&vu(l,h,_,!0),h=Jr.current,h!==null){switch(h.tag){case 31:case 13:return _a===null?sv():h.alternate===null&&tn===0&&(tn=3),h.flags&=-257,h.flags|=65536,h.lanes=_,y===Ip?h.flags|=16384:(l=h.updateQueue,l===null?h.updateQueue=new Set([y]):l.add(y),lw(o,y,_)),!1;case 22:return h.flags|=65536,y===Ip?h.flags|=16384:(l=h.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([y])},h.updateQueue=l):(h=l.retryQueue,h===null?l.retryQueue=new Set([y]):h.add(y)),lw(o,y,_)),!1}throw Error(r(435,h.tag))}return lw(o,y,_),sv(),!1}if(ot)return l=Jr.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=_,y!==nb&&(o=Error(r(422),{cause:y}),_f(ba(o,h)))):(y!==nb&&(l=Error(r(423),{cause:y}),_f(ba(l,h))),o=o.current.alternate,o.flags|=65536,_&=-_,o.lanes|=_,y=ba(y,h),_=Lb(o.stateNode,y,_),hb(o,_),tn!==4&&(tn=2)),!1;var C=Error(r(520),{cause:y});if(C=ba(C,h),Ff===null?Ff=[C]:Ff.push(C),tn!==4&&(tn=2),l===null)return!0;y=ba(y,h),h=l;do{switch(h.tag){case 3:return h.flags|=65536,o=_&-_,h.lanes|=o,o=Lb(h.stateNode,y,o),hb(h,o),!1;case 1:if(l=h.type,C=h.stateNode,(h.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(js===null||!js.has(C))))return h.flags|=65536,_&=-_,h.lanes|=_,_=KT(_),VT(_,o,h,y),hb(h,_),!1}h=h.return}while(h!==null);return!1}var zb=Error(r(461)),wn=!1;function Jn(o,l,h,y){l.child=o===null?WN(l,null,h,y):Kl(l,o.child,h,y)}function YT(o,l,h,y,_){h=h.render;var C=l.ref;if("ref"in y){var M={};for(var U in y)U!=="ref"&&(M[U]=y[U])}else M=y;return Ul(l),y=xb(o,l,h,M,C,_),U=bb(),o!==null&&!wn?(wb(o,l,_),lo(o,l,_)):(ot&&U&&eb(l),l.flags|=1,Jn(o,l,y,_),l.child)}function GT(o,l,h,y,_){if(o===null){var C=h.type;return typeof C=="function"&&!Qx(C)&&C.defaultProps===void 0&&h.compare===null?(l.tag=15,l.type=C,XT(o,l,C,y,_)):(o=Tp(h.type,null,y,l,l.mode,_),o.ref=l.ref,o.return=l,l.child=o)}if(C=o.child,!Vb(o,_)){var M=C.memoizedProps;if(h=h.compare,h=h!==null?h:wf,h(M,y)&&o.ref===l.ref)return lo(o,l,_)}return l.flags|=1,o=no(C,y),o.ref=l.ref,o.return=l,l.child=o}function XT(o,l,h,y,_){if(o!==null){var C=o.memoizedProps;if(wf(C,y)&&o.ref===l.ref)if(wn=!1,l.pendingProps=y=C,Vb(o,_))(o.flags&131072)!==0&&(wn=!0);else return l.lanes=o.lanes,lo(o,l,_)}return $b(o,l,h,y,_)}function WT(o,l,h,y){var _=y.children,C=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((l.flags&128)!==0){if(C=C!==null?C.baseLanes|h:h,o!==null){for(y=l.child=o.child,_=0;y!==null;)_=_|y.lanes|y.childLanes,y=y.sibling;y=_&~C}else y=0,l.child=null;return QT(o,l,C,h,y)}if((h&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&Rp(l,C!==null?C.cachePool:null),C!==null?JN(l,C):pb(),eT(l);else return y=l.lanes=536870912,QT(o,l,C!==null?C.baseLanes|h:h,h,y)}else C!==null?(Rp(l,C.cachePool),JN(l,C),ws(),l.memoizedState=null):(o!==null&&Rp(l,null),pb(),ws());return Jn(o,l,_,h),l.child}function If(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function QT(o,l,h,y,_){var C=cb();return C=C===null?null:{parent:xn._currentValue,pool:C},l.memoizedState={baseLanes:h,cachePool:C},o!==null&&Rp(l,null),pb(),eT(l),o!==null&&vu(o,l,y,!0),l.childLanes=_,null}function Wp(o,l){return l=Zp({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function ZT(o,l,h){return Kl(l,o.child,null,h),o=Wp(l,l.pendingProps),o.flags|=2,ea(l),l.memoizedState=null,o}function tK(o,l,h){var y=l.pendingProps,_=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(ot){if(y.mode==="hidden")return o=Wp(l,y),l.lanes=536870912,If(null,o);if(gb(l),(o=Bt)?(o=uP(o,Ea),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:hs!==null?{id:yi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},h=DN(o),h.return=l,l.child=h,Qn=l,Bt=null)):o=null,o===null)throw ps(l);return l.lanes=536870912,null}return Wp(l,y)}var C=o.memoizedState;if(C!==null){var M=C.dehydrated;if(gb(l),_)if(l.flags&256)l.flags&=-257,l=ZT(o,l,h);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(wn||vu(o,l,h,!1),_=(h&o.childLanes)!==0,wn||_){if(y=Rt,y!==null&&(M=lr(y,h),M!==0&&M!==C.retryLane))throw C.retryLane=M,Ll(o,M),Hr(y,o,M),zb;sv(),l=ZT(o,l,h)}else o=C.treeContext,Bt=ja(M.nextSibling),Qn=l,ot=!0,ms=null,Ea=!1,o!==null&&zN(l,o),l=Wp(l,y),l.flags|=4096;return l}return o=no(o.child,{mode:y.mode,children:y.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Qp(o,l){var h=l.ref;if(h===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(l.flags|=4194816)}}function $b(o,l,h,y,_){return Ul(l),h=xb(o,l,h,y,void 0,_),y=bb(),o!==null&&!wn?(wb(o,l,_),lo(o,l,_)):(ot&&y&&eb(l),l.flags|=1,Jn(o,l,h,_),l.child)}function JT(o,l,h,y,_,C){return Ul(l),l.updateQueue=null,h=nT(l,y,h,_),tT(o),y=bb(),o!==null&&!wn?(wb(o,l,C),lo(o,l,C)):(ot&&y&&eb(l),l.flags|=1,Jn(o,l,h,C),l.child)}function e2(o,l,h,y,_){if(Ul(l),l.stateNode===null){var C=fu,M=h.contextType;typeof M=="object"&&M!==null&&(C=Zn(M)),C=new h(y,C),l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=Ib,l.stateNode=C,C._reactInternals=l,C=l.stateNode,C.props=y,C.state=l.memoizedState,C.refs={},db(l),M=h.contextType,C.context=typeof M=="object"&&M!==null?Zn(M):fu,C.state=l.memoizedState,M=h.getDerivedStateFromProps,typeof M=="function"&&(Db(l,h,M,y),C.state=l.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(M=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),M!==C.state&&Ib.enqueueReplaceState(C,C.state,null),Pf(l,y,C,_),Tf(),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308),y=!0}else if(o===null){C=l.stateNode;var U=l.memoizedProps,Q=Yl(h,U);C.props=Q;var ue=C.context,me=h.contextType;M=fu,typeof me=="object"&&me!==null&&(M=Zn(me));var ve=h.getDerivedStateFromProps;me=typeof ve=="function"||typeof C.getSnapshotBeforeUpdate=="function",U=l.pendingProps!==U,me||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(U||ue!==M)&&BT(l,C,y,M),gs=!1;var de=l.memoizedState;C.state=de,Pf(l,y,C,_),Tf(),ue=l.memoizedState,U||de!==ue||gs?(typeof ve=="function"&&(Db(l,h,ve,y),ue=l.memoizedState),(Q=gs||$T(l,h,Q,y,de,ue,M))?(me||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(l.flags|=4194308)):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=ue),C.props=y,C.state=ue,C.context=M,y=Q):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{C=l.stateNode,fb(o,l),M=l.memoizedProps,me=Yl(h,M),C.props=me,ve=l.pendingProps,de=C.context,ue=h.contextType,Q=fu,typeof ue=="object"&&ue!==null&&(Q=Zn(ue)),U=h.getDerivedStateFromProps,(ue=typeof U=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(M!==ve||de!==Q)&&BT(l,C,y,Q),gs=!1,de=l.memoizedState,C.state=de,Pf(l,y,C,_),Tf();var he=l.memoizedState;M!==ve||de!==he||gs||o!==null&&o.dependencies!==null&&Mp(o.dependencies)?(typeof U=="function"&&(Db(l,h,U,y),he=l.memoizedState),(me=gs||$T(l,h,me,y,de,he,Q)||o!==null&&o.dependencies!==null&&Mp(o.dependencies))?(ue||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(y,he,Q),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(y,he,Q)),typeof C.componentDidUpdate=="function"&&(l.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof C.componentDidUpdate!="function"||M===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=he),C.props=y,C.state=he,C.context=Q,y=me):(typeof C.componentDidUpdate!="function"||M===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),y=!1)}return C=y,Qp(o,l),y=(l.flags&128)!==0,C||y?(C=l.stateNode,h=y&&typeof h.getDerivedStateFromError!="function"?null:C.render(),l.flags|=1,o!==null&&y?(l.child=Kl(l,o.child,null,_),l.child=Kl(l,null,h,_)):Jn(o,l,h,_),l.memoizedState=C.state,o=l.child):o=lo(o,l,_),o}function t2(o,l,h,y){return $l(),l.flags|=256,Jn(o,l,h,y),l.child}var Bb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ub(o){return{baseLanes:o,cachePool:qN()}}function Hb(o,l,h){return o=o!==null?o.childLanes&~h:0,l&&(o|=na),o}function n2(o,l,h){var y=l.pendingProps,_=!1,C=(l.flags&128)!==0,M;if((M=C)||(M=o!==null&&o.memoizedState===null?!1:(fn.current&2)!==0),M&&(_=!0,l.flags&=-129),M=(l.flags&32)!==0,l.flags&=-33,o===null){if(ot){if(_?bs(l):ws(),(o=Bt)?(o=uP(o,Ea),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:hs!==null?{id:yi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},h=DN(o),h.return=l,l.child=h,Qn=l,Bt=null)):o=null,o===null)throw ps(l);return _w(o)?l.lanes=32:l.lanes=536870912,null}var U=y.children;return y=y.fallback,_?(ws(),_=l.mode,U=Zp({mode:"hidden",children:U},_),y=zl(y,_,h,null),U.return=l,y.return=l,U.sibling=y,l.child=U,y=l.child,y.memoizedState=Ub(h),y.childLanes=Hb(o,M,h),l.memoizedState=Bb,If(null,y)):(bs(l),Fb(l,U))}var Q=o.memoizedState;if(Q!==null&&(U=Q.dehydrated,U!==null)){if(C)l.flags&256?(bs(l),l.flags&=-257,l=qb(o,l,h)):l.memoizedState!==null?(ws(),l.child=o.child,l.flags|=128,l=null):(ws(),U=y.fallback,_=l.mode,y=Zp({mode:"visible",children:y.children},_),U=zl(U,_,h,null),U.flags|=2,y.return=l,U.return=l,y.sibling=U,l.child=y,Kl(l,o.child,null,h),y=l.child,y.memoizedState=Ub(h),y.childLanes=Hb(o,M,h),l.memoizedState=Bb,l=If(null,y));else if(bs(l),_w(U)){if(M=U.nextSibling&&U.nextSibling.dataset,M)var ue=M.dgst;M=ue,y=Error(r(419)),y.stack="",y.digest=M,_f({value:y,source:null,stack:null}),l=qb(o,l,h)}else if(wn||vu(o,l,h,!1),M=(h&o.childLanes)!==0,wn||M){if(M=Rt,M!==null&&(y=lr(M,h),y!==0&&y!==Q.retryLane))throw Q.retryLane=y,Ll(o,y),Hr(M,o,y),zb;Ew(U)||sv(),l=qb(o,l,h)}else Ew(U)?(l.flags|=192,l.child=o.child,l=null):(o=Q.treeContext,Bt=ja(U.nextSibling),Qn=l,ot=!0,ms=null,Ea=!1,o!==null&&zN(l,o),l=Fb(l,y.children),l.flags|=4096);return l}return _?(ws(),U=y.fallback,_=l.mode,Q=o.child,ue=Q.sibling,y=no(Q,{mode:"hidden",children:y.children}),y.subtreeFlags=Q.subtreeFlags&65011712,ue!==null?U=no(ue,U):(U=zl(U,_,h,null),U.flags|=2),U.return=l,y.return=l,y.sibling=U,l.child=y,If(null,y),y=l.child,U=o.child.memoizedState,U===null?U=Ub(h):(_=U.cachePool,_!==null?(Q=xn._currentValue,_=_.parent!==Q?{parent:Q,pool:Q}:_):_=qN(),U={baseLanes:U.baseLanes|h,cachePool:_}),y.memoizedState=U,y.childLanes=Hb(o,M,h),l.memoizedState=Bb,If(o.child,y)):(bs(l),h=o.child,o=h.sibling,h=no(h,{mode:"visible",children:y.children}),h.return=l,h.sibling=null,o!==null&&(M=l.deletions,M===null?(l.deletions=[o],l.flags|=16):M.push(o)),l.child=h,l.memoizedState=null,h)}function Fb(o,l){return l=Zp({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Zp(o,l){return o=Zr(22,o,null,l),o.lanes=0,o}function qb(o,l,h){return Kl(l,o.child,null,h),o=Fb(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function r2(o,l,h){o.lanes|=l;var y=o.alternate;y!==null&&(y.lanes|=l),ib(o.return,l,h)}function Kb(o,l,h,y,_,C){var M=o.memoizedState;M===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:_,treeForkCount:C}:(M.isBackwards=l,M.rendering=null,M.renderingStartTime=0,M.last=y,M.tail=h,M.tailMode=_,M.treeForkCount=C)}function a2(o,l,h){var y=l.pendingProps,_=y.revealOrder,C=y.tail;y=y.children;var M=fn.current,U=(M&2)!==0;if(U?(M=M&1|2,l.flags|=128):M&=1,X(fn,M),Jn(o,l,y,h),y=ot?Ef:0,!U&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&r2(o,h,l);else if(o.tag===19)r2(o,h,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(_){case"forwards":for(h=l.child,_=null;h!==null;)o=h.alternate,o!==null&&Bp(o)===null&&(_=h),h=h.sibling;h=_,h===null?(_=l.child,l.child=null):(_=h.sibling,h.sibling=null),Kb(l,!1,_,h,C,y);break;case"backwards":case"unstable_legacy-backwards":for(h=null,_=l.child,l.child=null;_!==null;){if(o=_.alternate,o!==null&&Bp(o)===null){l.child=_;break}o=_.sibling,_.sibling=h,h=_,_=o}Kb(l,!0,h,null,C,y);break;case"together":Kb(l,!1,null,null,void 0,y);break;default:l.memoizedState=null}return l.child}function lo(o,l,h){if(o!==null&&(l.dependencies=o.dependencies),_s|=l.lanes,(h&l.childLanes)===0)if(o!==null){if(vu(o,l,h,!1),(h&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,h=no(o,o.pendingProps),l.child=h,h.return=l;o.sibling!==null;)o=o.sibling,h=h.sibling=no(o,o.pendingProps),h.return=l;h.sibling=null}return l.child}function Vb(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&Mp(o)))}function nK(o,l,h){switch(l.tag){case 3:ae(l,l.stateNode.containerInfo),vs(l,xn,o.memoizedState.cache),$l();break;case 27:case 5:re(l);break;case 4:ae(l,l.stateNode.containerInfo);break;case 10:vs(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,gb(l),null;break;case 13:var y=l.memoizedState;if(y!==null)return y.dehydrated!==null?(bs(l),l.flags|=128,null):(h&l.child.childLanes)!==0?n2(o,l,h):(bs(l),o=lo(o,l,h),o!==null?o.sibling:null);bs(l);break;case 19:var _=(o.flags&128)!==0;if(y=(h&l.childLanes)!==0,y||(vu(o,l,h,!1),y=(h&l.childLanes)!==0),_){if(y)return a2(o,l,h);l.flags|=128}if(_=l.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),X(fn,fn.current),y)break;return null;case 22:return l.lanes=0,WT(o,l,h,l.pendingProps);case 24:vs(l,xn,o.memoizedState.cache)}return lo(o,l,h)}function i2(o,l,h){if(o!==null)if(o.memoizedProps!==l.pendingProps)wn=!0;else{if(!Vb(o,h)&&(l.flags&128)===0)return wn=!1,nK(o,l,h);wn=(o.flags&131072)!==0}else wn=!1,ot&&(l.flags&1048576)!==0&&LN(l,Ef,l.index);switch(l.lanes=0,l.tag){case 16:e:{var y=l.pendingProps;if(o=Fl(l.elementType),l.type=o,typeof o=="function")Qx(o)?(y=Yl(o,y),l.tag=1,l=e2(null,l,o,y,h)):(l.tag=0,l=$b(null,l,o,y,h));else{if(o!=null){var _=o.$$typeof;if(_===A){l.tag=11,l=YT(null,l,o,y,h);break e}else if(_===P){l.tag=14,l=GT(null,l,o,y,h);break e}}throw l=L(o)||o,Error(r(306,l,""))}}return l;case 0:return $b(o,l,l.type,l.pendingProps,h);case 1:return y=l.type,_=Yl(y,l.pendingProps),e2(o,l,y,_,h);case 3:e:{if(ae(l,l.stateNode.containerInfo),o===null)throw Error(r(387));y=l.pendingProps;var C=l.memoizedState;_=C.element,fb(o,l),Pf(l,y,null,h);var M=l.memoizedState;if(y=M.cache,vs(l,xn,y),y!==C.cache&&ob(l,[xn],h,!0),Tf(),y=M.element,C.isDehydrated)if(C={element:y,isDehydrated:!1,cache:M.cache},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){l=t2(o,l,y,h);break e}else if(y!==_){_=ba(Error(r(424)),l),_f(_),l=t2(o,l,y,h);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Bt=ja(o.firstChild),Qn=l,ot=!0,ms=null,Ea=!0,h=WN(l,null,y,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if($l(),y===_){l=lo(o,l,h);break e}Jn(o,l,y,h)}l=l.child}return l;case 26:return Qp(o,l),o===null?(h=vP(l.type,null,l.pendingProps,null))?l.memoizedState=h:ot||(h=l.type,o=l.pendingProps,y=mv(le.current).createElement(h),y[An]=l,y[cr]=o,er(y,h,o),yn(y),l.stateNode=y):l.memoizedState=vP(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return re(l),o===null&&ot&&(y=l.stateNode=hP(l.type,l.pendingProps,le.current),Qn=l,Ea=!0,_=Bt,Ns(l.type)?(jw=_,Bt=ja(y.firstChild)):Bt=_),Jn(o,l,l.pendingProps.children,h),Qp(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&ot&&((_=y=Bt)&&(y=MK(y,l.type,l.pendingProps,Ea),y!==null?(l.stateNode=y,Qn=l,Bt=ja(y.firstChild),Ea=!1,_=!0):_=!1),_||ps(l)),re(l),_=l.type,C=l.pendingProps,M=o!==null?o.memoizedProps:null,y=C.children,bw(_,C)?y=null:M!==null&&bw(_,M)&&(l.flags|=32),l.memoizedState!==null&&(_=xb(o,l,Y7,null,null,h),Qf._currentValue=_),Qp(o,l),Jn(o,l,y,h),l.child;case 6:return o===null&&ot&&((o=h=Bt)&&(h=kK(h,l.pendingProps,Ea),h!==null?(l.stateNode=h,Qn=l,Bt=null,o=!0):o=!1),o||ps(l)),null;case 13:return n2(o,l,h);case 4:return ae(l,l.stateNode.containerInfo),y=l.pendingProps,o===null?l.child=Kl(l,null,y,h):Jn(o,l,y,h),l.child;case 11:return YT(o,l,l.type,l.pendingProps,h);case 7:return Jn(o,l,l.pendingProps,h),l.child;case 8:return Jn(o,l,l.pendingProps.children,h),l.child;case 12:return Jn(o,l,l.pendingProps.children,h),l.child;case 10:return y=l.pendingProps,vs(l,l.type,y.value),Jn(o,l,y.children,h),l.child;case 9:return _=l.type._context,y=l.pendingProps.children,Ul(l),_=Zn(_),y=y(_),l.flags|=1,Jn(o,l,y,h),l.child;case 14:return GT(o,l,l.type,l.pendingProps,h);case 15:return XT(o,l,l.type,l.pendingProps,h);case 19:return a2(o,l,h);case 31:return tK(o,l,h);case 22:return WT(o,l,h,l.pendingProps);case 24:return Ul(l),y=Zn(xn),o===null?(_=cb(),_===null&&(_=Rt,C=sb(),_.pooledCache=C,C.refCount++,C!==null&&(_.pooledCacheLanes|=h),_=C),l.memoizedState={parent:y,cache:_},db(l),vs(l,xn,_)):((o.lanes&h)!==0&&(fb(o,l),Pf(l,null,null,h),Tf()),_=o.memoizedState,C=l.memoizedState,_.parent!==y?(_={parent:y,cache:y},l.memoizedState=_,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=_),vs(l,xn,y)):(y=C.cache,vs(l,xn,y),y!==_.cache&&ob(l,[xn],h,!0))),Jn(o,l,l.pendingProps.children,h),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function co(o){o.flags|=4}function Yb(o,l,h,y,_){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(_&335544128)===_)if(o.stateNode.complete)o.flags|=8192;else if(M2())o.flags|=8192;else throw ql=Ip,ub}else o.flags&=-16777217}function o2(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!wP(l))if(M2())o.flags|=8192;else throw ql=Ip,ub}function Jp(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Hn():536870912,o.lanes|=l,Au|=l)}function Lf(o,l){if(!ot)switch(o.tailMode){case"hidden":l=o.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function Ut(o){var l=o.alternate!==null&&o.alternate.child===o.child,h=0,y=0;if(l)for(var _=o.child;_!==null;)h|=_.lanes|_.childLanes,y|=_.subtreeFlags&65011712,y|=_.flags&65011712,_.return=o,_=_.sibling;else for(_=o.child;_!==null;)h|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=o,_=_.sibling;return o.subtreeFlags|=y,o.childLanes=h,l}function rK(o,l,h){var y=l.pendingProps;switch(tb(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(l),null;case 1:return Ut(l),null;case 3:return h=l.stateNode,y=null,o!==null&&(y=o.memoizedState.cache),l.memoizedState.cache!==y&&(l.flags|=2048),io(xn),J(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(pu(l)?co(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,rb())),Ut(l),null;case 26:var _=l.type,C=l.memoizedState;return o===null?(co(l),C!==null?(Ut(l),o2(l,C)):(Ut(l),Yb(l,_,null,y,h))):C?C!==o.memoizedState?(co(l),Ut(l),o2(l,C)):(Ut(l),l.flags&=-16777217):(o=o.memoizedProps,o!==y&&co(l),Ut(l),Yb(l,_,o,y,h)),null;case 27:if(fe(l),h=le.current,_=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==y&&co(l);else{if(!y){if(l.stateNode===null)throw Error(r(166));return Ut(l),null}o=Z.current,pu(l)?$N(l):(o=hP(_,y,h),l.stateNode=o,co(l))}return Ut(l),null;case 5:if(fe(l),_=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==y&&co(l);else{if(!y){if(l.stateNode===null)throw Error(r(166));return Ut(l),null}if(C=Z.current,pu(l))$N(l);else{var M=mv(le.current);switch(C){case 1:C=M.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:C=M.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":C=M.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":C=M.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":C=M.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof y.is=="string"?M.createElement("select",{is:y.is}):M.createElement("select"),y.multiple?C.multiple=!0:y.size&&(C.size=y.size);break;default:C=typeof y.is=="string"?M.createElement(_,{is:y.is}):M.createElement(_)}}C[An]=l,C[cr]=y;e:for(M=l.child;M!==null;){if(M.tag===5||M.tag===6)C.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===l)break e;for(;M.sibling===null;){if(M.return===null||M.return===l)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}l.stateNode=C;e:switch(er(C,_,y),_){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&co(l)}}return Ut(l),Yb(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,h),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==y&&co(l);else{if(typeof y!="string"&&l.stateNode===null)throw Error(r(166));if(o=le.current,pu(l)){if(o=l.stateNode,h=l.memoizedProps,y=null,_=Qn,_!==null)switch(_.tag){case 27:case 5:y=_.memoizedProps}o[An]=l,o=!!(o.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||nP(o.nodeValue,h)),o||ps(l,!0)}else o=mv(o).createTextNode(y),o[An]=l,l.stateNode=o}return Ut(l),null;case 31:if(h=l.memoizedState,o===null||o.memoizedState!==null){if(y=pu(l),h!==null){if(o===null){if(!y)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[An]=l}else $l(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ut(l),o=!1}else h=rb(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return l.flags&256?(ea(l),l):(ea(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Ut(l),null;case 13:if(y=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(_=pu(l),y!==null&&y.dehydrated!==null){if(o===null){if(!_)throw Error(r(318));if(_=l.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[An]=l}else $l(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ut(l),_=!1}else _=rb(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=_),_=!0;if(!_)return l.flags&256?(ea(l),l):(ea(l),null)}return ea(l),(l.flags&128)!==0?(l.lanes=h,l):(h=y!==null,o=o!==null&&o.memoizedState!==null,h&&(y=l.child,_=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(_=y.alternate.memoizedState.cachePool.pool),C=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(C=y.memoizedState.cachePool.pool),C!==_&&(y.flags|=2048)),h!==o&&h&&(l.child.flags|=8192),Jp(l,l.updateQueue),Ut(l),null);case 4:return J(),o===null&&pw(l.stateNode.containerInfo),Ut(l),null;case 10:return io(l.type),Ut(l),null;case 19:if($(fn),y=l.memoizedState,y===null)return Ut(l),null;if(_=(l.flags&128)!==0,C=y.rendering,C===null)if(_)Lf(y,!1);else{if(tn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(C=Bp(o),C!==null){for(l.flags|=128,Lf(y,!1),o=C.updateQueue,l.updateQueue=o,Jp(l,o),l.subtreeFlags=0,o=h,h=l.child;h!==null;)RN(h,o),h=h.sibling;return X(fn,fn.current&1|2),ot&&ro(l,y.treeForkCount),l.child}o=o.sibling}y.tail!==null&&It()>av&&(l.flags|=128,_=!0,Lf(y,!1),l.lanes=4194304)}else{if(!_)if(o=Bp(C),o!==null){if(l.flags|=128,_=!0,o=o.updateQueue,l.updateQueue=o,Jp(l,o),Lf(y,!0),y.tail===null&&y.tailMode==="hidden"&&!C.alternate&&!ot)return Ut(l),null}else 2*It()-y.renderingStartTime>av&&h!==536870912&&(l.flags|=128,_=!0,Lf(y,!1),l.lanes=4194304);y.isBackwards?(C.sibling=l.child,l.child=C):(o=y.last,o!==null?o.sibling=C:l.child=C,y.last=C)}return y.tail!==null?(o=y.tail,y.rendering=o,y.tail=o.sibling,y.renderingStartTime=It(),o.sibling=null,h=fn.current,X(fn,_?h&1|2:h&1),ot&&ro(l,y.treeForkCount),o):(Ut(l),null);case 22:case 23:return ea(l),vb(),y=l.memoizedState!==null,o!==null?o.memoizedState!==null!==y&&(l.flags|=8192):y&&(l.flags|=8192),y?(h&536870912)!==0&&(l.flags&128)===0&&(Ut(l),l.subtreeFlags&6&&(l.flags|=8192)):Ut(l),h=l.updateQueue,h!==null&&Jp(l,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),y=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(y=l.memoizedState.cachePool.pool),y!==h&&(l.flags|=2048),o!==null&&$(Hl),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),io(xn),Ut(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function aK(o,l){switch(tb(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return io(xn),J(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return fe(l),null;case 31:if(l.memoizedState!==null){if(ea(l),l.alternate===null)throw Error(r(340));$l()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(ea(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));$l()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return $(fn),null;case 4:return J(),null;case 10:return io(l.type),null;case 22:case 23:return ea(l),vb(),o!==null&&$(Hl),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return io(xn),null;case 25:return null;default:return null}}function s2(o,l){switch(tb(l),l.tag){case 3:io(xn),J();break;case 26:case 27:case 5:fe(l);break;case 4:J();break;case 31:l.memoizedState!==null&&ea(l);break;case 13:ea(l);break;case 19:$(fn);break;case 10:io(l.type);break;case 22:case 23:ea(l),vb(),o!==null&&$(Hl);break;case 24:io(xn)}}function zf(o,l){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var _=y.next;h=_;do{if((h.tag&o)===o){y=void 0;var C=h.create,M=h.inst;y=C(),M.destroy=y}h=h.next}while(h!==_)}}catch(U){jt(l,l.return,U)}}function Ss(o,l,h){try{var y=l.updateQueue,_=y!==null?y.lastEffect:null;if(_!==null){var C=_.next;y=C;do{if((y.tag&o)===o){var M=y.inst,U=M.destroy;if(U!==void 0){M.destroy=void 0,_=l;var Q=h,ue=U;try{ue()}catch(me){jt(_,Q,me)}}}y=y.next}while(y!==C)}}catch(me){jt(l,l.return,me)}}function l2(o){var l=o.updateQueue;if(l!==null){var h=o.stateNode;try{ZN(l,h)}catch(y){jt(o,o.return,y)}}}function c2(o,l,h){h.props=Yl(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(y){jt(o,l,y)}}function $f(o,l){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var y=o.stateNode;break;case 30:y=o.stateNode;break;default:y=o.stateNode}typeof h=="function"?o.refCleanup=h(y):h.current=y}}catch(_){jt(o,l,_)}}function bi(o,l){var h=o.ref,y=o.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(_){jt(o,l,_)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(_){jt(o,l,_)}else h.current=null}function u2(o){var l=o.type,h=o.memoizedProps,y=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":h.autoFocus&&y.focus();break e;case"img":h.src?y.src=h.src:h.srcSet&&(y.srcset=h.srcSet)}}catch(_){jt(o,o.return,_)}}function Gb(o,l,h){try{var y=o.stateNode;CK(y,o.type,h,l),y[cr]=l}catch(_){jt(o,o.return,_)}}function d2(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Ns(o.type)||o.tag===4}function Xb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||d2(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Ns(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Wb(o,l,h){var y=o.tag;if(y===5||y===6)o=o.stateNode,l?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,l):(l=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,l.appendChild(o),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=eo));else if(y!==4&&(y===27&&Ns(o.type)&&(h=o.stateNode,l=null),o=o.child,o!==null))for(Wb(o,l,h),o=o.sibling;o!==null;)Wb(o,l,h),o=o.sibling}function ev(o,l,h){var y=o.tag;if(y===5||y===6)o=o.stateNode,l?h.insertBefore(o,l):h.appendChild(o);else if(y!==4&&(y===27&&Ns(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(ev(o,l,h),o=o.sibling;o!==null;)ev(o,l,h),o=o.sibling}function f2(o){var l=o.stateNode,h=o.memoizedProps;try{for(var y=o.type,_=l.attributes;_.length;)l.removeAttributeNode(_[0]);er(l,y,h),l[An]=o,l[cr]=h}catch(C){jt(o,o.return,C)}}var uo=!1,Sn=!1,Qb=!1,h2=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function iK(o,l){if(o=o.containerInfo,yw=wv,o=jN(o),qx(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var _=y.anchorOffset,C=y.focusNode;y=y.focusOffset;try{h.nodeType,C.nodeType}catch{h=null;break e}var M=0,U=-1,Q=-1,ue=0,me=0,ve=o,de=null;t:for(;;){for(var he;ve!==h||_!==0&&ve.nodeType!==3||(U=M+_),ve!==C||y!==0&&ve.nodeType!==3||(Q=M+y),ve.nodeType===3&&(M+=ve.nodeValue.length),(he=ve.firstChild)!==null;)de=ve,ve=he;for(;;){if(ve===o)break t;if(de===h&&++ue===_&&(U=M),de===C&&++me===y&&(Q=M),(he=ve.nextSibling)!==null)break;ve=de,de=ve.parentNode}ve=he}h=U===-1||Q===-1?null:{start:U,end:Q}}else h=null}h=h||{start:0,end:0}}else h=null;for(xw={focusedElem:o,selectionRange:h},wv=!1,Fn=l;Fn!==null;)if(l=Fn,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Fn=o;else for(;Fn!==null;){switch(l=Fn,C=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)_=o[h],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&C!==null){o=void 0,h=l,_=C.memoizedProps,C=C.memoizedState,y=h.stateNode;try{var Ne=Yl(h.type,_);o=y.getSnapshotBeforeUpdate(Ne,C),y.__reactInternalSnapshotBeforeUpdate=o}catch(Ue){jt(h,h.return,Ue)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,h=o.nodeType,h===9)Sw(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Sw(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Fn=o;break}Fn=l.return}}function m2(o,l,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:ho(o,h),y&4&&zf(5,h);break;case 1:if(ho(o,h),y&4)if(o=h.stateNode,l===null)try{o.componentDidMount()}catch(M){jt(h,h.return,M)}else{var _=Yl(h.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(_,l,o.__reactInternalSnapshotBeforeUpdate)}catch(M){jt(h,h.return,M)}}y&64&&l2(h),y&512&&$f(h,h.return);break;case 3:if(ho(o,h),y&64&&(o=h.updateQueue,o!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=h.child.stateNode;break;case 1:l=h.child.stateNode}try{ZN(o,l)}catch(M){jt(h,h.return,M)}}break;case 27:l===null&&y&4&&f2(h);case 26:case 5:ho(o,h),l===null&&y&4&&u2(h),y&512&&$f(h,h.return);break;case 12:ho(o,h);break;case 31:ho(o,h),y&4&&g2(o,h);break;case 13:ho(o,h),y&4&&y2(o,h),y&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=mK.bind(null,h),RK(o,h))));break;case 22:if(y=h.memoizedState!==null||uo,!y){l=l!==null&&l.memoizedState!==null||Sn,_=uo;var C=Sn;uo=y,(Sn=l)&&!C?mo(o,h,(h.subtreeFlags&8772)!==0):ho(o,h),uo=_,Sn=C}break;case 30:break;default:ho(o,h)}}function p2(o){var l=o.alternate;l!==null&&(o.alternate=null,p2(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&df(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Kt=null,zr=!1;function fo(o,l,h){for(h=h.child;h!==null;)v2(o,l,h),h=h.sibling}function v2(o,l,h){if(we&&typeof we.onCommitFiberUnmount=="function")try{we.onCommitFiberUnmount(kr,h)}catch{}switch(h.tag){case 26:Sn||bi(h,l),fo(o,l,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Sn||bi(h,l);var y=Kt,_=zr;Ns(h.type)&&(Kt=h.stateNode,zr=!1),fo(o,l,h),Gf(h.stateNode),Kt=y,zr=_;break;case 5:Sn||bi(h,l);case 6:if(y=Kt,_=zr,Kt=null,fo(o,l,h),Kt=y,zr=_,Kt!==null)if(zr)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(h.stateNode)}catch(C){jt(h,l,C)}else try{Kt.removeChild(h.stateNode)}catch(C){jt(h,l,C)}break;case 18:Kt!==null&&(zr?(o=Kt,lP(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),Iu(o)):lP(Kt,h.stateNode));break;case 4:y=Kt,_=zr,Kt=h.stateNode.containerInfo,zr=!0,fo(o,l,h),Kt=y,zr=_;break;case 0:case 11:case 14:case 15:Ss(2,h,l),Sn||Ss(4,h,l),fo(o,l,h);break;case 1:Sn||(bi(h,l),y=h.stateNode,typeof y.componentWillUnmount=="function"&&c2(h,l,y)),fo(o,l,h);break;case 21:fo(o,l,h);break;case 22:Sn=(y=Sn)||h.memoizedState!==null,fo(o,l,h),Sn=y;break;default:fo(o,l,h)}}function g2(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Iu(o)}catch(h){jt(l,l.return,h)}}}function y2(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Iu(o)}catch(h){jt(l,l.return,h)}}function oK(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new h2),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new h2),l;default:throw Error(r(435,o.tag))}}function tv(o,l){var h=oK(o);l.forEach(function(y){if(!h.has(y)){h.add(y);var _=pK.bind(null,o,y);y.then(_,_)}})}function $r(o,l){var h=l.deletions;if(h!==null)for(var y=0;y<h.length;y++){var _=h[y],C=o,M=l,U=M;e:for(;U!==null;){switch(U.tag){case 27:if(Ns(U.type)){Kt=U.stateNode,zr=!1;break e}break;case 5:Kt=U.stateNode,zr=!1;break e;case 3:case 4:Kt=U.stateNode.containerInfo,zr=!0;break e}U=U.return}if(Kt===null)throw Error(r(160));v2(C,M,_),Kt=null,zr=!1,C=_.alternate,C!==null&&(C.return=null),_.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)x2(l,o),l=l.sibling}var Ka=null;function x2(o,l){var h=o.alternate,y=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:$r(l,o),Br(o),y&4&&(Ss(3,o,o.return),zf(3,o),Ss(5,o,o.return));break;case 1:$r(l,o),Br(o),y&512&&(Sn||h===null||bi(h,h.return)),y&64&&uo&&(o=o.updateQueue,o!==null&&(y=o.callbacks,y!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?y:h.concat(y))));break;case 26:var _=Ka;if($r(l,o),Br(o),y&512&&(Sn||h===null||bi(h,h.return)),y&4){var C=h!==null?h.memoizedState:null;if(y=o.memoizedState,h===null)if(y===null)if(o.stateNode===null){e:{y=o.type,h=o.memoizedProps,_=_.ownerDocument||_;t:switch(y){case"title":C=_.getElementsByTagName("title")[0],(!C||C[Pl]||C[An]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=_.createElement(y),_.head.insertBefore(C,_.querySelector("head > title"))),er(C,y,h),C[An]=o,yn(C),y=C;break e;case"link":var M=xP("link","href",_).get(y+(h.href||""));if(M){for(var U=0;U<M.length;U++)if(C=M[U],C.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&C.getAttribute("rel")===(h.rel==null?null:h.rel)&&C.getAttribute("title")===(h.title==null?null:h.title)&&C.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){M.splice(U,1);break t}}C=_.createElement(y),er(C,y,h),_.head.appendChild(C);break;case"meta":if(M=xP("meta","content",_).get(y+(h.content||""))){for(U=0;U<M.length;U++)if(C=M[U],C.getAttribute("content")===(h.content==null?null:""+h.content)&&C.getAttribute("name")===(h.name==null?null:h.name)&&C.getAttribute("property")===(h.property==null?null:h.property)&&C.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&C.getAttribute("charset")===(h.charSet==null?null:h.charSet)){M.splice(U,1);break t}}C=_.createElement(y),er(C,y,h),_.head.appendChild(C);break;default:throw Error(r(468,y))}C[An]=o,yn(C),y=C}o.stateNode=y}else bP(_,o.type,o.stateNode);else o.stateNode=yP(_,y,o.memoizedProps);else C!==y?(C===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):C.count--,y===null?bP(_,o.type,o.stateNode):yP(_,y,o.memoizedProps)):y===null&&o.stateNode!==null&&Gb(o,o.memoizedProps,h.memoizedProps)}break;case 27:$r(l,o),Br(o),y&512&&(Sn||h===null||bi(h,h.return)),h!==null&&y&4&&Gb(o,o.memoizedProps,h.memoizedProps);break;case 5:if($r(l,o),Br(o),y&512&&(Sn||h===null||bi(h,h.return)),o.flags&32){_=o.stateNode;try{iu(_,"")}catch(Ne){jt(o,o.return,Ne)}}y&4&&o.stateNode!=null&&(_=o.memoizedProps,Gb(o,_,h!==null?h.memoizedProps:_)),y&1024&&(Qb=!0);break;case 6:if($r(l,o),Br(o),y&4){if(o.stateNode===null)throw Error(r(162));y=o.memoizedProps,h=o.stateNode;try{h.nodeValue=y}catch(Ne){jt(o,o.return,Ne)}}break;case 3:if(gv=null,_=Ka,Ka=pv(l.containerInfo),$r(l,o),Ka=_,Br(o),y&4&&h!==null&&h.memoizedState.isDehydrated)try{Iu(l.containerInfo)}catch(Ne){jt(o,o.return,Ne)}Qb&&(Qb=!1,b2(o));break;case 4:y=Ka,Ka=pv(o.stateNode.containerInfo),$r(l,o),Br(o),Ka=y;break;case 12:$r(l,o),Br(o);break;case 31:$r(l,o),Br(o),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,tv(o,y)));break;case 13:$r(l,o),Br(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(rv=It()),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,tv(o,y)));break;case 22:_=o.memoizedState!==null;var Q=h!==null&&h.memoizedState!==null,ue=uo,me=Sn;if(uo=ue||_,Sn=me||Q,$r(l,o),Sn=me,uo=ue,Br(o),y&8192)e:for(l=o.stateNode,l._visibility=_?l._visibility&-2:l._visibility|1,_&&(h===null||Q||uo||Sn||Gl(o)),h=null,l=o;;){if(l.tag===5||l.tag===26){if(h===null){Q=h=l;try{if(C=Q.stateNode,_)M=C.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{U=Q.stateNode;var ve=Q.memoizedProps.style,de=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;U.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Ne){jt(Q,Q.return,Ne)}}}else if(l.tag===6){if(h===null){Q=l;try{Q.stateNode.nodeValue=_?"":Q.memoizedProps}catch(Ne){jt(Q,Q.return,Ne)}}}else if(l.tag===18){if(h===null){Q=l;try{var he=Q.stateNode;_?cP(he,!0):cP(Q.stateNode,!1)}catch(Ne){jt(Q,Q.return,Ne)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;h===l&&(h=null),l=l.return}h===l&&(h=null),l.sibling.return=l.return,l=l.sibling}y&4&&(y=o.updateQueue,y!==null&&(h=y.retryQueue,h!==null&&(y.retryQueue=null,tv(o,h))));break;case 19:$r(l,o),Br(o),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,tv(o,y)));break;case 30:break;case 21:break;default:$r(l,o),Br(o)}}function Br(o){var l=o.flags;if(l&2){try{for(var h,y=o.return;y!==null;){if(d2(y)){h=y;break}y=y.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var _=h.stateNode,C=Xb(o);ev(o,C,_);break;case 5:var M=h.stateNode;h.flags&32&&(iu(M,""),h.flags&=-33);var U=Xb(o);ev(o,U,M);break;case 3:case 4:var Q=h.stateNode.containerInfo,ue=Xb(o);Wb(o,ue,Q);break;default:throw Error(r(161))}}catch(me){jt(o,o.return,me)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function b2(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;b2(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function ho(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)m2(o,l.alternate,l),l=l.sibling}function Gl(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Ss(4,l,l.return),Gl(l);break;case 1:bi(l,l.return);var h=l.stateNode;typeof h.componentWillUnmount=="function"&&c2(l,l.return,h),Gl(l);break;case 27:Gf(l.stateNode);case 26:case 5:bi(l,l.return),Gl(l);break;case 22:l.memoizedState===null&&Gl(l);break;case 30:Gl(l);break;default:Gl(l)}o=o.sibling}}function mo(o,l,h){for(h=h&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var y=l.alternate,_=o,C=l,M=C.flags;switch(C.tag){case 0:case 11:case 15:mo(_,C,h),zf(4,C);break;case 1:if(mo(_,C,h),y=C,_=y.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(ue){jt(y,y.return,ue)}if(y=C,_=y.updateQueue,_!==null){var U=y.stateNode;try{var Q=_.shared.hiddenCallbacks;if(Q!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Q.length;_++)QN(Q[_],U)}catch(ue){jt(y,y.return,ue)}}h&&M&64&&l2(C),$f(C,C.return);break;case 27:f2(C);case 26:case 5:mo(_,C,h),h&&y===null&&M&4&&u2(C),$f(C,C.return);break;case 12:mo(_,C,h);break;case 31:mo(_,C,h),h&&M&4&&g2(_,C);break;case 13:mo(_,C,h),h&&M&4&&y2(_,C);break;case 22:C.memoizedState===null&&mo(_,C,h),$f(C,C.return);break;case 30:break;default:mo(_,C,h)}l=l.sibling}}function Zb(o,l){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&jf(h))}function Jb(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&jf(o))}function Va(o,l,h,y){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)w2(o,l,h,y),l=l.sibling}function w2(o,l,h,y){var _=l.flags;switch(l.tag){case 0:case 11:case 15:Va(o,l,h,y),_&2048&&zf(9,l);break;case 1:Va(o,l,h,y);break;case 3:Va(o,l,h,y),_&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&jf(o)));break;case 12:if(_&2048){Va(o,l,h,y),o=l.stateNode;try{var C=l.memoizedProps,M=C.id,U=C.onPostCommit;typeof U=="function"&&U(M,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Q){jt(l,l.return,Q)}}else Va(o,l,h,y);break;case 31:Va(o,l,h,y);break;case 13:Va(o,l,h,y);break;case 23:break;case 22:C=l.stateNode,M=l.alternate,l.memoizedState!==null?C._visibility&2?Va(o,l,h,y):Bf(o,l):C._visibility&2?Va(o,l,h,y):(C._visibility|=2,ju(o,l,h,y,(l.subtreeFlags&10256)!==0||!1)),_&2048&&Zb(M,l);break;case 24:Va(o,l,h,y),_&2048&&Jb(l.alternate,l);break;default:Va(o,l,h,y)}}function ju(o,l,h,y,_){for(_=_&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var C=o,M=l,U=h,Q=y,ue=M.flags;switch(M.tag){case 0:case 11:case 15:ju(C,M,U,Q,_),zf(8,M);break;case 23:break;case 22:var me=M.stateNode;M.memoizedState!==null?me._visibility&2?ju(C,M,U,Q,_):Bf(C,M):(me._visibility|=2,ju(C,M,U,Q,_)),_&&ue&2048&&Zb(M.alternate,M);break;case 24:ju(C,M,U,Q,_),_&&ue&2048&&Jb(M.alternate,M);break;default:ju(C,M,U,Q,_)}l=l.sibling}}function Bf(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var h=o,y=l,_=y.flags;switch(y.tag){case 22:Bf(h,y),_&2048&&Zb(y.alternate,y);break;case 24:Bf(h,y),_&2048&&Jb(y.alternate,y);break;default:Bf(h,y)}l=l.sibling}}var Uf=8192;function Cu(o,l,h){if(o.subtreeFlags&Uf)for(o=o.child;o!==null;)S2(o,l,h),o=o.sibling}function S2(o,l,h){switch(o.tag){case 26:Cu(o,l,h),o.flags&Uf&&o.memoizedState!==null&&VK(h,Ka,o.memoizedState,o.memoizedProps);break;case 5:Cu(o,l,h);break;case 3:case 4:var y=Ka;Ka=pv(o.stateNode.containerInfo),Cu(o,l,h),Ka=y;break;case 22:o.memoizedState===null&&(y=o.alternate,y!==null&&y.memoizedState!==null?(y=Uf,Uf=16777216,Cu(o,l,h),Uf=y):Cu(o,l,h));break;default:Cu(o,l,h)}}function E2(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function Hf(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var y=l[h];Fn=y,j2(y,o)}E2(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)_2(o),o=o.sibling}function _2(o){switch(o.tag){case 0:case 11:case 15:Hf(o),o.flags&2048&&Ss(9,o,o.return);break;case 3:Hf(o);break;case 12:Hf(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,nv(o)):Hf(o);break;default:Hf(o)}}function nv(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var y=l[h];Fn=y,j2(y,o)}E2(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Ss(8,l,l.return),nv(l);break;case 22:h=l.stateNode,h._visibility&2&&(h._visibility&=-3,nv(l));break;default:nv(l)}o=o.sibling}}function j2(o,l){for(;Fn!==null;){var h=Fn;switch(h.tag){case 0:case 11:case 15:Ss(8,h,l);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var y=h.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:jf(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,Fn=y;else e:for(h=o;Fn!==null;){y=Fn;var _=y.sibling,C=y.return;if(p2(y),y===h){Fn=null;break e}if(_!==null){_.return=C,Fn=_;break e}Fn=C}}}var sK={getCacheForType:function(o){var l=Zn(xn),h=l.data.get(o);return h===void 0&&(h=o(),l.data.set(o,h)),h},cacheSignal:function(){return Zn(xn).controller.signal}},lK=typeof WeakMap=="function"?WeakMap:Map,bt=0,Rt=null,et=null,rt=0,_t=0,ta=null,Es=!1,Ou=!1,ew=!1,po=0,tn=0,_s=0,Xl=0,tw=0,na=0,Au=0,Ff=null,Ur=null,nw=!1,rv=0,C2=0,av=1/0,iv=null,js=null,Nn=0,Cs=null,Nu=null,vo=0,rw=0,aw=null,O2=null,qf=0,iw=null;function ra(){return(bt&2)!==0&&rt!==0?rt&-rt:k.T!==null?dw():uf()}function A2(){if(na===0)if((rt&536870912)===0||ot){var o=Ua;Ua<<=1,(Ua&3932160)===0&&(Ua=262144),na=o}else na=536870912;return o=Jr.current,o!==null&&(o.flags|=32),na}function Hr(o,l,h){(o===Rt&&(_t===2||_t===9)||o.cancelPendingCommit!==null)&&(Tu(o,0),Os(o,rt,na,!1)),$t(o,h),((bt&2)===0||o!==Rt)&&(o===Rt&&((bt&2)===0&&(Xl|=h),tn===4&&Os(o,rt,na,!1)),wi(o))}function N2(o,l,h){if((bt&6)!==0)throw Error(r(327));var y=!h&&(l&127)===0&&(l&o.expiredLanes)===0||Lt(o,l),_=y?dK(o,l):sw(o,l,!0),C=y;do{if(_===0){Ou&&!y&&Os(o,l,0,!1);break}else{if(h=o.current.alternate,C&&!cK(h)){_=sw(o,l,!1),C=!1;continue}if(_===2){if(C=l,o.errorRecoveryDisabledLanes&C)var M=0;else M=o.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){l=M;e:{var U=o;_=Ff;var Q=U.current.memoizedState.isDehydrated;if(Q&&(Tu(U,M).flags|=256),M=sw(U,M,!1),M!==2){if(ew&&!Q){U.errorRecoveryDisabledLanes|=C,Xl|=C,_=4;break e}C=Ur,Ur=_,C!==null&&(Ur===null?Ur=C:Ur.push.apply(Ur,C))}_=M}if(C=!1,_!==2)continue}}if(_===1){Tu(o,0),Os(o,l,0,!0);break}e:{switch(y=o,C=_,C){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Os(y,l,na,!Es);break e;case 2:Ur=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(_=rv+300-It(),10<_)){if(Os(y,l,na,!Es),qe(y,0,!0)!==0)break e;vo=l,y.timeoutHandle=oP(T2.bind(null,y,h,Ur,iv,nw,l,na,Xl,Au,Es,C,"Throttled",-0,0),_);break e}T2(y,h,Ur,iv,nw,l,na,Xl,Au,Es,C,null,-0,0)}}break}while(!0);wi(o)}function T2(o,l,h,y,_,C,M,U,Q,ue,me,ve,de,he){if(o.timeoutHandle=-1,ve=l.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:eo},S2(l,C,ve);var Ne=(C&62914560)===C?rv-It():(C&4194048)===C?C2-It():0;if(Ne=YK(ve,Ne),Ne!==null){vo=C,o.cancelPendingCommit=Ne(z2.bind(null,o,l,C,h,y,_,M,U,Q,me,ve,null,de,he)),Os(o,C,M,!ue);return}}z2(o,l,C,h,y,_,M,U,Q)}function cK(o){for(var l=o;;){var h=l.tag;if((h===0||h===11||h===15)&&l.flags&16384&&(h=l.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var y=0;y<h.length;y++){var _=h[y],C=_.getSnapshot;_=_.value;try{if(!Qr(C(),_))return!1}catch{return!1}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Os(o,l,h,y){l&=~tw,l&=~Xl,o.suspendedLanes|=l,o.pingedLanes&=~l,y&&(o.warmLanes|=l),y=o.expirationTimes;for(var _=l;0<_;){var C=31-ht(_),M=1<<C;y[C]=-1,_&=~M}h!==0&&Wi(o,h,l)}function ov(){return(bt&6)===0?(Kf(0),!1):!0}function ow(){if(et!==null){if(_t===0)var o=et.return;else o=et,ao=Bl=null,Sb(o),bu=null,Of=0,o=et;for(;o!==null;)s2(o.alternate,o),o=o.return;et=null}}function Tu(o,l){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,NK(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),vo=0,ow(),Rt=o,et=h=no(o.current,null),rt=l,_t=0,ta=null,Es=!1,Ou=Lt(o,l),ew=!1,Au=na=tw=Xl=_s=tn=0,Ur=Ff=null,nw=!1,(l&8)!==0&&(l|=l&32);var y=o.entangledLanes;if(y!==0)for(o=o.entanglements,y&=l;0<y;){var _=31-ht(y),C=1<<_;l|=o[_],y&=~C}return po=l,Op(),h}function P2(o,l){Xe=null,k.H=Df,l===xu||l===Dp?(l=YN(),_t=3):l===ub?(l=YN(),_t=4):_t=l===zb?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,ta=l,et===null&&(tn=1,Xp(o,ba(l,o.current)))}function M2(){var o=Jr.current;return o===null?!0:(rt&4194048)===rt?_a===null:(rt&62914560)===rt||(rt&536870912)!==0?o===_a:!1}function k2(){var o=k.H;return k.H=Df,o===null?Df:o}function R2(){var o=k.A;return k.A=sK,o}function sv(){tn=4,Es||(rt&4194048)!==rt&&Jr.current!==null||(Ou=!0),(_s&134217727)===0&&(Xl&134217727)===0||Rt===null||Os(Rt,rt,na,!1)}function sw(o,l,h){var y=bt;bt|=2;var _=k2(),C=R2();(Rt!==o||rt!==l)&&(iv=null,Tu(o,l)),l=!1;var M=tn;e:do try{if(_t!==0&&et!==null){var U=et,Q=ta;switch(_t){case 8:ow(),M=6;break e;case 3:case 2:case 9:case 6:Jr.current===null&&(l=!0);var ue=_t;if(_t=0,ta=null,Pu(o,U,Q,ue),h&&Ou){M=0;break e}break;default:ue=_t,_t=0,ta=null,Pu(o,U,Q,ue)}}uK(),M=tn;break}catch(me){P2(o,me)}while(!0);return l&&o.shellSuspendCounter++,ao=Bl=null,bt=y,k.H=_,k.A=C,et===null&&(Rt=null,rt=0,Op()),M}function uK(){for(;et!==null;)D2(et)}function dK(o,l){var h=bt;bt|=2;var y=k2(),_=R2();Rt!==o||rt!==l?(iv=null,av=It()+500,Tu(o,l)):Ou=Lt(o,l);e:do try{if(_t!==0&&et!==null){l=et;var C=ta;t:switch(_t){case 1:_t=0,ta=null,Pu(o,l,C,1);break;case 2:case 9:if(KN(C)){_t=0,ta=null,I2(l);break}l=function(){_t!==2&&_t!==9||Rt!==o||(_t=7),wi(o)},C.then(l,l);break e;case 3:_t=7;break e;case 4:_t=5;break e;case 7:KN(C)?(_t=0,ta=null,I2(l)):(_t=0,ta=null,Pu(o,l,C,7));break;case 5:var M=null;switch(et.tag){case 26:M=et.memoizedState;case 5:case 27:var U=et;if(M?wP(M):U.stateNode.complete){_t=0,ta=null;var Q=U.sibling;if(Q!==null)et=Q;else{var ue=U.return;ue!==null?(et=ue,lv(ue)):et=null}break t}}_t=0,ta=null,Pu(o,l,C,5);break;case 6:_t=0,ta=null,Pu(o,l,C,6);break;case 8:ow(),tn=6;break e;default:throw Error(r(462))}}fK();break}catch(me){P2(o,me)}while(!0);return ao=Bl=null,k.H=y,k.A=_,bt=h,et!==null?0:(Rt=null,rt=0,Op(),tn)}function fK(){for(;et!==null&&!Et();)D2(et)}function D2(o){var l=i2(o.alternate,o,po);o.memoizedProps=o.pendingProps,l===null?lv(o):et=l}function I2(o){var l=o,h=l.alternate;switch(l.tag){case 15:case 0:l=JT(h,l,l.pendingProps,l.type,void 0,rt);break;case 11:l=JT(h,l,l.pendingProps,l.type.render,l.ref,rt);break;case 5:Sb(l);default:s2(h,l),l=et=RN(l,po),l=i2(h,l,po)}o.memoizedProps=o.pendingProps,l===null?lv(o):et=l}function Pu(o,l,h,y){ao=Bl=null,Sb(l),bu=null,Of=0;var _=l.return;try{if(eK(o,_,l,h,rt)){tn=1,Xp(o,ba(h,o.current)),et=null;return}}catch(C){if(_!==null)throw et=_,C;tn=1,Xp(o,ba(h,o.current)),et=null;return}l.flags&32768?(ot||y===1?o=!0:Ou||(rt&536870912)!==0?o=!1:(Es=o=!0,(y===2||y===9||y===3||y===6)&&(y=Jr.current,y!==null&&y.tag===13&&(y.flags|=16384))),L2(l,o)):lv(l)}function lv(o){var l=o;do{if((l.flags&32768)!==0){L2(l,Es);return}o=l.return;var h=rK(l.alternate,l,po);if(h!==null){et=h;return}if(l=l.sibling,l!==null){et=l;return}et=l=o}while(l!==null);tn===0&&(tn=5)}function L2(o,l){do{var h=aK(o.alternate,o);if(h!==null){h.flags&=32767,et=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!l&&(o=o.sibling,o!==null)){et=o;return}et=o=h}while(o!==null);tn=6,et=null}function z2(o,l,h,y,_,C,M,U,Q){o.cancelPendingCommit=null;do cv();while(Nn!==0);if((bt&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(C=l.lanes|l.childLanes,C|=Xx,or(o,h,C,M,U,Q),o===Rt&&(et=Rt=null,rt=0),Nu=l,Cs=o,vo=h,rw=C,aw=_,O2=y,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,vK(Er,function(){return F2(),null})):(o.callbackNode=null,o.callbackPriority=0),y=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||y){y=k.T,k.T=null,_=H.p,H.p=2,M=bt,bt|=4;try{iK(o,l,h)}finally{bt=M,H.p=_,k.T=y}}Nn=1,$2(),B2(),U2()}}function $2(){if(Nn===1){Nn=0;var o=Cs,l=Nu,h=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||h){h=k.T,k.T=null;var y=H.p;H.p=2;var _=bt;bt|=4;try{x2(l,o);var C=xw,M=jN(o.containerInfo),U=C.focusedElem,Q=C.selectionRange;if(M!==U&&U&&U.ownerDocument&&_N(U.ownerDocument.documentElement,U)){if(Q!==null&&qx(U)){var ue=Q.start,me=Q.end;if(me===void 0&&(me=ue),"selectionStart"in U)U.selectionStart=ue,U.selectionEnd=Math.min(me,U.value.length);else{var ve=U.ownerDocument||document,de=ve&&ve.defaultView||window;if(de.getSelection){var he=de.getSelection(),Ne=U.textContent.length,Ue=Math.min(Q.start,Ne),Nt=Q.end===void 0?Ue:Math.min(Q.end,Ne);!he.extend&&Ue>Nt&&(M=Nt,Nt=Ue,Ue=M);var oe=EN(U,Ue),te=EN(U,Nt);if(oe&&te&&(he.rangeCount!==1||he.anchorNode!==oe.node||he.anchorOffset!==oe.offset||he.focusNode!==te.node||he.focusOffset!==te.offset)){var ce=ve.createRange();ce.setStart(oe.node,oe.offset),he.removeAllRanges(),Ue>Nt?(he.addRange(ce),he.extend(te.node,te.offset)):(ce.setEnd(te.node,te.offset),he.addRange(ce))}}}}for(ve=[],he=U;he=he.parentNode;)he.nodeType===1&&ve.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<ve.length;U++){var pe=ve[U];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}wv=!!yw,xw=yw=null}finally{bt=_,H.p=y,k.T=h}}o.current=l,Nn=2}}function B2(){if(Nn===2){Nn=0;var o=Cs,l=Nu,h=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||h){h=k.T,k.T=null;var y=H.p;H.p=2;var _=bt;bt|=4;try{m2(o,l.alternate,l)}finally{bt=_,H.p=y,k.T=h}}Nn=3}}function U2(){if(Nn===4||Nn===3){Nn=0,vn();var o=Cs,l=Nu,h=vo,y=O2;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Nn=5:(Nn=0,Nu=Cs=null,H2(o,o.pendingLanes));var _=o.pendingLanes;if(_===0&&(js=null),Wr(h),l=l.stateNode,we&&typeof we.onCommitFiberRoot=="function")try{we.onCommitFiberRoot(kr,l,void 0,(l.current.flags&128)===128)}catch{}if(y!==null){l=k.T,_=H.p,H.p=2,k.T=null;try{for(var C=o.onRecoverableError,M=0;M<y.length;M++){var U=y[M];C(U.value,{componentStack:U.stack})}}finally{k.T=l,H.p=_}}(vo&3)!==0&&cv(),wi(o),_=o.pendingLanes,(h&261930)!==0&&(_&42)!==0?o===iw?qf++:(qf=0,iw=o):qf=0,Kf(0)}}function H2(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,jf(l)))}function cv(){return $2(),B2(),U2(),F2()}function F2(){if(Nn!==5)return!1;var o=Cs,l=rw;rw=0;var h=Wr(vo),y=k.T,_=H.p;try{H.p=32>h?32:h,k.T=null,h=aw,aw=null;var C=Cs,M=vo;if(Nn=0,Nu=Cs=null,vo=0,(bt&6)!==0)throw Error(r(331));var U=bt;if(bt|=4,_2(C.current),w2(C,C.current,M,h),bt=U,Kf(0,!1),we&&typeof we.onPostCommitFiberRoot=="function")try{we.onPostCommitFiberRoot(kr,C)}catch{}return!0}finally{H.p=_,k.T=y,H2(o,l)}}function q2(o,l,h){l=ba(h,l),l=Lb(o.stateNode,l,2),o=xs(o,l,2),o!==null&&($t(o,2),wi(o))}function jt(o,l,h){if(o.tag===3)q2(o,o,h);else for(;l!==null;){if(l.tag===3){q2(l,o,h);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(js===null||!js.has(y))){o=ba(h,o),h=KT(2),y=xs(l,h,2),y!==null&&(VT(h,y,l,o),$t(y,2),wi(y));break}}l=l.return}}function lw(o,l,h){var y=o.pingCache;if(y===null){y=o.pingCache=new lK;var _=new Set;y.set(l,_)}else _=y.get(l),_===void 0&&(_=new Set,y.set(l,_));_.has(h)||(ew=!0,_.add(h),o=hK.bind(null,o,l,h),l.then(o,o))}function hK(o,l,h){var y=o.pingCache;y!==null&&y.delete(l),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,Rt===o&&(rt&h)===h&&(tn===4||tn===3&&(rt&62914560)===rt&&300>It()-rv?(bt&2)===0&&Tu(o,0):tw|=h,Au===rt&&(Au=0)),wi(o)}function K2(o,l){l===0&&(l=Hn()),o=Ll(o,l),o!==null&&($t(o,l),wi(o))}function mK(o){var l=o.memoizedState,h=0;l!==null&&(h=l.retryLane),K2(o,h)}function pK(o,l){var h=0;switch(o.tag){case 31:case 13:var y=o.stateNode,_=o.memoizedState;_!==null&&(h=_.retryLane);break;case 19:y=o.stateNode;break;case 22:y=o.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(l),K2(o,h)}function vK(o,l){return pn(o,l)}var uv=null,Mu=null,cw=!1,dv=!1,uw=!1,As=0;function wi(o){o!==Mu&&o.next===null&&(Mu===null?uv=Mu=o:Mu=Mu.next=o),dv=!0,cw||(cw=!0,yK())}function Kf(o,l){if(!uw&&dv){uw=!0;do for(var h=!1,y=uv;y!==null;){if(o!==0){var _=y.pendingLanes;if(_===0)var C=0;else{var M=y.suspendedLanes,U=y.pingedLanes;C=(1<<31-ht(42|o)+1)-1,C&=_&~(M&~U),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(h=!0,X2(y,C))}else C=rt,C=qe(y,y===Rt?C:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(C&3)===0||Lt(y,C)||(h=!0,X2(y,C));y=y.next}while(h);uw=!1}}function gK(){V2()}function V2(){dv=cw=!1;var o=0;As!==0&&AK()&&(o=As);for(var l=It(),h=null,y=uv;y!==null;){var _=y.next,C=Y2(y,l);C===0?(y.next=null,h===null?uv=_:h.next=_,_===null&&(Mu=h)):(h=y,(o!==0||(C&3)!==0)&&(dv=!0)),y=_}Nn!==0&&Nn!==5||Kf(o),As!==0&&(As=0)}function Y2(o,l){for(var h=o.suspendedLanes,y=o.pingedLanes,_=o.expirationTimes,C=o.pendingLanes&-62914561;0<C;){var M=31-ht(C),U=1<<M,Q=_[M];Q===-1?((U&h)===0||(U&y)!==0)&&(_[M]=gn(U,l)):Q<=l&&(o.expiredLanes|=U),C&=~U}if(l=Rt,h=rt,h=qe(o,o===l?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y=o.callbackNode,h===0||o===l&&(_t===2||_t===9)||o.cancelPendingCommit!==null)return y!==null&&y!==null&&Bn(y),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Lt(o,h)){if(l=h&-h,l===o.callbackPriority)return l;switch(y!==null&&Bn(y),Wr(h)){case 2:case 8:h=Mr;break;case 32:h=Er;break;case 268435456:h=Un;break;default:h=Er}return y=G2.bind(null,o),h=pn(h,y),o.callbackPriority=l,o.callbackNode=h,l}return y!==null&&y!==null&&Bn(y),o.callbackPriority=2,o.callbackNode=null,2}function G2(o,l){if(Nn!==0&&Nn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(cv()&&o.callbackNode!==h)return null;var y=rt;return y=qe(o,o===Rt?y:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y===0?null:(N2(o,y,l),Y2(o,It()),o.callbackNode!=null&&o.callbackNode===h?G2.bind(null,o):null)}function X2(o,l){if(cv())return null;N2(o,l,!0)}function yK(){TK(function(){(bt&6)!==0?pn(dn,gK):V2()})}function dw(){if(As===0){var o=gu;o===0&&(o=Rr,Rr<<=1,(Rr&261888)===0&&(Rr=256)),As=o}return As}function W2(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:xp(""+o)}function Q2(o,l){var h=l.ownerDocument.createElement("input");return h.name=l.name,h.value=l.value,o.id&&h.setAttribute("form",o.id),l.parentNode.insertBefore(h,l),o=new FormData(o),h.parentNode.removeChild(h),o}function xK(o,l,h,y,_){if(l==="submit"&&h&&h.stateNode===_){var C=W2((_[cr]||null).action),M=y.submitter;M&&(l=(l=M[cr]||null)?W2(l.formAction):M.getAttribute("formAction"),l!==null&&(C=l,M=null));var U=new Ep("action","action",null,y,_);o.push({event:U,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(As!==0){var Q=M?Q2(_,M):new FormData(_);Pb(h,{pending:!0,data:Q,method:_.method,action:C},null,Q)}}else typeof C=="function"&&(U.preventDefault(),Q=M?Q2(_,M):new FormData(_),Pb(h,{pending:!0,data:Q,method:_.method,action:C},C,Q))},currentTarget:_}]})}}for(var fw=0;fw<Gx.length;fw++){var hw=Gx[fw],bK=hw.toLowerCase(),wK=hw[0].toUpperCase()+hw.slice(1);qa(bK,"on"+wK)}qa(AN,"onAnimationEnd"),qa(NN,"onAnimationIteration"),qa(TN,"onAnimationStart"),qa("dblclick","onDoubleClick"),qa("focusin","onFocus"),qa("focusout","onBlur"),qa(L7,"onTransitionRun"),qa(z7,"onTransitionStart"),qa($7,"onTransitionCancel"),qa(PN,"onTransitionEnd"),us("onMouseEnter",["mouseout","mouseover"]),us("onMouseLeave",["mouseout","mouseover"]),us("onPointerEnter",["pointerout","pointerover"]),us("onPointerLeave",["pointerout","pointerover"]),Zi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vf="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(" "),SK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vf));function Z2(o,l){l=(l&4)!==0;for(var h=0;h<o.length;h++){var y=o[h],_=y.event;y=y.listeners;e:{var C=void 0;if(l)for(var M=y.length-1;0<=M;M--){var U=y[M],Q=U.instance,ue=U.currentTarget;if(U=U.listener,Q!==C&&_.isPropagationStopped())break e;C=U,_.currentTarget=ue;try{C(_)}catch(me){Cp(me)}_.currentTarget=null,C=Q}else for(M=0;M<y.length;M++){if(U=y[M],Q=U.instance,ue=U.currentTarget,U=U.listener,Q!==C&&_.isPropagationStopped())break e;C=U,_.currentTarget=ue;try{C(_)}catch(me){Cp(me)}_.currentTarget=null,C=Q}}}}function tt(o,l){var h=l[nu];h===void 0&&(h=l[nu]=new Set);var y=o+"__bubble";h.has(y)||(J2(l,o,2,!1),h.add(y))}function mw(o,l,h){var y=0;l&&(y|=4),J2(h,o,y,l)}var fv="_reactListening"+Math.random().toString(36).slice(2);function pw(o){if(!o[fv]){o[fv]=!0,hp.forEach(function(h){h!=="selectionchange"&&(SK.has(h)||mw(h,!1,o),mw(h,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[fv]||(l[fv]=!0,mw("selectionchange",!1,l))}}function J2(o,l,h,y){switch(AP(l)){case 2:var _=WK;break;case 8:_=QK;break;default:_=Tw}h=_.bind(null,l,h,o),_=void 0,!Dx||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(_=!0),y?_!==void 0?o.addEventListener(l,h,{capture:!0,passive:_}):o.addEventListener(l,h,!0):_!==void 0?o.addEventListener(l,h,{passive:_}):o.addEventListener(l,h,!1)}function vw(o,l,h,y,_){var C=y;if((l&1)===0&&(l&2)===0&&y!==null)e:for(;;){if(y===null)return;var M=y.tag;if(M===3||M===4){var U=y.stateNode.containerInfo;if(U===_)break;if(M===4)for(M=y.return;M!==null;){var Q=M.tag;if((Q===3||Q===4)&&M.stateNode.containerInfo===_)return;M=M.return}for(;U!==null;){if(M=os(U),M===null)return;if(Q=M.tag,Q===5||Q===6||Q===26||Q===27){y=C=M;continue e}U=U.parentNode}}y=y.return}aN(function(){var ue=C,me=kx(h),ve=[];e:{var de=MN.get(o);if(de!==void 0){var he=Ep,Ne=o;switch(o){case"keypress":if(wp(h)===0)break e;case"keydown":case"keyup":he=p7;break;case"focusin":Ne="focus",he=$x;break;case"focusout":Ne="blur",he=$x;break;case"beforeblur":case"afterblur":he=$x;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=sN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=r7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=y7;break;case AN:case NN:case TN:he=o7;break;case PN:he=b7;break;case"scroll":case"scrollend":he=t7;break;case"wheel":he=S7;break;case"copy":case"cut":case"paste":he=l7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=cN;break;case"toggle":case"beforetoggle":he=_7}var Ue=(l&4)!==0,Nt=!Ue&&(o==="scroll"||o==="scrollend"),oe=Ue?de!==null?de+"Capture":null:de;Ue=[];for(var te=ue,ce;te!==null;){var pe=te;if(ce=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ce===null||oe===null||(pe=mf(te,oe),pe!=null&&Ue.push(Yf(te,pe,ce))),Nt)break;te=te.return}0<Ue.length&&(de=new he(de,Ne,null,h,me),ve.push({event:de,listeners:Ue}))}}if((l&7)===0){e:{if(de=o==="mouseover"||o==="pointerover",he=o==="mouseout"||o==="pointerout",de&&h!==Mx&&(Ne=h.relatedTarget||h.fromElement)&&(os(Ne)||Ne[Qi]))break e;if((he||de)&&(de=me.window===me?me:(de=me.ownerDocument)?de.defaultView||de.parentWindow:window,he?(Ne=h.relatedTarget||h.toElement,he=ue,Ne=Ne?os(Ne):null,Ne!==null&&(Nt=i(Ne),Ue=Ne.tag,Ne!==Nt||Ue!==5&&Ue!==27&&Ue!==6)&&(Ne=null)):(he=null,Ne=ue),he!==Ne)){if(Ue=sN,pe="onMouseLeave",oe="onMouseEnter",te="mouse",(o==="pointerout"||o==="pointerover")&&(Ue=cN,pe="onPointerLeave",oe="onPointerEnter",te="pointer"),Nt=he==null?de:ls(he),ce=Ne==null?de:ls(Ne),de=new Ue(pe,te+"leave",he,h,me),de.target=Nt,de.relatedTarget=ce,pe=null,os(me)===ue&&(Ue=new Ue(oe,te+"enter",Ne,h,me),Ue.target=ce,Ue.relatedTarget=Nt,pe=Ue),Nt=pe,he&&Ne)t:{for(Ue=EK,oe=he,te=Ne,ce=0,pe=oe;pe;pe=Ue(pe))ce++;pe=0;for(var $e=te;$e;$e=Ue($e))pe++;for(;0<ce-pe;)oe=Ue(oe),ce--;for(;0<pe-ce;)te=Ue(te),pe--;for(;ce--;){if(oe===te||te!==null&&oe===te.alternate){Ue=oe;break t}oe=Ue(oe),te=Ue(te)}Ue=null}else Ue=null;he!==null&&eP(ve,de,he,Ue,!1),Ne!==null&&Nt!==null&&eP(ve,Nt,Ne,Ue,!0)}}e:{if(de=ue?ls(ue):window,he=de.nodeName&&de.nodeName.toLowerCase(),he==="select"||he==="input"&&de.type==="file")var pt=gN;else if(pN(de))if(yN)pt=R7;else{pt=M7;var Re=P7}else he=de.nodeName,!he||he.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ue&&Px(ue.elementType)&&(pt=gN):pt=k7;if(pt&&(pt=pt(o,ue))){vN(ve,pt,h,me);break e}Re&&Re(o,de,ue),o==="focusout"&&ue&&de.type==="number"&&ue.memoizedProps.value!=null&&hf(de,"number",de.value)}switch(Re=ue?ls(ue):window,o){case"focusin":(pN(Re)||Re.contentEditable==="true")&&(cu=Re,Kx=ue,Sf=null);break;case"focusout":Sf=Kx=cu=null;break;case"mousedown":Vx=!0;break;case"contextmenu":case"mouseup":case"dragend":Vx=!1,CN(ve,h,me);break;case"selectionchange":if(I7)break;case"keydown":case"keyup":CN(ve,h,me)}var We;if(Ux)e:{switch(o){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else lu?hN(o,h)&&(at="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(at="onCompositionStart");at&&(uN&&h.locale!=="ko"&&(lu||at!=="onCompositionStart"?at==="onCompositionEnd"&&lu&&(We=iN()):(fs=me,Ix="value"in fs?fs.value:fs.textContent,lu=!0)),Re=hv(ue,at),0<Re.length&&(at=new lN(at,o,null,h,me),ve.push({event:at,listeners:Re}),We?at.data=We:(We=mN(h),We!==null&&(at.data=We)))),(We=C7?O7(o,h):A7(o,h))&&(at=hv(ue,"onBeforeInput"),0<at.length&&(Re=new lN("onBeforeInput","beforeinput",null,h,me),ve.push({event:Re,listeners:at}),Re.data=We)),xK(ve,o,ue,h,me)}Z2(ve,l)})}function Yf(o,l,h){return{instance:o,listener:l,currentTarget:h}}function hv(o,l){for(var h=l+"Capture",y=[];o!==null;){var _=o,C=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||C===null||(_=mf(o,h),_!=null&&y.unshift(Yf(o,_,C)),_=mf(o,l),_!=null&&y.push(Yf(o,_,C))),o.tag===3)return y;o=o.return}return[]}function EK(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function eP(o,l,h,y,_){for(var C=l._reactName,M=[];h!==null&&h!==y;){var U=h,Q=U.alternate,ue=U.stateNode;if(U=U.tag,Q!==null&&Q===y)break;U!==5&&U!==26&&U!==27||ue===null||(Q=ue,_?(ue=mf(h,C),ue!=null&&M.unshift(Yf(h,ue,Q))):_||(ue=mf(h,C),ue!=null&&M.push(Yf(h,ue,Q)))),h=h.return}M.length!==0&&o.push({event:l,listeners:M})}var _K=/\r\n?/g,jK=/\u0000|\uFFFD/g;function tP(o){return(typeof o=="string"?o:""+o).replace(_K,`
`).replace(jK,"")}function nP(o,l){return l=tP(l),tP(o)===l}function At(o,l,h,y,_,C){switch(h){case"children":typeof y=="string"?l==="body"||l==="textarea"&&y===""||iu(o,y):(typeof y=="number"||typeof y=="bigint")&&l!=="body"&&iu(o,""+y);break;case"className":au(o,"class",y);break;case"tabIndex":au(o,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":au(o,h,y);break;case"style":nN(o,y,C);break;case"data":if(l!=="object"){au(o,"data",y);break}case"src":case"href":if(y===""&&(l!=="a"||h!=="href")){o.removeAttribute(h);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(h);break}y=xp(""+y),o.setAttribute(h,y);break;case"action":case"formAction":if(typeof y=="function"){o.setAttribute(h,"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 C=="function"&&(h==="formAction"?(l!=="input"&&At(o,l,"name",_.name,_,null),At(o,l,"formEncType",_.formEncType,_,null),At(o,l,"formMethod",_.formMethod,_,null),At(o,l,"formTarget",_.formTarget,_,null)):(At(o,l,"encType",_.encType,_,null),At(o,l,"method",_.method,_,null),At(o,l,"target",_.target,_,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(h);break}y=xp(""+y),o.setAttribute(h,y);break;case"onClick":y!=null&&(o.onclick=eo);break;case"onScroll":y!=null&&tt("scroll",o);break;case"onScrollEnd":y!=null&&tt("scrollend",o);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(_.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":o.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){o.removeAttribute("xlink:href");break}h=xp(""+y),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,""+y):o.removeAttribute(h);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":y&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":y===!0?o.setAttribute(h,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,y):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?o.setAttribute(h,y):o.removeAttribute(h);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?o.removeAttribute(h):o.setAttribute(h,y);break;case"popover":tt("beforetoggle",o),tt("toggle",o),ru(o,"popover",y);break;case"xlinkActuate":Fa(o,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Fa(o,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Fa(o,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Fa(o,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Fa(o,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Fa(o,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Fa(o,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Fa(o,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Fa(o,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":ru(o,"is",y);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=J9.get(h)||h,ru(o,h,y))}}function gw(o,l,h,y,_,C){switch(h){case"style":nN(o,y,C);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(_.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof y=="string"?iu(o,y):(typeof y=="number"||typeof y=="bigint")&&iu(o,""+y);break;case"onScroll":y!=null&&tt("scroll",o);break;case"onScrollEnd":y!=null&&tt("scrollend",o);break;case"onClick":y!=null&&(o.onclick=eo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mp.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(_=h.endsWith("Capture"),l=h.slice(2,_?h.length-7:void 0),C=o[cr]||null,C=C!=null?C[h]:null,typeof C=="function"&&o.removeEventListener(l,C,_),typeof y=="function")){typeof C!="function"&&C!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(l,y,_);break e}h in o?o[h]=y:y===!0?o.setAttribute(h,""):ru(o,h,y)}}}function er(o,l,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",o),tt("load",o);var y=!1,_=!1,C;for(C in h)if(h.hasOwnProperty(C)){var M=h[C];if(M!=null)switch(C){case"src":y=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:At(o,l,C,M,h,null)}}_&&At(o,l,"srcSet",h.srcSet,h,null),y&&At(o,l,"src",h.src,h,null);return;case"input":tt("invalid",o);var U=C=M=_=null,Q=null,ue=null;for(y in h)if(h.hasOwnProperty(y)){var me=h[y];if(me!=null)switch(y){case"name":_=me;break;case"type":M=me;break;case"checked":Q=me;break;case"defaultChecked":ue=me;break;case"value":C=me;break;case"defaultValue":U=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:At(o,l,y,me,h,null)}}yp(o,C,U,Q,ue,M,_,!1);return;case"select":tt("invalid",o),y=M=C=null;for(_ in h)if(h.hasOwnProperty(_)&&(U=h[_],U!=null))switch(_){case"value":C=U;break;case"defaultValue":M=U;break;case"multiple":y=U;default:At(o,l,_,U,h,null)}l=C,h=M,o.multiple=!!y,l!=null?Ji(o,!!y,l,!1):h!=null&&Ji(o,!!y,h,!0);return;case"textarea":tt("invalid",o),C=_=y=null;for(M in h)if(h.hasOwnProperty(M)&&(U=h[M],U!=null))switch(M){case"value":y=U;break;case"defaultValue":_=U;break;case"children":C=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(91));break;default:At(o,l,M,U,h,null)}eN(o,y,_,C);return;case"option":for(Q in h)if(h.hasOwnProperty(Q)&&(y=h[Q],y!=null))switch(Q){case"selected":o.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:At(o,l,Q,y,h,null)}return;case"dialog":tt("beforetoggle",o),tt("toggle",o),tt("cancel",o),tt("close",o);break;case"iframe":case"object":tt("load",o);break;case"video":case"audio":for(y=0;y<Vf.length;y++)tt(Vf[y],o);break;case"image":tt("error",o),tt("load",o);break;case"details":tt("toggle",o);break;case"embed":case"source":case"link":tt("error",o),tt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in h)if(h.hasOwnProperty(ue)&&(y=h[ue],y!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:At(o,l,ue,y,h,null)}return;default:if(Px(l)){for(me in h)h.hasOwnProperty(me)&&(y=h[me],y!==void 0&&gw(o,l,me,y,h,void 0));return}}for(U in h)h.hasOwnProperty(U)&&(y=h[U],y!=null&&At(o,l,U,y,h,null))}function CK(o,l,h,y){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,C=null,M=null,U=null,Q=null,ue=null,me=null;for(he in h){var ve=h[he];if(h.hasOwnProperty(he)&&ve!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Q=ve;default:y.hasOwnProperty(he)||At(o,l,he,null,y,ve)}}for(var de in y){var he=y[de];if(ve=h[de],y.hasOwnProperty(de)&&(he!=null||ve!=null))switch(de){case"type":C=he;break;case"name":_=he;break;case"checked":ue=he;break;case"defaultChecked":me=he;break;case"value":M=he;break;case"defaultValue":U=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:he!==ve&&At(o,l,de,he,y,ve)}}kl(o,M,U,Q,ue,me,C,_);return;case"select":he=M=U=de=null;for(C in h)if(Q=h[C],h.hasOwnProperty(C)&&Q!=null)switch(C){case"value":break;case"multiple":he=Q;default:y.hasOwnProperty(C)||At(o,l,C,null,y,Q)}for(_ in y)if(C=y[_],Q=h[_],y.hasOwnProperty(_)&&(C!=null||Q!=null))switch(_){case"value":de=C;break;case"defaultValue":U=C;break;case"multiple":M=C;default:C!==Q&&At(o,l,_,C,y,Q)}l=U,h=M,y=he,de!=null?Ji(o,!!h,de,!1):!!y!=!!h&&(l!=null?Ji(o,!!h,l,!0):Ji(o,!!h,h?[]:"",!1));return;case"textarea":he=de=null;for(U in h)if(_=h[U],h.hasOwnProperty(U)&&_!=null&&!y.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:At(o,l,U,null,y,_)}for(M in y)if(_=y[M],C=h[M],y.hasOwnProperty(M)&&(_!=null||C!=null))switch(M){case"value":de=_;break;case"defaultValue":he=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==C&&At(o,l,M,_,y,C)}JA(o,de,he);return;case"option":for(var Ne in h)if(de=h[Ne],h.hasOwnProperty(Ne)&&de!=null&&!y.hasOwnProperty(Ne))switch(Ne){case"selected":o.selected=!1;break;default:At(o,l,Ne,null,y,de)}for(Q in y)if(de=y[Q],he=h[Q],y.hasOwnProperty(Q)&&de!==he&&(de!=null||he!=null))switch(Q){case"selected":o.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:At(o,l,Q,de,y,he)}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 Ue in h)de=h[Ue],h.hasOwnProperty(Ue)&&de!=null&&!y.hasOwnProperty(Ue)&&At(o,l,Ue,null,y,de);for(ue in y)if(de=y[ue],he=h[ue],y.hasOwnProperty(ue)&&de!==he&&(de!=null||he!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:At(o,l,ue,de,y,he)}return;default:if(Px(l)){for(var Nt in h)de=h[Nt],h.hasOwnProperty(Nt)&&de!==void 0&&!y.hasOwnProperty(Nt)&&gw(o,l,Nt,void 0,y,de);for(me in y)de=y[me],he=h[me],!y.hasOwnProperty(me)||de===he||de===void 0&&he===void 0||gw(o,l,me,de,y,he);return}}for(var oe in h)de=h[oe],h.hasOwnProperty(oe)&&de!=null&&!y.hasOwnProperty(oe)&&At(o,l,oe,null,y,de);for(ve in y)de=y[ve],he=h[ve],!y.hasOwnProperty(ve)||de===he||de==null&&he==null||At(o,l,ve,de,y,he)}function rP(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function OK(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,h=performance.getEntriesByType("resource"),y=0;y<h.length;y++){var _=h[y],C=_.transferSize,M=_.initiatorType,U=_.duration;if(C&&U&&rP(M)){for(M=0,U=_.responseEnd,y+=1;y<h.length;y++){var Q=h[y],ue=Q.startTime;if(ue>U)break;var me=Q.transferSize,ve=Q.initiatorType;me&&rP(ve)&&(Q=Q.responseEnd,M+=me*(Q<U?1:(U-ue)/(Q-ue)))}if(--y,l+=8*(C+M)/(_.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var yw=null,xw=null;function mv(o){return o.nodeType===9?o:o.ownerDocument}function aP(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function iP(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function bw(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var ww=null;function AK(){var o=window.event;return o&&o.type==="popstate"?o===ww?!1:(ww=o,!0):(ww=null,!1)}var oP=typeof setTimeout=="function"?setTimeout:void 0,NK=typeof clearTimeout=="function"?clearTimeout:void 0,sP=typeof Promise=="function"?Promise:void 0,TK=typeof queueMicrotask=="function"?queueMicrotask:typeof sP<"u"?function(o){return sP.resolve(null).then(o).catch(PK)}:oP;function PK(o){setTimeout(function(){throw o})}function Ns(o){return o==="head"}function lP(o,l){var h=l,y=0;do{var _=h.nextSibling;if(o.removeChild(h),_&&_.nodeType===8)if(h=_.data,h==="/$"||h==="/&"){if(y===0){o.removeChild(_),Iu(l);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")Gf(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,Gf(h);for(var C=h.firstChild;C;){var M=C.nextSibling,U=C.nodeName;C[Pl]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&C.rel.toLowerCase()==="stylesheet"||h.removeChild(C),C=M}}else h==="body"&&Gf(o.ownerDocument.body);h=_}while(h);Iu(l)}function cP(o,l){var h=o;o=0;do{var y=h.nextSibling;if(h.nodeType===1?l?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(l?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),y&&y.nodeType===8)if(h=y.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=y}while(h)}function Sw(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var h=l;switch(l=l.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Sw(h),df(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function MK(o,l,h,y){for(;o.nodeType===1;){var _=h;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!y&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(y){if(!o[Pl])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(C=o.getAttribute("rel"),C==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(C!==_.rel||o.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||o.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||o.getAttribute("title")!==(_.title==null?null:_.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(C=o.getAttribute("src"),(C!==(_.src==null?null:_.src)||o.getAttribute("type")!==(_.type==null?null:_.type)||o.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&C&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var C=_.name==null?null:""+_.name;if(_.type==="hidden"&&o.getAttribute("name")===C)return o}else return o;if(o=ja(o.nextSibling),o===null)break}return null}function kK(o,l,h){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=ja(o.nextSibling),o===null))return null;return o}function uP(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=ja(o.nextSibling),o===null))return null;return o}function Ew(o){return o.data==="$?"||o.data==="$~"}function _w(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function RK(o,l){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||h.readyState!=="loading")l();else{var y=function(){l(),h.removeEventListener("DOMContentLoaded",y)};h.addEventListener("DOMContentLoaded",y),o._reactRetry=y}}function ja(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var jw=null;function dP(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(l===0)return ja(o.nextSibling);l--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||l++}o=o.nextSibling}return null}function fP(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(l===0)return o;l--}else h!=="/$"&&h!=="/&"||l++}o=o.previousSibling}return null}function hP(o,l,h){switch(l=mv(h),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function Gf(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);df(o)}var Ca=new Map,mP=new Set;function pv(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var go=H.d;H.d={f:DK,r:IK,D:LK,C:zK,L:$K,m:BK,X:HK,S:UK,M:FK};function DK(){var o=go.f(),l=ov();return o||l}function IK(o){var l=ss(o);l!==null&&l.tag===5&&l.type==="form"?PT(l):go.r(o)}var ku=typeof document>"u"?null:document;function pP(o,l,h){var y=ku;if(y&&typeof l=="string"&&l){var _=Ir(l);_='link[rel="'+o+'"][href="'+_+'"]',typeof h=="string"&&(_+='[crossorigin="'+h+'"]'),mP.has(_)||(mP.add(_),o={rel:o,crossOrigin:h,href:l},y.querySelector(_)===null&&(l=y.createElement("link"),er(l,"link",o),yn(l),y.head.appendChild(l)))}}function LK(o){go.D(o),pP("dns-prefetch",o,null)}function zK(o,l){go.C(o,l),pP("preconnect",o,l)}function $K(o,l,h){go.L(o,l,h);var y=ku;if(y&&o&&l){var _='link[rel="preload"][as="'+Ir(l)+'"]';l==="image"&&h&&h.imageSrcSet?(_+='[imagesrcset="'+Ir(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(_+='[imagesizes="'+Ir(h.imageSizes)+'"]')):_+='[href="'+Ir(o)+'"]';var C=_;switch(l){case"style":C=Ru(o);break;case"script":C=Du(o)}Ca.has(C)||(o=f({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:o,as:l},h),Ca.set(C,o),y.querySelector(_)!==null||l==="style"&&y.querySelector(Xf(C))||l==="script"&&y.querySelector(Wf(C))||(l=y.createElement("link"),er(l,"link",o),yn(l),y.head.appendChild(l)))}}function BK(o,l){go.m(o,l);var h=ku;if(h&&o){var y=l&&typeof l.as=="string"?l.as:"script",_='link[rel="modulepreload"][as="'+Ir(y)+'"][href="'+Ir(o)+'"]',C=_;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Du(o)}if(!Ca.has(C)&&(o=f({rel:"modulepreload",href:o},l),Ca.set(C,o),h.querySelector(_)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Wf(C)))return}y=h.createElement("link"),er(y,"link",o),yn(y),h.head.appendChild(y)}}}function UK(o,l,h){go.S(o,l,h);var y=ku;if(y&&o){var _=cs(y).hoistableStyles,C=Ru(o);l=l||"default";var M=_.get(C);if(!M){var U={loading:0,preload:null};if(M=y.querySelector(Xf(C)))U.loading=5;else{o=f({rel:"stylesheet",href:o,"data-precedence":l},h),(h=Ca.get(C))&&Cw(o,h);var Q=M=y.createElement("link");yn(Q),er(Q,"link",o),Q._p=new Promise(function(ue,me){Q.onload=ue,Q.onerror=me}),Q.addEventListener("load",function(){U.loading|=1}),Q.addEventListener("error",function(){U.loading|=2}),U.loading|=4,vv(M,l,y)}M={type:"stylesheet",instance:M,count:1,state:U},_.set(C,M)}}}function HK(o,l){go.X(o,l);var h=ku;if(h&&o){var y=cs(h).hoistableScripts,_=Du(o),C=y.get(_);C||(C=h.querySelector(Wf(_)),C||(o=f({src:o,async:!0},l),(l=Ca.get(_))&&Ow(o,l),C=h.createElement("script"),yn(C),er(C,"link",o),h.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},y.set(_,C))}}function FK(o,l){go.M(o,l);var h=ku;if(h&&o){var y=cs(h).hoistableScripts,_=Du(o),C=y.get(_);C||(C=h.querySelector(Wf(_)),C||(o=f({src:o,async:!0,type:"module"},l),(l=Ca.get(_))&&Ow(o,l),C=h.createElement("script"),yn(C),er(C,"link",o),h.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},y.set(_,C))}}function vP(o,l,h,y){var _=(_=le.current)?pv(_):null;if(!_)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(l=Ru(h.href),h=cs(_).hoistableStyles,y=h.get(l),y||(y={type:"style",instance:null,count:0,state:null},h.set(l,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=Ru(h.href);var C=cs(_).hoistableStyles,M=C.get(o);if(M||(_=_.ownerDocument||_,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(o,M),(C=_.querySelector(Xf(o)))&&!C._p&&(M.instance=C,M.state.loading=5),Ca.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Ca.set(o,h),C||qK(_,o,h,M.state))),l&&y===null)throw Error(r(528,""));return M}if(l&&y!==null)throw Error(r(529,""));return null;case"script":return l=h.async,h=h.src,typeof h=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Du(h),h=cs(_).hoistableScripts,y=h.get(l),y||(y={type:"script",instance:null,count:0,state:null},h.set(l,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Ru(o){return'href="'+Ir(o)+'"'}function Xf(o){return'link[rel="stylesheet"]['+o+"]"}function gP(o){return f({},o,{"data-precedence":o.precedence,precedence:null})}function qK(o,l,h,y){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?y.loading=1:(l=o.createElement("link"),y.preload=l,l.addEventListener("load",function(){return y.loading|=1}),l.addEventListener("error",function(){return y.loading|=2}),er(l,"link",h),yn(l),o.head.appendChild(l))}function Du(o){return'[src="'+Ir(o)+'"]'}function Wf(o){return"script[async]"+o}function yP(o,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var y=o.querySelector('style[data-href~="'+Ir(h.href)+'"]');if(y)return l.instance=y,yn(y),y;var _=f({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return y=(o.ownerDocument||o).createElement("style"),yn(y),er(y,"style",_),vv(y,h.precedence,o),l.instance=y;case"stylesheet":_=Ru(h.href);var C=o.querySelector(Xf(_));if(C)return l.state.loading|=4,l.instance=C,yn(C),C;y=gP(h),(_=Ca.get(_))&&Cw(y,_),C=(o.ownerDocument||o).createElement("link"),yn(C);var M=C;return M._p=new Promise(function(U,Q){M.onload=U,M.onerror=Q}),er(C,"link",y),l.state.loading|=4,vv(C,h.precedence,o),l.instance=C;case"script":return C=Du(h.src),(_=o.querySelector(Wf(C)))?(l.instance=_,yn(_),_):(y=h,(_=Ca.get(C))&&(y=f({},h),Ow(y,_)),o=o.ownerDocument||o,_=o.createElement("script"),yn(_),er(_,"link",y),o.head.appendChild(_),l.instance=_);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(y=l.instance,l.state.loading|=4,vv(y,h.precedence,o));return l.instance}function vv(o,l,h){for(var y=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=y.length?y[y.length-1]:null,C=_,M=0;M<y.length;M++){var U=y[M];if(U.dataset.precedence===l)C=U;else if(C!==_)break}C?C.parentNode.insertBefore(o,C.nextSibling):(l=h.nodeType===9?h.head:h,l.insertBefore(o,l.firstChild))}function Cw(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function Ow(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var gv=null;function xP(o,l,h){if(gv===null){var y=new Map,_=gv=new Map;_.set(h,y)}else _=gv,y=_.get(h),y||(y=new Map,_.set(h,y));if(y.has(o))return y;for(y.set(o,null),h=h.getElementsByTagName(o),_=0;_<h.length;_++){var C=h[_];if(!(C[Pl]||C[An]||o==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var M=C.getAttribute(l)||"";M=o+M;var U=y.get(M);U?U.push(C):y.set(M,[C])}}return y}function bP(o,l,h){o=o.ownerDocument||o,o.head.insertBefore(h,l==="title"?o.querySelector("head > title"):null)}function KK(o,l,h){if(h===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function wP(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function VK(o,l,h,y){if(h.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var _=Ru(y.href),C=l.querySelector(Xf(_));if(C){l=C._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=yv.bind(o),l.then(o,o)),h.state.loading|=4,h.instance=C,yn(C);return}C=l.ownerDocument||l,y=gP(y),(_=Ca.get(_))&&Cw(y,_),C=C.createElement("link"),yn(C);var M=C;M._p=new Promise(function(U,Q){M.onload=U,M.onerror=Q}),er(C,"link",y),h.instance=C}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,l),(l=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=yv.bind(o),l.addEventListener("load",h),l.addEventListener("error",h))}}var Aw=0;function YK(o,l){return o.stylesheets&&o.count===0&&bv(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var y=setTimeout(function(){if(o.stylesheets&&bv(o,o.stylesheets),o.unsuspend){var C=o.unsuspend;o.unsuspend=null,C()}},6e4+l);0<o.imgBytes&&Aw===0&&(Aw=62500*OK());var _=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&bv(o,o.stylesheets),o.unsuspend)){var C=o.unsuspend;o.unsuspend=null,C()}},(o.imgBytes>Aw?50:800)+l);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(y),clearTimeout(_)}}:null}function yv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bv(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var xv=null;function bv(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,xv=new Map,l.forEach(GK,o),xv=null,yv.call(o))}function GK(o,l){if(!(l.state.loading&4)){var h=xv.get(o);if(h)var y=h.get(null);else{h=new Map,xv.set(o,h);for(var _=o.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<_.length;C++){var M=_[C];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(h.set(M.dataset.precedence,M),y=M)}y&&h.set(null,y)}_=l.instance,M=_.getAttribute("data-precedence"),C=h.get(M)||y,C===y&&h.set(null,_),h.set(M,_),this.count++,y=yv.bind(this),_.addEventListener("load",y),_.addEventListener("error",y),C?C.parentNode.insertBefore(_,C.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(_,o.firstChild)),l.state.loading|=4}}var Qf={$$typeof:j,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function XK(o,l,h,y,_,C,M,U,Q){this.tag=1,this.containerInfo=o,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=vi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vi(0),this.hiddenUpdates=vi(null),this.identifierPrefix=y,this.onUncaughtError=_,this.onCaughtError=C,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function SP(o,l,h,y,_,C,M,U,Q,ue,me,ve){return o=new XK(o,l,h,M,Q,ue,me,ve,U),l=1,C===!0&&(l|=24),C=Zr(3,null,null,l),o.current=C,C.stateNode=o,l=sb(),l.refCount++,o.pooledCache=l,l.refCount++,C.memoizedState={element:y,isDehydrated:h,cache:l},db(C),o}function EP(o){return o?(o=fu,o):fu}function _P(o,l,h,y,_,C){_=EP(_),y.context===null?y.context=_:y.pendingContext=_,y=ys(l),y.payload={element:h},C=C===void 0?null:C,C!==null&&(y.callback=C),h=xs(o,y,l),h!==null&&(Hr(h,o,l),Nf(h,o,l))}function jP(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<l?h:l}}function Nw(o,l){jP(o,l),(o=o.alternate)&&jP(o,l)}function CP(o){if(o.tag===13||o.tag===31){var l=Ll(o,67108864);l!==null&&Hr(l,o,67108864),Nw(o,67108864)}}function OP(o){if(o.tag===13||o.tag===31){var l=ra();l=is(l);var h=Ll(o,l);h!==null&&Hr(h,o,l),Nw(o,l)}}var wv=!0;function WK(o,l,h,y){var _=k.T;k.T=null;var C=H.p;try{H.p=2,Tw(o,l,h,y)}finally{H.p=C,k.T=_}}function QK(o,l,h,y){var _=k.T;k.T=null;var C=H.p;try{H.p=8,Tw(o,l,h,y)}finally{H.p=C,k.T=_}}function Tw(o,l,h,y){if(wv){var _=Pw(y);if(_===null)vw(o,l,y,Sv,h),NP(o,y);else if(JK(_,o,l,h,y))y.stopPropagation();else if(NP(o,y),l&4&&-1<ZK.indexOf(o)){for(;_!==null;){var C=ss(_);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var M=ir(C.pendingLanes);if(M!==0){var U=C;for(U.pendingLanes|=2,U.entangledLanes|=2;M;){var Q=1<<31-ht(M);U.entanglements[1]|=Q,M&=~Q}wi(C),(bt&6)===0&&(av=It()+500,Kf(0))}}break;case 31:case 13:U=Ll(C,2),U!==null&&Hr(U,C,2),ov(),Nw(C,2)}if(C=Pw(y),C===null&&vw(o,l,y,Sv,h),C===_)break;_=C}_!==null&&y.stopPropagation()}else vw(o,l,y,null,h)}}function Pw(o){return o=kx(o),Mw(o)}var Sv=null;function Mw(o){if(Sv=null,o=os(o),o!==null){var l=i(o);if(l===null)o=null;else{var h=l.tag;if(h===13){if(o=s(l),o!==null)return o;o=null}else if(h===31){if(o=c(l),o!==null)return o;o=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return Sv=o,null}function AP(o){switch(o){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(Sr()){case dn:return 2;case Mr:return 8;case Er:case ga:return 32;case Un:return 268435456;default:return 32}default:return 32}}var kw=!1,Ts=null,Ps=null,Ms=null,Zf=new Map,Jf=new Map,ks=[],ZK="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 NP(o,l){switch(o){case"focusin":case"focusout":Ts=null;break;case"dragenter":case"dragleave":Ps=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":Zf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jf.delete(l.pointerId)}}function eh(o,l,h,y,_,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:h,eventSystemFlags:y,nativeEvent:C,targetContainers:[_]},l!==null&&(l=ss(l),l!==null&&CP(l)),o):(o.eventSystemFlags|=y,l=o.targetContainers,_!==null&&l.indexOf(_)===-1&&l.push(_),o)}function JK(o,l,h,y,_){switch(l){case"focusin":return Ts=eh(Ts,o,l,h,y,_),!0;case"dragenter":return Ps=eh(Ps,o,l,h,y,_),!0;case"mouseover":return Ms=eh(Ms,o,l,h,y,_),!0;case"pointerover":var C=_.pointerId;return Zf.set(C,eh(Zf.get(C)||null,o,l,h,y,_)),!0;case"gotpointercapture":return C=_.pointerId,Jf.set(C,eh(Jf.get(C)||null,o,l,h,y,_)),!0}return!1}function TP(o){var l=os(o.target);if(l!==null){var h=i(l);if(h!==null){if(l=h.tag,l===13){if(l=s(h),l!==null){o.blockedOn=l,up(o.priority,function(){OP(h)});return}}else if(l===31){if(l=c(h),l!==null){o.blockedOn=l,up(o.priority,function(){OP(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Ev(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var h=Pw(o.nativeEvent);if(h===null){h=o.nativeEvent;var y=new h.constructor(h.type,h);Mx=y,h.target.dispatchEvent(y),Mx=null}else return l=ss(h),l!==null&&CP(l),o.blockedOn=h,!1;l.shift()}return!0}function PP(o,l,h){Ev(o)&&h.delete(l)}function eV(){kw=!1,Ts!==null&&Ev(Ts)&&(Ts=null),Ps!==null&&Ev(Ps)&&(Ps=null),Ms!==null&&Ev(Ms)&&(Ms=null),Zf.forEach(PP),Jf.forEach(PP)}function _v(o,l){o.blockedOn===l&&(o.blockedOn=null,kw||(kw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,eV)))}var jv=null;function MP(o){jv!==o&&(jv=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){jv===o&&(jv=null);for(var l=0;l<o.length;l+=3){var h=o[l],y=o[l+1],_=o[l+2];if(typeof y!="function"){if(Mw(y||h)===null)continue;break}var C=ss(h);C!==null&&(o.splice(l,3),l-=3,Pb(C,{pending:!0,data:_,method:h.method,action:y},y,_))}}))}function Iu(o){function l(Q){return _v(Q,o)}Ts!==null&&_v(Ts,o),Ps!==null&&_v(Ps,o),Ms!==null&&_v(Ms,o),Zf.forEach(l),Jf.forEach(l);for(var h=0;h<ks.length;h++){var y=ks[h];y.blockedOn===o&&(y.blockedOn=null)}for(;0<ks.length&&(h=ks[0],h.blockedOn===null);)TP(h),h.blockedOn===null&&ks.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(y=0;y<h.length;y+=3){var _=h[y],C=h[y+1],M=_[cr]||null;if(typeof C=="function")M||MP(h);else if(M){var U=null;if(C&&C.hasAttribute("formAction")){if(_=C,M=C[cr]||null)U=M.formAction;else if(Mw(_)!==null)continue}else U=M.action;typeof U=="function"?h[y+1]=U:(h.splice(y,3),y-=3),MP(h)}}}function kP(){function o(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(M){return _=M})},focusReset:"manual",scroll:"manual"})}function l(){_!==null&&(_(),_=null),y||setTimeout(h,20)}function h(){if(!y&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,_=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(h,100),function(){y=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),_!==null&&(_(),_=null)}}}function Rw(o){this._internalRoot=o}Cv.prototype.render=Rw.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var h=l.current,y=ra();_P(h,y,o,l,null,null)},Cv.prototype.unmount=Rw.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;_P(o.current,2,null,o,null,null),ov(),l[Qi]=null}};function Cv(o){this._internalRoot=o}Cv.prototype.unstable_scheduleHydration=function(o){if(o){var l=uf();o={blockedOn:null,target:o,priority:l};for(var h=0;h<ks.length&&l!==0&&l<ks[h].priority;h++);ks.splice(h,0,o),h===0&&TP(o)}};var RP=t.version;if(RP!=="19.2.4")throw Error(r(527,RP,"19.2.4"));H.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=d(l),o=o!==null?m(o):null,o=o===null?null:o.stateNode,o};var tV={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ov=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ov.isDisabled&&Ov.supportsFiber)try{kr=Ov.inject(tV),we=Ov}catch{}}return nh.createRoot=function(o,l){if(!a(o))throw Error(r(299));var h=!1,y="",_=UT,C=HT,M=FT;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onUncaughtError!==void 0&&(_=l.onUncaughtError),l.onCaughtError!==void 0&&(C=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError)),l=SP(o,1,!1,null,null,h,y,null,_,C,M,kP),o[Qi]=l.current,pw(o),new Rw(l)},nh.hydrateRoot=function(o,l,h){if(!a(o))throw Error(r(299));var y=!1,_="",C=UT,M=HT,U=FT,Q=null;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(_=h.identifierPrefix),h.onUncaughtError!==void 0&&(C=h.onUncaughtError),h.onCaughtError!==void 0&&(M=h.onCaughtError),h.onRecoverableError!==void 0&&(U=h.onRecoverableError),h.formState!==void 0&&(Q=h.formState)),l=SP(o,1,!0,l,h??null,y,_,Q,C,M,U,kP),l.context=EP(null),h=l.current,y=ra(),y=is(y),_=ys(y),_.callback=null,xs(h,_,y),h=y,l.current.lanes=h,$t(l,h),wi(l),o[Qi]=l.current,pw(o),new Cv(l)},nh.version="19.2.4",nh}var KP;function hV(){if(KP)return $w.exports;KP=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$w.exports=fV(),$w.exports}var mV=hV();/**
 * react-router v7.13.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var VP="popstate";function YP(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function pV(e={}){function t(r,a){var d;let i=(d=a.state)==null?void 0:d.masked,{pathname:s,search:c,hash:u}=i||r.location;return JS("",{pathname:s,search:c,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:Rh(a)}return gV(t,n,null,e)}function Xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ii(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vV(){return Math.random().toString(36).substring(2,10)}function GP(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function JS(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qd(t):t,state:n,key:t&&t.key||r||vV(),unstable_mask:a}}function Rh({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function qd(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function gV(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,s=a.history,c="POP",u=null,d=m();d==null&&(d=0,s.replaceState({...s.state,idx:d},""));function m(){return(s.state||{idx:null}).idx}function f(){c="POP";let S=m(),E=S==null?null:S-d;d=S,u&&u({action:c,location:w.location,delta:E})}function v(S,E){c="PUSH";let O=YP(S)?S:JS(w.location,S,E);d=m()+1;let j=GP(O,d),A=w.createHref(O.unstable_mask||O);try{s.pushState(j,"",A)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(A)}i&&u&&u({action:c,location:w.location,delta:1})}function g(S,E){c="REPLACE";let O=YP(S)?S:JS(w.location,S,E);d=m();let j=GP(O,d),A=w.createHref(O.unstable_mask||O);s.replaceState(j,"",A),i&&u&&u({action:c,location:w.location,delta:0})}function b(S){return yV(S)}let w={get action(){return c},get location(){return e(a,s)},listen(S){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(VP,f),u=S,()=>{a.removeEventListener(VP,f),u=null}},createHref(S){return t(a,S)},createURL:b,encodeLocation(S){let E=b(S);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:v,replace:g,go(S){return s.go(S)}};return w}function yV(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Xt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Rh(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function gz(e,t,n="/"){return xV(e,t,n,!1)}function xV(e,t,n,r){let a=typeof t=="string"?qd(t):t,i=Do(a.pathname||"/",n);if(i==null)return null;let s=yz(e);bV(s);let c=null;for(let u=0;c==null&&u<s.length;++u){let d=bz(i);c=NV(s[u],d,r)}return c}function yz(e,t=[],n=[],r="",a=!1){let i=(s,c,u=a,d)=>{let m={relativePath:d===void 0?s.path||"":d,caseSensitive:s.caseSensitive===!0,childrenIndex:c,route:s};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&u)return;Xt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let f=Ri([r,m.relativePath]),v=n.concat(m);s.children&&s.children.length>0&&(Xt(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),yz(s.children,t,v,f,u)),!(s.path==null&&!s.index)&&t.push({path:f,score:OV(f,s.index),routesMeta:v})};return e.forEach((s,c)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))i(s,c);else for(let d of xz(s.path))i(s,c,!0,d)}),t}function xz(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let s=xz(r.join("/")),c=[];return c.push(...s.map(u=>u===""?i:[i,u].join("/"))),a&&c.push(...s),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function bV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var wV=/^:[\w-]+$/,SV=3,EV=2,_V=1,jV=10,CV=-2,XP=e=>e==="*";function OV(e,t){let n=e.split("/"),r=n.length;return n.some(XP)&&(r+=CV),t&&(r+=EV),n.filter(a=>!XP(a)).reduce((a,i)=>a+(wV.test(i)?SV:i===""?_V:jV),r)}function AV(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function NV(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",s=[];for(let c=0;c<r.length;++c){let u=r[c],d=c===r.length-1,m=i==="/"?t:t.slice(i.length)||"/",f=Dh({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},m),v=u.route;if(!f&&d&&n&&!r[r.length-1].route.index&&(f=Dh({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},m)),!f)return null;Object.assign(a,f.params),s.push({params:a,pathname:Ri([i,f.pathname]),pathnameBase:RV(Ri([i,f.pathnameBase])),route:v}),f.pathnameBase!=="/"&&(i=Ri([i,f.pathnameBase]))}return s}function Dh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=TV(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:f},v)=>{if(m==="*"){let b=c[v]||"";s=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const g=c[v];return f&&!g?d[m]=void 0:d[m]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:s,pattern:e}}function TV(e,t=!1,n=!0){ii(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,c,u,d,m)=>{if(r.push({paramName:c,isOptional:u!=null}),u){let f=m.charAt(d+s.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function bz(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ii(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Do(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var PV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function MV(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?qd(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=WP(n.substring(1),"/"):i=WP(n,t)):i=t,{pathname:i,search:DV(r),hash:IV(a)}}function WP(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Fw(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function kV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wz(e){let t=kV(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function ij(e,t,n,r=!1){let a;typeof e=="string"?a=qd(e):(a={...e},Xt(!a.pathname||!a.pathname.includes("?"),Fw("?","pathname","search",a)),Xt(!a.pathname||!a.pathname.includes("#"),Fw("#","pathname","hash",a)),Xt(!a.search||!a.search.includes("#"),Fw("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,c;if(s==null)c=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),f-=1;a.pathname=v.join("/")}c=f>=0?t[f]:"/"}let u=MV(a,c),d=s&&s!=="/"&&s.endsWith("/"),m=(i||s===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||m)&&(u.pathname+="/"),u}var Ri=e=>e.join("/").replace(/\/\/+/g,"/"),RV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,IV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,LV=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function zV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function $V(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Sz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ez(e,t){let n=e;if(typeof n!="string"||!PV.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(Sz)try{let i=new URL(window.location.href),s=n.startsWith("//")?new URL(i.protocol+n):new URL(n),c=Do(s.pathname,t);s.origin===i.origin&&c!=null?n=c+s.search+s.hash:a=!0}catch{ii(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _z=["POST","PUT","PATCH","DELETE"];new Set(_z);var BV=["GET",..._z];new Set(BV);var Kd=x.createContext(null);Kd.displayName="DataRouter";var Yy=x.createContext(null);Yy.displayName="DataRouterState";var UV=x.createContext(!1),jz=x.createContext({isTransitioning:!1});jz.displayName="ViewTransition";var HV=x.createContext(new Map);HV.displayName="Fetchers";var FV=x.createContext(null);FV.displayName="Await";var za=x.createContext(null);za.displayName="Navigation";var Em=x.createContext(null);Em.displayName="Location";var ui=x.createContext({outlet:null,matches:[],isDataRoute:!1});ui.displayName="Route";var oj=x.createContext(null);oj.displayName="RouteError";var Cz="REACT_ROUTER_ERROR",qV="REDIRECT",KV="ROUTE_ERROR_RESPONSE";function VV(e){if(e.startsWith(`${Cz}:${qV}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function YV(e){if(e.startsWith(`${Cz}:${KV}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new LV(t.status,t.statusText,t.data)}catch{}}function GV(e,{relative:t}={}){Xt(Vd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(za),{hash:a,pathname:i,search:s}=_m(e,{relative:t}),c=i;return n!=="/"&&(c=i==="/"?n:Ri([n,i])),r.createHref({pathname:c,search:s,hash:a})}function Vd(){return x.useContext(Em)!=null}function di(){return Xt(Vd(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Em).location}function XV(e){Xt(Vd(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=di();return x.useMemo(()=>Dh(e,bz(t)),[t,e])}var Oz="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Az(e){x.useContext(za).static||x.useLayoutEffect(e)}function gl(){let{isDataRoute:e}=x.useContext(ui);return e?uY():WV()}function WV(){Xt(Vd(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Kd),{basename:t,navigator:n}=x.useContext(za),{matches:r}=x.useContext(ui),{pathname:a}=di(),i=JSON.stringify(wz(r)),s=x.useRef(!1);return Az(()=>{s.current=!0}),x.useCallback((u,d={})=>{if(ii(s.current,Oz),!s.current)return;if(typeof u=="number"){n.go(u);return}let m=ij(u,JSON.parse(i),a,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ri([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,i,a,e])}var QV=x.createContext(null);function ZV(e){let t=x.useContext(ui).outlet;return x.useMemo(()=>t&&x.createElement(QV.Provider,{value:e},t),[t,e])}function Gy(){let{matches:e}=x.useContext(ui),t=e[e.length-1];return t?t.params:{}}function _m(e,{relative:t}={}){let{matches:n}=x.useContext(ui),{pathname:r}=di(),a=JSON.stringify(wz(n));return x.useMemo(()=>ij(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function JV(e,t){return Nz(e,t)}function Nz(e,t,n){var S;Xt(Vd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=x.useContext(za),{matches:a}=x.useContext(ui),i=a[a.length-1],s=i?i.params:{},c=i?i.pathname:"/",u=i?i.pathnameBase:"/",d=i&&i.route;{let E=d&&d.path||"";Pz(c,!d||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=di(),f;if(t){let E=typeof t=="string"?qd(t):t;Xt(u==="/"||((S=E.pathname)==null?void 0:S.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${E.pathname}" was given in the \`location\` prop.`),f=E}else f=m;let v=f.pathname||"/",g=v;if(u!=="/"){let E=u.replace(/^\//,"").split("/");g="/"+v.replace(/^\//,"").split("/").slice(E.length).join("/")}let b=gz(e,{pathname:g});ii(d||b!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ii(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=aY(b&&b.map(E=>Object.assign({},E,{params:Object.assign({},s,E.params),pathname:Ri([u,r.encodeLocation?r.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?u:Ri([u,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),a,n);return t&&w?x.createElement(Em.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...f},navigationType:"POP"}},w):w}function eY(){let e=cY(),t=zV(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:i},"ErrorBoundary")," or"," ",x.createElement("code",{style:i},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:a},n):null,s)}var tY=x.createElement(eY,null),Tz=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=YV(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(ui.Provider,{value:this.props.routeContext},x.createElement(oj.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(nY,{error:e},t):t}};Tz.contextType=UV;var qw=new WeakMap;function nY({children:e,error:t}){let{basename:n}=x.useContext(za);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=VV(t.digest);if(r){let a=qw.get(t);if(a)throw a;let i=Ez(r.location,n);if(Sz&&!qw.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw qw.set(t,s),s}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function rY({routeContext:e,match:t,children:n}){let r=x.useContext(Kd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(ui.Provider,{value:e},n)}function aY(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let m=a.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id])!==void 0);Xt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,m+1))}let s=!1,c=-1;if(n&&r){s=r.renderFallback;for(let m=0;m<a.length;m++){let f=a[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=m),f.route.id){let{loaderData:v,errors:g}=r,b=f.route.loader&&!v.hasOwnProperty(f.route.id)&&(!g||g[f.route.id]===void 0);if(f.route.lazy||b){n.isStatic&&(s=!0),c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}}let u=n==null?void 0:n.onError,d=r&&u?(m,f)=>{var v,g;u(m,{location:r.location,params:((g=(v=r.matches)==null?void 0:v[0])==null?void 0:g.params)??{},unstable_pattern:$V(r.matches),errorInfo:f})}:void 0;return a.reduceRight((m,f,v)=>{let g,b=!1,w=null,S=null;r&&(g=i&&f.route.id?i[f.route.id]:void 0,w=f.route.errorElement||tY,s&&(c<0&&v===0?(Pz("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):c===v&&(b=!0,S=f.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,v+1)),O=()=>{let j;return g?j=w:b?j=S:f.route.Component?j=x.createElement(f.route.Component,null):f.route.element?j=f.route.element:j=m,x.createElement(rY,{match:f,routeContext:{outlet:m,matches:E,isDataRoute:r!=null},children:j})};return r&&(f.route.ErrorBoundary||f.route.errorElement||v===0)?x.createElement(Tz,{location:r.location,revalidation:r.revalidation,component:w,error:g,children:O(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:d}):O()},null)}function sj(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function iY(e){let t=x.useContext(Kd);return Xt(t,sj(e)),t}function oY(e){let t=x.useContext(Yy);return Xt(t,sj(e)),t}function sY(e){let t=x.useContext(ui);return Xt(t,sj(e)),t}function lj(e){let t=sY(e),n=t.matches[t.matches.length-1];return Xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function lY(){return lj("useRouteId")}function cY(){var r;let e=x.useContext(oj),t=oY("useRouteError"),n=lj("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function uY(){let{router:e}=iY("useNavigate"),t=lj("useNavigate"),n=x.useRef(!1);return Az(()=>{n.current=!0}),x.useCallback(async(a,i={})=>{ii(n.current,Oz),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var QP={};function Pz(e,t,n){!t&&!QP[e]&&(QP[e]=!0,ii(!1,n))}x.memo(dY);function dY({routes:e,future:t,state:n,isStatic:r,onError:a}){return Nz(e,void 0,{state:n,isStatic:r,onError:a})}function fY(e){return ZV(e.context)}function Ga(e){Xt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function hY({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:s}){Xt(!Vd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:c,navigator:a,static:i,unstable_useTransitions:s,future:{}}),[c,a,i,s]);typeof n=="string"&&(n=qd(n));let{pathname:d="/",search:m="",hash:f="",state:v=null,key:g="default",unstable_mask:b}=n,w=x.useMemo(()=>{let S=Do(d,c);return S==null?null:{location:{pathname:S,search:m,hash:f,state:v,key:g,unstable_mask:b},navigationType:r}},[c,d,m,f,v,g,r,b]);return ii(w!=null,`<Router basename="${c}"> is not able to match the URL "${d}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(za.Provider,{value:u},x.createElement(Em.Provider,{children:t,value:w}))}function mY({children:e,location:t}){return JV(eE(e),t)}function eE(e,t=[]){let n=[];return x.Children.forEach(e,(r,a)=>{if(!x.isValidElement(r))return;let i=[...t,a];if(r.type===x.Fragment){n.push.apply(n,eE(r.props.children,i));return}Xt(r.type===Ga,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Xt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=eE(r.props.children,i)),n.push(s)}),n}var ug="get",dg="application/x-www-form-urlencoded";function Xy(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function pY(e){return Xy(e)&&e.tagName.toLowerCase()==="button"}function vY(e){return Xy(e)&&e.tagName.toLowerCase()==="form"}function gY(e){return Xy(e)&&e.tagName.toLowerCase()==="input"}function yY(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xY(e,t){return e.button===0&&(!t||t==="_self")&&!yY(e)}function tE(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function bY(e,t){let n=tE(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var Nv=null;function wY(){if(Nv===null)try{new FormData(document.createElement("form"),0),Nv=!1}catch{Nv=!0}return Nv}var SY=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kw(e){return e!=null&&!SY.has(e)?(ii(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dg}"`),null):e}function EY(e,t){let n,r,a,i,s;if(vY(e)){let c=e.getAttribute("action");r=c?Do(c,t):null,n=e.getAttribute("method")||ug,a=Kw(e.getAttribute("enctype"))||dg,i=new FormData(e)}else if(pY(e)||gY(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(r=u?Do(u,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||ug,a=Kw(e.getAttribute("formenctype"))||Kw(c.getAttribute("enctype"))||dg,i=new FormData(c,e),!wY()){let{name:d,type:m,value:f}=e;if(m==="image"){let v=d?`${d}.`:"";i.append(`${v}x`,"0"),i.append(`${v}y`,"0")}else d&&i.append(d,f)}}else{if(Xy(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ug,r=null,a=dg,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cj(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _Y(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Do(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function jY(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function CY(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function OY(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let s=await jY(i,n);return s.links?s.links():[]}return[]}));return PY(r.flat(1).filter(CY).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function ZP(e,t,n,r,a,i){let s=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,c=(u,d)=>{var m;return n[d].pathname!==u.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==u.params["*"]};return i==="assets"?t.filter((u,d)=>s(u,d)||c(u,d)):i==="data"?t.filter((u,d)=>{var f;let m=r.routes[u.route.id];if(!m||!m.hasLoader)return!1;if(s(u,d)||c(u,d))return!0;if(u.route.shouldRevalidate){let v=u.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function AY(e,t,{includeHydrateFallback:n}={}){return NY(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function NY(e){return[...new Set(e)]}function TY(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function PY(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(TY(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function Mz(){let e=x.useContext(Kd);return cj(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function MY(){let e=x.useContext(Yy);return cj(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var uj=x.createContext(void 0);uj.displayName="FrameworkContext";function kz(){let e=x.useContext(uj);return cj(e,"You must render this element inside a <HydratedRouter> element"),e}function kY(e,t){let n=x.useContext(uj),[r,a]=x.useState(!1),[i,s]=x.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:m,onTouchStart:f}=t,v=x.useRef(null);x.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let w=E=>{E.forEach(O=>{s(O.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return v.current&&S.observe(v.current),()=>{S.disconnect()}}},[e]),x.useEffect(()=>{if(r){let w=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(w)}}},[r]);let g=()=>{a(!0)},b=()=>{a(!1),s(!1)};return n?e!=="intent"?[i,v,{}]:[i,v,{onFocus:rh(c,g),onBlur:rh(u,b),onMouseEnter:rh(d,g),onMouseLeave:rh(m,b),onTouchStart:rh(f,g)}]:[!1,v,{}]}function rh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function RY({page:e,...t}){let{router:n}=Mz(),r=x.useMemo(()=>gz(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(IY,{page:e,matches:r,...t}):null}function DY(e){let{manifest:t,routeModules:n}=kz(),[r,a]=x.useState([]);return x.useEffect(()=>{let i=!1;return OY(e,t,n).then(s=>{i||a(s)}),()=>{i=!0}},[e,t,n]),r}function IY({page:e,matches:t,...n}){let r=di(),{future:a,manifest:i,routeModules:s}=kz(),{basename:c}=Mz(),{loaderData:u,matches:d}=MY(),m=x.useMemo(()=>ZP(e,t,d,i,r,"data"),[e,t,d,i,r]),f=x.useMemo(()=>ZP(e,t,d,i,r,"assets"),[e,t,d,i,r]),v=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(t.forEach(O=>{var A;let j=i.routes[O.route.id];!j||!j.hasLoader||(!m.some(N=>N.route.id===O.route.id)&&O.route.id in u&&((A=s[O.route.id])!=null&&A.shouldRevalidate)||j.hasClientLoader?S=!0:w.add(O.route.id))}),w.size===0)return[];let E=_Y(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return S&&w.size>0&&E.searchParams.set("_routes",t.filter(O=>w.has(O.route.id)).map(O=>O.route.id).join(",")),[E.pathname+E.search]},[c,a.unstable_trailingSlashAwareDataRequests,u,r,i,m,t,e,s]),g=x.useMemo(()=>AY(f,i),[f,i]),b=DY(f);return x.createElement(x.Fragment,null,v.map(w=>x.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),g.map(w=>x.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:S})=>x.createElement("link",{key:w,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function LY(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var zY=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{zY&&(window.__reactRouterVersion="7.13.1")}catch{}function $Y({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=x.useRef();a.current==null&&(a.current=pV({window:r,v5Compat:!0}));let i=a.current,[s,c]=x.useState({action:i.action,location:i.location}),u=x.useCallback(d=>{n===!1?c(d):x.startTransition(()=>c(d))},[n]);return x.useLayoutEffect(()=>i.listen(u),[i,u]),x.createElement(hY,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:i,unstable_useTransitions:n})}var Rz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gr=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:s,unstable_mask:c,state:u,target:d,to:m,preventScrollReset:f,viewTransition:v,unstable_defaultShouldRevalidate:g,...b},w){let{basename:S,navigator:E,unstable_useTransitions:O}=x.useContext(za),j=typeof m=="string"&&Rz.test(m),A=Ez(m,S);m=A.to;let N=GV(m,{relative:a}),T=di(),P=null;if(c){let Y=ij(c,[],T.unstable_mask?T.unstable_mask.pathname:"/",!0);S!=="/"&&(Y.pathname=Y.pathname==="/"?S:Ri([S,Y.pathname])),P=E.createHref(Y)}let[R,D,K]=kY(r,b),z=HY(m,{replace:s,unstable_mask:c,state:u,target:d,preventScrollReset:f,relative:a,viewTransition:v,unstable_defaultShouldRevalidate:g,unstable_useTransitions:O});function I(Y){t&&t(Y),Y.defaultPrevented||z(Y)}let G=!(A.isExternal||i),L=x.createElement("a",{...b,...K,href:(G?P:void 0)||A.absoluteURL||N,onClick:G?I:t,ref:LY(w,D),target:d,"data-discover":!j&&n==="render"?"true":void 0});return R&&!j?x.createElement(x.Fragment,null,L,x.createElement(RY,{page:N})):L});gr.displayName="Link";var nE=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:s,viewTransition:c,children:u,...d},m){let f=_m(s,{relative:d.relative}),v=di(),g=x.useContext(Yy),{navigator:b,basename:w}=x.useContext(za),S=g!=null&&GY(f)&&c===!0,E=b.encodeLocation?b.encodeLocation(f).pathname:f.pathname,O=v.pathname,j=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(O=O.toLowerCase(),j=j?j.toLowerCase():null,E=E.toLowerCase()),j&&w&&(j=Do(j,w)||j);const A=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let N=O===E||!a&&O.startsWith(E)&&O.charAt(A)==="/",T=j!=null&&(j===E||!a&&j.startsWith(E)&&j.charAt(E.length)==="/"),P={isActive:N,isPending:T,isTransitioning:S},R=N?t:void 0,D;typeof r=="function"?D=r(P):D=[r,N?"active":null,T?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let K=typeof i=="function"?i(P):i;return x.createElement(gr,{...d,"aria-current":R,className:D,ref:m,style:K,to:s,viewTransition:c},typeof u=="function"?u(P):u)});nE.displayName="NavLink";var BY=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:s=ug,action:c,onSubmit:u,relative:d,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:v,...g},b)=>{let{unstable_useTransitions:w}=x.useContext(za),S=VY(),E=YY(c,{relative:d}),O=s.toLowerCase()==="get"?"get":"post",j=typeof c=="string"&&Rz.test(c),A=N=>{if(u&&u(N),N.defaultPrevented)return;N.preventDefault();let T=N.nativeEvent.submitter,P=(T==null?void 0:T.getAttribute("formmethod"))||s,R=()=>S(T||N.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:a,state:i,relative:d,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:v});w&&n!==!1?x.startTransition(()=>R()):R()};return x.createElement("form",{ref:b,method:O,action:E,onSubmit:r?u:A,...g,"data-discover":!j&&e==="render"?"true":void 0})});BY.displayName="Form";function UY(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Dz(e){let t=x.useContext(Kd);return Xt(t,UY(e)),t}function HY(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let m=gl(),f=di(),v=_m(e,{relative:s});return x.useCallback(g=>{if(xY(g,t)){g.preventDefault();let b=n!==void 0?n:Rh(f)===Rh(v),w=()=>m(e,{replace:b,unstable_mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:u});d?x.startTransition(()=>w()):w()}},[f,m,v,n,r,a,t,e,i,s,c,u,d])}function FY(e){ii(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(tE(e)),n=x.useRef(!1),r=di(),a=x.useMemo(()=>bY(r.search,n.current?null:t.current),[r.search]),i=gl(),s=x.useCallback((c,u)=>{const d=tE(typeof c=="function"?c(new URLSearchParams(a)):c);n.current=!0,i("?"+d,u)},[i,a]);return[a,s]}var qY=0,KY=()=>`__${String(++qY)}__`;function VY(){let{router:e}=Dz("useSubmit"),{basename:t}=x.useContext(za),n=lY(),r=e.fetch,a=e.navigate;return x.useCallback(async(i,s={})=>{let{action:c,method:u,encType:d,formData:m,body:f}=EY(i,t);if(s.navigate===!1){let v=s.fetcherKey||KY();await r(v,n,s.action||c,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:m,body:f,formMethod:s.method||u,formEncType:s.encType||d,flushSync:s.flushSync})}else await a(s.action||c,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:m,body:f,formMethod:s.method||u,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[r,a,t,n])}function YY(e,{relative:t}={}){let{basename:n}=x.useContext(za),r=x.useContext(ui);Xt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={..._m(e||".",{relative:t})},s=di();if(e==null){i.search=s.search;let c=new URLSearchParams(i.search),u=c.getAll("index");if(u.some(m=>m==="")){c.delete("index"),u.filter(f=>f).forEach(f=>c.append("index",f));let m=c.toString();i.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Ri([n,i.pathname])),Rh(i)}function GY(e,{relative:t}={}){let n=x.useContext(jz);Xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Dz("useViewTransitionState"),a=_m(e,{relative:t});if(!n.isTransitioning)return!1;let i=Do(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Do(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Dh(a.pathname,s)!=null||Dh(a.pathname,i)!=null}var yl=vz();const Iz=ci(yl);var Yc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},XY={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ys,rj,az,WY=(az=class{constructor(){je(this,Ys,XY);je(this,rj,!1)}setTimeoutProvider(e){Se(this,Ys,e)}setTimeout(e,t){return W(this,Ys).setTimeout(e,t)}clearTimeout(e){W(this,Ys).clearTimeout(e)}setInterval(e,t){return W(this,Ys).setInterval(e,t)}clearInterval(e){W(this,Ys).clearInterval(e)}},Ys=new WeakMap,rj=new WeakMap,az),sc=new WY;function QY(e){setTimeout(e,0)}var Cc=typeof window>"u"||"Deno"in globalThis;function pr(){}function ZY(e,t){return typeof e=="function"?e(t):e}function rE(e){return typeof e=="number"&&e>=0&&e!==1/0}function Lz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function al(e,t){return typeof e=="function"?e(t):e}function ka(e,t){return typeof e=="function"?e(t):e}function JP(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:s,stale:c}=e;if(s){if(r){if(t.queryHash!==dj(s,t.options))return!1}else if(!Ih(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||i&&!i(t))}function eM(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Oc(t.options.mutationKey)!==Oc(i))return!1}else if(!Ih(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function dj(e,t){return((t==null?void 0:t.queryKeyHashFn)||Oc)(e)}function Oc(e){return JSON.stringify(e,(t,n)=>aE(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Ih(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ih(e[n],t[n])):!1}var JY=Object.prototype.hasOwnProperty;function fj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=tM(e)&&tM(t);if(!r&&!(aE(e)&&aE(t)))return t;const i=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),c=s.length,u=r?new Array(c):{};let d=0;for(let m=0;m<c;m++){const f=r?m:s[m],v=e[f],g=t[f];if(v===g){u[f]=v,(r?m<i:JY.call(e,f))&&d++;continue}if(v===null||g===null||typeof v!="object"||typeof g!="object"){u[f]=g;continue}const b=fj(v,g,n+1);u[f]=b,b===v&&d++}return i===c&&d===i?e:u}function Lh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function tM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function aE(e){if(!nM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!nM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function nM(e){return Object.prototype.toString.call(e)==="[object Object]"}function eG(e){return new Promise(t=>{sc.setTimeout(t,e)})}function iE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?fj(e,t):t}function tG(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nG(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var hj=Symbol();function zz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mj(e,t){return typeof e=="function"?e(...t):!!e}function rG(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var fc,Gs,ld,iz,aG=(iz=class extends Yc{constructor(){super();je(this,fc);je(this,Gs);je(this,ld);Se(this,ld,t=>{if(!Cc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Gs)||this.setEventListener(W(this,ld))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Gs))==null||t.call(this),Se(this,Gs,void 0))}setEventListener(t){var n;Se(this,ld,t),(n=W(this,Gs))==null||n.call(this),Se(this,Gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,fc)!==t&&(Se(this,fc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,fc)=="boolean"?W(this,fc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fc=new WeakMap,Gs=new WeakMap,ld=new WeakMap,iz),pj=new aG;function oE(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var iG=QY;function oG(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=iG;const i=c=>{t?e.push(c):a(()=>{n(c)})},s=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;t++;try{u=c()}finally{t--,t||s()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var on=oG(),cd,Xs,ud,oz,sG=(oz=class extends Yc{constructor(){super();je(this,cd,!0);je(this,Xs);je(this,ud);Se(this,ud,t=>{if(!Cc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Xs)||this.setEventListener(W(this,ud))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Xs))==null||t.call(this),Se(this,Xs,void 0))}setEventListener(t){var n;Se(this,ud,t),(n=W(this,Xs))==null||n.call(this),Se(this,Xs,t(this.setOnline.bind(this)))}setOnline(t){W(this,cd)!==t&&(Se(this,cd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,cd)}},cd=new WeakMap,Xs=new WeakMap,ud=new WeakMap,oz),Ng=new sG;function lG(e){return Math.min(1e3*2**e,3e4)}function $z(e){return(e??"online")==="online"?Ng.isOnline():!0}var sE=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Bz(e){let t=!1,n=0,r;const a=oE(),i=()=>a.status!=="pending",s=w=>{var S;if(!i()){const E=new sE(w);v(E),(S=e.onCancel)==null||S.call(e,E)}},c=()=>{t=!0},u=()=>{t=!1},d=()=>pj.isFocused()&&(e.networkMode==="always"||Ng.isOnline())&&e.canRun(),m=()=>$z(e.networkMode)&&e.canRun(),f=w=>{i()||(r==null||r(),a.resolve(w))},v=w=>{i()||(r==null||r(),a.reject(w))},g=()=>new Promise(w=>{var S;r=E=>{(i()||d())&&w(E)},(S=e.onPause)==null||S.call(e)}).then(()=>{var w;r=void 0,i()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(i())return;let w;const S=n===0?e.initialPromise:void 0;try{w=S??e.fn()}catch(E){w=Promise.reject(E)}Promise.resolve(w).then(f).catch(E=>{var T;if(i())return;const O=e.retry??(Cc?0:3),j=e.retryDelay??lG,A=typeof j=="function"?j(n,E):j,N=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,E);if(t||!N){v(E);return}n++,(T=e.onFail)==null||T.call(e,n,E),eG(A).then(()=>d()?void 0:g()).then(()=>{t?v(E):b()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:u,canStart:m,start:()=>(m()?b():g().then(b),a)}}var hc,sz,Uz=(sz=class{constructor(){je(this,hc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rE(this.gcTime)&&Se(this,hc,sc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cc?1/0:300*1e3))}clearGcTimeout(){W(this,hc)&&(sc.clearTimeout(W(this,hc)),Se(this,hc,void 0))}},hc=new WeakMap,sz),mc,dd,Pa,pc,qn,mm,vc,Wa,bo,lz,cG=(lz=class extends Uz{constructor(t){super();je(this,Wa);je(this,mc);je(this,dd);je(this,Pa);je(this,pc);je(this,qn);je(this,mm);je(this,vc);Se(this,vc,!1),Se(this,mm,t.defaultOptions),this.setOptions(t.options),this.observers=[],Se(this,pc,t.client),Se(this,Pa,W(this,pc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Se(this,mc,aM(this.options)),this.state=t.state??W(this,mc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,qn))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,mm),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=aM(this.options);n.data!==void 0&&(this.setState(rM(n.data,n.dataUpdatedAt)),Se(this,mc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Pa).remove(this)}setData(t,n){const r=iE(this.state.data,t,this.options);return He(this,Wa,bo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){He(this,Wa,bo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=W(this,qn))==null?void 0:r.promise;return(a=W(this,qn))==null||a.cancel(t),n?n.then(pr).catch(pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,mc))}isActive(){return this.observers.some(t=>ka(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>al(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Lz(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,qn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,qn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,Pa).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,qn)&&(W(this,vc)?W(this,qn).cancel({revert:!0}):W(this,qn).cancelRetry()),this.scheduleGc()),W(this,Pa).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,Wa,bo).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,m,f,v,g,b,w,S,E,O,j;if(this.state.fetchStatus!=="idle"&&((u=W(this,qn))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,qn))return W(this,qn).continueRetry(),W(this,qn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(N=>N.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,a=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Se(this,vc,!0),r.signal)})},i=()=>{const A=zz(this.options,n),T=(()=>{const P={client:W(this,pc),queryKey:this.queryKey,meta:this.meta};return a(P),P})();return Se(this,vc,!1),this.options.persister?this.options.persister(A,T,this):A(T)},c=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,pc),state:this.state,fetchFn:i};return a(A),A})();(d=this.options.behavior)==null||d.onFetch(c,this),Se(this,dd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&He(this,Wa,bo).call(this,{type:"fetch",meta:(f=c.fetchOptions)==null?void 0:f.meta}),Se(this,qn,Bz({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:A=>{A instanceof sE&&A.revert&&this.setState({...W(this,dd),fetchStatus:"idle"}),r.abort()},onFail:(A,N)=>{He(this,Wa,bo).call(this,{type:"failed",failureCount:A,error:N})},onPause:()=>{He(this,Wa,bo).call(this,{type:"pause"})},onContinue:()=>{He(this,Wa,bo).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const A=await W(this,qn).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(g=(v=W(this,Pa).config).onSuccess)==null||g.call(v,A,this),(w=(b=W(this,Pa).config).onSettled)==null||w.call(b,A,this.state.error,this),A}catch(A){if(A instanceof sE){if(A.silent)return W(this,qn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw He(this,Wa,bo).call(this,{type:"error",error:A}),(E=(S=W(this,Pa).config).onError)==null||E.call(S,A,this),(j=(O=W(this,Pa).config).onSettled)==null||j.call(O,this.state.data,A,this),A}finally{this.scheduleGc()}}},mc=new WeakMap,dd=new WeakMap,Pa=new WeakMap,pc=new WeakMap,qn=new WeakMap,mm=new WeakMap,vc=new WeakMap,Wa=new WeakSet,bo=function(t){const n=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,...Hz(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...rM(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Se(this,dd,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),on.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,Pa).notify({query:this,type:"updated",action:t})})},lz);function Hz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$z(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function rM(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function aM(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Fr,st,pm,Cr,gc,fd,So,Ws,vm,hd,md,yc,xc,Qs,pd,St,Eh,lE,cE,uE,dE,fE,hE,mE,Fz,cz,vj=(cz=class extends Yc{constructor(t,n){super();je(this,St);je(this,Fr);je(this,st);je(this,pm);je(this,Cr);je(this,gc);je(this,fd);je(this,So);je(this,Ws);je(this,vm);je(this,hd);je(this,md);je(this,yc);je(this,xc);je(this,Qs);je(this,pd,new Set);this.options=n,Se(this,Fr,t),Se(this,Ws,null),Se(this,So,oE()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,st).addObserver(this),iM(W(this,st),this.options)?He(this,St,Eh).call(this):this.updateResult(),He(this,St,dE).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pE(W(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pE(W(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,St,fE).call(this),He(this,St,hE).call(this),W(this,st).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,st);if(this.options=W(this,Fr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ka(this.options.enabled,W(this,st))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,St,mE).call(this),W(this,st).setOptions(this.options),n._defaulted&&!Lh(this.options,n)&&W(this,Fr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,st),observer:this});const a=this.hasListeners();a&&oM(W(this,st),r,this.options,n)&&He(this,St,Eh).call(this),this.updateResult(),a&&(W(this,st)!==r||ka(this.options.enabled,W(this,st))!==ka(n.enabled,W(this,st))||al(this.options.staleTime,W(this,st))!==al(n.staleTime,W(this,st)))&&He(this,St,lE).call(this);const i=He(this,St,cE).call(this);a&&(W(this,st)!==r||ka(this.options.enabled,W(this,st))!==ka(n.enabled,W(this,st))||i!==W(this,Qs))&&He(this,St,uE).call(this,i)}getOptimisticResult(t){const n=W(this,Fr).getQueryCache().build(W(this,Fr),t),r=this.createResult(n,t);return dG(this,r)&&(Se(this,Cr,r),Se(this,fd,this.options),Se(this,gc,W(this,st).state)),r}getCurrentResult(){return W(this,Cr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,So).status==="pending"&&W(this,So).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){W(this,pd).add(t)}getCurrentQuery(){return W(this,st)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,Fr).defaultQueryOptions(t),r=W(this,Fr).getQueryCache().build(W(this,Fr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return He(this,St,Eh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Cr)))}createResult(t,n){var D;const r=W(this,st),a=this.options,i=W(this,Cr),s=W(this,gc),c=W(this,fd),d=t!==r?t.state:W(this,pm),{state:m}=t;let f={...m},v=!1,g;if(n._optimisticResults){const K=this.hasListeners(),z=!K&&iM(t,n),I=K&&oM(t,r,n,a);(z||I)&&(f={...f,...Hz(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=f;g=f.data;let E=!1;if(n.placeholderData!==void 0&&g===void 0&&S==="pending"){let K;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(K=i.data,E=!0):K=typeof n.placeholderData=="function"?n.placeholderData((D=W(this,md))==null?void 0:D.state.data,W(this,md)):n.placeholderData,K!==void 0&&(S="success",g=iE(i==null?void 0:i.data,K,n),v=!0)}if(n.select&&g!==void 0&&!E)if(i&&g===(s==null?void 0:s.data)&&n.select===W(this,vm))g=W(this,hd);else try{Se(this,vm,n.select),g=n.select(g),g=iE(i==null?void 0:i.data,g,n),Se(this,hd,g),Se(this,Ws,null)}catch(K){Se(this,Ws,K)}W(this,Ws)&&(b=W(this,Ws),g=W(this,hd),w=Date.now(),S="error");const O=f.fetchStatus==="fetching",j=S==="pending",A=S==="error",N=j&&O,T=g!==void 0,R={status:S,fetchStatus:f.fetchStatus,isPending:j,isSuccess:S==="success",isError:A,isInitialLoading:N,isLoading:N,data:g,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:O,isRefetching:O&&!j,isLoadingError:A&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:A&&T,isStale:gj(t,n),refetch:this.refetch,promise:W(this,So),isEnabled:ka(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const K=R.data!==void 0,z=R.status==="error"&&!K,I=Y=>{z?Y.reject(R.error):K&&Y.resolve(R.data)},G=()=>{const Y=Se(this,So,R.promise=oE());I(Y)},L=W(this,So);switch(L.status){case"pending":t.queryHash===r.queryHash&&I(L);break;case"fulfilled":(z||R.data!==L.value)&&G();break;case"rejected":(!z||R.error!==L.reason)&&G();break}}return R}updateResult(){const t=W(this,Cr),n=this.createResult(W(this,st),this.options);if(Se(this,gc,W(this,st).state),Se(this,fd,this.options),W(this,gc).data!==void 0&&Se(this,md,W(this,st)),Lh(n,t))return;Se(this,Cr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!W(this,pd).size)return!0;const s=new Set(i??W(this,pd));return this.options.throwOnError&&s.add("error"),Object.keys(W(this,Cr)).some(c=>{const u=c;return W(this,Cr)[u]!==t[u]&&s.has(u)})};He(this,St,Fz).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,St,dE).call(this)}},Fr=new WeakMap,st=new WeakMap,pm=new WeakMap,Cr=new WeakMap,gc=new WeakMap,fd=new WeakMap,So=new WeakMap,Ws=new WeakMap,vm=new WeakMap,hd=new WeakMap,md=new WeakMap,yc=new WeakMap,xc=new WeakMap,Qs=new WeakMap,pd=new WeakMap,St=new WeakSet,Eh=function(t){He(this,St,mE).call(this);let n=W(this,st).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(pr)),n},lE=function(){He(this,St,fE).call(this);const t=al(this.options.staleTime,W(this,st));if(Cc||W(this,Cr).isStale||!rE(t))return;const r=Lz(W(this,Cr).dataUpdatedAt,t)+1;Se(this,yc,sc.setTimeout(()=>{W(this,Cr).isStale||this.updateResult()},r))},cE=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,st)):this.options.refetchInterval)??!1},uE=function(t){He(this,St,hE).call(this),Se(this,Qs,t),!(Cc||ka(this.options.enabled,W(this,st))===!1||!rE(W(this,Qs))||W(this,Qs)===0)&&Se(this,xc,sc.setInterval(()=>{(this.options.refetchIntervalInBackground||pj.isFocused())&&He(this,St,Eh).call(this)},W(this,Qs)))},dE=function(){He(this,St,lE).call(this),He(this,St,uE).call(this,He(this,St,cE).call(this))},fE=function(){W(this,yc)&&(sc.clearTimeout(W(this,yc)),Se(this,yc,void 0))},hE=function(){W(this,xc)&&(sc.clearInterval(W(this,xc)),Se(this,xc,void 0))},mE=function(){const t=W(this,Fr).getQueryCache().build(W(this,Fr),this.options);if(t===W(this,st))return;const n=W(this,st);Se(this,st,t),Se(this,pm,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Fz=function(t){on.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Cr))}),W(this,Fr).getQueryCache().notify({query:W(this,st),type:"observerResultsUpdated"})})},cz);function uG(e,t){return ka(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function iM(e,t){return uG(e,t)||e.state.data!==void 0&&pE(e,t,t.refetchOnMount)}function pE(e,t,n){if(ka(t.enabled,e)!==!1&&al(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&gj(e,t)}return!1}function oM(e,t,n,r){return(e!==t||ka(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&gj(e,n)}function gj(e,t){return ka(t.enabled,e)!==!1&&e.isStaleByTime(al(t.staleTime,e))}function dG(e,t){return!Lh(e.getCurrentResult(),t)}function sM(e){return{onFetch:(t,n)=>{var m,f,v,g,b;const r=t.options,a=(v=(f=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:f.fetchMore)==null?void 0:v.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],s=((b=t.state.data)==null?void 0:b.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const d=async()=>{let w=!1;const S=j=>{rG(j,()=>t.signal,()=>w=!0)},E=zz(t.options,t.fetchOptions),O=async(j,A,N)=>{if(w)return Promise.reject();if(A==null&&j.pages.length)return Promise.resolve(j);const P=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:A,direction:N?"backward":"forward",meta:t.options.meta};return S(z),z})(),R=await E(P),{maxPages:D}=t.options,K=N?nG:tG;return{pages:K(j.pages,R,D),pageParams:K(j.pageParams,A,D)}};if(a&&i.length){const j=a==="backward",A=j?fG:lM,N={pages:i,pageParams:s},T=A(r,N);c=await O(N,T,j)}else{const j=e??i.length;do{const A=u===0?s[0]??r.initialPageParam:lM(r,c);if(u>0&&A==null)break;c=await O(c,A),u++}while(u<j)}return c};t.options.persister?t.fetchFn=()=>{var w,S;return(S=(w=t.options).persister)==null?void 0:S.call(w,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function lM(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function fG(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var gm,Ci,hr,bc,Oi,Bs,uz,hG=(uz=class extends Uz{constructor(t){super();je(this,Oi);je(this,gm);je(this,Ci);je(this,hr);je(this,bc);Se(this,gm,t.client),this.mutationId=t.mutationId,Se(this,hr,t.mutationCache),Se(this,Ci,[]),this.state=t.state||qz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,Ci).includes(t)||(W(this,Ci).push(t),this.clearGcTimeout(),W(this,hr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Se(this,Ci,W(this,Ci).filter(n=>n!==t)),this.scheduleGc(),W(this,hr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,Ci).length||(this.state.status==="pending"?this.scheduleGc():W(this,hr).remove(this))}continue(){var t;return((t=W(this,bc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,c,u,d,m,f,v,g,b,w,S,E,O,j,A,N,T,P;const n=()=>{He(this,Oi,Bs).call(this,{type:"continue"})},r={client:W(this,gm),meta:this.options.meta,mutationKey:this.options.mutationKey};Se(this,bc,Bz({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,D)=>{He(this,Oi,Bs).call(this,{type:"failed",failureCount:R,error:D})},onPause:()=>{He(this,Oi,Bs).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,hr).canRun(this)}));const a=this.state.status==="pending",i=!W(this,bc).canStart();try{if(a)n();else{He(this,Oi,Bs).call(this,{type:"pending",variables:t,isPaused:i}),W(this,hr).config.onMutate&&await W(this,hr).config.onMutate(t,this,r);const D=await((c=(s=this.options).onMutate)==null?void 0:c.call(s,t,r));D!==this.state.context&&He(this,Oi,Bs).call(this,{type:"pending",context:D,variables:t,isPaused:i})}const R=await W(this,bc).start();return await((d=(u=W(this,hr).config).onSuccess)==null?void 0:d.call(u,R,t,this.state.context,this,r)),await((f=(m=this.options).onSuccess)==null?void 0:f.call(m,R,t,this.state.context,r)),await((g=(v=W(this,hr).config).onSettled)==null?void 0:g.call(v,R,null,this.state.variables,this.state.context,this,r)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,R,null,t,this.state.context,r)),He(this,Oi,Bs).call(this,{type:"success",data:R}),R}catch(R){try{await((E=(S=W(this,hr).config).onError)==null?void 0:E.call(S,R,t,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((j=(O=this.options).onError)==null?void 0:j.call(O,R,t,this.state.context,r))}catch(D){Promise.reject(D)}try{await((N=(A=W(this,hr).config).onSettled)==null?void 0:N.call(A,void 0,R,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((P=(T=this.options).onSettled)==null?void 0:P.call(T,void 0,R,t,this.state.context,r))}catch(D){Promise.reject(D)}throw He(this,Oi,Bs).call(this,{type:"error",error:R}),R}finally{W(this,hr).runNext(this)}}},gm=new WeakMap,Ci=new WeakMap,hr=new WeakMap,bc=new WeakMap,Oi=new WeakSet,Bs=function(t){const n=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=n(this.state),on.batch(()=>{W(this,Ci).forEach(r=>{r.onMutationUpdate(t)}),W(this,hr).notify({mutation:this,type:"updated",action:t})})},uz);function qz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Eo,Qa,ym,dz,mG=(dz=class extends Yc{constructor(t={}){super();je(this,Eo);je(this,Qa);je(this,ym);this.config=t,Se(this,Eo,new Set),Se(this,Qa,new Map),Se(this,ym,0)}build(t,n,r){const a=new hG({client:t,mutationCache:this,mutationId:++Av(this,ym)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){W(this,Eo).add(t);const n=Tv(t);if(typeof n=="string"){const r=W(this,Qa).get(n);r?r.push(t):W(this,Qa).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Eo).delete(t)){const n=Tv(t);if(typeof n=="string"){const r=W(this,Qa).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&W(this,Qa).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Tv(t);if(typeof n=="string"){const r=W(this,Qa).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=Tv(t);if(typeof n=="string"){const a=(r=W(this,Qa).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){on.batch(()=>{W(this,Eo).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Eo).clear(),W(this,Qa).clear()})}getAll(){return Array.from(W(this,Eo))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>eM(n,r))}findAll(t={}){return this.getAll().filter(n=>eM(t,n))}notify(t){on.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return on.batch(()=>Promise.all(t.map(n=>n.continue().catch(pr))))}},Eo=new WeakMap,Qa=new WeakMap,ym=new WeakMap,dz);function Tv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var _o,Zs,qr,jo,Ro,fg,vE,fz,pG=(fz=class extends Yc{constructor(n,r){super();je(this,Ro);je(this,_o);je(this,Zs);je(this,qr);je(this,jo);Se(this,_o,n),this.setOptions(r),this.bindMethods(),He(this,Ro,fg).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=W(this,_o).defaultMutationOptions(n),Lh(this.options,r)||W(this,_o).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,qr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Oc(r.mutationKey)!==Oc(this.options.mutationKey)?this.reset():((a=W(this,qr))==null?void 0:a.state.status)==="pending"&&W(this,qr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,qr))==null||n.removeObserver(this)}onMutationUpdate(n){He(this,Ro,fg).call(this),He(this,Ro,vE).call(this,n)}getCurrentResult(){return W(this,Zs)}reset(){var n;(n=W(this,qr))==null||n.removeObserver(this),Se(this,qr,void 0),He(this,Ro,fg).call(this),He(this,Ro,vE).call(this)}mutate(n,r){var a;return Se(this,jo,r),(a=W(this,qr))==null||a.removeObserver(this),Se(this,qr,W(this,_o).getMutationCache().build(W(this,_o),this.options)),W(this,qr).addObserver(this),W(this,qr).execute(n)}},_o=new WeakMap,Zs=new WeakMap,qr=new WeakMap,jo=new WeakMap,Ro=new WeakSet,fg=function(){var r;const n=((r=W(this,qr))==null?void 0:r.state)??qz();Se(this,Zs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vE=function(n){on.batch(()=>{var r,a,i,s,c,u,d,m;if(W(this,jo)&&this.hasListeners()){const f=W(this,Zs).variables,v=W(this,Zs).context,g={client:W(this,_o),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=W(this,jo)).onSuccess)==null||a.call(r,n.data,f,v,g)}catch(b){Promise.reject(b)}try{(s=(i=W(this,jo)).onSettled)==null||s.call(i,n.data,null,f,v,g)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(u=(c=W(this,jo)).onError)==null||u.call(c,n.error,f,v,g)}catch(b){Promise.reject(b)}try{(m=(d=W(this,jo)).onSettled)==null||m.call(d,void 0,n.error,f,v,g)}catch(b){Promise.reject(b)}}}this.listeners.forEach(f=>{f(W(this,Zs))})})},fz);function cM(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function vG(e,t,n){const r=e.slice(0);return r[t]=n,r}var vd,aa,gd,yd,Ma,Js,xm,bm,wm,Sm,ar,gE,yE,xE,bE,wE,hz,gG=(hz=class extends Yc{constructor(t,n,r){super();je(this,ar);je(this,vd);je(this,aa);je(this,gd);je(this,yd);je(this,Ma);je(this,Js);je(this,xm);je(this,bm);je(this,wm);je(this,Sm,[]);Se(this,vd,t),Se(this,yd,r),Se(this,gd,[]),Se(this,Ma,[]),Se(this,aa,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,Ma).forEach(t=>{t.subscribe(n=>{He(this,ar,bE).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,Ma).forEach(t=>{t.destroy()})}setQueries(t,n){Se(this,gd,t),Se(this,yd,n),on.batch(()=>{const r=W(this,Ma),a=He(this,ar,xE).call(this,W(this,gd));a.forEach(f=>f.observer.setOptions(f.defaultedQueryOptions));const i=a.map(f=>f.observer),s=i.map(f=>f.getCurrentResult()),c=r.length!==i.length,u=i.some((f,v)=>f!==r[v]),d=c||u,m=d?!0:s.some((f,v)=>{const g=W(this,aa)[v];return!g||!Lh(f,g)});!d&&!m||(d&&(Se(this,Sm,a),Se(this,Ma,i)),Se(this,aa,s),this.hasListeners()&&(d&&(cM(r,i).forEach(f=>{f.destroy()}),cM(i,r).forEach(f=>{f.subscribe(v=>{He(this,ar,bE).call(this,f,v)})})),He(this,ar,wE).call(this)))})}getCurrentResult(){return W(this,aa)}getQueries(){return W(this,Ma).map(t=>t.getCurrentQuery())}getObservers(){return W(this,Ma)}getOptimisticResult(t,n){const r=He(this,ar,xE).call(this,t),a=r.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions)),i=r.map(s=>s.defaultedQueryOptions.queryHash);return[a,s=>He(this,ar,yE).call(this,s??a,n,i),()=>He(this,ar,gE).call(this,a,r)]}},vd=new WeakMap,aa=new WeakMap,gd=new WeakMap,yd=new WeakMap,Ma=new WeakMap,Js=new WeakMap,xm=new WeakMap,bm=new WeakMap,wm=new WeakMap,Sm=new WeakMap,ar=new WeakSet,gE=function(t,n){return n.map((r,a)=>{const i=t[a];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,s=>{n.forEach(c=>{c.observer.trackProp(s)})})})},yE=function(t,n,r){if(n){const a=W(this,wm),i=r!==void 0&&a!==void 0&&(a.length!==r.length||r.some((s,c)=>s!==a[c]));return(!W(this,Js)||W(this,aa)!==W(this,bm)||i||n!==W(this,xm))&&(Se(this,xm,n),Se(this,bm,W(this,aa)),r!==void 0&&Se(this,wm,r),Se(this,Js,fj(W(this,Js),n(t)))),W(this,Js)}return t},xE=function(t){const n=new Map;W(this,Ma).forEach(a=>{const i=a.options.queryHash;if(!i)return;const s=n.get(i);s?s.push(a):n.set(i,[a])});const r=[];return t.forEach(a=>{var u;const i=W(this,vd).defaultQueryOptions(a),c=((u=n.get(i.queryHash))==null?void 0:u.shift())??new vj(W(this,vd),i);r.push({defaultedQueryOptions:i,observer:c})}),r},bE=function(t,n){const r=W(this,Ma).indexOf(t);r!==-1&&(Se(this,aa,vG(W(this,aa),r,n)),He(this,ar,wE).call(this))},wE=function(){var t;if(this.hasListeners()){const n=W(this,Js),r=He(this,ar,gE).call(this,W(this,aa),W(this,Sm)),a=He(this,ar,yE).call(this,r,(t=W(this,yd))==null?void 0:t.combine);n!==a&&on.batch(()=>{this.listeners.forEach(i=>{i(W(this,aa))})})}},hz),Ai,mz,yG=(mz=class extends Yc{constructor(t={}){super();je(this,Ai);this.config=t,Se(this,Ai,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??dj(a,n);let s=this.get(i);return s||(s=new cG({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(s)),s}add(t){W(this,Ai).has(t.queryHash)||(W(this,Ai).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,Ai).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,Ai).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){on.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,Ai).get(t)}getAll(){return[...W(this,Ai).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>JP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>JP(t,r)):n}notify(t){on.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){on.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){on.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ai=new WeakMap,mz),nn,el,tl,xd,bd,nl,wd,Sd,pz,xG=(pz=class{constructor(e={}){je(this,nn);je(this,el);je(this,tl);je(this,xd);je(this,bd);je(this,nl);je(this,wd);je(this,Sd);Se(this,nn,e.queryCache||new yG),Se(this,el,e.mutationCache||new mG),Se(this,tl,e.defaultOptions||{}),Se(this,xd,new Map),Se(this,bd,new Map),Se(this,nl,0)}mount(){Av(this,nl)._++,W(this,nl)===1&&(Se(this,wd,pj.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,nn).onFocus())})),Se(this,Sd,Ng.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,nn).onOnline())})))}unmount(){var e,t;Av(this,nl)._--,W(this,nl)===0&&((e=W(this,wd))==null||e.call(this),Se(this,wd,void 0),(t=W(this,Sd))==null||t.call(this),Se(this,Sd,void 0))}isFetching(e){return W(this,nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,el).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,nn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,nn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(al(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,nn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=W(this,nn).get(r.queryHash),i=a==null?void 0:a.state.data,s=ZY(t,i);if(s!==void 0)return W(this,nn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return on.batch(()=>W(this,nn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,nn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,nn);on.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,nn);return on.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=on.batch(()=>W(this,nn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(pr).catch(pr)}invalidateQueries(e,t={}){return on.batch(()=>(W(this,nn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=on.batch(()=>W(this,nn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(pr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(pr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,nn).build(this,t);return n.isStaleByTime(al(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pr).catch(pr)}fetchInfiniteQuery(e){return e.behavior=sM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pr).catch(pr)}ensureInfiniteQueryData(e){return e.behavior=sM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ng.isOnline()?W(this,el).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,nn)}getMutationCache(){return W(this,el)}getDefaultOptions(){return W(this,tl)}setDefaultOptions(e){Se(this,tl,e)}setQueryDefaults(e,t){W(this,xd).set(Oc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,xd).values()],n={};return t.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,bd).set(Oc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,bd).values()],n={};return t.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,tl).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=dj(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===hj&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,tl).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,nn).clear(),W(this,el).clear()}},nn=new WeakMap,el=new WeakMap,tl=new WeakMap,xd=new WeakMap,bd=new WeakMap,nl=new WeakMap,wd=new WeakMap,Sd=new WeakMap,pz),Kz=x.createContext(void 0),ft=e=>{const t=x.useContext(Kz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},bG=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Kz.Provider,{value:e,children:t})),Vz=x.createContext(!1),Yz=()=>x.useContext(Vz);Vz.Provider;function wG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var SG=x.createContext(wG()),Gz=()=>x.useContext(SG),Xz=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?mj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Wz=e=>{x.useEffect(()=>{e.clearReset()},[e])},Qz=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||mj(n,[e.error,r])),Zz=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},EG=(e,t)=>e.isLoading&&e.isFetching&&!t,SE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,EE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _G({queries:e,...t},n){const r=ft(),a=Yz(),i=Gz(),s=x.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=a?"isRestoring":"optimistic",S}),[e,r,a]);s.forEach(w=>{Zz(w);const S=r.getQueryCache().get(w.queryHash);Xz(w,i,S)}),Wz(i);const[c]=x.useState(()=>new gG(r,s,t)),[u,d,m]=c.getOptimisticResult(s,t.combine),f=!a&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(w=>f?c.subscribe(on.batchCalls(w)):pr,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);const g=u.some((w,S)=>SE(s[S],w))?u.flatMap((w,S)=>{const E=s[S];if(E&&SE(E,w)){const O=new vj(r,E);return EE(E,O,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const b=u.find((w,S)=>{const E=s[S];return E&&Qz({result:w,errorResetBoundary:i,throwOnError:E.throwOnError,query:r.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(b!=null&&b.error)throw b.error;return d(m())}function jG(e,t,n){var v,g,b,w;const r=Yz(),a=Gz(),i=ft(),s=i.defaultQueryOptions(e);(g=(v=i.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||g.call(v,s);const c=i.getQueryCache().get(s.queryHash);s._optimisticResults=r?"isRestoring":"optimistic",Zz(s),Xz(s,a,c),Wz(a);const u=!i.getQueryCache().get(s.queryHash),[d]=x.useState(()=>new t(i,s)),m=d.getOptimisticResult(s),f=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(S=>{const E=f?d.subscribe(on.batchCalls(S)):pr;return d.updateResult(),E},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),x.useEffect(()=>{d.setOptions(s)},[s,d]),SE(s,m))throw EE(s,d,a);if(Qz({result:m,errorResetBoundary:a,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw m.error;if((w=(b=i.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||w.call(b,s,m),s.experimental_prefetchInRender&&!Cc&&EG(m,r)){const S=u?EE(s,d,a):c==null?void 0:c.promise;S==null||S.catch(pr).finally(()=>{d.updateResult()})}return s.notifyOnChangeProps?m:d.trackResult(m)}function mn(e,t){return jG(e,vj)}function Mt(e,t){const n=ft(),[r]=x.useState(()=>new pG(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const a=x.useSyncExternalStore(x.useCallback(s=>r.subscribe(on.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=x.useCallback((s,c)=>{r.mutate(s,c).catch(pr)},[r]);if(a.error&&mj(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}var CG=(e,t,n,r,a,i,s,c)=>{let u=document.documentElement,d=["light","dark"];function m(g){(Array.isArray(e)?e:[e]).forEach(b=>{let w=b==="class",S=w&&i?a.map(E=>i[E]||E):a;w?(u.classList.remove(...S),u.classList.add(i&&i[g]?i[g]:g)):u.setAttribute(b,g)}),f(g)}function f(g){c&&d.includes(g)&&(u.style.colorScheme=g)}function v(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let g=localStorage.getItem(t)||n,b=s&&g==="system"?v():g;m(b)}catch{}},uM=["light","dark"],Jz="(prefers-color-scheme: dark)",OG=typeof window>"u",yj=x.createContext(void 0),AG={setTheme:e=>{},themes:[]},xj=()=>{var e;return(e=x.useContext(yj))!=null?e:AG},NG=e=>x.useContext(yj)?x.createElement(x.Fragment,null,e.children):x.createElement(PG,{...e}),TG=["light","dark"],PG=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:a="theme",themes:i=TG,defaultTheme:s=n?"system":"light",attribute:c="data-theme",value:u,children:d,nonce:m,scriptProps:f})=>{let[v,g]=x.useState(()=>kG(a,s)),[b,w]=x.useState(()=>v==="system"?Vw():v),S=u?Object.values(u):i,E=x.useCallback(N=>{let T=N;if(!T)return;N==="system"&&n&&(T=Vw());let P=u?u[T]:T,R=t?RG(m):null,D=document.documentElement,K=z=>{z==="class"?(D.classList.remove(...S),P&&D.classList.add(P)):z.startsWith("data-")&&(P?D.setAttribute(z,P):D.removeAttribute(z))};if(Array.isArray(c)?c.forEach(K):K(c),r){let z=uM.includes(s)?s:null,I=uM.includes(T)?T:z;D.style.colorScheme=I}R==null||R()},[m]),O=x.useCallback(N=>{let T=typeof N=="function"?N(v):N;g(T);try{localStorage.setItem(a,T)}catch{}},[v]),j=x.useCallback(N=>{let T=Vw(N);w(T),v==="system"&&n&&!e&&E("system")},[v,e]);x.useEffect(()=>{let N=window.matchMedia(Jz);return N.addListener(j),j(N),()=>N.removeListener(j)},[j]),x.useEffect(()=>{let N=T=>{T.key===a&&(T.newValue?g(T.newValue):O(s))};return window.addEventListener("storage",N),()=>window.removeEventListener("storage",N)},[O]),x.useEffect(()=>{E(e??v)},[e,v]);let A=x.useMemo(()=>({theme:v,setTheme:O,forcedTheme:e,resolvedTheme:v==="system"?b:v,themes:n?[...i,"system"]:i,systemTheme:n?b:void 0}),[v,O,e,b,n,i]);return x.createElement(yj.Provider,{value:A},x.createElement(MG,{forcedTheme:e,storageKey:a,attribute:c,enableSystem:n,enableColorScheme:r,defaultTheme:s,value:u,themes:i,nonce:m,scriptProps:f}),d)},MG=x.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:s,themes:c,nonce:u,scriptProps:d})=>{let m=JSON.stringify([n,t,i,e,c,s,r,a]).slice(1,-1);return x.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${CG.toString()})(${m})`}})}),kG=(e,t)=>{if(OG)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},RG=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Vw=e=>(e||(e=window.matchMedia(Jz)),e.matches?"dark":"light");function dM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Io(...e){return t=>{let n=!1;const r=e.map(a=>{const i=dM(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():dM(e[a],null)}}}}function it(...e){return x.useCallback(Io(...e),e)}function Ac(e){const t=DG(e),n=x.forwardRef((r,a)=>{const{children:i,...s}=r,c=x.Children.toArray(i),u=c.find(LG);if(u){const d=u.props.children,m=c.map(f=>f===u?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:f);return p.jsx(t,{...s,ref:a,children:x.isValidElement(d)?x.cloneElement(d,void 0,m):null})}return p.jsx(t,{...s,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var bj=Ac("Slot");function DG(e){const t=x.forwardRef((n,r)=>{const{children:a,...i}=n;if(x.isValidElement(a)){const s=$G(a),c=zG(i,a.props);return a.type!==x.Fragment&&(c.ref=r?Io(r,s):s),x.cloneElement(a,c)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e4=Symbol("radix.slottable");function IG(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=e4,t}function LG(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e4}function zG(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const u=i(...c);return a(...c),u}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function $G(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var BG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=BG.reduce((e,t)=>{const n=Ac(`Primitive.${t}`),r=x.forwardRef((a,i)=>{const{asChild:s,...c}=a,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function t4(e,t){e&&yl.flushSync(()=>e.dispatchEvent(t))}var n4=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),UG="VisuallyHidden",r4=x.forwardRef((e,t)=>p.jsx(Ie.span,{...e,ref:t,style:{...n4,...e.style}}));r4.displayName=UG;var HG=r4;function FG(e,t){const n=x.createContext(t),r=i=>{const{children:s,...c}=i,u=x.useMemo(()=>c,Object.values(c));return p.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function a(i){const s=x.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function fi(e,t=[]){let n=[];function r(i,s){const c=x.createContext(s),u=n.length;n=[...n,s];const d=f=>{var E;const{scope:v,children:g,...b}=f,w=((E=v==null?void 0:v[e])==null?void 0:E[u])||c,S=x.useMemo(()=>b,Object.values(b));return p.jsx(w.Provider,{value:S,children:g})};d.displayName=i+"Provider";function m(f,v){var w;const g=((w=v==null?void 0:v[e])==null?void 0:w[u])||c,b=x.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,m]}const a=()=>{const i=n.map(s=>x.createContext(s));return function(c){const u=(c==null?void 0:c[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return a.scopeName=e,[r,qG(a,...t)]}function qG(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const s=r.reduce((c,{useScope:u,scopeName:d})=>{const f=u(i)[`__scope${d}`];return{...c,...f}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function wj(e){const t=e+"CollectionProvider",[n,r]=fi(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=w=>{const{scope:S,children:E}=w,O=be.useRef(null),j=be.useRef(new Map).current;return p.jsx(a,{scope:S,itemMap:j,collectionRef:O,children:E})};s.displayName=t;const c=e+"CollectionSlot",u=Ac(c),d=be.forwardRef((w,S)=>{const{scope:E,children:O}=w,j=i(c,E),A=it(S,j.collectionRef);return p.jsx(u,{ref:A,children:O})});d.displayName=c;const m=e+"CollectionItemSlot",f="data-radix-collection-item",v=Ac(m),g=be.forwardRef((w,S)=>{const{scope:E,children:O,...j}=w,A=be.useRef(null),N=it(S,A),T=i(m,E);return be.useEffect(()=>(T.itemMap.set(A,{ref:A,...j}),()=>void T.itemMap.delete(A))),p.jsx(v,{[f]:"",ref:N,children:O})});g.displayName=m;function b(w){const S=i(e+"CollectionConsumer",w);return be.useCallback(()=>{const O=S.collectionRef.current;if(!O)return[];const j=Array.from(O.querySelectorAll(`[${f}]`));return Array.from(S.itemMap.values()).sort((T,P)=>j.indexOf(T.ref.current)-j.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},b,r]}function _e(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}var Gn=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},KG=aj[" useInsertionEffect ".trim().toString()]||Gn;function ll({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=VG({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:a;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const f=m.current;f!==c&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=c},[c,r])}const d=x.useCallback(m=>{var f;if(c){const v=YG(m)?m(e):m;v!==e&&((f=s.current)==null||f.call(s,v))}else i(m)},[c,e,i,s]);return[u,d]}function VG({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),i=x.useRef(t);return KG(()=>{i.current=t},[t]),x.useEffect(()=>{var s;a.current!==n&&((s=i.current)==null||s.call(i,n),a.current=n)},[n,a]),[n,r,i]}function YG(e){return typeof e=="function"}function GG(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var xr=e=>{const{present:t,children:n}=e,r=XG(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=it(r.ref,WG(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:i}):null};xr.displayName="Presence";function XG(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[c,u]=GG(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=Pv(r.current);i.current=c==="mounted"?d:"none"},[c]),Gn(()=>{const d=r.current,m=a.current;if(m!==e){const v=i.current,g=Pv(d);e?u("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(m&&v!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),Gn(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,f=g=>{const w=Pv(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&w&&(u("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},v=g=>{g.target===t&&(i.current=Pv(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Pv(e){return(e==null?void 0:e.animationName)||"none"}function WG(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var QG=aj[" useId ".trim().toString()]||(()=>{}),ZG=0;function Yn(e){const[t,n]=x.useState(QG());return Gn(()=>{n(r=>r??String(ZG++))},[e]),e||(t?`radix-${t}`:"")}var Wy="Collapsible",[JG]=fi(Wy),[eX,Sj]=JG(Wy),a4=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:s,...c}=e,[u,d]=ll({prop:r,defaultProp:a??!1,onChange:s,caller:Wy});return p.jsx(eX,{scope:n,disabled:i,contentId:Yn(),open:u,onOpenToggle:x.useCallback(()=>d(m=>!m),[d]),children:p.jsx(Ie.div,{"data-state":_j(u),"data-disabled":i?"":void 0,...c,ref:t})})});a4.displayName=Wy;var i4="CollapsibleTrigger",o4=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=Sj(i4,n);return p.jsx(Ie.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":_j(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:_e(e.onClick,a.onOpenToggle)})});o4.displayName=i4;var Ej="CollapsibleContent",s4=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Sj(Ej,e.__scopeCollapsible);return p.jsx(xr,{present:n||a.open,children:({present:i})=>p.jsx(tX,{...r,ref:t,present:i})})});s4.displayName=Ej;var tX=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,s=Sj(Ej,n),[c,u]=x.useState(r),d=x.useRef(null),m=it(t,d),f=x.useRef(0),v=f.current,g=x.useRef(0),b=g.current,w=s.open||c,S=x.useRef(w),E=x.useRef(void 0);return x.useEffect(()=>{const O=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(O)},[]),Gn(()=>{const O=d.current;if(O){E.current=E.current||{transitionDuration:O.style.transitionDuration,animationName:O.style.animationName},O.style.transitionDuration="0s",O.style.animationName="none";const j=O.getBoundingClientRect();f.current=j.height,g.current=j.width,S.current||(O.style.transitionDuration=E.current.transitionDuration,O.style.animationName=E.current.animationName),u(r)}},[s.open,r]),p.jsx(Ie.div,{"data-state":_j(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!w,...i,ref:m,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:w&&a})});function _j(e){return e?"open":"closed"}var nX=a4,rX=x.createContext(void 0);function jm(e){const t=x.useContext(rX);return e||t||"ltr"}function rr(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function aX(e,t=globalThis==null?void 0:globalThis.document){const n=rr(e);x.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var iX="DismissableLayer",_E="dismissableLayer.update",oX="dismissableLayer.pointerDownOutside",sX="dismissableLayer.focusOutside",fM,l4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Cm=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...u}=e,d=x.useContext(l4),[m,f]=x.useState(null),v=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=x.useState({}),b=it(t,P=>f(P)),w=Array.from(d.layers),[S]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(S),O=m?w.indexOf(m):-1,j=d.layersWithOutsidePointerEventsDisabled.size>0,A=O>=E,N=uX(P=>{const R=P.target,D=[...d.branches].some(K=>K.contains(R));!A||D||(a==null||a(P),s==null||s(P),P.defaultPrevented||c==null||c())},v),T=dX(P=>{const R=P.target;[...d.branches].some(K=>K.contains(R))||(i==null||i(P),s==null||s(P),P.defaultPrevented||c==null||c())},v);return aX(P=>{O===d.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},v),x.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(fM=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),hM(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=fM)}},[m,v,n,d]),x.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),hM())},[m,d]),x.useEffect(()=>{const P=()=>g({});return document.addEventListener(_E,P),()=>document.removeEventListener(_E,P)},[]),p.jsx(Ie.div,{...u,ref:b,style:{pointerEvents:j?A?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,T.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,N.onPointerDownCapture)})});Cm.displayName=iX;var lX="DismissableLayerBranch",cX=x.forwardRef((e,t)=>{const n=x.useContext(l4),r=x.useRef(null),a=it(t,r);return x.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),p.jsx(Ie.div,{...e,ref:a})});cX.displayName=lX;function uX(e,t=globalThis==null?void 0:globalThis.document){const n=rr(e),r=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let u=function(){c4(oX,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function dX(e,t=globalThis==null?void 0:globalThis.document){const n=rr(e),r=x.useRef(!1);return x.useEffect(()=>{const a=i=>{i.target&&!r.current&&c4(sX,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hM(){const e=new CustomEvent(_E);document.dispatchEvent(e)}function c4(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?t4(a,i):a.dispatchEvent(i)}var Yw="focusScope.autoFocusOnMount",Gw="focusScope.autoFocusOnUnmount",mM={bubbles:!1,cancelable:!0},fX="FocusScope",Qy=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=e,[c,u]=x.useState(null),d=rr(a),m=rr(i),f=x.useRef(null),v=it(t,w=>u(w)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(j){if(g.paused||!c)return;const A=j.target;c.contains(A)?f.current=A:Us(f.current,{select:!0})},S=function(j){if(g.paused||!c)return;const A=j.relatedTarget;A!==null&&(c.contains(A)||Us(f.current,{select:!0}))},E=function(j){if(document.activeElement===document.body)for(const N of j)N.removedNodes.length>0&&Us(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const O=new MutationObserver(E);return c&&O.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),O.disconnect()}}},[r,c,g.paused]),x.useEffect(()=>{if(c){vM.add(g);const w=document.activeElement;if(!c.contains(w)){const E=new CustomEvent(Yw,mM);c.addEventListener(Yw,d),c.dispatchEvent(E),E.defaultPrevented||(hX(yX(u4(c)),{select:!0}),document.activeElement===w&&Us(c))}return()=>{c.removeEventListener(Yw,d),setTimeout(()=>{const E=new CustomEvent(Gw,mM);c.addEventListener(Gw,m),c.dispatchEvent(E),E.defaultPrevented||Us(w??document.body,{select:!0}),c.removeEventListener(Gw,m),vM.remove(g)},0)}}},[c,d,m,g]);const b=x.useCallback(w=>{if(!n&&!r||g.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(S&&E){const O=w.currentTarget,[j,A]=mX(O);j&&A?!w.shiftKey&&E===A?(w.preventDefault(),n&&Us(j,{select:!0})):w.shiftKey&&E===j&&(w.preventDefault(),n&&Us(A,{select:!0})):E===O&&w.preventDefault()}},[n,r,g.paused]);return p.jsx(Ie.div,{tabIndex:-1,...s,ref:v,onKeyDown:b})});Qy.displayName=fX;function hX(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Us(r,{select:t}),document.activeElement!==n)return}function mX(e){const t=u4(e),n=pM(t,e),r=pM(t.reverse(),e);return[n,r]}function u4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pM(e,t){for(const n of e)if(!pX(n,{upTo:t}))return n}function pX(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vX(e){return e instanceof HTMLInputElement&&"select"in e}function Us(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vX(e)&&t&&e.select()}}var vM=gX();function gX(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=gM(e,t),e.unshift(t)},remove(t){var n;e=gM(e,t),(n=e[0])==null||n.resume()}}}function gM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yX(e){return e.filter(t=>t.tagName!=="A")}var xX="Portal",Om=x.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[a,i]=x.useState(!1);Gn(()=>i(!0),[]);const s=n||a&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?Iz.createPortal(p.jsx(Ie.div,{...r,ref:t}),s):null});Om.displayName=xX;var Xw=0;function jj(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yM()),document.body.insertAdjacentElement("beforeend",e[1]??yM()),Xw++,()=>{Xw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xw--}},[])}function yM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ti=function(){return Ti=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ti.apply(this,arguments)};function d4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function bX(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var hg="right-scroll-bar-position",mg="width-before-scroll-bar",wX="with-scroll-bars-hidden",SX="--removed-body-scroll-bar-size";function Ww(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function EX(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var _X=typeof window<"u"?x.useLayoutEffect:x.useEffect,xM=new WeakMap;function jX(e,t){var n=EX(null,function(r){return e.forEach(function(a){return Ww(a,r)})});return _X(function(){var r=xM.get(n);if(r){var a=new Set(r),i=new Set(e),s=n.current;a.forEach(function(c){i.has(c)||Ww(c,null)}),i.forEach(function(c){a.has(c)||Ww(c,s)})}xM.set(n,e)},[e]),n}function CX(e){return e}function OX(e,t){t===void 0&&(t=CX);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(c){return c!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var c=n;n=[],c.forEach(i),s=n}var u=function(){var m=s;s=[],m.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(m){s.push(m),d()},filter:function(m){return s=s.filter(m),n}}}};return a}function AX(e){e===void 0&&(e={});var t=OX(null);return t.options=Ti({async:!0,ssr:!1},e),t}var f4=function(e){var t=e.sideCar,n=d4(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Ti({},n))};f4.isSideCarExport=!0;function NX(e,t){return e.useMedium(t),f4}var h4=AX(),Qw=function(){},Zy=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Qw,onWheelCapture:Qw,onTouchMoveCapture:Qw}),a=r[0],i=r[1],s=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,m=e.enabled,f=e.shards,v=e.sideCar,g=e.noRelative,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,E=e.as,O=E===void 0?"div":E,j=e.gapMode,A=d4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=v,T=jX([n,t]),P=Ti(Ti({},A),a);return x.createElement(x.Fragment,null,m&&x.createElement(N,{sideCar:h4,removeScrollBar:d,shards:f,noRelative:g,noIsolation:b,inert:w,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:j}),s?x.cloneElement(x.Children.only(c),Ti(Ti({},P),{ref:T})):x.createElement(O,Ti({},P,{className:u,ref:T}),c))});Zy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zy.classNames={fullWidth:mg,zeroRight:hg};var TX=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PX(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=TX();return t&&e.setAttribute("nonce",t),e}function MX(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kX(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var RX=function(){var e=0,t=null;return{add:function(n){e==0&&(t=PX())&&(MX(t,n),kX(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},DX=function(){var e=RX();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},m4=function(){var e=DX(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},IX={left:0,top:0,right:0,gap:0},Zw=function(e){return parseInt(e||"",10)||0},LX=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Zw(n),Zw(r),Zw(a)]},zX=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return IX;var t=LX(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$X=m4(),nd="data-scroll-locked",BX=function(e,t,n,r){var a=e.left,i=e.top,s=e.right,c=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(wX,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(c,"px ").concat(r,`;
  }
  body[`).concat(nd,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(a,`px;
    padding-top: `).concat(i,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(c,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(hg,` {
    right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(mg,` {
    margin-right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(hg," .").concat(hg,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(mg," .").concat(mg,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(nd,`] {
    `).concat(SX,": ").concat(c,`px;
  }
`)},bM=function(){var e=parseInt(document.body.getAttribute(nd)||"0",10);return isFinite(e)?e:0},UX=function(){x.useEffect(function(){return document.body.setAttribute(nd,(bM()+1).toString()),function(){var e=bM()-1;e<=0?document.body.removeAttribute(nd):document.body.setAttribute(nd,e.toString())}},[])},HX=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;UX();var i=x.useMemo(function(){return zX(a)},[a]);return x.createElement($X,{styles:BX(i,!t,a,n?"":"!important")})},jE=!1;if(typeof window<"u")try{var Mv=Object.defineProperty({},"passive",{get:function(){return jE=!0,!0}});window.addEventListener("test",Mv,Mv),window.removeEventListener("test",Mv,Mv)}catch{jE=!1}var Lu=jE?{passive:!1}:!1,FX=function(e){return e.tagName==="TEXTAREA"},p4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!FX(e)&&n[t]==="visible")},qX=function(e){return p4(e,"overflowY")},KX=function(e){return p4(e,"overflowX")},wM=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=v4(e,r);if(a){var i=g4(e,r),s=i[1],c=i[2];if(s>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VX=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},YX=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},v4=function(e,t){return e==="v"?qX(t):KX(t)},g4=function(e,t){return e==="v"?VX(t):YX(t)},GX=function(e,t){return e==="h"&&t==="rtl"?-1:1},XX=function(e,t,n,r,a){var i=GX(e,window.getComputedStyle(t).direction),s=i*r,c=n.target,u=t.contains(c),d=!1,m=s>0,f=0,v=0;do{if(!c)break;var g=g4(e,c),b=g[0],w=g[1],S=g[2],E=w-S-i*b;(b||E)&&v4(e,c)&&(f+=E,v+=b);var O=c.parentNode;c=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(m&&Math.abs(f)<1||!m&&Math.abs(v)<1)&&(d=!0),d},kv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},SM=function(e){return[e.deltaX,e.deltaY]},EM=function(e){return e&&"current"in e?e.current:e},WX=function(e,t){return e[0]===t[0]&&e[1]===t[1]},QX=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},ZX=0,zu=[];function JX(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),a=x.useState(ZX++)[0],i=x.useState(m4)[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var w=bX([e.lockRef.current],(e.shards||[]).map(EM),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!s.current.allowPinchZoom;var E=kv(w),O=n.current,j="deltaX"in w?w.deltaX:O[0]-E[0],A="deltaY"in w?w.deltaY:O[1]-E[1],N,T=w.target,P=Math.abs(j)>Math.abs(A)?"h":"v";if("touches"in w&&P==="h"&&T.type==="range")return!1;var R=window.getSelection(),D=R&&R.anchorNode,K=D?D===T||D.contains(T):!1;if(K)return!1;var z=wM(P,T);if(!z)return!0;if(z?N=P:(N=P==="v"?"h":"v",z=wM(P,T)),!z)return!1;if(!r.current&&"changedTouches"in w&&(j||A)&&(r.current=N),!N)return!0;var I=r.current||N;return XX(I,S,w,I==="h"?j:A)},[]),u=x.useCallback(function(w){var S=w;if(!(!zu.length||zu[zu.length-1]!==i)){var E="deltaY"in S?SM(S):kv(S),O=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&WX(N.delta,E)})[0];if(O&&O.should){S.cancelable&&S.preventDefault();return}if(!O){var j=(s.current.shards||[]).map(EM).filter(Boolean).filter(function(N){return N.contains(S.target)}),A=j.length>0?c(S,j[0]):!s.current.noIsolation;A&&S.cancelable&&S.preventDefault()}}},[]),d=x.useCallback(function(w,S,E,O){var j={name:w,delta:S,target:E,should:O,shadowParent:eW(E)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(A){return A!==j})},1)},[]),m=x.useCallback(function(w){n.current=kv(w),r.current=void 0},[]),f=x.useCallback(function(w){d(w.type,SM(w),w.target,c(w,e.lockRef.current))},[]),v=x.useCallback(function(w){d(w.type,kv(w),w.target,c(w,e.lockRef.current))},[]);x.useEffect(function(){return zu.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:v}),document.addEventListener("wheel",u,Lu),document.addEventListener("touchmove",u,Lu),document.addEventListener("touchstart",m,Lu),function(){zu=zu.filter(function(w){return w!==i}),document.removeEventListener("wheel",u,Lu),document.removeEventListener("touchmove",u,Lu),document.removeEventListener("touchstart",m,Lu)}},[]);var g=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:QX(a)}):null,g?x.createElement(HX,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function eW(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const tW=NX(h4,JX);var Jy=x.forwardRef(function(e,t){return x.createElement(Zy,Ti({},e,{ref:t,sideCar:tW}))});Jy.classNames=Zy.classNames;var nW=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$u=new WeakMap,Rv=new WeakMap,Dv={},Jw=0,y4=function(e){return e&&(e.host||y4(e.parentNode))},rW=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=y4(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},aW=function(e,t,n,r){var a=rW(t,Array.isArray(e)?e:[e]);Dv[n]||(Dv[n]=new WeakMap);var i=Dv[n],s=[],c=new Set,u=new Set(a),d=function(f){!f||c.has(f)||(c.add(f),d(f.parentNode))};a.forEach(d);var m=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(v){if(c.has(v))m(v);else try{var g=v.getAttribute(r),b=g!==null&&g!=="false",w=($u.get(v)||0)+1,S=(i.get(v)||0)+1;$u.set(v,w),i.set(v,S),s.push(v),w===1&&b&&Rv.set(v,!0),S===1&&v.setAttribute(n,"true"),b||v.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return m(t),c.clear(),Jw++,function(){s.forEach(function(f){var v=$u.get(f)-1,g=i.get(f)-1;$u.set(f,v),i.set(f,g),v||(Rv.has(f)||f.removeAttribute(r),Rv.delete(f)),g||f.removeAttribute(n)}),Jw--,Jw||($u=new WeakMap,$u=new WeakMap,Rv=new WeakMap,Dv={})}},Cj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=nW(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),aW(r,a,n,"aria-hidden")):function(){return null}},e0="Dialog",[x4]=fi(e0),[iW,hi]=x4(e0),b4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,c=x.useRef(null),u=x.useRef(null),[d,m]=ll({prop:r,defaultProp:a??!1,onChange:i,caller:e0});return p.jsx(iW,{scope:t,triggerRef:c,contentRef:u,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),open:d,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(f=>!f),[m]),modal:s,children:n})};b4.displayName=e0;var w4="DialogTrigger",oW=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=hi(w4,n),i=it(t,a.triggerRef);return p.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Nj(a.open),...r,ref:i,onClick:_e(e.onClick,a.onOpenToggle)})});oW.displayName=w4;var Oj="DialogPortal",[sW,S4]=x4(Oj,{forceMount:void 0}),E4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=hi(Oj,t);return p.jsx(sW,{scope:t,forceMount:n,children:x.Children.map(r,s=>p.jsx(xr,{present:n||i.open,children:p.jsx(Om,{asChild:!0,container:a,children:s})}))})};E4.displayName=Oj;var Tg="DialogOverlay",_4=x.forwardRef((e,t)=>{const n=S4(Tg,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=hi(Tg,e.__scopeDialog);return i.modal?p.jsx(xr,{present:r||i.open,children:p.jsx(cW,{...a,ref:t})}):null});_4.displayName=Tg;var lW=Ac("DialogOverlay.RemoveScroll"),cW=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=hi(Tg,n);return p.jsx(Jy,{as:lW,allowPinchZoom:!0,shards:[a.contentRef],children:p.jsx(Ie.div,{"data-state":Nj(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Nc="DialogContent",j4=x.forwardRef((e,t)=>{const n=S4(Nc,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=hi(Nc,e.__scopeDialog);return p.jsx(xr,{present:r||i.open,children:i.modal?p.jsx(uW,{...a,ref:t}):p.jsx(dW,{...a,ref:t})})});j4.displayName=Nc;var uW=x.forwardRef((e,t)=>{const n=hi(Nc,e.__scopeDialog),r=x.useRef(null),a=it(t,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return Cj(i)},[]),p.jsx(C4,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&i.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault())})}),dW=x.forwardRef((e,t)=>{const n=hi(Nc,e.__scopeDialog),r=x.useRef(!1),a=x.useRef(!1);return p.jsx(C4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,c;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),C4=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=e,c=hi(Nc,n),u=x.useRef(null),d=it(t,u);return jj(),p.jsxs(p.Fragment,{children:[p.jsx(Qy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:p.jsx(Cm,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Nj(c.open),...s,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(fW,{titleId:c.titleId}),p.jsx(mW,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Aj="DialogTitle",O4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=hi(Aj,n);return p.jsx(Ie.h2,{id:a.titleId,...r,ref:t})});O4.displayName=Aj;var A4="DialogDescription",N4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=hi(A4,n);return p.jsx(Ie.p,{id:a.descriptionId,...r,ref:t})});N4.displayName=A4;var T4="DialogClose",P4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=hi(T4,n);return p.jsx(Ie.button,{type:"button",...r,ref:t,onClick:_e(e.onClick,()=>a.onOpenChange(!1))})});P4.displayName=T4;function Nj(e){return e?"open":"closed"}var M4="DialogTitleWarning",[w2e,k4]=FG(M4,{contentName:Nc,titleName:Aj,docsSlug:"dialog"}),fW=({titleId:e})=>{const t=k4(M4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},hW="DialogDescriptionWarning",mW=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${k4(hW).contentName}}.`;return x.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Tj=b4,Pj=E4,Mj=_4,kj=j4,R4=O4,D4=N4,Rj=P4,e1={exports:{}},t1={};/**
 * @license React
 * use-sync-external-store-shim.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 _M;function pW(){if(_M)return t1;_M=1;var e=Fd();function t(f,v){return f===v&&(f!==0||1/f===1/v)||f!==f&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function c(f,v){var g=v(),b=r({inst:{value:g,getSnapshot:v}}),w=b[0].inst,S=b[1];return i(function(){w.value=g,w.getSnapshot=v,u(w)&&S({inst:w})},[f,g,v]),a(function(){return u(w)&&S({inst:w}),f(function(){u(w)&&S({inst:w})})},[f]),s(g),g}function u(f){var v=f.getSnapshot;f=f.value;try{var g=v();return!n(f,g)}catch{return!0}}function d(f,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return t1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,t1}var jM;function vW(){return jM||(jM=1,e1.exports=pW()),e1.exports}function gW(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function yW(e){const[t,n]=x.useState(void 0);return Gn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let s,c;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,c=d.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const xW=["top","right","bottom","left"],cl=Math.min,ia=Math.max,Pg=Math.round,Iv=Math.floor,Di=e=>({x:e,y:e}),bW={left:"right",right:"left",bottom:"top",top:"bottom"};function CE(e,t,n){return ia(e,cl(t,n))}function Lo(e,t){return typeof e=="function"?e(t):e}function zo(e){return e.split("-")[0]}function Yd(e){return e.split("-")[1]}function Dj(e){return e==="x"?"y":"x"}function Ij(e){return e==="y"?"height":"width"}function Pi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Lj(e){return Dj(Pi(e))}function wW(e,t,n){n===void 0&&(n=!1);const r=Yd(e),a=Lj(e),i=Ij(a);let s=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Mg(s)),[s,Mg(s)]}function SW(e){const t=Mg(e);return[OE(e),t,OE(t)]}function OE(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const CM=["left","right"],OM=["right","left"],EW=["top","bottom"],_W=["bottom","top"];function jW(e,t,n){switch(e){case"top":case"bottom":return n?t?OM:CM:t?CM:OM;case"left":case"right":return t?EW:_W;default:return[]}}function CW(e,t,n,r){const a=Yd(e);let i=jW(zo(e),n==="start",r);return a&&(i=i.map(s=>s+"-"+a),t&&(i=i.concat(i.map(OE)))),i}function Mg(e){const t=zo(e);return bW[t]+e.slice(t.length)}function OW(e){return{top:0,right:0,bottom:0,left:0,...e}}function I4(e){return typeof e!="number"?OW(e):{top:e,right:e,bottom:e,left:e}}function kg(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function AM(e,t,n){let{reference:r,floating:a}=e;const i=Pi(t),s=Lj(t),c=Ij(s),u=zo(t),d=i==="y",m=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,v=r[c]/2-a[c]/2;let g;switch(u){case"top":g={x:m,y:r.y-a.height};break;case"bottom":g={x:m,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-a.width,y:f};break;default:g={x:r.x,y:r.y}}switch(Yd(t)){case"start":g[s]-=v*(n&&d?-1:1);break;case"end":g[s]+=v*(n&&d?-1:1);break}return g}async function AW(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:s,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:v=!1,padding:g=0}=Lo(t,e),b=I4(g),S=c[v?f==="floating"?"reference":"floating":f],E=kg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:m,strategy:u})),O=f==="floating"?{x:r,y:a,width:s.floating.width,height:s.floating.height}:s.reference,j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(j))?await(i.getScale==null?void 0:i.getScale(j))||{x:1,y:1}:{x:1,y:1},N=kg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:O,offsetParent:j,strategy:u}):O);return{top:(E.top-N.top+b.top)/A.y,bottom:(N.bottom-E.bottom+b.bottom)/A.y,left:(E.left-N.left+b.left)/A.x,right:(N.right-E.right+b.right)/A.x}}const NW=50,TW=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:AW},u=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:f}=AM(d,r,u),v=r,g=0;const b={};for(let w=0;w<i.length;w++){const S=i[w];if(!S)continue;const{name:E,fn:O}=S,{x:j,y:A,data:N,reset:T}=await O({x:m,y:f,initialPlacement:r,placement:v,strategy:a,middlewareData:b,rects:d,platform:c,elements:{reference:e,floating:t}});m=j??m,f=A??f,b[E]={...b[E],...N},T&&g<NW&&(g++,typeof T=="object"&&(T.placement&&(v=T.placement),T.rects&&(d=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):T.rects),{x:m,y:f}=AM(d,v,u)),w=-1)}return{x:m,y:f,placement:v,strategy:a,middlewareData:b}},PW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:s,elements:c,middlewareData:u}=t,{element:d,padding:m=0}=Lo(e,t)||{};if(d==null)return{};const f=I4(m),v={x:n,y:r},g=Lj(a),b=Ij(g),w=await s.getDimensions(d),S=g==="y",E=S?"top":"left",O=S?"bottom":"right",j=S?"clientHeight":"clientWidth",A=i.reference[b]+i.reference[g]-v[g]-i.floating[b],N=v[g]-i.reference[g],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let P=T?T[j]:0;(!P||!await(s.isElement==null?void 0:s.isElement(T)))&&(P=c.floating[j]||i.floating[b]);const R=A/2-N/2,D=P/2-w[b]/2-1,K=cl(f[E],D),z=cl(f[O],D),I=K,G=P-w[b]-z,L=P/2-w[b]/2+R,Y=CE(I,L,G),k=!u.arrow&&Yd(a)!=null&&L!==Y&&i.reference[b]/2-(L<I?K:z)-w[b]/2<0,H=k?L<I?L-I:L-G:0;return{[g]:v[g]+H,data:{[g]:Y,centerOffset:L-Y-H,...k&&{alignmentOffset:H}},reset:k}}}),MW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:s,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:v,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=Lo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=zo(a),O=Pi(c),j=zo(c)===c,A=await(u.isRTL==null?void 0:u.isRTL(d.floating)),N=v||(j||!w?[Mg(c)]:SW(c)),T=b!=="none";!v&&T&&N.push(...CW(c,w,b,A));const P=[c,...N],R=await u.detectOverflow(t,S),D=[];let K=((r=i.flip)==null?void 0:r.overflows)||[];if(m&&D.push(R[E]),f){const L=wW(a,s,A);D.push(R[L[0]],R[L[1]])}if(K=[...K,{placement:a,overflows:D}],!D.every(L=>L<=0)){var z,I;const L=(((z=i.flip)==null?void 0:z.index)||0)+1,Y=P[L];if(Y&&(!(f==="alignment"?O!==Pi(Y):!1)||K.every(q=>Pi(q.placement)===O?q.overflows[0]>0:!0)))return{data:{index:L,overflows:K},reset:{placement:Y}};let k=(I=K.filter(H=>H.overflows[0]<=0).sort((H,q)=>H.overflows[1]-q.overflows[1])[0])==null?void 0:I.placement;if(!k)switch(g){case"bestFit":{var G;const H=(G=K.filter(q=>{if(T){const F=Pi(q.placement);return F===O||F==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(F=>F>0).reduce((F,V)=>F+V,0)]).sort((q,F)=>q[1]-F[1])[0])==null?void 0:G[0];H&&(k=H);break}case"initialPlacement":k=c;break}if(a!==k)return{reset:{placement:k}}}return{}}}};function NM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TM(e){return xW.some(t=>e[t]>=0)}const kW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Lo(e,t);switch(a){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=NM(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:TM(c)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),c=NM(s,n.floating);return{data:{escapedOffsets:c,escaped:TM(c)}}}default:return{}}}}},L4=new Set(["left","top"]);async function RW(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),s=zo(n),c=Yd(n),u=Pi(n)==="y",d=L4.has(s)?-1:1,m=i&&u?-1:1,f=Lo(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof b=="number"&&(g=c==="end"?b*-1:b),u?{x:g*m,y:v*d}:{x:v*d,y:g*m}}const DW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:s,middlewareData:c}=t,u=await RW(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+u.x,y:i+u.y,data:{...u,placement:s}}}}},IW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:E=>{let{x:O,y:j}=E;return{x:O,y:j}}},...d}=Lo(e,t),m={x:n,y:r},f=await i.detectOverflow(t,d),v=Pi(zo(a)),g=Dj(v);let b=m[g],w=m[v];if(s){const E=g==="y"?"top":"left",O=g==="y"?"bottom":"right",j=b+f[E],A=b-f[O];b=CE(j,b,A)}if(c){const E=v==="y"?"top":"left",O=v==="y"?"bottom":"right",j=w+f[E],A=w-f[O];w=CE(j,w,A)}const S=u.fn({...t,[g]:b,[v]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[g]:s,[v]:c}}}}}},LW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Lo(e,t),m={x:n,y:r},f=Pi(a),v=Dj(f);let g=m[v],b=m[f];const w=Lo(c,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const j=v==="y"?"height":"width",A=i.reference[v]-i.floating[j]+S.mainAxis,N=i.reference[v]+i.reference[j]-S.mainAxis;g<A?g=A:g>N&&(g=N)}if(d){var E,O;const j=v==="y"?"width":"height",A=L4.has(zo(a)),N=i.reference[f]-i.floating[j]+(A&&((E=s.offset)==null?void 0:E[f])||0)+(A?0:S.crossAxis),T=i.reference[f]+i.reference[j]+(A?0:((O=s.offset)==null?void 0:O[f])||0)-(A?S.crossAxis:0);b<N?b=N:b>T&&(b=T)}return{[v]:g,[f]:b}}}},zW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:s,elements:c}=t,{apply:u=()=>{},...d}=Lo(e,t),m=await s.detectOverflow(t,d),f=zo(a),v=Yd(a),g=Pi(a)==="y",{width:b,height:w}=i.floating;let S,E;f==="top"||f==="bottom"?(S=f,E=v===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(E=f,S=v==="end"?"top":"bottom");const O=w-m.top-m.bottom,j=b-m.left-m.right,A=cl(w-m[S],O),N=cl(b-m[E],j),T=!t.middlewareData.shift;let P=A,R=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=O),T&&!v){const K=ia(m.left,0),z=ia(m.right,0),I=ia(m.top,0),G=ia(m.bottom,0);g?R=b-2*(K!==0||z!==0?K+z:ia(m.left,m.right)):P=w-2*(I!==0||G!==0?I+G:ia(m.top,m.bottom))}await u({...t,availableWidth:R,availableHeight:P});const D=await s.getDimensions(c.floating);return b!==D.width||w!==D.height?{reset:{rects:!0}}:{}}}};function t0(){return typeof window<"u"}function Gd(e){return z4(e)?(e.nodeName||"").toLowerCase():"#document"}function da(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yi(e){var t;return(t=(z4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function z4(e){return t0()?e instanceof Node||e instanceof da(e).Node:!1}function oi(e){return t0()?e instanceof Element||e instanceof da(e).Element:!1}function Xo(e){return t0()?e instanceof HTMLElement||e instanceof da(e).HTMLElement:!1}function PM(e){return!t0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof da(e).ShadowRoot}function Am(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=si(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function $W(e){return/^(table|td|th)$/.test(Gd(e))}function n0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const BW=/transform|translate|scale|rotate|perspective|filter/,UW=/paint|layout|strict|content/,Wl=e=>!!e&&e!=="none";let n1;function zj(e){const t=oi(e)?si(e):e;return Wl(t.transform)||Wl(t.translate)||Wl(t.scale)||Wl(t.rotate)||Wl(t.perspective)||!$j()&&(Wl(t.backdropFilter)||Wl(t.filter))||BW.test(t.willChange||"")||UW.test(t.contain||"")}function HW(e){let t=ul(e);for(;Xo(t)&&!Ed(t);){if(zj(t))return t;if(n0(t))return null;t=ul(t)}return null}function $j(){return n1==null&&(n1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),n1}function Ed(e){return/^(html|body|#document)$/.test(Gd(e))}function si(e){return da(e).getComputedStyle(e)}function r0(e){return oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ul(e){if(Gd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||PM(e)&&e.host||Yi(e);return PM(t)?t.host:t}function $4(e){const t=ul(e);return Ed(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xo(t)&&Am(t)?t:$4(t)}function zh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=$4(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),s=da(a);if(i){const c=AE(s);return t.concat(s,s.visualViewport||[],Am(a)?a:[],c&&n?zh(c):[])}else return t.concat(a,zh(a,[],n))}function AE(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function B4(e){const t=si(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Xo(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:r,c=Pg(n)!==i||Pg(r)!==s;return c&&(n=i,r=s),{width:n,height:r,$:c}}function Bj(e){return oi(e)?e:e.contextElement}function rd(e){const t=Bj(e);if(!Xo(t))return Di(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=B4(t);let s=(i?Pg(n.width):n.width)/r,c=(i?Pg(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const FW=Di(0);function U4(e){const t=da(e);return!$j()||!t.visualViewport?FW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==da(e)?!1:t}function Tc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Bj(e);let s=Di(1);t&&(r?oi(r)&&(s=rd(r)):s=rd(e));const c=qW(i,n,r)?U4(i):Di(0);let u=(a.left+c.x)/s.x,d=(a.top+c.y)/s.y,m=a.width/s.x,f=a.height/s.y;if(i){const v=da(i),g=r&&oi(r)?da(r):r;let b=v,w=AE(b);for(;w&&r&&g!==b;){const S=rd(w),E=w.getBoundingClientRect(),O=si(w),j=E.left+(w.clientLeft+parseFloat(O.paddingLeft))*S.x,A=E.top+(w.clientTop+parseFloat(O.paddingTop))*S.y;u*=S.x,d*=S.y,m*=S.x,f*=S.y,u+=j,d+=A,b=da(w),w=AE(b)}}return kg({width:m,height:f,x:u,y:d})}function a0(e,t){const n=r0(e).scrollLeft;return t?t.left+n:Tc(Yi(e)).left+n}function H4(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-a0(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function KW(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",s=Yi(r),c=t?n0(t.floating):!1;if(r===s||c&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Di(1);const m=Di(0),f=Xo(r);if((f||!f&&!i)&&((Gd(r)!=="body"||Am(s))&&(u=r0(r)),f)){const g=Tc(r);d=rd(r),m.x=g.x+r.clientLeft,m.y=g.y+r.clientTop}const v=s&&!f&&!i?H4(s,u):Di(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+m.x+v.x,y:n.y*d.y-u.scrollTop*d.y+m.y+v.y}}function VW(e){return Array.from(e.getClientRects())}function YW(e){const t=Yi(e),n=r0(e),r=e.ownerDocument.body,a=ia(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ia(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+a0(e);const c=-n.scrollTop;return si(r).direction==="rtl"&&(s+=ia(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:s,y:c}}const MM=25;function GW(e,t){const n=da(e),r=Yi(e),a=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,c=0,u=0;if(a){i=a.width,s=a.height;const m=$j();(!m||m&&t==="fixed")&&(c=a.offsetLeft,u=a.offsetTop)}const d=a0(r);if(d<=0){const m=r.ownerDocument,f=m.body,v=getComputedStyle(f),g=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(r.clientWidth-f.clientWidth-g);b<=MM&&(i-=b)}else d<=MM&&(i+=d);return{width:i,height:s,x:c,y:u}}function XW(e,t){const n=Tc(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Xo(e)?rd(e):Di(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,u=a*i.x,d=r*i.y;return{width:s,height:c,x:u,y:d}}function kM(e,t,n){let r;if(t==="viewport")r=GW(e,n);else if(t==="document")r=YW(Yi(e));else if(oi(t))r=XW(t,n);else{const a=U4(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return kg(r)}function F4(e,t){const n=ul(e);return n===t||!oi(n)||Ed(n)?!1:si(n).position==="fixed"||F4(n,t)}function WW(e,t){const n=t.get(e);if(n)return n;let r=zh(e,[],!1).filter(c=>oi(c)&&Gd(c)!=="body"),a=null;const i=si(e).position==="fixed";let s=i?ul(e):e;for(;oi(s)&&!Ed(s);){const c=si(s),u=zj(s);!u&&c.position==="fixed"&&(a=null),(i?!u&&!a:!u&&c.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Am(s)&&!u&&F4(e,s))?r=r.filter(m=>m!==s):a=c,s=ul(s)}return t.set(e,r),r}function QW(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const s=[...n==="clippingAncestors"?n0(t)?[]:WW(t,this._c):[].concat(n),r],c=kM(t,s[0],a);let u=c.top,d=c.right,m=c.bottom,f=c.left;for(let v=1;v<s.length;v++){const g=kM(t,s[v],a);u=ia(g.top,u),d=cl(g.right,d),m=cl(g.bottom,m),f=ia(g.left,f)}return{width:d-f,height:m-u,x:f,y:u}}function ZW(e){const{width:t,height:n}=B4(e);return{width:t,height:n}}function JW(e,t,n){const r=Xo(t),a=Yi(t),i=n==="fixed",s=Tc(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=Di(0);function d(){u.x=a0(a)}if(r||!r&&!i)if((Gd(t)!=="body"||Am(a))&&(c=r0(t)),r){const g=Tc(t,!0,i,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else a&&d();i&&!r&&a&&d();const m=a&&!r&&!i?H4(a,c):Di(0),f=s.left+c.scrollLeft-u.x-m.x,v=s.top+c.scrollTop-u.y-m.y;return{x:f,y:v,width:s.width,height:s.height}}function r1(e){return si(e).position==="static"}function RM(e,t){if(!Xo(e)||si(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yi(e)===n&&(n=n.ownerDocument.body),n}function q4(e,t){const n=da(e);if(n0(e))return n;if(!Xo(e)){let a=ul(e);for(;a&&!Ed(a);){if(oi(a)&&!r1(a))return a;a=ul(a)}return n}let r=RM(e,t);for(;r&&$W(r)&&r1(r);)r=RM(r,t);return r&&Ed(r)&&r1(r)&&!zj(r)?n:r||HW(e)||n}const eQ=async function(e){const t=this.getOffsetParent||q4,n=this.getDimensions,r=await n(e.floating);return{reference:JW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tQ(e){return si(e).direction==="rtl"}const nQ={convertOffsetParentRelativeRectToViewportRelativeRect:KW,getDocumentElement:Yi,getClippingRect:QW,getOffsetParent:q4,getElementRects:eQ,getClientRects:VW,getDimensions:ZW,getScale:rd,isElement:oi,isRTL:tQ};function K4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rQ(e,t){let n=null,r;const a=Yi(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),i();const d=e.getBoundingClientRect(),{left:m,top:f,width:v,height:g}=d;if(c||t(),!v||!g)return;const b=Iv(f),w=Iv(a.clientWidth-(m+v)),S=Iv(a.clientHeight-(f+g)),E=Iv(m),j={rootMargin:-b+"px "+-w+"px "+-S+"px "+-E+"px",threshold:ia(0,cl(1,u))||1};let A=!0;function N(T){const P=T[0].intersectionRatio;if(P!==u){if(!A)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!K4(d,e.getBoundingClientRect())&&s(),A=!1}try{n=new IntersectionObserver(N,{...j,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,j)}n.observe(e)}return s(!0),i}function aQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Bj(e),m=a||i?[...d?zh(d):[],...t?zh(t):[]]:[];m.forEach(E=>{a&&E.addEventListener("scroll",n,{passive:!0}),i&&E.addEventListener("resize",n)});const f=d&&c?rQ(d,n):null;let v=-1,g=null;s&&(g=new ResizeObserver(E=>{let[O]=E;O&&O.target===d&&g&&t&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=g)==null||j.observe(t)})),n()}),d&&!u&&g.observe(d),t&&g.observe(t));let b,w=u?Tc(e):null;u&&S();function S(){const E=Tc(e);w&&!K4(w,E)&&n(),w=E,b=requestAnimationFrame(S)}return n(),()=>{var E;m.forEach(O=>{a&&O.removeEventListener("scroll",n),i&&O.removeEventListener("resize",n)}),f==null||f(),(E=g)==null||E.disconnect(),g=null,u&&cancelAnimationFrame(b)}}const iQ=DW,oQ=IW,sQ=MW,lQ=zW,cQ=kW,DM=PW,uQ=LW,dQ=(e,t,n)=>{const r=new Map,a={platform:nQ,...n},i={...a.platform,_c:r};return TW(e,t,{...a,platform:i})};var fQ=typeof document<"u",hQ=function(){},pg=fQ?x.useLayoutEffect:hQ;function Rg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Rg(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Rg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function V4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function IM(e,t){const n=V4(e);return Math.round(t*n)/n}function a1(e){const t=x.useRef(e);return pg(()=>{t.current=e}),t}function mQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[m,f]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=x.useState(r);Rg(v,r)||g(r);const[b,w]=x.useState(null),[S,E]=x.useState(null),O=x.useCallback(q=>{q!==T.current&&(T.current=q,w(q))},[]),j=x.useCallback(q=>{q!==P.current&&(P.current=q,E(q))},[]),A=i||b,N=s||S,T=x.useRef(null),P=x.useRef(null),R=x.useRef(m),D=u!=null,K=a1(u),z=a1(a),I=a1(d),G=x.useCallback(()=>{if(!T.current||!P.current)return;const q={placement:t,strategy:n,middleware:v};z.current&&(q.platform=z.current),dQ(T.current,P.current,q).then(F=>{const V={...F,isPositioned:I.current!==!1};L.current&&!Rg(R.current,V)&&(R.current=V,yl.flushSync(()=>{f(V)}))})},[v,t,n,z,I]);pg(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[d]);const L=x.useRef(!1);pg(()=>(L.current=!0,()=>{L.current=!1}),[]),pg(()=>{if(A&&(T.current=A),N&&(P.current=N),A&&N){if(K.current)return K.current(A,N,G);G()}},[A,N,G,K,D]);const Y=x.useMemo(()=>({reference:T,floating:P,setReference:O,setFloating:j}),[O,j]),k=x.useMemo(()=>({reference:A,floating:N}),[A,N]),H=x.useMemo(()=>{const q={position:n,left:0,top:0};if(!k.floating)return q;const F=IM(k.floating,m.x),V=IM(k.floating,m.y);return c?{...q,transform:"translate("+F+"px, "+V+"px)",...V4(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:V}},[n,c,k.floating,m.x,m.y]);return x.useMemo(()=>({...m,update:G,refs:Y,elements:k,floatingStyles:H}),[m,G,Y,k,H])}const pQ=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?DM({element:r.current,padding:a}).fn(n):{}:r?DM({element:r,padding:a}).fn(n):{}}}},vQ=(e,t)=>{const n=iQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},gQ=(e,t)=>{const n=oQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},yQ=(e,t)=>({fn:uQ(e).fn,options:[e,t]}),xQ=(e,t)=>{const n=sQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},bQ=(e,t)=>{const n=lQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},wQ=(e,t)=>{const n=cQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},SQ=(e,t)=>{const n=pQ(e);return{name:n.name,fn:n.fn,options:[e,t]}};var EQ="Arrow",Y4=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return p.jsx(Ie.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Y4.displayName=EQ;var _Q=Y4,Uj="Popper",[G4,Xd]=fi(Uj),[jQ,X4]=G4(Uj),W4=e=>{const{__scopePopper:t,children:n}=e,[r,a]=x.useState(null);return p.jsx(jQ,{scope:t,anchor:r,onAnchorChange:a,children:n})};W4.displayName=Uj;var Q4="PopperAnchor",Z4=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=X4(Q4,n),s=x.useRef(null),c=it(t,s),u=x.useRef(null);return x.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||s.current,d!==u.current&&i.onAnchorChange(u.current)}),r?null:p.jsx(Ie.div,{...a,ref:c})});Z4.displayName=Q4;var Hj="PopperContent",[CQ,OQ]=G4(Hj),J4=x.forwardRef((e,t)=>{var ie,ae,J,re,fe,ne;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:f="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:b,...w}=e,S=X4(Hj,n),[E,O]=x.useState(null),j=it(t,xe=>O(xe)),[A,N]=x.useState(null),T=yW(A),P=(T==null?void 0:T.width)??0,R=(T==null?void 0:T.height)??0,D=r+(i!=="center"?"-"+i:""),K=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},z=Array.isArray(d)?d:[d],I=z.length>0,G={padding:K,boundary:z.filter(NQ),altBoundary:I},{refs:L,floatingStyles:Y,placement:k,isPositioned:H,middlewareData:q}=mQ({strategy:"fixed",placement:D,whileElementsMounted:(...xe)=>aQ(...xe,{animationFrame:g==="always"}),elements:{reference:S.anchor},middleware:[vQ({mainAxis:a+R,alignmentAxis:s}),u&&gQ({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?yQ():void 0,...G}),u&&xQ({...G}),bQ({...G,apply:({elements:xe,rects:ye,availableWidth:De,availableHeight:Me})=>{const{width:Ke,height:Je}=ye.reference,nt=xe.floating.style;nt.setProperty("--radix-popper-available-width",`${De}px`),nt.setProperty("--radix-popper-available-height",`${Me}px`),nt.setProperty("--radix-popper-anchor-width",`${Ke}px`),nt.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),A&&SQ({element:A,padding:c}),TQ({arrowWidth:P,arrowHeight:R}),v&&wQ({strategy:"referenceHidden",...G})]}),[F,V]=n5(k),B=rr(b);Gn(()=>{H&&(B==null||B())},[H,B]);const $=(ie=q.arrow)==null?void 0:ie.x,X=(ae=q.arrow)==null?void 0:ae.y,Z=((J=q.arrow)==null?void 0:J.centerOffset)!==0,[ee,le]=x.useState();return Gn(()=>{E&&le(window.getComputedStyle(E).zIndex)},[E]),p.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:H?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(re=q.transformOrigin)==null?void 0:re.x,(fe=q.transformOrigin)==null?void 0:fe.y].join(" "),...((ne=q.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(CQ,{scope:n,placedSide:F,onArrowChange:N,arrowX:$,arrowY:X,shouldHideArrow:Z,children:p.jsx(Ie.div,{"data-side":F,"data-align":V,...w,ref:j,style:{...w.style,animation:H?void 0:"none"}})})})});J4.displayName=Hj;var e5="PopperArrow",AQ={top:"bottom",right:"left",bottom:"top",left:"right"},t5=x.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=OQ(e5,r),s=AQ[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(_Q,{...a,ref:n,style:{...a.style,display:"block"}})})});t5.displayName=e5;function NQ(e){return e!==null}var TQ=e=>({name:"transformOrigin",options:e,fn(t){var S,E,O;const{placement:n,rects:r,middlewareData:a}=t,s=((S=a.arrow)==null?void 0:S.centerOffset)!==0,c=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[d,m]=n5(n),f={start:"0%",center:"50%",end:"100%"}[m],v=(((E=a.arrow)==null?void 0:E.x)??0)+c/2,g=(((O=a.arrow)==null?void 0:O.y)??0)+u/2;let b="",w="";return d==="bottom"?(b=s?f:`${v}px`,w=`${-u}px`):d==="top"?(b=s?f:`${v}px`,w=`${r.floating.height+u}px`):d==="right"?(b=`${-u}px`,w=s?f:`${g}px`):d==="left"&&(b=`${r.floating.width+u}px`,w=s?f:`${g}px`),{data:{x:b,y:w}}}});function n5(e){const[t,n="center"]=e.split("-");return[t,n]}var Fj=W4,qj=Z4,Kj=J4,Vj=t5,i1="rovingFocusGroup.onEntryFocus",PQ={bubbles:!1,cancelable:!0},Nm="RovingFocusGroup",[NE,r5,MQ]=wj(Nm),[kQ,i0]=fi(Nm,[MQ]),[RQ,DQ]=kQ(Nm),a5=x.forwardRef((e,t)=>p.jsx(NE.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(NE.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(IQ,{...e,ref:t})})}));a5.displayName=Nm;var IQ=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...f}=e,v=x.useRef(null),g=it(t,v),b=jm(i),[w,S]=ll({prop:s,defaultProp:c??null,onChange:u,caller:Nm}),[E,O]=x.useState(!1),j=rr(d),A=r5(n),N=x.useRef(!1),[T,P]=x.useState(0);return x.useEffect(()=>{const R=v.current;if(R)return R.addEventListener(i1,j),()=>R.removeEventListener(i1,j)},[j]),p.jsx(RQ,{scope:n,orientation:r,dir:b,loop:a,currentTabStopId:w,onItemFocus:x.useCallback(R=>S(R),[S]),onItemShiftTab:x.useCallback(()=>O(!0),[]),onFocusableItemAdd:x.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:x.useCallback(()=>P(R=>R-1),[]),children:p.jsx(Ie.div,{tabIndex:E||T===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{N.current=!0}),onFocus:_e(e.onFocus,R=>{const D=!N.current;if(R.target===R.currentTarget&&D&&!E){const K=new CustomEvent(i1,PQ);if(R.currentTarget.dispatchEvent(K),!K.defaultPrevented){const z=A().filter(k=>k.focusable),I=z.find(k=>k.active),G=z.find(k=>k.id===w),Y=[I,G,...z].filter(Boolean).map(k=>k.ref.current);s5(Y,m)}}N.current=!1}),onBlur:_e(e.onBlur,()=>O(!1))})})}),i5="RovingFocusGroupItem",o5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...c}=e,u=Yn(),d=i||u,m=DQ(i5,n),f=m.currentTabStopId===d,v=r5(n),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:w}=m;return x.useEffect(()=>{if(r)return g(),()=>b()},[r,g,b]),p.jsx(NE.ItemSlot,{scope:n,id:d,focusable:r,active:a,children:p.jsx(Ie.span,{tabIndex:f?0:-1,"data-orientation":m.orientation,...c,ref:t,onMouseDown:_e(e.onMouseDown,S=>{r?m.onItemFocus(d):S.preventDefault()}),onFocus:_e(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:_e(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){m.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const E=$Q(S,m.orientation,m.dir);if(E!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let j=v().filter(A=>A.focusable).map(A=>A.ref.current);if(E==="last")j.reverse();else if(E==="prev"||E==="next"){E==="prev"&&j.reverse();const A=j.indexOf(S.currentTarget);j=m.loop?BQ(j,A+1):j.slice(A+1)}setTimeout(()=>s5(j))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:w!=null}):s})})});o5.displayName=i5;var LQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zQ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $Q(e,t,n){const r=zQ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return LQ[r]}function s5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function BQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var l5=a5,c5=o5,TE=["Enter"," "],UQ=["ArrowDown","PageUp","Home"],u5=["ArrowUp","PageDown","End"],HQ=[...UQ,...u5],FQ={ltr:[...TE,"ArrowRight"],rtl:[...TE,"ArrowLeft"]},qQ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tm="Menu",[$h,KQ,VQ]=wj(Tm),[Gc,d5]=fi(Tm,[VQ,Xd,i0]),o0=Xd(),f5=i0(),[YQ,Xc]=Gc(Tm),[GQ,Pm]=Gc(Tm),h5=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:s=!0}=e,c=o0(t),[u,d]=x.useState(null),m=x.useRef(!1),f=rr(i),v=jm(a);return x.useEffect(()=>{const g=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),p.jsx(Fj,{...c,children:p.jsx(YQ,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:d,children:p.jsx(GQ,{scope:t,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:m,dir:v,modal:s,children:r})})})};h5.displayName=Tm;var XQ="MenuAnchor",Yj=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=o0(n);return p.jsx(qj,{...a,...r,ref:t})});Yj.displayName=XQ;var Gj="MenuPortal",[WQ,m5]=Gc(Gj,{forceMount:void 0}),p5=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Xc(Gj,t);return p.jsx(WQ,{scope:t,forceMount:n,children:p.jsx(xr,{present:n||i.open,children:p.jsx(Om,{asChild:!0,container:a,children:r})})})};p5.displayName=Gj;var Ia="MenuContent",[QQ,Xj]=Gc(Ia),v5=x.forwardRef((e,t)=>{const n=m5(Ia,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Xc(Ia,e.__scopeMenu),s=Pm(Ia,e.__scopeMenu);return p.jsx($h.Provider,{scope:e.__scopeMenu,children:p.jsx(xr,{present:r||i.open,children:p.jsx($h.Slot,{scope:e.__scopeMenu,children:s.modal?p.jsx(ZQ,{...a,ref:t}):p.jsx(JQ,{...a,ref:t})})})})}),ZQ=x.forwardRef((e,t)=>{const n=Xc(Ia,e.__scopeMenu),r=x.useRef(null),a=it(t,r);return x.useEffect(()=>{const i=r.current;if(i)return Cj(i)},[]),p.jsx(Wj,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),JQ=x.forwardRef((e,t)=>{const n=Xc(Ia,e.__scopeMenu);return p.jsx(Wj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),eZ=Ac("MenuContent.ScrollLock"),Wj=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:v,onDismiss:g,disableOutsideScroll:b,...w}=e,S=Xc(Ia,n),E=Pm(Ia,n),O=o0(n),j=f5(n),A=KQ(n),[N,T]=x.useState(null),P=x.useRef(null),R=it(t,P,S.onContentChange),D=x.useRef(0),K=x.useRef(""),z=x.useRef(0),I=x.useRef(null),G=x.useRef("right"),L=x.useRef(0),Y=b?Jy:x.Fragment,k=b?{as:eZ,allowPinchZoom:!0}:void 0,H=F=>{var ie,ae;const V=K.current+F,B=A().filter(J=>!J.disabled),$=document.activeElement,X=(ie=B.find(J=>J.ref.current===$))==null?void 0:ie.textValue,Z=B.map(J=>J.textValue),ee=fZ(Z,V,X),le=(ae=B.find(J=>J.textValue===ee))==null?void 0:ae.ref.current;(function J(re){K.current=re,window.clearTimeout(D.current),re!==""&&(D.current=window.setTimeout(()=>J(""),1e3))})(V),le&&setTimeout(()=>le.focus())};x.useEffect(()=>()=>window.clearTimeout(D.current),[]),jj();const q=x.useCallback(F=>{var B,$;return G.current===((B=I.current)==null?void 0:B.side)&&mZ(F,($=I.current)==null?void 0:$.area)},[]);return p.jsx(QQ,{scope:n,searchRef:K,onItemEnter:x.useCallback(F=>{q(F)&&F.preventDefault()},[q]),onItemLeave:x.useCallback(F=>{var V;q(F)||((V=P.current)==null||V.focus(),T(null))},[q]),onTriggerLeave:x.useCallback(F=>{q(F)&&F.preventDefault()},[q]),pointerGraceTimerRef:z,onPointerGraceIntentChange:x.useCallback(F=>{I.current=F},[]),children:p.jsx(Y,{...k,children:p.jsx(Qy,{asChild:!0,trapped:a,onMountAutoFocus:_e(i,F=>{var V;F.preventDefault(),(V=P.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:p.jsx(Cm,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:v,onDismiss:g,children:p.jsx(l5,{asChild:!0,...j,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:T,onEntryFocus:_e(u,F=>{E.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(Kj,{role:"menu","aria-orientation":"vertical","data-state":M5(S.open),"data-radix-menu-content":"",dir:E.dir,...O,...w,ref:R,style:{outline:"none",...w.style},onKeyDown:_e(w.onKeyDown,F=>{const B=F.target.closest("[data-radix-menu-content]")===F.currentTarget,$=F.ctrlKey||F.altKey||F.metaKey,X=F.key.length===1;B&&(F.key==="Tab"&&F.preventDefault(),!$&&X&&H(F.key));const Z=P.current;if(F.target!==Z||!HQ.includes(F.key))return;F.preventDefault();const le=A().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);u5.includes(F.key)&&le.reverse(),uZ(le)}),onBlur:_e(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(D.current),K.current="")}),onPointerMove:_e(e.onPointerMove,Bh(F=>{const V=F.target,B=L.current!==F.clientX;if(F.currentTarget.contains(V)&&B){const $=F.clientX>L.current?"right":"left";G.current=$,L.current=F.clientX}}))})})})})})})});v5.displayName=Ia;var tZ="MenuGroup",Qj=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ie.div,{role:"group",...r,ref:t})});Qj.displayName=tZ;var nZ="MenuLabel",g5=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ie.div,{...r,ref:t})});g5.displayName=nZ;var Dg="MenuItem",LM="menu.itemSelect",s0=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=x.useRef(null),s=Pm(Dg,e.__scopeMenu),c=Xj(Dg,e.__scopeMenu),u=it(t,i),d=x.useRef(!1),m=()=>{const f=i.current;if(!n&&f){const v=new CustomEvent(LM,{bubbles:!0,cancelable:!0});f.addEventListener(LM,g=>r==null?void 0:r(g),{once:!0}),t4(f,v),v.defaultPrevented?d.current=!1:s.onClose()}};return p.jsx(y5,{...a,ref:u,disabled:n,onClick:_e(e.onClick,m),onPointerDown:f=>{var v;(v=e.onPointerDown)==null||v.call(e,f),d.current=!0},onPointerUp:_e(e.onPointerUp,f=>{var v;d.current||(v=f.currentTarget)==null||v.click()}),onKeyDown:_e(e.onKeyDown,f=>{const v=c.searchRef.current!=="";n||v&&f.key===" "||TE.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});s0.displayName=Dg;var y5=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,s=Xj(Dg,n),c=f5(n),u=x.useRef(null),d=it(t,u),[m,f]=x.useState(!1),[v,g]=x.useState("");return x.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[i.children]),p.jsx($h.ItemSlot,{scope:n,disabled:r,textValue:a??v,children:p.jsx(c5,{asChild:!0,...c,focusable:!r,children:p.jsx(Ie.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:_e(e.onPointerMove,Bh(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_e(e.onPointerLeave,Bh(b=>s.onItemLeave(b))),onFocus:_e(e.onFocus,()=>f(!0)),onBlur:_e(e.onBlur,()=>f(!1))})})})}),rZ="MenuCheckboxItem",x5=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return p.jsx(_5,{scope:e.__scopeMenu,checked:n,children:p.jsx(s0,{role:"menuitemcheckbox","aria-checked":Ig(n)?"mixed":n,...a,ref:t,"data-state":Jj(n),onSelect:_e(a.onSelect,()=>r==null?void 0:r(Ig(n)?!0:!n),{checkForDefaultPrevented:!1})})})});x5.displayName=rZ;var b5="MenuRadioGroup",[aZ,iZ]=Gc(b5,{value:void 0,onValueChange:()=>{}}),w5=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=rr(r);return p.jsx(aZ,{scope:e.__scopeMenu,value:n,onValueChange:i,children:p.jsx(Qj,{...a,ref:t})})});w5.displayName=b5;var S5="MenuRadioItem",E5=x.forwardRef((e,t)=>{const{value:n,...r}=e,a=iZ(S5,e.__scopeMenu),i=n===a.value;return p.jsx(_5,{scope:e.__scopeMenu,checked:i,children:p.jsx(s0,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Jj(i),onSelect:_e(r.onSelect,()=>{var s;return(s=a.onValueChange)==null?void 0:s.call(a,n)},{checkForDefaultPrevented:!1})})})});E5.displayName=S5;var Zj="MenuItemIndicator",[_5,oZ]=Gc(Zj,{checked:!1}),j5=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=oZ(Zj,n);return p.jsx(xr,{present:r||Ig(i.checked)||i.checked===!0,children:p.jsx(Ie.span,{...a,ref:t,"data-state":Jj(i.checked)})})});j5.displayName=Zj;var sZ="MenuSeparator",C5=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ie.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});C5.displayName=sZ;var lZ="MenuArrow",O5=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=o0(n);return p.jsx(Vj,{...a,...r,ref:t})});O5.displayName=lZ;var cZ="MenuSub",[S2e,A5]=Gc(cZ),_h="MenuSubTrigger",N5=x.forwardRef((e,t)=>{const n=Xc(_h,e.__scopeMenu),r=Pm(_h,e.__scopeMenu),a=A5(_h,e.__scopeMenu),i=Xj(_h,e.__scopeMenu),s=x.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},m=x.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return x.useEffect(()=>m,[m]),x.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),u(null)}},[c,u]),p.jsx(Yj,{asChild:!0,...d,children:p.jsx(y5,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":M5(n.open),...e,ref:Io(t,a.onTriggerChange),onClick:f=>{var v;(v=e.onClick)==null||v.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:_e(e.onPointerMove,Bh(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:_e(e.onPointerLeave,Bh(f=>{var g,b;m();const v=(g=n.content)==null?void 0:g.getBoundingClientRect();if(v){const w=(b=n.content)==null?void 0:b.dataset.side,S=w==="right",E=S?-5:5,O=v[S?"left":"right"],j=v[S?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+E,y:f.clientY},{x:O,y:v.top},{x:j,y:v.top},{x:j,y:v.bottom},{x:O,y:v.bottom}],side:w}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:_e(e.onKeyDown,f=>{var g;const v=i.searchRef.current!=="";e.disabled||v&&f.key===" "||FQ[r.dir].includes(f.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),f.preventDefault())})})})});N5.displayName=_h;var T5="MenuSubContent",P5=x.forwardRef((e,t)=>{const n=m5(Ia,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Xc(Ia,e.__scopeMenu),s=Pm(Ia,e.__scopeMenu),c=A5(T5,e.__scopeMenu),u=x.useRef(null),d=it(t,u);return p.jsx($h.Provider,{scope:e.__scopeMenu,children:p.jsx(xr,{present:r||i.open,children:p.jsx($h.Slot,{scope:e.__scopeMenu,children:p.jsx(Wj,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var f;s.isUsingKeyboardRef.current&&((f=u.current)==null||f.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:_e(e.onFocusOutside,m=>{m.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:_e(e.onEscapeKeyDown,m=>{s.onClose(),m.preventDefault()}),onKeyDown:_e(e.onKeyDown,m=>{var g;const f=m.currentTarget.contains(m.target),v=qQ[s.dir].includes(m.key);f&&v&&(i.onOpenChange(!1),(g=c.trigger)==null||g.focus(),m.preventDefault())})})})})})});P5.displayName=T5;function M5(e){return e?"open":"closed"}function Ig(e){return e==="indeterminate"}function Jj(e){return Ig(e)?"indeterminate":e?"checked":"unchecked"}function uZ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function dZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function fZ(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=dZ(e,Math.max(i,0));a.length===1&&(s=s.filter(d=>d!==n));const u=s.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return u!==n?u:void 0}function hZ(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i],u=t[s],d=c.x,m=c.y,f=u.x,v=u.y;m>r!=v>r&&n<(f-d)*(r-m)/(v-m)+d&&(a=!a)}return a}function mZ(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return hZ(n,t)}function Bh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var pZ=h5,vZ=Yj,gZ=p5,yZ=v5,xZ=Qj,bZ=g5,wZ=s0,SZ=x5,EZ=w5,_Z=E5,jZ=j5,CZ=C5,OZ=O5,AZ=N5,NZ=P5,l0="DropdownMenu",[TZ]=fi(l0,[d5]),Pr=d5(),[PZ,k5]=TZ(l0),R5=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:s,modal:c=!0}=e,u=Pr(t),d=x.useRef(null),[m,f]=ll({prop:a,defaultProp:i??!1,onChange:s,caller:l0});return p.jsx(PZ,{scope:t,triggerId:Yn(),triggerRef:d,contentId:Yn(),open:m,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(v=>!v),[f]),modal:c,children:p.jsx(pZ,{...u,open:m,onOpenChange:f,dir:r,modal:c,children:n})})};R5.displayName=l0;var D5="DropdownMenuTrigger",I5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=k5(D5,n),s=Pr(n);return p.jsx(vZ,{asChild:!0,...s,children:p.jsx(Ie.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Io(t,i.triggerRef),onPointerDown:_e(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:_e(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});I5.displayName=D5;var MZ="DropdownMenuPortal",L5=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Pr(t);return p.jsx(gZ,{...r,...n})};L5.displayName=MZ;var z5="DropdownMenuContent",$5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=k5(z5,n),i=Pr(n),s=x.useRef(!1);return p.jsx(yZ,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,c=>{var u;s.current||(u=a.triggerRef.current)==null||u.focus(),s.current=!1,c.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,m=u.button===2||d;(!a.modal||m)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$5.displayName=z5;var kZ="DropdownMenuGroup",RZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(xZ,{...a,...r,ref:t})});RZ.displayName=kZ;var DZ="DropdownMenuLabel",IZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(bZ,{...a,...r,ref:t})});IZ.displayName=DZ;var LZ="DropdownMenuItem",B5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(wZ,{...a,...r,ref:t})});B5.displayName=LZ;var zZ="DropdownMenuCheckboxItem",U5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(SZ,{...a,...r,ref:t})});U5.displayName=zZ;var $Z="DropdownMenuRadioGroup",BZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(EZ,{...a,...r,ref:t})});BZ.displayName=$Z;var UZ="DropdownMenuRadioItem",HZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(_Z,{...a,...r,ref:t})});HZ.displayName=UZ;var FZ="DropdownMenuItemIndicator",H5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(jZ,{...a,...r,ref:t})});H5.displayName=FZ;var qZ="DropdownMenuSeparator",KZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(CZ,{...a,...r,ref:t})});KZ.displayName=qZ;var VZ="DropdownMenuArrow",YZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(OZ,{...a,...r,ref:t})});YZ.displayName=VZ;var GZ="DropdownMenuSubTrigger",XZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(AZ,{...a,...r,ref:t})});XZ.displayName=GZ;var WZ="DropdownMenuSubContent",QZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Pr(n);return p.jsx(NZ,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});QZ.displayName=WZ;var ZZ=R5,JZ=I5,eJ=L5,tJ=$5,nJ=B5,rJ=U5,aJ=H5,iJ="Label",F5=x.forwardRef((e,t)=>p.jsx(Ie.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));F5.displayName=iJ;var oJ=F5;function PE(e,[t,n]){return Math.min(n,Math.max(t,e))}function sJ(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var eC="ScrollArea",[q5]=fi(eC),[lJ,$a]=q5(eC),K5=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...s}=e,[c,u]=x.useState(null),[d,m]=x.useState(null),[f,v]=x.useState(null),[g,b]=x.useState(null),[w,S]=x.useState(null),[E,O]=x.useState(0),[j,A]=x.useState(0),[N,T]=x.useState(!1),[P,R]=x.useState(!1),D=it(t,z=>u(z)),K=jm(a);return p.jsx(lJ,{scope:n,type:r,dir:K,scrollHideDelay:i,scrollArea:c,viewport:d,onViewportChange:m,content:f,onContentChange:v,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:N,onScrollbarXEnabledChange:T,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:P,onScrollbarYEnabledChange:R,onCornerWidthChange:O,onCornerHeightChange:A,children:p.jsx(Ie.div,{dir:K,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});K5.displayName=eC;var V5="ScrollAreaViewport",Y5=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,s=$a(V5,n),c=x.useRef(null),u=it(t,c,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),p.jsx(Ie.div,{"data-radix-scroll-area-viewport":"",...i,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Y5.displayName=V5;var Gi="ScrollAreaScrollbar",G5=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=$a(Gi,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=a,c=e.orientation==="horizontal";return x.useEffect(()=>(c?i(!0):s(!0),()=>{c?i(!1):s(!1)}),[c,i,s]),a.type==="hover"?p.jsx(cJ,{...r,ref:t,forceMount:n}):a.type==="scroll"?p.jsx(uJ,{...r,ref:t,forceMount:n}):a.type==="auto"?p.jsx(X5,{...r,ref:t,forceMount:n}):a.type==="always"?p.jsx(tC,{...r,ref:t}):null});G5.displayName=Gi;var cJ=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=$a(Gi,e.__scopeScrollArea),[i,s]=x.useState(!1);return x.useEffect(()=>{const c=a.scrollArea;let u=0;if(c){const d=()=>{window.clearTimeout(u),s(!0)},m=()=>{u=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return c.addEventListener("pointerenter",d),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),c.removeEventListener("pointerenter",d),c.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),p.jsx(xr,{present:n||i,children:p.jsx(X5,{"data-state":i?"visible":"hidden",...r,ref:t})})}),uJ=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=$a(Gi,e.__scopeScrollArea),i=e.orientation==="horizontal",s=u0(()=>u("SCROLL_END"),100),[c,u]=sJ("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(c==="idle"){const d=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(d)}},[c,a.scrollHideDelay,u]),x.useEffect(()=>{const d=a.viewport,m=i?"scrollLeft":"scrollTop";if(d){let f=d[m];const v=()=>{const g=d[m];f!==g&&(u("SCROLL"),s()),f=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[a.viewport,i,u,s]),p.jsx(xr,{present:n||c!=="hidden",children:p.jsx(tC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:_e(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:_e(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),X5=x.forwardRef((e,t)=>{const n=$a(Gi,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,s]=x.useState(!1),c=e.orientation==="horizontal",u=u0(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;s(c?d:m)}},10);return _d(n.viewport,u),_d(n.content,u),p.jsx(xr,{present:r||i,children:p.jsx(tC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),tC=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=$a(Gi,e.__scopeScrollArea),i=x.useRef(null),s=x.useRef(0),[c,u]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=e$(c.viewport,c.content),m={...r,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:v=>i.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function f(v,g){return vJ(v,s.current,c,g)}return n==="horizontal"?p.jsx(dJ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const v=a.viewport.scrollLeft,g=zM(v,c,a.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{a.viewport&&(a.viewport.scrollLeft=v)},onDragScroll:v=>{a.viewport&&(a.viewport.scrollLeft=f(v,a.dir))}}):n==="vertical"?p.jsx(fJ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const v=a.viewport.scrollTop,g=zM(v,c);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{a.viewport&&(a.viewport.scrollTop=v)},onDragScroll:v=>{a.viewport&&(a.viewport.scrollTop=f(v))}}):null}),dJ=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=$a(Gi,e.__scopeScrollArea),[s,c]=x.useState(),u=x.useRef(null),d=it(t,u,i.onScrollbarXChange);return x.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),p.jsx(Q5,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":c0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,f)=>{if(i.viewport){const v=i.viewport.scrollLeft+m.deltaX;e.onWheelScroll(v),n$(v,f)&&m.preventDefault()}},onResize:()=>{u.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:zg(s.paddingLeft),paddingEnd:zg(s.paddingRight)}})}})}),fJ=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=$a(Gi,e.__scopeScrollArea),[s,c]=x.useState(),u=x.useRef(null),d=it(t,u,i.onScrollbarYChange);return x.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),p.jsx(Q5,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":c0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,f)=>{if(i.viewport){const v=i.viewport.scrollTop+m.deltaY;e.onWheelScroll(v),n$(v,f)&&m.preventDefault()}},onResize:()=>{u.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:zg(s.paddingTop),paddingEnd:zg(s.paddingBottom)}})}})}),[hJ,W5]=q5(Gi),Q5=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:m,onResize:f,...v}=e,g=$a(Gi,n),[b,w]=x.useState(null),S=it(t,D=>w(D)),E=x.useRef(null),O=x.useRef(""),j=g.viewport,A=r.content-r.viewport,N=rr(m),T=rr(u),P=u0(f,10);function R(D){if(E.current){const K=D.clientX-E.current.left,z=D.clientY-E.current.top;d({x:K,y:z})}}return x.useEffect(()=>{const D=K=>{const z=K.target;(b==null?void 0:b.contains(z))&&N(K,A)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[j,b,A,N]),x.useEffect(T,[r,T]),_d(b,P),_d(g.content,P),p.jsx(hJ,{scope:n,scrollbar:b,hasThumb:a,onThumbChange:rr(i),onThumbPointerUp:rr(s),onThumbPositionChange:T,onThumbPointerDown:rr(c),children:p.jsx(Ie.div,{...v,ref:S,style:{position:"absolute",...v.style},onPointerDown:_e(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),E.current=b.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(D))}),onPointerMove:_e(e.onPointerMove,R),onPointerUp:_e(e.onPointerUp,D=>{const K=D.target;K.hasPointerCapture(D.pointerId)&&K.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=O.current,g.viewport&&(g.viewport.style.scrollBehavior=""),E.current=null})})})}),Lg="ScrollAreaThumb",Z5=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=W5(Lg,e.__scopeScrollArea);return p.jsx(xr,{present:n||a.hasThumb,children:p.jsx(mJ,{ref:t,...r})})}),mJ=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=$a(Lg,n),s=W5(Lg,n),{onThumbPositionChange:c}=s,u=it(t,f=>s.onThumbChange(f)),d=x.useRef(void 0),m=u0(()=>{d.current&&(d.current(),d.current=void 0)},100);return x.useEffect(()=>{const f=i.viewport;if(f){const v=()=>{if(m(),!d.current){const g=gJ(f,c);d.current=g,c()}};return c(),f.addEventListener("scroll",v),()=>f.removeEventListener("scroll",v)}},[i.viewport,m,c]),p.jsx(Ie.div,{"data-state":s.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:_e(e.onPointerDownCapture,f=>{const g=f.target.getBoundingClientRect(),b=f.clientX-g.left,w=f.clientY-g.top;s.onThumbPointerDown({x:b,y:w})}),onPointerUp:_e(e.onPointerUp,s.onThumbPointerUp)})});Z5.displayName=Lg;var nC="ScrollAreaCorner",J5=x.forwardRef((e,t)=>{const n=$a(nC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.jsx(pJ,{...e,ref:t}):null});J5.displayName=nC;var pJ=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=$a(nC,n),[i,s]=x.useState(0),[c,u]=x.useState(0),d=!!(i&&c);return _d(a.scrollbarX,()=>{var f;const m=((f=a.scrollbarX)==null?void 0:f.offsetHeight)||0;a.onCornerHeightChange(m),u(m)}),_d(a.scrollbarY,()=>{var f;const m=((f=a.scrollbarY)==null?void 0:f.offsetWidth)||0;a.onCornerWidthChange(m),s(m)}),d?p.jsx(Ie.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function zg(e){return e?parseInt(e,10):0}function e$(e,t){const n=e/t;return isNaN(n)?0:n}function c0(e){const t=e$(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function vJ(e,t,n,r="ltr"){const a=c0(n),i=a/2,s=t||i,c=a-s,u=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,f=r==="ltr"?[0,m]:[m*-1,0];return t$([u,d],f)(e)}function zM(e,t,n="ltr"){const r=c0(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,s=t.content-t.viewport,c=i-r,u=n==="ltr"?[0,s]:[s*-1,0],d=PE(e,u);return t$([0,s],[0,c])(d)}function t$(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function n$(e,t){return e>0&&e<t}var gJ=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,c=n.top!==i.top;(s||c)&&t(),n=i,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function u0(e,t){const n=rr(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function _d(e,t){const n=rr(t);Gn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var yJ=K5,xJ=Y5,bJ=J5,wJ=[" ","Enter","ArrowUp","ArrowDown"],SJ=[" ","Enter"],Pc="Select",[d0,f0,EJ]=wj(Pc),[Wd]=fi(Pc,[EJ,Xd]),h0=Xd(),[_J,xl]=Wd(Pc),[jJ,CJ]=Wd(Pc),r$=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:s,defaultValue:c,onValueChange:u,dir:d,name:m,autoComplete:f,disabled:v,required:g,form:b}=e,w=h0(t),[S,E]=x.useState(null),[O,j]=x.useState(null),[A,N]=x.useState(!1),T=jm(d),[P,R]=ll({prop:r,defaultProp:a??!1,onChange:i,caller:Pc}),[D,K]=ll({prop:s,defaultProp:c,onChange:u,caller:Pc}),z=x.useRef(null),I=S?b||!!S.closest("form"):!0,[G,L]=x.useState(new Set),Y=Array.from(G).map(k=>k.props.value).join(";");return p.jsx(Fj,{...w,children:p.jsxs(_J,{required:g,scope:t,trigger:S,onTriggerChange:E,valueNode:O,onValueNodeChange:j,valueNodeHasChildren:A,onValueNodeHasChildrenChange:N,contentId:Yn(),value:D,onValueChange:K,open:P,onOpenChange:R,dir:T,triggerPointerDownPosRef:z,disabled:v,children:[p.jsx(d0.Provider,{scope:t,children:p.jsx(jJ,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(k=>{L(H=>new Set(H).add(k))},[]),onNativeOptionRemove:x.useCallback(k=>{L(H=>{const q=new Set(H);return q.delete(k),q})},[]),children:n})}),I?p.jsxs(j$,{"aria-hidden":!0,required:g,tabIndex:-1,name:m,autoComplete:f,value:D,onChange:k=>K(k.target.value),disabled:v,form:b,children:[D===void 0?p.jsx("option",{value:""}):null,Array.from(G)]},Y):null]})})};r$.displayName=Pc;var a$="SelectTrigger",i$=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=h0(n),s=xl(a$,n),c=s.disabled||r,u=it(t,s.onTriggerChange),d=f0(n),m=x.useRef("touch"),[f,v,g]=O$(w=>{const S=d().filter(j=>!j.disabled),E=S.find(j=>j.value===s.value),O=A$(S,w,E);O!==void 0&&s.onValueChange(O.value)}),b=w=>{c||(s.onOpenChange(!0),g()),w&&(s.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return p.jsx(qj,{asChild:!0,...i,children:p.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":C$(s.value)?"":void 0,...a,ref:u,onClick:_e(a.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&b(w)}),onPointerDown:_e(a.onPointerDown,w=>{m.current=w.pointerType;const S=w.target;S.hasPointerCapture(w.pointerId)&&S.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(b(w),w.preventDefault())}),onKeyDown:_e(a.onKeyDown,w=>{const S=f.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&v(w.key),!(S&&w.key===" ")&&wJ.includes(w.key)&&(b(),w.preventDefault())})})})});i$.displayName=a$;var o$="SelectValue",s$=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:s="",...c}=e,u=xl(o$,n),{onValueNodeHasChildrenChange:d}=u,m=i!==void 0,f=it(t,u.onValueNodeChange);return Gn(()=>{d(m)},[d,m]),p.jsx(Ie.span,{...c,ref:f,style:{pointerEvents:"none"},children:C$(u.value)?p.jsx(p.Fragment,{children:s}):i})});s$.displayName=o$;var OJ="SelectIcon",l$=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return p.jsx(Ie.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});l$.displayName=OJ;var AJ="SelectPortal",c$=e=>p.jsx(Om,{asChild:!0,...e});c$.displayName=AJ;var Mc="SelectContent",u$=x.forwardRef((e,t)=>{const n=xl(Mc,e.__scopeSelect),[r,a]=x.useState();if(Gn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?yl.createPortal(p.jsx(d$,{scope:e.__scopeSelect,children:p.jsx(d0.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(f$,{...e,ref:t})});u$.displayName=Mc;var Xa=10,[d$,bl]=Wd(Mc),NJ="SelectContentImpl",TJ=Ac("SelectContent.RemoveScroll"),f$=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:c,sideOffset:u,align:d,alignOffset:m,arrowPadding:f,collisionBoundary:v,collisionPadding:g,sticky:b,hideWhenDetached:w,avoidCollisions:S,...E}=e,O=xl(Mc,n),[j,A]=x.useState(null),[N,T]=x.useState(null),P=it(t,ie=>A(ie)),[R,D]=x.useState(null),[K,z]=x.useState(null),I=f0(n),[G,L]=x.useState(!1),Y=x.useRef(!1);x.useEffect(()=>{if(j)return Cj(j)},[j]),jj();const k=x.useCallback(ie=>{const[ae,...J]=I().map(ne=>ne.ref.current),[re]=J.slice(-1),fe=document.activeElement;for(const ne of ie)if(ne===fe||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===ae&&N&&(N.scrollTop=0),ne===re&&N&&(N.scrollTop=N.scrollHeight),ne==null||ne.focus(),document.activeElement!==fe))return},[I,N]),H=x.useCallback(()=>k([R,j]),[k,R,j]);x.useEffect(()=>{G&&H()},[G,H]);const{onOpenChange:q,triggerPointerDownPosRef:F}=O;x.useEffect(()=>{if(j){let ie={x:0,y:0};const ae=re=>{var fe,ne;ie={x:Math.abs(Math.round(re.pageX)-(((fe=F.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(re.pageY)-(((ne=F.current)==null?void 0:ne.y)??0))}},J=re=>{ie.x<=10&&ie.y<=10?re.preventDefault():j.contains(re.target)||q(!1),document.removeEventListener("pointermove",ae),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",J,{capture:!0})}}},[j,q,F]),x.useEffect(()=>{const ie=()=>q(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[q]);const[V,B]=O$(ie=>{const ae=I().filter(fe=>!fe.disabled),J=ae.find(fe=>fe.ref.current===document.activeElement),re=A$(ae,ie,J);re&&setTimeout(()=>re.ref.current.focus())}),$=x.useCallback((ie,ae,J)=>{const re=!Y.current&&!J;(O.value!==void 0&&O.value===ae||re)&&(D(ie),re&&(Y.current=!0))},[O.value]),X=x.useCallback(()=>j==null?void 0:j.focus(),[j]),Z=x.useCallback((ie,ae,J)=>{const re=!Y.current&&!J;(O.value!==void 0&&O.value===ae||re)&&z(ie)},[O.value]),ee=r==="popper"?ME:h$,le=ee===ME?{side:c,sideOffset:u,align:d,alignOffset:m,arrowPadding:f,collisionBoundary:v,collisionPadding:g,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return p.jsx(d$,{scope:n,content:j,viewport:N,onViewportChange:T,itemRefCallback:$,selectedItem:R,onItemLeave:X,itemTextRefCallback:Z,focusSelectedItem:H,selectedItemText:K,position:r,isPositioned:G,searchRef:V,children:p.jsx(Jy,{as:TJ,allowPinchZoom:!0,children:p.jsx(Qy,{asChild:!0,trapped:O.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:_e(a,ie=>{var ae;(ae=O.trigger)==null||ae.focus({preventScroll:!0}),ie.preventDefault()}),children:p.jsx(Cm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:p.jsx(ee,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:ie=>ie.preventDefault(),...E,...le,onPlaced:()=>L(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:_e(E.onKeyDown,ie=>{const ae=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!ae&&ie.key.length===1&&B(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let re=I().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const fe=ie.target,ne=re.indexOf(fe);re=re.slice(ne+1)}setTimeout(()=>k(re)),ie.preventDefault()}})})})})})})});f$.displayName=NJ;var PJ="SelectItemAlignedPosition",h$=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=xl(Mc,n),s=bl(Mc,n),[c,u]=x.useState(null),[d,m]=x.useState(null),f=it(t,P=>m(P)),v=f0(n),g=x.useRef(!1),b=x.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:E,focusSelectedItem:O}=s,j=x.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&w&&S&&E){const P=i.trigger.getBoundingClientRect(),R=d.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),K=E.getBoundingClientRect();if(i.dir!=="rtl"){const fe=K.left-R.left,ne=D.left-fe,xe=P.left-ne,ye=P.width+xe,De=Math.max(ye,R.width),Me=window.innerWidth-Xa,Ke=PE(ne,[Xa,Math.max(Xa,Me-De)]);c.style.minWidth=ye+"px",c.style.left=Ke+"px"}else{const fe=R.right-K.right,ne=window.innerWidth-D.right-fe,xe=window.innerWidth-P.right-ne,ye=P.width+xe,De=Math.max(ye,R.width),Me=window.innerWidth-Xa,Ke=PE(ne,[Xa,Math.max(Xa,Me-De)]);c.style.minWidth=ye+"px",c.style.right=Ke+"px"}const z=v(),I=window.innerHeight-Xa*2,G=w.scrollHeight,L=window.getComputedStyle(d),Y=parseInt(L.borderTopWidth,10),k=parseInt(L.paddingTop,10),H=parseInt(L.borderBottomWidth,10),q=parseInt(L.paddingBottom,10),F=Y+k+G+q+H,V=Math.min(S.offsetHeight*5,F),B=window.getComputedStyle(w),$=parseInt(B.paddingTop,10),X=parseInt(B.paddingBottom,10),Z=P.top+P.height/2-Xa,ee=I-Z,le=S.offsetHeight/2,ie=S.offsetTop+le,ae=Y+k+ie,J=F-ae;if(ae<=Z){const fe=z.length>0&&S===z[z.length-1].ref.current;c.style.bottom="0px";const ne=d.clientHeight-w.offsetTop-w.offsetHeight,xe=Math.max(ee,le+(fe?X:0)+ne+H),ye=ae+xe;c.style.height=ye+"px"}else{const fe=z.length>0&&S===z[0].ref.current;c.style.top="0px";const xe=Math.max(Z,Y+w.offsetTop+(fe?$:0)+le)+J;c.style.height=xe+"px",w.scrollTop=ae-Z+w.offsetTop}c.style.margin=`${Xa}px 0`,c.style.minHeight=V+"px",c.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,i.trigger,i.valueNode,c,d,w,S,E,i.dir,r]);Gn(()=>j(),[j]);const[A,N]=x.useState();Gn(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const T=x.useCallback(P=>{P&&b.current===!0&&(j(),O==null||O(),b.current=!1)},[j,O]);return p.jsx(kJ,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:p.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:p.jsx(Ie.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});h$.displayName=PJ;var MJ="SelectPopperPosition",ME=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Xa,...i}=e,s=h0(n);return p.jsx(Kj,{...s,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ME.displayName=MJ;var[kJ,rC]=Wd(Mc,{}),kE="SelectViewport",m$=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=bl(kE,n),s=rC(kE,n),c=it(t,i.onViewportChange),u=x.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(d0.Slot,{scope:n,children:p.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:_e(a.onScroll,d=>{const m=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:v}=s;if(v!=null&&v.current&&f){const g=Math.abs(u.current-m.scrollTop);if(g>0){const b=window.innerHeight-Xa*2,w=parseFloat(f.style.minHeight),S=parseFloat(f.style.height),E=Math.max(w,S);if(E<b){const O=E+g,j=Math.min(b,O),A=O-j;f.style.height=j+"px",f.style.bottom==="0px"&&(m.scrollTop=A>0?A:0,f.style.justifyContent="flex-end")}}}u.current=m.scrollTop})})})]})});m$.displayName=kE;var p$="SelectGroup",[RJ,DJ]=Wd(p$),IJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Yn();return p.jsx(RJ,{scope:n,id:a,children:p.jsx(Ie.div,{role:"group","aria-labelledby":a,...r,ref:t})})});IJ.displayName=p$;var v$="SelectLabel",LJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=DJ(v$,n);return p.jsx(Ie.div,{id:a.id,...r,ref:t})});LJ.displayName=v$;var $g="SelectItem",[zJ,g$]=Wd($g),y$=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...s}=e,c=xl($g,n),u=bl($g,n),d=c.value===r,[m,f]=x.useState(i??""),[v,g]=x.useState(!1),b=it(t,O=>{var j;return(j=u.itemRefCallback)==null?void 0:j.call(u,O,r,a)}),w=Yn(),S=x.useRef("touch"),E=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(zJ,{scope:n,value:r,disabled:a,textId:w,isSelected:d,onItemTextChange:x.useCallback(O=>{f(j=>j||((O==null?void 0:O.textContent)??"").trim())},[]),children:p.jsx(d0.ItemSlot,{scope:n,value:r,disabled:a,textValue:m,children:p.jsx(Ie.div,{role:"option","aria-labelledby":w,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:b,onFocus:_e(s.onFocus,()=>g(!0)),onBlur:_e(s.onBlur,()=>g(!1)),onClick:_e(s.onClick,()=>{S.current!=="mouse"&&E()}),onPointerUp:_e(s.onPointerUp,()=>{S.current==="mouse"&&E()}),onPointerDown:_e(s.onPointerDown,O=>{S.current=O.pointerType}),onPointerMove:_e(s.onPointerMove,O=>{var j;S.current=O.pointerType,a?(j=u.onItemLeave)==null||j.call(u):S.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(s.onPointerLeave,O=>{var j;O.currentTarget===document.activeElement&&((j=u.onItemLeave)==null||j.call(u))}),onKeyDown:_e(s.onKeyDown,O=>{var A;((A=u.searchRef)==null?void 0:A.current)!==""&&O.key===" "||(SJ.includes(O.key)&&E(),O.key===" "&&O.preventDefault())})})})})});y$.displayName=$g;var jh="SelectItemText",x$=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,s=xl(jh,n),c=bl(jh,n),u=g$(jh,n),d=CJ(jh,n),[m,f]=x.useState(null),v=it(t,E=>f(E),u.onItemTextChange,E=>{var O;return(O=c.itemTextRefCallback)==null?void 0:O.call(c,E,u.value,u.disabled)}),g=m==null?void 0:m.textContent,b=x.useMemo(()=>p.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=d;return Gn(()=>(w(b),()=>S(b)),[w,S,b]),p.jsxs(p.Fragment,{children:[p.jsx(Ie.span,{id:u.textId,...i,ref:v}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?yl.createPortal(i.children,s.valueNode):null]})});x$.displayName=jh;var b$="SelectItemIndicator",w$=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g$(b$,n).isSelected?p.jsx(Ie.span,{"aria-hidden":!0,...r,ref:t}):null});w$.displayName=b$;var RE="SelectScrollUpButton",S$=x.forwardRef((e,t)=>{const n=bl(RE,e.__scopeSelect),r=rC(RE,e.__scopeSelect),[a,i]=x.useState(!1),s=it(t,r.onScrollButtonChange);return Gn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollTop>0;i(d)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?p.jsx(_$,{...e,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});S$.displayName=RE;var DE="SelectScrollDownButton",E$=x.forwardRef((e,t)=>{const n=bl(DE,e.__scopeSelect),r=rC(DE,e.__scopeSelect),[a,i]=x.useState(!1),s=it(t,r.onScrollButtonChange);return Gn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollHeight-u.clientHeight,m=Math.ceil(u.scrollTop)<d;i(m)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?p.jsx(_$,{...e,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});E$.displayName=DE;var _$=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=bl("SelectScrollButton",n),s=x.useRef(null),c=f0(n),u=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>u(),[u]),Gn(()=>{var m;const d=c().find(f=>f.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[c]),p.jsx(Ie.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:_e(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:_e(a.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:_e(a.onPointerLeave,()=>{u()})})}),$J="SelectSeparator",BJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(Ie.div,{"aria-hidden":!0,...r,ref:t})});BJ.displayName=$J;var IE="SelectArrow",UJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=h0(n),i=xl(IE,n),s=bl(IE,n);return i.open&&s.position==="popper"?p.jsx(Vj,{...a,...r,ref:t}):null});UJ.displayName=IE;var HJ="SelectBubbleInput",j$=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=x.useRef(null),i=it(r,a),s=gW(t);return x.useEffect(()=>{const c=a.current;if(!c)return;const u=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==t&&m){const f=new Event("change",{bubbles:!0});m.call(c,t),c.dispatchEvent(f)}},[s,t]),p.jsx(Ie.select,{...n,style:{...n4,...n.style},ref:i,defaultValue:t})});j$.displayName=HJ;function C$(e){return e===""||e===void 0}function O$(e){const t=rr(e),n=x.useRef(""),r=x.useRef(0),a=x.useCallback(s=>{const c=n.current+s;t(c),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(c)},[t]),i=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function A$(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=FJ(e,Math.max(i,0));a.length===1&&(s=s.filter(d=>d!==n));const u=s.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return u!==n?u:void 0}function FJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qJ=r$,KJ=i$,VJ=s$,YJ=l$,GJ=c$,XJ=u$,WJ=m$,QJ=y$,ZJ=x$,JJ=w$,eee=S$,tee=E$,nee="Separator",$M="horizontal",ree=["horizontal","vertical"],N$=x.forwardRef((e,t)=>{const{decorative:n,orientation:r=$M,...a}=e,i=aee(r)?r:$M,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return p.jsx(Ie.div,{"data-orientation":i,...c,...a,ref:t})});N$.displayName=nee;function aee(e){return ree.includes(e)}var iee=N$,m0="Tabs",[oee]=fi(m0,[i0]),T$=i0(),[see,aC]=oee(m0),P$=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:c,activationMode:u="automatic",...d}=e,m=jm(c),[f,v]=ll({prop:r,onChange:a,defaultProp:i??"",caller:m0});return p.jsx(see,{scope:n,baseId:Yn(),value:f,onValueChange:v,orientation:s,dir:m,activationMode:u,children:p.jsx(Ie.div,{dir:m,"data-orientation":s,...d,ref:t})})});P$.displayName=m0;var M$="TabsList",k$=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=aC(M$,n),s=T$(n);return p.jsx(l5,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:p.jsx(Ie.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});k$.displayName=M$;var R$="TabsTrigger",D$=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,s=aC(R$,n),c=T$(n),u=z$(s.baseId,r),d=$$(s.baseId,r),m=r===s.value;return p.jsx(c5,{asChild:!0,...c,focusable:!a,active:m,children:p.jsx(Ie.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:u,...i,ref:t,onMouseDown:_e(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:_e(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:_e(e.onFocus,()=>{const f=s.activationMode!=="manual";!m&&!a&&f&&s.onValueChange(r)})})})});D$.displayName=R$;var I$="TabsContent",L$=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...s}=e,c=aC(I$,n),u=z$(c.baseId,r),d=$$(c.baseId,r),m=r===c.value,f=x.useRef(m);return x.useEffect(()=>{const v=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(v)},[]),p.jsx(xr,{present:a||m,children:({present:v})=>p.jsx(Ie.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!v,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:v&&i})})});L$.displayName=I$;function z$(e,t){return`${e}-trigger-${t}`}function $$(e,t){return`${e}-content-${t}`}var lee=P$,cee=k$,uee=D$,dee=L$,[p0]=fi("Tooltip",[Xd]),v0=Xd(),B$="TooltipProvider",fee=700,LE="tooltip.open",[hee,iC]=p0(B$),U$=e=>{const{__scopeTooltip:t,delayDuration:n=fee,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,s=x.useRef(!0),c=x.useRef(!1),u=x.useRef(0);return x.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),p.jsx(hee,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(d=>{c.current=d},[]),disableHoverableContent:a,children:i})};U$.displayName=B$;var Uh="Tooltip",[mee,Mm]=p0(Uh),H$=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,u=iC(Uh,e.__scopeTooltip),d=v0(t),[m,f]=x.useState(null),v=Yn(),g=x.useRef(0),b=s??u.disableHoverableContent,w=c??u.delayDuration,S=x.useRef(!1),[E,O]=ll({prop:r,defaultProp:a??!1,onChange:P=>{P?(u.onOpen(),document.dispatchEvent(new CustomEvent(LE))):u.onClose(),i==null||i(P)},caller:Uh}),j=x.useMemo(()=>E?S.current?"delayed-open":"instant-open":"closed",[E]),A=x.useCallback(()=>{window.clearTimeout(g.current),g.current=0,S.current=!1,O(!0)},[O]),N=x.useCallback(()=>{window.clearTimeout(g.current),g.current=0,O(!1)},[O]),T=x.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{S.current=!0,O(!0),g.current=0},w)},[w,O]);return x.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),p.jsx(Fj,{...d,children:p.jsx(mee,{scope:t,contentId:v,open:E,stateAttribute:j,trigger:m,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{u.isOpenDelayedRef.current?T():A()},[u.isOpenDelayedRef,T,A]),onTriggerLeave:x.useCallback(()=>{b?N():(window.clearTimeout(g.current),g.current=0)},[N,b]),onOpen:A,onClose:N,disableHoverableContent:b,children:n})})};H$.displayName=Uh;var zE="TooltipTrigger",F$=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Mm(zE,n),i=iC(zE,n),s=v0(n),c=x.useRef(null),u=it(t,c,a.onTriggerChange),d=x.useRef(!1),m=x.useRef(!1),f=x.useCallback(()=>d.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),p.jsx(qj,{asChild:!0,...s,children:p.jsx(Ie.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:u,onPointerMove:_e(e.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:_e(e.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:_e(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:_e(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:_e(e.onBlur,a.onClose),onClick:_e(e.onClick,a.onClose)})})});F$.displayName=zE;var oC="TooltipPortal",[pee,vee]=p0(oC,{forceMount:void 0}),q$=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=Mm(oC,t);return p.jsx(pee,{scope:t,forceMount:n,children:p.jsx(xr,{present:n||i.open,children:p.jsx(Om,{asChild:!0,container:a,children:r})})})};q$.displayName=oC;var jd="TooltipContent",K$=x.forwardRef((e,t)=>{const n=vee(jd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,s=Mm(jd,e.__scopeTooltip);return p.jsx(xr,{present:r||s.open,children:s.disableHoverableContent?p.jsx(V$,{side:a,...i,ref:t}):p.jsx(gee,{side:a,...i,ref:t})})}),gee=x.forwardRef((e,t)=>{const n=Mm(jd,e.__scopeTooltip),r=iC(jd,e.__scopeTooltip),a=x.useRef(null),i=it(t,a),[s,c]=x.useState(null),{trigger:u,onClose:d}=n,m=a.current,{onPointerInTransitChange:f}=r,v=x.useCallback(()=>{c(null),f(!1)},[f]),g=x.useCallback((b,w)=>{const S=b.currentTarget,E={x:b.clientX,y:b.clientY},O=wee(E,S.getBoundingClientRect()),j=See(E,O),A=Eee(w.getBoundingClientRect()),N=jee([...j,...A]);c(N),f(!0)},[f]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(u&&m){const b=S=>g(S,m),w=S=>g(S,u);return u.addEventListener("pointerleave",b),m.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",w)}}},[u,m,g,v]),x.useEffect(()=>{if(s){const b=w=>{const S=w.target,E={x:w.clientX,y:w.clientY},O=(u==null?void 0:u.contains(S))||(m==null?void 0:m.contains(S)),j=!_ee(E,s);O?v():j&&(v(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,m,s,d,v]),p.jsx(V$,{...e,ref:i})}),[yee,xee]=p0(Uh,{isInside:!1}),bee=IG("TooltipContent"),V$=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,u=Mm(jd,n),d=v0(n),{onClose:m}=u;return x.useEffect(()=>(document.addEventListener(LE,m),()=>document.removeEventListener(LE,m)),[m]),x.useEffect(()=>{if(u.trigger){const f=v=>{const g=v.target;g!=null&&g.contains(u.trigger)&&m()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[u.trigger,m]),p.jsx(Cm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:m,children:p.jsxs(Kj,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(bee,{children:r}),p.jsx(yee,{scope:n,isInside:!0,children:p.jsx(HG,{id:u.contentId,role:"tooltip",children:a||r})})]})})});K$.displayName=jd;var Y$="TooltipArrow",G$=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=v0(n);return xee(Y$,n).isInside?null:p.jsx(Vj,{...a,...r,ref:t})});G$.displayName=Y$;function wee(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function See(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Eee(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function _ee(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i],u=t[s],d=c.x,m=c.y,f=u.x,v=u.y;m>r!=v>r&&n<(f-d)*(r-m)/(v-m)+d&&(a=!a)}return a}function jee(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Cee(t)}function Cee(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(a.y-s.y)>=(i.y-s.y)*(a.x-s.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(a.y-s.y)>=(i.y-s.y)*(a.x-s.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Oee=U$,Aee=H$,Nee=F$,Tee=q$,Pee=K$,Mee=G$;function X$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=X$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function dt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=X$(e))&&(r&&(r+=" "),r+=t);return r}const kee=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ree=(e,t)=>({classGroupId:e,validator:t}),W$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Bg="-",BM=[],Dee="arbitrary..",Iee=e=>{const t=zee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Lee(s);const c=s.split(Bg),u=c[0]===""&&c.length>1?1:0;return Q$(c,u,t)},getConflictingClassGroupIds:(s,c)=>{if(c){const u=r[s],d=n[s];return u?d?kee(d,u):u:d||BM}return n[s]||BM}}},Q$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],i=n.nextPart.get(a);if(i){const d=Q$(e,t+1,i);if(d)return d}const s=n.validators;if(s===null)return;const c=t===0?e.join(Bg):e.slice(t).join(Bg),u=s.length;for(let d=0;d<u;d++){const m=s[d];if(m.validator(c))return m.classGroupId}},Lee=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Dee+r:void 0})(),zee=e=>{const{theme:t,classGroups:n}=e;return $ee(n,t)},$ee=(e,t)=>{const n=W$();for(const r in e){const a=e[r];sC(a,n,r,t)}return n},sC=(e,t,n,r)=>{const a=e.length;for(let i=0;i<a;i++){const s=e[i];Bee(s,t,n,r)}},Bee=(e,t,n,r)=>{if(typeof e=="string"){Uee(e,t,n);return}if(typeof e=="function"){Hee(e,t,n,r);return}Fee(e,t,n,r)},Uee=(e,t,n)=>{const r=e===""?t:Z$(t,e);r.classGroupId=n},Hee=(e,t,n,r)=>{if(qee(e)){sC(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ree(n,e))},Fee=(e,t,n,r)=>{const a=Object.entries(e),i=a.length;for(let s=0;s<i;s++){const[c,u]=a[s];sC(u,Z$(t,c),n,r)}},Z$=(e,t)=>{let n=e;const r=t.split(Bg),a=r.length;for(let i=0;i<a;i++){const s=r[i];let c=n.nextPart.get(s);c||(c=W$(),n.nextPart.set(s,c)),n=c}return n},qee=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Kee=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return a(i,s),s},set(i,s){i in n?n[i]=s:a(i,s)}}},$E="!",UM=":",Vee=[],HM=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),Yee=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let s=0,c=0,u=0,d;const m=a.length;for(let w=0;w<m;w++){const S=a[w];if(s===0&&c===0){if(S===UM){i.push(a.slice(u,w)),u=w+1;continue}if(S==="/"){d=w;continue}}S==="["?s++:S==="]"?s--:S==="("?c++:S===")"&&c--}const f=i.length===0?a:a.slice(u);let v=f,g=!1;f.endsWith($E)?(v=f.slice(0,-1),g=!0):f.startsWith($E)&&(v=f.slice(1),g=!0);const b=d&&d>u?d-u:void 0;return HM(i,g,v,b)};if(t){const a=t+UM,i=r;r=s=>s.startsWith(a)?i(s.slice(a.length)):HM(Vee,!1,s,void 0,!0)}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},Gee=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let i=0;i<n.length;i++){const s=n[i],c=s[0]==="[",u=t.has(s);c||u?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(s)):a.push(s)}return a.length>0&&(a.sort(),r.push(...a)),r}},Xee=e=>({cache:Kee(e.cacheSize),parseClassName:Yee(e),sortModifiers:Gee(e),...Iee(e)}),Wee=/\s+/,Qee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,s=[],c=e.trim().split(Wee);let u="";for(let d=c.length-1;d>=0;d-=1){const m=c[d],{isExternal:f,modifiers:v,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:w}=n(m);if(f){u=m+(u.length>0?" "+u:u);continue}let S=!!w,E=r(S?b.substring(0,w):b);if(!E){if(!S){u=m+(u.length>0?" "+u:u);continue}if(E=r(b),!E){u=m+(u.length>0?" "+u:u);continue}S=!1}const O=v.length===0?"":v.length===1?v[0]:i(v).join(":"),j=g?O+$E:O,A=j+E;if(s.indexOf(A)>-1)continue;s.push(A);const N=a(E,S);for(let T=0;T<N.length;++T){const P=N[T];s.push(j+P)}u=m+(u.length>0?" "+u:u)}return u},Zee=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=J$(n))&&(a&&(a+=" "),a+=r);return a},J$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=J$(e[r]))&&(n&&(n+=" "),n+=t);return n},Jee=(e,...t)=>{let n,r,a,i;const s=u=>{const d=t.reduce((m,f)=>f(m),e());return n=Xee(d),r=n.cache.get,a=n.cache.set,i=c,c(u)},c=u=>{const d=r(u);if(d)return d;const m=Qee(u,n);return a(u,m),m};return i=s,(...u)=>i(Zee(...u))},ete=[],Tn=e=>{const t=n=>n[e]||ete;return t.isThemeGetter=!0,t},eB=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tB=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tte=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rte=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ate=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ite=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ote=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ds=e=>tte.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Is=e=>!!e&&Number.isInteger(Number(e)),o1=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),yo=e=>nte.test(e),nB=()=>!0,ste=e=>rte.test(e)&&!ate.test(e),lC=()=>!1,lte=e=>ite.test(e),cte=e=>ote.test(e),ute=e=>!Pe(e)&&!ke(e),dte=e=>wl(e,iB,lC),Pe=e=>eB.test(e),Ql=e=>wl(e,oB,ste),FM=e=>wl(e,xte,Qe),fte=e=>wl(e,lB,nB),hte=e=>wl(e,sB,lC),qM=e=>wl(e,rB,lC),mte=e=>wl(e,aB,cte),Lv=e=>wl(e,cB,lte),ke=e=>tB.test(e),ah=e=>Wc(e,oB),pte=e=>Wc(e,sB),KM=e=>Wc(e,rB),vte=e=>Wc(e,iB),gte=e=>Wc(e,aB),zv=e=>Wc(e,cB,!0),yte=e=>Wc(e,lB,!0),wl=(e,t,n)=>{const r=eB.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Wc=(e,t,n=!1)=>{const r=tB.exec(e);return r?r[1]?t(r[1]):n:!1},rB=e=>e==="position"||e==="percentage",aB=e=>e==="image"||e==="url",iB=e=>e==="length"||e==="size"||e==="bg-size",oB=e=>e==="length",xte=e=>e==="number",sB=e=>e==="family-name",lB=e=>e==="number"||e==="weight",cB=e=>e==="shadow",bte=()=>{const e=Tn("color"),t=Tn("font"),n=Tn("text"),r=Tn("font-weight"),a=Tn("tracking"),i=Tn("leading"),s=Tn("breakpoint"),c=Tn("container"),u=Tn("spacing"),d=Tn("radius"),m=Tn("shadow"),f=Tn("inset-shadow"),v=Tn("text-shadow"),g=Tn("drop-shadow"),b=Tn("blur"),w=Tn("perspective"),S=Tn("aspect"),E=Tn("ease"),O=Tn("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...A(),ke,Pe],T=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],R=()=>[ke,Pe,u],D=()=>[Ds,"full","auto",...R()],K=()=>[Is,"none","subgrid",ke,Pe],z=()=>["auto",{span:["full",Is,ke,Pe]},Is,ke,Pe],I=()=>[Is,"auto",ke,Pe],G=()=>["auto","min","max","fr",ke,Pe],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...R()],H=()=>[Ds,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],q=()=>[Ds,"screen","full","dvw","lvw","svw","min","max","fit",...R()],F=()=>[Ds,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],V=()=>[e,ke,Pe],B=()=>[...A(),KM,qM,{position:[ke,Pe]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",vte,dte,{size:[ke,Pe]}],Z=()=>[o1,ah,Ql],ee=()=>["","none","full",d,ke,Pe],le=()=>["",Qe,ah,Ql],ie=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[Qe,o1,KM,qM],re=()=>["","none",b,ke,Pe],fe=()=>["none",Qe,ke,Pe],ne=()=>["none",Qe,ke,Pe],xe=()=>[Qe,ke,Pe],ye=()=>[Ds,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yo],breakpoint:[yo],color:[nB],container:[yo],"drop-shadow":[yo],ease:["in","out","in-out"],font:[ute],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yo],shadow:[yo],spacing:["px",Qe],text:[yo],"text-shadow":[yo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ds,Pe,ke,S]}],container:["container"],columns:[{columns:[Qe,Pe,ke,c]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Is,"auto",ke,Pe]}],basis:[{basis:[Ds,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Ds,"auto","initial","none",Pe]}],grow:[{grow:["",Qe,ke,Pe]}],shrink:[{shrink:["",Qe,ke,Pe]}],order:[{order:[Is,"first","last","none",ke,Pe]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[c,"screen",...H()]}],"min-w":[{"min-w":[c,"screen","none",...H()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[s]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,ah,Ql]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,yte,fte]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",o1,Pe]}],"font-family":[{font:[pte,hte,t]}],"font-features":[{"font-features":[Pe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ke,Pe]}],"line-clamp":[{"line-clamp":[Qe,"none",ke,FM]}],leading:[{leading:[i,...R()]}],"list-image":[{"list-image":["none",ke,Pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",ke,Ql]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Qe,"auto",ke,Pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Is,ke,Pe],radial:["",ke,Pe],conic:[Is,ke,Pe]},gte,mte]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,ke,Pe]}],"outline-w":[{outline:["",Qe,ah,Ql]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",m,zv,Lv]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",f,zv,Lv]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Qe,Ql]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",v,zv,Lv]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Qe,ke,Pe]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[ke,Pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Pe]}],filter:[{filter:["","none",ke,Pe]}],blur:[{blur:re()}],brightness:[{brightness:[Qe,ke,Pe]}],contrast:[{contrast:[Qe,ke,Pe]}],"drop-shadow":[{"drop-shadow":["","none",g,zv,Lv]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Qe,ke,Pe]}],"hue-rotate":[{"hue-rotate":[Qe,ke,Pe]}],invert:[{invert:["",Qe,ke,Pe]}],saturate:[{saturate:[Qe,ke,Pe]}],sepia:[{sepia:["",Qe,ke,Pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Pe]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,ke,Pe]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,ke,Pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,ke,Pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,ke,Pe]}],"backdrop-invert":[{"backdrop-invert":["",Qe,ke,Pe]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,ke,Pe]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,ke,Pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,ke,Pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",ke,Pe]}],ease:[{ease:["linear","initial",E,ke,Pe]}],delay:[{delay:[Qe,ke,Pe]}],animate:[{animate:["none",O,ke,Pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ke,Pe]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[ke,Pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,Pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,Pe]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Qe,ah,Ql,FM]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},wte=Jee(bte);function Ce(...e){return wte(dt(e))}function uB({delayDuration:e=0,...t}){return p.jsx(Oee,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ste({...e}){return p.jsx(Aee,{"data-slot":"tooltip",...e})}function Ete({...e}){return p.jsx(Nee,{"data-slot":"tooltip-trigger",...e})}function _te({className:e,sideOffset:t=0,children:n,...r}){return p.jsx(Tee,{children:p.jsxs(Pee,{"data-slot":"tooltip-content",sideOffset:t,className:Ce("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...r,children:[n,p.jsx(Mee,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dB=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jte=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cte=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VM=e=>{const t=Cte(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var Ote={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.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ate=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nte=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:s,...c},u)=>x.createElement("svg",{ref:u,...Ote,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:dB("lucide",a),...!i&&!Ate(c)&&{"aria-hidden":"true"},...c},[...s.map(([d,m])=>x.createElement(d,m)),...Array.isArray(i)?i:[i]]));/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fe=(e,t)=>{const n=x.forwardRef(({className:r,...a},i)=>x.createElement(Nte,{ref:i,iconNode:t,className:dB(`lucide-${jte(VM(e))}`,`lucide-${e}`,r),...a}));return n.displayName=VM(e),n};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tte=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Pte=Fe("arrow-down",Tte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mte=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],cC=Fe("arrow-left",Mte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kte=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],fB=Fe("bot",kte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rte=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],hB=Fe("brain",Rte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dte=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],uC=Fe("check",Dte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ite=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Hh=Fe("chevron-down",Ite);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lte=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],zte=Fe("chevron-left",Lte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $te=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],g0=Fe("chevron-right",$te);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bte=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ute=Fe("chevron-up",Bte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hte=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Fte=Fe("chevrons-up-down",Hte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qte=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$o=Fe("circle-alert",qte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kte=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],dC=Fe("circle-check",Kte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vte=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],mB=Fe("circle-x",Vte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yte=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Gte=Fe("clock",Yte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xte=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Wte=Fe("corner-down-left",Xte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qte=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],y0=Fe("download",Qte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zte=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Jte=Fe("external-link",Zte);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ene=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],tne=Fe("eye-off",ene);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nne=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rne=Fe("eye",nne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ane=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],BE=Fe("folder-kanban",ane);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ine=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]],one=Fe("folder-up",ine);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sne=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],lne=Fe("folder",sne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cne=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],une=Fe("house",cne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],fne=Fe("info",dne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hne=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],mne=Fe("key-round",hne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pne=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],pB=Fe("layout-dashboard",pne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vne=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],wc=Fe("loader-circle",vne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gne=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],vB=Fe("message-square",gne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yne=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],xne=Fe("monitor",yne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bne=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],gB=Fe("moon",bne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wne=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],yB=Fe("octagon-x",wne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sne=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],xB=Fe("paperclip",Sne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ene=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],_ne=Fe("pause",Ene);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jne=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],fC=Fe("pencil",jne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cne=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],hC=Fe("play",Cne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const One=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ug=Fe("plus",One);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ane=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],bB=Fe("save",Ane);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nne=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],wB=Fe("search",Nne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tne=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Pne=Fe("send",Tne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mne=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],SB=Fe("settings",Mne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Rne=Fe("square",kne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dne=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],EB=Fe("sun",Dne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ine=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Lne=Fe("terminal",Ine);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zne=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Sl=Fe("trash-2",zne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $ne=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Bne=Fe("triangle-alert",$ne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Une=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],mC=Fe("upload",Une);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hne=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],_B=Fe("users",Hne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fne=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],jB=Fe("wrench",Fne);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qne=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],x0=Fe("x",qne);function Kne(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Vne=e=>{switch(e){case"success":return Xne;case"info":return Qne;case"warning":return Wne;case"error":return Zne;default:return null}},Yne=Array(12).fill(0),Gne=({visible:e,className:t})=>be.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},be.createElement("div",{className:"sonner-spinner"},Yne.map((n,r)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Xne=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Wne=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Qne=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Zne=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Jne=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ere=()=>{const[e,t]=be.useState(document.hidden);return be.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let UE=1;class tre{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:UE++,s=this.toasts.find(u=>u.id===i),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...t,id:i,title:r}),{...u,...t,id:i,dismissible:c,title:r}):u):this.addToast({title:r,...a,dismissible:c,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,s;const c=a.then(async d=>{if(s=["resolve",d],be.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(rre(d)&&!d.ok){i=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,b=typeof f=="object"&&!be.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:v,...b})}else if(d instanceof Error){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,v=typeof n.description=="function"?await n.description(d):n.description,b=typeof f=="object"&&!be.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:v,...b})}else if(n.success!==void 0){i=!1;const f=typeof n.success=="function"?await n.success(d):n.success,v=typeof n.description=="function"?await n.description(d):n.description,b=typeof f=="object"&&!be.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:v,...b})}}).catch(async d=>{if(s=["reject",d],n.error!==void 0){i=!1;const m=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,g=typeof m=="object"&&!be.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:f,...g})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,m)=>c.then(()=>s[0]==="reject"?m(s[1]):d(s[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||UE++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Kr=new tre,nre=(e,t)=>{const n=(t==null?void 0:t.id)||UE++;return Kr.addToast({title:e,...t,id:n}),n},rre=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",are=nre,ire=()=>Kr.toasts,ore=()=>Kr.getActiveToasts(),wt=Object.assign(are,{success:Kr.success,info:Kr.info,warning:Kr.warning,error:Kr.error,custom:Kr.custom,message:Kr.message,promise:Kr.promise,dismiss:Kr.dismiss,loading:Kr.loading},{getHistory:ire,getToasts:ore});Kne("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function $v(e){return e.label!==void 0}const sre=3,lre="24px",cre="16px",YM=4e3,ure=356,dre=14,fre=45,hre=200;function Si(...e){return e.filter(Boolean).join(" ")}function mre(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const pre=e=>{var t,n,r,a,i,s,c,u,d;const{invert:m,toast:f,unstyled:v,interacting:g,setHeights:b,visibleToasts:w,heights:S,index:E,toasts:O,expanded:j,removeToast:A,defaultRichColors:N,closeButton:T,style:P,cancelButtonStyle:R,actionButtonStyle:D,className:K="",descriptionClassName:z="",duration:I,position:G,gap:L,expandByDefault:Y,classNames:k,icons:H,closeButtonAriaLabel:q="Close toast"}=e,[F,V]=be.useState(null),[B,$]=be.useState(null),[X,Z]=be.useState(!1),[ee,le]=be.useState(!1),[ie,ae]=be.useState(!1),[J,re]=be.useState(!1),[fe,ne]=be.useState(!1),[xe,ye]=be.useState(0),[De,Me]=be.useState(0),Ke=be.useRef(f.duration||I||YM),Je=be.useRef(null),nt=be.useRef(null),pn=E===0,Bn=E+1<=w,Et=f.type,vn=f.dismissible!==!1,It=f.className||"",Sr=f.descriptionClassName||"",dn=be.useMemo(()=>S.findIndex(qe=>qe.toastId===f.id)||0,[S,f.id]),Mr=be.useMemo(()=>{var qe;return(qe=f.closeButton)!=null?qe:T},[f.closeButton,T]),Er=be.useMemo(()=>f.duration||I||YM,[f.duration,I]),ga=be.useRef(0),Un=be.useRef(0),ya=be.useRef(0),_r=be.useRef(null),[kr,we]=G.split("-"),xt=be.useMemo(()=>S.reduce((qe,Lt,gn)=>gn>=dn?qe:qe+Lt.height,0),[S,dn]),ht=ere(),Xr=f.invert||m,ge=Et==="loading";Un.current=be.useMemo(()=>dn*L+xt,[dn,xt]),be.useEffect(()=>{Ke.current=Er},[Er]),be.useEffect(()=>{Z(!0)},[]),be.useEffect(()=>{const qe=nt.current;if(qe){const Lt=qe.getBoundingClientRect().height;return Me(Lt),b(gn=>[{toastId:f.id,height:Lt,position:f.position},...gn]),()=>b(gn=>gn.filter(Hn=>Hn.toastId!==f.id))}},[b,f.id]),be.useLayoutEffect(()=>{if(!X)return;const qe=nt.current,Lt=qe.style.height;qe.style.height="auto";const gn=qe.getBoundingClientRect().height;qe.style.height=Lt,Me(gn),b(Hn=>Hn.find($t=>$t.toastId===f.id)?Hn.map($t=>$t.toastId===f.id?{...$t,height:gn}:$t):[{toastId:f.id,height:gn,position:f.position},...Hn])},[X,f.title,f.description,b,f.id,f.jsx,f.action,f.cancel]);const Ct=be.useCallback(()=>{le(!0),ye(Un.current),b(qe=>qe.filter(Lt=>Lt.toastId!==f.id)),setTimeout(()=>{A(f)},hre)},[f,A,b,Un]);be.useEffect(()=>{if(f.promise&&Et==="loading"||f.duration===1/0||f.type==="loading")return;let qe;return j||g||ht?(()=>{if(ya.current<ga.current){const Hn=new Date().getTime()-ga.current;Ke.current=Ke.current-Hn}ya.current=new Date().getTime()})():(()=>{Ke.current!==1/0&&(ga.current=new Date().getTime(),qe=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ct()},Ke.current))})(),()=>clearTimeout(qe)},[j,g,f,Et,ht,Ct]),be.useEffect(()=>{f.delete&&(Ct(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ct,f.delete]);function Rr(){var qe;if(H!=null&&H.loading){var Lt;return be.createElement("div",{className:Si(k==null?void 0:k.loader,f==null||(Lt=f.classNames)==null?void 0:Lt.loader,"sonner-loader"),"data-visible":Et==="loading"},H.loading)}return be.createElement(Gne,{className:Si(k==null?void 0:k.loader,f==null||(qe=f.classNames)==null?void 0:qe.loader),visible:Et==="loading"})}const Ua=f.icon||(H==null?void 0:H[Et])||Vne(Et);var Ha,ir;return be.createElement("li",{tabIndex:0,ref:nt,className:Si(K,It,k==null?void 0:k.toast,f==null||(t=f.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[Et],f==null||(n=f.classNames)==null?void 0:n[Et]),"data-sonner-toast":"","data-rich-colors":(Ha=f.richColors)!=null?Ha:N,"data-styled":!(f.jsx||f.unstyled||v),"data-mounted":X,"data-promise":!!f.promise,"data-swiped":fe,"data-removed":ee,"data-visible":Bn,"data-y-position":kr,"data-x-position":we,"data-index":E,"data-front":pn,"data-swiping":ie,"data-dismissible":vn,"data-type":Et,"data-invert":Xr,"data-swipe-out":J,"data-swipe-direction":B,"data-expanded":!!(j||Y&&X),"data-testid":f.testId,style:{"--index":E,"--toasts-before":E,"--z-index":O.length-E,"--offset":`${ee?xe:Un.current}px`,"--initial-height":Y?"auto":`${De}px`,...P,...f.style},onDragEnd:()=>{ae(!1),V(null),_r.current=null},onPointerDown:qe=>{qe.button!==2&&(ge||!vn||(Je.current=new Date,ye(Un.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(ae(!0),_r.current={x:qe.clientX,y:qe.clientY})))},onPointerUp:()=>{var qe,Lt,gn;if(J||!vn)return;_r.current=null;const Hn=Number(((qe=nt.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),vi=Number(((Lt=nt.current)==null?void 0:Lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$t=new Date().getTime()-((gn=Je.current)==null?void 0:gn.getTime()),or=F==="x"?Hn:vi,Wi=Math.abs(or)/$t;if(Math.abs(or)>=fre||Wi>.11){ye(Un.current),f.onDismiss==null||f.onDismiss.call(f,f),$(F==="x"?Hn>0?"right":"left":vi>0?"down":"up"),Ct(),re(!0);return}else{var sr,lr;(sr=nt.current)==null||sr.style.setProperty("--swipe-amount-x","0px"),(lr=nt.current)==null||lr.style.setProperty("--swipe-amount-y","0px")}ne(!1),ae(!1),V(null)},onPointerMove:qe=>{var Lt,gn,Hn;if(!_r.current||!vn||((Lt=window.getSelection())==null?void 0:Lt.toString().length)>0)return;const $t=qe.clientY-_r.current.y,or=qe.clientX-_r.current.x;var Wi;const sr=(Wi=e.swipeDirections)!=null?Wi:mre(G);!F&&(Math.abs(or)>1||Math.abs($t)>1)&&V(Math.abs(or)>Math.abs($t)?"x":"y");let lr={x:0,y:0};const is=Wr=>1/(1.5+Math.abs(Wr)/20);if(F==="y"){if(sr.includes("top")||sr.includes("bottom"))if(sr.includes("top")&&$t<0||sr.includes("bottom")&&$t>0)lr.y=$t;else{const Wr=$t*is($t);lr.y=Math.abs(Wr)<Math.abs($t)?Wr:$t}}else if(F==="x"&&(sr.includes("left")||sr.includes("right")))if(sr.includes("left")&&or<0||sr.includes("right")&&or>0)lr.x=or;else{const Wr=or*is(or);lr.x=Math.abs(Wr)<Math.abs(or)?Wr:or}(Math.abs(lr.x)>0||Math.abs(lr.y)>0)&&ne(!0),(gn=nt.current)==null||gn.style.setProperty("--swipe-amount-x",`${lr.x}px`),(Hn=nt.current)==null||Hn.style.setProperty("--swipe-amount-y",`${lr.y}px`)}},Mr&&!f.jsx&&Et!=="loading"?be.createElement("button",{"aria-label":q,"data-disabled":ge,"data-close-button":!0,onClick:ge||!vn?()=>{}:()=>{Ct(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Si(k==null?void 0:k.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(ir=H==null?void 0:H.close)!=null?ir:Jne):null,(Et||f.icon||f.promise)&&f.icon!==null&&((H==null?void 0:H[Et])!==null||f.icon)?be.createElement("div",{"data-icon":"",className:Si(k==null?void 0:k.icon,f==null||(a=f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Rr():null,f.type!=="loading"?Ua:null):null,be.createElement("div",{"data-content":"",className:Si(k==null?void 0:k.content,f==null||(i=f.classNames)==null?void 0:i.content)},be.createElement("div",{"data-title":"",className:Si(k==null?void 0:k.title,f==null||(s=f.classNames)==null?void 0:s.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?be.createElement("div",{"data-description":"",className:Si(z,Sr,k==null?void 0:k.description,f==null||(c=f.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),be.isValidElement(f.cancel)?f.cancel:f.cancel&&$v(f.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:qe=>{$v(f.cancel)&&vn&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,qe),Ct())},className:Si(k==null?void 0:k.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,be.isValidElement(f.action)?f.action:f.action&&$v(f.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||D,onClick:qe=>{$v(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,qe),!qe.defaultPrevented&&Ct())},className:Si(k==null?void 0:k.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function GM(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function vre(e,t){const n={};return[e,t].forEach((r,a)=>{const i=a===1,s=i?"--mobile-offset":"--offset",c=i?cre:lre;function u(d){["top","right","bottom","left"].forEach(m=>{n[`${s}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=c:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(c)}),n}const gre=be.forwardRef(function(t,n){const{id:r,invert:a,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:c,closeButton:u,className:d,offset:m,mobileOffset:f,theme:v="light",richColors:g,duration:b,style:w,visibleToasts:S=sre,toastOptions:E,dir:O=GM(),gap:j=dre,icons:A,containerAriaLabel:N="Notifications"}=t,[T,P]=be.useState([]),R=be.useMemo(()=>r?T.filter(X=>X.toasterId===r):T.filter(X=>!X.toasterId),[T,r]),D=be.useMemo(()=>Array.from(new Set([i].concat(R.filter(X=>X.position).map(X=>X.position)))),[R,i]),[K,z]=be.useState([]),[I,G]=be.useState(!1),[L,Y]=be.useState(!1),[k,H]=be.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=be.useRef(null),F=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),V=be.useRef(null),B=be.useRef(!1),$=be.useCallback(X=>{P(Z=>{var ee;return(ee=Z.find(le=>le.id===X.id))!=null&&ee.delete||Kr.dismiss(X.id),Z.filter(({id:le})=>le!==X.id)})},[]);return be.useEffect(()=>Kr.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{P(Z=>Z.map(ee=>ee.id===X.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{Iz.flushSync(()=>{P(Z=>{const ee=Z.findIndex(le=>le.id===X.id);return ee!==-1?[...Z.slice(0,ee),{...Z[ee],...X},...Z.slice(ee+1)]:[X,...Z]})})})}),[T]),be.useEffect(()=>{if(v!=="system"){H(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:Z})=>{H(Z?"dark":"light")})}catch{X.addListener(({matches:ee})=>{try{H(ee?"dark":"light")}catch(le){console.error(le)}})}},[v]),be.useEffect(()=>{T.length<=1&&G(!1)},[T]),be.useEffect(()=>{const X=Z=>{var ee;if(s.every(ae=>Z[ae]||Z.code===ae)){var ie;G(!0),(ie=q.current)==null||ie.focus()}Z.code==="Escape"&&(document.activeElement===q.current||(ee=q.current)!=null&&ee.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[s]),be.useEffect(()=>{if(q.current)return()=>{V.current&&(V.current.focus({preventScroll:!0}),V.current=null,B.current=!1)}},[q.current]),be.createElement("section",{ref:n,"aria-label":`${N} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((X,Z)=>{var ee;const[le,ie]=X.split("-");return R.length?be.createElement("ol",{key:X,dir:O==="auto"?GM():O,tabIndex:-1,ref:q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":le,"data-x-position":ie,style:{"--front-toast-height":`${((ee=K[0])==null?void 0:ee.height)||0}px`,"--width":`${ure}px`,"--gap":`${j}px`,...w,...vre(m,f)},onBlur:ae=>{B.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(B.current=!1,V.current&&(V.current.focus({preventScroll:!0}),V.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||B.current||(B.current=!0,V.current=ae.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{L||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},R.filter(ae=>!ae.position&&Z===0||ae.position===X).map((ae,J)=>{var re,fe;return be.createElement(pre,{key:ae.id,icons:A,index:J,toast:ae,defaultRichColors:g,duration:(re=E==null?void 0:E.duration)!=null?re:b,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:a,visibleToasts:S,closeButton:(fe=E==null?void 0:E.closeButton)!=null?fe:u,interacting:L,position:X,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:$,toasts:R.filter(ne=>ne.position==ae.position),heights:K.filter(ne=>ne.position==ae.position),setHeights:z,expandByDefault:c,gap:j,expanded:I,swipeDirections:t.swipeDirections})})):null}))}),yre=({...e})=>{const{theme:t="system"}=xj();return p.jsx(gre,{theme:t,className:"toaster group",icons:{success:p.jsx(dC,{className:"size-4"}),info:p.jsx(fne,{className:"size-4"}),warning:p.jsx(Bne,{className:"size-4"}),error:p.jsx(yB,{className:"size-4"}),loading:p.jsx(wc,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},xre=new xG({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),CB="/api";class OB extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function ih(e,t){const n=`${CB}${e}`,r=new AbortController,a=setTimeout(()=>r.abort(),3e4);let i;try{i=await fetch(n,{...t,signal:(t==null?void 0:t.signal)??r.signal,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}})}finally{clearTimeout(a)}if(!i.ok){const s=await i.json().catch(()=>null);throw new OB(i.status,i.statusText,s)}if(!(i.status===204||i.headers.get("content-length")==="0"))return i.json()}async function bre(e,t){const n=`${CB}${e}`,r=new AbortController,a=setTimeout(()=>r.abort(),6e4);let i;try{i=await fetch(n,{method:"POST",body:t,signal:r.signal})}finally{clearTimeout(a)}if(!i.ok){const s=await i.json().catch(()=>null);throw new OB(i.status,i.statusText,s)}return i.json()}const ze={get:e=>ih(e),post:(e,t)=>ih(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>ih(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>ih(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>ih(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),bre(e,n)}},Be={projects:{all:["projects"],detail:e=>["projects",e],config:e=>["projects",e,"config"],sessions:e=>["projects",e,"sessions"],files:e=>["projects",e,"files"],stats:(e,t)=>["projects",e,"stats",t],resources:e=>["projects",e,"resources"],resourceDetail:(e,t,n)=>["projects",e,"resources",t,n],resourceConfig:(e,t,n)=>["projects",e,"resources",t,n,"config"]},sessions:{all:e=>["sessions",e],detail:(e,t)=>["sessions",e,t],running:()=>["sessions",{status:"running"}]},roles:{all:["roles"]},config:{global:["config","global"]},registry:{list:e=>["registry",e],detail:(e,t)=>["registry",e,t],config:(e,t)=>["registry",e,t,"config"],validate:e=>["registry","agents",e,"validate"]},schedules:{all:["schedules"],detail:e=>["schedules",e],history:e=>["schedules",e,"history"]},conversations:{all:e=>["conversations",e],detail:e=>["conversations","detail",e]}};function Qd(){return mn({queryKey:Be.projects.all,queryFn:()=>ze.get("/projects")})}function pC(e,t){return mn({queryKey:Be.projects.detail(e),queryFn:()=>ze.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function vC(e){return mn({queryKey:Be.projects.files(e),queryFn:()=>ze.get(`/projects/${e}/files`)})}function gC(e,t){return mn({queryKey:Be.projects.config(e),queryFn:()=>ze.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function XM(e,t){return mn({queryKey:Be.conversations.detail(e),queryFn:()=>ze.get(`/conversations/${e}`),...t})}function wre(e=10){return mn({queryKey:["conversations","recent",e],queryFn:()=>ze.get(`/conversations/recent?limit=${e}`)})}function AB(e,t=1,n=20){return mn({queryKey:[...Be.conversations.all(e),t,n],queryFn:()=>ze.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function NB(){const e=ft();return Mt({mutationFn:t=>ze.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.conversations.all(n.project_id)})}})}function Sre(e){const t=ft();return Mt({mutationFn:n=>ze.post(`/conversations/${e}/tasks`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Be.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]})}})}function yC(e){const t=ft();return Mt({mutationFn:({conversationId:n,title:r})=>ze.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:Be.conversations.all(e)}),t.invalidateQueries({queryKey:Be.conversations.detail(r)})}})}function TB(e){const t=ft();return Mt({mutationFn:n=>ze.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:Be.conversations.all(e)});const r=t.getQueryData(Be.conversations.all(e));return t.setQueryData(Be.conversations.all(e),a=>a&&{...a,items:a.items.filter(i=>i.id!==n),total:a.total-1}),{previous:r}},onError:(n,r,a)=>{a!=null&&a.previous&&t.setQueryData(Be.conversations.all(e),a.previous)},onSettled:()=>{t.invalidateQueries({queryKey:Be.conversations.all(e)})}})}function Ze({className:e,type:t,...n}){return p.jsx("input",{type:t,"data-slot":"input",className:Ce("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...n})}const Ere=500;function _re({onCommandPalette:e,onShortcutsHelp:t}){const n=gl(),r=x.useRef(null),a=x.useRef(void 0);x.useEffect(()=>{function i(s){const c=s.target;if(!(c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable)){if((s.metaKey||s.ctrlKey)&&s.key==="k"){s.preventDefault(),e();return}if(!(s.metaKey||s.ctrlKey||s.altKey)){if(s.key==="?"){s.preventDefault(),t();return}if(r.current==="g"){if(r.current=null,clearTimeout(a.current),s.key==="d"){s.preventDefault(),n("/");return}if(s.key==="p"){s.preventDefault(),n("/projects");return}}if(s.key==="g"){r.current="g",a.current=setTimeout(()=>{r.current=null},Ere);return}}}}return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),clearTimeout(a.current)}},[n,e,t])}function PB(e){const t=e?"?"+new URLSearchParams(e).toString():"";return mn({queryKey:Be.sessions.all(e),queryFn:()=>ze.get(`/sessions${t}`)})}function xC(){return PB({status:"running",per_page:"50"})}function jre(){return PB({per_page:"10"})}function Cre(e,t=1,n=20){return mn({queryKey:[...Be.projects.sessions(e),t,n],queryFn:()=>ze.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function Ore(e,t,n){return mn({queryKey:Be.sessions.detail(e,t),queryFn:()=>ze.get(`/projects/${e}/sessions/${t}`),...n})}var WM=1,Are=.9,Nre=.8,Tre=.17,s1=.1,l1=.999,Pre=.9999,Mre=.99,kre=/[\\\/_+.#"@\[\(\{&]/,Rre=/[\\\/_+.#"@\[\(\{&]/g,Dre=/[\s-]/,MB=/[\s-]/g;function HE(e,t,n,r,a,i,s){if(i===t.length)return a===e.length?WM:Mre;var c=`${a},${i}`;if(s[c]!==void 0)return s[c];for(var u=r.charAt(i),d=n.indexOf(u,a),m=0,f,v,g,b;d>=0;)f=HE(e,t,n,r,d+1,i+1,s),f>m&&(d===a?f*=WM:kre.test(e.charAt(d-1))?(f*=Nre,g=e.slice(a,d-1).match(Rre),g&&a>0&&(f*=Math.pow(l1,g.length))):Dre.test(e.charAt(d-1))?(f*=Are,b=e.slice(a,d-1).match(MB),b&&a>0&&(f*=Math.pow(l1,b.length))):(f*=Tre,a>0&&(f*=Math.pow(l1,d-a))),e.charAt(d)!==t.charAt(i)&&(f*=Pre)),(f<s1&&n.charAt(d-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(d-1)!==r.charAt(i))&&(v=HE(e,t,n,r,d+1,i+2,s),v*s1>f&&(f=v*s1)),f>m&&(m=f),d=n.indexOf(u,d+1);return s[c]=m,m}function QM(e){return e.toLowerCase().replace(MB," ")}function Ire(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,HE(e,t,QM(e),QM(t),0,0,{})}var oh='[cmdk-group=""]',c1='[cmdk-group-items=""]',Lre='[cmdk-group-heading=""]',kB='[cmdk-item=""]',ZM=`${kB}:not([aria-disabled="true"])`,FE="cmdk-item-select",Xu="data-value",zre=(e,t,n)=>Ire(e,t,n),RB=x.createContext(void 0),km=()=>x.useContext(RB),DB=x.createContext(void 0),bC=()=>x.useContext(DB),IB=x.createContext(void 0),LB=x.forwardRef((e,t)=>{let n=Wu(()=>{var $,X;return{search:"",value:(X=($=e.value)!=null?$:e.defaultValue)!=null?X:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Wu(()=>new Set),a=Wu(()=>new Map),i=Wu(()=>new Map),s=Wu(()=>new Set),c=zB(e),{label:u,children:d,value:m,onValueChange:f,filter:v,shouldFilter:g,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...E}=e,O=Yn(),j=Yn(),A=Yn(),N=x.useRef(null),T=Xre();kc(()=>{if(m!==void 0){let $=m.trim();n.current.value=$,P.emit()}},[m]),kc(()=>{T(6,G)},[]);let P=x.useMemo(()=>({subscribe:$=>(s.current.add($),()=>s.current.delete($)),snapshot:()=>n.current,setState:($,X,Z)=>{var ee,le,ie,ae;if(!Object.is(n.current[$],X)){if(n.current[$]=X,$==="search")I(),K(),T(1,z);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let J=document.getElementById(A);J?J.focus():(ee=document.getElementById(O))==null||ee.focus()}if(T(7,()=>{var J;n.current.selectedItemId=(J=L())==null?void 0:J.id,P.emit()}),Z||T(5,G),((le=c.current)==null?void 0:le.value)!==void 0){let J=X??"";(ae=(ie=c.current).onValueChange)==null||ae.call(ie,J);return}}P.emit()}},emit:()=>{s.current.forEach($=>$())}}),[]),R=x.useMemo(()=>({value:($,X,Z)=>{var ee;X!==((ee=i.current.get($))==null?void 0:ee.value)&&(i.current.set($,{value:X,keywords:Z}),n.current.filtered.items.set($,D(X,Z)),T(2,()=>{K(),P.emit()}))},item:($,X)=>(r.current.add($),X&&(a.current.has(X)?a.current.get(X).add($):a.current.set(X,new Set([$]))),T(3,()=>{I(),K(),n.current.value||z(),P.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let Z=L();T(4,()=>{I(),(Z==null?void 0:Z.getAttribute("id"))===$&&z(),P.emit()})}),group:$=>(a.current.has($)||a.current.set($,new Set),()=>{i.current.delete($),a.current.delete($)}),filter:()=>c.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:O,inputId:A,labelId:j,listInnerRef:N}),[]);function D($,X){var Z,ee;let le=(ee=(Z=c.current)==null?void 0:Z.filter)!=null?ee:zre;return $?le($,n.current.search,X):0}function K(){if(!n.current.search||c.current.shouldFilter===!1)return;let $=n.current.filtered.items,X=[];n.current.filtered.groups.forEach(ee=>{let le=a.current.get(ee),ie=0;le.forEach(ae=>{let J=$.get(ae);ie=Math.max(J,ie)}),X.push([ee,ie])});let Z=N.current;Y().sort((ee,le)=>{var ie,ae;let J=ee.getAttribute("id"),re=le.getAttribute("id");return((ie=$.get(re))!=null?ie:0)-((ae=$.get(J))!=null?ae:0)}).forEach(ee=>{let le=ee.closest(c1);le?le.appendChild(ee.parentElement===le?ee:ee.closest(`${c1} > *`)):Z.appendChild(ee.parentElement===Z?ee:ee.closest(`${c1} > *`))}),X.sort((ee,le)=>le[1]-ee[1]).forEach(ee=>{var le;let ie=(le=N.current)==null?void 0:le.querySelector(`${oh}[${Xu}="${encodeURIComponent(ee[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function z(){let $=Y().find(Z=>Z.getAttribute("aria-disabled")!=="true"),X=$==null?void 0:$.getAttribute(Xu);P.setState("value",X||void 0)}function I(){var $,X,Z,ee;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let le=0;for(let ie of r.current){let ae=(X=($=i.current.get(ie))==null?void 0:$.value)!=null?X:"",J=(ee=(Z=i.current.get(ie))==null?void 0:Z.keywords)!=null?ee:[],re=D(ae,J);n.current.filtered.items.set(ie,re),re>0&&le++}for(let[ie,ae]of a.current)for(let J of ae)if(n.current.filtered.items.get(J)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=le}function G(){var $,X,Z;let ee=L();ee&&((($=ee.parentElement)==null?void 0:$.firstChild)===ee&&((Z=(X=ee.closest(oh))==null?void 0:X.querySelector(Lre))==null||Z.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function L(){var $;return($=N.current)==null?void 0:$.querySelector(`${kB}[aria-selected="true"]`)}function Y(){var $;return Array.from((($=N.current)==null?void 0:$.querySelectorAll(ZM))||[])}function k($){let X=Y()[$];X&&P.setState("value",X.getAttribute(Xu))}function H($){var X;let Z=L(),ee=Y(),le=ee.findIndex(ae=>ae===Z),ie=ee[le+$];(X=c.current)!=null&&X.loop&&(ie=le+$<0?ee[ee.length-1]:le+$===ee.length?ee[0]:ee[le+$]),ie&&P.setState("value",ie.getAttribute(Xu))}function q($){let X=L(),Z=X==null?void 0:X.closest(oh),ee;for(;Z&&!ee;)Z=$>0?Yre(Z,oh):Gre(Z,oh),ee=Z==null?void 0:Z.querySelector(ZM);ee?P.setState("value",ee.getAttribute(Xu)):H($)}let F=()=>k(Y().length-1),V=$=>{$.preventDefault(),$.metaKey?F():$.altKey?q(1):H(1)},B=$=>{$.preventDefault(),$.metaKey?k(0):$.altKey?q(-1):H(-1)};return x.createElement(Ie.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:$=>{var X;(X=E.onKeyDown)==null||X.call(E,$);let Z=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||Z))switch($.key){case"n":case"j":{S&&$.ctrlKey&&V($);break}case"ArrowDown":{V($);break}case"p":case"k":{S&&$.ctrlKey&&B($);break}case"ArrowUp":{B($);break}case"Home":{$.preventDefault(),k(0);break}case"End":{$.preventDefault(),F();break}case"Enter":{$.preventDefault();let ee=L();if(ee){let le=new Event(FE);ee.dispatchEvent(le)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Qre},u),b0(e,$=>x.createElement(DB.Provider,{value:P},x.createElement(RB.Provider,{value:R},$))))}),$re=x.forwardRef((e,t)=>{var n,r;let a=Yn(),i=x.useRef(null),s=x.useContext(IB),c=km(),u=zB(e),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;kc(()=>{if(!d)return c.item(a,s==null?void 0:s.id)},[d]);let m=$B(a,i,[e.value,e.children,i],e.keywords),f=bC(),v=dl(T=>T.value&&T.value===m.current),g=dl(T=>d||c.filter()===!1?!0:T.search?T.filtered.items.get(a)>0:!0);x.useEffect(()=>{let T=i.current;if(!(!T||e.disabled))return T.addEventListener(FE,b),()=>T.removeEventListener(FE,b)},[g,e.onSelect,e.disabled]);function b(){var T,P;w(),(P=(T=u.current).onSelect)==null||P.call(T,m.current)}function w(){f.setState("value",m.current,!0)}if(!g)return null;let{disabled:S,value:E,onSelect:O,forceMount:j,keywords:A,...N}=e;return x.createElement(Ie.div,{ref:Io(i,t),...N,id:a,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!v,"data-disabled":!!S,"data-selected":!!v,onPointerMove:S||c.getDisablePointerSelection()?void 0:w,onClick:S?void 0:b},e.children)}),Bre=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,s=Yn(),c=x.useRef(null),u=x.useRef(null),d=Yn(),m=km(),f=dl(g=>a||m.filter()===!1?!0:g.search?g.filtered.groups.has(s):!0);kc(()=>m.group(s),[]),$B(s,c,[e.value,e.heading,u]);let v=x.useMemo(()=>({id:s,forceMount:a}),[a]);return x.createElement(Ie.div,{ref:Io(c,t),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&x.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),b0(e,g=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},x.createElement(IB.Provider,{value:v},g))))}),Ure=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),i=dl(s=>!s.search);return!n&&!i?null:x.createElement(Ie.div,{ref:Io(a,t),...r,"cmdk-separator":"",role:"separator"})}),Hre=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=bC(),s=dl(d=>d.search),c=dl(d=>d.selectedItemId),u=km();return x.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),x.createElement(Ie.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":c,id:u.inputId,type:"text",value:a?e.value:s,onChange:d=>{a||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),Fre=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=x.useRef(null),s=x.useRef(null),c=dl(d=>d.selectedItemId),u=km();return x.useEffect(()=>{if(s.current&&i.current){let d=s.current,m=i.current,f,v=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let g=d.offsetHeight;m.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return v.observe(d),()=>{cancelAnimationFrame(f),v.unobserve(d)}}},[]),x.createElement(Ie.div,{ref:Io(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:u.listId},b0(e,d=>x.createElement("div",{ref:Io(s,u.listInnerRef),"cmdk-list-sizer":""},d)))}),qre=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:s,...c}=e;return x.createElement(Tj,{open:n,onOpenChange:r},x.createElement(Pj,{container:s},x.createElement(Mj,{"cmdk-overlay":"",className:a}),x.createElement(kj,{"aria-label":e.label,"cmdk-dialog":"",className:i},x.createElement(LB,{ref:t,...c}))))}),Kre=x.forwardRef((e,t)=>dl(n=>n.filtered.count===0)?x.createElement(Ie.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Vre=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return x.createElement(Ie.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},b0(e,s=>x.createElement("div",{"aria-hidden":!0},s)))}),Zd=Object.assign(LB,{List:Fre,Item:$re,Input:Hre,Group:Bre,Separator:Ure,Dialog:qre,Empty:Kre,Loading:Vre});function Yre(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Gre(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function zB(e){let t=x.useRef(e);return kc(()=>{t.current=e}),t}var kc=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Wu(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function dl(e){let t=bC(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function $B(e,t,n,r=[]){let a=x.useRef(),i=km();return kc(()=>{var s;let c=(()=>{var d;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(d=m.current.textContent)==null?void 0:d.trim():a.current}})(),u=r.map(d=>d.trim());i.value(e,c,u),(s=t.current)==null||s.setAttribute(Xu,c),a.current=c}),a}var Xre=()=>{let[e,t]=x.useState(),n=Wu(()=>new Map);return kc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Wre(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function b0({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(Wre(t),{ref:t.ref},n(t.props.children)):n(t)}var Qre={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const JM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ek=dt,w0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ek(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,s=Object.keys(a).map(d=>{const m=n==null?void 0:n[d],f=i==null?void 0:i[d];if(m===null)return null;const v=JM(m)||JM(f);return a[d][v]}),c=n&&Object.entries(n).reduce((d,m)=>{let[f,v]=m;return v===void 0||(d[f]=v),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:f,className:v,...g}=m;return Object.entries(g).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...i,...c}[w]):{...i,...c}[w]===S})?[...d,f,v]:d},[]);return ek(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},Zre=w0("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ee({className:e,variant:t="default",size:n="default",asChild:r=!1,...a}){const i=r?bj:"button";return p.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:Ce(Zre({variant:t,size:n,className:e})),...a})}function El({...e}){return p.jsx(Tj,{"data-slot":"dialog",...e})}function Jre({...e}){return p.jsx(Pj,{"data-slot":"dialog-portal",...e})}function eae({className:e,...t}){return p.jsx(Mj,{"data-slot":"dialog-overlay",className:Ce("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function _l({className:e,children:t,showCloseButton:n=!0,...r}){return p.jsxs(Jre,{"data-slot":"dialog-portal",children:[p.jsx(eae,{}),p.jsxs(kj,{"data-slot":"dialog-content",className:Ce("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,n&&p.jsxs(Rj,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[p.jsx(x0,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function jl({className:e,...t}){return p.jsx("div",{"data-slot":"dialog-header",className:Ce("flex flex-col gap-2 text-center sm:text-left",e),...t})}function BB({className:e,showCloseButton:t=!1,children:n,...r}){return p.jsxs("div",{"data-slot":"dialog-footer",className:Ce("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&p.jsx(Rj,{asChild:!0,children:p.jsx(Ee,{variant:"outline",children:"Close"})})]})}function Cl({className:e,...t}){return p.jsx(R4,{"data-slot":"dialog-title",className:Ce("text-lg leading-none font-semibold",e),...t})}function UB({className:e,...t}){return p.jsx(D4,{"data-slot":"dialog-description",className:Ce("text-sm text-muted-foreground",e),...t})}function tae({className:e,...t}){return p.jsx(Zd,{"data-slot":"command",className:Ce("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function nae({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:a=!0,...i}){return p.jsxs(El,{...i,children:[p.jsxs(jl,{className:"sr-only",children:[p.jsx(Cl,{children:e}),p.jsx(UB,{children:t})]}),p.jsx(_l,{className:Ce("overflow-hidden p-0",r),showCloseButton:a,children:p.jsx(tae,{className:"**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})]})}function rae({className:e,...t}){return p.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[p.jsx(wB,{className:"size-4 shrink-0 opacity-50"}),p.jsx(Zd.Input,{"data-slot":"command-input",className:Ce("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function aae({className:e,...t}){return p.jsx(Zd.List,{"data-slot":"command-list",className:Ce("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function iae({...e}){return p.jsx(Zd.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function sh({className:e,...t}){return p.jsx(Zd.Group,{"data-slot":"command-group",className:Ce("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function Ya({className:e,...t}){return p.jsx(Zd.Item,{"data-slot":"command-item",className:Ce("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...t})}function tk({className:e,...t}){return p.jsx("span",{"data-slot":"command-shortcut",className:Ce("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function oae({open:e,onOpenChange:t}){var d;const n=gl(),{setTheme:r}=xj(),a=Qd(),i=xC(),s=a.data??[],c=((d=i.data)==null?void 0:d.items)??[],u=m=>{t(!1),n(m)};return p.jsxs(nae,{open:e,onOpenChange:t,showCloseButton:!1,children:[p.jsx(rae,{placeholder:"Type a command or search..."}),p.jsxs(aae,{children:[p.jsx(iae,{children:"No results found."}),p.jsxs(sh,{heading:"Navigation",children:[p.jsxs(Ya,{onSelect:()=>u("/"),children:[p.jsx(pB,{}),"Dashboard",p.jsx(tk,{children:"G D"})]}),p.jsxs(Ya,{onSelect:()=>u("/projects"),children:[p.jsx(BE,{}),"Projects",p.jsx(tk,{children:"G P"})]})]}),s.length>0&&p.jsx(sh,{heading:"Projects",children:s.map(m=>p.jsxs(Ya,{onSelect:()=>u(`/projects/${m.id}`),children:[p.jsx(BE,{}),m.display_name]},m.id))}),c.length>0&&p.jsx(sh,{heading:"Running Sessions",children:c.map(m=>p.jsxs(Ya,{onSelect:()=>u(`/projects/${m.project_id}/sessions/${m.run_id}`),children:[p.jsx(hC,{}),m.role," (",m.run_id.slice(0,8),")"]},m.run_id))}),p.jsxs(sh,{heading:"Resources",children:[p.jsxs(Ya,{onSelect:()=>u("/resources/roles"),children:[p.jsx(_B,{}),"Roles"]}),p.jsxs(Ya,{onSelect:()=>u("/resources/skills"),children:[p.jsx(jB,{}),"Skills"]}),p.jsxs(Ya,{onSelect:()=>u("/resources/agents"),children:[p.jsx(fB,{}),"Agents"]}),p.jsxs(Ya,{onSelect:()=>u("/resources/memories"),children:[p.jsx(hB,{}),"Memory"]})]}),p.jsxs(sh,{heading:"Theme",children:[p.jsxs(Ya,{onSelect:()=>{r("light"),t(!1)},children:[p.jsx(EB,{}),"Light"]}),p.jsxs(Ya,{onSelect:()=>{r("dark"),t(!1)},children:[p.jsx(gB,{}),"Dark"]}),p.jsxs(Ya,{onSelect:()=>{r("system"),t(!1)},children:[p.jsx(xne,{}),"System"]})]})]})]})}const sae=[{keys:["⌘","K"],description:"Open command palette"},{keys:["G","D"],description:"Go to Dashboard"},{keys:["G","P"],description:"Go to Projects"},{keys:["?"],description:"Show keyboard shortcuts"}];function lae({open:e,onOpenChange:t}){return p.jsx(El,{open:e,onOpenChange:t,children:p.jsxs(_l,{className:"max-w-sm",children:[p.jsx(jl,{children:p.jsx(Cl,{children:"Keyboard Shortcuts"})}),p.jsx("div",{className:"space-y-2",children:sae.map(n=>p.jsxs("div",{className:"flex items-center justify-between text-sm",children:[p.jsx("span",{className:"text-muted-foreground",children:n.description}),p.jsx("div",{className:"flex gap-1",children:n.keys.map(r=>p.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-xs",children:r},r))})]},n.description))})]})})}function cae({...e}){return p.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function uae({className:e,...t}){return p.jsx("ol",{"data-slot":"breadcrumb-list",className:Ce("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function dae({className:e,...t}){return p.jsx("li",{"data-slot":"breadcrumb-item",className:Ce("inline-flex items-center gap-1.5",e),...t})}function fae({asChild:e,className:t,...n}){const r=e?bj:"a";return p.jsx(r,{"data-slot":"breadcrumb-link",className:Ce("transition-colors hover:text-foreground",t),...n})}function hae({className:e,...t}){return p.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Ce("font-normal text-foreground",e),...t})}function mae({children:e,className:t,...n}){return p.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Ce("[&>svg]:size-3.5",t),...n,children:e??p.jsx(g0,{})})}function Fh({...e}){return p.jsx(ZZ,{"data-slot":"dropdown-menu",...e})}function qh({...e}){return p.jsx(JZ,{"data-slot":"dropdown-menu-trigger",...e})}function Kh({className:e,sideOffset:t=4,...n}){return p.jsx(eJ,{children:p.jsx(tJ,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ce("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...n})})}function Ch({className:e,inset:t,variant:n="default",...r}){return p.jsx(nJ,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ce("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...r})}function HB({className:e,children:t,checked:n,...r}){return p.jsxs(rJ,{"data-slot":"dropdown-menu-checkbox-item",className:Ce("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[p.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:p.jsx(aJ,{children:p.jsx(uC,{className:"size-4"})})}),t]})}function qs({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return p.jsx(iee,{"data-slot":"separator",decorative:n,orientation:t,className:Ce("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const pae=[{to:"/",label:"Dashboard",icon:pB,end:!0},{to:"/projects",label:"Projects",icon:BE},{to:"/schedules",label:"Schedules",icon:Gte},{to:"/settings",label:"Settings",icon:SB}],vae=[{to:"/resources/roles",label:"Roles",icon:_B},{to:"/resources/skills",label:"Skills",icon:jB},{to:"/resources/agents",label:"Agents",icon:fB},{to:"/resources/memories",label:"Memory",icon:hB}];function gae({conv:e,projectId:t,isActive:n,navigate:r}){const[a,i]=x.useState(!1),[s,c]=x.useState(!1),[u,d]=x.useState(!1),[m,f]=x.useState(""),v=x.useRef(null),g=yC(t),b=TB(t),w=E=>{E.stopPropagation(),E.preventDefault(),f(e.title??""),i(!0),setTimeout(()=>{var O;return(O=v.current)==null?void 0:O.focus()},0)},S=()=>{const E=m.trim();g.mutate({conversationId:e.id,title:E||null}),i(!1)};return a?p.jsx("div",{className:"px-1",children:p.jsx(Ze,{ref:v,value:m,onChange:E=>f(E.target.value),onBlur:S,onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),S()),E.key==="Escape"&&(E.stopPropagation(),i(!1))},onClick:E=>E.stopPropagation(),className:"h-7 text-xs px-2"})}):p.jsxs("div",{onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),className:Ce("flex items-center gap-1 rounded-md px-2 py-1.5 transition-colors",n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[p.jsx("button",{onClick:()=>r(`/projects/${t}/conversations/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:p.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),u?p.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p.jsx("button",{onClick:E=>{E.stopPropagation(),b.mutate(e.id),d(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:b.isPending,children:"Delete"}),p.jsx("button",{onClick:E=>{E.stopPropagation(),d(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):p.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:s?1:0},children:[p.jsx("button",{onClick:w,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:p.jsx(fC,{className:"h-3 w-3"})}),!n&&p.jsx("button",{onClick:E=>{E.stopPropagation(),d(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:p.jsx(Sl,{className:"h-3 w-3"})})]})]})}function yae({projectId:e,conversationId:t}){var s,c;const n=gl(),r=AB(e,1,50),a=NB(),i=pC(e);return p.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[p.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:p.jsx(gr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),p.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[p.jsxs("button",{onClick:()=>n(`/projects/${e}`),className:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground transition-colors",children:[p.jsx(cC,{className:"h-4 w-4 shrink-0"}),p.jsx("span",{className:"truncate",children:((s=i.data)==null?void 0:s.display_name)??"Back to Project"})]}),p.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[p.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),p.jsx("button",{onClick:()=>a.mutate({project_id:e},{onSuccess:u=>n(`/projects/${e}/conversations/${u.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:p.jsx(Ug,{className:"h-3.5 w-3.5"})})]}),p.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(((c=r.data)==null?void 0:c.items)??[]).map(u=>p.jsx(gae,{conv:u,projectId:e,isActive:u.id===t,navigate:n},u.id))})]})]})}function xae(){const t=di().pathname.split("/").filter(Boolean),n=t[0]==="projects"&&t[1]?Number(t[1]):0,{data:r}=pC(n,{enabled:n>0}),a=[{label:"Dashboard",href:"/"}];if(t[0]==="projects"&&(a.push({label:"Projects",href:"/projects"}),t[1])){const i=`/projects/${t[1]}`,s=(r==null?void 0:r.display_name)??`Project #${t[1]}`;a.push({label:s,href:i,projectSwitcher:!0}),t[2]==="sessions"&&t[3]?a.push({label:`Session ${t[3].slice(0,8)}…`}):t[2]==="conversations"&&t[3]&&a.push({label:`Conversation #${t[3]}`})}if(t[0]==="schedules"&&a.push({label:"Scheduled Tasks"}),t[0]==="settings"&&a.push({label:"Settings"}),t[0]==="resources"){const i={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory"};a.push({label:"Resources"}),t[1]&&(a[a.length-1].href=`/resources/${t[1]}`,a.push({label:i[t[1]]??t[1]}))}return a}function bae(){const e=xae(),t=gl(),n=Qd(),{setTheme:r}=xj(),[a,i]=x.useState(!1),[s,c]=x.useState(!1),u=XV("/projects/:projectId/conversations/:conversationId"),d=u?Number(u.params.projectId):0,m=u?Number(u.params.conversationId):0;return _re({onCommandPalette:()=>i(!0),onShortcutsHelp:()=>c(!0)}),p.jsxs("div",{className:"flex h-screen",children:[u?p.jsx(yae,{projectId:d,conversationId:m}):p.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[p.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:p.jsx(gr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),p.jsxs("nav",{className:"flex flex-col gap-1 p-3",children:[pae.map(({to:f,label:v,icon:g,end:b})=>p.jsxs(nE,{to:f,end:b,className:({isActive:w})=>Ce("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",w?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[p.jsx(g,{className:"h-4 w-4"}),v]},f)),p.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),vae.map(({to:f,label:v,icon:g})=>p.jsxs(nE,{to:f,className:({isActive:b})=>Ce("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",b?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[p.jsx(g,{className:"h-4 w-4"}),v]},f))]})]}),p.jsxs("div",{className:"flex flex-1 flex-col",children:[p.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border px-6",children:[p.jsx(cae,{children:p.jsx(uae,{children:e.map((f,v)=>{const g=v===e.length-1;return p.jsxs(dae,{children:[v>0&&p.jsx(mae,{}),f.projectSwitcher?p.jsxs(Fh,{children:[p.jsxs(qh,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[f.label,p.jsx(Fte,{className:"h-3 w-3 text-muted-foreground"})]}),p.jsx(Kh,{align:"start",children:(n.data??[]).map(b=>p.jsxs(Ch,{onClick:()=>t(`/projects/${b.id}`),children:[f.href===`/projects/${b.id}`?p.jsx(uC,{className:"mr-2 h-3.5 w-3.5"}):p.jsx("span",{className:"mr-2 inline-block w-3.5"}),b.display_name]},b.id))})]}):g?p.jsx(hae,{children:f.label}):p.jsx(fae,{href:f.href,children:f.label})]},f.label)})})}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted",children:p.jsx("kbd",{className:"font-mono",children:"⌘K"})}),p.jsxs(Fh,{children:[p.jsx(qh,{asChild:!0,children:p.jsxs(Ee,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[p.jsx(EB,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),p.jsx(gB,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),p.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),p.jsxs(Kh,{align:"end",children:[p.jsx(Ch,{onClick:()=>r("light"),children:"Light"}),p.jsx(Ch,{onClick:()=>r("dark"),children:"Dark"}),p.jsx(Ch,{onClick:()=>r("system"),children:"System"})]})]})]})]}),p.jsx(qs,{}),p.jsx("main",{className:"flex-1 overflow-auto p-6",children:p.jsx(fY,{})})]}),p.jsx(oae,{open:a,onOpenChange:i}),p.jsx(lae,{open:s,onOpenChange:c})]})}function wae(){const e=ft();return Mt({mutationFn:t=>ze.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function FB(){const e=ft();return Mt({mutationFn:t=>ze.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function Sae(){const e=ft();return Mt({mutationFn:t=>ze.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const Eae=w0("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function qt({className:e,variant:t="default",asChild:n=!1,...r}){const a=n?bj:"span";return p.jsx(a,{"data-slot":"badge","data-variant":t,className:Ce(Eae({variant:t}),e),...r})}function Bo({className:e,...t}){return p.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:p.jsx("table",{"data-slot":"table",className:Ce("w-full caption-bottom text-sm",e),...t})})}function Uo({className:e,...t}){return p.jsx("thead",{"data-slot":"table-header",className:Ce("[&_tr]:border-b",e),...t})}function Ho({className:e,...t}){return p.jsx("tbody",{"data-slot":"table-body",className:Ce("[&_tr:last-child]:border-0",e),...t})}function Rn({className:e,...t}){return p.jsx("tr",{"data-slot":"table-row",className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function Ye({className:e,...t}){return p.jsx("th",{"data-slot":"table-head",className:Ce("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Ve({className:e,...t}){return p.jsx("td",{"data-slot":"table-cell",className:Ce("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function qE({sessions:e,projectNames:t}){return p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Run ID"}),t&&p.jsx(Ye,{children:"Project"}),p.jsx(Ye,{children:"Role"}),p.jsx(Ye,{children:"Status"}),p.jsx(Ye,{children:"Started"}),p.jsx(Ye,{children:"Duration"}),p.jsx(Ye,{children:"Task"}),p.jsx(Ye,{className:"w-[80px]"})]})}),p.jsx(Ho,{children:e.map(n=>p.jsxs(Rn,{children:[p.jsx(Ve,{children:p.jsx(gr,{to:`/projects/${n.project_id}/sessions/${n.run_id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:n.run_id.slice(0,16)})}),t&&p.jsx(Ve,{children:p.jsx(gr,{to:`/projects/${n.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:t.get(n.project_id)??`#${n.project_id}`})}),p.jsx(Ve,{className:"text-sm",children:n.role}),p.jsx(Ve,{children:p.jsx(_ae,{status:n.status})}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:Hg(n.started_at)}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:S0(n.duration_ms)}),p.jsx(Ve,{className:"max-w-[300px] truncate text-sm",children:n.task??"—"}),p.jsx(Ve,{children:p.jsx(jae,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function _ae({status:e}){const t=qB(e);return p.jsxs(qt,{variant:"outline",className:Ce("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&p.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}const nk=qB;function qB(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function Hg(e){try{return new Date(e).toLocaleString()}catch{return e}}function S0(e){if(e==null)return"—";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}function jae({runId:e,disabled:t}){const[n,r]=x.useState(!1),a=Sae(),i=async()=>{try{await a.mutateAsync(e)}catch{}};return n?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Ee,{size:"sm",variant:"destructive",onClick:i,disabled:a.isPending,children:"Confirm"}),p.jsx(Ee,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):p.jsx(Ee,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:p.jsx(Sl,{className:"h-4 w-4"})})}function sn({className:e,...t}){return p.jsx("div",{"data-slot":"card",className:Ce("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function lh({className:e,...t}){return p.jsx("div",{"data-slot":"card-header",className:Ce("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function ch({className:e,...t}){return p.jsx("div",{"data-slot":"card-title",className:Ce("leading-none font-semibold",e),...t})}function ln({className:e,...t}){return p.jsx("div",{"data-slot":"card-content",className:Ce("px-6",e),...t})}const u1=1e4;function KB(e,t,n){const[r,a]=x.useState([]),[i,s]=x.useState(!1),[c,u]=x.useState(!1),d=x.useRef(null),m=x.useRef(void 0),f=x.useRef(1e3),v=x.useRef("");return x.useEffect(()=>{if(!t)return;const g=`${e}:${t}`;v.current!==g&&(a([]),u(!1),v.current=g);function b(){const w=new EventSource(`/api/sessions/${e}/logs/${t}`);d.current=w,w.onopen=()=>{s(!0),f.current=1e3},w.addEventListener("snapshot",S=>{try{const E=JSON.parse(S.data);Array.isArray(E.lines)&&a(E.lines.slice(-u1))}catch{}}),w.addEventListener("append",S=>{try{const E=JSON.parse(S.data);Array.isArray(E.lines)&&E.lines.length>0&&a(O=>{const j=[...O,...E.lines];return j.length>u1?j.slice(-u1):j})}catch{}}),w.addEventListener("done",()=>{u(!0),w.close(),d.current=null}),w.onerror=()=>{w.close(),d.current=null,s(!1),m.current=setTimeout(()=>{f.current=Math.min(f.current*2,15e3),b()},f.current)}}return b(),()=>{var w;(w=d.current)==null||w.close(),d.current=null,m.current&&clearTimeout(m.current)}},[e,t,n]),{lines:r,connected:i,done:c}}const Cae=5e3;function Oae({runId:e,projectId:t,agentId:n,role:r,runtime:a,startedAt:i}){const{lines:s,done:c}=KB(e,n,!0),u=s.slice(-4),[d,m]=x.useState("");x.useEffect(()=>{const w=new Date(i).getTime(),S=()=>{const O=Date.now()-w,j=Math.floor(O/1e3)%60,A=Math.floor(O/6e4)%60,N=Math.floor(O/36e5);m(N>0?`${N}h ${A}m`:`${A}m ${j}s`)};S();const E=setInterval(S,1e3);return()=>clearInterval(E)},[i]);const f=x.useRef(s.length),v=x.useRef(Date.now()),[g,b]=x.useState(!1);return x.useEffect(()=>{s.length!==f.current&&(f.current=s.length,v.current=Date.now(),b(!1))},[s.length]),x.useEffect(()=>{const w=setInterval(()=>{Date.now()-v.current>Cae&&b(!0)},1e3);return()=>clearInterval(w)},[]),p.jsx(sn,{className:"overflow-hidden",children:p.jsxs(ln,{className:"space-y-2 pt-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${c?"bg-muted-foreground":g?"bg-green-300":"animate-pulse bg-green-500"}`}),p.jsx("span",{className:"font-medium text-sm",children:r})]}),p.jsx(qt,{variant:"outline",className:"text-xs",children:a.replace("strawpot-","")})]}),p.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[p.jsxs("span",{children:["Session: ",e.slice(0,12)]}),p.jsx("span",{children:"·"}),p.jsx("span",{children:d})]}),p.jsx("div",{className:"rounded bg-[#1e1e1e] px-2 py-1.5 font-mono text-[11px] leading-[16px] text-[#d4d4d4]",children:u.length>0?u.map((w,S)=>p.jsxs("div",{className:"truncate",children:[p.jsx("span",{className:"text-[#666]",children:"> "}),w]},S)):p.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),p.jsx("div",{className:"flex justify-end",children:p.jsxs(gr,{to:`/projects/${t}/sessions/${e}?tab=logs`,className:"inline-flex items-center gap-0.5 text-xs text-primary hover:underline",children:["View Session",p.jsx(g0,{className:"h-3 w-3"})]})})]})})}const d1=8;function Aae(){var s;const t=((s=xC().data)==null?void 0:s.items)??[],n=_G({queries:t.slice(0,d1).map(c=>({queryKey:Be.sessions.detail(c.project_id,c.run_id),queryFn:()=>ze.get(`/projects/${c.project_id}/sessions/${c.run_id}`),staleTime:1e4}))}),r=[];for(const c of n){if(!c.data)continue;const u=c.data;for(const[d,m]of Object.entries(u.agents))r.push({runId:u.run_id,projectId:u.project_id,agentId:d,role:m.role,runtime:m.runtime,startedAt:m.started_at})}if(r.length===0)return null;const a=r.slice(0,d1),i=r.length-d1;return p.jsxs("section",{className:"space-y-3",children:[p.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Active Agents (",r.length,")"]}),p.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:a.map(c=>p.jsx(Oae,{runId:c.runId,projectId:c.projectId,agentId:c.agentId,role:c.role,runtime:c.runtime,startedAt:c.startedAt},`${c.runId}:${c.agentId}`))}),i>0&&p.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",i," more agent",i!==1?"s":""," running"]})]})}function cn({className:e,...t}){return p.jsx("div",{"data-slot":"skeleton",className:Ce("animate-pulse rounded-md bg-accent",e),...t})}function Nae(){return p.jsxs("div",{className:"space-y-8",children:[p.jsx(cn,{className:"h-8 w-40"}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(cn,{className:"h-4 w-24"}),p.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:[1,2,3].map(e=>p.jsx(cn,{className:"h-28 rounded-lg"},e))})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(cn,{className:"h-4 w-32"}),p.jsx(cn,{className:"h-48 rounded-lg"})]})]})}function Tae(){var f,v;const e=Qd(),t=xC(),n=jre(),r=wre(10),a=e.isLoading||t.isLoading||n.isLoading,i=e.error||t.error||n.error;if(a)return p.jsx(Nae,{});if(i)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",i.message]})]});const s=e.data??[],c=((f=t.data)==null?void 0:f.items)??[],u=((v=n.data)==null?void 0:v.items)??[],d=new Map;for(const g of s)d.set(g.id,g.display_name);const m=new Map;for(const g of c)m.set(g.project_id,(m.get(g.project_id)??0)+1);return p.jsxs("div",{className:"space-y-8",children:[p.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),p.jsx(Aae,{}),p.jsxs("section",{className:"space-y-3",children:[p.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",s.length,")"]}),s.length===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Name"}),p.jsx(Ye,{children:"Directory"}),p.jsx(Ye,{children:"Status"})]})}),p.jsxs(Ho,{children:[s.slice(0,10).map(g=>p.jsxs(Rn,{children:[p.jsx(Ve,{children:p.jsx(gr,{to:`/projects/${g.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:g.display_name})}),p.jsx(Ve,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:g.working_dir}),p.jsx(Ve,{children:p.jsxs("div",{className:"flex gap-1.5",children:[!g.dir_exists&&p.jsx(qt,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Directory missing"}),(m.get(g.id)??0)>0&&p.jsxs(qt,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:[p.jsx("span",{className:"mr-1 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),m.get(g.id)," running"]})]})})]},g.id)),s.length>10&&p.jsx(Rn,{children:p.jsx(Ve,{colSpan:3,className:"text-center",children:p.jsxs(gr,{to:"/projects",className:"text-sm text-muted-foreground underline-offset-4 hover:underline",children:["+",s.length-10," more — view all projects"]})})})]})]})})})]}),c.length>0&&p.jsxs("section",{className:"space-y-3",children:[p.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",c.length,")"]}),p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsx(qE,{sessions:c,projectNames:d})})})]}),(r.data??[]).length>0&&p.jsxs("section",{className:"space-y-3",children:[p.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Conversations"}),p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Title"}),p.jsx(Ye,{children:"Project"}),p.jsx(Ye,{children:"Sessions"}),p.jsx(Ye,{children:"Last Activity"})]})}),p.jsx(Ho,{children:(r.data??[]).map(g=>p.jsxs(Rn,{children:[p.jsx(Ve,{children:p.jsx(gr,{to:`/projects/${g.project_id}/conversations/${g.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:g.title??`Conversation #${g.id}`})}),p.jsx(Ve,{children:p.jsx(gr,{to:`/projects/${g.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:g.project_name})}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:g.session_count}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:g.last_activity?new Date(g.last_activity).toLocaleString():"—"})]},g.id))})]})})})]}),p.jsxs("section",{className:"space-y-3",children:[p.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),u.length===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsx(qE,{sessions:u,projectNames:d})})})]})]})}function VB(){return mn({queryKey:Be.config.global,queryFn:()=>ze.get("/config/global")})}function Pae(){const e=ft();return Mt({mutationFn:t=>ze.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Be.projects.all})}})}function Mae(){const e=ft();return Mt({mutationFn:t=>ze.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Be.projects.all})}})}function kae(){const e=ft();return Mt({mutationFn:({projectId:t,files:n})=>ze.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.projects.files(n.projectId)})}})}function Rae(){const e=ft();return Mt({mutationFn:({projectId:t,filePath:n})=>ze.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.projects.files(n.projectId)})}})}function Dae(){const e=ft();return Mt({mutationFn:t=>ze.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(Be.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:Be.config.global})}})}function YB(){const e=ft();return Mt({mutationFn:({projectId:t,data:n})=>ze.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData(Be.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:Be.projects.config(n.projectId)})}})}function Rm({className:e,children:t,...n}){return p.jsxs(yJ,{"data-slot":"scroll-area",className:Ce("relative",e),...n,children:[p.jsx(xJ,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:t}),p.jsx(Iae,{}),p.jsx(bJ,{})]})}function Iae({className:e,orientation:t="vertical",...n}){return p.jsx(G5,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Ce("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:p.jsx(Z5,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function Lae({initialPath:e,onSelect:t,onCancel:n}){const[r,a]=x.useState(null),[i,s]=x.useState(!0),[c,u]=x.useState(null),[d,m]=x.useState(null),f=g=>{s(!0),u(null);const b=g?`?path=${encodeURIComponent(g)}`:"";ze.get(`/fs/browse${b}`).then(a).catch(w=>u(w.message??"Failed to browse")).finally(()=>s(!1))},v=async()=>{if(!(!r||!(d!=null&&d.trim())))try{const g=await ze.post("/fs/mkdir",{path:r.path,name:d.trim()});m(null),f(g.path)}catch(g){u(g instanceof Error?g.message:"Failed to create folder")}};return x.useEffect(()=>{f(e||void 0)},[]),p.jsx(El,{open:!0,onOpenChange:g=>!g&&n(),children:p.jsxs(_l,{className:"sm:max-w-[480px]",children:[p.jsx(jl,{children:p.jsx(Cl,{children:"Select Directory"})}),r&&p.jsx("div",{className:"break-all rounded-md bg-muted px-3 py-1.5 font-mono text-xs",children:r.path}),c&&p.jsx("p",{className:"text-sm text-destructive",children:c}),i&&!r?p.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Loading..."}):p.jsx(Rm,{className:"h-[300px]",children:p.jsxs("div",{className:"space-y-0.5",children:[(r==null?void 0:r.parent)&&p.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>f(r.parent),children:[p.jsx(one,{className:"h-4 w-4"}),".."]}),r==null?void 0:r.entries.map(g=>p.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>f(g.path),children:[p.jsx(lne,{className:"h-4 w-4"}),g.name]},g.path)),(r==null?void 0:r.entries.length)===0&&p.jsx("p",{className:"px-3 py-4 text-sm italic text-muted-foreground",children:"No subdirectories"})]})}),p.jsx(BB,{children:d!==null?p.jsxs("div",{className:"flex w-full gap-2",children:[p.jsx(Ze,{value:d,onChange:g=>m(g.target.value),onKeyDown:g=>{g.key==="Enter"&&v(),g.key==="Escape"&&m(null)},placeholder:"Folder name",autoFocus:!0,className:"flex-1"}),p.jsx(Ee,{size:"sm",onClick:v,children:"Create"}),p.jsx(Ee,{size:"sm",variant:"outline",onClick:()=>m(null),children:"Cancel"})]}):p.jsxs(p.Fragment,{children:[p.jsx(Ee,{variant:"outline",onClick:()=>m(""),disabled:!r,children:"New Folder"}),p.jsx("div",{className:"flex-1"}),p.jsx(Ee,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),p.jsx(Ee,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function mt({className:e,...t}){return p.jsx(oJ,{"data-slot":"label",className:Ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function zi({...e}){return p.jsx(qJ,{"data-slot":"select",...e})}function $i({...e}){return p.jsx(VJ,{"data-slot":"select-value",...e})}function Bi({className:e,size:t="default",children:n,...r}){return p.jsxs(KJ,{"data-slot":"select-trigger","data-size":t,className:Ce("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...r,children:[n,p.jsx(YJ,{asChild:!0,children:p.jsx(Hh,{className:"size-4 opacity-50"})})]})}function Ui({className:e,children:t,position:n="item-aligned",align:r="center",...a}){return p.jsx(GJ,{children:p.jsxs(XJ,{"data-slot":"select-content",className:Ce("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...a,children:[p.jsx(zae,{}),p.jsx(WJ,{className:Ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),p.jsx($ae,{})]})})}function Dn({className:e,children:t,...n}){return p.jsxs(QJ,{"data-slot":"select-item",className:Ce("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[p.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:p.jsx(JJ,{children:p.jsx(uC,{className:"size-4"})})}),p.jsx(ZJ,{children:t})]})}function zae({className:e,...t}){return p.jsx(eee,{"data-slot":"select-scroll-up-button",className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(Ute,{className:"size-4"})})}function $ae({className:e,...t}){return p.jsx(tee,{"data-slot":"select-scroll-down-button",className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(Hh,{className:"size-4"})})}function Bae(){const{data:e,isLoading:t,error:n}=Qd(),[r,a]=x.useState(!1);if(t)return p.jsxs("div",{className:"space-y-6",children:[p.jsx(cn,{className:"h-8 w-32"}),p.jsx(cn,{className:"h-64 rounded-lg"})]});if(n)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",n.message]})]});const i=e??[];return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Projects"}),p.jsxs(Ee,{onClick:()=>a(!0),children:[p.jsx(Ug,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&p.jsx(Uae,{onDone:()=>a(!1),onCancel:()=>a(!1)}),i.length===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered yet."}):p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Name"}),p.jsx(Ye,{children:"Directory"}),p.jsx(Ye,{children:"Created"}),p.jsx(Ye,{children:"Status"}),p.jsx(Ye,{className:"w-[80px]"})]})}),p.jsx(Ho,{children:i.map(s=>p.jsxs(Rn,{children:[p.jsx(Ve,{children:p.jsx(gr,{to:`/projects/${s.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:s.display_name})}),p.jsx(Ve,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:s.working_dir}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:Fae(s.created_at)}),p.jsx(Ve,{children:s.dir_exists?p.jsx(qt,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):p.jsx(qt,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})}),p.jsx(Ve,{children:p.jsx(Hae,{projectId:s.id})})]},s.id))})]})})})]})}function Uae({onDone:e,onCancel:t}){var R,D,K;const[n,r]=x.useState(""),[a,i]=x.useState(""),[s,c]=x.useState(""),[u,d]=x.useState(""),[m,f]=x.useState(!1),[v,g]=x.useState(!1),b=Pae(),w=YB(),E=(R=VB().data)==null?void 0:R.defaults,O=(E==null?void 0:E.isolation)??"none",j=((D=E==null?void 0:E.session)==null?void 0:D.merge_strategy)??"auto",A=s||O,N=async()=>{const z=await b.mutateAsync({display_name:n.trim(),working_dir:a.trim()}),I={},G=u||j;I.isolation=A,I.session={merge_strategy:G},await w.mutateAsync({projectId:z.id,data:I}),e()},T=async z=>{z.preventDefault();try{if(A==="worktree"&&a.trim()&&!(await ze.get(`/fs/git-check?path=${encodeURIComponent(a.trim())}`)).is_git){g(!0);return}await N()}catch{}},P=async()=>{try{await ze.post("/fs/git-init",{path:a.trim()}),g(!1),await N()}catch{}};return p.jsx(sn,{children:p.jsx(ln,{className:"pt-6",children:p.jsxs("form",{onSubmit:T,className:"space-y-4",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"display-name",children:"Display Name"}),p.jsx(Ze,{id:"display-name",value:n,onChange:z=>r(z.target.value),required:!0,autoFocus:!0})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"working-dir",children:"Working Directory"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ze,{id:"working-dir",value:a,onChange:z=>i(z.target.value),placeholder:"/path/to/project",required:!0}),p.jsx(Ee,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!m),children:"Browse"})]})]})]}),m&&p.jsx(Lae,{initialPath:a||void 0,onSelect:z=>{i(z),f(!1)},onCancel:()=>f(!1)}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"isolation",children:"Isolation"}),p.jsxs(zi,{value:s||O,onValueChange:c,children:[p.jsx(Bi,{id:"isolation",children:p.jsx($i,{})}),p.jsxs(Ui,{children:[p.jsx(Dn,{value:"none",children:"none"}),p.jsx(Dn,{value:"worktree",children:"worktree"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"merge-strategy",children:"Merge Strategy"}),p.jsxs(zi,{value:u||j,onValueChange:d,children:[p.jsx(Bi,{id:"merge-strategy",children:p.jsx($i,{})}),p.jsxs(Ui,{children:[p.jsx(Dn,{value:"auto",children:"auto"}),p.jsx(Dn,{value:"local",children:"local"}),p.jsx(Dn,{value:"pr",children:"pr"})]})]})]})]}),v&&p.jsxs("div",{className:"rounded-md border border-orange-200 bg-orange-50 p-3 dark:border-orange-800 dark:bg-orange-950",children:[p.jsxs("p",{className:"text-sm",children:["The selected directory is not a git repository. Worktree isolation requires git. Initialize a git repository with ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"git init"}),"?"]}),p.jsxs("div",{className:"mt-2 flex gap-2",children:[p.jsx(Ee,{type:"button",size:"sm",onClick:P,children:"Yes, initialize"}),p.jsx(Ee,{type:"button",size:"sm",variant:"outline",onClick:()=>g(!1),children:"Cancel"})]})]}),(b.error||w.error)&&p.jsx("p",{className:"text-sm text-destructive",children:(K=b.error||w.error)==null?void 0:K.message}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ee,{type:"submit",disabled:b.isPending||w.isPending,children:b.isPending||w.isPending?"Adding...":"Add"}),p.jsx(Ee,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function Hae({projectId:e}){const[t,n]=x.useState(!1),r=Mae(),a=async()=>{try{await r.mutateAsync(e)}catch{}};return t?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Ee,{size:"sm",variant:"destructive",onClick:a,disabled:r.isPending,children:"Confirm"}),p.jsx(Ee,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):p.jsx(Ee,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:p.jsx(Sl,{className:"h-4 w-4"})})}function Fae(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function GB(e){return mn({queryKey:Be.projects.resources(e),queryFn:()=>ze.get(`/projects/${e}/resources`)})}function qae(e,t,n,r){return mn({queryKey:Be.projects.resourceDetail(e,t,n),queryFn:()=>ze.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function Kae(e,t,n,r){return mn({queryKey:Be.projects.resourceConfig(e,t,n),queryFn:()=>ze.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function Vae(e,t){if(t<=7)return Array.from({length:t},(i,s)=>s+1);const n=[1];e>3&&n.push("...");const r=Math.max(2,e-1),a=Math.min(t-1,e+1);for(let i=r;i<=a;i++)n.push(i);return e<t-2&&n.push("..."),n.push(t),n}function Yae({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=Vae(e,t);return p.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[p.jsx(Ee,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:p.jsx(zte,{className:"h-4 w-4"})}),r.map((a,i)=>a==="..."?p.jsx("span",{className:"px-1 text-sm text-muted-foreground",children:"..."},`ellipsis-${i}`):p.jsx(Ee,{variant:a===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(a),children:a},a)),p.jsx(Ee,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:p.jsx(g0,{className:"h-4 w-4"})})]})}function wC(){return mn({queryKey:Be.roles.all,queryFn:()=>ze.get("/roles")})}function Gae(e){return mn({queryKey:Be.registry.validate(e??""),queryFn:()=>ze.get(`/registry/agents/${e}/validate`),enabled:!!e})}function To(e,t){return mn({queryKey:Be.registry.list(e),queryFn:()=>ze.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function Xae(e,t,n){return mn({queryKey:Be.registry.detail(e,t),queryFn:()=>ze.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}function XB(e,t,n){return mn({queryKey:Be.registry.config(e,t),queryFn:()=>ze.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function Cd({className:e,...t}){return p.jsx("textarea",{"data-slot":"textarea",className:Ce("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function SC({...e}){return p.jsx(nX,{"data-slot":"collapsible",...e})}function EC({...e}){return p.jsx(o4,{"data-slot":"collapsible-trigger",...e})}function _C({...e}){return p.jsx(s4,{"data-slot":"collapsible-content",...e})}function Wae({projectId:e,open:t,onOpenChange:n}){var Er,ga,Un,ya,_r,kr;const r=gl(),a=gC(e),i=wC(),{data:s}=To("agents"),{data:c}=To("memories"),u=vC(e),d=wae(),m=(Er=a.data)==null?void 0:Er.merged,f="__empty__",[v,g]=x.useState(""),[b,w]=x.useState(""),[S,E]=x.useState(""),[O,j]=x.useState(""),[A,N]=x.useState(""),[T,P]=x.useState(""),[R,D]=x.useState(""),[K,z]=x.useState(""),[I,G]=x.useState(""),[L,Y]=x.useState(!1),[k,H]=x.useState([]),[q,F]=x.useState(!1),[V,B]=x.useState(""),[$,X]=x.useState(!1),[Z,ee]=x.useState(!1),le=ft(),ie=()=>{g(""),w(""),E(""),j(""),N(""),P(""),D(""),z(""),G(""),Y(!1),H([]),F(!1)},ae=we=>{we.preventDefault(),X(!0)},J=we=>{we.preventDefault(),X(!0)},re=we=>{we.preventDefault(),X(!1)},fe=async we=>{we.preventDefault(),X(!1);const xt=Array.from(we.dataTransfer.files);if(xt.length){ee(!0);try{const ht=await ze.upload(`/projects/${e}/files`,xt);le.invalidateQueries({queryKey:Be.projects.files(e)}),H(Xr=>{const ge=ht.map(Ct=>Ct.path).filter(Ct=>!Xr.includes(Ct));return[...Xr,...ge]})}catch{}finally{ee(!1)}}},ne=we=>{H(xt=>xt.includes(we)?xt.filter(ht=>ht!==we):[...xt,we])},xe=async we=>{we.preventDefault();try{const xt={project_id:e,task:v.trim()};b.trim()&&(xt.role=b.trim());const ht={};S.trim()&&(ht.runtime=S.trim()),O.trim()&&(ht.memory=O.trim()),A&&(ht.cache_delegations=A==="true"),T.trim()&&(ht.cache_max_entries=Number(T.trim())),R.trim()&&(ht.cache_ttl_seconds=Number(R.trim())),K.trim()&&(ht.max_num_delegations=Number(K.trim())),Object.keys(ht).length>0&&(xt.overrides=ht),k.length>0&&(xt.context_files=k),I.trim()&&(xt.system_prompt=I.trim()),L&&(xt.interactive=!0);const Xr=await d.mutateAsync(xt);ie(),n(!1),r(`/projects/${e}/sessions/${Xr.run_id}`)}catch{}},ye=(m==null?void 0:m.orchestrator_role)??"orchestrator",De=(i.data??[]).filter(we=>we!==ye),Me=[ye,...De],Ke=(s??[]).map(we=>we.name),Je=new Set((c??[]).map(we=>we.name));Je.add("none");const nt=[...Je].sort(),pn=b.trim()||ye,Bn=XB("roles",pn,{enabled:!!pn}),Et=((Un=(ga=Bn.data)==null?void 0:ga.params_values)==null?void 0:Un.default_agent)??((kr=(_r=(ya=Bn.data)==null?void 0:ya.params_schema)==null?void 0:_r.default_agent)==null?void 0:kr.default)??"",vn=Et&&Ke.includes(Et)?Et:(m==null?void 0:m.runtime)??"strawpot-claude-code",It=b.trim()&&!Me.includes(b.trim())?"Role not found in installed roles":"",Sr=S.trim()&&Ke.length>0&&!Ke.includes(S.trim())?"Runtime not found in installed agents":"",dn=O.trim()&&!nt.includes(O.trim())?"Memory not found in installed providers":"",Mr=!!It||!!Sr||!!dn;return p.jsx(El,{open:t,onOpenChange:n,children:p.jsxs(_l,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[p.jsx(jl,{children:p.jsx(Cl,{children:"Launch Session"})}),p.jsxs("form",{onSubmit:xe,className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsxs(mt,{htmlFor:"task",children:["Task ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsxs("div",{className:"relative",onDragOver:ae,onDragEnter:J,onDragLeave:re,onDrop:fe,children:[p.jsx(Cd,{id:"task",value:v,onChange:we=>g(we.target.value),placeholder:"Describe what the agent should do… (drag & drop files to attach)",required:!0,autoFocus:!0,rows:3}),($||Z)&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:Z?p.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(wc,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):p.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[p.jsx(mC,{className:"h-4 w-4"})," Drop to upload & attach"]})})]})]}),(u.data??[]).length>0&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(Fh,{children:[p.jsx(qh,{asChild:!0,children:p.jsxs(Ee,{type:"button",variant:"outline",size:"sm",children:[p.jsx(xB,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),p.jsxs(Kh,{align:"start",className:"w-64",onCloseAutoFocus:we=>we.preventDefault(),children:[p.jsx("div",{className:"px-2 py-1.5",children:p.jsx(Ze,{placeholder:"Filter files...",value:V,onChange:we=>B(we.target.value),className:"h-7 text-xs",onKeyDown:we=>we.stopPropagation()})}),p.jsx("div",{className:"max-h-48 overflow-y-auto",children:(u.data??[]).filter(we=>we.path.toLowerCase().includes(V.toLowerCase())).map(we=>p.jsx(HB,{checked:k.includes(we.path),onCheckedChange:()=>ne(we.path),onSelect:xt=>xt.preventDefault(),children:p.jsx("span",{className:"font-mono text-xs",children:we.path})},we.path))})]})]}),k.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[k.length," file(s) attached"]})]}),k.length>0&&p.jsxs("div",{className:"flex flex-wrap gap-1",children:[(q?k:k.slice(0,3)).map(we=>p.jsxs(qt,{variant:"secondary",className:"max-w-[200px] gap-1 font-mono text-xs",children:[p.jsx("button",{type:"button",onClick:()=>ne(we),className:"mr-0.5 shrink-0 rounded-sm hover:bg-muted",children:p.jsx(x0,{className:"h-3 w-3"})}),p.jsxs("span",{className:"truncate",children:["@",we]})]},we)),!q&&k.length>3&&p.jsxs("button",{type:"button",onClick:()=>F(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",k.length-3," more"]}),q&&k.length>3&&p.jsx("button",{type:"button",onClick:()=>F(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"role",children:"Role"}),p.jsx(Ze,{id:"role",list:"datalist-role",value:b,onChange:we=>w(we.target.value),placeholder:ye}),p.jsxs("datalist",{id:"datalist-role",children:[p.jsx("option",{value:ye}),De.map(we=>p.jsx("option",{value:we},we))]}),It&&p.jsx("p",{className:"text-xs text-destructive",children:It})]}),p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:L,onChange:we=>Y(we.target.checked),className:"rounded border-input"}),p.jsx("span",{className:"text-sm",children:"Interactive mode"}),p.jsx("span",{className:"text-xs text-muted-foreground",children:"Allow the agent to ask you questions via a chat panel"})]}),p.jsxs(SC,{children:[p.jsx(EC,{asChild:!0,children:p.jsxs(Ee,{type:"button",variant:"ghost",size:"sm",children:[p.jsx(Hh,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),p.jsxs(_C,{className:"mt-3 space-y-4",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"runtime",children:"Runtime"}),p.jsx(Ze,{id:"runtime",list:"datalist-runtime",value:S,onChange:we=>E(we.target.value),placeholder:vn}),s&&p.jsx("datalist",{id:"datalist-runtime",children:s.map(we=>p.jsx("option",{value:we.name},we.name))}),Sr&&p.jsx("p",{className:"text-xs text-destructive",children:Sr})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"memory",children:"Memory"}),p.jsx(Ze,{id:"memory",list:"datalist-memory",value:O,onChange:we=>j(we.target.value),placeholder:(m==null?void 0:m.memory)||"dial"}),p.jsx("datalist",{id:"datalist-memory",children:nt.map(we=>p.jsx("option",{value:we},we))}),dn&&p.jsx("p",{className:"text-xs text-destructive",children:dn})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"system-prompt",children:"System Prompt"}),p.jsx(Cd,{id:"system-prompt",value:I,onChange:we=>G(we.target.value),placeholder:"Additional instructions for the agent...",rows:3})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Max Delegations"}),p.jsx(Ze,{type:"number",min:"0",value:K,onChange:we=>z(we.target.value),placeholder:m!=null&&m.max_num_delegations?String(m.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Cache Delegations"}),p.jsxs(zi,{value:A||f,onValueChange:we=>N(we===f?"":we),children:[p.jsx(Bi,{className:"h-8 text-xs",children:p.jsx($i,{placeholder:(m==null?void 0:m.cache_delegations)!==!1?"true":"false"})}),p.jsxs(Ui,{children:[p.jsxs(Dn,{value:f,className:"text-muted-foreground",children:["Default (",(m==null?void 0:m.cache_delegations)!==!1?"true":"false",")"]}),p.jsx(Dn,{value:"true",children:"true"}),p.jsx(Dn,{value:"false",children:"false"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Cache Max Entries"}),p.jsx(Ze,{type:"number",min:"0",value:T,onChange:we=>P(we.target.value),placeholder:m!=null&&m.cache_max_entries?String(m.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Cache TTL (seconds)"}),p.jsx(Ze,{type:"number",min:"0",value:R,onChange:we=>D(we.target.value),placeholder:m!=null&&m.cache_ttl_seconds?String(m.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]})]}),d.error&&p.jsx("p",{className:"text-sm text-destructive",children:d.error.message}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ee,{type:"submit",disabled:d.isPending||Mr,children:d.isPending?"Launching...":"Launch"}),p.jsx(Ee,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function Qae(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Zae({projectId:e}){const t=vC(e),n=kae(),r=Rae(),a=x.useRef(null),[i,s]=x.useState(!1),[c,u]=x.useState(null),d=x.useCallback(E=>{const O=Array.from(E);O.length!==0&&n.mutate({projectId:e,files:O},{onSuccess:()=>wt.success(`Uploaded ${O.length} file(s)`),onError:()=>wt.error("Upload failed")})},[e,n]),m=x.useCallback(E=>{E.preventDefault(),s(!1),d(E.dataTransfer.files)},[d]),f=x.useCallback(E=>{E.preventDefault(),s(!0)},[]),v=x.useCallback(E=>{E.preventDefault(),s(!1)},[]),g=x.useCallback(()=>{var E;(E=a.current)==null||E.click()},[]),b=x.useCallback(E=>{E.target.files&&(d(E.target.files),E.target.value="")},[d]),w=x.useCallback(E=>{r.mutate({projectId:e,filePath:E},{onSuccess:()=>{wt.success("File deleted"),u(null)},onError:()=>{wt.error("Failed to delete file"),u(null)}})},[e,r]),S=t.data??[];return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{onDrop:m,onDragOver:f,onDragLeave:v,className:`flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 transition-colors ${i?"border-primary bg-primary/5":"border-muted-foreground/25"}`,children:[p.jsx(mC,{className:"h-8 w-8 text-muted-foreground"}),p.jsxs("p",{className:"text-sm text-muted-foreground",children:["Drag & drop files here, or"," ",p.jsx("button",{type:"button",onClick:g,className:"font-medium text-primary underline-offset-4 hover:underline",children:"browse"})]}),n.isPending&&p.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploading..."}),p.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",onChange:b})]}),S.length===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Name"}),p.jsx(Ye,{className:"w-24",children:"Size"}),p.jsx(Ye,{className:"w-44",children:"Modified"}),p.jsx(Ye,{className:"w-28"})]})}),p.jsx(Ho,{children:S.map(E=>p.jsxs(Rn,{children:[p.jsx(Ve,{className:"font-mono text-xs",children:E.path}),p.jsx(Ve,{className:"text-xs text-muted-foreground",children:Qae(E.size)}),p.jsx(Ve,{className:"text-xs text-muted-foreground",children:new Date(E.modified_at).toLocaleString()}),p.jsx(Ve,{children:c===E.path?p.jsxs("div",{className:"flex items-center justify-end gap-2",children:[p.jsx("button",{type:"button",onClick:()=>w(E.path),disabled:r.isPending,className:"text-xs text-destructive hover:text-destructive/80 font-medium",children:"Confirm"}),p.jsx("button",{type:"button",onClick:()=>u(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):p.jsx("div",{className:"flex justify-end",children:p.jsx(Ee,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>u(E.path),disabled:r.isPending,children:p.jsx(Sl,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},E.path))})]})})})]})}function Jae(){const e=ft();return Mt({mutationFn:t=>ze.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function WB(){const e=ft();return Mt({mutationFn:({type:t,name:n})=>ze.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function eie(){const e=ft();return Mt({mutationFn:t=>ze.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function tie(){const e=ft();return Mt({mutationFn:t=>ze.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function nie(){const e=ft();return Mt({mutationFn:({type:t,name:n,env_values:r,params_values:a})=>ze.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:a}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.registry.config(n.type,n.name)})}})}function rie(e){const t=ft();return Mt({mutationFn:n=>ze.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Be.projects.resources(e)})}})}function QB(e){const t=ft();return Mt({mutationFn:({type:n,name:r})=>ze.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Be.projects.resources(e)})}})}function aie(e){const t=ft();return Mt({mutationFn:n=>ze.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Be.projects.resources(e)})}})}function iie(e){const t=ft();return Mt({mutationFn:n=>ze.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Be.projects.resources(e)})}})}function oie(e){const t=ft();return Mt({mutationFn:({type:n,name:r,env_values:a,params_values:i})=>ze.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:a,params_values:i}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Be.projects.resourceConfig(e,r.type,r.name)})}})}function sie({...e}){return p.jsx(Tj,{"data-slot":"sheet",...e})}function lie({...e}){return p.jsx(Pj,{"data-slot":"sheet-portal",...e})}function cie({className:e,...t}){return p.jsx(Mj,{"data-slot":"sheet-overlay",className:Ce("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function uie({className:e,children:t,side:n="right",showCloseButton:r=!0,...a}){return p.jsxs(lie,{children:[p.jsx(cie,{}),p.jsxs(kj,{"data-slot":"sheet-content",className:Ce("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",n==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",n==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",n==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",n==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...a,children:[t,r&&p.jsxs(Rj,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[p.jsx(x0,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function die({className:e,...t}){return p.jsx("div",{"data-slot":"sheet-header",className:Ce("flex flex-col gap-1.5 p-4",e),...t})}function fie({className:e,...t}){return p.jsx(R4,{"data-slot":"sheet-title",className:Ce("font-semibold text-foreground",e),...t})}function hie({className:e,...t}){return p.jsx(D4,{"data-slot":"sheet-description",className:Ce("text-sm text-muted-foreground",e),...t})}const mie=w0("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function vg({className:e,variant:t,...n}){return p.jsx("div",{"data-slot":"alert",role:"alert",className:Ce(mie({variant:t}),e),...n})}function gg({className:e,...t}){return p.jsx("div",{"data-slot":"alert-title",className:Ce("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function yg({className:e,...t}){return p.jsx("div",{"data-slot":"alert-description",className:Ce("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function pie({agentName:e}){const{data:t}=Gae(e);return!t||!(!t.tools_ok||t.setup_command||!t.env_ok)?null:p.jsxs("div",{className:"mb-4 space-y-3",children:[!t.tools_ok&&p.jsxs(vg,{variant:"destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsx(gg,{children:"Missing Prerequisites"}),p.jsx(yg,{children:t.missing_tools.map(r=>p.jsxs("div",{className:"mt-1",children:[p.jsx("strong",{children:r.name})," not found on PATH.",r.install_hint&&p.jsx("code",{className:"ml-2 rounded bg-muted px-1.5 py-0.5 text-xs",children:r.install_hint})]},r.name))})]}),t.setup_command&&p.jsxs(vg,{children:[p.jsx(Lne,{className:"h-4 w-4"}),p.jsx(gg,{children:"Setup"}),p.jsxs(yg,{children:[p.jsx("p",{children:t.setup_description||"Run initial authentication in your terminal:"}),p.jsx("code",{className:"mt-1 block rounded bg-muted px-2 py-1 text-xs",children:t.setup_command}),p.jsx("p",{className:"mt-2 text-muted-foreground",children:"Or set the API key in the config below instead."})]})]}),!t.env_ok&&!t.setup_command&&t.missing_env.length>0&&p.jsxs(vg,{children:[p.jsx(mne,{className:"h-4 w-4"}),p.jsx(gg,{children:"API Key Required"}),p.jsx(yg,{children:p.jsxs("p",{children:["Set"," ",t.missing_env.map((r,a)=>p.jsxs("span",{children:[a>0&&", ",p.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:r})]},r))," ","in the config below to authenticate."]})})]})]})}function vie({resourceType:e,resourceName:t,enabled:n,projectId:r}){const a=XB(e,t,{enabled:n&&!r}),i=Kae(r??0,e,t,{enabled:n&&!!r}),{data:s,isLoading:c}=r?i:a,u=nie(),d=oie(r??0),m=r?d:u,{data:f}=To("agents",{enabled:n&&e==="roles"}),[v,g]=x.useState({}),[b,w]=x.useState({}),[S,E]=x.useState(new Set);if(x.useEffect(()=>{s&&(g({...s.env_values}),w({...s.params_values}))},[s]),c||!s)return null;const O=Object.keys(s.env_schema),j=Object.keys(s.params_schema);if(O.length===0&&j.length===0)return null;const A=D=>E(K=>{const z=new Set(K);return z.has(D)?z.delete(D):z.add(D),z}),N=(f??[]).map(D=>D.name),T=String(b.default_agent??"").trim(),P=e==="roles"&&T&&N.length>0&&!N.includes(T)?"Agent not found in installed agents":"",R=()=>{m.mutate({type:e,name:t,env_values:O.length>0?v:void 0,params_values:j.length>0?b:void 0},{onSuccess:()=>wt.success("Configuration saved"),onError:()=>wt.error("Failed to save configuration")})};return p.jsxs("div",{className:"flex flex-col gap-4",children:[O.length>0&&p.jsxs(p.Fragment,{children:[p.jsx(qs,{}),p.jsxs("div",{className:"flex flex-col gap-3",children:[p.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),O.map(D=>{const K=s.env_schema[D],z=S.has(D);return p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(mt,{className:"text-xs font-mono",children:D}),K.required&&p.jsx(qt,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),K.description&&p.jsx("p",{className:"text-xs text-muted-foreground",children:K.description}),p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Ze,{type:z?"text":"password",value:v[D]??"",onChange:I=>g(G=>({...G,[D]:I.target.value})),placeholder:D,className:"h-8 text-xs font-mono"}),p.jsx(Ee,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 shrink-0 p-0",onClick:()=>A(D),children:z?p.jsx(tne,{className:"h-3.5 w-3.5"}):p.jsx(rne,{className:"h-3.5 w-3.5"})})]})]},D)})]})]}),j.length>0&&p.jsxs(p.Fragment,{children:[p.jsx(qs,{}),p.jsxs("div",{className:"flex flex-col gap-3",children:[p.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),j.map(D=>{const K=s.params_schema[D],z=b[D],I=K.default;if(K.type==="boolean")return p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsx(mt,{className:"text-xs font-mono",children:D}),K.description&&p.jsx("p",{className:"text-xs text-muted-foreground",children:K.description}),p.jsxs(zi,{value:z!=null?String(z):I!=null?String(I):"",onValueChange:H=>w(q=>({...q,[D]:H==="true"})),children:[p.jsx(Bi,{className:"h-8 text-xs",children:p.jsx($i,{})}),p.jsxs(Ui,{children:[p.jsx(Dn,{value:"true",children:"true"}),p.jsx(Dn,{value:"false",children:"false"})]})]})]},D);const G=K.type==="int"||K.type==="float"?"number":"text",L=K.type==="float"?"any":void 0,Y=D==="default_agent"&&f?f.map(H=>H.name):void 0,k=Y?`datalist-${D}`:void 0;return p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsx(mt,{className:"text-xs font-mono",children:D}),K.description&&p.jsx("p",{className:"text-xs text-muted-foreground",children:K.description}),p.jsx(Ze,{type:G,step:L,list:k,value:z!=null?String(z):"",onChange:H=>w(q=>({...q,[D]:G==="number"&&H.target.value!==""?Number(H.target.value):H.target.value})),placeholder:I!=null?String(I):void 0,className:"h-8 text-xs font-mono"}),Y&&p.jsx("datalist",{id:k,children:Y.map(H=>p.jsx("option",{value:H},H))}),D==="default_agent"&&P&&p.jsx("p",{className:"text-xs text-destructive",children:P})]},D)})]})]}),p.jsxs(Ee,{size:"sm",onClick:R,disabled:m.isPending||!!P,className:"self-start",children:[p.jsx(bB,{className:"mr-2 h-3.5 w-3.5"}),m.isPending?"Saving...":"Save Configuration"]})]})}function ZB({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:a}){var P,R;const i=WB(),s=eie(),c=tie(),u=QB(a??0),d=aie(a??0),m=iie(a??0),f=a?u:i,v=a?d:s,g=a?m:c,[b,w]=x.useState(!1),S=v.isPending||g.isPending||f.isPending;if(!e)return null;const E=()=>{if(!b){w(!0);return}f.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?(wt.success(`Uninstalled ${e.name}`),r(!1)):wt.error(`Uninstall failed: ${D.stderr||D.stdout}`),w(!1)},onError:()=>{wt.error("Uninstall request failed"),w(!1)}})},O=()=>{v.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?wt.success(`Updated ${e.name}`):wt.error(`Update failed: ${D.stderr||D.stdout}`)},onError:()=>wt.error("Update request failed")})},j=()=>{g.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?wt.success(`Reinstalled ${e.name}`):wt.error(`Reinstall failed: ${D.stderr||D.stdout}`)},onError:()=>wt.error("Reinstall request failed")})},N=!a&&((P={skills:["denden"],roles:["ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:P.includes(e.name)),T=(R=e.frontmatter)==null?void 0:R.metadata;return p.jsx(sie,{open:n,onOpenChange:D=>{r(D),w(!1)},children:p.jsxs(uie,{side:"right",className:"flex h-full flex-col sm:max-w-lg",children:[p.jsxs(die,{className:"shrink-0",children:[p.jsxs(fie,{className:"flex items-center gap-2",children:[e.name,e.version&&p.jsxs(qt,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),p.jsx(hie,{children:e.description||"No description"})]}),p.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[p.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[p.jsxs("span",{children:["Source: ",p.jsx("strong",{children:e.source})]}),p.jsxs("span",{children:["Path: ",p.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]})]}),T&&Object.keys(T).length>0&&p.jsxs("details",{className:"text-sm",children:[p.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"Metadata"}),p.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(T,null,2)})]})]}),p.jsxs(Rm,{className:"min-h-0 flex-1 px-4",children:[t==="agents"&&p.jsx(pie,{agentName:e.name}),p.jsx(vie,{resourceType:t,resourceName:e.name,enabled:n,projectId:a}),p.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap mt-4",children:e.body||"No content."})]}),p.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[p.jsx(Ee,{size:"sm",onClick:O,disabled:S,children:v.isPending?"Updating...":"Update"}),p.jsx(Ee,{variant:"outline",size:"sm",onClick:j,disabled:S,children:g.isPending?"Reinstalling...":"Reinstall"}),p.jsx("div",{className:"flex-1"}),!N&&p.jsxs(p.Fragment,{children:[p.jsx(Ee,{variant:b?"destructive":"outline",size:"sm",onClick:E,disabled:S,children:f.isPending?"Uninstalling...":b?"Confirm Uninstall":"Uninstall"}),b&&!f.isPending&&p.jsx(Ee,{variant:"ghost",size:"sm",onClick:()=>w(!1),children:"Cancel"})]})]})]})})}const gie=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function jC({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[a,i]=x.useState(n??"roles"),[s,c]=x.useState(""),[u,d]=x.useState(null),[m,f]=x.useState(null);x.useEffect(()=>{e&&n&&i(n)},[e,n]);const v=Jae(),g=rie(r??0),b=r?g:v,w=(u==null?void 0:u.status)==="success",S=()=>{s.trim()&&(d(null),f(null),b.mutate({type:a,name:s.trim()},{onSuccess:O=>{O.exit_code===0?(wt.success(`Installed ${s.trim()}`),d({status:"success",message:`Successfully installed ${s.trim()}`}),f(O.stdout||null)):(d({status:"error",message:"Installation failed"}),f(O.stderr||O.stdout||"Unknown error."))},onError:()=>{d({status:"error",message:"Install request failed"}),wt.error("Install request failed")}}))},E=O=>{O||(d(null),f(null),c("")),t(O)};return p.jsx(El,{open:e,onOpenChange:E,children:p.jsxs(_l,{className:"sm:max-w-md",children:[p.jsxs(jl,{children:[p.jsx(Cl,{children:r?"Install Resource to Project":"Install Resource"}),p.jsx(UB,{children:"Install a resource from StrawHub by name."})]}),p.jsxs("div",{className:"flex flex-col gap-4",children:[u&&p.jsxs(vg,{variant:u.status==="error"?"destructive":"default",className:u.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[u.status==="success"?p.jsx(dC,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):p.jsx(mB,{className:"h-4 w-4"}),p.jsx(gg,{children:u.status==="success"?"Installed":"Error"}),p.jsx(yg,{children:u.message})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(mt,{htmlFor:"install-type",children:"Type"}),p.jsxs(zi,{value:a,onValueChange:i,disabled:w,children:[p.jsx(Bi,{id:"install-type",children:p.jsx($i,{})}),p.jsx(Ui,{children:gie.map(O=>p.jsx(Dn,{value:O.value,children:O.label},O.value))})]})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(mt,{htmlFor:"install-name",children:"Package Name"}),p.jsx(Ze,{id:"install-name",autoFocus:!0,value:s,onChange:O=>c(O.target.value),placeholder:"e.g. strawpot-claude-code",readOnly:w,onKeyDown:O=>{O.key==="Enter"&&S()}})]}),m&&p.jsxs("details",{className:"text-sm",children:[p.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),p.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:m})]})]}),p.jsx(BB,{children:(u==null?void 0:u.status)==="success"?p.jsx(Ee,{onClick:()=>E(!1),children:"Done"}):p.jsx(Ee,{onClick:S,disabled:!s.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const yie={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function xie({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:a}=GB(e),[i,s]=x.useState(null),[c,u]=x.useState(""),[d,m]=x.useState(!1),[f,v]=x.useState(!1),g=t??f,b=n??v,{data:w}=qae(e,c,i??"",{enabled:d&&!!i&&!!c});return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("p",{className:"text-sm text-muted-foreground",children:"Resources installed to this project"}),p.jsxs(Ee,{onClick:()=>b(!0),size:"sm",children:[p.jsx(y0,{className:"mr-2 h-4 w-4"}),"Install"]})]}),a?p.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((S,E)=>p.jsx(cn,{className:"h-12 w-full"},E))}):!r||r.length===0?p.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No project resources installed yet."}):p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Name"}),p.jsx(Ye,{children:"Type"}),p.jsx(Ye,{children:"Version"}),p.jsx(Ye,{children:"Description"}),p.jsx(Ye,{className:"w-24"})]})}),p.jsx(Ho,{children:r.map(S=>p.jsxs(Rn,{className:"cursor-pointer",onClick:()=>{s(S.name),u(S.type),m(!0)},children:[p.jsx(Ve,{className:"font-medium",children:S.name}),p.jsx(Ve,{children:p.jsx(qt,{variant:"outline",className:"text-xs",children:yie[S.type]??S.type})}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:S.version??"—"}),p.jsx(Ve,{className:"max-w-[300px] truncate text-sm",children:S.description||"—"}),p.jsx(Ve,{children:p.jsx(bie,{projectId:e,resourceType:S.type,name:S.name})})]},`${S.type}-${S.name}`))})]})})}),p.jsx(ZB,{resource:w??null,resourceType:c,open:d,onOpenChange:m,projectId:e}),p.jsx(jC,{open:g,onOpenChange:b,projectId:e})]})}function bie({projectId:e,resourceType:t,name:n}){const[r,a]=x.useState(!1),i=QB(e),s=c=>{c.stopPropagation(),i.mutate({type:t,name:n},{onSuccess:u=>{u.exit_code===0?wt.success(`Uninstalled ${n}`):wt.error(`Uninstall failed: ${u.stderr||u.stdout}`),a(!1)},onError:()=>{wt.error("Uninstall request failed"),a(!1)}})};return r?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Ee,{size:"sm",variant:"destructive",onClick:s,disabled:i.isPending,children:"Confirm"}),p.jsx(Ee,{size:"sm",variant:"outline",onClick:c=>{c.stopPropagation(),a(!1)},children:"No"})]}):p.jsx(Ee,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:c=>{c.stopPropagation(),a(!0)},children:p.jsx(Sl,{className:"h-4 w-4"})})}function wie(e,t="30d"){return mn({queryKey:Be.projects.stats(e,t),queryFn:()=>ze.get(`/projects/${e}/stats?period=${t}`)})}var Sie=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function CC(e){if(typeof e!="string")return!1;var t=Sie;return t.includes(e)}var Eie=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],_ie=new Set(Eie);function JB(e){return typeof e!="string"?!1:_ie.has(e)}function e8(e){return typeof e=="string"&&e.startsWith("data-")}function ha(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(JB(n)||e8(n))&&(t[n]=e[n]);return t}function Rc(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return ha(t)}return typeof e=="object"&&!Array.isArray(e)?ha(e):null}function Nr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(JB(n)||e8(n)||CC(n))&&(t[n]=e[n]);return t}function jie(e){return e==null?null:x.isValidElement(e)?Nr(e.props):typeof e=="object"&&!Array.isArray(e)?Nr(e):null}var Cie=["children","width","height","viewBox","className","style","title","desc"];function KE(){return KE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KE.apply(null,arguments)}function Oie(e,t){if(e==null)return{};var n,r,a=Aie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Aie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var OC=x.forwardRef((e,t)=>{var{children:n,width:r,height:a,viewBox:i,className:s,style:c,title:u,desc:d}=e,m=Oie(e,Cie),f=i||{width:r,height:a,x:0,y:0},v=dt("recharts-surface",s);return x.createElement("svg",KE({},Nr(m),{className:v,width:r,height:a,style:c,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),x.createElement("title",null,u),x.createElement("desc",null,d),n)}),Nie=["children","className"];function VE(){return VE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VE.apply(null,arguments)}function Tie(e,t){if(e==null)return{};var n,r,a=Pie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Pie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var In=x.forwardRef((e,t)=>{var{children:n,className:r}=e,a=Tie(e,Nie),i=dt("recharts-layer",r);return x.createElement("g",VE({className:i},Nr(a),{ref:t}),n)}),t8=x.createContext(null),Mie=()=>x.useContext(t8);function zt(e){return function(){return e}}const n8=Math.cos,Fg=Math.sin,mi=Math.sqrt,qg=Math.PI,E0=2*qg,YE=Math.PI,GE=2*YE,rc=1e-6,kie=GE-rc;function r8(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Rie(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return r8;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class Die{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?r8:Rie(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,i,s){this._append`C${+t},${+n},${+r},${+a},${this._x1=+i},${this._y1=+s}`}arcTo(t,n,r,a,i){if(t=+t,n=+n,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,c=this._y1,u=r-t,d=a-n,m=s-t,f=c-n,v=m*m+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(v>rc)if(!(Math.abs(f*u-d*m)>rc)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-s,b=a-c,w=u*u+d*d,S=g*g+b*b,E=Math.sqrt(w),O=Math.sqrt(v),j=i*Math.tan((YE-Math.acos((w+v-S)/(2*E*O)))/2),A=j/O,N=j/E;Math.abs(A-1)>rc&&this._append`L${t+A*m},${n+A*f}`,this._append`A${i},${i},0,0,${+(f*g>m*b)},${this._x1=t+N*u},${this._y1=n+N*d}`}}arc(t,n,r,a,i,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(a),u=r*Math.sin(a),d=t+c,m=n+u,f=1^s,v=s?a-i:i-a;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>rc||Math.abs(this._y1-m)>rc)&&this._append`L${d},${m}`,r&&(v<0&&(v=v%GE+GE),v>kie?this._append`A${r},${r},0,1,${f},${t-c},${n-u}A${r},${r},0,1,${f},${this._x1=d},${this._y1=m}`:v>rc&&this._append`A${r},${r},0,${+(v>=YE)},${f},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function AC(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Die(t)}function NC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function a8(e){this._context=e}a8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function _0(e){return new a8(e)}function i8(e){return e[0]}function o8(e){return e[1]}function s8(e,t){var n=zt(!0),r=null,a=_0,i=null,s=AC(c);e=typeof e=="function"?e:e===void 0?i8:zt(e),t=typeof t=="function"?t:t===void 0?o8:zt(t);function c(u){var d,m=(u=NC(u)).length,f,v=!1,g;for(r==null&&(i=a(g=s())),d=0;d<=m;++d)!(d<m&&n(f=u[d],d,u))===v&&((v=!v)?i.lineStart():i.lineEnd()),v&&i.point(+e(f,d,u),+t(f,d,u));if(g)return i=null,g+""||null}return c.x=function(u){return arguments.length?(e=typeof u=="function"?u:zt(+u),c):e},c.y=function(u){return arguments.length?(t=typeof u=="function"?u:zt(+u),c):t},c.defined=function(u){return arguments.length?(n=typeof u=="function"?u:zt(!!u),c):n},c.curve=function(u){return arguments.length?(a=u,r!=null&&(i=a(r)),c):a},c.context=function(u){return arguments.length?(u==null?r=i=null:i=a(r=u),c):r},c}function Bv(e,t,n){var r=null,a=zt(!0),i=null,s=_0,c=null,u=AC(d);e=typeof e=="function"?e:e===void 0?i8:zt(+e),t=typeof t=="function"?t:zt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?o8:zt(+n);function d(f){var v,g,b,w=(f=NC(f)).length,S,E=!1,O,j=new Array(w),A=new Array(w);for(i==null&&(c=s(O=u())),v=0;v<=w;++v){if(!(v<w&&a(S=f[v],v,f))===E)if(E=!E)g=v,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),b=v-1;b>=g;--b)c.point(j[b],A[b]);c.lineEnd(),c.areaEnd()}E&&(j[v]=+e(S,v,f),A[v]=+t(S,v,f),c.point(r?+r(S,v,f):j[v],n?+n(S,v,f):A[v]))}if(O)return c=null,O+""||null}function m(){return s8().defined(a).curve(s).context(i)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:zt(+f),r=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:zt(+f),d):e},d.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:zt(+f),d):r},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:zt(+f),n=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:zt(+f),d):t},d.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:zt(+f),d):n},d.lineX0=d.lineY0=function(){return m().x(e).y(t)},d.lineY1=function(){return m().x(e).y(n)},d.lineX1=function(){return m().x(r).y(t)},d.defined=function(f){return arguments.length?(a=typeof f=="function"?f:zt(!!f),d):a},d.curve=function(f){return arguments.length?(s=f,i!=null&&(c=s(i)),d):s},d.context=function(f){return arguments.length?(f==null?i=c=null:c=s(i=f),d):i},d}class l8{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Iie(e){return new l8(e,!0)}function Lie(e){return new l8(e,!1)}const TC={draw(e,t){const n=mi(t/qg);e.moveTo(n,0),e.arc(0,0,n,0,E0)}},zie={draw(e,t){const n=mi(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},c8=mi(1/3),$ie=c8*2,Bie={draw(e,t){const n=mi(t/$ie),r=n*c8;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Uie={draw(e,t){const n=mi(t),r=-n/2;e.rect(r,r,n,n)}},Hie=.8908130915292852,u8=Fg(qg/10)/Fg(7*qg/10),Fie=Fg(E0/10)*u8,qie=-n8(E0/10)*u8,Kie={draw(e,t){const n=mi(t*Hie),r=Fie*n,a=qie*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const s=E0*i/5,c=n8(s),u=Fg(s);e.lineTo(u*n,-c*n),e.lineTo(c*r-u*a,u*r+c*a)}e.closePath()}},f1=mi(3),Vie={draw(e,t){const n=-mi(t/(f1*3));e.moveTo(0,n*2),e.lineTo(-f1*n,-n),e.lineTo(f1*n,-n),e.closePath()}},Oa=-.5,Aa=mi(3)/2,XE=1/mi(12),Yie=(XE/2+1)*3,Gie={draw(e,t){const n=mi(t/Yie),r=n/2,a=n*XE,i=r,s=n*XE+n,c=-i,u=s;e.moveTo(r,a),e.lineTo(i,s),e.lineTo(c,u),e.lineTo(Oa*r-Aa*a,Aa*r+Oa*a),e.lineTo(Oa*i-Aa*s,Aa*i+Oa*s),e.lineTo(Oa*c-Aa*u,Aa*c+Oa*u),e.lineTo(Oa*r+Aa*a,Oa*a-Aa*r),e.lineTo(Oa*i+Aa*s,Oa*s-Aa*i),e.lineTo(Oa*c+Aa*u,Oa*u-Aa*c),e.closePath()}};function Xie(e,t){let n=null,r=AC(a);e=typeof e=="function"?e:zt(e||TC),t=typeof t=="function"?t:zt(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:zt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:zt(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function Kg(){}function Vg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function d8(e){this._context=e}d8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Vg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Vg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Wie(e){return new d8(e)}function f8(e){this._context=e}f8.prototype={areaStart:Kg,areaEnd:Kg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Vg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Qie(e){return new f8(e)}function h8(e){this._context=e}h8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Vg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Zie(e){return new h8(e)}function m8(e){this._context=e}m8.prototype={areaStart:Kg,areaEnd:Kg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Jie(e){return new m8(e)}function rk(e){return e<0?-1:1}function ak(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),s=(n-e._y1)/(a||r<0&&-0),c=(i*a+s*r)/(r+a);return(rk(i)+rk(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(c))||0}function ik(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function h1(e,t,n){var r=e._x0,a=e._y0,i=e._x1,s=e._y1,c=(i-r)/3;e._context.bezierCurveTo(r+c,a+c*t,i-c,s-c*n,i,s)}function Yg(e){this._context=e}Yg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:h1(this,this._t0,ik(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,h1(this,ik(this,n=ak(this,e,t)),n);break;default:h1(this,this._t0,n=ak(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function p8(e){this._context=new v8(e)}(p8.prototype=Object.create(Yg.prototype)).point=function(e,t){Yg.prototype.point.call(this,t,e)};function v8(e){this._context=e}v8.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function eoe(e){return new Yg(e)}function toe(e){return new p8(e)}function g8(e){this._context=e}g8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=ok(e),a=ok(t),i=0,s=1;s<n;++i,++s)this._context.bezierCurveTo(r[0][i],a[0][i],r[1][i],a[1][i],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function ok(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),s=new Array(n);for(a[0]=0,i[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,s[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,s[t]-=r*s[t-1];for(a[n-1]=s[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(s[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function noe(e){return new g8(e)}function j0(e,t){this._context=e,this._t=t}j0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function roe(e){return new j0(e,.5)}function aoe(e){return new j0(e,0)}function ioe(e){return new j0(e,1)}function Dc(e,t){if((s=e.length)>1)for(var n=1,r,a,i=e[t[0]],s,c=i.length;n<s;++n)for(a=i,i=e[t[n]],r=0;r<c;++r)i[r][1]+=i[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function WE(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ooe(e,t){return e[t]}function soe(e){const t=[];return t.key=e,t}function loe(){var e=zt([]),t=WE,n=Dc,r=ooe;function a(i){var s=Array.from(e.apply(this,arguments),soe),c,u=s.length,d=-1,m;for(const f of i)for(c=0,++d;c<u;++c)(s[c][d]=[0,+r(f,s[c].key,d,i)]).data=f;for(c=0,m=NC(t(s));c<u;++c)s[m[c]].index=c;return n(s,m),s}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:zt(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:zt(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?WE:typeof i=="function"?i:zt(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Dc,a):n},a}function coe(e,t){if((r=e.length)>0){for(var n,r,a=0,i=e[0].length,s;a<i;++a){for(s=n=0;n<r;++n)s+=e[n][a][1]||0;if(s)for(n=0;n<r;++n)e[n][a][1]/=s}Dc(e,t)}}function uoe(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,i=r.length;n<i;++n){for(var s=0,c=0;s<a;++s)c+=e[s][n][1]||0;r[n][1]+=r[n][0]=-c/2}Dc(e,t)}}function doe(e,t){if(!(!((s=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,s;r<i;++r){for(var c=0,u=0,d=0;c<s;++c){for(var m=e[t[c]],f=m[r][1]||0,v=m[r-1][1]||0,g=(f-v)/2,b=0;b<c;++b){var w=e[t[b]],S=w[r][1]||0,E=w[r-1][1]||0;g+=S-E}u+=f,d+=g*f}a[r-1][1]+=a[r-1][0]=n,u&&(n-=d/u)}a[r-1][1]+=a[r-1][0]=n,Dc(e,t)}}var m1={},p1={},sk;function foe(){return sk||(sk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(p1)),p1}var v1={},lk;function y8(){return lk||(lk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(v1)),v1}var g1={},ck;function PC(){return ck||(ck=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var r;return typeof n=="string"||typeof n=="symbol"?n:Object.is((r=n==null?void 0:n.valueOf)==null?void 0:r.call(n),-0)?"-0":String(n)}e.toKey=t})(g1)),g1}var y1={},x1={},uk;function hoe(){return uk||(uk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(x1)),x1}var dk;function MC(){return dk||(dk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hoe(),n=PC();function r(a){if(Array.isArray(a))return a.map(n.toKey);if(typeof a=="symbol")return[a];a=t.toString(a);const i=[],s=a.length;if(s===0)return i;let c=0,u="",d="",m=!1;for(a.charCodeAt(0)===46&&(i.push(""),c++);c<s;){const f=a[c];d?f==="\\"&&c+1<s?(c++,u+=a[c]):f===d?d="":u+=f:m?f==='"'||f==="'"?d=f:f==="]"?(m=!1,i.push(u),u=""):u+=f:f==="["?(m=!0,u&&(i.push(u),u="")):f==="."?u&&(i.push(u),u=""):u+=f,c++}return u&&i.push(u),i}e.toPath=r})(y1)),y1}var fk;function kC(){return fk||(fk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=foe(),n=y8(),r=PC(),a=MC();function i(c,u,d){if(c==null)return d;switch(typeof u){case"string":{if(t.isUnsafeProperty(u))return d;const m=c[u];return m===void 0?n.isDeepKey(u)?i(c,a.toPath(u),d):d:m}case"number":case"symbol":{typeof u=="number"&&(u=r.toKey(u));const m=c[u];return m===void 0?d:m}default:{if(Array.isArray(u))return s(c,u,d);if(Object.is(u==null?void 0:u.valueOf(),-0)?u="-0":u=String(u),t.isUnsafeProperty(u))return d;const m=c[u];return m===void 0?d:m}}}function s(c,u,d){if(u.length===0)return d;let m=c;for(let f=0;f<u.length;f++){if(m==null||t.isUnsafeProperty(u[f]))return d;m=m[u[f]]}return m===void 0?d:m}e.get=i})(m1)),m1}var b1,hk;function moe(){return hk||(hk=1,b1=kC().get),b1}var poe=moe();const Ic=ci(poe);var voe=4;function rl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:voe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function an(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((a,i,s)=>{var c=n[s-1];return typeof c=="string"?a+c+i:c!==void 0?a+rl(c)+i:a+i},"")}var Vn=e=>e===0?0:e>0?1:-1,Hi=e=>typeof e=="number"&&e!=+e,Lc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Oe=e=>(typeof e=="number"||e instanceof Number)&&!Hi(e),Fi=e=>Oe(e)||typeof e=="string",goe=0,Vh=e=>{var t=++goe;return"".concat(e||"").concat(t)},yr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Oe(t)&&typeof t!="string")return r;var i;if(Lc(t)){if(n==null)return r;var s=t.indexOf("%");i=n*parseFloat(t.slice(0,s))/100}else i=+t;return Hi(i)&&(i=r),a&&n!=null&&i>n&&(i=n),i},x8=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Vt(e,t,n){return Oe(e)&&Oe(t)?rl(e+n*(t-e)):t}function b8(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Ic(r,t))===n)}var Wt=e=>e===null||typeof e>"u",Dm=e=>Wt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Vr(e){return e!=null}function Ol(){}var yoe=["type","size","sizeType"];function QE(){return QE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QE.apply(null,arguments)}function mk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mk(Object(n),!0).forEach(function(r){xoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xoe(e,t,n){return(t=boe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function boe(e){var t=woe(e,"string");return typeof t=="symbol"?t:t+""}function woe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Soe(e,t){if(e==null)return{};var n,r,a=Eoe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Eoe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var w8={symbolCircle:TC,symbolCross:zie,symbolDiamond:Bie,symbolSquare:Uie,symbolStar:Kie,symbolTriangle:Vie,symbolWye:Gie},_oe=Math.PI/180,joe=e=>{var t="symbol".concat(Dm(e));return w8[t]||TC},Coe=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*_oe;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Ooe=(e,t)=>{w8["symbol".concat(Dm(e))]=t},RC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,a=Soe(e,yoe),i=pk(pk({},a),{},{type:t,size:n,sizeType:r}),s="circle";typeof t=="string"&&(s=t);var c=()=>{var v=joe(s),g=Xie().type(v).size(Coe(n,r,s)),b=g();if(b!==null)return b},{className:u,cx:d,cy:m}=i,f=Nr(i);return Oe(d)&&Oe(m)&&Oe(n)?x.createElement("path",QE({},f,{className:dt("recharts-symbols",u),transform:"translate(".concat(d,", ").concat(m,")"),d:c()})):null};RC.registerSymbol=Ooe;var S8=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,DC=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(a=>{CC(a)&&typeof n[a]=="function"&&(r[a]=(i=>n[a](n,i)))}),r},Aoe=(e,t,n)=>r=>(e(t,n,r),null),Im=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(a=>{var i=e[a];CC(a)&&typeof i=="function"&&(r||(r={}),r[a]=Aoe(i,t,n))}),r};function vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Noe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vk(Object(n),!0).forEach(function(r){Toe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Toe(e,t,n){return(t=Poe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Poe(e){var t=Moe(e,"string");return typeof t=="symbol"?t:t+""}function Moe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cn(e,t){var n=Noe({},e),r=t,a=Object.keys(t),i=a.reduce((s,c)=>(s[c]===void 0&&r[c]!==void 0&&(s[c]=r[c]),s),n);return i}function Gg(){return Gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gg.apply(null,arguments)}function gk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function E8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gk(Object(n),!0).forEach(function(r){koe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function koe(e,t,n){return(t=Roe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Roe(e){var t=Doe(e,"string");return typeof t=="symbol"?t:t+""}function Doe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ta=32,Ioe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Loe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function zoe(e){var{data:t,iconType:n,inactiveColor:r}=e,a=Ta/2,i=Ta/6,s=Ta/3,c=t.inactive?r:t.color,u=n??t.type;if(u==="none")return null;if(u==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:Loe(t.payload),x1:0,y1:a,x2:Ta,y2:a,className:"recharts-legend-icon"});if(u==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(s,`
            A`).concat(i,",").concat(i,",0,1,1,").concat(2*s,",").concat(a,`
            H`).concat(Ta,"M").concat(2*s,",").concat(a,`
            A`).concat(i,",").concat(i,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(u==="rect")return x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Ta/8,"h").concat(Ta,"v").concat(Ta*3/4,"h").concat(-Ta,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var d=E8({},t);return delete d.legendIcon,x.cloneElement(t.legendIcon,d)}return x.createElement(RC,{fill:c,cx:a,cy:a,size:Ta,sizeType:"diameter",type:u})}function $oe(e){var{payload:t,iconSize:n,layout:r,formatter:a,inactiveColor:i,iconType:s,labelStyle:c}=e,u={x:0,y:0,width:Ta,height:Ta},d={display:r==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((f,v)=>{var g=f.formatter||a,b=dt({"recharts-legend-item":!0,["legend-item-".concat(v)]:!0,inactive:f.inactive});if(f.type==="none")return null;var w=typeof c=="object"?E8({},c):{};w.color=f.inactive?i:w.color||f.color;var S=g?g(f.value,f,v):f.value;return x.createElement("li",Gg({className:b,style:d,key:"legend-item-".concat(v)},Im(e,f,v)),x.createElement(OC,{width:n,height:n,viewBox:u,style:m,"aria-label":"".concat(S," legend icon")},x.createElement(zoe,{data:f,iconType:s,inactiveColor:i})),x.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var Boe=e=>{var t=Cn(e,Ioe),{payload:n,layout:r,align:a}=t;if(!n||!n.length)return null;var i={padding:0,margin:0,textAlign:r==="horizontal"?a:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:i},x.createElement($oe,Gg({},t,{payload:n})))},w1={},S1={},yk;function Uoe(){return yk||(yk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const a=new Map;for(let i=0;i<n.length;i++){const s=n[i],c=r(s,i,n);a.has(c)||a.set(c,s)}return Array.from(a.values())}e.uniqBy=t})(S1)),S1}var E1={},xk;function Hoe(){return xk||(xk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...a){return n.apply(this,a.slice(0,r))}}e.ary=t})(E1)),E1}var _1={},bk;function _8(){return bk||(bk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(_1)),_1}var j1={},C1={},O1={},wk;function Foe(){return wk||(wk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(O1)),O1}var Sk;function j8(){return Sk||(Sk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Foe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(C1)),C1}var A1={},Ek;function qoe(){return Ek||(Ek=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(A1)),A1}var _k;function Koe(){return _k||(_k=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=j8(),n=qoe();function r(a){return n.isObjectLike(a)&&t.isArrayLike(a)}e.isArrayLikeObject=r})(j1)),j1}var N1={},T1={},jk;function Voe(){return jk||(jk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kC();function n(r){return function(a){return t.get(a,r)}}e.property=n})(T1)),T1}var P1={},M1={},k1={},R1={},Ck;function C8(){return Ck||(Ck=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(R1)),R1}var D1={},Ok;function O8(){return Ok||(Ok=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(D1)),D1}var I1={},Ak;function A8(){return Ak||(Ak=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(I1)),I1}var Nk;function Yoe(){return Nk||(Nk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=C8(),n=O8(),r=A8();function a(m,f,v){return typeof v!="function"?a(m,f,()=>{}):i(m,f,function g(b,w,S,E,O,j){const A=v(b,w,S,E,O,j);return A!==void 0?!!A:i(b,w,g,j)},new Map)}function i(m,f,v,g){if(f===m)return!0;switch(typeof f){case"object":return s(m,f,v,g);case"function":return Object.keys(f).length>0?i(m,{...f},v,g):r.isEqualsSameValueZero(m,f);default:return t.isObject(m)?typeof f=="string"?f==="":!0:r.isEqualsSameValueZero(m,f)}}function s(m,f,v,g){if(f==null)return!0;if(Array.isArray(f))return u(m,f,v,g);if(f instanceof Map)return c(m,f,v,g);if(f instanceof Set)return d(m,f,v,g);const b=Object.keys(f);if(m==null||n.isPrimitive(m))return b.length===0;if(b.length===0)return!0;if(g!=null&&g.has(f))return g.get(f)===m;g==null||g.set(f,m);try{for(let w=0;w<b.length;w++){const S=b[w];if(!n.isPrimitive(m)&&!(S in m)||f[S]===void 0&&m[S]!==void 0||f[S]===null&&m[S]!==null||!v(m[S],f[S],S,m,f,g))return!1}return!0}finally{g==null||g.delete(f)}}function c(m,f,v,g){if(f.size===0)return!0;if(!(m instanceof Map))return!1;for(const[b,w]of f.entries()){const S=m.get(b);if(v(S,w,b,m,f,g)===!1)return!1}return!0}function u(m,f,v,g){if(f.length===0)return!0;if(!Array.isArray(m))return!1;const b=new Set;for(let w=0;w<f.length;w++){const S=f[w];let E=!1;for(let O=0;O<m.length;O++){if(b.has(O))continue;const j=m[O];let A=!1;if(v(j,S,w,m,f,g)&&(A=!0),A){b.add(O),E=!0;break}}if(!E)return!1}return!0}function d(m,f,v,g){return f.size===0?!0:m instanceof Set?u([...m],[...f],v,g):!1}e.isMatchWith=a,e.isSetMatch=d})(k1)),k1}var Tk;function N8(){return Tk||(Tk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yoe();function n(r,a){return t.isMatchWith(r,a,()=>{})}e.isMatch=n})(M1)),M1}var L1={},z1={},$1={},Pk;function Goe(){return Pk||(Pk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})($1)),$1}var B1={},Mk;function IC(){return Mk||(Mk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(B1)),B1}var U1={},kk;function T8(){return kk||(kk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",a="[object Boolean]",i="[object Arguments]",s="[object Symbol]",c="[object Date]",u="[object Map]",d="[object Set]",m="[object Array]",f="[object Function]",v="[object ArrayBuffer]",g="[object Object]",b="[object Error]",w="[object DataView]",S="[object Uint8Array]",E="[object Uint8ClampedArray]",O="[object Uint16Array]",j="[object Uint32Array]",A="[object BigUint64Array]",N="[object Int8Array]",T="[object Int16Array]",P="[object Int32Array]",R="[object BigInt64Array]",D="[object Float32Array]",K="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=v,e.arrayTag=m,e.bigInt64ArrayTag=R,e.bigUint64ArrayTag=A,e.booleanTag=a,e.dataViewTag=w,e.dateTag=c,e.errorTag=b,e.float32ArrayTag=D,e.float64ArrayTag=K,e.functionTag=f,e.int16ArrayTag=T,e.int32ArrayTag=P,e.int8ArrayTag=N,e.mapTag=u,e.numberTag=r,e.objectTag=g,e.regexpTag=t,e.setTag=d,e.stringTag=n,e.symbolTag=s,e.uint16ArrayTag=O,e.uint32ArrayTag=j,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=E})(U1)),U1}var H1={},Rk;function Xoe(){return Rk||(Rk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(H1)),H1}var Dk;function P8(){return Dk||(Dk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Goe(),n=IC(),r=T8(),a=O8(),i=Xoe();function s(m,f){return c(m,void 0,m,new Map,f)}function c(m,f,v,g=new Map,b=void 0){const w=b==null?void 0:b(m,f,v,g);if(w!==void 0)return w;if(a.isPrimitive(m))return m;if(g.has(m))return g.get(m);if(Array.isArray(m)){const S=new Array(m.length);g.set(m,S);for(let E=0;E<m.length;E++)S[E]=c(m[E],E,v,g,b);return Object.hasOwn(m,"index")&&(S.index=m.index),Object.hasOwn(m,"input")&&(S.input=m.input),S}if(m instanceof Date)return new Date(m.getTime());if(m instanceof RegExp){const S=new RegExp(m.source,m.flags);return S.lastIndex=m.lastIndex,S}if(m instanceof Map){const S=new Map;g.set(m,S);for(const[E,O]of m)S.set(E,c(O,E,v,g,b));return S}if(m instanceof Set){const S=new Set;g.set(m,S);for(const E of m)S.add(c(E,void 0,v,g,b));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(m))return m.subarray();if(i.isTypedArray(m)){const S=new(Object.getPrototypeOf(m)).constructor(m.length);g.set(m,S);for(let E=0;E<m.length;E++)S[E]=c(m[E],E,v,g,b);return S}if(m instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer)return m.slice(0);if(m instanceof DataView){const S=new DataView(m.buffer.slice(0),m.byteOffset,m.byteLength);return g.set(m,S),u(S,m,v,g,b),S}if(typeof File<"u"&&m instanceof File){const S=new File([m],m.name,{type:m.type});return g.set(m,S),u(S,m,v,g,b),S}if(typeof Blob<"u"&&m instanceof Blob){const S=new Blob([m],{type:m.type});return g.set(m,S),u(S,m,v,g,b),S}if(m instanceof Error){const S=structuredClone(m);return g.set(m,S),S.message=m.message,S.name=m.name,S.stack=m.stack,S.cause=m.cause,S.constructor=m.constructor,u(S,m,v,g,b),S}if(m instanceof Boolean){const S=new Boolean(m.valueOf());return g.set(m,S),u(S,m,v,g,b),S}if(m instanceof Number){const S=new Number(m.valueOf());return g.set(m,S),u(S,m,v,g,b),S}if(m instanceof String){const S=new String(m.valueOf());return g.set(m,S),u(S,m,v,g,b),S}if(typeof m=="object"&&d(m)){const S=Object.create(Object.getPrototypeOf(m));return g.set(m,S),u(S,m,v,g,b),S}return m}function u(m,f,v=m,g,b){const w=[...Object.keys(f),...t.getSymbols(f)];for(let S=0;S<w.length;S++){const E=w[S],O=Object.getOwnPropertyDescriptor(m,E);(O==null||O.writable)&&(m[E]=c(f[E],E,v,g,b))}}function d(m){switch(n.getTag(m)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=c,e.copyProperties=u})(z1)),z1}var Ik;function Woe(){return Ik||(Ik=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P8();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(L1)),L1}var Lk;function Qoe(){return Lk||(Lk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N8(),n=Woe();function r(a){return a=n.cloneDeep(a),i=>t.isMatch(i,a)}e.matches=r})(P1)),P1}var F1={},q1={},K1={},zk;function Zoe(){return zk||(zk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P8(),n=IC(),r=T8();function a(i,s){return t.cloneDeepWith(i,(c,u,d,m)=>{const f=s==null?void 0:s(c,u,d,m);if(f!==void 0)return f;if(typeof i=="object"){if(n.getTag(i)===r.objectTag&&typeof i.constructor!="function"){const v={};return m.set(i,v),t.copyProperties(v,i,d,m),v}switch(Object.prototype.toString.call(i)){case r.numberTag:case r.stringTag:case r.booleanTag:{const v=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(v,i),v}case r.argumentsTag:{const v={};return t.copyProperties(v,i),v.length=i.length,v[Symbol.iterator]=i[Symbol.iterator],v}default:return}}})}e.cloneDeepWith=a})(K1)),K1}var $k;function Joe(){return $k||($k=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zoe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(q1)),q1}var V1={},Y1={},Bk;function M8(){return Bk||(Bk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,a=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<a;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(Y1)),Y1}var G1={},Uk;function ese(){return Uk||(Uk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(G1)),G1}var Hk;function tse(){return Hk||(Hk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=y8(),n=M8(),r=ese(),a=MC();function i(s,c){let u;if(Array.isArray(c)?u=c:typeof c=="string"&&t.isDeepKey(c)&&(s==null?void 0:s[c])==null?u=a.toPath(c):u=[c],u.length===0)return!1;let d=s;for(let m=0;m<u.length;m++){const f=u[m];if((d==null||!Object.hasOwn(d,f))&&!((Array.isArray(d)||r.isArguments(d))&&n.isIndex(f)&&f<d.length))return!1;d=d[f]}return!0}e.has=i})(V1)),V1}var Fk;function nse(){return Fk||(Fk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N8(),n=PC(),r=Joe(),a=kC(),i=tse();function s(c,u){switch(typeof c){case"object":{Object.is(c==null?void 0:c.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return u=r.cloneDeep(u),function(d){const m=a.get(d,c);return m===void 0?i.has(d,c):u===void 0?m===void 0:t.isMatch(m,u)}}e.matchesProperty=s})(F1)),F1}var qk;function rse(){return qk||(qk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_8(),n=Voe(),r=Qoe(),a=nse();function i(s){if(s==null)return t.identity;switch(typeof s){case"function":return s;case"object":return Array.isArray(s)&&s.length===2?a.matchesProperty(s[0],s[1]):r.matches(s);case"string":case"symbol":case"number":return n.property(s)}}e.iteratee=i})(N1)),N1}var Kk;function ase(){return Kk||(Kk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Uoe(),n=Hoe(),r=_8(),a=Koe(),i=rse();function s(c,u=r.identity){return a.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(i.iteratee(u),1)):[]}e.uniqBy=s})(w1)),w1}var X1,Vk;function ise(){return Vk||(Vk=1,X1=ase().uniqBy),X1}var ose=ise();const Yk=ci(ose);function k8(e,t,n){return t===!0?Yk(e,n):typeof t=="function"?Yk(e,t):e}var W1={exports:{}},Q1={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.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 Gk;function sse(){if(Gk)return Q1;Gk=1;var e=Fd(),t=vW();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Q1.useSyncExternalStoreWithSelector=function(d,m,f,v,g){var b=i(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=c(function(){function E(T){if(!O){if(O=!0,j=T,T=v(T),g!==void 0&&w.hasValue){var P=w.value;if(g(P,T))return A=P}return A=T}if(P=A,r(j,T))return P;var R=v(T);return g!==void 0&&g(P,R)?(j=T,P):(j=T,A=R)}var O=!1,j,A,N=f===void 0?null:f;return[function(){return E(m())},N===null?void 0:function(){return E(N())}]},[m,f,v,g]);var S=a(d,b[0],b[1]);return s(function(){w.hasValue=!0,w.value=S},[S]),u(S),S},Q1}var Xk;function lse(){return Xk||(Xk=1,W1.exports=sse()),W1.exports}var R8=lse();const cse=ci(R8);var LC=x.createContext(null),use=e=>e,kt=()=>{var e=x.useContext(LC);return e?e.store.dispatch:use},xg=()=>{},dse=()=>xg,fse=(e,t)=>e===t;function Te(e){var t=x.useContext(LC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:xg,[t,e]);return R8.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:dse,t?t.store.getState:xg,t?t.store.getState:xg,n,fse)}function hse(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function mse(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function pse(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Wk=e=>Array.isArray(e)?e:[e];function vse(e){const t=Array.isArray(e[0])?e[0]:e;return pse(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function gse(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}var yse=class{constructor(e){this.value=e}deref(){return this.value}},xse=typeof WeakRef<"u"?WeakRef:yse,bse=0,Qk=1;function Uv(){return{s:bse,v:void 0,o:null,p:null}}function D8(e,t={}){let n=Uv();const{resultEqualityCheck:r}=t;let a,i=0;function s(){var f;let c=n;const{length:u}=arguments;for(let v=0,g=u;v<g;v++){const b=arguments[v];if(typeof b=="function"||typeof b=="object"&&b!==null){let w=c.o;w===null&&(c.o=w=new WeakMap);const S=w.get(b);S===void 0?(c=Uv(),w.set(b,c)):c=S}else{let w=c.p;w===null&&(c.p=w=new Map);const S=w.get(b);S===void 0?(c=Uv(),w.set(b,c)):c=S}}const d=c;let m;if(c.s===Qk)m=c.v;else if(m=e.apply(null,arguments),i++,r){const v=((f=a==null?void 0:a.deref)==null?void 0:f.call(a))??a;v!=null&&r(v,m)&&(m=v,i!==0&&i--),a=typeof m=="object"&&m!==null||typeof m=="function"?new xse(m):m}return d.s=Qk,d.v=m,m}return s.clearCache=()=>{n=Uv(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function wse(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...a)=>{let i=0,s=0,c,u={},d=a.pop();typeof d=="object"&&(u=d,d=a.pop()),hse(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...u},{memoize:f,memoizeOptions:v=[],argsMemoize:g=D8,argsMemoizeOptions:b=[]}=m,w=Wk(v),S=Wk(b),E=vse(a),O=f(function(){return i++,d.apply(null,arguments)},...w),j=g(function(){s++;const N=gse(E,arguments);return c=O.apply(null,N),c},...S);return Object.assign(j,{resultFunc:d,memoizedResultFunc:O,dependencies:E,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>c,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var se=wse(D8),Sse=Object.assign((e,t=se)=>{mse(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(i=>e[i]);return t(r,(...i)=>i.reduce((s,c,u)=>(s[n[u]]=c,s),{}))},{withTypes:()=>Sse}),Z1={},J1={},eS={},Zk;function Ese(){return Zk||(Zk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,a,i)=>{if(r!==a){const s=t(r),c=t(a);if(s===c&&s===0){if(r<a)return i==="desc"?1:-1;if(r>a)return i==="desc"?-1:1}return i==="desc"?c-s:s-c}return 0};e.compareValues=n})(eS)),eS}var tS={},nS={},Jk;function I8(){return Jk||(Jk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(nS)),nS}var eR;function _se(){return eR||(eR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=I8(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,s){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||t.isSymbol(i)?!0:typeof i=="string"&&(r.test(i)||!n.test(i))||s!=null&&Object.hasOwn(s,i)}e.isKey=a})(tS)),tS}var tR;function jse(){return tR||(tR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ese(),n=_se(),r=MC();function a(i,s,c,u){if(i==null)return[];c=u?void 0:c,Array.isArray(i)||(i=Object.values(i)),Array.isArray(s)||(s=s==null?[null]:[s]),s.length===0&&(s=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(g=>String(g));const d=(g,b)=>{let w=g;for(let S=0;S<b.length&&w!=null;++S)w=w[b[S]];return w},m=(g,b)=>b==null||g==null?b:typeof g=="object"&&"key"in g?Object.hasOwn(b,g.key)?b[g.key]:d(b,g.path):typeof g=="function"?g(b):Array.isArray(g)?d(b,g):typeof b=="object"?b[g]:b,f=s.map(g=>(Array.isArray(g)&&g.length===1&&(g=g[0]),g==null||typeof g=="function"||Array.isArray(g)||n.isKey(g)?g:{key:g,path:r.toPath(g)}));return i.map(g=>({original:g,criteria:f.map(b=>m(b,g))})).slice().sort((g,b)=>{for(let w=0;w<f.length;w++){const S=t.compareValues(g.criteria[w],b.criteria[w],c[w]);if(S!==0)return S}return 0}).map(g=>g.original)}e.orderBy=a})(J1)),J1}var rS={},nR;function Cse(){return nR||(nR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const a=[],i=Math.floor(r),s=(c,u)=>{for(let d=0;d<c.length;d++){const m=c[d];Array.isArray(m)&&u<i?s(m,u+1):a.push(m)}};return s(n,0),a}e.flatten=t})(rS)),rS}var aS={},rR;function L8(){return rR||(rR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M8(),n=j8(),r=C8(),a=A8();function i(s,c,u){return r.isObject(u)&&(typeof c=="number"&&n.isArrayLike(u)&&t.isIndex(c)&&c<u.length||typeof c=="string"&&c in u)?a.isEqualsSameValueZero(u[c],s):!1}e.isIterateeCall=i})(aS)),aS}var aR;function Ose(){return aR||(aR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jse(),n=Cse(),r=L8();function a(i,...s){const c=s.length;return c>1&&r.isIterateeCall(i,s[0],s[1])?s=[]:c>2&&r.isIterateeCall(s[0],s[1],s[2])&&(s=[s[0]]),t.orderBy(i,n.flatten(s),["asc"])}e.sortBy=a})(Z1)),Z1}var iS,iR;function Ase(){return iR||(iR=1,iS=Ose().sortBy),iS}var Nse=Ase();const C0=ci(Nse);var z8=e=>e.legend.settings,Tse=e=>e.legend.size,Pse=e=>e.legend.payload,Mse=se([Pse,z8],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?C0(r,n):r});function kse(){return Te(Mse)}var Hv=1;function $8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(a=>{if(a!=null){var i=a.getBoundingClientRect(),s={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(s.height-t.height)>Hv||Math.abs(s.left-t.left)>Hv||Math.abs(s.top-t.top)>Hv||Math.abs(s.width-t.width)>Hv)&&n({height:s.height,left:s.left,top:s.top,width:s.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function tr(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Rse=typeof Symbol=="function"&&Symbol.observable||"@@observable",oR=Rse,oS=()=>Math.random().toString(36).substring(7).split("").join("."),Dse={INIT:`@@redux/INIT${oS()}`,REPLACE:`@@redux/REPLACE${oS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${oS()}`},Xg=Dse;function zC(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function B8(e,t,n){if(typeof e!="function")throw new Error(tr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(tr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(tr(1));return n(B8)(e,t)}let r=e,a=t,i=new Map,s=i,c=0,u=!1;function d(){s===i&&(s=new Map,i.forEach((S,E)=>{s.set(E,S)}))}function m(){if(u)throw new Error(tr(3));return a}function f(S){if(typeof S!="function")throw new Error(tr(4));if(u)throw new Error(tr(5));let E=!0;d();const O=c++;return s.set(O,S),function(){if(E){if(u)throw new Error(tr(6));E=!1,d(),s.delete(O),i=null}}}function v(S){if(!zC(S))throw new Error(tr(7));if(typeof S.type>"u")throw new Error(tr(8));if(typeof S.type!="string")throw new Error(tr(17));if(u)throw new Error(tr(9));try{u=!0,a=r(a,S)}finally{u=!1}return(i=s).forEach(O=>{O()}),S}function g(S){if(typeof S!="function")throw new Error(tr(10));r=S,v({type:Xg.REPLACE})}function b(){const S=f;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(tr(11));function O(){const A=E;A.next&&A.next(m())}return O(),{unsubscribe:S(O)}},[oR](){return this}}}return v({type:Xg.INIT}),{dispatch:v,subscribe:f,getState:m,replaceReducer:g,[oR]:b}}function Ise(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Xg.INIT})>"u")throw new Error(tr(12));if(typeof n(void 0,{type:Xg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(tr(13))})}function U8(e){const t=Object.keys(e),n={};for(let i=0;i<t.length;i++){const s=t[i];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let a;try{Ise(n)}catch(i){a=i}return function(s={},c){if(a)throw a;let u=!1;const d={};for(let m=0;m<r.length;m++){const f=r[m],v=n[f],g=s[f],b=v(g,c);if(typeof b>"u")throw c&&c.type,new Error(tr(14));d[f]=b,u=u||b!==g}return u=u||r.length!==Object.keys(s).length,u?d:s}}function Wg(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Lse(...e){return t=>(n,r)=>{const a=t(n,r);let i=()=>{throw new Error(tr(15))};const s={getState:a.getState,dispatch:(u,...d)=>i(u,...d)},c=e.map(u=>u(s));return i=Wg(...c)(a.dispatch),{...a,dispatch:i}}}function H8(e){return zC(e)&&"type"in e&&typeof e.type=="string"}var F8=Symbol.for("immer-nothing"),sR=Symbol.for("immer-draftable"),Tr=Symbol.for("immer-state");function ei(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ua=Object,Od=ua.getPrototypeOf,Qg="constructor",O0="prototype",ZE="configurable",Zg="enumerable",bg="writable",Yh="value",Fo=e=>!!e&&!!e[Tr];function li(e){var t;return e?q8(e)||N0(e)||!!e[sR]||!!((t=e[Qg])!=null&&t[sR])||T0(e)||P0(e):!1}var zse=ua[O0][Qg].toString(),lR=new WeakMap;function q8(e){if(!e||!$C(e))return!1;const t=Od(e);if(t===null||t===ua[O0])return!0;const n=ua.hasOwnProperty.call(t,Qg)&&t[Qg];if(n===Object)return!0;if(!Qu(n))return!1;let r=lR.get(n);return r===void 0&&(r=Function.toString.call(n),lR.set(n,r)),r===zse}function A0(e,t,n=!0){Lm(e)===0?(n?Reflect.ownKeys(e):ua.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((r,a)=>t(a,r,e))}function Lm(e){const t=e[Tr];return t?t.type_:N0(e)?1:T0(e)?2:P0(e)?3:0}var cR=(e,t,n=Lm(e))=>n===2?e.has(t):ua[O0].hasOwnProperty.call(e,t),JE=(e,t,n=Lm(e))=>n===2?e.get(t):e[t],Jg=(e,t,n,r=Lm(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function $se(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var N0=Array.isArray,T0=e=>e instanceof Map,P0=e=>e instanceof Set,$C=e=>typeof e=="object",Qu=e=>typeof e=="function",sS=e=>typeof e=="boolean";function Bse(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var wo=e=>e.copy_||e.base_,BC=e=>e.modified_?e.copy_:e.base_;function e_(e,t){if(T0(e))return new Map(e);if(P0(e))return new Set(e);if(N0(e))return Array[O0].slice.call(e);const n=q8(e);if(t===!0||t==="class_only"&&!n){const r=ua.getOwnPropertyDescriptors(e);delete r[Tr];let a=Reflect.ownKeys(r);for(let i=0;i<a.length;i++){const s=a[i],c=r[s];c[bg]===!1&&(c[bg]=!0,c[ZE]=!0),(c.get||c.set)&&(r[s]={[ZE]:!0,[bg]:!0,[Zg]:c[Zg],[Yh]:e[s]})}return ua.create(Od(e),r)}else{const r=Od(e);if(r!==null&&n)return{...e};const a=ua.create(r);return ua.assign(a,e)}}function UC(e,t=!1){return M0(e)||Fo(e)||!li(e)||(Lm(e)>1&&ua.defineProperties(e,{set:Fv,add:Fv,clear:Fv,delete:Fv}),ua.freeze(e),t&&A0(e,(n,r)=>{UC(r,!0)},!1)),e}function Use(){ei(2)}var Fv={[Yh]:Use};function M0(e){return e===null||!$C(e)?!0:ua.isFrozen(e)}var ey="MapSet",t_="Patches",uR="ArrayMethods",K8={};function zc(e){const t=K8[e];return t||ei(0,e),t}var dR=e=>!!K8[e],Gh,V8=()=>Gh,Hse=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:dR(ey)?zc(ey):void 0,arrayMethodsPlugin_:dR(uR)?zc(uR):void 0});function fR(e,t){t&&(e.patchPlugin_=zc(t_),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function n_(e){r_(e),e.drafts_.forEach(Fse),e.drafts_=null}function r_(e){e===Gh&&(Gh=e.parent_)}var hR=e=>Gh=Hse(Gh,e);function Fse(e){const t=e[Tr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function mR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Tr].modified_&&(n_(t),ei(4)),li(e)&&(e=pR(t,e));const{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(n[Tr].base_,e,t)}else e=pR(t,n);return qse(t,e,!0),n_(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==F8?e:void 0}function pR(e,t){if(M0(t))return t;const n=t[Tr];if(!n)return ty(t,e.handledSet_,e);if(!k0(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);X8(n,e)}return n.copy_}function qse(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&UC(t,n)}function Y8(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var k0=(e,t)=>e.scope_===t,Kse=[];function G8(e,t,n,r){const a=wo(e),i=e.type_;if(r!==void 0&&JE(a,r,i)===t){Jg(a,r,n,i);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;A0(a,(u,d)=>{if(Fo(d)){const m=c.get(d)||[];m.push(u),c.set(d,m)}})}const s=e.draftLocations_.get(t)??Kse;for(const c of s)Jg(a,c,n,i)}function Vse(e,t,n){e.callbacks_.push(function(a){var c;const i=t;if(!i||!k0(i,a))return;(c=a.mapSetPlugin_)==null||c.fixSetContents(i);const s=BC(i);G8(e,i.draft_??i,s,n),X8(i,a)})}function X8(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:a}=t;if(a){const i=a.getPath(e);i&&a.generatePatches_(e,i,t)}Y8(e)}}function Yse(e,t,n){const{scope_:r}=e;if(Fo(n)){const a=n[Tr];k0(a,r)&&a.callbacks_.push(function(){wg(e);const s=BC(a);G8(e,n,s,t)})}else li(n)&&e.callbacks_.push(function(){const i=wo(e);e.type_===3?i.has(n)&&ty(n,r.handledSet_,r):JE(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&ty(JE(e.copy_,t,e.type_),r.handledSet_,r)})}function ty(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Fo(e)||t.has(e)||!li(e)||M0(e)||(t.add(e),A0(e,(r,a)=>{if(Fo(a)){const i=a[Tr];if(k0(i,n)){const s=BC(i);Jg(e,r,s,e.type_),Y8(i)}}else li(a)&&ty(a,t,n)})),e}function Gse(e,t){const n=N0(e),r={type_:n?1:0,scope_:t?t.scope_:V8(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=r,i=ny;n&&(a=[r],i=Xh);const{revoke:s,proxy:c}=Proxy.revocable(a,i);return r.draft_=c,r.revoke_=s,[c,r]}var ny={get(e,t){if(t===Tr)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const a=wo(e);if(!cR(a,t,e.type_))return Xse(e,a,t);const i=a[t];if(e.finalized_||!li(i)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&Bse(t))return i;if(i===lS(e.base_,t)){wg(e);const s=e.type_===1?+t:t,c=i_(e.scope_,i,e,s);return e.copy_[s]=c}return i},has(e,t){return t in wo(e)},ownKeys(e){return Reflect.ownKeys(wo(e))},set(e,t,n){const r=W8(wo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=lS(wo(e),t),i=a==null?void 0:a[Tr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if($se(n,a)&&(n!==void 0||cR(e.base_,t,e.type_)))return!0;wg(e),a_(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Yse(e,t,n)),!0},deleteProperty(e,t){return wg(e),lS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),a_(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=wo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[bg]:!0,[ZE]:e.type_!==1||t!=="length",[Zg]:r[Zg],[Yh]:n[t]}},defineProperty(){ei(11)},getPrototypeOf(e){return Od(e.base_)},setPrototypeOf(){ei(12)}},Xh={};for(let e in ny){let t=ny[e];Xh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Xh.deleteProperty=function(e,t){return Xh.set.call(this,e,t,void 0)};Xh.set=function(e,t,n){return ny.set.call(this,e[0],t,n,e[0])};function lS(e,t){const n=e[Tr];return(n?wo(n):e)[t]}function Xse(e,t,n){var a;const r=W8(t,n);return r?Yh in r?r[Yh]:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function W8(e,t){if(!(t in e))return;let n=Od(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Od(n)}}function a_(e){e.modified_||(e.modified_=!0,e.parent_&&a_(e.parent_))}function wg(e){e.copy_||(e.assigned_=new Map,e.copy_=e_(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Wse=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,a)=>{if(Qu(n)&&!Qu(r)){const s=r;r=n;const c=this;return function(d=s,...m){return c.produce(d,f=>r.call(this,f,...m))}}Qu(r)||ei(6),a!==void 0&&!Qu(a)&&ei(7);let i;if(li(n)){const s=hR(this),c=i_(s,n,void 0);let u=!0;try{i=r(c),u=!1}finally{u?n_(s):r_(s)}return fR(s,a),mR(i,s)}else if(!n||!$C(n)){if(i=r(n),i===void 0&&(i=n),i===F8&&(i=void 0),this.autoFreeze_&&UC(i,!0),a){const s=[],c=[];zc(t_).generateReplacementPatches_(n,i,{patches_:s,inversePatches_:c}),a(s,c)}return i}else ei(1,n)},this.produceWithPatches=(n,r)=>{if(Qu(n))return(c,...u)=>this.produceWithPatches(c,d=>n(d,...u));let a,i;return[this.produce(n,r,(c,u)=>{a=c,i=u}),a,i]},sS(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),sS(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),sS(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){li(t)||ei(8),Fo(t)&&(t=Ra(t));const n=hR(this),r=i_(n,t,void 0);return r[Tr].isManual_=!0,r_(n),r}finishDraft(t,n){const r=t&&t[Tr];(!r||!r.isManual_)&&ei(9);const{scope_:a}=r;return fR(a,n),mR(void 0,a)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const i=n[r];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}r>-1&&(n=n.slice(r+1));const a=zc(t_).applyPatches_;return Fo(t)?a(t,n):this.produce(t,i=>a(i,n))}};function i_(e,t,n,r){const[a,i]=T0(t)?zc(ey).proxyMap_(t,n):P0(t)?zc(ey).proxySet_(t,n):Gse(t,n);return((n==null?void 0:n.scope_)??V8()).drafts_.push(a),i.callbacks_=(n==null?void 0:n.callbacks_)??[],i.key_=r,n&&r!==void 0?Vse(n,i,r):i.callbacks_.push(function(u){var m;(m=u.mapSetPlugin_)==null||m.fixSetContents(i);const{patchPlugin_:d}=u;i.modified_&&d&&d.generatePatches_(i,[],u)}),a}function Ra(e){return Fo(e)||ei(10,e),Q8(e)}function Q8(e){if(!li(e)||M0(e))return e;const t=e[Tr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=e_(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=e_(e,!0);return A0(n,(a,i)=>{Jg(n,a,Q8(i))},r),t&&(t.finalized_=!1),n}var Qse=new Wse,Z8=Qse.produce;function J8(e){return({dispatch:n,getState:r})=>a=>i=>typeof i=="function"?i(n,r,e):a(i)}var Zse=J8(),Jse=J8,ele=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Wg:Wg.apply(null,arguments)};function ma(e,t){function n(...r){if(t){let a=t(...r);if(!a)throw new Error(fa(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>H8(r)&&r.type===e,n}var e6=class Oh extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Oh.prototype)}static get[Symbol.species](){return Oh}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Oh(...t[0].concat(this)):new Oh(...t.concat(this))}};function vR(e){return li(e)?Z8(e,()=>{}):e}function qv(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function tle(e){return typeof e=="boolean"}var nle=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{};let s=new e6;return n&&(tle(n)?s.push(Zse):s.push(Jse(n.extraArgument))),s},t6="RTK_autoBatch",Ht=()=>e=>({payload:e,meta:{[t6]:!0}}),gR=e=>t=>{setTimeout(t,e)},n6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let a=!0,i=!1,s=!1;const c=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:gR(10):e.type==="callback"?e.queueNotification:gR(e.timeout),d=()=>{s=!1,i&&(i=!1,c.forEach(m=>m()))};return Object.assign({},r,{subscribe(m){const f=()=>a&&m(),v=r.subscribe(f);return c.add(m),()=>{v(),c.delete(m)}},dispatch(m){var f;try{return a=!((f=m==null?void 0:m.meta)!=null&&f[t6]),i=!a,i&&(s||(s=!0,u(d))),r.dispatch(m)}finally{a=!0}}})},rle=e=>function(n){const{autoBatch:r=!0}=n??{};let a=new e6(e);return r&&a.push(n6(typeof r=="object"?r:void 0)),a};function ale(e){const t=nle(),{reducer:n=void 0,middleware:r,devTools:a=!0,preloadedState:i=void 0,enhancers:s=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(zC(n))c=U8(n);else throw new Error(fa(1));let u;typeof r=="function"?u=r(t):u=t();let d=Wg;a&&(d=ele({trace:!1,...typeof a=="object"&&a}));const m=Lse(...u),f=rle(m);let v=typeof s=="function"?s(f):f();const g=d(...v);return B8(c,i,g)}function r6(e){const t={},n=[];let r;const a={addCase(i,s){const c=typeof i=="string"?i:i.type;if(!c)throw new Error(fa(28));if(c in t)throw new Error(fa(29));return t[c]=s,a},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase(i){return r=i,a}};return e(a),[t,n,r]}function ile(e){return typeof e=="function"}function ole(e,t){let[n,r,a]=r6(t),i;if(ile(e))i=()=>vR(e());else{const c=vR(e);i=()=>c}function s(c=i(),u){let d=[n[u.type],...r.filter(({matcher:m})=>m(u)).map(({reducer:m})=>m)];return d.filter(m=>!!m).length===0&&(d=[a]),d.reduce((m,f)=>{if(f)if(Fo(m)){const g=f(m,u);return g===void 0?m:g}else{if(li(m))return Z8(m,v=>f(v,u));{const v=f(m,u);if(v===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return m},c)}return s.getInitialState=i,s}var sle="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",lle=(e=21)=>{let t="",n=e;for(;n--;)t+=sle[Math.random()*64|0];return t},cle=Symbol.for("rtk-slice-createasyncthunk");function ule(e,t){return`${e}/${t}`}function dle({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[cle];return function(a){const{name:i,reducerPath:s=i}=a;if(!i)throw new Error(fa(11));const c=(typeof a.reducers=="function"?a.reducers(hle()):a.reducers)||{},u=Object.keys(c),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(A,N){const T=typeof A=="string"?A:A.type;if(!T)throw new Error(fa(12));if(T in d.sliceCaseReducersByType)throw new Error(fa(13));return d.sliceCaseReducersByType[T]=N,m},addMatcher(A,N){return d.sliceMatchers.push({matcher:A,reducer:N}),m},exposeAction(A,N){return d.actionCreators[A]=N,m},exposeCaseReducer(A,N){return d.sliceCaseReducersByName[A]=N,m}};u.forEach(A=>{const N=c[A],T={reducerName:A,type:ule(i,A),createNotation:typeof a.reducers=="function"};ple(N)?gle(T,N,m,t):mle(T,N,m)});function f(){const[A={},N=[],T=void 0]=typeof a.extraReducers=="function"?r6(a.extraReducers):[a.extraReducers],P={...A,...d.sliceCaseReducersByType};return ole(a.initialState,R=>{for(let D in P)R.addCase(D,P[D]);for(let D of d.sliceMatchers)R.addMatcher(D.matcher,D.reducer);for(let D of N)R.addMatcher(D.matcher,D.reducer);T&&R.addDefaultCase(T)})}const v=A=>A,g=new Map,b=new WeakMap;let w;function S(A,N){return w||(w=f()),w(A,N)}function E(){return w||(w=f()),w.getInitialState()}function O(A,N=!1){function T(R){let D=R[A];return typeof D>"u"&&N&&(D=qv(b,T,E)),D}function P(R=v){const D=qv(g,N,()=>new WeakMap);return qv(D,R,()=>{const K={};for(const[z,I]of Object.entries(a.selectors??{}))K[z]=fle(I,R,()=>qv(b,R,E),N);return K})}return{reducerPath:A,getSelectors:P,get selectors(){return P(T)},selectSlice:T}}const j={name:i,reducer:S,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:E,...O(s),injectInto(A,{reducerPath:N,...T}={}){const P=N??s;return A.inject({reducerPath:P,reducer:S},T),{...j,...O(P,!0)}}};return j}}function fle(e,t,n,r){function a(i,...s){let c=t(i);return typeof c>"u"&&r&&(c=n()),e(c,...s)}return a.unwrapped=e,a}var br=dle();function hle(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function mle({type:e,reducerName:t,createNotation:n},r,a){let i,s;if("reducer"in r){if(n&&!vle(r))throw new Error(fa(17));i=r.reducer,s=r.prepare}else i=r;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?ma(e,s):ma(e))}function ple(e){return e._reducerDefinitionType==="asyncThunk"}function vle(e){return e._reducerDefinitionType==="reducerWithPrepare"}function gle({type:e,reducerName:t},n,r,a){if(!a)throw new Error(fa(18));const{payloadCreator:i,fulfilled:s,pending:c,rejected:u,settled:d,options:m}=n,f=a(e,i,m);r.exposeAction(t,f),s&&r.addCase(f.fulfilled,s),c&&r.addCase(f.pending,c),u&&r.addCase(f.rejected,u),d&&r.addMatcher(f.settled,d),r.exposeCaseReducer(t,{fulfilled:s||Kv,pending:c||Kv,rejected:u||Kv,settled:d||Kv})}function Kv(){}var yle="task",a6="listener",i6="completed",HC="cancelled",xle=`task-${HC}`,ble=`task-${i6}`,o_=`${a6}-${HC}`,wle=`${a6}-${i6}`,R0=class{constructor(e){Dw(this,"name","TaskAbortError");Dw(this,"message");this.code=e,this.message=`${yle} ${HC} (reason: ${e})`}},FC=(e,t)=>{if(typeof e!="function")throw new TypeError(fa(32))},ry=()=>{},o6=(e,t=ry)=>(e.catch(t),e),s6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Sc=e=>{if(e.aborted)throw new R0(e.reason)};function l6(e,t){let n=ry;return new Promise((r,a)=>{const i=()=>a(new R0(e.reason));if(e.aborted){i();return}n=s6(e,i),t.finally(()=>n()).then(r,a)}).finally(()=>{n=ry})}var Sle=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof R0?"cancelled":"rejected",error:n}}finally{t==null||t()}},ay=e=>t=>o6(l6(e,t).then(n=>(Sc(e),n))),c6=e=>{const t=ay(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:ad}=Object,yR={},D0="listenerMiddleware",Ele=(e,t)=>{const n=r=>s6(e,()=>r.abort(e.reason));return(r,a)=>{FC(r);const i=new AbortController;n(i);const s=Sle(async()=>{Sc(e),Sc(i.signal);const c=await r({pause:ay(i.signal),delay:c6(i.signal),signal:i.signal});return Sc(i.signal),c},()=>i.abort(ble));return a!=null&&a.autoJoin&&t.push(s.catch(ry)),{result:ay(e)(s),cancel(){i.abort(xle)}}}},_le=(e,t)=>{const n=async(r,a)=>{Sc(t);let i=()=>{};const c=[new Promise((u,d)=>{let m=e({predicate:r,effect:(f,v)=>{v.unsubscribe(),u([f,v.getState(),v.getOriginalState()])}});i=()=>{m(),d()}})];a!=null&&c.push(new Promise(u=>setTimeout(u,a,null)));try{const u=await l6(t,Promise.race(c));return Sc(t),u}finally{i()}};return(r,a)=>o6(n(r,a))},u6=e=>{let{type:t,actionCreator:n,matcher:r,predicate:a,effect:i}=e;if(t)a=ma(t).match;else if(n)t=n.type,a=n.match;else if(r)a=r;else if(!a)throw new Error(fa(21));return FC(i),{predicate:a,type:t,effect:i}},d6=ad(e=>{const{type:t,predicate:n,effect:r}=u6(e);return{id:lle(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(fa(22))}}},{withTypes:()=>d6}),xR=(e,t)=>{const{type:n,effect:r,predicate:a}=u6(t);return Array.from(e.values()).find(i=>(typeof n=="string"?i.type===n:i.predicate===a)&&i.effect===r)},s_=e=>{e.pending.forEach(t=>{t.abort(o_)})},jle=(e,t)=>()=>{for(const n of t.keys())s_(n);e.clear()},bR=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},f6=ad(ma(`${D0}/add`),{withTypes:()=>f6}),Cle=ma(`${D0}/removeAll`),h6=ad(ma(`${D0}/remove`),{withTypes:()=>h6}),Ole=(...e)=>{console.error(`${D0}/error`,...e)},zm=(e={})=>{const t=new Map,n=new Map,r=g=>{const b=n.get(g)??0;n.set(g,b+1)},a=g=>{const b=n.get(g)??1;b===1?n.delete(g):n.set(g,b-1)},{extra:i,onError:s=Ole}=e;FC(s);const c=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),b=>{g.unsubscribe(),b!=null&&b.cancelActive&&s_(g)}),u=g=>{const b=xR(t,g)??d6(g);return c(b)};ad(u,{withTypes:()=>u});const d=g=>{const b=xR(t,g);return b&&(b.unsubscribe(),g.cancelActive&&s_(b)),!!b};ad(d,{withTypes:()=>d});const m=async(g,b,w,S)=>{const E=new AbortController,O=_le(u,E.signal),j=[];try{g.pending.add(E),r(g),await Promise.resolve(g.effect(b,ad({},w,{getOriginalState:S,condition:(A,N)=>O(A,N).then(Boolean),take:O,delay:c6(E.signal),pause:ay(E.signal),extra:i,signal:E.signal,fork:Ele(E.signal,j),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((A,N,T)=>{A!==E&&(A.abort(o_),T.delete(A))})},cancel:()=>{E.abort(o_),g.pending.delete(E)},throwIfCancelled:()=>{Sc(E.signal)}})))}catch(A){A instanceof R0||bR(s,A,{raisedBy:"effect"})}finally{await Promise.all(j),E.abort(wle),a(g),g.pending.delete(E)}},f=jle(t,n);return{middleware:g=>b=>w=>{if(!H8(w))return b(w);if(f6.match(w))return u(w.payload);if(Cle.match(w)){f();return}if(h6.match(w))return d(w.payload);let S=g.getState();const E=()=>{if(S===yR)throw new Error(fa(23));return S};let O;try{if(O=b(w),t.size>0){const j=g.getState(),A=Array.from(t.values());for(const N of A){let T=!1;try{T=N.predicate(w,j,S)}catch(P){T=!1,bR(s,P,{raisedBy:"predicate"})}T&&m(N,w,g,E)}}}finally{S=yR}return O},startListening:u,stopListening:d,clearListeners:f}};function fa(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ale={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},m6=br({name:"chartLayout",initialState:Ale,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,a,i;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(a=t.payload.bottom)!==null&&a!==void 0?a:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Nle,setLayout:Tle,setChartSize:Ple,setScale:Mle}=m6.actions,kle=m6.reducer;function p6(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ct(e){return Number.isFinite(e)}function qi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function wR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(n),!0).forEach(function(r){Rle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rle(e,t,n){return(t=Dle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dle(e){var t=Ile(e,"string");return typeof t=="symbol"?t:t+""}function Ile(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pt(e,t,n){return Wt(e)||Wt(t)?n:Fi(t)?Ic(e,t,n):typeof t=="function"?t(e):n}var Lle=(e,t,n)=>{if(t&&n){var{width:r,height:a}=n,{align:i,verticalAlign:s,layout:c}=t;if((c==="vertical"||c==="horizontal"&&s==="middle")&&i!=="center"&&Oe(e[i]))return Zu(Zu({},e),{},{[i]:e[i]+(r||0)});if((c==="horizontal"||c==="vertical"&&i==="center")&&s!=="middle"&&Oe(e[s]))return Zu(Zu({},e),{},{[s]:e[s]+(a||0)})}return e},Wo=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",v6=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var a,i,s=e.map(c=>(c.coordinate===t&&(a=!0),c.coordinate===n&&(i=!0),c.coordinate));return a||s.push(t),i||s.push(n),s},g6=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:a,range:i,scale:s,realScaleType:c,isCategorical:u,categoricalDomain:d,tickCount:m,ticks:f,niceTicks:v,axisType:g}=e;if(!s)return null;var b=c==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,w=a==="category"&&s.bandwidth?s.bandwidth()/b:0;if(w=g==="angleAxis"&&i&&i.length>=2?Vn(i[0]-i[1])*2*w:w,f||v){var S=(f||v||[]).map((E,O)=>{var j=r?r.indexOf(E):E,A=s.map(j);return ct(A)?{coordinate:A+w,value:E,offset:w,index:O}:null}).filter(Vr);return S}return u&&d?d.map((E,O)=>{var j=s.map(E);return ct(j)?{coordinate:j+w,value:E,index:O,offset:w}:null}).filter(Vr):s.ticks&&m!=null?s.ticks(m).map((E,O)=>{var j=s.map(E);return ct(j)?{coordinate:j+w,value:E,index:O,offset:w}:null}).filter(Vr):s.domain().map((E,O)=>{var j=s.map(E);return ct(j)?{coordinate:j+w,value:r?r[E]:E,index:O,offset:w}:null}).filter(Vr)},zle=(e,t)=>{if(!t||t.length!==2||!Oe(t[0])||!Oe(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),a=[e[0],e[1]];return(!Oe(e[0])||e[0]<n)&&(a[0]=n),(!Oe(e[1])||e[1]>r)&&(a[1]=r),a[0]>r&&(a[0]=r),a[1]<n&&(a[1]=n),a},$le=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var a=0;a<r;++a)for(var i=0,s=0,c=0;c<n;++c){var u=e[c],d=u==null?void 0:u[a];if(d!=null){var m=d[1],f=d[0],v=Hi(m)?f:m;v>=0?(d[0]=i,i+=v,d[1]=i):(d[0]=s,s+=v,d[1]=s)}}}},Ble=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var a=0;a<r;++a)for(var i=0,s=0;s<n;++s){var c=e[s],u=c==null?void 0:c[a];if(u!=null){var d=Hi(u[1])?u[0]:u[1];d>=0?(u[0]=i,i+=d,u[1]=i):(u[0]=0,u[1]=0)}}}},Ule={sign:$le,expand:coe,none:Dc,silhouette:uoe,wiggle:doe,positive:Ble},Hle=(e,t,n)=>{var r,a=(r=Ule[n])!==null&&r!==void 0?r:Dc,i=loe().keys(t).value((c,u)=>Number(Pt(c,u,0))).order(WE).offset(a),s=i(e);return s.forEach((c,u)=>{c.forEach((d,m)=>{var f=Pt(e[m],t[u],0);Array.isArray(f)&&f.length===2&&Oe(f[0])&&Oe(f[1])&&(d[0]=f[0],d[1]=f[1])})}),s};function Fle(e){return e==null?void 0:String(e)}function SR(e){var{axis:t,ticks:n,bandSize:r,entry:a,index:i,dataKey:s}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Wt(a[t.dataKey])){var c=b8(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[i]?n[i].coordinate+r/2:null}var u=Pt(a,Wt(s)?t.dataKey:s),d=t.scale.map(u);return Oe(d)?d:null}var ER=e=>{var{axis:t,ticks:n,offset:r,bandSize:a,entry:i,index:s}=e;if(t.type==="category")return n[s]?n[s].coordinate+r:null;var c=Pt(i,t.dataKey,t.scale.domain()[s]);if(Wt(c))return null;var u=t.scale.map(c);return Oe(u)?u-a/2+r:null},qle=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return r<=0&&a>=0?0:a<0?a:r}return n[0]},Kle=e=>{var t=e.flat(2).filter(Oe);return[Math.min(...t),Math.max(...t)]},Vle=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Yle=(e,t,n)=>{if(e!=null)return Vle(Object.keys(e).reduce((r,a)=>{var i=e[a];if(!i)return r;var{stackedData:s}=i,c=s.reduce((u,d)=>{var m=p6(d,t,n),f=Kle(m);return!ct(f[0])||!ct(f[1])?u:[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},_R=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,jR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ad=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var a=C0(t,m=>m.coordinate),i=1/0,s=1,c=a.length;s<c;s++){var u=a[s],d=a[s-1];i=Math.min(((u==null?void 0:u.coordinate)||0)-((d==null?void 0:d.coordinate)||0),i)}return i===1/0?0:i}return n?void 0:0};function CR(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:a,name:i}=e;return Zu(Zu({},t),{},{dataKey:n,payload:r,value:a,name:i})}function Jd(e,t){if(e)return String(e);if(typeof t=="string")return t}var Gle=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Xle=(e,t)=>t==="centric"?e.angle:e.radius,Qo=e=>e.layout.width,Zo=e=>e.layout.height,Wle=e=>e.layout.scale,y6=e=>e.layout.margin,I0=se(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),L0=se(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),x6="data-recharts-item-index",b6="data-recharts-item-id",$m=60;function OR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Vv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(n),!0).forEach(function(r){Qle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qle(e,t,n){return(t=Zle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zle(e){var t=Jle(e,"string");return typeof t=="symbol"?t:t+""}function Jle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ece=e=>e.brush.height;function tce(e){var t=L0(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var a=typeof r.width=="number"?r.width:$m;return n+a}return n},0)}function nce(e){var t=L0(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var a=typeof r.width=="number"?r.width:$m;return n+a}return n},0)}function rce(e){var t=I0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function ace(e){var t=I0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Ln=se([Qo,Zo,y6,ece,tce,nce,rce,ace,z8,Tse],(e,t,n,r,a,i,s,c,u,d)=>{var m={left:(n.left||0)+a,right:(n.right||0)+i},f={top:(n.top||0)+s,bottom:(n.bottom||0)+c},v=Vv(Vv({},f),m),g=v.bottom;v.bottom+=r,v=Lle(v,u,d);var b=e-v.left-v.right,w=t-v.top-v.bottom;return Vv(Vv({brushBottom:g},v),{},{width:Math.max(b,0),height:Math.max(w,0)})}),ice=se(Ln,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),qC=se(Qo,Zo,(e,t)=>({x:0,y:0,width:e,height:t})),oce=x.createContext(null),wr=()=>x.useContext(oce)!=null,z0=e=>e.brush,$0=se([z0,Ln,y6],(e,t,n)=>({height:e.height,x:Oe(e.x)?e.x:t.left,y:Oe(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Oe(e.width)?e.width:t.width})),cS={},uS={},dS={},AR;function sce(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:a,edges:i}={}){let s,c=null;const u=i!=null&&i.includes("leading"),d=i==null||i.includes("trailing"),m=()=>{c!==null&&(n.apply(s,c),s=void 0,c=null)},f=()=>{d&&m(),w()};let v=null;const g=()=>{v!=null&&clearTimeout(v),v=setTimeout(()=>{v=null,f()},r)},b=()=>{v!==null&&(clearTimeout(v),v=null)},w=()=>{b(),s=void 0,c=null},S=()=>{m()},E=function(...O){if(a!=null&&a.aborted)return;s=this,c=O;const j=v==null;g(),u&&j&&m()};return E.schedule=g,E.cancel=w,E.flush=S,a==null||a.addEventListener("abort",w,{once:!0}),E}e.debounce=t})(dS)),dS}var NR;function lce(){return NR||(NR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sce();function n(r,a=0,i={}){typeof i!="object"&&(i={});const{leading:s=!1,trailing:c=!0,maxWait:u}=i,d=Array(2);s&&(d[0]="leading"),c&&(d[1]="trailing");let m,f=null;const v=t.debounce(function(...w){m=r.apply(this,w),f=null},a,{edges:d}),g=function(...w){return u!=null&&(f===null&&(f=Date.now()),Date.now()-f>=u)?(m=r.apply(this,w),f=Date.now(),v.cancel(),v.schedule(),m):(v.apply(this,w),m)},b=()=>(v.flush(),m);return g.cancel=v.cancel,g.flush=b,g}e.debounce=n})(uS)),uS}var TR;function cce(){return TR||(TR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lce();function n(r,a=0,i={}){const{leading:s=!0,trailing:c=!0}=i;return t.debounce(r,a,{leading:s,maxWait:a,trailing:c})}e.throttle=n})(cS)),cS}var fS,PR;function uce(){return PR||(PR=1,fS=cce().throttle),fS}var dce=uce();const fce=ci(dce);var iy=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;i<r;i++)a[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(n.replace(/%s/g,()=>a[s++]))}},Mi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},w6=(e,t,n)=>{var{width:r=Mi.width,height:a=Mi.height,aspect:i,maxHeight:s}=n,c=Lc(r)?e:Number(r),u=Lc(a)?t:Number(a);return i&&i>0&&(c?u=c/i:u&&(c=u*i),s&&u!=null&&u>s&&(u=s)),{calculatedWidth:c,calculatedHeight:u}},hce={width:0,height:0,overflow:"visible"},mce={width:0,overflowX:"visible"},pce={height:0,overflowY:"visible"},vce={},gce=e=>{var{width:t,height:n}=e,r=Lc(t),a=Lc(n);return r&&a?hce:r?mce:a?pce:vce};function yce(e){var{width:t,height:n,aspect:r}=e,a=t,i=n;return a===void 0&&i===void 0?(a=Mi.width,i=Mi.height):a===void 0?a=r&&r>0?void 0:Mi.width:i===void 0&&(i=r&&r>0?void 0:Mi.height),{width:a,height:i}}function l_(){return l_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l_.apply(null,arguments)}function MR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function kR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MR(Object(n),!0).forEach(function(r){xce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xce(e,t,n){return(t=bce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bce(e){var t=wce(e,"string");return typeof t=="symbol"?t:t+""}function wce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var S6=x.createContext(Mi.initialDimension);function Sce(e){return qi(e.width)&&qi(e.height)}function E6(e){var{children:t,width:n,height:r}=e,a=x.useMemo(()=>({width:n,height:r}),[n,r]);return Sce(a)?x.createElement(S6.Provider,{value:a},t):null}var KC=()=>x.useContext(S6),Ece=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Mi.initialDimension,width:a,height:i,minWidth:s=Mi.minWidth,minHeight:c,maxHeight:u,children:d,debounce:m=Mi.debounce,id:f,className:v,onResize:g,style:b={}}=e,w=x.useRef(null),S=x.useRef();S.current=g,x.useImperativeHandle(t,()=>w.current);var[E,O]=x.useState({containerWidth:r.width,containerHeight:r.height}),j=x.useCallback((R,D)=>{O(K=>{var z=Math.round(R),I=Math.round(D);return K.containerWidth===z&&K.containerHeight===I?K:{containerWidth:z,containerHeight:I}})},[]);x.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return Ol;var R=I=>{var G,L=I[0];if(L!=null){var{width:Y,height:k}=L.contentRect;j(Y,k),(G=S.current)===null||G===void 0||G.call(S,Y,k)}};m>0&&(R=fce(R,m,{trailing:!0,leading:!1}));var D=new ResizeObserver(R),{width:K,height:z}=w.current.getBoundingClientRect();return j(K,z),D.observe(w.current),()=>{D.disconnect()}},[j,m]);var{containerWidth:A,containerHeight:N}=E;iy(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:T,calculatedHeight:P}=w6(A,N,{width:a,height:i,aspect:n,maxHeight:u});return iy(T!=null&&T>0||P!=null&&P>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,T,P,a,i,s,c,n),x.createElement("div",{id:f?"".concat(f):void 0,className:dt("recharts-responsive-container",v),style:kR(kR({},b),{},{width:a,height:i,minWidth:s,minHeight:c,maxHeight:u}),ref:w},x.createElement("div",{style:gce({width:a,height:i})},x.createElement(E6,{width:T,height:P},d)))}),VC=x.forwardRef((e,t)=>{var n=KC();if(qi(n.width)&&qi(n.height))return e.children;var{width:r,height:a}=yce({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:s}=w6(void 0,void 0,{width:r,height:a,aspect:e.aspect,maxHeight:e.maxHeight});return Oe(i)&&Oe(s)?x.createElement(E6,{width:i,height:s},e.children):x.createElement(Ece,l_({},e,{width:r,height:a,ref:t}))});function YC(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var B0=()=>{var e,t=wr(),n=Te(ice),r=Te($0),a=(e=Te(z0))===null||e===void 0?void 0:e.padding;return!t||!r||!a?n:{width:r.width-a.left-a.right,height:r.height-a.top-a.bottom,x:a.left,y:a.top}},_ce={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},_6=()=>{var e;return(e=Te(Ln))!==null&&e!==void 0?e:_ce},GC=()=>Te(Qo),XC=()=>Te(Zo),jce=()=>Te(e=>e.layout.margin),yt=e=>e.layout.layoutType,Qc=()=>Te(yt),j6=()=>{var e=Qc();if(e==="horizontal"||e==="vertical")return e},C6=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Cce=()=>{var e=Qc();return e!==void 0},Bm=e=>{var t=kt(),n=wr(),{width:r,height:a}=e,i=KC(),s=r,c=a;return i&&(s=i.width>0?i.width:r,c=i.height>0?i.height:a),x.useEffect(()=>{!n&&qi(s)&&qi(c)&&t(Ple({width:s,height:c}))},[t,n,s,c]),null},O6=Symbol.for("immer-nothing"),RR=Symbol.for("immer-draftable"),pa=Symbol.for("immer-state");function ti(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Wh=Object.getPrototypeOf;function Nd(e){return!!e&&!!e[pa]}function $c(e){var t;return e?A6(e)||Array.isArray(e)||!!e[RR]||!!((t=e.constructor)!=null&&t[RR])||Um(e)||H0(e):!1}var Oce=Object.prototype.constructor.toString(),DR=new WeakMap;function A6(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=DR.get(n);return r===void 0&&(r=Function.toString.call(n),DR.set(n,r)),r===Oce}function oy(e,t,n=!0){U0(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((r,a)=>t(a,r,e))}function U0(e){const t=e[pa];return t?t.type_:Array.isArray(e)?1:Um(e)?2:H0(e)?3:0}function c_(e,t){return U0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function N6(e,t,n){const r=U0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Ace(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Um(e){return e instanceof Map}function H0(e){return e instanceof Set}function ac(e){return e.copy_||e.base_}function u_(e,t){if(Um(e))return new Map(e);if(H0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=A6(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[pa];let a=Reflect.ownKeys(r);for(let i=0;i<a.length;i++){const s=a[i],c=r[s];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[s]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[s]})}return Object.create(Wh(e),r)}else{const r=Wh(e);if(r!==null&&n)return{...e};const a=Object.create(r);return Object.assign(a,e)}}function WC(e,t=!1){return F0(e)||Nd(e)||!$c(e)||(U0(e)>1&&Object.defineProperties(e,{set:Yv,add:Yv,clear:Yv,delete:Yv}),Object.freeze(e),t&&Object.values(e).forEach(n=>WC(n,!0))),e}function Nce(){ti(2)}var Yv={value:Nce};function F0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Tce={};function Bc(e){const t=Tce[e];return t||ti(0,e),t}var Qh;function T6(){return Qh}function Pce(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function IR(e,t){t&&(Bc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function d_(e){f_(e),e.drafts_.forEach(Mce),e.drafts_=null}function f_(e){e===Qh&&(Qh=e.parent_)}function LR(e){return Qh=Pce(Qh,e)}function Mce(e){const t=e[pa];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function zR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[pa].modified_&&(d_(t),ti(4)),$c(e)&&(e=sy(t,e),t.parent_||ly(t,e)),t.patches_&&Bc("Patches").generateReplacementPatches_(n[pa].base_,e,t.patches_,t.inversePatches_)):e=sy(t,n,[]),d_(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==O6?e:void 0}function sy(e,t,n){if(F0(t))return t;const r=e.immer_.shouldUseStrictIteration(),a=t[pa];if(!a)return oy(t,(i,s)=>$R(e,a,t,i,s,n),r),t;if(a.scope_!==e)return t;if(!a.modified_)return ly(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const i=a.copy_;let s=i,c=!1;a.type_===3&&(s=new Set(i),i.clear(),c=!0),oy(s,(u,d)=>$R(e,a,i,u,d,n,c),r),ly(e,i,!1),n&&e.patches_&&Bc("Patches").generatePatches_(a,n,e.patches_,e.inversePatches_)}return a.copy_}function $R(e,t,n,r,a,i,s){if(a==null||typeof a!="object"&&!s)return;const c=F0(a);if(!(c&&!s)){if(Nd(a)){const u=i&&t&&t.type_!==3&&!c_(t.assigned_,r)?i.concat(r):void 0,d=sy(e,a,u);if(N6(n,r,d),Nd(d))e.canAutoFreeze_=!1;else return}else s&&n.add(a);if($c(a)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===a&&c)return;sy(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Um(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&ly(e,a)}}}function ly(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&WC(t,n)}function kce(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:T6(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,i=QC;n&&(a=[r],i=Zh);const{revoke:s,proxy:c}=Proxy.revocable(a,i);return r.draft_=c,r.revoke_=s,c}var QC={get(e,t){if(t===pa)return e;const n=ac(e);if(!c_(n,t))return Rce(e,n,t);const r=n[t];return e.finalized_||!$c(r)?r:r===hS(e.base_,t)?(mS(e),e.copy_[t]=m_(r,e)):r},has(e,t){return t in ac(e)},ownKeys(e){return Reflect.ownKeys(ac(e))},set(e,t,n){const r=P6(ac(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=hS(ac(e),t),i=a==null?void 0:a[pa];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Ace(n,a)&&(n!==void 0||c_(e.base_,t)))return!0;mS(e),h_(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return hS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,mS(e),h_(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ac(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ti(11)},getPrototypeOf(e){return Wh(e.base_)},setPrototypeOf(){ti(12)}},Zh={};oy(QC,(e,t)=>{Zh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Zh.deleteProperty=function(e,t){return Zh.set.call(this,e,t,void 0)};Zh.set=function(e,t,n){return QC.set.call(this,e[0],t,n,e[0])};function hS(e,t){const n=e[pa];return(n?ac(n):e)[t]}function Rce(e,t,n){var a;const r=P6(t,n);return r?"value"in r?r.value:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function P6(e,t){if(!(t in e))return;let n=Wh(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Wh(n)}}function h_(e){e.modified_||(e.modified_=!0,e.parent_&&h_(e.parent_))}function mS(e){e.copy_||(e.copy_=u_(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Dce=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(u=i,...d){return s.produce(u,m=>n.call(this,m,...d))}}typeof n!="function"&&ti(6),r!==void 0&&typeof r!="function"&&ti(7);let a;if($c(t)){const i=LR(this),s=m_(t,void 0);let c=!0;try{a=n(s),c=!1}finally{c?d_(i):f_(i)}return IR(i,r),zR(a,i)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===O6&&(a=void 0),this.autoFreeze_&&WC(a,!0),r){const i=[],s=[];Bc("Patches").generateReplacementPatches_(t,a,i,s),r(i,s)}return a}else ti(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...c)=>this.produceWithPatches(s,u=>t(u,...c));let r,a;return[this.produce(t,n,(s,c)=>{r=s,a=c}),r,a]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){$c(e)||ti(8),Nd(e)&&(e=Ice(e));const t=LR(this),n=m_(e,void 0);return n[pa].isManual_=!0,f_(t),n}finishDraft(e,t){const n=e&&e[pa];(!n||!n.isManual_)&&ti(9);const{scope_:r}=n;return IR(r,t),zR(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));const r=Bc("Patches").applyPatches_;return Nd(e)?r(e,t):this.produce(e,a=>r(a,t))}};function m_(e,t){const n=Um(e)?Bc("MapSet").proxyMap_(e,t):H0(e)?Bc("MapSet").proxySet_(e,t):kce(e,t);return(t?t.scope_:T6()).drafts_.push(n),n}function Ice(e){return Nd(e)||ti(10,e),M6(e)}function M6(e){if(!$c(e)||F0(e))return e;const t=e[pa];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=u_(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=u_(e,!0);return oy(n,(a,i)=>{N6(n,a,M6(i))},r),t&&(t.finalized_=!1),n}var Lce=new Dce;Lce.produce;var zce={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},k6=br({name:"legend",initialState:zce,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:Ht()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,a=Ra(e).payload.indexOf(n);a>-1&&(e.payload[a]=r)},prepare:Ht()},removeLegendPayload:{reducer(e,t){var n=Ra(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Ht()}}}),{setLegendSize:BR,setLegendSettings:$ce,addLegendPayload:R6,replaceLegendPayload:D6,removeLegendPayload:I6}=k6.actions,Bce=k6.reducer,pS={exports:{}},vS={};/**
 * @license React
 * use-sync-external-store-with-selector.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 UR;function Uce(){if(UR)return vS;UR=1;var e=Fd();function t(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,c=e.useDebugValue;return vS.useSyncExternalStoreWithSelector=function(u,d,m,f,v){var g=a(null);if(g.current===null){var b={hasValue:!1,value:null};g.current=b}else b=g.current;g=s(function(){function S(N){if(!E){if(E=!0,O=N,N=f(N),v!==void 0&&b.hasValue){var T=b.value;if(v(T,N))return j=T}return j=N}if(T=j,n(O,N))return T;var P=f(N);return v!==void 0&&v(T,P)?(O=N,T):(O=N,j=P)}var E=!1,O,j,A=m===void 0?null:m;return[function(){return S(d())},A===null?void 0:function(){return S(A())}]},[d,m,f,v]);var w=r(u,g[0],g[1]);return i(function(){b.hasValue=!0,b.value=w},[w]),c(w),w},vS}var HR;function Hce(){return HR||(HR=1,pS.exports=Uce()),pS.exports}Hce();function Fce(e){e()}function qce(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Fce(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const a=t={callback:n,next:null,prev:t};return a.prev?a.prev.next=a:e=a,function(){!r||e===null||(r=!1,a.next?a.next.prev=a.prev:t=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var FR={notify(){},get:()=>[]};function Kce(e,t){let n,r=FR,a=0,i=!1;function s(w){m();const S=r.subscribe(w);let E=!1;return()=>{E||(E=!0,S(),f())}}function c(){r.notify()}function u(){b.onStateChange&&b.onStateChange()}function d(){return i}function m(){a++,n||(n=e.subscribe(u),r=qce())}function f(){a--,n&&a===0&&(n(),n=void 0,r.clear(),r=FR)}function v(){i||(i=!0,m())}function g(){i&&(i=!1,f())}const b={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:u,isSubscribed:d,trySubscribe:v,tryUnsubscribe:g,getListeners:()=>r};return b}var Vce=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yce=Vce(),Gce=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Xce=Gce(),Wce=()=>Yce||Xce?x.useLayoutEffect:x.useEffect,Qce=Wce();function qR(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Zce(e,t){if(qR(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!qR(e[n[a]],t[n[a]]))return!1;return!0}var gS=Symbol.for("react-redux-context"),yS=typeof globalThis<"u"?globalThis:{};function Jce(){if(!x.createContext)return{};const e=yS[gS]??(yS[gS]=new Map);let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var eue=Jce();function tue(e){const{children:t,context:n,serverState:r,store:a}=e,i=x.useMemo(()=>{const u=Kce(a);return{store:a,subscription:u,getServerState:r?()=>r:void 0}},[a,r]),s=x.useMemo(()=>a.getState(),[a]);Qce(()=>{const{subscription:u}=i;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),s!==a.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[i,s]);const c=n||eue;return x.createElement(c.Provider,{value:i},t)}var nue=tue,rue=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function aue(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function ef(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(rue.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Zce(e[r],t[r]))return!1}else if(!aue(e[r],t[r]))return!1;return!0}var iue=["contextPayload"];function p_(){return p_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p_.apply(null,arguments)}function KR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Td(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KR(Object(n),!0).forEach(function(r){oue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oue(e,t,n){return(t=sue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sue(e){var t=lue(e,"string");return typeof t=="symbol"?t:t+""}function lue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cue(e,t){if(e==null)return{};var n,r,a=uue(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function uue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function due(e){return e.value}function fue(e){var{contextPayload:t}=e,n=cue(e,iue),r=k8(t,e.payloadUniqBy,due),a=Td(Td({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,a):typeof e.content=="function"?x.createElement(e.content,a):x.createElement(Boe,a)}function hue(e,t,n,r,a,i){var{layout:s,align:c,verticalAlign:u}=t,d,m;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&s==="vertical"?d={left:((r||0)-i.width)/2}:d=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u==="middle"?m={top:((a||0)-i.height)/2}:m=u==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Td(Td({},d),m)}function mue(e){var t=kt();return x.useEffect(()=>{t($ce(e))},[t,e]),null}function pue(e){var t=kt();return x.useEffect(()=>(t(BR(e)),()=>{t(BR({width:0,height:0}))}),[t,e]),null}function vue(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var gue={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function yue(e){var t=Cn(e,gue),n=kse(),r=Mie(),a=jce(),{width:i,height:s,wrapperStyle:c,portal:u}=t,[d,m]=$8([n]),f=GC(),v=XC();if(f==null||v==null)return null;var g=f-((a==null?void 0:a.left)||0)-((a==null?void 0:a.right)||0),b=vue(t.layout,s,i,g),w=u?c:Td(Td({position:"absolute",width:(b==null?void 0:b.width)||i||"auto",height:(b==null?void 0:b.height)||s||"auto"},hue(c,t,a,f,v,d)),c),S=u??r;if(S==null||n==null)return null;var E=x.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:m},x.createElement(mue,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!u&&x.createElement(pue,{width:d.width,height:d.height}),x.createElement(fue,p_({},t,b,{margin:a,chartWidth:f,chartHeight:v,contextPayload:n})));return yl.createPortal(E,S)}var L6=x.memo(yue,ef);L6.displayName="Legend";function v_(){return v_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v_.apply(null,arguments)}function VR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function uh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VR(Object(n),!0).forEach(function(r){xue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xue(e,t,n){return(t=bue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bue(e){var t=wue(e,"string");return typeof t=="symbol"?t:t+""}function wue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sue(e){return Array.isArray(e)&&Fi(e[0])&&Fi(e[1])?e.join(" ~ "):e}var Bu={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function Eue(e,t){return t==null?e:C0(e,t)}var _ue=e=>{var{separator:t=Bu.separator,contentStyle:n,itemStyle:r,labelStyle:a=Bu.labelStyle,payload:i,formatter:s,itemSorter:c,wrapperClassName:u,labelClassName:d,label:m,labelFormatter:f,accessibilityLayer:v=Bu.accessibilityLayer}=e,g=()=>{if(i&&i.length){var N={padding:0,margin:0},T=Eue(i,c),P=T.map((R,D)=>{if(R.type==="none")return null;var K=R.formatter||s||Sue,{value:z,name:I}=R,G=z,L=I;if(K){var Y=K(z,I,R,D,i);if(Array.isArray(Y))[G,L]=Y;else if(Y!=null)G=Y;else return null}var k=uh(uh({},Bu.itemStyle),{},{color:R.color||Bu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:k},Fi(L)?x.createElement("span",{className:"recharts-tooltip-item-name"},L):null,Fi(L)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},G),x.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:N},P)}return null},b=uh(uh({},Bu.contentStyle),n),w=uh({margin:0},a),S=!Wt(m),E=S?m:"",O=dt("recharts-default-tooltip",u),j=dt("recharts-tooltip-label",d);S&&f&&i!==void 0&&i!==null&&(E=f(m,i));var A=v?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",v_({className:O,style:b},A),x.createElement("p",{className:j,style:w},x.isValidElement(E)?E:"".concat(E)),g())},dh="recharts-tooltip-wrapper",jue={visibility:"hidden"};function Cue(e){var{coordinate:t,translateX:n,translateY:r}=e;return dt(dh,{["".concat(dh,"-right")]:Oe(n)&&t&&Oe(t.x)&&n>=t.x,["".concat(dh,"-left")]:Oe(n)&&t&&Oe(t.x)&&n<t.x,["".concat(dh,"-bottom")]:Oe(r)&&t&&Oe(t.y)&&r>=t.y,["".concat(dh,"-top")]:Oe(r)&&t&&Oe(t.y)&&r<t.y})}function YR(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:a,position:i,reverseDirection:s,tooltipDimension:c,viewBox:u,viewBoxDimension:d}=e;if(i&&Oe(i[r]))return i[r];var m=n[r]-c-(a>0?a:0),f=n[r]+a;if(t[r])return s[r]?m:f;var v=u[r];if(v==null)return 0;if(s[r]){var g=m,b=v;return g<b?Math.max(f,v):Math.max(m,v)}if(d==null)return 0;var w=f+c,S=v+d;return w>S?Math.max(m,v):Math.max(f,v)}function Oue(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Aue(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:a,position:i,reverseDirection:s,tooltipBox:c,useTranslate3d:u,viewBox:d}=e,m,f,v;return c.height>0&&c.width>0&&n?(f=YR({allowEscapeViewBox:t,coordinate:n,key:"x",offset:a,position:i,reverseDirection:s,tooltipDimension:c.width,viewBox:d,viewBoxDimension:d.width}),v=YR({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:i,reverseDirection:s,tooltipDimension:c.height,viewBox:d,viewBoxDimension:d.height}),m=Oue({translateX:f,translateY:v,useTranslate3d:u})):m=jue,{cssProperties:m,cssClasses:Cue({translateX:f,translateY:v,coordinate:n})}}var Nue=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Hm={isSsr:Nue()};function z6(){var[e,t]=x.useState(()=>Hm.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function GR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Uu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GR(Object(n),!0).forEach(function(r){Tue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tue(e,t,n){return(t=Pue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pue(e){var t=Mue(e,"string");return typeof t=="symbol"?t:t+""}function Mue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kue(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Rue(e){var t,n,r,a,i,s,c=z6(),[u,d]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,E,O,j;d({dismissed:!0,dismissedAtCoordinate:{x:(S=(E=e.coordinate)===null||E===void 0?void 0:E.x)!==null&&S!==void 0?S:0,y:(O=(j=e.coordinate)===null||j===void 0?void 0:j.y)!==null&&O!==void 0?O:0}})}};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),u.dismissed&&(((r=(a=e.coordinate)===null||a===void 0?void 0:a.x)!==null&&r!==void 0?r:0)!==u.dismissedAtCoordinate.x||((i=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)!==u.dismissedAtCoordinate.y)&&d(Uu(Uu({},u),{},{dismissed:!1}));var{cssClasses:m,cssProperties:f}=Aue({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),v=e.hasPortalFromProps?{}:Uu(Uu({transition:kue({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},f),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),g=Uu(Uu({},v),{},{visibility:!u.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:g,ref:e.innerRef},e.children)}var Due=x.memo(Rue),$6=()=>{var e;return(e=Te(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function g_(){return g_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g_.apply(null,arguments)}function XR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function WR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XR(Object(n),!0).forEach(function(r){Iue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iue(e,t,n){return(t=Lue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lue(e){var t=zue(e,"string");return typeof t=="symbol"?t:t+""}function zue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QR={curveBasisClosed:Qie,curveBasisOpen:Zie,curveBasis:Wie,curveBumpX:Iie,curveBumpY:Lie,curveLinearClosed:Jie,curveLinear:_0,curveMonotoneX:eoe,curveMonotoneY:toe,curveNatural:noe,curveStep:roe,curveStepAfter:ioe,curveStepBefore:aoe},cy=e=>ct(e.x)&&ct(e.y),ZR=e=>e.base!=null&&cy(e.base)&&cy(e),fh=e=>e.x,hh=e=>e.y,$ue=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Dm(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=QR["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return QR[n]||_0},JR={connectNulls:!1,type:"linear"},Bue=e=>{var{type:t=JR.type,points:n=[],baseLine:r,layout:a,connectNulls:i=JR.connectNulls}=e,s=$ue(t,a),c=i?n.filter(cy):n;if(Array.isArray(r)){var u,d=n.map((b,w)=>WR(WR({},b),{},{base:r[w]}));a==="vertical"?u=Bv().y(hh).x1(fh).x0(b=>b.base.x):u=Bv().x(fh).y1(hh).y0(b=>b.base.y);var m=u.defined(ZR).curve(s),f=i?d.filter(ZR):d;return m(f)}var v;a==="vertical"&&Oe(r)?v=Bv().y(hh).x1(fh).x0(r):Oe(r)?v=Bv().x(fh).y1(hh).y0(r):v=s8().x(fh).y(hh);var g=v.defined(cy).curve(s);return g(c)},ZC=e=>{var{className:t,points:n,path:r,pathRef:a}=e,i=Qc();if((!n||!n.length)&&!r)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},c=n&&n.length?Bue(s):r;return x.createElement("path",g_({},ha(e),DC(e),{className:dt("recharts-curve",t),d:c===null?void 0:c,ref:a}))},Uue=["x","y","top","left","width","height","className"];function y_(){return y_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y_.apply(null,arguments)}function eD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eD(Object(n),!0).forEach(function(r){Fue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fue(e,t,n){return(t=que(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function que(e){var t=Kue(e,"string");return typeof t=="symbol"?t:t+""}function Kue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vue(e,t){if(e==null)return{};var n,r,a=Yue(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Yue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Gue=(e,t,n,r,a,i)=>"M".concat(e,",").concat(a,"v").concat(r,"M").concat(i,",").concat(t,"h").concat(n),Xue=e=>{var{x:t=0,y:n=0,top:r=0,left:a=0,width:i=0,height:s=0,className:c}=e,u=Vue(e,Uue),d=Hue({x:t,y:n,top:r,left:a,width:i,height:s},u);return!Oe(t)||!Oe(n)||!Oe(i)||!Oe(s)||!Oe(r)||!Oe(a)?null:x.createElement("path",y_({},Nr(d),{className:dt("recharts-cross",c),d:Gue(t,n,i,s,r,a)}))};function Wue(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function tD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tD(Object(n),!0).forEach(function(r){Que(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Que(e,t,n){return(t=Zue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zue(e){var t=Jue(e,"string");return typeof t=="symbol"?t:t+""}function Jue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ede=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),B6=(e,t,n)=>e.map(r=>"".concat(ede(r)," ").concat(t,"ms ").concat(n)).join(","),tde=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(a=>r.includes(a))),Jh=(e,t)=>Object.keys(t).reduce((n,r)=>nD(nD({},n),{},{[r]:e(r,t[r])}),{});function rD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rD(Object(n),!0).forEach(function(r){nde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nde(e,t,n){return(t=rde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rde(e){var t=ade(e,"string");return typeof t=="symbol"?t:t+""}function ade(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uy=(e,t,n)=>e+(t-e)*n,x_=e=>{var{from:t,to:n}=e;return t!==n},U6=(e,t,n)=>{var r=Jh((a,i)=>{if(x_(i)){var[s,c]=e(i.from,i.to,i.velocity);return kn(kn({},i),{},{from:s,velocity:c})}return i},t);return n<1?Jh((a,i)=>x_(i)&&r[a]!=null?kn(kn({},i),{},{velocity:uy(i.velocity,r[a].velocity,n),from:uy(i.from,r[a].from,n)}):i,t):U6(e,r,n-1)};function ide(e,t,n,r,a,i){var s,c=r.reduce((v,g)=>kn(kn({},v),{},{[g]:{from:e[g],velocity:0,to:t[g]}}),{}),u=()=>Jh((v,g)=>g.from,c),d=()=>!Object.values(c).filter(x_).length,m=null,f=v=>{s||(s=v);var g=v-s,b=g/n.dt;c=U6(n,c,b),a(kn(kn(kn({},e),t),u())),s=v,d()||(m=i.setTimeout(f))};return()=>(m=i.setTimeout(f),()=>{var v;(v=m)===null||v===void 0||v()})}function ode(e,t,n,r,a,i,s){var c=null,u=a.reduce((f,v)=>{var g=e[v],b=t[v];return g==null||b==null?f:kn(kn({},f),{},{[v]:[g,b]})},{}),d,m=f=>{d||(d=f);var v=(f-d)/r,g=Jh((w,S)=>uy(...S,n(v)),u);if(i(kn(kn(kn({},e),t),g)),v<1)c=s.setTimeout(m);else{var b=Jh((w,S)=>uy(...S,n(1)),u);i(kn(kn(kn({},e),t),b))}};return()=>(c=s.setTimeout(m),()=>{var f;(f=c)===null||f===void 0||f()})}const sde=(e,t,n,r,a,i)=>{var s=tde(e,t);return n==null?()=>(a(kn(kn({},e),t)),()=>{}):n.isStepper===!0?ide(e,t,n,s,a,i):ode(e,t,n,r,s,a,i)};var dy=1e-4,H6=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],F6=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),aD=(e,t)=>n=>{var r=H6(e,t);return F6(r,n)},lde=(e,t)=>n=>{var r=H6(e,t),a=[...r.map((i,s)=>i*s).slice(1),0];return F6(a,n)},cde=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var a=r.map(i=>parseFloat(i));return[a[0],a[1],a[2],a[3]]},ude=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var a=cde(n[0]);if(a)return a}}return n.length===4?n:[0,0,1,1]},dde=(e,t,n,r)=>{var a=aD(e,n),i=aD(t,r),s=lde(e,n),c=d=>d>1?1:d<0?0:d,u=d=>{for(var m=d>1?1:d,f=m,v=0;v<8;++v){var g=a(f)-m,b=s(f);if(Math.abs(g-m)<dy||b<dy)return i(f);f=c(f-g/b)}return i(f)};return u.isStepper=!1,u},iD=function(){return dde(...ude(...arguments))},fde=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:a=17}=t,i=(s,c,u)=>{var d=-(s-c)*n,m=u*r,f=u+(d-m)*a/1e3,v=u*a/1e3+s;return Math.abs(v-c)<dy&&Math.abs(f)<dy?[c,0]:[v,f]};return i.isStepper=!0,i.dt=a,i},hde=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return iD(e);case"spring":return fde();default:if(e.split("(")[0]==="cubic-bezier")return iD(e)}return typeof e=="function"?e:null};function mde(e){var t,n=()=>null,r=!1,a=null,i=s=>{if(!r){if(Array.isArray(s)){if(!s.length)return;var c=s,[u,...d]=c;if(typeof u=="number"){a=e.setTimeout(i.bind(null,d),u);return}i(u),a=e.setTimeout(i.bind(null,d));return}typeof s=="string"&&(t=s,n(t)),typeof s=="object"&&(t=s,n(t)),typeof s=="function"&&s()}};return{stop:()=>{r=!0},start:s=>{r=!1,a&&(a(),a=null),i(s)},subscribe:s=>(n=s,()=>{n=()=>null}),getTimeoutController:()=>e}}class pde{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),a=null,i=s=>{s-r>=n?t(s):typeof requestAnimationFrame=="function"&&(a=requestAnimationFrame(i))};return a=requestAnimationFrame(i),()=>{a!=null&&cancelAnimationFrame(a)}}}function vde(){return mde(new pde)}var gde=x.createContext(vde);function yde(e,t){var n=x.useContext(gde);return x.useMemo(()=>t??n(e),[e,t,n])}var xde={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},oD={t:0},xS={t:1};function Fm(e){var t=Cn(e,xde),{isActive:n,canBegin:r,duration:a,easing:i,begin:s,onAnimationEnd:c,onAnimationStart:u,children:d}=t,m=z6(),f=n==="auto"?!Hm.isSsr&&!m:n,v=yde(t.animationId,t.animationManager),[g,b]=x.useState(f?oD:xS),w=x.useRef(null);return x.useEffect(()=>{f||b(xS)},[f]),x.useEffect(()=>{if(!f||!r)return Ol;var S=sde(oD,xS,hde(i),a,b,v.getTimeoutController()),E=()=>{w.current=S()};return v.start([u,s,E,a,c]),()=>{v.stop(),w.current&&w.current(),c()}},[f,r,a,i,s,u,c,v]),d(g.t)}function qm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Vh(t)),r=x.useRef(e);return r.current!==e&&(n.current=Vh(t),r.current=e),n.current}var bde=["radius"],wde=["radius"],sD,lD,cD,uD,dD,fD,hD,mD,pD,vD;function gD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function yD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gD(Object(n),!0).forEach(function(r){Sde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sde(e,t,n){return(t=Ede(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ede(e){var t=_de(e,"string");return typeof t=="symbol"?t:t+""}function _de(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fy(){return fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fy.apply(null,arguments)}function xD(e,t){if(e==null)return{};var n,r,a=jde(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function jde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ei(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bD=(e,t,n,r,a)=>{var i=rl(n),s=rl(r),c=Math.min(Math.abs(i)/2,Math.abs(s)/2),u=s>=0?1:-1,d=i>=0?1:-1,m=s>=0&&i>=0||s<0&&i<0?1:0,f;if(c>0&&Array.isArray(a)){for(var v=[0,0,0,0],g=0,b=4;g<b;g++){var w,S=(w=a[g])!==null&&w!==void 0?w:0;v[g]=S>c?c:S}f=an(sD||(sD=Ei(["M",",",""])),e,t+u*v[0]),v[0]>0&&(f+=an(lD||(lD=Ei(["A ",",",",0,0,",",",",",""])),v[0],v[0],m,e+d*v[0],t)),f+=an(cD||(cD=Ei(["L ",",",""])),e+n-d*v[1],t),v[1]>0&&(f+=an(uD||(uD=Ei(["A ",",",",0,0,",`,
        `,",",""])),v[1],v[1],m,e+n,t+u*v[1])),f+=an(dD||(dD=Ei(["L ",",",""])),e+n,t+r-u*v[2]),v[2]>0&&(f+=an(fD||(fD=Ei(["A ",",",",0,0,",`,
        `,",",""])),v[2],v[2],m,e+n-d*v[2],t+r)),f+=an(hD||(hD=Ei(["L ",",",""])),e+d*v[3],t+r),v[3]>0&&(f+=an(mD||(mD=Ei(["A ",",",",0,0,",`,
        `,",",""])),v[3],v[3],m,e,t+r-u*v[3])),f+="Z"}else if(c>0&&a===+a&&a>0){var E=Math.min(c,a);f=an(pD||(pD=Ei(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+u*E,E,E,m,e+d*E,t,e+n-d*E,t,E,E,m,e+n,t+u*E,e+n,t+r-u*E,E,E,m,e+n-d*E,t+r,e+d*E,t+r,E,E,m,e,t+r-u*E)}else f=an(vD||(vD=Ei(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},wD={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},q6=e=>{var t=Cn(e,wD),n=x.useRef(null),[r,a]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var H=n.current.getTotalLength();H&&a(H)}catch{}},[]);var{x:i,y:s,width:c,height:u,radius:d,className:m}=t,{animationEasing:f,animationDuration:v,animationBegin:g,isAnimationActive:b,isUpdateAnimationActive:w}=t,S=x.useRef(c),E=x.useRef(u),O=x.useRef(i),j=x.useRef(s),A=x.useMemo(()=>({x:i,y:s,width:c,height:u,radius:d}),[i,s,c,u,d]),N=qm(A,"rectangle-");if(i!==+i||s!==+s||c!==+c||u!==+u||c===0||u===0)return null;var T=dt("recharts-rectangle",m);if(!w){var P=Nr(t),{radius:R}=P,D=xD(P,bde);return x.createElement("path",fy({},D,{x:rl(i),y:rl(s),width:rl(c),height:rl(u),radius:typeof d=="number"?d:void 0,className:T,d:bD(i,s,c,u,d)}))}var K=S.current,z=E.current,I=O.current,G=j.current,L="0px ".concat(r===-1?1:r,"px"),Y="".concat(r,"px ").concat(r,"px"),k=B6(["strokeDasharray"],v,typeof f=="string"?f:wD.animationEasing);return x.createElement(Fm,{animationId:N,key:N,canBegin:r>0,duration:v,easing:f,isActive:w,begin:g},H=>{var q=Vt(K,c,H),F=Vt(z,u,H),V=Vt(I,i,H),B=Vt(G,s,H);n.current&&(S.current=q,E.current=F,O.current=V,j.current=B);var $;b?H>0?$={transition:k,strokeDasharray:Y}:$={strokeDasharray:L}:$={strokeDasharray:Y};var X=Nr(t),{radius:Z}=X,ee=xD(X,wde);return x.createElement("path",fy({},ee,{radius:typeof d=="number"?d:void 0,className:T,d:bD(V,B,q,F,d),ref:n,style:yD(yD({},$),t.style)}))})};function SD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ED(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SD(Object(n),!0).forEach(function(r){Cde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cde(e,t,n){return(t=Ode(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ode(e){var t=Ade(e,"string");return typeof t=="symbol"?t:t+""}function Ade(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hy=Math.PI/180,Nde=e=>e*180/Math.PI,En=(e,t,n,r)=>({x:e+Math.cos(-hy*r)*n,y:t+Math.sin(-hy*r)*n}),K6=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Tde=(e,t)=>{var{x:n,y:r}=e,{x:a,y:i}=t;return Math.sqrt((n-a)**2+(r-i)**2)},Pde=(e,t)=>{var{x:n,y:r}=e,{cx:a,cy:i}=t,s=Tde({x:n,y:r},{x:a,y:i});if(s<=0)return{radius:s,angle:0};var c=(n-a)/s,u=Math.acos(c);return r>i&&(u=2*Math.PI-u),{radius:s,angle:Nde(u),angleInRadian:u}},Mde=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),a=Math.floor(n/360),i=Math.min(r,a);return{startAngle:t-i*360,endAngle:n-i*360}},kde=(e,t)=>{var{startAngle:n,endAngle:r}=t,a=Math.floor(n/360),i=Math.floor(r/360),s=Math.min(a,i);return e+s*360},Rde=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:a,angle:i}=Pde({x:n,y:r},t),{innerRadius:s,outerRadius:c}=t;if(a<s||a>c||a===0)return null;var{startAngle:u,endAngle:d}=Mde(t),m=i,f;if(u<=d){for(;m>d;)m-=360;for(;m<u;)m+=360;f=m>=u&&m<=d}else{for(;m>u;)m-=360;for(;m<d;)m+=360;f=m>=d&&m<=u}return f?ED(ED({},t),{},{radius:a,angle:kde(m,t)}):null};function V6(e){var{cx:t,cy:n,radius:r,startAngle:a,endAngle:i}=e,s=En(t,n,r,a),c=En(t,n,r,i);return{points:[s,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}var _D,jD,CD,OD,AD,ND,TD;function b_(){return b_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b_.apply(null,arguments)}function lc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Dde=(e,t)=>{var n=Vn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Gv=e=>{var{cx:t,cy:n,radius:r,angle:a,sign:i,isExternal:s,cornerRadius:c,cornerIsExternal:u}=e,d=c*(s?1:-1)+r,m=Math.asin(c/d)/hy,f=u?a:a+i*m,v=En(t,n,d,f),g=En(t,n,r,f),b=u?a-i*m:a,w=En(t,n,d*Math.cos(m*hy),b);return{center:v,circleTangency:g,lineTangency:w,theta:m}},Y6=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:a,startAngle:i,endAngle:s}=e,c=Dde(i,s),u=i+c,d=En(t,n,a,i),m=En(t,n,a,u),f=an(_D||(_D=lc(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),d.x,d.y,a,a,+(Math.abs(c)>180),+(i>u),m.x,m.y);if(r>0){var v=En(t,n,r,i),g=En(t,n,r,u);f+=an(jD||(jD=lc(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),g.x,g.y,r,r,+(Math.abs(c)>180),+(i<=u),v.x,v.y)}else f+=an(CD||(CD=lc(["L ",","," Z"])),t,n);return f},Ide=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:a,cornerRadius:i,forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:d}=e,m=Vn(d-u),{circleTangency:f,lineTangency:v,theta:g}=Gv({cx:t,cy:n,radius:a,angle:u,sign:m,cornerRadius:i,cornerIsExternal:c}),{circleTangency:b,lineTangency:w,theta:S}=Gv({cx:t,cy:n,radius:a,angle:d,sign:-m,cornerRadius:i,cornerIsExternal:c}),E=c?Math.abs(u-d):Math.abs(u-d)-g-S;if(E<0)return s?an(OD||(OD=lc(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),v.x,v.y,i,i,i*2,i,i,-i*2):Y6({cx:t,cy:n,innerRadius:r,outerRadius:a,startAngle:u,endAngle:d});var O=an(AD||(AD=lc(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),v.x,v.y,i,i,+(m<0),f.x,f.y,a,a,+(E>180),+(m<0),b.x,b.y,i,i,+(m<0),w.x,w.y);if(r>0){var{circleTangency:j,lineTangency:A,theta:N}=Gv({cx:t,cy:n,radius:r,angle:u,sign:m,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),{circleTangency:T,lineTangency:P,theta:R}=Gv({cx:t,cy:n,radius:r,angle:d,sign:-m,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),D=c?Math.abs(u-d):Math.abs(u-d)-N-R;if(D<0&&i===0)return"".concat(O,"L").concat(t,",").concat(n,"Z");O+=an(ND||(ND=lc(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),P.x,P.y,i,i,+(m<0),T.x,T.y,r,r,+(D>180),+(m>0),j.x,j.y,i,i,+(m<0),A.x,A.y)}else O+=an(TD||(TD=lc(["L",",","Z"])),t,n);return O},Lde={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},G6=e=>{var t=Cn(e,Lde),{cx:n,cy:r,innerRadius:a,outerRadius:i,cornerRadius:s,forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:m,className:f}=t;if(i<a||d===m)return null;var v=dt("recharts-sector",f),g=i-a,b=yr(s,g,0,!0),w;return b>0&&Math.abs(d-m)<360?w=Ide({cx:n,cy:r,innerRadius:a,outerRadius:i,cornerRadius:Math.min(b,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:m}):w=Y6({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:d,endAngle:m}),x.createElement("path",b_({},Nr(t),{className:v,d:w}))};function zde(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(S8(t)){if(e==="centric"){var{cx:r,cy:a,innerRadius:i,outerRadius:s,angle:c}=t,u=En(r,a,i,c),d=En(r,a,s,c);return[{x:u.x,y:u.y},{x:d.x,y:d.y}]}return V6(t)}}var bS={},wS={},SS={},PD;function $de(){return PD||(PD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=I8();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(SS)),SS}var MD;function Bde(){return MD||(MD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$de();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(wS)),wS}var kD;function Ude(){return kD||(kD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=L8(),n=Bde();function r(a,i,s){s&&typeof s!="number"&&t.isIterateeCall(a,i,s)&&(i=s=void 0),a=n.toFinite(a),i===void 0?(i=a,a=0):i=n.toFinite(i),s=s===void 0?a<i?1:-1:n.toFinite(s);const c=Math.max(Math.ceil((i-a)/(s||1)),0),u=new Array(c);for(let d=0;d<c;d++)u[d]=a,a+=s;return u}e.range=r})(bS)),bS}var ES,RD;function Hde(){return RD||(RD=1,ES=Ude().range),ES}var Fde=Hde();const X6=ci(Fde);var Jo=e=>e.chartData,q0=se([Jo],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),JC=(e,t,n,r)=>r?q0(e):Jo(e),qde=(e,t,n)=>n?q0(e):Jo(e);function Ii(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ct(t)&&ct(n))return!0}return!1}function DD(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function W6(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,a,i;if(ct(n))a=n;else if(typeof n=="function")return;if(ct(r))i=r;else if(typeof r=="function")return;var s=[a,i];if(Ii(s))return s}}function Kde(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Ii(r))return DD(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[a,i]=e,s,c;if(a==="auto")t!=null&&(s=Math.min(...t));else if(Oe(a))s=a;else if(typeof a=="function")try{t!=null&&(s=a(t==null?void 0:t[0]))}catch{}else if(typeof a=="string"&&_R.test(a)){var u=_R.exec(a);if(u==null||u[1]==null||t==null)s=void 0;else{var d=+u[1];s=t[0]-d}}else s=t==null?void 0:t[0];if(i==="auto")t!=null&&(c=Math.max(...t));else if(Oe(i))c=i;else if(typeof i=="function")try{t!=null&&(c=i(t==null?void 0:t[1]))}catch{}else if(typeof i=="string"&&jR.test(i)){var m=jR.exec(i);if(m==null||m[1]==null||t==null)c=void 0;else{var f=+m[1];c=t[1]+f}}else c=t==null?void 0:t[1];var v=[s,c];if(Ii(v))return t==null?v:DD(v,t,n)}}}var tf=1e9,Vde={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},tO,Gt=!0,La="[DecimalError] ",Ec=La+"Invalid argument: ",eO=La+"Exponent out of range: ",nf=Math.floor,ic=Math.pow,Yde=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,la,Kn=1e7,Ft=7,Q6=9007199254740991,my=nf(Q6/Ft),Ae={};Ae.absoluteValue=Ae.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ae.comparedTo=Ae.cmp=function(e){var t,n,r,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Ae.decimalPlaces=Ae.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ft;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ae.dividedBy=Ae.div=function(e){return Po(this,new this.constructor(e))};Ae.dividedToIntegerBy=Ae.idiv=function(e){var t=this,n=t.constructor;return Dt(Po(t,new n(e),0,1),n.precision)};Ae.equals=Ae.eq=function(e){return!this.cmp(e)};Ae.exponent=function(){return jn(this)};Ae.greaterThan=Ae.gt=function(e){return this.cmp(e)>0};Ae.greaterThanOrEqualTo=Ae.gte=function(e){return this.cmp(e)>=0};Ae.isInteger=Ae.isint=function(){return this.e>this.d.length-2};Ae.isNegative=Ae.isneg=function(){return this.s<0};Ae.isPositive=Ae.ispos=function(){return this.s>0};Ae.isZero=function(){return this.s===0};Ae.lessThan=Ae.lt=function(e){return this.cmp(e)<0};Ae.lessThanOrEqualTo=Ae.lte=function(e){return this.cmp(e)<1};Ae.logarithm=Ae.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(la))throw Error(La+"NaN");if(n.s<1)throw Error(La+(n.s?"NaN":"-Infinity"));return n.eq(la)?new r(0):(Gt=!1,t=Po(em(n,i),em(e,i),i),Gt=!0,Dt(t,a))};Ae.minus=Ae.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?eU(t,e):Z6(t,(e.s=-e.s,e))};Ae.modulo=Ae.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(La+"NaN");return n.s?(Gt=!1,t=Po(n,e,0,1).times(e),Gt=!0,n.minus(t)):Dt(new r(n),a)};Ae.naturalExponential=Ae.exp=function(){return J6(this)};Ae.naturalLogarithm=Ae.ln=function(){return em(this)};Ae.negated=Ae.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ae.plus=Ae.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Z6(t,e):eU(t,(e.s=-e.s,e))};Ae.precision=Ae.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ec+e);if(t=jn(a)+1,r=a.d.length-1,n=r*Ft+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ae.squareRoot=Ae.sqrt=function(){var e,t,n,r,a,i,s,c=this,u=c.constructor;if(c.s<1){if(!c.s)return new u(0);throw Error(La+"NaN")}for(e=jn(c),Gt=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ki(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=nf((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new u(t)):r=new u(a.toString()),n=u.precision,a=s=n+3;;)if(i=r,r=i.plus(Po(c,i,s+2)).times(.5),ki(i.d).slice(0,s)===(t=ki(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(Dt(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;s+=4}return Gt=!0,Dt(r,n)};Ae.times=Ae.mul=function(e){var t,n,r,a,i,s,c,u,d,m=this,f=m.constructor,v=m.d,g=(e=new f(e)).d;if(!m.s||!e.s)return new f(0);for(e.s*=m.s,n=m.e+e.e,u=v.length,d=g.length,u<d&&(i=v,v=g,g=i,s=u,u=d,d=s),i=[],s=u+d,r=s;r--;)i.push(0);for(r=d;--r>=0;){for(t=0,a=u+r;a>r;)c=i[a]+g[r]*v[a-r-1]+t,i[a--]=c%Kn|0,t=c/Kn|0;i[a]=(i[a]+t)%Kn|0}for(;!i[--s];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,Gt?Dt(e,f.precision):e};Ae.toDecimalPlaces=Ae.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ki(e,0,tf),t===void 0?t=r.rounding:Ki(t,0,8),Dt(n,e+jn(n)+1,t))};Ae.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Uc(r,!0):(Ki(e,0,tf),t===void 0?t=a.rounding:Ki(t,0,8),r=Dt(new a(r),e+1,t),n=Uc(r,!0,e+1)),n};Ae.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Uc(a):(Ki(e,0,tf),t===void 0?t=i.rounding:Ki(t,0,8),r=Dt(new i(a),e+jn(a)+1,t),n=Uc(r.abs(),!1,e+jn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ae.toInteger=Ae.toint=function(){var e=this,t=e.constructor;return Dt(new t(e),jn(e)+1,t.rounding)};Ae.toNumber=function(){return+this};Ae.toPower=Ae.pow=function(e){var t,n,r,a,i,s,c=this,u=c.constructor,d=12,m=+(e=new u(e));if(!e.s)return new u(la);if(c=new u(c),!c.s){if(e.s<1)throw Error(La+"Infinity");return c}if(c.eq(la))return c;if(r=u.precision,e.eq(la))return Dt(c,r);if(t=e.e,n=e.d.length-1,s=t>=n,i=c.s,s){if((n=m<0?-m:m)<=Q6){for(a=new u(la),t=Math.ceil(r/Ft+4),Gt=!1;n%2&&(a=a.times(c),LD(a.d,t)),n=nf(n/2),n!==0;)c=c.times(c),LD(c.d,t);return Gt=!0,e.s<0?new u(la).div(a):Dt(a,r)}}else if(i<0)throw Error(La+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Gt=!1,a=e.times(em(c,r+d)),Gt=!0,a=J6(a),a.s=i,a};Ae.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=jn(a),r=Uc(a,n<=i.toExpNeg||n>=i.toExpPos)):(Ki(e,1,tf),t===void 0?t=i.rounding:Ki(t,0,8),a=Dt(new i(a),e,t),n=jn(a),r=Uc(a,e<=n||n<=i.toExpNeg,e)),r};Ae.toSignificantDigits=Ae.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ki(e,1,tf),t===void 0?t=r.rounding:Ki(t,0,8)),Dt(new r(n),e,t)};Ae.toString=Ae.valueOf=Ae.val=Ae.toJSON=Ae[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=jn(e),n=e.constructor;return Uc(e,t<=n.toExpNeg||t>=n.toExpPos)};function Z6(e,t){var n,r,a,i,s,c,u,d,m=e.constructor,f=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Gt?Dt(t,f):t;if(u=e.d,d=t.d,s=e.e,a=t.e,u=u.slice(),i=s-a,i){for(i<0?(r=u,i=-i,c=d.length):(r=d,a=s,c=u.length),s=Math.ceil(f/Ft),c=s>c?s+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=u.length,i=d.length,c-i<0&&(i=c,r=d,d=u,u=r),n=0;i;)n=(u[--i]=u[i]+d[i]+n)/Kn|0,u[i]%=Kn;for(n&&(u.unshift(n),++a),c=u.length;u[--c]==0;)u.pop();return t.d=u,t.e=a,Gt?Dt(t,f):t}function Ki(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ec+e)}function ki(e){var t,n,r,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,t=1;t<a;t++)r=e[t]+"",n=Ft-r.length,n&&(i+=Hs(n)),i+=r;s=e[t],r=s+"",n=Ft-r.length,n&&(i+=Hs(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}var Po=(function(){function e(r,a){var i,s=0,c=r.length;for(r=r.slice();c--;)i=r[c]*a+s,r[c]=i%Kn|0,s=i/Kn|0;return s&&r.unshift(s),r}function t(r,a,i,s){var c,u;if(i!=s)u=i>s?1:-1;else for(c=u=0;c<i;c++)if(r[c]!=a[c]){u=r[c]>a[c]?1:-1;break}return u}function n(r,a,i){for(var s=0;i--;)r[i]-=s,s=r[i]<a[i]?1:0,r[i]=s*Kn+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,s){var c,u,d,m,f,v,g,b,w,S,E,O,j,A,N,T,P,R,D=r.constructor,K=r.s==a.s?1:-1,z=r.d,I=a.d;if(!r.s)return new D(r);if(!a.s)throw Error(La+"Division by zero");for(u=r.e-a.e,P=I.length,N=z.length,g=new D(K),b=g.d=[],d=0;I[d]==(z[d]||0);)++d;if(I[d]>(z[d]||0)&&--u,i==null?O=i=D.precision:s?O=i+(jn(r)-jn(a))+1:O=i,O<0)return new D(0);if(O=O/Ft+2|0,d=0,P==1)for(m=0,I=I[0],O++;(d<N||m)&&O--;d++)j=m*Kn+(z[d]||0),b[d]=j/I|0,m=j%I|0;else{for(m=Kn/(I[0]+1)|0,m>1&&(I=e(I,m),z=e(z,m),P=I.length,N=z.length),A=P,w=z.slice(0,P),S=w.length;S<P;)w[S++]=0;R=I.slice(),R.unshift(0),T=I[0],I[1]>=Kn/2&&++T;do m=0,c=t(I,w,P,S),c<0?(E=w[0],P!=S&&(E=E*Kn+(w[1]||0)),m=E/T|0,m>1?(m>=Kn&&(m=Kn-1),f=e(I,m),v=f.length,S=w.length,c=t(f,w,v,S),c==1&&(m--,n(f,P<v?R:I,v))):(m==0&&(c=m=1),f=I.slice()),v=f.length,v<S&&f.unshift(0),n(w,f,S),c==-1&&(S=w.length,c=t(I,w,P,S),c<1&&(m++,n(w,P<S?R:I,S))),S=w.length):c===0&&(m++,w=[0]),b[d++]=m,c&&w[0]?w[S++]=z[A]||0:(w=[z[A]],S=1);while((A++<N||w[0]!==void 0)&&O--)}return b[0]||b.shift(),g.e=u,Dt(g,s?i+jn(g)+1:i)}})();function J6(e,t){var n,r,a,i,s,c,u=0,d=0,m=e.constructor,f=m.precision;if(jn(e)>16)throw Error(eO+jn(e));if(!e.s)return new m(la);for(Gt=!1,c=f,s=new m(.03125);e.abs().gte(.1);)e=e.times(s),d+=5;for(r=Math.log(ic(2,d))/Math.LN10*2+5|0,c+=r,n=a=i=new m(la),m.precision=c;;){if(a=Dt(a.times(e),c),n=n.times(++u),s=i.plus(Po(a,n,c)),ki(s.d).slice(0,c)===ki(i.d).slice(0,c)){for(;d--;)i=Dt(i.times(i),c);return m.precision=f,t==null?(Gt=!0,Dt(i,f)):i}i=s}}function jn(e){for(var t=e.e*Ft,n=e.d[0];n>=10;n/=10)t++;return t}function _S(e,t,n){if(t>e.LN10.sd())throw Gt=!0,n&&(e.precision=n),Error(La+"LN10 precision limit exceeded");return Dt(new e(e.LN10),t)}function Hs(e){for(var t="";e--;)t+="0";return t}function em(e,t){var n,r,a,i,s,c,u,d,m,f=1,v=10,g=e,b=g.d,w=g.constructor,S=w.precision;if(g.s<1)throw Error(La+(g.s?"NaN":"-Infinity"));if(g.eq(la))return new w(0);if(t==null?(Gt=!1,d=S):d=t,g.eq(10))return t==null&&(Gt=!0),_S(w,d);if(d+=v,w.precision=d,n=ki(b),r=n.charAt(0),i=jn(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ki(g.d),r=n.charAt(0),f++;i=jn(g),r>1?(g=new w("0."+n),i++):g=new w(r+"."+n.slice(1))}else return u=_S(w,d+2,S).times(i+""),g=em(new w(r+"."+n.slice(1)),d-v).plus(u),w.precision=S,t==null?(Gt=!0,Dt(g,S)):g;for(c=s=g=Po(g.minus(la),g.plus(la),d),m=Dt(g.times(g),d),a=3;;){if(s=Dt(s.times(m),d),u=c.plus(Po(s,new w(a),d)),ki(u.d).slice(0,d)===ki(c.d).slice(0,d))return c=c.times(2),i!==0&&(c=c.plus(_S(w,d+2,S).times(i+""))),c=Po(c,new w(f),d),w.precision=S,t==null?(Gt=!0,Dt(c,S)):c;c=u,a+=2}}function ID(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=nf(n/Ft),e.d=[],r=(n+1)%Ft,n<0&&(r+=Ft),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=Ft;r<a;)e.d.push(+t.slice(r,r+=Ft));t=t.slice(r),r=Ft-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),Gt&&(e.e>my||e.e<-my))throw Error(eO+n)}else e.s=0,e.e=0,e.d=[0];return e}function Dt(e,t,n){var r,a,i,s,c,u,d,m,f=e.d;for(s=1,i=f[0];i>=10;i/=10)s++;if(r=t-s,r<0)r+=Ft,a=t,d=f[m=0];else{if(m=Math.ceil((r+1)/Ft),i=f.length,m>=i)return e;for(d=i=f[m],s=1;i>=10;i/=10)s++;r%=Ft,a=r-Ft+s}if(n!==void 0&&(i=ic(10,s-a-1),c=d/i%10|0,u=t<0||f[m+1]!==void 0||d%i,u=n<4?(c||u)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||u||n==6&&(r>0?a>0?d/ic(10,s-a):0:f[m-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return u?(i=jn(e),f.length=1,t=t-i-1,f[0]=ic(10,(Ft-t%Ft)%Ft),e.e=nf(-t/Ft)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=m,i=1,m--):(f.length=m+1,i=ic(10,Ft-r),f[m]=a>0?(d/ic(10,s-a)%ic(10,a)|0)*i:0),u)for(;;)if(m==0){(f[0]+=i)==Kn&&(f[0]=1,++e.e);break}else{if(f[m]+=i,f[m]!=Kn)break;f[m--]=0,i=1}for(r=f.length;f[--r]===0;)f.pop();if(Gt&&(e.e>my||e.e<-my))throw Error(eO+jn(e));return e}function eU(e,t){var n,r,a,i,s,c,u,d,m,f,v=e.constructor,g=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),Gt?Dt(t,g):t;if(u=e.d,f=t.d,r=t.e,d=e.e,u=u.slice(),s=d-r,s){for(m=s<0,m?(n=u,s=-s,c=f.length):(n=f,r=d,c=u.length),a=Math.max(Math.ceil(g/Ft),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=u.length,c=f.length,m=a<c,m&&(c=a),a=0;a<c;a++)if(u[a]!=f[a]){m=u[a]<f[a];break}s=0}for(m&&(n=u,u=f,f=n,t.s=-t.s),c=u.length,a=f.length-c;a>0;--a)u[c++]=0;for(a=f.length;a>s;){if(u[--a]<f[a]){for(i=a;i&&u[--i]===0;)u[i]=Kn-1;--u[i],u[a]+=Kn}u[a]-=f[a]}for(;u[--c]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(t.d=u,t.e=r,Gt?Dt(t,g):t):new v(0)}function Uc(e,t,n){var r,a=jn(e),i=ki(e.d),s=i.length;return t?(n&&(r=n-s)>0?i=i.charAt(0)+"."+i.slice(1)+Hs(r):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Hs(-a-1)+i,n&&(r=n-s)>0&&(i+=Hs(r))):a>=s?(i+=Hs(a+1-s),n&&(r=n-a-1)>0&&(i=i+"."+Hs(r))):((r=a+1)<s&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-s)>0&&(a+1===s&&(i+="."),i+=Hs(r))),e.s<0?"-"+i:i}function LD(e,t){if(e.length>t)return e.length=t,!0}function tU(e){var t,n,r;function a(i){var s=this;if(!(s instanceof a))return new a(i);if(s.constructor=a,i instanceof a){s.s=i.s,s.e=i.e,s.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Ec+i);if(i>0)s.s=1;else if(i<0)i=-i,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(i===~~i&&i<1e7){s.e=0,s.d=[i];return}return ID(s,i.toString())}else if(typeof i!="string")throw Error(Ec+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,Yde.test(i))ID(s,i);else throw Error(Ec+i)}if(a.prototype=Ae,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=tU,a.config=a.set=Gde,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function Gde(e){if(!e||typeof e!="object")throw Error(La+"Object expected");var t,n,r,a=["precision",1,tf,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(nf(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Ec+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ec+n+": "+r);return this}var tO=tU(Vde);la=new tO(1);const lt=tO;function nU(e){var t;return e===0?t=1:t=Math.floor(new lt(e).abs().log(10).toNumber())+1,t}function rU(e,t,n){for(var r=new lt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var aU=e=>{var[t,n]=e,[r,a]=[t,n];return t>n&&([r,a]=[n,t]),[r,a]},nO=(e,t,n)=>{if(e.lte(0))return new lt(0);var r=nU(e.toNumber()),a=new lt(10).pow(r),i=e.div(a),s=r!==1?.05:.1,c=new lt(Math.ceil(i.div(s).toNumber())).add(n).mul(s),u=c.mul(a);return t?new lt(u.toNumber()):new lt(Math.ceil(u.toNumber()))},iU=(e,t,n)=>{var r;if(e.lte(0))return new lt(0);var a=[1,2,2.5,5],i=e.toNumber(),s=Math.floor(new lt(i).abs().log(10).toNumber()),c=new lt(10).pow(s),u=e.div(c).toNumber(),d=a.findIndex(g=>g>=u-1e-10);if(d===-1&&(c=c.mul(10),d=0),d+=n,d>=a.length){var m=Math.floor(d/a.length);d%=a.length,c=c.mul(new lt(10).pow(m))}var f=(r=a[d])!==null&&r!==void 0?r:1,v=new lt(f).mul(c);return t?v:new lt(Math.ceil(v.toNumber()))},Xde=(e,t,n)=>{var r=new lt(1),a=new lt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new lt(10).pow(nU(e)-1),a=new lt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new lt(Math.floor(e)))}else e===0?a=new lt(Math.floor((t-1)/2)):n||(a=new lt(Math.floor(e)));for(var s=Math.floor((t-1)/2),c=[],u=0;u<t;u++)c.push(a.add(new lt(u-s).mul(r)).toNumber());return c},oU=function(t,n,r,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:nO;if(!Number.isFinite((n-t)/(r-1)))return{step:new lt(0),tickMin:new lt(0),tickMax:new lt(0)};var c=s(new lt(n).sub(t).div(r-1),a,i),u;t<=0&&n>=0?u=new lt(0):(u=new lt(t).add(n).div(2),u=u.sub(new lt(u).mod(c)));var d=Math.ceil(u.sub(t).div(c).toNumber()),m=Math.ceil(new lt(n).sub(u).div(c).toNumber()),f=d+m+1;return f>r?oU(t,n,r,a,i+1,s):(f<r&&(m=n>0?m+(r-f):m,d=n>0?d:d+(r-f)),{step:c,tickMin:u.sub(new lt(d).mul(c)),tickMax:u.add(new lt(m).mul(c))})},zD=function(t){var[n,r]=t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(a,2),[u,d]=aU([n,r]);if(u===-1/0||d===1/0){var m=d===1/0?[u,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),d];return n>r?m.reverse():m}if(u===d)return Xde(u,a,i);var f=s==="snap125"?iU:nO,{step:v,tickMin:g,tickMax:b}=oU(u,d,c,i,0,f),w=rU(g,b.add(new lt(.1).mul(v)),v);return n>r?w.reverse():w},$D=function(t,n){var[r,a]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,u]=aU([r,a]);if(c===-1/0||u===1/0)return[r,a];if(c===u)return[c];var d=s==="snap125"?iU:nO,m=Math.max(n,2),f=d(new lt(u).sub(c).div(m-1),i,0),v=[...rU(new lt(c),new lt(u),f),u];return i===!1&&(v=v.map(g=>Math.round(g))),r>a?v.reverse():v},sU=e=>e.rootProps.maxBarSize,Wde=e=>e.rootProps.barGap,lU=e=>e.rootProps.barCategoryGap,Qde=e=>e.rootProps.barSize,Km=e=>e.rootProps.stackOffset,cU=e=>e.rootProps.reverseStackOrder,rO=e=>e.options.chartName,aO=e=>e.rootProps.syncId,uU=e=>e.rootProps.syncMethod,iO=e=>e.options.eventEmitter,_n={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Zl={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},_i={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},K0=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function V0(e,t,n){if(n!=="auto")return n;if(e!=null)return Wo(e,t)?"category":"number"}function BD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function py(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BD(Object(n),!0).forEach(function(r){Zde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zde(e,t,n){return(t=Jde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jde(e){var t=efe(e,"string");return typeof t=="symbol"?t:t+""}function efe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UD={allowDataOverflow:Zl.allowDataOverflow,allowDecimals:Zl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Zl.angleAxisId,includeHidden:!1,name:void 0,reversed:Zl.reversed,scale:Zl.scale,tick:Zl.tick,tickCount:void 0,ticks:void 0,type:Zl.type,unit:void 0,niceTicks:"auto"},HD={allowDataOverflow:_i.allowDataOverflow,allowDecimals:_i.allowDecimals,allowDuplicatedCategory:_i.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_i.radiusAxisId,includeHidden:_i.includeHidden,name:void 0,reversed:_i.reversed,scale:_i.scale,tick:_i.tick,tickCount:_i.tickCount,ticks:void 0,type:_i.type,unit:void 0,niceTicks:"auto"},tfe=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},oO=se([tfe,C6],(e,t)=>{var n;if(e!=null)return e;var r=(n=V0(t,"angleAxis",UD.type))!==null&&n!==void 0?n:"category";return py(py({},UD),{},{type:r})}),nfe=(e,t)=>e.polarAxis.radiusAxis[t],sO=se([nfe,C6],(e,t)=>{var n;if(e!=null)return e;var r=(n=V0(t,"radiusAxis",HD.type))!==null&&n!==void 0?n:"category";return py(py({},HD),{},{type:r})}),Y0=e=>e.polarOptions,lO=se([Qo,Zo,Ln],K6),dU=se([Y0,lO],(e,t)=>{if(e!=null)return yr(e.innerRadius,t,0)}),fU=se([Y0,lO],(e,t)=>{if(e!=null)return yr(e.outerRadius,t,t*.8)}),rfe=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},hU=se([Y0],rfe);se([oO,hU],K0);var mU=se([lO,dU,fU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});se([sO,mU],K0);var pU=se([yt,Y0,dU,fU,Qo,Zo],(e,t,n,r,a,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:s,cy:c,startAngle:u,endAngle:d}=t;return{cx:yr(s,a,a/2),cy:yr(c,i,i/2),innerRadius:n,outerRadius:r,startAngle:u,endAngle:d,clockWise:!1}}}),Jt=(e,t)=>t,Vm=(e,t,n)=>n;function cO(e){return e==null?void 0:e.id}function vU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:a,dataKey:i}=n,s=new Map;return e.forEach(c=>{var u,d=(u=c.data)!==null&&u!==void 0?u:r;if(!(d==null||d.length===0)){var m=cO(c);d.forEach((f,v)=>{var g=i==null||a?v:String(Pt(f,i,null)),b=Pt(f,c.dataKey,0),w;s.has(g)?w=s.get(g):w={},Object.assign(w,{[m]:b}),s.set(g,w)})}}),Array.from(s.values())}function G0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var X0=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function W0(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function afe(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Xn=e=>{var t=yt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},rf=e=>e.tooltip.settings.axisId;function uO(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),a=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(i){function s(){return i.apply(this,arguments)}return s.toString=function(){return i.toString()},s})(()=>a),rangeMin:()=>a[0],rangeMax:()=>a[1],isInRange(i){var s=a[0],c=a[1];return s<=c?i>=s&&i<=c:i>=c&&i<=s},bandwidth:n?()=>n.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,s)=>{var c=e(i);if(c!=null){if(e.bandwidth&&s!==null&&s!==void 0&&s.position){var u=e.bandwidth();switch(s.position){case"middle":c+=u/2;break;case"end":c+=u;break}}return c}}}}}var gU=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ii(t)){for(var n,r,a=0;a<t.length;a++){var i=t[a];ct(i)&&((n===void 0||i<n)&&(n=i),(r===void 0||i>r)&&(r=i))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function il(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ife(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function dO(e){let t,n,r;e.length!==2?(t=il,n=(c,u)=>il(e(c),u),r=(c,u)=>e(c)-u):(t=e===il||e===ife?e:ofe,n=e,r=e);function a(c,u,d=0,m=c.length){if(d<m){if(t(u,u)!==0)return m;do{const f=d+m>>>1;n(c[f],u)<0?d=f+1:m=f}while(d<m)}return d}function i(c,u,d=0,m=c.length){if(d<m){if(t(u,u)!==0)return m;do{const f=d+m>>>1;n(c[f],u)<=0?d=f+1:m=f}while(d<m)}return d}function s(c,u,d=0,m=c.length){const f=a(c,u,d,m-1);return f>d&&r(c[f-1],u)>-r(c[f],u)?f-1:f}return{left:a,center:s,right:i}}function ofe(){return 0}function yU(e){return e===null?NaN:+e}function*sfe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const lfe=dO(il),Ym=lfe.right;dO(yU).center;class FD extends Map{constructor(t,n=dfe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(qD(this,t))}has(t){return super.has(qD(this,t))}set(t,n){return super.set(cfe(this,t),n)}delete(t){return super.delete(ufe(this,t))}}function qD({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function cfe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ufe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function dfe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ffe(e=il){if(e===il)return xU;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function xU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const hfe=Math.sqrt(50),mfe=Math.sqrt(10),pfe=Math.sqrt(2);function vy(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),s=i>=hfe?10:i>=mfe?5:i>=pfe?2:1;let c,u,d;return a<0?(d=Math.pow(10,-a)/s,c=Math.round(e*d),u=Math.round(t*d),c/d<e&&++c,u/d>t&&--u,d=-d):(d=Math.pow(10,a)*s,c=Math.round(e/d),u=Math.round(t/d),c*d<e&&++c,u*d>t&&--u),u<c&&.5<=n&&n<2?vy(e,t,n*2):[c,u,d]}function w_(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,s]=r?vy(t,e,n):vy(e,t,n);if(!(i>=a))return[];const c=i-a+1,u=new Array(c);if(r)if(s<0)for(let d=0;d<c;++d)u[d]=(i-d)/-s;else for(let d=0;d<c;++d)u[d]=(i-d)*s;else if(s<0)for(let d=0;d<c;++d)u[d]=(a+d)/-s;else for(let d=0;d<c;++d)u[d]=(a+d)*s;return u}function S_(e,t,n){return t=+t,e=+e,n=+n,vy(e,t,n)[2]}function E_(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?S_(t,e,n):S_(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function KD(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function VD(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function bU(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?xU:ffe(a);r>n;){if(r-n>600){const u=r-n+1,d=t-n+1,m=Math.log(u),f=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*f*(u-f)/u)*(d-u/2<0?-1:1),g=Math.max(n,Math.floor(t-d*f/u+v)),b=Math.min(r,Math.floor(t+(u-d)*f/u+v));bU(e,t,g,b,a)}const i=e[t];let s=n,c=r;for(mh(e,n,t),a(e[r],i)>0&&mh(e,n,r);s<c;){for(mh(e,s,c),++s,--c;a(e[s],i)<0;)++s;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?mh(e,n,c):(++c,mh(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function mh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function vfe(e,t,n){if(e=Float64Array.from(sfe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return VD(e);if(t>=1)return KD(e);var r,a=(r-1)*t,i=Math.floor(a),s=KD(bU(e,i).subarray(0,i+1)),c=VD(e.subarray(i+1));return s+(c-s)*(a-i)}}function gfe(e,t,n=yU){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),s=+n(e[i],i,e),c=+n(e[i+1],i+1,e);return s+(c-s)*(a-i)}}function yfe(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function Ba(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function es(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const __=Symbol("implicit");function fO(){var e=new FD,t=[],n=[],r=__;function a(i){let s=e.get(i);if(s===void 0){if(r!==__)return r;e.set(i,s=t.push(i)-1)}return n[s%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new FD;for(const s of i)e.has(s)||e.set(s,t.push(s)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return fO(t,n).unknown(r)},Ba.apply(a,arguments),a}function hO(){var e=fO().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,s,c=!1,u=0,d=0,m=.5;delete e.unknown;function f(){var v=t().length,g=a<r,b=g?a:r,w=g?r:a;i=(w-b)/Math.max(1,v-u+d*2),c&&(i=Math.floor(i)),b+=(w-b-i*(v-u))*m,s=i*(1-u),c&&(b=Math.round(b),s=Math.round(s));var S=yfe(v).map(function(E){return b+i*E});return n(g?S.reverse():S)}return e.domain=function(v){return arguments.length?(t(v),f()):t()},e.range=function(v){return arguments.length?([r,a]=v,r=+r,a=+a,f()):[r,a]},e.rangeRound=function(v){return[r,a]=v,r=+r,a=+a,c=!0,f()},e.bandwidth=function(){return s},e.step=function(){return i},e.round=function(v){return arguments.length?(c=!!v,f()):c},e.padding=function(v){return arguments.length?(u=Math.min(1,d=+v),f()):u},e.paddingInner=function(v){return arguments.length?(u=Math.min(1,v),f()):u},e.paddingOuter=function(v){return arguments.length?(d=+v,f()):d},e.align=function(v){return arguments.length?(m=Math.max(0,Math.min(1,v)),f()):m},e.copy=function(){return hO(t(),[r,a]).round(c).paddingInner(u).paddingOuter(d).align(m)},Ba.apply(f(),arguments)}function wU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return wU(t())},e}function xfe(){return wU(hO.apply(null,arguments).paddingInner(1))}function mO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function SU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Gm(){}var tm=.7,gy=1/tm,id="\\s*([+-]?\\d+)\\s*",nm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bfe=/^#([0-9a-f]{3,8})$/,wfe=new RegExp(`^rgb\\(${id},${id},${id}\\)$`),Sfe=new RegExp(`^rgb\\(${Li},${Li},${Li}\\)$`),Efe=new RegExp(`^rgba\\(${id},${id},${id},${nm}\\)$`),_fe=new RegExp(`^rgba\\(${Li},${Li},${Li},${nm}\\)$`),jfe=new RegExp(`^hsl\\(${nm},${Li},${Li}\\)$`),Cfe=new RegExp(`^hsla\\(${nm},${Li},${Li},${nm}\\)$`),YD={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};mO(Gm,Hc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:GD,formatHex:GD,formatHex8:Ofe,formatHsl:Afe,formatRgb:XD,toString:XD});function GD(){return this.rgb().formatHex()}function Ofe(){return this.rgb().formatHex8()}function Afe(){return EU(this).formatHsl()}function XD(){return this.rgb().formatRgb()}function Hc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bfe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?WD(t):n===3?new Yr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=wfe.exec(e))?new Yr(t[1],t[2],t[3],1):(t=Sfe.exec(e))?new Yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Efe.exec(e))?Xv(t[1],t[2],t[3],t[4]):(t=_fe.exec(e))?Xv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jfe.exec(e))?JD(t[1],t[2]/100,t[3]/100,1):(t=Cfe.exec(e))?JD(t[1],t[2]/100,t[3]/100,t[4]):YD.hasOwnProperty(e)?WD(YD[e]):e==="transparent"?new Yr(NaN,NaN,NaN,0):null}function WD(e){return new Yr(e>>16&255,e>>8&255,e&255,1)}function Xv(e,t,n,r){return r<=0&&(e=t=n=NaN),new Yr(e,t,n,r)}function Nfe(e){return e instanceof Gm||(e=Hc(e)),e?(e=e.rgb(),new Yr(e.r,e.g,e.b,e.opacity)):new Yr}function j_(e,t,n,r){return arguments.length===1?Nfe(e):new Yr(e,t,n,r??1)}function Yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}mO(Yr,j_,SU(Gm,{brighter(e){return e=e==null?gy:Math.pow(gy,e),new Yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tm:Math.pow(tm,e),new Yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Yr(_c(this.r),_c(this.g),_c(this.b),yy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QD,formatHex:QD,formatHex8:Tfe,formatRgb:ZD,toString:ZD}));function QD(){return`#${cc(this.r)}${cc(this.g)}${cc(this.b)}`}function Tfe(){return`#${cc(this.r)}${cc(this.g)}${cc(this.b)}${cc((isNaN(this.opacity)?1:this.opacity)*255)}`}function ZD(){const e=yy(this.opacity);return`${e===1?"rgb(":"rgba("}${_c(this.r)}, ${_c(this.g)}, ${_c(this.b)}${e===1?")":`, ${e})`}`}function yy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _c(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cc(e){return e=_c(e),(e<16?"0":"")+e.toString(16)}function JD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ni(e,t,n,r)}function EU(e){if(e instanceof ni)return new ni(e.h,e.s,e.l,e.opacity);if(e instanceof Gm||(e=Hc(e)),!e)return new ni;if(e instanceof ni)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,c=i-a,u=(i+a)/2;return c?(t===i?s=(n-r)/c+(n<r)*6:n===i?s=(r-t)/c+2:s=(t-n)/c+4,c/=u<.5?i+a:2-i-a,s*=60):c=u>0&&u<1?0:s,new ni(s,c,u,e.opacity)}function Pfe(e,t,n,r){return arguments.length===1?EU(e):new ni(e,t,n,r??1)}function ni(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}mO(ni,Pfe,SU(Gm,{brighter(e){return e=e==null?gy:Math.pow(gy,e),new ni(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tm:Math.pow(tm,e),new ni(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Yr(jS(e>=240?e-240:e+120,a,r),jS(e,a,r),jS(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new ni(eI(this.h),Wv(this.s),Wv(this.l),yy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=yy(this.opacity);return`${e===1?"hsl(":"hsla("}${eI(this.h)}, ${Wv(this.s)*100}%, ${Wv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function eI(e){return e=(e||0)%360,e<0?e+360:e}function Wv(e){return Math.max(0,Math.min(1,e||0))}function jS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const pO=e=>()=>e;function Mfe(e,t){return function(n){return e+n*t}}function kfe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Rfe(e){return(e=+e)==1?_U:function(t,n){return n-t?kfe(t,n,e):pO(isNaN(t)?n:t)}}function _U(e,t){var n=t-e;return n?Mfe(e,n):pO(isNaN(e)?t:e)}const xy=(function e(t){var n=Rfe(t);function r(a,i){var s=n((a=j_(a)).r,(i=j_(i)).r),c=n(a.g,i.g),u=n(a.b,i.b),d=_U(a.opacity,i.opacity);return function(m){return a.r=s(m),a.g=c(m),a.b=u(m),a.opacity=d(m),a+""}}return r.gamma=e,r})(1);function Dfe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function Ife(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Lfe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)a[s]=Mo(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(c){for(s=0;s<r;++s)i[s]=a[s](c);return i}}function zfe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ja(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function $fe(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Mo(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var C_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,CS=new RegExp(C_.source,"g");function Bfe(e){return function(){return e}}function Ufe(e){return function(t){return e(t)+""}}function jU(e,t){var n=C_.lastIndex=CS.lastIndex=0,r,a,i,s=-1,c=[],u=[];for(e=e+"",t=t+"";(r=C_.exec(e))&&(a=CS.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),c[s]?c[s]+=i:c[++s]=i),(r=r[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,u.push({i:s,x:Ja(r,a)})),n=CS.lastIndex;return n<t.length&&(i=t.slice(n),c[s]?c[s]+=i:c[++s]=i),c.length<2?u[0]?Ufe(u[0].x):Bfe(t):(t=u.length,function(d){for(var m=0,f;m<t;++m)c[(f=u[m]).i]=f.x(d);return c.join("")})}function Mo(e,t){var n=typeof t,r;return t==null||n==="boolean"?pO(t):(n==="number"?Ja:n==="string"?(r=Hc(t))?(t=r,xy):jU:t instanceof Hc?xy:t instanceof Date?zfe:Ife(t)?Dfe:Array.isArray(t)?Lfe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?$fe:Ja)(e,t)}function vO(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var tI=180/Math.PI,O_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function CU(e,t,n,r,a,i){var s,c,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,u/=c),e*r<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*tI,skewX:Math.atan(u)*tI,scaleX:s,scaleY:c}}var Qv;function Hfe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?O_:CU(t.a,t.b,t.c,t.d,t.e,t.f)}function Ffe(e){return e==null||(Qv||(Qv=document.createElementNS("http://www.w3.org/2000/svg","g")),Qv.setAttribute("transform",e),!(e=Qv.transform.baseVal.consolidate()))?O_:(e=e.matrix,CU(e.a,e.b,e.c,e.d,e.e,e.f))}function OU(e,t,n,r){function a(d){return d.length?d.pop()+" ":""}function i(d,m,f,v,g,b){if(d!==f||m!==v){var w=g.push("translate(",null,t,null,n);b.push({i:w-4,x:Ja(d,f)},{i:w-2,x:Ja(m,v)})}else(f||v)&&g.push("translate("+f+t+v+n)}function s(d,m,f,v){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),v.push({i:f.push(a(f)+"rotate(",null,r)-2,x:Ja(d,m)})):m&&f.push(a(f)+"rotate("+m+r)}function c(d,m,f,v){d!==m?v.push({i:f.push(a(f)+"skewX(",null,r)-2,x:Ja(d,m)}):m&&f.push(a(f)+"skewX("+m+r)}function u(d,m,f,v,g,b){if(d!==f||m!==v){var w=g.push(a(g)+"scale(",null,",",null,")");b.push({i:w-4,x:Ja(d,f)},{i:w-2,x:Ja(m,v)})}else(f!==1||v!==1)&&g.push(a(g)+"scale("+f+","+v+")")}return function(d,m){var f=[],v=[];return d=e(d),m=e(m),i(d.translateX,d.translateY,m.translateX,m.translateY,f,v),s(d.rotate,m.rotate,f,v),c(d.skewX,m.skewX,f,v),u(d.scaleX,d.scaleY,m.scaleX,m.scaleY,f,v),d=m=null,function(g){for(var b=-1,w=v.length,S;++b<w;)f[(S=v[b]).i]=S.x(g);return f.join("")}}}var qfe=OU(Hfe,"px, ","px)","deg)"),Kfe=OU(Ffe,", ",")",")"),Vfe=1e-12;function nI(e){return((e=Math.exp(e))+1/e)/2}function Yfe(e){return((e=Math.exp(e))-1/e)/2}function Gfe(e){return((e=Math.exp(2*e))-1)/(e+1)}const Sg=(function e(t,n,r){function a(i,s){var c=i[0],u=i[1],d=i[2],m=s[0],f=s[1],v=s[2],g=m-c,b=f-u,w=g*g+b*b,S,E;if(w<Vfe)E=Math.log(v/d)/t,S=function(P){return[c+P*g,u+P*b,d*Math.exp(t*P*E)]};else{var O=Math.sqrt(w),j=(v*v-d*d+r*w)/(2*d*n*O),A=(v*v-d*d-r*w)/(2*v*n*O),N=Math.log(Math.sqrt(j*j+1)-j),T=Math.log(Math.sqrt(A*A+1)-A);E=(T-N)/t,S=function(P){var R=P*E,D=nI(N),K=d/(n*O)*(D*Gfe(t*R+N)-Yfe(N));return[c+K*g,u+K*b,d*D/nI(t*R+N)]}}return S.duration=E*1e3*t/Math.SQRT2,S}return a.rho=function(i){var s=Math.max(.001,+i),c=s*s,u=c*c;return e(s,c,u)},a})(Math.SQRT2,2,4);function Xfe(e,t){t===void 0&&(t=e,e=Mo);for(var n=0,r=t.length-1,a=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(a,a=t[++n]);return function(s){var c=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return i[c](s-c)}}function Wfe(e){return function(){return e}}function by(e){return+e}var rI=[0,1];function Ar(e){return e}function A_(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Wfe(isNaN(t)?NaN:.5)}function Qfe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Zfe(e,t,n){var r=e[0],a=e[1],i=t[0],s=t[1];return a<r?(r=A_(a,r),i=n(s,i)):(r=A_(r,a),i=n(i,s)),function(c){return i(r(c))}}function Jfe(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)a[s]=A_(e[s],e[s+1]),i[s]=n(t[s],t[s+1]);return function(c){var u=Ym(e,c,1,r)-1;return i[u](a[u](c))}}function Xm(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Q0(){var e=rI,t=rI,n=Mo,r,a,i,s=Ar,c,u,d;function m(){var v=Math.min(e.length,t.length);return s!==Ar&&(s=Qfe(e[0],e[v-1])),c=v>2?Jfe:Zfe,u=d=null,f}function f(v){return v==null||isNaN(v=+v)?i:(u||(u=c(e.map(r),t,n)))(r(s(v)))}return f.invert=function(v){return s(a((d||(d=c(t,e.map(r),Ja)))(v)))},f.domain=function(v){return arguments.length?(e=Array.from(v,by),m()):e.slice()},f.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},f.rangeRound=function(v){return t=Array.from(v),n=vO,m()},f.clamp=function(v){return arguments.length?(s=v?!0:Ar,m()):s!==Ar},f.interpolate=function(v){return arguments.length?(n=v,m()):n},f.unknown=function(v){return arguments.length?(i=v,f):i},function(v,g){return r=v,a=g,m()}}function gO(){return Q0()(Ar,Ar)}function ehe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wy(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pd(e){return e=wy(Math.abs(e)),e?e[1]:NaN}function the(e,t){return function(n,r){for(var a=n.length,i=[],s=0,c=e[0],u=0;a>0&&c>0&&(u+c+1>r&&(c=Math.max(1,r-u)),i.push(n.substring(a-=c,a+c)),!((u+=c+1)>r));)c=e[s=(s+1)%e.length];return i.reverse().join(t)}}function nhe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var rhe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function rm(e){if(!(t=rhe.exec(e)))throw new Error("invalid format: "+e);var t;return new yO({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}rm.prototype=yO.prototype;function yO(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}yO.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ahe(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var Sy;function ihe(e,t){var n=wy(e,t);if(!n)return Sy=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(Sy=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+wy(e,Math.max(0,t+i-1))[0]}function aI(e,t){var n=wy(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const iI={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ehe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>aI(e*100,t),r:aI,s:ihe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function oI(e){return e}var sI=Array.prototype.map,lI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ohe(e){var t=e.grouping===void 0||e.thousands===void 0?oI:the(sI.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?oI:nhe(sI.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function d(f,v){f=rm(f);var g=f.fill,b=f.align,w=f.sign,S=f.symbol,E=f.zero,O=f.width,j=f.comma,A=f.precision,N=f.trim,T=f.type;T==="n"?(j=!0,T="g"):iI[T]||(A===void 0&&(A=12),N=!0,T="g"),(E||g==="0"&&b==="=")&&(E=!0,g="0",b="=");var P=(v&&v.prefix!==void 0?v.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),R=(S==="$"?r:/[%p]/.test(T)?s:"")+(v&&v.suffix!==void 0?v.suffix:""),D=iI[T],K=/[defgprs%]/.test(T);A=A===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function z(I){var G=P,L=R,Y,k,H;if(T==="c")L=D(I)+L,I="";else{I=+I;var q=I<0||1/I<0;if(I=isNaN(I)?u:D(Math.abs(I),A),N&&(I=ahe(I)),q&&+I==0&&w!=="+"&&(q=!1),G=(q?w==="("?w:c:w==="-"||w==="("?"":w)+G,L=(T==="s"&&!isNaN(I)&&Sy!==void 0?lI[8+Sy/3]:"")+L+(q&&w==="("?")":""),K){for(Y=-1,k=I.length;++Y<k;)if(H=I.charCodeAt(Y),48>H||H>57){L=(H===46?a+I.slice(Y+1):I.slice(Y))+L,I=I.slice(0,Y);break}}}j&&!E&&(I=t(I,1/0));var F=G.length+I.length+L.length,V=F<O?new Array(O-F+1).join(g):"";switch(j&&E&&(I=t(V+I,V.length?O-L.length:1/0),V=""),b){case"<":I=G+I+L+V;break;case"=":I=G+V+I+L;break;case"^":I=V.slice(0,F=V.length>>1)+G+I+L+V.slice(F);break;default:I=V+G+I+L;break}return i(I)}return z.toString=function(){return f+""},z}function m(f,v){var g=Math.max(-8,Math.min(8,Math.floor(Pd(v)/3)))*3,b=Math.pow(10,-g),w=d((f=rm(f),f.type="f",f),{suffix:lI[8+g/3]});return function(S){return w(b*S)}}return{format:d,formatPrefix:m}}var Zv,xO,AU;she({thousands:",",grouping:[3],currency:["$",""]});function she(e){return Zv=ohe(e),xO=Zv.format,AU=Zv.formatPrefix,Zv}function lhe(e){return Math.max(0,-Pd(Math.abs(e)))}function che(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pd(t)/3)))*3-Pd(Math.abs(e)))}function uhe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pd(t)-Pd(e))+1}function NU(e,t,n,r){var a=E_(e,t,n),i;switch(r=rm(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=che(a,s))&&(r.precision=i),AU(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=uhe(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=lhe(a))&&(r.precision=i-(r.type==="%")*2);break}}return xO(r)}function Al(e){var t=e.domain;return e.ticks=function(n){var r=t();return w_(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return NU(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,s=r[a],c=r[i],u,d,m=10;for(c<s&&(d=s,s=c,c=d,d=a,a=i,i=d);m-- >0;){if(d=S_(s,c,n),d===u)return r[a]=s,r[i]=c,t(r);if(d>0)s=Math.floor(s/d)*d,c=Math.ceil(c/d)*d;else if(d<0)s=Math.ceil(s*d)/d,c=Math.floor(c*d)/d;else break;u=d}return e},e}function TU(){var e=gO();return e.copy=function(){return Xm(e,TU())},Ba.apply(e,arguments),Al(e)}function PU(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,by),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return PU(e).unknown(t)},e=arguments.length?Array.from(e,by):[0,1],Al(n)}function MU(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],s;return i<a&&(s=n,n=r,r=s,s=a,a=i,i=s),e[n]=t.floor(a),e[r]=t.ceil(i),e}function cI(e){return Math.log(e)}function uI(e){return Math.exp(e)}function dhe(e){return-Math.log(-e)}function fhe(e){return-Math.exp(-e)}function hhe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function mhe(e){return e===10?hhe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function phe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function dI(e){return(t,n)=>-e(-t,n)}function bO(e){const t=e(cI,uI),n=t.domain;let r=10,a,i;function s(){return a=phe(r),i=mhe(r),n()[0]<0?(a=dI(a),i=dI(i),e(dhe,fhe)):e(cI,uI),t}return t.base=function(c){return arguments.length?(r=+c,s()):r},t.domain=function(c){return arguments.length?(n(c),s()):n()},t.ticks=c=>{const u=n();let d=u[0],m=u[u.length-1];const f=m<d;f&&([d,m]=[m,d]);let v=a(d),g=a(m),b,w;const S=c==null?10:+c;let E=[];if(!(r%1)&&g-v<S){if(v=Math.floor(v),g=Math.ceil(g),d>0){for(;v<=g;++v)for(b=1;b<r;++b)if(w=v<0?b/i(-v):b*i(v),!(w<d)){if(w>m)break;E.push(w)}}else for(;v<=g;++v)for(b=r-1;b>=1;--b)if(w=v>0?b/i(-v):b*i(v),!(w<d)){if(w>m)break;E.push(w)}E.length*2<S&&(E=w_(d,m,S))}else E=w_(v,g,Math.min(g-v,S)).map(i);return f?E.reverse():E},t.tickFormat=(c,u)=>{if(c==null&&(c=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=rm(u)).precision==null&&(u.trim=!0),u=xO(u)),c===1/0)return u;const d=Math.max(1,r*c/t.ticks().length);return m=>{let f=m/i(Math.round(a(m)));return f*r<r-.5&&(f*=r),f<=d?u(m):""}},t.nice=()=>n(MU(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function kU(){const e=bO(Q0()).domain([1,10]);return e.copy=()=>Xm(e,kU()).base(e.base()),Ba.apply(e,arguments),e}function fI(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function hI(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wO(e){var t=1,n=e(fI(t),hI(t));return n.constant=function(r){return arguments.length?e(fI(t=+r),hI(t)):t},Al(n)}function RU(){var e=wO(Q0());return e.copy=function(){return Xm(e,RU()).constant(e.constant())},Ba.apply(e,arguments)}function mI(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function vhe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function ghe(e){return e<0?-e*e:e*e}function SO(e){var t=e(Ar,Ar),n=1;function r(){return n===1?e(Ar,Ar):n===.5?e(vhe,ghe):e(mI(n),mI(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Al(t)}function EO(){var e=SO(Q0());return e.copy=function(){return Xm(e,EO()).exponent(e.exponent())},Ba.apply(e,arguments),e}function yhe(){return EO.apply(null,arguments).exponent(.5)}function pI(e){return Math.sign(e)*e*e}function xhe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function DU(){var e=gO(),t=[0,1],n=!1,r;function a(i){var s=xhe(e(i));return isNaN(s)?r:n?Math.round(s):s}return a.invert=function(i){return e.invert(pI(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,by)).map(pI)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return DU(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ba.apply(a,arguments),Al(a)}function IU(){var e=[],t=[],n=[],r;function a(){var s=0,c=Math.max(1,t.length);for(n=new Array(c-1);++s<c;)n[s-1]=gfe(e,s/c);return i}function i(s){return s==null||isNaN(s=+s)?r:t[Ym(n,s)]}return i.invertExtent=function(s){var c=t.indexOf(s);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},i.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let c of s)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(il),a()},i.range=function(s){return arguments.length?(t=Array.from(s),a()):t.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return IU().domain(e).range(t).unknown(r)},Ba.apply(i,arguments)}function LU(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function s(u){return u!=null&&u<=u?a[Ym(r,u,0,n)]:i}function c(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*t-(u-n)*e)/(n+1);return s}return s.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,c()):[e,t]},s.range=function(u){return arguments.length?(n=(a=Array.from(u)).length-1,c()):a.slice()},s.invertExtent=function(u){var d=a.indexOf(u);return d<0?[NaN,NaN]:d<1?[e,r[0]]:d>=n?[r[n-1],t]:[r[d-1],r[d]]},s.unknown=function(u){return arguments.length&&(i=u),s},s.thresholds=function(){return r.slice()},s.copy=function(){return LU().domain([e,t]).range(a).unknown(i)},Ba.apply(Al(s),arguments)}function zU(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[Ym(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var s=t.indexOf(i);return[e[s-1],e[s]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return zU().domain(e).range(t).unknown(n)},Ba.apply(a,arguments)}const OS=new Date,AS=new Date;function zn(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const s=a(i),c=a.ceil(i);return i-s<c-i?s:c},a.offset=(i,s)=>(t(i=new Date(+i),s==null?1:Math.floor(s)),i),a.range=(i,s,c)=>{const u=[];if(i=a.ceil(i),c=c==null?1:Math.floor(c),!(i<s)||!(c>0))return u;let d;do u.push(d=new Date(+i)),t(i,c),e(i);while(d<i&&i<s);return u},a.filter=i=>zn(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,c)=>{if(s>=s)if(c<0)for(;++c<=0;)for(;t(s,-1),!i(s););else for(;--c>=0;)for(;t(s,1),!i(s););}),n&&(a.count=(i,s)=>(OS.setTime(+i),AS.setTime(+s),e(OS),e(AS),Math.floor(n(OS,AS))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?s=>r(s)%i===0:s=>a.count(0,s)%i===0):a)),a}const Ey=zn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ey.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?zn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ey);Ey.range;const Oo=1e3,Da=Oo*60,Ao=Da*60,qo=Ao*24,_O=qo*7,vI=qo*30,NS=qo*365,uc=zn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Oo)},(e,t)=>(t-e)/Oo,e=>e.getUTCSeconds());uc.range;const jO=zn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Oo)},(e,t)=>{e.setTime(+e+t*Da)},(e,t)=>(t-e)/Da,e=>e.getMinutes());jO.range;const CO=zn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Da)},(e,t)=>(t-e)/Da,e=>e.getUTCMinutes());CO.range;const OO=zn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Oo-e.getMinutes()*Da)},(e,t)=>{e.setTime(+e+t*Ao)},(e,t)=>(t-e)/Ao,e=>e.getHours());OO.range;const AO=zn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ao)},(e,t)=>(t-e)/Ao,e=>e.getUTCHours());AO.range;const Wm=zn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Da)/qo,e=>e.getDate()-1);Wm.range;const Z0=zn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/qo,e=>e.getUTCDate()-1);Z0.range;const $U=zn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/qo,e=>Math.floor(e/qo));$U.range;function Zc(e){return zn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Da)/_O)}const J0=Zc(0),_y=Zc(1),bhe=Zc(2),whe=Zc(3),Md=Zc(4),She=Zc(5),Ehe=Zc(6);J0.range;_y.range;bhe.range;whe.range;Md.range;She.range;Ehe.range;function Jc(e){return zn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/_O)}const ex=Jc(0),jy=Jc(1),_he=Jc(2),jhe=Jc(3),kd=Jc(4),Che=Jc(5),Ohe=Jc(6);ex.range;jy.range;_he.range;jhe.range;kd.range;Che.range;Ohe.range;const NO=zn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());NO.range;const TO=zn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());TO.range;const Ko=zn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ko.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Ko.range;const Vo=zn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Vo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Vo.range;function BU(e,t,n,r,a,i){const s=[[uc,1,Oo],[uc,5,5*Oo],[uc,15,15*Oo],[uc,30,30*Oo],[i,1,Da],[i,5,5*Da],[i,15,15*Da],[i,30,30*Da],[a,1,Ao],[a,3,3*Ao],[a,6,6*Ao],[a,12,12*Ao],[r,1,qo],[r,2,2*qo],[n,1,_O],[t,1,vI],[t,3,3*vI],[e,1,NS]];function c(d,m,f){const v=m<d;v&&([d,m]=[m,d]);const g=f&&typeof f.range=="function"?f:u(d,m,f),b=g?g.range(d,+m+1):[];return v?b.reverse():b}function u(d,m,f){const v=Math.abs(m-d)/f,g=dO(([,,S])=>S).right(s,v);if(g===s.length)return e.every(E_(d/NS,m/NS,f));if(g===0)return Ey.every(Math.max(E_(d,m,f),1));const[b,w]=s[v/s[g-1][2]<s[g][2]/v?g-1:g];return b.every(w)}return[c,u]}const[Ahe,Nhe]=BU(Vo,TO,ex,$U,AO,CO),[The,Phe]=BU(Ko,NO,J0,Wm,OO,jO);function TS(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function PS(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ph(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Mhe(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,s=e.shortDays,c=e.months,u=e.shortMonths,d=vh(a),m=gh(a),f=vh(i),v=gh(i),g=vh(s),b=gh(s),w=vh(c),S=gh(c),E=vh(u),O=gh(u),j={a:H,A:q,b:F,B:V,c:null,d:SI,e:SI,f:tme,g:dme,G:hme,H:Zhe,I:Jhe,j:eme,L:UU,m:nme,M:rme,p:B,q:$,Q:jI,s:CI,S:ame,u:ime,U:ome,V:sme,w:lme,W:cme,x:null,X:null,y:ume,Y:fme,Z:mme,"%":_I},A={a:X,A:Z,b:ee,B:le,c:null,d:EI,e:EI,f:yme,g:Ame,G:Tme,H:pme,I:vme,j:gme,L:FU,m:xme,M:bme,p:ie,q:ae,Q:jI,s:CI,S:wme,u:Sme,U:Eme,V:_me,w:jme,W:Cme,x:null,X:null,y:Ome,Y:Nme,Z:Pme,"%":_I},N={a:K,A:z,b:I,B:G,c:L,d:bI,e:bI,f:Ghe,g:xI,G:yI,H:wI,I:wI,j:qhe,L:Yhe,m:Fhe,M:Khe,p:D,q:Hhe,Q:Whe,s:Qhe,S:Vhe,u:Lhe,U:zhe,V:$he,w:Ihe,W:Bhe,x:Y,X:k,y:xI,Y:yI,Z:Uhe,"%":Xhe};j.x=T(n,j),j.X=T(r,j),j.c=T(t,j),A.x=T(n,A),A.X=T(r,A),A.c=T(t,A);function T(J,re){return function(fe){var ne=[],xe=-1,ye=0,De=J.length,Me,Ke,Je;for(fe instanceof Date||(fe=new Date(+fe));++xe<De;)J.charCodeAt(xe)===37&&(ne.push(J.slice(ye,xe)),(Ke=gI[Me=J.charAt(++xe)])!=null?Me=J.charAt(++xe):Ke=Me==="e"?" ":"0",(Je=re[Me])&&(Me=Je(fe,Ke)),ne.push(Me),ye=xe+1);return ne.push(J.slice(ye,xe)),ne.join("")}}function P(J,re){return function(fe){var ne=ph(1900,void 0,1),xe=R(ne,J,fe+="",0),ye,De;if(xe!=fe.length)return null;if("Q"in ne)return new Date(ne.Q);if("s"in ne)return new Date(ne.s*1e3+("L"in ne?ne.L:0));if(re&&!("Z"in ne)&&(ne.Z=0),"p"in ne&&(ne.H=ne.H%12+ne.p*12),ne.m===void 0&&(ne.m="q"in ne?ne.q:0),"V"in ne){if(ne.V<1||ne.V>53)return null;"w"in ne||(ne.w=1),"Z"in ne?(ye=PS(ph(ne.y,0,1)),De=ye.getUTCDay(),ye=De>4||De===0?jy.ceil(ye):jy(ye),ye=Z0.offset(ye,(ne.V-1)*7),ne.y=ye.getUTCFullYear(),ne.m=ye.getUTCMonth(),ne.d=ye.getUTCDate()+(ne.w+6)%7):(ye=TS(ph(ne.y,0,1)),De=ye.getDay(),ye=De>4||De===0?_y.ceil(ye):_y(ye),ye=Wm.offset(ye,(ne.V-1)*7),ne.y=ye.getFullYear(),ne.m=ye.getMonth(),ne.d=ye.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),De="Z"in ne?PS(ph(ne.y,0,1)).getUTCDay():TS(ph(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(De+5)%7:ne.w+ne.U*7-(De+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,PS(ne)):TS(ne)}}function R(J,re,fe,ne){for(var xe=0,ye=re.length,De=fe.length,Me,Ke;xe<ye;){if(ne>=De)return-1;if(Me=re.charCodeAt(xe++),Me===37){if(Me=re.charAt(xe++),Ke=N[Me in gI?re.charAt(xe++):Me],!Ke||(ne=Ke(J,fe,ne))<0)return-1}else if(Me!=fe.charCodeAt(ne++))return-1}return ne}function D(J,re,fe){var ne=d.exec(re.slice(fe));return ne?(J.p=m.get(ne[0].toLowerCase()),fe+ne[0].length):-1}function K(J,re,fe){var ne=g.exec(re.slice(fe));return ne?(J.w=b.get(ne[0].toLowerCase()),fe+ne[0].length):-1}function z(J,re,fe){var ne=f.exec(re.slice(fe));return ne?(J.w=v.get(ne[0].toLowerCase()),fe+ne[0].length):-1}function I(J,re,fe){var ne=E.exec(re.slice(fe));return ne?(J.m=O.get(ne[0].toLowerCase()),fe+ne[0].length):-1}function G(J,re,fe){var ne=w.exec(re.slice(fe));return ne?(J.m=S.get(ne[0].toLowerCase()),fe+ne[0].length):-1}function L(J,re,fe){return R(J,t,re,fe)}function Y(J,re,fe){return R(J,n,re,fe)}function k(J,re,fe){return R(J,r,re,fe)}function H(J){return s[J.getDay()]}function q(J){return i[J.getDay()]}function F(J){return u[J.getMonth()]}function V(J){return c[J.getMonth()]}function B(J){return a[+(J.getHours()>=12)]}function $(J){return 1+~~(J.getMonth()/3)}function X(J){return s[J.getUTCDay()]}function Z(J){return i[J.getUTCDay()]}function ee(J){return u[J.getUTCMonth()]}function le(J){return c[J.getUTCMonth()]}function ie(J){return a[+(J.getUTCHours()>=12)]}function ae(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var re=T(J+="",j);return re.toString=function(){return J},re},parse:function(J){var re=P(J+="",!1);return re.toString=function(){return J},re},utcFormat:function(J){var re=T(J+="",A);return re.toString=function(){return J},re},utcParse:function(J){var re=P(J+="",!0);return re.toString=function(){return J},re}}}var gI={"-":"",_:" ",0:"0"},Wn=/^\s*\d+/,khe=/^%/,Rhe=/[\\^$*+?|[\]().{}]/g;function gt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function Dhe(e){return e.replace(Rhe,"\\$&")}function vh(e){return new RegExp("^(?:"+e.map(Dhe).join("|")+")","i")}function gh(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Ihe(e,t,n){var r=Wn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Lhe(e,t,n){var r=Wn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function zhe(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function $he(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Bhe(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function yI(e,t,n){var r=Wn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function xI(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Uhe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Hhe(e,t,n){var r=Wn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Fhe(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function bI(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function qhe(e,t,n){var r=Wn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function wI(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Khe(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vhe(e,t,n){var r=Wn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Yhe(e,t,n){var r=Wn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ghe(e,t,n){var r=Wn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xhe(e,t,n){var r=khe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Whe(e,t,n){var r=Wn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Qhe(e,t,n){var r=Wn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function SI(e,t){return gt(e.getDate(),t,2)}function Zhe(e,t){return gt(e.getHours(),t,2)}function Jhe(e,t){return gt(e.getHours()%12||12,t,2)}function eme(e,t){return gt(1+Wm.count(Ko(e),e),t,3)}function UU(e,t){return gt(e.getMilliseconds(),t,3)}function tme(e,t){return UU(e,t)+"000"}function nme(e,t){return gt(e.getMonth()+1,t,2)}function rme(e,t){return gt(e.getMinutes(),t,2)}function ame(e,t){return gt(e.getSeconds(),t,2)}function ime(e){var t=e.getDay();return t===0?7:t}function ome(e,t){return gt(J0.count(Ko(e)-1,e),t,2)}function HU(e){var t=e.getDay();return t>=4||t===0?Md(e):Md.ceil(e)}function sme(e,t){return e=HU(e),gt(Md.count(Ko(e),e)+(Ko(e).getDay()===4),t,2)}function lme(e){return e.getDay()}function cme(e,t){return gt(_y.count(Ko(e)-1,e),t,2)}function ume(e,t){return gt(e.getFullYear()%100,t,2)}function dme(e,t){return e=HU(e),gt(e.getFullYear()%100,t,2)}function fme(e,t){return gt(e.getFullYear()%1e4,t,4)}function hme(e,t){var n=e.getDay();return e=n>=4||n===0?Md(e):Md.ceil(e),gt(e.getFullYear()%1e4,t,4)}function mme(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+gt(t/60|0,"0",2)+gt(t%60,"0",2)}function EI(e,t){return gt(e.getUTCDate(),t,2)}function pme(e,t){return gt(e.getUTCHours(),t,2)}function vme(e,t){return gt(e.getUTCHours()%12||12,t,2)}function gme(e,t){return gt(1+Z0.count(Vo(e),e),t,3)}function FU(e,t){return gt(e.getUTCMilliseconds(),t,3)}function yme(e,t){return FU(e,t)+"000"}function xme(e,t){return gt(e.getUTCMonth()+1,t,2)}function bme(e,t){return gt(e.getUTCMinutes(),t,2)}function wme(e,t){return gt(e.getUTCSeconds(),t,2)}function Sme(e){var t=e.getUTCDay();return t===0?7:t}function Eme(e,t){return gt(ex.count(Vo(e)-1,e),t,2)}function qU(e){var t=e.getUTCDay();return t>=4||t===0?kd(e):kd.ceil(e)}function _me(e,t){return e=qU(e),gt(kd.count(Vo(e),e)+(Vo(e).getUTCDay()===4),t,2)}function jme(e){return e.getUTCDay()}function Cme(e,t){return gt(jy.count(Vo(e)-1,e),t,2)}function Ome(e,t){return gt(e.getUTCFullYear()%100,t,2)}function Ame(e,t){return e=qU(e),gt(e.getUTCFullYear()%100,t,2)}function Nme(e,t){return gt(e.getUTCFullYear()%1e4,t,4)}function Tme(e,t){var n=e.getUTCDay();return e=n>=4||n===0?kd(e):kd.ceil(e),gt(e.getUTCFullYear()%1e4,t,4)}function Pme(){return"+0000"}function _I(){return"%"}function jI(e){return+e}function CI(e){return Math.floor(+e/1e3)}var Hu,KU,VU;Mme({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Mme(e){return Hu=Mhe(e),KU=Hu.format,Hu.parse,VU=Hu.utcFormat,Hu.utcParse,Hu}function kme(e){return new Date(e)}function Rme(e){return e instanceof Date?+e:+new Date(+e)}function PO(e,t,n,r,a,i,s,c,u,d){var m=gO(),f=m.invert,v=m.domain,g=d(".%L"),b=d(":%S"),w=d("%I:%M"),S=d("%I %p"),E=d("%a %d"),O=d("%b %d"),j=d("%B"),A=d("%Y");function N(T){return(u(T)<T?g:c(T)<T?b:s(T)<T?w:i(T)<T?S:r(T)<T?a(T)<T?E:O:n(T)<T?j:A)(T)}return m.invert=function(T){return new Date(f(T))},m.domain=function(T){return arguments.length?v(Array.from(T,Rme)):v().map(kme)},m.ticks=function(T){var P=v();return e(P[0],P[P.length-1],T??10)},m.tickFormat=function(T,P){return P==null?N:d(P)},m.nice=function(T){var P=v();return(!T||typeof T.range!="function")&&(T=t(P[0],P[P.length-1],T??10)),T?v(MU(P,T)):m},m.copy=function(){return Xm(m,PO(e,t,n,r,a,i,s,c,u,d))},m}function Dme(){return Ba.apply(PO(The,Phe,Ko,NO,J0,Wm,OO,jO,uc,KU).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ime(){return Ba.apply(PO(Ahe,Nhe,Vo,TO,ex,Z0,AO,CO,uc,VU).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function tx(){var e=0,t=1,n,r,a,i,s=Ar,c=!1,u;function d(f){return f==null||isNaN(f=+f)?u:s(a===0?.5:(f=(i(f)-n)*a,c?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([e,t]=f,n=i(e=+e),r=i(t=+t),a=n===r?0:1/(r-n),d):[e,t]},d.clamp=function(f){return arguments.length?(c=!!f,d):c},d.interpolator=function(f){return arguments.length?(s=f,d):s};function m(f){return function(v){var g,b;return arguments.length?([g,b]=v,s=f(g,b),d):[s(0),s(1)]}}return d.range=m(Mo),d.rangeRound=m(vO),d.unknown=function(f){return arguments.length?(u=f,d):u},function(f){return i=f,n=f(e),r=f(t),a=n===r?0:1/(r-n),d}}function Nl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function YU(){var e=Al(tx()(Ar));return e.copy=function(){return Nl(e,YU())},es.apply(e,arguments)}function GU(){var e=bO(tx()).domain([1,10]);return e.copy=function(){return Nl(e,GU()).base(e.base())},es.apply(e,arguments)}function XU(){var e=wO(tx());return e.copy=function(){return Nl(e,XU()).constant(e.constant())},es.apply(e,arguments)}function MO(){var e=SO(tx());return e.copy=function(){return Nl(e,MO()).exponent(e.exponent())},es.apply(e,arguments)}function Lme(){return MO.apply(null,arguments).exponent(.5)}function WU(){var e=[],t=Ar;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ym(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(il),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>vfe(e,i/r))},n.copy=function(){return WU(t).domain(e)},es.apply(n,arguments)}function nx(){var e=0,t=.5,n=1,r=1,a,i,s,c,u,d=Ar,m,f=!1,v;function g(w){return isNaN(w=+w)?v:(w=.5+((w=+m(w))-i)*(r*w<r*i?c:u),d(f?Math.max(0,Math.min(1,w)):w))}g.domain=function(w){return arguments.length?([e,t,n]=w,a=m(e=+e),i=m(t=+t),s=m(n=+n),c=a===i?0:.5/(i-a),u=i===s?0:.5/(s-i),r=i<a?-1:1,g):[e,t,n]},g.clamp=function(w){return arguments.length?(f=!!w,g):f},g.interpolator=function(w){return arguments.length?(d=w,g):d};function b(w){return function(S){var E,O,j;return arguments.length?([E,O,j]=S,d=Xfe(w,[E,O,j]),g):[d(0),d(.5),d(1)]}}return g.range=b(Mo),g.rangeRound=b(vO),g.unknown=function(w){return arguments.length?(v=w,g):v},function(w){return m=w,a=w(e),i=w(t),s=w(n),c=a===i?0:.5/(i-a),u=i===s?0:.5/(s-i),r=i<a?-1:1,g}}function QU(){var e=Al(nx()(Ar));return e.copy=function(){return Nl(e,QU())},es.apply(e,arguments)}function ZU(){var e=bO(nx()).domain([.1,1,10]);return e.copy=function(){return Nl(e,ZU()).base(e.base())},es.apply(e,arguments)}function JU(){var e=wO(nx());return e.copy=function(){return Nl(e,JU()).constant(e.constant())},es.apply(e,arguments)}function kO(){var e=SO(nx());return e.copy=function(){return Nl(e,kO()).exponent(e.exponent())},es.apply(e,arguments)}function zme(){return kO.apply(null,arguments).exponent(.5)}const Ah=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:hO,scaleDiverging:QU,scaleDivergingLog:ZU,scaleDivergingPow:kO,scaleDivergingSqrt:zme,scaleDivergingSymlog:JU,scaleIdentity:PU,scaleImplicit:__,scaleLinear:TU,scaleLog:kU,scaleOrdinal:fO,scalePoint:xfe,scalePow:EO,scaleQuantile:IU,scaleQuantize:LU,scaleRadial:DU,scaleSequential:YU,scaleSequentialLog:GU,scaleSequentialPow:MO,scaleSequentialQuantile:WU,scaleSequentialSqrt:Lme,scaleSequentialSymlog:XU,scaleSqrt:yhe,scaleSymlog:RU,scaleThreshold:zU,scaleTime:Dme,scaleUtc:Ime,tickFormat:NU},Symbol.toStringTag,{value:"Module"}));function $me(e){if(e in Ah)return Ah[e]();var t="scale".concat(Dm(e));if(t in Ah)return Ah[t]()}function OI(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=$me(e);if(r!=null)return r.domain(t).range(n),r}}function RO(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?OI(e.scale,n,r):OI(t,n,r)}function Bme(e){return"scale".concat(Dm(e))}function Ume(e){return Bme(e)in Ah}var eH=(e,t,n)=>{if(e!=null){var{scale:r,type:a}=e;if(r==="auto")return a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":a==="category"?"band":"linear";if(typeof r=="string")return Ume(r)?r:"point"}};function Hme(e,t){for(var n=0,r=e.length,a=e[0]<e[e.length-1];n<r;){var i=Math.floor((n+r)/2);(a?e[i]<t:e[i]>t)?n=i+1:r=i}return n}function tH(e,t){if(e){var n=t??e.domain(),r=n.map(i=>{var s;return(s=e(i))!==null&&s!==void 0?s:0}),a=e.range();if(!(n.length===0||a.length<2))return i=>{var s,c,u=Hme(r,i);if(u<=0)return n[0];if(u>=n.length)return n[n.length-1];var d=(s=r[u-1])!==null&&s!==void 0?s:0,m=(c=r[u])!==null&&c!==void 0?c:0;return Math.abs(i-d)<=Math.abs(i-m)?n[u-1]:n[u]}}}function Fme(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):tH(e,void 0)}function AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Cy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){qme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qme(e,t,n){return(t=Kme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kme(e){var t=Vme(e,"string");return typeof t=="symbol"?t:t+""}function Vme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N_=[0,"auto"],Pn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},nH=(e,t)=>e.cartesianAxis.xAxis[t],ts=(e,t)=>{var n=nH(e,t);return n??Pn},Mn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:N_,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:$m},rH=(e,t)=>e.cartesianAxis.yAxis[t],ns=(e,t)=>{var n=rH(e,t);return n??Mn},Yme={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},DO=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Yme},un=(e,t,n)=>{switch(t){case"xAxis":return ts(e,n);case"yAxis":return ns(e,n);case"zAxis":return DO(e,n);case"angleAxis":return oO(e,n);case"radiusAxis":return sO(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Gme=(e,t,n)=>{switch(t){case"xAxis":return ts(e,n);case"yAxis":return ns(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},af=(e,t,n)=>{switch(t){case"xAxis":return ts(e,n);case"yAxis":return ns(e,n);case"angleAxis":return oO(e,n);case"radiusAxis":return sO(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},aH=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function IO(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var rx=e=>e.graphicalItems.cartesianItems,Xme=se([Jt,Vm],IO),LO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Qm=se([rx,un,Xme],LO,{memoizeOptions:{resultEqualityCheck:W0}}),iH=se([Qm],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(G0)),oH=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Wme=se([Qm],oH),zO=e=>e.map(t=>t.data).filter(Boolean).flat(1),Qme=se([Qm],zO,{memoizeOptions:{resultEqualityCheck:W0}}),$O=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:a}=t;return e.length>0?e:n.slice(r,a+1)},BO=se([Qme,JC],$O),UO=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Pt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(a=>({value:Pt(a,r)}))):e.map(r=>({value:r})),Zm=se([BO,un,Qm],UO);function od(e){if(Fi(e)||e instanceof Date){var t=Number(e);if(ct(t))return t}}function NI(e){if(Array.isArray(e)){var t=[od(e[0]),od(e[1])];return Ii(t)?t:void 0}var n=od(e);if(n!=null)return[n,n]}function Yo(e){return e.map(od).filter(Vr)}function Zme(e,t){var n=od(e),r=od(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Jme=se([Zm],e=>e==null?void 0:e.map(t=>t.value).sort(Zme));function sH(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function epe(e,t,n){return!n||typeof t!="number"||Hi(t)?[]:n.length?Yo(n.flatMap(r=>{var a=Pt(e,r.dataKey),i,s;if(Array.isArray(a)?[i,s]=a:i=s=a,!(!ct(i)||!ct(s)))return[t-i,t+s]})):[]}var $n=e=>{var t=Xn(e),n=rf(e);return af(e,t,n)},Jm=se([$n],e=>e==null?void 0:e.dataKey),tpe=se([iH,JC,$n],vU),lH=(e,t,n,r)=>{var a={},i=t.reduce((s,c)=>{if(c.stackId==null)return s;var u=s[c.stackId];return u==null&&(u=[]),u.push(c),s[c.stackId]=u,s},a);return Object.fromEntries(Object.entries(i).map(s=>{var[c,u]=s,d=r?[...u].reverse():u,m=d.map(cO);return[c,{stackedData:Hle(e,m,n),graphicalItems:d}]}))},T_=se([tpe,iH,Km,cU],lH),cH=(e,t,n,r)=>{var{dataStartIndex:a,dataEndIndex:i}=t;if(r==null&&n!=="zAxis"){var s=Yle(e,a,i);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},npe=se([un],e=>e.allowDataOverflow),HO=e=>{var t;if(e==null||!("domain"in e))return N_;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Yo(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:N_},FO=se([un],HO),qO=se([FO,npe],W6),rpe=se([T_,Jo,Jt,qO],cH,{memoizeOptions:{resultEqualityCheck:X0}}),ax=e=>e.errorBars,ape=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>sH(n,r)),Oy=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n.filter(Boolean);if(a.length!==0){var i=a.flat(),s=Math.min(...i),c=Math.max(...i);return[s,c]}},KO=(e,t,n,r,a)=>{var i,s;if(n.length>0&&e.forEach(c=>{n.forEach(u=>{var d,m,f=(d=r[u.id])===null||d===void 0?void 0:d.filter(E=>sH(a,E)),v=Pt(c,(m=t.dataKey)!==null&&m!==void 0?m:u.dataKey),g=epe(c,v,f);if(g.length>=2){var b=Math.min(...g),w=Math.max(...g);(i==null||b<i)&&(i=b),(s==null||w>s)&&(s=w)}var S=NI(v);S!=null&&(i=i==null?S[0]:Math.min(i,S[0]),s=s==null?S[1]:Math.max(s,S[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(c=>{var u=NI(Pt(c,t.dataKey));u!=null&&(i=i==null?u[0]:Math.min(i,u[0]),s=s==null?u[1]:Math.max(s,u[1]))}),ct(i)&&ct(s))return[i,s]},ipe=se([BO,un,Wme,ax,Jt],KO,{memoizeOptions:{resultEqualityCheck:X0}});function ope(e){var{value:t}=e;if(Fi(t)||t instanceof Date)return t}var spe=(e,t,n)=>{var r=e.map(ope).filter(a=>a!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&x8(r))?X6(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},uH=e=>e.referenceElements.dots,of=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),lpe=se([uH,Jt,Vm],of),dH=e=>e.referenceElements.areas,cpe=se([dH,Jt,Vm],of),fH=e=>e.referenceElements.lines,upe=se([fH,Jt,Vm],of),hH=(e,t)=>{if(e!=null){var n=Yo(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},dpe=se(lpe,Jt,hH),mH=(e,t)=>{if(e!=null){var n=Yo(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},fpe=se([cpe,Jt],mH);function hpe(e){var t;if(e.x!=null)return Yo([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Yo(n)}function mpe(e){var t;if(e.y!=null)return Yo([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Yo(n)}var pH=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?hpe(r):mpe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},ppe=se([upe,Jt],pH),vpe=se(dpe,ppe,fpe,(e,t,n)=>Oy(e,n,t)),VO=(e,t,n,r,a,i,s,c)=>{if(n!=null)return n;var u=s==="vertical"&&c==="xAxis"||s==="horizontal"&&c==="yAxis",d=u?Oy(r,i,a):Oy(i,a);return Kde(t,d,e.allowDataOverflow)},gpe=se([un,FO,qO,rpe,ipe,vpe,yt,Jt],VO,{memoizeOptions:{resultEqualityCheck:X0}}),ype=[0,1],YO=(e,t,n,r,a,i,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var{dataKey:c,type:u}=e,d=Wo(t,i);if(d&&c==null){var m;return X6(0,(m=n==null?void 0:n.length)!==null&&m!==void 0?m:0)}return u==="category"?spe(r,e,d):a==="expand"?ype:s}},GO=se([un,yt,BO,Zm,Km,Jt,gpe],YO),Tl=se([un,aH,rO],eH),XO=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var a=HO(t),i=Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Ii(e)){if(i)return zD(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return $D(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(i&&Ii(e))return zD(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ii(e))return $D(e,t.tickCount,t.allowDecimals,"adaptive")}}},WO=se([GO,af,Tl],XO),QO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Ii(t)&&Array.isArray(n)&&n.length>0){var a,i,s=t[0],c=(a=n[0])!==null&&a!==void 0?a:0,u=t[1],d=(i=n[n.length-1])!==null&&i!==void 0?i:0;return[Math.min(s,c),Math.max(u,d)]}return t},xpe=se([un,GO,WO,Jt],QO),bpe=se(Zm,un,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Yo(e.map(f=>f.value))).sort((f,v)=>f-v),a=r[0],i=r[r.length-1];if(a==null||i==null)return 1/0;var s=i-a;if(s===0)return 1/0;for(var c=0;c<r.length-1;c++){var u=r[c],d=r[c+1];if(!(u==null||d==null)){var m=d-u;n=Math.min(n,m)}}return n/s}}),vH=se(bpe,yt,lU,Ln,(e,t,n,r,a)=>a,(e,t,n,r,a)=>{if(!ct(e))return 0;var i=t==="vertical"?r.height:r.width;if(a==="gap")return e*i/2;if(a==="no-gap"){var s=yr(n,e*i),c=e*i/2;return c-s-(c-s)/i*s}return 0}),wpe=(e,t,n)=>{var r=ts(e,t);return r==null||typeof r.padding!="string"?0:vH(e,"xAxis",t,n,r.padding)},Spe=(e,t,n)=>{var r=ns(e,t);return r==null||typeof r.padding!="string"?0:vH(e,"yAxis",t,n,r.padding)},Epe=se(ts,wpe,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:a}=e;return typeof a=="string"?{left:t,right:t}:{left:((n=a.left)!==null&&n!==void 0?n:0)+t,right:((r=a.right)!==null&&r!==void 0?r:0)+t}}),_pe=se(ns,Spe,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:a}=e;return typeof a=="string"?{top:t,bottom:t}:{top:((n=a.top)!==null&&n!==void 0?n:0)+t,bottom:((r=a.bottom)!==null&&r!==void 0?r:0)+t}}),jpe=se([Ln,Epe,$0,z0,(e,t,n)=>n],(e,t,n,r,a)=>{var{padding:i}=r;return a?[i.left,n.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),Cpe=se([Ln,yt,_pe,$0,z0,(e,t,n)=>n],(e,t,n,r,a,i)=>{var{padding:s}=a;return i?[r.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),ep=(e,t,n,r)=>{var a;switch(t){case"xAxis":return jpe(e,n,r);case"yAxis":return Cpe(e,n,r);case"zAxis":return(a=DO(e,n))===null||a===void 0?void 0:a.range;case"angleAxis":return hU(e);case"radiusAxis":return mU(e,n);default:return}},gH=se([un,ep],K0),Ope=se([Tl,xpe],gU),ZO=se([un,Tl,Ope,gH],RO),yH=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:a,scale:i}=n,s=Wo(e,r);if(s&&(a==="number"||i!=="auto"))return t.map(c=>c.value)}},JO=se([yt,Zm,af,Jt],yH),ix=se([ZO],uO);se([ZO],Fme);se([ZO,Jme],tH);se([Qm,ax,Jt],ape);function xH(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var ox=(e,t)=>t,sx=(e,t,n)=>n,Ape=se(I0,ox,sx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(xH)),Npe=se(L0,ox,sx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(xH)),bH=(e,t)=>({width:e.width,height:t.height}),Tpe=(e,t)=>{var n=typeof t.width=="number"?t.width:$m;return{width:n,height:e.height}},wH=se(Ln,ts,bH),Ppe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Mpe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},kpe=se(Zo,Ln,Ape,ox,sx,(e,t,n,r,a)=>{var i={},s;return n.forEach(c=>{var u=bH(t,c);s==null&&(s=Ppe(t,r,e));var d=r==="top"&&!a||r==="bottom"&&a;i[c.id]=s-Number(d)*u.height,s+=(d?-1:1)*u.height}),i}),Rpe=se(Qo,Ln,Npe,ox,sx,(e,t,n,r,a)=>{var i={},s;return n.forEach(c=>{var u=Tpe(t,c);s==null&&(s=Mpe(t,r,e));var d=r==="left"&&!a||r==="right"&&a;i[c.id]=s-Number(d)*u.width,s+=(d?-1:1)*u.width}),i}),Dpe=(e,t)=>{var n=ts(e,t);if(n!=null)return kpe(e,n.orientation,n.mirror)},Ipe=se([Ln,ts,Dpe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var a=n==null?void 0:n[r];return a==null?{x:e.left,y:0}:{x:e.left,y:a}}}),Lpe=(e,t)=>{var n=ns(e,t);if(n!=null)return Rpe(e,n.orientation,n.mirror)},zpe=se([Ln,ns,Lpe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var a=n==null?void 0:n[r];return a==null?{x:0,y:e.top}:{x:a,y:e.top}}}),SH=se(Ln,ns,(e,t)=>{var n=typeof t.width=="number"?t.width:$m;return{width:n,height:e.height}}),TI=(e,t,n)=>{switch(t){case"xAxis":return wH(e,n).width;case"yAxis":return SH(e,n).height;default:return}},EH=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:a,type:i,dataKey:s}=n,c=Wo(e,r),u=t.map(d=>d.value);if(s&&c&&i==="category"&&a&&x8(u))return u}},eA=se([yt,Zm,un,Jt],EH),PI=se([yt,Gme,Tl,ix,eA,JO,ep,WO,Jt],(e,t,n,r,a,i,s,c,u)=>{if(t!=null){var d=Wo(e,u);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:u,categoricalDomain:i,duplicateDomain:a,isCategorical:d,niceTicks:c,range:s,realScaleType:n,scale:r}}}),$pe=(e,t,n,r,a,i,s,c,u)=>{if(!(t==null||r==null)){var d=Wo(e,u),{type:m,ticks:f,tickCount:v}=t,g=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,b=m==="category"&&r.bandwidth?r.bandwidth()/g:0;b=u==="angleAxis"&&i!=null&&i.length>=2?Vn(i[0]-i[1])*2*b:b;var w=f||a;return w?w.map((S,E)=>{var O=s?s.indexOf(S):S,j=r.map(O);return ct(j)?{index:E,coordinate:j+b,value:S,offset:b}:null}).filter(Vr):d&&c?c.map((S,E)=>{var O=r.map(S);return ct(O)?{coordinate:O+b,value:S,index:E,offset:b}:null}).filter(Vr):r.ticks?r.ticks(v).map((S,E)=>{var O=r.map(S);return ct(O)?{coordinate:O+b,value:S,index:E,offset:b}:null}).filter(Vr):r.domain().map((S,E)=>{var O=r.map(S);return ct(O)?{coordinate:O+b,value:s?s[S]:S,index:E,offset:b}:null}).filter(Vr)}},_H=se([yt,af,Tl,ix,WO,ep,eA,JO,Jt],$pe),Bpe=(e,t,n,r,a,i,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Wo(e,s),{tickCount:u}=t,d=0;return d=s==="angleAxis"&&(r==null?void 0:r.length)>=2?Vn(r[0]-r[1])*2*d:d,c&&i?i.map((m,f)=>{var v=n.map(m);return ct(v)?{coordinate:v+d,value:m,index:f,offset:d}:null}).filter(Vr):n.ticks?n.ticks(u).map((m,f)=>{var v=n.map(m);return ct(v)?{coordinate:v+d,value:m,index:f,offset:d}:null}).filter(Vr):n.domain().map((m,f)=>{var v=n.map(m);return ct(v)?{coordinate:v+d,value:a?a[m]:m,index:f,offset:d}:null}).filter(Vr)}},fl=se([yt,af,ix,ep,eA,JO,Jt],Bpe),hl=se(un,ix,(e,t)=>{if(!(e==null||t==null))return Cy(Cy({},e),{},{scale:t})}),Upe=se([un,Tl,GO,gH],RO),Hpe=se([Upe],uO);se((e,t,n)=>DO(e,n),Hpe,(e,t)=>{if(!(e==null||t==null))return Cy(Cy({},e),{},{scale:t})});var Fpe=se([yt,I0,L0],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),qpe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};se([qpe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,a=e[0];for(var i of e){var s=Math.abs(i.coordinate-t);s<r&&(r=s,a=i)}return(n=a)===null||n===void 0?void 0:n.value}});var jH=e=>e.options.defaultTooltipEventType,CH=e=>e.options.validateTooltipEventTypes;function OH(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function tA(e,t){var n=jH(e),r=CH(e);return OH(t,n,r)}function Kpe(e){return Te(t=>tA(t,e))}var AH=(e,t)=>{var n,r=Number(t);if(!(Hi(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Vpe=e=>e.tooltip.settings,Ks={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Ype={itemInteraction:{click:Ks,hover:Ks},axisInteraction:{click:Ks,hover:Ks},keyboardInteraction:Ks,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},NH=br({name:"tooltip",initialState:Ype,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Ht()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,a=Ra(e).tooltipItemPayloads.indexOf(n);a>-1&&(e.tooltipItemPayloads[a]=r)},prepare:Ht()},removeTooltipEntrySettings:{reducer(e,t){var n=Ra(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Ht()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Gpe,replaceTooltipEntrySettings:Xpe,removeTooltipEntrySettings:Wpe,setTooltipSettingsState:Qpe,setActiveMouseOverItemIndex:TH,mouseLeaveItem:Zpe,mouseLeaveChart:PH,setActiveClickItemIndex:Jpe,setMouseOverAxisIndex:MH,setMouseClickAxisIndex:eve,setSyncInteraction:P_,setKeyboardInteraction:Ay}=NH.actions,tve=NH.reducer;function MI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Jv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MI(Object(n),!0).forEach(function(r){nve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nve(e,t,n){return(t=rve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rve(e){var t=ave(e,"string");return typeof t=="symbol"?t:t+""}function ave(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ive(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function ove(e){return e.index!=null}var kH=(e,t,n,r)=>{if(t==null)return Ks;var a=ive(e,t,n);if(a==null)return Ks;if(a.active)return a;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(ove(a)){if(i)return Jv(Jv({},a),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Jv(Jv({},Ks),{},{coordinate:a.coordinate})};function sve(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function lve(e,t){var n=sve(e),r=t[0],a=t[1];if(n===void 0)return!1;var i=Math.min(r,a),s=Math.max(r,a);return n>=i&&n<=s}function cve(e,t,n){if(n==null||t==null)return!0;var r=Pt(e,t);return r==null||!Ii(n)?!0:lve(r,n)}var nA=(e,t,n,r)=>{var a=e==null?void 0:e.index;if(a==null)return null;var i=Number(a);if(!ct(i))return a;var s=0,c=1/0;t.length>0&&(c=t.length-1);var u=Math.max(s,Math.min(i,c)),d=t[u];return d==null||cve(d,n,r)?String(u):null},RH=(e,t,n,r,a,i,s)=>{if(i!=null){var c=s[0],u=c==null?void 0:c.getPosition(i);if(u!=null)return u;var d=a==null?void 0:a[Number(i)];if(d)switch(n){case"horizontal":return{x:d.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:d.coordinate}}}},DH=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var a;if(n==="hover"?a=e.itemInteraction.hover.graphicalItemId:a=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&a==null)return e.tooltipItemPayloads;if(a==null&&r!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(s=>{var c;return((c=s.settings)===null||c===void 0?void 0:c.graphicalItemId)===a})},IH=e=>e.options.tooltipPayloadSearcher,sf=e=>e.tooltip;function kI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function RI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(n),!0).forEach(function(r){uve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uve(e,t,n){return(t=dve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dve(e){var t=fve(e,"string");return typeof t=="symbol"?t:t+""}function fve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hve(e){if(typeof e=="string"||typeof e=="number")return e}function mve(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function pve(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function DI(e){if(typeof e=="string")return e}function vve(e){if(!(e==null||typeof e!="object")){var t="name"in e?hve(e.name):void 0,n="unit"in e?mve(e.unit):void 0,r="dataKey"in e?pve(e.dataKey):void 0,a="payload"in e?e.payload:void 0,i="color"in e?DI(e.color):void 0,s="fill"in e?DI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:a,color:i,fill:s}}}function gve(e,t){return e??t}var LH=(e,t,n,r,a,i,s)=>{if(!(t==null||i==null)){var{chartData:c,computedData:u,dataStartIndex:d,dataEndIndex:m}=n,f=[];return e.reduce((v,g)=>{var b,{dataDefinedOnItem:w,settings:S}=g,E=gve(w,c),O=Array.isArray(E)?p6(E,d,m):E,j=(b=S==null?void 0:S.dataKey)!==null&&b!==void 0?b:r,A=S==null?void 0:S.nameKey,N;if(r&&Array.isArray(O)&&!Array.isArray(O[0])&&s==="axis"?N=b8(O,r,a):N=i(O,t,u,A),Array.isArray(N))N.forEach(P=>{var R,D,K=vve(P),z=K==null?void 0:K.name,I=K==null?void 0:K.dataKey,G=K==null?void 0:K.payload,L=RI(RI({},S),{},{name:z,unit:K==null?void 0:K.unit,color:(R=K==null?void 0:K.color)!==null&&R!==void 0?R:S==null?void 0:S.color,fill:(D=K==null?void 0:K.fill)!==null&&D!==void 0?D:S==null?void 0:S.fill});v.push(CR({tooltipEntrySettings:L,dataKey:I,payload:G,value:Pt(G,I),name:z==null?void 0:String(z)}))});else{var T;v.push(CR({tooltipEntrySettings:S,dataKey:j,payload:N,value:Pt(N,j),name:(T=Pt(N,A))!==null&&T!==void 0?T:S==null?void 0:S.name}))}return v},f)}},rA=se([$n,aH,rO],eH),yve=se([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),xve=se([Xn,rf],IO),lf=se([yve,$n,xve],LO,{memoizeOptions:{resultEqualityCheck:W0}}),bve=se([lf],e=>e.filter(G0)),wve=se([lf],zO,{memoizeOptions:{resultEqualityCheck:W0}}),cf=se([wve,Jo],$O),Sve=se([bve,Jo,$n],vU),aA=se([cf,$n,lf],UO),zH=se([$n],HO),Eve=se([$n],e=>e.allowDataOverflow),$H=se([zH,Eve],W6),_ve=se([lf],e=>e.filter(G0)),jve=se([Sve,_ve,Km,cU],lH),Cve=se([jve,Jo,Xn,$H],cH),Ove=se([lf],oH),Ave=se([cf,$n,Ove,ax,Xn],KO,{memoizeOptions:{resultEqualityCheck:X0}}),Nve=se([uH,Xn,rf],of),Tve=se([Nve,Xn],hH),Pve=se([dH,Xn,rf],of),Mve=se([Pve,Xn],mH),kve=se([fH,Xn,rf],of),Rve=se([kve,Xn],pH),Dve=se([Tve,Rve,Mve],Oy),Ive=se([$n,zH,$H,Cve,Ave,Dve,yt,Xn],VO),tp=se([$n,yt,cf,aA,Km,Xn,Ive],YO),Lve=se([tp,$n,rA],XO),zve=se([$n,tp,Lve,Xn],QO),BH=e=>{var t=Xn(e),n=rf(e),r=!1;return ep(e,t,n,r)},UH=se([$n,BH],K0),$ve=se([$n,rA,zve,UH],RO),HH=se([$ve],uO),Bve=se([yt,aA,$n,Xn],EH),Uve=se([yt,aA,$n,Xn],yH),Hve=(e,t,n,r,a,i,s,c)=>{if(t){var{type:u}=t,d=Wo(e,c);if(r){var m=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,f=u==="category"&&r.bandwidth?r.bandwidth()/m:0;return f=c==="angleAxis"&&a!=null&&(a==null?void 0:a.length)>=2?Vn(a[0]-a[1])*2*f:f,d&&s?s.map((v,g)=>{var b=r.map(v);return ct(b)?{coordinate:b+f,value:v,index:g,offset:f}:null}).filter(Vr):r.domain().map((v,g)=>{var b=r.map(v);return ct(b)?{coordinate:b+f,value:i?i[v]:v,index:g,offset:f}:null}).filter(Vr)}}},rs=se([yt,$n,rA,HH,BH,Bve,Uve,Xn],Hve),iA=se([jH,CH,Vpe],(e,t,n)=>OH(n.shared,e,t)),FH=e=>e.tooltip.settings.trigger,oA=e=>e.tooltip.settings.defaultIndex,np=se([sf,iA,FH,oA],kH),ml=se([np,cf,Jm,tp],nA),qH=se([rs,ml],AH),sA=se([np],e=>{if(e)return e.dataKey}),KH=se([np],e=>{if(e)return e.graphicalItemId}),VH=se([sf,iA,FH,oA],DH),Fve=se([Qo,Zo,yt,Ln,rs,oA,VH],RH),qve=se([np,Fve],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Kve=se([np],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),Vve=se([VH,ml,Jo,Jm,qH,IH,iA],LH),Yve=se([Vve],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function II(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function LI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?II(Object(n),!0).forEach(function(r){Gve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gve(e,t,n){return(t=Xve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xve(e){var t=Wve(e,"string");return typeof t=="symbol"?t:t+""}function Wve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qve=()=>Te($n),Zve=()=>{var e=Qve(),t=Te(rs),n=Te(HH);return Ad(!e||!n?void 0:LI(LI({},e),{},{scale:n}),t)};function zI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zI(Object(n),!0).forEach(function(r){Jve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jve(e,t,n){return(t=ege(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ege(e){var t=tge(e,"string");return typeof t=="symbol"?t:t+""}function tge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nge=(e,t,n,r)=>{var a=t.find(i=>i&&i.index===n);if(a){if(e==="horizontal")return{x:a.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:a.coordinate}}return{x:0,y:0}},rge=(e,t,n,r)=>{var a=t.find(d=>d&&d.index===n);if(a){if(e==="centric"){var i=a.coordinate,{radius:s}=r;return Fu(Fu(Fu({},r),En(r.cx,r.cy,s,i)),{},{angle:i,radius:s})}var c=a.coordinate,{angle:u}=r;return Fu(Fu(Fu({},r),En(r.cx,r.cy,c,u)),{},{angle:u,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function age(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var YH=(e,t,n,r,a)=>{var i,s=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(s<=1||e==null)return 0;if(r==="angleAxis"&&a!=null&&Math.abs(Math.abs(a[1]-a[0])-360)<=1e-6)for(var c=0;c<s;c++){var u,d,m,f,v,g=c>0?(u=n[c-1])===null||u===void 0?void 0:u.coordinate:(d=n[s-1])===null||d===void 0?void 0:d.coordinate,b=(m=n[c])===null||m===void 0?void 0:m.coordinate,w=c>=s-1?(f=n[0])===null||f===void 0?void 0:f.coordinate:(v=n[c+1])===null||v===void 0?void 0:v.coordinate,S=void 0;if(!(g==null||b==null||w==null))if(Vn(b-g)!==Vn(w-b)){var E=[];if(Vn(w-b)===Vn(a[1]-a[0])){S=w;var O=b+a[1]-a[0];E[0]=Math.min(O,(O+g)/2),E[1]=Math.max(O,(O+g)/2)}else{S=g;var j=w+a[1]-a[0];E[0]=Math.min(b,(j+b)/2),E[1]=Math.max(b,(j+b)/2)}var A=[Math.min(b,(S+b)/2),Math.max(b,(S+b)/2)];if(e>A[0]&&e<=A[1]||e>=E[0]&&e<=E[1]){var N;return(N=n[c])===null||N===void 0?void 0:N.index}}else{var T=Math.min(g,w),P=Math.max(g,w);if(e>(T+b)/2&&e<=(P+b)/2){var R;return(R=n[c])===null||R===void 0?void 0:R.index}}}else if(t)for(var D=0;D<s;D++){var K=t[D];if(K!=null){var z=t[D+1],I=t[D-1];if(D===0&&z!=null&&e<=(K.coordinate+z.coordinate)/2||D===s-1&&I!=null&&e>(K.coordinate+I.coordinate)/2||D>0&&D<s-1&&I!=null&&z!=null&&e>(K.coordinate+I.coordinate)/2&&e<=(K.coordinate+z.coordinate)/2)return K.index}}return-1},ige=()=>Te(rO),lA=(e,t)=>t,GH=(e,t,n)=>n,cA=(e,t,n,r)=>r,oge=se(rs,e=>C0(e,t=>t.coordinate)),uA=se([sf,lA,GH,cA],kH),dA=se([uA,cf,Jm,tp],nA),sge=(e,t,n)=>{if(t!=null){var r=sf(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},XH=se([sf,lA,GH,cA],DH),Ny=se([Qo,Zo,yt,Ln,rs,cA,XH],RH),lge=se([uA,Ny],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),WH=se([rs,dA],AH),cge=se([XH,dA,Jo,Jm,WH,IH,lA],LH),uge=se([uA,dA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),dge=(e,t,n,r,a,i,s)=>{if(!(!e||!n||!r||!a)&&age(e,s)){var c=Gle(e,t),u=YH(c,i,a,n,r),d=nge(t,a,u,e);return{activeIndex:String(u),activeCoordinate:d}}},fge=(e,t,n,r,a,i,s)=>{if(!(!e||!r||!a||!i||!n)){var c=Rde(e,n);if(c){var u=Xle(c,t),d=YH(u,s,i,r,a),m=rge(t,i,d,c);return{activeIndex:String(d),activeCoordinate:m}}}},hge=(e,t,n,r,a,i,s,c)=>{if(!(!e||!t||!r||!a||!i))return t==="horizontal"||t==="vertical"?dge(e,t,r,a,i,s,c):fge(e,t,n,r,a,i,s)},mge=se(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),pge=se(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(_n)),n=Array.from(new Set(t));return n.sort((r,a)=>r-a)},{memoizeOptions:{resultEqualityCheck:afe}});function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function BI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(r){vge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vge(e,t,n){return(t=gge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gge(e){var t=yge(e,"string");return typeof t=="symbol"?t:t+""}function yge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xge={},bge={zIndexMap:Object.values(_n).reduce((e,t)=>BI(BI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),xge)},wge=new Set(Object.values(_n));function Sge(e){return wge.has(e)}var QH=br({name:"zIndex",initialState:bge,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Ht()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Sge(n)&&delete e.zIndexMap[n])},prepare:Ht()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:a}=t.payload;e.zIndexMap[n]?a?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:a?void 0:r,panoramaElement:a?r:void 0}},prepare:Ht()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Ht()}}}),{registerZIndexPortal:Ege,unregisterZIndexPortal:_ge,registerZIndexPortalElement:jge,unregisterZIndexPortalElement:Cge}=QH.actions,Oge=QH.reducer;function Gr(e){var{zIndex:t,children:n}=e,r=Cce(),a=r&&t!==void 0&&t!==0,i=wr(),s=kt();x.useLayoutEffect(()=>a?(s(Ege({zIndex:t})),()=>{s(_ge({zIndex:t}))}):Ol,[s,t,a]);var c=Te(u=>mge(u,t,i));return a?c?yl.createPortal(n,c):null:n}function M_(){return M_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M_.apply(null,arguments)}function UI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function eg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(n),!0).forEach(function(r){Age(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Age(e,t,n){return(t=Nge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nge(e){var t=Tge(e,"string");return typeof t=="symbol"?t:t+""}function Tge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pge(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Mge(e){var t,{coordinate:n,payload:r,index:a,offset:i,tooltipAxisBandSize:s,layout:c,cursor:u,tooltipEventType:d,chartName:m}=e,f=n,v=r,g=a;if(!u||!f||m!=="ScatterChart"&&d!=="axis")return null;var b,w,S;if(m==="ScatterChart")b=f,w=Xue,S=_n.cursorLine;else if(m==="BarChart")b=Wue(c,f,i,s),w=q6,S=_n.cursorRectangle;else if(c==="radial"&&S8(f)){var{cx:E,cy:O,radius:j,startAngle:A,endAngle:N}=V6(f);b={cx:E,cy:O,startAngle:A,endAngle:N,innerRadius:j,outerRadius:j},w=G6,S=_n.cursorLine}else b={points:zde(c,f,i)},w=ZC,S=_n.cursorLine;var T=typeof u=="object"&&"className"in u?u.className:void 0,P=eg(eg(eg(eg({stroke:"#ccc",pointerEvents:"none"},i),b),Rc(u)),{},{payload:v,payloadIndex:g,className:dt("recharts-tooltip-cursor",T)});return x.createElement(Gr,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},x.createElement(Pge,{cursor:u,cursorComp:w,cursorProps:P}))}function kge(e){var t=Zve(),n=_6(),r=Qc(),a=ige();return t==null||n==null||r==null||a==null?null:x.createElement(Mge,M_({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:a}))}var ZH=x.createContext(null),Rge=()=>x.useContext(ZH),MS={exports:{}},HI;function Dge(){return HI||(HI=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(u,d,m){this.fn=u,this.context=d,this.once=m||!1}function i(u,d,m,f,v){if(typeof m!="function")throw new TypeError("The listener must be a function");var g=new a(m,f||u,v),b=n?n+d:d;return u._events[b]?u._events[b].fn?u._events[b]=[u._events[b],g]:u._events[b].push(g):(u._events[b]=g,u._eventsCount++),u}function s(u,d){--u._eventsCount===0?u._events=new r:delete u._events[d]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],m,f;if(this._eventsCount===0)return d;for(f in m=this._events)t.call(m,f)&&d.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},c.prototype.listeners=function(d){var m=n?n+d:d,f=this._events[m];if(!f)return[];if(f.fn)return[f.fn];for(var v=0,g=f.length,b=new Array(g);v<g;v++)b[v]=f[v].fn;return b},c.prototype.listenerCount=function(d){var m=n?n+d:d,f=this._events[m];return f?f.fn?1:f.length:0},c.prototype.emit=function(d,m,f,v,g,b){var w=n?n+d:d;if(!this._events[w])return!1;var S=this._events[w],E=arguments.length,O,j;if(S.fn){switch(S.once&&this.removeListener(d,S.fn,void 0,!0),E){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,m),!0;case 3:return S.fn.call(S.context,m,f),!0;case 4:return S.fn.call(S.context,m,f,v),!0;case 5:return S.fn.call(S.context,m,f,v,g),!0;case 6:return S.fn.call(S.context,m,f,v,g,b),!0}for(j=1,O=new Array(E-1);j<E;j++)O[j-1]=arguments[j];S.fn.apply(S.context,O)}else{var A=S.length,N;for(j=0;j<A;j++)switch(S[j].once&&this.removeListener(d,S[j].fn,void 0,!0),E){case 1:S[j].fn.call(S[j].context);break;case 2:S[j].fn.call(S[j].context,m);break;case 3:S[j].fn.call(S[j].context,m,f);break;case 4:S[j].fn.call(S[j].context,m,f,v);break;default:if(!O)for(N=1,O=new Array(E-1);N<E;N++)O[N-1]=arguments[N];S[j].fn.apply(S[j].context,O)}}return!0},c.prototype.on=function(d,m,f){return i(this,d,m,f,!1)},c.prototype.once=function(d,m,f){return i(this,d,m,f,!0)},c.prototype.removeListener=function(d,m,f,v){var g=n?n+d:d;if(!this._events[g])return this;if(!m)return s(this,g),this;var b=this._events[g];if(b.fn)b.fn===m&&(!v||b.once)&&(!f||b.context===f)&&s(this,g);else{for(var w=0,S=[],E=b.length;w<E;w++)(b[w].fn!==m||v&&!b[w].once||f&&b[w].context!==f)&&S.push(b[w]);S.length?this._events[g]=S.length===1?S[0]:S:s(this,g)}return this},c.prototype.removeAllListeners=function(d){var m;return d?(m=n?n+d:d,this._events[m]&&s(this,m)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(MS)),MS.exports}var Ige=Dge();const Lge=ci(Ige);var am=new Lge,k_="recharts.syncEvent.tooltip",FI="recharts.syncEvent.brush",fA=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Hi(n))return e[n]}},zge={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},JH=br({name:"options",initialState:zge,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),$ge=JH.reducer,{createEventEmitter:Bge}=JH.actions;function Uge(e){return e.tooltip.syncInteraction}var Hge={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},eF=br({name:"chartData",initialState:Hge,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:qI,setDataStartEndIndexes:Fge,setComputedData:_2e}=eF.actions,qge=eF.reducer,Kge=["x","y"];function KI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KI(Object(n),!0).forEach(function(r){Vge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vge(e,t,n){return(t=Yge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yge(e){var t=Gge(e,"string");return typeof t=="symbol"?t:t+""}function Gge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xge(e,t){if(e==null)return{};var n,r,a=Wge(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Wge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Qge(){var e=Te(aO),t=Te(iO),n=kt(),r=Te(uU),a=Te(rs),i=Qc(),s=B0(),c=Te(u=>u.rootProps.className);x.useEffect(()=>{if(e==null)return Ol;var u=(d,m,f)=>{if(t!==f&&e===d){if(r==="index"){var v;if(s&&m!==null&&m!==void 0&&(v=m.payload)!==null&&v!==void 0&&v.coordinate&&m.payload.sourceViewBox){var g=m.payload.coordinate,{x:b,y:w}=g,S=Xge(g,Kge),{x:E,y:O,width:j,height:A}=m.payload.sourceViewBox,N=qu(qu({},S),{},{x:s.x+(j?(b-E)/j:0)*s.width,y:s.y+(A?(w-O)/A:0)*s.height});n(qu(qu({},m),{},{payload:qu(qu({},m.payload),{},{coordinate:N})}))}else n(m);return}if(a!=null){var T;if(typeof r=="function"){var P={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},R=r(a,P);T=a[R]}else r==="value"&&(T=a.find(k=>String(k.value)===m.payload.label));var{coordinate:D}=m.payload;if(T==null||m.payload.active===!1||D==null||s==null){n(P_({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:K,y:z}=D,I=Math.min(K,s.x+s.width),G=Math.min(z,s.y+s.height),L={x:i==="horizontal"?T.coordinate:I,y:i==="horizontal"?G:T.coordinate},Y=P_({active:m.payload.active,coordinate:L,dataKey:m.payload.dataKey,index:String(T.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(Y)}}};return am.on(k_,u),()=>{am.off(k_,u)}},[c,n,t,e,r,a,i,s])}function Zge(){var e=Te(aO),t=Te(iO),n=kt();x.useEffect(()=>{if(e==null)return Ol;var r=(a,i,s)=>{t!==s&&e===a&&n(Fge(i))};return am.on(FI,r),()=>{am.off(FI,r)}},[n,t,e])}function Jge(){var e=kt();x.useEffect(()=>{e(Bge())},[e]),Qge(),Zge()}function eye(e,t,n,r,a,i){var s=Te(b=>sge(b,e,t)),c=Te(KH),u=Te(iO),d=Te(aO),m=Te(uU),f=Te(Uge),v=f==null?void 0:f.active,g=B0();x.useEffect(()=>{if(!v&&d!=null&&u!=null){var b=P_({active:i,coordinate:n,dataKey:s,index:a,label:typeof r=="number"?String(r):r,sourceViewBox:g,graphicalItemId:c});am.emit(k_,d,b,u)}},[v,n,s,c,a,r,u,d,m,i,g])}function VI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function YI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(r){tye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tye(e,t,n){return(t=nye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nye(e){var t=rye(e,"string");return typeof t=="symbol"?t:t+""}function rye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aye(e){return e.dataKey}function iye(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(_ue,t)}var GI=[],oye={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function tF(e){var t,n,r=Cn(e,oye),{active:a,allowEscapeViewBox:i,animationDuration:s,animationEasing:c,content:u,filterNull:d,isAnimationActive:m,offset:f,payloadUniqBy:v,position:g,reverseDirection:b,useTranslate3d:w,wrapperStyle:S,cursor:E,shared:O,trigger:j,defaultIndex:A,portal:N,axisId:T}=r,P=kt(),R=typeof A=="number"?String(A):A;x.useEffect(()=>{P(Qpe({shared:O,trigger:j,axisId:T,active:a,defaultIndex:R}))},[P,O,j,T,a,R]);var D=B0(),K=$6(),z=Kpe(O),{activeIndex:I,isActive:G}=(t=Te(ae=>uge(ae,z,j,R)))!==null&&t!==void 0?t:{},L=Te(ae=>cge(ae,z,j,R)),Y=Te(ae=>WH(ae,z,j,R)),k=Te(ae=>lge(ae,z,j,R)),H=L,q=Rge(),F=(n=a??G)!==null&&n!==void 0?n:!1,[V,B]=$8([H,F]),$=z==="axis"?Y:void 0;eye(z,j,k,$,I,F);var X=N??q;if(X==null||D==null||z==null)return null;var Z=H??GI;F||(Z=GI),d&&Z.length&&(Z=k8(Z.filter(ae=>ae.value!=null&&(ae.hide!==!0||r.includeHidden)),v,aye));var ee=Z.length>0,le=YI(YI({},r),{},{payload:Z,label:$,active:F,activeIndex:I,coordinate:k,accessibilityLayer:K}),ie=x.createElement(Due,{allowEscapeViewBox:i,animationDuration:s,animationEasing:c,isAnimationActive:m,active:F,coordinate:k,hasPayload:ee,offset:f,position:g,reverseDirection:b,useTranslate3d:w,viewBox:D,wrapperStyle:S,lastBoundingBox:V,innerRef:B,hasPortalFromProps:!!N},iye(u,le));return x.createElement(x.Fragment,null,yl.createPortal(ie,X),F&&x.createElement(kge,{cursor:E,tooltipEventType:z,coordinate:k,payload:Z,index:I}))}var rp=e=>null;rp.displayName="Cell";function sye(e,t,n){return(t=lye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lye(e){var t=cye(e,"string");return typeof t=="symbol"?t:t+""}function cye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class uye{constructor(t){sye(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function XI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function dye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XI(Object(n),!0).forEach(function(r){fye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fye(e,t,n){return(t=hye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hye(e){var t=mye(e,"string");return typeof t=="symbol"?t:t+""}function mye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pye={cacheSize:2e3,enableCache:!0},nF=dye({},pye),WI=new uye(nF.cacheSize),vye={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},QI="recharts_measurement_span";function gye(e,t){var n=t.fontSize||"",r=t.fontFamily||"",a=t.fontWeight||"",i=t.fontStyle||"",s=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(a,"|").concat(i,"|").concat(s,"|").concat(c)}var ZI=(e,t)=>{try{var n=document.getElementById(QI);n||(n=document.createElement("span"),n.setAttribute("id",QI),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,vye,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Mh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Hm.isSsr)return{width:0,height:0};if(!nF.enableCache)return ZI(t,n);var r=gye(t,n),a=WI.get(r);if(a)return a;var i=ZI(t,n);return WI.set(r,i),i},rF;function yye(e,t,n){return(t=xye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xye(e){var t=bye(e,"string");return typeof t=="symbol"?t:t+""}function bye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,e3=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,wye=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Sye=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Eye={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},_ye=["cm","mm","pt","pc","in","Q","px"];function jye(e){return _ye.includes(e)}var Ju="NaN";function Cye(e,t){return e*Eye[t]}class nr{static parse(t){var n,[,r,a]=(n=Sye.exec(t))!==null&&n!==void 0?n:[];return r==null?nr.NaN:new nr(parseFloat(r),a??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Hi(t)&&(this.unit=""),n!==""&&!wye.test(n)&&(this.num=NaN,this.unit=""),jye(n)&&(this.num=Cye(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new nr(NaN,""):new nr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new nr(NaN,""):new nr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new nr(NaN,""):new nr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new nr(NaN,""):new nr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Hi(this.num)}}rF=nr;yye(nr,"NaN",new rF(NaN,""));function aF(e){if(e==null||e.includes(Ju))return Ju;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,a,i]=(n=JI.exec(t))!==null&&n!==void 0?n:[],s=nr.parse(r??""),c=nr.parse(i??""),u=a==="*"?s.multiply(c):s.divide(c);if(u.isNaN())return Ju;t=t.replace(JI,u.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,m,f,v]=(d=e3.exec(t))!==null&&d!==void 0?d:[],g=nr.parse(m??""),b=nr.parse(v??""),w=f==="+"?g.add(b):g.subtract(b);if(w.isNaN())return Ju;t=t.replace(e3,w.toString())}return t}var t3=/\(([^()]*)\)/;function Oye(e){for(var t=e,n;(n=t3.exec(t))!=null;){var[,r]=n;t=t.replace(t3,aF(r))}return t}function Aye(e){var t=e.replace(/\s+/g,"");return t=Oye(t),t=aF(t),t}function Nye(e){try{return Aye(e)}catch{return Ju}}function kS(e){var t=Nye(e.slice(5,-1));return t===Ju?"":t}var Tye=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Pye=["dx","dy","angle","className","breakAll"];function R_(){return R_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R_.apply(null,arguments)}function n3(e,t){if(e==null)return{};var n,r,a=Mye(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Mye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var iF=/[ \f\n\r\t\v\u2028\u2029]+/,oF=e=>{var{children:t,breakAll:n,style:r}=e;try{var a=[];Wt(t)||(n?a=t.toString().split(""):a=t.toString().split(iF));var i=a.map(c=>({word:c,width:Mh(c,r).width})),s=n?0:Mh(" ",r).width;return{wordsWithComputedWidth:i,spaceWidth:s}}catch{return null}};function sF(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function kye(e){return Wt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var lF=(e,t,n,r)=>e.reduce((a,i)=>{var{word:s,width:c}=i,u=a[a.length-1];if(u&&c!=null&&(t==null||r||u.width+c+n<Number(t)))u.words.push(s),u.width+=c+n;else{var d={words:[s],width:c};a.push(d)}return a},[]),cF=e=>e.reduce((t,n)=>t.width>n.width?t:n),Rye="…",r3=(e,t,n,r,a,i,s,c)=>{var u=e.slice(0,t),d=oF({breakAll:n,style:r,children:u+Rye});if(!d)return[!1,[]];var m=lF(d.wordsWithComputedWidth,i,s,c),f=m.length>a||cF(m).width>Number(i);return[f,m]},Dye=(e,t,n,r,a)=>{var{maxLines:i,children:s,style:c,breakAll:u}=e,d=Oe(i),m=String(s),f=lF(t,r,n,a);if(!d||a)return f;var v=f.length>i||cF(f).width>Number(r);if(!v)return f;for(var g=0,b=m.length-1,w=0,S;g<=b&&w<=m.length-1;){var E=Math.floor((g+b)/2),O=E-1,[j,A]=r3(m,O,u,c,i,r,n,a),[N]=r3(m,E,u,c,i,r,n,a);if(!j&&!N&&(g=E+1),j&&N&&(b=E-1),!j&&N){S=A;break}w++}return S||f},a3=e=>{var t=Wt(e)?[]:e.toString().split(iF);return[{words:t,width:void 0}]},Iye=e=>{var{width:t,scaleToFit:n,children:r,style:a,breakAll:i,maxLines:s}=e;if((t||n)&&!Hm.isSsr){var c,u,d=oF({breakAll:i,children:r,style:a});if(d){var{wordsWithComputedWidth:m,spaceWidth:f}=d;c=m,u=f}else return a3(r);return Dye({breakAll:i,children:r,maxLines:s,style:a},c,u,t,!!n)}return a3(r)},uF="#808080",Lye={angle:0,breakAll:!1,capHeight:"0.71em",fill:uF,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},lx=x.forwardRef((e,t)=>{var n=Cn(e,Lye),{x:r,y:a,lineHeight:i,capHeight:s,fill:c,scaleToFit:u,textAnchor:d,verticalAnchor:m}=n,f=n3(n,Tye),v=x.useMemo(()=>Iye({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:u,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,u,f.style,f.width]),{dx:g,dy:b,angle:w,className:S,breakAll:E}=f,O=n3(f,Pye);if(!Fi(r)||!Fi(a)||v.length===0)return null;var j=Number(r)+(Oe(g)?g:0),A=Number(a)+(Oe(b)?b:0);if(!ct(j)||!ct(A))return null;var N;switch(m){case"start":N=kS("calc(".concat(s,")"));break;case"middle":N=kS("calc(".concat((v.length-1)/2," * -").concat(i," + (").concat(s," / 2))"));break;default:N=kS("calc(".concat(v.length-1," * -").concat(i,")"));break}var T=[],P=v[0];if(u&&P!=null){var R=P.width,{width:D}=f;T.push("scale(".concat(Oe(D)&&Oe(R)?D/R:1,")"))}return w&&T.push("rotate(".concat(w,", ").concat(j,", ").concat(A,")")),T.length&&(O.transform=T.join(" ")),x.createElement("text",R_({},Nr(O),{ref:t,x:j,y:A,className:dt("recharts-text",S),textAnchor:d,fill:c.includes("url")?uF:c}),v.map((K,z)=>{var I=K.words.join(E?"":" ");return x.createElement("tspan",{x:j,dy:z===0?N:i,key:"".concat(I,"-").concat(z)},I)}))});lx.displayName="Text";function i3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i3(Object(n),!0).forEach(function(r){zye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zye(e,t,n){return(t=$ye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ye(e){var t=Bye(e,"string");return typeof t=="symbol"?t:t+""}function Bye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uye=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:a}=e,{x:i,y:s,height:c,upperWidth:u,lowerWidth:d}=YC(t),m=i,f=i+(u-d)/2,v=(m+f)/2,g=(u+d)/2,b=m+u/2,w=c>=0?1:-1,S=w*r,E=w>0?"end":"start",O=w>0?"start":"end",j=u>=0?1:-1,A=j*r,N=j>0?"end":"start",T=j>0?"start":"end",P=a;if(n==="top"){var R={x:m+u/2,y:s-S,horizontalAnchor:"middle",verticalAnchor:E};return P&&(R.height=Math.max(s-P.y,0),R.width=u),R}if(n==="bottom"){var D={x:f+d/2,y:s+c+S,horizontalAnchor:"middle",verticalAnchor:O};return P&&(D.height=Math.max(P.y+P.height-(s+c),0),D.width=d),D}if(n==="left"){var K={x:v-A,y:s+c/2,horizontalAnchor:N,verticalAnchor:"middle"};return P&&(K.width=Math.max(K.x-P.x,0),K.height=c),K}if(n==="right"){var z={x:v+g+A,y:s+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return P&&(z.width=Math.max(P.x+P.width-z.x,0),z.height=c),z}var I=P?{width:g,height:c}:{};return n==="insideLeft"?ji({x:v+A,y:s+c/2,horizontalAnchor:T,verticalAnchor:"middle"},I):n==="insideRight"?ji({x:v+g-A,y:s+c/2,horizontalAnchor:N,verticalAnchor:"middle"},I):n==="insideTop"?ji({x:m+u/2,y:s+S,horizontalAnchor:"middle",verticalAnchor:O},I):n==="insideBottom"?ji({x:f+d/2,y:s+c-S,horizontalAnchor:"middle",verticalAnchor:E},I):n==="insideTopLeft"?ji({x:m+A,y:s+S,horizontalAnchor:T,verticalAnchor:O},I):n==="insideTopRight"?ji({x:m+u-A,y:s+S,horizontalAnchor:N,verticalAnchor:O},I):n==="insideBottomLeft"?ji({x:f+A,y:s+c-S,horizontalAnchor:T,verticalAnchor:E},I):n==="insideBottomRight"?ji({x:f+d-A,y:s+c-S,horizontalAnchor:N,verticalAnchor:E},I):n&&typeof n=="object"&&(Oe(n.x)||Lc(n.x))&&(Oe(n.y)||Lc(n.y))?ji({x:i+yr(n.x,g),y:s+yr(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},I):ji({x:b,y:s+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},I)},Hye=["labelRef"],Fye=["content"];function o3(e,t){if(e==null)return{};var n,r,a=qye(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function qye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function s3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Nh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s3(Object(n),!0).forEach(function(r){Kye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kye(e,t,n){return(t=Vye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vye(e){var t=Yye(e,"string");return typeof t=="symbol"?t:t+""}function Yye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Co(){return Co=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Co.apply(null,arguments)}var dF=x.createContext(null),Gye=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:a,width:i,height:s,children:c}=e,u=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:a,width:i,height:s}),[t,n,r,a,i,s]);return x.createElement(dF.Provider,{value:u},c)},fF=()=>{var e=x.useContext(dF),t=B0();return e||(t?YC(t):void 0)},Xye=x.createContext(null),Wye=()=>{var e=x.useContext(Xye),t=Te(pU);return e||t},Qye=e=>{var{value:t,formatter:n}=e,r=Wt(e.children)?t:e.children;return typeof n=="function"?n(r):r},hA=e=>e!=null&&typeof e=="function",Zye=(e,t)=>{var n=Vn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Jye=(e,t,n,r,a)=>{var{offset:i,className:s}=e,{cx:c,cy:u,innerRadius:d,outerRadius:m,startAngle:f,endAngle:v,clockWise:g}=a,b=(d+m)/2,w=Zye(f,v),S=w>=0?1:-1,E,O;switch(t){case"insideStart":E=f+S*i,O=g;break;case"insideEnd":E=v-S*i,O=!g;break;case"end":E=v+S*i,O=g;break;default:throw new Error("Unsupported position ".concat(t))}O=w<=0?O:!O;var j=En(c,u,b,E),A=En(c,u,b,E+(O?1:-1)*359),N="M".concat(j.x,",").concat(j.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(O?0:1,`,
    `).concat(A.x,",").concat(A.y),T=Wt(e.id)?Vh("recharts-radial-line-"):e.id;return x.createElement("text",Co({},r,{dominantBaseline:"central",className:dt("recharts-radial-bar-label",s)}),x.createElement("defs",null,x.createElement("path",{id:T,d:N})),x.createElement("textPath",{xlinkHref:"#".concat(T)},n))},e0e=(e,t,n)=>{var{cx:r,cy:a,innerRadius:i,outerRadius:s,startAngle:c,endAngle:u}=e,d=(c+u)/2;if(n==="outside"){var{x:m,y:f}=En(r,a,s+t,d);return{x:m,y:f,textAnchor:m>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:a,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:a,textAnchor:"middle",verticalAnchor:"end"};var v=(i+s)/2,{x:g,y:b}=En(r,a,v,d);return{x:g,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Eg=e=>e!=null&&"cx"in e&&Oe(e.cx),t0e={angle:0,offset:5,zIndex:_n.label,position:"middle",textBreakAll:!1};function n0e(e){if(!Eg(e))return e;var{cx:t,cy:n,outerRadius:r}=e,a=r*2;return{x:t-r,y:n-r,width:a,upperWidth:a,lowerWidth:a,height:a}}function Fs(e){var t=Cn(e,t0e),{viewBox:n,parentViewBox:r,position:a,value:i,children:s,content:c,className:u="",textBreakAll:d,labelRef:m}=t,f=Wye(),v=fF(),g=a==="center"?v:f??v,b,w,S;n==null?b=g:Eg(n)?b=n:b=YC(n);var E=n0e(b);if(!b||Wt(i)&&Wt(s)&&!x.isValidElement(c)&&typeof c!="function")return null;var O=Nh(Nh({},t),{},{viewBox:b});if(x.isValidElement(c)){var{labelRef:j}=O,A=o3(O,Hye);return x.cloneElement(c,A)}if(typeof c=="function"){var{content:N}=O,T=o3(O,Fye);if(w=x.createElement(c,T),x.isValidElement(w))return w}else w=Qye(t);var P=Nr(t);if(Eg(b)){if(a==="insideStart"||a==="insideEnd"||a==="end")return Jye(t,a,w,P,b);S=e0e(b,t.offset,t.position)}else{if(!E)return null;var R=Uye({viewBox:E,position:a,offset:t.offset,parentViewBox:Eg(r)?void 0:r});S=Nh(Nh({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}return x.createElement(Gr,{zIndex:t.zIndex},x.createElement(lx,Co({ref:m,className:dt("recharts-label",u)},P,S,{textAnchor:sF(P.textAnchor)?P.textAnchor:S.textAnchor,breakAll:d}),w))}Fs.displayName="Label";var r0e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Fs,Co({key:"label-implicit"},r)):Fi(e)?x.createElement(Fs,Co({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Fs?x.cloneElement(e,Nh({key:"label-implicit"},r)):x.createElement(Fs,Co({key:"label-implicit",content:e},r)):hA(e)?x.createElement(Fs,Co({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Fs,Co({},e,{key:"label-implicit"},r)):null};function a0e(e){var{label:t,labelRef:n}=e,r=fF();return r0e(t,r,n)||null}var i0e=["valueAccessor"],o0e=["dataKey","clockWise","id","textBreakAll","zIndex"];function Ty(){return Ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ty.apply(null,arguments)}function l3(e,t){if(e==null)return{};var n,r,a=s0e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function s0e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var l0e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(kye(t))return t},hF=x.createContext(void 0),mF=hF.Provider,pF=x.createContext(void 0),c0e=pF.Provider;function u0e(){return x.useContext(hF)}function d0e(){return x.useContext(pF)}function _g(e){var{valueAccessor:t=l0e}=e,n=l3(e,i0e),{dataKey:r,clockWise:a,id:i,textBreakAll:s,zIndex:c}=n,u=l3(n,o0e),d=u0e(),m=d0e(),f=d||m;return!f||!f.length?null:x.createElement(Gr,{zIndex:c??_n.label},x.createElement(In,{className:"recharts-label-list"},f.map((v,g)=>{var b,w=Wt(r)?t(v,g):Pt(v.payload,r),S=Wt(i)?{}:{id:"".concat(i,"-").concat(g)};return x.createElement(Fs,Ty({key:"label-".concat(g)},Nr(v),u,S,{fill:(b=n.fill)!==null&&b!==void 0?b:v.fill,parentViewBox:v.parentViewBox,value:w,textBreakAll:s,viewBox:v.viewBox,index:g,zIndex:0}))})))}_g.displayName="LabelList";function mA(e){var{label:t}=e;return t?t===!0?x.createElement(_g,{key:"labelList-implicit"}):x.isValidElement(t)||hA(t)?x.createElement(_g,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(_g,Ty({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function D_(){return D_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D_.apply(null,arguments)}var vF=e=>{var{cx:t,cy:n,r,className:a}=e,i=dt("recharts-dot",a);return Oe(t)&&Oe(n)&&Oe(r)?x.createElement("circle",D_({},ha(e),DC(e),{className:i,cx:t,cy:n,r})):null},gF=e=>e.graphicalItems.polarItems,f0e=se([Jt,Vm],IO),cx=se([gF,un,f0e],LO),h0e=se([cx],zO),ux=se([h0e,q0],$O),m0e=se([ux,un,cx],UO);se([ux,un,cx],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(a=>{var i,s=Pt(r,(i=t.dataKey)!==null&&i!==void 0?i:a.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Pt(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var c3=()=>{},p0e=se([ux,un,cx,ax,Jt],KO),v0e=se([un,FO,qO,c3,p0e,c3,yt,Jt],VO),yF=se([un,yt,ux,m0e,Km,Jt,v0e],YO),g0e=se([yF,af,Tl],XO),y0e=se([un,yF,g0e,Jt],QO);se([Tl,y0e],gU);var x0e={radiusAxis:{},angleAxis:{}},xF=br({name:"polarAxis",initialState:x0e,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:j2e,removeRadiusAxis:C2e,addAngleAxis:O2e,removeAngleAxis:A2e}=xF.actions,b0e=xF.reducer;function bF(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function u3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function d3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u3(Object(n),!0).forEach(function(r){w0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w0e(e,t,n){return(t=S0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S0e(e){var t=E0e(e,"string");return typeof t=="symbol"?t:t+""}function E0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _0e=(e,t)=>t,pA=se([gF,_0e],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),j0e=[],vA=(e,t,n)=>(n==null?void 0:n.length)===0?j0e:n,wF=se([q0,pA,vA],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var a;if((t==null?void 0:t.data)!=null&&t.data.length>0?a=t.data:a=r,(!a||!a.length)&&n!=null&&(a=n.map(i=>d3(d3({},t.presentationProps),i.props))),a!=null)return a}}),C0e=se([wF,pA,vA],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,a)=>{var i,s=Pt(r,t.nameKey,t.name),c;return n!=null&&(i=n[a])!==null&&i!==void 0&&(i=i.props)!==null&&i!==void 0&&i.fill?c=n[a].props.fill:typeof r=="object"&&r!=null&&"fill"in r?c=r.fill:c=t.fill,{value:Jd(s,t.dataKey),color:c,payload:r,type:t.legendType}})}),O0e=se([wF,pA,vA,Ln],(e,t,n,r)=>{if(!(t==null||e==null))return Pxe({offset:r,pieSettings:t,displayedData:e,cells:n})}),RS={exports:{}},Tt={};/**
 * @license React
 * react-is.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 f3;function A0e(){if(f3)return Tt;f3=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),v=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");function b(w){if(typeof w=="object"&&w!==null){var S=w.$$typeof;switch(S){case e:switch(w=w.type,w){case n:case a:case r:case u:case d:case v:return w;default:switch(w=w&&w.$$typeof,w){case s:case c:case f:case m:return w;case i:return w;default:return S}}case t:return S}}}return Tt.ContextConsumer=i,Tt.ContextProvider=s,Tt.Element=e,Tt.ForwardRef=c,Tt.Fragment=n,Tt.Lazy=f,Tt.Memo=m,Tt.Portal=t,Tt.Profiler=a,Tt.StrictMode=r,Tt.Suspense=u,Tt.SuspenseList=d,Tt.isContextConsumer=function(w){return b(w)===i},Tt.isContextProvider=function(w){return b(w)===s},Tt.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Tt.isForwardRef=function(w){return b(w)===c},Tt.isFragment=function(w){return b(w)===n},Tt.isLazy=function(w){return b(w)===f},Tt.isMemo=function(w){return b(w)===m},Tt.isPortal=function(w){return b(w)===t},Tt.isProfiler=function(w){return b(w)===a},Tt.isStrictMode=function(w){return b(w)===r},Tt.isSuspense=function(w){return b(w)===u},Tt.isSuspenseList=function(w){return b(w)===d},Tt.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===a||w===r||w===u||w===d||typeof w=="object"&&w!==null&&(w.$$typeof===f||w.$$typeof===m||w.$$typeof===s||w.$$typeof===i||w.$$typeof===c||w.$$typeof===g||w.getModuleId!==void 0)},Tt.typeOf=b,Tt}var h3;function N0e(){return h3||(h3=1,RS.exports=A0e()),RS.exports}var T0e=N0e(),m3=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",p3=null,DS=null,SF=e=>{if(e===p3&&Array.isArray(DS))return DS;var t=[];return x.Children.forEach(e,n=>{Wt(n)||(T0e.isFragment(n)?t=t.concat(SF(n.props.children)):t.push(n))}),DS=t,p3=e,t};function gA(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(a=>m3(a)):r=[m3(t)],SF(e).forEach(a=>{var i=Ic(a,"type.displayName")||Ic(a,"type.name");i&&r.indexOf(i)!==-1&&n.push(a)}),n}var EF=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,IS={},v3;function P0e(){return v3||(v3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var a;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const i=n[Symbol.toStringTag];return i==null||!((a=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&a.writable)?!1:n.toString()===`[object ${i}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(IS)),IS}var LS,g3;function M0e(){return g3||(g3=1,LS=P0e().isPlainObject),LS}var k0e=M0e();const R0e=ci(k0e);var y3,x3,b3,w3,S3;function E3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E3(Object(n),!0).forEach(function(r){D0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function D0e(e,t,n){return(t=I0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I0e(e){var t=L0e(e,"string");return typeof t=="symbol"?t:t+""}function L0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Py(){return Py=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Py.apply(null,arguments)}function yh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var j3=(e,t,n,r,a)=>{var i=n-r,s;return s=an(y3||(y3=yh(["M ",",",""])),e,t),s+=an(x3||(x3=yh(["L ",",",""])),e+n,t),s+=an(b3||(b3=yh(["L ",",",""])),e+n-i/2,t+a),s+=an(w3||(w3=yh(["L ",",",""])),e+n-i/2-r,t+a),s+=an(S3||(S3=yh(["L ",","," Z"])),e,t),s},z0e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$0e=e=>{var t=Cn(e,z0e),{x:n,y:r,upperWidth:a,lowerWidth:i,height:s,className:c}=t,{animationEasing:u,animationDuration:d,animationBegin:m,isUpdateAnimationActive:f}=t,v=x.useRef(null),[g,b]=x.useState(-1),w=x.useRef(a),S=x.useRef(i),E=x.useRef(s),O=x.useRef(n),j=x.useRef(r),A=qm(e,"trapezoid-");if(x.useEffect(()=>{if(v.current&&v.current.getTotalLength)try{var L=v.current.getTotalLength();L&&b(L)}catch{}},[]),n!==+n||r!==+r||a!==+a||i!==+i||s!==+s||a===0&&i===0||s===0)return null;var N=dt("recharts-trapezoid",c);if(!f)return x.createElement("g",null,x.createElement("path",Py({},Nr(t),{className:N,d:j3(n,r,a,i,s)})));var T=w.current,P=S.current,R=E.current,D=O.current,K=j.current,z="0px ".concat(g===-1?1:g,"px"),I="".concat(g,"px ").concat(g,"px"),G=B6(["strokeDasharray"],d,u);return x.createElement(Fm,{animationId:A,key:A,canBegin:g>0,duration:d,easing:u,isActive:f,begin:m},L=>{var Y=Vt(T,a,L),k=Vt(P,i,L),H=Vt(R,s,L),q=Vt(D,n,L),F=Vt(K,r,L);v.current&&(w.current=Y,S.current=k,E.current=H,O.current=q,j.current=F);var V=L>0?{transition:G,strokeDasharray:I}:{strokeDasharray:z};return x.createElement("path",Py({},Nr(t),{className:N,d:j3(q,F,Y,k,H),ref:v,style:_3(_3({},V),t.style)}))})},B0e=["option","shapeType","activeClassName","inActiveClassName"];function U0e(e,t){if(e==null)return{};var n,r,a=H0e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function H0e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function C3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function My(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C3(Object(n),!0).forEach(function(r){F0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function F0e(e,t,n){return(t=q0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q0e(e){var t=K0e(e,"string");return typeof t=="symbol"?t:t+""}function K0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function V0e(e,t){return My(My({},t),e)}function Y0e(e,t){return e==="symbols"}function O3(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(q6,n);case"trapezoid":return x.createElement($0e,n);case"sector":return x.createElement(G6,n);case"symbols":if(Y0e(t))return x.createElement(RC,n);break;case"curve":return x.createElement(ZC,n);default:return null}}function G0e(e){return x.isValidElement(e)?e.props:e}function yA(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:a="recharts-shape"}=e,i=U0e(e,B0e),s;if(x.isValidElement(t))s=x.cloneElement(t,My(My({},i),G0e(t)));else if(typeof t=="function")s=t(i,i.index);else if(R0e(t)&&typeof t!="boolean"){var c=V0e(t,i);s=x.createElement(O3,{shapeType:n,elementProps:c})}else{var u=i;s=x.createElement(O3,{shapeType:n,elementProps:u})}return i.isActive?x.createElement(In,{className:r},s):x.createElement(In,{className:a},s)}var xA=(e,t,n)=>{var r=kt();return(a,i)=>s=>{e==null||e(a,i,s),r(TH({activeIndex:String(i),activeDataKey:t,activeCoordinate:a.tooltipPosition,activeGraphicalItemId:n}))}},bA=e=>{var t=kt();return(n,r)=>a=>{e==null||e(n,r,a),t(Zpe())}},wA=(e,t,n)=>{var r=kt();return(a,i)=>s=>{e==null||e(a,i,s),r(Jpe({activeIndex:String(i),activeDataKey:t,activeCoordinate:a.tooltipPosition,activeGraphicalItemId:n}))}};function SA(e){var{tooltipEntrySettings:t}=e,n=kt(),r=wr(),a=x.useRef(null);return x.useLayoutEffect(()=>{r||(a.current===null?n(Gpe(t)):a.current!==t&&n(Xpe({prev:a.current,next:t})),a.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{a.current&&(n(Wpe(a.current)),a.current=null)},[n]),null}function _F(e){var{legendPayload:t}=e,n=kt(),r=wr(),a=x.useRef(null);return x.useLayoutEffect(()=>{r||(a.current===null?n(R6(t)):a.current!==t&&n(D6({prev:a.current,next:t})),a.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{a.current&&(n(I6(a.current)),a.current=null)},[n]),null}function X0e(e){var{legendPayload:t}=e,n=kt(),r=Te(yt),a=x.useRef(null);return x.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(a.current===null?n(R6(t)):a.current!==t&&n(D6({prev:a.current,next:t})),a.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{a.current&&(n(I6(a.current)),a.current=null)},[n]),null}var zS,W0e=()=>{var[e]=x.useState(()=>Vh("uid-"));return e},Q0e=(zS=aj.useId)!==null&&zS!==void 0?zS:W0e;function Z0e(e,t){var n=Q0e();return t||(e?"".concat(e,"-").concat(n):n)}var J0e=x.createContext(void 0),EA=e=>{var{id:t,type:n,children:r}=e,a=Z0e("recharts-".concat(n),t);return x.createElement(J0e.Provider,{value:a},r(a))},exe={cartesianItems:[],polarItems:[]},jF=br({name:"graphicalItems",initialState:exe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Ht()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,a=Ra(e).cartesianItems.indexOf(n);a>-1&&(e.cartesianItems[a]=r)},prepare:Ht()},removeCartesianGraphicalItem:{reducer(e,t){var n=Ra(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Ht()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Ht()},removePolarGraphicalItem:{reducer(e,t){var n=Ra(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Ht()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,a=Ra(e).polarItems.indexOf(n);a>-1&&(e.polarItems[a]=r)},prepare:Ht()}}}),{addCartesianGraphicalItem:txe,replaceCartesianGraphicalItem:nxe,removeCartesianGraphicalItem:rxe,addPolarGraphicalItem:axe,removePolarGraphicalItem:ixe,replacePolarGraphicalItem:oxe}=jF.actions,sxe=jF.reducer,lxe=e=>{var t=kt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(txe(e)):n.current!==e&&t(nxe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(rxe(n.current)),n.current=null)},[t]),null},CF=x.memo(lxe),cxe=e=>{var t=kt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(axe(e)):n.current!==e&&t(oxe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(ixe(n.current)),n.current=null)},[t]),null},uxe=x.memo(cxe),dxe=["key"],fxe=["onMouseEnter","onClick","onMouseLeave"],hxe=["id"],mxe=["id"];function pl(){return pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pl.apply(null,arguments)}function dx(e,t){if(e==null)return{};var n,r,a=pxe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function pxe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function A3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A3(Object(n),!0).forEach(function(r){vxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vxe(e,t,n){return(t=gxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gxe(e){var t=yxe(e,"string");return typeof t=="symbol"?t:t+""}function yxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xxe(e){var t=x.useMemo(()=>gA(e.children,rp),[e.children]),n=Te(r=>C0e(r,e.id,t));return n==null?null:x.createElement(X0e,{legendPayload:n})}function bxe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(x.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var wxe=x.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:a,strokeWidth:i,fill:s,name:c,hide:u,tooltipType:d,id:m,activeShape:f}=e,v=bxe(f),g=r.map(w=>{var S=w.tooltipPayload;return v==null||S==null?S:S.map(E=>Yt(Yt({},E),{},{color:v,fill:v}))}),b={dataDefinedOnItem:g,getPosition:w=>{var S;return(S=r[Number(w)])===null||S===void 0?void 0:S.tooltipPosition},settings:{stroke:a,strokeWidth:i,fill:s,dataKey:t,nameKey:n,name:Jd(c,t),hide:u,type:d,color:s,unit:"",graphicalItemId:m}};return x.createElement(SA,{tooltipEntrySettings:b})}),Sxe=(e,t)=>e>t?"start":e<t?"end":"middle",Exe=(e,t,n)=>yr(typeof t=="function"?t(e):t,n,n*.8),_xe=(e,t,n)=>{var{top:r,left:a,width:i,height:s}=t,c=K6(i,s),u=a+yr(e.cx,i,i/2),d=r+yr(e.cy,s,s/2),m=yr(e.innerRadius,c,0),f=Exe(n,e.outerRadius,c),v=e.maxRadius||Math.sqrt(i*i+s*s)/2;return{cx:u,cy:d,innerRadius:m,outerRadius:f,maxRadius:v}},jxe=(e,t)=>{var n=Vn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Cxe=(e,t)=>{if(x.isValidElement(e))return x.cloneElement(e,t);if(typeof e=="function")return e(t);var n=dt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,a=dx(t,dxe);return x.createElement(ZC,pl({},a,{type:"linear",className:n}))},Oxe=(e,t,n)=>{if(x.isValidElement(e))return x.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),x.isValidElement(r)))return r;var a=dt("recharts-pie-label-text",bF(e));return x.createElement(lx,pl({},t,{alignmentBaseline:"middle",className:a}),r)};function Axe(e){var{sectors:t,props:n,showLabels:r}=e,{label:a,labelLine:i,dataKey:s}=n;if(!r||!a||!t)return null;var c=ha(n),u=Rc(a),d=Rc(i),m=typeof a=="object"&&"offsetRadius"in a&&typeof a.offsetRadius=="number"&&a.offsetRadius||20,f=t.map((v,g)=>{var b=(v.startAngle+v.endAngle)/2,w=En(v.cx,v.cy,v.outerRadius+m,b),S=Yt(Yt(Yt(Yt({},c),v),{},{stroke:"none"},u),{},{index:g,textAnchor:Sxe(w.x,v.cx)},w),E=Yt(Yt(Yt(Yt({},c),v),{},{fill:"none",stroke:v.fill},d),{},{index:g,points:[En(v.cx,v.cy,v.outerRadius,b),w],key:"line"});return x.createElement(Gr,{zIndex:_n.label,key:"label-".concat(v.startAngle,"-").concat(v.endAngle,"-").concat(v.midAngle,"-").concat(g)},x.createElement(In,null,i&&Cxe(i,E),Oxe(a,S,Pt(v,s))))});return x.createElement(In,{className:"recharts-pie-labels"},f)}function Nxe(e){var{sectors:t,props:n,showLabels:r}=e,{label:a}=n;return typeof a=="object"&&a!=null&&"position"in a?x.createElement(mA,{label:a}):x.createElement(Axe,{sectors:t,props:n,showLabels:r})}function Txe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:a,shape:i,id:s}=e,c=Te(ml),u=Te(sA),d=Te(KH),{onMouseEnter:m,onClick:f,onMouseLeave:v}=a,g=dx(a,fxe),b=xA(m,a.dataKey,s),w=bA(v),S=wA(f,a.dataKey,s);return t==null||t.length===0?null:x.createElement(x.Fragment,null,t.map((E,O)=>{if((E==null?void 0:E.startAngle)===0&&(E==null?void 0:E.endAngle)===0&&t.length!==1)return null;var j=d==null||d===s,A=String(O)===c&&(u==null||a.dataKey===u)&&j,N=c?r:null,T=n&&A?n:N,P=Yt(Yt({},E),{},{stroke:E.stroke,tabIndex:-1,[x6]:O,[b6]:s});return x.createElement(In,pl({key:"sector-".concat(E==null?void 0:E.startAngle,"-").concat(E==null?void 0:E.endAngle,"-").concat(E.midAngle,"-").concat(O),tabIndex:-1,className:"recharts-pie-sector"},Im(g,E,O),{onMouseEnter:b(E,O),onMouseLeave:w(E,O),onClick:S(E,O)}),x.createElement(yA,pl({option:i??T,index:O,shapeType:"sector",isActive:A},P)))}))}function Pxe(e){var t,{pieSettings:n,displayedData:r,cells:a,offset:i}=e,{cornerRadius:s,startAngle:c,endAngle:u,dataKey:d,nameKey:m,tooltipType:f}=n,v=Math.abs(n.minAngle),g=jxe(c,u),b=Math.abs(g),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(T=>Pt(T,d,0)!==0).length,E=(b>=360?S:S-1)*w,O=b-S*v-E,j=r.reduce((T,P)=>{var R=Pt(P,d,0);return T+(Oe(R)?R:0)},0),A;if(j>0){var N;A=r.map((T,P)=>{var R=Pt(T,d,0),D=Pt(T,m,P),K=_xe(n,i,T),z=(Oe(R)?R:0)/j,I,G=Yt(Yt({},T),a&&a[P]&&a[P].props),L=G!=null&&"fill"in G&&typeof G.fill=="string"?G.fill:n.fill;P?I=N.endAngle+Vn(g)*w*(R!==0?1:0):I=c;var Y=I+Vn(g)*((R!==0?v:0)+z*O),k=(I+Y)/2,H=(K.innerRadius+K.outerRadius)/2,q=[{name:D,value:R,payload:G,dataKey:d,type:f,color:L,fill:L,graphicalItemId:n.id}],F=En(K.cx,K.cy,H,k);return N=Yt(Yt(Yt(Yt({},n.presentationProps),{},{percent:z,cornerRadius:typeof s=="string"?parseFloat(s):s,name:D,tooltipPayload:q,midAngle:k,middleRadius:H,tooltipPosition:F},G),K),{},{value:R,dataKey:d,startAngle:I,endAngle:Y,payload:G,paddingAngle:Vn(g)*w}),N})}return A}function Mxe(e){var{showLabels:t,sectors:n,children:r}=e,a=x.useMemo(()=>!t||!n?[]:n.map(i=>({value:i.value,payload:i.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:i.cx,cy:i.cy,innerRadius:i.innerRadius,outerRadius:i.outerRadius,startAngle:i.startAngle,endAngle:i.endAngle,clockWise:!1},fill:i.fill})),[n,t]);return x.createElement(c0e,{value:t?a:void 0},r)}function kxe(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:a,isAnimationActive:i,animationBegin:s,animationDuration:c,animationEasing:u,activeShape:d,inactiveShape:m,onAnimationStart:f,onAnimationEnd:v}=t,g=qm(t,"recharts-pie-"),b=n.current,[w,S]=x.useState(!1),E=x.useCallback(()=>{typeof v=="function"&&v(),S(!1)},[v]),O=x.useCallback(()=>{typeof f=="function"&&f(),S(!0)},[f]);return x.createElement(Mxe,{showLabels:!w,sectors:a},x.createElement(Fm,{animationId:g,begin:s,duration:c,isActive:i,easing:u,onAnimationStart:O,onAnimationEnd:E,key:g},j=>{var A,N=[],T=a&&a[0],P=(A=T==null?void 0:T.startAngle)!==null&&A!==void 0?A:0;return a==null||a.forEach((R,D)=>{var K=b&&b[D],z=D>0?Ic(R,"paddingAngle",0):0;if(K){var I=Vt(K.endAngle-K.startAngle,R.endAngle-R.startAngle,j),G=Yt(Yt({},R),{},{startAngle:P+z,endAngle:P+I+z});N.push(G),P=G.endAngle}else{var{endAngle:L,startAngle:Y}=R,k=Vt(0,L-Y,j),H=Yt(Yt({},R),{},{startAngle:P+z,endAngle:P+k+z});N.push(H),P=H.endAngle}}),n.current=N,x.createElement(In,null,x.createElement(Txe,{sectors:N,activeShape:d,inactiveShape:m,allOtherPieProps:t,shape:t.shape,id:r}))}),x.createElement(Nxe,{showLabels:!w,sectors:a,props:t}),t.children)}var Rxe={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:_n.area};function Dxe(e){var{id:t}=e,n=dx(e,hxe),{hide:r,className:a,rootTabIndex:i}=e,s=x.useMemo(()=>gA(e.children,rp),[e.children]),c=Te(m=>O0e(m,t,s)),u=x.useRef(null),d=dt("recharts-pie",a);return r||c==null?(u.current=null,x.createElement(In,{tabIndex:i,className:d})):x.createElement(Gr,{zIndex:e.zIndex},x.createElement(wxe,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:c,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),x.createElement(In,{tabIndex:i,className:d},x.createElement(kxe,{props:Yt(Yt({},n),{},{sectors:c}),previousSectorsRef:u,id:t})))}function Ixe(e){var t=Cn(e,Rxe),{id:n}=t,r=dx(t,mxe),a=ha(r);return x.createElement(EA,{id:n,type:"pie"},i=>x.createElement(x.Fragment,null,x.createElement(uxe,{type:"pie",id:i,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:a,maxRadius:t.maxRadius}),x.createElement(xxe,pl({},r,{id:i})),x.createElement(Dxe,pl({},r,{id:i}))))}var OF=Ixe;OF.displayName="Pie";var Lxe=["points"];function N3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N3(Object(n),!0).forEach(function(r){zxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zxe(e,t,n){return(t=$xe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $xe(e){var t=Bxe(e,"string");return typeof t=="symbol"?t:t+""}function Bxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ky(){return ky=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ky.apply(null,arguments)}function Uxe(e,t){if(e==null)return{};var n,r,a=Hxe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Hxe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Fxe(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var a=dt(r,typeof t!="boolean"?t.className:""),i=n??{},{points:s}=i,c=Uxe(i,Lxe);return x.createElement(vF,ky({},c,{className:a}))}function qxe(e,t){return e==null?!1:t?!0:e.length===1}function Kxe(e){var{points:t,dot:n,className:r,dotClassName:a,dataKey:i,baseProps:s,needClip:c,clipPathId:u,zIndex:d=_n.scatter}=e;if(!qxe(t,n))return null;var m=EF(n),f=jie(n),v=t.map((b,w)=>{var S,E,O=$S($S($S({r:3},s),f),{},{index:w,cx:(S=b.x)!==null&&S!==void 0?S:void 0,cy:(E=b.y)!==null&&E!==void 0?E:void 0,dataKey:i,value:b.value,payload:b.payload,points:t});return x.createElement(Fxe,{key:"dot-".concat(w),option:n,dotProps:O,className:a})}),g={};return c&&u!=null&&(g.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(u,")")),x.createElement(Gr,{zIndex:d},x.createElement(In,ky({className:r},g),v))}function T3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function P3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T3(Object(n),!0).forEach(function(r){Vxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vxe(e,t,n){return(t=Yxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yxe(e){var t=Gxe(e,"string");return typeof t=="symbol"?t:t+""}function Gxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AF=0,Xxe={xAxis:{},yAxis:{},zAxis:{}},NF=br({name:"cartesianAxis",initialState:Xxe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Ht()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:Ht()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Ht()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Ht()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:Ht()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Ht()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Ht()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:Ht()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Ht()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,a=e.yAxis[n];if(a){var i,s=a.widthHistory||[];if(s.length===3&&s[0]===s[2]&&r===s[1]&&r!==a.width&&Math.abs(r-((i=s[0])!==null&&i!==void 0?i:0))<=1)return;var c=[...s,r].slice(-3);e.yAxis[n]=P3(P3({},a),{},{width:r,widthHistory:c})}}}}),{addXAxis:Wxe,replaceXAxis:Qxe,removeXAxis:Zxe,addYAxis:Jxe,replaceYAxis:ebe,removeYAxis:tbe,addZAxis:N2e,replaceZAxis:T2e,removeZAxis:P2e,updateYAxisWidth:nbe}=NF.actions,rbe=NF.reducer,abe=se([Ln],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),ibe=se([abe,Qo,Zo],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),_A=()=>Te(ibe),obe=()=>Te(Yve);function M3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function BS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M3(Object(n),!0).forEach(function(r){sbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sbe(e,t,n){return(t=lbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lbe(e){var t=cbe(e,"string");return typeof t=="symbol"?t:t+""}function cbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ube=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:a,dataKey:i,clipPath:s}=e;if(a===!1||t.x==null||t.y==null)return null;var c={index:n,dataKey:i,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},u=BS(BS(BS({},c),Rc(a)),DC(a)),d;return x.isValidElement(a)?d=x.cloneElement(a,u):typeof a=="function"?d=a(u):d=x.createElement(vF,u),x.createElement(In,{className:"recharts-active-dot",clipPath:s},d)};function dbe(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:a,clipPath:i,zIndex:s=_n.activeDot}=e,c=Te(ml),u=obe();if(t==null||u==null)return null;var d=t.find(m=>u.includes(m.payload));return Wt(d)?null:x.createElement(Gr,{zIndex:s},x.createElement(ube,{point:d,childIndex:Number(c),mainColor:n,dataKey:a,activeDot:r,clipPath:i}))}var k3=(e,t,n)=>{var r=n??e;if(!Wt(r))return yr(r,t,0)},fbe=(e,t,n)=>{var r={},a=e.filter(G0),i=e.filter(d=>d.stackId==null),s=a.reduce((d,m)=>{var f=d[m.stackId];return f==null&&(f=[]),f.push(m),d[m.stackId]=f,d},r),c=Object.entries(s).map(d=>{var m,[f,v]=d,g=v.map(w=>w.dataKey),b=k3(t,n,(m=v[0])===null||m===void 0?void 0:m.barSize);return{stackId:f,dataKeys:g,barSize:b}}),u=i.map(d=>{var m=[d.dataKey].filter(v=>v!=null),f=k3(t,n,d.barSize);return{stackId:void 0,dataKeys:m,barSize:f}});return[...c,...u]};function R3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R3(Object(n),!0).forEach(function(r){hbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hbe(e,t,n){return(t=mbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mbe(e){var t=pbe(e,"string");return typeof t=="symbol"?t:t+""}function pbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vbe(e,t,n,r,a){var i,s=r.length;if(!(s<1)){var c=yr(e,n,0,!0),u,d=[];if(ct((i=r[0])===null||i===void 0?void 0:i.barSize)){var m=!1,f=n/s,v=r.reduce((O,j)=>O+(j.barSize||0),0);v+=(s-1)*c,v>=n&&(v-=(s-1)*c,c=0),v>=n&&f>0&&(m=!0,f*=.9,v=s*f);var g=(n-v)/2>>0,b={offset:g-c,size:0};u=r.reduce((O,j)=>{var A,N={stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:b.offset+b.size+c,size:m?f:(A=j.barSize)!==null&&A!==void 0?A:0}},T=[...O,N];return b=N.position,T},d)}else{var w=yr(t,n,0,!0);n-2*w-(s-1)*c<=0&&(c=0);var S=(n-2*w-(s-1)*c)/s;S>1&&(S>>=0);var E=ct(a)?Math.min(S,a):S;u=r.reduce((O,j,A)=>[...O,{stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:w+(S+c)*A+(S-E)/2,size:E}}],d)}return u}}var gbe=(e,t,n,r,a,i,s)=>{var c=Wt(s)?t:s,u=vbe(n,r,a!==i?a:i,e,c);return a!==i&&u!=null&&(u=u.map(d=>tg(tg({},d),{},{position:tg(tg({},d.position),{},{offset:d.position.offset-a/2})}))),u},ybe=(e,t)=>{var n=cO(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var a=e[r];if(a){var{stackedData:i}=a;if(i)return i.find(s=>s.key===n)}}}},xbe=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function bbe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ct(e.zIndex)?e.zIndex:t}var TF=e=>{var{chartData:t}=e,n=kt(),r=wr();return x.useEffect(()=>r?()=>{}:(n(qI(t)),()=>{n(qI(void 0))}),[t,n,r]),null},D3={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},PF=br({name:"brush",initialState:D3,reducers:{setBrushSettings(e,t){return t.payload==null?D3:t.payload}}}),{setBrushSettings:M2e}=PF.actions,wbe=PF.reducer;function Sbe(e){return(e%180+180)%180}var Ebe=function(t){var{width:n,height:r}=t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Sbe(a),s=i*Math.PI/180,c=Math.atan(r/n),u=s>c&&s<Math.PI-c?r/Math.sin(s):n/Math.cos(s);return Math.abs(u)},_be={dots:[],areas:[],lines:[]},MF=br({name:"referenceElements",initialState:_be,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Ra(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Ra(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=Ra(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:k2e,removeDot:R2e,addArea:D2e,removeArea:I2e,addLine:L2e,removeLine:z2e}=MF.actions,jbe=MF.reducer,Cbe=x.createContext(void 0),Obe=e=>{var{children:t}=e,[n]=x.useState("".concat(Vh("recharts"),"-clip")),r=_A();if(r==null)return null;var{x:a,y:i,width:s,height:c}=r;return x.createElement(Cbe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:a,y:i,height:c,width:s}))),t)};function kF(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var a=e[r];a!==void 0&&n.push(a)}return n}function Abe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Ebe(r,n)}function Nbe(e,t,n){var r=n==="width",{x:a,y:i,width:s,height:c}=e;return t===1?{start:r?a:i,end:r?a+s:i+c}:{start:r?a+s:i+c,end:r?a:i}}function im(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function Tbe(e,t){return kF(e,t+1)}function Pbe(e,t,n,r,a){for(var i=(r||[]).slice(),{start:s,end:c}=t,u=0,d=1,m=s,f=function(){var b=r==null?void 0:r[u];if(b===void 0)return{v:kF(r,d)};var w=u,S,E=()=>(S===void 0&&(S=n(b,w)),S),O=b.coordinate,j=u===0||im(e,O,E,m,c);j||(u=0,m=s,d+=1),j&&(m=O+e*(E()/2+a),u+=d)},v;d<=i.length;)if(v=f(),v)return v.v;return[]}function Mbe(e,t,n,r,a){var i=(r||[]).slice(),s=i.length;if(s===0)return[];for(var{start:c,end:u}=t,d=1;d<=s;d++){for(var m=(s-1)%d,f=c,v=!0,g=function(){var A=r[w];if(A==null)return 0;var N=w,T,P=()=>(T===void 0&&(T=n(A,N)),T),R=A.coordinate,D=w===m||im(e,R,P,f,u);if(!D)return v=!1,1;D&&(f=R+e*(P()/2+a))},b,w=m;w<s&&(b=g(),!(b!==0&&b===1));w+=d);if(v){for(var S=[],E=m;E<s;E+=d){var O=r[E];O!=null&&S.push(O)}return S}}return[]}function I3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function mr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I3(Object(n),!0).forEach(function(r){kbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kbe(e,t,n){return(t=Rbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rbe(e){var t=Dbe(e,"string");return typeof t=="symbol"?t:t+""}function Dbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ibe(e,t,n,r,a){for(var i=(r||[]).slice(),s=i.length,{start:c}=t,{end:u}=t,d=function(v){var g=i[v];if(g==null)return 1;var b=g,w,S=()=>(w===void 0&&(w=n(g,v)),w);if(v===s-1){var E=e*(b.coordinate+e*S()/2-u);i[v]=b=mr(mr({},b),{},{tickCoord:E>0?b.coordinate-E*e:b.coordinate})}else i[v]=b=mr(mr({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var O=im(e,b.tickCoord,S,c,u);O&&(u=b.tickCoord-e*(S()/2+a),i[v]=mr(mr({},b),{},{isShow:!0}))}},m=s-1;m>=0;m--)d(m);return i}function Lbe(e,t,n,r,a,i){var s=(r||[]).slice(),c=s.length,{start:u,end:d}=t;if(i){var m=r[c-1];if(m!=null){var f=n(m,c-1),v=e*(m.coordinate+e*f/2-d);if(s[c-1]=m=mr(mr({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate}),m.tickCoord!=null){var g=im(e,m.tickCoord,()=>f,u,d);g&&(d=m.tickCoord-e*(f/2+a),s[c-1]=mr(mr({},m),{},{isShow:!0}))}}}for(var b=i?c-1:c,w=function(O){var j=s[O];if(j==null)return 1;var A=j,N,T=()=>(N===void 0&&(N=n(j,O)),N);if(O===0){var P=e*(A.coordinate-e*T()/2-u);s[O]=A=mr(mr({},A),{},{tickCoord:P<0?A.coordinate-P*e:A.coordinate})}else s[O]=A=mr(mr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var R=im(e,A.tickCoord,T,u,d);R&&(u=A.tickCoord+e*(T()/2+a),s[O]=mr(mr({},A),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return s}function jA(e,t,n){var{tick:r,ticks:a,viewBox:i,minTickGap:s,orientation:c,interval:u,tickFormatter:d,unit:m,angle:f}=e;if(!a||!a.length||!r)return[];if(Oe(u)||Hm.isSsr){var v;return(v=Tbe(a,Oe(u)?u:0))!==null&&v!==void 0?v:[]}var g=[],b=c==="top"||c==="bottom"?"width":"height",w=m&&b==="width"?Mh(m,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(N,T)=>{var P=typeof d=="function"?d(N.value,T):N.value;return b==="width"?Abe(Mh(P,{fontSize:t,letterSpacing:n}),w,f):Mh(P,{fontSize:t,letterSpacing:n})[b]},E=a[0],O=a[1],j=a.length>=2&&E!=null&&O!=null?Vn(O.coordinate-E.coordinate):1,A=Nbe(i,j,b);return u==="equidistantPreserveStart"?Pbe(j,A,S,a,s):u==="equidistantPreserveEnd"?Mbe(j,A,S,a,s):(u==="preserveStart"||u==="preserveStartEnd"?g=Lbe(j,A,S,a,s,u==="preserveStartEnd"):g=Ibe(j,A,S,a,s),g.filter(N=>N.isShow))}var zbe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:a=0,tickMargin:i=0}=e,s=0;if(t){Array.from(t).forEach(m=>{if(m){var f=m.getBoundingClientRect();f.width>s&&(s=f.width)}});var c=n?n.getBoundingClientRect().width:0,u=a+i,d=s+u+c+(n?r:0);return Math.round(d)}return 0},$be={xAxis:{},yAxis:{}},RF=br({name:"renderedTicks",initialState:$be,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:a}=t.payload;e[n][r]=a},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:Bbe,removeRenderedTicks:Ube}=RF.actions,Hbe=RF.reducer,Fbe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function qbe(e,t){if(e==null)return{};var n,r,a=Kbe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Kbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Fc(){return Fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fc.apply(null,arguments)}function L3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L3(Object(n),!0).forEach(function(r){Vbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vbe(e,t,n){return(t=Ybe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ybe(e){var t=Gbe(e,"string");return typeof t=="symbol"?t:t+""}function Gbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ko={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:_n.axis};function Xbe(e){var{x:t,y:n,width:r,height:a,orientation:i,mirror:s,axisLine:c,otherSvgProps:u}=e;if(!c)return null;var d=rn(rn(rn({},u),ha(c)),{},{fill:"none"});if(i==="top"||i==="bottom"){var m=+(i==="top"&&!s||i==="bottom"&&s);d=rn(rn({},d),{},{x1:t,y1:n+m*a,x2:t+r,y2:n+m*a})}else{var f=+(i==="left"&&!s||i==="right"&&s);d=rn(rn({},d),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+a})}return x.createElement("line",Fc({},d,{className:dt("recharts-cartesian-axis-line",Ic(c,"className"))}))}function Wbe(e,t,n,r,a,i,s,c,u){var d,m,f,v,g,b,w=c?-1:1,S=e.tickSize||s,E=Oe(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":d=m=e.coordinate,v=n+ +!c*a,f=v-w*S,b=f-w*u,g=E;break;case"left":f=v=e.coordinate,m=t+ +!c*r,d=m-w*S,g=d-w*u,b=E;break;case"right":f=v=e.coordinate,m=t+ +c*r,d=m+w*S,g=d+w*u,b=E;break;default:d=m=e.coordinate,v=n+ +c*a,f=v+w*S,b=f+w*u,g=E;break}return{line:{x1:d,y1:f,x2:m,y2:v},tick:{x:g,y:b}}}function Qbe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Zbe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Jbe(e){var{option:t,tickProps:n,value:r}=e,a,i=dt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))a=x.cloneElement(t,rn(rn({},n),{},{className:i}));else if(typeof t=="function")a=t(rn(rn({},n),{},{className:i}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=dt(s,bF(t))),a=x.createElement(lx,Fc({},n,{className:s}),r)}return a}function ewe(e){var{ticks:t,axisType:n,axisId:r}=e,a=kt();return x.useEffect(()=>{if(r==null||n==null)return Ol;var i=t.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return a(Bbe({ticks:i,axisId:r,axisType:n})),()=>{a(Ube({axisId:r,axisType:n}))}},[a,t,r,n]),null}var twe=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:a,stroke:i,tickFormatter:s,unit:c,padding:u,tickTextProps:d,orientation:m,mirror:f,x:v,y:g,width:b,height:w,tickSize:S,tickMargin:E,fontSize:O,letterSpacing:j,getTicksConfig:A,events:N,axisType:T,axisId:P}=e,R=jA(rn(rn({},A),{},{ticks:n}),O,j),D=ha(A),K=Rc(r),z=sF(D.textAnchor)?D.textAnchor:Qbe(m,f),I=Zbe(m,f),G={};typeof a=="object"&&(G=a);var L=rn(rn({},D),{},{fill:"none"},G),Y=R.map(q=>rn({entry:q},Wbe(q,v,g,b,w,m,S,f,E))),k=Y.map(q=>{var{entry:F,line:V}=q;return x.createElement(In,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(F.value,"-").concat(F.coordinate,"-").concat(F.tickCoord)},a&&x.createElement("line",Fc({},L,V,{className:dt("recharts-cartesian-axis-tick-line",Ic(a,"className"))})))}),H=Y.map((q,F)=>{var V,B,{entry:$,tick:X}=q,Z=rn(rn(rn(rn({verticalAnchor:I},D),{},{textAnchor:z,stroke:"none",fill:i},X),{},{index:F,payload:$,visibleTicksCount:R.length,tickFormatter:s,padding:u},d),{},{angle:(V=(B=d==null?void 0:d.angle)!==null&&B!==void 0?B:D.angle)!==null&&V!==void 0?V:0}),ee=rn(rn({},Z),K);return x.createElement(In,Fc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat($.value,"-").concat($.coordinate,"-").concat($.tickCoord)},Im(N,$,F)),r&&x.createElement(Jbe,{option:r,tickProps:ee,value:"".concat(typeof s=="function"?s($.value,F):$.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(T,"-ticks")},x.createElement(ewe,{ticks:R,axisId:P,axisType:T}),H.length>0&&x.createElement(Gr,{zIndex:_n.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(T,"-tick-labels"),ref:t},H)),k.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(T,"-tick-lines")},k))}),nwe=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:a,className:i,hide:s,ticks:c,axisType:u,axisId:d}=e,m=qbe(e,Fbe),[f,v]=x.useState(""),[g,b]=x.useState(""),w=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var E;return zbe({ticks:w.current,label:(E=e.labelRef)===null||E===void 0?void 0:E.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=x.useCallback(E=>{if(E){var O=E.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=O;var j=O[0];if(j){var A=window.getComputedStyle(j),N=A.fontSize,T=A.letterSpacing;(N!==f||T!==g)&&(v(N),b(T))}}},[f,g]);return s||r!=null&&r<=0||a!=null&&a<=0?null:x.createElement(Gr,{zIndex:e.zIndex},x.createElement(In,{className:dt("recharts-cartesian-axis",i)},x.createElement(Xbe,{x:e.x,y:e.y,width:r,height:a,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:ha(e)}),x.createElement(twe,{ref:S,axisType:u,events:m,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:g,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:d}),x.createElement(Gye,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(a0e,{label:e.label,labelRef:e.labelRef}),e.children)))}),CA=x.forwardRef((e,t)=>{var n=Cn(e,ko);return x.createElement(nwe,Fc({},n,{ref:t}))});CA.displayName="CartesianAxis";var rwe=["x1","y1","x2","y2","key"],awe=["offset"],iwe=["xAxisId","yAxisId"],owe=["xAxisId","yAxisId"];function z3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z3(Object(n),!0).forEach(function(r){swe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function swe(e,t,n){return(t=lwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lwe(e){var t=cwe(e,"string");return typeof t=="symbol"?t:t+""}function cwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dc(){return dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dc.apply(null,arguments)}function Ry(e,t){if(e==null)return{};var n,r,a=uwe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function uwe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var dwe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:a,width:i,height:s,ry:c}=e;return x.createElement("rect",{x:r,y:a,ry:c,width:i,height:s,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function DF(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var a,{x1:i,y1:s,x2:c,y2:u,key:d}=n,m=Ry(n,rwe),f=(a=ha(m))!==null&&a!==void 0?a:{},{offset:v}=f,g=Ry(f,awe);r=x.createElement("line",dc({},g,{x1:i,y1:s,x2:c,y2:u,fill:"none",key:d}))}return r}function fwe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:a}=e;if(!r||!a||!a.length)return null;var{xAxisId:i,yAxisId:s}=e,c=Ry(e,iwe),u=a.map((d,m)=>{var f=vr(vr({},c),{},{x1:t,y1:d,x2:t+n,y2:d,key:"line-".concat(m),index:m});return x.createElement(DF,{key:"line-".concat(m),option:r,lineItemProps:f})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function hwe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:a}=e;if(!r||!a||!a.length)return null;var{xAxisId:i,yAxisId:s}=e,c=Ry(e,owe),u=a.map((d,m)=>{var f=vr(vr({},c),{},{x1:d,y1:t,x2:d,y2:t+n,key:"line-".concat(m),index:m});return x.createElement(DF,{option:r,lineItemProps:f,key:"line-".concat(m)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function mwe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:a,width:i,height:s,horizontalPoints:c,horizontal:u=!0}=e;if(!u||!t||!t.length||c==null)return null;var d=c.map(f=>Math.round(f+a-a)).sort((f,v)=>f-v);a!==d[0]&&d.unshift(0);var m=d.map((f,v)=>{var g=d[v+1],b=g==null,w=b?a+s-f:g-f;if(w<=0)return null;var S=v%t.length;return x.createElement("rect",{key:"react-".concat(v),y:f,x:r,height:w,width:i,stroke:"none",fill:t[S],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function pwe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:a,y:i,width:s,height:c,verticalPoints:u}=e;if(!t||!n||!n.length)return null;var d=u.map(f=>Math.round(f+a-a)).sort((f,v)=>f-v);a!==d[0]&&d.unshift(0);var m=d.map((f,v)=>{var g=d[v+1],b=g==null,w=b?a+s-f:g-f;if(w<=0)return null;var S=v%n.length;return x.createElement("rect",{key:"react-".concat(v),x:f,y:i,width:w,height:c,stroke:"none",fill:n[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var vwe=(e,t)=>{var{xAxis:n,width:r,height:a,offset:i}=e;return v6(jA(vr(vr(vr({},ko),n),{},{ticks:g6(n),viewBox:{x:0,y:0,width:r,height:a}})),i.left,i.left+i.width,t)},gwe=(e,t)=>{var{yAxis:n,width:r,height:a,offset:i}=e;return v6(jA(vr(vr(vr({},ko),n),{},{ticks:g6(n),viewBox:{x:0,y:0,width:r,height:a}})),i.top,i.top+i.height,t)},ywe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:_n.grid};function OA(e){var t=GC(),n=XC(),r=_6(),a=vr(vr({},Cn(e,ywe)),{},{x:Oe(e.x)?e.x:r.left,y:Oe(e.y)?e.y:r.top,width:Oe(e.width)?e.width:r.width,height:Oe(e.height)?e.height:r.height}),{xAxisId:i,yAxisId:s,x:c,y:u,width:d,height:m,syncWithTicks:f,horizontalValues:v,verticalValues:g}=a,b=wr(),w=Te(D=>PI(D,"xAxis",i,b)),S=Te(D=>PI(D,"yAxis",s,b));if(!qi(d)||!qi(m)||!Oe(c)||!Oe(u))return null;var E=a.verticalCoordinatesGenerator||vwe,O=a.horizontalCoordinatesGenerator||gwe,{horizontalPoints:j,verticalPoints:A}=a;if((!j||!j.length)&&typeof O=="function"){var N=v&&v.length,T=O({yAxis:S?vr(vr({},S),{},{ticks:N?v:S.ticks}):void 0,width:t??d,height:n??m,offset:r},N?!0:f);iy(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(j=T)}if((!A||!A.length)&&typeof E=="function"){var P=g&&g.length,R=E({xAxis:w?vr(vr({},w),{},{ticks:P?g:w.ticks}):void 0,width:t??d,height:n??m,offset:r},P?!0:f);iy(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof R,"]")),Array.isArray(R)&&(A=R)}return x.createElement(Gr,{zIndex:a.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(dwe,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),x.createElement(mwe,dc({},a,{horizontalPoints:j})),x.createElement(pwe,dc({},a,{verticalPoints:A})),x.createElement(fwe,dc({},a,{offset:r,horizontalPoints:j,xAxis:w,yAxis:S})),x.createElement(hwe,dc({},a,{offset:r,verticalPoints:A,xAxis:w,yAxis:S}))))}OA.displayName="CartesianGrid";var xwe={},IF=br({name:"errorBars",initialState:xwe,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:a}=t.payload;e[n]&&(e[n]=e[n].map(i=>i.dataKey===r.dataKey&&i.direction===r.direction?a:i))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(a=>a.dataKey!==r.dataKey||a.direction!==r.direction))}}}),{addErrorBar:$2e,replaceErrorBar:B2e,removeErrorBar:U2e}=IF.actions,bwe=IF.reducer,wwe=["children"];function Swe(e,t){if(e==null)return{};var n,r,a=Ewe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Ewe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _we={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},jwe=x.createContext(_we);function LF(e){var{children:t}=e,n=Swe(e,wwe);return x.createElement(jwe.Provider,{value:n},t)}function AA(e,t){var n,r,a=Te(d=>ts(d,e)),i=Te(d=>ns(d,t)),s=(n=a==null?void 0:a.allowDataOverflow)!==null&&n!==void 0?n:Pn.allowDataOverflow,c=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:Mn.allowDataOverflow,u=s||c;return{needClip:u,needClipX:s,needClipY:c}}function zF(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,a=_A(),{needClipX:i,needClipY:s,needClip:c}=AA(t,n);if(!c||!a)return null;var{x:u,y:d,width:m,height:f}=a;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:i?u:u-m/2,y:s?d:d-f/2,width:i?m:m*2,height:s?f:f*2}))}var $F=(e,t,n,r)=>hl(e,"xAxis",t,r),BF=(e,t,n,r)=>fl(e,"xAxis",t,r),UF=(e,t,n,r)=>hl(e,"yAxis",n,r),HF=(e,t,n,r)=>fl(e,"yAxis",n,r),Cwe=se([yt,$F,UF,BF,HF],(e,t,n,r,a)=>Wo(e,"xAxis")?Ad(t,r,!1):Ad(n,a,!1)),Owe=(e,t,n,r,a)=>a;function Awe(e){return e.type==="line"}var Nwe=se([rx,Owe],(e,t)=>e.filter(Awe).find(n=>n.id===t)),Twe=se([yt,$F,UF,BF,HF,Nwe,Cwe,JC],(e,t,n,r,a,i,s,c)=>{var{chartData:u,dataStartIndex:d,dataEndIndex:m}=c;if(!(i==null||t==null||n==null||r==null||a==null||r.length===0||a.length===0||s==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:v}=i,g;if(v!=null&&v.length>0?g=v:g=u==null?void 0:u.slice(d,m+1),g!=null)return Qwe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:a,dataKey:f,bandSize:s,displayedData:g})}});function Pwe(e){var t=Rc(e),n=3,r=2;if(t!=null){var{r:a,strokeWidth:i}=t,s=Number(a),c=Number(i);return(Number.isNaN(s)||s<0)&&(s=n),(Number.isNaN(c)||c<0)&&(c=r),{r:s,strokeWidth:c}}return{r:n,strokeWidth:r}}var Mwe=["id"],kwe=["type","layout","connectNulls","needClip","shape"],Rwe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function om(){return om=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},om.apply(null,arguments)}function $3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ni(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$3(Object(n),!0).forEach(function(r){Dwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dwe(e,t,n){return(t=Iwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iwe(e){var t=Lwe(e,"string");return typeof t=="symbol"?t:t+""}function Lwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NA(e,t){if(e==null)return{};var n,r,a=zwe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function zwe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var $we=e=>{var{dataKey:t,name:n,stroke:r,legendType:a,hide:i}=e;return[{inactive:i,dataKey:t,type:a,color:r,value:Jd(n,t),payload:e}]},Bwe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:a,fill:i,name:s,hide:c,unit:u,tooltipType:d,id:m}=e,f={dataDefinedOnItem:n,getPosition:Ol,settings:{stroke:r,strokeWidth:a,fill:i,dataKey:t,nameKey:void 0,name:Jd(s,t),hide:c,type:d,color:r,unit:u,graphicalItemId:m}};return x.createElement(SA,{tooltipEntrySettings:f})}),FF=(e,t)=>"".concat(t,"px ").concat(e,"px");function Uwe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],a=0;a<t;++a)r.push(...n);return r}var Hwe=(e,t,n)=>{var r=n.reduce((v,g)=>v+g,0);if(!r)return FF(t,e);for(var a=Math.floor(e/r),i=e%r,s=[],c=0,u=0;c<n.length;u+=(d=n[c])!==null&&d!==void 0?d:0,++c){var d,m=n[c];if(m!=null&&u+m>i){s=[...n.slice(0,c),i-u];break}}var f=s.length%2===0?[0,t]:[t];return[...Uwe(n,a),...s,...f].map(v=>"".concat(v,"px")).join(", ")};function Fwe(e){var{clipPathId:t,points:n,props:r}=e,{dot:a,dataKey:i,needClip:s}=r,{id:c}=r,u=NA(r,Mwe),d=ha(u);return x.createElement(Kxe,{points:n,dot:a,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:i,baseProps:d,needClip:s,clipPathId:t})}function qwe(e){var{showLabels:t,children:n,points:r}=e,a=x.useMemo(()=>r==null?void 0:r.map(i=>{var s,c,u={x:(s=i.x)!==null&&s!==void 0?s:0,y:(c=i.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ni(Ni({},u),{},{value:i.value,payload:i.payload,viewBox:u,parentViewBox:void 0,fill:void 0})}),[r]);return x.createElement(mF,{value:t?a:void 0},n)}function B3(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:a,props:i}=e,{type:s,layout:c,connectNulls:u,needClip:d,shape:m}=i,f=NA(i,kwe),v=Ni(Ni({},Nr(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):void 0,points:r,type:s,layout:c,connectNulls:u,strokeDasharray:a??i.strokeDasharray});return x.createElement(x.Fragment,null,(r==null?void 0:r.length)>1&&x.createElement(yA,om({shapeType:"curve",option:m},v,{pathRef:n})),x.createElement(Fwe,{points:r,clipPathId:t,props:i}))}function Kwe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Vwe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:a,longestAnimatedLengthRef:i}=e,{points:s,strokeDasharray:c,isAnimationActive:u,animationBegin:d,animationDuration:m,animationEasing:f,animateNewValues:v,width:g,height:b,onAnimationEnd:w,onAnimationStart:S}=n,E=a.current,O=qm(s,"recharts-line-"),j=x.useRef(O),[A,N]=x.useState(!1),T=!A,P=x.useCallback(()=>{typeof w=="function"&&w(),N(!1)},[w]),R=x.useCallback(()=>{typeof S=="function"&&S(),N(!0)},[S]),D=Kwe(r.current),K=x.useRef(0);j.current!==O&&(K.current=i.current,j.current=O);var z=K.current;return x.createElement(qwe,{points:s,showLabels:T},n.children,x.createElement(Fm,{animationId:O,begin:d,duration:m,isActive:u,easing:f,onAnimationEnd:P,onAnimationStart:R,key:O},I=>{var G=Vt(z,D+z,I),L=Math.min(G,D),Y;if(u)if(c){var k="".concat(c).split(/[,\s]+/gim).map(F=>parseFloat(F));Y=Hwe(L,D,k)}else Y=FF(D,L);else Y=c==null?void 0:String(c);if(I>0&&D>0&&(a.current=s,i.current=Math.max(i.current,L)),E){var H=E.length/s.length,q=I===1?s:s.map((F,V)=>{var B=Math.floor(V*H);if(E[B]){var $=E[B];return Ni(Ni({},F),{},{x:Vt($.x,F.x,I),y:Vt($.y,F.y,I)})}return v?Ni(Ni({},F),{},{x:Vt(g*2,F.x,I),y:Vt(b/2,F.y,I)}):Ni(Ni({},F),{},{x:F.x,y:F.y})});return a.current=q,x.createElement(B3,{props:n,points:q,clipPathId:t,pathRef:r,strokeDasharray:Y})}return x.createElement(B3,{props:n,points:s,clipPathId:t,pathRef:r,strokeDasharray:Y})}),x.createElement(mA,{label:n.label}))}function Ywe(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),a=x.useRef(0),i=x.useRef(null);return x.createElement(Vwe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:a,pathRef:i})}var Gwe=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:Pt(e.payload,t)}};class Xwe extends x.Component{render(){var{hide:t,dot:n,points:r,className:a,xAxisId:i,yAxisId:s,top:c,left:u,width:d,height:m,id:f,needClip:v,zIndex:g}=this.props;if(t)return null;var b=dt("recharts-line",a),w=f,{r:S,strokeWidth:E}=Pwe(n),O=EF(n),j=S*2+E,A=v?"url(#clipPath-".concat(O?"":"dots-").concat(w,")"):void 0;return x.createElement(Gr,{zIndex:g},x.createElement(In,{className:b},v&&x.createElement("defs",null,x.createElement(zF,{clipPathId:w,xAxisId:i,yAxisId:s}),!O&&x.createElement("clipPath",{id:"clipPath-dots-".concat(w)},x.createElement("rect",{x:u-j/2,y:c-j/2,width:d+j,height:m+j}))),x.createElement(LF,{xAxisId:i,yAxisId:s,data:r,dataPointFormatter:Gwe,errorBarOffset:0},x.createElement(Ywe,{props:this.props,clipPathId:w}))),x.createElement(dbe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:A}))}}var qF={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:_n.line,type:"linear"};function Wwe(e){var t=Cn(e,qF),{activeDot:n,animateNewValues:r,animationBegin:a,animationDuration:i,animationEasing:s,connectNulls:c,dot:u,hide:d,isAnimationActive:m,label:f,legendType:v,xAxisId:g,yAxisId:b,id:w}=t,S=NA(t,Rwe),{needClip:E}=AA(g,b),O=_A(),j=Qc(),A=wr(),N=Te(K=>Twe(K,g,b,A,w));if(j!=="horizontal"&&j!=="vertical"||N==null||O==null)return null;var{height:T,width:P,x:R,y:D}=O;return x.createElement(Xwe,om({},S,{id:w,connectNulls:c,dot:u,activeDot:n,animateNewValues:r,animationBegin:a,animationDuration:i,animationEasing:s,isAnimationActive:m,hide:d,label:f,legendType:v,xAxisId:g,yAxisId:b,points:N,layout:j,height:T,width:P,left:R,top:D,needClip:E}))}function Qwe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:a,yAxisTicks:i,dataKey:s,bandSize:c,displayedData:u}=e;return u.map((d,m)=>{var f=Pt(d,s);if(t==="horizontal"){var v=SR({axis:n,ticks:a,bandSize:c,entry:d,index:m}),g=Wt(f)?null:r.scale.map(f);return{x:v,y:g??null,value:f,payload:d}}var b=Wt(f)?null:n.scale.map(f),w=SR({axis:r,ticks:i,bandSize:c,entry:d,index:m});return b==null||w==null?null:{x:b,y:w,value:f,payload:d}}).filter(Boolean)}function Zwe(e){var t=Cn(e,qF),n=wr();return x.createElement(EA,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(_F,{legendPayload:$we(t)}),x.createElement(Bwe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(CF,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),x.createElement(Wwe,om({},t,{id:r}))))}var KF=x.memo(Zwe,ef);KF.displayName="Line";function eu(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(a=>a.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:AF}function tu(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(a=>a.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:AF}var Jwe="Invariant failed";function e1e(e,t){throw new Error(Jwe)}function I_(){return I_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I_.apply(null,arguments)}function TA(e){return x.createElement(yA,I_({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var t1e=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,a)=>{if(Oe(t))return t;var i=Oe(r)||Wt(r);return i?t(r,a):(i||e1e(),n)}},n1e=(e,t,n)=>n,r1e=(e,t)=>t,ap=se([rx,r1e],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),a1e=se([ap],e=>e==null?void 0:e.maxBarSize),i1e=(e,t,n,r)=>r,o1e=se([yt,rx,eu,tu,n1e],(e,t,n,r,a)=>t.filter(i=>e==="horizontal"?i.xAxisId===n:i.yAxisId===r).filter(i=>i.isPanorama===a).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),s1e=(e,t,n)=>{var r=yt(e),a=eu(e,t),i=tu(e,t);if(!(a==null||i==null))return r==="horizontal"?T_(e,"yAxis",i,n):T_(e,"xAxis",a,n)},l1e=(e,t)=>{var n=yt(e),r=eu(e,t),a=tu(e,t);if(!(r==null||a==null))return n==="horizontal"?TI(e,"xAxis",r):TI(e,"yAxis",a)},c1e=se([o1e,Qde,l1e],fbe),u1e=(e,t,n)=>{var r,a,i=ap(e,t);if(i==null)return 0;var s=eu(e,t),c=tu(e,t);if(s==null||c==null)return 0;var u=yt(e),d=sU(e),{maxBarSize:m}=i,f=Wt(m)?d:m,v,g;return u==="horizontal"?(v=hl(e,"xAxis",s,n),g=fl(e,"xAxis",s,n)):(v=hl(e,"yAxis",c,n),g=fl(e,"yAxis",c,n)),(r=(a=Ad(v,g,!0))!==null&&a!==void 0?a:f)!==null&&r!==void 0?r:0},VF=(e,t,n)=>{var r=yt(e),a=eu(e,t),i=tu(e,t);if(!(a==null||i==null)){var s,c;return r==="horizontal"?(s=hl(e,"xAxis",a,n),c=fl(e,"xAxis",a,n)):(s=hl(e,"yAxis",i,n),c=fl(e,"yAxis",i,n)),Ad(s,c)}},d1e=se([c1e,sU,Wde,lU,u1e,VF,a1e],gbe),f1e=(e,t,n)=>{var r=eu(e,t);if(r!=null)return hl(e,"xAxis",r,n)},h1e=(e,t,n)=>{var r=tu(e,t);if(r!=null)return hl(e,"yAxis",r,n)},m1e=(e,t,n)=>{var r=eu(e,t);if(r!=null)return fl(e,"xAxis",r,n)},p1e=(e,t,n)=>{var r=tu(e,t);if(r!=null)return fl(e,"yAxis",r,n)},v1e=se([d1e,ap],xbe),g1e=se([s1e,ap],ybe),y1e=se([Ln,qC,f1e,h1e,m1e,p1e,v1e,yt,qde,VF,g1e,ap,i1e],(e,t,n,r,a,i,s,c,u,d,m,f,v)=>{var{chartData:g,dataStartIndex:b,dataEndIndex:w}=u;if(!(f==null||s==null||t==null||c!=="horizontal"&&c!=="vertical"||n==null||r==null||a==null||i==null||d==null)){var{data:S}=f,E;if(S!=null&&S.length>0?E=S:E=g==null?void 0:g.slice(b,w+1),E!=null)return V1e({layout:c,barSettings:f,pos:s,parentViewBox:t,bandSize:d,xAxis:n,yAxis:r,xAxisTicks:a,yAxisTicks:i,stackedData:m,displayedData:E,offset:e,cells:v,dataStartIndex:b})}}),x1e=["index"];function L_(){return L_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L_.apply(null,arguments)}function b1e(e,t){if(e==null)return{};var n,r,a=w1e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function w1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var YF=x.createContext(void 0),S1e=e=>{var t=x.useContext(YF);if(t!=null)return t.stackId;if(e!=null)return Fle(e)},E1e=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),_1e=e=>{var t=x.useContext(YF);if(t!=null){var{stackId:n}=t;return"url(#".concat(E1e(n,e),")")}},GF=e=>{var{index:t}=e,n=b1e(e,x1e),r=_1e(t);return x.createElement(In,L_({className:"recharts-bar-stack-layer",clipPath:r},n))},j1e=["onMouseEnter","onMouseLeave","onClick"],C1e=["value","background","tooltipPosition"],O1e=["id"],A1e=["onMouseEnter","onClick","onMouseLeave"];function vl(){return vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vl.apply(null,arguments)}function U3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Or(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U3(Object(n),!0).forEach(function(r){N1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N1e(e,t,n){return(t=T1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T1e(e){var t=P1e(e,"string");return typeof t=="symbol"?t:t+""}function P1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dy(e,t){if(e==null)return{};var n,r,a=M1e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function M1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var k1e=e=>{var{dataKey:t,name:n,fill:r,legendType:a,hide:i}=e;return[{inactive:i,dataKey:t,type:a,color:r,value:Jd(n,t),payload:e}]},R1e=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:a,name:i,hide:s,unit:c,tooltipType:u,id:d}=e,m={dataDefinedOnItem:void 0,getPosition:Ol,settings:{stroke:n,strokeWidth:r,fill:a,dataKey:t,nameKey:void 0,name:Jd(i,t),hide:s,type:u,color:a,unit:c,graphicalItemId:d}};return x.createElement(SA,{tooltipEntrySettings:m})});function D1e(e){var t=Te(ml),{data:n,dataKey:r,background:a,allOtherBarProps:i}=e,{onMouseEnter:s,onMouseLeave:c,onClick:u}=i,d=Dy(i,j1e),m=xA(s,r,i.id),f=bA(c),v=wA(u,r,i.id);if(!a||n==null)return null;var g=Rc(a);return x.createElement(Gr,{zIndex:bbe(a,_n.barBackground)},n.map((b,w)=>{var{value:S,background:E,tooltipPosition:O}=b,j=Dy(b,C1e);if(!E)return null;var A=m(b,w),N=f(b,w),T=v(b,w),P=Or(Or(Or(Or(Or({option:a,isActive:String(w)===t},j),{},{fill:"#eee"},E),g),Im(d,b,w)),{},{onMouseEnter:A,onMouseLeave:N,onClick:T,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return x.createElement(TA,vl({key:"background-bar-".concat(w)},P))}))}function I1e(e){var{showLabels:t,children:n,rects:r}=e,a=r==null?void 0:r.map(i=>{var s={x:i.x,y:i.y,width:i.width,lowerWidth:i.width,upperWidth:i.width,height:i.height};return Or(Or({},s),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:s,fill:i.fill})});return x.createElement(mF,{value:t?a:void 0},n)}function L1e(e){var{shape:t,activeBar:n,baseProps:r,entry:a,index:i,dataKey:s}=e,c=Te(ml),u=Te(sA),d=n&&String(a.originalDataIndex)===c&&(u==null||s===u),[m,f]=x.useState(!1),[v,g]=x.useState(!1);x.useEffect(()=>{var j;return d?(f(!0),j=requestAnimationFrame(()=>{g(!0)})):g(!1),()=>{cancelAnimationFrame(j)}},[d]);var b=x.useCallback(()=>{d||f(!1)},[d]),w=d&&v,S=d||m,E;d?n===!0?E=t:E=n:E=t;var O=x.createElement(TA,vl({},r,{name:String(r.name)},a,{isActive:w,option:E,index:i,dataKey:s,onTransitionEnd:b}));return S?x.createElement(Gr,{zIndex:_n.activeBar},x.createElement(GF,{index:a.originalDataIndex},O)):O}function z1e(e){var{shape:t,baseProps:n,entry:r,index:a,dataKey:i}=e;return x.createElement(TA,vl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:a,dataKey:i}))}function $1e(e){var t,{data:n,props:r}=e,a=(t=ha(r))!==null&&t!==void 0?t:{},{id:i}=a,s=Dy(a,O1e),{shape:c,dataKey:u,activeBar:d}=r,{onMouseEnter:m,onClick:f,onMouseLeave:v}=r,g=Dy(r,A1e),b=xA(m,u,i),w=bA(v),S=wA(f,u,i);return n?x.createElement(x.Fragment,null,n.map((E,O)=>x.createElement(GF,vl({index:E.originalDataIndex,key:"rectangle-".concat(E==null?void 0:E.x,"-").concat(E==null?void 0:E.y,"-").concat(E==null?void 0:E.value,"-").concat(O),className:"recharts-bar-rectangle"},Im(g,E,O),{onMouseEnter:b(E,O),onMouseLeave:w(E,O),onClick:S(E,O)}),d?x.createElement(L1e,{shape:c,activeBar:d,baseProps:s,entry:E,index:O,dataKey:u}):x.createElement(z1e,{shape:c,baseProps:s,entry:E,index:O,dataKey:u})))):null}function B1e(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:a,isAnimationActive:i,animationBegin:s,animationDuration:c,animationEasing:u,onAnimationEnd:d,onAnimationStart:m}=t,f=n.current,v=qm(t,"recharts-bar-"),[g,b]=x.useState(!1),w=!g,S=x.useCallback(()=>{typeof d=="function"&&d(),b(!1)},[d]),E=x.useCallback(()=>{typeof m=="function"&&m(),b(!0)},[m]);return x.createElement(I1e,{showLabels:w,rects:r},x.createElement(Fm,{animationId:v,begin:s,duration:c,isActive:i,easing:u,onAnimationEnd:S,onAnimationStart:E,key:v},O=>{var j=O===1?r:r==null?void 0:r.map((A,N)=>{var T=f&&f[N];if(T)return Or(Or({},A),{},{x:Vt(T.x,A.x,O),y:Vt(T.y,A.y,O),width:Vt(T.width,A.width,O),height:Vt(T.height,A.height,O)});if(a==="horizontal"){var P=Vt(0,A.height,O),R=Vt(A.stackedBarStart,A.y,O);return Or(Or({},A),{},{y:R,height:P})}var D=Vt(0,A.width,O),K=Vt(A.stackedBarStart,A.x,O);return Or(Or({},A),{},{width:D,x:K})});return O>0&&(n.current=j??null),j==null?null:x.createElement(In,null,x.createElement($1e,{props:t,data:j}))}),x.createElement(mA,{label:t.label}),t.children)}function U1e(e){var t=x.useRef(null);return x.createElement(B1e,{previousRectanglesRef:t,props:e})}var XF=0,H1e=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Pt(e,t)}};class F1e extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:a,xAxisId:i,yAxisId:s,needClip:c,background:u,id:d}=this.props;if(t||n==null)return null;var m=dt("recharts-bar",a),f=d;return x.createElement(In,{className:m,id:d},c&&x.createElement("defs",null,x.createElement(zF,{clipPathId:f,xAxisId:i,yAxisId:s})),x.createElement(In,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(f,")"):void 0},x.createElement(D1e,{data:n,dataKey:r,background:u,allOtherBarProps:this.props}),x.createElement(U1e,this.props)))}}var q1e={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:XF,xAxisId:0,yAxisId:0,zIndex:_n.bar};function K1e(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:i,activeBar:s,animationBegin:c,animationDuration:u,animationEasing:d,isAnimationActive:m}=e,{needClip:f}=AA(t,n),v=Qc(),g=wr(),b=gA(e.children,rp),w=Te(O=>y1e(O,e.id,g,b));if(v!=="vertical"&&v!=="horizontal")return null;var S,E=w==null?void 0:w[0];return E==null||E.height==null||E.width==null?S=0:S=v==="vertical"?E.height/2:E.width/2,x.createElement(LF,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:H1e,errorBarOffset:S},x.createElement(F1e,vl({},e,{layout:v,needClip:f,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:i,activeBar:s,animationBegin:c,animationDuration:u,animationEasing:d,isAnimationActive:m})))}function V1e(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:a},pos:i,bandSize:s,xAxis:c,yAxis:u,xAxisTicks:d,yAxisTicks:m,stackedData:f,displayedData:v,offset:g,cells:b,parentViewBox:w,dataStartIndex:S}=e,E=t==="horizontal"?u:c,O=f?E.scale.domain():null,j=qle({numericAxis:E}),A=E.scale.map(j);return v.map((N,T)=>{var P,R,D,K,z,I;if(f){var G=f[T+S];if(G==null)return null;P=zle(G,O)}else P=Pt(N,n),Array.isArray(P)||(P=[j,P]);var L=t1e(r,XF)(P[1],T);if(t==="horizontal"){var Y,k=u.scale.map(P[0]),H=u.scale.map(P[1]);if(k==null||H==null)return null;R=ER({axis:c,ticks:d,bandSize:s,offset:i.offset,entry:N,index:T}),D=(Y=H??k)!==null&&Y!==void 0?Y:void 0,K=i.size;var q=k-H;if(z=Hi(q)?0:q,I={x:R,y:g.top,width:K,height:g.height},Math.abs(L)>0&&Math.abs(z)<Math.abs(L)){var F=Vn(z||L)*(Math.abs(L)-Math.abs(z));D-=F,z+=F}}else{var V=c.scale.map(P[0]),B=c.scale.map(P[1]);if(V==null||B==null)return null;if(R=V,D=ER({axis:u,ticks:m,bandSize:s,offset:i.offset,entry:N,index:T}),K=B-V,z=i.size,I={x:g.left,y:D,width:g.width,height:z},Math.abs(L)>0&&Math.abs(K)<Math.abs(L)){var $=Vn(K||L)*(Math.abs(L)-Math.abs(K));K+=$}}if(R==null||D==null||K==null||z==null||!a&&(K===0||z===0))return null;var X=Or(Or({},N),{},{stackedBarStart:A,x:R,y:D,width:K,height:z,value:f?P:P[1],payload:N,background:I,tooltipPosition:{x:R+K/2,y:D+z/2},parentViewBox:w,originalDataIndex:T},b&&b[T]&&b[T].props);return X}).filter(Boolean)}function Y1e(e){var t=Cn(e,q1e),n=S1e(t.stackId),r=wr();return x.createElement(EA,{id:t.id,type:"bar"},a=>x.createElement(x.Fragment,null,x.createElement(_F,{legendPayload:k1e(t)}),x.createElement(R1e,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:a}),x.createElement(CF,{type:"bar",id:a,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),x.createElement(Gr,{zIndex:t.zIndex},x.createElement(K1e,vl({},t,{id:a})))))}var z_=x.memo(Y1e,ef);z_.displayName="Bar";var G1e=["domain","range"],X1e=["domain","range"];function H3(e,t){if(e==null)return{};var n,r,a=W1e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function W1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function F3(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function WF(e,t){if(e===t)return!0;var{domain:n,range:r}=e,a=H3(e,G1e),{domain:i,range:s}=t,c=H3(t,X1e);return!F3(n,i)||!F3(r,s)?!1:ef(a,c)}var Q1e=["type"],Z1e=["dangerouslySetInnerHTML","ticks","scale"],J1e=["id","scale"];function $_(){return $_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$_.apply(null,arguments)}function q3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function K3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q3(Object(n),!0).forEach(function(r){eSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eSe(e,t,n){return(t=tSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tSe(e){var t=nSe(e,"string");return typeof t=="symbol"?t:t+""}function nSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function B_(e,t){if(e==null)return{};var n,r,a=rSe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function rSe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function aSe(e){var t=kt(),n=x.useRef(null),r=j6(),{type:a}=e,i=B_(e,Q1e),s=V0(r,"xAxis",a),c=x.useMemo(()=>{if(s!=null)return K3(K3({},i),{},{type:s})},[i,s]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Wxe(c)):n.current!==c&&t(Qxe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(Zxe(n.current)),n.current=null)},[t]),null}var iSe=e=>{var{xAxisId:t,className:n}=e,r=Te(qC),a=wr(),i="xAxis",s=Te(E=>_H(E,i,t,a)),c=Te(E=>wH(E,t)),u=Te(E=>Ipe(E,t)),d=Te(E=>nH(E,t));if(c==null||u==null||d==null)return null;var{dangerouslySetInnerHTML:m,ticks:f,scale:v}=e,g=B_(e,Z1e),{id:b,scale:w}=d,S=B_(d,J1e);return x.createElement(CA,$_({},g,S,{x:u.x,y:u.y,width:c.width,height:c.height,className:dt("recharts-".concat(i," ").concat(i),n),viewBox:r,ticks:s,axisType:i,axisId:t}))},oSe={allowDataOverflow:Pn.allowDataOverflow,allowDecimals:Pn.allowDecimals,allowDuplicatedCategory:Pn.allowDuplicatedCategory,angle:Pn.angle,axisLine:ko.axisLine,height:Pn.height,hide:!1,includeHidden:Pn.includeHidden,interval:Pn.interval,label:!1,minTickGap:Pn.minTickGap,mirror:Pn.mirror,orientation:Pn.orientation,padding:Pn.padding,reversed:Pn.reversed,scale:Pn.scale,tick:Pn.tick,tickCount:Pn.tickCount,tickLine:ko.tickLine,tickSize:ko.tickSize,type:Pn.type,niceTicks:Pn.niceTicks,xAxisId:0},sSe=e=>{var t=Cn(e,oSe);return x.createElement(x.Fragment,null,x.createElement(aSe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(iSe,t))},PA=x.memo(sSe,WF);PA.displayName="XAxis";var lSe=["type"],cSe=["dangerouslySetInnerHTML","ticks","scale"],uSe=["id","scale"];function U_(){return U_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U_.apply(null,arguments)}function V3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Y3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V3(Object(n),!0).forEach(function(r){dSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dSe(e,t,n){return(t=fSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fSe(e){var t=hSe(e,"string");return typeof t=="symbol"?t:t+""}function hSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function H_(e,t){if(e==null)return{};var n,r,a=mSe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function mSe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pSe(e){var t=kt(),n=x.useRef(null),r=j6(),{type:a}=e,i=H_(e,lSe),s=V0(r,"yAxis",a),c=x.useMemo(()=>{if(s!=null)return Y3(Y3({},i),{},{type:s})},[s,i]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Jxe(c)):n.current!==c&&t(ebe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(tbe(n.current)),n.current=null)},[t]),null}function vSe(e){var{yAxisId:t,className:n,width:r,label:a}=e,i=x.useRef(null),s=x.useRef(null),c=Te(qC),u=wr(),d=kt(),m="yAxis",f=Te(T=>SH(T,t)),v=Te(T=>zpe(T,t)),g=Te(T=>_H(T,m,t,u)),b=Te(T=>rH(T,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!f||hA(a)||x.isValidElement(a)||b==null)){var T=i.current;if(T){var P=T.getCalculatedWidth();Math.round(f.width)!==Math.round(P)&&d(nbe({id:t,width:P}))}}},[g,f,d,a,t,r,b]),f==null||v==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:S,scale:E}=e,O=H_(e,cSe),{id:j,scale:A}=b,N=H_(b,uSe);return x.createElement(CA,U_({},O,N,{ref:i,labelRef:s,x:v.x,y:v.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:f.width,height:f.height,className:dt("recharts-".concat(m," ").concat(m),n),viewBox:c,ticks:g,axisType:m,axisId:t}))}var gSe={allowDataOverflow:Mn.allowDataOverflow,allowDecimals:Mn.allowDecimals,allowDuplicatedCategory:Mn.allowDuplicatedCategory,angle:Mn.angle,axisLine:ko.axisLine,hide:!1,includeHidden:Mn.includeHidden,interval:Mn.interval,label:!1,minTickGap:Mn.minTickGap,mirror:Mn.mirror,orientation:Mn.orientation,padding:Mn.padding,reversed:Mn.reversed,scale:Mn.scale,tick:Mn.tick,tickCount:Mn.tickCount,tickLine:ko.tickLine,tickSize:ko.tickSize,type:Mn.type,niceTicks:Mn.niceTicks,width:Mn.width,yAxisId:0},ySe=e=>{var t=Cn(e,gSe);return x.createElement(x.Fragment,null,x.createElement(pSe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(vSe,t))},MA=x.memo(ySe,WF);MA.displayName="YAxis";var xSe=(e,t)=>t,kA=se([xSe,yt,pU,Xn,UH,rs,oge,Ln],hge);function bSe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function RA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(bSe(e)){var a=e.currentTarget.getBBox();n=a.width>0?t.width/a.width:1,r=a.height>0?t.height/a.height:1}else{var i=e.currentTarget;n=i.offsetWidth>0?t.width/i.offsetWidth:1,r=i.offsetHeight>0?t.height/i.offsetHeight:1}var s=(c,u)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((u-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>s(c.clientX,c.clientY)):s(e.clientX,e.clientY)}var QF=ma("mouseClick"),ZF=zm();ZF.startListening({actionCreator:QF,effect:(e,t)=>{var n=e.payload,r=kA(t.getState(),RA(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(eve({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var F_=ma("mouseMove"),JF=zm(),Ku=null,Jl=null,US=null;JF.startListening({actionCreator:F_,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:a,throttledEvents:i}=r.eventSettings,s=i==="all"||(i==null?void 0:i.includes("mousemove"));Ku!==null&&(cancelAnimationFrame(Ku),Ku=null),Jl!==null&&(typeof a!="number"||!s)&&(clearTimeout(Jl),Jl=null),US=RA(n);var c=()=>{var u=t.getState(),d=tA(u,u.tooltip.settings.shared);if(!US){Ku=null,Jl=null;return}if(d==="axis"){var m=kA(u,US);(m==null?void 0:m.activeIndex)!=null?t.dispatch(MH({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(PH())}Ku=null,Jl=null};if(!s){c();return}a==="raf"?Ku=requestAnimationFrame(c):typeof a=="number"&&Jl===null&&(Jl=setTimeout(c,a))}});function wSe(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var G3={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},eq=br({name:"rootProps",initialState:G3,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:G3.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),SSe=eq.reducer,{updateOptions:ESe}=eq.actions,_Se=null,jSe={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},tq=br({name:"polarOptions",initialState:_Se,reducers:jSe}),{updatePolarOptions:CSe}=tq.actions,OSe=tq.reducer,nq=ma("keyDown"),rq=ma("focus"),aq=ma("blur"),fx=zm(),Vu=null,ec=null,ng=null;fx.startListening({actionCreator:nq,effect:(e,t)=>{ng=e.payload,Vu!==null&&(cancelAnimationFrame(Vu),Vu=null);var n=t.getState(),{throttleDelay:r,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("keydown");ec!==null&&(typeof r!="number"||!i)&&(clearTimeout(ec),ec=null);var s=()=>{try{var c=t.getState(),u=c.rootProps.accessibilityLayer!==!1;if(!u)return;var{keyboardInteraction:d}=c.tooltip,m=ng;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var f=nA(d,cf(c),Jm(c),tp(c)),v=f==null?-1:Number(f);if(!Number.isFinite(v)||v<0)return;var g=rs(c);if(m==="Enter"){var b=Ny(c,"axis","hover",String(d.index));t.dispatch(Ay({active:!d.active,activeIndex:d.index,activeCoordinate:b}));return}var w=Fpe(c),S=w==="left-to-right"?1:-1,E=m==="ArrowRight"?1:-1,O=v+E*S;if(g==null||O>=g.length||O<0)return;var j=Ny(c,"axis","hover",String(O));t.dispatch(Ay({active:!0,activeIndex:O.toString(),activeCoordinate:j}))}finally{Vu=null,ec=null}};if(!i){s();return}r==="raf"?Vu=requestAnimationFrame(s):typeof r=="number"&&ec===null&&(s(),ng=null,ec=setTimeout(()=>{ng?s():(ec=null,Vu=null)},r))}});fx.startListening({actionCreator:rq,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:a}=n.tooltip;if(!a.active&&a.index==null){var i="0",s=Ny(n,"axis","hover",String(i));t.dispatch(Ay({active:!0,activeIndex:i,activeCoordinate:s}))}}}});fx.startListening({actionCreator:aq,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:a}=n.tooltip;a.active&&t.dispatch(Ay({active:!1,activeIndex:a.index,activeCoordinate:a.coordinate}))}}});function iq(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var a=Reflect.get(n,r);return typeof a=="function"?a.bind(n):a}})}var Na=ma("externalEvent"),oq=zm(),rg=new Map,xh=new Map,HS=new Map;oq.startListening({actionCreator:Na,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var a=r.type,i=iq(r);HS.set(a,{handler:n,reactEvent:i});var s=rg.get(a);s!==void 0&&(cancelAnimationFrame(s),rg.delete(a));var c=t.getState(),{throttleDelay:u,throttledEvents:d}=c.eventSettings,m=d,f=m==="all"||(m==null?void 0:m.includes(a)),v=xh.get(a);v!==void 0&&(typeof u!="number"||!f)&&(clearTimeout(v),xh.delete(a));var g=()=>{var S=HS.get(a);try{if(!S)return;var{handler:E,reactEvent:O}=S,j=t.getState(),A={activeCoordinate:qve(j),activeDataKey:sA(j),activeIndex:ml(j),activeLabel:qH(j),activeTooltipIndex:ml(j),isTooltipActive:Kve(j)};E&&E(A,O)}finally{rg.delete(a),xh.delete(a),HS.delete(a)}};if(!f){g();return}if(u==="raf"){var b=requestAnimationFrame(g);rg.set(a,b)}else if(typeof u=="number"){if(!xh.has(a)){g();var w=setTimeout(g,u);xh.set(a,w)}}else g()}}});var ASe=se([sf],e=>e.tooltipItemPayloads),NSe=se([ASe,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(i=>i.settings.graphicalItemId===n);if(r!=null){var{getPosition:a}=r;if(a!=null)return a(t)}}}),sq=ma("touchMove"),lq=zm(),tc=null,Ls=null,X3=null,bh=null;lq.startListening({actionCreator:sq,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){bh=iq(n);var r=t.getState(),{throttleDelay:a,throttledEvents:i}=r.eventSettings,s=i==="all"||i.includes("touchmove");tc!==null&&(cancelAnimationFrame(tc),tc=null),Ls!==null&&(typeof a!="number"||!s)&&(clearTimeout(Ls),Ls=null),X3=Array.from(n.touches).map(u=>RA({clientX:u.clientX,clientY:u.clientY,currentTarget:n.currentTarget}));var c=()=>{if(bh!=null){var u=t.getState(),d=tA(u,u.tooltip.settings.shared);if(d==="axis"){var m,f=(m=X3)===null||m===void 0?void 0:m[0];if(f==null){tc=null,Ls=null;return}var v=kA(u,f);(v==null?void 0:v.activeIndex)!=null&&t.dispatch(MH({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(d==="item"){var g,b=bh.touches[0];if(document.elementFromPoint==null||b==null)return;var w=document.elementFromPoint(b.clientX,b.clientY);if(!w||!w.getAttribute)return;var S=w.getAttribute(x6),E=(g=w.getAttribute(b6))!==null&&g!==void 0?g:void 0,O=lf(u).find(N=>N.id===E);if(S==null||O==null||E==null)return;var{dataKey:j}=O,A=NSe(u,S,E);t.dispatch(TH({activeDataKey:j,activeIndex:S,activeCoordinate:A,activeGraphicalItemId:E}))}tc=null,Ls=null}};if(!s){c();return}a==="raf"?tc=requestAnimationFrame(c):typeof a=="number"&&Ls===null&&(c(),bh=null,Ls=setTimeout(()=>{bh?c():(Ls=null,tc=null)},a))}}});var DA={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},cq=br({name:"eventSettings",initialState:DA,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:TSe}=cq.actions,PSe=cq.reducer,MSe=U8({brush:wbe,cartesianAxis:rbe,chartData:qge,errorBars:bwe,eventSettings:PSe,graphicalItems:sxe,layout:kle,legend:Bce,options:$ge,polarAxis:b0e,polarOptions:OSe,referenceElements:jbe,renderedTicks:Hbe,rootProps:SSe,tooltip:tve,zIndex:Oge}),kSe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return ale({reducer:MSe,preloadedState:t,middleware:r=>{var a;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((a="es6")!==null&&a!==void 0?a:"")}).concat([ZF.middleware,JF.middleware,fx.middleware,oq.middleware,lq.middleware])},enhancers:r=>{var a=r;return typeof r=="function"&&(a=r()),a.concat(n6({type:"raf"}))},devTools:{serialize:{replacer:wSe},name:"recharts-".concat(n)}})};function uq(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,a=wr(),i=x.useRef(null);if(a)return n;i.current==null&&(i.current=kSe(t,r));var s=LC;return x.createElement(nue,{context:s,store:i.current},n)}function RSe(e){var{layout:t,margin:n}=e,r=kt(),a=wr();return x.useEffect(()=>{a||(r(Tle(t)),r(Nle(n)))},[r,a,t,n]),null}var dq=x.memo(RSe,ef);function fq(e){var t=kt();return x.useEffect(()=>{t(ESe(e))},[t,e]),null}var DSe=e=>{var t=kt();return x.useEffect(()=>{t(TSe(e))},[t,e]),null},hq=x.memo(DSe,ef);function W3(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),a=kt();return x.useLayoutEffect(()=>(r.current&&a(jge({zIndex:t,element:r.current,isPanorama:n})),()=>{a(Cge({zIndex:t,isPanorama:n}))}),[a,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function Q3(e){var{children:t,isPanorama:n}=e,r=Te(pge);if(!r||r.length===0)return t;var a=r.filter(s=>s<0),i=r.filter(s=>s>0);return x.createElement(x.Fragment,null,a.map(s=>x.createElement(W3,{key:s,zIndex:s,isPanorama:n})),t,i.map(s=>x.createElement(W3,{key:s,zIndex:s,isPanorama:n})))}var ISe=["children"];function LSe(e,t){if(e==null)return{};var n,r,a=zSe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function zSe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Iy(){return Iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iy.apply(null,arguments)}var $Se={width:"100%",height:"100%",display:"block"},BSe=x.forwardRef((e,t)=>{var n=GC(),r=XC(),a=$6();if(!qi(n)||!qi(r))return null;var{children:i,otherAttributes:s,title:c,desc:u}=e,d,m;return s!=null&&(typeof s.tabIndex=="number"?d=s.tabIndex:d=a?0:void 0,typeof s.role=="string"?m=s.role:m=a?"application":void 0),x.createElement(OC,Iy({},s,{title:c,desc:u,role:m,tabIndex:d,width:n,height:r,style:$Se,ref:t}),i)}),USe=e=>{var{children:t}=e,n=Te($0);if(!n)return null;var{width:r,height:a,y:i,x:s}=n;return x.createElement(OC,{width:r,height:a,x:s,y:i},t)},Z3=x.forwardRef((e,t)=>{var{children:n}=e,r=LSe(e,ISe),a=wr();return a?x.createElement(USe,null,x.createElement(Q3,{isPanorama:!0},n)):x.createElement(BSe,Iy({ref:t},r),x.createElement(Q3,{isPanorama:!1},n))});function HSe(){var e=kt(),[t,n]=x.useState(null),r=Te(Wle);return x.useEffect(()=>{if(t!=null){var a=t.getBoundingClientRect(),i=a.width/t.offsetWidth;ct(i)&&i!==r&&e(Mle(i))}},[t,e,r]),n}function J3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function FSe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J3(Object(n),!0).forEach(function(r){qSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qSe(e,t,n){return(t=KSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KSe(e){var t=VSe(e,"string");return typeof t=="symbol"?t:t+""}function VSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ol(){return ol=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ol.apply(null,arguments)}var YSe=()=>(Jge(),null);function Ly(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var GSe=x.forwardRef((e,t)=>{var n,r,a=x.useRef(null),[i,s]=x.useState({containerWidth:Ly((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Ly((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((d,m)=>{s(f=>{var v=Math.round(d),g=Math.round(m);return f.containerWidth===v&&f.containerHeight===g?f:{containerWidth:v,containerHeight:g}})},[]),u=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:m,height:f}=d.getBoundingClientRect();c(m,f);var v=b=>{var w=b[0];if(w!=null){var{width:S,height:E}=w.contentRect;c(S,E)}},g=new ResizeObserver(v);g.observe(d),a.current=g}},[t,c]);return x.useEffect(()=>()=>{var d=a.current;d!=null&&d.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(Bm,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",ol({ref:u},e)))}),XSe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[a,i]=x.useState({containerWidth:Ly(n),containerHeight:Ly(r)}),s=x.useCallback((u,d)=>{i(m=>{var f=Math.round(u),v=Math.round(d);return m.containerWidth===f&&m.containerHeight===v?m:{containerWidth:f,containerHeight:v}})},[]),c=x.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null){var{width:d,height:m}=u.getBoundingClientRect();s(d,m)}},[t,s]);return x.createElement(x.Fragment,null,x.createElement(Bm,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",ol({ref:c},e)))}),WSe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(Bm,{width:n,height:r}),x.createElement("div",ol({ref:t},e)))}),QSe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(XSe,ol({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(WSe,ol({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(Bm,{width:n,height:r}),x.createElement("div",ol({ref:t},e)))});function ZSe(e){return e?GSe:QSe}var JSe=x.forwardRef((e,t)=>{var{children:n,className:r,height:a,onClick:i,onContextMenu:s,onDoubleClick:c,onMouseDown:u,onMouseEnter:d,onMouseLeave:m,onMouseMove:f,onMouseUp:v,onTouchEnd:g,onTouchMove:b,onTouchStart:w,style:S,width:E,responsive:O,dispatchTouchEvents:j=!0}=e,A=x.useRef(null),N=kt(),[T,P]=x.useState(null),[R,D]=x.useState(null),K=HSe(),z=KC(),I=(z==null?void 0:z.width)>0?z.width:E,G=(z==null?void 0:z.height)>0?z.height:a,L=x.useCallback(re=>{K(re),typeof t=="function"&&t(re),P(re),D(re),re!=null&&(A.current=re)},[K,t,P,D]),Y=x.useCallback(re=>{N(QF(re)),N(Na({handler:i,reactEvent:re}))},[N,i]),k=x.useCallback(re=>{N(F_(re)),N(Na({handler:d,reactEvent:re}))},[N,d]),H=x.useCallback(re=>{N(PH()),N(Na({handler:m,reactEvent:re}))},[N,m]),q=x.useCallback(re=>{N(F_(re)),N(Na({handler:f,reactEvent:re}))},[N,f]),F=x.useCallback(()=>{N(rq())},[N]),V=x.useCallback(()=>{N(aq())},[N]),B=x.useCallback(re=>{N(nq(re.key))},[N]),$=x.useCallback(re=>{N(Na({handler:s,reactEvent:re}))},[N,s]),X=x.useCallback(re=>{N(Na({handler:c,reactEvent:re}))},[N,c]),Z=x.useCallback(re=>{N(Na({handler:u,reactEvent:re}))},[N,u]),ee=x.useCallback(re=>{N(Na({handler:v,reactEvent:re}))},[N,v]),le=x.useCallback(re=>{N(Na({handler:w,reactEvent:re}))},[N,w]),ie=x.useCallback(re=>{j&&N(sq(re)),N(Na({handler:b,reactEvent:re}))},[N,j,b]),ae=x.useCallback(re=>{N(Na({handler:g,reactEvent:re}))},[N,g]),J=ZSe(O);return x.createElement(ZH.Provider,{value:T},x.createElement(t8.Provider,{value:R},x.createElement(J,{width:I??(S==null?void 0:S.width),height:G??(S==null?void 0:S.height),className:dt("recharts-wrapper",r),style:FSe({position:"relative",cursor:"default",width:I,height:G},S),onClick:Y,onContextMenu:$,onDoubleClick:X,onFocus:F,onBlur:V,onKeyDown:B,onMouseDown:Z,onMouseEnter:k,onMouseLeave:H,onMouseMove:q,onMouseUp:ee,onTouchEnd:ae,onTouchMove:ie,onTouchStart:le,ref:L},x.createElement(YSe,null),n)))}),eEe=["width","height","responsive","children","className","style","compact","title","desc"];function tEe(e,t){if(e==null)return{};var n,r,a=nEe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function nEe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var mq=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:a,children:i,className:s,style:c,compact:u,title:d,desc:m}=e,f=tEe(e,eEe),v=ha(f);return u?x.createElement(x.Fragment,null,x.createElement(Bm,{width:n,height:r}),x.createElement(Z3,{otherAttributes:v,title:d,desc:m},i)):x.createElement(JSe,{className:s,style:c,width:n,height:r,responsive:a??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(Z3,{otherAttributes:v,title:d,desc:m,ref:t},x.createElement(Obe,null,i)))});function q_(){return q_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q_.apply(null,arguments)}function eL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rEe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eL(Object(n),!0).forEach(function(r){aEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aEe(e,t,n){return(t=iEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iEe(e){var t=oEe(e,"string");return typeof t=="symbol"?t:t+""}function oEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sEe={top:5,right:5,bottom:5,left:5},lEe=rEe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:sEe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},DA),pq=x.forwardRef(function(t,n){var r,a=Cn(t.categoricalChartProps,lEe),{chartName:i,defaultTooltipEventType:s,validateTooltipEventTypes:c,tooltipPayloadSearcher:u,categoricalChartProps:d}=t,m={chartName:i,defaultTooltipEventType:s,validateTooltipEventTypes:c,tooltipPayloadSearcher:u,eventEmitter:void 0};return x.createElement(uq,{preloadedState:{options:m},reduxStoreName:(r=d.id)!==null&&r!==void 0?r:i},x.createElement(TF,{chartData:d.data}),x.createElement(dq,{layout:a.layout,margin:a.margin}),x.createElement(hq,{throttleDelay:a.throttleDelay,throttledEvents:a.throttledEvents}),x.createElement(fq,{baseValue:a.baseValue,accessibilityLayer:a.accessibilityLayer,barCategoryGap:a.barCategoryGap,maxBarSize:a.maxBarSize,stackOffset:a.stackOffset,barGap:a.barGap,barSize:a.barSize,syncId:a.syncId,syncMethod:a.syncMethod,className:a.className,reverseStackOrder:a.reverseStackOrder}),x.createElement(mq,q_({},a,{ref:n})))}),cEe=["axis"],uEe=x.forwardRef((e,t)=>x.createElement(pq,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:cEe,tooltipPayloadSearcher:fA,categoricalChartProps:e,ref:t})),dEe=["axis","item"],fEe=x.forwardRef((e,t)=>x.createElement(pq,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:dEe,tooltipPayloadSearcher:fA,categoricalChartProps:e,ref:t}));function hEe(e){var t=kt();return x.useEffect(()=>{t(CSe(e))},[t,e]),null}var mEe=["layout"];function K_(){return K_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K_.apply(null,arguments)}function pEe(e,t){if(e==null)return{};var n,r,a=vEe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function vEe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function tL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gEe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tL(Object(n),!0).forEach(function(r){yEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yEe(e,t,n){return(t=xEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xEe(e){var t=bEe(e,"string");return typeof t=="symbol"?t:t+""}function bEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wEe={top:5,right:5,bottom:5,left:5},vq=gEe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:wEe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},DA),SEe=x.forwardRef(function(t,n){var r,a=Cn(t.categoricalChartProps,vq),{layout:i}=a,s=pEe(a,mEe),{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:d,tooltipPayloadSearcher:m}=t,f={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:d,tooltipPayloadSearcher:m,eventEmitter:void 0};return x.createElement(uq,{preloadedState:{options:f},reduxStoreName:(r=a.id)!==null&&r!==void 0?r:c},x.createElement(TF,{chartData:a.data}),x.createElement(dq,{layout:i,margin:a.margin}),x.createElement(hq,{throttleDelay:a.throttleDelay,throttledEvents:a.throttledEvents}),x.createElement(fq,{baseValue:void 0,accessibilityLayer:a.accessibilityLayer,barCategoryGap:a.barCategoryGap,maxBarSize:a.maxBarSize,stackOffset:a.stackOffset,barGap:a.barGap,barSize:a.barSize,syncId:a.syncId,syncMethod:a.syncMethod,className:a.className,reverseStackOrder:a.reverseStackOrder}),x.createElement(hEe,{cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius}),x.createElement(mq,K_({},s,{ref:n})))});function nL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nL(Object(n),!0).forEach(function(r){EEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EEe(e,t,n){return(t=_Ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Ee(e){var t=jEe(e,"string");return typeof t=="symbol"?t:t+""}function jEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CEe=["item"],OEe=rL(rL({},vq),{},{layout:"centric",startAngle:0,endAngle:360}),AEe=x.forwardRef((e,t)=>{var n=Cn(e,OEe);return x.createElement(SEe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:CEe,tooltipPayloadSearcher:fA,categoricalChartProps:n,ref:t})});function NEe({completed:e,failed:t}){const n=e+t;if(n===0)return p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"relative h-32 w-32",children:[p.jsx("svg",{viewBox:"0 0 100 100",className:"h-full w-full",children:p.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"12"})}),p.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:p.jsx("span",{className:"text-sm text-muted-foreground",children:"N/A"})})]})});const r=Math.round(e/n*1e3)/10,a=[{name:"Completed",value:e},{name:"Failed",value:t}],i=["#2e7d32","#c62828"];return p.jsxs("div",{className:"relative flex h-full items-center justify-center",children:[p.jsx(VC,{width:140,height:140,children:p.jsx(AEe,{children:p.jsx(OF,{data:a,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:a.map((s,c)=>p.jsx(rp,{fill:i[c]},c))})})}),p.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:p.jsxs("span",{className:"text-lg font-semibold",children:[r,"%"]})})]})}function aL(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function TEe({data:e}){return e.some(n=>n.total>0)?p.jsx(VC,{width:"100%",height:280,children:p.jsxs(fEe,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[p.jsx(OA,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),p.jsx(PA,{dataKey:"date",tickFormatter:aL,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),p.jsx(MA,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),p.jsx(tF,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>aL(String(n))}),p.jsx(L6,{wrapperStyle:{fontSize:12,paddingTop:8}}),p.jsx(z_,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),p.jsx(z_,{dataKey:"failed",name:"Failed",stackId:"a",fill:"#c62828",radius:[2,2,0,0]})]})}):p.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"})}function iL(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function PEe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function MEe({data:e}){if(e.filter(r=>r.avg_duration_ms!==null).length===0)return p.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"});const n=e.map(r=>({...r,avg_minutes:r.avg_duration_ms!==null?r.avg_duration_ms/6e4:null}));return p.jsx(VC,{width:"100%",height:280,children:p.jsxs(uEe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[p.jsx(OA,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),p.jsx(PA,{dataKey:"date",tickFormatter:iL,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),p.jsx(MA,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),p.jsx(tF,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>iL(String(r)),formatter:r=>[PEe(Number(r)*6e4),"Avg Duration"]}),p.jsx(KF,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const kEe=["7d","30d","90d"];function REe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function DEe({projectId:e}){const[t,n]=x.useState("30d"),{data:r,isLoading:a}=wie(e,t);return a?p.jsxs("div",{className:"space-y-4",children:[p.jsx(cn,{className:"h-8 w-48"}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsx(cn,{className:"h-32"}),p.jsx(cn,{className:"h-32"}),p.jsx(cn,{className:"h-32"})]}),p.jsx(cn,{className:"h-72"})]}):r?p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"flex gap-1",children:kEe.map(i=>p.jsx(Ee,{size:"sm",variant:t===i?"default":"outline",onClick:()=>n(i),children:i},i))}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsxs(sn,{children:[p.jsx(lh,{className:"pb-2",children:p.jsx(ch,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),p.jsxs(ln,{children:[p.jsx("div",{className:"text-3xl font-bold",children:r.total_runs}),p.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[r.completed," completed · ",r.failed," failed"]})]})]}),p.jsxs(sn,{children:[p.jsx(lh,{className:"pb-2",children:p.jsx(ch,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),p.jsx(ln,{className:"h-36",children:p.jsx(NEe,{completed:r.completed,failed:r.failed})})]}),p.jsxs(sn,{children:[p.jsx(lh,{className:"pb-2",children:p.jsx(ch,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),p.jsxs(ln,{children:[p.jsx("div",{className:"text-3xl font-bold",children:REe(r.avg_duration_ms)}),p.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),p.jsxs(sn,{children:[p.jsx(lh,{children:p.jsx(ch,{className:"text-base",children:"Run Frequency"})}),p.jsx(ln,{children:p.jsx(TEe,{data:r.daily})})]}),p.jsxs(sn,{children:[p.jsx(lh,{children:p.jsx(ch,{className:"text-base",children:"Duration Trends"})}),p.jsx(ln,{children:p.jsx(MEe,{data:r.daily})})]})]}):null}function IA({className:e,orientation:t="horizontal",...n}){return p.jsx(lee,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Ce("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const IEe=w0("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function LA({className:e,variant:t="default",...n}){return p.jsx(cee,{"data-slot":"tabs-list","data-variant":t,className:Ce(IEe({variant:t}),e),...n})}function oa({className:e,...t}){return p.jsx(uee,{"data-slot":"tabs-trigger",className:Ce("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function sa({className:e,...t}){return p.jsx(dee,{"data-slot":"tabs-content",className:Ce("flex-1 outline-none",e),...t})}function LEe(){return p.jsxs("div",{className:"space-y-6",children:[p.jsx(cn,{className:"h-8 w-48"}),p.jsx(cn,{className:"h-24 rounded-lg"}),p.jsx(cn,{className:"h-64 rounded-lg"})]})}function zEe({projectId:e,conversationId:t,title:n,fallback:r}){const[a,i]=x.useState(!1),[s,c]=x.useState(""),u=x.useRef(null),d=yC(e);function m(g){g.stopPropagation(),c(n??""),i(!0),setTimeout(()=>{var b;return(b=u.current)==null?void 0:b.select()},0)}function f(g){g.stopPropagation();const b=s.trim();d.mutate({conversationId:t,title:b||null}),i(!1)}function v(g){g.key==="Enter"&&(g.preventDefault(),f(g)),g.key==="Escape"&&(g.stopPropagation(),i(!1))}return a?p.jsx(Ze,{ref:u,value:s,onChange:g=>c(g.target.value),onBlur:f,onKeyDown:v,onClick:g=>g.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:r}):p.jsxs("div",{className:"flex items-center gap-1.5 group",children:[p.jsx("span",{className:"font-medium",children:n??r}),p.jsx(Ee,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:m,"aria-label":"Rename",children:p.jsx(fC,{className:"h-3 w-3"})})]})}function $Ee({projectId:e,conversationId:t,label:n}){const[r,a]=x.useState(!1),i=TB(e);return r?p.jsxs("div",{className:"flex justify-end gap-1",onClick:s=>s.stopPropagation(),children:[p.jsx(Ee,{size:"sm",variant:"destructive",disabled:i.isPending,onClick:s=>{s.stopPropagation(),i.mutate(t,{onSuccess:()=>a(!1),onError:()=>a(!1)})},children:"Confirm"}),p.jsx(Ee,{size:"sm",variant:"outline",onClick:s=>{s.stopPropagation(),a(!1)},children:"No"})]}):p.jsx(Ee,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:s=>{s.stopPropagation(),a(!0)},"aria-label":`Delete ${n}`,children:p.jsx(Sl,{className:"h-3.5 w-3.5"})})}const oL={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function BEe(){var K,z,I;const{projectId:e}=Gy(),t=Number(e),n=gl(),r=pC(t),[a,i]=x.useState(1),[s]=x.useState(1),c=Cre(t,a),u=GB(t),d=AB(t,s),m=NB(),[f,v]=x.useState(!1),[g,b]=x.useState(!1),[w,S]=x.useState("conversations"),E=r.isLoading||c.isLoading,O=r.error||c.error;if(E)return p.jsx(LEe,{});if(O)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",O.message]})]});if(!r.data)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsx("span",{children:"Project not found"})]});const j=r.data,A=c.data,N=(A==null?void 0:A.items)??[],T=(A==null?void 0:A.total)??0,P=A?Math.ceil(A.total/A.per_page):0,R=u.data??[],D=R.reduce((G,L)=>(G[L.type]=(G[L.type]||0)+1,G),{});return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:j.display_name}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(Ee,{disabled:!j.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:G=>n(`/projects/${t}/conversations/${G.id}`)})},children:[p.jsx(vB,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),p.jsxs(Ee,{variant:"outline",onClick:()=>v(!0),disabled:!j.dir_exists,children:[p.jsx(hC,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),p.jsxs(Ee,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[p.jsx(y0,{className:"mr-2 h-4 w-4"}),"Install Resource"]}),p.jsx(Ee,{variant:"outline",asChild:!0,children:p.jsxs(gr,{to:"/projects",children:[p.jsx(cC,{className:"mr-2 h-4 w-4"}),"Back"]})})]})]}),p.jsx(sn,{children:p.jsx(ln,{className:"pt-6",children:p.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Directory"}),p.jsxs("dd",{className:"flex items-center gap-2 break-all",children:[j.working_dir,j.dir_exists?p.jsx(qt,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):p.jsx(qt,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})]}),p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Created"}),p.jsx("dd",{children:new Date(j.created_at).toLocaleString()}),p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),p.jsx("dd",{children:R.length===0?p.jsx("span",{className:"text-sm text-muted-foreground",children:"None installed"}):p.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(D).map(([G,L])=>p.jsxs(qt,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[L," ",L===1?oL[G]??G:`${oL[G]??G}s`]},G))})})]})})}),p.jsx(Wae,{projectId:t,open:f,onOpenChange:v}),p.jsx(jC,{open:g,onOpenChange:b,projectId:t}),p.jsxs(IA,{value:w,onValueChange:S,children:[p.jsxs(LA,{children:[p.jsxs(oa,{value:"conversations",children:["Conversations (",((K=d.data)==null?void 0:K.total)??0,")"]}),p.jsxs(oa,{value:"sessions",children:["Sessions (",T,")"]}),p.jsx(oa,{value:"activity",children:"Activity"}),p.jsxs(oa,{value:"resources",children:["Resources (",R.length,")"]}),p.jsx(oa,{value:"files",children:"Files"})]}),p.jsx(sa,{value:"sessions",className:"mt-4 space-y-3",children:T===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):p.jsxs(p.Fragment,{children:[p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsx(qE,{sessions:N})})}),p.jsx(Yae,{page:a,totalPages:P,onPageChange:i})]})}),p.jsx(sa,{value:"conversations",className:"mt-4 space-y-3",children:(((z=d.data)==null?void 0:z.items)??[]).length===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:'No conversations yet. Click "New Conversation" to start one.'}):p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[p.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),p.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),p.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),p.jsx("th",{className:"px-4 py-2"})]})}),p.jsx("tbody",{children:(((I=d.data)==null?void 0:I.items)??[]).map(G=>p.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>n(`/projects/${t}/conversations/${G.id}`),children:[p.jsx("td",{className:"px-4 py-2",children:p.jsx(zEe,{projectId:t,conversationId:G.id,title:G.title,fallback:`Conversation #${G.id}`})}),p.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:G.session_count}),p.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:G.last_activity?new Date(G.last_activity).toLocaleString():"—"}),p.jsx("td",{className:"px-4 py-2 text-right",children:p.jsx($Ee,{projectId:t,conversationId:G.id,label:G.title??`Conversation #${G.id}`})})]},G.id))})]})})})}),p.jsx(sa,{value:"activity",className:"mt-4",children:p.jsx(DEe,{projectId:t})}),p.jsx(sa,{value:"resources",className:"mt-4",children:p.jsx(xie,{projectId:t,installOpen:g,onInstallOpenChange:b})}),p.jsx(sa,{value:"files",className:"mt-4",children:p.jsx(Zae,{projectId:t})})]})]})}function On(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=On(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var UEe={value:()=>{}};function hx(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new jg(n)}function jg(e){this._=e}function HEe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}jg.prototype=hx.prototype={constructor:jg,on:function(e,t){var n=this._,r=HEe(e+"",n),a,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((a=(e=r[i]).type)&&(a=FEe(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(a=(e=r[i]).type)n[a]=sL(n[a],e.name,t);else if(t==null)for(a in n)n[a]=sL(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new jg(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,i;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};function FEe(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function sL(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=UEe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var V_="http://www.w3.org/1999/xhtml";const lL={svg:"http://www.w3.org/2000/svg",xhtml:V_,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function mx(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),lL.hasOwnProperty(t)?{space:lL[t],local:e}:e}function qEe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===V_&&t.documentElement.namespaceURI===V_?t.createElement(e):t.createElementNS(n,e)}}function KEe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gq(e){var t=mx(e);return(t.local?KEe:qEe)(t)}function VEe(){}function zA(e){return e==null?VEe:function(){return this.querySelector(e)}}function YEe(e){typeof e!="function"&&(e=zA(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,c=r[a]=new Array(s),u,d,m=0;m<s;++m)(u=i[m])&&(d=e.call(u,u.__data__,m,i))&&("__data__"in u&&(d.__data__=u.__data__),c[m]=d);return new va(r,this._parents)}function GEe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function XEe(){return[]}function yq(e){return e==null?XEe:function(){return this.querySelectorAll(e)}}function WEe(e){return function(){return GEe(e.apply(this,arguments))}}function QEe(e){typeof e=="function"?e=WEe(e):e=yq(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var s=t[i],c=s.length,u,d=0;d<c;++d)(u=s[d])&&(r.push(e.call(u,u.__data__,d,s)),a.push(u));return new va(r,a)}function xq(e){return function(){return this.matches(e)}}function bq(e){return function(t){return t.matches(e)}}var ZEe=Array.prototype.find;function JEe(e){return function(){return ZEe.call(this.children,e)}}function e_e(){return this.firstElementChild}function t_e(e){return this.select(e==null?e_e:JEe(typeof e=="function"?e:bq(e)))}var n_e=Array.prototype.filter;function r_e(){return Array.from(this.children)}function a_e(e){return function(){return n_e.call(this.children,e)}}function i_e(e){return this.selectAll(e==null?r_e:a_e(typeof e=="function"?e:bq(e)))}function o_e(e){typeof e!="function"&&(e=xq(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,c=r[a]=[],u,d=0;d<s;++d)(u=i[d])&&e.call(u,u.__data__,d,i)&&c.push(u);return new va(r,this._parents)}function wq(e){return new Array(e.length)}function s_e(){return new va(this._enter||this._groups.map(wq),this._parents)}function zy(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}zy.prototype={constructor:zy,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function l_e(e){return function(){return e}}function c_e(e,t,n,r,a,i){for(var s=0,c,u=t.length,d=i.length;s<d;++s)(c=t[s])?(c.__data__=i[s],r[s]=c):n[s]=new zy(e,i[s]);for(;s<u;++s)(c=t[s])&&(a[s]=c)}function u_e(e,t,n,r,a,i,s){var c,u,d=new Map,m=t.length,f=i.length,v=new Array(m),g;for(c=0;c<m;++c)(u=t[c])&&(v[c]=g=s.call(u,u.__data__,c,t)+"",d.has(g)?a[c]=u:d.set(g,u));for(c=0;c<f;++c)g=s.call(e,i[c],c,i)+"",(u=d.get(g))?(r[c]=u,u.__data__=i[c],d.delete(g)):n[c]=new zy(e,i[c]);for(c=0;c<m;++c)(u=t[c])&&d.get(v[c])===u&&(a[c]=u)}function d_e(e){return e.__data__}function f_e(e,t){if(!arguments.length)return Array.from(this,d_e);var n=t?u_e:c_e,r=this._parents,a=this._groups;typeof e!="function"&&(e=l_e(e));for(var i=a.length,s=new Array(i),c=new Array(i),u=new Array(i),d=0;d<i;++d){var m=r[d],f=a[d],v=f.length,g=h_e(e.call(m,m&&m.__data__,d,r)),b=g.length,w=c[d]=new Array(b),S=s[d]=new Array(b),E=u[d]=new Array(v);n(m,f,w,S,E,g,t);for(var O=0,j=0,A,N;O<b;++O)if(A=w[O]){for(O>=j&&(j=O+1);!(N=S[j])&&++j<b;);A._next=N||null}}return s=new va(s,r),s._enter=c,s._exit=u,s}function h_e(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function m_e(){return new va(this._exit||this._groups.map(wq),this._parents)}function p_e(e,t,n){var r=this.enter(),a=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),r&&a?r.merge(a).order():a}function v_e(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,s=Math.min(a,i),c=new Array(a),u=0;u<s;++u)for(var d=n[u],m=r[u],f=d.length,v=c[u]=new Array(f),g,b=0;b<f;++b)(g=d[b]||m[b])&&(v[b]=g);for(;u<a;++u)c[u]=n[u];return new va(c,this._parents)}function g_e(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,i=r[a],s;--a>=0;)(s=r[a])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function y_e(e){e||(e=x_e);function t(f,v){return f&&v?e(f.__data__,v.__data__):!f-!v}for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var s=n[i],c=s.length,u=a[i]=new Array(c),d,m=0;m<c;++m)(d=s[m])&&(u[m]=d);u.sort(t)}return new va(a,this._parents).order()}function x_e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function b_e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function w_e(){return Array.from(this)}function S_e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var s=r[a];if(s)return s}return null}function E_e(){let e=0;for(const t of this)++e;return e}function __e(){return!this.node()}function j_e(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],i=0,s=a.length,c;i<s;++i)(c=a[i])&&e.call(c,c.__data__,i,a);return this}function C_e(e){return function(){this.removeAttribute(e)}}function O_e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function A_e(e,t){return function(){this.setAttribute(e,t)}}function N_e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function T_e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function P_e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function M_e(e,t){var n=mx(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?O_e:C_e:typeof t=="function"?n.local?P_e:T_e:n.local?N_e:A_e)(n,t))}function Sq(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function k_e(e){return function(){this.style.removeProperty(e)}}function R_e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function D_e(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function I_e(e,t,n){return arguments.length>1?this.each((t==null?k_e:typeof t=="function"?D_e:R_e)(e,t,n??"")):Rd(this.node(),e)}function Rd(e,t){return e.style.getPropertyValue(t)||Sq(e).getComputedStyle(e,null).getPropertyValue(t)}function L_e(e){return function(){delete this[e]}}function z_e(e,t){return function(){this[e]=t}}function $_e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function B_e(e,t){return arguments.length>1?this.each((t==null?L_e:typeof t=="function"?$_e:z_e)(e,t)):this.node()[e]}function Eq(e){return e.trim().split(/^|\s+/)}function $A(e){return e.classList||new _q(e)}function _q(e){this._node=e,this._names=Eq(e.getAttribute("class")||"")}_q.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function jq(e,t){for(var n=$A(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function Cq(e,t){for(var n=$A(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function U_e(e){return function(){jq(this,e)}}function H_e(e){return function(){Cq(this,e)}}function F_e(e,t){return function(){(t.apply(this,arguments)?jq:Cq)(this,e)}}function q_e(e,t){var n=Eq(e+"");if(arguments.length<2){for(var r=$A(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?F_e:t?U_e:H_e)(n,t))}function K_e(){this.textContent=""}function V_e(e){return function(){this.textContent=e}}function Y_e(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function G_e(e){return arguments.length?this.each(e==null?K_e:(typeof e=="function"?Y_e:V_e)(e)):this.node().textContent}function X_e(){this.innerHTML=""}function W_e(e){return function(){this.innerHTML=e}}function Q_e(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Z_e(e){return arguments.length?this.each(e==null?X_e:(typeof e=="function"?Q_e:W_e)(e)):this.node().innerHTML}function J_e(){this.nextSibling&&this.parentNode.appendChild(this)}function eje(){return this.each(J_e)}function tje(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nje(){return this.each(tje)}function rje(e){var t=typeof e=="function"?e:gq(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function aje(){return null}function ije(e,t){var n=typeof e=="function"?e:gq(e),r=t==null?aje:typeof t=="function"?t:zA(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function oje(){var e=this.parentNode;e&&e.removeChild(this)}function sje(){return this.each(oje)}function lje(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cje(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uje(e){return this.select(e?cje:lje)}function dje(e){return arguments.length?this.property("__data__",e):this.node().__data__}function fje(e){return function(t){e.call(this,t,this.__data__)}}function hje(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function mje(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function pje(e,t,n){return function(){var r=this.__on,a,i=fje(t);if(r){for(var s=0,c=r.length;s<c;++s)if((a=r[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(a):this.__on=[a]}}function vje(e,t,n){var r=hje(e+""),a,i=r.length,s;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,d=c.length,m;u<d;++u)for(a=0,m=c[u];a<i;++a)if((s=r[a]).type===m.type&&s.name===m.name)return m.value}return}for(c=t?pje:mje,a=0;a<i;++a)this.each(c(r[a],t,n));return this}function Oq(e,t,n){var r=Sq(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function gje(e,t){return function(){return Oq(this,e,t)}}function yje(e,t){return function(){return Oq(this,e,t.apply(this,arguments))}}function xje(e,t){return this.each((typeof t=="function"?yje:gje)(e,t))}function*bje(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length,s;a<i;++a)(s=r[a])&&(yield s)}var Aq=[null];function va(e,t){this._groups=e,this._parents=t}function ip(){return new va([[document.documentElement]],Aq)}function wje(){return this}va.prototype=ip.prototype={constructor:va,select:YEe,selectAll:QEe,selectChild:t_e,selectChildren:i_e,filter:o_e,data:f_e,enter:s_e,exit:m_e,join:p_e,merge:v_e,selection:wje,order:g_e,sort:y_e,call:b_e,nodes:w_e,node:S_e,size:E_e,empty:__e,each:j_e,attr:M_e,style:I_e,property:B_e,classed:q_e,text:G_e,html:Z_e,raise:eje,lower:nje,append:rje,insert:ije,remove:sje,clone:uje,datum:dje,on:vje,dispatch:xje,[Symbol.iterator]:bje};function ca(e){return typeof e=="string"?new va([[document.querySelector(e)]],[document.documentElement]):new va([[e]],Aq)}function Sje(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Za(e,t){if(e=Sje(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const Eje={passive:!1},sm={capture:!0,passive:!1};function FS(e){e.stopImmediatePropagation()}function sd(e){e.preventDefault(),e.stopImmediatePropagation()}function Nq(e){var t=e.document.documentElement,n=ca(e).on("dragstart.drag",sd,sm);"onselectstart"in t?n.on("selectstart.drag",sd,sm):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Tq(e,t){var n=e.document.documentElement,r=ca(e).on("dragstart.drag",null);t&&(r.on("click.drag",sd,sm),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ag=e=>()=>e;function Y_(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:i,x:s,y:c,dx:u,dy:d,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}Y_.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function _je(e){return!e.ctrlKey&&!e.button}function jje(){return this.parentNode}function Cje(e,t){return t??{x:e.x,y:e.y}}function Oje(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pq(){var e=_je,t=jje,n=Cje,r=Oje,a={},i=hx("start","drag","end"),s=0,c,u,d,m,f=0;function v(A){A.on("mousedown.drag",g).filter(r).on("touchstart.drag",S).on("touchmove.drag",E,Eje).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(A,N){if(!(m||!e.call(this,A,N))){var T=j(this,t.call(this,A,N),A,N,"mouse");T&&(ca(A.view).on("mousemove.drag",b,sm).on("mouseup.drag",w,sm),Nq(A.view),FS(A),d=!1,c=A.clientX,u=A.clientY,T("start",A))}}function b(A){if(sd(A),!d){var N=A.clientX-c,T=A.clientY-u;d=N*N+T*T>f}a.mouse("drag",A)}function w(A){ca(A.view).on("mousemove.drag mouseup.drag",null),Tq(A.view,d),sd(A),a.mouse("end",A)}function S(A,N){if(e.call(this,A,N)){var T=A.changedTouches,P=t.call(this,A,N),R=T.length,D,K;for(D=0;D<R;++D)(K=j(this,P,A,N,T[D].identifier,T[D]))&&(FS(A),K("start",A,T[D]))}}function E(A){var N=A.changedTouches,T=N.length,P,R;for(P=0;P<T;++P)(R=a[N[P].identifier])&&(sd(A),R("drag",A,N[P]))}function O(A){var N=A.changedTouches,T=N.length,P,R;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),P=0;P<T;++P)(R=a[N[P].identifier])&&(FS(A),R("end",A,N[P]))}function j(A,N,T,P,R,D){var K=i.copy(),z=Za(D||T,N),I,G,L;if((L=n.call(A,new Y_("beforestart",{sourceEvent:T,target:v,identifier:R,active:s,x:z[0],y:z[1],dx:0,dy:0,dispatch:K}),P))!=null)return I=L.x-z[0]||0,G=L.y-z[1]||0,function Y(k,H,q){var F=z,V;switch(k){case"start":a[R]=Y,V=s++;break;case"end":delete a[R],--s;case"drag":z=Za(q||H,N),V=s;break}K.call(k,A,new Y_(k,{sourceEvent:H,subject:L,target:v,identifier:R,active:V,x:z[0]+I,y:z[1]+G,dx:z[0]-F[0],dy:z[1]-F[1],dispatch:K}),P)}}return v.filter=function(A){return arguments.length?(e=typeof A=="function"?A:ag(!!A),v):e},v.container=function(A){return arguments.length?(t=typeof A=="function"?A:ag(A),v):t},v.subject=function(A){return arguments.length?(n=typeof A=="function"?A:ag(A),v):n},v.touchable=function(A){return arguments.length?(r=typeof A=="function"?A:ag(!!A),v):r},v.on=function(){var A=i.on.apply(i,arguments);return A===i?v:A},v.clickDistance=function(A){return arguments.length?(f=(A=+A)*A,v):Math.sqrt(f)},v}var Dd=0,Th=0,wh=0,Mq=1e3,$y,Ph,By=0,qc=0,px=0,lm=typeof performance=="object"&&performance.now?performance:Date,kq=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function BA(){return qc||(kq(Aje),qc=lm.now()+px)}function Aje(){qc=0}function Uy(){this._call=this._time=this._next=null}Uy.prototype=Rq.prototype={constructor:Uy,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?BA():+n)+(t==null?0:+t),!this._next&&Ph!==this&&(Ph?Ph._next=this:$y=this,Ph=this),this._call=e,this._time=n,G_()},stop:function(){this._call&&(this._call=null,this._time=1/0,G_())}};function Rq(e,t,n){var r=new Uy;return r.restart(e,t,n),r}function Nje(){BA(),++Dd;for(var e=$y,t;e;)(t=qc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Dd}function cL(){qc=(By=lm.now())+px,Dd=Th=0;try{Nje()}finally{Dd=0,Pje(),qc=0}}function Tje(){var e=lm.now(),t=e-By;t>Mq&&(px-=t,By=e)}function Pje(){for(var e,t=$y,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$y=n);Ph=e,G_(r)}function G_(e){if(!Dd){Th&&(Th=clearTimeout(Th));var t=e-qc;t>24?(e<1/0&&(Th=setTimeout(cL,e-lm.now()-px)),wh&&(wh=clearInterval(wh))):(wh||(By=lm.now(),wh=setInterval(Tje,Mq)),Dd=1,kq(cL))}}function uL(e,t,n){var r=new Uy;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var Mje=hx("start","end","cancel","interrupt"),kje=[],Dq=0,dL=1,X_=2,Cg=3,fL=4,W_=5,Og=6;function vx(e,t,n,r,a,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Rje(e,n,{name:t,index:r,group:a,on:Mje,tween:kje,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Dq})}function UA(e,t){var n=pi(e,t);if(n.state>Dq)throw new Error("too late; already scheduled");return n}function Xi(e,t){var n=pi(e,t);if(n.state>Cg)throw new Error("too late; already running");return n}function pi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Rje(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=Rq(i,0,n.time);function i(d){n.state=dL,n.timer.restart(s,n.delay,n.time),n.delay<=d&&s(d-n.delay)}function s(d){var m,f,v,g;if(n.state!==dL)return u();for(m in r)if(g=r[m],g.name===n.name){if(g.state===Cg)return uL(s);g.state===fL?(g.state=Og,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[m]):+m<t&&(g.state=Og,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[m])}if(uL(function(){n.state===Cg&&(n.state=fL,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=X_,n.on.call("start",e,e.__data__,n.index,n.group),n.state===X_){for(n.state=Cg,a=new Array(v=n.tween.length),m=0,f=-1;m<v;++m)(g=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(a[++f]=g);a.length=f+1}}function c(d){for(var m=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=W_,1),f=-1,v=a.length;++f<v;)a[f].call(e,m);n.state===W_&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Og,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Ag(e,t){var n=e.__transition,r,a,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}a=r.state>X_&&r.state<W_,r.state=Og,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Dje(e){return this.each(function(){Ag(this,e)})}function Ije(e,t){var n,r;return function(){var a=Xi(this,e),i=a.tween;if(i!==n){r=n=i;for(var s=0,c=r.length;s<c;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}a.tween=r}}function Lje(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=Xi(this,e),s=i.tween;if(s!==r){a=(r=s).slice();for(var c={name:t,value:n},u=0,d=a.length;u<d;++u)if(a[u].name===t){a[u]=c;break}u===d&&a.push(c)}i.tween=a}}function zje(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=pi(this.node(),n).tween,a=0,i=r.length,s;a<i;++a)if((s=r[a]).name===e)return s.value;return null}return this.each((t==null?Ije:Lje)(n,e,t))}function HA(e,t,n){var r=e._id;return e.each(function(){var a=Xi(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return pi(a,r).value[t]}}function Iq(e,t){var n;return(typeof t=="number"?Ja:t instanceof Hc?xy:(n=Hc(t))?(t=n,xy):jU)(e,t)}function $je(e){return function(){this.removeAttribute(e)}}function Bje(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Uje(e,t,n){var r,a=n+"",i;return function(){var s=this.getAttribute(e);return s===a?null:s===r?i:i=t(r=s,n)}}function Hje(e,t,n){var r,a=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===a?null:s===r?i:i=t(r=s,n)}}function Fje(e,t,n){var r,a,i;return function(){var s,c=n(this),u;return c==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=c+"",s===u?null:s===r&&u===a?i:(a=u,i=t(r=s,c)))}}function qje(e,t,n){var r,a,i;return function(){var s,c=n(this),u;return c==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=c+"",s===u?null:s===r&&u===a?i:(a=u,i=t(r=s,c)))}}function Kje(e,t){var n=mx(e),r=n==="transform"?Kfe:Iq;return this.attrTween(e,typeof t=="function"?(n.local?qje:Fje)(n,r,HA(this,"attr."+e,t)):t==null?(n.local?Bje:$je)(n):(n.local?Hje:Uje)(n,r,t))}function Vje(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Yje(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Gje(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Yje(e,i)),n}return a._value=t,a}function Xje(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Vje(e,i)),n}return a._value=t,a}function Wje(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=mx(e);return this.tween(n,(r.local?Gje:Xje)(r,t))}function Qje(e,t){return function(){UA(this,e).delay=+t.apply(this,arguments)}}function Zje(e,t){return t=+t,function(){UA(this,e).delay=t}}function Jje(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Qje:Zje)(t,e)):pi(this.node(),t).delay}function eCe(e,t){return function(){Xi(this,e).duration=+t.apply(this,arguments)}}function tCe(e,t){return t=+t,function(){Xi(this,e).duration=t}}function nCe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eCe:tCe)(t,e)):pi(this.node(),t).duration}function rCe(e,t){if(typeof t!="function")throw new Error;return function(){Xi(this,e).ease=t}}function aCe(e){var t=this._id;return arguments.length?this.each(rCe(t,e)):pi(this.node(),t).ease}function iCe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xi(this,e).ease=n}}function oCe(e){if(typeof e!="function")throw new Error;return this.each(iCe(this._id,e))}function sCe(e){typeof e!="function"&&(e=xq(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],s=i.length,c=r[a]=[],u,d=0;d<s;++d)(u=i[d])&&e.call(u,u.__data__,d,i)&&c.push(u);return new Go(r,this._parents,this._name,this._id)}function lCe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),s=new Array(r),c=0;c<i;++c)for(var u=t[c],d=n[c],m=u.length,f=s[c]=new Array(m),v,g=0;g<m;++g)(v=u[g]||d[g])&&(f[g]=v);for(;c<r;++c)s[c]=t[c];return new Go(s,this._parents,this._name,this._id)}function cCe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function uCe(e,t,n){var r,a,i=cCe(t)?UA:Xi;return function(){var s=i(this,e),c=s.on;c!==r&&(a=(r=c).copy()).on(t,n),s.on=a}}function dCe(e,t){var n=this._id;return arguments.length<2?pi(this.node(),n).on.on(e):this.each(uCe(n,e,t))}function fCe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function hCe(){return this.on("end.remove",fCe(this._id))}function mCe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=zA(e));for(var r=this._groups,a=r.length,i=new Array(a),s=0;s<a;++s)for(var c=r[s],u=c.length,d=i[s]=new Array(u),m,f,v=0;v<u;++v)(m=c[v])&&(f=e.call(m,m.__data__,v,c))&&("__data__"in m&&(f.__data__=m.__data__),d[v]=f,vx(d[v],t,n,v,d,pi(m,n)));return new Go(i,this._parents,t,n)}function pCe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=yq(e));for(var r=this._groups,a=r.length,i=[],s=[],c=0;c<a;++c)for(var u=r[c],d=u.length,m,f=0;f<d;++f)if(m=u[f]){for(var v=e.call(m,m.__data__,f,u),g,b=pi(m,n),w=0,S=v.length;w<S;++w)(g=v[w])&&vx(g,t,n,w,v,b);i.push(v),s.push(m)}return new Go(i,s,t,n)}var vCe=ip.prototype.constructor;function gCe(){return new vCe(this._groups,this._parents)}function yCe(e,t){var n,r,a;return function(){var i=Rd(this,e),s=(this.style.removeProperty(e),Rd(this,e));return i===s?null:i===n&&s===r?a:a=t(n=i,r=s)}}function Lq(e){return function(){this.style.removeProperty(e)}}function xCe(e,t,n){var r,a=n+"",i;return function(){var s=Rd(this,e);return s===a?null:s===r?i:i=t(r=s,n)}}function bCe(e,t,n){var r,a,i;return function(){var s=Rd(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),Rd(this,e))),s===u?null:s===r&&u===a?i:(a=u,i=t(r=s,c))}}function wCe(e,t){var n,r,a,i="style."+t,s="end."+i,c;return function(){var u=Xi(this,e),d=u.on,m=u.value[i]==null?c||(c=Lq(t)):void 0;(d!==n||a!==m)&&(r=(n=d).copy()).on(s,a=m),u.on=r}}function SCe(e,t,n){var r=(e+="")=="transform"?qfe:Iq;return t==null?this.styleTween(e,yCe(e,r)).on("end.style."+e,Lq(e)):typeof t=="function"?this.styleTween(e,bCe(e,r,HA(this,"style."+e,t))).each(wCe(this._id,e)):this.styleTween(e,xCe(e,r,t),n).on("end.style."+e,null)}function ECe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _Ce(e,t,n){var r,a;function i(){var s=t.apply(this,arguments);return s!==a&&(r=(a=s)&&ECe(e,s,n)),r}return i._value=t,i}function jCe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,_Ce(e,t,n??""))}function CCe(e){return function(){this.textContent=e}}function OCe(e){return function(){var t=e(this);this.textContent=t??""}}function ACe(e){return this.tween("text",typeof e=="function"?OCe(HA(this,"text",e)):CCe(e==null?"":e+""))}function NCe(e){return function(t){this.textContent=e.call(this,t)}}function TCe(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&NCe(a)),t}return r._value=e,r}function PCe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,TCe(e))}function MCe(){for(var e=this._name,t=this._id,n=zq(),r=this._groups,a=r.length,i=0;i<a;++i)for(var s=r[i],c=s.length,u,d=0;d<c;++d)if(u=s[d]){var m=pi(u,t);vx(u,e,n,d,s,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Go(r,this._parents,e,n)}function kCe(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,s){var c={value:s},u={value:function(){--a===0&&i()}};n.each(function(){var d=Xi(this,r),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),d.on=t}),a===0&&i()})}var RCe=0;function Go(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function zq(){return++RCe}var xo=ip.prototype;Go.prototype={constructor:Go,select:mCe,selectAll:pCe,selectChild:xo.selectChild,selectChildren:xo.selectChildren,filter:sCe,merge:lCe,selection:gCe,transition:MCe,call:xo.call,nodes:xo.nodes,node:xo.node,size:xo.size,empty:xo.empty,each:xo.each,on:dCe,attr:Kje,attrTween:Wje,style:SCe,styleTween:jCe,text:ACe,textTween:PCe,remove:hCe,tween:zje,delay:Jje,duration:nCe,ease:aCe,easeVarying:oCe,end:kCe,[Symbol.iterator]:xo[Symbol.iterator]};function DCe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ICe={time:null,delay:0,duration:250,ease:DCe};function LCe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function zCe(e){var t,n;e instanceof Go?(t=e._id,e=e._name):(t=zq(),(n=ICe).time=BA(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var s=r[i],c=s.length,u,d=0;d<c;++d)(u=s[d])&&vx(u,e,t,d,s,n||LCe(u,t));return new Go(r,this._parents,e,t)}ip.prototype.interrupt=Dje;ip.prototype.transition=zCe;const ig=e=>()=>e;function $Ce(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function No(e,t,n){this.k=e,this.x=t,this.y=n}No.prototype={constructor:No,scale:function(e){return e===1?this:new No(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new No(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var gx=new No(1,0,0);$q.prototype=No.prototype;function $q(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gx;return e.__zoom}function qS(e){e.stopImmediatePropagation()}function Sh(e){e.preventDefault(),e.stopImmediatePropagation()}function BCe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function UCe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function hL(){return this.__zoom||gx}function HCe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function FCe(){return navigator.maxTouchPoints||"ontouchstart"in this}function qCe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Bq(){var e=BCe,t=UCe,n=qCe,r=HCe,a=FCe,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,u=Sg,d=hx("start","zoom","end"),m,f,v,g=500,b=150,w=0,S=10;function E(L){L.property("__zoom",hL).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",K).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(L,Y,k,H){var q=L.selection?L.selection():L;q.property("__zoom",hL),L!==q?N(L,Y,k,H):q.interrupt().each(function(){T(this,arguments).event(H).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},E.scaleBy=function(L,Y,k,H){E.scaleTo(L,function(){var q=this.__zoom.k,F=typeof Y=="function"?Y.apply(this,arguments):Y;return q*F},k,H)},E.scaleTo=function(L,Y,k,H){E.transform(L,function(){var q=t.apply(this,arguments),F=this.__zoom,V=k==null?A(q):typeof k=="function"?k.apply(this,arguments):k,B=F.invert(V),$=typeof Y=="function"?Y.apply(this,arguments):Y;return n(j(O(F,$),V,B),q,s)},k,H)},E.translateBy=function(L,Y,k,H){E.transform(L,function(){return n(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),s)},null,H)},E.translateTo=function(L,Y,k,H,q){E.transform(L,function(){var F=t.apply(this,arguments),V=this.__zoom,B=H==null?A(F):typeof H=="function"?H.apply(this,arguments):H;return n(gx.translate(B[0],B[1]).scale(V.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof k=="function"?-k.apply(this,arguments):-k),F,s)},H,q)};function O(L,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===L.k?L:new No(Y,L.x,L.y)}function j(L,Y,k){var H=Y[0]-k[0]*L.k,q=Y[1]-k[1]*L.k;return H===L.x&&q===L.y?L:new No(L.k,H,q)}function A(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function N(L,Y,k,H){L.on("start.zoom",function(){T(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(H).end()}).tween("zoom",function(){var q=this,F=arguments,V=T(q,F).event(H),B=t.apply(q,F),$=k==null?A(B):typeof k=="function"?k.apply(q,F):k,X=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Z=q.__zoom,ee=typeof Y=="function"?Y.apply(q,F):Y,le=u(Z.invert($).concat(X/Z.k),ee.invert($).concat(X/ee.k));return function(ie){if(ie===1)ie=ee;else{var ae=le(ie),J=X/ae[2];ie=new No(J,$[0]-ae[0]*J,$[1]-ae[1]*J)}V.zoom(null,ie)}})}function T(L,Y,k){return!k&&L.__zooming||new P(L,Y)}function P(L,Y){this.that=L,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,Y),this.taps=0}P.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,Y){return this.mouse&&L!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var Y=ca(this.that).datum();d.call(L,this.that,new $Ce(L,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:d}),Y)}};function R(L,...Y){if(!e.apply(this,arguments))return;var k=T(this,Y).event(L),H=this.__zoom,q=Math.max(i[0],Math.min(i[1],H.k*Math.pow(2,r.apply(this,arguments)))),F=Za(L);if(k.wheel)(k.mouse[0][0]!==F[0]||k.mouse[0][1]!==F[1])&&(k.mouse[1]=H.invert(k.mouse[0]=F)),clearTimeout(k.wheel);else{if(H.k===q)return;k.mouse=[F,H.invert(F)],Ag(this),k.start()}Sh(L),k.wheel=setTimeout(V,b),k.zoom("mouse",n(j(O(H,q),k.mouse[0],k.mouse[1]),k.extent,s));function V(){k.wheel=null,k.end()}}function D(L,...Y){if(v||!e.apply(this,arguments))return;var k=L.currentTarget,H=T(this,Y,!0).event(L),q=ca(L.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",X,!0),F=Za(L,k),V=L.clientX,B=L.clientY;Nq(L.view),qS(L),H.mouse=[F,this.__zoom.invert(F)],Ag(this),H.start();function $(Z){if(Sh(Z),!H.moved){var ee=Z.clientX-V,le=Z.clientY-B;H.moved=ee*ee+le*le>w}H.event(Z).zoom("mouse",n(j(H.that.__zoom,H.mouse[0]=Za(Z,k),H.mouse[1]),H.extent,s))}function X(Z){q.on("mousemove.zoom mouseup.zoom",null),Tq(Z.view,H.moved),Sh(Z),H.event(Z).end()}}function K(L,...Y){if(e.apply(this,arguments)){var k=this.__zoom,H=Za(L.changedTouches?L.changedTouches[0]:L,this),q=k.invert(H),F=k.k*(L.shiftKey?.5:2),V=n(j(O(k,F),H,q),t.apply(this,Y),s);Sh(L),c>0?ca(this).transition().duration(c).call(N,V,H,L):ca(this).call(E.transform,V,H,L)}}function z(L,...Y){if(e.apply(this,arguments)){var k=L.touches,H=k.length,q=T(this,Y,L.changedTouches.length===H).event(L),F,V,B,$;for(qS(L),V=0;V<H;++V)B=k[V],$=Za(B,this),$=[$,this.__zoom.invert($),B.identifier],q.touch0?!q.touch1&&q.touch0[2]!==$[2]&&(q.touch1=$,q.taps=0):(q.touch0=$,F=!0,q.taps=1+!!m);m&&(m=clearTimeout(m)),F&&(q.taps<2&&(f=$[0],m=setTimeout(function(){m=null},g)),Ag(this),q.start())}}function I(L,...Y){if(this.__zooming){var k=T(this,Y).event(L),H=L.changedTouches,q=H.length,F,V,B,$;for(Sh(L),F=0;F<q;++F)V=H[F],B=Za(V,this),k.touch0&&k.touch0[2]===V.identifier?k.touch0[0]=B:k.touch1&&k.touch1[2]===V.identifier&&(k.touch1[0]=B);if(V=k.that.__zoom,k.touch1){var X=k.touch0[0],Z=k.touch0[1],ee=k.touch1[0],le=k.touch1[1],ie=(ie=ee[0]-X[0])*ie+(ie=ee[1]-X[1])*ie,ae=(ae=le[0]-Z[0])*ae+(ae=le[1]-Z[1])*ae;V=O(V,Math.sqrt(ie/ae)),B=[(X[0]+ee[0])/2,(X[1]+ee[1])/2],$=[(Z[0]+le[0])/2,(Z[1]+le[1])/2]}else if(k.touch0)B=k.touch0[0],$=k.touch0[1];else return;k.zoom("touch",n(j(V,B,$),k.extent,s))}}function G(L,...Y){if(this.__zooming){var k=T(this,Y).event(L),H=L.changedTouches,q=H.length,F,V;for(qS(L),v&&clearTimeout(v),v=setTimeout(function(){v=null},g),F=0;F<q;++F)V=H[F],k.touch0&&k.touch0[2]===V.identifier?delete k.touch0:k.touch1&&k.touch1[2]===V.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(V=Za(V,this),Math.hypot(f[0]-V[0],f[1]-V[1])<S)){var B=ca(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return E.wheelDelta=function(L){return arguments.length?(r=typeof L=="function"?L:ig(+L),E):r},E.filter=function(L){return arguments.length?(e=typeof L=="function"?L:ig(!!L),E):e},E.touchable=function(L){return arguments.length?(a=typeof L=="function"?L:ig(!!L),E):a},E.extent=function(L){return arguments.length?(t=typeof L=="function"?L:ig([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),E):t},E.scaleExtent=function(L){return arguments.length?(i[0]=+L[0],i[1]=+L[1],E):[i[0],i[1]]},E.translateExtent=function(L){return arguments.length?(s[0][0]=+L[0][0],s[1][0]=+L[1][0],s[0][1]=+L[0][1],s[1][1]=+L[1][1],E):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},E.constrain=function(L){return arguments.length?(n=L,E):n},E.duration=function(L){return arguments.length?(c=+L,E):c},E.interpolate=function(L){return arguments.length?(u=L,E):u},E.on=function(){var L=d.on.apply(d,arguments);return L===d?E:L},E.clickDistance=function(L){return arguments.length?(w=(L=+L)*L,E):Math.sqrt(w)},E.tapDistance=function(L){return arguments.length?(S=+L,E):S},E}const Vi={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},cm=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Uq=["Enter"," ","Escape"],Hq={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Id;(function(e){e.Strict="strict",e.Loose="loose"})(Id||(Id={}));var jc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jc||(jc={}));var um;(function(e){e.Partial="partial",e.Full="full"})(um||(um={}));const Fq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Vs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Vs||(Vs={}));var Ld;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ld||(Ld={}));var Le;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Le||(Le={}));const mL={[Le.Left]:Le.Right,[Le.Right]:Le.Left,[Le.Top]:Le.Bottom,[Le.Bottom]:Le.Top};function qq(e){return e===null?null:e?"valid":"invalid"}const Kq=e=>"id"in e&&"source"in e&&"target"in e,KCe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),FA=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),op=(e,t=[0,0])=>{const{width:n,height:r}=as(e),a=e.origin??t,i=n*a[0],s=r*a[1];return{x:e.position.x-i,y:e.position.y-s}},VCe=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const i=typeof a=="string";let s=!t.nodeLookup&&!i?a:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(a):FA(a)?a:t.nodeLookup.get(a.id));const c=s?Hy(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return yx(r,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xx(n)},sp=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=yx(n,Hy(a)),r=!0)}),r?xx(n):{x:0,y:0,width:0,height:0}},qA=(e,t,[n,r,a]=[0,0,1],i=!1,s=!1)=>{const c={...cp(t,[n,r,a]),width:t.width/a,height:t.height/a},u=[];for(const d of e.values()){const{measured:m,selectable:f=!0,hidden:v=!1}=d;if(s&&!f||v)continue;const g=m.width??d.width??d.initialWidth??null,b=m.height??d.height??d.initialHeight??null,w=dm(c,$d(d)),S=(g??0)*(b??0),E=i&&w>0;(!d.internals.handleBounds||E||w>=S||d.dragging)&&u.push(d)}return u},YCe=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function GCe(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function XCe({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const c=GCe(e,s),u=sp(c),d=KA(u,t,n,(s==null?void 0:s.minZoom)??a,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(d,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function Vq({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:i}){const s=n.get(e),c=s.parentId?n.get(s.parentId):void 0,{x:u,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},m=s.origin??r;let f=s.extent||a;if(s.extent==="parent"&&!s.expandParent)if(!c)i==null||i("005",Vi.error005());else{const g=c.measured.width,b=c.measured.height;g&&b&&(f=[[u,d],[u+g,d+b]])}else c&&Bd(s.extent)&&(f=[[s.extent[0][0]+u,s.extent[0][1]+d],[s.extent[1][0]+u,s.extent[1][1]+d]]);const v=Bd(f)?Kc(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Vi.error015())),{position:{x:v.x-u+(s.measured.width??0)*m[0],y:v.y-d+(s.measured.height??0)*m[1]},positionAbsolute:v}}async function WCe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const i=new Set(e.map(v=>v.id)),s=[];for(const v of n){if(v.deletable===!1)continue;const g=i.has(v.id),b=!g&&v.parentId&&s.find(w=>w.id===v.parentId);(g||b)&&s.push(v)}const c=new Set(t.map(v=>v.id)),u=r.filter(v=>v.deletable!==!1),m=YCe(s,u);for(const v of u)c.has(v.id)&&!m.find(b=>b.id===v.id)&&m.push(v);if(!a)return{edges:m,nodes:s};const f=await a({nodes:s,edges:m});return typeof f=="boolean"?f?{edges:m,nodes:s}:{edges:[],nodes:[]}:f}const zd=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Kc=(e={x:0,y:0},t,n)=>({x:zd(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:zd(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Yq(e,t,n){const{width:r,height:a}=as(n),{x:i,y:s}=n.internals.positionAbsolute;return Kc(e,[[i,s],[i+r,s+a]],t)}const pL=(e,t,n)=>e<t?zd(Math.abs(e-t),1,t)/t:e>n?-zd(Math.abs(e-n),1,t)/t:0,Gq=(e,t,n=15,r=40)=>{const a=pL(e.x,r,t.width-r)*n,i=pL(e.y,r,t.height-r)*n;return[a,i]},yx=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Q_=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),xx=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),$d=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=FA(e)?e.internals.positionAbsolute:op(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Hy=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=FA(e)?e.internals.positionAbsolute:op(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Xq=(e,t)=>xx(yx(Q_(e),Q_(t))),dm=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},vL=e=>ri(e.width)&&ri(e.height)&&ri(e.x)&&ri(e.y),ri=e=>!isNaN(e)&&isFinite(e),QCe=(e,t)=>{},lp=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),cp=({x:e,y:t},[n,r,a],i=!1,s=[1,1])=>{const c={x:(e-n)/a,y:(t-r)/a};return i?lp(c,s):c},Fy=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function Yu(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZCe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Yu(e,n),a=Yu(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=Yu(e.top??e.y??0,n),a=Yu(e.bottom??e.y??0,n),i=Yu(e.left??e.x??0,t),s=Yu(e.right??e.x??0,t);return{top:r,right:s,bottom:a,left:i,x:i+s,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JCe(e,t,n,r,a,i){const{x:s,y:c}=Fy(e,[t,n,r]),{x:u,y:d}=Fy({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=a-u,f=i-d;return{left:Math.floor(s),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(f)}}const KA=(e,t,n,r,a,i)=>{const s=ZCe(i,t,n),c=(t-s.x)/e.width,u=(n-s.y)/e.height,d=Math.min(c,u),m=zd(d,r,a),f=e.x+e.width/2,v=e.y+e.height/2,g=t/2-f*m,b=n/2-v*m,w=JCe(e,g,b,m,t,n),S={left:Math.min(w.left-s.left,0),top:Math.min(w.top-s.top,0),right:Math.min(w.right-s.right,0),bottom:Math.min(w.bottom-s.bottom,0)};return{x:g-S.left+S.right,y:b-S.top+S.bottom,zoom:m}},fm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Bd(e){return e!=null&&e!=="parent"}function as(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Wq(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Qq(e,t={width:0,height:0},n,r,a){const i={...e},s=r.get(n);if(s){const c=s.origin||a;i.x+=s.internals.positionAbsolute.x-(t.width??0)*c[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*c[1]}return i}function gL(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function eOe(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function tOe(e){return{...Hq,...e||{}}}function kh(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:i,y:s}=ai(e),c=cp({x:i-((a==null?void 0:a.left)??0),y:s-((a==null?void 0:a.top)??0)},r),{x:u,y:d}=n?lp(c,t):c;return{xSnapped:u,ySnapped:d,...c}}const VA=e=>({width:e.offsetWidth,height:e.offsetHeight}),Zq=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},nOe=["INPUT","SELECT","TEXTAREA"];function Jq(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:nOe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const e9=e=>"clientX"in e,ai=(e,t)=>{var i,s;const n=e9(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,a=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},yL=(e,t,n,r,a)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const c=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:a,position:s.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...VA(s)}})};function t9({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:i,targetControlX:s,targetControlY:c}){const u=e*.125+a*.375+s*.375+n*.125,d=t*.125+i*.375+c*.375+r*.125,m=Math.abs(u-e),f=Math.abs(d-t);return[u,d,m,f]}function og(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function xL({pos:e,x1:t,y1:n,x2:r,y2:a,c:i}){switch(e){case Le.Left:return[t-og(t-r,i),n];case Le.Right:return[t+og(r-t,i),n];case Le.Top:return[t,n-og(n-a,i)];case Le.Bottom:return[t,n+og(a-n,i)]}}function n9({sourceX:e,sourceY:t,sourcePosition:n=Le.Bottom,targetX:r,targetY:a,targetPosition:i=Le.Top,curvature:s=.25}){const[c,u]=xL({pos:n,x1:e,y1:t,x2:r,y2:a,c:s}),[d,m]=xL({pos:i,x1:r,y1:a,x2:e,y2:t,c:s}),[f,v,g,b]=t9({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:c,sourceControlY:u,targetControlX:d,targetControlY:m});return[`M${e},${t} C${c},${u} ${d},${m} ${r},${a}`,f,v,g,b]}function r9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,i=n<e?n+a:n-a,s=Math.abs(r-t)/2,c=r<t?r+s:r-s;return[i,c,a,s]}function rOe({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=a&&n?r+1e3:r,c=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return s+c}function aOe({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const i=yx(Hy(e),Hy(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return dm(s,xx(i))>0}const iOe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,oOe=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),sOe=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||iOe;let a;return Kq(e)?a={...e}:a={...e,id:r(e)},oOe(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function a9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,i,s,c]=r9({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,i,s,c]}const bL={[Le.Left]:{x:-1,y:0},[Le.Right]:{x:1,y:0},[Le.Top]:{x:0,y:-1},[Le.Bottom]:{x:0,y:1}},lOe=({source:e,sourcePosition:t=Le.Bottom,target:n})=>t===Le.Left||t===Le.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},wL=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function cOe({source:e,sourcePosition:t=Le.Bottom,target:n,targetPosition:r=Le.Top,center:a,offset:i,stepPosition:s}){const c=bL[t],u=bL[r],d={x:e.x+c.x*i,y:e.y+c.y*i},m={x:n.x+u.x*i,y:n.y+u.y*i},f=lOe({source:d,sourcePosition:t,target:m}),v=f.x!==0?"x":"y",g=f[v];let b=[],w,S;const E={x:0,y:0},O={x:0,y:0},[,,j,A]=r9({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[v]*u[v]===-1){v==="x"?(w=a.x??d.x+(m.x-d.x)*s,S=a.y??(d.y+m.y)/2):(w=a.x??(d.x+m.x)/2,S=a.y??d.y+(m.y-d.y)*s);const T=[{x:w,y:d.y},{x:w,y:m.y}],P=[{x:d.x,y:S},{x:m.x,y:S}];c[v]===g?b=v==="x"?T:P:b=v==="x"?P:T}else{const T=[{x:d.x,y:m.y}],P=[{x:m.x,y:d.y}];if(v==="x"?b=c.x===g?P:T:b=c.y===g?T:P,t===r){const I=Math.abs(e[v]-n[v]);if(I<=i){const G=Math.min(i-1,i-I);c[v]===g?E[v]=(d[v]>e[v]?-1:1)*G:O[v]=(m[v]>n[v]?-1:1)*G}}if(t!==r){const I=v==="x"?"y":"x",G=c[v]===u[I],L=d[I]>m[I],Y=d[I]<m[I];(c[v]===1&&(!G&&L||G&&Y)||c[v]!==1&&(!G&&Y||G&&L))&&(b=v==="x"?T:P)}const R={x:d.x+E.x,y:d.y+E.y},D={x:m.x+O.x,y:m.y+O.y},K=Math.max(Math.abs(R.x-b[0].x),Math.abs(D.x-b[0].x)),z=Math.max(Math.abs(R.y-b[0].y),Math.abs(D.y-b[0].y));K>=z?(w=(R.x+D.x)/2,S=b[0].y):(w=b[0].x,S=(R.y+D.y)/2)}return[[e,{x:d.x+E.x,y:d.y+E.y},...b,{x:m.x+O.x,y:m.y+O.y},n],w,S,j,A]}function uOe(e,t,n,r){const a=Math.min(wL(e,t)/2,wL(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const d=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${i+a*d},${s}Q ${i},${s} ${i},${s+a*m}`}const c=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${s+a*u}Q ${i},${s} ${i+a*c},${s}`}function Z_({sourceX:e,sourceY:t,sourcePosition:n=Le.Bottom,targetX:r,targetY:a,targetPosition:i=Le.Top,borderRadius:s=5,centerX:c,centerY:u,offset:d=20,stepPosition:m=.5}){const[f,v,g,b,w]=cOe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:i,center:{x:c,y:u},offset:d,stepPosition:m});return[f.reduce((E,O,j)=>{let A="";return j>0&&j<f.length-1?A=uOe(f[j-1],O,f[j+1],s):A=`${j===0?"M":"L"}${O.x} ${O.y}`,E+=A,E},""),v,g,b,w]}function SL(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function dOe(e){var f;const{sourceNode:t,targetNode:n}=e;if(!SL(t)||!SL(n))return null;const r=t.internals.handleBounds||EL(t.handles),a=n.internals.handleBounds||EL(n.handles),i=_L((r==null?void 0:r.source)??[],e.sourceHandle),s=_L(e.connectionMode===Id.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!i||!s)return(f=e.onError)==null||f.call(e,"008",Vi.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||Le.Bottom,u=(s==null?void 0:s.position)||Le.Top,d=Vc(t,i,c),m=Vc(n,s,u);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:u}}function EL(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Vc(e,t,n=Le.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:c}=t??as(e);if(r)return{x:a+s/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case Le.Top:return{x:a+s/2,y:i};case Le.Right:return{x:a+s,y:i+c/2};case Le.Bottom:return{x:a+s/2,y:i+c};case Le.Left:return{x:a,y:i+c/2}}}function _L(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function J_(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fOe(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const i=new Set;return e.reduce((s,c)=>([c.markerStart||r,c.markerEnd||a].forEach(u=>{if(u&&typeof u=="object"){const d=J_(u,t);i.has(d)||(s.push({id:d,color:u.color||n,...u}),i.add(d))}}),s),[]).sort((s,c)=>s.id.localeCompare(c.id))}const i9=1e3,hOe=10,YA={nodeOrigin:[0,0],nodeExtent:cm,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},mOe={...YA,checkEquality:!0};function GA(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function pOe(e,t,n){const r=GA(YA,n);for(const a of e.values())if(a.parentId)WA(a,e,t,r);else{const i=op(a,r.nodeOrigin),s=Bd(a.extent)?a.extent:r.nodeExtent,c=Kc(i,s,as(a));a.internals.positionAbsolute=c}}function vOe(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const i={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&r.push(i)}return{source:n,target:r}}function XA(e){return e==="manual"}function ej(e,t,n,r={}){var d,m;const a=GA(mOe,r),i={i:0},s=new Map(t),c=a!=null&&a.elevateNodesOnSelect&&!XA(a.zIndexMode)?i9:0;let u=e.length>0;t.clear(),n.clear();for(const f of e){let v=s.get(f.id);if(a.checkEquality&&f===(v==null?void 0:v.internals.userNode))t.set(f.id,v);else{const g=op(f,a.nodeOrigin),b=Bd(f.extent)?f.extent:a.nodeExtent,w=Kc(g,b,as(f));v={...a.defaults,...f,measured:{width:(d=f.measured)==null?void 0:d.width,height:(m=f.measured)==null?void 0:m.height},internals:{positionAbsolute:w,handleBounds:vOe(f,v),z:o9(f,c,a.zIndexMode),userNode:f}},t.set(f.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(u=!1),f.parentId&&WA(v,t,n,r,i)}return u}function gOe(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function WA(e,t,n,r,a){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:c,zIndexMode:u}=GA(YA,r),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gOe(e,n),a&&!m.parentId&&m.internals.rootParentIndex===void 0&&u==="auto"&&(m.internals.rootParentIndex=++a.i,m.internals.z=m.internals.z+a.i*hOe),a&&m.internals.rootParentIndex!==void 0&&(a.i=m.internals.rootParentIndex);const f=i&&!XA(u)?i9:0,{x:v,y:g,z:b}=yOe(e,m,s,c,f,u),{positionAbsolute:w}=e.internals,S=v!==w.x||g!==w.y;(S||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:v,y:g}:w,z:b}})}function o9(e,t,n){const r=ri(e.zIndex)?e.zIndex:0;return XA(n)?r:r+(e.selected?t:0)}function yOe(e,t,n,r,a,i){const{x:s,y:c}=t.internals.positionAbsolute,u=as(e),d=op(e,n),m=Bd(e.extent)?Kc(d,e.extent,u):d;let f=Kc({x:s+m.x,y:c+m.y},r,u);e.extent==="parent"&&(f=Yq(f,u,t));const v=o9(e,a,i),g=t.internals.z??0;return{x:f.x,y:f.y,z:g>=v?g+1:v}}function QA(e,t,n,r=[0,0]){var s;const a=[],i=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const d=((s=i.get(c.parentId))==null?void 0:s.expandedRect)??$d(u),m=Xq(d,c.rect);i.set(c.parentId,{expandedRect:m,parent:u})}return i.size>0&&i.forEach(({expandedRect:c,parent:u},d)=>{var j;const m=u.internals.positionAbsolute,f=as(u),v=u.origin??r,g=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,b=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,w=Math.max(f.width,Math.round(c.width)),S=Math.max(f.height,Math.round(c.height)),E=(w-f.width)*v[0],O=(S-f.height)*v[1];(g>0||b>0||E||O)&&(a.push({id:d,type:"position",position:{x:u.position.x-g+E,y:u.position.y-b+O}}),(j=n.get(d))==null||j.forEach(A=>{e.some(N=>N.id===A.id)||a.push({id:A.id,type:"position",position:{x:A.position.x+g,y:A.position.y+b}})})),(f.width<c.width||f.height<c.height||g||b)&&a.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(g?v[0]*g-E:0),height:S+(b?v[1]*b-O:0)}})}),a}function xOe(e,t,n,r,a,i,s){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!c)return{changes:[],updatedInternals:u};const d=[],m=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(m.transform),v=[];for(const g of e.values()){const b=t.get(g.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const w=VA(g.nodeElement),S=b.measured.width!==w.width||b.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!b.internals.handleBounds||g.force))){const O=g.nodeElement.getBoundingClientRect(),j=Bd(b.extent)?b.extent:i;let{positionAbsolute:A}=b.internals;b.parentId&&b.extent==="parent"?A=Yq(A,w,t.get(b.parentId)):j&&(A=Kc(A,j,w));const N={...b,measured:w,internals:{...b.internals,positionAbsolute:A,handleBounds:{source:yL("source",g.nodeElement,O,f,b.id),target:yL("target",g.nodeElement,O,f,b.id)}}};t.set(b.id,N),b.parentId&&WA(N,t,n,{nodeOrigin:a,zIndexMode:s}),u=!0,S&&(d.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&v.push({id:b.id,parentId:b.parentId,rect:$d(N,a)}))}}if(v.length>0){const g=QA(v,t,n,a);d.push(...g)}return{changes:d,updatedInternals:u}}async function bOe({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,i]],r),c=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(c)}function jL(e,t,n,r,a,i){let s=a;const c=r.get(s)||new Map;r.set(s,c.set(n,t)),s=`${a}-${e}`;const u=r.get(s)||new Map;if(r.set(s,u.set(n,t)),i){s=`${a}-${e}-${i}`;const d=r.get(s)||new Map;r.set(s,d.set(n,t))}}function s9(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:i,sourceHandle:s=null,targetHandle:c=null}=r,u={edgeId:r.id,source:a,target:i,sourceHandle:s,targetHandle:c},d=`${a}-${s}--${i}-${c}`,m=`${i}-${c}--${a}-${s}`;jL("source",u,m,e,a,s),jL("target",u,d,e,i,c),t.set(r.id,r)}}function l9(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:l9(n,t):!1}function CL(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function wOe(e,t,n,r){const a=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!l9(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const c=e.get(i);c&&a.set(i,{id:i,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return a}function KS({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,c,u;const a=[];for(const[d,m]of t){const f=(s=n.get(d))==null?void 0:s.internals.userNode;f&&a.push({...f,position:m.position,dragging:r})}if(!e)return[a[0],a];const i=(c=n.get(e))==null?void 0:c.internals.userNode;return[i?{...i,position:((u=t.get(e))==null?void 0:u.position)||i.position,dragging:r}:a[0],a]}function SOe({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:r-a.distance.y},s=lp(i,t);return{x:s.x-i.x,y:s.y-i.y}}function EOe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let i={x:null,y:null},s=0,c=new Map,u=!1,d={x:0,y:0},m=null,f=!1,v=null,g=!1,b=!1,w=null;function S({noDragClassName:O,handleSelector:j,domNode:A,isSelectable:N,nodeId:T,nodeClickDistance:P=0}){v=ca(A);function R({x:I,y:G}){const{nodeLookup:L,nodeExtent:Y,snapGrid:k,snapToGrid:H,nodeOrigin:q,onNodeDrag:F,onSelectionDrag:V,onError:B,updateNodePositions:$}=t();i={x:I,y:G};let X=!1;const Z=c.size>1,ee=Z&&Y?Q_(sp(c)):null,le=Z&&H?SOe({dragItems:c,snapGrid:k,x:I,y:G}):null;for(const[ie,ae]of c){if(!L.has(ie))continue;let J={x:I-ae.distance.x,y:G-ae.distance.y};H&&(J=le?{x:Math.round(J.x+le.x),y:Math.round(J.y+le.y)}:lp(J,k));let re=null;if(Z&&Y&&!ae.extent&&ee){const{positionAbsolute:xe}=ae.internals,ye=xe.x-ee.x+Y[0][0],De=xe.x+ae.measured.width-ee.x2+Y[1][0],Me=xe.y-ee.y+Y[0][1],Ke=xe.y+ae.measured.height-ee.y2+Y[1][1];re=[[ye,Me],[De,Ke]]}const{position:fe,positionAbsolute:ne}=Vq({nodeId:ie,nextPosition:J,nodeLookup:L,nodeExtent:re||Y,nodeOrigin:q,onError:B});X=X||ae.position.x!==fe.x||ae.position.y!==fe.y,ae.position=fe,ae.internals.positionAbsolute=ne}if(b=b||X,!!X&&($(c,!0),w&&(r||F||!T&&V))){const[ie,ae]=KS({nodeId:T,dragItems:c,nodeLookup:L});r==null||r(w,c,ie,ae),F==null||F(w,ie,ae),T||V==null||V(w,ae)}}async function D(){if(!m)return;const{transform:I,panBy:G,autoPanSpeed:L,autoPanOnNodeDrag:Y}=t();if(!Y){u=!1,cancelAnimationFrame(s);return}const[k,H]=Gq(d,m,L);(k!==0||H!==0)&&(i.x=(i.x??0)-k/I[2],i.y=(i.y??0)-H/I[2],await G({x:k,y:H})&&R(i)),s=requestAnimationFrame(D)}function K(I){var Z;const{nodeLookup:G,multiSelectionActive:L,nodesDraggable:Y,transform:k,snapGrid:H,snapToGrid:q,selectNodesOnDrag:F,onNodeDragStart:V,onSelectionDragStart:B,unselectNodesAndEdges:$}=t();f=!0,(!F||!N)&&!L&&T&&((Z=G.get(T))!=null&&Z.selected||$()),N&&F&&T&&(e==null||e(T));const X=kh(I.sourceEvent,{transform:k,snapGrid:H,snapToGrid:q,containerBounds:m});if(i=X,c=wOe(G,Y,X,T),c.size>0&&(n||V||!T&&B)){const[ee,le]=KS({nodeId:T,dragItems:c,nodeLookup:G});n==null||n(I.sourceEvent,c,ee,le),V==null||V(I.sourceEvent,ee,le),T||B==null||B(I.sourceEvent,le)}}const z=Pq().clickDistance(P).on("start",I=>{const{domNode:G,nodeDragThreshold:L,transform:Y,snapGrid:k,snapToGrid:H}=t();m=(G==null?void 0:G.getBoundingClientRect())||null,g=!1,b=!1,w=I.sourceEvent,L===0&&K(I),i=kh(I.sourceEvent,{transform:Y,snapGrid:k,snapToGrid:H,containerBounds:m}),d=ai(I.sourceEvent,m)}).on("drag",I=>{const{autoPanOnNodeDrag:G,transform:L,snapGrid:Y,snapToGrid:k,nodeDragThreshold:H,nodeLookup:q}=t(),F=kh(I.sourceEvent,{transform:L,snapGrid:Y,snapToGrid:k,containerBounds:m});if(w=I.sourceEvent,(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||T&&!q.has(T))&&(g=!0),!g){if(!u&&G&&f&&(u=!0,D()),!f){const V=ai(I.sourceEvent,m),B=V.x-d.x,$=V.y-d.y;Math.sqrt(B*B+$*$)>H&&K(I)}(i.x!==F.xSnapped||i.y!==F.ySnapped)&&c&&f&&(d=ai(I.sourceEvent,m),R(F))}}).on("end",I=>{if(!(!f||g)&&(u=!1,f=!1,cancelAnimationFrame(s),c.size>0)){const{nodeLookup:G,updateNodePositions:L,onNodeDragStop:Y,onSelectionDragStop:k}=t();if(b&&(L(c,!1),b=!1),a||Y||!T&&k){const[H,q]=KS({nodeId:T,dragItems:c,nodeLookup:G,dragging:!1});a==null||a(I.sourceEvent,c,H,q),Y==null||Y(I.sourceEvent,H,q),T||k==null||k(I.sourceEvent,q)}}}).filter(I=>{const G=I.target;return!I.button&&(!O||!CL(G,`.${O}`,A))&&(!j||CL(G,j,A))});v.call(z)}function E(){v==null||v.on(".drag",null)}return{update:S,destroy:E}}function _Oe(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())dm(a,$d(i))>0&&r.push(i);return r}const jOe=250;function COe(e,t,n,r){var c,u;let a=[],i=1/0;const s=_Oe(e,n,t+jOe);for(const d of s){const m=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const f of m){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:v,y:g}=Vc(d,f,f.position,!0),b=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(g-e.y,2));b>t||(b<i?(a=[{...f,x:v,y:g}],i=b):b===i&&a.push({...f,x:v,y:g}))}}if(!a.length)return null;if(a.length>1){const d=r.type==="source"?"target":"source";return a.find(m=>m.type===d)??a[0]}return a[0]}function c9(e,t,n,r,a,i=!1){var d,m,f;const s=r.get(e);if(!s)return null;const c=a==="strict"?(d=s.internals.handleBounds)==null?void 0:d[t]:[...((m=s.internals.handleBounds)==null?void 0:m.source)??[],...((f=s.internals.handleBounds)==null?void 0:f.target)??[]],u=(n?c==null?void 0:c.find(v=>v.id===n):c==null?void 0:c[0])??null;return u&&i?{...u,...Vc(s,u,u.position,!0)}:u}function u9(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function OOe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const d9=()=>!0;function AOe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:i,isTarget:s,domNode:c,nodeLookup:u,lib:d,autoPanOnConnect:m,flowId:f,panBy:v,cancelConnection:g,onConnectStart:b,onConnect:w,onConnectEnd:S,isValidConnection:E=d9,onReconnectEnd:O,updateConnection:j,getTransform:A,getFromHandle:N,autoPanSpeed:T,dragThreshold:P=1,handleDomNode:R}){const D=Zq(e.target);let K=0,z;const{x:I,y:G}=ai(e),L=u9(i,R),Y=c==null?void 0:c.getBoundingClientRect();let k=!1;if(!Y||!L)return;const H=c9(a,L,r,u,t);if(!H)return;let q=ai(e,Y),F=!1,V=null,B=!1,$=null;function X(){if(!m||!Y)return;const[fe,ne]=Gq(q,Y,T);v({x:fe,y:ne}),K=requestAnimationFrame(X)}const Z={...H,nodeId:a,type:L,position:H.position},ee=u.get(a);let ie={inProgress:!0,isValid:null,from:Vc(ee,Z,Le.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ee,to:q,toHandle:null,toPosition:mL[Z.position],toNode:null,pointer:q};function ae(){k=!0,j(ie),b==null||b(e,{nodeId:a,handleId:r,handleType:L})}P===0&&ae();function J(fe){if(!k){const{x:Ke,y:Je}=ai(fe),nt=Ke-I,pn=Je-G;if(!(nt*nt+pn*pn>P*P))return;ae()}if(!N()||!Z){re(fe);return}const ne=A();q=ai(fe,Y),z=COe(cp(q,ne,!1,[1,1]),n,u,Z),F||(X(),F=!0);const xe=f9(fe,{handle:z,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:s?"target":"source",isValidConnection:E,doc:D,lib:d,flowId:f,nodeLookup:u});$=xe.handleDomNode,V=xe.connection,B=OOe(!!z,xe.isValid);const ye=u.get(a),De=ye?Vc(ye,Z,Le.Left,!0):ie.from,Me={...ie,from:De,isValid:B,to:xe.toHandle&&B?Fy({x:xe.toHandle.x,y:xe.toHandle.y},ne):q,toHandle:xe.toHandle,toPosition:B&&xe.toHandle?xe.toHandle.position:mL[Z.position],toNode:xe.toHandle?u.get(xe.toHandle.nodeId):null,pointer:q};j(Me),ie=Me}function re(fe){if(!("touches"in fe&&fe.touches.length>0)){if(k){(z||$)&&V&&B&&(w==null||w(V));const{inProgress:ne,...xe}=ie,ye={...xe,toPosition:ie.toHandle?ie.toPosition:null};S==null||S(fe,ye),i&&(O==null||O(fe,ye))}g(),cancelAnimationFrame(K),F=!1,B=!1,V=null,$=null,D.removeEventListener("mousemove",J),D.removeEventListener("mouseup",re),D.removeEventListener("touchmove",J),D.removeEventListener("touchend",re)}}D.addEventListener("mousemove",J),D.addEventListener("mouseup",re),D.addEventListener("touchmove",J),D.addEventListener("touchend",re)}function f9(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:i,doc:s,lib:c,flowId:u,isValidConnection:d=d9,nodeLookup:m}){const f=i==="target",v=t?s.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:b}=ai(e),w=s.elementFromPoint(g,b),S=w!=null&&w.classList.contains(`${c}-flow__handle`)?w:v,E={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const O=u9(void 0,S),j=S.getAttribute("data-nodeid"),A=S.getAttribute("data-handleid"),N=S.classList.contains("connectable"),T=S.classList.contains("connectableend");if(!j||!O)return E;const P={source:f?j:r,sourceHandle:f?A:a,target:f?r:j,targetHandle:f?a:A};E.connection=P;const D=N&&T&&(n===Id.Strict?f&&O==="source"||!f&&O==="target":j!==r||A!==a);E.isValid=D&&d(P),E.toHandle=c9(j,O,A,m,n,!0)}return E}const tj={onPointerDown:AOe,isValid:f9};function NOe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=ca(e);function i({translateExtent:c,width:u,height:d,zoomStep:m=1,pannable:f=!0,zoomable:v=!0,inversePan:g=!1}){const b=j=>{if(j.sourceEvent.type!=="wheel"||!t)return;const A=n(),N=j.sourceEvent.ctrlKey&&fm()?10:1,T=-j.sourceEvent.deltaY*(j.sourceEvent.deltaMode===1?.05:j.sourceEvent.deltaMode?1:.002)*m,P=A[2]*Math.pow(2,T*N);t.scaleTo(P)};let w=[0,0];const S=j=>{(j.sourceEvent.type==="mousedown"||j.sourceEvent.type==="touchstart")&&(w=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY])},E=j=>{const A=n();if(j.sourceEvent.type!=="mousemove"&&j.sourceEvent.type!=="touchmove"||!t)return;const N=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY],T=[N[0]-w[0],N[1]-w[1]];w=N;const P=r()*Math.max(A[2],Math.log(A[2]))*(g?-1:1),R={x:A[0]-T[0]*P,y:A[1]-T[1]*P},D=[[0,0],[u,d]];t.setViewportConstrained({x:R.x,y:R.y,zoom:A[2]},D,c)},O=Bq().on("start",S).on("zoom",f?E:null).on("zoom.wheel",v?b:null);a.call(O,{})}function s(){a.on("zoom",null)}return{update:i,destroy:s,pointer:Za}}const bx=e=>({x:e.x,y:e.y,zoom:e.k}),VS=({x:e,y:t,zoom:n})=>gx.translate(e,t).scale(n),ed=(e,t)=>e.target.closest(`.${t}`),h9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),TOe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,YS=(e,t=0,n=TOe,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},m9=e=>{const t=e.ctrlKey&&fm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function POe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:d}){return m=>{if(ed(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(m.ctrlKey&&s){const S=Za(m),E=m9(m),O=f*Math.pow(2,E);r.scaleTo(n,O,S,m);return}const v=m.deltaMode===1?20:1;let g=a===jc.Vertical?0:m.deltaX*v,b=a===jc.Horizontal?0:m.deltaY*v;!fm()&&m.shiftKey&&a!==jc.Vertical&&(g=m.deltaY*v,b=0),r.translateBy(n,-(g/f)*i,-(b/f)*i,{internal:!0});const w=bx(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(m,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,w))}}function MOe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,c=ed(r,e);if(r.ctrlKey&&i&&c&&r.preventDefault(),s||c)return null;r.preventDefault(),n.call(this,r,a)}}function kOe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,c;if((i=r.sourceEvent)!=null&&i.internal)return;const a=bx(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function ROe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return i=>{var s,c;e.usedRightMouseButton=!!(n&&h9(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),a&&!((c=i.sourceEvent)!=null&&c.internal)&&(a==null||a(i.sourceEvent,bx(i.transform)))}}function DOe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:i}){return s=>{var c;if(!((c=s.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,i&&h9(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const u=bx(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(s.sourceEvent,u)},n?150:0)}}}function IOe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:m}){return f=>{var S;const v=e||t,g=n&&f.ctrlKey,b=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(ed(f,`${d}-flow__node`)||ed(f,`${d}-flow__edge`)))return!0;if(!r&&!v&&!a&&!i&&!n||s||m&&!b||ed(f,c)&&b||ed(f,u)&&(!b||a&&b&&!e)||!n&&f.ctrlKey&&b)return!1;if(!n&&f.type==="touchstart"&&((S=f.touches)==null?void 0:S.length)>1)return f.preventDefault(),!1;if(!v&&!a&&!g&&b||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||b)&&w}}function LOe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:c,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),f=Bq().scaleExtent([t,n]).translateExtent(r),v=ca(e).call(f);O({x:a.x,y:a.y,zoom:zd(a.zoom,t,n)},[[0,0],[m.width,m.height]],r);const g=v.on("wheel.zoom"),b=v.on("dblclick.zoom");f.wheelDelta(m9);function w(z,I){return v?new Promise(G=>{f==null||f.interpolate((I==null?void 0:I.interpolate)==="linear"?Mo:Sg).transform(YS(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>G(!0)),z)}):Promise.resolve(!1)}function S({noWheelClassName:z,noPanClassName:I,onPaneContextMenu:G,userSelectionActive:L,panOnScroll:Y,panOnDrag:k,panOnScrollMode:H,panOnScrollSpeed:q,preventScrolling:F,zoomOnPinch:V,zoomOnScroll:B,zoomOnDoubleClick:$,zoomActivationKeyPressed:X,lib:Z,onTransformChange:ee,connectionInProgress:le,paneClickDistance:ie,selectionOnDrag:ae}){L&&!d.isZoomingOrPanning&&E();const J=Y&&!X&&!L;f.clickDistance(ae?1/0:!ri(ie)||ie<0?0:ie);const re=J?POe({zoomPanValues:d,noWheelClassName:z,d3Selection:v,d3Zoom:f,panOnScrollMode:H,panOnScrollSpeed:q,zoomOnPinch:V,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:c}):MOe({noWheelClassName:z,preventScrolling:F,d3ZoomHandler:g});if(v.on("wheel.zoom",re,{passive:!1}),!L){const ne=kOe({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:s});f.on("start",ne);const xe=ROe({zoomPanValues:d,panOnDrag:k,onPaneContextMenu:!!G,onPanZoom:i,onTransformChange:ee});f.on("zoom",xe);const ye=DOe({zoomPanValues:d,panOnDrag:k,panOnScroll:Y,onPaneContextMenu:G,onPanZoomEnd:c,onDraggingChange:u});f.on("end",ye)}const fe=IOe({zoomActivationKeyPressed:X,panOnDrag:k,zoomOnScroll:B,panOnScroll:Y,zoomOnDoubleClick:$,zoomOnPinch:V,userSelectionActive:L,noPanClassName:I,noWheelClassName:z,lib:Z,connectionInProgress:le});f.filter(fe),$?v.on("dblclick.zoom",b):v.on("dblclick.zoom",null)}function E(){f.on("zoom",null)}async function O(z,I,G){const L=VS(z),Y=f==null?void 0:f.constrain()(L,I,G);return Y&&await w(Y),new Promise(k=>k(Y))}async function j(z,I){const G=VS(z);return await w(G,I),new Promise(L=>L(G))}function A(z){if(v){const I=VS(z),G=v.property("__zoom");(G.k!==z.zoom||G.x!==z.x||G.y!==z.y)&&(f==null||f.transform(v,I,null,{sync:!0}))}}function N(){const z=v?$q(v.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function T(z,I){return v?new Promise(G=>{f==null||f.interpolate((I==null?void 0:I.interpolate)==="linear"?Mo:Sg).scaleTo(YS(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>G(!0)),z)}):Promise.resolve(!1)}function P(z,I){return v?new Promise(G=>{f==null||f.interpolate((I==null?void 0:I.interpolate)==="linear"?Mo:Sg).scaleBy(YS(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>G(!0)),z)}):Promise.resolve(!1)}function R(z){f==null||f.scaleExtent(z)}function D(z){f==null||f.translateExtent(z)}function K(z){const I=!ri(z)||z<0?0:z;f==null||f.clickDistance(I)}return{update:S,destroy:E,setViewport:j,setViewportConstrained:O,getViewport:N,scaleTo:T,scaleBy:P,setScaleExtent:R,setTranslateExtent:D,syncViewport:A,setClickDistance:K}}var Ud;(function(e){e.Line="line",e.Handle="handle"})(Ud||(Ud={}));function zOe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:i}){const s=e-t,c=n-r,u=[s>0?1:s<0?-1:0,c>0?1:c<0?-1:0];return s&&a&&(u[0]=u[0]*-1),c&&i&&(u[1]=u[1]*-1),u}function OL(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function zs(e,t){return Math.max(0,t-e)}function $s(e,t){return Math.max(0,e-t)}function sg(e,t,n){return Math.max(0,t-e,e-n)}function AL(e,t){return e?!t:t}function $Oe(e,t,n,r,a,i,s,c){let{affectsX:u,affectsY:d}=t;const{isHorizontal:m,isVertical:f}=t,v=m&&f,{xSnapped:g,ySnapped:b}=n,{minWidth:w,maxWidth:S,minHeight:E,maxHeight:O}=r,{x:j,y:A,width:N,height:T,aspectRatio:P}=e;let R=Math.floor(m?g-e.pointerX:0),D=Math.floor(f?b-e.pointerY:0);const K=N+(u?-R:R),z=T+(d?-D:D),I=-i[0]*N,G=-i[1]*T;let L=sg(K,w,S),Y=sg(z,E,O);if(s){let q=0,F=0;u&&R<0?q=zs(j+R+I,s[0][0]):!u&&R>0&&(q=$s(j+K+I,s[1][0])),d&&D<0?F=zs(A+D+G,s[0][1]):!d&&D>0&&(F=$s(A+z+G,s[1][1])),L=Math.max(L,q),Y=Math.max(Y,F)}if(c){let q=0,F=0;u&&R>0?q=$s(j+R,c[0][0]):!u&&R<0&&(q=zs(j+K,c[1][0])),d&&D>0?F=$s(A+D,c[0][1]):!d&&D<0&&(F=zs(A+z,c[1][1])),L=Math.max(L,q),Y=Math.max(Y,F)}if(a){if(m){const q=sg(K/P,E,O)*P;if(L=Math.max(L,q),s){let F=0;!u&&!d||u&&!d&&v?F=$s(A+G+K/P,s[1][1])*P:F=zs(A+G+(u?R:-R)/P,s[0][1])*P,L=Math.max(L,F)}if(c){let F=0;!u&&!d||u&&!d&&v?F=zs(A+K/P,c[1][1])*P:F=$s(A+(u?R:-R)/P,c[0][1])*P,L=Math.max(L,F)}}if(f){const q=sg(z*P,w,S)/P;if(Y=Math.max(Y,q),s){let F=0;!u&&!d||d&&!u&&v?F=$s(j+z*P+I,s[1][0])/P:F=zs(j+(d?D:-D)*P+I,s[0][0])/P,Y=Math.max(Y,F)}if(c){let F=0;!u&&!d||d&&!u&&v?F=zs(j+z*P,c[1][0])/P:F=$s(j+(d?D:-D)*P,c[0][0])/P,Y=Math.max(Y,F)}}}D=D+(D<0?Y:-Y),R=R+(R<0?L:-L),a&&(v?K>z*P?D=(AL(u,d)?-R:R)/P:R=(AL(u,d)?-D:D)*P:m?(D=R/P,d=u):(R=D*P,u=d));const k=u?j+R:j,H=d?A+D:A;return{width:N+(u?-R:R),height:T+(d?-D:D),x:i[0]*R*(u?-1:1)+k,y:i[1]*D*(d?-1:1)+H}}const p9={width:0,height:0,x:0,y:0},BOe={...p9,pointerX:0,pointerY:0,aspectRatio:1};function UOe(e){return[[0,0],[e.measured.width,e.measured.height]]}function HOe(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,c=n[0]*i,u=n[1]*s;return[[r-c,a-u],[r+i-c,a+s-u]]}function FOe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const i=ca(e);let s={controlDirection:OL("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:d,boundaries:m,keepAspectRatio:f,resizeDirection:v,onResizeStart:g,onResize:b,onResizeEnd:w,shouldResize:S}){let E={...p9},O={...BOe};s={boundaries:m,resizeDirection:v,keepAspectRatio:f,controlDirection:OL(d)};let j,A=null,N=[],T,P,R,D=!1;const K=Pq().on("start",z=>{const{nodeLookup:I,transform:G,snapGrid:L,snapToGrid:Y,nodeOrigin:k,paneDomNode:H}=n();if(j=I.get(t),!j)return;A=(H==null?void 0:H.getBoundingClientRect())??null;const{xSnapped:q,ySnapped:F}=kh(z.sourceEvent,{transform:G,snapGrid:L,snapToGrid:Y,containerBounds:A});E={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},O={...E,pointerX:q,pointerY:F,aspectRatio:E.width/E.height},T=void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(T=I.get(j.parentId),P=T&&j.extent==="parent"?UOe(T):void 0),N=[],R=void 0;for(const[V,B]of I)if(B.parentId===t&&(N.push({id:V,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const $=HOe(B,j,B.origin??k);R?R=[[Math.min($[0][0],R[0][0]),Math.min($[0][1],R[0][1])],[Math.max($[1][0],R[1][0]),Math.max($[1][1],R[1][1])]]:R=$}g==null||g(z,{...E})}).on("drag",z=>{const{transform:I,snapGrid:G,snapToGrid:L,nodeOrigin:Y}=n(),k=kh(z.sourceEvent,{transform:I,snapGrid:G,snapToGrid:L,containerBounds:A}),H=[];if(!j)return;const{x:q,y:F,width:V,height:B}=E,$={},X=j.origin??Y,{width:Z,height:ee,x:le,y:ie}=$Oe(O,s.controlDirection,k,s.boundaries,s.keepAspectRatio,X,P,R),ae=Z!==V,J=ee!==B,re=le!==q&&ae,fe=ie!==F&&J;if(!re&&!fe&&!ae&&!J)return;if((re||fe||X[0]===1||X[1]===1)&&($.x=re?le:E.x,$.y=fe?ie:E.y,E.x=$.x,E.y=$.y,N.length>0)){const De=le-q,Me=ie-F;for(const Ke of N)Ke.position={x:Ke.position.x-De+X[0]*(Z-V),y:Ke.position.y-Me+X[1]*(ee-B)},H.push(Ke)}if((ae||J)&&($.width=ae&&(!s.resizeDirection||s.resizeDirection==="horizontal")?Z:E.width,$.height=J&&(!s.resizeDirection||s.resizeDirection==="vertical")?ee:E.height,E.width=$.width,E.height=$.height),T&&j.expandParent){const De=X[0]*($.width??0);$.x&&$.x<De&&(E.x=De,O.x=O.x-($.x-De));const Me=X[1]*($.height??0);$.y&&$.y<Me&&(E.y=Me,O.y=O.y-($.y-Me))}const ne=zOe({width:E.width,prevWidth:V,height:E.height,prevHeight:B,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),xe={...E,direction:ne};(S==null?void 0:S(z,xe))!==!1&&(D=!0,b==null||b(z,xe),r($,H))}).on("end",z=>{D&&(w==null||w(z,{...E}),a==null||a({...E}),D=!1)});i.call(K)}function u(){i.on(".drag",null)}return{update:c,destroy:u}}const qOe={},NL=e=>{let t;const n=new Set,r=(m,f)=>{const v=typeof m=="function"?m(t):m;if(!Object.is(v,t)){const g=t;t=f??(typeof v!="object"||v===null)?v:Object.assign({},t,v),n.forEach(b=>b(t,g))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(qOe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,a,u);return u},KOe=e=>e?NL(e):NL,{useDebugValue:VOe}=be,{useSyncExternalStoreWithSelector:YOe}=cse,GOe=e=>e;function v9(e,t=GOe,n){const r=YOe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return VOe(r),r}const TL=(e,t)=>{const n=KOe(e),r=(a,i=t)=>v9(n,a,i);return Object.assign(r,n),r},XOe=(e,t)=>e?TL(e,t):TL;function Qt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const wx=x.createContext(null),WOe=wx.Provider,g9=Vi.error001();function ut(e,t){const n=x.useContext(wx);if(n===null)throw new Error(g9);return v9(n,e,t)}function Zt(){const e=x.useContext(wx);if(e===null)throw new Error(g9);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const PL={display:"none"},QOe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},y9="react-flow__node-desc",x9="react-flow__edge-desc",ZOe="react-flow__aria-live",JOe=e=>e.ariaLiveMessage,eAe=e=>e.ariaLabelConfig;function tAe({rfId:e}){const t=ut(JOe);return p.jsx("div",{id:`${ZOe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:QOe,children:t})}function nAe({rfId:e,disableKeyboardA11y:t}){const n=ut(eAe);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${y9}-${e}`,style:PL,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${x9}-${e}`,style:PL,children:n["edge.a11yDescription.default"]}),!t&&p.jsx(tAe,{rfId:e})]})}const Sx=x.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},i)=>{const s=`${e}`.split("-");return p.jsx("div",{className:On(["react-flow__panel",n,...s]),style:r,ref:i,...a,children:t})});Sx.displayName="Panel";function rAe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:p.jsx(Sx,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:p.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const aAe=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},lg=e=>e.id;function iAe(e,t){return Qt(e.selectedNodes.map(lg),t.selectedNodes.map(lg))&&Qt(e.selectedEdges.map(lg),t.selectedEdges.map(lg))}function oAe({onSelectionChange:e}){const t=Zt(),{selectedNodes:n,selectedEdges:r}=ut(aAe,iAe);return x.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(i=>i(a))},[n,r,e]),null}const sAe=e=>!!e.onSelectionChangeHandlers;function lAe({onSelectionChange:e}){const t=ut(sAe);return e||t?p.jsx(oAe,{onSelectionChange:e}):null}const b9=[0,0],cAe={x:0,y:0,zoom:1},uAe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],ML=[...uAe,"rfId"],dAe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),kL={translateExtent:cm,nodeOrigin:b9,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function fAe(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:i,setNodeExtent:s,reset:c,setDefaultNodesAndEdges:u}=ut(dAe,Qt),d=Zt();x.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{m.current=kL,c()}),[]);const m=x.useRef(kL);return x.useEffect(()=>{for(const f of ML){const v=e[f],g=m.current[f];v!==g&&(typeof e[f]>"u"||(f==="nodes"?t(v):f==="edges"?n(v):f==="minZoom"?r(v):f==="maxZoom"?a(v):f==="translateExtent"?i(v):f==="nodeExtent"?s(v):f==="ariaLabelConfig"?d.setState({ariaLabelConfig:tOe(v)}):f==="fitView"?d.setState({fitViewQueued:v}):f==="fitViewOptions"?d.setState({fitViewOptions:v}):d.setState({[f]:v})))}m.current=e},ML.map(f=>e[f])),null}function RL(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function hAe(e){var r;const[t,n]=x.useState(e==="system"?null:e);return x.useEffect(()=>{if(e!=="system"){n(e);return}const a=RL(),i=()=>n(a!=null&&a.matches?"dark":"light");return i(),a==null||a.addEventListener("change",i),()=>{a==null||a.removeEventListener("change",i)}},[e]),t!==null?t:(r=RL())!=null&&r.matches?"dark":"light"}const DL=typeof document<"u"?document:null;function hm(e=null,t={target:DL,actInsideInputWithModifier:!0}){const[n,r]=x.useState(!1),a=x.useRef(!1),i=x.useRef(new Set([])),[s,c]=x.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
`).replace(`

`,`
+`).split(`
`)),m=d.reduce((f,v)=>f.concat(...v),[]);return[d,m]}return[[],[]]},[e]);return x.useEffect(()=>{const u=(t==null?void 0:t.target)??DL,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=g=>{var S,E;if(a.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!a.current||a.current&&!d)&&Jq(g))return!1;const w=LL(g.code,c);if(i.current.add(g[w]),IL(s,i.current,!1)){const O=((E=(S=g.composedPath)==null?void 0:S.call(g))==null?void 0:E[0])||g.target,j=(O==null?void 0:O.nodeName)==="BUTTON"||(O==null?void 0:O.nodeName)==="A";t.preventDefault!==!1&&(a.current||!j)&&g.preventDefault(),r(!0)}},f=g=>{const b=LL(g.code,c);IL(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(g[b]),g.key==="Meta"&&i.current.clear(),a.current=!1},v=()=>{i.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,r]),n}function IL(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function LL(e,t){return t.includes(e)?"code":"key"}const mAe=()=>{const e=Zt();return x.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:i,maxZoom:s,panZoom:c}=e.getState(),u=KA(t,r,a,i,s,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:c,y:u}=s.getBoundingClientRect(),d={x:t.x-c,y:t.y-u},m=n.snapGrid??a,f=n.snapToGrid??i;return cp(d,r,f,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:i}=r.getBoundingClientRect(),s=Fy(t,n);return{x:s.x+a,y:s.y+i}}}),[])};function w9(e,t){const n=[],r=new Map,a=[];for(const i of e)if(i.type==="add"){a.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const c={...i};for(const u of s)pAe(u,c);n.push(c)}return a.length&&a.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function pAe(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function vAe(e,t){return w9(e,t)}function gAe(e,t){return w9(e,t)}function oc(e,t){return{id:e,type:"select",selected:t}}function td(e,t=new Set,n=!1){const r=[];for(const[a,i]of e){const s=t.has(a);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(oc(i.id,s)))}return r}function zL({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const c=t.get(s.id),u=((a=c==null?void 0:c.internals)==null?void 0:a.userNode)??c;u!==void 0&&u!==s&&n.push({id:s.id,item:s,type:"replace"}),u===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function $L(e){return{id:e.id,type:"remove"}}const BL=e=>KCe(e),yAe=e=>Kq(e);function S9(e){return x.forwardRef(e)}const xAe=typeof window<"u"?x.useLayoutEffect:x.useEffect;function UL(e){const[t,n]=x.useState(BigInt(0)),[r]=x.useState(()=>bAe(()=>n(a=>a+BigInt(1))));return xAe(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function bAe(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const E9=x.createContext(null);function wAe({children:e}){const t=Zt(),n=x.useCallback(c=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:m,onNodesChange:f,nodeLookup:v,fitViewQueued:g,onNodesChangeMiddlewareMap:b}=t.getState();let w=u;for(const E of c)w=typeof E=="function"?E(w):E;let S=zL({items:w,lookup:v});for(const E of b.values())S=E(S);m&&d(w),S.length>0?f==null||f(S):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:O,setNodes:j}=t.getState();E&&j(O)})},[]),r=UL(n),a=x.useCallback(c=>{const{edges:u=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:f,edgeLookup:v}=t.getState();let g=u;for(const b of c)g=typeof b=="function"?b(g):b;m?d(g):f&&f(zL({items:g,lookup:v}))},[]),i=UL(a),s=x.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return p.jsx(E9.Provider,{value:s,children:e})}function SAe(){const e=x.useContext(E9);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const EAe=e=>!!e.panZoom;function Ex(){const e=mAe(),t=Zt(),n=SAe(),r=ut(EAe),a=x.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},c=f=>{n.edgeQueue.push(f)},u=f=>{var E,O;const{nodeLookup:v,nodeOrigin:g}=t.getState(),b=BL(f)?f:v.get(f.id),w=b.parentId?Qq(b.position,b.measured,b.parentId,v,g):b.position,S={...b,position:w,width:((E=b.measured)==null?void 0:E.width)??b.width,height:((O=b.measured)==null?void 0:O.height)??b.height};return $d(S)},d=(f,v,g={replace:!1})=>{s(b=>b.map(w=>{if(w.id===f){const S=typeof v=="function"?v(w):v;return g.replace&&BL(S)?S:{...w,...S}}return w}))},m=(f,v,g={replace:!1})=>{c(b=>b.map(w=>{if(w.id===f){const S=typeof v=="function"?v(w):v;return g.replace&&yAe(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var v;return(v=i(f))==null?void 0:v.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(v=>({...v}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:c,addNodes:f=>{const v=Array.isArray(f)?f:[f];n.nodeQueue.push(g=>[...g,...v])},addEdges:f=>{const v=Array.isArray(f)?f:[f];n.edgeQueue.push(g=>[...g,...v])},toObject:()=>{const{nodes:f=[],edges:v=[],transform:g}=t.getState(),[b,w,S]=g;return{nodes:f.map(E=>({...E})),edges:v.map(E=>({...E})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:f=[],edges:v=[]})=>{const{nodes:g,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:E,triggerEdgeChanges:O,onDelete:j,onBeforeDelete:A}=t.getState(),{nodes:N,edges:T}=await WCe({nodesToRemove:f,edgesToRemove:v,nodes:g,edges:b,onBeforeDelete:A}),P=T.length>0,R=N.length>0;if(P){const D=T.map($L);S==null||S(T),O(D)}if(R){const D=N.map($L);w==null||w(N),E(D)}return(R||P)&&(j==null||j({nodes:N,edges:T})),{deletedNodes:N,deletedEdges:T}},getIntersectingNodes:(f,v=!0,g)=>{const b=vL(f),w=b?f:u(f),S=g!==void 0;return w?(g||t.getState().nodes).filter(E=>{const O=t.getState().nodeLookup.get(E.id);if(O&&!b&&(E.id===f.id||!O.internals.positionAbsolute))return!1;const j=$d(S?E:O),A=dm(j,w);return v&&A>0||A>=j.width*j.height||A>=w.width*w.height}):[]},isNodeIntersecting:(f,v,g=!0)=>{const w=vL(f)?f:u(f);if(!w)return!1;const S=dm(w,v);return g&&S>0||S>=v.width*v.height||S>=w.width*w.height},updateNode:d,updateNodeData:(f,v,g={replace:!1})=>{d(f,b=>{const w=typeof v=="function"?v(b):v;return g.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},g)},updateEdge:m,updateEdgeData:(f,v,g={replace:!1})=>{m(f,b=>{const w=typeof v=="function"?v(b):v;return g.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},g)},getNodesBounds:f=>{const{nodeLookup:v,nodeOrigin:g}=t.getState();return VCe(f,{nodeLookup:v,nodeOrigin:g})},getHandleConnections:({type:f,id:v,nodeId:g})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${g}-${f}${v?`-${v}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:f,handleId:v,nodeId:g})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${g}${f?v?`-${f}-${v}`:`-${f}`:""}`))==null?void 0:b.values())??[])},fitView:async f=>{const v=t.getState().fitViewResolver??eOe();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:v}),n.nodeQueue.push(g=>[...g]),v.promise}}},[]);return x.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const HL=e=>e.selected,_Ae=typeof window<"u"?window:void 0;function jAe({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Zt(),{deleteElements:r}=Ex(),a=hm(e,{actInsideInputWithModifier:!1}),i=hm(t,{target:_Ae});x.useEffect(()=>{if(a){const{edges:s,nodes:c}=n.getState();r({nodes:c.filter(HL),edges:s.filter(HL)}),n.setState({nodesSelectionActive:!1})}},[a]),x.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function CAe(e){const t=Zt();x.useEffect(()=>{const n=()=>{var a,i,s,c;if(!e.current||!(((i=(a=e.current).checkVisibility)==null?void 0:i.call(a))??!0))return!1;const r=VA(e.current);(r.height===0||r.width===0)&&((c=(s=t.getState()).onError)==null||c.call(s,"004",Vi.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const _x={position:"absolute",width:"100%",height:"100%",top:0,left:0},OAe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function AAe({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=jc.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:m,maxZoom:f,zoomActivationKeyCode:v,preventScrolling:g=!0,children:b,noWheelClassName:w,noPanClassName:S,onViewportChange:E,isControlledViewport:O,paneClickDistance:j,selectionOnDrag:A}){const N=Zt(),T=x.useRef(null),{userSelectionActive:P,lib:R,connectionInProgress:D}=ut(OAe,Qt),K=hm(v),z=x.useRef();CAe(T);const I=x.useCallback(G=>{E==null||E({x:G[0],y:G[1],zoom:G[2]}),O||N.setState({transform:G})},[E,O]);return x.useEffect(()=>{if(T.current){z.current=LOe({domNode:T.current,minZoom:m,maxZoom:f,translateExtent:d,viewport:u,onDraggingChange:k=>N.setState(H=>H.paneDragging===k?H:{paneDragging:k}),onPanZoomStart:(k,H)=>{const{onViewportChangeStart:q,onMoveStart:F}=N.getState();F==null||F(k,H),q==null||q(H)},onPanZoom:(k,H)=>{const{onViewportChange:q,onMove:F}=N.getState();F==null||F(k,H),q==null||q(H)},onPanZoomEnd:(k,H)=>{const{onViewportChangeEnd:q,onMoveEnd:F}=N.getState();F==null||F(k,H),q==null||q(H)}});const{x:G,y:L,zoom:Y}=z.current.getViewport();return N.setState({panZoom:z.current,transform:[G,L,Y],domNode:T.current.closest(".react-flow")}),()=>{var k;(k=z.current)==null||k.destroy()}}},[]),x.useEffect(()=>{var G;(G=z.current)==null||G.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:K,preventScrolling:g,noPanClassName:S,userSelectionActive:P,noWheelClassName:w,lib:R,onTransformChange:I,connectionInProgress:D,selectionOnDrag:A,paneClickDistance:j})},[e,t,n,r,a,i,s,c,K,g,S,P,w,R,I,D,A,j]),p.jsx("div",{className:"react-flow__renderer",ref:T,style:_x,children:b})}const NAe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function TAe(){const{userSelectionActive:e,userSelectionRect:t}=ut(NAe,Qt);return e&&t?p.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const GS=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},PAe=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function MAe({isSelecting:e,selectionKeyPressed:t,selectionMode:n=um.Full,panOnDrag:r,paneClickDistance:a,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:m,onPaneMouseEnter:f,onPaneMouseMove:v,onPaneMouseLeave:g,children:b}){const w=Zt(),{userSelectionActive:S,elementsSelectable:E,dragging:O,connectionInProgress:j}=ut(PAe,Qt),A=E&&(e||S),N=x.useRef(null),T=x.useRef(),P=x.useRef(new Set),R=x.useRef(new Set),D=x.useRef(!1),K=q=>{if(D.current||j){D.current=!1;return}u==null||u(q),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},z=q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){q.preventDefault();return}d==null||d(q)},I=m?q=>m(q):void 0,G=q=>{D.current&&(q.stopPropagation(),D.current=!1)},L=q=>{var ee,le;const{domNode:F}=w.getState();if(T.current=F==null?void 0:F.getBoundingClientRect(),!T.current)return;const V=q.target===N.current;if(!V&&!!q.target.closest(".nokey")||!e||!(i&&V||t)||q.button!==0||!q.isPrimary)return;(le=(ee=q.target)==null?void 0:ee.setPointerCapture)==null||le.call(ee,q.pointerId),D.current=!1;const{x:X,y:Z}=ai(q.nativeEvent,T.current);w.setState({userSelectionRect:{width:0,height:0,startX:X,startY:Z,x:X,y:Z}}),V||(q.stopPropagation(),q.preventDefault())},Y=q=>{const{userSelectionRect:F,transform:V,nodeLookup:B,edgeLookup:$,connectionLookup:X,triggerNodeChanges:Z,triggerEdgeChanges:ee,defaultEdgeOptions:le,resetSelectedElements:ie}=w.getState();if(!T.current||!F)return;const{x:ae,y:J}=ai(q.nativeEvent,T.current),{startX:re,startY:fe}=F;if(!D.current){const Me=t?0:a;if(Math.hypot(ae-re,J-fe)<=Me)return;ie(),s==null||s(q)}D.current=!0;const ne={startX:re,startY:fe,x:ae<re?ae:re,y:J<fe?J:fe,width:Math.abs(ae-re),height:Math.abs(J-fe)},xe=P.current,ye=R.current;P.current=new Set(qA(B,ne,V,n===um.Partial,!0).map(Me=>Me.id)),R.current=new Set;const De=(le==null?void 0:le.selectable)??!0;for(const Me of P.current){const Ke=X.get(Me);if(Ke)for(const{edgeId:Je}of Ke.values()){const nt=$.get(Je);nt&&(nt.selectable??De)&&R.current.add(Je)}}if(!gL(xe,P.current)){const Me=td(B,P.current,!0);Z(Me)}if(!gL(ye,R.current)){const Me=td($,R.current);ee(Me)}w.setState({userSelectionRect:ne,userSelectionActive:!0,nodesSelectionActive:!1})},k=q=>{var F,V;q.button===0&&((V=(F=q.target)==null?void 0:F.releasePointerCapture)==null||V.call(F,q.pointerId),!S&&q.target===N.current&&w.getState().userSelectionRect&&(K==null||K(q)),w.setState({userSelectionActive:!1,userSelectionRect:null}),D.current&&(c==null||c(q),w.setState({nodesSelectionActive:P.current.size>0})))},H=r===!0||Array.isArray(r)&&r.includes(0);return p.jsxs("div",{className:On(["react-flow__pane",{draggable:H,dragging:O,selection:e}]),onClick:A?void 0:GS(K,N),onContextMenu:GS(z,N),onWheel:GS(I,N),onPointerEnter:A?void 0:f,onPointerMove:A?Y:v,onPointerUp:A?k:void 0,onPointerDownCapture:A?L:void 0,onClickCapture:A?G:void 0,onPointerLeave:g,ref:N,style:_x,children:[b,p.jsx(TAe,{})]})}function nj({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:c,onError:u}=t.getState(),d=c.get(e);if(!d){u==null||u("012",Vi.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&s)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):a([e])}function _9({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:i,nodeClickDistance:s}){const c=Zt(),[u,d]=x.useState(!1),m=x.useRef();return x.useEffect(()=>{m.current=EOe({getStoreItems:()=>c.getState(),onNodeMouseDown:f=>{nj({id:f,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),x.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:a,nodeClickDistance:s}),()=>{var f;(f=m.current)==null||f.destroy()}},[n,r,t,i,e,a,s]),u}const kAe=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function j9(){const e=Zt();return x.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:i,nodesDraggable:s,onError:c,updateNodePositions:u,nodeLookup:d,nodeOrigin:m}=e.getState(),f=new Map,v=kAe(s),g=a?i[0]:5,b=a?i[1]:5,w=n.direction.x*g*n.factor,S=n.direction.y*b*n.factor;for(const[,E]of d){if(!v(E))continue;let O={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+S};a&&(O=lp(O,i));const{position:j,positionAbsolute:A}=Vq({nodeId:E.id,nextPosition:O,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:c});E.position=j,E.internals.positionAbsolute=A,f.set(E.id,E)}u(f)},[])}const ZA=x.createContext(null),RAe=ZA.Provider;ZA.Consumer;const C9=()=>x.useContext(ZA),DAe=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),IAe=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:i,connection:s}=r,{fromHandle:c,toHandle:u,isValid:d}=s,m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:i===Id.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!a,valid:m&&d}};function LAe({type:e="source",position:t=Le.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:s,onConnect:c,children:u,className:d,onMouseDown:m,onTouchStart:f,...v},g){var Y,k;const b=s||null,w=e==="target",S=Zt(),E=C9(),{connectOnClick:O,noPanClassName:j,rfId:A}=ut(DAe,Qt),{connectingFrom:N,connectingTo:T,clickConnecting:P,isPossibleEndHandle:R,connectionInProcess:D,clickConnectionInProcess:K,valid:z}=ut(IAe(E,b,e),Qt);E||(k=(Y=S.getState()).onError)==null||k.call(Y,"010",Vi.error010());const I=H=>{const{defaultEdgeOptions:q,onConnect:F,hasDefaultEdges:V}=S.getState(),B={...q,...H};if(V){const{edges:$,setEdges:X}=S.getState();X(sOe(B,$))}F==null||F(B),c==null||c(B)},G=H=>{if(!E)return;const q=e9(H.nativeEvent);if(a&&(q&&H.button===0||!q)){const F=S.getState();tj.onPointerDown(H.nativeEvent,{handleDomNode:H.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:w,handleId:b,nodeId:E,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...V)=>{var B,$;return($=(B=S.getState()).onConnectEnd)==null?void 0:$.call(B,...V)},updateConnection:F.updateConnection,onConnect:I,isValidConnection:n||((...V)=>{var B,$;return(($=(B=S.getState()).isValidConnection)==null?void 0:$.call(B,...V))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}q?m==null||m(H):f==null||f(H)},L=H=>{const{onClickConnectStart:q,onClickConnectEnd:F,connectionClickStartHandle:V,connectionMode:B,isValidConnection:$,lib:X,rfId:Z,nodeLookup:ee,connection:le}=S.getState();if(!E||!V&&!a)return;if(!V){q==null||q(H.nativeEvent,{nodeId:E,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:E,type:e,id:b}});return}const ie=Zq(H.target),ae=n||$,{connection:J,isValid:re}=tj.isValid(H.nativeEvent,{handle:{nodeId:E,id:b,type:e},connectionMode:B,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ae,flowId:Z,doc:ie,lib:X,nodeLookup:ee});re&&J&&I(J);const fe=structuredClone(le);delete fe.inProgress,fe.toPosition=fe.toHandle?fe.toHandle.position:null,F==null||F(H,fe),S.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":b,"data-nodeid":E,"data-handlepos":t,"data-id":`${A}-${E}-${b}-${e}`,className:On(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",j,d,{source:!w,target:w,connectable:r,connectablestart:a,connectableend:i,clickconnecting:P,connectingfrom:N,connectingto:T,valid:z,connectionindicator:r&&(!D||R)&&(D||K?i:a)}]),onMouseDown:G,onTouchStart:G,onClick:O?L:void 0,ref:g,...v,children:u})}const Hd=x.memo(S9(LAe));function zAe({data:e,isConnectable:t,sourcePosition:n=Le.Bottom}){return p.jsxs(p.Fragment,{children:[e==null?void 0:e.label,p.jsx(Hd,{type:"source",position:n,isConnectable:t})]})}function $Ae({data:e,isConnectable:t,targetPosition:n=Le.Top,sourcePosition:r=Le.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(Hd,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,p.jsx(Hd,{type:"source",position:r,isConnectable:t})]})}function BAe(){return null}function UAe({data:e,isConnectable:t,targetPosition:n=Le.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(Hd,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const qy={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},FL={input:zAe,default:$Ae,output:UAe,group:BAe};function HAe(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const FAe=e=>{const{width:t,height:n,x:r,y:a}=sp(e.nodeLookup,{filter:i=>!!i.selected});return{width:ri(t)?t:null,height:ri(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function qAe({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Zt(),{width:a,height:i,transformString:s,userSelectionActive:c}=ut(FAe,Qt),u=j9(),d=x.useRef(null);x.useEffect(()=>{var g;n||(g=d.current)==null||g.focus({preventScroll:!0})},[n]);const m=!c&&a!==null&&i!==null;if(_9({nodeRef:d,disabled:!m}),!m)return null;const f=e?g=>{const b=r.getState().nodes.filter(w=>w.selected);e(g,b)}:void 0,v=g=>{Object.prototype.hasOwnProperty.call(qy,g.key)&&(g.preventDefault(),u({direction:qy[g.key],factor:g.shiftKey?4:1}))};return p.jsx("div",{className:On(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:p.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:v,style:{width:a,height:i}})})}const qL=typeof window<"u"?window:void 0,KAe=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function O9({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:m,selectionMode:f,onSelectionStart:v,onSelectionEnd:g,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:E,zoomOnScroll:O,zoomOnPinch:j,panOnScroll:A,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:P,panOnDrag:R,defaultViewport:D,translateExtent:K,minZoom:z,maxZoom:I,preventScrolling:G,onSelectionContextMenu:L,noWheelClassName:Y,noPanClassName:k,disableKeyboardA11y:H,onViewportChange:q,isControlledViewport:F}){const{nodesSelectionActive:V,userSelectionActive:B}=ut(KAe,Qt),$=hm(d,{target:qL}),X=hm(w,{target:qL}),Z=X||R,ee=X||A,le=m&&Z!==!0,ie=$||B||le;return jAe({deleteKeyCode:u,multiSelectionKeyCode:b}),p.jsx(AAe,{onPaneContextMenu:i,elementsSelectable:E,zoomOnScroll:O,zoomOnPinch:j,panOnScroll:ee,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:P,panOnDrag:!$&&Z,defaultViewport:D,translateExtent:K,minZoom:z,maxZoom:I,zoomActivationKeyCode:S,preventScrolling:G,noWheelClassName:Y,noPanClassName:k,onViewportChange:q,isControlledViewport:F,paneClickDistance:c,selectionOnDrag:le,children:p.jsxs(MAe,{onSelectionStart:v,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Z,isSelecting:!!ie,selectionMode:f,selectionKeyPressed:$,paneClickDistance:c,selectionOnDrag:le,children:[e,V&&p.jsx(qAe,{onSelectionContextMenu:L,noPanClassName:k,disableKeyboardA11y:H})]})})}O9.displayName="FlowRenderer";const VAe=x.memo(O9),YAe=e=>t=>e?qA(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function GAe(e){return ut(x.useCallback(YAe(e),[e]),Qt)}const XAe=e=>e.updateNodeInternals;function WAe(){const e=ut(XAe),[t]=x.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const i=a.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:a.target,force:!0})}),e(r)}));return x.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function QAe({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=Zt(),i=x.useRef(null),s=x.useRef(null),c=x.useRef(e.sourcePosition),u=x.useRef(e.targetPosition),d=x.useRef(t),m=n&&!!e.internals.handleBounds;return x.useEffect(()=>{i.current&&!e.hidden&&(!m||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[m,e.hidden]),x.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),x.useEffect(()=>{if(i.current){const f=d.current!==t,v=c.current!==e.sourcePosition,g=u.current!==e.targetPosition;(f||v||g)&&(d.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function ZAe({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:i,onDoubleClick:s,nodesDraggable:c,elementsSelectable:u,nodesConnectable:d,nodesFocusable:m,resizeObserver:f,noDragClassName:v,noPanClassName:g,disableKeyboardA11y:b,rfId:w,nodeTypes:S,nodeClickDistance:E,onError:O}){const{node:j,internals:A,isParent:N}=ut(ae=>{const J=ae.nodeLookup.get(e),re=ae.parentLookup.has(e);return{node:J,internals:J.internals,isParent:re}},Qt);let T=j.type||"default",P=(S==null?void 0:S[T])||FL[T];P===void 0&&(O==null||O("003",Vi.error003(T)),T="default",P=(S==null?void 0:S.default)||FL.default);const R=!!(j.draggable||c&&typeof j.draggable>"u"),D=!!(j.selectable||u&&typeof j.selectable>"u"),K=!!(j.connectable||d&&typeof j.connectable>"u"),z=!!(j.focusable||m&&typeof j.focusable>"u"),I=Zt(),G=Wq(j),L=QAe({node:j,nodeType:T,hasDimensions:G,resizeObserver:f}),Y=_9({nodeRef:L,disabled:j.hidden||!R,noDragClassName:v,handleSelector:j.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:E}),k=j9();if(j.hidden)return null;const H=as(j),q=HAe(j),F=D||R||t||n||r||a,V=n?ae=>n(ae,{...A.userNode}):void 0,B=r?ae=>r(ae,{...A.userNode}):void 0,$=a?ae=>a(ae,{...A.userNode}):void 0,X=i?ae=>i(ae,{...A.userNode}):void 0,Z=s?ae=>s(ae,{...A.userNode}):void 0,ee=ae=>{const{selectNodesOnDrag:J,nodeDragThreshold:re}=I.getState();D&&(!J||!R||re>0)&&nj({id:e,store:I,nodeRef:L}),t&&t(ae,{...A.userNode})},le=ae=>{if(!(Jq(ae.nativeEvent)||b)){if(Uq.includes(ae.key)&&D){const J=ae.key==="Escape";nj({id:e,store:I,unselect:J,nodeRef:L})}else if(R&&j.selected&&Object.prototype.hasOwnProperty.call(qy,ae.key)){ae.preventDefault();const{ariaLabelConfig:J}=I.getState();I.setState({ariaLiveMessage:J["node.a11yDescription.ariaLiveMessage"]({direction:ae.key.replace("Arrow","").toLowerCase(),x:~~A.positionAbsolute.x,y:~~A.positionAbsolute.y})}),k({direction:qy[ae.key],factor:ae.shiftKey?4:1})}}},ie=()=>{var ye;if(b||!((ye=L.current)!=null&&ye.matches(":focus-visible")))return;const{transform:ae,width:J,height:re,autoPanOnNodeFocus:fe,setCenter:ne}=I.getState();if(!fe)return;qA(new Map([[e,j]]),{x:0,y:0,width:J,height:re},ae,!0).length>0||ne(j.position.x+H.width/2,j.position.y+H.height/2,{zoom:ae[2]})};return p.jsx("div",{className:On(["react-flow__node",`react-flow__node-${T}`,{[g]:R},j.className,{selected:j.selected,selectable:D,parent:N,draggable:R,dragging:Y}]),ref:L,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:G?"visible":"hidden",...j.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:B,onMouseLeave:$,onContextMenu:X,onClick:ee,onDoubleClick:Z,onKeyDown:z?le:void 0,tabIndex:z?0:void 0,onFocus:z?ie:void 0,role:j.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${y9}-${w}`,"aria-label":j.ariaLabel,...j.domAttributes,children:p.jsx(RAe,{value:e,children:p.jsx(P,{id:e,data:j.data,type:T,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:j.selected??!1,selectable:D,draggable:R,deletable:j.deletable??!0,isConnectable:K,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:Y,dragHandle:j.dragHandle,zIndex:A.z,parentId:j.parentId,...H})})})}var JAe=x.memo(ZAe);const eNe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function A9(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:i}=ut(eNe,Qt),s=GAe(e.onlyRenderVisibleElements),c=WAe();return p.jsx("div",{className:"react-flow__nodes",style:_x,children:s.map(u=>p.jsx(JAe,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:i},u))})}A9.displayName="NodeRenderer";const tNe=x.memo(A9);function nNe(e){return ut(x.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const i=n.nodeLookup.get(a.source),s=n.nodeLookup.get(a.target);i&&s&&aOe({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),Qt)}const rNe=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return p.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},aNe=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return p.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},KL={[Ld.Arrow]:rNe,[Ld.ArrowClosed]:aNe};function iNe(e){const t=Zt();return x.useMemo(()=>{var a,i;return Object.prototype.hasOwnProperty.call(KL,e)?KL[e]:((i=(a=t.getState()).onError)==null||i.call(a,"009",Vi.error009(e)),null)},[e])}const oNe=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:c="auto-start-reverse"})=>{const u=iNe(t);return u?p.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:c,refX:"0",refY:"0",children:p.jsx(u,{color:n,strokeWidth:s})}):null},N9=({defaultColor:e,rfId:t})=>{const n=ut(i=>i.edges),r=ut(i=>i.defaultEdgeOptions),a=x.useMemo(()=>fOe(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?p.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:p.jsx("defs",{children:a.map(i=>p.jsx(oNe,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};N9.displayName="MarkerDefinitions";var sNe=x.memo(N9);function T9({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...m}){const[f,v]=x.useState({x:1,y:0,width:0,height:0}),g=On(["react-flow__edge-textwrapper",d]),b=x.useRef(null);return x.useEffect(()=>{if(b.current){const w=b.current.getBBox();v({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?p.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:g,visibility:f.width?"visible":"hidden",...m,children:[a&&p.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),p.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}T9.displayName="EdgeText";const lNe=x.memo(T9);function jx({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:s,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:d=20,...m}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...m,d:e,fill:"none",className:On(["react-flow__edge-path",m.className])}),d?p.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&ri(t)&&ri(n)?p.jsx(lNe,{x:t,y:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:s,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function VL({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Le.Left||e===Le.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function P9({sourceX:e,sourceY:t,sourcePosition:n=Le.Bottom,targetX:r,targetY:a,targetPosition:i=Le.Top}){const[s,c]=VL({pos:n,x1:e,y1:t,x2:r,y2:a}),[u,d]=VL({pos:i,x1:r,y1:a,x2:e,y2:t}),[m,f,v,g]=t9({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:s,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${s},${c} ${u},${d} ${r},${a}`,m,f,v,g]}function M9(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:s,targetPosition:c,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:v,labelBgBorderRadius:g,style:b,markerEnd:w,markerStart:S,interactionWidth:E})=>{const[O,j,A]=P9({sourceX:n,sourceY:r,sourcePosition:s,targetX:a,targetY:i,targetPosition:c}),N=e.isInternal?void 0:t;return p.jsx(jx,{id:N,path:O,labelX:j,labelY:A,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:v,labelBgBorderRadius:g,style:b,markerEnd:w,markerStart:S,interactionWidth:E})})}const cNe=M9({isInternal:!1}),k9=M9({isInternal:!0});cNe.displayName="SimpleBezierEdge";k9.displayName="SimpleBezierEdgeInternal";function R9(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:v,sourcePosition:g=Le.Bottom,targetPosition:b=Le.Top,markerEnd:w,markerStart:S,pathOptions:E,interactionWidth:O})=>{const[j,A,N]=Z_({sourceX:n,sourceY:r,sourcePosition:g,targetX:a,targetY:i,targetPosition:b,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),T=e.isInternal?void 0:t;return p.jsx(jx,{id:T,path:j,labelX:A,labelY:N,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:v,markerEnd:w,markerStart:S,interactionWidth:O})})}const D9=R9({isInternal:!1}),I9=R9({isInternal:!0});D9.displayName="SmoothStepEdge";I9.displayName="SmoothStepEdgeInternal";function L9(e){return x.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return p.jsx(D9,{...n,id:r,pathOptions:x.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const uNe=L9({isInternal:!1}),z9=L9({isInternal:!0});uNe.displayName="StepEdge";z9.displayName="StepEdgeInternal";function $9(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:v,markerEnd:g,markerStart:b,interactionWidth:w})=>{const[S,E,O]=a9({sourceX:n,sourceY:r,targetX:a,targetY:i}),j=e.isInternal?void 0:t;return p.jsx(jx,{id:j,path:S,labelX:E,labelY:O,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:v,markerEnd:g,markerStart:b,interactionWidth:w})})}const dNe=$9({isInternal:!1}),B9=$9({isInternal:!0});dNe.displayName="StraightEdge";B9.displayName="StraightEdgeInternal";function U9(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:s=Le.Bottom,targetPosition:c=Le.Top,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:v,labelBgBorderRadius:g,style:b,markerEnd:w,markerStart:S,pathOptions:E,interactionWidth:O})=>{const[j,A,N]=n9({sourceX:n,sourceY:r,sourcePosition:s,targetX:a,targetY:i,targetPosition:c,curvature:E==null?void 0:E.curvature}),T=e.isInternal?void 0:t;return p.jsx(jx,{id:T,path:j,labelX:A,labelY:N,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:v,labelBgBorderRadius:g,style:b,markerEnd:w,markerStart:S,interactionWidth:O})})}const fNe=U9({isInternal:!1}),H9=U9({isInternal:!0});fNe.displayName="BezierEdge";H9.displayName="BezierEdgeInternal";const YL={default:H9,straight:B9,step:z9,smoothstep:I9,simplebezier:k9},GL={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},hNe=(e,t,n)=>n===Le.Left?e-t:n===Le.Right?e+t:e,mNe=(e,t,n)=>n===Le.Top?e-t:n===Le.Bottom?e+t:e,XL="react-flow__edgeupdater";function WL({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:i,onMouseOut:s,type:c}){return p.jsx("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:s,className:On([XL,`${XL}-${c}`]),cx:hNe(t,r,e),cy:mNe(n,r,e),r,stroke:"transparent",fill:"transparent"})}function pNe({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:i,targetY:s,sourcePosition:c,targetPosition:u,onReconnect:d,onReconnectStart:m,onReconnectEnd:f,setReconnecting:v,setUpdateHover:g}){const b=Zt(),w=(A,N)=>{if(A.button!==0)return;const{autoPanOnConnect:T,domNode:P,connectionMode:R,connectionRadius:D,lib:K,onConnectStart:z,cancelConnection:I,nodeLookup:G,rfId:L,panBy:Y,updateConnection:k}=b.getState(),H=N.type==="target",q=(B,$)=>{v(!1),f==null||f(B,n,N.type,$)},F=B=>d==null?void 0:d(n,B),V=(B,$)=>{v(!0),m==null||m(A,n,N.type),z==null||z(B,$)};tj.onPointerDown(A.nativeEvent,{autoPanOnConnect:T,connectionMode:R,connectionRadius:D,domNode:P,handleId:N.id,nodeId:N.nodeId,nodeLookup:G,isTarget:H,edgeUpdaterType:N.type,lib:K,flowId:L,cancelConnection:I,panBy:Y,isValidConnection:(...B)=>{var $,X;return((X=($=b.getState()).isValidConnection)==null?void 0:X.call($,...B))??!0},onConnect:F,onConnectStart:V,onConnectEnd:(...B)=>{var $,X;return(X=($=b.getState()).onConnectEnd)==null?void 0:X.call($,...B)},onReconnectEnd:q,updateConnection:k,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:A.currentTarget})},S=A=>w(A,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=A=>w(A,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),O=()=>g(!0),j=()=>g(!1);return p.jsxs(p.Fragment,{children:[(e===!0||e==="source")&&p.jsx(WL,{position:c,centerX:r,centerY:a,radius:t,onMouseDown:S,onMouseEnter:O,onMouseOut:j,type:"source"}),(e===!0||e==="target")&&p.jsx(WL,{position:u,centerX:i,centerY:s,radius:t,onMouseDown:E,onMouseEnter:O,onMouseOut:j,type:"target"})]})}function vNe({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:i,onContextMenu:s,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,reconnectRadius:m,onReconnect:f,onReconnectStart:v,onReconnectEnd:g,rfId:b,edgeTypes:w,noPanClassName:S,onError:E,disableKeyboardA11y:O}){let j=ut(ne=>ne.edgeLookup.get(e));const A=ut(ne=>ne.defaultEdgeOptions);j=A?{...A,...j}:j;let N=j.type||"default",T=(w==null?void 0:w[N])||YL[N];T===void 0&&(E==null||E("011",Vi.error011(N)),N="default",T=(w==null?void 0:w.default)||YL.default);const P=!!(j.focusable||t&&typeof j.focusable>"u"),R=typeof f<"u"&&(j.reconnectable||n&&typeof j.reconnectable>"u"),D=!!(j.selectable||r&&typeof j.selectable>"u"),K=x.useRef(null),[z,I]=x.useState(!1),[G,L]=x.useState(!1),Y=Zt(),{zIndex:k,sourceX:H,sourceY:q,targetX:F,targetY:V,sourcePosition:B,targetPosition:$}=ut(x.useCallback(ne=>{const xe=ne.nodeLookup.get(j.source),ye=ne.nodeLookup.get(j.target);if(!xe||!ye)return{zIndex:j.zIndex,...GL};const De=dOe({id:e,sourceNode:xe,targetNode:ye,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:ne.connectionMode,onError:E});return{zIndex:rOe({selected:j.selected,zIndex:j.zIndex,sourceNode:xe,targetNode:ye,elevateOnSelect:ne.elevateEdgesOnSelect,zIndexMode:ne.zIndexMode}),...De||GL}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex]),Qt),X=x.useMemo(()=>j.markerStart?`url('#${J_(j.markerStart,b)}')`:void 0,[j.markerStart,b]),Z=x.useMemo(()=>j.markerEnd?`url('#${J_(j.markerEnd,b)}')`:void 0,[j.markerEnd,b]);if(j.hidden||H===null||q===null||F===null||V===null)return null;const ee=ne=>{var Me;const{addSelectedEdges:xe,unselectNodesAndEdges:ye,multiSelectionActive:De}=Y.getState();D&&(Y.setState({nodesSelectionActive:!1}),j.selected&&De?(ye({nodes:[],edges:[j]}),(Me=K.current)==null||Me.blur()):xe([e])),a&&a(ne,j)},le=i?ne=>{i(ne,{...j})}:void 0,ie=s?ne=>{s(ne,{...j})}:void 0,ae=c?ne=>{c(ne,{...j})}:void 0,J=u?ne=>{u(ne,{...j})}:void 0,re=d?ne=>{d(ne,{...j})}:void 0,fe=ne=>{var xe;if(!O&&Uq.includes(ne.key)&&D){const{unselectNodesAndEdges:ye,addSelectedEdges:De}=Y.getState();ne.key==="Escape"?((xe=K.current)==null||xe.blur(),ye({edges:[j]})):De([e])}};return p.jsx("svg",{style:{zIndex:k},children:p.jsxs("g",{className:On(["react-flow__edge",`react-flow__edge-${N}`,j.className,S,{selected:j.selected,animated:j.animated,inactive:!D&&!a,updating:z,selectable:D}]),onClick:ee,onDoubleClick:le,onContextMenu:ie,onMouseEnter:ae,onMouseMove:J,onMouseLeave:re,onKeyDown:P?fe:void 0,tabIndex:P?0:void 0,role:j.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":j.ariaLabel===null?void 0:j.ariaLabel||`Edge from ${j.source} to ${j.target}`,"aria-describedby":P?`${x9}-${b}`:void 0,ref:K,...j.domAttributes,children:[!G&&p.jsx(T,{id:e,source:j.source,target:j.target,type:j.type,selected:j.selected,animated:j.animated,selectable:D,deletable:j.deletable??!0,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,sourceX:H,sourceY:q,targetX:F,targetY:V,sourcePosition:B,targetPosition:$,data:j.data,style:j.style,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerStart:X,markerEnd:Z,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth}),R&&p.jsx(pNe,{edge:j,isReconnectable:R,reconnectRadius:m,onReconnect:f,onReconnectStart:v,onReconnectEnd:g,sourceX:H,sourceY:q,targetX:F,targetY:V,sourcePosition:B,targetPosition:$,setUpdateHover:I,setReconnecting:L})]})})}var gNe=x.memo(vNe);const yNe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function F9({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:f,onEdgeDoubleClick:v,onReconnectStart:g,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:E,elementsSelectable:O,onError:j}=ut(yNe,Qt),A=nNe(t);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(sNe,{defaultColor:e,rfId:n}),A.map(N=>p.jsx(gNe,{id:N,edgesFocusable:S,edgesReconnectable:E,elementsSelectable:O,noPanClassName:a,onReconnect:i,onContextMenu:s,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:m,reconnectRadius:f,onDoubleClick:v,onReconnectStart:g,onReconnectEnd:b,rfId:n,onError:j,edgeTypes:r,disableKeyboardA11y:w},N))]})}F9.displayName="EdgeRenderer";const xNe=x.memo(F9),bNe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function wNe({children:e}){const t=ut(bNe);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function SNe(e){const t=Ex(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const ENe=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function _Ne(e){const t=ut(ENe),n=Zt();return x.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function jNe(e){return e.connection.inProgress?{...e.connection,to:cp(e.connection.to,e.transform)}:{...e.connection}}function CNe(e){return jNe}function ONe(e){const t=CNe();return ut(t,Qt)}const ANe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function NNe({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:i,height:s,isValid:c,inProgress:u}=ut(ANe,Qt);return!(i&&a&&u)?null:p.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:On(["react-flow__connection",qq(c)]),children:p.jsx(q9,{style:t,type:n,CustomComponent:r,isValid:c})})})}const q9=({style:e,type:t=Vs.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:i,fromNode:s,fromHandle:c,fromPosition:u,to:d,toNode:m,toHandle:f,toPosition:v,pointer:g}=ONe();if(!a)return;if(n)return p.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:c,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:v,connectionStatus:qq(r),toNode:m,toHandle:f,pointer:g});let b="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:v};switch(t){case Vs.Bezier:[b]=n9(w);break;case Vs.SimpleBezier:[b]=P9(w);break;case Vs.Step:[b]=Z_({...w,borderRadius:0});break;case Vs.SmoothStep:[b]=Z_(w);break;default:[b]=a9(w)}return p.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};q9.displayName="ConnectionLine";const TNe={};function QL(e=TNe){x.useRef(e),Zt(),x.useEffect(()=>{},[e])}function PNe(){Zt(),x.useRef(!1),x.useEffect(()=>{},[])}function K9({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:f,onSelectionStart:v,onSelectionEnd:g,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:E,selectionKeyCode:O,selectionOnDrag:j,selectionMode:A,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:P,deleteKeyCode:R,onlyRenderVisibleElements:D,elementsSelectable:K,defaultViewport:z,translateExtent:I,minZoom:G,maxZoom:L,preventScrolling:Y,defaultMarkerColor:k,zoomOnScroll:H,zoomOnPinch:q,panOnScroll:F,panOnScrollSpeed:V,panOnScrollMode:B,zoomOnDoubleClick:$,panOnDrag:X,onPaneClick:Z,onPaneMouseEnter:ee,onPaneMouseMove:le,onPaneMouseLeave:ie,onPaneScroll:ae,onPaneContextMenu:J,paneClickDistance:re,nodeClickDistance:fe,onEdgeContextMenu:ne,onEdgeMouseEnter:xe,onEdgeMouseMove:ye,onEdgeMouseLeave:De,reconnectRadius:Me,onReconnect:Ke,onReconnectStart:Je,onReconnectEnd:nt,noDragClassName:pn,noWheelClassName:Bn,noPanClassName:Et,disableKeyboardA11y:vn,nodeExtent:It,rfId:Sr,viewport:dn,onViewportChange:Mr}){return QL(e),QL(t),PNe(),SNe(n),_Ne(dn),p.jsx(VAe,{onPaneClick:Z,onPaneMouseEnter:ee,onPaneMouseMove:le,onPaneMouseLeave:ie,onPaneContextMenu:J,onPaneScroll:ae,paneClickDistance:re,deleteKeyCode:R,selectionKeyCode:O,selectionOnDrag:j,selectionMode:A,onSelectionStart:v,onSelectionEnd:g,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:P,elementsSelectable:K,zoomOnScroll:H,zoomOnPinch:q,zoomOnDoubleClick:$,panOnScroll:F,panOnScrollSpeed:V,panOnScrollMode:B,panOnDrag:X,defaultViewport:z,translateExtent:I,minZoom:G,maxZoom:L,onSelectionContextMenu:f,preventScrolling:Y,noDragClassName:pn,noWheelClassName:Bn,noPanClassName:Et,disableKeyboardA11y:vn,onViewportChange:Mr,isControlledViewport:!!dn,children:p.jsxs(wNe,{children:[p.jsx(xNe,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:s,onReconnect:Ke,onReconnectStart:Je,onReconnectEnd:nt,onlyRenderVisibleElements:D,onEdgeContextMenu:ne,onEdgeMouseEnter:xe,onEdgeMouseMove:ye,onEdgeMouseLeave:De,reconnectRadius:Me,defaultMarkerColor:k,noPanClassName:Et,disableKeyboardA11y:vn,rfId:Sr}),p.jsx(NNe,{style:w,type:b,component:S,containerStyle:E}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(tNe,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:fe,onlyRenderVisibleElements:D,noPanClassName:Et,noDragClassName:pn,disableKeyboardA11y:vn,nodeExtent:It,rfId:Sr}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}K9.displayName="GraphView";const MNe=x.memo(K9),ZL=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:s,fitViewOptions:c,minZoom:u=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:f,zIndexMode:v="basic"}={})=>{const g=new Map,b=new Map,w=new Map,S=new Map,E=r??t??[],O=n??e??[],j=m??[0,0],A=f??cm;s9(w,S,E);const N=ej(O,g,b,{nodeOrigin:j,nodeExtent:A,zIndexMode:v});let T=[0,0,1];if(s&&a&&i){const P=sp(g,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:R,y:D,zoom:K}=KA(P,a,i,u,d,(c==null?void 0:c.padding)??.1);T=[R,D,K]}return{rfId:"1",width:a??0,height:i??0,transform:T,nodes:O,nodesInitialized:N,nodeLookup:g,parentLookup:b,edges:E,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:cm,nodeExtent:A,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Id.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:j,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:c,fitViewResolver:null,connection:{...Fq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:QCe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Hq,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},kNe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:s,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:f,zIndexMode:v})=>XOe((g,b)=>{async function w(){const{nodeLookup:S,panZoom:E,fitViewOptions:O,fitViewResolver:j,width:A,height:N,minZoom:T,maxZoom:P}=b();E&&(await XCe({nodes:S,width:A,height:N,panZoom:E,minZoom:T,maxZoom:P},O),j==null||j.resolve(!0),g({fitViewResolver:null}))}return{...ZL({nodes:e,edges:t,width:a,height:i,fitView:s,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:v}),setNodes:S=>{const{nodeLookup:E,parentLookup:O,nodeOrigin:j,elevateNodesOnSelect:A,fitViewQueued:N,zIndexMode:T}=b(),P=ej(S,E,O,{nodeOrigin:j,nodeExtent:f,elevateNodesOnSelect:A,checkEquality:!0,zIndexMode:T});N&&P?(w(),g({nodes:S,nodesInitialized:P,fitViewQueued:!1,fitViewOptions:void 0})):g({nodes:S,nodesInitialized:P})},setEdges:S=>{const{connectionLookup:E,edgeLookup:O}=b();s9(E,O,S),g({edges:S})},setDefaultNodesAndEdges:(S,E)=>{if(S){const{setNodes:O}=b();O(S),g({hasDefaultNodes:!0})}if(E){const{setEdges:O}=b();O(E),g({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:E,nodeLookup:O,parentLookup:j,domNode:A,nodeOrigin:N,nodeExtent:T,debug:P,fitViewQueued:R,zIndexMode:D}=b(),{changes:K,updatedInternals:z}=xOe(S,O,j,A,N,T,D);z&&(pOe(O,j,{nodeOrigin:N,nodeExtent:T,zIndexMode:D}),R?(w(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(K==null?void 0:K.length)>0&&(P&&console.log("React Flow: trigger node changes",K),E==null||E(K)))},updateNodePositions:(S,E=!1)=>{const O=[];let j=[];const{nodeLookup:A,triggerNodeChanges:N,connection:T,updateConnection:P,onNodesChangeMiddlewareMap:R}=b();for(const[D,K]of S){const z=A.get(D),I=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(K!=null&&K.position)),G={id:D,type:"position",position:I?{x:Math.max(0,K.position.x),y:Math.max(0,K.position.y)}:K.position,dragging:E};if(z&&T.inProgress&&T.fromNode.id===z.id){const L=Vc(z,T.fromHandle,Le.Left,!0);P({...T,from:L})}I&&z.parentId&&O.push({id:D,parentId:z.parentId,rect:{...K.internals.positionAbsolute,width:K.measured.width??0,height:K.measured.height??0}}),j.push(G)}if(O.length>0){const{parentLookup:D,nodeOrigin:K}=b(),z=QA(O,A,D,K);j.push(...z)}for(const D of R.values())j=D(j);N(j)},triggerNodeChanges:S=>{const{onNodesChange:E,setNodes:O,nodes:j,hasDefaultNodes:A,debug:N}=b();if(S!=null&&S.length){if(A){const T=vAe(S,j);O(T)}N&&console.log("React Flow: trigger node changes",S),E==null||E(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:E,setEdges:O,edges:j,hasDefaultEdges:A,debug:N}=b();if(S!=null&&S.length){if(A){const T=gAe(S,j);O(T)}N&&console.log("React Flow: trigger edge changes",S),E==null||E(S)}},addSelectedNodes:S=>{const{multiSelectionActive:E,edgeLookup:O,nodeLookup:j,triggerNodeChanges:A,triggerEdgeChanges:N}=b();if(E){const T=S.map(P=>oc(P,!0));A(T);return}A(td(j,new Set([...S]),!0)),N(td(O))},addSelectedEdges:S=>{const{multiSelectionActive:E,edgeLookup:O,nodeLookup:j,triggerNodeChanges:A,triggerEdgeChanges:N}=b();if(E){const T=S.map(P=>oc(P,!0));N(T);return}N(td(O,new Set([...S]))),A(td(j,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:E}={})=>{const{edges:O,nodes:j,nodeLookup:A,triggerNodeChanges:N,triggerEdgeChanges:T}=b(),P=S||j,R=E||O,D=[];for(const z of P){if(!z.selected)continue;const I=A.get(z.id);I&&(I.selected=!1),D.push(oc(z.id,!1))}const K=[];for(const z of R)z.selected&&K.push(oc(z.id,!1));N(D),T(K)},setMinZoom:S=>{const{panZoom:E,maxZoom:O}=b();E==null||E.setScaleExtent([S,O]),g({minZoom:S})},setMaxZoom:S=>{const{panZoom:E,minZoom:O}=b();E==null||E.setScaleExtent([O,S]),g({maxZoom:S})},setTranslateExtent:S=>{var E;(E=b().panZoom)==null||E.setTranslateExtent(S),g({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:E,triggerNodeChanges:O,triggerEdgeChanges:j,elementsSelectable:A}=b();if(!A)return;const N=E.reduce((P,R)=>R.selected?[...P,oc(R.id,!1)]:P,[]),T=S.reduce((P,R)=>R.selected?[...P,oc(R.id,!1)]:P,[]);O(N),j(T)},setNodeExtent:S=>{const{nodes:E,nodeLookup:O,parentLookup:j,nodeOrigin:A,elevateNodesOnSelect:N,nodeExtent:T,zIndexMode:P}=b();S[0][0]===T[0][0]&&S[0][1]===T[0][1]&&S[1][0]===T[1][0]&&S[1][1]===T[1][1]||(ej(E,O,j,{nodeOrigin:A,nodeExtent:S,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:P}),g({nodeExtent:S}))},panBy:S=>{const{transform:E,width:O,height:j,panZoom:A,translateExtent:N}=b();return bOe({delta:S,panZoom:A,transform:E,translateExtent:N,width:O,height:j})},setCenter:async(S,E,O)=>{const{width:j,height:A,maxZoom:N,panZoom:T}=b();if(!T)return Promise.resolve(!1);const P=typeof(O==null?void 0:O.zoom)<"u"?O.zoom:N;return await T.setViewport({x:j/2-S*P,y:A/2-E*P,zoom:P},{duration:O==null?void 0:O.duration,ease:O==null?void 0:O.ease,interpolate:O==null?void 0:O.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{g({connection:{...Fq}})},updateConnection:S=>{g({connection:S})},reset:()=>g({...ZL()})}},Object.is);function V9({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:i,initialMinZoom:s,initialMaxZoom:c,initialFitViewOptions:u,fitView:d,nodeOrigin:m,nodeExtent:f,zIndexMode:v,children:g}){const[b]=x.useState(()=>kNe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:d,minZoom:s,maxZoom:c,fitViewOptions:u,nodeOrigin:m,nodeExtent:f,zIndexMode:v}));return p.jsx(WOe,{value:b,children:p.jsx(wAe,{children:g})})}function RNe({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:i,height:s,fitView:c,fitViewOptions:u,minZoom:d,maxZoom:m,nodeOrigin:f,nodeExtent:v,zIndexMode:g}){return x.useContext(wx)?p.jsx(p.Fragment,{children:e}):p.jsx(V9,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:i,initialHeight:s,fitView:c,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:f,nodeExtent:v,zIndexMode:g,children:e})}const DNe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function INe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:i,edgeTypes:s,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:m,onMoveStart:f,onMoveEnd:v,onConnect:g,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:E,onNodeMouseEnter:O,onNodeMouseMove:j,onNodeMouseLeave:A,onNodeContextMenu:N,onNodeDoubleClick:T,onNodeDragStart:P,onNodeDrag:R,onNodeDragStop:D,onNodesDelete:K,onEdgesDelete:z,onDelete:I,onSelectionChange:G,onSelectionDragStart:L,onSelectionDrag:Y,onSelectionDragStop:k,onSelectionContextMenu:H,onSelectionStart:q,onSelectionEnd:F,onBeforeDelete:V,connectionMode:B,connectionLineType:$=Vs.Bezier,connectionLineStyle:X,connectionLineComponent:Z,connectionLineContainerStyle:ee,deleteKeyCode:le="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:ae=!1,selectionMode:J=um.Full,panActivationKeyCode:re="Space",multiSelectionKeyCode:fe=fm()?"Meta":"Control",zoomActivationKeyCode:ne=fm()?"Meta":"Control",snapToGrid:xe,snapGrid:ye,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:Me,nodesDraggable:Ke,autoPanOnNodeFocus:Je,nodesConnectable:nt,nodesFocusable:pn,nodeOrigin:Bn=b9,edgesFocusable:Et,edgesReconnectable:vn,elementsSelectable:It=!0,defaultViewport:Sr=cAe,minZoom:dn=.5,maxZoom:Mr=2,translateExtent:Er=cm,preventScrolling:ga=!0,nodeExtent:Un,defaultMarkerColor:ya="#b1b1b7",zoomOnScroll:_r=!0,zoomOnPinch:kr=!0,panOnScroll:we=!1,panOnScrollSpeed:xt=.5,panOnScrollMode:ht=jc.Free,zoomOnDoubleClick:Xr=!0,panOnDrag:ge=!0,onPaneClick:Ct,onPaneMouseEnter:Rr,onPaneMouseMove:Ua,onPaneMouseLeave:Ha,onPaneScroll:ir,onPaneContextMenu:qe,paneClickDistance:Lt=1,nodeClickDistance:gn=0,children:Hn,onReconnect:vi,onReconnectStart:$t,onReconnectEnd:or,onEdgeContextMenu:Wi,onEdgeDoubleClick:sr,onEdgeMouseEnter:lr,onEdgeMouseMove:is,onEdgeMouseLeave:Wr,reconnectRadius:uf=10,onNodesChange:up,onEdgesChange:gi,noDragClassName:An="nodrag",noWheelClassName:cr="nowheel",noPanClassName:Qi="nopan",fitView:nu,fitViewOptions:dp,connectOnClick:Cx,attributionPosition:fp,proOptions:Pl,defaultEdgeOptions:df,elevateNodesOnSelect:os=!0,elevateEdgesOnSelect:ss=!1,disableKeyboardA11y:ls=!1,autoPanOnConnect:cs,autoPanOnNodeDrag:yn,autoPanSpeed:hp,connectionRadius:mp,isValidConnection:Zi,onError:us,style:Ox,id:ff,nodeDragThreshold:pp,connectionDragThreshold:Ax,viewport:ru,onViewportChange:au,width:Fa,height:Dr,colorMode:vp="light",debug:Nx,onScroll:ds,ariaLabelConfig:gp,zIndexMode:Ml="basic",...Tx},Ir){const kl=ff||"1",yp=hAe(vp),hf=x.useCallback(Ji=>{Ji.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ds==null||ds(Ji)},[ds]);return p.jsx("div",{"data-testid":"rf__wrapper",...Tx,onScroll:hf,style:{...Ox,...DNe},ref:Ir,className:On(["react-flow",a,yp]),id:ff,role:"application",children:p.jsxs(RNe,{nodes:e,edges:t,width:Fa,height:Dr,fitView:nu,fitViewOptions:dp,minZoom:dn,maxZoom:Mr,nodeOrigin:Bn,nodeExtent:Un,zIndexMode:Ml,children:[p.jsx(MNe,{onInit:d,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:O,onNodeMouseMove:j,onNodeMouseLeave:A,onNodeContextMenu:N,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:s,connectionLineType:$,connectionLineStyle:X,connectionLineComponent:Z,connectionLineContainerStyle:ee,selectionKeyCode:ie,selectionOnDrag:ae,selectionMode:J,deleteKeyCode:le,multiSelectionKeyCode:fe,panActivationKeyCode:re,zoomActivationKeyCode:ne,onlyRenderVisibleElements:De,defaultViewport:Sr,translateExtent:Er,minZoom:dn,maxZoom:Mr,preventScrolling:ga,zoomOnScroll:_r,zoomOnPinch:kr,zoomOnDoubleClick:Xr,panOnScroll:we,panOnScrollSpeed:xt,panOnScrollMode:ht,panOnDrag:ge,onPaneClick:Ct,onPaneMouseEnter:Rr,onPaneMouseMove:Ua,onPaneMouseLeave:Ha,onPaneScroll:ir,onPaneContextMenu:qe,paneClickDistance:Lt,nodeClickDistance:gn,onSelectionContextMenu:H,onSelectionStart:q,onSelectionEnd:F,onReconnect:vi,onReconnectStart:$t,onReconnectEnd:or,onEdgeContextMenu:Wi,onEdgeDoubleClick:sr,onEdgeMouseEnter:lr,onEdgeMouseMove:is,onEdgeMouseLeave:Wr,reconnectRadius:uf,defaultMarkerColor:ya,noDragClassName:An,noWheelClassName:cr,noPanClassName:Qi,rfId:kl,disableKeyboardA11y:ls,nodeExtent:Un,viewport:ru,onViewportChange:au}),p.jsx(fAe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:E,nodesDraggable:Ke,autoPanOnNodeFocus:Je,nodesConnectable:nt,nodesFocusable:pn,edgesFocusable:Et,edgesReconnectable:vn,elementsSelectable:It,elevateNodesOnSelect:os,elevateEdgesOnSelect:ss,minZoom:dn,maxZoom:Mr,nodeExtent:Un,onNodesChange:up,onEdgesChange:gi,snapToGrid:xe,snapGrid:ye,connectionMode:B,translateExtent:Er,connectOnClick:Cx,defaultEdgeOptions:df,fitView:nu,fitViewOptions:dp,onNodesDelete:K,onEdgesDelete:z,onDelete:I,onNodeDragStart:P,onNodeDrag:R,onNodeDragStop:D,onSelectionDrag:Y,onSelectionDragStart:L,onSelectionDragStop:k,onMove:m,onMoveStart:f,onMoveEnd:v,noPanClassName:Qi,nodeOrigin:Bn,rfId:kl,autoPanOnConnect:cs,autoPanOnNodeDrag:yn,autoPanSpeed:hp,onError:us,connectionRadius:mp,isValidConnection:Zi,selectNodesOnDrag:Me,nodeDragThreshold:pp,connectionDragThreshold:Ax,onBeforeDelete:V,debug:Nx,ariaLabelConfig:gp,zIndexMode:Ml}),p.jsx(lAe,{onSelectionChange:G}),Hn,p.jsx(rAe,{proOptions:Pl,position:fp}),p.jsx(nAe,{rfId:kl,disableKeyboardA11y:ls})]})})}var LNe=S9(INe);function zNe({dimensions:e,lineWidth:t,variant:n,className:r}){return p.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:On(["react-flow__background-pattern",n,r])})}function $Ne({radius:e,className:t}){return p.jsx("circle",{cx:e,cy:e,r:e,className:On(["react-flow__background-pattern","dots",t])})}var sl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(sl||(sl={}));const BNe={[sl.Dots]:1,[sl.Lines]:1,[sl.Cross]:6},UNe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Y9({id:e,variant:t=sl.Dots,gap:n=20,size:r,lineWidth:a=1,offset:i=0,color:s,bgColor:c,style:u,className:d,patternClassName:m}){const f=x.useRef(null),{transform:v,patternId:g}=ut(UNe,Qt),b=r||BNe[t],w=t===sl.Dots,S=t===sl.Cross,E=Array.isArray(n)?n:[n,n],O=[E[0]*v[2]||1,E[1]*v[2]||1],j=b*v[2],A=Array.isArray(i)?i:[i,i],N=S?[j,j]:O,T=[A[0]*v[2]||1+N[0]/2,A[1]*v[2]||1+N[1]/2],P=`${g}${e||""}`;return p.jsxs("svg",{className:On(["react-flow__background",d]),style:{...u,..._x,"--xy-background-color-props":c,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[p.jsx("pattern",{id:P,x:v[0]%O[0],y:v[1]%O[1],width:O[0],height:O[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:w?p.jsx($Ne,{radius:j/2,className:m}):p.jsx(zNe,{dimensions:N,lineWidth:a,variant:t,className:m})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}Y9.displayName="Background";x.memo(Y9);function HNe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:p.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function FNe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:p.jsx("path",{d:"M0 0h32v4.2H0z"})})}function qNe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:p.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function KNe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function VNe(){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:p.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function cg({children:e,className:t,...n}){return p.jsx("button",{type:"button",className:On(["react-flow__controls-button",t]),...n,children:e})}const YNe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function G9({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:s,onFitView:c,onInteractiveChange:u,className:d,children:m,position:f="bottom-left",orientation:v="vertical","aria-label":g}){const b=Zt(),{isInteractive:w,minZoomReached:S,maxZoomReached:E,ariaLabelConfig:O}=ut(YNe,Qt),{zoomIn:j,zoomOut:A,fitView:N}=Ex(),T=()=>{j(),i==null||i()},P=()=>{A(),s==null||s()},R=()=>{N(a),c==null||c()},D=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},K=v==="horizontal"?"horizontal":"vertical";return p.jsxs(Sx,{className:On(["react-flow__controls",K,d]),position:f,style:e,"data-testid":"rf__controls","aria-label":g??O["controls.ariaLabel"],children:[t&&p.jsxs(p.Fragment,{children:[p.jsx(cg,{onClick:T,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:E,children:p.jsx(HNe,{})}),p.jsx(cg,{onClick:P,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:S,children:p.jsx(FNe,{})})]}),n&&p.jsx(cg,{className:"react-flow__controls-fitview",onClick:R,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:p.jsx(qNe,{})}),r&&p.jsx(cg,{className:"react-flow__controls-interactive",onClick:D,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:w?p.jsx(VNe,{}):p.jsx(KNe,{})}),m]})}G9.displayName="Controls";x.memo(G9);function GNe({id:e,x:t,y:n,width:r,height:a,style:i,color:s,strokeColor:c,strokeWidth:u,className:d,borderRadius:m,shapeRendering:f,selected:v,onClick:g}){const{background:b,backgroundColor:w}=i||{},S=s||b||w;return p.jsx("rect",{className:On(["react-flow__minimap-node",{selected:v},d]),x:t,y:n,rx:m,ry:m,width:r,height:a,style:{fill:S,stroke:c,strokeWidth:u},shapeRendering:f,onClick:g?E=>g(E,e):void 0})}const XNe=x.memo(GNe),WNe=e=>e.nodes.map(t=>t.id),XS=e=>e instanceof Function?e:()=>e;function QNe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:i=XNe,onClick:s}){const c=ut(WNe,Qt),u=XS(t),d=XS(e),m=XS(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:c.map(v=>p.jsx(JNe,{id:v,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:i,onClick:s,shapeRendering:f},v))})}function ZNe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:c,onClick:u}){const{node:d,x:m,y:f,width:v,height:g}=ut(b=>{const w=b.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const S=w.internals.userNode,{x:E,y:O}=w.internals.positionAbsolute,{width:j,height:A}=as(S);return{node:S,x:E,y:O,width:j,height:A}},Qt);return!d||d.hidden||!Wq(d)?null:p.jsx(c,{x:m,y:f,width:v,height:g,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:a,strokeColor:n(d),strokeWidth:i,shapeRendering:s,onClick:u,id:d.id})}const JNe=x.memo(ZNe);var eTe=x.memo(QNe);const tTe=200,nTe=150,rTe=e=>!e.hidden,aTe=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Xq(sp(e.nodeLookup,{filter:rTe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},iTe="react-flow__minimap-desc";function X9({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:c,bgColor:u,maskColor:d,maskStrokeColor:m,maskStrokeWidth:f,position:v="bottom-right",onClick:g,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:E,inversePan:O,zoomStep:j=1,offsetScale:A=5}){const N=Zt(),T=x.useRef(null),{boundingRect:P,viewBB:R,rfId:D,panZoom:K,translateExtent:z,flowWidth:I,flowHeight:G,ariaLabelConfig:L}=ut(aTe,Qt),Y=(e==null?void 0:e.width)??tTe,k=(e==null?void 0:e.height)??nTe,H=P.width/Y,q=P.height/k,F=Math.max(H,q),V=F*Y,B=F*k,$=A*F,X=P.x-(V-P.width)/2-$,Z=P.y-(B-P.height)/2-$,ee=V+$*2,le=B+$*2,ie=`${iTe}-${D}`,ae=x.useRef(0),J=x.useRef();ae.current=F,x.useEffect(()=>{if(T.current&&K)return J.current=NOe({domNode:T.current,panZoom:K,getTransform:()=>N.getState().transform,getViewScale:()=>ae.current}),()=>{var xe;(xe=J.current)==null||xe.destroy()}},[K]),x.useEffect(()=>{var xe;(xe=J.current)==null||xe.update({translateExtent:z,width:I,height:G,inversePan:O,pannable:w,zoomStep:j,zoomable:S})},[w,S,O,j,z,I,G]);const re=g?xe=>{var Me;const[ye,De]=((Me=J.current)==null?void 0:Me.pointer(xe))||[0,0];g(xe,{x:ye,y:De})}:void 0,fe=b?x.useCallback((xe,ye)=>{const De=N.getState().nodeLookup.get(ye).internals.userNode;b(xe,De)},[]):void 0,ne=E??L["minimap.ariaLabel"];return p.jsx(Sx,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:On(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:Y,height:k,viewBox:`${X} ${Z} ${ee} ${le}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ie,ref:T,onClick:re,children:[ne&&p.jsx("title",{id:ie,children:ne}),p.jsx(eTe,{onClick:fe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:s,nodeComponent:c}),p.jsx("path",{className:"react-flow__minimap-mask",d:`M${X-$},${Z-$}h${ee+$*2}v${le+$*2}h${-ee-$*2}z
        M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}X9.displayName="MiniMap";x.memo(X9);const oTe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,sTe={[Ud.Line]:"right",[Ud.Handle]:"bottom-right"};function lTe({nodeId:e,position:t,variant:n=Ud.Handle,className:r,style:a=void 0,children:i,color:s,minWidth:c=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:v,autoScale:g=!0,shouldResize:b,onResizeStart:w,onResize:S,onResizeEnd:E}){const O=C9(),j=typeof e=="string"?e:O,A=Zt(),N=x.useRef(null),T=n===Ud.Handle,P=ut(x.useCallback(oTe(T&&g),[T,g]),Qt),R=x.useRef(null),D=t??sTe[n];x.useEffect(()=>{if(!(!N.current||!j))return R.current||(R.current=FOe({domNode:N.current,nodeId:j,getStoreItems:()=>{const{nodeLookup:z,transform:I,snapGrid:G,snapToGrid:L,nodeOrigin:Y,domNode:k}=A.getState();return{nodeLookup:z,transform:I,snapGrid:G,snapToGrid:L,nodeOrigin:Y,paneDomNode:k}},onChange:(z,I)=>{const{triggerNodeChanges:G,nodeLookup:L,parentLookup:Y,nodeOrigin:k}=A.getState(),H=[],q={x:z.x,y:z.y},F=L.get(j);if(F&&F.expandParent&&F.parentId){const V=F.origin??k,B=z.width??F.measured.width??0,$=z.height??F.measured.height??0,X={id:F.id,parentId:F.parentId,rect:{width:B,height:$,...Qq({x:z.x??F.position.x,y:z.y??F.position.y},{width:B,height:$},F.parentId,L,V)}},Z=QA([X],L,Y,k);H.push(...Z),q.x=z.x?Math.max(V[0]*B,z.x):void 0,q.y=z.y?Math.max(V[1]*$,z.y):void 0}if(q.x!==void 0&&q.y!==void 0){const V={id:j,type:"position",position:{...q}};H.push(V)}if(z.width!==void 0&&z.height!==void 0){const B={id:j,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};H.push(B)}for(const V of I){const B={...V,type:"position"};H.push(B)}G(H)},onEnd:({width:z,height:I})=>{const G={id:j,type:"dimensions",resizing:!1,dimensions:{width:z,height:I}};A.getState().triggerNodeChanges([G])}})),R.current.update({controlPosition:D,boundaries:{minWidth:c,minHeight:u,maxWidth:d,maxHeight:m},keepAspectRatio:f,resizeDirection:v,onResizeStart:w,onResize:S,onResizeEnd:E,shouldResize:b}),()=>{var z;(z=R.current)==null||z.destroy()}},[D,c,u,d,m,f,w,S,E,b]);const K=D.split("-");return p.jsx("div",{className:On(["react-flow__resize-control","nodrag",...K,n,r]),ref:N,style:{...a,scale:P,...s&&{[T?"backgroundColor":"borderColor"]:s}},children:i})}x.memo(lTe);function cTe(e){const[t,n]=x.useState(null),[r,a]=x.useState(!1),i=x.useRef(null);return x.useEffect(()=>{const s=new EventSource(`/api/sessions/${e}/tree`);return i.current=s,s.onopen=()=>a(!0),s.onmessage=c=>{try{const u=JSON.parse(c.data);n(u)}catch{}},s.onerror=()=>{a(!1)},()=>{s.close(),i.current=null}},[e]),{tree:t,connected:r}}const W9=180,uTe=70,Ky=24,dTe=60;function fTe({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${nk(e.status)}`;return p.jsxs("div",{className:t,children:[p.jsx(Hd,{type:"target",position:Le.Top}),p.jsx("div",{className:"agent-flow-role",children:e.pending?`[pending: ${e.role}]`:e.role}),!e.pending&&p.jsxs("div",{className:"agent-flow-meta",children:[p.jsx("span",{className:`status-dot ${nk(e.status)}`}),p.jsx("span",{children:e.status}),e.duration_ms!=null&&p.jsx("span",{children:S0(e.duration_ms)}),e.exit_code!=null&&p.jsxs("span",{children:["exit ",e.exit_code]})]}),p.jsx(Hd,{type:"source",position:Le.Bottom})]})}const hTe={agent:fTe};function mTe(e,t){const n=new Map(e.map(c=>[c.agent_id,c])),r=new Map;for(const c of e){const u=c.parent;r.has(u)||r.set(u,[]),r.get(u).push(c.agent_id)}const a=new Map;for(const c of t){const u=c.requested_by;u&&n.has(u)&&(a.has(u)||a.set(u,[]),a.get(u).push(c))}function i(c){const u=(r.get(c)||[]).map(i),d=(a.get(c)||[]).map(m=>({id:`pending-${m.span_id}`,children:[]}));return{id:c,children:[...u,...d]}}return(r.get(null)||[]).map(i)}function Vy(e){return e.children.length===0?W9:e.children.reduce((t,n)=>t+Vy(n)+Ky,-Ky)}function Q9(e,t,n,r){if(r.set(e.id,{x:t-W9/2,y:n}),e.children.length===0)return;const a=Vy(e);let i=t-a/2;for(const s of e.children){const c=Vy(s),u=i+c/2;Q9(s,u,n+uTe+dTe,r),i+=c+Ky}}function pTe({runId:e}){return p.jsx(V9,{children:p.jsx(vTe,{runId:e})})}function vTe({runId:e}){const{tree:t,connected:n}=cTe(e),{fitView:r}=Ex(),a=x.useCallback(()=>{r({duration:300})},[r]),{flowNodes:i,flowEdges:s}=x.useMemo(()=>{if(!t)return{flowNodes:[],flowEdges:[]};const c=mTe(t.nodes,t.pending_delegations),u=new Map;let d=0;for(const b of c){const w=Vy(b),S=d+w/2;Q9(b,S,0,u),d+=w+Ky*2}const m=new Map(t.nodes.map(b=>[b.agent_id,b])),f=new Map(t.pending_delegations.map(b=>[`pending-${b.span_id}`,b])),v=[];for(const[b,w]of u){const S=m.get(b),E=f.get(b);S?v.push({id:b,type:"agent",position:w,data:{label:S.role,role:S.role,status:S.status,runtime:S.runtime,duration_ms:S.duration_ms,exit_code:S.exit_code}}):E&&v.push({id:b,type:"agent",position:w,data:{label:E.role,role:E.role,status:"running",runtime:"",duration_ms:null,exit_code:null,pending:!0}})}const g=[];for(const b of t.nodes)b.parent&&g.push({id:`e-${b.parent}-${b.agent_id}`,source:b.parent,target:b.agent_id,type:"smoothstep",markerEnd:{type:Ld.ArrowClosed,width:16,height:16}});for(const b of t.pending_delegations)b.requested_by&&g.push({id:`e-${b.requested_by}-pending-${b.span_id}`,source:b.requested_by,target:`pending-${b.span_id}`,type:"smoothstep",markerEnd:{type:Ld.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:v,flowEdges:g}},[t]);return t?p.jsxs("div",{children:[p.jsxs("div",{className:"react-flow-wrapper",children:[p.jsx(LNe,{nodes:i,edges:s,nodeTypes:hTe,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0}}),p.jsx("button",{className:"tree-reset-btn",onClick:a,children:"Reset View"})]}),t.denied_delegations.length>0&&p.jsxs("div",{className:"denied-list",children:[p.jsx("strong",{children:"Denied delegations:"}),t.denied_delegations.map(c=>p.jsxs("span",{className:"denied-item",children:[c.role," (",c.reason,")"]},c.span_id))]})]}):p.jsx("div",{className:"agent-tree",children:p.jsx("p",{className:"agent-meta",children:n?"Loading tree...":"Connecting..."})})}const nc=18,JL=10;function gTe({runId:e,agents:t,active:n}){var Y;const r=Object.keys(t),a=r.find(k=>t[k].parent===null)??r[0]??"",[i,s]=x.useState(a),{lines:c,connected:u,done:d}=KB(e,i,!0),[m,f]=x.useState(""),v=m.toLowerCase(),g=m?c.reduce((k,H,q)=>(H.toLowerCase().includes(v)&&k.push(q),k),[]):[],b=x.useRef(null),[w,S]=x.useState(0),[E,O]=x.useState(0),[j,A]=x.useState(!0),N=x.useRef(0),T=c.length*nc,P=Math.max(0,Math.floor(w/nc)-JL),R=Math.ceil(E/nc)+JL*2,D=Math.min(c.length,P+R),K=c.slice(P,D),z=String(c.length).length,I=x.useCallback(()=>{const k=b.current;if(!k)return;S(k.scrollTop),O(k.clientHeight);const H=k.scrollTop+k.clientHeight>=k.scrollHeight-nc*2;A(H)},[]);x.useEffect(()=>{const k=b.current;k&&O(k.clientHeight)},[]),x.useEffect(()=>{if(j&&c.length>N.current){const k=b.current;k&&(k.scrollTop=k.scrollHeight)}N.current=c.length},[c.length,j]);const G=()=>{const k=b.current;k&&(k.scrollTop=k.scrollHeight,A(!0))},L=async()=>{try{const k=await fetch(`/api/sessions/${e}/logs/${i}/full`);if(!k.ok)return;const H=await k.text(),q=new Blob([H],{type:"text/plain"}),F=URL.createObjectURL(q),V=document.createElement("a");V.href=F,V.download=`${i}.log`,V.click(),URL.revokeObjectURL(F)}catch{}};return p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[r.length>1&&p.jsxs(zi,{value:i,onValueChange:s,children:[p.jsx(Bi,{className:"w-[220px]",children:p.jsx($i,{})}),p.jsx(Ui,{children:r.map(k=>p.jsxs(Dn,{value:k,children:[t[k].role," (",k.slice(0,8),")"]},k))})]}),r.length===1&&p.jsxs("span",{className:"text-sm text-muted-foreground",children:[(Y=t[i])==null?void 0:Y.role," (",i.slice(0,8),")"]}),p.jsxs("div",{className:"relative ml-auto",children:[p.jsx(wB,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),p.jsx(Ze,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:m,onChange:k=>f(k.target.value)})]}),m&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[g.length," match",g.length!==1?"es":""]}),p.jsxs(Ee,{variant:"outline",size:"sm",onClick:L,children:[p.jsx(y0,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),p.jsx(yTe,{connected:u,done:d,active:n})]}),p.jsxs("div",{className:"relative",children:[p.jsx("div",{ref:b,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:I,children:c.length===0?p.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:n&&!d?"Waiting for log output...":"No log output."}):p.jsx("div",{style:{height:T,position:"relative"},children:p.jsx("div",{style:{position:"absolute",top:P*nc,left:0,right:0},children:K.map((k,H)=>{const q=P+H,F=m&&k.toLowerCase().includes(v);return p.jsxs("div",{className:F?"bg-yellow-900/30":void 0,style:{height:nc,lineHeight:`${nc}px`,display:"flex",whiteSpace:"pre"},children:[p.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(z+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:q+1}),p.jsx("span",{children:F?p.jsx(xTe,{line:k,search:v}):k})]},q)})})})}),!j&&c.length>0&&p.jsxs(Ee,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:G,children:[p.jsx(Pte,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function yTe({connected:e,done:t,active:n}){return t||!n?p.jsx("span",{className:"text-xs text-muted-foreground",children:"Session ended"}):p.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[p.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${e?"animate-pulse bg-green-500":"bg-orange-400"}`}),e?"Live":"Connecting..."]})}function xTe({line:e,search:t}){const n=[],r=e.toLowerCase();let a=0,i=r.indexOf(t,a),s=0;for(;i!==-1;)i>a&&n.push(e.slice(a,i)),n.push(p.jsx("span",{className:"bg-yellow-500/60 text-white",children:e.slice(i,i+t.length)},s++)),a=i+t.length,i=r.indexOf(t,a);return a<e.length&&n.push(e.slice(a)),p.jsx(p.Fragment,{children:n})}function bTe(e){return Mt({mutationFn:t=>ze.post(`/sessions/${e}/respond`,t)})}function wTe({runId:e,pendingAskUsers:t,initialMessages:n}){const[r,a]=x.useState([]),[i,s]=x.useState(""),c=bTe(e),u=x.useRef(null),d=x.useRef(new Set);x.useEffect(()=>{!n||n.length===0||a(v=>{const g=new Set(v.map(S=>S.id)),b=n.filter(S=>!g.has(S.id));if(b.length===0)return v;const w=[...b,...v];w.sort((S,E)=>S.timestamp-E.timestamp);for(const S of w)d.current.add(S.id);return w})},[n]),x.useEffect(()=>{if(t.length===0)return;const v=[];for(const g of t)d.current.has(g.request_id)||(d.current.add(g.request_id),v.push({id:g.request_id,role:"agent",text:g.question,timestamp:g.timestamp}));v.length>0&&a(g=>[...g,...v])},[t]),x.useEffect(()=>{var v;(v=u.current)==null||v.scrollIntoView({behavior:"smooth"})},[r]);const m=async(v,g)=>{if(!v.trim())return;const b=`user-${g.request_id}`;d.current.has(b)||(d.current.add(b),a(w=>[...w,{id:b,role:"user",text:v.trim(),timestamp:Date.now()/1e3}])),s("");try{await c.mutateAsync({request_id:g.request_id,text:v.trim()})}catch{}},f=t.length>0?t[0]:null;return p.jsx(sn,{className:"flex h-[500px] flex-col",children:p.jsxs(ln,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[p.jsx(Rm,{className:"flex-1",children:p.jsxs("div",{className:"space-y-3 pr-3",children:[r.length===0&&p.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-muted-foreground",children:[p.jsx(vB,{className:"h-8 w-8"}),p.jsx("p",{className:"text-sm",children:"Waiting for the agent to ask a question..."})]}),r.map(v=>{const g=v.role==="agent"?t.find(b=>b.request_id===v.id):void 0;return p.jsxs("div",{children:[p.jsx("div",{className:Ce("flex",v.role==="user"?"justify-end":"justify-start"),children:p.jsx("div",{className:Ce("max-w-[80%] rounded-lg px-3 py-2 text-sm",v.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:p.jsx("p",{className:"whitespace-pre-wrap",children:v.text})})}),(g==null?void 0:g.choices)&&g.choices.length>0&&p.jsx("div",{className:"ml-3 mt-1 flex flex-wrap gap-1.5",children:g.choices.map(b=>p.jsx(Ee,{variant:"outline",size:"sm",onClick:()=>m(b,g),disabled:c.isPending,children:b},b))})]},v.id)}),p.jsx("div",{ref:u})]})}),t.length>0&&p.jsx("div",{className:"flex items-center gap-2",children:p.jsxs(qt,{variant:"outline",className:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-400",children:[p.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-amber-500"}),t.length===1?"Waiting for response":`${t.length} questions waiting`]})}),p.jsxs("form",{className:"flex gap-2",onSubmit:v=>{v.preventDefault(),f&&m(i,f)},children:[p.jsx(Ze,{value:i,onChange:v=>s(v.target.value),placeholder:f?"Type your response...":"Waiting for agent question...",disabled:!f||c.isPending}),p.jsx(Ee,{type:"submit",size:"icon",disabled:!f||!i.trim()||c.isPending,children:p.jsx(Pne,{className:"h-4 w-4"})})]})]})})}function STe(e,t){const[n,r]=x.useState([]),[a,i]=x.useState(!1),s=x.useRef(null),c=x.useRef(""),u=x.useRef(void 0),d=x.useRef(1e3);return x.useEffect(()=>{if(!t)return;c.current!==e&&(r([]),c.current=e);function m(){const f=new EventSource(`/api/sessions/${e}/events`);s.current=f,f.onopen=()=>{i(!0),d.current=1e3},f.addEventListener("snapshot",v=>{try{const g=JSON.parse(v.data);g.events&&Array.isArray(g.events)&&r(g.events)}catch{}}),f.addEventListener("delta",v=>{try{const g=JSON.parse(v.data);g.events&&Array.isArray(g.events)&&r(b=>[...b,...g.events])}catch{}}),f.onmessage=v=>{try{const g=JSON.parse(v.data);g.events&&Array.isArray(g.events)&&r(g.events)}catch{}},f.onerror=()=>{f.close(),s.current=null,i(!1),u.current=setTimeout(()=>{d.current=Math.min(d.current*2,15e3),m()},d.current)}}return m(),()=>{var f;(f=s.current)==null||f.close(),s.current=null,u.current&&clearTimeout(u.current)}},[e,t]),{events:n,connected:a}}function ETe(e,t){const[n,r]=x.useState([]),[a,i]=x.useState([]),s=x.useRef(null),c=x.useRef(void 0),u=x.useRef(1e3),d=x.useRef(!1);return x.useEffect(()=>{if(!t){r([]),i([]),d.current=!1;return}function m(){if(d.current)return;const f=new EventSource(`/api/sessions/${e}/tree`);s.current=f,f.onopen=()=>{u.current=1e3},f.addEventListener("chat_history",v=>{try{const g=JSON.parse(v.data);g.messages&&i(g.messages)}catch{}}),f.addEventListener("ask_user",v=>{try{const g=JSON.parse(v.data);r(b=>b.some(w=>w.request_id===g.request_id)?b:[...b,g])}catch{}}),f.addEventListener("ask_user_resolved",v=>{try{const g=JSON.parse(v.data);g.request_id?r(b=>b.filter(w=>w.request_id!==g.request_id)):r([])}catch{r([])}}),f.addEventListener("stream_complete",()=>{d.current=!0,f.close(),s.current=null}),f.onerror=()=>{f.close(),s.current=null,!d.current&&(c.current=setTimeout(()=>{u.current=Math.min(u.current*2,15e3),m()},u.current))}}return m(),()=>{var f;(f=s.current)==null||f.close(),s.current=null,c.current&&clearTimeout(c.current)}},[e,t]),{pendingAskUsers:n,chatMessages:a}}function _Te(){return p.jsxs("div",{className:"space-y-6",children:[p.jsx(cn,{className:"h-8 w-64"}),p.jsx(cn,{className:"h-32 rounded-lg"}),p.jsx(cn,{className:"h-64 rounded-lg"})]})}function jTe(){const{projectId:e,runId:t}=Gy(),[n]=FY(),r=Number(e),a=j=>j==="starting"||j==="running",i=Ore(r,t??"",{refetchInterval:void 0}),s=i.data,c=a(s==null?void 0:s.status);x.useEffect(()=>{if(!c)return;const j=setInterval(()=>i.refetch(),2e3);return()=>clearInterval(j)},[c,i]);const{events:u}=STe(t??"",c),d=(s==null?void 0:s.events)??[],m=u.length>0?u:d,f=!!(s!=null&&s.interactive),{pendingAskUsers:v,chatMessages:g}=ETe(t??"",f),[b,w]=x.useState(void 0);if(x.useEffect(()=>{v.length>0&&w("chat")},[v]),i.isLoading)return p.jsx(_Te,{});if(i.error)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",i.error.message]})]});if(!s)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsx("span",{children:"Session not found"})]});const S=MTe(m),E=PTe(m),O=n.get("tab")??(c?f?"chat":"agent-tree":"overview");return p.jsxs("div",{className:"space-y-6",children:[p.jsx(CTe,{session:s,projectId:r,runId:t??"",onStopped:()=>i.refetch()}),p.jsx(NTe,{session:s}),p.jsxs(IA,{value:b??O,onValueChange:w,children:[p.jsxs(LA,{children:[p.jsx(oa,{value:"overview",children:"Overview"}),f&&p.jsxs(oa,{value:"chat",className:"relative",children:["Chat",v.length>0&&p.jsx("span",{className:"ml-1.5 inline-block h-2 w-2 animate-pulse rounded-full bg-amber-500"})]}),p.jsx(oa,{value:"agent-tree",children:"Agent Tree"}),p.jsx(oa,{value:"logs",children:"Logs"}),p.jsxs(oa,{value:"trace",children:["Trace",m.length>0&&` (${m.length})`]}),p.jsxs(oa,{value:"artifacts",children:["Artifacts",S.length>0&&` (${S.length})`]})]}),p.jsxs(sa,{value:"overview",className:"space-y-4",children:[s.task&&p.jsxs("section",{className:"space-y-2",children:[p.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Task"}),p.jsx(sn,{children:p.jsx(ln,{className:"pt-4",children:p.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm",children:s.task})})})]}),E&&p.jsxs("section",{className:"space-y-2",children:[p.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Output"}),p.jsx(sn,{children:p.jsx(ln,{className:"pt-4",children:p.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:p.jsx(TTe,{runId:s.run_id,hash:E})})})})]}),!s.task&&!E&&p.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),f&&p.jsx(sa,{value:"chat",children:p.jsx(wTe,{runId:s.run_id,pendingAskUsers:v,initialMessages:g})}),p.jsx(sa,{value:"agent-tree",children:p.jsx(pTe,{runId:s.run_id})}),p.jsx(sa,{value:"logs",children:Object.keys(s.agents).length>0?p.jsx(gTe,{runId:s.run_id,agents:s.agents,active:c}):p.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),p.jsx(sa,{value:"trace",children:m.length>0?p.jsx(LTe,{events:m,runId:s.run_id}):p.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),p.jsx(sa,{value:"artifacts",children:S.length>0?p.jsx(kTe,{artifacts:S,runId:s.run_id}):p.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function CTe({session:e,projectId:t,runId:n,onStopped:r}){const[a,i]=x.useState(!1),s=FB(),c=e.status==="starting"||e.status==="running";return p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:["Session ",e.run_id.slice(0,16)]}),p.jsxs("div",{className:"flex gap-2",children:[c&&(a?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Ee,{size:"sm",variant:"destructive",onClick:async()=>{await s.mutateAsync(n),i(!1),r()},disabled:s.isPending,children:"Confirm"}),p.jsx(Ee,{size:"sm",variant:"outline",onClick:()=>i(!1),children:"Cancel"})]}):p.jsxs(Ee,{variant:"destructive",onClick:()=>i(!0),children:[p.jsx(yB,{className:"mr-2 h-4 w-4"}),"Stop Session"]})),p.jsx(Ee,{variant:"outline",asChild:!0,children:p.jsxs(gr,{to:`/projects/${t}`,children:[p.jsx(cC,{className:"mr-2 h-4 w-4"}),"Back"]})})]})]})}function OTe({status:e}){const t=ATe(e);return p.jsxs(qt,{variant:"outline",className:Ce("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&p.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}function ATe(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function NTe({session:e}){return p.jsx(sn,{children:p.jsx(ln,{className:"pt-6",children:p.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status"}),p.jsx("dd",{children:p.jsx(OTe,{status:e.status})}),p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Role"}),p.jsx("dd",{children:e.role}),p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Runtime"}),p.jsx("dd",{children:e.runtime}),p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Isolation"}),p.jsx("dd",{children:e.isolation}),p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),p.jsx("dd",{children:Hg(e.started_at)}),e.ended_at&&p.jsxs(p.Fragment,{children:[p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Ended"}),p.jsx("dd",{children:Hg(e.ended_at)})]}),p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),p.jsx("dd",{children:S0(e.duration_ms)}),e.exit_code!==null&&p.jsxs(p.Fragment,{children:[p.jsx("dt",{className:"font-medium text-muted-foreground",children:"Exit Code"}),p.jsx("dd",{children:e.exit_code})]})]})})})}function TTe({runId:e,hash:t}){const[n,r]=x.useState(null),[a,i]=x.useState(null);return x.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(s=>{if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.text()}).then(r).catch(s=>i(s.message))},[e,t]),a?p.jsxs("span",{className:"text-destructive",children:["Error: ",a]}):n===null?p.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):p.jsx(p.Fragment,{children:n})}function PTe(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function MTe(e){const t=[];for(const n of e){const r=n.data;n.event==="agent_spawn"&&(r.context_ref&&t.push({label:`Agent Context (${r.role||"agent"})`,hash:String(r.context_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0}),r.task_ref&&t.push({label:`Agent Task (${r.role||"agent"})`,hash:String(r.task_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0})),n.event==="session_end"&&r.output_ref&&t.push({label:"Session Output",hash:String(r.output_ref),event:n.event}),n.event==="agent_end"&&r.output_ref&&t.push({label:`Agent Output (${r.agent_id||"agent"})`,hash:String(r.output_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0}),n.event==="memory_get"&&(r.cards_ref&&t.push({label:`Memory Cards (${r.provider||"memory"})`,hash:String(r.cards_ref),event:n.event}),r.behavior_ref&&t.push({label:`Memory Get Behavior (${r.role||"agent"})`,hash:String(r.behavior_ref),event:n.event}),r.task_ref&&t.push({label:`Memory Get Task (${r.role||"agent"})`,hash:String(r.task_ref),event:n.event})),n.event==="memory_dump"&&(r.output_ref&&t.push({label:`Memory Dump Output (${r.provider||"memory"})`,hash:String(r.output_ref),event:n.event}),r.behavior_ref&&t.push({label:`Memory Dump Behavior (${r.provider||"memory"})`,hash:String(r.behavior_ref),event:n.event}),r.task_ref&&t.push({label:`Memory Dump Task (${r.provider||"memory"})`,hash:String(r.task_ref),event:n.event})),n.event==="delegate_start"&&r.context_ref&&t.push({label:`Delegation Context (${r.role||"delegate"})`,hash:String(r.context_ref),event:n.event}),n.event==="delegate_end"&&r.output_ref&&t.push({label:`Delegation Output (${r.role||"delegate"})`,hash:String(r.output_ref),event:n.event})}return t}function kTe({artifacts:e,runId:t}){return p.jsx("div",{className:"space-y-1",children:e.map(n=>p.jsxs(SC,{children:[p.jsxs(EC,{className:"flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-sm hover:bg-muted",children:[p.jsx(g0,{className:"h-3 w-3 transition-transform [[data-state=open]>&]:rotate-90"}),p.jsx("span",{className:"font-medium text-primary",children:n.label})]}),p.jsx(_C,{children:p.jsx(RTe,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function RTe({runId:e,hash:t}){const[n,r]=x.useState(null),[a,i]=x.useState(null);return x.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(s=>{if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.text()}).then(r).catch(s=>i(s.message))},[e,t]),a?p.jsxs("p",{className:"px-3 py-2 text-sm text-destructive",children:["Error: ",a]}):n===null?p.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading..."}):p.jsx(Rm,{className:"max-h-[300px] overflow-hidden",children:p.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-b-md bg-muted/30 px-3 py-2 font-mono text-xs leading-relaxed",children:n})})}function DTe({event:e}){const t=ITe(e);return p.jsx(qt,{variant:"outline",className:Ce("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:e})}function ITe(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function LTe({events:e,runId:t}){const[n,r]=x.useState(null);return p.jsxs(p.Fragment,{children:[p.jsx(sn,{children:p.jsx(ln,{className:"p-0",children:p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Time"}),p.jsx(Ye,{children:"Event"}),p.jsx(Ye,{children:"Span"}),p.jsx(Ye,{children:"Details"})]})}),p.jsx(Ho,{children:e.map((a,i)=>p.jsxs(Rn,{children:[p.jsx(Ve,{className:"text-sm text-muted-foreground",children:Hg(a.ts)}),p.jsx(Ve,{children:p.jsx(DTe,{event:a.event})}),p.jsx(Ve,{className:"font-mono text-xs text-muted-foreground",children:a.span_id.slice(0,8)}),p.jsx(Ve,{className:"max-w-[400px] text-sm",children:$Te(a,(s,c)=>r({hash:s,label:c}))})]},i))})]})})}),p.jsx(El,{open:!!n,onOpenChange:()=>r(null),children:p.jsxs(_l,{className:"max-w-3xl overflow-hidden",children:[p.jsx(jl,{children:p.jsx(Cl,{children:n==null?void 0:n.label})}),n&&p.jsx(zTe,{runId:t,hash:n.hash})]})})]})}function zTe({runId:e,hash:t}){const[n,r]=x.useState(null),[a,i]=x.useState(null);return x.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(s=>{if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.text()}).then(r).catch(s=>i(s.message))},[e,t]),a?p.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",a]}):n===null?p.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):p.jsx(Rm,{className:"max-h-[60vh]",children:p.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-4 font-mono text-xs leading-relaxed",children:n})})}function $Te(e,t){const n=e.data,r=[];for(const[i,s]of Object.entries(n))if(i.endsWith("_ref")&&s){const c=i.replace(/_ref$/,"");r.push(p.jsx("button",{className:"rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 font-mono text-xs text-primary hover:bg-primary/10",onClick:()=>t(String(s),c),children:c},i))}const a=[];for(const[i,s]of Object.entries(n)){if(i.endsWith("_ref")||s==null||s==="")continue;const c=i==="duration_ms"?S0(s):Array.isArray(s)?s.join(", "):String(s);a.push(p.jsxs("span",{children:[p.jsxs("span",{className:"text-muted-foreground",children:[i,"="]}),p.jsx("span",{children:c})]},i))}return p.jsxs(p.Fragment,{children:[r.length>0&&p.jsx("div",{className:"mb-1 flex flex-wrap gap-1",children:r}),a.length>0&&p.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:a})]})}function BTe(e){if(e===null)return"";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}function UTe({status:e}){return e==="running"||e==="starting"?p.jsxs(qt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[p.jsx(wc,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?p.jsxs(qt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[p.jsx(dC,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?p.jsxs(qt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[p.jsx(mB,{className:"h-3 w-3"}),"Failed"]}):p.jsx(qt,{variant:"outline",children:e})}function HTe({session:e,projectId:t}){const n=e.status==="running"||e.status==="starting";return p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent"}),p.jsx(UTe,{status:e.status}),e.duration_ms!==null&&p.jsx("span",{className:"text-xs text-muted-foreground",children:BTe(e.duration_ms)}),p.jsx("span",{className:"text-xs text-muted-foreground",children:e.role})]}),p.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:n?p.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[p.jsx(wc,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?p.jsx("p",{className:"whitespace-pre-wrap text-foreground",children:e.summary}):p.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),p.jsxs(gr,{to:`/projects/${t}/sessions/${e.run_id}`,className:"flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[p.jsx(Jte,{className:"h-3 w-3"}),"View session"]})]})}function FTe({task:e}){return p.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[p.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),p.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:p.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}function qTe(){var Xr;const{projectId:e,conversationId:t}=Gy(),n=Number(e),r=Number(t),[a,i]=x.useState(""),[s,c]=x.useState(""),[u,d]=x.useState([]),[m,f]=x.useState(!1),[v,g]=x.useState(!1),[b,w]=x.useState(!1),[S,E]=x.useState(""),[O,j]=x.useState(!1),[A,N]=x.useState(""),[T,P]=x.useState(!1),[R,D]=x.useState(""),[K,z]=x.useState(""),[I,G]=x.useState(""),[L,Y]=x.useState(""),[k,H]=x.useState(""),[q,F]=x.useState(""),[V,B]=x.useState(""),$=x.useRef(null),X=x.useRef(null),Z=ft(),ee=wC(),{data:le}=To("agents"),{data:ie}=To("memories"),ae=gC(n),J=vC(n),re=(Xr=ae.data)==null?void 0:Xr.merged,{data:fe,error:ne}=XM(r),xe=(fe==null?void 0:fe.sessions.some(ge=>ge.status==="running"||ge.status==="starting"))??!1;XM(r,{refetchInterval:xe?2e3:!1});const ye=Sre(r),De=FB(),Me=yC(n),Ke=s.trim()&&!(ee.data??[]).includes(s.trim())?"Role not found in installed roles":"",Je=fe==null?void 0:fe.sessions[fe.sessions.length-1],nt=(Je==null?void 0:Je.status)==="running"||(Je==null?void 0:Je.status)==="starting";x.useEffect(()=>{var ge;(ge=$.current)==null||ge.scrollIntoView({behavior:"smooth"})},[fe==null?void 0:fe.sessions.length,Je==null?void 0:Je.summary,Je==null?void 0:Je.status]);const pn=(le??[]).map(ge=>ge.name),Bn=[...new Set((ie??[]).map(ge=>ge.name)),"none"].sort(),Et=R.trim()&&pn.length>0&&!pn.includes(R.trim())?"Runtime not found in installed agents":"",vn=K.trim()&&Bn.length>0&&!Bn.includes(K.trim())?"Memory not found in installed providers":"",It=!!Et||!!vn,Sr=[R,K,I,L,k,q,V].filter(ge=>ge.trim()).length,dn=ge=>d(Ct=>Ct.includes(ge)?Ct.filter(Rr=>Rr!==ge):[...Ct,ge]),Mr=ge=>{ge.preventDefault(),g(!0)},Er=ge=>{ge.preventDefault(),g(!0)},ga=ge=>{ge.preventDefault(),g(!1)},Un=async ge=>{ge.preventDefault(),g(!1);const Ct=Array.from(ge.dataTransfer.files);if(Ct.length){w(!0);try{const Rr=await ze.upload(`/projects/${n}/files`,Ct);Z.invalidateQueries({queryKey:Be.projects.files(n)}),d(Ua=>{const Ha=Rr.map(ir=>ir.path).filter(ir=>!Ua.includes(ir));return[...Ua,...Ha]})}catch{}finally{w(!1)}}};function ya(ge){ge.preventDefault();const Ct=a.trim();if(!Ct||nt||Ke||It)return;const Rr={task:Ct,role:s.trim()||void 0,context_files:u.length>0?u:void 0,system_prompt:I.trim()||void 0,runtime:R.trim()||void 0,memory:K.trim()||void 0,max_num_delegations:L.trim()?Number(L):void 0,cache_delegations:k?k==="true":void 0,cache_max_entries:q.trim()?Number(q):void 0,cache_ttl_seconds:V.trim()?Number(V):void 0};ye.mutate(Rr,{onSuccess:()=>{i(""),d([]),f(!1)}})}function _r(ge){ge.key==="Enter"&&!ge.shiftKey&&(ge.preventDefault(),ya(ge))}function kr(){N((fe==null?void 0:fe.title)??""),j(!0),setTimeout(()=>{var ge;return(ge=X.current)==null?void 0:ge.select()},0)}function we(){const ge=A.trim();Me.mutate({conversationId:r,title:ge||null}),j(!1)}function xt(ge){ge.key==="Enter"&&(ge.preventDefault(),we()),ge.key==="Escape"&&j(!1)}if(ne)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",ne.message]})]});const ht=(fe==null?void 0:fe.title)??`Conversation #${r}`;return p.jsxs("div",{className:"flex h-full flex-col",children:[p.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[p.jsx("div",{className:"flex items-center gap-3",children:O?p.jsx(Ze,{ref:X,value:A,onChange:ge=>N(ge.target.value),onBlur:we,onKeyDown:xt,className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${r}`}):p.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:kr,title:"Click to rename",children:ht})}),fe&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[fe.sessions.length," session",fe.sessions.length!==1?"s":""]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:p.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[(fe==null?void 0:fe.sessions.length)===0&&p.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),fe==null?void 0:fe.sessions.map(ge=>p.jsxs("div",{className:"space-y-4",children:[ge.task&&p.jsx(FTe,{task:ge.task}),p.jsx(HTe,{session:ge,projectId:n})]},ge.run_id)),p.jsx("div",{ref:$})]})}),p.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:p.jsxs("form",{onSubmit:ya,className:"mx-auto max-w-2xl space-y-2",children:[p.jsxs("div",{className:"relative",onDragOver:Mr,onDragEnter:Er,onDragLeave:ga,onDrop:Un,children:[p.jsx(Cd,{value:a,onChange:ge=>i(ge.target.value),onKeyDown:_r,placeholder:nt?"Agent is working…":"Describe the next task… (Enter to submit, Shift+Enter for new line, drag & drop files to attach)",disabled:nt||ye.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(v||b)&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:b?p.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx(wc,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):p.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[p.jsx(mC,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(J.data??[]).length>0&&p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(Fh,{children:[p.jsx(qh,{asChild:!0,children:p.jsxs(Ee,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[p.jsx(xB,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),p.jsxs(Kh,{align:"start",className:"w-64",onCloseAutoFocus:ge=>ge.preventDefault(),children:[p.jsx("div",{className:"px-2 py-1.5",children:p.jsx(Ze,{placeholder:"Filter files…",value:S,onChange:ge=>E(ge.target.value),className:"h-7 text-xs",onKeyDown:ge=>ge.stopPropagation()})}),p.jsx("div",{className:"max-h-48 overflow-y-auto",children:(J.data??[]).filter(ge=>ge.path.toLowerCase().includes(S.toLowerCase())).map(ge=>p.jsx(HB,{checked:u.includes(ge.path),onCheckedChange:()=>dn(ge.path),onSelect:Ct=>Ct.preventDefault(),children:p.jsx("span",{className:"font-mono text-xs",children:ge.path})},ge.path))})]})]}),u.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.length," attached"]})]}),u.length>0&&p.jsxs("div",{className:"flex flex-wrap gap-1",children:[(m?u:u.slice(0,3)).map(ge=>p.jsxs(qt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[p.jsx("button",{type:"button",onClick:()=>dn(ge),className:"mr-0.5 rounded-sm hover:bg-muted",children:p.jsx(x0,{className:"h-3 w-3"})}),"@",ge]},ge)),!m&&u.length>3&&p.jsxs("button",{type:"button",onClick:()=>f(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",u.length-3," more"]}),m&&u.length>3&&p.jsx("button",{type:"button",onClick:()=>f(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),p.jsx("div",{className:"flex flex-col gap-1.5",children:p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsx(Ze,{list:"datalist-role",value:s,onChange:ge=>c(ge.target.value),placeholder:"Default role",className:"w-48 text-sm"}),Ke&&p.jsx("p",{className:"text-xs text-destructive",children:Ke})]}),p.jsx("datalist",{id:"datalist-role",children:(ee.data??[]).map(ge=>p.jsx("option",{value:ge},ge))}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsxs(Ee,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>P(!0),title:"Advanced options",children:[p.jsx(SB,{className:"h-4 w-4"}),Sr>0&&p.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-primary text-[9px] text-primary-foreground",children:Sr})]}),nt?p.jsxs(Ee,{type:"button",variant:"destructive",onClick:()=>Je&&De.mutate(Je.run_id),disabled:De.isPending,children:[De.isPending?p.jsx(wc,{className:"mr-2 h-4 w-4 animate-spin"}):p.jsx(Rne,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}):p.jsx(Ee,{type:"submit",disabled:!a.trim()||ye.isPending||!!Ke||It,children:ye.isPending?p.jsx(wc,{className:"h-4 w-4 animate-spin"}):p.jsx(Wte,{className:"h-4 w-4"})})]})]})})]})}),p.jsx(El,{open:T,onOpenChange:P,children:p.jsxs(_l,{className:"max-w-lg",children:[p.jsx(jl,{children:p.jsx(Cl,{children:"Advanced Options"})}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Runtime"}),p.jsx(Ze,{list:"adv-datalist-runtime",value:R,onChange:ge=>D(ge.target.value),placeholder:(re==null?void 0:re.runtime)??"default",className:"text-sm"}),p.jsx("datalist",{id:"adv-datalist-runtime",children:pn.map(ge=>p.jsx("option",{value:ge},ge))}),Et&&p.jsx("p",{className:"text-xs text-destructive",children:Et})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Memory"}),p.jsx(Ze,{list:"adv-datalist-memory",value:K,onChange:ge=>z(ge.target.value),placeholder:(re==null?void 0:re.memory)??"dial",className:"text-sm"}),p.jsx("datalist",{id:"adv-datalist-memory",children:Bn.map(ge=>p.jsx("option",{value:ge},ge))}),vn&&p.jsx("p",{className:"text-xs text-destructive",children:vn})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"System Prompt"}),p.jsx(Cd,{value:I,onChange:ge=>G(ge.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Max Delegations"}),p.jsx(Ze,{type:"number",min:"0",value:L,onChange:ge=>Y(ge.target.value),placeholder:re!=null&&re.max_num_delegations?String(re.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Cache Delegations"}),p.jsxs(zi,{value:k||"__empty__",onValueChange:ge=>H(ge==="__empty__"?"":ge),children:[p.jsx(Bi,{className:"h-8 text-xs",children:p.jsx($i,{placeholder:`Default (${(re==null?void 0:re.cache_delegations)!==!1?"true":"false"})`})}),p.jsxs(Ui,{children:[p.jsxs(Dn,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(re==null?void 0:re.cache_delegations)!==!1?"true":"false",")"]}),p.jsx(Dn,{value:"true",children:"true"}),p.jsx(Dn,{value:"false",children:"false"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Cache Max Entries"}),p.jsx(Ze,{type:"number",min:"0",value:q,onChange:ge=>F(ge.target.value),placeholder:re!=null&&re.cache_max_entries?String(re.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{children:"Cache TTL (seconds)"}),p.jsx(Ze,{type:"number",min:"0",value:V,onChange:ge=>B(ge.target.value),placeholder:re!=null&&re.cache_ttl_seconds?String(re.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),p.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[p.jsx(Ee,{variant:"ghost",size:"sm",onClick:()=>{D(""),z(""),G(""),Y(""),H(""),F(""),B("")},children:"Reset"}),p.jsx(Ee,{size:"sm",onClick:()=>P(!1),children:"Done"})]})]})})]})}const KTe={skills:["denden"],roles:["ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},VTe={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function YTe(){const{resourceType:e="roles"}=Gy(),{data:t,isLoading:n}=To(e),[r,a]=x.useState(null),[i,s]=x.useState(!1),[c,u]=x.useState(!1),{data:d}=Xae(e,r??"",{enabled:i&&!!r}),m=VTe[e]??e;return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:m}),p.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",m.toLowerCase()," from StrawHub"]})]}),p.jsxs(Ee,{onClick:()=>u(!0),size:"sm",children:[p.jsx(y0,{className:"mr-2 h-4 w-4"}),"Install"]})]}),n?p.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((f,v)=>p.jsx(cn,{className:"h-12 w-full"},v))}):!t||t.length===0?p.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",m.toLowerCase()," installed yet."]}):p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Name"}),p.jsx(Ye,{children:"Version"}),p.jsx(Ye,{children:"Description"}),p.jsx(Ye,{children:"Source"}),p.jsx(Ye,{className:"w-24"})]})}),p.jsx(Ho,{children:t.map(f=>{var v;return p.jsxs(Rn,{className:"cursor-pointer",onClick:()=>{a(f.name),s(!0)},children:[p.jsx(Ve,{className:"font-medium",children:f.name}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:f.version??"—"}),p.jsx(Ve,{className:"max-w-[300px] truncate text-sm",children:f.description||"—"}),p.jsx(Ve,{children:p.jsx(qt,{variant:"outline",className:"text-xs",children:f.source})}),p.jsx(Ve,{children:!((v=KTe[e])!=null&&v.includes(f.name))&&p.jsx(GTe,{resourceType:e,name:f.name})})]},f.name)})})]}),p.jsx(ZB,{resource:d??null,resourceType:e,open:i,onOpenChange:s}),p.jsx(jC,{open:c,onOpenChange:u,defaultType:e})]})}function GTe({resourceType:e,name:t}){const[n,r]=x.useState(!1),a=WB(),i=s=>{s.stopPropagation(),a.mutate({type:e,name:t},{onSuccess:c=>{c.exit_code===0?wt.success(`Uninstalled ${t}`):wt.error(`Uninstall failed: ${c.stderr||c.stdout}`),r(!1)},onError:()=>{wt.error("Uninstall request failed"),r(!1)}})};return n?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Ee,{size:"sm",variant:"destructive",onClick:i,disabled:a.isPending,children:"Confirm"}),p.jsx(Ee,{size:"sm",variant:"outline",onClick:s=>{s.stopPropagation(),r(!1)},children:"No"})]}):p.jsx(Ee,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:s=>{s.stopPropagation(),r(!0)},children:p.jsx(Sl,{className:"h-4 w-4"})})}function XTe(){return mn({queryKey:Be.schedules.all,queryFn:()=>ze.get("/schedules")})}function WTe(){const e=ft();return Mt({mutationFn:t=>ze.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Be.schedules.all})}})}function QTe(){const e=ft();return Mt({mutationFn:({id:t,...n})=>ze.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:Be.schedules.all})}})}function ZTe(){const e=ft();return Mt({mutationFn:t=>ze.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Be.schedules.all})}})}function JTe(){const e=ft();return Mt({mutationFn:({id:t,enable:n})=>ze.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Be.schedules.all})}})}var WS={exports:{}},ez;function e2e(){return ez||(ez=1,(function(e,t){(function(r,a){e.exports=a()})(globalThis,()=>(()=>{var n={949(s,c,u){Object.defineProperty(c,"__esModule",{value:!0}),c.CronParser=void 0;var d=u(515),m=(function(){function f(v,g,b){g===void 0&&(g=!0),b===void 0&&(b=!1),this.expression=v,this.dayOfWeekStartIndexZero=g,this.monthStartIndexZero=b}return f.prototype.parse=function(){var v,g,b=(v=this.expression)!==null&&v!==void 0?v:"";if(b==="@reboot")return g=["@reboot","","","","","",""],g;if(b.startsWith("@")){var w=this.parseSpecial(this.expression);g=this.extractParts(w)}else g=this.extractParts(this.expression);return this.normalize(g),this.validate(g),g},f.prototype.parseSpecial=function(v){var g={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},b=g[v];if(!b)throw new Error("Unknown special expression.");return b},f.prototype.extractParts=function(v){if(!this.expression)throw new Error("cron expression is empty");for(var g=v.trim().split(/[ ]+/),b=0;b<g.length;b++)if(g[b].includes(",")){var w=g[b].split(",").map(function(E){return E.trim()}).filter(function(E){return E!==""}).map(function(E){return isNaN(Number(E))?E:Number(E)}).filter(function(E){return E!==null&&E!==""});w.length===0&&w.push("*"),w.sort(function(E,O){return E!==null&&O!==null?E-O:0}),g[b]=w.map(function(E){return E!==null?E.toString():""}).join(",")}if(g.length<5)throw new Error("Expression has only ".concat(g.length," part").concat(g.length==1?"":"s",". At least 5 parts are required."));if(g.length==5)g.unshift(""),g.push("");else if(g.length==6){var S=/\d{4}$/.test(g[5])||g[4]=="?"||g[2]=="?";S?g.unshift(""):g.push("")}else if(g.length>7)throw new Error("Expression has ".concat(g.length," parts; too many!"));return g},f.prototype.normalize=function(v){var g=this;if(v[3]=v[3].replace("?","*"),v[5]=v[5].replace("?","*"),v[2]=v[2].replace("?","*"),v[0].indexOf("0/")==0&&(v[0]=v[0].replace("0/","*/")),v[1].indexOf("0/")==0&&(v[1]=v[1].replace("0/","*/")),v[2].indexOf("0/")==0&&(v[2]=v[2].replace("0/","*/")),v[3].indexOf("1/")==0&&(v[3]=v[3].replace("1/","*/")),v[4].indexOf("1/")==0&&(v[4]=v[4].replace("1/","*/")),v[6].indexOf("1/")==0&&(v[6]=v[6].replace("1/","*/")),v[5]=v[5].replace(/(^\d)|([^#/\s]\d)/g,function(N){var T=N.replace(/\D/,""),P=T;return g.dayOfWeekStartIndexZero?T=="7"&&(P="0"):P=(parseInt(T)-1).toString(),N.replace(T,P)}),v[5]=="L"&&(v[5]="6"),v[3]=="?"&&(v[3]="*"),v[3].indexOf("W")>-1&&(v[3].indexOf(",")>-1||v[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var b={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var w in b)v[5]=v[5].replace(new RegExp(w,"gi"),b[w].toString());v[4]=v[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(N){var T=N.replace(/\D/,""),P=T;return g.monthStartIndexZero&&(P=(parseInt(T)+1).toString()),N.replace(T,P)});var S={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var E in S)v[4]=v[4].replace(new RegExp(E,"gi"),S[E].toString());v[0]=="0"&&(v[0]=""),!/\*|\-|\,|\//.test(v[2])&&(/\*|\//.test(v[1])||/\*|\//.test(v[0]))&&(v[2]+="-".concat(v[2]));for(var O=0;O<v.length;O++)if(v[O].indexOf(",")!=-1&&(v[O]=v[O].split(",").filter(function(N){return N!==""}).join(",")||"*"),v[O]=="*/1"&&(v[O]="*"),v[O].indexOf("/")>-1&&!/^\*|\-|\,/.test(v[O])){var j=null;switch(O){case 4:j="12";break;case 5:j="6";break;case 6:j="9999";break;default:j=null;break}if(j!==null){var A=v[O].split("/");v[O]="".concat(A[0],"-").concat(j,"/").concat(A[1])}}},f.prototype.validate=function(v){var g="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(v[0],g),this.validateOnlyExpectedCharactersFound(v[1],g),this.validateOnlyExpectedCharactersFound(v[2],g),this.validateOnlyExpectedCharactersFound(v[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(v[4],g),this.validateOnlyExpectedCharactersFound(v[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(v[6],g),this.validateAnyRanges(v)},f.prototype.validateAnyRanges=function(v){d.default.secondRange(v[0]),d.default.minuteRange(v[1]),d.default.hourRange(v[2]),d.default.dayOfMonthRange(v[3]),d.default.monthRange(v[4],this.monthStartIndexZero),d.default.dayOfWeekRange(v[5],this.dayOfWeekStartIndexZero)},f.prototype.validateOnlyExpectedCharactersFound=function(v,g){var b=v.match(new RegExp("[^".concat(g,"]+"),"gi"));if(b&&b.length)throw new Error("Expression contains invalid values: '".concat(b.toString(),"'"))},f})();c.CronParser=m},333(s,c,u){Object.defineProperty(c,"__esModule",{value:!0}),c.ExpressionDescriptor=void 0;var d=u(823),m=u(949),f=(function(){function v(g,b){if(this.expression=g,this.options=b,this.expressionParts=new Array(5),!this.options.locale&&v.defaultLocale&&(this.options.locale=v.defaultLocale),!v.locales[this.options.locale]){var w=Object.keys(v.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(w,"'.")),this.options.locale=w}this.i18n=v.locales[this.options.locale],b.use24HourTimeFormat===void 0&&(b.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return v.toString=function(g,b){var w=b===void 0?{}:b,S=w.throwExceptionOnParseError,E=S===void 0?!0:S,O=w.verbose,j=O===void 0?!1:O,A=w.dayOfWeekStartIndexZero,N=A===void 0?!0:A,T=w.monthStartIndexZero,P=T===void 0?!1:T,R=w.use24HourTimeFormat,D=w.locale,K=D===void 0?null:D,z=w.logicalAndDayFields,I=z===void 0?!1:z,G={throwExceptionOnParseError:E,verbose:j,dayOfWeekStartIndexZero:N,monthStartIndexZero:P,use24HourTimeFormat:R,locale:K,logicalAndDayFields:I};G.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var L=new v(g,G);return L.getFullDescription()},v.initialize=function(g,b){b===void 0&&(b="en"),v.specialCharacters=["/","-",",","*"],v.defaultLocale=b,g.load(v.locales)},v.prototype.getFullDescription=function(){var g,b,w="";try{var S=new m.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=S.parse(),this.expressionParts[0]==="@reboot")return((b=(g=this.i18n).atReboot)===null||b===void 0?void 0:b.call(g))||"Run once, at startup";var E=this.getTimeOfDayDescription(),O=this.getDayOfMonthDescription(),j=this.getMonthDescription(),A=this.getDayOfWeekDescription(),N=this.getYearDescription();w+=E+O+A+j+N,w=this.transformVerbosity(w,!!this.options.verbose),w=w.charAt(0).toLocaleUpperCase()+w.substr(1)}catch(T){if(!this.options.throwExceptionOnParseError)w=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(T)}return w},v.prototype.getTimeOfDayDescription=function(){var g=this.expressionParts[0],b=this.expressionParts[1],w=this.expressionParts[2],S="";if(!d.StringUtilities.containsAny(b,v.specialCharacters)&&!d.StringUtilities.containsAny(w,v.specialCharacters)&&!d.StringUtilities.containsAny(g,v.specialCharacters))S+=this.i18n.atSpace()+this.formatTime(w,b,g);else if(!g&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!d.StringUtilities.containsAny(w,v.specialCharacters)){var E=b.split("-");S+=d.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(w,E[0],""),this.formatTime(w,E[1],""))}else if(!g&&w.indexOf(",")>-1&&w.indexOf("-")==-1&&w.indexOf("/")==-1&&!d.StringUtilities.containsAny(b,v.specialCharacters)){var O=w.split(",");S+=this.i18n.at();for(var j=0;j<O.length;j++)S+=" ",S+=this.formatTime(O[j],b,""),j<O.length-2&&(S+=","),j==O.length-2&&(S+=this.i18n.spaceAnd())}else{var A=this.getSecondsDescription(),N=this.getMinutesDescription(),T=this.getHoursDescription();if(S+=A,S&&N&&(S+=", "),S+=N,N===T)return S;S&&T&&(S+=", "),S+=T}return S},v.prototype.getSecondsDescription=function(){var g=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(w){return w},function(w){return d.StringUtilities.format(g.i18n.everyX0Seconds(w),w)},function(w){return g.i18n.secondsX0ThroughX1PastTheMinute()},function(w){return w=="0"?"":parseInt(w)<20?g.i18n.atX0SecondsPastTheMinute(w):g.i18n.atX0SecondsPastTheMinuteGt20()||g.i18n.atX0SecondsPastTheMinute(w)});return b},v.prototype.getMinutesDescription=function(){var g=this,b=this.expressionParts[0],w=this.expressionParts[2],S=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(E){return E},function(E){return d.StringUtilities.format(g.i18n.everyX0Minutes(E),E)},function(E){return g.i18n.minutesX0ThroughX1PastTheHour()},function(E){var O,j;try{return E=="0"&&w.indexOf("/")==-1&&b==""?g.i18n.everyHour():E=="0"?((j=(O=g.i18n).onTheHour)===null||j===void 0?void 0:j.call(O))||g.i18n.atX0MinutesPastTheHour(E):parseInt(E)<20?g.i18n.atX0MinutesPastTheHour(E):g.i18n.atX0MinutesPastTheHourGt20()||g.i18n.atX0MinutesPastTheHour(E)}catch{return g.i18n.atX0MinutesPastTheHour(E)}});return S},v.prototype.getHoursDescription=function(){var g=this,b=this.expressionParts[2],w=0,S=[];b.split("/")[0].split(",").forEach(function(j){var A=j.split("-");A.length===2&&S.push({value:A[1],index:w+1}),w+=A.length});var E=0,O=this.getSegmentDescription(b,this.i18n.everyHour(),function(j){var A=S.find(function(T){return T.value===j&&T.index===E}),N=A&&g.expressionParts[1]!=="0";return E++,N?g.formatTime(j,"59",""):g.formatTime(j,"0","")},function(j){return d.StringUtilities.format(g.i18n.everyX0Hours(j),j)},function(j){return g.i18n.betweenX0AndX1()},function(j){return g.i18n.atX0()});return O},v.prototype.getDayOfWeekDescription=function(){var g=this,b=this.i18n.daysOfTheWeek(),w=null;return this.expressionParts[5]=="*"?w="":w=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(S,E){var O=S;S.indexOf("#")>-1?O=S.substring(0,S.indexOf("#")):S.indexOf("L")>-1&&(O=O.replace("L",""));var j=parseInt(O),A=g.i18n.daysOfTheWeekInCase?g.i18n.daysOfTheWeekInCase(E)[j]:b[j];if(S.indexOf("#")>-1){var N=null,T=S.substring(S.indexOf("#")+1),P=S.substring(0,S.indexOf("#"));switch(T){case"1":N=g.i18n.first(P);break;case"2":N=g.i18n.second(P);break;case"3":N=g.i18n.third(P);break;case"4":N=g.i18n.fourth(P);break;case"5":N=g.i18n.fifth(P);break}A=N+" "+A}return A},function(S){return parseInt(S)==1?"":d.StringUtilities.format(g.i18n.commaEveryX0DaysOfTheWeek(S),S)},function(S){var E=S.substring(0,S.indexOf("-")),O=g.expressionParts[3]!="*";return O?g.i18n.commaAndX0ThroughX1(E):g.i18n.commaX0ThroughX1(E)},function(S){var E=null;if(S.indexOf("#")>-1){var O=S.substring(S.indexOf("#")+1),j=S.substring(0,S.indexOf("#"));E=g.i18n.commaOnThe(O,j).trim()+g.i18n.spaceX0OfTheMonth()}else if(S.indexOf("L")>-1)E=g.i18n.commaOnTheLastX0OfTheMonth(S.replace("L",""));else{var A=g.expressionParts[3]!="*";A?g.options.logicalAndDayFields?E=g.i18n.commaOnlyOnX0(S):E=g.i18n.commaAndOnX0():E=g.i18n.commaOnlyOnX0(S)}return E}),w},v.prototype.getMonthDescription=function(){var g=this,b=this.i18n.monthsOfTheYear(),w=this.getSegmentDescription(this.expressionParts[4],"",function(S,E){return E&&g.i18n.monthsOfTheYearInCase?g.i18n.monthsOfTheYearInCase(E)[parseInt(S)-1]:b[parseInt(S)-1]},function(S){return parseInt(S)==1?"":d.StringUtilities.format(g.i18n.commaEveryX0Months(S),S)},function(S){return g.i18n.commaMonthX0ThroughMonthX1()||g.i18n.commaX0ThroughX1()},function(S){return g.i18n.commaOnlyInMonthX0?g.i18n.commaOnlyInMonthX0():g.i18n.commaOnlyInX0()});return w},v.prototype.getDayOfMonthDescription=function(){var g=this,b=null,w=this.expressionParts[3];switch(w){case"L":b=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":b=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var S=w.match(/(\d{1,2}W)|(W\d{1,2})/);if(S){var E=parseInt(S[0].replace("W","")),O=E==1?this.i18n.firstWeekday():d.StringUtilities.format(this.i18n.weekdayNearestDayX0(),E.toString());b=d.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),O);break}else{var j=w.match(/L-(\d{1,2})/);if(j){var A=j[1];b=d.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(A),A);break}else{if(w=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(w,this.i18n.commaEveryDay(),function(N){return N=="L"?g.i18n.lastDay():g.i18n.dayX0?d.StringUtilities.format(g.i18n.dayX0(),N):N},function(N){return N=="1"?g.i18n.commaEveryDay():g.i18n.commaEveryX0Days(N)},function(N){return g.i18n.commaBetweenDayX0AndX1OfTheMonth(N)},function(N){return g.i18n.commaOnDayX0OfTheMonth(N)})}break}}return b},v.prototype.getYearDescription=function(){var g=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(w){return/^\d+$/.test(w)?new Date(parseInt(w),1).getFullYear().toString():w},function(w){return d.StringUtilities.format(g.i18n.commaEveryX0Years(w),w)},function(w){return g.i18n.commaYearX0ThroughYearX1()||g.i18n.commaX0ThroughX1()},function(w){return g.i18n.commaOnlyInYearX0?g.i18n.commaOnlyInYearX0():g.i18n.commaOnlyInX0()});return b},v.prototype.getSegmentDescription=function(g,b,w,S,E,O){var j=null,A=g.indexOf("/")>-1,N=g.indexOf("-")>-1,T=g.indexOf(",")>-1;if(!g)j="";else if(g==="*")j=b;else if(!A&&!N&&!T)j=d.StringUtilities.format(O(g),w(g));else if(T){for(var P=g.split(","),R="",D=0;D<P.length;D++)if(D>0&&P.length>2&&(R+=",",D<P.length-1&&(R+=" ")),D>0&&P.length>1&&(D==P.length-1||P.length==2)&&(R+="".concat(this.i18n.spaceAnd()," ")),P[D].indexOf("/")>-1||P[D].indexOf("-")>-1){var K=P[D].indexOf("-")>-1&&P[D].indexOf("/")==-1,z=this.getSegmentDescription(P[D],b,w,S,K?this.i18n.commaX0ThroughX1:E,O);K&&(z=z.replace(", ","")),R+=z}else if(!A)R+=w(P[D]);else{var I=this.getSegmentDescription(P[D],b,w,S,E,O);I&&I.startsWith(", ")&&(I=I.substring(2)),R+=I}A?j=R:j=d.StringUtilities.format(O(g),R)}else if(A){var P=g.split("/");if(j=d.StringUtilities.format(S(P[1]),P[1]),P[0].indexOf("-")>-1){var G=this.generateRangeSegmentDescription(P[0],E,w);G.indexOf(", ")!=0&&(j+=", "),j+=G}else if(P[0].indexOf("*")==-1){var L=d.StringUtilities.format(O(P[0]),w(P[0]));L=L.replace(", ",""),j+=d.StringUtilities.format(this.i18n.commaStartingX0(),L)}}else N&&(j=this.generateRangeSegmentDescription(g,E,w));return j},v.prototype.generateRangeSegmentDescription=function(g,b,w){var S="",E=g.split("-"),O=w(E[0],1),j=w(E[1],2),A=b(g);return S+=d.StringUtilities.format(A,O,j),S},v.prototype.formatTime=function(g,b,w){var S=0,E=0,O=parseInt(g)+S,j=parseInt(b)+E;j>=60?(j-=60,O+=1):j<0&&(j+=60,O-=1),O>=24?O=O-24:O<0&&(O=24+O);var A="",N=!1;this.options.use24HourTimeFormat||(N=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),A=N?"".concat(this.getPeriod(O)," "):" ".concat(this.getPeriod(O)),O>12&&(O-=12),O===0&&(O=12));var T="";return w&&(T=":".concat(("00"+w).substring(w.length))),"".concat(N?A:"").concat(("00"+O.toString()).substring(O.toString().length),":").concat(("00"+j.toString()).substring(j.toString().length)).concat(T).concat(N?"":A)},v.prototype.transformVerbosity=function(g,b){if(!b&&(g=g.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),g=g.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),g=g.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),g=g.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var w=0,S=Object.entries(this.i18n.conciseVerbosityReplacements());w<S.length;w++){var E=S[w],O=E[0],j=E[1];g=g.replace(new RegExp(O,"g"),j)}return g},v.prototype.getPeriod=function(g){return g>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},v.locales={},v})();c.ExpressionDescriptor=f},747(s,c,u){Object.defineProperty(c,"__esModule",{value:!0}),c.enLocaleLoader=void 0;var d=u(486),m=(function(){function f(){}return f.prototype.load=function(v){v.en=new d.en},f})();c.enLocaleLoader=m},486(s,c){Object.defineProperty(c,"__esModule",{value:!0}),c.en=void 0;var u=(function(){function d(){}return d.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},d.prototype.atX0MinutesPastTheHourGt20=function(){return null},d.prototype.commaMonthX0ThroughMonthX1=function(){return null},d.prototype.commaYearX0ThroughYearX1=function(){return null},d.prototype.use24HourTimeFormatByDefault=function(){return!1},d.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},d.prototype.everyMinute=function(){return"every minute"},d.prototype.everyHour=function(){return"every hour"},d.prototype.atSpace=function(){return"At "},d.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},d.prototype.at=function(){return"At"},d.prototype.spaceAnd=function(){return" and"},d.prototype.everySecond=function(){return"every second"},d.prototype.everyX0Seconds=function(){return"every %s seconds"},d.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},d.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},d.prototype.everyX0Minutes=function(){return"every %s minutes"},d.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},d.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},d.prototype.everyX0Hours=function(){return"every %s hours"},d.prototype.betweenX0AndX1=function(){return"between %s and %s"},d.prototype.atX0=function(){return"at %s"},d.prototype.commaEveryDay=function(){return", every day"},d.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},d.prototype.commaX0ThroughX1=function(){return", %s through %s"},d.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},d.prototype.first=function(){return"first"},d.prototype.second=function(){return"second"},d.prototype.third=function(){return"third"},d.prototype.fourth=function(){return"fourth"},d.prototype.fifth=function(){return"fifth"},d.prototype.commaOnThe=function(){return", on the "},d.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},d.prototype.lastDay=function(){return"the last day"},d.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},d.prototype.commaOnlyOnX0=function(){return", only on %s"},d.prototype.commaAndOnX0=function(){return", and on %s"},d.prototype.commaEveryX0Months=function(){return", every %s months"},d.prototype.commaOnlyInX0=function(){return", only in %s"},d.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},d.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},d.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},d.prototype.firstWeekday=function(){return"first weekday"},d.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},d.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},d.prototype.commaEveryX0Days=function(){return", every %s days in a month"},d.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},d.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},d.prototype.commaEveryHour=function(){return", every hour"},d.prototype.commaEveryX0Years=function(){return", every %s years"},d.prototype.commaStartingX0=function(){return", starting %s"},d.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},d.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},d.prototype.atReboot=function(){return"Run once, at startup"},d.prototype.onTheHour=function(){return"on the hour"},d})();c.en=u},515(s,c){Object.defineProperty(c,"__esModule",{value:!0});function u(m,f){if(!m)throw new Error(f)}var d=(function(){function m(){}return m.secondRange=function(f){for(var v=f.split(","),g=0;g<v.length;g++)if(!isNaN(parseInt(v[g],10))){var b=parseInt(v[g],10);u(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},m.minuteRange=function(f){for(var v=f.split(","),g=0;g<v.length;g++)if(!isNaN(parseInt(v[g],10))){var b=parseInt(v[g],10);u(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},m.hourRange=function(f){for(var v=f.split(","),g=0;g<v.length;g++)if(!isNaN(parseInt(v[g],10))){var b=parseInt(v[g],10);u(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},m.dayOfMonthRange=function(f){for(var v=f.split(","),g=0;g<v.length;g++)if(!isNaN(parseInt(v[g],10))){var b=parseInt(v[g],10);u(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},m.monthRange=function(f,v){for(var g=f.split(","),b=0;b<g.length;b++)if(!isNaN(parseInt(g[b],10))){var w=parseInt(g[b],10);u(w>=1&&w<=12,v?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},m.dayOfWeekRange=function(f,v){for(var g=f.split(","),b=0;b<g.length;b++)if(!isNaN(parseInt(g[b],10))){var w=parseInt(g[b],10);u(w>=0&&w<=6,v?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},m})();c.default=d},823(s,c){Object.defineProperty(c,"__esModule",{value:!0}),c.StringUtilities=void 0;var u=(function(){function d(){}return d.format=function(m){for(var f=[],v=1;v<arguments.length;v++)f[v-1]=arguments[v];return m.replace(/%s/g,function(g){return f.shift()})},d.containsAny=function(m,f){return f.some(function(v){return m.indexOf(v)>-1})},d})();c.StringUtilities=u}},r={};function a(s){var c=r[s];if(c!==void 0)return c.exports;var u=r[s]={exports:{}};return n[s](u,u.exports,a),u.exports}var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.toString=void 0;var c=a(333),u=a(747);c.ExpressionDescriptor.initialize(new u.enLocaleLoader),s.default=c.ExpressionDescriptor;var d=c.ExpressionDescriptor.toString;s.toString=d})(),i})())})(WS)),WS.exports}var t2e=e2e();const n2e=ci(t2e),r2e=[{label:"Every 1 minute",value:"* * * * *"},{label:"Every 5 minutes",value:"*/5 * * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Daily at midnight",value:"0 0 * * *"},{label:"Weekdays at 9am",value:"0 9 * * 1-5"},{label:"Weekly Monday 9am",value:"0 9 * * 1"}];function a2e({open:e,onOpenChange:t,editing:n}){const{data:r}=Qd(),{data:a}=wC(),i=WTe(),s=QTe(),[c,u]=x.useState(""),[d,m]=x.useState(""),[f,v]=x.useState(""),[g,b]=x.useState(""),[w,S]=x.useState(""),[E,O]=x.useState(""),[j,A]=x.useState(!0),[N,T]=x.useState(!1);x.useEffect(()=>{e&&n?(u(n.name),m(String(n.project_id)),v(n.task),b(n.cron_expr),S(n.role??""),O(n.system_prompt??""),A(n.skip_if_running)):e&&!n&&P()},[e,n]);function P(){u(""),m(""),v(""),b(""),S(""),O(""),A(!0),T(!1)}async function R(I){I.preventDefault();try{const G={name:c.trim(),task:f.trim(),cron_expr:g.trim(),role:w.trim()||void 0,system_prompt:E.trim()||void 0,skip_if_running:j};n?await s.mutateAsync({id:n.id,...G}):await i.mutateAsync({...G,project_id:Number(d)}),P(),t(!1)}catch{}}const D=x.useMemo(()=>{if(!g.trim())return null;try{return n2e.toString(g.trim())}catch{return null}},[g]),K=i.isPending||s.isPending,z=i.error||s.error;return p.jsx(El,{open:e,onOpenChange:t,children:p.jsxs(_l,{className:"max-w-lg",children:[p.jsx(jl,{children:p.jsx(Cl,{children:n?"Edit Schedule":"Create Schedule"})}),p.jsxs("form",{onSubmit:R,className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsxs(mt,{htmlFor:"sched-name",children:["Name ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx(Ze,{id:"sched-name",value:c,onChange:I=>u(I.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs(mt,{htmlFor:"sched-project",children:["Project ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsxs(zi,{value:d,onValueChange:m,required:!0,children:[p.jsx(Bi,{id:"sched-project",children:p.jsx($i,{placeholder:"Select a project"})}),p.jsx(Ui,{children:(r??[]).map(I=>p.jsx(Dn,{value:String(I.id),children:I.display_name},I.id))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs(mt,{htmlFor:"sched-task",children:["Task ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx(Cd,{id:"sched-task",value:f,onChange:I=>v(I.target.value),placeholder:"What should the agent do each time this runs?",required:!0,rows:3})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs(mt,{htmlFor:"sched-cron",children:["Cron Expression ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsxs(Fh,{children:[p.jsx(qh,{asChild:!0,children:p.jsxs(Ee,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",p.jsx(Hh,{className:"ml-1 h-3 w-3"})]})}),p.jsx(Kh,{align:"end",children:r2e.map(I=>p.jsxs(Ch,{onClick:()=>b(I.value),children:[p.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:I.value}),I.label]},I.value))})]})]}),p.jsx(Ze,{id:"sched-cron",value:g,onChange:I=>b(I.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),D&&p.jsx("p",{className:"text-xs text-muted-foreground",children:D})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"sched-role",children:"Role"}),p.jsx(Ze,{id:"sched-role",value:w,onChange:I=>S(I.target.value),placeholder:(a==null?void 0:a[0])??"orchestrator",list:"sched-role-list"}),p.jsx("datalist",{id:"sched-role-list",children:(a??[]).map(I=>p.jsx("option",{value:I},I))})]}),p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:j,onChange:I=>A(I.target.checked),className:"rounded border-input"}),p.jsx("span",{className:"text-sm",children:"Skip if already running"}),p.jsx("span",{className:"text-xs text-muted-foreground",children:"— don't start a new session while a previous one is still active"})]}),p.jsxs(SC,{open:N,onOpenChange:T,children:[p.jsx(EC,{asChild:!0,children:p.jsxs(Ee,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[p.jsx(Hh,{className:`h-3 w-3 transition-transform ${N?"rotate-180":""}`}),"Advanced Options"]})}),p.jsx(_C,{className:"space-y-4 pt-2",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx(mt,{htmlFor:"sched-prompt",children:"System Prompt"}),p.jsx(Cd,{id:"sched-prompt",value:E,onChange:I=>O(I.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),z&&p.jsx("p",{className:"text-sm text-destructive",children:z.message}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Ee,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Ee,{type:"submit",disabled:K,children:K?"Saving...":n?"Update":"Create"})]})]})]})})}function tz(e){if(!e)return"—";try{const t=new Date(e),n=new Date,r=t.getTime()-n.getTime(),a=Math.abs(r);if(a<6e4)return r>0?"in < 1m":"< 1m ago";if(a<36e5){const i=Math.round(a/6e4);return r>0?`in ${i}m`:`${i}m ago`}if(a<864e5){const i=Math.round(a/36e5);return r>0?`in ${i}h`:`${i}h ago`}return t.toLocaleDateString()}catch{return"—"}}function i2e({schedule:e}){return e.enabled?e.last_error?p.jsx(uB,{children:p.jsxs(Ste,{children:[p.jsx(Ete,{children:p.jsx(qt,{variant:"destructive",children:"Error"})}),p.jsx(_te,{className:"max-w-xs",children:p.jsx("p",{className:"text-xs",children:e.last_error})})]})}):p.jsx(qt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):p.jsx(qt,{variant:"secondary",children:"Disabled"})}function o2e(){const{data:e,isLoading:t,error:n}=XTe(),[r,a]=x.useState(!1),[i,s]=x.useState(null),c=ZTe(),u=JTe();if(t)return p.jsxs("div",{className:"space-y-6",children:[p.jsx(cn,{className:"h-8 w-48"}),p.jsx(cn,{className:"h-64 rounded-lg"})]});if(n)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx($o,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",n.message]})]});const d=e??[];return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Scheduled Tasks"}),p.jsxs(Ee,{onClick:()=>{s(null),a(!0)},children:[p.jsx(Ug,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),d.length===0?p.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[p.jsx("p",{className:"text-muted-foreground",children:"No scheduled tasks yet."}),p.jsxs(Ee,{variant:"outline",className:"mt-4",onClick:()=>{s(null),a(!0)},children:[p.jsx(Ug,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):p.jsx("div",{className:"rounded-lg border",children:p.jsxs(Bo,{children:[p.jsx(Uo,{children:p.jsxs(Rn,{children:[p.jsx(Ye,{children:"Name"}),p.jsx(Ye,{children:"Project"}),p.jsx(Ye,{children:"Cron"}),p.jsx(Ye,{children:"Next Run"}),p.jsx(Ye,{children:"Last Run"}),p.jsx(Ye,{children:"Status"}),p.jsx(Ye,{className:"w-[120px]",children:"Actions"})]})}),p.jsx(Ho,{children:d.map(m=>p.jsxs(Rn,{children:[p.jsx(Ve,{className:"font-medium",children:m.name}),p.jsx(Ve,{className:"text-muted-foreground",children:m.project_name}),p.jsx(Ve,{children:p.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:m.cron_expr})}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:tz(m.next_run_at)}),p.jsx(Ve,{className:"text-sm text-muted-foreground",children:tz(m.last_run_at)}),p.jsx(Ve,{children:p.jsx(i2e,{schedule:m})}),p.jsx(Ve,{children:p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(Ee,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{s(m),a(!0)},children:p.jsx(fC,{className:"h-3.5 w-3.5"})}),p.jsx(Ee,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u.mutate({id:m.id,enable:!m.enabled}),children:m.enabled?p.jsx(_ne,{className:"h-3.5 w-3.5"}):p.jsx(hC,{className:"h-3.5 w-3.5"})}),p.jsx(Ee,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${m.name}"?`)&&c.mutate(m.id)},children:p.jsx(Sl,{className:"h-3.5 w-3.5"})})]})})]},m.id))})]})}),p.jsx(a2e,{open:r,onOpenChange:a,editing:i})]})}function QS(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},a=e.trace??{};return{runtime:dr(e.runtime),isolation:dr(e.isolation),memory:dr(e.memory),orchestrator_role:dr(t.role),orchestrator_permission_mode:dr(t.permission_mode),policy_max_depth:dr(n.max_depth),policy_agent_timeout:dr(n.agent_timeout),policy_max_delegate_retries:dr(n.max_delegate_retries),policy_cache_delegations:dr(n.cache_delegations),policy_cache_max_entries:dr(n.cache_max_entries),policy_cache_ttl_seconds:dr(n.cache_ttl_seconds),policy_max_num_delegations:dr(n.max_num_delegations),session_merge_strategy:dr(r.merge_strategy),session_pull_before_session:dr(r.pull_before_session),session_pr_command:dr(r.pr_command),trace_enabled:dr(a.enabled)}}function dr(e){return e==null?"":String(e)}function s2e(e){const t={};e.runtime&&(t.runtime=e.runtime),e.isolation&&(t.isolation=e.isolation),e.memory&&(t.memory=e.memory);const n={};e.orchestrator_role&&(n.role=e.orchestrator_role),e.orchestrator_permission_mode&&(n.permission_mode=e.orchestrator_permission_mode),Object.keys(n).length>0&&(t.orchestrator=n);const r={};e.policy_max_depth&&(r.max_depth=Number(e.policy_max_depth)),e.policy_agent_timeout&&(r.agent_timeout=Number(e.policy_agent_timeout)),e.policy_max_delegate_retries&&(r.max_delegate_retries=Number(e.policy_max_delegate_retries)),e.policy_cache_delegations&&(r.cache_delegations=e.policy_cache_delegations==="true"),e.policy_cache_max_entries&&(r.cache_max_entries=Number(e.policy_cache_max_entries)),e.policy_cache_ttl_seconds&&(r.cache_ttl_seconds=Number(e.policy_cache_ttl_seconds)),e.policy_max_num_delegations&&(r.max_num_delegations=Number(e.policy_max_num_delegations)),Object.keys(r).length>0&&(t.policy=r);const a={};e.session_merge_strategy&&(a.merge_strategy=e.session_merge_strategy),e.session_pull_before_session&&(a.pull_before_session=e.session_pull_before_session),e.session_pr_command&&(a.pr_command=e.session_pr_command),Object.keys(a).length>0&&(t.session=a);const i={};return e.trace_enabled&&(i.enabled=e.trace_enabled==="true"),Object.keys(i).length>0&&(t.trace=i),t}const l2e=["none","worktree"],c2e=["default","plan","bypassPermissions"],u2e=["auto","local","pr"],d2e=["prompt","always","never"],nz=["true","false"],ZS="__empty__";function rz({values:e,placeholders:t,onSave:n,saving:r}){const[a,i]=x.useState(QS(e)),{data:s}=To("agents"),{data:c}=To("roles"),{data:u}=To("memories"),d=t?QS(t):void 0,m=JSON.stringify(e);x.useEffect(()=>{i(QS(e))},[m]);const f=N=>T=>i(P=>({...P,[N]:T})),v=()=>{n(s2e(a))},g=(s??[]).map(N=>N.name),b=(c??[]).map(N=>N.name),w=new Set((u??[]).map(N=>N.name));w.add("none");const S=[...w].sort(),E=a.runtime&&g.length>0&&!g.includes(a.runtime)?"Runtime not found in installed agents":"",O=a.orchestrator_role&&b.length>0&&!b.includes(a.orchestrator_role)?"Role not found in installed roles":"",j=a.memory&&!S.includes(a.memory)?"Memory not found in installed providers":"",A=!!E||!!O||!!j;return p.jsxs("div",{className:"flex flex-col gap-6",children:[p.jsxs("section",{className:"flex flex-col gap-3",children:[p.jsx("h3",{className:"text-sm font-semibold",children:"General"}),p.jsx(qs,{}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsxs(fr,{label:"Runtime",children:[p.jsx(Ze,{list:"cfg-dl-runtime",value:a.runtime,onChange:N=>f("runtime")(N.target.value),placeholder:(d==null?void 0:d.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),g.length>0&&p.jsx("datalist",{id:"cfg-dl-runtime",children:g.map(N=>p.jsx("option",{value:N},N))}),E&&p.jsx("p",{className:"text-xs text-destructive",children:E})]}),p.jsx(fr,{label:"Isolation",children:p.jsx(Gu,{value:a.isolation,onChange:f("isolation"),options:l2e,placeholder:(d==null?void 0:d.isolation)||"none",allowEmpty:!0})}),p.jsxs(fr,{label:"Memory",children:[p.jsx(Ze,{list:"cfg-dl-memory",value:a.memory,onChange:N=>f("memory")(N.target.value),placeholder:(d==null?void 0:d.memory)||"dial",className:"h-8 text-xs"}),p.jsx("datalist",{id:"cfg-dl-memory",children:S.map(N=>p.jsx("option",{value:N},N))}),j&&p.jsx("p",{className:"text-xs text-destructive",children:j})]})]})]}),p.jsxs("section",{className:"flex flex-col gap-3",children:[p.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),p.jsx(qs,{}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[p.jsxs(fr,{label:"Role",children:[p.jsx(Ze,{list:"cfg-dl-role",value:a.orchestrator_role,onChange:N=>f("orchestrator_role")(N.target.value),placeholder:(d==null?void 0:d.orchestrator_role)||"ai-ceo",className:"h-8 text-xs"}),b.length>0&&p.jsx("datalist",{id:"cfg-dl-role",children:b.map(N=>p.jsx("option",{value:N},N))}),O&&p.jsx("p",{className:"text-xs text-destructive",children:O})]}),p.jsx(fr,{label:"Permission Mode",children:p.jsx(Gu,{value:a.orchestrator_permission_mode,onChange:f("orchestrator_permission_mode"),options:c2e,placeholder:(d==null?void 0:d.orchestrator_permission_mode)||"default",allowEmpty:!0})})]})]}),p.jsxs("section",{className:"flex flex-col gap-3",children:[p.jsx("h3",{className:"text-sm font-semibold",children:"Policy"}),p.jsx(qs,{}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsx(fr,{label:"Max Depth",children:p.jsx(Ze,{type:"number",value:a.policy_max_depth,onChange:N=>f("policy_max_depth")(N.target.value),placeholder:(d==null?void 0:d.policy_max_depth)||"3",className:"h-8 text-xs"})}),p.jsx(fr,{label:"Agent Timeout (seconds)",children:p.jsx(Ze,{type:"number",value:a.policy_agent_timeout,onChange:N=>f("policy_agent_timeout")(N.target.value),placeholder:(d==null?void 0:d.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),p.jsx(fr,{label:"Max Delegate Retries",children:p.jsx(Ze,{type:"number",value:a.policy_max_delegate_retries,onChange:N=>f("policy_max_delegate_retries")(N.target.value),placeholder:(d==null?void 0:d.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),p.jsx(fr,{label:"Cache Delegations",children:p.jsx(Gu,{value:a.policy_cache_delegations,onChange:f("policy_cache_delegations"),options:nz,placeholder:(d==null?void 0:d.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),p.jsx(fr,{label:"Cache Max Entries",children:p.jsx(Ze,{value:a.policy_cache_max_entries,onChange:N=>f("policy_cache_max_entries")(N.target.value),placeholder:(d==null?void 0:d.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),p.jsx(fr,{label:"Cache TTL (seconds)",children:p.jsx(Ze,{value:a.policy_cache_ttl_seconds,onChange:N=>f("policy_cache_ttl_seconds")(N.target.value),placeholder:(d==null?void 0:d.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),p.jsx(fr,{label:"Max Delegations",children:p.jsx(Ze,{type:"number",min:"0",value:a.policy_max_num_delegations,onChange:N=>f("policy_max_num_delegations")(N.target.value),placeholder:(d==null?void 0:d.policy_max_num_delegations)||"0 (unlimited)",className:"h-8 text-xs"})})]})]}),p.jsxs("section",{className:"flex flex-col gap-3",children:[p.jsx("h3",{className:"text-sm font-semibold",children:"Session"}),p.jsx(qs,{}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsx(fr,{label:"Merge Strategy",children:p.jsx(Gu,{value:a.session_merge_strategy,onChange:f("session_merge_strategy"),options:u2e,placeholder:(d==null?void 0:d.session_merge_strategy)||"auto",allowEmpty:!0})}),p.jsx(fr,{label:"Pull Before Session",children:p.jsx(Gu,{value:a.session_pull_before_session,onChange:f("session_pull_before_session"),options:d2e,placeholder:(d==null?void 0:d.session_pull_before_session)||"prompt",allowEmpty:!0})}),p.jsx(fr,{label:"PR Command",className:"sm:col-span-3",children:p.jsx(Ze,{value:a.session_pr_command,onChange:N=>f("session_pr_command")(N.target.value),placeholder:(d==null?void 0:d.session_pr_command)||"gh pr create --base {base_branch} --head {session_branch}",className:"h-8 text-xs font-mono"})})]})]}),p.jsxs("section",{className:"flex flex-col gap-3",children:[p.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),p.jsx(qs,{}),p.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:p.jsx(fr,{label:"Enabled",children:p.jsx(Gu,{value:a.trace_enabled,onChange:f("trace_enabled"),options:nz,placeholder:(d==null?void 0:d.trace_enabled)||"true",allowEmpty:!0})})})]}),p.jsxs(Ee,{size:"sm",onClick:v,disabled:r||A,className:"self-start",children:[p.jsx(bB,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function fr({label:e,children:t,className:n}){return p.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[p.jsx(mt,{className:"text-xs",children:e}),t]})}function Gu({value:e,onChange:t,options:n,placeholder:r,allowEmpty:a}){return p.jsxs(zi,{value:e||(a?ZS:""),onValueChange:i=>t(i===ZS?"":i),children:[p.jsx(Bi,{className:"h-8 text-xs",children:p.jsx($i,{placeholder:r})}),p.jsxs(Ui,{children:[a&&p.jsx(Dn,{value:ZS,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(i=>p.jsx(Dn,{value:i,children:i},i))]})]})}function f2e(){var v,g;const[e,t]=x.useState("global"),[n,r]=x.useState(null),a=ft(),i=VB(),s=Qd(),c=gC(n??0,{enabled:n!=null}),u=Dae(),d=YB(),m=b=>{u.mutate(b,{onSuccess:()=>wt.success("Global configuration saved"),onError:()=>wt.error("Failed to save global configuration")})},f=b=>{n!=null&&d.mutate({projectId:n,data:b},{onSuccess:()=>wt.success("Project configuration saved"),onError:()=>wt.error("Failed to save project configuration")})};return x.useEffect(()=>{e==="project"&&n!=null&&a.invalidateQueries({queryKey:Be.projects.config(n)})},[e,n,a]),p.jsxs("div",{className:"space-y-6",children:[p.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),p.jsxs(IA,{value:e,onValueChange:t,children:[p.jsxs(LA,{children:[p.jsx(oa,{value:"global",children:"Global"}),p.jsx(oa,{value:"project",children:"Project"})]}),p.jsx(sa,{value:"global",className:"mt-4",children:i.isLoading?p.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):p.jsx(rz,{values:((v=i.data)==null?void 0:v.values)??{},placeholders:(g=i.data)==null?void 0:g.defaults,onSave:m,saving:u.isPending})}),p.jsx(sa,{value:"project",className:"mt-4",children:p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[p.jsx(mt,{className:"text-xs",children:"Project"}),p.jsxs(zi,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[p.jsx(Bi,{className:"h-8 text-xs",children:p.jsx($i,{placeholder:"Select a project"})}),p.jsx(Ui,{children:(s.data??[]).map(b=>p.jsx(Dn,{value:String(b.id),children:b.display_name},b.id))})]})]}),n!=null&&c.isLoading&&p.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),n!=null&&c.data&&p.jsx(rz,{values:c.data.project,placeholders:c.data.merged_nested,onSave:f,saving:d.isPending},n)]})})]})]})}function h2e(){return p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20",children:[p.jsx("h1",{className:"text-2xl font-bold",children:"Page not found"}),p.jsx(Ee,{variant:"outline",asChild:!0,children:p.jsxs(gr,{to:"/",children:[p.jsx(une,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const m2e=3,p2e=1e4,v2e=2e3;function g2e(){const e=ft(),t=x.useRef(null),n=x.useRef(void 0),r=x.useRef(1e3),a=x.useRef(0),i=x.useRef({});x.useEffect(()=>{function s(u){const d=Date.now();if(d-a.current<v2e)return!1;const m=(i.current[u]??[]).filter(f=>d-f<p2e);return m.length>=m2e?!1:(m.push(d),i.current[u]=m,!0)}function c(){const u=new EventSource("/api/events");t.current=u,u.onopen=()=>{r.current=1e3,a.current=Date.now()};const d=m=>{try{const f=JSON.parse(m.data),v=(f.run_id??"unknown").slice(0,12);s(m.type)&&(m.type==="session_started"?wt.info(`Session ${v} started`):m.type==="session_completed"?wt.success(`Session ${v} completed`):m.type==="session_failed"?wt.error(`Session ${v} failed`):m.type==="session_stopped"&&wt.warning(`Session ${v} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),f.project_id&&(e.invalidateQueries({queryKey:Be.projects.sessions(f.project_id)}),e.invalidateQueries({queryKey:Be.conversations.all(f.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}catch{}};u.addEventListener("session_started",d),u.addEventListener("session_completed",d),u.addEventListener("session_failed",d),u.addEventListener("session_stopped",d),u.onerror=()=>{u.close(),t.current=null,n.current=setTimeout(()=>{r.current=Math.min(r.current*2,15e3),c()},r.current)}}return c(),()=>{var u;(u=t.current)==null||u.close(),t.current=null,n.current&&clearTimeout(n.current)}},[e])}function y2e(){return g2e(),p.jsx(mY,{children:p.jsxs(Ga,{element:p.jsx(bae,{}),children:[p.jsx(Ga,{index:!0,element:p.jsx(Tae,{})}),p.jsx(Ga,{path:"projects",element:p.jsx(Bae,{})}),p.jsx(Ga,{path:"projects/:projectId",element:p.jsx(BEe,{})}),p.jsx(Ga,{path:"projects/:projectId/sessions/:runId",element:p.jsx(jTe,{})}),p.jsx(Ga,{path:"projects/:projectId/conversations/:conversationId",element:p.jsx(qTe,{})}),p.jsx(Ga,{path:"schedules",element:p.jsx(o2e,{})}),p.jsx(Ga,{path:"resources/:resourceType",element:p.jsx(YTe,{})}),p.jsx(Ga,{path:"settings",element:p.jsx(f2e,{})}),p.jsx(Ga,{path:"*",element:p.jsx(h2e,{})})]})})}mV.createRoot(document.getElementById("root")).render(p.jsx(x.StrictMode,{children:p.jsx(NG,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:p.jsx(bG,{client:xre,children:p.jsxs(uB,{children:[p.jsx($Y,{children:p.jsx(y2e,{})}),p.jsx(yre,{})]})})})}));
