var eV=Object.defineProperty;var kP=e=>{throw TypeError(e)};var tV=(e,t,n)=>t in e?eV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Dw=(e,t,n)=>tV(e,typeof t!="symbol"?t+"":t,n),Iw=(e,t,n)=>t.has(e)||kP("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)?kP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),be=(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 jv=(e,t,n,r)=>({set _(a){be(e,t,a,n)},get _(){return W(e,t,r)}});function nV(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 Za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lw={exports:{}},nh={};/**
 * @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 RP;function rV(){if(RP)return nh;RP=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 nh.Fragment=t,nh.jsx=n,nh.jsxs=n,nh}var DP;function aV(){return DP||(DP=1,Lw.exports=rV()),Lw.exports}var p=aV(),zw={exports:{}},Ve={};/**
 * @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 IP;function iV(){if(IP)return Ve;IP=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"),f=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),v=Symbol.iterator;function y(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 L(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 z(B,$){return typeof B=="object"&&B!==null&&B.key!=null?I(""+B.key):$.toString(36)}function V(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 ie=typeof B;(ie==="undefined"||ie==="boolean")&&(B=null);var ae=!1;if(B===null)ae=!0;else switch(ie){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(B.$$typeof){case e:case t:ae=!0;break;case m:return ae=B._init,k(ae(B._payload),$,X,Z,ee)}}if(ae)return ee=ee(B),ae=Z===""?"."+z(B,0):Z,N(ee)?(X="",ae!=null&&(X=ae.replace(G,"$&/")+"/"),k(ee,$,X,"",function(le){return le})):ee!=null&&(L(ee)&&(ee=K(ee,X+(ee.key==null||B&&B.key===ee.key?"":(""+ee.key).replace(G,"$&/")+"/")+ae)),$.push(ee)),1;ae=0;var re=Z===""?".":Z+":";if(N(B))for(var J=0;J<B.length;J++)Z=B[J],ie=re+z(Z,J),ae+=k(Z,$,X,ie,ee);else if(J=y(B),typeof J=="function")for(B=J.call(B),J=0;!(Z=B.next()).done;)Z=Z.value,ie=re+z(Z,J++),ae+=k(Z,$,X,ie,ee);else if(ie==="object"){if(typeof B.then=="function")return k(V(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 ae}function F(B,$,X){if(B==null)return B;var Z=[],ee=0;return k(B,Z,"","",function(ie){return $.call(X,ie,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 U=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)},Y={map:F,forEach:function(B,$,X){F(B,function(){$.apply(this,arguments)},X)},count:function(B){var $=0;return F(B,function(){$++}),$},toArray:function(B){return F(B,function($){return $})||[]},only:function(B){if(!L(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ve.Activity=d,Ve.Children=Y,Ve.Component=E,Ve.Fragment=n,Ve.Profiler=a,Ve.PureComponent=j,Ve.StrictMode=r,Ve.Suspense=f,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(B){return P.H.useMemoCache(B)}},Ve.cache=function(B){return function(){return B.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.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(ie in $.key!==void 0&&(ee=""+$.key),$)!R.call($,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&$.ref===void 0||(Z[ie]=$[ie]);var ie=arguments.length-2;if(ie===1)Z.children=X;else if(1<ie){for(var ae=Array(ie),re=0;re<ie;re++)ae[re]=arguments[re+2];Z.children=ae}return D(B.type,ee,Z)},Ve.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},Ve.createElement=function(B,$,X){var Z,ee={},ie=null;if($!=null)for(Z in $.key!==void 0&&(ie=""+$.key),$)R.call($,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ee[Z]=$[Z]);var ae=arguments.length-2;if(ae===1)ee.children=X;else if(1<ae){for(var re=Array(ae),J=0;J<ae;J++)re[J]=arguments[J+2];ee.children=re}if(B&&B.defaultProps)for(Z in ae=B.defaultProps,ae)ee[Z]===void 0&&(ee[Z]=ae[Z]);return D(B,ie,ee)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(B){return{$$typeof:c,render:B}},Ve.isValidElement=L,Ve.lazy=function(B){return{$$typeof:m,_payload:{_status:-1,_result:B},_init:q}},Ve.memo=function(B,$){return{$$typeof:u,type:B,compare:$===void 0?null:$}},Ve.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,U)}catch(ie){U(ie)}finally{$!==null&&X.types!==null&&($.types=X.types),P.T=$}},Ve.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ve.use=function(B){return P.H.use(B)},Ve.useActionState=function(B,$,X){return P.H.useActionState(B,$,X)},Ve.useCallback=function(B,$){return P.H.useCallback(B,$)},Ve.useContext=function(B){return P.H.useContext(B)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(B,$){return P.H.useDeferredValue(B,$)},Ve.useEffect=function(B,$){return P.H.useEffect(B,$)},Ve.useEffectEvent=function(B){return P.H.useEffectEvent(B)},Ve.useId=function(){return P.H.useId()},Ve.useImperativeHandle=function(B,$,X){return P.H.useImperativeHandle(B,$,X)},Ve.useInsertionEffect=function(B,$){return P.H.useInsertionEffect(B,$)},Ve.useLayoutEffect=function(B,$){return P.H.useLayoutEffect(B,$)},Ve.useMemo=function(B,$){return P.H.useMemo(B,$)},Ve.useOptimistic=function(B,$){return P.H.useOptimistic(B,$)},Ve.useReducer=function(B,$,X){return P.H.useReducer(B,$,X)},Ve.useRef=function(B){return P.H.useRef(B)},Ve.useState=function(B){return P.H.useState(B)},Ve.useSyncExternalStore=function(B,$,X){return P.H.useSyncExternalStore(B,$,X)},Ve.useTransition=function(){return P.H.useTransition()},Ve.version="19.2.4",Ve}var LP;function qf(){return LP||(LP=1,zw.exports=iV()),zw.exports}var x=qf();const xe=Za(x),rj=nV({__proto__:null,default:xe},[x]);var $w={exports:{}},rh={},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 zP;function oV(){return zP||(zP=1,(function(e){function t(k,F){var q=k.length;k.push(F);e:for(;0<q;){var U=q-1>>>1,Y=k[U];if(0<a(Y,F))k[U]=F,k[q]=Y,q=U;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var F=k[0],q=k.pop();if(q!==F){k[0]=q;e:for(var U=0,Y=k.length,B=Y>>>1;U<B;){var $=2*(U+1)-1,X=k[$],Z=$+1,ee=k[Z];if(0>a(X,q))Z<Y&&0>a(ee,X)?(k[U]=ee,k[Z]=q,U=Z):(k[U]=X,k[$]=q,U=$);else if(Z<Y&&0>a(ee,q))k[U]=ee,k[Z]=q,U=Z;else break e}}return F}function a(k,F){var q=k.sortIndex-F.sortIndex;return q!==0?q:k.id-F.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 f=[],u=[],m=1,d=null,v=3,y=!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 F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=k)r(u),F.sortIndex=F.expirationTime,t(f,F);else break;F=n(u)}}function N(k){if(w=!1,A(k),!b)if(n(f)!==null)b=!0,T||(T=!0,I());else{var F=n(u);F!==null&&V(N,F.startTime-k)}}var T=!1,P=-1,R=5,D=-1;function K(){return S?!0:!(e.unstable_now()-D<R)}function L(){if(S=!1,T){var k=e.unstable_now();D=k;var F=!0;try{e:{b=!1,w&&(w=!1,O(P),P=-1),y=!0;var q=v;try{t:{for(A(k),d=n(f);d!==null&&!(d.expirationTime>k&&K());){var U=d.callback;if(typeof U=="function"){d.callback=null,v=d.priorityLevel;var Y=U(d.expirationTime<=k);if(k=e.unstable_now(),typeof Y=="function"){d.callback=Y,A(k),F=!0;break t}d===n(f)&&r(f),A(k)}else r(f);d=n(f)}if(d!==null)F=!0;else{var B=n(u);B!==null&&V(N,B.startTime-k),F=!1}}break e}finally{d=null,v=q,y=!1}F=void 0}}finally{F?I():T=!1}}}var I;if(typeof j=="function")I=function(){j(L)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,z=G.port2;G.port1.onmessage=L,I=function(){z.postMessage(null)}}else I=function(){E(L,0)};function V(k,F){P=E(function(){k(e.unstable_now())},F)}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 F=3;break;default:F=v}var q=v;v=F;try{return k()}finally{v=q}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(k,F){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var q=v;v=k;try{return F()}finally{v=q}},e.unstable_scheduleCallback=function(k,F,q){var U=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?U+q:U):q=U,k){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=q+Y,k={id:m++,callback:F,priorityLevel:k,startTime:q,expirationTime:Y,sortIndex:-1},q>U?(k.sortIndex=q,t(u,k),n(f)===null&&k===n(u)&&(w?(O(P),P=-1):w=!0,V(N,q-U))):(k.sortIndex=Y,t(f,k),b||y||(b=!0,T||(T=!0,I()))),k},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(k){var F=v;return function(){var q=v;v=F;try{return k.apply(this,arguments)}finally{v=q}}}})(Uw)),Uw}var $P;function sV(){return $P||($P=1,Bw.exports=oV()),Bw.exports}var Hw={exports:{}},ir={};/**
 * @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 BP;function lV(){if(BP)return ir;BP=1;var e=qf();function t(f){var u="https://react.dev/errors/"+f;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+u+" 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(f,u,m){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:f,containerInfo:u,implementation:m}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,u){if(f==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ir.createPortal=function(f,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return i(f,u,null,m)},ir.flushSync=function(f){var u=s.T,m=r.p;try{if(s.T=null,r.p=2,f)return f()}finally{s.T=u,r.p=m,r.d.f()}},ir.preconnect=function(f,u){typeof f=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(f,u))},ir.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},ir.preinit=function(f,u){if(typeof f=="string"&&u&&typeof u.as=="string"){var m=u.as,d=c(m,u.crossOrigin),v=typeof u.integrity=="string"?u.integrity:void 0,y=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;m==="style"?r.d.S(f,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:d,integrity:v,fetchPriority:y}):m==="script"&&r.d.X(f,{crossOrigin:d,integrity:v,fetchPriority:y,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},ir.preinitModule=function(f,u){if(typeof f=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var m=c(u.as,u.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(f)},ir.preload=function(f,u){if(typeof f=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var m=u.as,d=c(m,u.crossOrigin);r.d.L(f,m,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},ir.preloadModule=function(f,u){if(typeof f=="string")if(u){var m=c(u.as,u.crossOrigin);r.d.m(f,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:m,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(f)},ir.requestFormReset=function(f){r.d.r(f)},ir.unstable_batchedUpdates=function(f,u){return f(u)},ir.useFormState=function(f,u,m){return s.H.useFormState(f,u,m)},ir.useFormStatus=function(){return s.H.useHostTransitionStatus()},ir.version="19.2.4",ir}var UP;function mz(){if(UP)return Hw.exports;UP=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=lV(),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 HP;function cV(){if(HP)return rh;HP=1;var e=sV(),t=qf(),n=mz();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 f(o){if(i(o)!==o)throw Error(r(188))}function u(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,g=l;;){var _=h.return;if(_===null)break;var C=_.alternate;if(C===null){if(g=_.return,g!==null){h=g;continue}break}if(_.child===C.child){for(C=_.child;C;){if(C===h)return f(_),o;if(C===g)return f(_),l;C=C.sibling}throw Error(r(188))}if(h.return!==g.return)h=_,g=C;else{for(var M=!1,H=_.child;H;){if(H===h){M=!0,h=_,g=C;break}if(H===g){M=!0,g=_,h=C;break}H=H.sibling}if(!M){for(H=C.child;H;){if(H===h){M=!0,h=C,g=_;break}if(H===g){M=!0,g=C,h=_;break}H=H.sibling}if(!M)throw Error(r(189))}}if(h.alternate!==g)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 d=Object.assign,v=Symbol.for("react.element"),y=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"),L=Symbol.iterator;function I(o){return o===null||typeof o!="object"?null:(o=L&&o[L]||o["@@iterator"],typeof o=="function"?o:null)}var G=Symbol.for("react.client.reference");function z(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:z(o.type)||"Memo";case R:l=o._payload,o=o._init;try{return z(o(l))}catch{}}return null}var V=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},U=[],Y=-1;function B(o){return{current:o}}function $(o){0>Y||(o.current=U[Y],U[Y]=null,Y--)}function X(o,l){Y++,U[Y]=o.current,o.current=l}var Z=B(null),ee=B(null),ie=B(null),ae=B(null);function re(o,l){switch(X(ie,l),X(ee,o),X(Z,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?nP(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=nP(l),o=rP(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),$(ie)}function le(o){o.memoizedState!==null&&X(ae,o);var l=Z.current,h=rP(l,o.type);l!==h&&(X(ee,o),X(Z,h))}function he(o){ee.current===o&&($(Z),$(ee)),ae.current===o&&($(ae),Zd._currentValue=q)}var ne,ge;function ye(o){if(ne===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);ne=l&&l[1]||"",ge=-1<h.stack.indexOf(`
    at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ne+o+ge}var De=!1;function Me(o,l){if(!o||De)return"";De=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={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(de){var fe=de}Reflect.construct(o,[],ve)}else{try{ve.call()}catch(de){fe=de}o.call(ve.prototype)}}else{try{throw Error()}catch(de){fe=de}(ve=o())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(de){if(de&&fe&&typeof de.stack=="string")return[de.stack,fe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=g.DetermineComponentFrameRoot(),M=C[0],H=C[1];if(M&&H){var Q=M.split(`
`),ue=H.split(`
`);for(_=g=0;g<Q.length&&!Q[g].includes("DetermineComponentFrameRoot");)g++;for(;_<ue.length&&!ue[_].includes("DetermineComponentFrameRoot");)_++;if(g===Q.length||_===ue.length)for(g=Q.length-1,_=ue.length-1;1<=g&&0<=_&&Q[g]!==ue[_];)_--;for(;1<=g&&0<=_;g--,_--)if(Q[g]!==ue[_]){if(g!==1||_!==1)do if(g--,_--,0>_||Q[g]!==ue[_]){var me=`
`+Q[g].replace(" at new "," at ");return o.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",o.displayName)),me}while(1<=g&&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 Bt(o){try{var l="",h=null;do l+=Ke(o,h),h=o,o=o.return;while(o);return l}catch(g){return`
Error generating stack: `+g.message+`
`+g.stack}}var ut=Object.prototype.hasOwnProperty,Sn=e.unstable_scheduleCallback,we=e.unstable_cancelCallback,Tt=e.unstable_shouldYield,Ee=e.unstable_requestPaint,dt=e.unstable_now,En=e.unstable_getCurrentPriorityLevel,er=e.unstable_ImmediatePriority,ii=e.unstable_UserBlockingPriority,oi=e.unstable_NormalPriority,_l=e.unstable_LowPriority,zr=e.unstable_IdlePriority,Jc=e.log,si=e.unstable_setDisableYieldValue,Hi=null,Kn=null;function $r(o){if(typeof Jc=="function"&&si(o),Kn&&typeof Kn.setStrictMode=="function")try{Kn.setStrictMode(Hi,o)}catch{}}var Dn=Math.clz32?Math.clz32:la,ud=Math.log,jl=Math.LN2;function la(o){return o>>>=0,o===0?32:31-(ud(o)/jl|0)|0}var Wo=256,Qo=262144,Fi=4194304;function ca(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 g=o.pendingLanes;if(g===0)return 0;var _=0,C=o.suspendedLanes,M=o.pingedLanes;o=o.warmLanes;var H=g&134217727;return H!==0?(g=H&~C,g!==0?_=ca(g):(M&=H,M!==0?_=ca(M):h||(h=H&~o,h!==0&&(_=ca(h))))):(H=g&~C,H!==0?_=ca(H):M!==0?_=ca(M):h||(h=g&~o,h!==0&&(_=ca(h)))),_===0?0:l!==0&&l!==_&&(l&C)===0&&(C=_&-_,h=l&-l,C>=h||C===32&&(h&4194048)!==0)?l:_}function kt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function un(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 In(){var o=Fi;return Fi<<=1,(Fi&62914560)===0&&(Fi=4194304),o}function li(o){for(var l=[],h=0;31>h;h++)l.push(o);return l}function Dt(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function tr(o,l,h,g,_,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 H=o.entanglements,Q=o.expirationTimes,ue=o.hiddenUpdates;for(h=M&~h;0<h;){var me=31-Dn(h),ve=1<<me;H[me]=0,Q[me]=-1;var fe=ue[me];if(fe!==null)for(ue[me]=null,me=0;me<fe.length;me++){var de=fe[me];de!==null&&(de.lane&=-536870913)}h&=~ve}g!==0&&qi(o,g,0),C!==0&&_===0&&o.tag!==0&&(o.suspendedLanes|=C&~(M&~l))}function qi(o,l,h){o.pendingLanes|=l,o.suspendedLanes&=~l;var g=31-Dn(l);o.entangledLanes|=l,o.entanglements[g]=o.entanglements[g]|1073741824|h&261930}function nr(o,l){var h=o.entangledLanes|=l;for(o=o.entanglements;h;){var g=31-Dn(h),_=1<<g;_&l|o[g]&l&&(o[g]|=l),h&=~_}}function rr(o,l){var h=l&-l;return h=(h&42)!==0?1:Zo(h),(h&(o.suspendedLanes|l))!==0?0:h}function Zo(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 Br(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function fd(){var o=F.p;return o!==0?o:(o=window.event,o===void 0?32:CP(o.type))}function sp(o,l){var h=F.p;try{return F.p=o,l()}finally{F.p=h}}var ci=Math.random().toString(36).slice(2),_n="__reactFiber$"+ci,ar="__reactProps$"+ci,Ki="__reactContainer$"+ci,eu="__reactEvents$"+ci,lp="__reactListeners$"+ci,Cx="__reactHandles$"+ci,cp="__reactResources$"+ci,Cl="__reactMarker$"+ci;function dd(o){delete o[_n],delete o[ar],delete o[eu],delete o[lp],delete o[Cx]}function Jo(o){var l=o[_n];if(l)return l;for(var h=o.parentNode;h;){if(l=h[Ki]||h[_n]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(o=uP(o);o!==null;){if(h=o[_n])return h;o=uP(o)}return l}o=h,h=o.parentNode}return null}function es(o){if(o=o[_n]||o[Ki]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function ts(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function ns(o){var l=o[cp];return l||(l=o[cp]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function fn(o){o[Cl]=!0}var up=new Set,fp={};function Vi(o,l){rs(o,l),rs(o+"Capture",l)}function rs(o,l){for(fp[o]=l,o=0;o<l.length;o++)up.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]*$"),hd={},dp={};function Ax(o){return ut.call(dp,o)?!0:ut.call(hd,o)?!1:Ox.test(o)?dp[o]=!0:(hd[o]=!0,!1)}function tu(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 g=l.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+h)}}function nu(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 Ma(o,l,h,g){if(g===null)o.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(l,h,""+g)}}function Er(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function hp(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Nx(o,l,h){var g=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var _=g.get,C=g.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:g.enumerable}),{getValue:function(){return h},setValue:function(M){h=""+M},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function as(o){if(!o._valueTracker){var l=hp(o)?"checked":"value";o._valueTracker=Nx(o,l,""+o[l])}}function mp(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var h=l.getValue(),g="";return o&&(g=hp(o)?o.checked?"true":"false":o.value),o=g,o!==h?(l.setValue(o),!0):!1}function Ol(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 _r(o){return o.replace(Tx,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Al(o,l,h,g,_,C,M,H){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=""+Er(l)):o.value!==""+Er(l)&&(o.value=""+Er(l)):M!=="submit"&&M!=="reset"||o.removeAttribute("value"),l!=null?md(o,M,Er(l)):h!=null?md(o,M,Er(h)):g!=null&&o.removeAttribute("value"),_==null&&C!=null&&(o.defaultChecked=!!C),_!=null&&(o.checked=_&&typeof _!="function"&&typeof _!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?o.name=""+Er(H):o.removeAttribute("name")}function pp(o,l,h,g,_,C,M,H){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)){as(o);return}h=h!=null?""+Er(h):"",l=l!=null?""+Er(l):h,H||l===o.value||(o.value=l),o.defaultValue=l}g=g??_,g=typeof g!="function"&&typeof g!="symbol"&&!!g,o.checked=H?o.checked:!!g,o.defaultChecked=!!g,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(o.name=M),as(o)}function md(o,l,h){l==="number"&&Ol(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Yi(o,l,h,g){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=_),_&&g&&(o[h].defaultSelected=!0)}else{for(h=""+Er(h),l=null,_=0;_<o.length;_++){if(o[_].value===h){o[_].selected=!0,g&&(o[_].defaultSelected=!0);return}l!==null||o[_].disabled||(l=o[_])}l!==null&&(l.selected=!0)}}function QA(o,l,h){if(l!=null&&(l=""+Er(l),l!==o.value&&(o.value=l),h==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=h!=null?""+Er(h):""}function ZA(o,l,h,g){if(l==null){if(g!=null){if(h!=null)throw Error(r(92));if(V(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),l=h}h=Er(l),o.defaultValue=h,g=o.textContent,g===h&&g!==""&&g!==null&&(o.value=g),as(o)}function ru(o,l){if(l){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=l;return}}o.textContent=l}var X9=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 JA(o,l,h){var g=l.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":g?o.setProperty(l,h):typeof h!="number"||h===0||X9.has(l)?l==="float"?o.cssFloat=h:o[l]=(""+h).trim():o[l]=h+"px"}function eN(o,l,h){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||l!=null&&l.hasOwnProperty(g)||(g.indexOf("--")===0?o.setProperty(g,""):g==="float"?o.cssFloat="":o[g]="");for(var _ in l)g=l[_],l.hasOwnProperty(_)&&h[_]!==g&&JA(o,_,g)}else for(var C in l)l.hasOwnProperty(C)&&JA(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 W9=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"]]),Q9=/^[\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 vp(o){return Q9.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Gi(){}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 au=null,iu=null;function tN(o){var l=es(o);if(l&&(o=l.stateNode)){var h=o[ar]||null;e:switch(o=l.stateNode,l.type){case"input":if(Al(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="'+_r(""+l)+'"][type="radio"]'),l=0;l<h.length;l++){var g=h[l];if(g!==o&&g.form===o.form){var _=g[ar]||null;if(!_)throw Error(r(90));Al(g,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(l=0;l<h.length;l++)g=h[l],g.form===o.form&&mp(g)}break e;case"textarea":QA(o,h.value,h.defaultValue);break e;case"select":l=h.value,l!=null&&Yi(o,!!h.multiple,l,!1)}}}var Rx=!1;function nN(o,l,h){if(Rx)return o(l,h);Rx=!0;try{var g=o(l);return g}finally{if(Rx=!1,(au!==null||iu!==null)&&(rv(),au&&(l=au,o=iu,iu=au=null,tN(l),o)))for(l=0;l<o.length;l++)tN(o[l])}}function pd(o,l){var h=o.stateNode;if(h===null)return null;var g=h[ar]||null;if(g===null)return null;h=g[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":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var Xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dx=!1;if(Xi)try{var vd={};Object.defineProperty(vd,"passive",{get:function(){Dx=!0}}),window.addEventListener("test",vd,vd),window.removeEventListener("test",vd,vd)}catch{Dx=!1}var is=null,Ix=null,gp=null;function rN(){if(gp)return gp;var o,l=Ix,h=l.length,g,_="value"in is?is.value:is.textContent,C=_.length;for(o=0;o<h&&l[o]===_[o];o++);var M=h-o;for(g=1;g<=M&&l[h-g]===_[C-g];g++);return gp=_.slice(o,1<g?1-g:void 0)}function yp(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 xp(){return!0}function aN(){return!1}function jr(o){function l(h,g,_,C,M){this._reactName=h,this._targetInst=_,this.type=g,this.nativeEvent=C,this.target=M,this.currentTarget=null;for(var H in o)o.hasOwnProperty(H)&&(h=o[H],this[H]=h?h(C):C[H]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?xp:aN,this.isPropagationStopped=aN,this}return d(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=xp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=xp)},persist:function(){},isPersistent:xp}),l}var Nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bp=jr(Nl),gd=d({},Nl,{view:0,detail:0}),Z9=jr(gd),Lx,zx,yd,wp=d({},gd,{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!==yd&&(yd&&o.type==="mousemove"?(Lx=o.screenX-yd.screenX,zx=o.screenY-yd.screenY):zx=Lx=0,yd=o),Lx)},movementY:function(o){return"movementY"in o?o.movementY:zx}}),iN=jr(wp),J9=d({},wp,{dataTransfer:0}),e7=jr(J9),t7=d({},gd,{relatedTarget:0}),$x=jr(t7),n7=d({},Nl,{animationName:0,elapsedTime:0,pseudoElement:0}),r7=jr(n7),a7=d({},Nl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),i7=jr(a7),o7=d({},Nl,{data:0}),oN=jr(o7),s7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l7={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"},c7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u7(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=c7[o])?!!l[o]:!1}function Bx(){return u7}var f7=d({},gd,{key:function(o){if(o.key){var l=s7[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=yp(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?l7[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"?yp(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?yp(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),d7=jr(f7),h7=d({},wp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sN=jr(h7),m7=d({},gd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bx}),p7=jr(m7),v7=d({},Nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),g7=jr(v7),y7=d({},wp,{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}),x7=jr(y7),b7=d({},Nl,{newState:0,oldState:0}),w7=jr(b7),S7=[9,13,27,32],Ux=Xi&&"CompositionEvent"in window,xd=null;Xi&&"documentMode"in document&&(xd=document.documentMode);var E7=Xi&&"TextEvent"in window&&!xd,lN=Xi&&(!Ux||xd&&8<xd&&11>=xd),cN=" ",uN=!1;function fN(o,l){switch(o){case"keyup":return S7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dN(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ou=!1;function _7(o,l){switch(o){case"compositionend":return dN(l);case"keypress":return l.which!==32?null:(uN=!0,cN);case"textInput":return o=l.data,o===cN&&uN?null:o;default:return null}}function j7(o,l){if(ou)return o==="compositionend"||!Ux&&fN(o,l)?(o=rN(),gp=Ix=is=null,ou=!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 lN&&l.locale!=="ko"?null:l.data;default:return null}}var C7={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 hN(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!C7[o.type]:l==="textarea"}function mN(o,l,h,g){au?iu?iu.push(g):iu=[g]:au=g,l=uv(l,"onChange"),0<l.length&&(h=new bp("onChange","change",null,h,g),o.push({event:h,listeners:l}))}var bd=null,wd=null;function O7(o){W2(o,0)}function Sp(o){var l=ts(o);if(mp(l))return o}function pN(o,l){if(o==="change")return l}var vN=!1;if(Xi){var Hx;if(Xi){var Fx="oninput"in document;if(!Fx){var gN=document.createElement("div");gN.setAttribute("oninput","return;"),Fx=typeof gN.oninput=="function"}Hx=Fx}else Hx=!1;vN=Hx&&(!document.documentMode||9<document.documentMode)}function yN(){bd&&(bd.detachEvent("onpropertychange",xN),wd=bd=null)}function xN(o){if(o.propertyName==="value"&&Sp(wd)){var l=[];mN(l,wd,o,kx(o)),nN(O7,l)}}function A7(o,l,h){o==="focusin"?(yN(),bd=l,wd=h,bd.attachEvent("onpropertychange",xN)):o==="focusout"&&yN()}function N7(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Sp(wd)}function T7(o,l){if(o==="click")return Sp(l)}function P7(o,l){if(o==="input"||o==="change")return Sp(l)}function M7(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ur=typeof Object.is=="function"?Object.is:M7;function Sd(o,l){if(Ur(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var h=Object.keys(o),g=Object.keys(l);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var _=h[g];if(!ut.call(l,_)||!Ur(o[_],l[_]))return!1}return!0}function bN(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function wN(o,l){var h=bN(o);o=0;for(var g;h;){if(h.nodeType===3){if(g=o+h.textContent.length,o<=l&&g>=l)return{node:h,offset:l-o};o=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=bN(h)}}function SN(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?SN(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function EN(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Ol(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=Ol(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 k7=Xi&&"documentMode"in document&&11>=document.documentMode,su=null,Kx=null,Ed=null,Vx=!1;function _N(o,l,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Vx||su==null||su!==Ol(g)||(g=su,"selectionStart"in g&&qx(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ed&&Sd(Ed,g)||(Ed=g,g=uv(Kx,"onSelect"),0<g.length&&(l=new bp("onSelect","select",null,l,h),o.push({event:l,listeners:g}),l.target=su)))}function Tl(o,l){var h={};return h[o.toLowerCase()]=l.toLowerCase(),h["Webkit"+o]="webkit"+l,h["Moz"+o]="moz"+l,h}var lu={animationend:Tl("Animation","AnimationEnd"),animationiteration:Tl("Animation","AnimationIteration"),animationstart:Tl("Animation","AnimationStart"),transitionrun:Tl("Transition","TransitionRun"),transitionstart:Tl("Transition","TransitionStart"),transitioncancel:Tl("Transition","TransitionCancel"),transitionend:Tl("Transition","TransitionEnd")},Yx={},jN={};Xi&&(jN=document.createElement("div").style,"AnimationEvent"in window||(delete lu.animationend.animation,delete lu.animationiteration.animation,delete lu.animationstart.animation),"TransitionEvent"in window||delete lu.transitionend.transition);function Pl(o){if(Yx[o])return Yx[o];if(!lu[o])return o;var l=lu[o],h;for(h in l)if(l.hasOwnProperty(h)&&h in jN)return Yx[o]=l[h];return o}var CN=Pl("animationend"),ON=Pl("animationiteration"),AN=Pl("animationstart"),R7=Pl("transitionrun"),D7=Pl("transitionstart"),I7=Pl("transitioncancel"),NN=Pl("transitionend"),TN=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 ka(o,l){TN.set(o,l),Vi(l,[o])}var Ep=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)},ua=[],cu=0,Xx=0;function _p(){for(var o=cu,l=Xx=cu=0;l<o;){var h=ua[l];ua[l++]=null;var g=ua[l];ua[l++]=null;var _=ua[l];ua[l++]=null;var C=ua[l];if(ua[l++]=null,g!==null&&_!==null){var M=g.pending;M===null?_.next=_:(_.next=M.next,M.next=_),g.pending=_}C!==0&&PN(h,_,C)}}function jp(o,l,h,g){ua[cu++]=o,ua[cu++]=l,ua[cu++]=h,ua[cu++]=g,Xx|=g,o.lanes|=g,o=o.alternate,o!==null&&(o.lanes|=g)}function Wx(o,l,h,g){return jp(o,l,h,g),Cp(o)}function Ml(o,l){return jp(o,null,null,l),Cp(o)}function PN(o,l,h){o.lanes|=h;var g=o.alternate;g!==null&&(g.lanes|=h);for(var _=!1,C=o.return;C!==null;)C.childLanes|=h,g=C.alternate,g!==null&&(g.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-Dn(h),o=C.hiddenUpdates,g=o[_],g===null?o[_]=[l]:g.push(l),l.lane=h|536870912),C):null}function Cp(o){if(50<Kd)throw Kd=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 uu={};function L7(o,l,h,g){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=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hr(o,l,h,g){return new L7(o,l,h,g)}function Qx(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Wi(o,l){var h=o.alternate;return h===null?(h=Hr(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 MN(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 Op(o,l,h,g,_,C){var M=0;if(g=o,typeof o=="function")Qx(o)&&(M=1);else if(typeof o=="string")M=HK(o,h,Z.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case D:return o=Hr(31,h,l,_),o.elementType=D,o.lanes=C,o;case w:return kl(h.children,_,C,l);case S:M=8,_|=24;break;case E:return o=Hr(12,h,l,_|2),o.elementType=E,o.lanes=C,o;case N:return o=Hr(13,h,l,_),o.elementType=N,o.lanes=C,o;case T:return o=Hr(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,g=null;break e}M=29,h=Error(r(130,o===null?"null":typeof o,"")),g=null}return l=Hr(M,h,l,_),l.elementType=o,l.type=g,l.lanes=C,l}function kl(o,l,h,g){return o=Hr(7,o,g,l),o.lanes=h,o}function Zx(o,l,h){return o=Hr(6,o,null,l),o.lanes=h,o}function kN(o){var l=Hr(18,null,null,0);return l.stateNode=o,l}function Jx(o,l,h){return l=Hr(4,o.children!==null?o.children:[],o.key,l),l.lanes=h,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var RN=new WeakMap;function fa(o,l){if(typeof o=="object"&&o!==null){var h=RN.get(o);return h!==void 0?h:(l={value:o,source:l,stack:Bt(l)},RN.set(o,l),l)}return{value:o,source:l,stack:Bt(l)}}var fu=[],du=0,Ap=null,_d=0,da=[],ha=0,os=null,ui=1,fi="";function Qi(o,l){fu[du++]=_d,fu[du++]=Ap,Ap=o,_d=l}function DN(o,l,h){da[ha++]=ui,da[ha++]=fi,da[ha++]=os,os=o;var g=ui;o=fi;var _=32-Dn(g)-1;g&=~(1<<_),h+=1;var C=32-Dn(l)+_;if(30<C){var M=_-_%5;C=(g&(1<<M)-1).toString(32),g>>=M,_-=M,ui=1<<32-Dn(l)+_|h<<_|g,fi=C+o}else ui=1<<C|h<<_|g,fi=o}function eb(o){o.return!==null&&(Qi(o,1),DN(o,1,0))}function tb(o){for(;o===Ap;)Ap=fu[--du],fu[du]=null,_d=fu[--du],fu[du]=null;for(;o===os;)os=da[--ha],da[ha]=null,fi=da[--ha],da[ha]=null,ui=da[--ha],da[ha]=null}function IN(o,l){da[ha++]=ui,da[ha++]=fi,da[ha++]=os,ui=l.id,fi=l.overflow,os=o}var Vn=null,It=null,at=!1,ss=null,ma=!1,nb=Error(r(519));function ls(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jd(fa(l,o)),nb}function LN(o){var l=o.stateNode,h=o.type,g=o.memoizedProps;switch(l[_n]=o,l[ar]=g,h){case"dialog":Je("cancel",l),Je("close",l);break;case"iframe":case"object":case"embed":Je("load",l);break;case"video":case"audio":for(h=0;h<Yd.length;h++)Je(Yd[h],l);break;case"source":Je("error",l);break;case"img":case"image":case"link":Je("error",l),Je("load",l);break;case"details":Je("toggle",l);break;case"input":Je("invalid",l),pp(l,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Je("invalid",l);break;case"textarea":Je("invalid",l),ZA(l,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||l.textContent===""+h||g.suppressHydrationWarning===!0||eP(l.textContent,h)?(g.popover!=null&&(Je("beforetoggle",l),Je("toggle",l)),g.onScroll!=null&&Je("scroll",l),g.onScrollEnd!=null&&Je("scrollend",l),g.onClick!=null&&(l.onclick=Gi),l=!0):l=!1,l||ls(o,!0)}function zN(o){for(Vn=o.return;Vn;)switch(Vn.tag){case 5:case 31:case 13:ma=!1;return;case 27:case 3:ma=!0;return;default:Vn=Vn.return}}function hu(o){if(o!==Vn)return!1;if(!at)return zN(o),at=!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&&It&&ls(o),zN(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));It=cP(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));It=cP(o)}else l===27?(l=It,Ss(o.type)?(o=jw,jw=null,It=o):It=l):It=Vn?va(o.stateNode.nextSibling):null;return!0}function Rl(){It=Vn=null,at=!1}function rb(){var o=ss;return o!==null&&(Nr===null?Nr=o:Nr.push.apply(Nr,o),ss=null),o}function jd(o){ss===null?ss=[o]:ss.push(o)}var ab=B(null),Dl=null,Zi=null;function cs(o,l,h){X(ab,l._currentValue),l._currentValue=h}function Ji(o){o._currentValue=ab.current,$(ab)}function ib(o,l,h){for(;o!==null;){var g=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),o===h)break;o=o.return}}function ob(o,l,h,g){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 H=C;C=_;for(var Q=0;Q<l.length;Q++)if(H.context===l[Q]){C.lanes|=h,H=C.alternate,H!==null&&(H.lanes|=h),ib(C.return,h,o),g||(M=null);break e}C=H.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 mu(o,l,h,g){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 H=_.type;Ur(_.pendingProps.value,M.value)||(o!==null?o.push(H):o=[H])}}else if(_===ae.current){if(M=_.alternate,M===null)throw Error(r(387));M.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(o!==null?o.push(Zd):o=[Zd])}_=_.return}o!==null&&ob(l,o,h,g),l.flags|=262144}function Np(o){for(o=o.firstContext;o!==null;){if(!Ur(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Il(o){Dl=o,Zi=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Yn(o){return $N(Dl,o)}function Tp(o,l){return Dl===null&&Il(o),$N(o,l)}function $N(o,l){var h=l._currentValue;if(l={context:l,memoizedValue:h,next:null},Zi===null){if(o===null)throw Error(r(308));Zi=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Zi=Zi.next=l;return h}var z7=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(h,g){o.push(g)}};this.abort=function(){l.aborted=!0,o.forEach(function(h){return h()})}},$7=e.unstable_scheduleCallback,B7=e.unstable_NormalPriority,dn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sb(){return{controller:new z7,data:new Map,refCount:0}}function Cd(o){o.refCount--,o.refCount===0&&$7(B7,function(){o.controller.abort()})}var Od=null,lb=0,pu=0,vu=null;function U7(o,l){if(Od===null){var h=Od=[];lb=0,pu=fw(),vu={status:"pending",value:void 0,then:function(g){h.push(g)}}}return lb++,l.then(BN,BN),l}function BN(){if(--lb===0&&Od!==null){vu!==null&&(vu.status="fulfilled");var o=Od;Od=null,pu=0,vu=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function H7(o,l){var h=[],g={status:"pending",value:null,reason:null,then:function(_){h.push(_)}};return o.then(function(){g.status="fulfilled",g.value=l;for(var _=0;_<h.length;_++)(0,h[_])(l)},function(_){for(g.status="rejected",g.reason=_,_=0;_<h.length;_++)(0,h[_])(void 0)}),g}var UN=k.S;k.S=function(o,l){_2=dt(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&U7(o,l),UN!==null&&UN(o,l)};var Ll=B(null);function cb(){var o=Ll.current;return o!==null?o:Pt.pooledCache}function Pp(o,l){l===null?X(Ll,Ll.current):X(Ll,l.pool)}function HN(){var o=cb();return o===null?null:{parent:dn._currentValue,pool:o}}var gu=Error(r(460)),ub=Error(r(474)),Mp=Error(r(542)),kp={then:function(){}};function FN(o){return o=o.status,o==="fulfilled"||o==="rejected"}function qN(o,l,h){switch(h=o[h],h===void 0?o.push(l):h!==l&&(l.then(Gi,Gi),l=h),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,VN(o),o;default:if(typeof l.status=="string")l.then(Gi,Gi);else{if(o=Pt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(g){if(l.status==="pending"){var _=l;_.status="fulfilled",_.value=g}},function(g){if(l.status==="pending"){var _=l;_.status="rejected",_.reason=g}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,VN(o),o}throw $l=l,gu}}function zl(o){try{var l=o._init;return l(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?($l=h,gu):h}}var $l=null;function KN(){if($l===null)throw Error(r(459));var o=$l;return $l=null,o}function VN(o){if(o===gu||o===Mp)throw Error(r(483))}var yu=null,Ad=0;function Rp(o){var l=Ad;return Ad+=1,yu===null&&(yu=[]),qN(yu,o,l)}function Nd(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function Dp(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 YN(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 g(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=Wi(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 H(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 ze=ce.type;return ze===w?me(oe,te,ce.props.children,pe,ce.key):te!==null&&(te.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===R&&zl(ze)===te.type)?(te=_(te,ce.props),Nd(te,ce),te.return=oe,te):(te=Op(ce.type,ce.key,ce.props,null,oe.mode,pe),Nd(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,ze){return te===null||te.tag!==7?(te=kl(ce,oe.mode,pe,ze),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 y:return ce=Op(te.type,te.key,te.props,null,oe.mode,ce),Nd(ce,te),ce.return=oe,ce;case b:return te=Jx(te,oe.mode,ce),te.return=oe,te;case R:return te=zl(te),ve(oe,te,ce)}if(V(te)||I(te))return te=kl(te,oe.mode,ce,null),te.return=oe,te;if(typeof te.then=="function")return ve(oe,Rp(te),ce);if(te.$$typeof===j)return ve(oe,Tp(oe,te),ce);Dp(oe,te)}return null}function fe(oe,te,ce,pe){var ze=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return ze!==null?null:H(oe,te,""+ce,pe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:return ce.key===ze?Q(oe,te,ce,pe):null;case b:return ce.key===ze?ue(oe,te,ce,pe):null;case R:return ce=zl(ce),fe(oe,te,ce,pe)}if(V(ce)||I(ce))return ze!==null?null:me(oe,te,ce,pe,null);if(typeof ce.then=="function")return fe(oe,te,Rp(ce),pe);if(ce.$$typeof===j)return fe(oe,te,Tp(oe,ce),pe);Dp(oe,ce)}return null}function de(oe,te,ce,pe,ze){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return oe=oe.get(ce)||null,H(te,oe,""+pe,ze);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case y:return oe=oe.get(pe.key===null?ce:pe.key)||null,Q(te,oe,pe,ze);case b:return oe=oe.get(pe.key===null?ce:pe.key)||null,ue(te,oe,pe,ze);case R:return pe=zl(pe),de(oe,te,ce,pe,ze)}if(V(pe)||I(pe))return oe=oe.get(ce)||null,me(te,oe,pe,ze,null);if(typeof pe.then=="function")return de(oe,te,ce,Rp(pe),ze);if(pe.$$typeof===j)return de(oe,te,ce,Tp(te,pe),ze);Dp(te,pe)}return null}function Ne(oe,te,ce,pe){for(var ze=null,ht=null,Re=te,Ge=te=0,nt=null;Re!==null&&Ge<ce.length;Ge++){Re.index>Ge?(nt=Re,Re=null):nt=Re.sibling;var mt=fe(oe,Re,ce[Ge],pe);if(mt===null){Re===null&&(Re=nt);break}o&&Re&&mt.alternate===null&&l(oe,Re),te=C(mt,te,Ge),ht===null?ze=mt:ht.sibling=mt,ht=mt,Re=nt}if(Ge===ce.length)return h(oe,Re),at&&Qi(oe,Ge),ze;if(Re===null){for(;Ge<ce.length;Ge++)Re=ve(oe,ce[Ge],pe),Re!==null&&(te=C(Re,te,Ge),ht===null?ze=Re:ht.sibling=Re,ht=Re);return at&&Qi(oe,Ge),ze}for(Re=g(Re);Ge<ce.length;Ge++)nt=de(Re,oe,Ge,ce[Ge],pe),nt!==null&&(o&&nt.alternate!==null&&Re.delete(nt.key===null?Ge:nt.key),te=C(nt,te,Ge),ht===null?ze=nt:ht.sibling=nt,ht=nt);return o&&Re.forEach(function(Os){return l(oe,Os)}),at&&Qi(oe,Ge),ze}function Ue(oe,te,ce,pe){if(ce==null)throw Error(r(151));for(var ze=null,ht=null,Re=te,Ge=te=0,nt=null,mt=ce.next();Re!==null&&!mt.done;Ge++,mt=ce.next()){Re.index>Ge?(nt=Re,Re=null):nt=Re.sibling;var Os=fe(oe,Re,mt.value,pe);if(Os===null){Re===null&&(Re=nt);break}o&&Re&&Os.alternate===null&&l(oe,Re),te=C(Os,te,Ge),ht===null?ze=Os:ht.sibling=Os,ht=Os,Re=nt}if(mt.done)return h(oe,Re),at&&Qi(oe,Ge),ze;if(Re===null){for(;!mt.done;Ge++,mt=ce.next())mt=ve(oe,mt.value,pe),mt!==null&&(te=C(mt,te,Ge),ht===null?ze=mt:ht.sibling=mt,ht=mt);return at&&Qi(oe,Ge),ze}for(Re=g(Re);!mt.done;Ge++,mt=ce.next())mt=de(Re,oe,Ge,mt.value,pe),mt!==null&&(o&&mt.alternate!==null&&Re.delete(mt.key===null?Ge:mt.key),te=C(mt,te,Ge),ht===null?ze=mt:ht.sibling=mt,ht=mt);return o&&Re.forEach(function(JK){return l(oe,JK)}),at&&Qi(oe,Ge),ze}function jt(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 y:e:{for(var ze=ce.key;te!==null;){if(te.key===ze){if(ze=ce.type,ze===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===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===R&&zl(ze)===te.type){h(oe,te.sibling),pe=_(te,ce.props),Nd(pe,ce),pe.return=oe,oe=pe;break e}h(oe,te);break}else l(oe,te);te=te.sibling}ce.type===w?(pe=kl(ce.props.children,oe.mode,pe,ce.key),pe.return=oe,oe=pe):(pe=Op(ce.type,ce.key,ce.props,null,oe.mode,pe),Nd(pe,ce),pe.return=oe,oe=pe)}return M(oe);case b:e:{for(ze=ce.key;te!==null;){if(te.key===ze)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=zl(ce),jt(oe,te,ce,pe)}if(V(ce))return Ne(oe,te,ce,pe);if(I(ce)){if(ze=I(ce),typeof ze!="function")throw Error(r(150));return ce=ze.call(ce),Ue(oe,te,ce,pe)}if(typeof ce.then=="function")return jt(oe,te,Rp(ce),pe);if(ce.$$typeof===j)return jt(oe,te,Tp(oe,ce),pe);Dp(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{Ad=0;var ze=jt(oe,te,ce,pe);return yu=null,ze}catch(Re){if(Re===gu||Re===Mp)throw Re;var ht=Hr(29,Re,null,oe.mode);return ht.lanes=pe,ht.return=oe,ht}finally{}}}var Bl=YN(!0),GN=YN(!1),us=!1;function fb(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function db(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 fs(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function ds(o,l,h){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(yt&2)!==0){var _=g.pending;return _===null?l.next=l:(l.next=_.next,_.next=l),g.pending=l,l=Cp(o),PN(o,null,h),l}return jp(o,g,l,h),Cp(o)}function Td(o,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194048)!==0)){var g=l.lanes;g&=o.pendingLanes,h|=g,l.lanes=h,nr(o,h)}}function hb(o,l){var h=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,h===g)){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:g.baseState,firstBaseUpdate:_,lastBaseUpdate:C,shared:g.shared,callbacks:g.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=l:o.next=l,h.lastBaseUpdate=l}var mb=!1;function Pd(){if(mb){var o=vu;if(o!==null)throw o}}function Md(o,l,h,g){mb=!1;var _=o.updateQueue;us=!1;var C=_.firstBaseUpdate,M=_.lastBaseUpdate,H=_.shared.pending;if(H!==null){_.shared.pending=null;var Q=H,ue=Q.next;Q.next=null,M===null?C=ue:M.next=ue,M=Q;var me=o.alternate;me!==null&&(me=me.updateQueue,H=me.lastBaseUpdate,H!==M&&(H===null?me.firstBaseUpdate=ue:H.next=ue,me.lastBaseUpdate=Q))}if(C!==null){var ve=_.baseState;M=0,me=ue=Q=null,H=C;do{var fe=H.lane&-536870913,de=fe!==H.lane;if(de?(tt&fe)===fe:(g&fe)===fe){fe!==0&&fe===pu&&(mb=!0),me!==null&&(me=me.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var Ne=o,Ue=H;fe=l;var jt=h;switch(Ue.tag){case 1:if(Ne=Ue.payload,typeof Ne=="function"){ve=Ne.call(jt,ve,fe);break e}ve=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Ue.payload,fe=typeof Ne=="function"?Ne.call(jt,ve,fe):Ne,fe==null)break e;ve=d({},ve,fe);break e;case 2:us=!0}}fe=H.callback,fe!==null&&(o.flags|=64,de&&(o.flags|=8192),de=_.callbacks,de===null?_.callbacks=[fe]:de.push(fe))}else de={lane:fe,tag:H.tag,payload:H.payload,callback:H.callback,next:null},me===null?(ue=me=de,Q=ve):me=me.next=de,M|=fe;if(H=H.next,H===null){if(H=_.shared.pending,H===null)break;de=H,H=de.next,de.next=null,_.lastBaseUpdate=de,_.shared.pending=null}}while(!0);me===null&&(Q=ve),_.baseState=Q,_.firstBaseUpdate=ue,_.lastBaseUpdate=me,C===null&&(_.shared.lanes=0),gs|=M,o.lanes=M,o.memoizedState=ve}}function XN(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function WN(o,l){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)XN(h[o],l)}var xu=B(null),Ip=B(0);function QN(o,l){o=lo,X(Ip,o),X(xu,l),lo=o|l.baseLanes}function pb(){X(Ip,lo),X(xu,xu.current)}function vb(){lo=Ip.current,$(xu),$(Ip)}var Fr=B(null),pa=null;function hs(o){var l=o.alternate;X(on,on.current&1),X(Fr,o),pa===null&&(l===null||xu.current!==null||l.memoizedState!==null)&&(pa=o)}function gb(o){X(on,on.current),X(Fr,o),pa===null&&(pa=o)}function ZN(o){o.tag===22?(X(on,on.current),X(Fr,o),pa===null&&(pa=o)):ms()}function ms(){X(on,on.current),X(Fr,Fr.current)}function qr(o){$(Fr),pa===o&&(pa=null),$(on)}var on=B(0);function Lp(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 eo=0,Ye=null,Et=null,hn=null,zp=!1,bu=!1,Ul=!1,$p=0,kd=0,wu=null,F7=0;function Qt(){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(!Ur(o[h],l[h]))return!1;return!0}function xb(o,l,h,g,_,C){return eo=C,Ye=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,k.H=o===null||o.memoizedState===null?DT:Rb,Ul=!1,C=h(g,_),Ul=!1,bu&&(C=eT(l,h,g,_)),JN(o),C}function JN(o){k.H=Id;var l=Et!==null&&Et.next!==null;if(eo=0,hn=Et=Ye=null,zp=!1,kd=0,wu=null,l)throw Error(r(300));o===null||mn||(o=o.dependencies,o!==null&&Np(o)&&(mn=!0))}function eT(o,l,h,g){Ye=o;var _=0;do{if(bu&&(wu=null),kd=0,bu=!1,25<=_)throw Error(r(301));if(_+=1,hn=Et=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=IT,C=l(h,g)}while(bu);return C}function q7(){var o=k.H,l=o.useState()[0];return l=typeof l.then=="function"?Rd(l):l,o=o.useState()[0],(Et!==null?Et.memoizedState:null)!==o&&(Ye.flags|=1024),l}function bb(){var o=$p!==0;return $p=0,o}function wb(o,l,h){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~h}function Sb(o){if(zp){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}zp=!1}eo=0,hn=Et=Ye=null,bu=!1,kd=$p=0,wu=null}function vr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?Ye.memoizedState=hn=o:hn=hn.next=o,hn}function sn(){if(Et===null){var o=Ye.alternate;o=o!==null?o.memoizedState:null}else o=Et.next;var l=hn===null?Ye.memoizedState:hn.next;if(l!==null)hn=l,Et=o;else{if(o===null)throw Ye.alternate===null?Error(r(467)):Error(r(310));Et=o,o={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},hn===null?Ye.memoizedState=hn=o:hn=hn.next=o}return hn}function Bp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rd(o){var l=kd;return kd+=1,wu===null&&(wu=[]),o=qN(wu,o,l),l=Ye,(hn===null?l.memoizedState:hn.next)===null&&(l=l.alternate,k.H=l===null||l.memoizedState===null?DT:Rb),o}function Up(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Rd(o);if(o.$$typeof===j)return Yn(o)}throw Error(r(438,String(o)))}function Eb(o){var l=null,h=Ye.updateQueue;if(h!==null&&(l=h.memoCache),l==null){var g=Ye.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(l={data:g.data.map(function(_){return _.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),h===null&&(h=Bp(),Ye.updateQueue=h),h.memoCache=l,h=l.data[l.index],h===void 0)for(h=l.data[l.index]=Array(o),g=0;g<o;g++)h[g]=K;return l.index++,h}function to(o,l){return typeof l=="function"?l(o):l}function Hp(o){var l=sn();return _b(l,Et,o)}function _b(o,l,h){var g=o.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var _=o.baseQueue,C=g.pending;if(C!==null){if(_!==null){var M=_.next;_.next=C.next,C.next=M}l.baseQueue=_=C,g.pending=null}if(C=o.baseState,_===null)o.memoizedState=C;else{l=_.next;var H=M=null,Q=null,ue=l,me=!1;do{var ve=ue.lane&-536870913;if(ve!==ue.lane?(tt&ve)===ve:(eo&ve)===ve){var fe=ue.revertLane;if(fe===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),ve===pu&&(me=!0);else if((eo&fe)===fe){ue=ue.next,fe===pu&&(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?(H=Q=ve,M=C):Q=Q.next=ve,Ye.lanes|=fe,gs|=fe;ve=ue.action,Ul&&h(C,ve),C=ue.hasEagerState?ue.eagerState:h(C,ve)}else fe={lane:ve,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Q===null?(H=Q=fe,M=C):Q=Q.next=fe,Ye.lanes|=ve,gs|=ve;ue=ue.next}while(ue!==null&&ue!==l);if(Q===null?M=C:Q.next=H,!Ur(C,o.memoizedState)&&(mn=!0,me&&(h=vu,h!==null)))throw h;o.memoizedState=C,o.baseState=M,o.baseQueue=Q,g.lastRenderedState=C}return _===null&&(g.lanes=0),[o.memoizedState,g.dispatch]}function jb(o){var l=sn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var g=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!==_);Ur(C,l.memoizedState)||(mn=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),h.lastRenderedState=C}return[C,g]}function tT(o,l,h){var g=Ye,_=sn(),C=at;if(C){if(h===void 0)throw Error(r(407));h=h()}else h=l();var M=!Ur((Et||_).memoizedState,h);if(M&&(_.memoizedState=h,mn=!0),_=_.queue,Ab(aT.bind(null,g,_,o),[o]),_.getSnapshot!==l||M||hn!==null&&hn.memoizedState.tag&1){if(g.flags|=2048,Su(9,{destroy:void 0},rT.bind(null,g,_,h,l),null),Pt===null)throw Error(r(349));C||(eo&127)!==0||nT(g,l,h)}return h}function nT(o,l,h){o.flags|=16384,o={getSnapshot:l,value:h},l=Ye.updateQueue,l===null?(l=Bp(),Ye.updateQueue=l,l.stores=[o]):(h=l.stores,h===null?l.stores=[o]:h.push(o))}function rT(o,l,h,g){l.value=h,l.getSnapshot=g,iT(l)&&oT(o)}function aT(o,l,h){return h(function(){iT(l)&&oT(o)})}function iT(o){var l=o.getSnapshot;o=o.value;try{var h=l();return!Ur(o,h)}catch{return!0}}function oT(o){var l=Ml(o,2);l!==null&&Tr(l,o,2)}function Cb(o){var l=vr();if(typeof o=="function"){var h=o;if(o=h(),Ul){$r(!0);try{h()}finally{$r(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:to,lastRenderedState:o},l}function sT(o,l,h,g){return o.baseState=h,_b(o,Et,typeof g=="function"?g:to)}function K7(o,l,h,g,_){if(Kp(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,g(C),h=l.pending,h===null?(C.next=l.pending=C,lT(l,C)):(C.next=h.next,l.pending=h.next=C)}}function lT(o,l){var h=l.action,g=l.payload,_=o.state;if(l.isTransition){var C=k.T,M={};k.T=M;try{var H=h(_,g),Q=k.S;Q!==null&&Q(M,H),cT(o,l,H)}catch(ue){Ob(o,l,ue)}finally{C!==null&&M.types!==null&&(C.types=M.types),k.T=C}}else try{C=h(_,g),cT(o,l,C)}catch(ue){Ob(o,l,ue)}}function cT(o,l,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){uT(o,l,g)},function(g){return Ob(o,l,g)}):uT(o,l,h)}function uT(o,l,h){l.status="fulfilled",l.value=h,fT(l),o.state=h,l=o.pending,l!==null&&(h=l.next,h===l?o.pending=null:(h=h.next,l.next=h,lT(o,h)))}function Ob(o,l,h){var g=o.pending;if(o.pending=null,g!==null){g=g.next;do l.status="rejected",l.reason=h,fT(l),l=l.next;while(l!==g)}o.action=null}function fT(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function dT(o,l){return l}function hT(o,l){if(at){var h=Pt.formState;if(h!==null){e:{var g=Ye;if(at){if(It){t:{for(var _=It,C=ma;_.nodeType!==8;){if(!C){_=null;break t}if(_=va(_.nextSibling),_===null){_=null;break t}}C=_.data,_=C==="F!"||C==="F"?_:null}if(_){It=va(_.nextSibling),g=_.data==="F!";break e}}ls(g)}g=!1}g&&(l=h[0])}}return h=vr(),h.memoizedState=h.baseState=l,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dT,lastRenderedState:l},h.queue=g,h=MT.bind(null,Ye,g),g.dispatch=h,g=Cb(!1),C=kb.bind(null,Ye,!1,g.queue),g=vr(),_={state:l,dispatch:null,action:o,pending:null},g.queue=_,h=K7.bind(null,Ye,_,C,h),_.dispatch=h,g.memoizedState=o,[l,h,!1]}function mT(o){var l=sn();return pT(l,Et,o)}function pT(o,l,h){if(l=_b(o,l,dT)[0],o=Hp(to)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var g=Rd(l)}catch(M){throw M===gu?Mp:M}else g=l;l=sn();var _=l.queue,C=_.dispatch;return h!==l.memoizedState&&(Ye.flags|=2048,Su(9,{destroy:void 0},V7.bind(null,_,h),null)),[g,C,o]}function V7(o,l){o.action=l}function vT(o){var l=sn(),h=Et;if(h!==null)return pT(l,h,o);sn(),l=l.memoizedState,h=sn();var g=h.queue.dispatch;return h.memoizedState=o,[l,g,!1]}function Su(o,l,h,g){return o={tag:o,create:h,deps:g,inst:l,next:null},l=Ye.updateQueue,l===null&&(l=Bp(),Ye.updateQueue=l),h=l.lastEffect,h===null?l.lastEffect=o.next=o:(g=h.next,h.next=o,o.next=g,l.lastEffect=o),o}function gT(){return sn().memoizedState}function Fp(o,l,h,g){var _=vr();Ye.flags|=o,_.memoizedState=Su(1|l,{destroy:void 0},h,g===void 0?null:g)}function qp(o,l,h,g){var _=sn();g=g===void 0?null:g;var C=_.memoizedState.inst;Et!==null&&g!==null&&yb(g,Et.memoizedState.deps)?_.memoizedState=Su(l,C,h,g):(Ye.flags|=o,_.memoizedState=Su(1|l,C,h,g))}function yT(o,l){Fp(8390656,8,o,l)}function Ab(o,l){qp(2048,8,o,l)}function Y7(o){Ye.flags|=4;var l=Ye.updateQueue;if(l===null)l=Bp(),Ye.updateQueue=l,l.events=[o];else{var h=l.events;h===null?l.events=[o]:h.push(o)}}function xT(o){var l=sn().memoizedState;return Y7({ref:l,nextImpl:o}),function(){if((yt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function bT(o,l){return qp(4,2,o,l)}function wT(o,l){return qp(4,4,o,l)}function ST(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 ET(o,l,h){h=h!=null?h.concat([o]):null,qp(4,4,ST.bind(null,l,o),h)}function Nb(){}function _T(o,l){var h=sn();l=l===void 0?null:l;var g=h.memoizedState;return l!==null&&yb(l,g[1])?g[0]:(h.memoizedState=[o,l],o)}function jT(o,l){var h=sn();l=l===void 0?null:l;var g=h.memoizedState;if(l!==null&&yb(l,g[1]))return g[0];if(g=o(),Ul){$r(!0);try{o()}finally{$r(!1)}}return h.memoizedState=[g,l],g}function Tb(o,l,h){return h===void 0||(eo&1073741824)!==0&&(tt&261930)===0?o.memoizedState=l:(o.memoizedState=h,o=C2(),Ye.lanes|=o,gs|=o,h)}function CT(o,l,h,g){return Ur(h,l)?h:xu.current!==null?(o=Tb(o,h,g),Ur(o,l)||(mn=!0),o):(eo&42)===0||(eo&1073741824)!==0&&(tt&261930)===0?(mn=!0,o.memoizedState=h):(o=C2(),Ye.lanes|=o,gs|=o,l)}function OT(o,l,h,g,_){var C=F.p;F.p=C!==0&&8>C?C:8;var M=k.T,H={};k.T=H,kb(o,!1,l,h);try{var Q=_(),ue=k.S;if(ue!==null&&ue(H,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var me=H7(Q,g);Dd(o,l,me,Yr(o))}else Dd(o,l,g,Yr(o))}catch(ve){Dd(o,l,{then:function(){},status:"rejected",reason:ve},Yr())}finally{F.p=C,M!==null&&H.types!==null&&(M.types=H.types),k.T=M}}function G7(){}function Pb(o,l,h,g){if(o.tag!==5)throw Error(r(476));var _=AT(o).queue;OT(o,_,l,q,h===null?G7:function(){return NT(o),h(g)})}function AT(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:to,lastRenderedState:q},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:to,lastRenderedState:h},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function NT(o){var l=AT(o);l.next===null&&(l=o.alternate.memoizedState),Dd(o,l.next.queue,{},Yr())}function Mb(){return Yn(Zd)}function TT(){return sn().memoizedState}function PT(){return sn().memoizedState}function X7(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var h=Yr();o=fs(h);var g=ds(l,o,h);g!==null&&(Tr(g,l,h),Td(g,l,h)),l={cache:sb()},o.payload=l;return}l=l.return}}function W7(o,l,h){var g=Yr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Kp(o)?kT(l,h):(h=Wx(o,l,h,g),h!==null&&(Tr(h,o,g),RT(h,l,g)))}function MT(o,l,h){var g=Yr();Dd(o,l,h,g)}function Dd(o,l,h,g){var _={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Kp(o))kT(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,H=C(M,h);if(_.hasEagerState=!0,_.eagerState=H,Ur(H,M))return jp(o,l,_,0),Pt===null&&_p(),!1}catch{}finally{}if(h=Wx(o,l,_,g),h!==null)return Tr(h,o,g),RT(h,l,g),!0}return!1}function kb(o,l,h,g){if(g={lane:2,revertLane:fw(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Kp(o)){if(l)throw Error(r(479))}else l=Wx(o,h,g,2),l!==null&&Tr(l,o,2)}function Kp(o){var l=o.alternate;return o===Ye||l!==null&&l===Ye}function kT(o,l){bu=zp=!0;var h=o.pending;h===null?l.next=l:(l.next=h.next,h.next=l),o.pending=l}function RT(o,l,h){if((h&4194048)!==0){var g=l.lanes;g&=o.pendingLanes,h|=g,l.lanes=h,nr(o,h)}}var Id={readContext:Yn,use:Up,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};Id.useEffectEvent=Qt;var DT={readContext:Yn,use:Up,useCallback:function(o,l){return vr().memoizedState=[o,l===void 0?null:l],o},useContext:Yn,useEffect:yT,useImperativeHandle:function(o,l,h){h=h!=null?h.concat([o]):null,Fp(4194308,4,ST.bind(null,l,o),h)},useLayoutEffect:function(o,l){return Fp(4194308,4,o,l)},useInsertionEffect:function(o,l){Fp(4,2,o,l)},useMemo:function(o,l){var h=vr();l=l===void 0?null:l;var g=o();if(Ul){$r(!0);try{o()}finally{$r(!1)}}return h.memoizedState=[g,l],g},useReducer:function(o,l,h){var g=vr();if(h!==void 0){var _=h(l);if(Ul){$r(!0);try{h(l)}finally{$r(!1)}}}else _=l;return g.memoizedState=g.baseState=_,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:_},g.queue=o,o=o.dispatch=W7.bind(null,Ye,o),[g.memoizedState,o]},useRef:function(o){var l=vr();return o={current:o},l.memoizedState=o},useState:function(o){o=Cb(o);var l=o.queue,h=MT.bind(null,Ye,l);return l.dispatch=h,[o.memoizedState,h]},useDebugValue:Nb,useDeferredValue:function(o,l){var h=vr();return Tb(h,o,l)},useTransition:function(){var o=Cb(!1);return o=OT.bind(null,Ye,o.queue,!0,!1),vr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,h){var g=Ye,_=vr();if(at){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),Pt===null)throw Error(r(349));(tt&127)!==0||nT(g,l,h)}_.memoizedState=h;var C={value:h,getSnapshot:l};return _.queue=C,yT(aT.bind(null,g,C,o),[o]),g.flags|=2048,Su(9,{destroy:void 0},rT.bind(null,g,C,h,l),null),h},useId:function(){var o=vr(),l=Pt.identifierPrefix;if(at){var h=fi,g=ui;h=(g&~(1<<32-Dn(g)-1)).toString(32)+h,l="_"+l+"R_"+h,h=$p++,0<h&&(l+="H"+h.toString(32)),l+="_"}else h=F7++,l="_"+l+"r_"+h.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:Mb,useFormState:hT,useActionState:hT,useOptimistic:function(o){var l=vr();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,Ye,!0,h),h.dispatch=l,[o,l]},useMemoCache:Eb,useCacheRefresh:function(){return vr().memoizedState=X7.bind(null,Ye)},useEffectEvent:function(o){var l=vr(),h={impl:o};return l.memoizedState=h,function(){if((yt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Rb={readContext:Yn,use:Up,useCallback:_T,useContext:Yn,useEffect:Ab,useImperativeHandle:ET,useInsertionEffect:bT,useLayoutEffect:wT,useMemo:jT,useReducer:Hp,useRef:gT,useState:function(){return Hp(to)},useDebugValue:Nb,useDeferredValue:function(o,l){var h=sn();return CT(h,Et.memoizedState,o,l)},useTransition:function(){var o=Hp(to)[0],l=sn().memoizedState;return[typeof o=="boolean"?o:Rd(o),l]},useSyncExternalStore:tT,useId:TT,useHostTransitionStatus:Mb,useFormState:mT,useActionState:mT,useOptimistic:function(o,l){var h=sn();return sT(h,Et,o,l)},useMemoCache:Eb,useCacheRefresh:PT};Rb.useEffectEvent=xT;var IT={readContext:Yn,use:Up,useCallback:_T,useContext:Yn,useEffect:Ab,useImperativeHandle:ET,useInsertionEffect:bT,useLayoutEffect:wT,useMemo:jT,useReducer:jb,useRef:gT,useState:function(){return jb(to)},useDebugValue:Nb,useDeferredValue:function(o,l){var h=sn();return Et===null?Tb(h,o,l):CT(h,Et.memoizedState,o,l)},useTransition:function(){var o=jb(to)[0],l=sn().memoizedState;return[typeof o=="boolean"?o:Rd(o),l]},useSyncExternalStore:tT,useId:TT,useHostTransitionStatus:Mb,useFormState:vT,useActionState:vT,useOptimistic:function(o,l){var h=sn();return Et!==null?sT(h,Et,o,l):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:Eb,useCacheRefresh:PT};IT.useEffectEvent=xT;function Db(o,l,h,g){l=o.memoizedState,h=h(g,l),h=h==null?l:d({},l,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var Ib={enqueueSetState:function(o,l,h){o=o._reactInternals;var g=Yr(),_=fs(g);_.payload=l,h!=null&&(_.callback=h),l=ds(o,_,g),l!==null&&(Tr(l,o,g),Td(l,o,g))},enqueueReplaceState:function(o,l,h){o=o._reactInternals;var g=Yr(),_=fs(g);_.tag=1,_.payload=l,h!=null&&(_.callback=h),l=ds(o,_,g),l!==null&&(Tr(l,o,g),Td(l,o,g))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var h=Yr(),g=fs(h);g.tag=2,l!=null&&(g.callback=l),l=ds(o,g,h),l!==null&&(Tr(l,o,h),Td(l,o,h))}};function LT(o,l,h,g,_,C,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,C,M):l.prototype&&l.prototype.isPureReactComponent?!Sd(h,g)||!Sd(_,C):!0}function zT(o,l,h,g){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,g),l.state!==o&&Ib.enqueueReplaceState(l,l.state,null)}function Hl(o,l){var h=l;if("ref"in l){h={};for(var g in l)g!=="ref"&&(h[g]=l[g])}if(o=o.defaultProps){h===l&&(h=d({},h));for(var _ in o)h[_]===void 0&&(h[_]=o[_])}return h}function $T(o){Ep(o)}function BT(o){console.error(o)}function UT(o){Ep(o)}function Vp(o,l){try{var h=o.onUncaughtError;h(l.value,{componentStack:l.stack})}catch(g){setTimeout(function(){throw g})}}function HT(o,l,h){try{var g=o.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Lb(o,l,h){return h=fs(h),h.tag=3,h.payload={element:null},h.callback=function(){Vp(o,l)},h}function FT(o){return o=fs(o),o.tag=3,o}function qT(o,l,h,g){var _=h.type.getDerivedStateFromError;if(typeof _=="function"){var C=g.value;o.payload=function(){return _(C)},o.callback=function(){HT(l,h,g)}}var M=h.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(o.callback=function(){HT(l,h,g),typeof _!="function"&&(ys===null?ys=new Set([this]):ys.add(this));var H=g.stack;this.componentDidCatch(g.value,{componentStack:H!==null?H:""})})}function Q7(o,l,h,g,_){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(l=h.alternate,l!==null&&mu(l,h,_,!0),h=Fr.current,h!==null){switch(h.tag){case 31:case 13:return pa===null?av():h.alternate===null&&Zt===0&&(Zt=3),h.flags&=-257,h.flags|=65536,h.lanes=_,g===kp?h.flags|=16384:(l=h.updateQueue,l===null?h.updateQueue=new Set([g]):l.add(g),lw(o,g,_)),!1;case 22:return h.flags|=65536,g===kp?h.flags|=16384:(l=h.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=l):(h=l.retryQueue,h===null?l.retryQueue=new Set([g]):h.add(g)),lw(o,g,_)),!1}throw Error(r(435,h.tag))}return lw(o,g,_),av(),!1}if(at)return l=Fr.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=_,g!==nb&&(o=Error(r(422),{cause:g}),jd(fa(o,h)))):(g!==nb&&(l=Error(r(423),{cause:g}),jd(fa(l,h))),o=o.current.alternate,o.flags|=65536,_&=-_,o.lanes|=_,g=fa(g,h),_=Lb(o.stateNode,g,_),hb(o,_),Zt!==4&&(Zt=2)),!1;var C=Error(r(520),{cause:g});if(C=fa(C,h),qd===null?qd=[C]:qd.push(C),Zt!==4&&(Zt=2),l===null)return!0;g=fa(g,h),h=l;do{switch(h.tag){case 3:return h.flags|=65536,o=_&-_,h.lanes|=o,o=Lb(h.stateNode,g,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"&&(ys===null||!ys.has(C))))return h.flags|=65536,_&=-_,h.lanes|=_,_=FT(_),qT(_,o,h,g),hb(h,_),!1}h=h.return}while(h!==null);return!1}var zb=Error(r(461)),mn=!1;function Gn(o,l,h,g){l.child=o===null?GN(l,null,h,g):Bl(l,o.child,h,g)}function KT(o,l,h,g,_){h=h.render;var C=l.ref;if("ref"in g){var M={};for(var H in g)H!=="ref"&&(M[H]=g[H])}else M=g;return Il(l),g=xb(o,l,h,M,C,_),H=bb(),o!==null&&!mn?(wb(o,l,_),no(o,l,_)):(at&&H&&eb(l),l.flags|=1,Gn(o,l,g,_),l.child)}function VT(o,l,h,g,_){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,YT(o,l,C,g,_)):(o=Op(h.type,null,g,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:Sd,h(M,g)&&o.ref===l.ref)return no(o,l,_)}return l.flags|=1,o=Wi(C,g),o.ref=l.ref,o.return=l,l.child=o}function YT(o,l,h,g,_){if(o!==null){var C=o.memoizedProps;if(Sd(C,g)&&o.ref===l.ref)if(mn=!1,l.pendingProps=g=C,Vb(o,_))(o.flags&131072)!==0&&(mn=!0);else return l.lanes=o.lanes,no(o,l,_)}return $b(o,l,h,g,_)}function GT(o,l,h,g){var _=g.children,C=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((l.flags&128)!==0){if(C=C!==null?C.baseLanes|h:h,o!==null){for(g=l.child=o.child,_=0;g!==null;)_=_|g.lanes|g.childLanes,g=g.sibling;g=_&~C}else g=0,l.child=null;return XT(o,l,C,h,g)}if((h&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&Pp(l,C!==null?C.cachePool:null),C!==null?QN(l,C):pb(),ZN(l);else return g=l.lanes=536870912,XT(o,l,C!==null?C.baseLanes|h:h,h,g)}else C!==null?(Pp(l,C.cachePool),QN(l,C),ms(),l.memoizedState=null):(o!==null&&Pp(l,null),pb(),ms());return Gn(o,l,_,h),l.child}function Ld(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function XT(o,l,h,g,_){var C=cb();return C=C===null?null:{parent:dn._currentValue,pool:C},l.memoizedState={baseLanes:h,cachePool:C},o!==null&&Pp(l,null),pb(),ZN(l),o!==null&&mu(o,l,g,!0),l.childLanes=_,null}function Yp(o,l){return l=Xp({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function WT(o,l,h){return Bl(l,o.child,null,h),o=Yp(l,l.pendingProps),o.flags|=2,qr(l),l.memoizedState=null,o}function Z7(o,l,h){var g=l.pendingProps,_=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(at){if(g.mode==="hidden")return o=Yp(l,g),l.lanes=536870912,Ld(null,o);if(gb(l),(o=It)?(o=lP(o,ma),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:os!==null?{id:ui,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},h=kN(o),h.return=l,l.child=h,Vn=l,It=null)):o=null,o===null)throw ls(l);return l.lanes=536870912,null}return Yp(l,g)}var C=o.memoizedState;if(C!==null){var M=C.dehydrated;if(gb(l),_)if(l.flags&256)l.flags&=-257,l=WT(o,l,h);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(mn||mu(o,l,h,!1),_=(h&o.childLanes)!==0,mn||_){if(g=Pt,g!==null&&(M=rr(g,h),M!==0&&M!==C.retryLane))throw C.retryLane=M,Ml(o,M),Tr(g,o,M),zb;av(),l=WT(o,l,h)}else o=C.treeContext,It=va(M.nextSibling),Vn=l,at=!0,ss=null,ma=!1,o!==null&&IN(l,o),l=Yp(l,g),l.flags|=4096;return l}return o=Wi(o.child,{mode:g.mode,children:g.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Gp(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,g,_){return Il(l),h=xb(o,l,h,g,void 0,_),g=bb(),o!==null&&!mn?(wb(o,l,_),no(o,l,_)):(at&&g&&eb(l),l.flags|=1,Gn(o,l,h,_),l.child)}function QT(o,l,h,g,_,C){return Il(l),l.updateQueue=null,h=eT(l,g,h,_),JN(o),g=bb(),o!==null&&!mn?(wb(o,l,C),no(o,l,C)):(at&&g&&eb(l),l.flags|=1,Gn(o,l,h,C),l.child)}function ZT(o,l,h,g,_){if(Il(l),l.stateNode===null){var C=uu,M=h.contextType;typeof M=="object"&&M!==null&&(C=Yn(M)),C=new h(g,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=g,C.state=l.memoizedState,C.refs={},fb(l),M=h.contextType,C.context=typeof M=="object"&&M!==null?Yn(M):uu,C.state=l.memoizedState,M=h.getDerivedStateFromProps,typeof M=="function"&&(Db(l,h,M,g),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),Md(l,g,C,_),Pd(),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308),g=!0}else if(o===null){C=l.stateNode;var H=l.memoizedProps,Q=Hl(h,H);C.props=Q;var ue=C.context,me=h.contextType;M=uu,typeof me=="object"&&me!==null&&(M=Yn(me));var ve=h.getDerivedStateFromProps;me=typeof ve=="function"||typeof C.getSnapshotBeforeUpdate=="function",H=l.pendingProps!==H,me||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(H||ue!==M)&&zT(l,C,g,M),us=!1;var fe=l.memoizedState;C.state=fe,Md(l,g,C,_),Pd(),ue=l.memoizedState,H||fe!==ue||us?(typeof ve=="function"&&(Db(l,h,ve,g),ue=l.memoizedState),(Q=us||LT(l,h,Q,g,fe,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=g,l.memoizedState=ue),C.props=g,C.state=ue,C.context=M,g=Q):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{C=l.stateNode,db(o,l),M=l.memoizedProps,me=Hl(h,M),C.props=me,ve=l.pendingProps,fe=C.context,ue=h.contextType,Q=uu,typeof ue=="object"&&ue!==null&&(Q=Yn(ue)),H=h.getDerivedStateFromProps,(ue=typeof H=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(M!==ve||fe!==Q)&&zT(l,C,g,Q),us=!1,fe=l.memoizedState,C.state=fe,Md(l,g,C,_),Pd();var de=l.memoizedState;M!==ve||fe!==de||us||o!==null&&o.dependencies!==null&&Np(o.dependencies)?(typeof H=="function"&&(Db(l,h,H,g),de=l.memoizedState),(me=us||LT(l,h,me,g,fe,de,Q)||o!==null&&o.dependencies!==null&&Np(o.dependencies))?(ue||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(g,de,Q),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(g,de,Q)),typeof C.componentDidUpdate=="function"&&(l.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof C.componentDidUpdate!="function"||M===o.memoizedProps&&fe===o.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&fe===o.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=de),C.props=g,C.state=de,C.context=Q,g=me):(typeof C.componentDidUpdate!="function"||M===o.memoizedProps&&fe===o.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&fe===o.memoizedState||(l.flags|=1024),g=!1)}return C=g,Gp(o,l),g=(l.flags&128)!==0,C||g?(C=l.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:C.render(),l.flags|=1,o!==null&&g?(l.child=Bl(l,o.child,null,_),l.child=Bl(l,null,h,_)):Gn(o,l,h,_),l.memoizedState=C.state,o=l.child):o=no(o,l,_),o}function JT(o,l,h,g){return Rl(),l.flags|=256,Gn(o,l,h,g),l.child}var Bb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ub(o){return{baseLanes:o,cachePool:HN()}}function Hb(o,l,h){return o=o!==null?o.childLanes&~h:0,l&&(o|=Vr),o}function e2(o,l,h){var g=l.pendingProps,_=!1,C=(l.flags&128)!==0,M;if((M=C)||(M=o!==null&&o.memoizedState===null?!1:(on.current&2)!==0),M&&(_=!0,l.flags&=-129),M=(l.flags&32)!==0,l.flags&=-33,o===null){if(at){if(_?hs(l):ms(),(o=It)?(o=lP(o,ma),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:os!==null?{id:ui,overflow:fi}:null,retryLane:536870912,hydrationErrors:null},h=kN(o),h.return=l,l.child=h,Vn=l,It=null)):o=null,o===null)throw ls(l);return _w(o)?l.lanes=32:l.lanes=536870912,null}var H=g.children;return g=g.fallback,_?(ms(),_=l.mode,H=Xp({mode:"hidden",children:H},_),g=kl(g,_,h,null),H.return=l,g.return=l,H.sibling=g,l.child=H,g=l.child,g.memoizedState=Ub(h),g.childLanes=Hb(o,M,h),l.memoizedState=Bb,Ld(null,g)):(hs(l),Fb(l,H))}var Q=o.memoizedState;if(Q!==null&&(H=Q.dehydrated,H!==null)){if(C)l.flags&256?(hs(l),l.flags&=-257,l=qb(o,l,h)):l.memoizedState!==null?(ms(),l.child=o.child,l.flags|=128,l=null):(ms(),H=g.fallback,_=l.mode,g=Xp({mode:"visible",children:g.children},_),H=kl(H,_,h,null),H.flags|=2,g.return=l,H.return=l,g.sibling=H,l.child=g,Bl(l,o.child,null,h),g=l.child,g.memoizedState=Ub(h),g.childLanes=Hb(o,M,h),l.memoizedState=Bb,l=Ld(null,g));else if(hs(l),_w(H)){if(M=H.nextSibling&&H.nextSibling.dataset,M)var ue=M.dgst;M=ue,g=Error(r(419)),g.stack="",g.digest=M,jd({value:g,source:null,stack:null}),l=qb(o,l,h)}else if(mn||mu(o,l,h,!1),M=(h&o.childLanes)!==0,mn||M){if(M=Pt,M!==null&&(g=rr(M,h),g!==0&&g!==Q.retryLane))throw Q.retryLane=g,Ml(o,g),Tr(M,o,g),zb;Ew(H)||av(),l=qb(o,l,h)}else Ew(H)?(l.flags|=192,l.child=o.child,l=null):(o=Q.treeContext,It=va(H.nextSibling),Vn=l,at=!0,ss=null,ma=!1,o!==null&&IN(l,o),l=Fb(l,g.children),l.flags|=4096);return l}return _?(ms(),H=g.fallback,_=l.mode,Q=o.child,ue=Q.sibling,g=Wi(Q,{mode:"hidden",children:g.children}),g.subtreeFlags=Q.subtreeFlags&65011712,ue!==null?H=Wi(ue,H):(H=kl(H,_,h,null),H.flags|=2),H.return=l,g.return=l,g.sibling=H,l.child=g,Ld(null,g),g=l.child,H=o.child.memoizedState,H===null?H=Ub(h):(_=H.cachePool,_!==null?(Q=dn._currentValue,_=_.parent!==Q?{parent:Q,pool:Q}:_):_=HN(),H={baseLanes:H.baseLanes|h,cachePool:_}),g.memoizedState=H,g.childLanes=Hb(o,M,h),l.memoizedState=Bb,Ld(o.child,g)):(hs(l),h=o.child,o=h.sibling,h=Wi(h,{mode:"visible",children:g.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=Xp({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Xp(o,l){return o=Hr(22,o,null,l),o.lanes=0,o}function qb(o,l,h){return Bl(l,o.child,null,h),o=Fb(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function t2(o,l,h){o.lanes|=l;var g=o.alternate;g!==null&&(g.lanes|=l),ib(o.return,l,h)}function Kb(o,l,h,g,_,C){var M=o.memoizedState;M===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:_,treeForkCount:C}:(M.isBackwards=l,M.rendering=null,M.renderingStartTime=0,M.last=g,M.tail=h,M.tailMode=_,M.treeForkCount=C)}function n2(o,l,h){var g=l.pendingProps,_=g.revealOrder,C=g.tail;g=g.children;var M=on.current,H=(M&2)!==0;if(H?(M=M&1|2,l.flags|=128):M&=1,X(on,M),Gn(o,l,g,h),g=at?_d:0,!H&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&t2(o,h,l);else if(o.tag===19)t2(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&&Lp(o)===null&&(_=h),h=h.sibling;h=_,h===null?(_=l.child,l.child=null):(_=h.sibling,h.sibling=null),Kb(l,!1,_,h,C,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,_=l.child,l.child=null;_!==null;){if(o=_.alternate,o!==null&&Lp(o)===null){l.child=_;break}o=_.sibling,_.sibling=h,h=_,_=o}Kb(l,!0,h,null,C,g);break;case"together":Kb(l,!1,null,null,void 0,g);break;default:l.memoizedState=null}return l.child}function no(o,l,h){if(o!==null&&(l.dependencies=o.dependencies),gs|=l.lanes,(h&l.childLanes)===0)if(o!==null){if(mu(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=Wi(o,o.pendingProps),l.child=h,h.return=l;o.sibling!==null;)o=o.sibling,h=h.sibling=Wi(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&&Np(o)))}function J7(o,l,h){switch(l.tag){case 3:re(l,l.stateNode.containerInfo),cs(l,dn,o.memoizedState.cache),Rl();break;case 27:case 5:le(l);break;case 4:re(l,l.stateNode.containerInfo);break;case 10:cs(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,gb(l),null;break;case 13:var g=l.memoizedState;if(g!==null)return g.dehydrated!==null?(hs(l),l.flags|=128,null):(h&l.child.childLanes)!==0?e2(o,l,h):(hs(l),o=no(o,l,h),o!==null?o.sibling:null);hs(l);break;case 19:var _=(o.flags&128)!==0;if(g=(h&l.childLanes)!==0,g||(mu(o,l,h,!1),g=(h&l.childLanes)!==0),_){if(g)return n2(o,l,h);l.flags|=128}if(_=l.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),X(on,on.current),g)break;return null;case 22:return l.lanes=0,GT(o,l,h,l.pendingProps);case 24:cs(l,dn,o.memoizedState.cache)}return no(o,l,h)}function r2(o,l,h){if(o!==null)if(o.memoizedProps!==l.pendingProps)mn=!0;else{if(!Vb(o,h)&&(l.flags&128)===0)return mn=!1,J7(o,l,h);mn=(o.flags&131072)!==0}else mn=!1,at&&(l.flags&1048576)!==0&&DN(l,_d,l.index);switch(l.lanes=0,l.tag){case 16:e:{var g=l.pendingProps;if(o=zl(l.elementType),l.type=o,typeof o=="function")Qx(o)?(g=Hl(o,g),l.tag=1,l=ZT(null,l,o,g,h)):(l.tag=0,l=$b(null,l,o,g,h));else{if(o!=null){var _=o.$$typeof;if(_===A){l.tag=11,l=KT(null,l,o,g,h);break e}else if(_===P){l.tag=14,l=VT(null,l,o,g,h);break e}}throw l=z(o)||o,Error(r(306,l,""))}}return l;case 0:return $b(o,l,l.type,l.pendingProps,h);case 1:return g=l.type,_=Hl(g,l.pendingProps),ZT(o,l,g,_,h);case 3:e:{if(re(l,l.stateNode.containerInfo),o===null)throw Error(r(387));g=l.pendingProps;var C=l.memoizedState;_=C.element,db(o,l),Md(l,g,null,h);var M=l.memoizedState;if(g=M.cache,cs(l,dn,g),g!==C.cache&&ob(l,[dn],h,!0),Pd(),g=M.element,C.isDehydrated)if(C={element:g,isDehydrated:!1,cache:M.cache},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){l=JT(o,l,g,h);break e}else if(g!==_){_=fa(Error(r(424)),l),jd(_),l=JT(o,l,g,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(It=va(o.firstChild),Vn=l,at=!0,ss=null,ma=!0,h=GN(l,null,g,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Rl(),g===_){l=no(o,l,h);break e}Gn(o,l,g,h)}l=l.child}return l;case 26:return Gp(o,l),o===null?(h=mP(l.type,null,l.pendingProps,null))?l.memoizedState=h:at||(h=l.type,o=l.pendingProps,g=fv(ie.current).createElement(h),g[_n]=l,g[ar]=o,Xn(g,h,o),fn(g),l.stateNode=g):l.memoizedState=mP(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return le(l),o===null&&at&&(g=l.stateNode=fP(l.type,l.pendingProps,ie.current),Vn=l,ma=!0,_=It,Ss(l.type)?(jw=_,It=va(g.firstChild)):It=_),Gn(o,l,l.pendingProps.children,h),Gp(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&at&&((_=g=It)&&(g=NK(g,l.type,l.pendingProps,ma),g!==null?(l.stateNode=g,Vn=l,It=va(g.firstChild),ma=!1,_=!0):_=!1),_||ls(l)),le(l),_=l.type,C=l.pendingProps,M=o!==null?o.memoizedProps:null,g=C.children,bw(_,C)?g=null:M!==null&&bw(_,M)&&(l.flags|=32),l.memoizedState!==null&&(_=xb(o,l,q7,null,null,h),Zd._currentValue=_),Gp(o,l),Gn(o,l,g,h),l.child;case 6:return o===null&&at&&((o=h=It)&&(h=TK(h,l.pendingProps,ma),h!==null?(l.stateNode=h,Vn=l,It=null,o=!0):o=!1),o||ls(l)),null;case 13:return e2(o,l,h);case 4:return re(l,l.stateNode.containerInfo),g=l.pendingProps,o===null?l.child=Bl(l,null,g,h):Gn(o,l,g,h),l.child;case 11:return KT(o,l,l.type,l.pendingProps,h);case 7:return Gn(o,l,l.pendingProps,h),l.child;case 8:return Gn(o,l,l.pendingProps.children,h),l.child;case 12:return Gn(o,l,l.pendingProps.children,h),l.child;case 10:return g=l.pendingProps,cs(l,l.type,g.value),Gn(o,l,g.children,h),l.child;case 9:return _=l.type._context,g=l.pendingProps.children,Il(l),_=Yn(_),g=g(_),l.flags|=1,Gn(o,l,g,h),l.child;case 14:return VT(o,l,l.type,l.pendingProps,h);case 15:return YT(o,l,l.type,l.pendingProps,h);case 19:return n2(o,l,h);case 31:return Z7(o,l,h);case 22:return GT(o,l,h,l.pendingProps);case 24:return Il(l),g=Yn(dn),o===null?(_=cb(),_===null&&(_=Pt,C=sb(),_.pooledCache=C,C.refCount++,C!==null&&(_.pooledCacheLanes|=h),_=C),l.memoizedState={parent:g,cache:_},fb(l),cs(l,dn,_)):((o.lanes&h)!==0&&(db(o,l),Md(l,null,null,h),Pd()),_=o.memoizedState,C=l.memoizedState,_.parent!==g?(_={parent:g,cache:g},l.memoizedState=_,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=_),cs(l,dn,g)):(g=C.cache,cs(l,dn,g),g!==_.cache&&ob(l,[dn],h,!0))),Gn(o,l,l.pendingProps.children,h),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function ro(o){o.flags|=4}function Yb(o,l,h,g,_){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(_&335544128)===_)if(o.stateNode.complete)o.flags|=8192;else if(T2())o.flags|=8192;else throw $l=kp,ub}else o.flags&=-16777217}function a2(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!xP(l))if(T2())o.flags|=8192;else throw $l=kp,ub}function Wp(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?In():536870912,o.lanes|=l,Cu|=l)}function zd(o,l){if(!at)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 g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Lt(o){var l=o.alternate!==null&&o.alternate.child===o.child,h=0,g=0;if(l)for(var _=o.child;_!==null;)h|=_.lanes|_.childLanes,g|=_.subtreeFlags&65011712,g|=_.flags&65011712,_.return=o,_=_.sibling;else for(_=o.child;_!==null;)h|=_.lanes|_.childLanes,g|=_.subtreeFlags,g|=_.flags,_.return=o,_=_.sibling;return o.subtreeFlags|=g,o.childLanes=h,l}function eK(o,l,h){var g=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 Lt(l),null;case 1:return Lt(l),null;case 3:return h=l.stateNode,g=null,o!==null&&(g=o.memoizedState.cache),l.memoizedState.cache!==g&&(l.flags|=2048),Ji(dn),J(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(hu(l)?ro(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,rb())),Lt(l),null;case 26:var _=l.type,C=l.memoizedState;return o===null?(ro(l),C!==null?(Lt(l),a2(l,C)):(Lt(l),Yb(l,_,null,g,h))):C?C!==o.memoizedState?(ro(l),Lt(l),a2(l,C)):(Lt(l),l.flags&=-16777217):(o=o.memoizedProps,o!==g&&ro(l),Lt(l),Yb(l,_,o,g,h)),null;case 27:if(he(l),h=ie.current,_=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==g&&ro(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Lt(l),null}o=Z.current,hu(l)?LN(l):(o=fP(_,g,h),l.stateNode=o,ro(l))}return Lt(l),null;case 5:if(he(l),_=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==g&&ro(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Lt(l),null}if(C=Z.current,hu(l))LN(l);else{var M=fv(ie.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 g.is=="string"?M.createElement("select",{is:g.is}):M.createElement("select"),g.multiple?C.multiple=!0:g.size&&(C.size=g.size);break;default:C=typeof g.is=="string"?M.createElement(_,{is:g.is}):M.createElement(_)}}C[_n]=l,C[ar]=g;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(Xn(C,_,g),_){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ro(l)}}return Lt(l),Yb(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,h),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==g&&ro(l);else{if(typeof g!="string"&&l.stateNode===null)throw Error(r(166));if(o=ie.current,hu(l)){if(o=l.stateNode,h=l.memoizedProps,g=null,_=Vn,_!==null)switch(_.tag){case 27:case 5:g=_.memoizedProps}o[_n]=l,o=!!(o.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||eP(o.nodeValue,h)),o||ls(l,!0)}else o=fv(o).createTextNode(g),o[_n]=l,l.stateNode=o}return Lt(l),null;case 31:if(h=l.memoizedState,o===null||o.memoizedState!==null){if(g=hu(l),h!==null){if(o===null){if(!g)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[_n]=l}else Rl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Lt(l),o=!1}else h=rb(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return l.flags&256?(qr(l),l):(qr(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Lt(l),null;case 13:if(g=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(_=hu(l),g!==null&&g.dehydrated!==null){if(o===null){if(!_)throw Error(r(318));if(_=l.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[_n]=l}else Rl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Lt(l),_=!1}else _=rb(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=_),_=!0;if(!_)return l.flags&256?(qr(l),l):(qr(l),null)}return qr(l),(l.flags&128)!==0?(l.lanes=h,l):(h=g!==null,o=o!==null&&o.memoizedState!==null,h&&(g=l.child,_=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(_=g.alternate.memoizedState.cachePool.pool),C=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(C=g.memoizedState.cachePool.pool),C!==_&&(g.flags|=2048)),h!==o&&h&&(l.child.flags|=8192),Wp(l,l.updateQueue),Lt(l),null);case 4:return J(),o===null&&pw(l.stateNode.containerInfo),Lt(l),null;case 10:return Ji(l.type),Lt(l),null;case 19:if($(on),g=l.memoizedState,g===null)return Lt(l),null;if(_=(l.flags&128)!==0,C=g.rendering,C===null)if(_)zd(g,!1);else{if(Zt!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(C=Lp(o),C!==null){for(l.flags|=128,zd(g,!1),o=C.updateQueue,l.updateQueue=o,Wp(l,o),l.subtreeFlags=0,o=h,h=l.child;h!==null;)MN(h,o),h=h.sibling;return X(on,on.current&1|2),at&&Qi(l,g.treeForkCount),l.child}o=o.sibling}g.tail!==null&&dt()>tv&&(l.flags|=128,_=!0,zd(g,!1),l.lanes=4194304)}else{if(!_)if(o=Lp(C),o!==null){if(l.flags|=128,_=!0,o=o.updateQueue,l.updateQueue=o,Wp(l,o),zd(g,!0),g.tail===null&&g.tailMode==="hidden"&&!C.alternate&&!at)return Lt(l),null}else 2*dt()-g.renderingStartTime>tv&&h!==536870912&&(l.flags|=128,_=!0,zd(g,!1),l.lanes=4194304);g.isBackwards?(C.sibling=l.child,l.child=C):(o=g.last,o!==null?o.sibling=C:l.child=C,g.last=C)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=dt(),o.sibling=null,h=on.current,X(on,_?h&1|2:h&1),at&&Qi(l,g.treeForkCount),o):(Lt(l),null);case 22:case 23:return qr(l),vb(),g=l.memoizedState!==null,o!==null?o.memoizedState!==null!==g&&(l.flags|=8192):g&&(l.flags|=8192),g?(h&536870912)!==0&&(l.flags&128)===0&&(Lt(l),l.subtreeFlags&6&&(l.flags|=8192)):Lt(l),h=l.updateQueue,h!==null&&Wp(l,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048),o!==null&&$(Ll),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Ji(dn),Lt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function tK(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 Ji(dn),J(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return he(l),null;case 31:if(l.memoizedState!==null){if(qr(l),l.alternate===null)throw Error(r(340));Rl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(qr(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Rl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return $(on),null;case 4:return J(),null;case 10:return Ji(l.type),null;case 22:case 23:return qr(l),vb(),o!==null&&$(Ll),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Ji(dn),null;case 25:return null;default:return null}}function i2(o,l){switch(tb(l),l.tag){case 3:Ji(dn),J();break;case 26:case 27:case 5:he(l);break;case 4:J();break;case 31:l.memoizedState!==null&&qr(l);break;case 13:qr(l);break;case 19:$(on);break;case 10:Ji(l.type);break;case 22:case 23:qr(l),vb(),o!==null&&$(Ll);break;case 24:Ji(dn)}}function $d(o,l){try{var h=l.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var _=g.next;h=_;do{if((h.tag&o)===o){g=void 0;var C=h.create,M=h.inst;g=C(),M.destroy=g}h=h.next}while(h!==_)}}catch(H){St(l,l.return,H)}}function ps(o,l,h){try{var g=l.updateQueue,_=g!==null?g.lastEffect:null;if(_!==null){var C=_.next;g=C;do{if((g.tag&o)===o){var M=g.inst,H=M.destroy;if(H!==void 0){M.destroy=void 0,_=l;var Q=h,ue=H;try{ue()}catch(me){St(_,Q,me)}}}g=g.next}while(g!==C)}}catch(me){St(l,l.return,me)}}function o2(o){var l=o.updateQueue;if(l!==null){var h=o.stateNode;try{WN(l,h)}catch(g){St(o,o.return,g)}}}function s2(o,l,h){h.props=Hl(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(g){St(o,l,g)}}function Bd(o,l){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var g=o.stateNode;break;case 30:g=o.stateNode;break;default:g=o.stateNode}typeof h=="function"?o.refCleanup=h(g):h.current=g}}catch(_){St(o,l,_)}}function di(o,l){var h=o.ref,g=o.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(_){St(o,l,_)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(_){St(o,l,_)}else h.current=null}function l2(o){var l=o.type,h=o.memoizedProps,g=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(_){St(o,o.return,_)}}function Gb(o,l,h){try{var g=o.stateNode;EK(g,o.type,h,l),g[ar]=l}catch(_){St(o,o.return,_)}}function c2(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Ss(o.type)||o.tag===4}function Xb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||c2(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&&Ss(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 g=o.tag;if(g===5||g===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=Gi));else if(g!==4&&(g===27&&Ss(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 Qp(o,l,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?h.insertBefore(o,l):h.appendChild(o);else if(g!==4&&(g===27&&Ss(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(Qp(o,l,h),o=o.sibling;o!==null;)Qp(o,l,h),o=o.sibling}function u2(o){var l=o.stateNode,h=o.memoizedProps;try{for(var g=o.type,_=l.attributes;_.length;)l.removeAttributeNode(_[0]);Xn(l,g,h),l[_n]=o,l[ar]=h}catch(C){St(o,o.return,C)}}var ao=!1,pn=!1,Qb=!1,f2=typeof WeakSet=="function"?WeakSet:Set,Ln=null;function nK(o,l){if(o=o.containerInfo,yw=yv,o=EN(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 g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var _=g.anchorOffset,C=g.focusNode;g=g.focusOffset;try{h.nodeType,C.nodeType}catch{h=null;break e}var M=0,H=-1,Q=-1,ue=0,me=0,ve=o,fe=null;t:for(;;){for(var de;ve!==h||_!==0&&ve.nodeType!==3||(H=M+_),ve!==C||g!==0&&ve.nodeType!==3||(Q=M+g),ve.nodeType===3&&(M+=ve.nodeValue.length),(de=ve.firstChild)!==null;)fe=ve,ve=de;for(;;){if(ve===o)break t;if(fe===h&&++ue===_&&(H=M),fe===C&&++me===g&&(Q=M),(de=ve.nextSibling)!==null)break;ve=fe,fe=ve.parentNode}ve=de}h=H===-1||Q===-1?null:{start:H,end:Q}}else h=null}h=h||{start:0,end:0}}else h=null;for(xw={focusedElem:o,selectionRange:h},yv=!1,Ln=l;Ln!==null;)if(l=Ln,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ln=o;else for(;Ln!==null;){switch(l=Ln,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,g=h.stateNode;try{var Ne=Hl(h.type,_);o=g.getSnapshotBeforeUpdate(Ne,C),g.__reactInternalSnapshotBeforeUpdate=o}catch(Ue){St(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,Ln=o;break}Ln=l.return}}function d2(o,l,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:oo(o,h),g&4&&$d(5,h);break;case 1:if(oo(o,h),g&4)if(o=h.stateNode,l===null)try{o.componentDidMount()}catch(M){St(h,h.return,M)}else{var _=Hl(h.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(_,l,o.__reactInternalSnapshotBeforeUpdate)}catch(M){St(h,h.return,M)}}g&64&&o2(h),g&512&&Bd(h,h.return);break;case 3:if(oo(o,h),g&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{WN(o,l)}catch(M){St(h,h.return,M)}}break;case 27:l===null&&g&4&&u2(h);case 26:case 5:oo(o,h),l===null&&g&4&&l2(h),g&512&&Bd(h,h.return);break;case 12:oo(o,h);break;case 31:oo(o,h),g&4&&p2(o,h);break;case 13:oo(o,h),g&4&&v2(o,h),g&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=fK.bind(null,h),PK(o,h))));break;case 22:if(g=h.memoizedState!==null||ao,!g){l=l!==null&&l.memoizedState!==null||pn,_=ao;var C=pn;ao=g,(pn=l)&&!C?so(o,h,(h.subtreeFlags&8772)!==0):oo(o,h),ao=_,pn=C}break;case 30:break;default:oo(o,h)}}function h2(o){var l=o.alternate;l!==null&&(o.alternate=null,h2(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&dd(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 Ut=null,Cr=!1;function io(o,l,h){for(h=h.child;h!==null;)m2(o,l,h),h=h.sibling}function m2(o,l,h){if(Kn&&typeof Kn.onCommitFiberUnmount=="function")try{Kn.onCommitFiberUnmount(Hi,h)}catch{}switch(h.tag){case 26:pn||di(h,l),io(o,l,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:pn||di(h,l);var g=Ut,_=Cr;Ss(h.type)&&(Ut=h.stateNode,Cr=!1),io(o,l,h),Xd(h.stateNode),Ut=g,Cr=_;break;case 5:pn||di(h,l);case 6:if(g=Ut,_=Cr,Ut=null,io(o,l,h),Ut=g,Cr=_,Ut!==null)if(Cr)try{(Ut.nodeType===9?Ut.body:Ut.nodeName==="HTML"?Ut.ownerDocument.body:Ut).removeChild(h.stateNode)}catch(C){St(h,l,C)}else try{Ut.removeChild(h.stateNode)}catch(C){St(h,l,C)}break;case 18:Ut!==null&&(Cr?(o=Ut,oP(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),Ru(o)):oP(Ut,h.stateNode));break;case 4:g=Ut,_=Cr,Ut=h.stateNode.containerInfo,Cr=!0,io(o,l,h),Ut=g,Cr=_;break;case 0:case 11:case 14:case 15:ps(2,h,l),pn||ps(4,h,l),io(o,l,h);break;case 1:pn||(di(h,l),g=h.stateNode,typeof g.componentWillUnmount=="function"&&s2(h,l,g)),io(o,l,h);break;case 21:io(o,l,h);break;case 22:pn=(g=pn)||h.memoizedState!==null,io(o,l,h),pn=g;break;default:io(o,l,h)}}function p2(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Ru(o)}catch(h){St(l,l.return,h)}}}function v2(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Ru(o)}catch(h){St(l,l.return,h)}}function rK(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new f2),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new f2),l;default:throw Error(r(435,o.tag))}}function Zp(o,l){var h=rK(o);l.forEach(function(g){if(!h.has(g)){h.add(g);var _=dK.bind(null,o,g);g.then(_,_)}})}function Or(o,l){var h=l.deletions;if(h!==null)for(var g=0;g<h.length;g++){var _=h[g],C=o,M=l,H=M;e:for(;H!==null;){switch(H.tag){case 27:if(Ss(H.type)){Ut=H.stateNode,Cr=!1;break e}break;case 5:Ut=H.stateNode,Cr=!1;break e;case 3:case 4:Ut=H.stateNode.containerInfo,Cr=!0;break e}H=H.return}if(Ut===null)throw Error(r(160));m2(C,M,_),Ut=null,Cr=!1,C=_.alternate,C!==null&&(C.return=null),_.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)g2(l,o),l=l.sibling}var Ra=null;function g2(o,l){var h=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Or(l,o),Ar(o),g&4&&(ps(3,o,o.return),$d(3,o),ps(5,o,o.return));break;case 1:Or(l,o),Ar(o),g&512&&(pn||h===null||di(h,h.return)),g&64&&ao&&(o=o.updateQueue,o!==null&&(g=o.callbacks,g!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var _=Ra;if(Or(l,o),Ar(o),g&512&&(pn||h===null||di(h,h.return)),g&4){var C=h!==null?h.memoizedState:null;if(g=o.memoizedState,h===null)if(g===null)if(o.stateNode===null){e:{g=o.type,h=o.memoizedProps,_=_.ownerDocument||_;t:switch(g){case"title":C=_.getElementsByTagName("title")[0],(!C||C[Cl]||C[_n]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=_.createElement(g),_.head.insertBefore(C,_.querySelector("head > title"))),Xn(C,g,h),C[_n]=o,fn(C),g=C;break e;case"link":var M=gP("link","href",_).get(g+(h.href||""));if(M){for(var H=0;H<M.length;H++)if(C=M[H],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(H,1);break t}}C=_.createElement(g),Xn(C,g,h),_.head.appendChild(C);break;case"meta":if(M=gP("meta","content",_).get(g+(h.content||""))){for(H=0;H<M.length;H++)if(C=M[H],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(H,1);break t}}C=_.createElement(g),Xn(C,g,h),_.head.appendChild(C);break;default:throw Error(r(468,g))}C[_n]=o,fn(C),g=C}o.stateNode=g}else yP(_,o.type,o.stateNode);else o.stateNode=vP(_,g,o.memoizedProps);else C!==g?(C===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):C.count--,g===null?yP(_,o.type,o.stateNode):vP(_,g,o.memoizedProps)):g===null&&o.stateNode!==null&&Gb(o,o.memoizedProps,h.memoizedProps)}break;case 27:Or(l,o),Ar(o),g&512&&(pn||h===null||di(h,h.return)),h!==null&&g&4&&Gb(o,o.memoizedProps,h.memoizedProps);break;case 5:if(Or(l,o),Ar(o),g&512&&(pn||h===null||di(h,h.return)),o.flags&32){_=o.stateNode;try{ru(_,"")}catch(Ne){St(o,o.return,Ne)}}g&4&&o.stateNode!=null&&(_=o.memoizedProps,Gb(o,_,h!==null?h.memoizedProps:_)),g&1024&&(Qb=!0);break;case 6:if(Or(l,o),Ar(o),g&4){if(o.stateNode===null)throw Error(r(162));g=o.memoizedProps,h=o.stateNode;try{h.nodeValue=g}catch(Ne){St(o,o.return,Ne)}}break;case 3:if(mv=null,_=Ra,Ra=dv(l.containerInfo),Or(l,o),Ra=_,Ar(o),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Ru(l.containerInfo)}catch(Ne){St(o,o.return,Ne)}Qb&&(Qb=!1,y2(o));break;case 4:g=Ra,Ra=dv(o.stateNode.containerInfo),Or(l,o),Ar(o),Ra=g;break;case 12:Or(l,o),Ar(o);break;case 31:Or(l,o),Ar(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,Zp(o,g)));break;case 13:Or(l,o),Ar(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(ev=dt()),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,Zp(o,g)));break;case 22:_=o.memoizedState!==null;var Q=h!==null&&h.memoizedState!==null,ue=ao,me=pn;if(ao=ue||_,pn=me||Q,Or(l,o),pn=me,ao=ue,Ar(o),g&8192)e:for(l=o.stateNode,l._visibility=_?l._visibility&-2:l._visibility|1,_&&(h===null||Q||ao||pn||Fl(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{H=Q.stateNode;var ve=Q.memoizedProps.style,fe=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;H.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Ne){St(Q,Q.return,Ne)}}}else if(l.tag===6){if(h===null){Q=l;try{Q.stateNode.nodeValue=_?"":Q.memoizedProps}catch(Ne){St(Q,Q.return,Ne)}}}else if(l.tag===18){if(h===null){Q=l;try{var de=Q.stateNode;_?sP(de,!0):sP(Q.stateNode,!1)}catch(Ne){St(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}g&4&&(g=o.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Zp(o,h))));break;case 19:Or(l,o),Ar(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,Zp(o,g)));break;case 30:break;case 21:break;default:Or(l,o),Ar(o)}}function Ar(o){var l=o.flags;if(l&2){try{for(var h,g=o.return;g!==null;){if(c2(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var _=h.stateNode,C=Xb(o);Qp(o,C,_);break;case 5:var M=h.stateNode;h.flags&32&&(ru(M,""),h.flags&=-33);var H=Xb(o);Qp(o,H,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){St(o,o.return,me)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function y2(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;y2(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function oo(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)d2(o,l.alternate,l),l=l.sibling}function Fl(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:ps(4,l,l.return),Fl(l);break;case 1:di(l,l.return);var h=l.stateNode;typeof h.componentWillUnmount=="function"&&s2(l,l.return,h),Fl(l);break;case 27:Xd(l.stateNode);case 26:case 5:di(l,l.return),Fl(l);break;case 22:l.memoizedState===null&&Fl(l);break;case 30:Fl(l);break;default:Fl(l)}o=o.sibling}}function so(o,l,h){for(h=h&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var g=l.alternate,_=o,C=l,M=C.flags;switch(C.tag){case 0:case 11:case 15:so(_,C,h),$d(4,C);break;case 1:if(so(_,C,h),g=C,_=g.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(ue){St(g,g.return,ue)}if(g=C,_=g.updateQueue,_!==null){var H=g.stateNode;try{var Q=_.shared.hiddenCallbacks;if(Q!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Q.length;_++)XN(Q[_],H)}catch(ue){St(g,g.return,ue)}}h&&M&64&&o2(C),Bd(C,C.return);break;case 27:u2(C);case 26:case 5:so(_,C,h),h&&g===null&&M&4&&l2(C),Bd(C,C.return);break;case 12:so(_,C,h);break;case 31:so(_,C,h),h&&M&4&&p2(_,C);break;case 13:so(_,C,h),h&&M&4&&v2(_,C);break;case 22:C.memoizedState===null&&so(_,C,h),Bd(C,C.return);break;case 30:break;default:so(_,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&&Cd(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&&Cd(o))}function Da(o,l,h,g){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)x2(o,l,h,g),l=l.sibling}function x2(o,l,h,g){var _=l.flags;switch(l.tag){case 0:case 11:case 15:Da(o,l,h,g),_&2048&&$d(9,l);break;case 1:Da(o,l,h,g);break;case 3:Da(o,l,h,g),_&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Cd(o)));break;case 12:if(_&2048){Da(o,l,h,g),o=l.stateNode;try{var C=l.memoizedProps,M=C.id,H=C.onPostCommit;typeof H=="function"&&H(M,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Q){St(l,l.return,Q)}}else Da(o,l,h,g);break;case 31:Da(o,l,h,g);break;case 13:Da(o,l,h,g);break;case 23:break;case 22:C=l.stateNode,M=l.alternate,l.memoizedState!==null?C._visibility&2?Da(o,l,h,g):Ud(o,l):C._visibility&2?Da(o,l,h,g):(C._visibility|=2,Eu(o,l,h,g,(l.subtreeFlags&10256)!==0||!1)),_&2048&&Zb(M,l);break;case 24:Da(o,l,h,g),_&2048&&Jb(l.alternate,l);break;default:Da(o,l,h,g)}}function Eu(o,l,h,g,_){for(_=_&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var C=o,M=l,H=h,Q=g,ue=M.flags;switch(M.tag){case 0:case 11:case 15:Eu(C,M,H,Q,_),$d(8,M);break;case 23:break;case 22:var me=M.stateNode;M.memoizedState!==null?me._visibility&2?Eu(C,M,H,Q,_):Ud(C,M):(me._visibility|=2,Eu(C,M,H,Q,_)),_&&ue&2048&&Zb(M.alternate,M);break;case 24:Eu(C,M,H,Q,_),_&&ue&2048&&Jb(M.alternate,M);break;default:Eu(C,M,H,Q,_)}l=l.sibling}}function Ud(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var h=o,g=l,_=g.flags;switch(g.tag){case 22:Ud(h,g),_&2048&&Zb(g.alternate,g);break;case 24:Ud(h,g),_&2048&&Jb(g.alternate,g);break;default:Ud(h,g)}l=l.sibling}}var Hd=8192;function _u(o,l,h){if(o.subtreeFlags&Hd)for(o=o.child;o!==null;)b2(o,l,h),o=o.sibling}function b2(o,l,h){switch(o.tag){case 26:_u(o,l,h),o.flags&Hd&&o.memoizedState!==null&&FK(h,Ra,o.memoizedState,o.memoizedProps);break;case 5:_u(o,l,h);break;case 3:case 4:var g=Ra;Ra=dv(o.stateNode.containerInfo),_u(o,l,h),Ra=g;break;case 22:o.memoizedState===null&&(g=o.alternate,g!==null&&g.memoizedState!==null?(g=Hd,Hd=16777216,_u(o,l,h),Hd=g):_u(o,l,h));break;default:_u(o,l,h)}}function w2(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 Fd(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];Ln=g,E2(g,o)}w2(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)S2(o),o=o.sibling}function S2(o){switch(o.tag){case 0:case 11:case 15:Fd(o),o.flags&2048&&ps(9,o,o.return);break;case 3:Fd(o);break;case 12:Fd(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Jp(o)):Fd(o);break;default:Fd(o)}}function Jp(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];Ln=g,E2(g,o)}w2(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:ps(8,l,l.return),Jp(l);break;case 22:h=l.stateNode,h._visibility&2&&(h._visibility&=-3,Jp(l));break;default:Jp(l)}o=o.sibling}}function E2(o,l){for(;Ln!==null;){var h=Ln;switch(h.tag){case 0:case 11:case 15:ps(8,h,l);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Cd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Ln=g;else e:for(h=o;Ln!==null;){g=Ln;var _=g.sibling,C=g.return;if(h2(g),g===h){Ln=null;break e}if(_!==null){_.return=C,Ln=_;break e}Ln=C}}}var aK={getCacheForType:function(o){var l=Yn(dn),h=l.data.get(o);return h===void 0&&(h=o(),l.data.set(o,h)),h},cacheSignal:function(){return Yn(dn).controller.signal}},iK=typeof WeakMap=="function"?WeakMap:Map,yt=0,Pt=null,Ze=null,tt=0,wt=0,Kr=null,vs=!1,ju=!1,ew=!1,lo=0,Zt=0,gs=0,ql=0,tw=0,Vr=0,Cu=0,qd=null,Nr=null,nw=!1,ev=0,_2=0,tv=1/0,nv=null,ys=null,jn=0,xs=null,Ou=null,co=0,rw=0,aw=null,j2=null,Kd=0,iw=null;function Yr(){return(yt&2)!==0&&tt!==0?tt&-tt:k.T!==null?fw():fd()}function C2(){if(Vr===0)if((tt&536870912)===0||at){var o=Qo;Qo<<=1,(Qo&3932160)===0&&(Qo=262144),Vr=o}else Vr=536870912;return o=Fr.current,o!==null&&(o.flags|=32),Vr}function Tr(o,l,h){(o===Pt&&(wt===2||wt===9)||o.cancelPendingCommit!==null)&&(Au(o,0),bs(o,tt,Vr,!1)),Dt(o,h),((yt&2)===0||o!==Pt)&&(o===Pt&&((yt&2)===0&&(ql|=h),Zt===4&&bs(o,tt,Vr,!1)),hi(o))}function O2(o,l,h){if((yt&6)!==0)throw Error(r(327));var g=!h&&(l&127)===0&&(l&o.expiredLanes)===0||kt(o,l),_=g?lK(o,l):sw(o,l,!0),C=g;do{if(_===0){ju&&!g&&bs(o,l,0,!1);break}else{if(h=o.current.alternate,C&&!oK(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 H=o;_=qd;var Q=H.current.memoizedState.isDehydrated;if(Q&&(Au(H,M).flags|=256),M=sw(H,M,!1),M!==2){if(ew&&!Q){H.errorRecoveryDisabledLanes|=C,ql|=C,_=4;break e}C=Nr,Nr=_,C!==null&&(Nr===null?Nr=C:Nr.push.apply(Nr,C))}_=M}if(C=!1,_!==2)continue}}if(_===1){Au(o,0),bs(o,l,0,!0);break}e:{switch(g=o,C=_,C){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:bs(g,l,Vr,!vs);break e;case 2:Nr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(_=ev+300-dt(),10<_)){if(bs(g,l,Vr,!vs),qe(g,0,!0)!==0)break e;co=l,g.timeoutHandle=aP(A2.bind(null,g,h,Nr,nv,nw,l,Vr,ql,Cu,vs,C,"Throttled",-0,0),_);break e}A2(g,h,Nr,nv,nw,l,Vr,ql,Cu,vs,C,null,-0,0)}}break}while(!0);hi(o)}function A2(o,l,h,g,_,C,M,H,Q,ue,me,ve,fe,de){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:Gi},b2(l,C,ve);var Ne=(C&62914560)===C?ev-dt():(C&4194048)===C?_2-dt():0;if(Ne=qK(ve,Ne),Ne!==null){co=C,o.cancelPendingCommit=Ne(I2.bind(null,o,l,C,h,g,_,M,H,Q,me,ve,null,fe,de)),bs(o,C,M,!ue);return}}I2(o,l,C,h,g,_,M,H,Q)}function oK(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 g=0;g<h.length;g++){var _=h[g],C=_.getSnapshot;_=_.value;try{if(!Ur(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 bs(o,l,h,g){l&=~tw,l&=~ql,o.suspendedLanes|=l,o.pingedLanes&=~l,g&&(o.warmLanes|=l),g=o.expirationTimes;for(var _=l;0<_;){var C=31-Dn(_),M=1<<C;g[C]=-1,_&=~M}h!==0&&qi(o,h,l)}function rv(){return(yt&6)===0?(Vd(0),!1):!0}function ow(){if(Ze!==null){if(wt===0)var o=Ze.return;else o=Ze,Zi=Dl=null,Sb(o),yu=null,Ad=0,o=Ze;for(;o!==null;)i2(o.alternate,o),o=o.return;Ze=null}}function Au(o,l){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,CK(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),co=0,ow(),Pt=o,Ze=h=Wi(o.current,null),tt=l,wt=0,Kr=null,vs=!1,ju=kt(o,l),ew=!1,Cu=Vr=tw=ql=gs=Zt=0,Nr=qd=null,nw=!1,(l&8)!==0&&(l|=l&32);var g=o.entangledLanes;if(g!==0)for(o=o.entanglements,g&=l;0<g;){var _=31-Dn(g),C=1<<_;l|=o[_],g&=~C}return lo=l,_p(),h}function N2(o,l){Ye=null,k.H=Id,l===gu||l===Mp?(l=KN(),wt=3):l===ub?(l=KN(),wt=4):wt=l===zb?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Kr=l,Ze===null&&(Zt=1,Vp(o,fa(l,o.current)))}function T2(){var o=Fr.current;return o===null?!0:(tt&4194048)===tt?pa===null:(tt&62914560)===tt||(tt&536870912)!==0?o===pa:!1}function P2(){var o=k.H;return k.H=Id,o===null?Id:o}function M2(){var o=k.A;return k.A=aK,o}function av(){Zt=4,vs||(tt&4194048)!==tt&&Fr.current!==null||(ju=!0),(gs&134217727)===0&&(ql&134217727)===0||Pt===null||bs(Pt,tt,Vr,!1)}function sw(o,l,h){var g=yt;yt|=2;var _=P2(),C=M2();(Pt!==o||tt!==l)&&(nv=null,Au(o,l)),l=!1;var M=Zt;e:do try{if(wt!==0&&Ze!==null){var H=Ze,Q=Kr;switch(wt){case 8:ow(),M=6;break e;case 3:case 2:case 9:case 6:Fr.current===null&&(l=!0);var ue=wt;if(wt=0,Kr=null,Nu(o,H,Q,ue),h&&ju){M=0;break e}break;default:ue=wt,wt=0,Kr=null,Nu(o,H,Q,ue)}}sK(),M=Zt;break}catch(me){N2(o,me)}while(!0);return l&&o.shellSuspendCounter++,Zi=Dl=null,yt=g,k.H=_,k.A=C,Ze===null&&(Pt=null,tt=0,_p()),M}function sK(){for(;Ze!==null;)k2(Ze)}function lK(o,l){var h=yt;yt|=2;var g=P2(),_=M2();Pt!==o||tt!==l?(nv=null,tv=dt()+500,Au(o,l)):ju=kt(o,l);e:do try{if(wt!==0&&Ze!==null){l=Ze;var C=Kr;t:switch(wt){case 1:wt=0,Kr=null,Nu(o,l,C,1);break;case 2:case 9:if(FN(C)){wt=0,Kr=null,R2(l);break}l=function(){wt!==2&&wt!==9||Pt!==o||(wt=7),hi(o)},C.then(l,l);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:FN(C)?(wt=0,Kr=null,R2(l)):(wt=0,Kr=null,Nu(o,l,C,7));break;case 5:var M=null;switch(Ze.tag){case 26:M=Ze.memoizedState;case 5:case 27:var H=Ze;if(M?xP(M):H.stateNode.complete){wt=0,Kr=null;var Q=H.sibling;if(Q!==null)Ze=Q;else{var ue=H.return;ue!==null?(Ze=ue,iv(ue)):Ze=null}break t}}wt=0,Kr=null,Nu(o,l,C,5);break;case 6:wt=0,Kr=null,Nu(o,l,C,6);break;case 8:ow(),Zt=6;break e;default:throw Error(r(462))}}cK();break}catch(me){N2(o,me)}while(!0);return Zi=Dl=null,k.H=g,k.A=_,yt=h,Ze!==null?0:(Pt=null,tt=0,_p(),Zt)}function cK(){for(;Ze!==null&&!Tt();)k2(Ze)}function k2(o){var l=r2(o.alternate,o,lo);o.memoizedProps=o.pendingProps,l===null?iv(o):Ze=l}function R2(o){var l=o,h=l.alternate;switch(l.tag){case 15:case 0:l=QT(h,l,l.pendingProps,l.type,void 0,tt);break;case 11:l=QT(h,l,l.pendingProps,l.type.render,l.ref,tt);break;case 5:Sb(l);default:i2(h,l),l=Ze=MN(l,lo),l=r2(h,l,lo)}o.memoizedProps=o.pendingProps,l===null?iv(o):Ze=l}function Nu(o,l,h,g){Zi=Dl=null,Sb(l),yu=null,Ad=0;var _=l.return;try{if(Q7(o,_,l,h,tt)){Zt=1,Vp(o,fa(h,o.current)),Ze=null;return}}catch(C){if(_!==null)throw Ze=_,C;Zt=1,Vp(o,fa(h,o.current)),Ze=null;return}l.flags&32768?(at||g===1?o=!0:ju||(tt&536870912)!==0?o=!1:(vs=o=!0,(g===2||g===9||g===3||g===6)&&(g=Fr.current,g!==null&&g.tag===13&&(g.flags|=16384))),D2(l,o)):iv(l)}function iv(o){var l=o;do{if((l.flags&32768)!==0){D2(l,vs);return}o=l.return;var h=eK(l.alternate,l,lo);if(h!==null){Ze=h;return}if(l=l.sibling,l!==null){Ze=l;return}Ze=l=o}while(l!==null);Zt===0&&(Zt=5)}function D2(o,l){do{var h=tK(o.alternate,o);if(h!==null){h.flags&=32767,Ze=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!l&&(o=o.sibling,o!==null)){Ze=o;return}Ze=o=h}while(o!==null);Zt=6,Ze=null}function I2(o,l,h,g,_,C,M,H,Q){o.cancelPendingCommit=null;do ov();while(jn!==0);if((yt&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,tr(o,h,C,M,H,Q),o===Pt&&(Ze=Pt=null,tt=0),Ou=l,xs=o,co=h,rw=C,aw=_,j2=g,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,hK(oi,function(){return U2(),null})):(o.callbackNode=null,o.callbackPriority=0),g=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||g){g=k.T,k.T=null,_=F.p,F.p=2,M=yt,yt|=4;try{nK(o,l,h)}finally{yt=M,F.p=_,k.T=g}}jn=1,L2(),z2(),$2()}}function L2(){if(jn===1){jn=0;var o=xs,l=Ou,h=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||h){h=k.T,k.T=null;var g=F.p;F.p=2;var _=yt;yt|=4;try{g2(l,o);var C=xw,M=EN(o.containerInfo),H=C.focusedElem,Q=C.selectionRange;if(M!==H&&H&&H.ownerDocument&&SN(H.ownerDocument.documentElement,H)){if(Q!==null&&qx(H)){var ue=Q.start,me=Q.end;if(me===void 0&&(me=ue),"selectionStart"in H)H.selectionStart=ue,H.selectionEnd=Math.min(me,H.value.length);else{var ve=H.ownerDocument||document,fe=ve&&ve.defaultView||window;if(fe.getSelection){var de=fe.getSelection(),Ne=H.textContent.length,Ue=Math.min(Q.start,Ne),jt=Q.end===void 0?Ue:Math.min(Q.end,Ne);!de.extend&&Ue>jt&&(M=jt,jt=Ue,Ue=M);var oe=wN(H,Ue),te=wN(H,jt);if(oe&&te&&(de.rangeCount!==1||de.anchorNode!==oe.node||de.anchorOffset!==oe.offset||de.focusNode!==te.node||de.focusOffset!==te.offset)){var ce=ve.createRange();ce.setStart(oe.node,oe.offset),de.removeAllRanges(),Ue>jt?(de.addRange(ce),de.extend(te.node,te.offset)):(ce.setEnd(te.node,te.offset),de.addRange(ce))}}}}for(ve=[],de=H;de=de.parentNode;)de.nodeType===1&&ve.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<ve.length;H++){var pe=ve[H];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}yv=!!yw,xw=yw=null}finally{yt=_,F.p=g,k.T=h}}o.current=l,jn=2}}function z2(){if(jn===2){jn=0;var o=xs,l=Ou,h=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||h){h=k.T,k.T=null;var g=F.p;F.p=2;var _=yt;yt|=4;try{d2(o,l.alternate,l)}finally{yt=_,F.p=g,k.T=h}}jn=3}}function $2(){if(jn===4||jn===3){jn=0,Ee();var o=xs,l=Ou,h=co,g=j2;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?jn=5:(jn=0,Ou=xs=null,B2(o,o.pendingLanes));var _=o.pendingLanes;if(_===0&&(ys=null),Br(h),l=l.stateNode,Kn&&typeof Kn.onCommitFiberRoot=="function")try{Kn.onCommitFiberRoot(Hi,l,void 0,(l.current.flags&128)===128)}catch{}if(g!==null){l=k.T,_=F.p,F.p=2,k.T=null;try{for(var C=o.onRecoverableError,M=0;M<g.length;M++){var H=g[M];C(H.value,{componentStack:H.stack})}}finally{k.T=l,F.p=_}}(co&3)!==0&&ov(),hi(o),_=o.pendingLanes,(h&261930)!==0&&(_&42)!==0?o===iw?Kd++:(Kd=0,iw=o):Kd=0,Vd(0)}}function B2(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Cd(l)))}function ov(){return L2(),z2(),$2(),U2()}function U2(){if(jn!==5)return!1;var o=xs,l=rw;rw=0;var h=Br(co),g=k.T,_=F.p;try{F.p=32>h?32:h,k.T=null,h=aw,aw=null;var C=xs,M=co;if(jn=0,Ou=xs=null,co=0,(yt&6)!==0)throw Error(r(331));var H=yt;if(yt|=4,S2(C.current),x2(C,C.current,M,h),yt=H,Vd(0,!1),Kn&&typeof Kn.onPostCommitFiberRoot=="function")try{Kn.onPostCommitFiberRoot(Hi,C)}catch{}return!0}finally{F.p=_,k.T=g,B2(o,l)}}function H2(o,l,h){l=fa(h,l),l=Lb(o.stateNode,l,2),o=ds(o,l,2),o!==null&&(Dt(o,2),hi(o))}function St(o,l,h){if(o.tag===3)H2(o,o,h);else for(;l!==null;){if(l.tag===3){H2(l,o,h);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ys===null||!ys.has(g))){o=fa(h,o),h=FT(2),g=ds(l,h,2),g!==null&&(qT(h,g,l,o),Dt(g,2),hi(g));break}}l=l.return}}function lw(o,l,h){var g=o.pingCache;if(g===null){g=o.pingCache=new iK;var _=new Set;g.set(l,_)}else _=g.get(l),_===void 0&&(_=new Set,g.set(l,_));_.has(h)||(ew=!0,_.add(h),o=uK.bind(null,o,l,h),l.then(o,o))}function uK(o,l,h){var g=o.pingCache;g!==null&&g.delete(l),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,Pt===o&&(tt&h)===h&&(Zt===4||Zt===3&&(tt&62914560)===tt&&300>dt()-ev?(yt&2)===0&&Au(o,0):tw|=h,Cu===tt&&(Cu=0)),hi(o)}function F2(o,l){l===0&&(l=In()),o=Ml(o,l),o!==null&&(Dt(o,l),hi(o))}function fK(o){var l=o.memoizedState,h=0;l!==null&&(h=l.retryLane),F2(o,h)}function dK(o,l){var h=0;switch(o.tag){case 31:case 13:var g=o.stateNode,_=o.memoizedState;_!==null&&(h=_.retryLane);break;case 19:g=o.stateNode;break;case 22:g=o.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(l),F2(o,h)}function hK(o,l){return Sn(o,l)}var sv=null,Tu=null,cw=!1,lv=!1,uw=!1,ws=0;function hi(o){o!==Tu&&o.next===null&&(Tu===null?sv=Tu=o:Tu=Tu.next=o),lv=!0,cw||(cw=!0,pK())}function Vd(o,l){if(!uw&&lv){uw=!0;do for(var h=!1,g=sv;g!==null;){if(o!==0){var _=g.pendingLanes;if(_===0)var C=0;else{var M=g.suspendedLanes,H=g.pingedLanes;C=(1<<31-Dn(42|o)+1)-1,C&=_&~(M&~H),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(h=!0,Y2(g,C))}else C=tt,C=qe(g,g===Pt?C:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(C&3)===0||kt(g,C)||(h=!0,Y2(g,C));g=g.next}while(h);uw=!1}}function mK(){q2()}function q2(){lv=cw=!1;var o=0;ws!==0&&jK()&&(o=ws);for(var l=dt(),h=null,g=sv;g!==null;){var _=g.next,C=K2(g,l);C===0?(g.next=null,h===null?sv=_:h.next=_,_===null&&(Tu=h)):(h=g,(o!==0||(C&3)!==0)&&(lv=!0)),g=_}jn!==0&&jn!==5||Vd(o),ws!==0&&(ws=0)}function K2(o,l){for(var h=o.suspendedLanes,g=o.pingedLanes,_=o.expirationTimes,C=o.pendingLanes&-62914561;0<C;){var M=31-Dn(C),H=1<<M,Q=_[M];Q===-1?((H&h)===0||(H&g)!==0)&&(_[M]=un(H,l)):Q<=l&&(o.expiredLanes|=H),C&=~H}if(l=Pt,h=tt,h=qe(o,o===l?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g=o.callbackNode,h===0||o===l&&(wt===2||wt===9)||o.cancelPendingCommit!==null)return g!==null&&g!==null&&we(g),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||kt(o,h)){if(l=h&-h,l===o.callbackPriority)return l;switch(g!==null&&we(g),Br(h)){case 2:case 8:h=ii;break;case 32:h=oi;break;case 268435456:h=zr;break;default:h=oi}return g=V2.bind(null,o),h=Sn(h,g),o.callbackPriority=l,o.callbackNode=h,l}return g!==null&&g!==null&&we(g),o.callbackPriority=2,o.callbackNode=null,2}function V2(o,l){if(jn!==0&&jn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(ov()&&o.callbackNode!==h)return null;var g=tt;return g=qe(o,o===Pt?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g===0?null:(O2(o,g,l),K2(o,dt()),o.callbackNode!=null&&o.callbackNode===h?V2.bind(null,o):null)}function Y2(o,l){if(ov())return null;O2(o,l,!0)}function pK(){OK(function(){(yt&6)!==0?Sn(er,mK):q2()})}function fw(){if(ws===0){var o=pu;o===0&&(o=Wo,Wo<<=1,(Wo&261888)===0&&(Wo=256)),ws=o}return ws}function G2(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:vp(""+o)}function X2(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 vK(o,l,h,g,_){if(l==="submit"&&h&&h.stateNode===_){var C=G2((_[ar]||null).action),M=g.submitter;M&&(l=(l=M[ar]||null)?G2(l.formAction):M.getAttribute("formAction"),l!==null&&(C=l,M=null));var H=new bp("action","action",null,g,_);o.push({event:H,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(ws!==0){var Q=M?X2(_,M):new FormData(_);Pb(h,{pending:!0,data:Q,method:_.method,action:C},null,Q)}}else typeof C=="function"&&(H.preventDefault(),Q=M?X2(_,M):new FormData(_),Pb(h,{pending:!0,data:Q,method:_.method,action:C},C,Q))},currentTarget:_}]})}}for(var dw=0;dw<Gx.length;dw++){var hw=Gx[dw],gK=hw.toLowerCase(),yK=hw[0].toUpperCase()+hw.slice(1);ka(gK,"on"+yK)}ka(CN,"onAnimationEnd"),ka(ON,"onAnimationIteration"),ka(AN,"onAnimationStart"),ka("dblclick","onDoubleClick"),ka("focusin","onFocus"),ka("focusout","onBlur"),ka(R7,"onTransitionRun"),ka(D7,"onTransitionStart"),ka(I7,"onTransitionCancel"),ka(NN,"onTransitionEnd"),rs("onMouseEnter",["mouseout","mouseover"]),rs("onMouseLeave",["mouseout","mouseover"]),rs("onPointerEnter",["pointerout","pointerover"]),rs("onPointerLeave",["pointerout","pointerover"]),Vi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yd="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(" "),xK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yd));function W2(o,l){l=(l&4)!==0;for(var h=0;h<o.length;h++){var g=o[h],_=g.event;g=g.listeners;e:{var C=void 0;if(l)for(var M=g.length-1;0<=M;M--){var H=g[M],Q=H.instance,ue=H.currentTarget;if(H=H.listener,Q!==C&&_.isPropagationStopped())break e;C=H,_.currentTarget=ue;try{C(_)}catch(me){Ep(me)}_.currentTarget=null,C=Q}else for(M=0;M<g.length;M++){if(H=g[M],Q=H.instance,ue=H.currentTarget,H=H.listener,Q!==C&&_.isPropagationStopped())break e;C=H,_.currentTarget=ue;try{C(_)}catch(me){Ep(me)}_.currentTarget=null,C=Q}}}}function Je(o,l){var h=l[eu];h===void 0&&(h=l[eu]=new Set);var g=o+"__bubble";h.has(g)||(Q2(l,o,2,!1),h.add(g))}function mw(o,l,h){var g=0;l&&(g|=4),Q2(h,o,g,l)}var cv="_reactListening"+Math.random().toString(36).slice(2);function pw(o){if(!o[cv]){o[cv]=!0,up.forEach(function(h){h!=="selectionchange"&&(xK.has(h)||mw(h,!1,o),mw(h,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[cv]||(l[cv]=!0,mw("selectionchange",!1,l))}}function Q2(o,l,h,g){switch(CP(l)){case 2:var _=YK;break;case 8:_=GK;break;default:_=Tw}h=_.bind(null,l,h,o),_=void 0,!Dx||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(_=!0),g?_!==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,g,_){var C=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var M=g.tag;if(M===3||M===4){var H=g.stateNode.containerInfo;if(H===_)break;if(M===4)for(M=g.return;M!==null;){var Q=M.tag;if((Q===3||Q===4)&&M.stateNode.containerInfo===_)return;M=M.return}for(;H!==null;){if(M=Jo(H),M===null)return;if(Q=M.tag,Q===5||Q===6||Q===26||Q===27){g=C=M;continue e}H=H.parentNode}}g=g.return}nN(function(){var ue=C,me=kx(h),ve=[];e:{var fe=TN.get(o);if(fe!==void 0){var de=bp,Ne=o;switch(o){case"keypress":if(yp(h)===0)break e;case"keydown":case"keyup":de=d7;break;case"focusin":Ne="focus",de=$x;break;case"focusout":Ne="blur",de=$x;break;case"beforeblur":case"afterblur":de=$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":de=iN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=e7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=p7;break;case CN:case ON:case AN:de=r7;break;case NN:de=g7;break;case"scroll":case"scrollend":de=Z9;break;case"wheel":de=x7;break;case"copy":case"cut":case"paste":de=i7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=sN;break;case"toggle":case"beforetoggle":de=w7}var Ue=(l&4)!==0,jt=!Ue&&(o==="scroll"||o==="scrollend"),oe=Ue?fe!==null?fe+"Capture":null:fe;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=pd(te,oe),pe!=null&&Ue.push(Gd(te,pe,ce))),jt)break;te=te.return}0<Ue.length&&(fe=new de(fe,Ne,null,h,me),ve.push({event:fe,listeners:Ue}))}}if((l&7)===0){e:{if(fe=o==="mouseover"||o==="pointerover",de=o==="mouseout"||o==="pointerout",fe&&h!==Mx&&(Ne=h.relatedTarget||h.fromElement)&&(Jo(Ne)||Ne[Ki]))break e;if((de||fe)&&(fe=me.window===me?me:(fe=me.ownerDocument)?fe.defaultView||fe.parentWindow:window,de?(Ne=h.relatedTarget||h.toElement,de=ue,Ne=Ne?Jo(Ne):null,Ne!==null&&(jt=i(Ne),Ue=Ne.tag,Ne!==jt||Ue!==5&&Ue!==27&&Ue!==6)&&(Ne=null)):(de=null,Ne=ue),de!==Ne)){if(Ue=iN,pe="onMouseLeave",oe="onMouseEnter",te="mouse",(o==="pointerout"||o==="pointerover")&&(Ue=sN,pe="onPointerLeave",oe="onPointerEnter",te="pointer"),jt=de==null?fe:ts(de),ce=Ne==null?fe:ts(Ne),fe=new Ue(pe,te+"leave",de,h,me),fe.target=jt,fe.relatedTarget=ce,pe=null,Jo(me)===ue&&(Ue=new Ue(oe,te+"enter",Ne,h,me),Ue.target=ce,Ue.relatedTarget=jt,pe=Ue),jt=pe,de&&Ne)t:{for(Ue=bK,oe=de,te=Ne,ce=0,pe=oe;pe;pe=Ue(pe))ce++;pe=0;for(var ze=te;ze;ze=Ue(ze))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;de!==null&&Z2(ve,fe,de,Ue,!1),Ne!==null&&jt!==null&&Z2(ve,jt,Ne,Ue,!0)}}e:{if(fe=ue?ts(ue):window,de=fe.nodeName&&fe.nodeName.toLowerCase(),de==="select"||de==="input"&&fe.type==="file")var ht=pN;else if(hN(fe))if(vN)ht=P7;else{ht=N7;var Re=A7}else de=fe.nodeName,!de||de.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ue&&Px(ue.elementType)&&(ht=pN):ht=T7;if(ht&&(ht=ht(o,ue))){mN(ve,ht,h,me);break e}Re&&Re(o,fe,ue),o==="focusout"&&ue&&fe.type==="number"&&ue.memoizedProps.value!=null&&md(fe,"number",fe.value)}switch(Re=ue?ts(ue):window,o){case"focusin":(hN(Re)||Re.contentEditable==="true")&&(su=Re,Kx=ue,Ed=null);break;case"focusout":Ed=Kx=su=null;break;case"mousedown":Vx=!0;break;case"contextmenu":case"mouseup":case"dragend":Vx=!1,_N(ve,h,me);break;case"selectionchange":if(k7)break;case"keydown":case"keyup":_N(ve,h,me)}var Ge;if(Ux)e:{switch(o){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else ou?fN(o,h)&&(nt="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(nt="onCompositionStart");nt&&(lN&&h.locale!=="ko"&&(ou||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&ou&&(Ge=rN()):(is=me,Ix="value"in is?is.value:is.textContent,ou=!0)),Re=uv(ue,nt),0<Re.length&&(nt=new oN(nt,o,null,h,me),ve.push({event:nt,listeners:Re}),Ge?nt.data=Ge:(Ge=dN(h),Ge!==null&&(nt.data=Ge)))),(Ge=E7?_7(o,h):j7(o,h))&&(nt=uv(ue,"onBeforeInput"),0<nt.length&&(Re=new oN("onBeforeInput","beforeinput",null,h,me),ve.push({event:Re,listeners:nt}),Re.data=Ge)),vK(ve,o,ue,h,me)}W2(ve,l)})}function Gd(o,l,h){return{instance:o,listener:l,currentTarget:h}}function uv(o,l){for(var h=l+"Capture",g=[];o!==null;){var _=o,C=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||C===null||(_=pd(o,h),_!=null&&g.unshift(Gd(o,_,C)),_=pd(o,l),_!=null&&g.push(Gd(o,_,C))),o.tag===3)return g;o=o.return}return[]}function bK(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function Z2(o,l,h,g,_){for(var C=l._reactName,M=[];h!==null&&h!==g;){var H=h,Q=H.alternate,ue=H.stateNode;if(H=H.tag,Q!==null&&Q===g)break;H!==5&&H!==26&&H!==27||ue===null||(Q=ue,_?(ue=pd(h,C),ue!=null&&M.unshift(Gd(h,ue,Q))):_||(ue=pd(h,C),ue!=null&&M.push(Gd(h,ue,Q)))),h=h.return}M.length!==0&&o.push({event:l,listeners:M})}var wK=/\r\n?/g,SK=/\u0000|\uFFFD/g;function J2(o){return(typeof o=="string"?o:""+o).replace(wK,`
`).replace(SK,"")}function eP(o,l){return l=J2(l),J2(o)===l}function _t(o,l,h,g,_,C){switch(h){case"children":typeof g=="string"?l==="body"||l==="textarea"&&g===""||ru(o,g):(typeof g=="number"||typeof g=="bigint")&&l!=="body"&&ru(o,""+g);break;case"className":nu(o,"class",g);break;case"tabIndex":nu(o,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":nu(o,h,g);break;case"style":eN(o,g,C);break;case"data":if(l!=="object"){nu(o,"data",g);break}case"src":case"href":if(g===""&&(l!=="a"||h!=="href")){o.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(h);break}g=vp(""+g),o.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="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"&&_t(o,l,"name",_.name,_,null),_t(o,l,"formEncType",_.formEncType,_,null),_t(o,l,"formMethod",_.formMethod,_,null),_t(o,l,"formTarget",_.formTarget,_,null)):(_t(o,l,"encType",_.encType,_,null),_t(o,l,"method",_.method,_,null),_t(o,l,"target",_.target,_,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(h);break}g=vp(""+g),o.setAttribute(h,g);break;case"onClick":g!=null&&(o.onclick=Gi);break;case"onScroll":g!=null&&Je("scroll",o);break;case"onScrollEnd":g!=null&&Je("scrollend",o);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(_.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":o.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){o.removeAttribute("xlink:href");break}h=vp(""+g),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":g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,""+g):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":g&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":g===!0?o.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,g):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?o.setAttribute(h,g):o.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?o.removeAttribute(h):o.setAttribute(h,g);break;case"popover":Je("beforetoggle",o),Je("toggle",o),tu(o,"popover",g);break;case"xlinkActuate":Ma(o,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ma(o,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ma(o,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ma(o,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ma(o,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ma(o,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ma(o,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ma(o,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ma(o,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":tu(o,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=W9.get(h)||h,tu(o,h,g))}}function gw(o,l,h,g,_,C){switch(h){case"style":eN(o,g,C);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(_.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof g=="string"?ru(o,g):(typeof g=="number"||typeof g=="bigint")&&ru(o,""+g);break;case"onScroll":g!=null&&Je("scroll",o);break;case"onScrollEnd":g!=null&&Je("scrollend",o);break;case"onClick":g!=null&&(o.onclick=Gi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fp.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(_=h.endsWith("Capture"),l=h.slice(2,_?h.length-7:void 0),C=o[ar]||null,C=C!=null?C[h]:null,typeof C=="function"&&o.removeEventListener(l,C,_),typeof g=="function")){typeof C!="function"&&C!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(l,g,_);break e}h in o?o[h]=g:g===!0?o.setAttribute(h,""):tu(o,h,g)}}}function Xn(o,l,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",o),Je("load",o);var g=!1,_=!1,C;for(C in h)if(h.hasOwnProperty(C)){var M=h[C];if(M!=null)switch(C){case"src":g=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:_t(o,l,C,M,h,null)}}_&&_t(o,l,"srcSet",h.srcSet,h,null),g&&_t(o,l,"src",h.src,h,null);return;case"input":Je("invalid",o);var H=C=M=_=null,Q=null,ue=null;for(g in h)if(h.hasOwnProperty(g)){var me=h[g];if(me!=null)switch(g){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":H=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:_t(o,l,g,me,h,null)}}pp(o,C,H,Q,ue,M,_,!1);return;case"select":Je("invalid",o),g=M=C=null;for(_ in h)if(h.hasOwnProperty(_)&&(H=h[_],H!=null))switch(_){case"value":C=H;break;case"defaultValue":M=H;break;case"multiple":g=H;default:_t(o,l,_,H,h,null)}l=C,h=M,o.multiple=!!g,l!=null?Yi(o,!!g,l,!1):h!=null&&Yi(o,!!g,h,!0);return;case"textarea":Je("invalid",o),C=_=g=null;for(M in h)if(h.hasOwnProperty(M)&&(H=h[M],H!=null))switch(M){case"value":g=H;break;case"defaultValue":_=H;break;case"children":C=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(91));break;default:_t(o,l,M,H,h,null)}ZA(o,g,_,C);return;case"option":for(Q in h)if(h.hasOwnProperty(Q)&&(g=h[Q],g!=null))switch(Q){case"selected":o.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:_t(o,l,Q,g,h,null)}return;case"dialog":Je("beforetoggle",o),Je("toggle",o),Je("cancel",o),Je("close",o);break;case"iframe":case"object":Je("load",o);break;case"video":case"audio":for(g=0;g<Yd.length;g++)Je(Yd[g],o);break;case"image":Je("error",o),Je("load",o);break;case"details":Je("toggle",o);break;case"embed":case"source":case"link":Je("error",o),Je("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)&&(g=h[ue],g!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:_t(o,l,ue,g,h,null)}return;default:if(Px(l)){for(me in h)h.hasOwnProperty(me)&&(g=h[me],g!==void 0&&gw(o,l,me,g,h,void 0));return}}for(H in h)h.hasOwnProperty(H)&&(g=h[H],g!=null&&_t(o,l,H,g,h,null))}function EK(o,l,h,g){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,H=null,Q=null,ue=null,me=null;for(de in h){var ve=h[de];if(h.hasOwnProperty(de)&&ve!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":Q=ve;default:g.hasOwnProperty(de)||_t(o,l,de,null,g,ve)}}for(var fe in g){var de=g[fe];if(ve=h[fe],g.hasOwnProperty(fe)&&(de!=null||ve!=null))switch(fe){case"type":C=de;break;case"name":_=de;break;case"checked":ue=de;break;case"defaultChecked":me=de;break;case"value":M=de;break;case"defaultValue":H=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:de!==ve&&_t(o,l,fe,de,g,ve)}}Al(o,M,H,Q,ue,me,C,_);return;case"select":de=M=H=fe=null;for(C in h)if(Q=h[C],h.hasOwnProperty(C)&&Q!=null)switch(C){case"value":break;case"multiple":de=Q;default:g.hasOwnProperty(C)||_t(o,l,C,null,g,Q)}for(_ in g)if(C=g[_],Q=h[_],g.hasOwnProperty(_)&&(C!=null||Q!=null))switch(_){case"value":fe=C;break;case"defaultValue":H=C;break;case"multiple":M=C;default:C!==Q&&_t(o,l,_,C,g,Q)}l=H,h=M,g=de,fe!=null?Yi(o,!!h,fe,!1):!!g!=!!h&&(l!=null?Yi(o,!!h,l,!0):Yi(o,!!h,h?[]:"",!1));return;case"textarea":de=fe=null;for(H in h)if(_=h[H],h.hasOwnProperty(H)&&_!=null&&!g.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:_t(o,l,H,null,g,_)}for(M in g)if(_=g[M],C=h[M],g.hasOwnProperty(M)&&(_!=null||C!=null))switch(M){case"value":fe=_;break;case"defaultValue":de=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==C&&_t(o,l,M,_,g,C)}QA(o,fe,de);return;case"option":for(var Ne in h)if(fe=h[Ne],h.hasOwnProperty(Ne)&&fe!=null&&!g.hasOwnProperty(Ne))switch(Ne){case"selected":o.selected=!1;break;default:_t(o,l,Ne,null,g,fe)}for(Q in g)if(fe=g[Q],de=h[Q],g.hasOwnProperty(Q)&&fe!==de&&(fe!=null||de!=null))switch(Q){case"selected":o.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:_t(o,l,Q,fe,g,de)}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)fe=h[Ue],h.hasOwnProperty(Ue)&&fe!=null&&!g.hasOwnProperty(Ue)&&_t(o,l,Ue,null,g,fe);for(ue in g)if(fe=g[ue],de=h[ue],g.hasOwnProperty(ue)&&fe!==de&&(fe!=null||de!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:_t(o,l,ue,fe,g,de)}return;default:if(Px(l)){for(var jt in h)fe=h[jt],h.hasOwnProperty(jt)&&fe!==void 0&&!g.hasOwnProperty(jt)&&gw(o,l,jt,void 0,g,fe);for(me in g)fe=g[me],de=h[me],!g.hasOwnProperty(me)||fe===de||fe===void 0&&de===void 0||gw(o,l,me,fe,g,de);return}}for(var oe in h)fe=h[oe],h.hasOwnProperty(oe)&&fe!=null&&!g.hasOwnProperty(oe)&&_t(o,l,oe,null,g,fe);for(ve in g)fe=g[ve],de=h[ve],!g.hasOwnProperty(ve)||fe===de||fe==null&&de==null||_t(o,l,ve,fe,g,de)}function tP(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _K(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var _=h[g],C=_.transferSize,M=_.initiatorType,H=_.duration;if(C&&H&&tP(M)){for(M=0,H=_.responseEnd,g+=1;g<h.length;g++){var Q=h[g],ue=Q.startTime;if(ue>H)break;var me=Q.transferSize,ve=Q.initiatorType;me&&tP(ve)&&(Q=Q.responseEnd,M+=me*(Q<H?1:(H-ue)/(Q-ue)))}if(--g,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 fv(o){return o.nodeType===9?o:o.ownerDocument}function nP(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 rP(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 jK(){var o=window.event;return o&&o.type==="popstate"?o===ww?!1:(ww=o,!0):(ww=null,!1)}var aP=typeof setTimeout=="function"?setTimeout:void 0,CK=typeof clearTimeout=="function"?clearTimeout:void 0,iP=typeof Promise=="function"?Promise:void 0,OK=typeof queueMicrotask=="function"?queueMicrotask:typeof iP<"u"?function(o){return iP.resolve(null).then(o).catch(AK)}:aP;function AK(o){setTimeout(function(){throw o})}function Ss(o){return o==="head"}function oP(o,l){var h=l,g=0;do{var _=h.nextSibling;if(o.removeChild(h),_&&_.nodeType===8)if(h=_.data,h==="/$"||h==="/&"){if(g===0){o.removeChild(_),Ru(l);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Xd(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,Xd(h);for(var C=h.firstChild;C;){var M=C.nextSibling,H=C.nodeName;C[Cl]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&C.rel.toLowerCase()==="stylesheet"||h.removeChild(C),C=M}}else h==="body"&&Xd(o.ownerDocument.body);h=_}while(h);Ru(l)}function sP(o,l){var h=o;o=0;do{var g=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||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=g}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),dd(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function NK(o,l,h,g){for(;o.nodeType===1;){var _=h;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!g&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(g){if(!o[Cl])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=va(o.nextSibling),o===null)break}return null}function TK(o,l,h){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=va(o.nextSibling),o===null))return null;return o}function lP(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=va(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 PK(o,l){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||h.readyState!=="loading")l();else{var g=function(){l(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),o._reactRetry=g}}function va(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 cP(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(l===0)return va(o.nextSibling);l--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||l++}o=o.nextSibling}return null}function uP(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 fP(o,l,h){switch(l=fv(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 Xd(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);dd(o)}var ga=new Map,dP=new Set;function dv(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var uo=F.d;F.d={f:MK,r:kK,D:RK,C:DK,L:IK,m:LK,X:$K,S:zK,M:BK};function MK(){var o=uo.f(),l=rv();return o||l}function kK(o){var l=es(o);l!==null&&l.tag===5&&l.type==="form"?NT(l):uo.r(o)}var Pu=typeof document>"u"?null:document;function hP(o,l,h){var g=Pu;if(g&&typeof l=="string"&&l){var _=_r(l);_='link[rel="'+o+'"][href="'+_+'"]',typeof h=="string"&&(_+='[crossorigin="'+h+'"]'),dP.has(_)||(dP.add(_),o={rel:o,crossOrigin:h,href:l},g.querySelector(_)===null&&(l=g.createElement("link"),Xn(l,"link",o),fn(l),g.head.appendChild(l)))}}function RK(o){uo.D(o),hP("dns-prefetch",o,null)}function DK(o,l){uo.C(o,l),hP("preconnect",o,l)}function IK(o,l,h){uo.L(o,l,h);var g=Pu;if(g&&o&&l){var _='link[rel="preload"][as="'+_r(l)+'"]';l==="image"&&h&&h.imageSrcSet?(_+='[imagesrcset="'+_r(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(_+='[imagesizes="'+_r(h.imageSizes)+'"]')):_+='[href="'+_r(o)+'"]';var C=_;switch(l){case"style":C=Mu(o);break;case"script":C=ku(o)}ga.has(C)||(o=d({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:o,as:l},h),ga.set(C,o),g.querySelector(_)!==null||l==="style"&&g.querySelector(Wd(C))||l==="script"&&g.querySelector(Qd(C))||(l=g.createElement("link"),Xn(l,"link",o),fn(l),g.head.appendChild(l)))}}function LK(o,l){uo.m(o,l);var h=Pu;if(h&&o){var g=l&&typeof l.as=="string"?l.as:"script",_='link[rel="modulepreload"][as="'+_r(g)+'"][href="'+_r(o)+'"]',C=_;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=ku(o)}if(!ga.has(C)&&(o=d({rel:"modulepreload",href:o},l),ga.set(C,o),h.querySelector(_)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Qd(C)))return}g=h.createElement("link"),Xn(g,"link",o),fn(g),h.head.appendChild(g)}}}function zK(o,l,h){uo.S(o,l,h);var g=Pu;if(g&&o){var _=ns(g).hoistableStyles,C=Mu(o);l=l||"default";var M=_.get(C);if(!M){var H={loading:0,preload:null};if(M=g.querySelector(Wd(C)))H.loading=5;else{o=d({rel:"stylesheet",href:o,"data-precedence":l},h),(h=ga.get(C))&&Cw(o,h);var Q=M=g.createElement("link");fn(Q),Xn(Q,"link",o),Q._p=new Promise(function(ue,me){Q.onload=ue,Q.onerror=me}),Q.addEventListener("load",function(){H.loading|=1}),Q.addEventListener("error",function(){H.loading|=2}),H.loading|=4,hv(M,l,g)}M={type:"stylesheet",instance:M,count:1,state:H},_.set(C,M)}}}function $K(o,l){uo.X(o,l);var h=Pu;if(h&&o){var g=ns(h).hoistableScripts,_=ku(o),C=g.get(_);C||(C=h.querySelector(Qd(_)),C||(o=d({src:o,async:!0},l),(l=ga.get(_))&&Ow(o,l),C=h.createElement("script"),fn(C),Xn(C,"link",o),h.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},g.set(_,C))}}function BK(o,l){uo.M(o,l);var h=Pu;if(h&&o){var g=ns(h).hoistableScripts,_=ku(o),C=g.get(_);C||(C=h.querySelector(Qd(_)),C||(o=d({src:o,async:!0,type:"module"},l),(l=ga.get(_))&&Ow(o,l),C=h.createElement("script"),fn(C),Xn(C,"link",o),h.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},g.set(_,C))}}function mP(o,l,h,g){var _=(_=ie.current)?dv(_):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=Mu(h.href),h=ns(_).hoistableStyles,g=h.get(l),g||(g={type:"style",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=Mu(h.href);var C=ns(_).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(Wd(o)))&&!C._p&&(M.instance=C,M.state.loading=5),ga.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},ga.set(o,h),C||UK(_,o,h,M.state))),l&&g===null)throw Error(r(528,""));return M}if(l&&g!==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=ku(h),h=ns(_).hoistableScripts,g=h.get(l),g||(g={type:"script",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Mu(o){return'href="'+_r(o)+'"'}function Wd(o){return'link[rel="stylesheet"]['+o+"]"}function pP(o){return d({},o,{"data-precedence":o.precedence,precedence:null})}function UK(o,l,h,g){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?g.loading=1:(l=o.createElement("link"),g.preload=l,l.addEventListener("load",function(){return g.loading|=1}),l.addEventListener("error",function(){return g.loading|=2}),Xn(l,"link",h),fn(l),o.head.appendChild(l))}function ku(o){return'[src="'+_r(o)+'"]'}function Qd(o){return"script[async]"+o}function vP(o,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var g=o.querySelector('style[data-href~="'+_r(h.href)+'"]');if(g)return l.instance=g,fn(g),g;var _=d({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(o.ownerDocument||o).createElement("style"),fn(g),Xn(g,"style",_),hv(g,h.precedence,o),l.instance=g;case"stylesheet":_=Mu(h.href);var C=o.querySelector(Wd(_));if(C)return l.state.loading|=4,l.instance=C,fn(C),C;g=pP(h),(_=ga.get(_))&&Cw(g,_),C=(o.ownerDocument||o).createElement("link"),fn(C);var M=C;return M._p=new Promise(function(H,Q){M.onload=H,M.onerror=Q}),Xn(C,"link",g),l.state.loading|=4,hv(C,h.precedence,o),l.instance=C;case"script":return C=ku(h.src),(_=o.querySelector(Qd(C)))?(l.instance=_,fn(_),_):(g=h,(_=ga.get(C))&&(g=d({},h),Ow(g,_)),o=o.ownerDocument||o,_=o.createElement("script"),fn(_),Xn(_,"link",g),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&&(g=l.instance,l.state.loading|=4,hv(g,h.precedence,o));return l.instance}function hv(o,l,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=g.length?g[g.length-1]:null,C=_,M=0;M<g.length;M++){var H=g[M];if(H.dataset.precedence===l)C=H;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 mv=null;function gP(o,l,h){if(mv===null){var g=new Map,_=mv=new Map;_.set(h,g)}else _=mv,g=_.get(h),g||(g=new Map,_.set(h,g));if(g.has(o))return g;for(g.set(o,null),h=h.getElementsByTagName(o),_=0;_<h.length;_++){var C=h[_];if(!(C[Cl]||C[_n]||o==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var M=C.getAttribute(l)||"";M=o+M;var H=g.get(M);H?H.push(C):g.set(M,[C])}}return g}function yP(o,l,h){o=o.ownerDocument||o,o.head.insertBefore(h,l==="title"?o.querySelector("head > title"):null)}function HK(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 xP(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function FK(o,l,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var _=Mu(g.href),C=l.querySelector(Wd(_));if(C){l=C._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=pv.bind(o),l.then(o,o)),h.state.loading|=4,h.instance=C,fn(C);return}C=l.ownerDocument||l,g=pP(g),(_=ga.get(_))&&Cw(g,_),C=C.createElement("link"),fn(C);var M=C;M._p=new Promise(function(H,Q){M.onload=H,M.onerror=Q}),Xn(C,"link",g),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=pv.bind(o),l.addEventListener("load",h),l.addEventListener("error",h))}}var Aw=0;function qK(o,l){return o.stylesheets&&o.count===0&&gv(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var g=setTimeout(function(){if(o.stylesheets&&gv(o,o.stylesheets),o.unsuspend){var C=o.unsuspend;o.unsuspend=null,C()}},6e4+l);0<o.imgBytes&&Aw===0&&(Aw=62500*_K());var _=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&gv(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(g),clearTimeout(_)}}:null}function pv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gv(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var vv=null;function gv(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,vv=new Map,l.forEach(KK,o),vv=null,pv.call(o))}function KK(o,l){if(!(l.state.loading&4)){var h=vv.get(o);if(h)var g=h.get(null);else{h=new Map,vv.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),g=M)}g&&h.set(null,g)}_=l.instance,M=_.getAttribute("data-precedence"),C=h.get(M)||g,C===g&&h.set(null,_),h.set(M,_),this.count++,g=pv.bind(this),_.addEventListener("load",g),_.addEventListener("error",g),C?C.parentNode.insertBefore(_,C.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(_,o.firstChild)),l.state.loading|=4}}var Zd={$$typeof:j,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function VK(o,l,h,g,_,C,M,H,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=li(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=li(0),this.hiddenUpdates=li(null),this.identifierPrefix=g,this.onUncaughtError=_,this.onCaughtError=C,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function bP(o,l,h,g,_,C,M,H,Q,ue,me,ve){return o=new VK(o,l,h,M,Q,ue,me,ve,H),l=1,C===!0&&(l|=24),C=Hr(3,null,null,l),o.current=C,C.stateNode=o,l=sb(),l.refCount++,o.pooledCache=l,l.refCount++,C.memoizedState={element:g,isDehydrated:h,cache:l},fb(C),o}function wP(o){return o?(o=uu,o):uu}function SP(o,l,h,g,_,C){_=wP(_),g.context===null?g.context=_:g.pendingContext=_,g=fs(l),g.payload={element:h},C=C===void 0?null:C,C!==null&&(g.callback=C),h=ds(o,g,l),h!==null&&(Tr(h,o,l),Td(h,o,l))}function EP(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){EP(o,l),(o=o.alternate)&&EP(o,l)}function _P(o){if(o.tag===13||o.tag===31){var l=Ml(o,67108864);l!==null&&Tr(l,o,67108864),Nw(o,67108864)}}function jP(o){if(o.tag===13||o.tag===31){var l=Yr();l=Zo(l);var h=Ml(o,l);h!==null&&Tr(h,o,l),Nw(o,l)}}var yv=!0;function YK(o,l,h,g){var _=k.T;k.T=null;var C=F.p;try{F.p=2,Tw(o,l,h,g)}finally{F.p=C,k.T=_}}function GK(o,l,h,g){var _=k.T;k.T=null;var C=F.p;try{F.p=8,Tw(o,l,h,g)}finally{F.p=C,k.T=_}}function Tw(o,l,h,g){if(yv){var _=Pw(g);if(_===null)vw(o,l,g,xv,h),OP(o,g);else if(WK(_,o,l,h,g))g.stopPropagation();else if(OP(o,g),l&4&&-1<XK.indexOf(o)){for(;_!==null;){var C=es(_);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var M=ca(C.pendingLanes);if(M!==0){var H=C;for(H.pendingLanes|=2,H.entangledLanes|=2;M;){var Q=1<<31-Dn(M);H.entanglements[1]|=Q,M&=~Q}hi(C),(yt&6)===0&&(tv=dt()+500,Vd(0))}}break;case 31:case 13:H=Ml(C,2),H!==null&&Tr(H,C,2),rv(),Nw(C,2)}if(C=Pw(g),C===null&&vw(o,l,g,xv,h),C===_)break;_=C}_!==null&&g.stopPropagation()}else vw(o,l,g,null,h)}}function Pw(o){return o=kx(o),Mw(o)}var xv=null;function Mw(o){if(xv=null,o=Jo(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 xv=o,null}function CP(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(En()){case er:return 2;case ii:return 8;case oi:case _l:return 32;case zr:return 268435456;default:return 32}default:return 32}}var kw=!1,Es=null,_s=null,js=null,Jd=new Map,eh=new Map,Cs=[],XK="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 OP(o,l){switch(o){case"focusin":case"focusout":Es=null;break;case"dragenter":case"dragleave":_s=null;break;case"mouseover":case"mouseout":js=null;break;case"pointerover":case"pointerout":Jd.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":eh.delete(l.pointerId)}}function th(o,l,h,g,_,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:h,eventSystemFlags:g,nativeEvent:C,targetContainers:[_]},l!==null&&(l=es(l),l!==null&&_P(l)),o):(o.eventSystemFlags|=g,l=o.targetContainers,_!==null&&l.indexOf(_)===-1&&l.push(_),o)}function WK(o,l,h,g,_){switch(l){case"focusin":return Es=th(Es,o,l,h,g,_),!0;case"dragenter":return _s=th(_s,o,l,h,g,_),!0;case"mouseover":return js=th(js,o,l,h,g,_),!0;case"pointerover":var C=_.pointerId;return Jd.set(C,th(Jd.get(C)||null,o,l,h,g,_)),!0;case"gotpointercapture":return C=_.pointerId,eh.set(C,th(eh.get(C)||null,o,l,h,g,_)),!0}return!1}function AP(o){var l=Jo(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,sp(o.priority,function(){jP(h)});return}}else if(l===31){if(l=c(h),l!==null){o.blockedOn=l,sp(o.priority,function(){jP(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 bv(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 g=new h.constructor(h.type,h);Mx=g,h.target.dispatchEvent(g),Mx=null}else return l=es(h),l!==null&&_P(l),o.blockedOn=h,!1;l.shift()}return!0}function NP(o,l,h){bv(o)&&h.delete(l)}function QK(){kw=!1,Es!==null&&bv(Es)&&(Es=null),_s!==null&&bv(_s)&&(_s=null),js!==null&&bv(js)&&(js=null),Jd.forEach(NP),eh.forEach(NP)}function wv(o,l){o.blockedOn===l&&(o.blockedOn=null,kw||(kw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,QK)))}var Sv=null;function TP(o){Sv!==o&&(Sv=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Sv===o&&(Sv=null);for(var l=0;l<o.length;l+=3){var h=o[l],g=o[l+1],_=o[l+2];if(typeof g!="function"){if(Mw(g||h)===null)continue;break}var C=es(h);C!==null&&(o.splice(l,3),l-=3,Pb(C,{pending:!0,data:_,method:h.method,action:g},g,_))}}))}function Ru(o){function l(Q){return wv(Q,o)}Es!==null&&wv(Es,o),_s!==null&&wv(_s,o),js!==null&&wv(js,o),Jd.forEach(l),eh.forEach(l);for(var h=0;h<Cs.length;h++){var g=Cs[h];g.blockedOn===o&&(g.blockedOn=null)}for(;0<Cs.length&&(h=Cs[0],h.blockedOn===null);)AP(h),h.blockedOn===null&&Cs.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var _=h[g],C=h[g+1],M=_[ar]||null;if(typeof C=="function")M||TP(h);else if(M){var H=null;if(C&&C.hasAttribute("formAction")){if(_=C,M=C[ar]||null)H=M.formAction;else if(Mw(_)!==null)continue}else H=M.action;typeof H=="function"?h[g+1]=H:(h.splice(g,3),g-=3),TP(h)}}}function PP(){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),g||setTimeout(h,20)}function h(){if(!g&&!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 g=!1,_=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),_!==null&&(_(),_=null)}}}function Rw(o){this._internalRoot=o}Ev.prototype.render=Rw.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var h=l.current,g=Yr();SP(h,g,o,l,null,null)},Ev.prototype.unmount=Rw.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;SP(o.current,2,null,o,null,null),rv(),l[Ki]=null}};function Ev(o){this._internalRoot=o}Ev.prototype.unstable_scheduleHydration=function(o){if(o){var l=fd();o={blockedOn:null,target:o,priority:l};for(var h=0;h<Cs.length&&l!==0&&l<Cs[h].priority;h++);Cs.splice(h,0,o),h===0&&AP(o)}};var MP=t.version;if(MP!=="19.2.4")throw Error(r(527,MP,"19.2.4"));F.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=u(l),o=o!==null?m(o):null,o=o===null?null:o.stateNode,o};var ZK={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_v.isDisabled&&_v.supportsFiber)try{Hi=_v.inject(ZK),Kn=_v}catch{}}return rh.createRoot=function(o,l){if(!a(o))throw Error(r(299));var h=!1,g="",_=$T,C=BT,M=UT;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(_=l.onUncaughtError),l.onCaughtError!==void 0&&(C=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError)),l=bP(o,1,!1,null,null,h,g,null,_,C,M,PP),o[Ki]=l.current,pw(o),new Rw(l)},rh.hydrateRoot=function(o,l,h){if(!a(o))throw Error(r(299));var g=!1,_="",C=$T,M=BT,H=UT,Q=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!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&&(H=h.onRecoverableError),h.formState!==void 0&&(Q=h.formState)),l=bP(o,1,!0,l,h??null,g,_,Q,C,M,H,PP),l.context=wP(null),h=l.current,g=Yr(),g=Zo(g),_=fs(g),_.callback=null,ds(h,_,g),h=g,l.current.lanes=h,Dt(l,h),hi(l),o[Ki]=l.current,pw(o),new Ev(l)},rh.version="19.2.4",rh}var FP;function uV(){if(FP)return $w.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(),$w.exports=cV(),$w.exports}var fV=uV();/**
 * 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 qP="popstate";function KP(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function dV(e={}){function t(r,a){var u;let i=(u=a.state)==null?void 0:u.masked,{pathname:s,search:c,hash:f}=i||r.location;return JS("",{pathname:s,search:c,hash:f},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:kh(a)}return mV(t,n,null,e)}function Vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ga(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hV(){return Math.random().toString(36).substring(2,10)}function VP(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"?Kf(t):t,state:n,key:t&&t.key||r||hV(),unstable_mask:a}}function kh({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 Kf(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 mV(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:i=!1}=r,s=a.history,c="POP",f=null,u=m();u==null&&(u=0,s.replaceState({...s.state,idx:u},""));function m(){return(s.state||{idx:null}).idx}function d(){c="POP";let S=m(),E=S==null?null:S-u;u=S,f&&f({action:c,location:w.location,delta:E})}function v(S,E){c="PUSH";let O=KP(S)?S:JS(w.location,S,E);u=m()+1;let j=VP(O,u),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&&f&&f({action:c,location:w.location,delta:1})}function y(S,E){c="REPLACE";let O=KP(S)?S:JS(w.location,S,E);u=m();let j=VP(O,u),A=w.createHref(O.unstable_mask||O);s.replaceState(j,"",A),i&&f&&f({action:c,location:w.location,delta:0})}function b(S){return pV(S)}let w={get action(){return c},get location(){return e(a,s)},listen(S){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(qP,d),f=S,()=>{a.removeEventListener(qP,d),f=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:y,go(S){return s.go(S)}};return w}function pV(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Vt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:kh(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function pz(e,t,n="/"){return vV(e,t,n,!1)}function vV(e,t,n,r){let a=typeof t=="string"?Kf(t):t,i=No(a.pathname||"/",n);if(i==null)return null;let s=vz(e);gV(s);let c=null;for(let f=0;c==null&&f<s.length;++f){let u=yz(i);c=CV(s[f],u,r)}return c}function vz(e,t=[],n=[],r="",a=!1){let i=(s,c,f=a,u)=>{let m={relativePath:u===void 0?s.path||"":u,caseSensitive:s.caseSensitive===!0,childrenIndex:c,route:s};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;Vt(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 d=Ci([r,m.relativePath]),v=n.concat(m);s.children&&s.children.length>0&&(Vt(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),vz(s.children,t,v,d,f)),!(s.path==null&&!s.index)&&t.push({path:d,score:_V(d,s.index),routesMeta:v})};return e.forEach((s,c)=>{var f;if(s.path===""||!((f=s.path)!=null&&f.includes("?")))i(s,c);else for(let u of gz(s.path))i(s,c,!0,u)}),t}function gz(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=gz(r.join("/")),c=[];return c.push(...s.map(f=>f===""?i:[i,f].join("/"))),a&&c.push(...s),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function gV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:jV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var yV=/^:[\w-]+$/,xV=3,bV=2,wV=1,SV=10,EV=-2,YP=e=>e==="*";function _V(e,t){let n=e.split("/"),r=n.length;return n.some(YP)&&(r+=EV),t&&(r+=bV),n.filter(a=>!YP(a)).reduce((a,i)=>a+(yV.test(i)?xV:i===""?wV:SV),r)}function jV(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 CV(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",s=[];for(let c=0;c<r.length;++c){let f=r[c],u=c===r.length-1,m=i==="/"?t:t.slice(i.length)||"/",d=Rh({path:f.relativePath,caseSensitive:f.caseSensitive,end:u},m),v=f.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=Rh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!d)return null;Object.assign(a,d.params),s.push({params:a,pathname:Ci([i,d.pathname]),pathnameBase:PV(Ci([i,d.pathnameBase])),route:v}),d.pathnameBase!=="/"&&(i=Ci([i,d.pathnameBase]))}return s}function Rh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=OV(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((u,{paramName:m,isOptional:d},v)=>{if(m==="*"){let b=c[v]||"";s=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const y=c[v];return d&&!y?u[m]=void 0:u[m]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function OV(e,t=!1,n=!0){Ga(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,f,u,m)=>{if(r.push({paramName:c,isOptional:f!=null}),f){let d=m.charAt(u+s.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 yz(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ga(!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 No(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 AV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function NV(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Kf(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=GP(n.substring(1),"/"):i=GP(n,t)):i=t,{pathname:i,search:MV(r),hash:kV(a)}}function GP(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 TV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function xz(e){let t=TV(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function aj(e,t,n,r=!1){let a;typeof e=="string"?a=Kf(e):(a={...e},Vt(!a.pathname||!a.pathname.includes("?"),Fw("?","pathname","search",a)),Vt(!a.pathname||!a.pathname.includes("#"),Fw("#","pathname","hash",a)),Vt(!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 d=t.length-1;if(!r&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),d-=1;a.pathname=v.join("/")}c=d>=0?t[d]:"/"}let f=NV(a,c),u=s&&s!=="/"&&s.endsWith("/"),m=(i||s===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(u||m)&&(f.pathname+="/"),f}var Ci=e=>e.join("/").replace(/\/\/+/g,"/"),PV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),MV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,RV=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 DV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function IV(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var bz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function wz(e,t){let n=e;if(typeof n!="string"||!AV.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(bz)try{let i=new URL(window.location.href),s=n.startsWith("//")?new URL(i.protocol+n):new URL(n),c=No(s.pathname,t);s.origin===i.origin&&c!=null?n=c+s.search+s.hash:a=!0}catch{Ga(!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 Sz=["POST","PUT","PATCH","DELETE"];new Set(Sz);var LV=["GET",...Sz];new Set(LV);var Vf=x.createContext(null);Vf.displayName="DataRouter";var Gy=x.createContext(null);Gy.displayName="DataRouterState";var zV=x.createContext(!1),Ez=x.createContext({isTransitioning:!1});Ez.displayName="ViewTransition";var $V=x.createContext(new Map);$V.displayName="Fetchers";var BV=x.createContext(null);BV.displayName="Await";var Na=x.createContext(null);Na.displayName="Navigation";var bm=x.createContext(null);bm.displayName="Location";var Ja=x.createContext({outlet:null,matches:[],isDataRoute:!1});Ja.displayName="Route";var ij=x.createContext(null);ij.displayName="RouteError";var _z="REACT_ROUTER_ERROR",UV="REDIRECT",HV="ROUTE_ERROR_RESPONSE";function FV(e){if(e.startsWith(`${_z}:${UV}:{`))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 qV(e){if(e.startsWith(`${_z}:${HV}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new RV(t.status,t.statusText,t.data)}catch{}}function KV(e,{relative:t}={}){Vt(Yf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(Na),{hash:a,pathname:i,search:s}=wm(e,{relative:t}),c=i;return n!=="/"&&(c=i==="/"?n:Ci([n,i])),r.createHref({pathname:c,search:s,hash:a})}function Yf(){return x.useContext(bm)!=null}function ei(){return Vt(Yf(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(bm).location}function VV(e){Vt(Yf(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=ei();return x.useMemo(()=>Rh(e,yz(t)),[t,e])}var jz="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cz(e){x.useContext(Na).static||x.useLayoutEffect(e)}function ul(){let{isDataRoute:e}=x.useContext(Ja);return e?sY():YV()}function YV(){Vt(Yf(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Vf),{basename:t,navigator:n}=x.useContext(Na),{matches:r}=x.useContext(Ja),{pathname:a}=ei(),i=JSON.stringify(xz(r)),s=x.useRef(!1);return Cz(()=>{s.current=!0}),x.useCallback((f,u={})=>{if(Ga(s.current,jz),!s.current)return;if(typeof f=="number"){n.go(f);return}let m=aj(f,JSON.parse(i),a,u.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ci([t,m.pathname])),(u.replace?n.replace:n.push)(m,u.state,u)},[t,n,i,a,e])}var GV=x.createContext(null);function XV(e){let t=x.useContext(Ja).outlet;return x.useMemo(()=>t&&x.createElement(GV.Provider,{value:e},t),[t,e])}function Xy(){let{matches:e}=x.useContext(Ja),t=e[e.length-1];return t?t.params:{}}function wm(e,{relative:t}={}){let{matches:n}=x.useContext(Ja),{pathname:r}=ei(),a=JSON.stringify(xz(n));return x.useMemo(()=>aj(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function WV(e,t){return Oz(e,t)}function Oz(e,t,n){var S;Vt(Yf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=x.useContext(Na),{matches:a}=x.useContext(Ja),i=a[a.length-1],s=i?i.params:{},c=i?i.pathname:"/",f=i?i.pathnameBase:"/",u=i&&i.route;{let E=u&&u.path||"";Nz(c,!u||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=ei(),d;if(t){let E=typeof t=="string"?Kf(t):t;Vt(f==="/"||((S=E.pathname)==null?void 0:S.startsWith(f)),`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 "${f}" but pathname "${E.pathname}" was given in the \`location\` prop.`),d=E}else d=m;let v=d.pathname||"/",y=v;if(f!=="/"){let E=f.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(E.length).join("/")}let b=pz(e,{pathname:y});Ga(u||b!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Ga(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 "${d.pathname}${d.search}${d.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=tY(b&&b.map(E=>Object.assign({},E,{params:Object.assign({},s,E.params),pathname:Ci([f,r.encodeLocation?r.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:Ci([f,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),a,n);return t&&w?x.createElement(bm.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},w):w}function QV(){let e=oY(),t=DV(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 ZV=x.createElement(QV,null),Az=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=qV(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Ja.Provider,{value:this.props.routeContext},x.createElement(ij.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(JV,{error:e},t):t}};Az.contextType=zV;var qw=new WeakMap;function JV({children:e,error:t}){let{basename:n}=x.useContext(Na);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=FV(t.digest);if(r){let a=qw.get(t);if(a)throw a;let i=wz(r.location,n);if(bz&&!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 eY({routeContext:e,match:t,children:n}){let r=x.useContext(Vf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Ja.Provider,{value:e},n)}function tY(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(d=>d.route.id&&(i==null?void 0:i[d.route.id])!==void 0);Vt(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 d=a[m];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=m),d.route.id){let{loaderData:v,errors:y}=r,b=d.route.loader&&!v.hasOwnProperty(d.route.id)&&(!y||y[d.route.id]===void 0);if(d.route.lazy||b){n.isStatic&&(s=!0),c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,u=r&&f?(m,d)=>{var v,y;f(m,{location:r.location,params:((y=(v=r.matches)==null?void 0:v[0])==null?void 0:y.params)??{},unstable_pattern:IV(r.matches),errorInfo:d})}:void 0;return a.reduceRight((m,d,v)=>{let y,b=!1,w=null,S=null;r&&(y=i&&d.route.id?i[d.route.id]:void 0,w=d.route.errorElement||ZV,s&&(c<0&&v===0?(Nz("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):c===v&&(b=!0,S=d.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,v+1)),O=()=>{let j;return y?j=w:b?j=S:d.route.Component?j=x.createElement(d.route.Component,null):d.route.element?j=d.route.element:j=m,x.createElement(eY,{match:d,routeContext:{outlet:m,matches:E,isDataRoute:r!=null},children:j})};return r&&(d.route.ErrorBoundary||d.route.errorElement||v===0)?x.createElement(Az,{location:r.location,revalidation:r.revalidation,component:w,error:y,children:O(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:u}):O()},null)}function oj(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function nY(e){let t=x.useContext(Vf);return Vt(t,oj(e)),t}function rY(e){let t=x.useContext(Gy);return Vt(t,oj(e)),t}function aY(e){let t=x.useContext(Ja);return Vt(t,oj(e)),t}function sj(e){let t=aY(e),n=t.matches[t.matches.length-1];return Vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function iY(){return sj("useRouteId")}function oY(){var r;let e=x.useContext(ij),t=rY("useRouteError"),n=sj("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function sY(){let{router:e}=nY("useNavigate"),t=sj("useNavigate"),n=x.useRef(!1);return Cz(()=>{n.current=!0}),x.useCallback(async(a,i={})=>{Ga(n.current,jz),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var XP={};function Nz(e,t,n){!t&&!XP[e]&&(XP[e]=!0,Ga(!1,n))}x.memo(lY);function lY({routes:e,future:t,state:n,isStatic:r,onError:a}){return Oz(e,void 0,{state:n,isStatic:r,onError:a})}function cY(e){return XV(e.context)}function La(e){Vt(!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 uY({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:s}){Vt(!Yf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=x.useMemo(()=>({basename:c,navigator:a,static:i,unstable_useTransitions:s,future:{}}),[c,a,i,s]);typeof n=="string"&&(n=Kf(n));let{pathname:u="/",search:m="",hash:d="",state:v=null,key:y="default",unstable_mask:b}=n,w=x.useMemo(()=>{let S=No(u,c);return S==null?null:{location:{pathname:S,search:m,hash:d,state:v,key:y,unstable_mask:b},navigationType:r}},[c,u,m,d,v,y,r,b]);return Ga(w!=null,`<Router basename="${c}"> is not able to match the URL "${u}${m}${d}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(Na.Provider,{value:f},x.createElement(bm.Provider,{children:t,value:w}))}function fY({children:e,location:t}){return WV(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}Vt(r.type===La,`[${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>`),Vt(!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 sg="get",lg="application/x-www-form-urlencoded";function Wy(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function dY(e){return Wy(e)&&e.tagName.toLowerCase()==="button"}function hY(e){return Wy(e)&&e.tagName.toLowerCase()==="form"}function mY(e){return Wy(e)&&e.tagName.toLowerCase()==="input"}function pY(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vY(e,t){return e.button===0&&(!t||t==="_self")&&!pY(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 gY(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 Cv=null;function yY(){if(Cv===null)try{new FormData(document.createElement("form"),0),Cv=!1}catch{Cv=!0}return Cv}var xY=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kw(e){return e!=null&&!xY.has(e)?(Ga(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${lg}"`),null):e}function bY(e,t){let n,r,a,i,s;if(hY(e)){let c=e.getAttribute("action");r=c?No(c,t):null,n=e.getAttribute("method")||sg,a=Kw(e.getAttribute("enctype"))||lg,i=new FormData(e)}else if(dY(e)||mY(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 f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?No(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||sg,a=Kw(e.getAttribute("formenctype"))||Kw(c.getAttribute("enctype"))||lg,i=new FormData(c,e),!yY()){let{name:u,type:m,value:d}=e;if(m==="image"){let v=u?`${u}.`:"";i.append(`${v}x`,"0"),i.append(`${v}y`,"0")}else u&&i.append(u,d)}}else{if(Wy(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=sg,r=null,a=lg,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 lj(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wY(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&&No(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function SY(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 EY(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 _Y(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let s=await SY(i,n);return s.links?s.links():[]}return[]}));return AY(r.flat(1).filter(EY).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function WP(e,t,n,r,a,i){let s=(f,u)=>n[u]?f.route.id!==n[u].route.id:!0,c=(f,u)=>{var m;return n[u].pathname!==f.pathname||((m=n[u].route.path)==null?void 0:m.endsWith("*"))&&n[u].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,u)=>s(f,u)||c(f,u)):i==="data"?t.filter((f,u)=>{var d;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(s(f,u)||c(f,u))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function jY(e,t,{includeHydrateFallback:n}={}){return CY(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 CY(e){return[...new Set(e)]}function OY(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function AY(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(OY(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function Tz(){let e=x.useContext(Vf);return lj(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function NY(){let e=x.useContext(Gy);return lj(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cj=x.createContext(void 0);cj.displayName="FrameworkContext";function Pz(){let e=x.useContext(cj);return lj(e,"You must render this element inside a <HydratedRouter> element"),e}function TY(e,t){let n=x.useContext(cj),[r,a]=x.useState(!1),[i,s]=x.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:u,onMouseLeave:m,onTouchStart:d}=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 y=()=>{a(!0)},b=()=>{a(!1),s(!1)};return n?e!=="intent"?[i,v,{}]:[i,v,{onFocus:ah(c,y),onBlur:ah(f,b),onMouseEnter:ah(u,y),onMouseLeave:ah(m,b),onTouchStart:ah(d,y)}]:[!1,v,{}]}function ah(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function PY({page:e,...t}){let{router:n}=Tz(),r=x.useMemo(()=>pz(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(kY,{page:e,matches:r,...t}):null}function MY(e){let{manifest:t,routeModules:n}=Pz(),[r,a]=x.useState([]);return x.useEffect(()=>{let i=!1;return _Y(e,t,n).then(s=>{i||a(s)}),()=>{i=!0}},[e,t,n]),r}function kY({page:e,matches:t,...n}){let r=ei(),{future:a,manifest:i,routeModules:s}=Pz(),{basename:c}=Tz(),{loaderData:f,matches:u}=NY(),m=x.useMemo(()=>WP(e,t,u,i,r,"data"),[e,t,u,i,r]),d=x.useMemo(()=>WP(e,t,u,i,r,"assets"),[e,t,u,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 f&&((A=s[O.route.id])!=null&&A.shouldRevalidate)||j.hasClientLoader?S=!0:w.add(O.route.id))}),w.size===0)return[];let E=wY(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,f,r,i,m,t,e,s]),y=x.useMemo(()=>jY(d,i),[d,i]),b=MY(d);return x.createElement(x.Fragment,null,v.map(w=>x.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),y.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 RY(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var DY=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{DY&&(window.__reactRouterVersion="7.13.1")}catch{}function IY({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=x.useRef();a.current==null&&(a.current=dV({window:r,v5Compat:!0}));let i=a.current,[s,c]=x.useState({action:i.action,location:i.location}),f=x.useCallback(u=>{n===!1?c(u):x.startTransition(()=>c(u))},[n]);return x.useLayoutEffect(()=>i.listen(f),[i,f]),x.createElement(uY,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:i,unstable_useTransitions:n})}var Mz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ra=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:s,unstable_mask:c,state:f,target:u,to:m,preventScrollReset:d,viewTransition:v,unstable_defaultShouldRevalidate:y,...b},w){let{basename:S,navigator:E,unstable_useTransitions:O}=x.useContext(Na),j=typeof m=="string"&&Mz.test(m),A=wz(m,S);m=A.to;let N=KV(m,{relative:a}),T=ei(),P=null;if(c){let V=aj(c,[],T.unstable_mask?T.unstable_mask.pathname:"/",!0);S!=="/"&&(V.pathname=V.pathname==="/"?S:Ci([S,V.pathname])),P=E.createHref(V)}let[R,D,K]=TY(r,b),L=$Y(m,{replace:s,unstable_mask:c,state:f,target:u,preventScrollReset:d,relative:a,viewTransition:v,unstable_defaultShouldRevalidate:y,unstable_useTransitions:O});function I(V){t&&t(V),V.defaultPrevented||L(V)}let G=!(A.isExternal||i),z=x.createElement("a",{...b,...K,href:(G?P:void 0)||A.absoluteURL||N,onClick:G?I:t,ref:RY(w,D),target:u,"data-discover":!j&&n==="render"?"true":void 0});return R&&!j?x.createElement(x.Fragment,null,z,x.createElement(PY,{page:N})):z});ra.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:f,...u},m){let d=wm(s,{relative:u.relative}),v=ei(),y=x.useContext(Gy),{navigator:b,basename:w}=x.useContext(Na),S=y!=null&&KY(d)&&c===!0,E=b.encodeLocation?b.encodeLocation(d).pathname:d.pathname,O=v.pathname,j=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(O=O.toLowerCase(),j=j?j.toLowerCase():null,E=E.toLowerCase()),j&&w&&(j=No(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(ra,{...u,"aria-current":R,className:D,ref:m,style:K,to:s,viewTransition:c},typeof f=="function"?f(P):f)});nE.displayName="NavLink";var LY=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:s=sg,action:c,onSubmit:f,relative:u,preventScrollReset:m,viewTransition:d,unstable_defaultShouldRevalidate:v,...y},b)=>{let{unstable_useTransitions:w}=x.useContext(Na),S=FY(),E=qY(c,{relative:u}),O=s.toLowerCase()==="get"?"get":"post",j=typeof c=="string"&&Mz.test(c),A=N=>{if(f&&f(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:u,preventScrollReset:m,viewTransition:d,unstable_defaultShouldRevalidate:v});w&&n!==!1?x.startTransition(()=>R()):R()};return x.createElement("form",{ref:b,method:O,action:E,onSubmit:r?f:A,...y,"data-discover":!j&&e==="render"?"true":void 0})});LY.displayName="Form";function zY(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function kz(e){let t=x.useContext(Vf);return Vt(t,zY(e)),t}function $Y(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:u}={}){let m=ul(),d=ei(),v=wm(e,{relative:s});return x.useCallback(y=>{if(vY(y,t)){y.preventDefault();let b=n!==void 0?n:kh(d)===kh(v),w=()=>m(e,{replace:b,unstable_mask:r,state:a,preventScrollReset:i,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:f});u?x.startTransition(()=>w()):w()}},[d,m,v,n,r,a,t,e,i,s,c,f,u])}function BY(e){Ga(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=ei(),a=x.useMemo(()=>gY(r.search,n.current?null:t.current),[r.search]),i=ul(),s=x.useCallback((c,f)=>{const u=tE(typeof c=="function"?c(new URLSearchParams(a)):c);n.current=!0,i("?"+u,f)},[i,a]);return[a,s]}var UY=0,HY=()=>`__${String(++UY)}__`;function FY(){let{router:e}=kz("useSubmit"),{basename:t}=x.useContext(Na),n=iY(),r=e.fetch,a=e.navigate;return x.useCallback(async(i,s={})=>{let{action:c,method:f,encType:u,formData:m,body:d}=bY(i,t);if(s.navigate===!1){let v=s.fetcherKey||HY();await r(v,n,s.action||c,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:m,body:d,formMethod:s.method||f,formEncType:s.encType||u,flushSync:s.flushSync})}else await a(s.action||c,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:m,body:d,formMethod:s.method||f,formEncType:s.encType||u,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[r,a,t,n])}function qY(e,{relative:t}={}){let{basename:n}=x.useContext(Na),r=x.useContext(Ja);Vt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...wm(e||".",{relative:t})},s=ei();if(e==null){i.search=s.search;let c=new URLSearchParams(i.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(d=>d).forEach(d=>c.append("index",d));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:Ci([n,i.pathname])),kh(i)}function KY(e,{relative:t}={}){let n=x.useContext(Ez);Vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=kz("useViewTransitionState"),a=wm(e,{relative:t});if(!n.isTransitioning)return!1;let i=No(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=No(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Rh(a.pathname,s)!=null||Rh(a.pathname,i)!=null}var fl=mz();const Rz=Za(fl);var Uc=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(){}},VY={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Bs,nj,nz,YY=(nz=class{constructor(){je(this,Bs,VY);je(this,nj,!1)}setTimeoutProvider(e){be(this,Bs,e)}setTimeout(e,t){return W(this,Bs).setTimeout(e,t)}clearTimeout(e){W(this,Bs).clearTimeout(e)}setInterval(e,t){return W(this,Bs).setInterval(e,t)}clearInterval(e){W(this,Bs).clearInterval(e)}},Bs=new WeakMap,nj=new WeakMap,nz),nc=new YY;function GY(e){setTimeout(e,0)}var bc=typeof window>"u"||"Deno"in globalThis;function ur(){}function XY(e,t){return typeof e=="function"?e(t):e}function rE(e){return typeof e=="number"&&e>=0&&e!==1/0}function Dz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qs(e,t){return typeof e=="function"?e(t):e}function _a(e,t){return typeof e=="function"?e(t):e}function QP(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:s,stale:c}=e;if(s){if(r){if(t.queryHash!==uj(s,t.options))return!1}else if(!Dh(t.queryKey,s))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||i&&!i(t))}function ZP(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(wc(t.options.mutationKey)!==wc(i))return!1}else if(!Dh(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function uj(e,t){return((t==null?void 0:t.queryKeyHashFn)||wc)(e)}function wc(e){return JSON.stringify(e,(t,n)=>aE(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Dh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Dh(e[n],t[n])):!1}var WY=Object.prototype.hasOwnProperty;function fj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=JP(e)&&JP(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,f=r?new Array(c):{};let u=0;for(let m=0;m<c;m++){const d=r?m:s[m],v=e[d],y=t[d];if(v===y){f[d]=v,(r?m<i:WY.call(e,d))&&u++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){f[d]=y;continue}const b=fj(v,y,n+1);f[d]=b,b===v&&u++}return i===c&&u===i?e:f}function Ih(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 JP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function aE(e){if(!eM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!eM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function eM(e){return Object.prototype.toString.call(e)==="[object Object]"}function QY(e){return new Promise(t=>{nc.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 ZY(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function JY(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var dj=Symbol();function Iz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===dj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function hj(e,t){return typeof e=="function"?e(...t):!!e}function eG(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 sc,Us,cf,rz,tG=(rz=class extends Uc{constructor(){super();je(this,sc);je(this,Us);je(this,cf);be(this,cf,t=>{if(!bc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Us)||this.setEventListener(W(this,cf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Us))==null||t.call(this),be(this,Us,void 0))}setEventListener(t){var n;be(this,cf,t),(n=W(this,Us))==null||n.call(this),be(this,Us,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,sc)!==t&&(be(this,sc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,sc)=="boolean"?W(this,sc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sc=new WeakMap,Us=new WeakMap,cf=new WeakMap,rz),mj=new tG;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 nG=GY;function rG(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=nG;const i=c=>{t?e.push(c):a(()=>{n(c)})},s=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||s()}return f},batchCalls:c=>(...f)=>{i(()=>{c(...f)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var nn=rG(),uf,Hs,ff,az,aG=(az=class extends Uc{constructor(){super();je(this,uf,!0);je(this,Hs);je(this,ff);be(this,ff,t=>{if(!bc&&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,Hs)||this.setEventListener(W(this,ff))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Hs))==null||t.call(this),be(this,Hs,void 0))}setEventListener(t){var n;be(this,ff,t),(n=W(this,Hs))==null||n.call(this),be(this,Hs,t(this.setOnline.bind(this)))}setOnline(t){W(this,uf)!==t&&(be(this,uf,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,uf)}},uf=new WeakMap,Hs=new WeakMap,ff=new WeakMap,az),Cg=new aG;function iG(e){return Math.min(1e3*2**e,3e4)}function Lz(e){return(e??"online")==="online"?Cg.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 zz(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},f=()=>{t=!1},u=()=>mj.isFocused()&&(e.networkMode==="always"||Cg.isOnline())&&e.canRun(),m=()=>Lz(e.networkMode)&&e.canRun(),d=w=>{i()||(r==null||r(),a.resolve(w))},v=w=>{i()||(r==null||r(),a.reject(w))},y=()=>new Promise(w=>{var S;r=E=>{(i()||u())&&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(d).catch(E=>{var T;if(i())return;const O=e.retry??(bc?0:3),j=e.retryDelay??iG,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),QY(A).then(()=>u()?void 0:y()).then(()=>{t?v(E):b()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?b():y().then(b),a)}}var lc,iz,$z=(iz=class{constructor(){je(this,lc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rE(this.gcTime)&&be(this,lc,nc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(bc?1/0:300*1e3))}clearGcTimeout(){W(this,lc)&&(nc.clearTimeout(W(this,lc)),be(this,lc,void 0))}},lc=new WeakMap,iz),cc,df,Sa,uc,zn,fm,fc,$a,mo,oz,oG=(oz=class extends $z{constructor(t){super();je(this,$a);je(this,cc);je(this,df);je(this,Sa);je(this,uc);je(this,zn);je(this,fm);je(this,fc);be(this,fc,!1),be(this,fm,t.defaultOptions),this.setOptions(t.options),this.observers=[],be(this,uc,t.client),be(this,Sa,W(this,uc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,be(this,cc,nM(this.options)),this.state=t.state??W(this,cc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,zn))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,fm),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=nM(this.options);n.data!==void 0&&(this.setState(tM(n.data,n.dataUpdatedAt)),be(this,cc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Sa).remove(this)}setData(t,n){const r=iE(this.state.data,t,this.options);return He(this,$a,mo).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,$a,mo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=W(this,zn))==null?void 0:r.promise;return(a=W(this,zn))==null||a.cancel(t),n?n.then(ur).catch(ur):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,cc))}isActive(){return this.observers.some(t=>_a(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Qs(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:!Dz(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,zn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,zn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,Sa).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,zn)&&(W(this,fc)?W(this,zn).cancel({revert:!0}):W(this,zn).cancelRetry()),this.scheduleGc()),W(this,Sa).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,$a,mo).call(this,{type:"invalidate"})}async fetch(t,n){var f,u,m,d,v,y,b,w,S,E,O,j;if(this.state.fetchStatus!=="idle"&&((f=W(this,zn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,zn))return W(this,zn).continueRetry(),W(this,zn).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:()=>(be(this,fc,!0),r.signal)})},i=()=>{const A=Iz(this.options,n),T=(()=>{const P={client:W(this,uc),queryKey:this.queryKey,meta:this.meta};return a(P),P})();return be(this,fc,!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,uc),state:this.state,fetchFn:i};return a(A),A})();(u=this.options.behavior)==null||u.onFetch(c,this),be(this,df,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&He(this,$a,mo).call(this,{type:"fetch",meta:(d=c.fetchOptions)==null?void 0:d.meta}),be(this,zn,zz({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:A=>{A instanceof sE&&A.revert&&this.setState({...W(this,df),fetchStatus:"idle"}),r.abort()},onFail:(A,N)=>{He(this,$a,mo).call(this,{type:"failed",failureCount:A,error:N})},onPause:()=>{He(this,$a,mo).call(this,{type:"pause"})},onContinue:()=>{He(this,$a,mo).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const A=await W(this,zn).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(y=(v=W(this,Sa).config).onSuccess)==null||y.call(v,A,this),(w=(b=W(this,Sa).config).onSettled)==null||w.call(b,A,this.state.error,this),A}catch(A){if(A instanceof sE){if(A.silent)return W(this,zn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw He(this,$a,mo).call(this,{type:"error",error:A}),(E=(S=W(this,Sa).config).onError)==null||E.call(S,A,this),(j=(O=W(this,Sa).config).onSettled)==null||j.call(O,this.state.data,A,this),A}finally{this.scheduleGc()}}},cc=new WeakMap,df=new WeakMap,Sa=new WeakMap,uc=new WeakMap,zn=new WeakMap,fm=new WeakMap,fc=new WeakMap,$a=new WeakSet,mo=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,...Bz(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...tM(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return be(this,df,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),nn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,Sa).notify({query:this,type:"updated",action:t})})},oz);function Bz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tM(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function nM(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 Pr,it,dm,gr,dc,hf,vo,Fs,hm,mf,pf,hc,mc,qs,vf,bt,Sh,lE,cE,uE,fE,dE,hE,mE,Uz,sz,pj=(sz=class extends Uc{constructor(t,n){super();je(this,bt);je(this,Pr);je(this,it);je(this,dm);je(this,gr);je(this,dc);je(this,hf);je(this,vo);je(this,Fs);je(this,hm);je(this,mf);je(this,pf);je(this,hc);je(this,mc);je(this,qs);je(this,vf,new Set);this.options=n,be(this,Pr,t),be(this,Fs,null),be(this,vo,oE()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,it).addObserver(this),rM(W(this,it),this.options)?He(this,bt,Sh).call(this):this.updateResult(),He(this,bt,fE).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pE(W(this,it),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pE(W(this,it),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,bt,dE).call(this),He(this,bt,hE).call(this),W(this,it).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,it);if(this.options=W(this,Pr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _a(this.options.enabled,W(this,it))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,bt,mE).call(this),W(this,it).setOptions(this.options),n._defaulted&&!Ih(this.options,n)&&W(this,Pr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,it),observer:this});const a=this.hasListeners();a&&aM(W(this,it),r,this.options,n)&&He(this,bt,Sh).call(this),this.updateResult(),a&&(W(this,it)!==r||_a(this.options.enabled,W(this,it))!==_a(n.enabled,W(this,it))||Qs(this.options.staleTime,W(this,it))!==Qs(n.staleTime,W(this,it)))&&He(this,bt,lE).call(this);const i=He(this,bt,cE).call(this);a&&(W(this,it)!==r||_a(this.options.enabled,W(this,it))!==_a(n.enabled,W(this,it))||i!==W(this,qs))&&He(this,bt,uE).call(this,i)}getOptimisticResult(t){const n=W(this,Pr).getQueryCache().build(W(this,Pr),t),r=this.createResult(n,t);return lG(this,r)&&(be(this,gr,r),be(this,hf,this.options),be(this,dc,W(this,it).state)),r}getCurrentResult(){return W(this,gr)}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,vo).status==="pending"&&W(this,vo).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){W(this,vf).add(t)}getCurrentQuery(){return W(this,it)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,Pr).defaultQueryOptions(t),r=W(this,Pr).getQueryCache().build(W(this,Pr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return He(this,bt,Sh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,gr)))}createResult(t,n){var D;const r=W(this,it),a=this.options,i=W(this,gr),s=W(this,dc),c=W(this,hf),u=t!==r?t.state:W(this,dm),{state:m}=t;let d={...m},v=!1,y;if(n._optimisticResults){const K=this.hasListeners(),L=!K&&rM(t,n),I=K&&aM(t,r,n,a);(L||I)&&(d={...d,...Bz(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=d;y=d.data;let E=!1;if(n.placeholderData!==void 0&&y===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,pf))==null?void 0:D.state.data,W(this,pf)):n.placeholderData,K!==void 0&&(S="success",y=iE(i==null?void 0:i.data,K,n),v=!0)}if(n.select&&y!==void 0&&!E)if(i&&y===(s==null?void 0:s.data)&&n.select===W(this,hm))y=W(this,mf);else try{be(this,hm,n.select),y=n.select(y),y=iE(i==null?void 0:i.data,y,n),be(this,mf,y),be(this,Fs,null)}catch(K){be(this,Fs,K)}W(this,Fs)&&(b=W(this,Fs),y=W(this,mf),w=Date.now(),S="error");const O=d.fetchStatus==="fetching",j=S==="pending",A=S==="error",N=j&&O,T=y!==void 0,R={status:S,fetchStatus:d.fetchStatus,isPending:j,isSuccess:S==="success",isError:A,isInitialLoading:N,isLoading:N,data:y,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:O,isRefetching:O&&!j,isLoadingError:A&&!T,isPaused:d.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:A&&T,isStale:vj(t,n),refetch:this.refetch,promise:W(this,vo),isEnabled:_a(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const K=R.data!==void 0,L=R.status==="error"&&!K,I=V=>{L?V.reject(R.error):K&&V.resolve(R.data)},G=()=>{const V=be(this,vo,R.promise=oE());I(V)},z=W(this,vo);switch(z.status){case"pending":t.queryHash===r.queryHash&&I(z);break;case"fulfilled":(L||R.data!==z.value)&&G();break;case"rejected":(!L||R.error!==z.reason)&&G();break}}return R}updateResult(){const t=W(this,gr),n=this.createResult(W(this,it),this.options);if(be(this,dc,W(this,it).state),be(this,hf,this.options),W(this,dc).data!==void 0&&be(this,pf,W(this,it)),Ih(n,t))return;be(this,gr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!W(this,vf).size)return!0;const s=new Set(i??W(this,vf));return this.options.throwOnError&&s.add("error"),Object.keys(W(this,gr)).some(c=>{const f=c;return W(this,gr)[f]!==t[f]&&s.has(f)})};He(this,bt,Uz).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,bt,fE).call(this)}},Pr=new WeakMap,it=new WeakMap,dm=new WeakMap,gr=new WeakMap,dc=new WeakMap,hf=new WeakMap,vo=new WeakMap,Fs=new WeakMap,hm=new WeakMap,mf=new WeakMap,pf=new WeakMap,hc=new WeakMap,mc=new WeakMap,qs=new WeakMap,vf=new WeakMap,bt=new WeakSet,Sh=function(t){He(this,bt,mE).call(this);let n=W(this,it).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ur)),n},lE=function(){He(this,bt,dE).call(this);const t=Qs(this.options.staleTime,W(this,it));if(bc||W(this,gr).isStale||!rE(t))return;const r=Dz(W(this,gr).dataUpdatedAt,t)+1;be(this,hc,nc.setTimeout(()=>{W(this,gr).isStale||this.updateResult()},r))},cE=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,it)):this.options.refetchInterval)??!1},uE=function(t){He(this,bt,hE).call(this),be(this,qs,t),!(bc||_a(this.options.enabled,W(this,it))===!1||!rE(W(this,qs))||W(this,qs)===0)&&be(this,mc,nc.setInterval(()=>{(this.options.refetchIntervalInBackground||mj.isFocused())&&He(this,bt,Sh).call(this)},W(this,qs)))},fE=function(){He(this,bt,lE).call(this),He(this,bt,uE).call(this,He(this,bt,cE).call(this))},dE=function(){W(this,hc)&&(nc.clearTimeout(W(this,hc)),be(this,hc,void 0))},hE=function(){W(this,mc)&&(nc.clearInterval(W(this,mc)),be(this,mc,void 0))},mE=function(){const t=W(this,Pr).getQueryCache().build(W(this,Pr),this.options);if(t===W(this,it))return;const n=W(this,it);be(this,it,t),be(this,dm,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Uz=function(t){nn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,gr))}),W(this,Pr).getQueryCache().notify({query:W(this,it),type:"observerResultsUpdated"})})},sz);function sG(e,t){return _a(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function rM(e,t){return sG(e,t)||e.state.data!==void 0&&pE(e,t,t.refetchOnMount)}function pE(e,t,n){if(_a(t.enabled,e)!==!1&&Qs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&vj(e,t)}return!1}function aM(e,t,n,r){return(e!==t||_a(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&vj(e,n)}function vj(e,t){return _a(t.enabled,e)!==!1&&e.isStaleByTime(Qs(t.staleTime,e))}function lG(e,t){return!Ih(e.getCurrentResult(),t)}function iM(e){return{onFetch:(t,n)=>{var m,d,v,y,b;const r=t.options,a=(v=(d=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:d.fetchMore)==null?void 0:v.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],s=((b=t.state.data)==null?void 0:b.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const u=async()=>{let w=!1;const S=j=>{eG(j,()=>t.signal,()=>w=!0)},E=Iz(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 L={client:t.client,queryKey:t.queryKey,pageParam:A,direction:N?"backward":"forward",meta:t.options.meta};return S(L),L})(),R=await E(P),{maxPages:D}=t.options,K=N?JY:ZY;return{pages:K(j.pages,R,D),pageParams:K(j.pageParams,A,D)}};if(a&&i.length){const j=a==="backward",A=j?cG:oM,N={pages:i,pageParams:s},T=A(r,N);c=await O(N,T,j)}else{const j=e??i.length;do{const A=f===0?s[0]??r.initialPageParam:oM(r,c);if(f>0&&A==null)break;c=await O(c,A),f++}while(f<j)}return c};t.options.persister?t.fetchFn=()=>{var w,S;return(S=(w=t.options).persister)==null?void 0:S.call(w,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function oM(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 cG(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 mm,yi,lr,pc,xi,ks,lz,uG=(lz=class extends $z{constructor(t){super();je(this,xi);je(this,mm);je(this,yi);je(this,lr);je(this,pc);be(this,mm,t.client),this.mutationId=t.mutationId,be(this,lr,t.mutationCache),be(this,yi,[]),this.state=t.state||Hz(),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,yi).includes(t)||(W(this,yi).push(t),this.clearGcTimeout(),W(this,lr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){be(this,yi,W(this,yi).filter(n=>n!==t)),this.scheduleGc(),W(this,lr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,yi).length||(this.state.status==="pending"?this.scheduleGc():W(this,lr).remove(this))}continue(){var t;return((t=W(this,pc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,c,f,u,m,d,v,y,b,w,S,E,O,j,A,N,T,P;const n=()=>{He(this,xi,ks).call(this,{type:"continue"})},r={client:W(this,mm),meta:this.options.meta,mutationKey:this.options.mutationKey};be(this,pc,zz({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,D)=>{He(this,xi,ks).call(this,{type:"failed",failureCount:R,error:D})},onPause:()=>{He(this,xi,ks).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,lr).canRun(this)}));const a=this.state.status==="pending",i=!W(this,pc).canStart();try{if(a)n();else{He(this,xi,ks).call(this,{type:"pending",variables:t,isPaused:i}),W(this,lr).config.onMutate&&await W(this,lr).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,xi,ks).call(this,{type:"pending",context:D,variables:t,isPaused:i})}const R=await W(this,pc).start();return await((u=(f=W(this,lr).config).onSuccess)==null?void 0:u.call(f,R,t,this.state.context,this,r)),await((d=(m=this.options).onSuccess)==null?void 0:d.call(m,R,t,this.state.context,r)),await((y=(v=W(this,lr).config).onSettled)==null?void 0:y.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,xi,ks).call(this,{type:"success",data:R}),R}catch(R){try{await((E=(S=W(this,lr).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,lr).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,xi,ks).call(this,{type:"error",error:R}),R}finally{W(this,lr).runNext(this)}}},mm=new WeakMap,yi=new WeakMap,lr=new WeakMap,pc=new WeakMap,xi=new WeakSet,ks=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),nn.batch(()=>{W(this,yi).forEach(r=>{r.onMutationUpdate(t)}),W(this,lr).notify({mutation:this,type:"updated",action:t})})},lz);function Hz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var go,Ba,pm,cz,fG=(cz=class extends Uc{constructor(t={}){super();je(this,go);je(this,Ba);je(this,pm);this.config=t,be(this,go,new Set),be(this,Ba,new Map),be(this,pm,0)}build(t,n,r){const a=new uG({client:t,mutationCache:this,mutationId:++jv(this,pm)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){W(this,go).add(t);const n=Ov(t);if(typeof n=="string"){const r=W(this,Ba).get(n);r?r.push(t):W(this,Ba).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,go).delete(t)){const n=Ov(t);if(typeof n=="string"){const r=W(this,Ba).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,Ba).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ov(t);if(typeof n=="string"){const r=W(this,Ba).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=Ov(t);if(typeof n=="string"){const a=(r=W(this,Ba).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(){nn.batch(()=>{W(this,go).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,go).clear(),W(this,Ba).clear()})}getAll(){return Array.from(W(this,go))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ZP(n,r))}findAll(t={}){return this.getAll().filter(n=>ZP(t,n))}notify(t){nn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return nn.batch(()=>Promise.all(t.map(n=>n.continue().catch(ur))))}},go=new WeakMap,Ba=new WeakMap,pm=new WeakMap,cz);function Ov(e){var t;return(t=e.options.scope)==null?void 0:t.id}var yo,Ks,Mr,xo,Ao,cg,vE,uz,dG=(uz=class extends Uc{constructor(n,r){super();je(this,Ao);je(this,yo);je(this,Ks);je(this,Mr);je(this,xo);be(this,yo,n),this.setOptions(r),this.bindMethods(),He(this,Ao,cg).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,yo).defaultMutationOptions(n),Ih(this.options,r)||W(this,yo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,Mr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&wc(r.mutationKey)!==wc(this.options.mutationKey)?this.reset():((a=W(this,Mr))==null?void 0:a.state.status)==="pending"&&W(this,Mr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,Mr))==null||n.removeObserver(this)}onMutationUpdate(n){He(this,Ao,cg).call(this),He(this,Ao,vE).call(this,n)}getCurrentResult(){return W(this,Ks)}reset(){var n;(n=W(this,Mr))==null||n.removeObserver(this),be(this,Mr,void 0),He(this,Ao,cg).call(this),He(this,Ao,vE).call(this)}mutate(n,r){var a;return be(this,xo,r),(a=W(this,Mr))==null||a.removeObserver(this),be(this,Mr,W(this,yo).getMutationCache().build(W(this,yo),this.options)),W(this,Mr).addObserver(this),W(this,Mr).execute(n)}},yo=new WeakMap,Ks=new WeakMap,Mr=new WeakMap,xo=new WeakMap,Ao=new WeakSet,cg=function(){var r;const n=((r=W(this,Mr))==null?void 0:r.state)??Hz();be(this,Ks,{...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){nn.batch(()=>{var r,a,i,s,c,f,u,m;if(W(this,xo)&&this.hasListeners()){const d=W(this,Ks).variables,v=W(this,Ks).context,y={client:W(this,yo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=W(this,xo)).onSuccess)==null||a.call(r,n.data,d,v,y)}catch(b){Promise.reject(b)}try{(s=(i=W(this,xo)).onSettled)==null||s.call(i,n.data,null,d,v,y)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=W(this,xo)).onError)==null||f.call(c,n.error,d,v,y)}catch(b){Promise.reject(b)}try{(m=(u=W(this,xo)).onSettled)==null||m.call(u,void 0,n.error,d,v,y)}catch(b){Promise.reject(b)}}}this.listeners.forEach(d=>{d(W(this,Ks))})})},uz);function sM(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function hG(e,t,n){const r=e.slice(0);return r[t]=n,r}var gf,Gr,yf,xf,Ea,Vs,vm,gm,ym,xm,Jn,gE,yE,xE,bE,wE,fz,mG=(fz=class extends Uc{constructor(t,n,r){super();je(this,Jn);je(this,gf);je(this,Gr);je(this,yf);je(this,xf);je(this,Ea);je(this,Vs);je(this,vm);je(this,gm);je(this,ym);je(this,xm,[]);be(this,gf,t),be(this,xf,r),be(this,yf,[]),be(this,Ea,[]),be(this,Gr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,Ea).forEach(t=>{t.subscribe(n=>{He(this,Jn,bE).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,Ea).forEach(t=>{t.destroy()})}setQueries(t,n){be(this,yf,t),be(this,xf,n),nn.batch(()=>{const r=W(this,Ea),a=He(this,Jn,xE).call(this,W(this,yf));a.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=a.map(d=>d.observer),s=i.map(d=>d.getCurrentResult()),c=r.length!==i.length,f=i.some((d,v)=>d!==r[v]),u=c||f,m=u?!0:s.some((d,v)=>{const y=W(this,Gr)[v];return!y||!Ih(d,y)});!u&&!m||(u&&(be(this,xm,a),be(this,Ea,i)),be(this,Gr,s),this.hasListeners()&&(u&&(sM(r,i).forEach(d=>{d.destroy()}),sM(i,r).forEach(d=>{d.subscribe(v=>{He(this,Jn,bE).call(this,d,v)})})),He(this,Jn,wE).call(this)))})}getCurrentResult(){return W(this,Gr)}getQueries(){return W(this,Ea).map(t=>t.getCurrentQuery())}getObservers(){return W(this,Ea)}getOptimisticResult(t,n){const r=He(this,Jn,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,Jn,yE).call(this,s??a,n,i),()=>He(this,Jn,gE).call(this,a,r)]}},gf=new WeakMap,Gr=new WeakMap,yf=new WeakMap,xf=new WeakMap,Ea=new WeakMap,Vs=new WeakMap,vm=new WeakMap,gm=new WeakMap,ym=new WeakMap,xm=new WeakMap,Jn=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,ym),i=r!==void 0&&a!==void 0&&(a.length!==r.length||r.some((s,c)=>s!==a[c]));return(!W(this,Vs)||W(this,Gr)!==W(this,gm)||i||n!==W(this,vm))&&(be(this,vm,n),be(this,gm,W(this,Gr)),r!==void 0&&be(this,ym,r),be(this,Vs,fj(W(this,Vs),n(t)))),W(this,Vs)}return t},xE=function(t){const n=new Map;W(this,Ea).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 f;const i=W(this,gf).defaultQueryOptions(a),c=((f=n.get(i.queryHash))==null?void 0:f.shift())??new pj(W(this,gf),i);r.push({defaultedQueryOptions:i,observer:c})}),r},bE=function(t,n){const r=W(this,Ea).indexOf(t);r!==-1&&(be(this,Gr,hG(W(this,Gr),r,n)),He(this,Jn,wE).call(this))},wE=function(){var t;if(this.hasListeners()){const n=W(this,Vs),r=He(this,Jn,gE).call(this,W(this,Gr),W(this,xm)),a=He(this,Jn,yE).call(this,r,(t=W(this,xf))==null?void 0:t.combine);n!==a&&nn.batch(()=>{this.listeners.forEach(i=>{i(W(this,Gr))})})}},fz),bi,dz,pG=(dz=class extends Uc{constructor(t={}){super();je(this,bi);this.config=t,be(this,bi,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??uj(a,n);let s=this.get(i);return s||(s=new oG({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(s)),s}add(t){W(this,bi).has(t.queryHash)||(W(this,bi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,bi).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,bi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){nn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,bi).get(t)}getAll(){return[...W(this,bi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>QP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>QP(t,r)):n}notify(t){nn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){nn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){nn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},bi=new WeakMap,dz),Jt,Ys,Gs,bf,wf,Xs,Sf,Ef,hz,vG=(hz=class{constructor(e={}){je(this,Jt);je(this,Ys);je(this,Gs);je(this,bf);je(this,wf);je(this,Xs);je(this,Sf);je(this,Ef);be(this,Jt,e.queryCache||new pG),be(this,Ys,e.mutationCache||new fG),be(this,Gs,e.defaultOptions||{}),be(this,bf,new Map),be(this,wf,new Map),be(this,Xs,0)}mount(){jv(this,Xs)._++,W(this,Xs)===1&&(be(this,Sf,mj.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Jt).onFocus())})),be(this,Ef,Cg.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Jt).onOnline())})))}unmount(){var e,t;jv(this,Xs)._--,W(this,Xs)===0&&((e=W(this,Sf))==null||e.call(this),be(this,Sf,void 0),(t=W(this,Ef))==null||t.call(this),be(this,Ef,void 0))}isFetching(e){return W(this,Jt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Ys).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,Jt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,Jt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Qs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,Jt).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,Jt).get(r.queryHash),i=a==null?void 0:a.state.data,s=XY(t,i);if(s!==void 0)return W(this,Jt).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return nn.batch(()=>W(this,Jt).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,Jt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,Jt);nn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,Jt);return nn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=nn.batch(()=>W(this,Jt).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(ur).catch(ur)}invalidateQueries(e,t={}){return nn.batch(()=>(W(this,Jt).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=nn.batch(()=>W(this,Jt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(ur)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(ur)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,Jt).build(this,t);return n.isStaleByTime(Qs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ur).catch(ur)}fetchInfiniteQuery(e){return e.behavior=iM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ur).catch(ur)}ensureInfiniteQueryData(e){return e.behavior=iM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Cg.isOnline()?W(this,Ys).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Jt)}getMutationCache(){return W(this,Ys)}getDefaultOptions(){return W(this,Gs)}setDefaultOptions(e){be(this,Gs,e)}setQueryDefaults(e,t){W(this,bf).set(wc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,bf).values()],n={};return t.forEach(r=>{Dh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,wf).set(wc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,wf).values()],n={};return t.forEach(r=>{Dh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Gs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uj(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===dj&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,Jt).clear(),W(this,Ys).clear()}},Jt=new WeakMap,Ys=new WeakMap,Gs=new WeakMap,bf=new WeakMap,wf=new WeakMap,Xs=new WeakMap,Sf=new WeakMap,Ef=new WeakMap,hz),Fz=x.createContext(void 0),vt=e=>{const t=x.useContext(Fz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gG=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(Fz.Provider,{value:e,children:t})),qz=x.createContext(!1),Kz=()=>x.useContext(qz);qz.Provider;function yG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xG=x.createContext(yG()),Vz=()=>x.useContext(xG),Yz=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?hj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Gz=e=>{x.useEffect(()=>{e.clearReset()},[e])},Xz=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||hj(n,[e.error,r])),Wz=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))}},bG=(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 wG({queries:e,...t},n){const r=vt(),a=Kz(),i=Vz(),s=x.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=a?"isRestoring":"optimistic",S}),[e,r,a]);s.forEach(w=>{Wz(w);const S=r.getQueryCache().get(w.queryHash);Yz(w,i,S)}),Gz(i);const[c]=x.useState(()=>new mG(r,s,t)),[f,u,m]=c.getOptimisticResult(s,t.combine),d=!a&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(w=>d?c.subscribe(nn.batchCalls(w)):ur,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);const y=f.some((w,S)=>SE(s[S],w))?f.flatMap((w,S)=>{const E=s[S];if(E&&SE(E,w)){const O=new pj(r,E);return EE(E,O,i)}return[]}):[];if(y.length>0)throw Promise.all(y);const b=f.find((w,S)=>{const E=s[S];return E&&Xz({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 u(m())}function SG(e,t,n){var v,y,b,w;const r=Kz(),a=Vz(),i=vt(),s=i.defaultQueryOptions(e);(y=(v=i.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||y.call(v,s);const c=i.getQueryCache().get(s.queryHash);s._optimisticResults=r?"isRestoring":"optimistic",Wz(s),Yz(s,a,c),Gz(a);const f=!i.getQueryCache().get(s.queryHash),[u]=x.useState(()=>new t(i,s)),m=u.getOptimisticResult(s),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(S=>{const E=d?u.subscribe(nn.batchCalls(S)):ur;return u.updateResult(),E},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setOptions(s)},[s,u]),SE(s,m))throw EE(s,u,a);if(Xz({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&&!bc&&bG(m,r)){const S=f?EE(s,u,a):c==null?void 0:c.promise;S==null||S.catch(ur).finally(()=>{u.updateResult()})}return s.notifyOnChangeProps?m:u.trackResult(m)}function xn(e,t){return SG(e,pj)}function At(e,t){const n=vt(),[r]=x.useState(()=>new dG(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const a=x.useSyncExternalStore(x.useCallback(s=>r.subscribe(nn.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=x.useCallback((s,c)=>{r.mutate(s,c).catch(ur)},[r]);if(a.error&&hj(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}var EG=(e,t,n,r,a,i,s,c)=>{let f=document.documentElement,u=["light","dark"];function m(y){(Array.isArray(e)?e:[e]).forEach(b=>{let w=b==="class",S=w&&i?a.map(E=>i[E]||E):a;w?(f.classList.remove(...S),f.classList.add(i&&i[y]?i[y]:y)):f.setAttribute(b,y)}),d(y)}function d(y){c&&u.includes(y)&&(f.style.colorScheme=y)}function v(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let y=localStorage.getItem(t)||n,b=s&&y==="system"?v():y;m(b)}catch{}},lM=["light","dark"],Qz="(prefers-color-scheme: dark)",_G=typeof window>"u",gj=x.createContext(void 0),jG={setTheme:e=>{},themes:[]},yj=()=>{var e;return(e=x.useContext(gj))!=null?e:jG},CG=e=>x.useContext(gj)?x.createElement(x.Fragment,null,e.children):x.createElement(AG,{...e}),OG=["light","dark"],AG=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:a="theme",themes:i=OG,defaultTheme:s=n?"system":"light",attribute:c="data-theme",value:f,children:u,nonce:m,scriptProps:d})=>{let[v,y]=x.useState(()=>TG(a,s)),[b,w]=x.useState(()=>v==="system"?Vw():v),S=f?Object.values(f):i,E=x.useCallback(N=>{let T=N;if(!T)return;N==="system"&&n&&(T=Vw());let P=f?f[T]:T,R=t?PG(m):null,D=document.documentElement,K=L=>{L==="class"?(D.classList.remove(...S),P&&D.classList.add(P)):L.startsWith("data-")&&(P?D.setAttribute(L,P):D.removeAttribute(L))};if(Array.isArray(c)?c.forEach(K):K(c),r){let L=lM.includes(s)?s:null,I=lM.includes(T)?T:L;D.style.colorScheme=I}R==null||R()},[m]),O=x.useCallback(N=>{let T=typeof N=="function"?N(v):N;y(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(Qz);return N.addListener(j),j(N),()=>N.removeListener(j)},[j]),x.useEffect(()=>{let N=T=>{T.key===a&&(T.newValue?y(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(gj.Provider,{value:A},x.createElement(NG,{forcedTheme:e,storageKey:a,attribute:c,enableSystem:n,enableColorScheme:r,defaultTheme:s,value:f,themes:i,nonce:m,scriptProps:d}),u)},NG=x.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:s,themes:c,nonce:f,scriptProps:u})=>{let m=JSON.stringify([n,t,i,e,c,s,r,a]).slice(1,-1);return x.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${EG.toString()})(${m})`}})}),TG=(e,t)=>{if(_G)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},PG=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(Qz)),e.matches?"dark":"light");function cM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function To(...e){return t=>{let n=!1;const r=e.map(a=>{const i=cM(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():cM(e[a],null)}}}}function rt(...e){return x.useCallback(To(...e),e)}function Sc(e){const t=MG(e),n=x.forwardRef((r,a)=>{const{children:i,...s}=r,c=x.Children.toArray(i),f=c.find(RG);if(f){const u=f.props.children,m=c.map(d=>d===f?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...s,ref:a,children:x.isValidElement(u)?x.cloneElement(u,void 0,m):null})}return p.jsx(t,{...s,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var xj=Sc("Slot");function MG(e){const t=x.forwardRef((n,r)=>{const{children:a,...i}=n;if(x.isValidElement(a)){const s=IG(a),c=DG(i,a.props);return a.type!==x.Fragment&&(c.ref=r?To(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 Zz=Symbol("radix.slottable");function kG(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Zz,t}function RG(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zz}function DG(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 f=i(...c);return a(...c),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function IG(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 LG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=LG.reduce((e,t)=>{const n=Sc(`Primitive.${t}`),r=x.forwardRef((a,i)=>{const{asChild:s,...c}=a,f=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(f,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Jz(e,t){e&&fl.flushSync(()=>e.dispatchEvent(t))}var e4=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"}),zG="VisuallyHidden",t4=x.forwardRef((e,t)=>p.jsx(Ie.span,{...e,ref:t,style:{...e4,...e.style}}));t4.displayName=zG;var $G=t4;function BG(e,t){const n=x.createContext(t),r=i=>{const{children:s,...c}=i,f=x.useMemo(()=>c,Object.values(c));return p.jsx(n.Provider,{value:f,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 ti(e,t=[]){let n=[];function r(i,s){const c=x.createContext(s),f=n.length;n=[...n,s];const u=d=>{var E;const{scope:v,children:y,...b}=d,w=((E=v==null?void 0:v[e])==null?void 0:E[f])||c,S=x.useMemo(()=>b,Object.values(b));return p.jsx(w.Provider,{value:S,children:y})};u.displayName=i+"Provider";function m(d,v){var w;const y=((w=v==null?void 0:v[e])==null?void 0:w[f])||c,b=x.useContext(y);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,m]}const a=()=>{const i=n.map(s=>x.createContext(s));return function(c){const f=(c==null?void 0:c[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return a.scopeName=e,[r,UG(a,...t)]}function UG(...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:f,scopeName:u})=>{const d=f(i)[`__scope${u}`];return{...c,...d}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function bj(e){const t=e+"CollectionProvider",[n,r]=ti(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=w=>{const{scope:S,children:E}=w,O=xe.useRef(null),j=xe.useRef(new Map).current;return p.jsx(a,{scope:S,itemMap:j,collectionRef:O,children:E})};s.displayName=t;const c=e+"CollectionSlot",f=Sc(c),u=xe.forwardRef((w,S)=>{const{scope:E,children:O}=w,j=i(c,E),A=rt(S,j.collectionRef);return p.jsx(f,{ref:A,children:O})});u.displayName=c;const m=e+"CollectionItemSlot",d="data-radix-collection-item",v=Sc(m),y=xe.forwardRef((w,S)=>{const{scope:E,children:O,...j}=w,A=xe.useRef(null),N=rt(S,A),T=i(m,E);return xe.useEffect(()=>(T.itemMap.set(A,{ref:A,...j}),()=>void T.itemMap.delete(A))),p.jsx(v,{[d]:"",ref:N,children:O})});y.displayName=m;function b(w){const S=i(e+"CollectionConsumer",w);return xe.useCallback(()=>{const O=S.collectionRef.current;if(!O)return[];const j=Array.from(O.querySelectorAll(`[${d}]`));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:u,ItemSlot:y},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 Hn=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},HG=rj[" useInsertionEffect ".trim().toString()]||Hn;function tl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=FG({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:a;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const d=m.current;d!==c&&console.warn(`${r} is changing from ${d?"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 u=x.useCallback(m=>{var d;if(c){const v=qG(m)?m(e):m;v!==e&&((d=s.current)==null||d.call(s,v))}else i(m)},[c,e,i,s]);return[f,u]}function FG({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),i=x.useRef(t);return HG(()=>{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 qG(e){return typeof e=="function"}function KG(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var hr=e=>{const{present:t,children:n}=e,r=VG(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=rt(r.ref,YG(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:i}):null};hr.displayName="Presence";function VG(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),i=x.useRef("none"),s=e?"mounted":"unmounted",[c,f]=KG(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=Av(r.current);i.current=c==="mounted"?u:"none"},[c]),Hn(()=>{const u=r.current,m=a.current;if(m!==e){const v=i.current,y=Av(u);e?f("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?f("UNMOUNT"):f(m&&v!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),Hn(()=>{if(t){let u;const m=t.ownerDocument.defaultView??window,d=y=>{const w=Av(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(f("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},v=y=>{y.target===t&&(i.current=Av(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{m.clearTimeout(u),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Av(e){return(e==null?void 0:e.animationName)||"none"}function YG(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 GG=rj[" useId ".trim().toString()]||(()=>{}),XG=0;function Un(e){const[t,n]=x.useState(GG());return Hn(()=>{n(r=>r??String(XG++))},[e]),e||(t?`radix-${t}`:"")}var Qy="Collapsible",[WG]=ti(Qy),[QG,wj]=WG(Qy),n4=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:s,...c}=e,[f,u]=tl({prop:r,defaultProp:a??!1,onChange:s,caller:Qy});return p.jsx(QG,{scope:n,disabled:i,contentId:Un(),open:f,onOpenToggle:x.useCallback(()=>u(m=>!m),[u]),children:p.jsx(Ie.div,{"data-state":Ej(f),"data-disabled":i?"":void 0,...c,ref:t})})});n4.displayName=Qy;var r4="CollapsibleTrigger",a4=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=wj(r4,n);return p.jsx(Ie.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":Ej(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:_e(e.onClick,a.onOpenToggle)})});a4.displayName=r4;var Sj="CollapsibleContent",i4=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=wj(Sj,e.__scopeCollapsible);return p.jsx(hr,{present:n||a.open,children:({present:i})=>p.jsx(ZG,{...r,ref:t,present:i})})});i4.displayName=Sj;var ZG=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,s=wj(Sj,n),[c,f]=x.useState(r),u=x.useRef(null),m=rt(t,u),d=x.useRef(0),v=d.current,y=x.useRef(0),b=y.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)},[]),Hn(()=>{const O=u.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();d.current=j.height,y.current=j.width,S.current||(O.style.transitionDuration=E.current.transitionDuration,O.style.animationName=E.current.animationName),f(r)}},[s.open,r]),p.jsx(Ie.div,{"data-state":Ej(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 Ej(e){return e?"open":"closed"}var JG=n4,eX=x.createContext(void 0);function Sm(e){const t=x.useContext(eX);return e||t||"ltr"}function Zn(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 tX(e,t=globalThis==null?void 0:globalThis.document){const n=Zn(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 nX="DismissableLayer",_E="dismissableLayer.update",rX="dismissableLayer.pointerDownOutside",aX="dismissableLayer.focusOutside",uM,o4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Em=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...f}=e,u=x.useContext(o4),[m,d]=x.useState(null),v=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=x.useState({}),b=rt(t,P=>d(P)),w=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(S),O=m?w.indexOf(m):-1,j=u.layersWithOutsidePointerEventsDisabled.size>0,A=O>=E,N=sX(P=>{const R=P.target,D=[...u.branches].some(K=>K.contains(R));!A||D||(a==null||a(P),s==null||s(P),P.defaultPrevented||c==null||c())},v),T=lX(P=>{const R=P.target;[...u.branches].some(K=>K.contains(R))||(i==null||i(P),s==null||s(P),P.defaultPrevented||c==null||c())},v);return tX(P=>{O===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},v),x.useEffect(()=>{if(m)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(uM=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(m)),u.layers.add(m),fM(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=uM)}},[m,v,n,u]),x.useEffect(()=>()=>{m&&(u.layers.delete(m),u.layersWithOutsidePointerEventsDisabled.delete(m),fM())},[m,u]),x.useEffect(()=>{const P=()=>y({});return document.addEventListener(_E,P),()=>document.removeEventListener(_E,P)},[]),p.jsx(Ie.div,{...f,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)})});Em.displayName=nX;var iX="DismissableLayerBranch",oX=x.forwardRef((e,t)=>{const n=x.useContext(o4),r=x.useRef(null),a=rt(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})});oX.displayName=iX;function sX(e,t=globalThis==null?void 0:globalThis.document){const n=Zn(e),r=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let f=function(){s4(rX,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}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 lX(e,t=globalThis==null?void 0:globalThis.document){const n=Zn(e),r=x.useRef(!1);return x.useEffect(()=>{const a=i=>{i.target&&!r.current&&s4(aX,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 fM(){const e=new CustomEvent(_E);document.dispatchEvent(e)}function s4(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?Jz(a,i):a.dispatchEvent(i)}var Yw="focusScope.autoFocusOnMount",Gw="focusScope.autoFocusOnUnmount",dM={bubbles:!1,cancelable:!0},cX="FocusScope",Zy=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=e,[c,f]=x.useState(null),u=Zn(a),m=Zn(i),d=x.useRef(null),v=rt(t,w=>f(w)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(j){if(y.paused||!c)return;const A=j.target;c.contains(A)?d.current=A:Rs(d.current,{select:!0})},S=function(j){if(y.paused||!c)return;const A=j.relatedTarget;A!==null&&(c.contains(A)||Rs(d.current,{select:!0}))},E=function(j){if(document.activeElement===document.body)for(const N of j)N.removedNodes.length>0&&Rs(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,y.paused]),x.useEffect(()=>{if(c){mM.add(y);const w=document.activeElement;if(!c.contains(w)){const E=new CustomEvent(Yw,dM);c.addEventListener(Yw,u),c.dispatchEvent(E),E.defaultPrevented||(uX(pX(l4(c)),{select:!0}),document.activeElement===w&&Rs(c))}return()=>{c.removeEventListener(Yw,u),setTimeout(()=>{const E=new CustomEvent(Gw,dM);c.addEventListener(Gw,m),c.dispatchEvent(E),E.defaultPrevented||Rs(w??document.body,{select:!0}),c.removeEventListener(Gw,m),mM.remove(y)},0)}}},[c,u,m,y]);const b=x.useCallback(w=>{if(!n&&!r||y.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]=fX(O);j&&A?!w.shiftKey&&E===A?(w.preventDefault(),n&&Rs(j,{select:!0})):w.shiftKey&&E===j&&(w.preventDefault(),n&&Rs(A,{select:!0})):E===O&&w.preventDefault()}},[n,r,y.paused]);return p.jsx(Ie.div,{tabIndex:-1,...s,ref:v,onKeyDown:b})});Zy.displayName=cX;function uX(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Rs(r,{select:t}),document.activeElement!==n)return}function fX(e){const t=l4(e),n=hM(t,e),r=hM(t.reverse(),e);return[n,r]}function l4(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 hM(e,t){for(const n of e)if(!dX(n,{upTo:t}))return n}function dX(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 hX(e){return e instanceof HTMLInputElement&&"select"in e}function Rs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hX(e)&&t&&e.select()}}var mM=mX();function mX(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=pM(e,t),e.unshift(t)},remove(t){var n;e=pM(e,t),(n=e[0])==null||n.resume()}}}function pM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pX(e){return e.filter(t=>t.tagName!=="A")}var vX="Portal",_m=x.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[a,i]=x.useState(!1);Hn(()=>i(!0),[]);const s=n||a&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?Rz.createPortal(p.jsx(Ie.div,{...r,ref:t}),s):null});_m.displayName=vX;var Xw=0;function _j(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vM()),document.body.insertAdjacentElement("beforeend",e[1]??vM()),Xw++,()=>{Xw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xw--}},[])}function vM(){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 Si=function(){return Si=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},Si.apply(this,arguments)};function c4(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 gX(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 ug="right-scroll-bar-position",fg="width-before-scroll-bar",yX="with-scroll-bars-hidden",xX="--removed-body-scroll-bar-size";function Ww(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function bX(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 wX=typeof window<"u"?x.useLayoutEffect:x.useEffect,gM=new WeakMap;function SX(e,t){var n=bX(null,function(r){return e.forEach(function(a){return Ww(a,r)})});return wX(function(){var r=gM.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)})}gM.set(n,e)},[e]),n}function EX(e){return e}function _X(e,t){t===void 0&&(t=EX);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 f=function(){var m=s;s=[],m.forEach(i)},u=function(){return Promise.resolve().then(f)};u(),n={push:function(m){s.push(m),u()},filter:function(m){return s=s.filter(m),n}}}};return a}function jX(e){e===void 0&&(e={});var t=_X(null);return t.options=Si({async:!0,ssr:!1},e),t}var u4=function(e){var t=e.sideCar,n=c4(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,Si({},n))};u4.isSideCarExport=!0;function CX(e,t){return e.useMedium(t),u4}var f4=jX(),Qw=function(){},Jy=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,f=e.className,u=e.removeScrollBar,m=e.enabled,d=e.shards,v=e.sideCar,y=e.noRelative,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,E=e.as,O=E===void 0?"div":E,j=e.gapMode,A=c4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=v,T=SX([n,t]),P=Si(Si({},A),a);return x.createElement(x.Fragment,null,m&&x.createElement(N,{sideCar:f4,removeScrollBar:u,shards:d,noRelative:y,noIsolation:b,inert:w,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:j}),s?x.cloneElement(x.Children.only(c),Si(Si({},P),{ref:T})):x.createElement(O,Si({},P,{className:f,ref:T}),c))});Jy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jy.classNames={fullWidth:fg,zeroRight:ug};var OX=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AX(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=OX();return t&&e.setAttribute("nonce",t),e}function NX(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function TX(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PX=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AX())&&(NX(t,n),TX(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},MX=function(){var e=PX();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},d4=function(){var e=MX(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},kX={left:0,top:0,right:0,gap:0},Zw=function(e){return parseInt(e||"",10)||0},RX=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)]},DX=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kX;var t=RX(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])}},IX=d4(),nf="data-scroll-locked",LX=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(yX,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(c,"px ").concat(r,`;
  }
  body[`).concat(nf,`] {
    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(ug,` {
    right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(fg,` {
    margin-right: `).concat(c,"px ").concat(r,`;
  }
  
  .`).concat(ug," .").concat(ug,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(fg," .").concat(fg,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(nf,`] {
    `).concat(xX,": ").concat(c,`px;
  }
`)},yM=function(){var e=parseInt(document.body.getAttribute(nf)||"0",10);return isFinite(e)?e:0},zX=function(){x.useEffect(function(){return document.body.setAttribute(nf,(yM()+1).toString()),function(){var e=yM()-1;e<=0?document.body.removeAttribute(nf):document.body.setAttribute(nf,e.toString())}},[])},$X=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;zX();var i=x.useMemo(function(){return DX(a)},[a]);return x.createElement(IX,{styles:LX(i,!t,a,n?"":"!important")})},jE=!1;if(typeof window<"u")try{var Nv=Object.defineProperty({},"passive",{get:function(){return jE=!0,!0}});window.addEventListener("test",Nv,Nv),window.removeEventListener("test",Nv,Nv)}catch{jE=!1}var Du=jE?{passive:!1}:!1,BX=function(e){return e.tagName==="TEXTAREA"},h4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!BX(e)&&n[t]==="visible")},UX=function(e){return h4(e,"overflowY")},HX=function(e){return h4(e,"overflowX")},xM=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=m4(e,r);if(a){var i=p4(e,r),s=i[1],c=i[2];if(s>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},FX=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},qX=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},m4=function(e,t){return e==="v"?UX(t):HX(t)},p4=function(e,t){return e==="v"?FX(t):qX(t)},KX=function(e,t){return e==="h"&&t==="rtl"?-1:1},VX=function(e,t,n,r,a){var i=KX(e,window.getComputedStyle(t).direction),s=i*r,c=n.target,f=t.contains(c),u=!1,m=s>0,d=0,v=0;do{if(!c)break;var y=p4(e,c),b=y[0],w=y[1],S=y[2],E=w-S-i*b;(b||E)&&m4(e,c)&&(d+=E,v+=b);var O=c.parentNode;c=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(m&&Math.abs(d)<1||!m&&Math.abs(v)<1)&&(u=!0),u},Tv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bM=function(e){return[e.deltaX,e.deltaY]},wM=function(e){return e&&"current"in e?e.current:e},YX=function(e,t){return e[0]===t[0]&&e[1]===t[1]},GX=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},XX=0,Iu=[];function WX(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),a=x.useState(XX++)[0],i=x.useState(d4)[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=gX([e.lockRef.current],(e.shards||[]).map(wM),!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=Tv(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 L=xM(P,T);if(!L)return!0;if(L?N=P:(N=P==="v"?"h":"v",L=xM(P,T)),!L)return!1;if(!r.current&&"changedTouches"in w&&(j||A)&&(r.current=N),!N)return!0;var I=r.current||N;return VX(I,S,w,I==="h"?j:A)},[]),f=x.useCallback(function(w){var S=w;if(!(!Iu.length||Iu[Iu.length-1]!==i)){var E="deltaY"in S?bM(S):Tv(S),O=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&YX(N.delta,E)})[0];if(O&&O.should){S.cancelable&&S.preventDefault();return}if(!O){var j=(s.current.shards||[]).map(wM).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()}}},[]),u=x.useCallback(function(w,S,E,O){var j={name:w,delta:S,target:E,should:O,shadowParent:QX(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=Tv(w),r.current=void 0},[]),d=x.useCallback(function(w){u(w.type,bM(w),w.target,c(w,e.lockRef.current))},[]),v=x.useCallback(function(w){u(w.type,Tv(w),w.target,c(w,e.lockRef.current))},[]);x.useEffect(function(){return Iu.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Du),document.addEventListener("touchmove",f,Du),document.addEventListener("touchstart",m,Du),function(){Iu=Iu.filter(function(w){return w!==i}),document.removeEventListener("wheel",f,Du),document.removeEventListener("touchmove",f,Du),document.removeEventListener("touchstart",m,Du)}},[]);var y=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(i,{styles:GX(a)}):null,y?x.createElement($X,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function QX(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ZX=CX(f4,WX);var e0=x.forwardRef(function(e,t){return x.createElement(Jy,Si({},e,{ref:t,sideCar:ZX}))});e0.classNames=Jy.classNames;var JX=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lu=new WeakMap,Pv=new WeakMap,Mv={},Jw=0,v4=function(e){return e&&(e.host||v4(e.parentNode))},eW=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=v4(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})},tW=function(e,t,n,r){var a=eW(t,Array.isArray(e)?e:[e]);Mv[n]||(Mv[n]=new WeakMap);var i=Mv[n],s=[],c=new Set,f=new Set(a),u=function(d){!d||c.has(d)||(c.add(d),u(d.parentNode))};a.forEach(u);var m=function(d){!d||f.has(d)||Array.prototype.forEach.call(d.children,function(v){if(c.has(v))m(v);else try{var y=v.getAttribute(r),b=y!==null&&y!=="false",w=(Lu.get(v)||0)+1,S=(i.get(v)||0)+1;Lu.set(v,w),i.set(v,S),s.push(v),w===1&&b&&Pv.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(d){var v=Lu.get(d)-1,y=i.get(d)-1;Lu.set(d,v),i.set(d,y),v||(Pv.has(d)||d.removeAttribute(r),Pv.delete(d)),y||d.removeAttribute(n)}),Jw--,Jw||(Lu=new WeakMap,Lu=new WeakMap,Pv=new WeakMap,Mv={})}},jj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=JX(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),tW(r,a,n,"aria-hidden")):function(){return null}},t0="Dialog",[g4]=ti(t0),[nW,ni]=g4(t0),y4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,c=x.useRef(null),f=x.useRef(null),[u,m]=tl({prop:r,defaultProp:a??!1,onChange:i,caller:t0});return p.jsx(nW,{scope:t,triggerRef:c,contentRef:f,contentId:Un(),titleId:Un(),descriptionId:Un(),open:u,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(d=>!d),[m]),modal:s,children:n})};y4.displayName=t0;var x4="DialogTrigger",rW=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ni(x4,n),i=rt(t,a.triggerRef);return p.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Aj(a.open),...r,ref:i,onClick:_e(e.onClick,a.onOpenToggle)})});rW.displayName=x4;var Cj="DialogPortal",[aW,b4]=g4(Cj,{forceMount:void 0}),w4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=ni(Cj,t);return p.jsx(aW,{scope:t,forceMount:n,children:x.Children.map(r,s=>p.jsx(hr,{present:n||i.open,children:p.jsx(_m,{asChild:!0,container:a,children:s})}))})};w4.displayName=Cj;var Og="DialogOverlay",S4=x.forwardRef((e,t)=>{const n=b4(Og,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=ni(Og,e.__scopeDialog);return i.modal?p.jsx(hr,{present:r||i.open,children:p.jsx(oW,{...a,ref:t})}):null});S4.displayName=Og;var iW=Sc("DialogOverlay.RemoveScroll"),oW=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ni(Og,n);return p.jsx(e0,{as:iW,allowPinchZoom:!0,shards:[a.contentRef],children:p.jsx(Ie.div,{"data-state":Aj(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ec="DialogContent",E4=x.forwardRef((e,t)=>{const n=b4(Ec,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=ni(Ec,e.__scopeDialog);return p.jsx(hr,{present:r||i.open,children:i.modal?p.jsx(sW,{...a,ref:t}):p.jsx(lW,{...a,ref:t})})});E4.displayName=Ec;var sW=x.forwardRef((e,t)=>{const n=ni(Ec,e.__scopeDialog),r=x.useRef(null),a=rt(t,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return jj(i)},[]),p.jsx(_4,{...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())})}),lW=x.forwardRef((e,t)=>{const n=ni(Ec,e.__scopeDialog),r=x.useRef(!1),a=x.useRef(!1);return p.jsx(_4,{...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 f,u;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),_4=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=e,c=ni(Ec,n),f=x.useRef(null),u=rt(t,f);return _j(),p.jsxs(p.Fragment,{children:[p.jsx(Zy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:p.jsx(Em,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Aj(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(cW,{titleId:c.titleId}),p.jsx(fW,{contentRef:f,descriptionId:c.descriptionId})]})]})}),Oj="DialogTitle",j4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ni(Oj,n);return p.jsx(Ie.h2,{id:a.titleId,...r,ref:t})});j4.displayName=Oj;var C4="DialogDescription",O4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ni(C4,n);return p.jsx(Ie.p,{id:a.descriptionId,...r,ref:t})});O4.displayName=C4;var A4="DialogClose",N4=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ni(A4,n);return p.jsx(Ie.button,{type:"button",...r,ref:t,onClick:_e(e.onClick,()=>a.onOpenChange(!1))})});N4.displayName=A4;function Aj(e){return e?"open":"closed"}var T4="DialogTitleWarning",[b2e,P4]=BG(T4,{contentName:Ec,titleName:Oj,docsSlug:"dialog"}),cW=({titleId:e})=>{const t=P4(T4),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},uW="DialogDescriptionWarning",fW=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${P4(uW).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},Nj=y4,Tj=w4,Pj=S4,Mj=E4,M4=j4,k4=O4,kj=N4,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 SM;function dW(){if(SM)return t1;SM=1;var e=qf();function t(d,v){return d===v&&(d!==0||1/d===1/v)||d!==d&&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(d,v){var y=v(),b=r({inst:{value:y,getSnapshot:v}}),w=b[0].inst,S=b[1];return i(function(){w.value=y,w.getSnapshot=v,f(w)&&S({inst:w})},[d,y,v]),a(function(){return f(w)&&S({inst:w}),d(function(){f(w)&&S({inst:w})})},[d]),s(y),y}function f(d){var v=d.getSnapshot;d=d.value;try{var y=v();return!n(d,y)}catch{return!0}}function u(d,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return t1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,t1}var EM;function hW(){return EM||(EM=1,e1.exports=dW()),e1.exports}function mW(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 pW(e){const[t,n]=x.useState(void 0);return Hn(()=>{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 f=i.borderBoxSize,u=Array.isArray(f)?f[0]:f;s=u.inlineSize,c=u.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 vW=["top","right","bottom","left"],nl=Math.min,Xr=Math.max,Ag=Math.round,kv=Math.floor,Oi=e=>({x:e,y:e}),gW={left:"right",right:"left",bottom:"top",top:"bottom"};function CE(e,t,n){return Xr(e,nl(t,n))}function Po(e,t){return typeof e=="function"?e(t):e}function Mo(e){return e.split("-")[0]}function Gf(e){return e.split("-")[1]}function Rj(e){return e==="x"?"y":"x"}function Dj(e){return e==="y"?"height":"width"}function Ei(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ij(e){return Rj(Ei(e))}function yW(e,t,n){n===void 0&&(n=!1);const r=Gf(e),a=Ij(e),i=Dj(a);let s=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ng(s)),[s,Ng(s)]}function xW(e){const t=Ng(e);return[OE(e),t,OE(t)]}function OE(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const _M=["left","right"],jM=["right","left"],bW=["top","bottom"],wW=["bottom","top"];function SW(e,t,n){switch(e){case"top":case"bottom":return n?t?jM:_M:t?_M:jM;case"left":case"right":return t?bW:wW;default:return[]}}function EW(e,t,n,r){const a=Gf(e);let i=SW(Mo(e),n==="start",r);return a&&(i=i.map(s=>s+"-"+a),t&&(i=i.concat(i.map(OE)))),i}function Ng(e){const t=Mo(e);return gW[t]+e.slice(t.length)}function _W(e){return{top:0,right:0,bottom:0,left:0,...e}}function R4(e){return typeof e!="number"?_W(e):{top:e,right:e,bottom:e,left:e}}function Tg(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 CM(e,t,n){let{reference:r,floating:a}=e;const i=Ei(t),s=Ij(t),c=Dj(s),f=Mo(t),u=i==="y",m=r.x+r.width/2-a.width/2,d=r.y+r.height/2-a.height/2,v=r[c]/2-a[c]/2;let y;switch(f){case"top":y={x:m,y:r.y-a.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:d};break;case"left":y={x:r.x-a.width,y:d};break;default:y={x:r.x,y:r.y}}switch(Gf(t)){case"start":y[s]-=v*(n&&u?-1:1);break;case"end":y[s]+=v*(n&&u?-1:1);break}return y}async function jW(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:s,elements:c,strategy:f}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:d="floating",altBoundary:v=!1,padding:y=0}=Po(t,e),b=R4(y),S=c[v?d==="floating"?"reference":"floating":d],E=Tg(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:u,rootBoundary:m,strategy:f})),O=d==="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=Tg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:O,offsetParent:j,strategy:f}):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 CW=50,OW=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:jW},f=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:d}=CM(u,r,f),v=r,y=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:d,initialPlacement:r,placement:v,strategy:a,middlewareData:b,rects:u,platform:c,elements:{reference:e,floating:t}});m=j??m,d=A??d,b[E]={...b[E],...N},T&&y<CW&&(y++,typeof T=="object"&&(T.placement&&(v=T.placement),T.rects&&(u=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):T.rects),{x:m,y:d}=CM(u,v,f)),w=-1)}return{x:m,y:d,placement:v,strategy:a,middlewareData:b}},AW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:s,elements:c,middlewareData:f}=t,{element:u,padding:m=0}=Po(e,t)||{};if(u==null)return{};const d=R4(m),v={x:n,y:r},y=Ij(a),b=Dj(y),w=await s.getDimensions(u),S=y==="y",E=S?"top":"left",O=S?"bottom":"right",j=S?"clientHeight":"clientWidth",A=i.reference[b]+i.reference[y]-v[y]-i.floating[b],N=v[y]-i.reference[y],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));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=nl(d[E],D),L=nl(d[O],D),I=K,G=P-w[b]-L,z=P/2-w[b]/2+R,V=CE(I,z,G),k=!f.arrow&&Gf(a)!=null&&z!==V&&i.reference[b]/2-(z<I?K:L)-w[b]/2<0,F=k?z<I?z-I:z-G:0;return{[y]:v[y]+F,data:{[y]:V,centerOffset:z-V-F,...k&&{alignmentOffset:F}},reset:k}}}),NW=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:f,elements:u}=t,{mainAxis:m=!0,crossAxis:d=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=Po(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=Mo(a),O=Ei(c),j=Mo(c)===c,A=await(f.isRTL==null?void 0:f.isRTL(u.floating)),N=v||(j||!w?[Ng(c)]:xW(c)),T=b!=="none";!v&&T&&N.push(...EW(c,w,b,A));const P=[c,...N],R=await f.detectOverflow(t,S),D=[];let K=((r=i.flip)==null?void 0:r.overflows)||[];if(m&&D.push(R[E]),d){const z=yW(a,s,A);D.push(R[z[0]],R[z[1]])}if(K=[...K,{placement:a,overflows:D}],!D.every(z=>z<=0)){var L,I;const z=(((L=i.flip)==null?void 0:L.index)||0)+1,V=P[z];if(V&&(!(d==="alignment"?O!==Ei(V):!1)||K.every(q=>Ei(q.placement)===O?q.overflows[0]>0:!0)))return{data:{index:z,overflows:K},reset:{placement:V}};let k=(I=K.filter(F=>F.overflows[0]<=0).sort((F,q)=>F.overflows[1]-q.overflows[1])[0])==null?void 0:I.placement;if(!k)switch(y){case"bestFit":{var G;const F=(G=K.filter(q=>{if(T){const U=Ei(q.placement);return U===O||U==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(U=>U>0).reduce((U,Y)=>U+Y,0)]).sort((q,U)=>q[1]-U[1])[0])==null?void 0:G[0];F&&(k=F);break}case"initialPlacement":k=c;break}if(a!==k)return{reset:{placement:k}}}return{}}}};function OM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AM(e){return vW.some(t=>e[t]>=0)}const TW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Po(e,t);switch(a){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=OM(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:AM(c)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),c=OM(s,n.floating);return{data:{escapedOffsets:c,escaped:AM(c)}}}default:return{}}}}},D4=new Set(["left","top"]);async function PW(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),s=Mo(n),c=Gf(n),f=Ei(n)==="y",u=D4.has(s)?-1:1,m=i&&f?-1:1,d=Po(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),f?{x:y*m,y:v*u}:{x:v*u,y:y*m}}const MW=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,f=await PW(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:i+f.y,data:{...f,placement:s}}}}},kW=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:f={fn:E=>{let{x:O,y:j}=E;return{x:O,y:j}}},...u}=Po(e,t),m={x:n,y:r},d=await i.detectOverflow(t,u),v=Ei(Mo(a)),y=Rj(v);let b=m[y],w=m[v];if(s){const E=y==="y"?"top":"left",O=y==="y"?"bottom":"right",j=b+d[E],A=b-d[O];b=CE(j,b,A)}if(c){const E=v==="y"?"top":"left",O=v==="y"?"bottom":"right",j=w+d[E],A=w-d[O];w=CE(j,w,A)}const S=f.fn({...t,[y]:b,[v]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[y]:s,[v]:c}}}}}},RW=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:f=!0,crossAxis:u=!0}=Po(e,t),m={x:n,y:r},d=Ei(a),v=Rj(d);let y=m[v],b=m[d];const w=Po(c,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const j=v==="y"?"height":"width",A=i.reference[v]-i.floating[j]+S.mainAxis,N=i.reference[v]+i.reference[j]-S.mainAxis;y<A?y=A:y>N&&(y=N)}if(u){var E,O;const j=v==="y"?"width":"height",A=D4.has(Mo(a)),N=i.reference[d]-i.floating[j]+(A&&((E=s.offset)==null?void 0:E[d])||0)+(A?0:S.crossAxis),T=i.reference[d]+i.reference[j]+(A?0:((O=s.offset)==null?void 0:O[d])||0)-(A?S.crossAxis:0);b<N?b=N:b>T&&(b=T)}return{[v]:y,[d]:b}}}},DW=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:f=()=>{},...u}=Po(e,t),m=await s.detectOverflow(t,u),d=Mo(a),v=Gf(a),y=Ei(a)==="y",{width:b,height:w}=i.floating;let S,E;d==="top"||d==="bottom"?(S=d,E=v===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(E=d,S=v==="end"?"top":"bottom");const O=w-m.top-m.bottom,j=b-m.left-m.right,A=nl(w-m[S],O),N=nl(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=Xr(m.left,0),L=Xr(m.right,0),I=Xr(m.top,0),G=Xr(m.bottom,0);y?R=b-2*(K!==0||L!==0?K+L:Xr(m.left,m.right)):P=w-2*(I!==0||G!==0?I+G:Xr(m.top,m.bottom))}await f({...t,availableWidth:R,availableHeight:P});const D=await s.getDimensions(c.floating);return b!==D.width||w!==D.height?{reset:{rects:!0}}:{}}}};function n0(){return typeof window<"u"}function Xf(e){return I4(e)?(e.nodeName||"").toLowerCase():"#document"}function ta(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $i(e){var t;return(t=(I4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I4(e){return n0()?e instanceof Node||e instanceof ta(e).Node:!1}function Xa(e){return n0()?e instanceof Element||e instanceof ta(e).Element:!1}function Bo(e){return n0()?e instanceof HTMLElement||e instanceof ta(e).HTMLElement:!1}function NM(e){return!n0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ta(e).ShadowRoot}function jm(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Wa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function IW(e){return/^(table|td|th)$/.test(Xf(e))}function r0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const LW=/transform|translate|scale|rotate|perspective|filter/,zW=/paint|layout|strict|content/,Kl=e=>!!e&&e!=="none";let n1;function Lj(e){const t=Xa(e)?Wa(e):e;return Kl(t.transform)||Kl(t.translate)||Kl(t.scale)||Kl(t.rotate)||Kl(t.perspective)||!zj()&&(Kl(t.backdropFilter)||Kl(t.filter))||LW.test(t.willChange||"")||zW.test(t.contain||"")}function $W(e){let t=rl(e);for(;Bo(t)&&!_f(t);){if(Lj(t))return t;if(r0(t))return null;t=rl(t)}return null}function zj(){return n1==null&&(n1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),n1}function _f(e){return/^(html|body|#document)$/.test(Xf(e))}function Wa(e){return ta(e).getComputedStyle(e)}function a0(e){return Xa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rl(e){if(Xf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||NM(e)&&e.host||$i(e);return NM(t)?t.host:t}function L4(e){const t=rl(e);return _f(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bo(t)&&jm(t)?t:L4(t)}function Lh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=L4(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),s=ta(a);if(i){const c=AE(s);return t.concat(s,s.visualViewport||[],jm(a)?a:[],c&&n?Lh(c):[])}else return t.concat(a,Lh(a,[],n))}function AE(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function z4(e){const t=Wa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Bo(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:r,c=Ag(n)!==i||Ag(r)!==s;return c&&(n=i,r=s),{width:n,height:r,$:c}}function $j(e){return Xa(e)?e:e.contextElement}function rf(e){const t=$j(e);if(!Bo(t))return Oi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=z4(t);let s=(i?Ag(n.width):n.width)/r,c=(i?Ag(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const BW=Oi(0);function $4(e){const t=ta(e);return!zj()||!t.visualViewport?BW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ta(e)?!1:t}function _c(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=$j(e);let s=Oi(1);t&&(r?Xa(r)&&(s=rf(r)):s=rf(e));const c=UW(i,n,r)?$4(i):Oi(0);let f=(a.left+c.x)/s.x,u=(a.top+c.y)/s.y,m=a.width/s.x,d=a.height/s.y;if(i){const v=ta(i),y=r&&Xa(r)?ta(r):r;let b=v,w=AE(b);for(;w&&r&&y!==b;){const S=rf(w),E=w.getBoundingClientRect(),O=Wa(w),j=E.left+(w.clientLeft+parseFloat(O.paddingLeft))*S.x,A=E.top+(w.clientTop+parseFloat(O.paddingTop))*S.y;f*=S.x,u*=S.y,m*=S.x,d*=S.y,f+=j,u+=A,b=ta(w),w=AE(b)}}return Tg({width:m,height:d,x:f,y:u})}function i0(e,t){const n=a0(e).scrollLeft;return t?t.left+n:_c($i(e)).left+n}function B4(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-i0(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function HW(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",s=$i(r),c=t?r0(t.floating):!1;if(r===s||c&&i)return n;let f={scrollLeft:0,scrollTop:0},u=Oi(1);const m=Oi(0),d=Bo(r);if((d||!d&&!i)&&((Xf(r)!=="body"||jm(s))&&(f=a0(r)),d)){const y=_c(r);u=rf(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const v=s&&!d&&!i?B4(s,f):Oi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-f.scrollLeft*u.x+m.x+v.x,y:n.y*u.y-f.scrollTop*u.y+m.y+v.y}}function FW(e){return Array.from(e.getClientRects())}function qW(e){const t=$i(e),n=a0(e),r=e.ownerDocument.body,a=Xr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+i0(e);const c=-n.scrollTop;return Wa(r).direction==="rtl"&&(s+=Xr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:s,y:c}}const TM=25;function KW(e,t){const n=ta(e),r=$i(e),a=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,c=0,f=0;if(a){i=a.width,s=a.height;const m=zj();(!m||m&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}const u=i0(r);if(u<=0){const m=r.ownerDocument,d=m.body,v=getComputedStyle(d),y=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(r.clientWidth-d.clientWidth-y);b<=TM&&(i-=b)}else u<=TM&&(i+=u);return{width:i,height:s,x:c,y:f}}function VW(e,t){const n=_c(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Bo(e)?rf(e):Oi(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,f=a*i.x,u=r*i.y;return{width:s,height:c,x:f,y:u}}function PM(e,t,n){let r;if(t==="viewport")r=KW(e,n);else if(t==="document")r=qW($i(e));else if(Xa(t))r=VW(t,n);else{const a=$4(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Tg(r)}function U4(e,t){const n=rl(e);return n===t||!Xa(n)||_f(n)?!1:Wa(n).position==="fixed"||U4(n,t)}function YW(e,t){const n=t.get(e);if(n)return n;let r=Lh(e,[],!1).filter(c=>Xa(c)&&Xf(c)!=="body"),a=null;const i=Wa(e).position==="fixed";let s=i?rl(e):e;for(;Xa(s)&&!_f(s);){const c=Wa(s),f=Lj(s);!f&&c.position==="fixed"&&(a=null),(i?!f&&!a:!f&&c.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||jm(s)&&!f&&U4(e,s))?r=r.filter(m=>m!==s):a=c,s=rl(s)}return t.set(e,r),r}function GW(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const s=[...n==="clippingAncestors"?r0(t)?[]:YW(t,this._c):[].concat(n),r],c=PM(t,s[0],a);let f=c.top,u=c.right,m=c.bottom,d=c.left;for(let v=1;v<s.length;v++){const y=PM(t,s[v],a);f=Xr(y.top,f),u=nl(y.right,u),m=nl(y.bottom,m),d=Xr(y.left,d)}return{width:u-d,height:m-f,x:d,y:f}}function XW(e){const{width:t,height:n}=z4(e);return{width:t,height:n}}function WW(e,t,n){const r=Bo(t),a=$i(t),i=n==="fixed",s=_c(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const f=Oi(0);function u(){f.x=i0(a)}if(r||!r&&!i)if((Xf(t)!=="body"||jm(a))&&(c=a0(t)),r){const y=_c(t,!0,i,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else a&&u();i&&!r&&a&&u();const m=a&&!r&&!i?B4(a,c):Oi(0),d=s.left+c.scrollLeft-f.x-m.x,v=s.top+c.scrollTop-f.y-m.y;return{x:d,y:v,width:s.width,height:s.height}}function r1(e){return Wa(e).position==="static"}function MM(e,t){if(!Bo(e)||Wa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $i(e)===n&&(n=n.ownerDocument.body),n}function H4(e,t){const n=ta(e);if(r0(e))return n;if(!Bo(e)){let a=rl(e);for(;a&&!_f(a);){if(Xa(a)&&!r1(a))return a;a=rl(a)}return n}let r=MM(e,t);for(;r&&IW(r)&&r1(r);)r=MM(r,t);return r&&_f(r)&&r1(r)&&!Lj(r)?n:r||$W(e)||n}const QW=async function(e){const t=this.getOffsetParent||H4,n=this.getDimensions,r=await n(e.floating);return{reference:WW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ZW(e){return Wa(e).direction==="rtl"}const JW={convertOffsetParentRelativeRectToViewportRelativeRect:HW,getDocumentElement:$i,getClippingRect:GW,getOffsetParent:H4,getElementRects:QW,getClientRects:FW,getDimensions:XW,getScale:rf,isElement:Xa,isRTL:ZW};function F4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function eQ(e,t){let n=null,r;const a=$i(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),i();const u=e.getBoundingClientRect(),{left:m,top:d,width:v,height:y}=u;if(c||t(),!v||!y)return;const b=kv(d),w=kv(a.clientWidth-(m+v)),S=kv(a.clientHeight-(d+y)),E=kv(m),j={rootMargin:-b+"px "+-w+"px "+-S+"px "+-E+"px",threshold:Xr(0,nl(1,f))||1};let A=!0;function N(T){const P=T[0].intersectionRatio;if(P!==f){if(!A)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!F4(u,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 tQ(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:f=!1}=r,u=$j(e),m=a||i?[...u?Lh(u):[],...t?Lh(t):[]]:[];m.forEach(E=>{a&&E.addEventListener("scroll",n,{passive:!0}),i&&E.addEventListener("resize",n)});const d=u&&c?eQ(u,n):null;let v=-1,y=null;s&&(y=new ResizeObserver(E=>{let[O]=E;O&&O.target===u&&y&&t&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),u&&!f&&y.observe(u),t&&y.observe(t));let b,w=f?_c(e):null;f&&S();function S(){const E=_c(e);w&&!F4(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)}),d==null||d(),(E=y)==null||E.disconnect(),y=null,f&&cancelAnimationFrame(b)}}const nQ=MW,rQ=kW,aQ=NW,iQ=DW,oQ=TW,kM=AW,sQ=RW,lQ=(e,t,n)=>{const r=new Map,a={platform:JW,...n},i={...a.platform,_c:r};return OW(e,t,{...a,platform:i})};var cQ=typeof document<"u",uQ=function(){},dg=cQ?x.useLayoutEffect:uQ;function Pg(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(!Pg(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)&&!Pg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function q4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function RM(e,t){const n=q4(e);return Math.round(t*n)/n}function a1(e){const t=x.useRef(e);return dg(()=>{t.current=e}),t}function fQ(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:f,open:u}=e,[m,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=x.useState(r);Pg(v,r)||y(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=f!=null,K=a1(f),L=a1(a),I=a1(u),G=x.useCallback(()=>{if(!T.current||!P.current)return;const q={placement:t,strategy:n,middleware:v};L.current&&(q.platform=L.current),lQ(T.current,P.current,q).then(U=>{const Y={...U,isPositioned:I.current!==!1};z.current&&!Pg(R.current,Y)&&(R.current=Y,fl.flushSync(()=>{d(Y)}))})},[v,t,n,L,I]);dg(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(q=>({...q,isPositioned:!1})))},[u]);const z=x.useRef(!1);dg(()=>(z.current=!0,()=>{z.current=!1}),[]),dg(()=>{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 V=x.useMemo(()=>({reference:T,floating:P,setReference:O,setFloating:j}),[O,j]),k=x.useMemo(()=>({reference:A,floating:N}),[A,N]),F=x.useMemo(()=>{const q={position:n,left:0,top:0};if(!k.floating)return q;const U=RM(k.floating,m.x),Y=RM(k.floating,m.y);return c?{...q,transform:"translate("+U+"px, "+Y+"px)",...q4(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:Y}},[n,c,k.floating,m.x,m.y]);return x.useMemo(()=>({...m,update:G,refs:V,elements:k,floatingStyles:F}),[m,G,V,k,F])}const dQ=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?kM({element:r.current,padding:a}).fn(n):{}:r?kM({element:r,padding:a}).fn(n):{}}}},hQ=(e,t)=>{const n=nQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},mQ=(e,t)=>{const n=rQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},pQ=(e,t)=>({fn:sQ(e).fn,options:[e,t]}),vQ=(e,t)=>{const n=aQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},gQ=(e,t)=>{const n=iQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},yQ=(e,t)=>{const n=oQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},xQ=(e,t)=>{const n=dQ(e);return{name:n.name,fn:n.fn,options:[e,t]}};var bQ="Arrow",K4=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"})})});K4.displayName=bQ;var wQ=K4,Bj="Popper",[V4,Wf]=ti(Bj),[SQ,Y4]=V4(Bj),G4=e=>{const{__scopePopper:t,children:n}=e,[r,a]=x.useState(null);return p.jsx(SQ,{scope:t,anchor:r,onAnchorChange:a,children:n})};G4.displayName=Bj;var X4="PopperAnchor",W4=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=Y4(X4,n),s=x.useRef(null),c=rt(t,s),f=x.useRef(null);return x.useEffect(()=>{const u=f.current;f.current=(r==null?void 0:r.current)||s.current,u!==f.current&&i.onAnchorChange(f.current)}),r?null:p.jsx(Ie.div,{...a,ref:c})});W4.displayName=X4;var Uj="PopperContent",[EQ,_Q]=V4(Uj),Q4=x.forwardRef((e,t)=>{var ae,re,J,le,he,ne;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:u=[],collisionPadding:m=0,sticky:d="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...w}=e,S=Y4(Uj,n),[E,O]=x.useState(null),j=rt(t,ge=>O(ge)),[A,N]=x.useState(null),T=pW(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},L=Array.isArray(u)?u:[u],I=L.length>0,G={padding:K,boundary:L.filter(CQ),altBoundary:I},{refs:z,floatingStyles:V,placement:k,isPositioned:F,middlewareData:q}=fQ({strategy:"fixed",placement:D,whileElementsMounted:(...ge)=>tQ(...ge,{animationFrame:y==="always"}),elements:{reference:S.anchor},middleware:[hQ({mainAxis:a+R,alignmentAxis:s}),f&&mQ({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?pQ():void 0,...G}),f&&vQ({...G}),gQ({...G,apply:({elements:ge,rects:ye,availableWidth:De,availableHeight:Me})=>{const{width:Ke,height:Bt}=ye.reference,ut=ge.floating.style;ut.setProperty("--radix-popper-available-width",`${De}px`),ut.setProperty("--radix-popper-available-height",`${Me}px`),ut.setProperty("--radix-popper-anchor-width",`${Ke}px`),ut.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),A&&xQ({element:A,padding:c}),OQ({arrowWidth:P,arrowHeight:R}),v&&yQ({strategy:"referenceHidden",...G})]}),[U,Y]=e5(k),B=Zn(b);Hn(()=>{F&&(B==null||B())},[F,B]);const $=(ae=q.arrow)==null?void 0:ae.x,X=(re=q.arrow)==null?void 0:re.y,Z=((J=q.arrow)==null?void 0:J.centerOffset)!==0,[ee,ie]=x.useState();return Hn(()=>{E&&ie(window.getComputedStyle(E).zIndex)},[E]),p.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:F?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(le=q.transformOrigin)==null?void 0:le.x,(he=q.transformOrigin)==null?void 0:he.y].join(" "),...((ne=q.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(EQ,{scope:n,placedSide:U,onArrowChange:N,arrowX:$,arrowY:X,shouldHideArrow:Z,children:p.jsx(Ie.div,{"data-side":U,"data-align":Y,...w,ref:j,style:{...w.style,animation:F?void 0:"none"}})})})});Q4.displayName=Uj;var Z4="PopperArrow",jQ={top:"bottom",right:"left",bottom:"top",left:"right"},J4=x.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=_Q(Z4,r),s=jQ[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(wQ,{...a,ref:n,style:{...a.style,display:"block"}})})});J4.displayName=Z4;function CQ(e){return e!==null}var OQ=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,f=s?0:e.arrowHeight,[u,m]=e5(n),d={start:"0%",center:"50%",end:"100%"}[m],v=(((E=a.arrow)==null?void 0:E.x)??0)+c/2,y=(((O=a.arrow)==null?void 0:O.y)??0)+f/2;let b="",w="";return u==="bottom"?(b=s?d:`${v}px`,w=`${-f}px`):u==="top"?(b=s?d:`${v}px`,w=`${r.floating.height+f}px`):u==="right"?(b=`${-f}px`,w=s?d:`${y}px`):u==="left"&&(b=`${r.floating.width+f}px`,w=s?d:`${y}px`),{data:{x:b,y:w}}}});function e5(e){const[t,n="center"]=e.split("-");return[t,n]}var Hj=G4,Fj=W4,qj=Q4,Kj=J4,i1="rovingFocusGroup.onEntryFocus",AQ={bubbles:!1,cancelable:!0},Cm="RovingFocusGroup",[NE,t5,NQ]=bj(Cm),[TQ,o0]=ti(Cm,[NQ]),[PQ,MQ]=TQ(Cm),n5=x.forwardRef((e,t)=>p.jsx(NE.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(NE.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(kQ,{...e,ref:t})})}));n5.displayName=Cm;var kQ=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:u,preventScrollOnEntryFocus:m=!1,...d}=e,v=x.useRef(null),y=rt(t,v),b=Sm(i),[w,S]=tl({prop:s,defaultProp:c??null,onChange:f,caller:Cm}),[E,O]=x.useState(!1),j=Zn(u),A=t5(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(PQ,{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,...d,ref:y,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,AQ);if(R.currentTarget.dispatchEvent(K),!K.defaultPrevented){const L=A().filter(k=>k.focusable),I=L.find(k=>k.active),G=L.find(k=>k.id===w),V=[I,G,...L].filter(Boolean).map(k=>k.ref.current);i5(V,m)}}N.current=!1}),onBlur:_e(e.onBlur,()=>O(!1))})})}),r5="RovingFocusGroupItem",a5=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:s,...c}=e,f=Un(),u=i||f,m=MQ(r5,n),d=m.currentTabStopId===u,v=t5(n),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:w}=m;return x.useEffect(()=>{if(r)return y(),()=>b()},[r,y,b]),p.jsx(NE.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:p.jsx(Ie.span,{tabIndex:d?0:-1,"data-orientation":m.orientation,...c,ref:t,onMouseDown:_e(e.onMouseDown,S=>{r?m.onItemFocus(u):S.preventDefault()}),onFocus:_e(e.onFocus,()=>m.onItemFocus(u)),onKeyDown:_e(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){m.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const E=IQ(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?LQ(j,A+1):j.slice(A+1)}setTimeout(()=>i5(j))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:w!=null}):s})})});a5.displayName=r5;var RQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DQ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function IQ(e,t,n){const r=DQ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return RQ[r]}function i5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function LQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var o5=n5,s5=a5,TE=["Enter"," "],zQ=["ArrowDown","PageUp","Home"],l5=["ArrowUp","PageDown","End"],$Q=[...zQ,...l5],BQ={ltr:[...TE,"ArrowRight"],rtl:[...TE,"ArrowLeft"]},UQ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Om="Menu",[zh,HQ,FQ]=bj(Om),[Hc,c5]=ti(Om,[FQ,Wf,o0]),s0=Wf(),u5=o0(),[qQ,Fc]=Hc(Om),[KQ,Am]=Hc(Om),f5=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:s=!0}=e,c=s0(t),[f,u]=x.useState(null),m=x.useRef(!1),d=Zn(i),v=Sm(a);return x.useEffect(()=>{const y=()=>{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",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),p.jsx(Hj,{...c,children:p.jsx(qQ,{scope:t,open:n,onOpenChange:d,content:f,onContentChange:u,children:p.jsx(KQ,{scope:t,onClose:x.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:m,dir:v,modal:s,children:r})})})};f5.displayName=Om;var VQ="MenuAnchor",Vj=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=s0(n);return p.jsx(Fj,{...a,...r,ref:t})});Vj.displayName=VQ;var Yj="MenuPortal",[YQ,d5]=Hc(Yj,{forceMount:void 0}),h5=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Fc(Yj,t);return p.jsx(YQ,{scope:t,forceMount:n,children:p.jsx(hr,{present:n||i.open,children:p.jsx(_m,{asChild:!0,container:a,children:r})})})};h5.displayName=Yj;var Oa="MenuContent",[GQ,Gj]=Hc(Oa),m5=x.forwardRef((e,t)=>{const n=d5(Oa,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Fc(Oa,e.__scopeMenu),s=Am(Oa,e.__scopeMenu);return p.jsx(zh.Provider,{scope:e.__scopeMenu,children:p.jsx(hr,{present:r||i.open,children:p.jsx(zh.Slot,{scope:e.__scopeMenu,children:s.modal?p.jsx(XQ,{...a,ref:t}):p.jsx(WQ,{...a,ref:t})})})})}),XQ=x.forwardRef((e,t)=>{const n=Fc(Oa,e.__scopeMenu),r=x.useRef(null),a=rt(t,r);return x.useEffect(()=>{const i=r.current;if(i)return jj(i)},[]),p.jsx(Xj,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),WQ=x.forwardRef((e,t)=>{const n=Fc(Oa,e.__scopeMenu);return p.jsx(Xj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),QQ=Sc("MenuContent.ScrollLock"),Xj=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:d,onInteractOutside:v,onDismiss:y,disableOutsideScroll:b,...w}=e,S=Fc(Oa,n),E=Am(Oa,n),O=s0(n),j=u5(n),A=HQ(n),[N,T]=x.useState(null),P=x.useRef(null),R=rt(t,P,S.onContentChange),D=x.useRef(0),K=x.useRef(""),L=x.useRef(0),I=x.useRef(null),G=x.useRef("right"),z=x.useRef(0),V=b?e0:x.Fragment,k=b?{as:QQ,allowPinchZoom:!0}:void 0,F=U=>{var ae,re;const Y=K.current+U,B=A().filter(J=>!J.disabled),$=document.activeElement,X=(ae=B.find(J=>J.ref.current===$))==null?void 0:ae.textValue,Z=B.map(J=>J.textValue),ee=cZ(Z,Y,X),ie=(re=B.find(J=>J.textValue===ee))==null?void 0:re.ref.current;(function J(le){K.current=le,window.clearTimeout(D.current),le!==""&&(D.current=window.setTimeout(()=>J(""),1e3))})(Y),ie&&setTimeout(()=>ie.focus())};x.useEffect(()=>()=>window.clearTimeout(D.current),[]),_j();const q=x.useCallback(U=>{var B,$;return G.current===((B=I.current)==null?void 0:B.side)&&fZ(U,($=I.current)==null?void 0:$.area)},[]);return p.jsx(GQ,{scope:n,searchRef:K,onItemEnter:x.useCallback(U=>{q(U)&&U.preventDefault()},[q]),onItemLeave:x.useCallback(U=>{var Y;q(U)||((Y=P.current)==null||Y.focus(),T(null))},[q]),onTriggerLeave:x.useCallback(U=>{q(U)&&U.preventDefault()},[q]),pointerGraceTimerRef:L,onPointerGraceIntentChange:x.useCallback(U=>{I.current=U},[]),children:p.jsx(V,{...k,children:p.jsx(Zy,{asChild:!0,trapped:a,onMountAutoFocus:_e(i,U=>{var Y;U.preventDefault(),(Y=P.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:p.jsx(Em,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:d,onInteractOutside:v,onDismiss:y,children:p.jsx(o5,{asChild:!0,...j,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:T,onEntryFocus:_e(f,U=>{E.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(qj,{role:"menu","aria-orientation":"vertical","data-state":T5(S.open),"data-radix-menu-content":"",dir:E.dir,...O,...w,ref:R,style:{outline:"none",...w.style},onKeyDown:_e(w.onKeyDown,U=>{const B=U.target.closest("[data-radix-menu-content]")===U.currentTarget,$=U.ctrlKey||U.altKey||U.metaKey,X=U.key.length===1;B&&(U.key==="Tab"&&U.preventDefault(),!$&&X&&F(U.key));const Z=P.current;if(U.target!==Z||!$Q.includes(U.key))return;U.preventDefault();const ie=A().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);l5.includes(U.key)&&ie.reverse(),sZ(ie)}),onBlur:_e(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(D.current),K.current="")}),onPointerMove:_e(e.onPointerMove,$h(U=>{const Y=U.target,B=z.current!==U.clientX;if(U.currentTarget.contains(Y)&&B){const $=U.clientX>z.current?"right":"left";G.current=$,z.current=U.clientX}}))})})})})})})});m5.displayName=Oa;var ZQ="MenuGroup",Wj=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ie.div,{role:"group",...r,ref:t})});Wj.displayName=ZQ;var JQ="MenuLabel",p5=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ie.div,{...r,ref:t})});p5.displayName=JQ;var Mg="MenuItem",DM="menu.itemSelect",l0=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=x.useRef(null),s=Am(Mg,e.__scopeMenu),c=Gj(Mg,e.__scopeMenu),f=rt(t,i),u=x.useRef(!1),m=()=>{const d=i.current;if(!n&&d){const v=new CustomEvent(DM,{bubbles:!0,cancelable:!0});d.addEventListener(DM,y=>r==null?void 0:r(y),{once:!0}),Jz(d,v),v.defaultPrevented?u.current=!1:s.onClose()}};return p.jsx(v5,{...a,ref:f,disabled:n,onClick:_e(e.onClick,m),onPointerDown:d=>{var v;(v=e.onPointerDown)==null||v.call(e,d),u.current=!0},onPointerUp:_e(e.onPointerUp,d=>{var v;u.current||(v=d.currentTarget)==null||v.click()}),onKeyDown:_e(e.onKeyDown,d=>{const v=c.searchRef.current!=="";n||v&&d.key===" "||TE.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});l0.displayName=Mg;var v5=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,s=Gj(Mg,n),c=u5(n),f=x.useRef(null),u=rt(t,f),[m,d]=x.useState(!1),[v,y]=x.useState("");return x.useEffect(()=>{const b=f.current;b&&y((b.textContent??"").trim())},[i.children]),p.jsx(zh.ItemSlot,{scope:n,disabled:r,textValue:a??v,children:p.jsx(s5,{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:u,onPointerMove:_e(e.onPointerMove,$h(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_e(e.onPointerLeave,$h(b=>s.onItemLeave(b))),onFocus:_e(e.onFocus,()=>d(!0)),onBlur:_e(e.onBlur,()=>d(!1))})})})}),eZ="MenuCheckboxItem",g5=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return p.jsx(S5,{scope:e.__scopeMenu,checked:n,children:p.jsx(l0,{role:"menuitemcheckbox","aria-checked":kg(n)?"mixed":n,...a,ref:t,"data-state":Zj(n),onSelect:_e(a.onSelect,()=>r==null?void 0:r(kg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});g5.displayName=eZ;var y5="MenuRadioGroup",[tZ,nZ]=Hc(y5,{value:void 0,onValueChange:()=>{}}),x5=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Zn(r);return p.jsx(tZ,{scope:e.__scopeMenu,value:n,onValueChange:i,children:p.jsx(Wj,{...a,ref:t})})});x5.displayName=y5;var b5="MenuRadioItem",w5=x.forwardRef((e,t)=>{const{value:n,...r}=e,a=nZ(b5,e.__scopeMenu),i=n===a.value;return p.jsx(S5,{scope:e.__scopeMenu,checked:i,children:p.jsx(l0,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Zj(i),onSelect:_e(r.onSelect,()=>{var s;return(s=a.onValueChange)==null?void 0:s.call(a,n)},{checkForDefaultPrevented:!1})})})});w5.displayName=b5;var Qj="MenuItemIndicator",[S5,rZ]=Hc(Qj,{checked:!1}),E5=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=rZ(Qj,n);return p.jsx(hr,{present:r||kg(i.checked)||i.checked===!0,children:p.jsx(Ie.span,{...a,ref:t,"data-state":Zj(i.checked)})})});E5.displayName=Qj;var aZ="MenuSeparator",_5=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ie.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});_5.displayName=aZ;var iZ="MenuArrow",j5=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=s0(n);return p.jsx(Kj,{...a,...r,ref:t})});j5.displayName=iZ;var oZ="MenuSub",[w2e,C5]=Hc(oZ),Eh="MenuSubTrigger",O5=x.forwardRef((e,t)=>{const n=Fc(Eh,e.__scopeMenu),r=Am(Eh,e.__scopeMenu),a=C5(Eh,e.__scopeMenu),i=Gj(Eh,e.__scopeMenu),s=x.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=i,u={__scopeMenu:e.__scopeMenu},m=x.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return x.useEffect(()=>m,[m]),x.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),f(null)}},[c,f]),p.jsx(Vj,{asChild:!0,...u,children:p.jsx(v5,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":T5(n.open),...e,ref:To(t,a.onTriggerChange),onClick:d=>{var v;(v=e.onClick)==null||v.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:_e(e.onPointerMove,$h(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:_e(e.onPointerLeave,$h(d=>{var y,b;m();const v=(y=n.content)==null?void 0:y.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:d.clientX+E,y:d.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(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:_e(e.onKeyDown,d=>{var y;const v=i.searchRef.current!=="";e.disabled||v&&d.key===" "||BQ[r.dir].includes(d.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),d.preventDefault())})})})});O5.displayName=Eh;var A5="MenuSubContent",N5=x.forwardRef((e,t)=>{const n=d5(Oa,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Fc(Oa,e.__scopeMenu),s=Am(Oa,e.__scopeMenu),c=C5(A5,e.__scopeMenu),f=x.useRef(null),u=rt(t,f);return p.jsx(zh.Provider,{scope:e.__scopeMenu,children:p.jsx(hr,{present:r||i.open,children:p.jsx(zh.Slot,{scope:e.__scopeMenu,children:p.jsx(Xj,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var d;s.isUsingKeyboardRef.current&&((d=f.current)==null||d.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 y;const d=m.currentTarget.contains(m.target),v=UQ[s.dir].includes(m.key);d&&v&&(i.onOpenChange(!1),(y=c.trigger)==null||y.focus(),m.preventDefault())})})})})})});N5.displayName=A5;function T5(e){return e?"open":"closed"}function kg(e){return e==="indeterminate"}function Zj(e){return kg(e)?"indeterminate":e?"checked":"unchecked"}function sZ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function cZ(e,t,n){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=lZ(e,Math.max(i,0));a.length===1&&(s=s.filter(u=>u!==n));const f=s.find(u=>u.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function uZ(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],f=t[s],u=c.x,m=c.y,d=f.x,v=f.y;m>r!=v>r&&n<(d-u)*(r-m)/(v-m)+u&&(a=!a)}return a}function fZ(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return uZ(n,t)}function $h(e){return t=>t.pointerType==="mouse"?e(t):void 0}var dZ=f5,hZ=Vj,mZ=h5,pZ=m5,vZ=Wj,gZ=p5,yZ=l0,xZ=g5,bZ=x5,wZ=w5,SZ=E5,EZ=_5,_Z=j5,jZ=O5,CZ=N5,c0="DropdownMenu",[OZ]=ti(c0,[c5]),Sr=c5(),[AZ,P5]=OZ(c0),M5=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:s,modal:c=!0}=e,f=Sr(t),u=x.useRef(null),[m,d]=tl({prop:a,defaultProp:i??!1,onChange:s,caller:c0});return p.jsx(AZ,{scope:t,triggerId:Un(),triggerRef:u,contentId:Un(),open:m,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(v=>!v),[d]),modal:c,children:p.jsx(dZ,{...f,open:m,onOpenChange:d,dir:r,modal:c,children:n})})};M5.displayName=c0;var k5="DropdownMenuTrigger",R5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=P5(k5,n),s=Sr(n);return p.jsx(hZ,{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:To(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())})})})});R5.displayName=k5;var NZ="DropdownMenuPortal",D5=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Sr(t);return p.jsx(mZ,{...r,...n})};D5.displayName=NZ;var I5="DropdownMenuContent",L5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=P5(I5,n),i=Sr(n),s=x.useRef(!1);return p.jsx(pZ,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,c=>{var f;s.current||(f=a.triggerRef.current)==null||f.focus(),s.current=!1,c.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,c=>{const f=c.detail.originalEvent,u=f.button===0&&f.ctrlKey===!0,m=f.button===2||u;(!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)"}})});L5.displayName=I5;var TZ="DropdownMenuGroup",PZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(vZ,{...a,...r,ref:t})});PZ.displayName=TZ;var MZ="DropdownMenuLabel",kZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(gZ,{...a,...r,ref:t})});kZ.displayName=MZ;var RZ="DropdownMenuItem",z5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(yZ,{...a,...r,ref:t})});z5.displayName=RZ;var DZ="DropdownMenuCheckboxItem",$5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(xZ,{...a,...r,ref:t})});$5.displayName=DZ;var IZ="DropdownMenuRadioGroup",LZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(bZ,{...a,...r,ref:t})});LZ.displayName=IZ;var zZ="DropdownMenuRadioItem",$Z=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(wZ,{...a,...r,ref:t})});$Z.displayName=zZ;var BZ="DropdownMenuItemIndicator",B5=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(SZ,{...a,...r,ref:t})});B5.displayName=BZ;var UZ="DropdownMenuSeparator",HZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(EZ,{...a,...r,ref:t})});HZ.displayName=UZ;var FZ="DropdownMenuArrow",qZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(_Z,{...a,...r,ref:t})});qZ.displayName=FZ;var KZ="DropdownMenuSubTrigger",VZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(jZ,{...a,...r,ref:t})});VZ.displayName=KZ;var YZ="DropdownMenuSubContent",GZ=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return p.jsx(CZ,{...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)"}})});GZ.displayName=YZ;var XZ=M5,WZ=R5,QZ=D5,ZZ=L5,JZ=z5,eJ=$5,tJ=B5,nJ="Label",U5=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())}}));U5.displayName=nJ;var rJ=U5;function PE(e,[t,n]){return Math.min(n,Math.max(t,e))}function aJ(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Jj="ScrollArea",[H5]=ti(Jj),[iJ,Ta]=H5(Jj),F5=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...s}=e,[c,f]=x.useState(null),[u,m]=x.useState(null),[d,v]=x.useState(null),[y,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=rt(t,L=>f(L)),K=Sm(a);return p.jsx(iJ,{scope:n,type:r,dir:K,scrollHideDelay:i,scrollArea:c,viewport:u,onViewportChange:m,content:d,onContentChange:v,scrollbarX:y,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}})})});F5.displayName=Jj;var q5="ScrollAreaViewport",K5=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,s=Ta(q5,n),c=x.useRef(null),f=rt(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:f,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})})]})});K5.displayName=q5;var Bi="ScrollAreaScrollbar",V5=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ta(Bi,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(oJ,{...r,ref:t,forceMount:n}):a.type==="scroll"?p.jsx(sJ,{...r,ref:t,forceMount:n}):a.type==="auto"?p.jsx(Y5,{...r,ref:t,forceMount:n}):a.type==="always"?p.jsx(eC,{...r,ref:t}):null});V5.displayName=Bi;var oJ=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ta(Bi,e.__scopeScrollArea),[i,s]=x.useState(!1);return x.useEffect(()=>{const c=a.scrollArea;let f=0;if(c){const u=()=>{window.clearTimeout(f),s(!0)},m=()=>{f=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),p.jsx(hr,{present:n||i,children:p.jsx(Y5,{"data-state":i?"visible":"hidden",...r,ref:t})})}),sJ=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ta(Bi,e.__scopeScrollArea),i=e.orientation==="horizontal",s=f0(()=>f("SCROLL_END"),100),[c,f]=aJ("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 u=window.setTimeout(()=>f("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,a.scrollHideDelay,f]),x.useEffect(()=>{const u=a.viewport,m=i?"scrollLeft":"scrollTop";if(u){let d=u[m];const v=()=>{const y=u[m];d!==y&&(f("SCROLL"),s()),d=y};return u.addEventListener("scroll",v),()=>u.removeEventListener("scroll",v)}},[a.viewport,i,f,s]),p.jsx(hr,{present:n||c!=="hidden",children:p.jsx(eC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:_e(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:_e(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),Y5=x.forwardRef((e,t)=>{const n=Ta(Bi,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,s]=x.useState(!1),c=e.orientation==="horizontal",f=f0(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;s(c?u:m)}},10);return jf(n.viewport,f),jf(n.content,f),p.jsx(hr,{present:r||i,children:p.jsx(eC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),eC=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Ta(Bi,e.__scopeScrollArea),i=x.useRef(null),s=x.useRef(0),[c,f]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Z5(c.viewport,c.content),m={...r,sizes:c,onSizesChange:f,hasThumb:u>0&&u<1,onThumbChange:v=>i.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function d(v,y){return hJ(v,s.current,c,y)}return n==="horizontal"?p.jsx(lJ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const v=a.viewport.scrollLeft,y=IM(v,c,a.dir);i.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:v=>{a.viewport&&(a.viewport.scrollLeft=v)},onDragScroll:v=>{a.viewport&&(a.viewport.scrollLeft=d(v,a.dir))}}):n==="vertical"?p.jsx(cJ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const v=a.viewport.scrollTop,y=IM(v,c);i.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:v=>{a.viewport&&(a.viewport.scrollTop=v)},onDragScroll:v=>{a.viewport&&(a.viewport.scrollTop=d(v))}}):null}),lJ=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Ta(Bi,e.__scopeScrollArea),[s,c]=x.useState(),f=x.useRef(null),u=rt(t,f,i.onScrollbarXChange);return x.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),p.jsx(X5,{"data-orientation":"horizontal",...a,ref:u,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":u0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,d)=>{if(i.viewport){const v=i.viewport.scrollLeft+m.deltaX;e.onWheelScroll(v),e$(v,d)&&m.preventDefault()}},onResize:()=>{f.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Dg(s.paddingLeft),paddingEnd:Dg(s.paddingRight)}})}})}),cJ=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Ta(Bi,e.__scopeScrollArea),[s,c]=x.useState(),f=x.useRef(null),u=rt(t,f,i.onScrollbarYChange);return x.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),p.jsx(X5,{"data-orientation":"vertical",...a,ref:u,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":u0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,d)=>{if(i.viewport){const v=i.viewport.scrollTop+m.deltaY;e.onWheelScroll(v),e$(v,d)&&m.preventDefault()}},onResize:()=>{f.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Dg(s.paddingTop),paddingEnd:Dg(s.paddingBottom)}})}})}),[uJ,G5]=H5(Bi),X5=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:u,onWheelScroll:m,onResize:d,...v}=e,y=Ta(Bi,n),[b,w]=x.useState(null),S=rt(t,D=>w(D)),E=x.useRef(null),O=x.useRef(""),j=y.viewport,A=r.content-r.viewport,N=Zn(m),T=Zn(f),P=f0(d,10);function R(D){if(E.current){const K=D.clientX-E.current.left,L=D.clientY-E.current.top;u({x:K,y:L})}}return x.useEffect(()=>{const D=K=>{const L=K.target;(b==null?void 0:b.contains(L))&&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]),jf(b,P),jf(y.content,P),p.jsx(uJ,{scope:n,scrollbar:b,hasThumb:a,onThumbChange:Zn(i),onThumbPointerUp:Zn(s),onThumbPositionChange:T,onThumbPointerDown:Zn(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",y.viewport&&(y.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,y.viewport&&(y.viewport.style.scrollBehavior=""),E.current=null})})})}),Rg="ScrollAreaThumb",W5=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=G5(Rg,e.__scopeScrollArea);return p.jsx(hr,{present:n||a.hasThumb,children:p.jsx(fJ,{ref:t,...r})})}),fJ=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Ta(Rg,n),s=G5(Rg,n),{onThumbPositionChange:c}=s,f=rt(t,d=>s.onThumbChange(d)),u=x.useRef(void 0),m=f0(()=>{u.current&&(u.current(),u.current=void 0)},100);return x.useEffect(()=>{const d=i.viewport;if(d){const v=()=>{if(m(),!u.current){const y=mJ(d,c);u.current=y,c()}};return c(),d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,m,c]),p.jsx(Ie.div,{"data-state":s.hasThumb?"visible":"hidden",...a,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:_e(e.onPointerDownCapture,d=>{const y=d.target.getBoundingClientRect(),b=d.clientX-y.left,w=d.clientY-y.top;s.onThumbPointerDown({x:b,y:w})}),onPointerUp:_e(e.onPointerUp,s.onThumbPointerUp)})});W5.displayName=Rg;var tC="ScrollAreaCorner",Q5=x.forwardRef((e,t)=>{const n=Ta(tC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.jsx(dJ,{...e,ref:t}):null});Q5.displayName=tC;var dJ=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Ta(tC,n),[i,s]=x.useState(0),[c,f]=x.useState(0),u=!!(i&&c);return jf(a.scrollbarX,()=>{var d;const m=((d=a.scrollbarX)==null?void 0:d.offsetHeight)||0;a.onCornerHeightChange(m),f(m)}),jf(a.scrollbarY,()=>{var d;const m=((d=a.scrollbarY)==null?void 0:d.offsetWidth)||0;a.onCornerWidthChange(m),s(m)}),u?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 Dg(e){return e?parseInt(e,10):0}function Z5(e,t){const n=e/t;return isNaN(n)?0:n}function u0(e){const t=Z5(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function hJ(e,t,n,r="ltr"){const a=u0(n),i=a/2,s=t||i,c=a-s,f=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,d=r==="ltr"?[0,m]:[m*-1,0];return J5([f,u],d)(e)}function IM(e,t,n="ltr"){const r=u0(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,s=t.content-t.viewport,c=i-r,f=n==="ltr"?[0,s]:[s*-1,0],u=PE(e,f);return J5([0,s],[0,c])(u)}function J5(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 e$(e,t){return e>0&&e<t}var mJ=(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 f0(e,t){const n=Zn(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 jf(e,t){const n=Zn(t);Hn(()=>{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 pJ=F5,vJ=K5,gJ=Q5,yJ=[" ","Enter","ArrowUp","ArrowDown"],xJ=[" ","Enter"],jc="Select",[d0,h0,bJ]=bj(jc),[Qf]=ti(jc,[bJ,Wf]),m0=Wf(),[wJ,dl]=Qf(jc),[SJ,EJ]=Qf(jc),t$=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:s,defaultValue:c,onValueChange:f,dir:u,name:m,autoComplete:d,disabled:v,required:y,form:b}=e,w=m0(t),[S,E]=x.useState(null),[O,j]=x.useState(null),[A,N]=x.useState(!1),T=Sm(u),[P,R]=tl({prop:r,defaultProp:a??!1,onChange:i,caller:jc}),[D,K]=tl({prop:s,defaultProp:c,onChange:f,caller:jc}),L=x.useRef(null),I=S?b||!!S.closest("form"):!0,[G,z]=x.useState(new Set),V=Array.from(G).map(k=>k.props.value).join(";");return p.jsx(Hj,{...w,children:p.jsxs(wJ,{required:y,scope:t,trigger:S,onTriggerChange:E,valueNode:O,onValueNodeChange:j,valueNodeHasChildren:A,onValueNodeHasChildrenChange:N,contentId:Un(),value:D,onValueChange:K,open:P,onOpenChange:R,dir:T,triggerPointerDownPosRef:L,disabled:v,children:[p.jsx(d0.Provider,{scope:t,children:p.jsx(SJ,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(k=>{z(F=>new Set(F).add(k))},[]),onNativeOptionRemove:x.useCallback(k=>{z(F=>{const q=new Set(F);return q.delete(k),q})},[]),children:n})}),I?p.jsxs(E$,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:d,value:D,onChange:k=>K(k.target.value),disabled:v,form:b,children:[D===void 0?p.jsx("option",{value:""}):null,Array.from(G)]},V):null]})})};t$.displayName=jc;var n$="SelectTrigger",r$=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=m0(n),s=dl(n$,n),c=s.disabled||r,f=rt(t,s.onTriggerChange),u=h0(n),m=x.useRef("touch"),[d,v,y]=j$(w=>{const S=u().filter(j=>!j.disabled),E=S.find(j=>j.value===s.value),O=C$(S,w,E);O!==void 0&&s.onValueChange(O.value)}),b=w=>{c||(s.onOpenChange(!0),y()),w&&(s.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return p.jsx(Fj,{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":_$(s.value)?"":void 0,...a,ref:f,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=d.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&v(w.key),!(S&&w.key===" ")&&yJ.includes(w.key)&&(b(),w.preventDefault())})})})});r$.displayName=n$;var a$="SelectValue",i$=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:s="",...c}=e,f=dl(a$,n),{onValueNodeHasChildrenChange:u}=f,m=i!==void 0,d=rt(t,f.onValueNodeChange);return Hn(()=>{u(m)},[u,m]),p.jsx(Ie.span,{...c,ref:d,style:{pointerEvents:"none"},children:_$(f.value)?p.jsx(p.Fragment,{children:s}):i})});i$.displayName=a$;var _J="SelectIcon",o$=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return p.jsx(Ie.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});o$.displayName=_J;var jJ="SelectPortal",s$=e=>p.jsx(_m,{asChild:!0,...e});s$.displayName=jJ;var Cc="SelectContent",l$=x.forwardRef((e,t)=>{const n=dl(Cc,e.__scopeSelect),[r,a]=x.useState();if(Hn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?fl.createPortal(p.jsx(c$,{scope:e.__scopeSelect,children:p.jsx(d0.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(u$,{...e,ref:t})});l$.displayName=Cc;var za=10,[c$,hl]=Qf(Cc),CJ="SelectContentImpl",OJ=Sc("SelectContent.RemoveScroll"),u$=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:c,sideOffset:f,align:u,alignOffset:m,arrowPadding:d,collisionBoundary:v,collisionPadding:y,sticky:b,hideWhenDetached:w,avoidCollisions:S,...E}=e,O=dl(Cc,n),[j,A]=x.useState(null),[N,T]=x.useState(null),P=rt(t,ae=>A(ae)),[R,D]=x.useState(null),[K,L]=x.useState(null),I=h0(n),[G,z]=x.useState(!1),V=x.useRef(!1);x.useEffect(()=>{if(j)return jj(j)},[j]),_j();const k=x.useCallback(ae=>{const[re,...J]=I().map(ne=>ne.ref.current),[le]=J.slice(-1),he=document.activeElement;for(const ne of ae)if(ne===he||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===re&&N&&(N.scrollTop=0),ne===le&&N&&(N.scrollTop=N.scrollHeight),ne==null||ne.focus(),document.activeElement!==he))return},[I,N]),F=x.useCallback(()=>k([R,j]),[k,R,j]);x.useEffect(()=>{G&&F()},[G,F]);const{onOpenChange:q,triggerPointerDownPosRef:U}=O;x.useEffect(()=>{if(j){let ae={x:0,y:0};const re=le=>{var he,ne;ae={x:Math.abs(Math.round(le.pageX)-(((he=U.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(le.pageY)-(((ne=U.current)==null?void 0:ne.y)??0))}},J=le=>{ae.x<=10&&ae.y<=10?le.preventDefault():j.contains(le.target)||q(!1),document.removeEventListener("pointermove",re),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",J,{capture:!0})}}},[j,q,U]),x.useEffect(()=>{const ae=()=>q(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[q]);const[Y,B]=j$(ae=>{const re=I().filter(he=>!he.disabled),J=re.find(he=>he.ref.current===document.activeElement),le=C$(re,ae,J);le&&setTimeout(()=>le.ref.current.focus())}),$=x.useCallback((ae,re,J)=>{const le=!V.current&&!J;(O.value!==void 0&&O.value===re||le)&&(D(ae),le&&(V.current=!0))},[O.value]),X=x.useCallback(()=>j==null?void 0:j.focus(),[j]),Z=x.useCallback((ae,re,J)=>{const le=!V.current&&!J;(O.value!==void 0&&O.value===re||le)&&L(ae)},[O.value]),ee=r==="popper"?ME:f$,ie=ee===ME?{side:c,sideOffset:f,align:u,alignOffset:m,arrowPadding:d,collisionBoundary:v,collisionPadding:y,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return p.jsx(c$,{scope:n,content:j,viewport:N,onViewportChange:T,itemRefCallback:$,selectedItem:R,onItemLeave:X,itemTextRefCallback:Z,focusSelectedItem:F,selectedItemText:K,position:r,isPositioned:G,searchRef:Y,children:p.jsx(e0,{as:OJ,allowPinchZoom:!0,children:p.jsx(Zy,{asChild:!0,trapped:O.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:_e(a,ae=>{var re;(re=O.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:p.jsx(Em,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:p.jsx(ee,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:ae=>ae.preventDefault(),...E,...ie,onPlaced:()=>z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:_e(E.onKeyDown,ae=>{const re=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!re&&ae.key.length===1&&B(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let le=I().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const he=ae.target,ne=le.indexOf(he);le=le.slice(ne+1)}setTimeout(()=>k(le)),ae.preventDefault()}})})})})})})});u$.displayName=CJ;var AJ="SelectItemAlignedPosition",f$=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=dl(Cc,n),s=hl(Cc,n),[c,f]=x.useState(null),[u,m]=x.useState(null),d=rt(t,P=>m(P)),v=h0(n),y=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&&u&&w&&S&&E){const P=i.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),K=E.getBoundingClientRect();if(i.dir!=="rtl"){const he=K.left-R.left,ne=D.left-he,ge=P.left-ne,ye=P.width+ge,De=Math.max(ye,R.width),Me=window.innerWidth-za,Ke=PE(ne,[za,Math.max(za,Me-De)]);c.style.minWidth=ye+"px",c.style.left=Ke+"px"}else{const he=R.right-K.right,ne=window.innerWidth-D.right-he,ge=window.innerWidth-P.right-ne,ye=P.width+ge,De=Math.max(ye,R.width),Me=window.innerWidth-za,Ke=PE(ne,[za,Math.max(za,Me-De)]);c.style.minWidth=ye+"px",c.style.right=Ke+"px"}const L=v(),I=window.innerHeight-za*2,G=w.scrollHeight,z=window.getComputedStyle(u),V=parseInt(z.borderTopWidth,10),k=parseInt(z.paddingTop,10),F=parseInt(z.borderBottomWidth,10),q=parseInt(z.paddingBottom,10),U=V+k+G+q+F,Y=Math.min(S.offsetHeight*5,U),B=window.getComputedStyle(w),$=parseInt(B.paddingTop,10),X=parseInt(B.paddingBottom,10),Z=P.top+P.height/2-za,ee=I-Z,ie=S.offsetHeight/2,ae=S.offsetTop+ie,re=V+k+ae,J=U-re;if(re<=Z){const he=L.length>0&&S===L[L.length-1].ref.current;c.style.bottom="0px";const ne=u.clientHeight-w.offsetTop-w.offsetHeight,ge=Math.max(ee,ie+(he?X:0)+ne+F),ye=re+ge;c.style.height=ye+"px"}else{const he=L.length>0&&S===L[0].ref.current;c.style.top="0px";const ge=Math.max(Z,V+w.offsetTop+(he?$:0)+ie)+J;c.style.height=ge+"px",w.scrollTop=re-Z+w.offsetTop}c.style.margin=`${za}px 0`,c.style.minHeight=Y+"px",c.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[v,i.trigger,i.valueNode,c,u,w,S,E,i.dir,r]);Hn(()=>j(),[j]);const[A,N]=x.useState();Hn(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const T=x.useCallback(P=>{P&&b.current===!0&&(j(),O==null||O(),b.current=!1)},[j,O]);return p.jsx(TJ,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:T,children:p.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:p.jsx(Ie.div,{...a,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});f$.displayName=AJ;var NJ="SelectPopperPosition",ME=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=za,...i}=e,s=m0(n);return p.jsx(qj,{...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=NJ;var[TJ,nC]=Qf(Cc,{}),kE="SelectViewport",d$=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=hl(kE,n),s=nC(kE,n),c=rt(t,i.onViewportChange),f=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,u=>{const m=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:v}=s;if(v!=null&&v.current&&d){const y=Math.abs(f.current-m.scrollTop);if(y>0){const b=window.innerHeight-za*2,w=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),E=Math.max(w,S);if(E<b){const O=E+y,j=Math.min(b,O),A=O-j;d.style.height=j+"px",d.style.bottom==="0px"&&(m.scrollTop=A>0?A:0,d.style.justifyContent="flex-end")}}}f.current=m.scrollTop})})})]})});d$.displayName=kE;var h$="SelectGroup",[PJ,MJ]=Qf(h$),kJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Un();return p.jsx(PJ,{scope:n,id:a,children:p.jsx(Ie.div,{role:"group","aria-labelledby":a,...r,ref:t})})});kJ.displayName=h$;var m$="SelectLabel",RJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=MJ(m$,n);return p.jsx(Ie.div,{id:a.id,...r,ref:t})});RJ.displayName=m$;var Ig="SelectItem",[DJ,p$]=Qf(Ig),v$=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...s}=e,c=dl(Ig,n),f=hl(Ig,n),u=c.value===r,[m,d]=x.useState(i??""),[v,y]=x.useState(!1),b=rt(t,O=>{var j;return(j=f.itemRefCallback)==null?void 0:j.call(f,O,r,a)}),w=Un(),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(DJ,{scope:n,value:r,disabled:a,textId:w,isSelected:u,onItemTextChange:x.useCallback(O=>{d(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":u&&v,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:b,onFocus:_e(s.onFocus,()=>y(!0)),onBlur:_e(s.onBlur,()=>y(!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=f.onItemLeave)==null||j.call(f):S.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(s.onPointerLeave,O=>{var j;O.currentTarget===document.activeElement&&((j=f.onItemLeave)==null||j.call(f))}),onKeyDown:_e(s.onKeyDown,O=>{var A;((A=f.searchRef)==null?void 0:A.current)!==""&&O.key===" "||(xJ.includes(O.key)&&E(),O.key===" "&&O.preventDefault())})})})})});v$.displayName=Ig;var _h="SelectItemText",g$=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,s=dl(_h,n),c=hl(_h,n),f=p$(_h,n),u=EJ(_h,n),[m,d]=x.useState(null),v=rt(t,E=>d(E),f.onItemTextChange,E=>{var O;return(O=c.itemTextRefCallback)==null?void 0:O.call(c,E,f.value,f.disabled)}),y=m==null?void 0:m.textContent,b=x.useMemo(()=>p.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=u;return Hn(()=>(w(b),()=>S(b)),[w,S,b]),p.jsxs(p.Fragment,{children:[p.jsx(Ie.span,{id:f.textId,...i,ref:v}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?fl.createPortal(i.children,s.valueNode):null]})});g$.displayName=_h;var y$="SelectItemIndicator",x$=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p$(y$,n).isSelected?p.jsx(Ie.span,{"aria-hidden":!0,...r,ref:t}):null});x$.displayName=y$;var RE="SelectScrollUpButton",b$=x.forwardRef((e,t)=>{const n=hl(RE,e.__scopeSelect),r=nC(RE,e.__scopeSelect),[a,i]=x.useState(!1),s=rt(t,r.onScrollButtonChange);return Hn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=f.scrollTop>0;i(u)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?p.jsx(S$,{...e,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop-f.offsetHeight)}}):null});b$.displayName=RE;var DE="SelectScrollDownButton",w$=x.forwardRef((e,t)=>{const n=hl(DE,e.__scopeSelect),r=nC(DE,e.__scopeSelect),[a,i]=x.useState(!1),s=rt(t,r.onScrollButtonChange);return Hn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=f.scrollHeight-f.clientHeight,m=Math.ceil(f.scrollTop)<u;i(m)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?p.jsx(S$,{...e,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop+f.offsetHeight)}}):null});w$.displayName=DE;var S$=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=hl("SelectScrollButton",n),s=x.useRef(null),c=h0(n),f=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>f(),[f]),Hn(()=>{var m;const u=c().find(d=>d.ref.current===document.activeElement);(m=u==null?void 0:u.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 u;(u=i.onItemLeave)==null||u.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:_e(a.onPointerLeave,()=>{f()})})}),IJ="SelectSeparator",LJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(Ie.div,{"aria-hidden":!0,...r,ref:t})});LJ.displayName=IJ;var IE="SelectArrow",zJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=m0(n),i=dl(IE,n),s=hl(IE,n);return i.open&&s.position==="popper"?p.jsx(Kj,{...a,...r,ref:t}):null});zJ.displayName=IE;var $J="SelectBubbleInput",E$=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=x.useRef(null),i=rt(r,a),s=mW(t);return x.useEffect(()=>{const c=a.current;if(!c)return;const f=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==t&&m){const d=new Event("change",{bubbles:!0});m.call(c,t),c.dispatchEvent(d)}},[s,t]),p.jsx(Ie.select,{...n,style:{...e4,...n.style},ref:i,defaultValue:t})});E$.displayName=$J;function _$(e){return e===""||e===void 0}function j$(e){const t=Zn(e),n=x.useRef(""),r=x.useRef(0),a=x.useCallback(s=>{const c=n.current+s;t(c),(function f(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(c)},[t]),i=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function C$(e,t,n){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=BJ(e,Math.max(i,0));a.length===1&&(s=s.filter(u=>u!==n));const f=s.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function BJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var UJ=t$,HJ=r$,FJ=i$,qJ=o$,KJ=s$,VJ=l$,YJ=d$,GJ=v$,XJ=g$,WJ=x$,QJ=b$,ZJ=w$,JJ="Separator",LM="horizontal",eee=["horizontal","vertical"],O$=x.forwardRef((e,t)=>{const{decorative:n,orientation:r=LM,...a}=e,i=tee(r)?r:LM,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})});O$.displayName=JJ;function tee(e){return eee.includes(e)}var nee=O$,p0="Tabs",[ree]=ti(p0,[o0]),A$=o0(),[aee,rC]=ree(p0),N$=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:c,activationMode:f="automatic",...u}=e,m=Sm(c),[d,v]=tl({prop:r,onChange:a,defaultProp:i??"",caller:p0});return p.jsx(aee,{scope:n,baseId:Un(),value:d,onValueChange:v,orientation:s,dir:m,activationMode:f,children:p.jsx(Ie.div,{dir:m,"data-orientation":s,...u,ref:t})})});N$.displayName=p0;var T$="TabsList",P$=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=rC(T$,n),s=A$(n);return p.jsx(o5,{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})})});P$.displayName=T$;var M$="TabsTrigger",k$=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,s=rC(M$,n),c=A$(n),f=I$(s.baseId,r),u=L$(s.baseId,r),m=r===s.value;return p.jsx(s5,{asChild:!0,...c,focusable:!a,active:m,children:p.jsx(Ie.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":u,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:f,...i,ref:t,onMouseDown:_e(e.onMouseDown,d=>{!a&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:_e(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:_e(e.onFocus,()=>{const d=s.activationMode!=="manual";!m&&!a&&d&&s.onValueChange(r)})})})});k$.displayName=M$;var R$="TabsContent",D$=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...s}=e,c=rC(R$,n),f=I$(c.baseId,r),u=L$(c.baseId,r),m=r===c.value,d=x.useRef(m);return x.useEffect(()=>{const v=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(v)},[]),p.jsx(hr,{present:a||m,children:({present:v})=>p.jsx(Ie.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:v&&i})})});D$.displayName=R$;function I$(e,t){return`${e}-trigger-${t}`}function L$(e,t){return`${e}-content-${t}`}var iee=N$,oee=P$,see=k$,lee=D$,[v0]=ti("Tooltip",[Wf]),g0=Wf(),z$="TooltipProvider",cee=700,LE="tooltip.open",[uee,aC]=v0(z$),$$=e=>{const{__scopeTooltip:t,delayDuration:n=cee,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,s=x.useRef(!0),c=x.useRef(!1),f=x.useRef(0);return x.useEffect(()=>{const u=f.current;return()=>window.clearTimeout(u)},[]),p.jsx(uee,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(f.current),s.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(u=>{c.current=u},[]),disableHoverableContent:a,children:i})};$$.displayName=z$;var Bh="Tooltip",[fee,Nm]=v0(Bh),B$=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,f=aC(Bh,e.__scopeTooltip),u=g0(t),[m,d]=x.useState(null),v=Un(),y=x.useRef(0),b=s??f.disableHoverableContent,w=c??f.delayDuration,S=x.useRef(!1),[E,O]=tl({prop:r,defaultProp:a??!1,onChange:P=>{P?(f.onOpen(),document.dispatchEvent(new CustomEvent(LE))):f.onClose(),i==null||i(P)},caller:Bh}),j=x.useMemo(()=>E?S.current?"delayed-open":"instant-open":"closed",[E]),A=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,S.current=!1,O(!0)},[O]),N=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,O(!1)},[O]),T=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{S.current=!0,O(!0),y.current=0},w)},[w,O]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),p.jsx(Hj,{...u,children:p.jsx(fee,{scope:t,contentId:v,open:E,stateAttribute:j,trigger:m,onTriggerChange:d,onTriggerEnter:x.useCallback(()=>{f.isOpenDelayedRef.current?T():A()},[f.isOpenDelayedRef,T,A]),onTriggerLeave:x.useCallback(()=>{b?N():(window.clearTimeout(y.current),y.current=0)},[N,b]),onOpen:A,onClose:N,disableHoverableContent:b,children:n})})};B$.displayName=Bh;var zE="TooltipTrigger",U$=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Nm(zE,n),i=aC(zE,n),s=g0(n),c=x.useRef(null),f=rt(t,c,a.onTriggerChange),u=x.useRef(!1),m=x.useRef(!1),d=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),p.jsx(Fj,{asChild:!0,...s,children:p.jsx(Ie.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:f,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(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:_e(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:_e(e.onBlur,a.onClose),onClick:_e(e.onClick,a.onClose)})})});U$.displayName=zE;var iC="TooltipPortal",[dee,hee]=v0(iC,{forceMount:void 0}),H$=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,i=Nm(iC,t);return p.jsx(dee,{scope:t,forceMount:n,children:p.jsx(hr,{present:n||i.open,children:p.jsx(_m,{asChild:!0,container:a,children:r})})})};H$.displayName=iC;var Cf="TooltipContent",F$=x.forwardRef((e,t)=>{const n=hee(Cf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,s=Nm(Cf,e.__scopeTooltip);return p.jsx(hr,{present:r||s.open,children:s.disableHoverableContent?p.jsx(q$,{side:a,...i,ref:t}):p.jsx(mee,{side:a,...i,ref:t})})}),mee=x.forwardRef((e,t)=>{const n=Nm(Cf,e.__scopeTooltip),r=aC(Cf,e.__scopeTooltip),a=x.useRef(null),i=rt(t,a),[s,c]=x.useState(null),{trigger:f,onClose:u}=n,m=a.current,{onPointerInTransitChange:d}=r,v=x.useCallback(()=>{c(null),d(!1)},[d]),y=x.useCallback((b,w)=>{const S=b.currentTarget,E={x:b.clientX,y:b.clientY},O=yee(E,S.getBoundingClientRect()),j=xee(E,O),A=bee(w.getBoundingClientRect()),N=See([...j,...A]);c(N),d(!0)},[d]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(f&&m){const b=S=>y(S,m),w=S=>y(S,f);return f.addEventListener("pointerleave",b),m.addEventListener("pointerleave",w),()=>{f.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",w)}}},[f,m,y,v]),x.useEffect(()=>{if(s){const b=w=>{const S=w.target,E={x:w.clientX,y:w.clientY},O=(f==null?void 0:f.contains(S))||(m==null?void 0:m.contains(S)),j=!wee(E,s);O?v():j&&(v(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[f,m,s,u,v]),p.jsx(q$,{...e,ref:i})}),[pee,vee]=v0(Bh,{isInside:!1}),gee=kG("TooltipContent"),q$=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,f=Nm(Cf,n),u=g0(n),{onClose:m}=f;return x.useEffect(()=>(document.addEventListener(LE,m),()=>document.removeEventListener(LE,m)),[m]),x.useEffect(()=>{if(f.trigger){const d=v=>{const y=v.target;y!=null&&y.contains(f.trigger)&&m()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[f.trigger,m]),p.jsx(Em,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:m,children:p.jsxs(qj,{"data-state":f.stateAttribute,...u,...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(gee,{children:r}),p.jsx(pee,{scope:n,isInside:!0,children:p.jsx($G,{id:f.contentId,role:"tooltip",children:a||r})})]})})});F$.displayName=Cf;var K$="TooltipArrow",V$=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=g0(n);return vee(K$,n).isInside?null:p.jsx(Kj,{...a,...r,ref:t})});V$.displayName=K$;function yee(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 xee(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 bee(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 wee(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],f=t[s],u=c.x,m=c.y,d=f.x,v=f.y;m>r!=v>r&&n<(d-u)*(r-m)/(v-m)+u&&(a=!a)}return a}function See(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),Eee(t)}function Eee(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 _ee=$$,jee=B$,Cee=U$,Oee=H$,Aee=F$,Nee=V$;function Y$(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=Y$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ct(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Y$(e))&&(r&&(r+=" "),r+=t);return r}const Tee=(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},Pee=(e,t)=>({classGroupId:e,validator:t}),G$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lg="-",zM=[],Mee="arbitrary..",kee=e=>{const t=Dee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Ree(s);const c=s.split(Lg),f=c[0]===""&&c.length>1?1:0;return X$(c,f,t)},getConflictingClassGroupIds:(s,c)=>{if(c){const f=r[s],u=n[s];return f?u?Tee(u,f):f:u||zM}return n[s]||zM}}},X$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],i=n.nextPart.get(a);if(i){const u=X$(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const c=t===0?e.join(Lg):e.slice(t).join(Lg),f=s.length;for(let u=0;u<f;u++){const m=s[u];if(m.validator(c))return m.classGroupId}},Ree=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?Mee+r:void 0})(),Dee=e=>{const{theme:t,classGroups:n}=e;return Iee(n,t)},Iee=(e,t)=>{const n=G$();for(const r in e){const a=e[r];oC(a,n,r,t)}return n},oC=(e,t,n,r)=>{const a=e.length;for(let i=0;i<a;i++){const s=e[i];Lee(s,t,n,r)}},Lee=(e,t,n,r)=>{if(typeof e=="string"){zee(e,t,n);return}if(typeof e=="function"){$ee(e,t,n,r);return}Bee(e,t,n,r)},zee=(e,t,n)=>{const r=e===""?t:W$(t,e);r.classGroupId=n},$ee=(e,t,n,r)=>{if(Uee(e)){oC(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Pee(n,e))},Bee=(e,t,n,r)=>{const a=Object.entries(e),i=a.length;for(let s=0;s<i;s++){const[c,f]=a[s];oC(f,W$(t,c),n,r)}},W$=(e,t)=>{let n=e;const r=t.split(Lg),a=r.length;for(let i=0;i<a;i++){const s=r[i];let c=n.nextPart.get(s);c||(c=G$(),n.nextPart.set(s,c)),n=c}return n},Uee=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Hee=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="!",$M=":",Fee=[],BM=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),qee=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const i=[];let s=0,c=0,f=0,u;const m=a.length;for(let w=0;w<m;w++){const S=a[w];if(s===0&&c===0){if(S===$M){i.push(a.slice(f,w)),f=w+1;continue}if(S==="/"){u=w;continue}}S==="["?s++:S==="]"?s--:S==="("?c++:S===")"&&c--}const d=i.length===0?a:a.slice(f);let v=d,y=!1;d.endsWith($E)?(v=d.slice(0,-1),y=!0):d.startsWith($E)&&(v=d.slice(1),y=!0);const b=u&&u>f?u-f:void 0;return BM(i,y,v,b)};if(t){const a=t+$M,i=r;r=s=>s.startsWith(a)?i(s.slice(a.length)):BM(Fee,!1,s,void 0,!0)}if(n){const a=r;r=i=>n({className:i,parseClassName:a})}return r},Kee=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]==="[",f=t.has(s);c||f?(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}},Vee=e=>({cache:Hee(e.cacheSize),parseClassName:qee(e),sortModifiers:Kee(e),...kee(e)}),Yee=/\s+/,Gee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:i}=t,s=[],c=e.trim().split(Yee);let f="";for(let u=c.length-1;u>=0;u-=1){const m=c[u],{isExternal:d,modifiers:v,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:w}=n(m);if(d){f=m+(f.length>0?" "+f:f);continue}let S=!!w,E=r(S?b.substring(0,w):b);if(!E){if(!S){f=m+(f.length>0?" "+f:f);continue}if(E=r(b),!E){f=m+(f.length>0?" "+f:f);continue}S=!1}const O=v.length===0?"":v.length===1?v[0]:i(v).join(":"),j=y?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)}f=m+(f.length>0?" "+f:f)}return f},Xee=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=Q$(n))&&(a&&(a+=" "),a+=r);return a},Q$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Q$(e[r]))&&(n&&(n+=" "),n+=t);return n},Wee=(e,...t)=>{let n,r,a,i;const s=f=>{const u=t.reduce((m,d)=>d(m),e());return n=Vee(u),r=n.cache.get,a=n.cache.set,i=c,c(f)},c=f=>{const u=r(f);if(u)return u;const m=Gee(f,n);return a(f,m),m};return i=s,(...f)=>i(Xee(...f))},Qee=[],Cn=e=>{const t=n=>n[e]||Qee;return t.isThemeGetter=!0,t},Z$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,J$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zee=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Jee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ete=/\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$/,tte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nte=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,As=e=>Zee.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),Ns=e=>!!e&&Number.isInteger(Number(e)),o1=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),fo=e=>Jee.test(e),eB=()=>!0,ate=e=>ete.test(e)&&!tte.test(e),sC=()=>!1,ite=e=>nte.test(e),ote=e=>rte.test(e),ste=e=>!Pe(e)&&!ke(e),lte=e=>ml(e,rB,sC),Pe=e=>Z$.test(e),Vl=e=>ml(e,aB,ate),UM=e=>ml(e,vte,Xe),cte=e=>ml(e,oB,eB),ute=e=>ml(e,iB,sC),HM=e=>ml(e,tB,sC),fte=e=>ml(e,nB,ote),Rv=e=>ml(e,sB,ite),ke=e=>J$.test(e),ih=e=>qc(e,aB),dte=e=>qc(e,iB),FM=e=>qc(e,tB),hte=e=>qc(e,rB),mte=e=>qc(e,nB),Dv=e=>qc(e,sB,!0),pte=e=>qc(e,oB,!0),ml=(e,t,n)=>{const r=Z$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qc=(e,t,n=!1)=>{const r=J$.exec(e);return r?r[1]?t(r[1]):n:!1},tB=e=>e==="position"||e==="percentage",nB=e=>e==="image"||e==="url",rB=e=>e==="length"||e==="size"||e==="bg-size",aB=e=>e==="length",vte=e=>e==="number",iB=e=>e==="family-name",oB=e=>e==="number"||e==="weight",sB=e=>e==="shadow",gte=()=>{const e=Cn("color"),t=Cn("font"),n=Cn("text"),r=Cn("font-weight"),a=Cn("tracking"),i=Cn("leading"),s=Cn("breakpoint"),c=Cn("container"),f=Cn("spacing"),u=Cn("radius"),m=Cn("shadow"),d=Cn("inset-shadow"),v=Cn("text-shadow"),y=Cn("drop-shadow"),b=Cn("blur"),w=Cn("perspective"),S=Cn("aspect"),E=Cn("ease"),O=Cn("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,f],D=()=>[As,"full","auto",...R()],K=()=>[Ns,"none","subgrid",ke,Pe],L=()=>["auto",{span:["full",Ns,ke,Pe]},Ns,ke,Pe],I=()=>[Ns,"auto",ke,Pe],G=()=>["auto","min","max","fr",ke,Pe],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...R()],F=()=>[As,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],q=()=>[As,"screen","full","dvw","lvw","svw","min","max","fit",...R()],U=()=>[As,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],Y=()=>[e,ke,Pe],B=()=>[...A(),FM,HM,{position:[ke,Pe]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",hte,lte,{size:[ke,Pe]}],Z=()=>[o1,ih,Vl],ee=()=>["","none","full",u,ke,Pe],ie=()=>["",Xe,ih,Vl],ae=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[Xe,o1,FM,HM],le=()=>["","none",b,ke,Pe],he=()=>["none",Xe,ke,Pe],ne=()=>["none",Xe,ke,Pe],ge=()=>[Xe,ke,Pe],ye=()=>[As,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fo],breakpoint:[fo],color:[eB],container:[fo],"drop-shadow":[fo],ease:["in","out","in-out"],font:[ste],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fo],shadow:[fo],spacing:["px",Xe],text:[fo],"text-shadow":[fo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",As,Pe,ke,S]}],container:["container"],columns:[{columns:[Xe,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:[Ns,"auto",ke,Pe]}],basis:[{basis:[As,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,As,"auto","initial","none",Pe]}],grow:[{grow:["",Xe,ke,Pe]}],shrink:[{shrink:["",Xe,ke,Pe]}],order:[{order:[Ns,"first","last","none",ke,Pe]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:L()}],"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:[...z(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],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:F()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[c,"screen",...F()]}],"min-w":[{"min-w":[c,"screen","none",...F()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[s]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,ih,Vl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pte,cte]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",o1,Pe]}],"font-family":[{font:[dte,ute,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":[Xe,"none",ke,UM]}],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:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",ke,Vl]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Xe,"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"]},Ns,ke,Pe],radial:["",ke,Pe],conic:[Ns,ke,Pe]},mte,fte]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],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:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,ke,Pe]}],"outline-w":[{outline:["",Xe,ih,Vl]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",m,Dv,Rv]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",d,Dv,Rv]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Xe,Vl]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",v,Dv,Rv]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Xe,ke,Pe]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"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":[Xe]}],"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":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"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":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"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":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"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":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"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":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"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":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"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":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"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":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"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":[Xe]}],"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":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"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:le()}],brightness:[{brightness:[Xe,ke,Pe]}],contrast:[{contrast:[Xe,ke,Pe]}],"drop-shadow":[{"drop-shadow":["","none",y,Dv,Rv]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Xe,ke,Pe]}],"hue-rotate":[{"hue-rotate":[Xe,ke,Pe]}],invert:[{invert:["",Xe,ke,Pe]}],saturate:[{saturate:[Xe,ke,Pe]}],sepia:[{sepia:["",Xe,ke,Pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Pe]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,ke,Pe]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,ke,Pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,ke,Pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,ke,Pe]}],"backdrop-invert":[{"backdrop-invert":["",Xe,ke,Pe]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,ke,Pe]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,ke,Pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,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:[Xe,"initial",ke,Pe]}],ease:[{ease:["linear","initial",E,ke,Pe]}],delay:[{delay:[Xe,ke,Pe]}],animate:[{animate:["none",O,ke,Pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ke,Pe]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],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:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"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",...Y()]}],"stroke-w":[{stroke:[Xe,ih,Vl,UM]}],stroke:[{stroke:["none",...Y()]}],"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"]}},yte=Wee(gte);function Ce(...e){return yte(ct(e))}function lB({delayDuration:e=0,...t}){return p.jsx(_ee,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function xte({...e}){return p.jsx(jee,{"data-slot":"tooltip",...e})}function bte({...e}){return p.jsx(Cee,{"data-slot":"tooltip-trigger",...e})}function wte({className:e,sideOffset:t=0,children:n,...r}){return p.jsx(Oee,{children:p.jsxs(Aee,{"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(Nee,{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 cB=(...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 Ste=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 Ete=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 qM=e=>{const t=Ete(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 _te={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 jte=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 Cte=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:s,...c},f)=>x.createElement("svg",{ref:f,..._te,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:cB("lucide",a),...!i&&!jte(c)&&{"aria-hidden":"true"},...c},[...s.map(([u,m])=>x.createElement(u,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(Cte,{ref:i,iconNode:t,className:cB(`lucide-${Ste(qM(e))}`,`lucide-${e}`,r),...a}));return n.displayName=qM(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 Ote=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ate=Fe("arrow-down",Ote);/**
 * @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=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],lC=Fe("arrow-left",Nte);/**
 * @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 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"}]],uB=Fe("bot",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 Pte=[["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"}]],fB=Fe("brain",Pte);/**
 * @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:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cC=Fe("check",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:"m6 9 6 6 6-6",key:"qrunsl"}]],Uh=Fe("chevron-down",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:"m15 18-6-6 6-6",key:"1wnfg3"}]],Dte=Fe("chevron-left",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 Ite=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],y0=Fe("chevron-right",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:"m18 15-6-6-6 6",key:"153udz"}]],zte=Fe("chevron-up",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:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Bte=Fe("chevrons-up-down",$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 Ute=[["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"}]],ko=Fe("circle-alert",Ute);/**
 * @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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],uC=Fe("circle-check",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 Fte=[["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"}]],dB=Fe("circle-x",Fte);/**
 * @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"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Kte=Fe("clock",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 Vte=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Yte=Fe("corner-down-left",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 Gte=[["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"}]],x0=Fe("download",Gte);/**
 * @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:"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"}]],Wte=Fe("external-link",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:"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"}]],Zte=Fe("eye-off",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 Jte=[["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"}]],ene=Fe("eye",Jte);/**
 * @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:"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"}]],zg=Fe("folder-kanban",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 nne=[["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"}]],rne=Fe("folder-up",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:"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"}]],ine=Fe("folder",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 one=[["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"}]],sne=Fe("house",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 lne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],cne=Fe("info",lne);/**
 * @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:"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"}]],fne=Fe("key-round",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 dne=[["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"}]],hB=Fe("layout-dashboard",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:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Hh=Fe("loader-circle",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 mne=[["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"}]],mB=Fe("message-square",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 pne=[["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"}]],vne=Fe("monitor",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 gne=[["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"}]],pB=Fe("moon",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=[["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"}]],vB=Fe("octagon-x",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 xne=[["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"}]],bne=Fe("paperclip",xne);/**
 * @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=[["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"}]],Sne=Fe("pause",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 Ene=[["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",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 _ne=[["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"}]],dC=Fe("play",_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 jne=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$g=Fe("plus",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:"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"}]],gB=Fe("save",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:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yB=Fe("search",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:"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"}]],Nne=Fe("send",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 Tne=[["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"}]],xB=Fe("settings",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 Pne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Mne=Fe("square",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 kne=[["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"}]],bB=Fe("sun",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 Rne=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Dne=Fe("terminal",Rne);/**
 * @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:"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"}]],pl=Fe("trash-2",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 Lne=[["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"}]],zne=Fe("triangle-alert",Lne);/**
 * @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:"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"}]],Bne=Fe("upload",$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:"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"}]],wB=Fe("users",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:"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"}]],SB=Fe("wrench",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:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hC=Fe("x",Fne);function qne(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 Kne=e=>{switch(e){case"success":return Gne;case"info":return Wne;case"warning":return Xne;case"error":return Qne;default:return null}},Vne=Array(12).fill(0),Yne=({visible:e,className:t})=>xe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},xe.createElement("div",{className:"sonner-spinner"},Vne.map((n,r)=>xe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Gne=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.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"})),Xne=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},xe.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"})),Wne=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.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"})),Qne=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.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"})),Zne=xe.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"},xe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),xe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Jne=()=>{const[e,t]=xe.useState(document.hidden);return xe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let BE=1;class ere{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:BE++,s=this.toasts.find(f=>f.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(f=>f.id===i?(this.publish({...f,...t,id:i,title:r}),{...f,...t,id:i,dismissible:c,title:r}):f):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 u=>{if(s=["resolve",u],xe.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(nre(u)&&!u.ok){i=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,b=typeof d=="object"&&!xe.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:v,...b})}else if(u instanceof Error){i=!1;const d=typeof n.error=="function"?await n.error(u):n.error,v=typeof n.description=="function"?await n.description(u):n.description,b=typeof d=="object"&&!xe.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:v,...b})}else if(n.success!==void 0){i=!1;const d=typeof n.success=="function"?await n.success(u):n.success,v=typeof n.description=="function"?await n.description(u):n.description,b=typeof d=="object"&&!xe.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:v,...b})}}).catch(async u=>{if(s=["reject",u],n.error!==void 0){i=!1;const m=typeof n.error=="function"?await n.error(u):n.error,d=typeof n.description=="function"?await n.description(u):n.description,y=typeof m=="object"&&!xe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:d,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((u,m)=>c.then(()=>s[0]==="reject"?m(s[1]):u(s[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||BE++;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 ere,tre=(e,t)=>{const n=(t==null?void 0:t.id)||BE++;return kr.addToast({title:e,...t,id:n}),n},nre=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",rre=tre,are=()=>kr.toasts,ire=()=>kr.getActiveToasts(),xt=Object.assign(rre,{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:are,getToasts:ire});qne("[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 Iv(e){return e.label!==void 0}const ore=3,sre="24px",lre="16px",KM=4e3,cre=356,ure=14,fre=45,dre=200;function mi(...e){return e.filter(Boolean).join(" ")}function hre(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const mre=e=>{var t,n,r,a,i,s,c,f,u;const{invert:m,toast:d,unstyled:v,interacting:y,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:L="",duration:I,position:G,gap:z,expandByDefault:V,classNames:k,icons:F,closeButtonAriaLabel:q="Close toast"}=e,[U,Y]=xe.useState(null),[B,$]=xe.useState(null),[X,Z]=xe.useState(!1),[ee,ie]=xe.useState(!1),[ae,re]=xe.useState(!1),[J,le]=xe.useState(!1),[he,ne]=xe.useState(!1),[ge,ye]=xe.useState(0),[De,Me]=xe.useState(0),Ke=xe.useRef(d.duration||I||KM),Bt=xe.useRef(null),ut=xe.useRef(null),Sn=E===0,we=E+1<=w,Tt=d.type,Ee=d.dismissible!==!1,dt=d.className||"",En=d.descriptionClassName||"",er=xe.useMemo(()=>S.findIndex(qe=>qe.toastId===d.id)||0,[S,d.id]),ii=xe.useMemo(()=>{var qe;return(qe=d.closeButton)!=null?qe:T},[d.closeButton,T]),oi=xe.useMemo(()=>d.duration||I||KM,[d.duration,I]),_l=xe.useRef(0),zr=xe.useRef(0),Jc=xe.useRef(0),si=xe.useRef(null),[Hi,Kn]=G.split("-"),$r=xe.useMemo(()=>S.reduce((qe,kt,un)=>un>=er?qe:qe+kt.height,0),[S,er]),Dn=Jne(),ud=d.invert||m,jl=Tt==="loading";zr.current=xe.useMemo(()=>er*z+$r,[er,$r]),xe.useEffect(()=>{Ke.current=oi},[oi]),xe.useEffect(()=>{Z(!0)},[]),xe.useEffect(()=>{const qe=ut.current;if(qe){const kt=qe.getBoundingClientRect().height;return Me(kt),b(un=>[{toastId:d.id,height:kt,position:d.position},...un]),()=>b(un=>un.filter(In=>In.toastId!==d.id))}},[b,d.id]),xe.useLayoutEffect(()=>{if(!X)return;const qe=ut.current,kt=qe.style.height;qe.style.height="auto";const un=qe.getBoundingClientRect().height;qe.style.height=kt,Me(un),b(In=>In.find(Dt=>Dt.toastId===d.id)?In.map(Dt=>Dt.toastId===d.id?{...Dt,height:un}:Dt):[{toastId:d.id,height:un,position:d.position},...In])},[X,d.title,d.description,b,d.id,d.jsx,d.action,d.cancel]);const la=xe.useCallback(()=>{ie(!0),ye(zr.current),b(qe=>qe.filter(kt=>kt.toastId!==d.id)),setTimeout(()=>{A(d)},dre)},[d,A,b,zr]);xe.useEffect(()=>{if(d.promise&&Tt==="loading"||d.duration===1/0||d.type==="loading")return;let qe;return j||y||Dn?(()=>{if(Jc.current<_l.current){const In=new Date().getTime()-_l.current;Ke.current=Ke.current-In}Jc.current=new Date().getTime()})():(()=>{Ke.current!==1/0&&(_l.current=new Date().getTime(),qe=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),la()},Ke.current))})(),()=>clearTimeout(qe)},[j,y,d,Tt,Dn,la]),xe.useEffect(()=>{d.delete&&(la(),d.onDismiss==null||d.onDismiss.call(d,d))},[la,d.delete]);function Wo(){var qe;if(F!=null&&F.loading){var kt;return xe.createElement("div",{className:mi(k==null?void 0:k.loader,d==null||(kt=d.classNames)==null?void 0:kt.loader,"sonner-loader"),"data-visible":Tt==="loading"},F.loading)}return xe.createElement(Yne,{className:mi(k==null?void 0:k.loader,d==null||(qe=d.classNames)==null?void 0:qe.loader),visible:Tt==="loading"})}const Qo=d.icon||(F==null?void 0:F[Tt])||Kne(Tt);var Fi,ca;return xe.createElement("li",{tabIndex:0,ref:ut,className:mi(K,dt,k==null?void 0:k.toast,d==null||(t=d.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[Tt],d==null||(n=d.classNames)==null?void 0:n[Tt]),"data-sonner-toast":"","data-rich-colors":(Fi=d.richColors)!=null?Fi:N,"data-styled":!(d.jsx||d.unstyled||v),"data-mounted":X,"data-promise":!!d.promise,"data-swiped":he,"data-removed":ee,"data-visible":we,"data-y-position":Hi,"data-x-position":Kn,"data-index":E,"data-front":Sn,"data-swiping":ae,"data-dismissible":Ee,"data-type":Tt,"data-invert":ud,"data-swipe-out":J,"data-swipe-direction":B,"data-expanded":!!(j||V&&X),"data-testid":d.testId,style:{"--index":E,"--toasts-before":E,"--z-index":O.length-E,"--offset":`${ee?ge:zr.current}px`,"--initial-height":V?"auto":`${De}px`,...P,...d.style},onDragEnd:()=>{re(!1),Y(null),si.current=null},onPointerDown:qe=>{qe.button!==2&&(jl||!Ee||(Bt.current=new Date,ye(zr.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(re(!0),si.current={x:qe.clientX,y:qe.clientY})))},onPointerUp:()=>{var qe,kt,un;if(J||!Ee)return;si.current=null;const In=Number(((qe=ut.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),li=Number(((kt=ut.current)==null?void 0:kt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Dt=new Date().getTime()-((un=Bt.current)==null?void 0:un.getTime()),tr=U==="x"?In:li,qi=Math.abs(tr)/Dt;if(Math.abs(tr)>=fre||qi>.11){ye(zr.current),d.onDismiss==null||d.onDismiss.call(d,d),$(U==="x"?In>0?"right":"left":li>0?"down":"up"),la(),le(!0);return}else{var nr,rr;(nr=ut.current)==null||nr.style.setProperty("--swipe-amount-x","0px"),(rr=ut.current)==null||rr.style.setProperty("--swipe-amount-y","0px")}ne(!1),re(!1),Y(null)},onPointerMove:qe=>{var kt,un,In;if(!si.current||!Ee||((kt=window.getSelection())==null?void 0:kt.toString().length)>0)return;const Dt=qe.clientY-si.current.y,tr=qe.clientX-si.current.x;var qi;const nr=(qi=e.swipeDirections)!=null?qi:hre(G);!U&&(Math.abs(tr)>1||Math.abs(Dt)>1)&&Y(Math.abs(tr)>Math.abs(Dt)?"x":"y");let rr={x:0,y:0};const Zo=Br=>1/(1.5+Math.abs(Br)/20);if(U==="y"){if(nr.includes("top")||nr.includes("bottom"))if(nr.includes("top")&&Dt<0||nr.includes("bottom")&&Dt>0)rr.y=Dt;else{const Br=Dt*Zo(Dt);rr.y=Math.abs(Br)<Math.abs(Dt)?Br:Dt}}else if(U==="x"&&(nr.includes("left")||nr.includes("right")))if(nr.includes("left")&&tr<0||nr.includes("right")&&tr>0)rr.x=tr;else{const Br=tr*Zo(tr);rr.x=Math.abs(Br)<Math.abs(tr)?Br:tr}(Math.abs(rr.x)>0||Math.abs(rr.y)>0)&&ne(!0),(un=ut.current)==null||un.style.setProperty("--swipe-amount-x",`${rr.x}px`),(In=ut.current)==null||In.style.setProperty("--swipe-amount-y",`${rr.y}px`)}},ii&&!d.jsx&&Tt!=="loading"?xe.createElement("button",{"aria-label":q,"data-disabled":jl,"data-close-button":!0,onClick:jl||!Ee?()=>{}:()=>{la(),d.onDismiss==null||d.onDismiss.call(d,d)},className:mi(k==null?void 0:k.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(ca=F==null?void 0:F.close)!=null?ca:Zne):null,(Tt||d.icon||d.promise)&&d.icon!==null&&((F==null?void 0:F[Tt])!==null||d.icon)?xe.createElement("div",{"data-icon":"",className:mi(k==null?void 0:k.icon,d==null||(a=d.classNames)==null?void 0:a.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Wo():null,d.type!=="loading"?Qo:null):null,xe.createElement("div",{"data-content":"",className:mi(k==null?void 0:k.content,d==null||(i=d.classNames)==null?void 0:i.content)},xe.createElement("div",{"data-title":"",className:mi(k==null?void 0:k.title,d==null||(s=d.classNames)==null?void 0:s.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?xe.createElement("div",{"data-description":"",className:mi(L,En,k==null?void 0:k.description,d==null||(c=d.classNames)==null?void 0:c.description)},typeof d.description=="function"?d.description():d.description):null),xe.isValidElement(d.cancel)?d.cancel:d.cancel&&Iv(d.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||R,onClick:qe=>{Iv(d.cancel)&&Ee&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,qe),la())},className:mi(k==null?void 0:k.cancelButton,d==null||(f=d.classNames)==null?void 0:f.cancelButton)},d.cancel.label):null,xe.isValidElement(d.action)?d.action:d.action&&Iv(d.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||D,onClick:qe=>{Iv(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,qe),!qe.defaultPrevented&&la())},className:mi(k==null?void 0:k.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function VM(){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 pre(e,t){const n={};return[e,t].forEach((r,a)=>{const i=a===1,s=i?"--mobile-offset":"--offset",c=i?lre:sre;function f(u){["top","right","bottom","left"].forEach(m=>{n[`${s}-${m}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=c:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):f(c)}),n}const vre=xe.forwardRef(function(t,n){const{id:r,invert:a,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:c,closeButton:f,className:u,offset:m,mobileOffset:d,theme:v="light",richColors:y,duration:b,style:w,visibleToasts:S=ore,toastOptions:E,dir:O=VM(),gap:j=ure,icons:A,containerAriaLabel:N="Notifications"}=t,[T,P]=xe.useState([]),R=xe.useMemo(()=>r?T.filter(X=>X.toasterId===r):T.filter(X=>!X.toasterId),[T,r]),D=xe.useMemo(()=>Array.from(new Set([i].concat(R.filter(X=>X.position).map(X=>X.position)))),[R,i]),[K,L]=xe.useState([]),[I,G]=xe.useState(!1),[z,V]=xe.useState(!1),[k,F]=xe.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=xe.useRef(null),U=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),Y=xe.useRef(null),B=xe.useRef(!1),$=xe.useCallback(X=>{P(Z=>{var ee;return(ee=Z.find(ie=>ie.id===X.id))!=null&&ee.delete||kr.dismiss(X.id),Z.filter(({id:ie})=>ie!==X.id)})},[]);return xe.useEffect(()=>kr.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{P(Z=>Z.map(ee=>ee.id===X.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{Rz.flushSync(()=>{P(Z=>{const ee=Z.findIndex(ie=>ie.id===X.id);return ee!==-1?[...Z.slice(0,ee),{...Z[ee],...X},...Z.slice(ee+1)]:[X,...Z]})})})}),[T]),xe.useEffect(()=>{if(v!=="system"){F(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:Z})=>{F(Z?"dark":"light")})}catch{X.addListener(({matches:ee})=>{try{F(ee?"dark":"light")}catch(ie){console.error(ie)}})}},[v]),xe.useEffect(()=>{T.length<=1&&G(!1)},[T]),xe.useEffect(()=>{const X=Z=>{var ee;if(s.every(re=>Z[re]||Z.code===re)){var ae;G(!0),(ae=q.current)==null||ae.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]),xe.useEffect(()=>{if(q.current)return()=>{Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null,B.current=!1)}},[q.current]),xe.createElement("section",{ref:n,"aria-label":`${N} ${U}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((X,Z)=>{var ee;const[ie,ae]=X.split("-");return R.length?xe.createElement("ol",{key:X,dir:O==="auto"?VM():O,tabIndex:-1,ref:q,className:u,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":ie,"data-x-position":ae,style:{"--front-toast-height":`${((ee=K[0])==null?void 0:ee.height)||0}px`,"--width":`${cre}px`,"--gap":`${j}px`,...w,...pre(m,d)},onBlur:re=>{B.current&&!re.currentTarget.contains(re.relatedTarget)&&(B.current=!1,Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||B.current||(B.current=!0,Y.current=re.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{z||G(!1)},onDragEnd:()=>G(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},R.filter(re=>!re.position&&Z===0||re.position===X).map((re,J)=>{var le,he;return xe.createElement(mre,{key:re.id,icons:A,index:J,toast:re,defaultRichColors:y,duration:(le=E==null?void 0:E.duration)!=null?le:b,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:a,visibleToasts:S,closeButton:(he=E==null?void 0:E.closeButton)!=null?he:f,interacting:z,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==re.position),heights:K.filter(ne=>ne.position==re.position),setHeights:L,expandByDefault:c,gap:j,expanded:I,swipeDirections:t.swipeDirections})})):null}))}),gre=({...e})=>{const{theme:t="system"}=yj();return p.jsx(vre,{theme:t,className:"toaster group",icons:{success:p.jsx(uC,{className:"size-4"}),info:p.jsx(cne,{className:"size-4"}),warning:p.jsx(zne,{className:"size-4"}),error:p.jsx(vB,{className:"size-4"}),loading:p.jsx(Hh,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},yre=new vG({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),EB="/api";class _B extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function oh(e,t){const n=`${EB}${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 _B(i.status,i.statusText,s)}if(!(i.status===204||i.headers.get("content-length")==="0"))return i.json()}async function xre(e,t){const n=`${EB}${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 _B(i.status,i.statusText,s)}return i.json()}const $e={get:e=>oh(e),post:(e,t)=>oh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>oh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>oh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>oh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),xre(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 Zf(){return xn({queryKey:Be.projects.all,queryFn:()=>$e.get("/projects")})}function mC(e,t){return xn({queryKey:Be.projects.detail(e),queryFn:()=>$e.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function jB(e){return xn({queryKey:Be.projects.files(e),queryFn:()=>$e.get(`/projects/${e}/files`)})}function pC(e,t){return xn({queryKey:Be.projects.config(e),queryFn:()=>$e.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function YM(e,t){return xn({queryKey:Be.conversations.detail(e),queryFn:()=>$e.get(`/conversations/${e}`),...t})}function CB(e,t=1,n=20){return xn({queryKey:[...Be.conversations.all(e),t,n],queryFn:()=>$e.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function OB(){const e=vt();return At({mutationFn:t=>$e.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.conversations.all(n.project_id)})}})}function bre(e){const t=vt();return At({mutationFn:n=>$e.post(`/conversations/${e}/tasks`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Be.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]})}})}function vC(e){const t=vt();return At({mutationFn:({conversationId:n,title:r})=>$e.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:Be.conversations.all(e)}),t.invalidateQueries({queryKey:Be.conversations.detail(r)})}})}function AB(e){const t=vt();return At({mutationFn:n=>$e.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 et({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 wre=500;function Sre({onCommandPalette:e,onShortcutsHelp:t}){const n=ul(),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},wre);return}}}}return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),clearTimeout(a.current)}},[n,e,t])}function NB(e){const t=e?"?"+new URLSearchParams(e).toString():"";return xn({queryKey:Be.sessions.all(e),queryFn:()=>$e.get(`/sessions${t}`)})}function gC(){return NB({status:"running",per_page:"50"})}function Ere(){return NB({per_page:"10"})}function _re(e,t=1,n=20){return xn({queryKey:[...Be.projects.sessions(e),t,n],queryFn:()=>$e.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function jre(e,t,n){return xn({queryKey:Be.sessions.detail(e,t),queryFn:()=>$e.get(`/projects/${e}/sessions/${t}`),...n})}var GM=1,Cre=.9,Ore=.8,Are=.17,s1=.1,l1=.999,Nre=.9999,Tre=.99,Pre=/[\\\/_+.#"@\[\(\{&]/,Mre=/[\\\/_+.#"@\[\(\{&]/g,kre=/[\s-]/,TB=/[\s-]/g;function UE(e,t,n,r,a,i,s){if(i===t.length)return a===e.length?GM:Tre;var c=`${a},${i}`;if(s[c]!==void 0)return s[c];for(var f=r.charAt(i),u=n.indexOf(f,a),m=0,d,v,y,b;u>=0;)d=UE(e,t,n,r,u+1,i+1,s),d>m&&(u===a?d*=GM:Pre.test(e.charAt(u-1))?(d*=Ore,y=e.slice(a,u-1).match(Mre),y&&a>0&&(d*=Math.pow(l1,y.length))):kre.test(e.charAt(u-1))?(d*=Cre,b=e.slice(a,u-1).match(TB),b&&a>0&&(d*=Math.pow(l1,b.length))):(d*=Are,a>0&&(d*=Math.pow(l1,u-a))),e.charAt(u)!==t.charAt(i)&&(d*=Nre)),(d<s1&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(v=UE(e,t,n,r,u+1,i+2,s),v*s1>d&&(d=v*s1)),d>m&&(m=d),u=n.indexOf(f,u+1);return s[c]=m,m}function XM(e){return e.toLowerCase().replace(TB," ")}function Rre(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,UE(e,t,XM(e),XM(t),0,0,{})}var sh='[cmdk-group=""]',c1='[cmdk-group-items=""]',Dre='[cmdk-group-heading=""]',PB='[cmdk-item=""]',WM=`${PB}:not([aria-disabled="true"])`,HE="cmdk-item-select",Yu="data-value",Ire=(e,t,n)=>Rre(e,t,n),MB=x.createContext(void 0),Tm=()=>x.useContext(MB),kB=x.createContext(void 0),yC=()=>x.useContext(kB),RB=x.createContext(void 0),DB=x.forwardRef((e,t)=>{let n=Gu(()=>{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=Gu(()=>new Set),a=Gu(()=>new Map),i=Gu(()=>new Map),s=Gu(()=>new Set),c=IB(e),{label:f,children:u,value:m,onValueChange:d,filter:v,shouldFilter:y,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...E}=e,O=Un(),j=Un(),A=Un(),N=x.useRef(null),T=Yre();Oc(()=>{if(m!==void 0){let $=m.trim();n.current.value=$,P.emit()}},[m]),Oc(()=>{T(6,G)},[]);let P=x.useMemo(()=>({subscribe:$=>(s.current.add($),()=>s.current.delete($)),snapshot:()=>n.current,setState:($,X,Z)=>{var ee,ie,ae,re;if(!Object.is(n.current[$],X)){if(n.current[$]=X,$==="search")I(),K(),T(1,L);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=z())==null?void 0:J.id,P.emit()}),Z||T(5,G),((ie=c.current)==null?void 0:ie.value)!==void 0){let J=X??"";(re=(ae=c.current).onValueChange)==null||re.call(ae,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||L(),P.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let Z=z();T(4,()=>{I(),(Z==null?void 0:Z.getAttribute("id"))===$&&L(),P.emit()})}),group:$=>(a.current.has($)||a.current.set($,new Set),()=>{i.current.delete($),a.current.delete($)}),filter:()=>c.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:O,inputId:A,labelId:j,listInnerRef:N}),[]);function D($,X){var Z,ee;let ie=(ee=(Z=c.current)==null?void 0:Z.filter)!=null?ee:Ire;return $?ie($,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 ie=a.current.get(ee),ae=0;ie.forEach(re=>{let J=$.get(re);ae=Math.max(J,ae)}),X.push([ee,ae])});let Z=N.current;V().sort((ee,ie)=>{var ae,re;let J=ee.getAttribute("id"),le=ie.getAttribute("id");return((ae=$.get(le))!=null?ae:0)-((re=$.get(J))!=null?re:0)}).forEach(ee=>{let ie=ee.closest(c1);ie?ie.appendChild(ee.parentElement===ie?ee:ee.closest(`${c1} > *`)):Z.appendChild(ee.parentElement===Z?ee:ee.closest(`${c1} > *`))}),X.sort((ee,ie)=>ie[1]-ee[1]).forEach(ee=>{var ie;let ae=(ie=N.current)==null?void 0:ie.querySelector(`${sh}[${Yu}="${encodeURIComponent(ee[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function L(){let $=V().find(Z=>Z.getAttribute("aria-disabled")!=="true"),X=$==null?void 0:$.getAttribute(Yu);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 ie=0;for(let ae of r.current){let re=(X=($=i.current.get(ae))==null?void 0:$.value)!=null?X:"",J=(ee=(Z=i.current.get(ae))==null?void 0:Z.keywords)!=null?ee:[],le=D(re,J);n.current.filtered.items.set(ae,le),le>0&&ie++}for(let[ae,re]of a.current)for(let J of re)if(n.current.filtered.items.get(J)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ie}function G(){var $,X,Z;let ee=z();ee&&((($=ee.parentElement)==null?void 0:$.firstChild)===ee&&((Z=(X=ee.closest(sh))==null?void 0:X.querySelector(Dre))==null||Z.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function z(){var $;return($=N.current)==null?void 0:$.querySelector(`${PB}[aria-selected="true"]`)}function V(){var $;return Array.from((($=N.current)==null?void 0:$.querySelectorAll(WM))||[])}function k($){let X=V()[$];X&&P.setState("value",X.getAttribute(Yu))}function F($){var X;let Z=z(),ee=V(),ie=ee.findIndex(re=>re===Z),ae=ee[ie+$];(X=c.current)!=null&&X.loop&&(ae=ie+$<0?ee[ee.length-1]:ie+$===ee.length?ee[0]:ee[ie+$]),ae&&P.setState("value",ae.getAttribute(Yu))}function q($){let X=z(),Z=X==null?void 0:X.closest(sh),ee;for(;Z&&!ee;)Z=$>0?Kre(Z,sh):Vre(Z,sh),ee=Z==null?void 0:Z.querySelector(WM);ee?P.setState("value",ee.getAttribute(Yu)):F($)}let U=()=>k(V().length-1),Y=$=>{$.preventDefault(),$.metaKey?U():$.altKey?q(1):F(1)},B=$=>{$.preventDefault(),$.metaKey?k(0):$.altKey?q(-1):F(-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&&Y($);break}case"ArrowDown":{Y($);break}case"p":case"k":{S&&$.ctrlKey&&B($);break}case"ArrowUp":{B($);break}case"Home":{$.preventDefault(),k(0);break}case"End":{$.preventDefault(),U();break}case"Enter":{$.preventDefault();let ee=z();if(ee){let ie=new Event(HE);ee.dispatchEvent(ie)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Xre},f),b0(e,$=>x.createElement(kB.Provider,{value:P},x.createElement(MB.Provider,{value:R},$))))}),Lre=x.forwardRef((e,t)=>{var n,r;let a=Un(),i=x.useRef(null),s=x.useContext(RB),c=Tm(),f=IB(e),u=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Oc(()=>{if(!u)return c.item(a,s==null?void 0:s.id)},[u]);let m=LB(a,i,[e.value,e.children,i],e.keywords),d=yC(),v=al(T=>T.value&&T.value===m.current),y=al(T=>u||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(HE,b),()=>T.removeEventListener(HE,b)},[y,e.onSelect,e.disabled]);function b(){var T,P;w(),(P=(T=f.current).onSelect)==null||P.call(T,m.current)}function w(){d.setState("value",m.current,!0)}if(!y)return null;let{disabled:S,value:E,onSelect:O,forceMount:j,keywords:A,...N}=e;return x.createElement(Ie.div,{ref:To(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)}),zre=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,s=Un(),c=x.useRef(null),f=x.useRef(null),u=Un(),m=Tm(),d=al(y=>a||m.filter()===!1?!0:y.search?y.filtered.groups.has(s):!0);Oc(()=>m.group(s),[]),LB(s,c,[e.value,e.heading,f]);let v=x.useMemo(()=>({id:s,forceMount:a}),[a]);return x.createElement(Ie.div,{ref:To(c,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&x.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),b0(e,y=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},x.createElement(RB.Provider,{value:v},y))))}),$re=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),i=al(s=>!s.search);return!n&&!i?null:x.createElement(Ie.div,{ref:To(a,t),...r,"cmdk-separator":"",role:"separator"})}),Bre=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=yC(),s=al(u=>u.search),c=al(u=>u.selectedItemId),f=Tm();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":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:a?e.value:s,onChange:u=>{a||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),Ure=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=x.useRef(null),s=x.useRef(null),c=al(u=>u.selectedItemId),f=Tm();return x.useEffect(()=>{if(s.current&&i.current){let u=s.current,m=i.current,d,v=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let y=u.offsetHeight;m.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return v.observe(u),()=>{cancelAnimationFrame(d),v.unobserve(u)}}},[]),x.createElement(Ie.div,{ref:To(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:f.listId},b0(e,u=>x.createElement("div",{ref:To(s,f.listInnerRef),"cmdk-list-sizer":""},u)))}),Hre=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:s,...c}=e;return x.createElement(Nj,{open:n,onOpenChange:r},x.createElement(Tj,{container:s},x.createElement(Pj,{"cmdk-overlay":"",className:a}),x.createElement(Mj,{"aria-label":e.label,"cmdk-dialog":"",className:i},x.createElement(DB,{ref:t,...c}))))}),Fre=x.forwardRef((e,t)=>al(n=>n.filtered.count===0)?x.createElement(Ie.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),qre=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)))}),Jf=Object.assign(DB,{List:Ure,Item:Lre,Input:Bre,Group:zre,Separator:$re,Dialog:Hre,Empty:Fre,Loading:qre});function Kre(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Vre(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function IB(e){let t=x.useRef(e);return Oc(()=>{t.current=e}),t}var Oc=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Gu(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function al(e){let t=yC(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function LB(e,t,n,r=[]){let a=x.useRef(),i=Tm();return Oc(()=>{var s;let c=(()=>{var u;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(u=m.current.textContent)==null?void 0:u.trim():a.current}})(),f=r.map(u=>u.trim());i.value(e,c,f),(s=t.current)==null||s.setAttribute(Yu,c),a.current=c}),a}var Yre=()=>{let[e,t]=x.useState(),n=Gu(()=>new Map);return Oc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Gre(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(Gre(t),{ref:t.ref},n(t.props.children)):n(t)}var Xre={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const QM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ZM=ct,w0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ZM(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,s=Object.keys(a).map(u=>{const m=n==null?void 0:n[u],d=i==null?void 0:i[u];if(m===null)return null;const v=QM(m)||QM(d);return a[u][v]}),c=n&&Object.entries(n).reduce((u,m)=>{let[d,v]=m;return v===void 0||(u[d]=v),u},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,m)=>{let{class:d,className:v,...y}=m;return Object.entries(y).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...i,...c}[w]):{...i,...c}[w]===S})?[...u,d,v]:u},[]);return ZM(e,s,f,n==null?void 0:n.class,n==null?void 0:n.className)},Wre=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 Se({className:e,variant:t="default",size:n="default",asChild:r=!1,...a}){const i=r?xj:"button";return p.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:Ce(Wre({variant:t,size:n,className:e})),...a})}function vl({...e}){return p.jsx(Nj,{"data-slot":"dialog",...e})}function Qre({...e}){return p.jsx(Tj,{"data-slot":"dialog-portal",...e})}function Zre({className:e,...t}){return p.jsx(Pj,{"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 gl({className:e,children:t,showCloseButton:n=!0,...r}){return p.jsxs(Qre,{"data-slot":"dialog-portal",children:[p.jsx(Zre,{}),p.jsxs(Mj,{"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(kj,{"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(hC,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yl({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 zB({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(kj,{asChild:!0,children:p.jsx(Se,{variant:"outline",children:"Close"})})]})}function xl({className:e,...t}){return p.jsx(M4,{"data-slot":"dialog-title",className:Ce("text-lg leading-none font-semibold",e),...t})}function $B({className:e,...t}){return p.jsx(k4,{"data-slot":"dialog-description",className:Ce("text-sm text-muted-foreground",e),...t})}function Jre({className:e,...t}){return p.jsx(Jf,{"data-slot":"command",className:Ce("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function eae({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:a=!0,...i}){return p.jsxs(vl,{...i,children:[p.jsxs(yl,{className:"sr-only",children:[p.jsx(xl,{children:e}),p.jsx($B,{children:t})]}),p.jsx(gl,{className:Ce("overflow-hidden p-0",r),showCloseButton:a,children:p.jsx(Jre,{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 tae({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(yB,{className:"size-4 shrink-0 opacity-50"}),p.jsx(Jf.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 nae({className:e,...t}){return p.jsx(Jf.List,{"data-slot":"command-list",className:Ce("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function rae({...e}){return p.jsx(Jf.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function lh({className:e,...t}){return p.jsx(Jf.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 Ia({className:e,...t}){return p.jsx(Jf.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 JM({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 aae({open:e,onOpenChange:t}){var u;const n=ul(),{setTheme:r}=yj(),a=Zf(),i=gC(),s=a.data??[],c=((u=i.data)==null?void 0:u.items)??[],f=m=>{t(!1),n(m)};return p.jsxs(eae,{open:e,onOpenChange:t,showCloseButton:!1,children:[p.jsx(tae,{placeholder:"Type a command or search..."}),p.jsxs(nae,{children:[p.jsx(rae,{children:"No results found."}),p.jsxs(lh,{heading:"Navigation",children:[p.jsxs(Ia,{onSelect:()=>f("/"),children:[p.jsx(hB,{}),"Dashboard",p.jsx(JM,{children:"G D"})]}),p.jsxs(Ia,{onSelect:()=>f("/projects"),children:[p.jsx(zg,{}),"Projects",p.jsx(JM,{children:"G P"})]})]}),s.length>0&&p.jsx(lh,{heading:"Projects",children:s.map(m=>p.jsxs(Ia,{onSelect:()=>f(`/projects/${m.id}`),children:[p.jsx(zg,{}),m.display_name]},m.id))}),c.length>0&&p.jsx(lh,{heading:"Running Sessions",children:c.map(m=>p.jsxs(Ia,{onSelect:()=>f(`/projects/${m.project_id}/sessions/${m.run_id}`),children:[p.jsx(dC,{}),m.role," (",m.run_id.slice(0,8),")"]},m.run_id))}),p.jsxs(lh,{heading:"Resources",children:[p.jsxs(Ia,{onSelect:()=>f("/resources/roles"),children:[p.jsx(wB,{}),"Roles"]}),p.jsxs(Ia,{onSelect:()=>f("/resources/skills"),children:[p.jsx(SB,{}),"Skills"]}),p.jsxs(Ia,{onSelect:()=>f("/resources/agents"),children:[p.jsx(uB,{}),"Agents"]}),p.jsxs(Ia,{onSelect:()=>f("/resources/memories"),children:[p.jsx(fB,{}),"Memory"]})]}),p.jsxs(lh,{heading:"Theme",children:[p.jsxs(Ia,{onSelect:()=>{r("light"),t(!1)},children:[p.jsx(bB,{}),"Light"]}),p.jsxs(Ia,{onSelect:()=>{r("dark"),t(!1)},children:[p.jsx(pB,{}),"Dark"]}),p.jsxs(Ia,{onSelect:()=>{r("system"),t(!1)},children:[p.jsx(vne,{}),"System"]})]})]})]})}const iae=[{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 oae({open:e,onOpenChange:t}){return p.jsx(vl,{open:e,onOpenChange:t,children:p.jsxs(gl,{className:"max-w-sm",children:[p.jsx(yl,{children:p.jsx(xl,{children:"Keyboard Shortcuts"})}),p.jsx("div",{className:"space-y-2",children:iae.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 sae({...e}){return p.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function lae({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 cae({className:e,...t}){return p.jsx("li",{"data-slot":"breadcrumb-item",className:Ce("inline-flex items-center gap-1.5",e),...t})}function uae({asChild:e,className:t,...n}){const r=e?xj:"a";return p.jsx(r,{"data-slot":"breadcrumb-link",className:Ce("transition-colors hover:text-foreground",t),...n})}function fae({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 dae({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(y0,{})})}function Bg({...e}){return p.jsx(XZ,{"data-slot":"dropdown-menu",...e})}function Ug({...e}){return p.jsx(WZ,{"data-slot":"dropdown-menu-trigger",...e})}function Hg({className:e,sideOffset:t=4,...n}){return p.jsx(QZ,{children:p.jsx(ZZ,{"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 jh({className:e,inset:t,variant:n="default",...r}){return p.jsx(JZ,{"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 hae({className:e,children:t,checked:n,...r}){return p.jsxs(eJ,{"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(tJ,{children:p.jsx(cC,{className:"size-4"})})}),t]})}function Ls({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return p.jsx(nee,{"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 mae=[{to:"/",label:"Dashboard",icon:hB,end:!0},{to:"/projects",label:"Projects",icon:zg},{to:"/schedules",label:"Schedules",icon:Kte},{to:"/settings",label:"Settings",icon:xB}],pae=[{to:"/resources/roles",label:"Roles",icon:wB},{to:"/resources/skills",label:"Skills",icon:SB},{to:"/resources/agents",label:"Agents",icon:uB},{to:"/resources/memories",label:"Memory",icon:fB}];function vae({conv:e,projectId:t,isActive:n,navigate:r}){const[a,i]=x.useState(!1),[s,c]=x.useState(!1),[f,u]=x.useState(!1),[m,d]=x.useState(""),v=x.useRef(null),y=vC(t),b=AB(t),w=E=>{E.stopPropagation(),E.preventDefault(),d(e.title??""),i(!0),setTimeout(()=>{var O;return(O=v.current)==null?void 0:O.focus()},0)},S=()=>{const E=m.trim();y.mutate({conversationId:e.id,title:E||null}),i(!1)};return a?p.jsx("div",{className:"px-1",children:p.jsx(et,{ref:v,value:m,onChange:E=>d(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}`})}),f?p.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p.jsx("button",{onClick:E=>{E.stopPropagation(),b.mutate(e.id),u(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:b.isPending,children:"Delete"}),p.jsx("button",{onClick:E=>{E.stopPropagation(),u(!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(),u(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:p.jsx(pl,{className:"h-3 w-3"})})]})]})}function gae({projectId:e,conversationId:t}){var s,c;const n=ul(),r=CB(e,1,50),a=OB(),i=mC(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(ra,{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(lC,{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:f=>n(`/projects/${e}/conversations/${f.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:p.jsx($g,{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(f=>p.jsx(vae,{conv:f,projectId:e,isActive:f.id===t,navigate:n},f.id))})]})]})}function yae(){const t=ei().pathname.split("/").filter(Boolean),n=t[0]==="projects"&&t[1]?Number(t[1]):0,{data:r}=mC(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 xae(){const e=yae(),t=ul(),n=Zf(),{setTheme:r}=yj(),[a,i]=x.useState(!1),[s,c]=x.useState(!1),f=VV("/projects/:projectId/conversations/:conversationId"),u=f?Number(f.params.projectId):0,m=f?Number(f.params.conversationId):0;return Sre({onCommandPalette:()=>i(!0),onShortcutsHelp:()=>c(!0)}),p.jsxs("div",{className:"flex h-screen",children:[f?p.jsx(gae,{projectId:u,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(ra,{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:[mae.map(({to:d,label:v,icon:y,end:b})=>p.jsxs(nE,{to:d,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(y,{className:"h-4 w-4"}),v]},d)),p.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),pae.map(({to:d,label:v,icon:y})=>p.jsxs(nE,{to:d,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(y,{className:"h-4 w-4"}),v]},d))]})]}),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(sae,{children:p.jsx(lae,{children:e.map((d,v)=>{const y=v===e.length-1;return p.jsxs(cae,{children:[v>0&&p.jsx(dae,{}),d.projectSwitcher?p.jsxs(Bg,{children:[p.jsxs(Ug,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[d.label,p.jsx(Bte,{className:"h-3 w-3 text-muted-foreground"})]}),p.jsx(Hg,{align:"start",children:(n.data??[]).map(b=>p.jsxs(jh,{onClick:()=>t(`/projects/${b.id}`),children:[d.href===`/projects/${b.id}`?p.jsx(cC,{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))})]}):y?p.jsx(fae,{children:d.label}):p.jsx(uae,{href:d.href,children:d.label})]},d.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(Bg,{children:[p.jsx(Ug,{asChild:!0,children:p.jsxs(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[p.jsx(bB,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),p.jsx(pB,{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(Hg,{align:"end",children:[p.jsx(jh,{onClick:()=>r("light"),children:"Light"}),p.jsx(jh,{onClick:()=>r("dark"),children:"Dark"}),p.jsx(jh,{onClick:()=>r("system"),children:"System"})]})]})]})]}),p.jsx(Ls,{}),p.jsx("main",{className:"flex-1 overflow-auto p-6",children:p.jsx(cY,{})})]}),p.jsx(aae,{open:a,onOpenChange:i}),p.jsx(oae,{open:s,onOpenChange:c})]})}function bae(){const e=vt();return At({mutationFn:t=>$e.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function BB(){const e=vt();return At({mutationFn:t=>$e.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function wae(){const e=vt();return At({mutationFn:t=>$e.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const Sae=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?xj:"span";return p.jsx(a,{"data-slot":"badge","data-variant":t,className:Ce(Sae({variant:t}),e),...r})}function Kc({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 Vc({className:e,...t}){return p.jsx("thead",{"data-slot":"table-header",className:Ce("[&_tr]:border-b",e),...t})}function Yc({className:e,...t}){return p.jsx("tbody",{"data-slot":"table-body",className:Ce("[&_tr:last-child]:border-0",e),...t})}function Ir({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 We({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 Qe({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 FE({sessions:e,projectNames:t}){return p.jsxs(Kc,{children:[p.jsx(Vc,{children:p.jsxs(Ir,{children:[p.jsx(We,{children:"Run ID"}),t&&p.jsx(We,{children:"Project"}),p.jsx(We,{children:"Role"}),p.jsx(We,{children:"Status"}),p.jsx(We,{children:"Started"}),p.jsx(We,{children:"Duration"}),p.jsx(We,{children:"Task"}),p.jsx(We,{className:"w-[80px]"})]})}),p.jsx(Yc,{children:e.map(n=>p.jsxs(Ir,{children:[p.jsx(Qe,{children:p.jsx(ra,{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(Qe,{children:p.jsx(ra,{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(Qe,{className:"text-sm",children:n.role}),p.jsx(Qe,{children:p.jsx(Eae,{status:n.status})}),p.jsx(Qe,{className:"text-sm text-muted-foreground",children:Fg(n.started_at)}),p.jsx(Qe,{className:"text-sm text-muted-foreground",children:S0(n.duration_ms)}),p.jsx(Qe,{className:"max-w-[300px] truncate text-sm",children:n.task??"—"}),p.jsx(Qe,{children:p.jsx(_ae,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function Eae({status:e}){const t=UB(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 ek=UB;function UB(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 Fg(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 _ae({runId:e,disabled:t}){const[n,r]=x.useState(!1),a=wae(),i=async()=>{try{await a.mutateAsync(e)}catch{}};return n?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Se,{size:"sm",variant:"destructive",onClick:i,disabled:a.isPending,children:"Confirm"}),p.jsx(Se,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):p.jsx(Se,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:p.jsx(pl,{className:"h-4 w-4"})})}function ln({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 Xu({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 Wu({className:e,...t}){return p.jsx("div",{"data-slot":"card-title",className:Ce("leading-none font-semibold",e),...t})}function cn({className:e,...t}){return p.jsx("div",{"data-slot":"card-content",className:Ce("px-6",e),...t})}const u1=1e4;function HB(e,t,n){const[r,a]=x.useState([]),[i,s]=x.useState(!1),[c,f]=x.useState(!1),u=x.useRef(null),m=x.useRef(void 0),d=x.useRef(1e3),v=x.useRef("");return x.useEffect(()=>{if(!t)return;const y=`${e}:${t}`;v.current!==y&&(a([]),f(!1),v.current=y);function b(){const w=new EventSource(`/api/sessions/${e}/logs/${t}`);u.current=w,w.onopen=()=>{s(!0),d.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",()=>{f(!0),w.close(),u.current=null}),w.onerror=()=>{w.close(),u.current=null,s(!1),m.current=setTimeout(()=>{d.current=Math.min(d.current*2,15e3),b()},d.current)}}return b(),()=>{var w;(w=u.current)==null||w.close(),u.current=null,m.current&&clearTimeout(m.current)}},[e,t,n]),{lines:r,connected:i,done:c}}const jae=5e3;function Cae({runId:e,projectId:t,agentId:n,role:r,runtime:a,startedAt:i}){const{lines:s,done:c}=HB(e,n,!0),f=s.slice(-4),[u,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 d=x.useRef(s.length),v=x.useRef(Date.now()),[y,b]=x.useState(!1);return x.useEffect(()=>{s.length!==d.current&&(d.current=s.length,v.current=Date.now(),b(!1))},[s.length]),x.useEffect(()=>{const w=setInterval(()=>{Date.now()-v.current>jae&&b(!0)},1e3);return()=>clearInterval(w)},[]),p.jsx(ln,{className:"overflow-hidden",children:p.jsxs(cn,{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":y?"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:u})]}),p.jsx("div",{className:"rounded bg-[#1e1e1e] px-2 py-1.5 font-mono text-[11px] leading-[16px] text-[#d4d4d4]",children:f.length>0?f.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(ra,{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(y0,{className:"h-3 w-3"})]})})]})})}const f1=8;function Oae(){var s;const t=((s=gC().data)==null?void 0:s.items)??[],n=wG({queries:t.slice(0,f1).map(c=>({queryKey:Be.sessions.detail(c.project_id,c.run_id),queryFn:()=>$e.get(`/projects/${c.project_id}/sessions/${c.run_id}`),staleTime:1e4}))}),r=[];for(const c of n){if(!c.data)continue;const f=c.data;for(const[u,m]of Object.entries(f.agents))r.push({runId:f.run_id,projectId:f.project_id,agentId:u,role:m.role,runtime:m.runtime,startedAt:m.started_at})}if(r.length===0)return null;const a=r.slice(0,f1),i=r.length-f1;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(Cae,{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 rn({className:e,...t}){return p.jsx("div",{"data-slot":"skeleton",className:Ce("animate-pulse rounded-md bg-accent",e),...t})}function Aae(){return p.jsxs("div",{className:"space-y-8",children:[p.jsx(rn,{className:"h-8 w-40"}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(rn,{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(rn,{className:"h-28 rounded-lg"},e))})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(rn,{className:"h-4 w-32"}),p.jsx(rn,{className:"h-48 rounded-lg"})]})]})}function Nae(){var m,d;const e=Zf(),t=gC(),n=Ere(),r=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(r)return p.jsx(Aae,{});if(a)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx(ko,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",a.message]})]});const i=e.data??[],s=((m=t.data)==null?void 0:m.items)??[],c=((d=n.data)==null?void 0:d.items)??[],f=new Map;for(const v of i)f.set(v.id,v.display_name);const u=new Map;for(const v of s)u.set(v.project_id,(u.get(v.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(Oae,{}),p.jsxs("section",{className:"space-y-3",children:[p.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",i.length,")"]}),i.length===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):p.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:i.map(v=>p.jsx(ra,{to:`/projects/${v.id}`,className:"group",children:p.jsxs(ln,{className:"transition-colors group-hover:border-foreground/20",children:[p.jsx(Xu,{className:"pb-2",children:p.jsxs(Wu,{className:"flex items-center gap-2 text-base",children:[p.jsx(zg,{className:"h-4 w-4 text-muted-foreground"}),v.display_name]})}),p.jsxs(cn,{children:[p.jsx("p",{className:"break-all text-sm text-muted-foreground",children:v.working_dir}),p.jsxs("div",{className:"mt-2 flex gap-1.5",children:[!v.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"}),(u.get(v.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"}),u.get(v.id)," running"]})]})]})]})},v.id))})]}),s.length>0&&p.jsxs("section",{className:"space-y-3",children:[p.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",s.length,")"]}),p.jsx(ln,{children:p.jsx(cn,{className:"p-0",children:p.jsx(FE,{sessions:s,projectNames:f})})})]}),p.jsxs("section",{className:"space-y-3",children:[p.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),c.length===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):p.jsx(ln,{children:p.jsx(cn,{className:"p-0",children:p.jsx(FE,{sessions:c,projectNames:f})})})]})]})}function FB(){return xn({queryKey:Be.config.global,queryFn:()=>$e.get("/config/global")})}function Tae(){const e=vt();return At({mutationFn:t=>$e.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Be.projects.all})}})}function Pae(){const e=vt();return At({mutationFn:t=>$e.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Be.projects.all})}})}function Mae(){const e=vt();return At({mutationFn:({projectId:t,files:n})=>$e.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.projects.files(n.projectId)})}})}function kae(){const e=vt();return At({mutationFn:({projectId:t,filePath:n})=>$e.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Be.projects.files(n.projectId)})}})}function Rae(){const e=vt();return At({mutationFn:t=>$e.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(Be.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:Be.config.global})}})}function qB(){const e=vt();return At({mutationFn:({projectId:t,data:n})=>$e.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 Pm({className:e,children:t,...n}){return p.jsxs(pJ,{"data-slot":"scroll-area",className:Ce("relative",e),...n,children:[p.jsx(vJ,{"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(Dae,{}),p.jsx(gJ,{})]})}function Dae({className:e,orientation:t="vertical",...n}){return p.jsx(V5,{"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(W5,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function Iae({initialPath:e,onSelect:t,onCancel:n}){const[r,a]=x.useState(null),[i,s]=x.useState(!0),[c,f]=x.useState(null),[u,m]=x.useState(null),d=y=>{s(!0),f(null);const b=y?`?path=${encodeURIComponent(y)}`:"";$e.get(`/fs/browse${b}`).then(a).catch(w=>f(w.message??"Failed to browse")).finally(()=>s(!1))},v=async()=>{if(!(!r||!(u!=null&&u.trim())))try{const y=await $e.post("/fs/mkdir",{path:r.path,name:u.trim()});m(null),d(y.path)}catch(y){f(y instanceof Error?y.message:"Failed to create folder")}};return x.useEffect(()=>{d(e||void 0)},[]),p.jsx(vl,{open:!0,onOpenChange:y=>!y&&n(),children:p.jsxs(gl,{className:"sm:max-w-[480px]",children:[p.jsx(yl,{children:p.jsx(xl,{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(Pm,{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:()=>d(r.parent),children:[p.jsx(rne,{className:"h-4 w-4"}),".."]}),r==null?void 0:r.entries.map(y=>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:()=>d(y.path),children:[p.jsx(ine,{className:"h-4 w-4"}),y.name]},y.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(zB,{children:u!==null?p.jsxs("div",{className:"flex w-full gap-2",children:[p.jsx(et,{value:u,onChange:y=>m(y.target.value),onKeyDown:y=>{y.key==="Enter"&&v(),y.key==="Escape"&&m(null)},placeholder:"Folder name",autoFocus:!0,className:"flex-1"}),p.jsx(Se,{size:"sm",onClick:v,children:"Create"}),p.jsx(Se,{size:"sm",variant:"outline",onClick:()=>m(null),children:"Cancel"})]}):p.jsxs(p.Fragment,{children:[p.jsx(Se,{variant:"outline",onClick:()=>m(""),disabled:!r,children:"New Folder"}),p.jsx("div",{className:"flex-1"}),p.jsx(Se,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),p.jsx(Se,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function ft({className:e,...t}){return p.jsx(rJ,{"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 Ti({...e}){return p.jsx(UJ,{"data-slot":"select",...e})}function Pi({...e}){return p.jsx(FJ,{"data-slot":"select-value",...e})}function Mi({className:e,size:t="default",children:n,...r}){return p.jsxs(HJ,{"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(qJ,{asChild:!0,children:p.jsx(Uh,{className:"size-4 opacity-50"})})]})}function ki({className:e,children:t,position:n="item-aligned",align:r="center",...a}){return p.jsx(KJ,{children:p.jsxs(VJ,{"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(Lae,{}),p.jsx(YJ,{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(zae,{})]})})}function Tn({className:e,children:t,...n}){return p.jsxs(GJ,{"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(WJ,{children:p.jsx(cC,{className:"size-4"})})}),p.jsx(XJ,{children:t})]})}function Lae({className:e,...t}){return p.jsx(QJ,{"data-slot":"select-scroll-up-button",className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(zte,{className:"size-4"})})}function zae({className:e,...t}){return p.jsx(ZJ,{"data-slot":"select-scroll-down-button",className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(Uh,{className:"size-4"})})}function $ae(){const{data:e,isLoading:t,error:n}=Zf(),[r,a]=x.useState(!1);if(t)return p.jsxs("div",{className:"space-y-6",children:[p.jsx(rn,{className:"h-8 w-32"}),p.jsx(rn,{className:"h-64 rounded-lg"})]});if(n)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx(ko,{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(Se,{onClick:()=>a(!0),children:[p.jsx($g,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&p.jsx(Bae,{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(ln,{children:p.jsx(cn,{className:"p-0",children:p.jsxs(Kc,{children:[p.jsx(Vc,{children:p.jsxs(Ir,{children:[p.jsx(We,{children:"Name"}),p.jsx(We,{children:"Directory"}),p.jsx(We,{children:"Created"}),p.jsx(We,{children:"Status"}),p.jsx(We,{className:"w-[80px]"})]})}),p.jsx(Yc,{children:i.map(s=>p.jsxs(Ir,{children:[p.jsx(Qe,{children:p.jsx(ra,{to:`/projects/${s.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:s.display_name})}),p.jsx(Qe,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:s.working_dir}),p.jsx(Qe,{className:"text-sm text-muted-foreground",children:Hae(s.created_at)}),p.jsx(Qe,{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(Qe,{children:p.jsx(Uae,{projectId:s.id})})]},s.id))})]})})})]})}function Bae({onDone:e,onCancel:t}){var R,D,K;const[n,r]=x.useState(""),[a,i]=x.useState(""),[s,c]=x.useState(""),[f,u]=x.useState(""),[m,d]=x.useState(!1),[v,y]=x.useState(!1),b=Tae(),w=qB(),E=(R=FB().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 L=await b.mutateAsync({display_name:n.trim(),working_dir:a.trim()}),I={},G=f||j;I.isolation=A,I.session={merge_strategy:G},await w.mutateAsync({projectId:L.id,data:I}),e()},T=async L=>{L.preventDefault();try{if(A==="worktree"&&a.trim()&&!(await $e.get(`/fs/git-check?path=${encodeURIComponent(a.trim())}`)).is_git){y(!0);return}await N()}catch{}},P=async()=>{try{await $e.post("/fs/git-init",{path:a.trim()}),y(!1),await N()}catch{}};return p.jsx(ln,{children:p.jsx(cn,{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(ft,{htmlFor:"display-name",children:"Display Name"}),p.jsx(et,{id:"display-name",value:n,onChange:L=>r(L.target.value),required:!0,autoFocus:!0})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{htmlFor:"working-dir",children:"Working Directory"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(et,{id:"working-dir",value:a,onChange:L=>i(L.target.value),placeholder:"/path/to/project",required:!0}),p.jsx(Se,{type:"button",variant:"outline",size:"sm",onClick:()=>d(!m),children:"Browse"})]})]})]}),m&&p.jsx(Iae,{initialPath:a||void 0,onSelect:L=>{i(L),d(!1)},onCancel:()=>d(!1)}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{htmlFor:"isolation",children:"Isolation"}),p.jsxs(Ti,{value:s||O,onValueChange:c,children:[p.jsx(Mi,{id:"isolation",children:p.jsx(Pi,{})}),p.jsxs(ki,{children:[p.jsx(Tn,{value:"none",children:"none"}),p.jsx(Tn,{value:"worktree",children:"worktree"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{htmlFor:"merge-strategy",children:"Merge Strategy"}),p.jsxs(Ti,{value:f||j,onValueChange:u,children:[p.jsx(Mi,{id:"merge-strategy",children:p.jsx(Pi,{})}),p.jsxs(ki,{children:[p.jsx(Tn,{value:"auto",children:"auto"}),p.jsx(Tn,{value:"local",children:"local"}),p.jsx(Tn,{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(Se,{type:"button",size:"sm",onClick:P,children:"Yes, initialize"}),p.jsx(Se,{type:"button",size:"sm",variant:"outline",onClick:()=>y(!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(Se,{type:"submit",disabled:b.isPending||w.isPending,children:b.isPending||w.isPending?"Adding...":"Add"}),p.jsx(Se,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function Uae({projectId:e}){const[t,n]=x.useState(!1),r=Pae(),a=async()=>{try{await r.mutateAsync(e)}catch{}};return t?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Se,{size:"sm",variant:"destructive",onClick:a,disabled:r.isPending,children:"Confirm"}),p.jsx(Se,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):p.jsx(Se,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:p.jsx(pl,{className:"h-4 w-4"})})}function Hae(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function KB(e){return xn({queryKey:Be.projects.resources(e),queryFn:()=>$e.get(`/projects/${e}/resources`)})}function Fae(e,t,n,r){return xn({queryKey:Be.projects.resourceDetail(e,t,n),queryFn:()=>$e.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function qae(e,t,n,r){return xn({queryKey:Be.projects.resourceConfig(e,t,n),queryFn:()=>$e.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function Kae(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 Vae({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=Kae(e,t);return p.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[p.jsx(Se,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:p.jsx(Dte,{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(Se,{variant:a===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(a),children:a},a)),p.jsx(Se,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:p.jsx(y0,{className:"h-4 w-4"})})]})}function xC(){return xn({queryKey:Be.roles.all,queryFn:()=>$e.get("/roles")})}function Yae(e){return xn({queryKey:Be.registry.validate(e??""),queryFn:()=>$e.get(`/registry/agents/${e}/validate`),enabled:!!e})}function _o(e,t){return xn({queryKey:Be.registry.list(e),queryFn:()=>$e.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function Gae(e,t,n){return xn({queryKey:Be.registry.detail(e,t),queryFn:()=>$e.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}function VB(e,t,n){return xn({queryKey:Be.registry.config(e,t),queryFn:()=>$e.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function Of({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 bC({...e}){return p.jsx(JG,{"data-slot":"collapsible",...e})}function wC({...e}){return p.jsx(a4,{"data-slot":"collapsible-trigger",...e})}function SC({...e}){return p.jsx(i4,{"data-slot":"collapsible-content",...e})}function Xae({projectId:e,open:t,onOpenChange:n}){var Ke,Bt,ut,Sn,we,Tt;const r=ul(),a=pC(e),i=xC(),{data:s}=_o("agents"),{data:c}=_o("memories"),f=jB(e),u=bae(),m=(Ke=a.data)==null?void 0:Ke.merged,d="__empty__",[v,y]=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,L]=x.useState(""),[I,G]=x.useState(""),[z,V]=x.useState(!1),[k,F]=x.useState([]),[q,U]=x.useState(""),Y=()=>{y(""),w(""),E(""),j(""),N(""),P(""),D(""),L(""),G(""),V(!1),F([])},B=Ee=>{F(dt=>dt.includes(Ee)?dt.filter(En=>En!==Ee):[...dt,Ee])},$=async Ee=>{Ee.preventDefault();try{const dt={project_id:e,task:v.trim()};b.trim()&&(dt.role=b.trim());const En={};S.trim()&&(En.runtime=S.trim()),O.trim()&&(En.memory=O.trim()),A&&(En.cache_delegations=A==="true"),T.trim()&&(En.cache_max_entries=Number(T.trim())),R.trim()&&(En.cache_ttl_seconds=Number(R.trim())),K.trim()&&(En.max_num_delegations=Number(K.trim())),Object.keys(En).length>0&&(dt.overrides=En),k.length>0&&(dt.context_files=k),I.trim()&&(dt.system_prompt=I.trim()),z&&(dt.interactive=!0);const er=await u.mutateAsync(dt);Y(),n(!1),r(`/projects/${e}/sessions/${er.run_id}`)}catch{}},X=(m==null?void 0:m.orchestrator_role)??"orchestrator",Z=(i.data??[]).filter(Ee=>Ee!==X),ee=[X,...Z],ie=(s??[]).map(Ee=>Ee.name),ae=new Set((c??[]).map(Ee=>Ee.name));ae.add("none");const re=[...ae].sort(),J=b.trim()||X,le=VB("roles",J,{enabled:!!J}),he=((ut=(Bt=le.data)==null?void 0:Bt.params_values)==null?void 0:ut.default_agent)??((Tt=(we=(Sn=le.data)==null?void 0:Sn.params_schema)==null?void 0:we.default_agent)==null?void 0:Tt.default)??"",ne=he&&ie.includes(he)?he:(m==null?void 0:m.runtime)??"strawpot-claude-code",ge=b.trim()&&!ee.includes(b.trim())?"Role not found in installed roles":"",ye=S.trim()&&ie.length>0&&!ie.includes(S.trim())?"Runtime not found in installed agents":"",De=O.trim()&&!re.includes(O.trim())?"Memory not found in installed providers":"",Me=!!ge||!!ye||!!De;return p.jsx(vl,{open:t,onOpenChange:n,children:p.jsxs(gl,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[p.jsx(yl,{children:p.jsx(xl,{children:"Launch Session"})}),p.jsxs("form",{onSubmit:$,className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsxs(ft,{htmlFor:"task",children:["Task ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx(Of,{id:"task",value:v,onChange:Ee=>y(Ee.target.value),placeholder:"Describe what the agent should do...",required:!0,autoFocus:!0,rows:3})]}),(f.data??[]).length>0&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(Bg,{children:[p.jsx(Ug,{asChild:!0,children:p.jsxs(Se,{type:"button",variant:"outline",size:"sm",children:[p.jsx(bne,{className:"mr-1 h-3.5 w-3.5"}),"@ Attach Files"]})}),p.jsxs(Hg,{align:"start",className:"w-64",onCloseAutoFocus:Ee=>Ee.preventDefault(),children:[p.jsx("div",{className:"px-2 py-1.5",children:p.jsx(et,{placeholder:"Filter files...",value:q,onChange:Ee=>U(Ee.target.value),className:"h-7 text-xs",onKeyDown:Ee=>Ee.stopPropagation()})}),p.jsx("div",{className:"max-h-48 overflow-y-auto",children:(f.data??[]).filter(Ee=>Ee.path.toLowerCase().includes(q.toLowerCase())).map(Ee=>p.jsx(hae,{checked:k.includes(Ee.path),onCheckedChange:()=>B(Ee.path),onSelect:dt=>dt.preventDefault(),children:p.jsx("span",{className:"font-mono text-xs",children:Ee.path})},Ee.path))})]})]}),k.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[k.length," file(s) attached"]})]}),k.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1",children:k.map(Ee=>p.jsxs(qt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:["@",Ee,p.jsx("button",{type:"button",onClick:()=>B(Ee),className:"ml-0.5 rounded-sm hover:bg-muted",children:p.jsx(hC,{className:"h-3 w-3"})})]},Ee))})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{htmlFor:"role",children:"Role"}),p.jsx(et,{id:"role",list:"datalist-role",value:b,onChange:Ee=>w(Ee.target.value),placeholder:X}),p.jsxs("datalist",{id:"datalist-role",children:[p.jsx("option",{value:X}),Z.map(Ee=>p.jsx("option",{value:Ee},Ee))]}),ge&&p.jsx("p",{className:"text-xs text-destructive",children:ge})]}),p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:z,onChange:Ee=>V(Ee.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(bC,{children:[p.jsx(wC,{asChild:!0,children:p.jsxs(Se,{type:"button",variant:"ghost",size:"sm",children:[p.jsx(Uh,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),p.jsxs(SC,{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(ft,{htmlFor:"runtime",children:"Runtime"}),p.jsx(et,{id:"runtime",list:"datalist-runtime",value:S,onChange:Ee=>E(Ee.target.value),placeholder:ne}),s&&p.jsx("datalist",{id:"datalist-runtime",children:s.map(Ee=>p.jsx("option",{value:Ee.name},Ee.name))}),ye&&p.jsx("p",{className:"text-xs text-destructive",children:ye})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{htmlFor:"memory",children:"Memory"}),p.jsx(et,{id:"memory",list:"datalist-memory",value:O,onChange:Ee=>j(Ee.target.value),placeholder:(m==null?void 0:m.memory)||"dial"}),p.jsx("datalist",{id:"datalist-memory",children:re.map(Ee=>p.jsx("option",{value:Ee},Ee))}),De&&p.jsx("p",{className:"text-xs text-destructive",children:De})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{htmlFor:"system-prompt",children:"System Prompt"}),p.jsx(Of,{id:"system-prompt",value:I,onChange:Ee=>G(Ee.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(ft,{children:"Max Delegations"}),p.jsx(et,{type:"number",min:"0",value:K,onChange:Ee=>L(Ee.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(ft,{children:"Cache Delegations"}),p.jsxs(Ti,{value:A||d,onValueChange:Ee=>N(Ee===d?"":Ee),children:[p.jsx(Mi,{className:"h-8 text-xs",children:p.jsx(Pi,{placeholder:(m==null?void 0:m.cache_delegations)!==!1?"true":"false"})}),p.jsxs(ki,{children:[p.jsxs(Tn,{value:d,className:"text-muted-foreground",children:["Default (",(m==null?void 0:m.cache_delegations)!==!1?"true":"false",")"]}),p.jsx(Tn,{value:"true",children:"true"}),p.jsx(Tn,{value:"false",children:"false"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{children:"Cache Max Entries"}),p.jsx(et,{type:"number",min:"0",value:T,onChange:Ee=>P(Ee.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(ft,{children:"Cache TTL (seconds)"}),p.jsx(et,{type:"number",min:"0",value:R,onChange:Ee=>D(Ee.target.value),placeholder:m!=null&&m.cache_ttl_seconds?String(m.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]})]}),u.error&&p.jsx("p",{className:"text-sm text-destructive",children:u.error.message}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Se,{type:"submit",disabled:u.isPending||Me,children:u.isPending?"Launching...":"Launch"}),p.jsx(Se,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function Wae(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Qae({projectId:e}){const t=jB(e),n=Mae(),r=kae(),a=x.useRef(null),[i,s]=x.useState(!1),c=x.useCallback(w=>{const S=Array.from(w);S.length!==0&&n.mutate({projectId:e,files:S},{onSuccess:()=>xt.success(`Uploaded ${S.length} file(s)`),onError:()=>xt.error("Upload failed")})},[e,n]),f=x.useCallback(w=>{w.preventDefault(),s(!1),c(w.dataTransfer.files)},[c]),u=x.useCallback(w=>{w.preventDefault(),s(!0)},[]),m=x.useCallback(w=>{w.preventDefault(),s(!1)},[]),d=x.useCallback(()=>{var w;(w=a.current)==null||w.click()},[]),v=x.useCallback(w=>{w.target.files&&(c(w.target.files),w.target.value="")},[c]),y=x.useCallback(w=>{r.mutate({projectId:e,filePath:w},{onSuccess:()=>xt.success("File deleted"),onError:()=>xt.error("Failed to delete file")})},[e,r]),b=t.data??[];return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{onDrop:f,onDragOver:u,onDragLeave:m,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(Bne,{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:d,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:v})]}),b.length===0?p.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):p.jsx(ln,{children:p.jsx(cn,{className:"p-0",children:p.jsxs(Kc,{children:[p.jsx(Vc,{children:p.jsxs(Ir,{children:[p.jsx(We,{children:"Name"}),p.jsx(We,{className:"w-24",children:"Size"}),p.jsx(We,{className:"w-44",children:"Modified"}),p.jsx(We,{className:"w-12"})]})}),p.jsx(Yc,{children:b.map(w=>p.jsxs(Ir,{children:[p.jsx(Qe,{className:"font-mono text-xs",children:w.path}),p.jsx(Qe,{className:"text-xs text-muted-foreground",children:Wae(w.size)}),p.jsx(Qe,{className:"text-xs text-muted-foreground",children:new Date(w.modified_at).toLocaleString()}),p.jsx(Qe,{children:p.jsx(Se,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>y(w.path),disabled:r.isPending,children:p.jsx(pl,{className:"h-3.5 w-3.5 text-muted-foreground"})})})]},w.path))})]})})})]})}function Zae(){const e=vt();return At({mutationFn:t=>$e.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function YB(){const e=vt();return At({mutationFn:({type:t,name:n})=>$e.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Jae(){const e=vt();return At({mutationFn:t=>$e.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function eie(){const e=vt();return At({mutationFn:t=>$e.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function tie(){const e=vt();return At({mutationFn:({type:t,name:n,env_values:r,params_values:a})=>$e.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 nie(e){const t=vt();return At({mutationFn:n=>$e.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Be.projects.resources(e)})}})}function GB(e){const t=vt();return At({mutationFn:({type:n,name:r})=>$e.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Be.projects.resources(e)})}})}function rie(e){const t=vt();return At({mutationFn:n=>$e.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Be.projects.resources(e)})}})}function aie(e){const t=vt();return At({mutationFn:n=>$e.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Be.projects.resources(e)})}})}function iie(e){const t=vt();return At({mutationFn:({type:n,name:r,env_values:a,params_values:i})=>$e.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 oie({...e}){return p.jsx(Nj,{"data-slot":"sheet",...e})}function sie({...e}){return p.jsx(Tj,{"data-slot":"sheet-portal",...e})}function lie({className:e,...t}){return p.jsx(Pj,{"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 cie({className:e,children:t,side:n="right",showCloseButton:r=!0,...a}){return p.jsxs(sie,{children:[p.jsx(lie,{}),p.jsxs(Mj,{"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(kj,{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(hC,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function uie({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(M4,{"data-slot":"sheet-title",className:Ce("font-semibold text-foreground",e),...t})}function die({className:e,...t}){return p.jsx(k4,{"data-slot":"sheet-description",className:Ce("text-sm text-muted-foreground",e),...t})}const hie=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 hg({className:e,variant:t,...n}){return p.jsx("div",{"data-slot":"alert",role:"alert",className:Ce(hie({variant:t}),e),...n})}function mg({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 pg({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 mie({agentName:e}){const{data:t}=Yae(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(hg,{variant:"destructive",children:[p.jsx(ko,{className:"h-4 w-4"}),p.jsx(mg,{children:"Missing Prerequisites"}),p.jsx(pg,{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(hg,{children:[p.jsx(Dne,{className:"h-4 w-4"}),p.jsx(mg,{children:"Setup"}),p.jsxs(pg,{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(hg,{children:[p.jsx(fne,{className:"h-4 w-4"}),p.jsx(mg,{children:"API Key Required"}),p.jsx(pg,{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 pie({resourceType:e,resourceName:t,enabled:n,projectId:r}){const a=VB(e,t,{enabled:n&&!r}),i=qae(r??0,e,t,{enabled:n&&!!r}),{data:s,isLoading:c}=r?i:a,f=tie(),u=iie(r??0),m=r?u:f,{data:d}=_o("agents",{enabled:n&&e==="roles"}),[v,y]=x.useState({}),[b,w]=x.useState({}),[S,E]=x.useState(new Set);if(x.useEffect(()=>{s&&(y({...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 L=new Set(K);return L.has(D)?L.delete(D):L.add(D),L}),N=(d??[]).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:()=>xt.success("Configuration saved"),onError:()=>xt.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(Ls,{}),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],L=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(ft,{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(et,{type:L?"text":"password",value:v[D]??"",onChange:I=>y(G=>({...G,[D]:I.target.value})),placeholder:D,className:"h-8 text-xs font-mono"}),p.jsx(Se,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 shrink-0 p-0",onClick:()=>A(D),children:L?p.jsx(Zte,{className:"h-3.5 w-3.5"}):p.jsx(ene,{className:"h-3.5 w-3.5"})})]})]},D)})]})]}),j.length>0&&p.jsxs(p.Fragment,{children:[p.jsx(Ls,{}),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],L=b[D],I=K.default;if(K.type==="boolean")return p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsx(ft,{className:"text-xs font-mono",children:D}),K.description&&p.jsx("p",{className:"text-xs text-muted-foreground",children:K.description}),p.jsxs(Ti,{value:L!=null?String(L):I!=null?String(I):"",onValueChange:F=>w(q=>({...q,[D]:F==="true"})),children:[p.jsx(Mi,{className:"h-8 text-xs",children:p.jsx(Pi,{})}),p.jsxs(ki,{children:[p.jsx(Tn,{value:"true",children:"true"}),p.jsx(Tn,{value:"false",children:"false"})]})]})]},D);const G=K.type==="int"||K.type==="float"?"number":"text",z=K.type==="float"?"any":void 0,V=D==="default_agent"&&d?d.map(F=>F.name):void 0,k=V?`datalist-${D}`:void 0;return p.jsxs("div",{className:"flex flex-col gap-1",children:[p.jsx(ft,{className:"text-xs font-mono",children:D}),K.description&&p.jsx("p",{className:"text-xs text-muted-foreground",children:K.description}),p.jsx(et,{type:G,step:z,list:k,value:L!=null?String(L):"",onChange:F=>w(q=>({...q,[D]:G==="number"&&F.target.value!==""?Number(F.target.value):F.target.value})),placeholder:I!=null?String(I):void 0,className:"h-8 text-xs font-mono"}),V&&p.jsx("datalist",{id:k,children:V.map(F=>p.jsx("option",{value:F},F))}),D==="default_agent"&&P&&p.jsx("p",{className:"text-xs text-destructive",children:P})]},D)})]})]}),p.jsxs(Se,{size:"sm",onClick:R,disabled:m.isPending||!!P,className:"self-start",children:[p.jsx(gB,{className:"mr-2 h-3.5 w-3.5"}),m.isPending?"Saving...":"Save Configuration"]})]})}function XB({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:a}){var P,R;const i=YB(),s=Jae(),c=eie(),f=GB(a??0),u=rie(a??0),m=aie(a??0),d=a?f:i,v=a?u:s,y=a?m:c,[b,w]=x.useState(!1),S=v.isPending||y.isPending||d.isPending;if(!e)return null;const E=()=>{if(!b){w(!0);return}d.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?(xt.success(`Uninstalled ${e.name}`),r(!1)):xt.error(`Uninstall failed: ${D.stderr||D.stdout}`),w(!1)},onError:()=>{xt.error("Uninstall request failed"),w(!1)}})},O=()=>{v.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?xt.success(`Updated ${e.name}`):xt.error(`Update failed: ${D.stderr||D.stdout}`)},onError:()=>xt.error("Update request failed")})},j=()=>{y.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?xt.success(`Reinstalled ${e.name}`):xt.error(`Reinstall failed: ${D.stderr||D.stdout}`)},onError:()=>xt.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(oie,{open:n,onOpenChange:D=>{r(D),w(!1)},children:p.jsxs(cie,{side:"right",className:"flex h-full flex-col sm:max-w-lg",children:[p.jsxs(uie,{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(die,{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(Pm,{className:"min-h-0 flex-1 px-4",children:[t==="agents"&&p.jsx(mie,{agentName:e.name}),p.jsx(pie,{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(Se,{size:"sm",onClick:O,disabled:S,children:v.isPending?"Updating...":"Update"}),p.jsx(Se,{variant:"outline",size:"sm",onClick:j,disabled:S,children:y.isPending?"Reinstalling...":"Reinstall"}),p.jsx("div",{className:"flex-1"}),!N&&p.jsxs(p.Fragment,{children:[p.jsx(Se,{variant:b?"destructive":"outline",size:"sm",onClick:E,disabled:S,children:d.isPending?"Uninstalling...":b?"Confirm Uninstall":"Uninstall"}),b&&!d.isPending&&p.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>w(!1),children:"Cancel"})]})]})]})})}const vie=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function EC({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[a,i]=x.useState(n??"roles"),[s,c]=x.useState(""),[f,u]=x.useState(null),[m,d]=x.useState(null);x.useEffect(()=>{e&&n&&i(n)},[e,n]);const v=Zae(),y=nie(r??0),b=r?y:v,w=(f==null?void 0:f.status)==="success",S=()=>{s.trim()&&(u(null),d(null),b.mutate({type:a,name:s.trim()},{onSuccess:O=>{O.exit_code===0?(xt.success(`Installed ${s.trim()}`),u({status:"success",message:`Successfully installed ${s.trim()}`}),d(O.stdout||null)):(u({status:"error",message:"Installation failed"}),d(O.stderr||O.stdout||"Unknown error."))},onError:()=>{u({status:"error",message:"Install request failed"}),xt.error("Install request failed")}}))},E=O=>{O||(u(null),d(null),c("")),t(O)};return p.jsx(vl,{open:e,onOpenChange:E,children:p.jsxs(gl,{className:"sm:max-w-md",children:[p.jsxs(yl,{children:[p.jsx(xl,{children:r?"Install Resource to Project":"Install Resource"}),p.jsx($B,{children:"Install a resource from StrawHub by name."})]}),p.jsxs("div",{className:"flex flex-col gap-4",children:[f&&p.jsxs(hg,{variant:f.status==="error"?"destructive":"default",className:f.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[f.status==="success"?p.jsx(uC,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):p.jsx(dB,{className:"h-4 w-4"}),p.jsx(mg,{children:f.status==="success"?"Installed":"Error"}),p.jsx(pg,{children:f.message})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(ft,{htmlFor:"install-type",children:"Type"}),p.jsxs(Ti,{value:a,onValueChange:i,disabled:w,children:[p.jsx(Mi,{id:"install-type",children:p.jsx(Pi,{})}),p.jsx(ki,{children:vie.map(O=>p.jsx(Tn,{value:O.value,children:O.label},O.value))})]})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(ft,{htmlFor:"install-name",children:"Package Name"}),p.jsx(et,{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(zB,{children:(f==null?void 0:f.status)==="success"?p.jsx(Se,{onClick:()=>E(!1),children:"Done"}):p.jsx(Se,{onClick:S,disabled:!s.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const gie={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function yie({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:a}=KB(e),[i,s]=x.useState(null),[c,f]=x.useState(""),[u,m]=x.useState(!1),[d,v]=x.useState(!1),y=t??d,b=n??v,{data:w}=Fae(e,c,i??"",{enabled:u&&!!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(Se,{onClick:()=>b(!0),size:"sm",children:[p.jsx(x0,{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(rn,{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(ln,{children:p.jsx(cn,{className:"p-0",children:p.jsxs(Kc,{children:[p.jsx(Vc,{children:p.jsxs(Ir,{children:[p.jsx(We,{children:"Name"}),p.jsx(We,{children:"Type"}),p.jsx(We,{children:"Version"}),p.jsx(We,{children:"Description"}),p.jsx(We,{className:"w-24"})]})}),p.jsx(Yc,{children:r.map(S=>p.jsxs(Ir,{className:"cursor-pointer",onClick:()=>{s(S.name),f(S.type),m(!0)},children:[p.jsx(Qe,{className:"font-medium",children:S.name}),p.jsx(Qe,{children:p.jsx(qt,{variant:"outline",className:"text-xs",children:gie[S.type]??S.type})}),p.jsx(Qe,{className:"text-sm text-muted-foreground",children:S.version??"—"}),p.jsx(Qe,{className:"max-w-[300px] truncate text-sm",children:S.description||"—"}),p.jsx(Qe,{children:p.jsx(xie,{projectId:e,resourceType:S.type,name:S.name})})]},`${S.type}-${S.name}`))})]})})}),p.jsx(XB,{resource:w??null,resourceType:c,open:u,onOpenChange:m,projectId:e}),p.jsx(EC,{open:y,onOpenChange:b,projectId:e})]})}function xie({projectId:e,resourceType:t,name:n}){const[r,a]=x.useState(!1),i=GB(e),s=c=>{c.stopPropagation(),i.mutate({type:t,name:n},{onSuccess:f=>{f.exit_code===0?xt.success(`Uninstalled ${n}`):xt.error(`Uninstall failed: ${f.stderr||f.stdout}`),a(!1)},onError:()=>{xt.error("Uninstall request failed"),a(!1)}})};return r?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Se,{size:"sm",variant:"destructive",onClick:s,disabled:i.isPending,children:"Confirm"}),p.jsx(Se,{size:"sm",variant:"outline",onClick:c=>{c.stopPropagation(),a(!1)},children:"No"})]}):p.jsx(Se,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:c=>{c.stopPropagation(),a(!0)},children:p.jsx(pl,{className:"h-4 w-4"})})}function bie(e,t="30d"){return xn({queryKey:Be.projects.stats(e,t),queryFn:()=>$e.get(`/projects/${e}/stats?period=${t}`)})}var wie=["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 _C(e){if(typeof e!="string")return!1;var t=wie;return t.includes(e)}var Sie=["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"],Eie=new Set(Sie);function WB(e){return typeof e!="string"?!1:Eie.has(e)}function QB(e){return typeof e=="string"&&e.startsWith("data-")}function aa(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(WB(n)||QB(n))&&(t[n]=e[n]);return t}function Ac(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return aa(t)}return typeof e=="object"&&!Array.isArray(e)?aa(e):null}function br(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(WB(n)||QB(n)||_C(n))&&(t[n]=e[n]);return t}function _ie(e){return e==null?null:x.isValidElement(e)?br(e.props):typeof e=="object"&&!Array.isArray(e)?br(e):null}var jie=["children","width","height","viewBox","className","style","title","desc"];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 Cie(e,t){if(e==null)return{};var n,r,a=Oie(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 Oie(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 jC=x.forwardRef((e,t)=>{var{children:n,width:r,height:a,viewBox:i,className:s,style:c,title:f,desc:u}=e,m=Cie(e,jie),d=i||{width:r,height:a,x:0,y:0},v=ct("recharts-surface",s);return x.createElement("svg",qE({},br(m),{className:v,width:r,height:a,style:c,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),x.createElement("title",null,f),x.createElement("desc",null,u),n)}),Aie=["children","className"];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 Nie(e,t){if(e==null)return{};var n,r,a=Tie(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 Tie(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 Pn=x.forwardRef((e,t)=>{var{children:n,className:r}=e,a=Nie(e,Aie),i=ct("recharts-layer",r);return x.createElement("g",KE({className:i},br(a),{ref:t}),n)}),ZB=x.createContext(null),Pie=()=>x.useContext(ZB);function Rt(e){return function(){return e}}const JB=Math.cos,qg=Math.sin,ri=Math.sqrt,Kg=Math.PI,E0=2*Kg,VE=Math.PI,YE=2*VE,Zl=1e-6,Mie=YE-Zl;function e8(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function kie(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return e8;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 Rie{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?e8:kie(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,f=r-t,u=a-n,m=s-t,d=c-n,v=m*m+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(v>Zl)if(!(Math.abs(d*f-u*m)>Zl)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-s,b=a-c,w=f*f+u*u,S=y*y+b*b,E=Math.sqrt(w),O=Math.sqrt(v),j=i*Math.tan((VE-Math.acos((w+v-S)/(2*E*O)))/2),A=j/O,N=j/E;Math.abs(A-1)>Zl&&this._append`L${t+A*m},${n+A*d}`,this._append`A${i},${i},0,0,${+(d*y>m*b)},${this._x1=t+N*f},${this._y1=n+N*u}`}}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),f=r*Math.sin(a),u=t+c,m=n+f,d=1^s,v=s?a-i:i-a;this._x1===null?this._append`M${u},${m}`:(Math.abs(this._x1-u)>Zl||Math.abs(this._y1-m)>Zl)&&this._append`L${u},${m}`,r&&(v<0&&(v=v%YE+YE),v>Mie?this._append`A${r},${r},0,1,${d},${t-c},${n-f}A${r},${r},0,1,${d},${this._x1=u},${this._y1=m}`:v>Zl&&this._append`A${r},${r},0,${+(v>=VE)},${d},${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 CC(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 Rie(t)}function OC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function t8(e){this._context=e}t8.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 t8(e)}function n8(e){return e[0]}function r8(e){return e[1]}function a8(e,t){var n=Rt(!0),r=null,a=_0,i=null,s=CC(c);e=typeof e=="function"?e:e===void 0?n8:Rt(e),t=typeof t=="function"?t:t===void 0?r8:Rt(t);function c(f){var u,m=(f=OC(f)).length,d,v=!1,y;for(r==null&&(i=a(y=s())),u=0;u<=m;++u)!(u<m&&n(d=f[u],u,f))===v&&((v=!v)?i.lineStart():i.lineEnd()),v&&i.point(+e(d,u,f),+t(d,u,f));if(y)return i=null,y+""||null}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:Rt(+f),c):e},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:Rt(+f),c):t},c.defined=function(f){return arguments.length?(n=typeof f=="function"?f:Rt(!!f),c):n},c.curve=function(f){return arguments.length?(a=f,r!=null&&(i=a(r)),c):a},c.context=function(f){return arguments.length?(f==null?r=i=null:i=a(r=f),c):r},c}function Lv(e,t,n){var r=null,a=Rt(!0),i=null,s=_0,c=null,f=CC(u);e=typeof e=="function"?e:e===void 0?n8:Rt(+e),t=typeof t=="function"?t:Rt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?r8:Rt(+n);function u(d){var v,y,b,w=(d=OC(d)).length,S,E=!1,O,j=new Array(w),A=new Array(w);for(i==null&&(c=s(O=f())),v=0;v<=w;++v){if(!(v<w&&a(S=d[v],v,d))===E)if(E=!E)y=v,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),b=v-1;b>=y;--b)c.point(j[b],A[b]);c.lineEnd(),c.areaEnd()}E&&(j[v]=+e(S,v,d),A[v]=+t(S,v,d),c.point(r?+r(S,v,d):j[v],n?+n(S,v,d):A[v]))}if(O)return c=null,O+""||null}function m(){return a8().defined(a).curve(s).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Rt(+d),r=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Rt(+d),u):e},u.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Rt(+d),u):r},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Rt(+d),n=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Rt(+d),u):t},u.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Rt(+d),u):n},u.lineX0=u.lineY0=function(){return m().x(e).y(t)},u.lineY1=function(){return m().x(e).y(n)},u.lineX1=function(){return m().x(r).y(t)},u.defined=function(d){return arguments.length?(a=typeof d=="function"?d:Rt(!!d),u):a},u.curve=function(d){return arguments.length?(s=d,i!=null&&(c=s(i)),u):s},u.context=function(d){return arguments.length?(d==null?i=c=null:c=s(i=d),u):i},u}class i8{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 Die(e){return new i8(e,!0)}function Iie(e){return new i8(e,!1)}const AC={draw(e,t){const n=ri(t/Kg);e.moveTo(n,0),e.arc(0,0,n,0,E0)}},Lie={draw(e,t){const n=ri(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()}},o8=ri(1/3),zie=o8*2,$ie={draw(e,t){const n=ri(t/zie),r=n*o8;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Bie={draw(e,t){const n=ri(t),r=-n/2;e.rect(r,r,n,n)}},Uie=.8908130915292852,s8=qg(Kg/10)/qg(7*Kg/10),Hie=qg(E0/10)*s8,Fie=-JB(E0/10)*s8,qie={draw(e,t){const n=ri(t*Uie),r=Hie*n,a=Fie*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const s=E0*i/5,c=JB(s),f=qg(s);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*a,f*r+c*a)}e.closePath()}},d1=ri(3),Kie={draw(e,t){const n=-ri(t/(d1*3));e.moveTo(0,n*2),e.lineTo(-d1*n,-n),e.lineTo(d1*n,-n),e.closePath()}},ya=-.5,xa=ri(3)/2,GE=1/ri(12),Vie=(GE/2+1)*3,Yie={draw(e,t){const n=ri(t/Vie),r=n/2,a=n*GE,i=r,s=n*GE+n,c=-i,f=s;e.moveTo(r,a),e.lineTo(i,s),e.lineTo(c,f),e.lineTo(ya*r-xa*a,xa*r+ya*a),e.lineTo(ya*i-xa*s,xa*i+ya*s),e.lineTo(ya*c-xa*f,xa*c+ya*f),e.lineTo(ya*r+xa*a,ya*a-xa*r),e.lineTo(ya*i+xa*s,ya*s-xa*i),e.lineTo(ya*c+xa*f,ya*f-xa*c),e.closePath()}};function Gie(e,t){let n=null,r=CC(a);e=typeof e=="function"?e:Rt(e||AC),t=typeof t=="function"?t:Rt(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:Rt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Rt(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function Vg(){}function Yg(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 l8(e){this._context=e}l8.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:Yg(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:Yg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Xie(e){return new l8(e)}function c8(e){this._context=e}c8.prototype={areaStart:Vg,areaEnd:Vg,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:Yg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Wie(e){return new c8(e)}function u8(e){this._context=e}u8.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:Yg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Qie(e){return new u8(e)}function f8(e){this._context=e}f8.prototype={areaStart:Vg,areaEnd:Vg,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 Zie(e){return new f8(e)}function tk(e){return e<0?-1:1}function nk(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(tk(i)+tk(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(c))||0}function rk(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 Gg(e){this._context=e}Gg.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,rk(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,rk(this,n=nk(this,e,t)),n);break;default:h1(this,this._t0,n=nk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function d8(e){this._context=new h8(e)}(d8.prototype=Object.create(Gg.prototype)).point=function(e,t){Gg.prototype.point.call(this,t,e)};function h8(e){this._context=e}h8.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 Jie(e){return new Gg(e)}function eoe(e){return new d8(e)}function m8(e){this._context=e}m8.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=ak(e),a=ak(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 ak(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 toe(e){return new m8(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 noe(e){return new j0(e,.5)}function roe(e){return new j0(e,0)}function aoe(e){return new j0(e,1)}function Nc(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 XE(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ioe(e,t){return e[t]}function ooe(e){const t=[];return t.key=e,t}function soe(){var e=Rt([]),t=XE,n=Nc,r=ioe;function a(i){var s=Array.from(e.apply(this,arguments),ooe),c,f=s.length,u=-1,m;for(const d of i)for(c=0,++u;c<f;++c)(s[c][u]=[0,+r(d,s[c].key,u,i)]).data=d;for(c=0,m=OC(t(s));c<f;++c)s[m[c]].index=c;return n(s,m),s}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:Rt(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:Rt(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?XE:typeof i=="function"?i:Rt(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Nc,a):n},a}function loe(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}Nc(e,t)}}function coe(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}Nc(e,t)}}function uoe(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,f=0,u=0;c<s;++c){for(var m=e[t[c]],d=m[r][1]||0,v=m[r-1][1]||0,y=(d-v)/2,b=0;b<c;++b){var w=e[t[b]],S=w[r][1]||0,E=w[r-1][1]||0;y+=S-E}f+=d,u+=y*d}a[r-1][1]+=a[r-1][0]=n,f&&(n-=u/f)}a[r-1][1]+=a[r-1][0]=n,Nc(e,t)}}var m1={},p1={},ik;function foe(){return ik||(ik=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(p1)),p1}var v1={},ok;function p8(){return ok||(ok=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={},sk;function NC(){return sk||(sk=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={},lk;function doe(){return lk||(lk=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 ck;function TC(){return ck||(ck=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=doe(),n=NC();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,f="",u="",m=!1;for(a.charCodeAt(0)===46&&(i.push(""),c++);c<s;){const d=a[c];u?d==="\\"&&c+1<s?(c++,f+=a[c]):d===u?u="":f+=d:m?d==='"'||d==="'"?u=d:d==="]"?(m=!1,i.push(f),f=""):f+=d:d==="["?(m=!0,f&&(i.push(f),f="")):d==="."?f&&(i.push(f),f=""):f+=d,c++}return f&&i.push(f),i}e.toPath=r})(y1)),y1}var uk;function PC(){return uk||(uk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=foe(),n=p8(),r=NC(),a=TC();function i(c,f,u){if(c==null)return u;switch(typeof f){case"string":{if(t.isUnsafeProperty(f))return u;const m=c[f];return m===void 0?n.isDeepKey(f)?i(c,a.toPath(f),u):u:m}case"number":case"symbol":{typeof f=="number"&&(f=r.toKey(f));const m=c[f];return m===void 0?u:m}default:{if(Array.isArray(f))return s(c,f,u);if(Object.is(f==null?void 0:f.valueOf(),-0)?f="-0":f=String(f),t.isUnsafeProperty(f))return u;const m=c[f];return m===void 0?u:m}}}function s(c,f,u){if(f.length===0)return u;let m=c;for(let d=0;d<f.length;d++){if(m==null||t.isUnsafeProperty(f[d]))return u;m=m[f[d]]}return m===void 0?u:m}e.get=i})(m1)),m1}var b1,fk;function hoe(){return fk||(fk=1,b1=PC().get),b1}var moe=hoe();const Tc=Za(moe);var poe=4;function Ws(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:poe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function tn(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+Ws(c)+i:a+i},"")}var Bn=e=>e===0?0:e>0?1:-1,Ri=e=>typeof e=="number"&&e!=+e,Pc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Oe=e=>(typeof e=="number"||e instanceof Number)&&!Ri(e),Di=e=>Oe(e)||typeof e=="string",voe=0,Fh=e=>{var t=++voe;return"".concat(e||"").concat(t)},dr=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(Pc(t)){if(n==null)return r;var s=t.indexOf("%");i=n*parseFloat(t.slice(0,s))/100}else i=+t;return Ri(i)&&(i=r),a&&n!=null&&i>n&&(i=n),i},v8=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 Ht(e,t,n){return Oe(e)&&Oe(t)?Ws(e+n*(t-e)):t}function g8(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Tc(r,t))===n)}var Yt=e=>e===null||typeof e>"u",Mm=e=>Yt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Rr(e){return e!=null}function bl(){}var goe=["type","size","sizeType"];function WE(){return WE=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},WE.apply(null,arguments)}function dk(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 hk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dk(Object(n),!0).forEach(function(r){yoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yoe(e,t,n){return(t=xoe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xoe(e){var t=boe(e,"string");return typeof t=="symbol"?t:t+""}function boe(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 woe(e,t){if(e==null)return{};var n,r,a=Soe(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 Soe(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 y8={symbolCircle:AC,symbolCross:Lie,symbolDiamond:$ie,symbolSquare:Bie,symbolStar:qie,symbolTriangle:Kie,symbolWye:Yie},Eoe=Math.PI/180,_oe=e=>{var t="symbol".concat(Mm(e));return y8[t]||AC},joe=(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*Eoe;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}},Coe=(e,t)=>{y8["symbol".concat(Mm(e))]=t},MC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,a=woe(e,goe),i=hk(hk({},a),{},{type:t,size:n,sizeType:r}),s="circle";typeof t=="string"&&(s=t);var c=()=>{var v=_oe(s),y=Gie().type(v).size(joe(n,r,s)),b=y();if(b!==null)return b},{className:f,cx:u,cy:m}=i,d=br(i);return Oe(u)&&Oe(m)&&Oe(n)?x.createElement("path",WE({},d,{className:ct("recharts-symbols",f),transform:"translate(".concat(u,", ").concat(m,")"),d:c()})):null};MC.registerSymbol=Coe;var x8=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,kC=(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=>{_C(a)&&typeof n[a]=="function"&&(r[a]=(i=>n[a](n,i)))}),r},Ooe=(e,t,n)=>r=>(e(t,n,r),null),km=(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];_C(a)&&typeof i=="function"&&(r||(r={}),r[a]=Ooe(i,t,n))}),r};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 Aoe(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){Noe(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 Noe(e,t,n){return(t=Toe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Toe(e){var t=Poe(e,"string");return typeof t=="symbol"?t:t+""}function Poe(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 bn(e,t){var n=Aoe({},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 Xg(){return Xg=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},Xg.apply(null,arguments)}function pk(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 b8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pk(Object(n),!0).forEach(function(r){Moe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Moe(e,t,n){return(t=koe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function koe(e){var t=Roe(e,"string");return typeof t=="symbol"?t:t+""}function Roe(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 wa=32,Doe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Ioe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Loe(e){var{data:t,iconType:n,inactiveColor:r}=e,a=wa/2,i=wa/6,s=wa/3,c=t.inactive?r:t.color,f=n??t.type;if(f==="none")return null;if(f==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:Ioe(t.payload),x1:0,y1:a,x2:wa,y2:a,className:"recharts-legend-icon"});if(f==="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(wa,"M").concat(2*s,",").concat(a,`
            A`).concat(i,",").concat(i,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(f==="rect")return x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(wa/8,"h").concat(wa,"v").concat(wa*3/4,"h").concat(-wa,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var u=b8({},t);return delete u.legendIcon,x.cloneElement(t.legendIcon,u)}return x.createElement(MC,{fill:c,cx:a,cy:a,size:wa,sizeType:"diameter",type:f})}function zoe(e){var{payload:t,iconSize:n,layout:r,formatter:a,inactiveColor:i,iconType:s,labelStyle:c}=e,f={x:0,y:0,width:wa,height:wa},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,v)=>{var y=d.formatter||a,b=ct({"recharts-legend-item":!0,["legend-item-".concat(v)]:!0,inactive:d.inactive});if(d.type==="none")return null;var w=typeof c=="object"?b8({},c):{};w.color=d.inactive?i:w.color||d.color;var S=y?y(d.value,d,v):d.value;return x.createElement("li",Xg({className:b,style:u,key:"legend-item-".concat(v)},km(e,d,v)),x.createElement(jC,{width:n,height:n,viewBox:f,style:m,"aria-label":"".concat(S," legend icon")},x.createElement(Loe,{data:d,iconType:s,inactiveColor:i})),x.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var $oe=e=>{var t=bn(e,Doe),{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(zoe,Xg({},t,{payload:n})))},w1={},S1={},vk;function Boe(){return vk||(vk=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={},gk;function Uoe(){return gk||(gk=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={},yk;function w8(){return yk||(yk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(_1)),_1}var j1={},C1={},O1={},xk;function Hoe(){return xk||(xk=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 bk;function S8(){return bk||(bk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hoe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(C1)),C1}var A1={},wk;function Foe(){return wk||(wk=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 Sk;function qoe(){return Sk||(Sk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=S8(),n=Foe();function r(a){return n.isObjectLike(a)&&t.isArrayLike(a)}e.isArrayLikeObject=r})(j1)),j1}var N1={},T1={},Ek;function Koe(){return Ek||(Ek=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PC();function n(r){return function(a){return t.get(a,r)}}e.property=n})(T1)),T1}var P1={},M1={},k1={},R1={},_k;function E8(){return _k||(_k=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={},jk;function _8(){return jk||(jk=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={},Ck;function j8(){return Ck||(Ck=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 Ok;function Voe(){return Ok||(Ok=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E8(),n=_8(),r=j8();function a(m,d,v){return typeof v!="function"?a(m,d,()=>{}):i(m,d,function y(b,w,S,E,O,j){const A=v(b,w,S,E,O,j);return A!==void 0?!!A:i(b,w,y,j)},new Map)}function i(m,d,v,y){if(d===m)return!0;switch(typeof d){case"object":return s(m,d,v,y);case"function":return Object.keys(d).length>0?i(m,{...d},v,y):r.isEqualsSameValueZero(m,d);default:return t.isObject(m)?typeof d=="string"?d==="":!0:r.isEqualsSameValueZero(m,d)}}function s(m,d,v,y){if(d==null)return!0;if(Array.isArray(d))return f(m,d,v,y);if(d instanceof Map)return c(m,d,v,y);if(d instanceof Set)return u(m,d,v,y);const b=Object.keys(d);if(m==null||n.isPrimitive(m))return b.length===0;if(b.length===0)return!0;if(y!=null&&y.has(d))return y.get(d)===m;y==null||y.set(d,m);try{for(let w=0;w<b.length;w++){const S=b[w];if(!n.isPrimitive(m)&&!(S in m)||d[S]===void 0&&m[S]!==void 0||d[S]===null&&m[S]!==null||!v(m[S],d[S],S,m,d,y))return!1}return!0}finally{y==null||y.delete(d)}}function c(m,d,v,y){if(d.size===0)return!0;if(!(m instanceof Map))return!1;for(const[b,w]of d.entries()){const S=m.get(b);if(v(S,w,b,m,d,y)===!1)return!1}return!0}function f(m,d,v,y){if(d.length===0)return!0;if(!Array.isArray(m))return!1;const b=new Set;for(let w=0;w<d.length;w++){const S=d[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,d,y)&&(A=!0),A){b.add(O),E=!0;break}}if(!E)return!1}return!0}function u(m,d,v,y){return d.size===0?!0:m instanceof Set?f([...m],[...d],v,y):!1}e.isMatchWith=a,e.isSetMatch=u})(k1)),k1}var Ak;function C8(){return Ak||(Ak=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Voe();function n(r,a){return t.isMatchWith(r,a,()=>{})}e.isMatch=n})(M1)),M1}var L1={},z1={},$1={},Nk;function Yoe(){return Nk||(Nk=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={},Tk;function RC(){return Tk||(Tk=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={},Pk;function O8(){return Pk||(Pk=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]",f="[object Map]",u="[object Set]",m="[object Array]",d="[object Function]",v="[object ArrayBuffer]",y="[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=d,e.int16ArrayTag=T,e.int32ArrayTag=P,e.int8ArrayTag=N,e.mapTag=f,e.numberTag=r,e.objectTag=y,e.regexpTag=t,e.setTag=u,e.stringTag=n,e.symbolTag=s,e.uint16ArrayTag=O,e.uint32ArrayTag=j,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=E})(U1)),U1}var H1={},Mk;function Goe(){return Mk||(Mk=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 kk;function A8(){return kk||(kk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yoe(),n=RC(),r=O8(),a=_8(),i=Goe();function s(m,d){return c(m,void 0,m,new Map,d)}function c(m,d,v,y=new Map,b=void 0){const w=b==null?void 0:b(m,d,v,y);if(w!==void 0)return w;if(a.isPrimitive(m))return m;if(y.has(m))return y.get(m);if(Array.isArray(m)){const S=new Array(m.length);y.set(m,S);for(let E=0;E<m.length;E++)S[E]=c(m[E],E,v,y,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;y.set(m,S);for(const[E,O]of m)S.set(E,c(O,E,v,y,b));return S}if(m instanceof Set){const S=new Set;y.set(m,S);for(const E of m)S.add(c(E,void 0,v,y,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);y.set(m,S);for(let E=0;E<m.length;E++)S[E]=c(m[E],E,v,y,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 y.set(m,S),f(S,m,v,y,b),S}if(typeof File<"u"&&m instanceof File){const S=new File([m],m.name,{type:m.type});return y.set(m,S),f(S,m,v,y,b),S}if(typeof Blob<"u"&&m instanceof Blob){const S=new Blob([m],{type:m.type});return y.set(m,S),f(S,m,v,y,b),S}if(m instanceof Error){const S=structuredClone(m);return y.set(m,S),S.message=m.message,S.name=m.name,S.stack=m.stack,S.cause=m.cause,S.constructor=m.constructor,f(S,m,v,y,b),S}if(m instanceof Boolean){const S=new Boolean(m.valueOf());return y.set(m,S),f(S,m,v,y,b),S}if(m instanceof Number){const S=new Number(m.valueOf());return y.set(m,S),f(S,m,v,y,b),S}if(m instanceof String){const S=new String(m.valueOf());return y.set(m,S),f(S,m,v,y,b),S}if(typeof m=="object"&&u(m)){const S=Object.create(Object.getPrototypeOf(m));return y.set(m,S),f(S,m,v,y,b),S}return m}function f(m,d,v=m,y,b){const w=[...Object.keys(d),...t.getSymbols(d)];for(let S=0;S<w.length;S++){const E=w[S],O=Object.getOwnPropertyDescriptor(m,E);(O==null||O.writable)&&(m[E]=c(d[E],E,v,y,b))}}function u(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=f})(z1)),z1}var Rk;function Xoe(){return Rk||(Rk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A8();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(L1)),L1}var Dk;function Woe(){return Dk||(Dk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=C8(),n=Xoe();function r(a){return a=n.cloneDeep(a),i=>t.isMatch(i,a)}e.matches=r})(P1)),P1}var F1={},q1={},K1={},Ik;function Qoe(){return Ik||(Ik=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A8(),n=RC(),r=O8();function a(i,s){return t.cloneDeepWith(i,(c,f,u,m)=>{const d=s==null?void 0:s(c,f,u,m);if(d!==void 0)return d;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,u,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 Lk;function Zoe(){return Lk||(Lk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qoe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(q1)),q1}var V1={},Y1={},zk;function N8(){return zk||(zk=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={},$k;function Joe(){return $k||($k=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(G1)),G1}var Bk;function ese(){return Bk||(Bk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=p8(),n=N8(),r=Joe(),a=TC();function i(s,c){let f;if(Array.isArray(c)?f=c:typeof c=="string"&&t.isDeepKey(c)&&(s==null?void 0:s[c])==null?f=a.toPath(c):f=[c],f.length===0)return!1;let u=s;for(let m=0;m<f.length;m++){const d=f[m];if((u==null||!Object.hasOwn(u,d))&&!((Array.isArray(u)||r.isArguments(u))&&n.isIndex(d)&&d<u.length))return!1;u=u[d]}return!0}e.has=i})(V1)),V1}var Uk;function tse(){return Uk||(Uk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=C8(),n=NC(),r=Zoe(),a=PC(),i=ese();function s(c,f){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 f=r.cloneDeep(f),function(u){const m=a.get(u,c);return m===void 0?i.has(u,c):f===void 0?m===void 0:t.isMatch(m,f)}}e.matchesProperty=s})(F1)),F1}var Hk;function nse(){return Hk||(Hk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=w8(),n=Koe(),r=Woe(),a=tse();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 Fk;function rse(){return Fk||(Fk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Boe(),n=Uoe(),r=w8(),a=qoe(),i=nse();function s(c,f=r.identity){return a.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(i.iteratee(f),1)):[]}e.uniqBy=s})(w1)),w1}var X1,qk;function ase(){return qk||(qk=1,X1=rse().uniqBy),X1}var ise=ase();const Kk=Za(ise);function T8(e,t,n){return t===!0?Kk(e,n):typeof t=="function"?Kk(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 Vk;function ose(){if(Vk)return Q1;Vk=1;var e=qf(),t=hW();function n(u,m){return u===m&&(u!==0||1/u===1/m)||u!==u&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Q1.useSyncExternalStoreWithSelector=function(u,m,d,v,y){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),y!==void 0&&w.hasValue){var P=w.value;if(y(P,T))return A=P}return A=T}if(P=A,r(j,T))return P;var R=v(T);return y!==void 0&&y(P,R)?(j=T,P):(j=T,A=R)}var O=!1,j,A,N=d===void 0?null:d;return[function(){return E(m())},N===null?void 0:function(){return E(N())}]},[m,d,v,y]);var S=a(u,b[0],b[1]);return s(function(){w.hasValue=!0,w.value=S},[S]),f(S),S},Q1}var Yk;function sse(){return Yk||(Yk=1,W1.exports=ose()),W1.exports}var P8=sse();const lse=Za(P8);var DC=x.createContext(null),cse=e=>e,Nt=()=>{var e=x.useContext(DC);return e?e.store.dispatch:cse},vg=()=>{},use=()=>vg,fse=(e,t)=>e===t;function Te(e){var t=x.useContext(DC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:vg,[t,e]);return P8.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:use,t?t.store.getState:vg,t?t.store.getState:vg,n,fse)}function dse(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function hse(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function mse(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 Gk=e=>Array.isArray(e)?e:[e];function pse(e){const t=Array.isArray(e[0])?e[0]:e;return mse(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function vse(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}var gse=class{constructor(e){this.value=e}deref(){return this.value}},yse=typeof WeakRef<"u"?WeakRef:gse,xse=0,Xk=1;function zv(){return{s:xse,v:void 0,o:null,p:null}}function M8(e,t={}){let n=zv();const{resultEqualityCheck:r}=t;let a,i=0;function s(){var d;let c=n;const{length:f}=arguments;for(let v=0,y=f;v<y;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=zv(),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=zv(),w.set(b,c)):c=S}}const u=c;let m;if(c.s===Xk)m=c.v;else if(m=e.apply(null,arguments),i++,r){const v=((d=a==null?void 0:a.deref)==null?void 0:d.call(a))??a;v!=null&&r(v,m)&&(m=v,i!==0&&i--),a=typeof m=="object"&&m!==null||typeof m=="function"?new yse(m):m}return u.s=Xk,u.v=m,m}return s.clearCache=()=>{n=zv(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function bse(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...a)=>{let i=0,s=0,c,f={},u=a.pop();typeof u=="object"&&(f=u,u=a.pop()),dse(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const m={...n,...f},{memoize:d,memoizeOptions:v=[],argsMemoize:y=M8,argsMemoizeOptions:b=[]}=m,w=Gk(v),S=Gk(b),E=pse(a),O=d(function(){return i++,u.apply(null,arguments)},...w),j=y(function(){s++;const N=vse(E,arguments);return c=O.apply(null,N),c},...S);return Object.assign(j,{resultFunc:u,memoizedResultFunc:O,dependencies:E,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>c,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:d,argsMemoize:y})};return Object.assign(r,{withTypes:()=>r}),r}var se=bse(M8),wse=Object.assign((e,t=se)=>{hse(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,f)=>(s[n[f]]=c,s),{}))},{withTypes:()=>wse}),Z1={},J1={},eS={},Wk;function Sse(){return Wk||(Wk=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={},Qk;function k8(){return Qk||(Qk=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 Zk;function Ese(){return Zk||(Zk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=k8(),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 Jk;function _se(){return Jk||(Jk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sse(),n=Ese(),r=TC();function a(i,s,c,f){if(i==null)return[];c=f?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(y=>String(y));const u=(y,b)=>{let w=y;for(let S=0;S<b.length&&w!=null;++S)w=w[b[S]];return w},m=(y,b)=>b==null||y==null?b:typeof y=="object"&&"key"in y?Object.hasOwn(b,y.key)?b[y.key]:u(b,y.path):typeof y=="function"?y(b):Array.isArray(y)?u(b,y):typeof b=="object"?b[y]:b,d=s.map(y=>(Array.isArray(y)&&y.length===1&&(y=y[0]),y==null||typeof y=="function"||Array.isArray(y)||n.isKey(y)?y:{key:y,path:r.toPath(y)}));return i.map(y=>({original:y,criteria:d.map(b=>m(b,y))})).slice().sort((y,b)=>{for(let w=0;w<d.length;w++){const S=t.compareValues(y.criteria[w],b.criteria[w],c[w]);if(S!==0)return S}return 0}).map(y=>y.original)}e.orderBy=a})(J1)),J1}var rS={},eR;function jse(){return eR||(eR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const a=[],i=Math.floor(r),s=(c,f)=>{for(let u=0;u<c.length;u++){const m=c[u];Array.isArray(m)&&f<i?s(m,f+1):a.push(m)}};return s(n,0),a}e.flatten=t})(rS)),rS}var aS={},tR;function R8(){return tR||(tR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N8(),n=S8(),r=E8(),a=j8();function i(s,c,f){return r.isObject(f)&&(typeof c=="number"&&n.isArrayLike(f)&&t.isIndex(c)&&c<f.length||typeof c=="string"&&c in f)?a.isEqualsSameValueZero(f[c],s):!1}e.isIterateeCall=i})(aS)),aS}var nR;function Cse(){return nR||(nR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_se(),n=jse(),r=R8();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,rR;function Ose(){return rR||(rR=1,iS=Cse().sortBy),iS}var Ase=Ose();const C0=Za(Ase);var D8=e=>e.legend.settings,Nse=e=>e.legend.size,Tse=e=>e.legend.payload,Pse=se([Tse,D8],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?C0(r,n):r});function Mse(){return Te(Pse)}var $v=1;function I8(){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)>$v||Math.abs(s.left-t.left)>$v||Math.abs(s.top-t.top)>$v||Math.abs(s.width-t.width)>$v)&&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 Wn(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 kse=typeof Symbol=="function"&&Symbol.observable||"@@observable",aR=kse,oS=()=>Math.random().toString(36).substring(7).split("").join("."),Rse={INIT:`@@redux/INIT${oS()}`,REPLACE:`@@redux/REPLACE${oS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${oS()}`},Wg=Rse;function IC(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 L8(e,t,n){if(typeof e!="function")throw new Error(Wn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Wn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Wn(1));return n(L8)(e,t)}let r=e,a=t,i=new Map,s=i,c=0,f=!1;function u(){s===i&&(s=new Map,i.forEach((S,E)=>{s.set(E,S)}))}function m(){if(f)throw new Error(Wn(3));return a}function d(S){if(typeof S!="function")throw new Error(Wn(4));if(f)throw new Error(Wn(5));let E=!0;u();const O=c++;return s.set(O,S),function(){if(E){if(f)throw new Error(Wn(6));E=!1,u(),s.delete(O),i=null}}}function v(S){if(!IC(S))throw new Error(Wn(7));if(typeof S.type>"u")throw new Error(Wn(8));if(typeof S.type!="string")throw new Error(Wn(17));if(f)throw new Error(Wn(9));try{f=!0,a=r(a,S)}finally{f=!1}return(i=s).forEach(O=>{O()}),S}function y(S){if(typeof S!="function")throw new Error(Wn(10));r=S,v({type:Wg.REPLACE})}function b(){const S=d;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Wn(11));function O(){const A=E;A.next&&A.next(m())}return O(),{unsubscribe:S(O)}},[aR](){return this}}}return v({type:Wg.INIT}),{dispatch:v,subscribe:d,getState:m,replaceReducer:y,[aR]:b}}function Dse(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Wg.INIT})>"u")throw new Error(Wn(12));if(typeof n(void 0,{type:Wg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Wn(13))})}function z8(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{Dse(n)}catch(i){a=i}return function(s={},c){if(a)throw a;let f=!1;const u={};for(let m=0;m<r.length;m++){const d=r[m],v=n[d],y=s[d],b=v(y,c);if(typeof b>"u")throw c&&c.type,new Error(Wn(14));u[d]=b,f=f||b!==y}return f=f||r.length!==Object.keys(s).length,f?u:s}}function Qg(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Ise(...e){return t=>(n,r)=>{const a=t(n,r);let i=()=>{throw new Error(Wn(15))};const s={getState:a.getState,dispatch:(f,...u)=>i(f,...u)},c=e.map(f=>f(s));return i=Qg(...c)(a.dispatch),{...a,dispatch:i}}}function $8(e){return IC(e)&&"type"in e&&typeof e.type=="string"}var B8=Symbol.for("immer-nothing"),iR=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state");function Fa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ea=Object,Af=ea.getPrototypeOf,Zg="constructor",O0="prototype",QE="configurable",Jg="enumerable",gg="writable",qh="value",Ro=e=>!!e&&!!e[wr];function Qa(e){var t;return e?U8(e)||N0(e)||!!e[iR]||!!((t=e[Zg])!=null&&t[iR])||T0(e)||P0(e):!1}var Lse=ea[O0][Zg].toString(),oR=new WeakMap;function U8(e){if(!e||!LC(e))return!1;const t=Af(e);if(t===null||t===ea[O0])return!0;const n=ea.hasOwnProperty.call(t,Zg)&&t[Zg];if(n===Object)return!0;if(!Qu(n))return!1;let r=oR.get(n);return r===void 0&&(r=Function.toString.call(n),oR.set(n,r)),r===Lse}function A0(e,t,n=!0){Rm(e)===0?(n?Reflect.ownKeys(e):ea.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((r,a)=>t(a,r,e))}function Rm(e){const t=e[wr];return t?t.type_:N0(e)?1:T0(e)?2:P0(e)?3:0}var sR=(e,t,n=Rm(e))=>n===2?e.has(t):ea[O0].hasOwnProperty.call(e,t),ZE=(e,t,n=Rm(e))=>n===2?e.get(t):e[t],ey=(e,t,n,r=Rm(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function zse(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,LC=e=>typeof e=="object",Qu=e=>typeof e=="function",sS=e=>typeof e=="boolean";function $se(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var po=e=>e.copy_||e.base_,zC=e=>e.modified_?e.copy_:e.base_;function JE(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=U8(e);if(t===!0||t==="class_only"&&!n){const r=ea.getOwnPropertyDescriptors(e);delete r[wr];let a=Reflect.ownKeys(r);for(let i=0;i<a.length;i++){const s=a[i],c=r[s];c[gg]===!1&&(c[gg]=!0,c[QE]=!0),(c.get||c.set)&&(r[s]={[QE]:!0,[gg]:!0,[Jg]:c[Jg],[qh]:e[s]})}return ea.create(Af(e),r)}else{const r=Af(e);if(r!==null&&n)return{...e};const a=ea.create(r);return ea.assign(a,e)}}function $C(e,t=!1){return M0(e)||Ro(e)||!Qa(e)||(Rm(e)>1&&ea.defineProperties(e,{set:Bv,add:Bv,clear:Bv,delete:Bv}),ea.freeze(e),t&&A0(e,(n,r)=>{$C(r,!0)},!1)),e}function Bse(){Fa(2)}var Bv={[qh]:Bse};function M0(e){return e===null||!LC(e)?!0:ea.isFrozen(e)}var ty="MapSet",e_="Patches",lR="ArrayMethods",H8={};function Mc(e){const t=H8[e];return t||Fa(0,e),t}var cR=e=>!!H8[e],Kh,F8=()=>Kh,Use=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:cR(ty)?Mc(ty):void 0,arrayMethodsPlugin_:cR(lR)?Mc(lR):void 0});function uR(e,t){t&&(e.patchPlugin_=Mc(e_),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function t_(e){n_(e),e.drafts_.forEach(Hse),e.drafts_=null}function n_(e){e===Kh&&(Kh=e.parent_)}var fR=e=>Kh=Use(Kh,e);function Hse(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function dR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[wr].modified_&&(t_(t),Fa(4)),Qa(e)&&(e=hR(t,e));const{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(n[wr].base_,e,t)}else e=hR(t,n);return Fse(t,e,!0),t_(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==B8?e:void 0}function hR(e,t){if(M0(t))return t;const n=t[wr];if(!n)return ny(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);V8(n,e)}return n.copy_}function Fse(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$C(t,n)}function q8(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var k0=(e,t)=>e.scope_===t,qse=[];function K8(e,t,n,r){const a=po(e),i=e.type_;if(r!==void 0&&ZE(a,r,i)===t){ey(a,r,n,i);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;A0(a,(f,u)=>{if(Ro(u)){const m=c.get(u)||[];m.push(f),c.set(u,m)}})}const s=e.draftLocations_.get(t)??qse;for(const c of s)ey(a,c,n,i)}function Kse(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=zC(i);K8(e,i.draft_??i,s,n),V8(i,a)})}function V8(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)}q8(e)}}function Vse(e,t,n){const{scope_:r}=e;if(Ro(n)){const a=n[wr];k0(a,r)&&a.callbacks_.push(function(){yg(e);const s=zC(a);K8(e,n,s,t)})}else Qa(n)&&e.callbacks_.push(function(){const i=po(e);e.type_===3?i.has(n)&&ny(n,r.handledSet_,r):ZE(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&ny(ZE(e.copy_,t,e.type_),r.handledSet_,r)})}function ny(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ro(e)||t.has(e)||!Qa(e)||M0(e)||(t.add(e),A0(e,(r,a)=>{if(Ro(a)){const i=a[wr];if(k0(i,n)){const s=zC(i);ey(e,r,s,e.type_),q8(i)}}else Qa(a)&&ny(a,t,n)})),e}function Yse(e,t){const n=N0(e),r={type_:n?1:0,scope_:t?t.scope_:F8(),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=ry;n&&(a=[r],i=Vh);const{revoke:s,proxy:c}=Proxy.revocable(a,i);return r.draft_=c,r.revoke_=s,[c,r]}var ry={get(e,t){if(t===wr)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=po(e);if(!sR(a,t,e.type_))return Gse(e,a,t);const i=a[t];if(e.finalized_||!Qa(i)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&$se(t))return i;if(i===lS(e.base_,t)){yg(e);const s=e.type_===1?+t:t,c=a_(e.scope_,i,e,s);return e.copy_[s]=c}return i},has(e,t){return t in po(e)},ownKeys(e){return Reflect.ownKeys(po(e))},set(e,t,n){const r=Y8(po(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=lS(po(e),t),i=a==null?void 0:a[wr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(zse(n,a)&&(n!==void 0||sR(e.base_,t,e.type_)))return!0;yg(e),r_(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),Vse(e,t,n)),!0},deleteProperty(e,t){return yg(e),lS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),r_(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=po(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[gg]:!0,[QE]:e.type_!==1||t!=="length",[Jg]:r[Jg],[qh]:n[t]}},defineProperty(){Fa(11)},getPrototypeOf(e){return Af(e.base_)},setPrototypeOf(){Fa(12)}},Vh={};for(let e in ry){let t=ry[e];Vh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Vh.deleteProperty=function(e,t){return Vh.set.call(this,e,t,void 0)};Vh.set=function(e,t,n){return ry.set.call(this,e[0],t,n,e[0])};function lS(e,t){const n=e[wr];return(n?po(n):e)[t]}function Gse(e,t,n){var a;const r=Y8(t,n);return r?qh in r?r[qh]:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function Y8(e,t){if(!(t in e))return;let n=Af(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Af(n)}}function r_(e){e.modified_||(e.modified_=!0,e.parent_&&r_(e.parent_))}function yg(e){e.copy_||(e.assigned_=new Map,e.copy_=JE(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xse=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(u=s,...m){return c.produce(u,d=>r.call(this,d,...m))}}Qu(r)||Fa(6),a!==void 0&&!Qu(a)&&Fa(7);let i;if(Qa(n)){const s=fR(this),c=a_(s,n,void 0);let f=!0;try{i=r(c),f=!1}finally{f?t_(s):n_(s)}return uR(s,a),dR(i,s)}else if(!n||!LC(n)){if(i=r(n),i===void 0&&(i=n),i===B8&&(i=void 0),this.autoFreeze_&&$C(i,!0),a){const s=[],c=[];Mc(e_).generateReplacementPatches_(n,i,{patches_:s,inversePatches_:c}),a(s,c)}return i}else Fa(1,n)},this.produceWithPatches=(n,r)=>{if(Qu(n))return(c,...f)=>this.produceWithPatches(c,u=>n(u,...f));let a,i;return[this.produce(n,r,(c,f)=>{a=c,i=f}),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){Qa(t)||Fa(8),Ro(t)&&(t=ja(t));const n=fR(this),r=a_(n,t,void 0);return r[wr].isManual_=!0,n_(n),r}finishDraft(t,n){const r=t&&t[wr];(!r||!r.isManual_)&&Fa(9);const{scope_:a}=r;return uR(a,n),dR(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=Mc(e_).applyPatches_;return Ro(t)?a(t,n):this.produce(t,i=>a(i,n))}};function a_(e,t,n,r){const[a,i]=T0(t)?Mc(ty).proxyMap_(t,n):P0(t)?Mc(ty).proxySet_(t,n):Yse(t,n);return((n==null?void 0:n.scope_)??F8()).drafts_.push(a),i.callbacks_=(n==null?void 0:n.callbacks_)??[],i.key_=r,n&&r!==void 0?Kse(n,i,r):i.callbacks_.push(function(f){var m;(m=f.mapSetPlugin_)==null||m.fixSetContents(i);const{patchPlugin_:u}=f;i.modified_&&u&&u.generatePatches_(i,[],f)}),a}function ja(e){return Ro(e)||Fa(10,e),G8(e)}function G8(e){if(!Qa(e)||M0(e))return e;const t=e[wr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=JE(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=JE(e,!0);return A0(n,(a,i)=>{ey(n,a,G8(i))},r),t&&(t.finalized_=!1),n}var Wse=new Xse,X8=Wse.produce;function W8(e){return({dispatch:n,getState:r})=>a=>i=>typeof i=="function"?i(n,r,e):a(i)}var Qse=W8(),Zse=W8,Jse=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Qg:Qg.apply(null,arguments)};function ia(e,t){function n(...r){if(t){let a=t(...r);if(!a)throw new Error(na(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=>$8(r)&&r.type===e,n}var Q8=class Ch extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ch.prototype)}static get[Symbol.species](){return Ch}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ch(...t[0].concat(this)):new Ch(...t.concat(this))}};function mR(e){return Qa(e)?X8(e,()=>{}):e}function Uv(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function ele(e){return typeof e=="boolean"}var tle=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{};let s=new Q8;return n&&(ele(n)?s.push(Qse):s.push(Zse(n.extraArgument))),s},Z8="RTK_autoBatch",zt=()=>e=>({payload:e,meta:{[Z8]:!0}}),pR=e=>t=>{setTimeout(t,e)},J8=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let a=!0,i=!1,s=!1;const c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:pR(10):e.type==="callback"?e.queueNotification:pR(e.timeout),u=()=>{s=!1,i&&(i=!1,c.forEach(m=>m()))};return Object.assign({},r,{subscribe(m){const d=()=>a&&m(),v=r.subscribe(d);return c.add(m),()=>{v(),c.delete(m)}},dispatch(m){var d;try{return a=!((d=m==null?void 0:m.meta)!=null&&d[Z8]),i=!a,i&&(s||(s=!0,f(u))),r.dispatch(m)}finally{a=!0}}})},nle=e=>function(n){const{autoBatch:r=!0}=n??{};let a=new Q8(e);return r&&a.push(J8(typeof r=="object"?r:void 0)),a};function rle(e){const t=tle(),{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(IC(n))c=z8(n);else throw new Error(na(1));let f;typeof r=="function"?f=r(t):f=t();let u=Qg;a&&(u=Jse({trace:!1,...typeof a=="object"&&a}));const m=Ise(...f),d=nle(m);let v=typeof s=="function"?s(d):d();const y=u(...v);return L8(c,i,y)}function e6(e){const t={},n=[];let r;const a={addCase(i,s){const c=typeof i=="string"?i:i.type;if(!c)throw new Error(na(28));if(c in t)throw new Error(na(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 ale(e){return typeof e=="function"}function ile(e,t){let[n,r,a]=e6(t),i;if(ale(e))i=()=>mR(e());else{const c=mR(e);i=()=>c}function s(c=i(),f){let u=[n[f.type],...r.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return u.filter(m=>!!m).length===0&&(u=[a]),u.reduce((m,d)=>{if(d)if(Ro(m)){const y=d(m,f);return y===void 0?m:y}else{if(Qa(m))return X8(m,v=>d(v,f));{const v=d(m,f);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 ole="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",sle=(e=21)=>{let t="",n=e;for(;n--;)t+=ole[Math.random()*64|0];return t},lle=Symbol.for("rtk-slice-createasyncthunk");function cle(e,t){return`${e}/${t}`}function ule({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[lle];return function(a){const{name:i,reducerPath:s=i}=a;if(!i)throw new Error(na(11));const c=(typeof a.reducers=="function"?a.reducers(dle()):a.reducers)||{},f=Object.keys(c),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(A,N){const T=typeof A=="string"?A:A.type;if(!T)throw new Error(na(12));if(T in u.sliceCaseReducersByType)throw new Error(na(13));return u.sliceCaseReducersByType[T]=N,m},addMatcher(A,N){return u.sliceMatchers.push({matcher:A,reducer:N}),m},exposeAction(A,N){return u.actionCreators[A]=N,m},exposeCaseReducer(A,N){return u.sliceCaseReducersByName[A]=N,m}};f.forEach(A=>{const N=c[A],T={reducerName:A,type:cle(i,A),createNotation:typeof a.reducers=="function"};mle(N)?vle(T,N,m,t):hle(T,N,m)});function d(){const[A={},N=[],T=void 0]=typeof a.extraReducers=="function"?e6(a.extraReducers):[a.extraReducers],P={...A,...u.sliceCaseReducersByType};return ile(a.initialState,R=>{for(let D in P)R.addCase(D,P[D]);for(let D of u.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,y=new Map,b=new WeakMap;let w;function S(A,N){return w||(w=d()),w(A,N)}function E(){return w||(w=d()),w.getInitialState()}function O(A,N=!1){function T(R){let D=R[A];return typeof D>"u"&&N&&(D=Uv(b,T,E)),D}function P(R=v){const D=Uv(y,N,()=>new WeakMap);return Uv(D,R,()=>{const K={};for(const[L,I]of Object.entries(a.selectors??{}))K[L]=fle(I,R,()=>Uv(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:u.actionCreators,caseReducers:u.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 mr=ule();function dle(){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 hle({type:e,reducerName:t,createNotation:n},r,a){let i,s;if("reducer"in r){if(n&&!ple(r))throw new Error(na(17));i=r.reducer,s=r.prepare}else i=r;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?ia(e,s):ia(e))}function mle(e){return e._reducerDefinitionType==="asyncThunk"}function ple(e){return e._reducerDefinitionType==="reducerWithPrepare"}function vle({type:e,reducerName:t},n,r,a){if(!a)throw new Error(na(18));const{payloadCreator:i,fulfilled:s,pending:c,rejected:f,settled:u,options:m}=n,d=a(e,i,m);r.exposeAction(t,d),s&&r.addCase(d.fulfilled,s),c&&r.addCase(d.pending,c),f&&r.addCase(d.rejected,f),u&&r.addMatcher(d.settled,u),r.exposeCaseReducer(t,{fulfilled:s||Hv,pending:c||Hv,rejected:f||Hv,settled:u||Hv})}function Hv(){}var gle="task",t6="listener",n6="completed",BC="cancelled",yle=`task-${BC}`,xle=`task-${n6}`,i_=`${t6}-${BC}`,ble=`${t6}-${n6}`,R0=class{constructor(e){Dw(this,"name","TaskAbortError");Dw(this,"message");this.code=e,this.message=`${gle} ${BC} (reason: ${e})`}},UC=(e,t)=>{if(typeof e!="function")throw new TypeError(na(32))},ay=()=>{},r6=(e,t=ay)=>(e.catch(t),e),a6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),vc=e=>{if(e.aborted)throw new R0(e.reason)};function i6(e,t){let n=ay;return new Promise((r,a)=>{const i=()=>a(new R0(e.reason));if(e.aborted){i();return}n=a6(e,i),t.finally(()=>n()).then(r,a)}).finally(()=>{n=ay})}var wle=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()}},iy=e=>t=>r6(i6(e,t).then(n=>(vc(e),n))),o6=e=>{const t=iy(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:af}=Object,vR={},D0="listenerMiddleware",Sle=(e,t)=>{const n=r=>a6(e,()=>r.abort(e.reason));return(r,a)=>{UC(r);const i=new AbortController;n(i);const s=wle(async()=>{vc(e),vc(i.signal);const c=await r({pause:iy(i.signal),delay:o6(i.signal),signal:i.signal});return vc(i.signal),c},()=>i.abort(xle));return a!=null&&a.autoJoin&&t.push(s.catch(ay)),{result:iy(e)(s),cancel(){i.abort(yle)}}}},Ele=(e,t)=>{const n=async(r,a)=>{vc(t);let i=()=>{};const c=[new Promise((f,u)=>{let m=e({predicate:r,effect:(d,v)=>{v.unsubscribe(),f([d,v.getState(),v.getOriginalState()])}});i=()=>{m(),u()}})];a!=null&&c.push(new Promise(f=>setTimeout(f,a,null)));try{const f=await i6(t,Promise.race(c));return vc(t),f}finally{i()}};return(r,a)=>r6(n(r,a))},s6=e=>{let{type:t,actionCreator:n,matcher:r,predicate:a,effect:i}=e;if(t)a=ia(t).match;else if(n)t=n.type,a=n.match;else if(r)a=r;else if(!a)throw new Error(na(21));return UC(i),{predicate:a,type:t,effect:i}},l6=af(e=>{const{type:t,predicate:n,effect:r}=s6(e);return{id:sle(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(na(22))}}},{withTypes:()=>l6}),gR=(e,t)=>{const{type:n,effect:r,predicate:a}=s6(t);return Array.from(e.values()).find(i=>(typeof n=="string"?i.type===n:i.predicate===a)&&i.effect===r)},o_=e=>{e.pending.forEach(t=>{t.abort(i_)})},_le=(e,t)=>()=>{for(const n of t.keys())o_(n);e.clear()},yR=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},c6=af(ia(`${D0}/add`),{withTypes:()=>c6}),jle=ia(`${D0}/removeAll`),u6=af(ia(`${D0}/remove`),{withTypes:()=>u6}),Cle=(...e)=>{console.error(`${D0}/error`,...e)},Dm=(e={})=>{const t=new Map,n=new Map,r=y=>{const b=n.get(y)??0;n.set(y,b+1)},a=y=>{const b=n.get(y)??1;b===1?n.delete(y):n.set(y,b-1)},{extra:i,onError:s=Cle}=e;UC(s);const c=y=>(y.unsubscribe=()=>t.delete(y.id),t.set(y.id,y),b=>{y.unsubscribe(),b!=null&&b.cancelActive&&o_(y)}),f=y=>{const b=gR(t,y)??l6(y);return c(b)};af(f,{withTypes:()=>f});const u=y=>{const b=gR(t,y);return b&&(b.unsubscribe(),y.cancelActive&&o_(b)),!!b};af(u,{withTypes:()=>u});const m=async(y,b,w,S)=>{const E=new AbortController,O=Ele(f,E.signal),j=[];try{y.pending.add(E),r(y),await Promise.resolve(y.effect(b,af({},w,{getOriginalState:S,condition:(A,N)=>O(A,N).then(Boolean),take:O,delay:o6(E.signal),pause:iy(E.signal),extra:i,signal:E.signal,fork:Sle(E.signal,j),unsubscribe:y.unsubscribe,subscribe:()=>{t.set(y.id,y)},cancelActiveListeners:()=>{y.pending.forEach((A,N,T)=>{A!==E&&(A.abort(i_),T.delete(A))})},cancel:()=>{E.abort(i_),y.pending.delete(E)},throwIfCancelled:()=>{vc(E.signal)}})))}catch(A){A instanceof R0||yR(s,A,{raisedBy:"effect"})}finally{await Promise.all(j),E.abort(ble),a(y),y.pending.delete(E)}},d=_le(t,n);return{middleware:y=>b=>w=>{if(!$8(w))return b(w);if(c6.match(w))return f(w.payload);if(jle.match(w)){d();return}if(u6.match(w))return u(w.payload);let S=y.getState();const E=()=>{if(S===vR)throw new Error(na(23));return S};let O;try{if(O=b(w),t.size>0){const j=y.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,yR(s,P,{raisedBy:"predicate"})}T&&m(N,w,y,E)}}}finally{S=vR}return O},startListening:f,stopListening:u,clearListeners:d}};function na(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 Ole={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},f6=mr({name:"chartLayout",initialState:Ole,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:Ale,setLayout:Nle,setChartSize:Tle,setScale:Ple}=f6.actions,Mle=f6.reducer;function d6(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function st(e){return Number.isFinite(e)}function Ii(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}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 Zu(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){kle(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 kle(e,t,n){return(t=Rle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rle(e){var t=Dle(e,"string");return typeof t=="symbol"?t:t+""}function Dle(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 Ot(e,t,n){return Yt(e)||Yt(t)?n:Di(t)?Tc(e,t,n):typeof t=="function"?t(e):n}var Ile=(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},Uo=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",h6=(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},m6=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:a,range:i,scale:s,realScaleType:c,isCategorical:f,categoricalDomain:u,tickCount:m,ticks:d,niceTicks:v,axisType:y}=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=y==="angleAxis"&&i&&i.length>=2?Bn(i[0]-i[1])*2*w:w,d||v){var S=(d||v||[]).map((E,O)=>{var j=r?r.indexOf(E):E,A=s.map(j);return st(A)?{coordinate:A+w,value:E,offset:w,index:O}:null}).filter(Rr);return S}return f&&u?u.map((E,O)=>{var j=s.map(E);return st(j)?{coordinate:j+w,value:E,index:O,offset:w}:null}).filter(Rr):s.ticks&&m!=null?s.ticks(m).map((E,O)=>{var j=s.map(E);return st(j)?{coordinate:j+w,value:E,index:O,offset:w}:null}).filter(Rr):s.domain().map((E,O)=>{var j=s.map(E);return st(j)?{coordinate:j+w,value:r?r[E]:E,index:O,offset:w}:null}).filter(Rr)},Lle=(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},zle=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 f=e[c],u=f==null?void 0:f[a];if(u!=null){var m=u[1],d=u[0],v=Ri(m)?d:m;v>=0?(u[0]=i,i+=v,u[1]=i):(u[0]=s,s+=v,u[1]=s)}}}},$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;s<n;++s){var c=e[s],f=c==null?void 0:c[a];if(f!=null){var u=Ri(f[1])?f[0]:f[1];u>=0?(f[0]=i,i+=u,f[1]=i):(f[0]=0,f[1]=0)}}}},Ble={sign:zle,expand:loe,none:Nc,silhouette:coe,wiggle:uoe,positive:$le},Ule=(e,t,n)=>{var r,a=(r=Ble[n])!==null&&r!==void 0?r:Nc,i=soe().keys(t).value((c,f)=>Number(Ot(c,f,0))).order(XE).offset(a),s=i(e);return s.forEach((c,f)=>{c.forEach((u,m)=>{var d=Ot(e[m],t[f],0);Array.isArray(d)&&d.length===2&&Oe(d[0])&&Oe(d[1])&&(u[0]=d[0],u[1]=d[1])})}),s};function Hle(e){return e==null?void 0:String(e)}function bR(e){var{axis:t,ticks:n,bandSize:r,entry:a,index:i,dataKey:s}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Yt(a[t.dataKey])){var c=g8(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[i]?n[i].coordinate+r/2:null}var f=Ot(a,Yt(s)?t.dataKey:s),u=t.scale.map(f);return Oe(u)?u:null}var wR=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=Ot(i,t.dataKey,t.scale.domain()[s]);if(Yt(c))return null;var f=t.scale.map(c);return Oe(f)?f-a/2+r:null},Fle=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]},qle=e=>{var t=e.flat(2).filter(Oe);return[Math.min(...t),Math.max(...t)]},Kle=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Vle=(e,t,n)=>{if(e!=null)return Kle(Object.keys(e).reduce((r,a)=>{var i=e[a];if(!i)return r;var{stackedData:s}=i,c=s.reduce((f,u)=>{var m=d6(u,t,n),d=qle(m);return!st(d[0])||!st(d[1])?f:[Math.min(f[0],d[0]),Math.max(f[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},SR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ER=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Nf=(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 f=a[s],u=a[s-1];i=Math.min(((f==null?void 0:f.coordinate)||0)-((u==null?void 0:u.coordinate)||0),i)}return i===1/0?0:i}return n?void 0:0};function _R(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 ed(e,t){if(e)return String(e);if(typeof t=="string")return t}var Yle=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Gle=(e,t)=>t==="centric"?e.angle:e.radius,Ho=e=>e.layout.width,Fo=e=>e.layout.height,Xle=e=>e.layout.scale,p6=e=>e.layout.margin,I0=se(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),L0=se(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),v6="data-recharts-item-index",g6="data-recharts-item-id",Im=60;function jR(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 Fv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jR(Object(n),!0).forEach(function(r){Wle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wle(e,t,n){return(t=Qle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qle(e){var t=Zle(e,"string");return typeof t=="symbol"?t:t+""}function Zle(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 Jle=e=>e.brush.height;function ece(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:Im;return n+a}return n},0)}function tce(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:Im;return n+a}return n},0)}function nce(e){var t=I0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function rce(e){var t=I0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Mn=se([Ho,Fo,p6,Jle,ece,tce,nce,rce,D8,Nse],(e,t,n,r,a,i,s,c,f,u)=>{var m={left:(n.left||0)+a,right:(n.right||0)+i},d={top:(n.top||0)+s,bottom:(n.bottom||0)+c},v=Fv(Fv({},d),m),y=v.bottom;v.bottom+=r,v=Ile(v,f,u);var b=e-v.left-v.right,w=t-v.top-v.bottom;return Fv(Fv({brushBottom:y},v),{},{width:Math.max(b,0),height:Math.max(w,0)})}),ace=se(Mn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),HC=se(Ho,Fo,(e,t)=>({x:0,y:0,width:e,height:t})),ice=x.createContext(null),pr=()=>x.useContext(ice)!=null,z0=e=>e.brush,$0=se([z0,Mn,p6],(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={},fS={},CR;function oce(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:a,edges:i}={}){let s,c=null;const f=i!=null&&i.includes("leading"),u=i==null||i.includes("trailing"),m=()=>{c!==null&&(n.apply(s,c),s=void 0,c=null)},d=()=>{u&&m(),w()};let v=null;const y=()=>{v!=null&&clearTimeout(v),v=setTimeout(()=>{v=null,d()},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;y(),f&&j&&m()};return E.schedule=y,E.cancel=w,E.flush=S,a==null||a.addEventListener("abort",w,{once:!0}),E}e.debounce=t})(fS)),fS}var OR;function sce(){return OR||(OR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oce();function n(r,a=0,i={}){typeof i!="object"&&(i={});const{leading:s=!1,trailing:c=!0,maxWait:f}=i,u=Array(2);s&&(u[0]="leading"),c&&(u[1]="trailing");let m,d=null;const v=t.debounce(function(...w){m=r.apply(this,w),d=null},a,{edges:u}),y=function(...w){return f!=null&&(d===null&&(d=Date.now()),Date.now()-d>=f)?(m=r.apply(this,w),d=Date.now(),v.cancel(),v.schedule(),m):(v.apply(this,w),m)},b=()=>(v.flush(),m);return y.cancel=v.cancel,y.flush=b,y}e.debounce=n})(uS)),uS}var AR;function lce(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sce();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 dS,NR;function cce(){return NR||(NR=1,dS=lce().throttle),dS}var uce=cce();const fce=Za(uce);var oy=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++]))}},_i={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},y6=(e,t,n)=>{var{width:r=_i.width,height:a=_i.height,aspect:i,maxHeight:s}=n,c=Pc(r)?e:Number(r),f=Pc(a)?t:Number(a);return i&&i>0&&(c?f=c/i:f&&(c=f*i),s&&f!=null&&f>s&&(f=s)),{calculatedWidth:c,calculatedHeight:f}},dce={width:0,height:0,overflow:"visible"},hce={width:0,overflowX:"visible"},mce={height:0,overflowY:"visible"},pce={},vce=e=>{var{width:t,height:n}=e,r=Pc(t),a=Pc(n);return r&&a?dce:r?hce:a?mce:pce};function gce(e){var{width:t,height:n,aspect:r}=e,a=t,i=n;return a===void 0&&i===void 0?(a=_i.width,i=_i.height):a===void 0?a=r&&r>0?void 0:_i.width:i===void 0&&(i=r&&r>0?void 0:_i.height),{width:a,height:i}}function s_(){return s_=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},s_.apply(null,arguments)}function TR(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 PR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){yce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yce(e,t,n){return(t=xce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xce(e){var t=bce(e,"string");return typeof t=="symbol"?t:t+""}function bce(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 x6=x.createContext(_i.initialDimension);function wce(e){return Ii(e.width)&&Ii(e.height)}function b6(e){var{children:t,width:n,height:r}=e,a=x.useMemo(()=>({width:n,height:r}),[n,r]);return wce(a)?x.createElement(x6.Provider,{value:a},t):null}var FC=()=>x.useContext(x6),Sce=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=_i.initialDimension,width:a,height:i,minWidth:s=_i.minWidth,minHeight:c,maxHeight:f,children:u,debounce:m=_i.debounce,id:d,className:v,onResize:y,style:b={}}=e,w=x.useRef(null),S=x.useRef();S.current=y,x.useImperativeHandle(t,()=>w.current);var[E,O]=x.useState({containerWidth:r.width,containerHeight:r.height}),j=x.useCallback((R,D)=>{O(K=>{var L=Math.round(R),I=Math.round(D);return K.containerWidth===L&&K.containerHeight===I?K:{containerWidth:L,containerHeight:I}})},[]);x.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return bl;var R=I=>{var G,z=I[0];if(z!=null){var{width:V,height:k}=z.contentRect;j(V,k),(G=S.current)===null||G===void 0||G.call(S,V,k)}};m>0&&(R=fce(R,m,{trailing:!0,leading:!1}));var D=new ResizeObserver(R),{width:K,height:L}=w.current.getBoundingClientRect();return j(K,L),D.observe(w.current),()=>{D.disconnect()}},[j,m]);var{containerWidth:A,containerHeight:N}=E;oy(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:T,calculatedHeight:P}=y6(A,N,{width:a,height:i,aspect:n,maxHeight:f});return oy(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:d?"".concat(d):void 0,className:ct("recharts-responsive-container",v),style:PR(PR({},b),{},{width:a,height:i,minWidth:s,minHeight:c,maxHeight:f}),ref:w},x.createElement("div",{style:vce({width:a,height:i})},x.createElement(b6,{width:T,height:P},u)))}),qC=x.forwardRef((e,t)=>{var n=FC();if(Ii(n.width)&&Ii(n.height))return e.children;var{width:r,height:a}=gce({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:s}=y6(void 0,void 0,{width:r,height:a,aspect:e.aspect,maxHeight:e.maxHeight});return Oe(i)&&Oe(s)?x.createElement(b6,{width:i,height:s},e.children):x.createElement(Sce,s_({},e,{width:r,height:a,ref:t}))});function KC(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=pr(),n=Te(ace),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}},Ece={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},w6=()=>{var e;return(e=Te(Mn))!==null&&e!==void 0?e:Ece},VC=()=>Te(Ho),YC=()=>Te(Fo),_ce=()=>Te(e=>e.layout.margin),gt=e=>e.layout.layoutType,Gc=()=>Te(gt),S6=()=>{var e=Gc();if(e==="horizontal"||e==="vertical")return e},E6=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},jce=()=>{var e=Gc();return e!==void 0},Lm=e=>{var t=Nt(),n=pr(),{width:r,height:a}=e,i=FC(),s=r,c=a;return i&&(s=i.width>0?i.width:r,c=i.height>0?i.height:a),x.useEffect(()=>{!n&&Ii(s)&&Ii(c)&&t(Tle({width:s,height:c}))},[t,n,s,c]),null},_6=Symbol.for("immer-nothing"),MR=Symbol.for("immer-draftable"),oa=Symbol.for("immer-state");function qa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Yh=Object.getPrototypeOf;function Tf(e){return!!e&&!!e[oa]}function kc(e){var t;return e?j6(e)||Array.isArray(e)||!!e[MR]||!!((t=e.constructor)!=null&&t[MR])||zm(e)||H0(e):!1}var Cce=Object.prototype.constructor.toString(),kR=new WeakMap;function j6(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=kR.get(n);return r===void 0&&(r=Function.toString.call(n),kR.set(n,r)),r===Cce}function sy(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[oa];return t?t.type_:Array.isArray(e)?1:zm(e)?2:H0(e)?3:0}function l_(e,t){return U0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function C6(e,t,n){const r=U0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Oce(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function zm(e){return e instanceof Map}function H0(e){return e instanceof Set}function Jl(e){return e.copy_||e.base_}function c_(e,t){if(zm(e))return new Map(e);if(H0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=j6(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[oa];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(Yh(e),r)}else{const r=Yh(e);if(r!==null&&n)return{...e};const a=Object.create(r);return Object.assign(a,e)}}function GC(e,t=!1){return F0(e)||Tf(e)||!kc(e)||(U0(e)>1&&Object.defineProperties(e,{set:qv,add:qv,clear:qv,delete:qv}),Object.freeze(e),t&&Object.values(e).forEach(n=>GC(n,!0))),e}function Ace(){qa(2)}var qv={value:Ace};function F0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Nce={};function Rc(e){const t=Nce[e];return t||qa(0,e),t}var Gh;function O6(){return Gh}function Tce(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function RR(e,t){t&&(Rc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function u_(e){f_(e),e.drafts_.forEach(Pce),e.drafts_=null}function f_(e){e===Gh&&(Gh=e.parent_)}function DR(e){return Gh=Tce(Gh,e)}function Pce(e){const t=e[oa];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function IR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[oa].modified_&&(u_(t),qa(4)),kc(e)&&(e=ly(t,e),t.parent_||cy(t,e)),t.patches_&&Rc("Patches").generateReplacementPatches_(n[oa].base_,e,t.patches_,t.inversePatches_)):e=ly(t,n,[]),u_(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_6?e:void 0}function ly(e,t,n){if(F0(t))return t;const r=e.immer_.shouldUseStrictIteration(),a=t[oa];if(!a)return sy(t,(i,s)=>LR(e,a,t,i,s,n),r),t;if(a.scope_!==e)return t;if(!a.modified_)return cy(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),sy(s,(f,u)=>LR(e,a,i,f,u,n,c),r),cy(e,i,!1),n&&e.patches_&&Rc("Patches").generatePatches_(a,n,e.patches_,e.inversePatches_)}return a.copy_}function LR(e,t,n,r,a,i,s){if(a==null||typeof a!="object"&&!s)return;const c=F0(a);if(!(c&&!s)){if(Tf(a)){const f=i&&t&&t.type_!==3&&!l_(t.assigned_,r)?i.concat(r):void 0,u=ly(e,a,f);if(C6(n,r,u),Tf(u))e.canAutoFreeze_=!1;else return}else s&&n.add(a);if(kc(a)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===a&&c)return;ly(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(zm(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&cy(e,a)}}}function cy(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&GC(t,n)}function Mce(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:O6(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,i=XC;n&&(a=[r],i=Xh);const{revoke:s,proxy:c}=Proxy.revocable(a,i);return r.draft_=c,r.revoke_=s,c}var XC={get(e,t){if(t===oa)return e;const n=Jl(e);if(!l_(n,t))return kce(e,n,t);const r=n[t];return e.finalized_||!kc(r)?r:r===hS(e.base_,t)?(mS(e),e.copy_[t]=h_(r,e)):r},has(e,t){return t in Jl(e)},ownKeys(e){return Reflect.ownKeys(Jl(e))},set(e,t,n){const r=A6(Jl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=hS(Jl(e),t),i=a==null?void 0:a[oa];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Oce(n,a)&&(n!==void 0||l_(e.base_,t)))return!0;mS(e),d_(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),d_(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Jl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){qa(11)},getPrototypeOf(e){return Yh(e.base_)},setPrototypeOf(){qa(12)}},Xh={};sy(XC,(e,t)=>{Xh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Xh.deleteProperty=function(e,t){return Xh.set.call(this,e,t,void 0)};Xh.set=function(e,t,n){return XC.set.call(this,e[0],t,n,e[0])};function hS(e,t){const n=e[oa];return(n?Jl(n):e)[t]}function kce(e,t,n){var a;const r=A6(t,n);return r?"value"in r?r.value:(a=r.get)==null?void 0:a.call(e.draft_):void 0}function A6(e,t){if(!(t in e))return;let n=Yh(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Yh(n)}}function d_(e){e.modified_||(e.modified_=!0,e.parent_&&d_(e.parent_))}function mS(e){e.copy_||(e.copy_=c_(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Rce=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(f=i,...u){return s.produce(f,m=>n.call(this,m,...u))}}typeof n!="function"&&qa(6),r!==void 0&&typeof r!="function"&&qa(7);let a;if(kc(t)){const i=DR(this),s=h_(t,void 0);let c=!0;try{a=n(s),c=!1}finally{c?u_(i):f_(i)}return RR(i,r),IR(a,i)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===_6&&(a=void 0),this.autoFreeze_&&GC(a,!0),r){const i=[],s=[];Rc("Patches").generateReplacementPatches_(t,a,i,s),r(i,s)}return a}else qa(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...c)=>this.produceWithPatches(s,f=>t(f,...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){kc(e)||qa(8),Tf(e)&&(e=Dce(e));const t=DR(this),n=h_(e,void 0);return n[oa].isManual_=!0,f_(t),n}finishDraft(e,t){const n=e&&e[oa];(!n||!n.isManual_)&&qa(9);const{scope_:r}=n;return RR(r,t),IR(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=Rc("Patches").applyPatches_;return Tf(e)?r(e,t):this.produce(e,a=>r(a,t))}};function h_(e,t){const n=zm(e)?Rc("MapSet").proxyMap_(e,t):H0(e)?Rc("MapSet").proxySet_(e,t):Mce(e,t);return(t?t.scope_:O6()).drafts_.push(n),n}function Dce(e){return Tf(e)||qa(10,e),N6(e)}function N6(e){if(!kc(e)||F0(e))return e;const t=e[oa];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=c_(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=c_(e,!0);return sy(n,(a,i)=>{C6(n,a,N6(i))},r),t&&(t.finalized_=!1),n}var Ice=new Rce;Ice.produce;var Lce={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},T6=mr({name:"legend",initialState:Lce,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:zt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,a=ja(e).payload.indexOf(n);a>-1&&(e.payload[a]=r)},prepare:zt()},removeLegendPayload:{reducer(e,t){var n=ja(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:zt()}}}),{setLegendSize:zR,setLegendSettings:zce,addLegendPayload:P6,replaceLegendPayload:M6,removeLegendPayload:k6}=T6.actions,$ce=T6.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 $R;function Bce(){if($R)return vS;$R=1;var e=qf();function t(f,u){return f===u&&(f!==0||1/f===1/u)||f!==f&&u!==u}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(f,u,m,d,v){var y=a(null);if(y.current===null){var b={hasValue:!1,value:null};y.current=b}else b=y.current;y=s(function(){function S(N){if(!E){if(E=!0,O=N,N=d(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=d(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(u())},A===null?void 0:function(){return S(A())}]},[u,m,d,v]);var w=r(f,y[0],y[1]);return i(function(){b.hasValue=!0,b.value=w},[w]),c(w),w},vS}var BR;function Uce(){return BR||(BR=1,pS.exports=Bce()),pS.exports}Uce();function Hce(e){e()}function Fce(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Hce(()=>{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 UR={notify(){},get:()=>[]};function qce(e,t){let n,r=UR,a=0,i=!1;function s(w){m();const S=r.subscribe(w);let E=!1;return()=>{E||(E=!0,S(),d())}}function c(){r.notify()}function f(){b.onStateChange&&b.onStateChange()}function u(){return i}function m(){a++,n||(n=e.subscribe(f),r=Fce())}function d(){a--,n&&a===0&&(n(),n=void 0,r.clear(),r=UR)}function v(){i||(i=!0,m())}function y(){i&&(i=!1,d())}const b={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:u,trySubscribe:v,tryUnsubscribe:y,getListeners:()=>r};return b}var Kce=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vce=Kce(),Yce=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Gce=Yce(),Xce=()=>Vce||Gce?x.useLayoutEffect:x.useEffect,Wce=Xce();function HR(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Qce(e,t){if(HR(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])||!HR(e[n[a]],t[n[a]]))return!1;return!0}var gS=Symbol.for("react-redux-context"),yS=typeof globalThis<"u"?globalThis:{};function Zce(){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 Jce=Zce();function eue(e){const{children:t,context:n,serverState:r,store:a}=e,i=x.useMemo(()=>{const f=qce(a);return{store:a,subscription:f,getServerState:r?()=>r:void 0}},[a,r]),s=x.useMemo(()=>a.getState(),[a]);Wce(()=>{const{subscription:f}=i;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),s!==a.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[i,s]);const c=n||Jce;return x.createElement(c.Provider,{value:i},t)}var tue=eue,nue=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function rue(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function td(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(nue.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Qce(e[r],t[r]))return!1}else if(!rue(e[r],t[r]))return!1;return!0}var aue=["contextPayload"];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 FR(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 Pf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FR(Object(n),!0).forEach(function(r){iue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iue(e,t,n){return(t=oue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oue(e){var t=sue(e,"string");return typeof t=="symbol"?t:t+""}function sue(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 lue(e,t){if(e==null)return{};var n,r,a=cue(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 cue(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 uue(e){return e.value}function fue(e){var{contextPayload:t}=e,n=lue(e,aue),r=T8(t,e.payloadUniqBy,uue),a=Pf(Pf({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,a):typeof e.content=="function"?x.createElement(e.content,a):x.createElement($oe,a)}function due(e,t,n,r,a,i){var{layout:s,align:c,verticalAlign:f}=t,u,m;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&s==="vertical"?u={left:((r||0)-i.width)/2}:u=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))&&(f==="middle"?m={top:((a||0)-i.height)/2}:m=f==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Pf(Pf({},u),m)}function hue(e){var t=Nt();return x.useEffect(()=>{t(zce(e))},[t,e]),null}function mue(e){var t=Nt();return x.useEffect(()=>(t(zR(e)),()=>{t(zR({width:0,height:0}))}),[t,e]),null}function pue(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var vue={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function gue(e){var t=bn(e,vue),n=Mse(),r=Pie(),a=_ce(),{width:i,height:s,wrapperStyle:c,portal:f}=t,[u,m]=I8([n]),d=VC(),v=YC();if(d==null||v==null)return null;var y=d-((a==null?void 0:a.left)||0)-((a==null?void 0:a.right)||0),b=pue(t.layout,s,i,y),w=f?c:Pf(Pf({position:"absolute",width:(b==null?void 0:b.width)||i||"auto",height:(b==null?void 0:b.height)||s||"auto"},due(c,t,a,d,v,u)),c),S=f??r;if(S==null||n==null)return null;var E=x.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:m},x.createElement(hue,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&x.createElement(mue,{width:u.width,height:u.height}),x.createElement(fue,m_({},t,b,{margin:a,chartWidth:d,chartHeight:v,contextPayload:n})));return fl.createPortal(E,S)}var R6=x.memo(gue,td);R6.displayName="Legend";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 qR(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 ch(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qR(Object(n),!0).forEach(function(r){yue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yue(e,t,n){return(t=xue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xue(e){var t=bue(e,"string");return typeof t=="symbol"?t:t+""}function bue(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 wue(e){return Array.isArray(e)&&Di(e[0])&&Di(e[1])?e.join(" ~ "):e}var zu={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 Sue(e,t){return t==null?e:C0(e,t)}var Eue=e=>{var{separator:t=zu.separator,contentStyle:n,itemStyle:r,labelStyle:a=zu.labelStyle,payload:i,formatter:s,itemSorter:c,wrapperClassName:f,labelClassName:u,label:m,labelFormatter:d,accessibilityLayer:v=zu.accessibilityLayer}=e,y=()=>{if(i&&i.length){var N={padding:0,margin:0},T=Sue(i,c),P=T.map((R,D)=>{if(R.type==="none")return null;var K=R.formatter||s||wue,{value:L,name:I}=R,G=L,z=I;if(K){var V=K(L,I,R,D,i);if(Array.isArray(V))[G,z]=V;else if(V!=null)G=V;else return null}var k=ch(ch({},zu.itemStyle),{},{color:R.color||zu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:k},Di(z)?x.createElement("span",{className:"recharts-tooltip-item-name"},z):null,Di(z)?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=ch(ch({},zu.contentStyle),n),w=ch({margin:0},a),S=!Yt(m),E=S?m:"",O=ct("recharts-default-tooltip",f),j=ct("recharts-tooltip-label",u);S&&d&&i!==void 0&&i!==null&&(E=d(m,i));var A=v?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",p_({className:O,style:b},A),x.createElement("p",{className:j,style:w},x.isValidElement(E)?E:"".concat(E)),y())},uh="recharts-tooltip-wrapper",_ue={visibility:"hidden"};function jue(e){var{coordinate:t,translateX:n,translateY:r}=e;return ct(uh,{["".concat(uh,"-right")]:Oe(n)&&t&&Oe(t.x)&&n>=t.x,["".concat(uh,"-left")]:Oe(n)&&t&&Oe(t.x)&&n<t.x,["".concat(uh,"-bottom")]:Oe(r)&&t&&Oe(t.y)&&r>=t.y,["".concat(uh,"-top")]:Oe(r)&&t&&Oe(t.y)&&r<t.y})}function KR(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:a,position:i,reverseDirection:s,tooltipDimension:c,viewBox:f,viewBoxDimension:u}=e;if(i&&Oe(i[r]))return i[r];var m=n[r]-c-(a>0?a:0),d=n[r]+a;if(t[r])return s[r]?m:d;var v=f[r];if(v==null)return 0;if(s[r]){var y=m,b=v;return y<b?Math.max(d,v):Math.max(m,v)}if(u==null)return 0;var w=d+c,S=v+u;return w>S?Math.max(m,v):Math.max(d,v)}function Cue(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 Oue(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:a,position:i,reverseDirection:s,tooltipBox:c,useTranslate3d:f,viewBox:u}=e,m,d,v;return c.height>0&&c.width>0&&n?(d=KR({allowEscapeViewBox:t,coordinate:n,key:"x",offset:a,position:i,reverseDirection:s,tooltipDimension:c.width,viewBox:u,viewBoxDimension:u.width}),v=KR({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:i,reverseDirection:s,tooltipDimension:c.height,viewBox:u,viewBoxDimension:u.height}),m=Cue({translateX:d,translateY:v,useTranslate3d:f})):m=_ue,{cssProperties:m,cssClasses:jue({translateX:d,translateY:v,coordinate:n})}}var Aue=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),$m={isSsr:Aue()};function D6(){var[e,t]=x.useState(()=>$m.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 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 $u(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){Nue(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 Nue(e,t,n){return(t=Tue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tue(e){var t=Pue(e,"string");return typeof t=="symbol"?t:t+""}function Pue(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 Mue(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function kue(e){var t,n,r,a,i,s,c=D6(),[f,u]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,E,O,j;u({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]),f.dismissed&&(((r=(a=e.coordinate)===null||a===void 0?void 0:a.x)!==null&&r!==void 0?r:0)!==f.dismissedAtCoordinate.x||((i=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)!==f.dismissedAtCoordinate.y)&&u($u($u({},f),{},{dismissed:!1}));var{cssClasses:m,cssProperties:d}=Oue({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?{}:$u($u({transition:Mue({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},d),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),y=$u($u({},v),{},{visibility:!f.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:y,ref:e.innerRef},e.children)}var Rue=x.memo(kue),I6=()=>{var e;return(e=Te(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};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 YR(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 GR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YR(Object(n),!0).forEach(function(r){Due(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Due(e,t,n){return(t=Iue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iue(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)}var XR={curveBasisClosed:Wie,curveBasisOpen:Qie,curveBasis:Xie,curveBumpX:Die,curveBumpY:Iie,curveLinearClosed:Zie,curveLinear:_0,curveMonotoneX:Jie,curveMonotoneY:eoe,curveNatural:toe,curveStep:noe,curveStepAfter:aoe,curveStepBefore:roe},uy=e=>st(e.x)&&st(e.y),WR=e=>e.base!=null&&uy(e.base)&&uy(e),fh=e=>e.x,dh=e=>e.y,zue=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Mm(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=XR["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return XR[n]||_0},QR={connectNulls:!1,type:"linear"},$ue=e=>{var{type:t=QR.type,points:n=[],baseLine:r,layout:a,connectNulls:i=QR.connectNulls}=e,s=zue(t,a),c=i?n.filter(uy):n;if(Array.isArray(r)){var f,u=n.map((b,w)=>GR(GR({},b),{},{base:r[w]}));a==="vertical"?f=Lv().y(dh).x1(fh).x0(b=>b.base.x):f=Lv().x(fh).y1(dh).y0(b=>b.base.y);var m=f.defined(WR).curve(s),d=i?u.filter(WR):u;return m(d)}var v;a==="vertical"&&Oe(r)?v=Lv().y(dh).x1(fh).x0(r):Oe(r)?v=Lv().x(fh).y1(dh).y0(r):v=a8().x(fh).y(dh);var y=v.defined(uy).curve(s);return y(c)},WC=e=>{var{className:t,points:n,path:r,pathRef:a}=e,i=Gc();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?$ue(s):r;return x.createElement("path",v_({},aa(e),kC(e),{className:ct("recharts-curve",t),d:c===null?void 0:c,ref:a}))},Bue=["x","y","top","left","width","height","className"];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 ZR(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 Uue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZR(Object(n),!0).forEach(function(r){Hue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hue(e,t,n){return(t=Fue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fue(e){var t=que(e,"string");return typeof t=="symbol"?t:t+""}function que(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,t){if(e==null)return{};var n,r,a=Vue(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 Vue(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 Yue=(e,t,n,r,a,i)=>"M".concat(e,",").concat(a,"v").concat(r,"M").concat(i,",").concat(t,"h").concat(n),Gue=e=>{var{x:t=0,y:n=0,top:r=0,left:a=0,width:i=0,height:s=0,className:c}=e,f=Kue(e,Bue),u=Uue({x:t,y:n,top:r,left:a,width:i,height:s},f);return!Oe(t)||!Oe(n)||!Oe(i)||!Oe(s)||!Oe(r)||!Oe(a)?null:x.createElement("path",g_({},br(u),{className:ct("recharts-cross",c),d:Yue(t,n,i,s,r,a)}))};function Xue(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 JR(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?JR(Object(n),!0).forEach(function(r){Wue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wue(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=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 Jue=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),L6=(e,t,n)=>e.map(r=>"".concat(Jue(r)," ").concat(t,"ms ").concat(n)).join(","),efe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(a=>r.includes(a))),Wh=(e,t)=>Object.keys(t).reduce((n,r)=>eD(eD({},n),{},{[r]:e(r,t[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 Nn(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){tfe(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 tfe(e,t,n){return(t=nfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nfe(e){var t=rfe(e,"string");return typeof t=="symbol"?t:t+""}function rfe(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 fy=(e,t,n)=>e+(t-e)*n,y_=e=>{var{from:t,to:n}=e;return t!==n},z6=(e,t,n)=>{var r=Wh((a,i)=>{if(y_(i)){var[s,c]=e(i.from,i.to,i.velocity);return Nn(Nn({},i),{},{from:s,velocity:c})}return i},t);return n<1?Wh((a,i)=>y_(i)&&r[a]!=null?Nn(Nn({},i),{},{velocity:fy(i.velocity,r[a].velocity,n),from:fy(i.from,r[a].from,n)}):i,t):z6(e,r,n-1)};function afe(e,t,n,r,a,i){var s,c=r.reduce((v,y)=>Nn(Nn({},v),{},{[y]:{from:e[y],velocity:0,to:t[y]}}),{}),f=()=>Wh((v,y)=>y.from,c),u=()=>!Object.values(c).filter(y_).length,m=null,d=v=>{s||(s=v);var y=v-s,b=y/n.dt;c=z6(n,c,b),a(Nn(Nn(Nn({},e),t),f())),s=v,u()||(m=i.setTimeout(d))};return()=>(m=i.setTimeout(d),()=>{var v;(v=m)===null||v===void 0||v()})}function ife(e,t,n,r,a,i,s){var c=null,f=a.reduce((d,v)=>{var y=e[v],b=t[v];return y==null||b==null?d:Nn(Nn({},d),{},{[v]:[y,b]})},{}),u,m=d=>{u||(u=d);var v=(d-u)/r,y=Wh((w,S)=>fy(...S,n(v)),f);if(i(Nn(Nn(Nn({},e),t),y)),v<1)c=s.setTimeout(m);else{var b=Wh((w,S)=>fy(...S,n(1)),f);i(Nn(Nn(Nn({},e),t),b))}};return()=>(c=s.setTimeout(m),()=>{var d;(d=c)===null||d===void 0||d()})}const ofe=(e,t,n,r,a,i)=>{var s=efe(e,t);return n==null?()=>(a(Nn(Nn({},e),t)),()=>{}):n.isStepper===!0?afe(e,t,n,s,a,i):ife(e,t,n,r,s,a,i)};var dy=1e-4,$6=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],B6=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),nD=(e,t)=>n=>{var r=$6(e,t);return B6(r,n)},sfe=(e,t)=>n=>{var r=$6(e,t),a=[...r.map((i,s)=>i*s).slice(1),0];return B6(a,n)},lfe=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]]},cfe=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=lfe(n[0]);if(a)return a}}return n.length===4?n:[0,0,1,1]},ufe=(e,t,n,r)=>{var a=nD(e,n),i=nD(t,r),s=sfe(e,n),c=u=>u>1?1:u<0?0:u,f=u=>{for(var m=u>1?1:u,d=m,v=0;v<8;++v){var y=a(d)-m,b=s(d);if(Math.abs(y-m)<dy||b<dy)return i(d);d=c(d-y/b)}return i(d)};return f.isStepper=!1,f},rD=function(){return ufe(...cfe(...arguments))},ffe=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,f)=>{var u=-(s-c)*n,m=f*r,d=f+(u-m)*a/1e3,v=f*a/1e3+s;return Math.abs(v-c)<dy&&Math.abs(d)<dy?[c,0]:[v,d]};return i.isStepper=!0,i.dt=a,i},dfe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return rD(e);case"spring":return ffe();default:if(e.split("(")[0]==="cubic-bezier")return rD(e)}return typeof e=="function"?e:null};function hfe(e){var t,n=()=>null,r=!1,a=null,i=s=>{if(!r){if(Array.isArray(s)){if(!s.length)return;var c=s,[f,...u]=c;if(typeof f=="number"){a=e.setTimeout(i.bind(null,u),f);return}i(f),a=e.setTimeout(i.bind(null,u));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 mfe{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 pfe(){return hfe(new mfe)}var vfe=x.createContext(pfe);function gfe(e,t){var n=x.useContext(vfe);return x.useMemo(()=>t??n(e),[e,t,n])}var yfe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},aD={t:0},xS={t:1};function Bm(e){var t=bn(e,yfe),{isActive:n,canBegin:r,duration:a,easing:i,begin:s,onAnimationEnd:c,onAnimationStart:f,children:u}=t,m=D6(),d=n==="auto"?!$m.isSsr&&!m:n,v=gfe(t.animationId,t.animationManager),[y,b]=x.useState(d?aD:xS),w=x.useRef(null);return x.useEffect(()=>{d||b(xS)},[d]),x.useEffect(()=>{if(!d||!r)return bl;var S=ofe(aD,xS,dfe(i),a,b,v.getTimeoutController()),E=()=>{w.current=S()};return v.start([f,s,E,a,c]),()=>{v.stop(),w.current&&w.current(),c()}},[d,r,a,i,s,f,c,v]),u(y.t)}function Um(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Fh(t)),r=x.useRef(e);return r.current!==e&&(n.current=Fh(t),r.current=e),n.current}var xfe=["radius"],bfe=["radius"],iD,oD,sD,lD,cD,uD,fD,dD,hD,mD;function pD(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 vD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pD(Object(n),!0).forEach(function(r){wfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wfe(e,t,n){return(t=Sfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sfe(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)}function hy(){return hy=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},hy.apply(null,arguments)}function gD(e,t){if(e==null)return{};var n,r,a=_fe(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 _fe(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 pi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var yD=(e,t,n,r,a)=>{var i=Ws(n),s=Ws(r),c=Math.min(Math.abs(i)/2,Math.abs(s)/2),f=s>=0?1:-1,u=i>=0?1:-1,m=s>=0&&i>=0||s<0&&i<0?1:0,d;if(c>0&&Array.isArray(a)){for(var v=[0,0,0,0],y=0,b=4;y<b;y++){var w,S=(w=a[y])!==null&&w!==void 0?w:0;v[y]=S>c?c:S}d=tn(iD||(iD=pi(["M",",",""])),e,t+f*v[0]),v[0]>0&&(d+=tn(oD||(oD=pi(["A ",",",",0,0,",",",",",""])),v[0],v[0],m,e+u*v[0],t)),d+=tn(sD||(sD=pi(["L ",",",""])),e+n-u*v[1],t),v[1]>0&&(d+=tn(lD||(lD=pi(["A ",",",",0,0,",`,
        `,",",""])),v[1],v[1],m,e+n,t+f*v[1])),d+=tn(cD||(cD=pi(["L ",",",""])),e+n,t+r-f*v[2]),v[2]>0&&(d+=tn(uD||(uD=pi(["A ",",",",0,0,",`,
        `,",",""])),v[2],v[2],m,e+n-u*v[2],t+r)),d+=tn(fD||(fD=pi(["L ",",",""])),e+u*v[3],t+r),v[3]>0&&(d+=tn(dD||(dD=pi(["A ",",",",0,0,",`,
        `,",",""])),v[3],v[3],m,e,t+r-f*v[3])),d+="Z"}else if(c>0&&a===+a&&a>0){var E=Math.min(c,a);d=tn(hD||(hD=pi(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+f*E,E,E,m,e+u*E,t,e+n-u*E,t,E,E,m,e+n,t+f*E,e+n,t+r-f*E,E,E,m,e+n-u*E,t+r,e+u*E,t+r,E,E,m,e,t+r-f*E)}else d=tn(mD||(mD=pi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},xD={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},U6=e=>{var t=bn(e,xD),n=x.useRef(null),[r,a]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var F=n.current.getTotalLength();F&&a(F)}catch{}},[]);var{x:i,y:s,width:c,height:f,radius:u,className:m}=t,{animationEasing:d,animationDuration:v,animationBegin:y,isAnimationActive:b,isUpdateAnimationActive:w}=t,S=x.useRef(c),E=x.useRef(f),O=x.useRef(i),j=x.useRef(s),A=x.useMemo(()=>({x:i,y:s,width:c,height:f,radius:u}),[i,s,c,f,u]),N=Um(A,"rectangle-");if(i!==+i||s!==+s||c!==+c||f!==+f||c===0||f===0)return null;var T=ct("recharts-rectangle",m);if(!w){var P=br(t),{radius:R}=P,D=gD(P,xfe);return x.createElement("path",hy({},D,{x:Ws(i),y:Ws(s),width:Ws(c),height:Ws(f),radius:typeof u=="number"?u:void 0,className:T,d:yD(i,s,c,f,u)}))}var K=S.current,L=E.current,I=O.current,G=j.current,z="0px ".concat(r===-1?1:r,"px"),V="".concat(r,"px ").concat(r,"px"),k=L6(["strokeDasharray"],v,typeof d=="string"?d:xD.animationEasing);return x.createElement(Bm,{animationId:N,key:N,canBegin:r>0,duration:v,easing:d,isActive:w,begin:y},F=>{var q=Ht(K,c,F),U=Ht(L,f,F),Y=Ht(I,i,F),B=Ht(G,s,F);n.current&&(S.current=q,E.current=U,O.current=Y,j.current=B);var $;b?F>0?$={transition:k,strokeDasharray:V}:$={strokeDasharray:z}:$={strokeDasharray:V};var X=br(t),{radius:Z}=X,ee=gD(X,bfe);return x.createElement("path",hy({},ee,{radius:typeof u=="number"?u:void 0,className:T,d:yD(Y,B,q,U,u),ref:n,style:vD(vD({},$),t.style)}))})};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 wD(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){jfe(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 jfe(e,t,n){return(t=Cfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cfe(e){var t=Ofe(e,"string");return typeof t=="symbol"?t:t+""}function Ofe(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 my=Math.PI/180,Afe=e=>e*180/Math.PI,vn=(e,t,n,r)=>({x:e+Math.cos(-my*r)*n,y:t+Math.sin(-my*r)*n}),H6=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},Nfe=(e,t)=>{var{x:n,y:r}=e,{x:a,y:i}=t;return Math.sqrt((n-a)**2+(r-i)**2)},Tfe=(e,t)=>{var{x:n,y:r}=e,{cx:a,cy:i}=t,s=Nfe({x:n,y:r},{x:a,y:i});if(s<=0)return{radius:s,angle:0};var c=(n-a)/s,f=Math.acos(c);return r>i&&(f=2*Math.PI-f),{radius:s,angle:Afe(f),angleInRadian:f}},Pfe=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}},Mfe=(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},kfe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:a,angle:i}=Tfe({x:n,y:r},t),{innerRadius:s,outerRadius:c}=t;if(a<s||a>c||a===0)return null;var{startAngle:f,endAngle:u}=Pfe(t),m=i,d;if(f<=u){for(;m>u;)m-=360;for(;m<f;)m+=360;d=m>=f&&m<=u}else{for(;m>f;)m-=360;for(;m<u;)m+=360;d=m>=u&&m<=f}return d?wD(wD({},t),{},{radius:a,angle:Mfe(m,t)}):null};function F6(e){var{cx:t,cy:n,radius:r,startAngle:a,endAngle:i}=e,s=vn(t,n,r,a),c=vn(t,n,r,i);return{points:[s,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}var SD,ED,_D,jD,CD,OD,AD;function x_(){return x_=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},x_.apply(null,arguments)}function rc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Rfe=(e,t)=>{var n=Bn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Kv=e=>{var{cx:t,cy:n,radius:r,angle:a,sign:i,isExternal:s,cornerRadius:c,cornerIsExternal:f}=e,u=c*(s?1:-1)+r,m=Math.asin(c/u)/my,d=f?a:a+i*m,v=vn(t,n,u,d),y=vn(t,n,r,d),b=f?a-i*m:a,w=vn(t,n,u*Math.cos(m*my),b);return{center:v,circleTangency:y,lineTangency:w,theta:m}},q6=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:a,startAngle:i,endAngle:s}=e,c=Rfe(i,s),f=i+c,u=vn(t,n,a,i),m=vn(t,n,a,f),d=tn(SD||(SD=rc(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),u.x,u.y,a,a,+(Math.abs(c)>180),+(i>f),m.x,m.y);if(r>0){var v=vn(t,n,r,i),y=vn(t,n,r,f);d+=tn(ED||(ED=rc(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),y.x,y.y,r,r,+(Math.abs(c)>180),+(i<=f),v.x,v.y)}else d+=tn(_D||(_D=rc(["L ",","," Z"])),t,n);return d},Dfe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:a,cornerRadius:i,forceCornerRadius:s,cornerIsExternal:c,startAngle:f,endAngle:u}=e,m=Bn(u-f),{circleTangency:d,lineTangency:v,theta:y}=Kv({cx:t,cy:n,radius:a,angle:f,sign:m,cornerRadius:i,cornerIsExternal:c}),{circleTangency:b,lineTangency:w,theta:S}=Kv({cx:t,cy:n,radius:a,angle:u,sign:-m,cornerRadius:i,cornerIsExternal:c}),E=c?Math.abs(f-u):Math.abs(f-u)-y-S;if(E<0)return s?tn(jD||(jD=rc(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),v.x,v.y,i,i,i*2,i,i,-i*2):q6({cx:t,cy:n,innerRadius:r,outerRadius:a,startAngle:f,endAngle:u});var O=tn(CD||(CD=rc(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),v.x,v.y,i,i,+(m<0),d.x,d.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}=Kv({cx:t,cy:n,radius:r,angle:f,sign:m,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),{circleTangency:T,lineTangency:P,theta:R}=Kv({cx:t,cy:n,radius:r,angle:u,sign:-m,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),D=c?Math.abs(f-u):Math.abs(f-u)-N-R;if(D<0&&i===0)return"".concat(O,"L").concat(t,",").concat(n,"Z");O+=tn(OD||(OD=rc(["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+=tn(AD||(AD=rc(["L",",","Z"])),t,n);return O},Ife={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},K6=e=>{var t=bn(e,Ife),{cx:n,cy:r,innerRadius:a,outerRadius:i,cornerRadius:s,forceCornerRadius:c,cornerIsExternal:f,startAngle:u,endAngle:m,className:d}=t;if(i<a||u===m)return null;var v=ct("recharts-sector",d),y=i-a,b=dr(s,y,0,!0),w;return b>0&&Math.abs(u-m)<360?w=Dfe({cx:n,cy:r,innerRadius:a,outerRadius:i,cornerRadius:Math.min(b,y/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:u,endAngle:m}):w=q6({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:u,endAngle:m}),x.createElement("path",x_({},br(t),{className:v,d:w}))};function Lfe(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(x8(t)){if(e==="centric"){var{cx:r,cy:a,innerRadius:i,outerRadius:s,angle:c}=t,f=vn(r,a,i,c),u=vn(r,a,s,c);return[{x:f.x,y:f.y},{x:u.x,y:u.y}]}return F6(t)}}var bS={},wS={},SS={},ND;function zfe(){return ND||(ND=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=k8();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(SS)),SS}var TD;function $fe(){return TD||(TD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zfe();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 PD;function Bfe(){return PD||(PD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=R8(),n=$fe();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),f=new Array(c);for(let u=0;u<c;u++)f[u]=a,a+=s;return f}e.range=r})(bS)),bS}var ES,MD;function Ufe(){return MD||(MD=1,ES=Bfe().range),ES}var Hfe=Ufe();const V6=Za(Hfe);var qo=e=>e.chartData,q0=se([qo],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),QC=(e,t,n,r)=>r?q0(e):qo(e),Ffe=(e,t,n)=>n?q0(e):qo(e);function Ai(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(st(t)&&st(n))return!0}return!1}function kD(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function Y6(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,a,i;if(st(n))a=n;else if(typeof n=="function")return;if(st(r))i=r;else if(typeof r=="function")return;var s=[a,i];if(Ai(s))return s}}function qfe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Ai(r))return kD(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"&&SR.test(a)){var f=SR.exec(a);if(f==null||f[1]==null||t==null)s=void 0;else{var u=+f[1];s=t[0]-u}}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"&&ER.test(i)){var m=ER.exec(i);if(m==null||m[1]==null||t==null)c=void 0;else{var d=+m[1];c=t[1]+d}}else c=t==null?void 0:t[1];var v=[s,c];if(Ai(v))return t==null?v:kD(v,t,n)}}}var nd=1e9,Kfe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},JC,Kt=!0,Aa="[DecimalError] ",gc=Aa+"Invalid argument: ",ZC=Aa+"Exponent out of range: ",rd=Math.floor,ec=Math.pow,Vfe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Zr,$n=1e7,$t=7,G6=9007199254740991,py=rd(G6/$t),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)*$t;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 jo(this,new this.constructor(e))};Ae.dividedToIntegerBy=Ae.idiv=function(e){var t=this,n=t.constructor;return Mt(jo(t,new n(e),0,1),n.precision)};Ae.equals=Ae.eq=function(e){return!this.cmp(e)};Ae.exponent=function(){return yn(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(Zr))throw Error(Aa+"NaN");if(n.s<1)throw Error(Aa+(n.s?"NaN":"-Infinity"));return n.eq(Zr)?new r(0):(Kt=!1,t=jo(Qh(n,i),Qh(e,i),i),Kt=!0,Mt(t,a))};Ae.minus=Ae.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Q6(t,e):X6(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(Aa+"NaN");return n.s?(Kt=!1,t=jo(n,e,0,1).times(e),Kt=!0,n.minus(t)):Mt(new r(n),a)};Ae.naturalExponential=Ae.exp=function(){return W6(this)};Ae.naturalLogarithm=Ae.ln=function(){return Qh(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?X6(t,e):Q6(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(gc+e);if(t=yn(a)+1,r=a.d.length-1,n=r*$t+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,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(Aa+"NaN")}for(e=yn(c),Kt=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ji(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=rd((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 f(t)):r=new f(a.toString()),n=f.precision,a=s=n+3;;)if(i=r,r=i.plus(jo(c,i,s+2)).times(.5),ji(i.d).slice(0,s)===(t=ji(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(Mt(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;s+=4}return Kt=!0,Mt(r,n)};Ae.times=Ae.mul=function(e){var t,n,r,a,i,s,c,f,u,m=this,d=m.constructor,v=m.d,y=(e=new d(e)).d;if(!m.s||!e.s)return new d(0);for(e.s*=m.s,n=m.e+e.e,f=v.length,u=y.length,f<u&&(i=v,v=y,y=i,s=f,f=u,u=s),i=[],s=f+u,r=s;r--;)i.push(0);for(r=u;--r>=0;){for(t=0,a=f+r;a>r;)c=i[a]+y[r]*v[a-r-1]+t,i[a--]=c%$n|0,t=c/$n|0;i[a]=(i[a]+t)%$n|0}for(;!i[--s];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,Kt?Mt(e,d.precision):e};Ae.toDecimalPlaces=Ae.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Li(e,0,nd),t===void 0?t=r.rounding:Li(t,0,8),Mt(n,e+yn(n)+1,t))};Ae.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Dc(r,!0):(Li(e,0,nd),t===void 0?t=a.rounding:Li(t,0,8),r=Mt(new a(r),e+1,t),n=Dc(r,!0,e+1)),n};Ae.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Dc(a):(Li(e,0,nd),t===void 0?t=i.rounding:Li(t,0,8),r=Mt(new i(a),e+yn(a)+1,t),n=Dc(r.abs(),!1,e+yn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ae.toInteger=Ae.toint=function(){var e=this,t=e.constructor;return Mt(new t(e),yn(e)+1,t.rounding)};Ae.toNumber=function(){return+this};Ae.toPower=Ae.pow=function(e){var t,n,r,a,i,s,c=this,f=c.constructor,u=12,m=+(e=new f(e));if(!e.s)return new f(Zr);if(c=new f(c),!c.s){if(e.s<1)throw Error(Aa+"Infinity");return c}if(c.eq(Zr))return c;if(r=f.precision,e.eq(Zr))return Mt(c,r);if(t=e.e,n=e.d.length-1,s=t>=n,i=c.s,s){if((n=m<0?-m:m)<=G6){for(a=new f(Zr),t=Math.ceil(r/$t+4),Kt=!1;n%2&&(a=a.times(c),DD(a.d,t)),n=rd(n/2),n!==0;)c=c.times(c),DD(c.d,t);return Kt=!0,e.s<0?new f(Zr).div(a):Mt(a,r)}}else if(i<0)throw Error(Aa+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Kt=!1,a=e.times(Qh(c,r+u)),Kt=!0,a=W6(a),a.s=i,a};Ae.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=yn(a),r=Dc(a,n<=i.toExpNeg||n>=i.toExpPos)):(Li(e,1,nd),t===void 0?t=i.rounding:Li(t,0,8),a=Mt(new i(a),e,t),n=yn(a),r=Dc(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):(Li(e,1,nd),t===void 0?t=r.rounding:Li(t,0,8)),Mt(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=yn(e),n=e.constructor;return Dc(e,t<=n.toExpNeg||t>=n.toExpPos)};function X6(e,t){var n,r,a,i,s,c,f,u,m=e.constructor,d=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Kt?Mt(t,d):t;if(f=e.d,u=t.d,s=e.e,a=t.e,f=f.slice(),i=s-a,i){for(i<0?(r=f,i=-i,c=u.length):(r=u,a=s,c=f.length),s=Math.ceil(d/$t),c=s>c?s+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=f.length,i=u.length,c-i<0&&(i=c,r=u,u=f,f=r),n=0;i;)n=(f[--i]=f[i]+u[i]+n)/$n|0,f[i]%=$n;for(n&&(f.unshift(n),++a),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=a,Kt?Mt(t,d):t}function Li(e,t,n){if(e!==~~e||e<t||e>n)throw Error(gc+e)}function ji(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=$t-r.length,n&&(i+=Ds(n)),i+=r;s=e[t],r=s+"",n=$t-r.length,n&&(i+=Ds(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}var jo=(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%$n|0,s=i/$n|0;return s&&r.unshift(s),r}function t(r,a,i,s){var c,f;if(i!=s)f=i>s?1:-1;else for(c=f=0;c<i;c++)if(r[c]!=a[c]){f=r[c]>a[c]?1:-1;break}return f}function n(r,a,i){for(var s=0;i--;)r[i]-=s,s=r[i]<a[i]?1:0,r[i]=s*$n+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,s){var c,f,u,m,d,v,y,b,w,S,E,O,j,A,N,T,P,R,D=r.constructor,K=r.s==a.s?1:-1,L=r.d,I=a.d;if(!r.s)return new D(r);if(!a.s)throw Error(Aa+"Division by zero");for(f=r.e-a.e,P=I.length,N=L.length,y=new D(K),b=y.d=[],u=0;I[u]==(L[u]||0);)++u;if(I[u]>(L[u]||0)&&--f,i==null?O=i=D.precision:s?O=i+(yn(r)-yn(a))+1:O=i,O<0)return new D(0);if(O=O/$t+2|0,u=0,P==1)for(m=0,I=I[0],O++;(u<N||m)&&O--;u++)j=m*$n+(L[u]||0),b[u]=j/I|0,m=j%I|0;else{for(m=$n/(I[0]+1)|0,m>1&&(I=e(I,m),L=e(L,m),P=I.length,N=L.length),A=P,w=L.slice(0,P),S=w.length;S<P;)w[S++]=0;R=I.slice(),R.unshift(0),T=I[0],I[1]>=$n/2&&++T;do m=0,c=t(I,w,P,S),c<0?(E=w[0],P!=S&&(E=E*$n+(w[1]||0)),m=E/T|0,m>1?(m>=$n&&(m=$n-1),d=e(I,m),v=d.length,S=w.length,c=t(d,w,v,S),c==1&&(m--,n(d,P<v?R:I,v))):(m==0&&(c=m=1),d=I.slice()),v=d.length,v<S&&d.unshift(0),n(w,d,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[u++]=m,c&&w[0]?w[S++]=L[A]||0:(w=[L[A]],S=1);while((A++<N||w[0]!==void 0)&&O--)}return b[0]||b.shift(),y.e=f,Mt(y,s?i+yn(y)+1:i)}})();function W6(e,t){var n,r,a,i,s,c,f=0,u=0,m=e.constructor,d=m.precision;if(yn(e)>16)throw Error(ZC+yn(e));if(!e.s)return new m(Zr);for(Kt=!1,c=d,s=new m(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(ec(2,u))/Math.LN10*2+5|0,c+=r,n=a=i=new m(Zr),m.precision=c;;){if(a=Mt(a.times(e),c),n=n.times(++f),s=i.plus(jo(a,n,c)),ji(s.d).slice(0,c)===ji(i.d).slice(0,c)){for(;u--;)i=Mt(i.times(i),c);return m.precision=d,t==null?(Kt=!0,Mt(i,d)):i}i=s}}function yn(e){for(var t=e.e*$t,n=e.d[0];n>=10;n/=10)t++;return t}function _S(e,t,n){if(t>e.LN10.sd())throw Kt=!0,n&&(e.precision=n),Error(Aa+"LN10 precision limit exceeded");return Mt(new e(e.LN10),t)}function Ds(e){for(var t="";e--;)t+="0";return t}function Qh(e,t){var n,r,a,i,s,c,f,u,m,d=1,v=10,y=e,b=y.d,w=y.constructor,S=w.precision;if(y.s<1)throw Error(Aa+(y.s?"NaN":"-Infinity"));if(y.eq(Zr))return new w(0);if(t==null?(Kt=!1,u=S):u=t,y.eq(10))return t==null&&(Kt=!0),_S(w,u);if(u+=v,w.precision=u,n=ji(b),r=n.charAt(0),i=yn(y),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=ji(y.d),r=n.charAt(0),d++;i=yn(y),r>1?(y=new w("0."+n),i++):y=new w(r+"."+n.slice(1))}else return f=_S(w,u+2,S).times(i+""),y=Qh(new w(r+"."+n.slice(1)),u-v).plus(f),w.precision=S,t==null?(Kt=!0,Mt(y,S)):y;for(c=s=y=jo(y.minus(Zr),y.plus(Zr),u),m=Mt(y.times(y),u),a=3;;){if(s=Mt(s.times(m),u),f=c.plus(jo(s,new w(a),u)),ji(f.d).slice(0,u)===ji(c.d).slice(0,u))return c=c.times(2),i!==0&&(c=c.plus(_S(w,u+2,S).times(i+""))),c=jo(c,new w(d),u),w.precision=S,t==null?(Kt=!0,Mt(c,S)):c;c=f,a+=2}}function RD(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=rd(n/$t),e.d=[],r=(n+1)%$t,n<0&&(r+=$t),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=$t;r<a;)e.d.push(+t.slice(r,r+=$t));t=t.slice(r),r=$t-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),Kt&&(e.e>py||e.e<-py))throw Error(ZC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Mt(e,t,n){var r,a,i,s,c,f,u,m,d=e.d;for(s=1,i=d[0];i>=10;i/=10)s++;if(r=t-s,r<0)r+=$t,a=t,u=d[m=0];else{if(m=Math.ceil((r+1)/$t),i=d.length,m>=i)return e;for(u=i=d[m],s=1;i>=10;i/=10)s++;r%=$t,a=r-$t+s}if(n!==void 0&&(i=ec(10,s-a-1),c=u/i%10|0,f=t<0||d[m+1]!==void 0||u%i,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?a>0?u/ec(10,s-a):0:d[m-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return f?(i=yn(e),d.length=1,t=t-i-1,d[0]=ec(10,($t-t%$t)%$t),e.e=rd(-t/$t)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=m,i=1,m--):(d.length=m+1,i=ec(10,$t-r),d[m]=a>0?(u/ec(10,s-a)%ec(10,a)|0)*i:0),f)for(;;)if(m==0){(d[0]+=i)==$n&&(d[0]=1,++e.e);break}else{if(d[m]+=i,d[m]!=$n)break;d[m--]=0,i=1}for(r=d.length;d[--r]===0;)d.pop();if(Kt&&(e.e>py||e.e<-py))throw Error(ZC+yn(e));return e}function Q6(e,t){var n,r,a,i,s,c,f,u,m,d,v=e.constructor,y=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),Kt?Mt(t,y):t;if(f=e.d,d=t.d,r=t.e,u=e.e,f=f.slice(),s=u-r,s){for(m=s<0,m?(n=f,s=-s,c=d.length):(n=d,r=u,c=f.length),a=Math.max(Math.ceil(y/$t),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=f.length,c=d.length,m=a<c,m&&(c=a),a=0;a<c;a++)if(f[a]!=d[a]){m=f[a]<d[a];break}s=0}for(m&&(n=f,f=d,d=n,t.s=-t.s),c=f.length,a=d.length-c;a>0;--a)f[c++]=0;for(a=d.length;a>s;){if(f[--a]<d[a]){for(i=a;i&&f[--i]===0;)f[i]=$n-1;--f[i],f[a]+=$n}f[a]-=d[a]}for(;f[--c]===0;)f.pop();for(;f[0]===0;f.shift())--r;return f[0]?(t.d=f,t.e=r,Kt?Mt(t,y):t):new v(0)}function Dc(e,t,n){var r,a=yn(e),i=ji(e.d),s=i.length;return t?(n&&(r=n-s)>0?i=i.charAt(0)+"."+i.slice(1)+Ds(r):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ds(-a-1)+i,n&&(r=n-s)>0&&(i+=Ds(r))):a>=s?(i+=Ds(a+1-s),n&&(r=n-a-1)>0&&(i=i+"."+Ds(r))):((r=a+1)<s&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-s)>0&&(a+1===s&&(i+="."),i+=Ds(r))),e.s<0?"-"+i:i}function DD(e,t){if(e.length>t)return e.length=t,!0}function Z6(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(gc+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 RD(s,i.toString())}else if(typeof i!="string")throw Error(gc+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,Vfe.test(i))RD(s,i);else throw Error(gc+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=Z6,a.config=a.set=Yfe,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 Yfe(e){if(!e||typeof e!="object")throw Error(Aa+"Object expected");var t,n,r,a=["precision",1,nd,"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(rd(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(gc+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(gc+n+": "+r);return this}var JC=Z6(Kfe);Zr=new JC(1);const ot=JC;function J6(e){var t;return e===0?t=1:t=Math.floor(new ot(e).abs().log(10).toNumber())+1,t}function eU(e,t,n){for(var r=new ot(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var tU=e=>{var[t,n]=e,[r,a]=[t,n];return t>n&&([r,a]=[n,t]),[r,a]},eO=(e,t,n)=>{if(e.lte(0))return new ot(0);var r=J6(e.toNumber()),a=new ot(10).pow(r),i=e.div(a),s=r!==1?.05:.1,c=new ot(Math.ceil(i.div(s).toNumber())).add(n).mul(s),f=c.mul(a);return t?new ot(f.toNumber()):new ot(Math.ceil(f.toNumber()))},nU=(e,t,n)=>{var r;if(e.lte(0))return new ot(0);var a=[1,2,2.5,5],i=e.toNumber(),s=Math.floor(new ot(i).abs().log(10).toNumber()),c=new ot(10).pow(s),f=e.div(c).toNumber(),u=a.findIndex(y=>y>=f-1e-10);if(u===-1&&(c=c.mul(10),u=0),u+=n,u>=a.length){var m=Math.floor(u/a.length);u%=a.length,c=c.mul(new ot(10).pow(m))}var d=(r=a[u])!==null&&r!==void 0?r:1,v=new ot(d).mul(c);return t?v:new ot(Math.ceil(v.toNumber()))},Gfe=(e,t,n)=>{var r=new ot(1),a=new ot(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new ot(10).pow(J6(e)-1),a=new ot(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new ot(Math.floor(e)))}else e===0?a=new ot(Math.floor((t-1)/2)):n||(a=new ot(Math.floor(e)));for(var s=Math.floor((t-1)/2),c=[],f=0;f<t;f++)c.push(a.add(new ot(f-s).mul(r)).toNumber());return c},rU=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]:eO;if(!Number.isFinite((n-t)/(r-1)))return{step:new ot(0),tickMin:new ot(0),tickMax:new ot(0)};var c=s(new ot(n).sub(t).div(r-1),a,i),f;t<=0&&n>=0?f=new ot(0):(f=new ot(t).add(n).div(2),f=f.sub(new ot(f).mod(c)));var u=Math.ceil(f.sub(t).div(c).toNumber()),m=Math.ceil(new ot(n).sub(f).div(c).toNumber()),d=u+m+1;return d>r?rU(t,n,r,a,i+1,s):(d<r&&(m=n>0?m+(r-d):m,u=n>0?u:u+(r-d)),{step:c,tickMin:f.sub(new ot(u).mul(c)),tickMax:f.add(new ot(m).mul(c))})},ID=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),[f,u]=tU([n,r]);if(f===-1/0||u===1/0){var m=u===1/0?[f,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),u];return n>r?m.reverse():m}if(f===u)return Gfe(f,a,i);var d=s==="snap125"?nU:eO,{step:v,tickMin:y,tickMax:b}=rU(f,u,c,i,0,d),w=eU(y,b.add(new ot(.1).mul(v)),v);return n>r?w.reverse():w},LD=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,f]=tU([r,a]);if(c===-1/0||f===1/0)return[r,a];if(c===f)return[c];var u=s==="snap125"?nU:eO,m=Math.max(n,2),d=u(new ot(f).sub(c).div(m-1),i,0),v=[...eU(new ot(c),new ot(f),d),f];return i===!1&&(v=v.map(y=>Math.round(y))),r>a?v.reverse():v},aU=e=>e.rootProps.maxBarSize,Xfe=e=>e.rootProps.barGap,iU=e=>e.rootProps.barCategoryGap,Wfe=e=>e.rootProps.barSize,Hm=e=>e.rootProps.stackOffset,oU=e=>e.rootProps.reverseStackOrder,tO=e=>e.options.chartName,nO=e=>e.rootProps.syncId,sU=e=>e.rootProps.syncMethod,rO=e=>e.options.eventEmitter,gn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Yl={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},vi={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 Uo(e,t)?"category":"number"}function zD(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 vy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zD(Object(n),!0).forEach(function(r){Qfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qfe(e,t,n){return(t=Zfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zfe(e){var t=Jfe(e,"string");return typeof t=="symbol"?t:t+""}function Jfe(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 $D={allowDataOverflow:Yl.allowDataOverflow,allowDecimals:Yl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Yl.angleAxisId,includeHidden:!1,name:void 0,reversed:Yl.reversed,scale:Yl.scale,tick:Yl.tick,tickCount:void 0,ticks:void 0,type:Yl.type,unit:void 0,niceTicks:"auto"},BD={allowDataOverflow:vi.allowDataOverflow,allowDecimals:vi.allowDecimals,allowDuplicatedCategory:vi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:vi.radiusAxisId,includeHidden:vi.includeHidden,name:void 0,reversed:vi.reversed,scale:vi.scale,tick:vi.tick,tickCount:vi.tickCount,ticks:void 0,type:vi.type,unit:void 0,niceTicks:"auto"},ede=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},aO=se([ede,E6],(e,t)=>{var n;if(e!=null)return e;var r=(n=V0(t,"angleAxis",$D.type))!==null&&n!==void 0?n:"category";return vy(vy({},$D),{},{type:r})}),tde=(e,t)=>e.polarAxis.radiusAxis[t],iO=se([tde,E6],(e,t)=>{var n;if(e!=null)return e;var r=(n=V0(t,"radiusAxis",BD.type))!==null&&n!==void 0?n:"category";return vy(vy({},BD),{},{type:r})}),Y0=e=>e.polarOptions,oO=se([Ho,Fo,Mn],H6),lU=se([Y0,oO],(e,t)=>{if(e!=null)return dr(e.innerRadius,t,0)}),cU=se([Y0,oO],(e,t)=>{if(e!=null)return dr(e.outerRadius,t,t*.8)}),nde=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},uU=se([Y0],nde);se([aO,uU],K0);var fU=se([oO,lU,cU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});se([iO,fU],K0);var dU=se([gt,Y0,lU,cU,Ho,Fo],(e,t,n,r,a,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:s,cy:c,startAngle:f,endAngle:u}=t;return{cx:dr(s,a,a/2),cy:dr(c,i,i/2),innerRadius:n,outerRadius:r,startAngle:f,endAngle:u,clockWise:!1}}}),Wt=(e,t)=>t,Fm=(e,t,n)=>n;function sO(e){return e==null?void 0:e.id}function hU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:a,dataKey:i}=n,s=new Map;return e.forEach(c=>{var f,u=(f=c.data)!==null&&f!==void 0?f:r;if(!(u==null||u.length===0)){var m=sO(c);u.forEach((d,v)=>{var y=i==null||a?v:String(Ot(d,i,null)),b=Ot(d,c.dataKey,0),w;s.has(y)?w=s.get(y):w={},Object.assign(w,{[m]:b}),s.set(y,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 rde(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 Fn=e=>{var t=gt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},ad=e=>e.tooltip.settings.axisId;function lO(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 f=e.bandwidth();switch(s.position){case"middle":c+=f/2;break;case"end":c+=f;break}}return c}}}}}var mU=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ai(t)){for(var n,r,a=0;a<t.length;a++){var i=t[a];st(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 Zs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ade(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function cO(e){let t,n,r;e.length!==2?(t=Zs,n=(c,f)=>Zs(e(c),f),r=(c,f)=>e(c)-f):(t=e===Zs||e===ade?e:ide,n=e,r=e);function a(c,f,u=0,m=c.length){if(u<m){if(t(f,f)!==0)return m;do{const d=u+m>>>1;n(c[d],f)<0?u=d+1:m=d}while(u<m)}return u}function i(c,f,u=0,m=c.length){if(u<m){if(t(f,f)!==0)return m;do{const d=u+m>>>1;n(c[d],f)<=0?u=d+1:m=d}while(u<m)}return u}function s(c,f,u=0,m=c.length){const d=a(c,f,u,m-1);return d>u&&r(c[d-1],f)>-r(c[d],f)?d-1:d}return{left:a,center:s,right:i}}function ide(){return 0}function pU(e){return e===null?NaN:+e}function*ode(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const sde=cO(Zs),qm=sde.right;cO(pU).center;class UD extends Map{constructor(t,n=ude){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(HD(this,t))}has(t){return super.has(HD(this,t))}set(t,n){return super.set(lde(this,t),n)}delete(t){return super.delete(cde(this,t))}}function HD({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function lde({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function cde({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ude(e){return e!==null&&typeof e=="object"?e.valueOf():e}function fde(e=Zs){if(e===Zs)return vU;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 vU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const dde=Math.sqrt(50),hde=Math.sqrt(10),mde=Math.sqrt(2);function gy(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>=dde?10:i>=hde?5:i>=mde?2:1;let c,f,u;return a<0?(u=Math.pow(10,-a)/s,c=Math.round(e*u),f=Math.round(t*u),c/u<e&&++c,f/u>t&&--f,u=-u):(u=Math.pow(10,a)*s,c=Math.round(e/u),f=Math.round(t/u),c*u<e&&++c,f*u>t&&--f),f<c&&.5<=n&&n<2?gy(e,t,n*2):[c,f,u]}function b_(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?gy(t,e,n):gy(e,t,n);if(!(i>=a))return[];const c=i-a+1,f=new Array(c);if(r)if(s<0)for(let u=0;u<c;++u)f[u]=(i-u)/-s;else for(let u=0;u<c;++u)f[u]=(i-u)*s;else if(s<0)for(let u=0;u<c;++u)f[u]=(a+u)/-s;else for(let u=0;u<c;++u)f[u]=(a+u)*s;return f}function w_(e,t,n){return t=+t,e=+e,n=+n,gy(e,t,n)[2]}function S_(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?w_(t,e,n):w_(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function FD(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function qD(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function gU(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?vU:fde(a);r>n;){if(r-n>600){const f=r-n+1,u=t-n+1,m=Math.log(f),d=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*d*(f-d)/f)*(u-f/2<0?-1:1),y=Math.max(n,Math.floor(t-u*d/f+v)),b=Math.min(r,Math.floor(t+(f-u)*d/f+v));gU(e,t,y,b,a)}const i=e[t];let s=n,c=r;for(hh(e,n,t),a(e[r],i)>0&&hh(e,n,r);s<c;){for(hh(e,s,c),++s,--c;a(e[s],i)<0;)++s;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?hh(e,n,c):(++c,hh(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function hh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function pde(e,t,n){if(e=Float64Array.from(ode(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return qD(e);if(t>=1)return FD(e);var r,a=(r-1)*t,i=Math.floor(a),s=FD(gU(e,i).subarray(0,i+1)),c=qD(e.subarray(i+1));return s+(c-s)*(a-i)}}function vde(e,t,n=pU){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 gde(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 Pa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ko(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 E_=Symbol("implicit");function uO(){var e=new UD,t=[],n=[],r=E_;function a(i){let s=e.get(i);if(s===void 0){if(r!==E_)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 UD;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 uO(t,n).unknown(r)},Pa.apply(a,arguments),a}function fO(){var e=uO().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,s,c=!1,f=0,u=0,m=.5;delete e.unknown;function d(){var v=t().length,y=a<r,b=y?a:r,w=y?r:a;i=(w-b)/Math.max(1,v-f+u*2),c&&(i=Math.floor(i)),b+=(w-b-i*(v-f))*m,s=i*(1-f),c&&(b=Math.round(b),s=Math.round(s));var S=gde(v).map(function(E){return b+i*E});return n(y?S.reverse():S)}return e.domain=function(v){return arguments.length?(t(v),d()):t()},e.range=function(v){return arguments.length?([r,a]=v,r=+r,a=+a,d()):[r,a]},e.rangeRound=function(v){return[r,a]=v,r=+r,a=+a,c=!0,d()},e.bandwidth=function(){return s},e.step=function(){return i},e.round=function(v){return arguments.length?(c=!!v,d()):c},e.padding=function(v){return arguments.length?(f=Math.min(1,u=+v),d()):f},e.paddingInner=function(v){return arguments.length?(f=Math.min(1,v),d()):f},e.paddingOuter=function(v){return arguments.length?(u=+v,d()):u},e.align=function(v){return arguments.length?(m=Math.max(0,Math.min(1,v)),d()):m},e.copy=function(){return fO(t(),[r,a]).round(c).paddingInner(f).paddingOuter(u).align(m)},Pa.apply(d(),arguments)}function yU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return yU(t())},e}function yde(){return yU(fO.apply(null,arguments).paddingInner(1))}function dO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Km(){}var Zh=.7,yy=1/Zh,of="\\s*([+-]?\\d+)\\s*",Jh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ni="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xde=/^#([0-9a-f]{3,8})$/,bde=new RegExp(`^rgb\\(${of},${of},${of}\\)$`),wde=new RegExp(`^rgb\\(${Ni},${Ni},${Ni}\\)$`),Sde=new RegExp(`^rgba\\(${of},${of},${of},${Jh}\\)$`),Ede=new RegExp(`^rgba\\(${Ni},${Ni},${Ni},${Jh}\\)$`),_de=new RegExp(`^hsl\\(${Jh},${Ni},${Ni}\\)$`),jde=new RegExp(`^hsla\\(${Jh},${Ni},${Ni},${Jh}\\)$`),KD={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};dO(Km,Ic,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:VD,formatHex:VD,formatHex8:Cde,formatHsl:Ode,formatRgb:YD,toString:YD});function VD(){return this.rgb().formatHex()}function Cde(){return this.rgb().formatHex8()}function Ode(){return bU(this).formatHsl()}function YD(){return this.rgb().formatRgb()}function Ic(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xde.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?GD(t):n===3?new Dr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Vv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Vv(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=bde.exec(e))?new Dr(t[1],t[2],t[3],1):(t=wde.exec(e))?new Dr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Sde.exec(e))?Vv(t[1],t[2],t[3],t[4]):(t=Ede.exec(e))?Vv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_de.exec(e))?QD(t[1],t[2]/100,t[3]/100,1):(t=jde.exec(e))?QD(t[1],t[2]/100,t[3]/100,t[4]):KD.hasOwnProperty(e)?GD(KD[e]):e==="transparent"?new Dr(NaN,NaN,NaN,0):null}function GD(e){return new Dr(e>>16&255,e>>8&255,e&255,1)}function Vv(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dr(e,t,n,r)}function Ade(e){return e instanceof Km||(e=Ic(e)),e?(e=e.rgb(),new Dr(e.r,e.g,e.b,e.opacity)):new Dr}function __(e,t,n,r){return arguments.length===1?Ade(e):new Dr(e,t,n,r??1)}function Dr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}dO(Dr,__,xU(Km,{brighter(e){return e=e==null?yy:Math.pow(yy,e),new Dr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zh:Math.pow(Zh,e),new Dr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dr(yc(this.r),yc(this.g),yc(this.b),xy(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:XD,formatHex:XD,formatHex8:Nde,formatRgb:WD,toString:WD}));function XD(){return`#${ac(this.r)}${ac(this.g)}${ac(this.b)}`}function Nde(){return`#${ac(this.r)}${ac(this.g)}${ac(this.b)}${ac((isNaN(this.opacity)?1:this.opacity)*255)}`}function WD(){const e=xy(this.opacity);return`${e===1?"rgb(":"rgba("}${yc(this.r)}, ${yc(this.g)}, ${yc(this.b)}${e===1?")":`, ${e})`}`}function xy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ac(e){return e=yc(e),(e<16?"0":"")+e.toString(16)}function QD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ka(e,t,n,r)}function bU(e){if(e instanceof Ka)return new Ka(e.h,e.s,e.l,e.opacity);if(e instanceof Km||(e=Ic(e)),!e)return new Ka;if(e instanceof Ka)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,f=(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/=f<.5?i+a:2-i-a,s*=60):c=f>0&&f<1?0:s,new Ka(s,c,f,e.opacity)}function Tde(e,t,n,r){return arguments.length===1?bU(e):new Ka(e,t,n,r??1)}function Ka(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}dO(Ka,Tde,xU(Km,{brighter(e){return e=e==null?yy:Math.pow(yy,e),new Ka(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zh:Math.pow(Zh,e),new Ka(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 Dr(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 Ka(ZD(this.h),Yv(this.s),Yv(this.l),xy(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=xy(this.opacity);return`${e===1?"hsl(":"hsla("}${ZD(this.h)}, ${Yv(this.s)*100}%, ${Yv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZD(e){return e=(e||0)%360,e<0?e+360:e}function Yv(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 hO=e=>()=>e;function Pde(e,t){return function(n){return e+n*t}}function Mde(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 kde(e){return(e=+e)==1?wU:function(t,n){return n-t?Mde(t,n,e):hO(isNaN(t)?n:t)}}function wU(e,t){var n=t-e;return n?Pde(e,n):hO(isNaN(e)?t:e)}const by=(function e(t){var n=kde(t);function r(a,i){var s=n((a=__(a)).r,(i=__(i)).r),c=n(a.g,i.g),f=n(a.b,i.b),u=wU(a.opacity,i.opacity);return function(m){return a.r=s(m),a.g=c(m),a.b=f(m),a.opacity=u(m),a+""}}return r.gamma=e,r})(1);function Rde(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 Dde(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ide(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]=Co(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 Lde(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ha(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function zde(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]=Co(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var j_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,CS=new RegExp(j_.source,"g");function $de(e){return function(){return e}}function Bde(e){return function(t){return e(t)+""}}function SU(e,t){var n=j_.lastIndex=CS.lastIndex=0,r,a,i,s=-1,c=[],f=[];for(e=e+"",t=t+"";(r=j_.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,f.push({i:s,x:Ha(r,a)})),n=CS.lastIndex;return n<t.length&&(i=t.slice(n),c[s]?c[s]+=i:c[++s]=i),c.length<2?f[0]?Bde(f[0].x):$de(t):(t=f.length,function(u){for(var m=0,d;m<t;++m)c[(d=f[m]).i]=d.x(u);return c.join("")})}function Co(e,t){var n=typeof t,r;return t==null||n==="boolean"?hO(t):(n==="number"?Ha:n==="string"?(r=Ic(t))?(t=r,by):SU:t instanceof Ic?by:t instanceof Date?Lde:Dde(t)?Rde:Array.isArray(t)?Ide:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?zde:Ha)(e,t)}function mO(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var JD=180/Math.PI,C_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function EU(e,t,n,r,a,i){var s,c,f;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(f=e*n+t*r)&&(n-=e*f,r-=t*f),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,f/=c),e*r<t*n&&(e=-e,t=-t,f=-f,s=-s),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*JD,skewX:Math.atan(f)*JD,scaleX:s,scaleY:c}}var Gv;function Ude(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?C_:EU(t.a,t.b,t.c,t.d,t.e,t.f)}function Hde(e){return e==null||(Gv||(Gv=document.createElementNS("http://www.w3.org/2000/svg","g")),Gv.setAttribute("transform",e),!(e=Gv.transform.baseVal.consolidate()))?C_:(e=e.matrix,EU(e.a,e.b,e.c,e.d,e.e,e.f))}function _U(e,t,n,r){function a(u){return u.length?u.pop()+" ":""}function i(u,m,d,v,y,b){if(u!==d||m!==v){var w=y.push("translate(",null,t,null,n);b.push({i:w-4,x:Ha(u,d)},{i:w-2,x:Ha(m,v)})}else(d||v)&&y.push("translate("+d+t+v+n)}function s(u,m,d,v){u!==m?(u-m>180?m+=360:m-u>180&&(u+=360),v.push({i:d.push(a(d)+"rotate(",null,r)-2,x:Ha(u,m)})):m&&d.push(a(d)+"rotate("+m+r)}function c(u,m,d,v){u!==m?v.push({i:d.push(a(d)+"skewX(",null,r)-2,x:Ha(u,m)}):m&&d.push(a(d)+"skewX("+m+r)}function f(u,m,d,v,y,b){if(u!==d||m!==v){var w=y.push(a(y)+"scale(",null,",",null,")");b.push({i:w-4,x:Ha(u,d)},{i:w-2,x:Ha(m,v)})}else(d!==1||v!==1)&&y.push(a(y)+"scale("+d+","+v+")")}return function(u,m){var d=[],v=[];return u=e(u),m=e(m),i(u.translateX,u.translateY,m.translateX,m.translateY,d,v),s(u.rotate,m.rotate,d,v),c(u.skewX,m.skewX,d,v),f(u.scaleX,u.scaleY,m.scaleX,m.scaleY,d,v),u=m=null,function(y){for(var b=-1,w=v.length,S;++b<w;)d[(S=v[b]).i]=S.x(y);return d.join("")}}}var Fde=_U(Ude,"px, ","px)","deg)"),qde=_U(Hde,", ",")",")"),Kde=1e-12;function eI(e){return((e=Math.exp(e))+1/e)/2}function Vde(e){return((e=Math.exp(e))-1/e)/2}function Yde(e){return((e=Math.exp(2*e))-1)/(e+1)}const xg=(function e(t,n,r){function a(i,s){var c=i[0],f=i[1],u=i[2],m=s[0],d=s[1],v=s[2],y=m-c,b=d-f,w=y*y+b*b,S,E;if(w<Kde)E=Math.log(v/u)/t,S=function(P){return[c+P*y,f+P*b,u*Math.exp(t*P*E)]};else{var O=Math.sqrt(w),j=(v*v-u*u+r*w)/(2*u*n*O),A=(v*v-u*u-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=eI(N),K=u/(n*O)*(D*Yde(t*R+N)-Vde(N));return[c+K*y,f+K*b,u*D/eI(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,f=c*c;return e(s,c,f)},a})(Math.SQRT2,2,4);function Gde(e,t){t===void 0&&(t=e,e=Co);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 Xde(e){return function(){return e}}function wy(e){return+e}var tI=[0,1];function xr(e){return e}function O_(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Xde(isNaN(t)?NaN:.5)}function Wde(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Qde(e,t,n){var r=e[0],a=e[1],i=t[0],s=t[1];return a<r?(r=O_(a,r),i=n(s,i)):(r=O_(r,a),i=n(i,s)),function(c){return i(r(c))}}function Zde(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]=O_(e[s],e[s+1]),i[s]=n(t[s],t[s+1]);return function(c){var f=qm(e,c,1,r)-1;return i[f](a[f](c))}}function Vm(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Q0(){var e=tI,t=tI,n=Co,r,a,i,s=xr,c,f,u;function m(){var v=Math.min(e.length,t.length);return s!==xr&&(s=Wde(e[0],e[v-1])),c=v>2?Zde:Qde,f=u=null,d}function d(v){return v==null||isNaN(v=+v)?i:(f||(f=c(e.map(r),t,n)))(r(s(v)))}return d.invert=function(v){return s(a((u||(u=c(t,e.map(r),Ha)))(v)))},d.domain=function(v){return arguments.length?(e=Array.from(v,wy),m()):e.slice()},d.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},d.rangeRound=function(v){return t=Array.from(v),n=mO,m()},d.clamp=function(v){return arguments.length?(s=v?!0:xr,m()):s!==xr},d.interpolate=function(v){return arguments.length?(n=v,m()):n},d.unknown=function(v){return arguments.length?(i=v,d):i},function(v,y){return r=v,a=y,m()}}function pO(){return Q0()(xr,xr)}function Jde(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Sy(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 Mf(e){return e=Sy(Math.abs(e)),e?e[1]:NaN}function ehe(e,t){return function(n,r){for(var a=n.length,i=[],s=0,c=e[0],f=0;a>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),i.push(n.substring(a-=c,a+c)),!((f+=c+1)>r));)c=e[s=(s+1)%e.length];return i.reverse().join(t)}}function the(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var nhe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function em(e){if(!(t=nhe.exec(e)))throw new Error("invalid format: "+e);var t;return new vO({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]})}em.prototype=vO.prototype;function vO(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+""}vO.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 rhe(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 Ey;function ahe(e,t){var n=Sy(e,t);if(!n)return Ey=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(Ey=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")+Sy(e,Math.max(0,t+i-1))[0]}function nI(e,t){var n=Sy(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 rI={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Jde,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)=>nI(e*100,t),r:nI,s:ahe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function aI(e){return e}var iI=Array.prototype.map,oI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ihe(e){var t=e.grouping===void 0||e.thousands===void 0?aI:ehe(iI.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?aI:the(iI.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function u(d,v){d=em(d);var y=d.fill,b=d.align,w=d.sign,S=d.symbol,E=d.zero,O=d.width,j=d.comma,A=d.precision,N=d.trim,T=d.type;T==="n"?(j=!0,T="g"):rI[T]||(A===void 0&&(A=12),N=!0,T="g"),(E||y==="0"&&b==="=")&&(E=!0,y="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=rI[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 L(I){var G=P,z=R,V,k,F;if(T==="c")z=D(I)+z,I="";else{I=+I;var q=I<0||1/I<0;if(I=isNaN(I)?f:D(Math.abs(I),A),N&&(I=rhe(I)),q&&+I==0&&w!=="+"&&(q=!1),G=(q?w==="("?w:c:w==="-"||w==="("?"":w)+G,z=(T==="s"&&!isNaN(I)&&Ey!==void 0?oI[8+Ey/3]:"")+z+(q&&w==="("?")":""),K){for(V=-1,k=I.length;++V<k;)if(F=I.charCodeAt(V),48>F||F>57){z=(F===46?a+I.slice(V+1):I.slice(V))+z,I=I.slice(0,V);break}}}j&&!E&&(I=t(I,1/0));var U=G.length+I.length+z.length,Y=U<O?new Array(O-U+1).join(y):"";switch(j&&E&&(I=t(Y+I,Y.length?O-z.length:1/0),Y=""),b){case"<":I=G+I+z+Y;break;case"=":I=G+Y+I+z;break;case"^":I=Y.slice(0,U=Y.length>>1)+G+I+z+Y.slice(U);break;default:I=Y+G+I+z;break}return i(I)}return L.toString=function(){return d+""},L}function m(d,v){var y=Math.max(-8,Math.min(8,Math.floor(Mf(v)/3)))*3,b=Math.pow(10,-y),w=u((d=em(d),d.type="f",d),{suffix:oI[8+y/3]});return function(S){return w(b*S)}}return{format:u,formatPrefix:m}}var Xv,gO,jU;ohe({thousands:",",grouping:[3],currency:["$",""]});function ohe(e){return Xv=ihe(e),gO=Xv.format,jU=Xv.formatPrefix,Xv}function she(e){return Math.max(0,-Mf(Math.abs(e)))}function lhe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Mf(t)/3)))*3-Mf(Math.abs(e)))}function che(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Mf(t)-Mf(e))+1}function CU(e,t,n,r){var a=S_(e,t,n),i;switch(r=em(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=lhe(a,s))&&(r.precision=i),jU(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=che(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=she(a))&&(r.precision=i-(r.type==="%")*2);break}}return gO(r)}function wl(e){var t=e.domain;return e.ticks=function(n){var r=t();return b_(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return CU(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],f,u,m=10;for(c<s&&(u=s,s=c,c=u,u=a,a=i,i=u);m-- >0;){if(u=w_(s,c,n),u===f)return r[a]=s,r[i]=c,t(r);if(u>0)s=Math.floor(s/u)*u,c=Math.ceil(c/u)*u;else if(u<0)s=Math.ceil(s*u)/u,c=Math.floor(c*u)/u;else break;f=u}return e},e}function OU(){var e=pO();return e.copy=function(){return Vm(e,OU())},Pa.apply(e,arguments),wl(e)}function AU(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,wy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return AU(e).unknown(t)},e=arguments.length?Array.from(e,wy):[0,1],wl(n)}function NU(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 sI(e){return Math.log(e)}function lI(e){return Math.exp(e)}function uhe(e){return-Math.log(-e)}function fhe(e){return-Math.exp(-e)}function dhe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function hhe(e){return e===10?dhe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function mhe(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 cI(e){return(t,n)=>-e(-t,n)}function yO(e){const t=e(sI,lI),n=t.domain;let r=10,a,i;function s(){return a=mhe(r),i=hhe(r),n()[0]<0?(a=cI(a),i=cI(i),e(uhe,fhe)):e(sI,lI),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 f=n();let u=f[0],m=f[f.length-1];const d=m<u;d&&([u,m]=[m,u]);let v=a(u),y=a(m),b,w;const S=c==null?10:+c;let E=[];if(!(r%1)&&y-v<S){if(v=Math.floor(v),y=Math.ceil(y),u>0){for(;v<=y;++v)for(b=1;b<r;++b)if(w=v<0?b/i(-v):b*i(v),!(w<u)){if(w>m)break;E.push(w)}}else for(;v<=y;++v)for(b=r-1;b>=1;--b)if(w=v>0?b/i(-v):b*i(v),!(w<u)){if(w>m)break;E.push(w)}E.length*2<S&&(E=b_(u,m,S))}else E=b_(v,y,Math.min(y-v,S)).map(i);return d?E.reverse():E},t.tickFormat=(c,f)=>{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=em(f)).precision==null&&(f.trim=!0),f=gO(f)),c===1/0)return f;const u=Math.max(1,r*c/t.ticks().length);return m=>{let d=m/i(Math.round(a(m)));return d*r<r-.5&&(d*=r),d<=u?f(m):""}},t.nice=()=>n(NU(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function TU(){const e=yO(Q0()).domain([1,10]);return e.copy=()=>Vm(e,TU()).base(e.base()),Pa.apply(e,arguments),e}function uI(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function fI(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xO(e){var t=1,n=e(uI(t),fI(t));return n.constant=function(r){return arguments.length?e(uI(t=+r),fI(t)):t},wl(n)}function PU(){var e=xO(Q0());return e.copy=function(){return Vm(e,PU()).constant(e.constant())},Pa.apply(e,arguments)}function dI(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function phe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function vhe(e){return e<0?-e*e:e*e}function bO(e){var t=e(xr,xr),n=1;function r(){return n===1?e(xr,xr):n===.5?e(phe,vhe):e(dI(n),dI(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},wl(t)}function wO(){var e=bO(Q0());return e.copy=function(){return Vm(e,wO()).exponent(e.exponent())},Pa.apply(e,arguments),e}function ghe(){return wO.apply(null,arguments).exponent(.5)}function hI(e){return Math.sign(e)*e*e}function yhe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function MU(){var e=pO(),t=[0,1],n=!1,r;function a(i){var s=yhe(e(i));return isNaN(s)?r:n?Math.round(s):s}return a.invert=function(i){return e.invert(hI(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,wy)).map(hI)),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 MU(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Pa.apply(a,arguments),wl(a)}function kU(){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]=vde(e,s/c);return i}function i(s){return s==null||isNaN(s=+s)?r:t[qm(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(Zs),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 kU().domain(e).range(t).unknown(r)},Pa.apply(i,arguments)}function RU(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function s(f){return f!=null&&f<=f?a[qm(r,f,0,n)]:i}function c(){var f=-1;for(r=new Array(n);++f<n;)r[f]=((f+1)*t-(f-n)*e)/(n+1);return s}return s.domain=function(f){return arguments.length?([e,t]=f,e=+e,t=+t,c()):[e,t]},s.range=function(f){return arguments.length?(n=(a=Array.from(f)).length-1,c()):a.slice()},s.invertExtent=function(f){var u=a.indexOf(f);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(f){return arguments.length&&(i=f),s},s.thresholds=function(){return r.slice()},s.copy=function(){return RU().domain([e,t]).range(a).unknown(i)},Pa.apply(wl(s),arguments)}function DU(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[qm(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 DU().domain(e).range(t).unknown(n)},Pa.apply(a,arguments)}const OS=new Date,AS=new Date;function kn(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 f=[];if(i=a.ceil(i),c=c==null?1:Math.floor(c),!(i<s)||!(c>0))return f;let u;do f.push(u=new Date(+i)),t(i,c),e(i);while(u<i&&i<s);return f},a.filter=i=>kn(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 _y=kn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);_y.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?kn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):_y);_y.range;const wo=1e3,Ca=wo*60,So=Ca*60,Do=So*24,SO=Do*7,mI=Do*30,NS=Do*365,ic=kn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*wo)},(e,t)=>(t-e)/wo,e=>e.getUTCSeconds());ic.range;const EO=kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wo)},(e,t)=>{e.setTime(+e+t*Ca)},(e,t)=>(t-e)/Ca,e=>e.getMinutes());EO.range;const _O=kn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ca)},(e,t)=>(t-e)/Ca,e=>e.getUTCMinutes());_O.range;const jO=kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wo-e.getMinutes()*Ca)},(e,t)=>{e.setTime(+e+t*So)},(e,t)=>(t-e)/So,e=>e.getHours());jO.range;const CO=kn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*So)},(e,t)=>(t-e)/So,e=>e.getUTCHours());CO.range;const Ym=kn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ca)/Do,e=>e.getDate()-1);Ym.range;const Z0=kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Do,e=>e.getUTCDate()-1);Z0.range;const IU=kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Do,e=>Math.floor(e/Do));IU.range;function Xc(e){return kn(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())*Ca)/SO)}const J0=Xc(0),jy=Xc(1),xhe=Xc(2),bhe=Xc(3),kf=Xc(4),whe=Xc(5),She=Xc(6);J0.range;jy.range;xhe.range;bhe.range;kf.range;whe.range;She.range;function Wc(e){return kn(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)/SO)}const ex=Wc(0),Cy=Wc(1),Ehe=Wc(2),_he=Wc(3),Rf=Wc(4),jhe=Wc(5),Che=Wc(6);ex.range;Cy.range;Ehe.range;_he.range;Rf.range;jhe.range;Che.range;const OO=kn(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());OO.range;const AO=kn(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());AO.range;const Io=kn(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());Io.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:kn(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)});Io.range;const Lo=kn(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());Lo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:kn(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)});Lo.range;function LU(e,t,n,r,a,i){const s=[[ic,1,wo],[ic,5,5*wo],[ic,15,15*wo],[ic,30,30*wo],[i,1,Ca],[i,5,5*Ca],[i,15,15*Ca],[i,30,30*Ca],[a,1,So],[a,3,3*So],[a,6,6*So],[a,12,12*So],[r,1,Do],[r,2,2*Do],[n,1,SO],[t,1,mI],[t,3,3*mI],[e,1,NS]];function c(u,m,d){const v=m<u;v&&([u,m]=[m,u]);const y=d&&typeof d.range=="function"?d:f(u,m,d),b=y?y.range(u,+m+1):[];return v?b.reverse():b}function f(u,m,d){const v=Math.abs(m-u)/d,y=cO(([,,S])=>S).right(s,v);if(y===s.length)return e.every(S_(u/NS,m/NS,d));if(y===0)return _y.every(Math.max(S_(u,m,d),1));const[b,w]=s[v/s[y-1][2]<s[y][2]/v?y-1:y];return b.every(w)}return[c,f]}const[Ohe,Ahe]=LU(Lo,AO,ex,IU,CO,_O),[Nhe,The]=LU(Io,OO,J0,Ym,jO,EO);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 mh(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Phe(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,s=e.shortDays,c=e.months,f=e.shortMonths,u=ph(a),m=vh(a),d=ph(i),v=vh(i),y=ph(s),b=vh(s),w=ph(c),S=vh(c),E=ph(f),O=vh(f),j={a:F,A:q,b:U,B:Y,c:null,d:bI,e:bI,f:eme,g:ume,G:dme,H:Qhe,I:Zhe,j:Jhe,L:zU,m:tme,M:nme,p:B,q:$,Q:EI,s:_I,S:rme,u:ame,U:ime,V:ome,w:sme,W:lme,x:null,X:null,y:cme,Y:fme,Z:hme,"%":SI},A={a:X,A:Z,b:ee,B:ie,c:null,d:wI,e:wI,f:gme,g:Ome,G:Nme,H:mme,I:pme,j:vme,L:BU,m:yme,M:xme,p:ae,q:re,Q:EI,s:_I,S:bme,u:wme,U:Sme,V:Eme,w:_me,W:jme,x:null,X:null,y:Cme,Y:Ame,Z:Tme,"%":SI},N={a:K,A:L,b:I,B:G,c:z,d:yI,e:yI,f:Yhe,g:gI,G:vI,H:xI,I:xI,j:Fhe,L:Vhe,m:Hhe,M:qhe,p:D,q:Uhe,Q:Xhe,s:Whe,S:Khe,u:Ihe,U:Lhe,V:zhe,w:Dhe,W:$he,x:V,X:k,y:gI,Y:vI,Z:Bhe,"%":Ghe};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,le){return function(he){var ne=[],ge=-1,ye=0,De=J.length,Me,Ke,Bt;for(he instanceof Date||(he=new Date(+he));++ge<De;)J.charCodeAt(ge)===37&&(ne.push(J.slice(ye,ge)),(Ke=pI[Me=J.charAt(++ge)])!=null?Me=J.charAt(++ge):Ke=Me==="e"?" ":"0",(Bt=le[Me])&&(Me=Bt(he,Ke)),ne.push(Me),ye=ge+1);return ne.push(J.slice(ye,ge)),ne.join("")}}function P(J,le){return function(he){var ne=mh(1900,void 0,1),ge=R(ne,J,he+="",0),ye,De;if(ge!=he.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(le&&!("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(mh(ne.y,0,1)),De=ye.getUTCDay(),ye=De>4||De===0?Cy.ceil(ye):Cy(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(mh(ne.y,0,1)),De=ye.getDay(),ye=De>4||De===0?jy.ceil(ye):jy(ye),ye=Ym.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(mh(ne.y,0,1)).getUTCDay():TS(mh(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,le,he,ne){for(var ge=0,ye=le.length,De=he.length,Me,Ke;ge<ye;){if(ne>=De)return-1;if(Me=le.charCodeAt(ge++),Me===37){if(Me=le.charAt(ge++),Ke=N[Me in pI?le.charAt(ge++):Me],!Ke||(ne=Ke(J,he,ne))<0)return-1}else if(Me!=he.charCodeAt(ne++))return-1}return ne}function D(J,le,he){var ne=u.exec(le.slice(he));return ne?(J.p=m.get(ne[0].toLowerCase()),he+ne[0].length):-1}function K(J,le,he){var ne=y.exec(le.slice(he));return ne?(J.w=b.get(ne[0].toLowerCase()),he+ne[0].length):-1}function L(J,le,he){var ne=d.exec(le.slice(he));return ne?(J.w=v.get(ne[0].toLowerCase()),he+ne[0].length):-1}function I(J,le,he){var ne=E.exec(le.slice(he));return ne?(J.m=O.get(ne[0].toLowerCase()),he+ne[0].length):-1}function G(J,le,he){var ne=w.exec(le.slice(he));return ne?(J.m=S.get(ne[0].toLowerCase()),he+ne[0].length):-1}function z(J,le,he){return R(J,t,le,he)}function V(J,le,he){return R(J,n,le,he)}function k(J,le,he){return R(J,r,le,he)}function F(J){return s[J.getDay()]}function q(J){return i[J.getDay()]}function U(J){return f[J.getMonth()]}function Y(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 f[J.getUTCMonth()]}function ie(J){return c[J.getUTCMonth()]}function ae(J){return a[+(J.getUTCHours()>=12)]}function re(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var le=T(J+="",j);return le.toString=function(){return J},le},parse:function(J){var le=P(J+="",!1);return le.toString=function(){return J},le},utcFormat:function(J){var le=T(J+="",A);return le.toString=function(){return J},le},utcParse:function(J){var le=P(J+="",!0);return le.toString=function(){return J},le}}}var pI={"-":"",_:" ",0:"0"},qn=/^\s*\d+/,Mhe=/^%/,khe=/[\\^$*+?|[\]().{}]/g;function pt(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 Rhe(e){return e.replace(khe,"\\$&")}function ph(e){return new RegExp("^(?:"+e.map(Rhe).join("|")+")","i")}function vh(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Dhe(e,t,n){var r=qn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ihe(e,t,n){var r=qn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Lhe(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function zhe(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function $he(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function vI(e,t,n){var r=qn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function gI(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Bhe(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 Uhe(e,t,n){var r=qn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Hhe(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function yI(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Fhe(e,t,n){var r=qn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function xI(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function qhe(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Khe(e,t,n){var r=qn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Vhe(e,t,n){var r=qn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Yhe(e,t,n){var r=qn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ghe(e,t,n){var r=Mhe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Xhe(e,t,n){var r=qn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Whe(e,t,n){var r=qn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function bI(e,t){return pt(e.getDate(),t,2)}function Qhe(e,t){return pt(e.getHours(),t,2)}function Zhe(e,t){return pt(e.getHours()%12||12,t,2)}function Jhe(e,t){return pt(1+Ym.count(Io(e),e),t,3)}function zU(e,t){return pt(e.getMilliseconds(),t,3)}function eme(e,t){return zU(e,t)+"000"}function tme(e,t){return pt(e.getMonth()+1,t,2)}function nme(e,t){return pt(e.getMinutes(),t,2)}function rme(e,t){return pt(e.getSeconds(),t,2)}function ame(e){var t=e.getDay();return t===0?7:t}function ime(e,t){return pt(J0.count(Io(e)-1,e),t,2)}function $U(e){var t=e.getDay();return t>=4||t===0?kf(e):kf.ceil(e)}function ome(e,t){return e=$U(e),pt(kf.count(Io(e),e)+(Io(e).getDay()===4),t,2)}function sme(e){return e.getDay()}function lme(e,t){return pt(jy.count(Io(e)-1,e),t,2)}function cme(e,t){return pt(e.getFullYear()%100,t,2)}function ume(e,t){return e=$U(e),pt(e.getFullYear()%100,t,2)}function fme(e,t){return pt(e.getFullYear()%1e4,t,4)}function dme(e,t){var n=e.getDay();return e=n>=4||n===0?kf(e):kf.ceil(e),pt(e.getFullYear()%1e4,t,4)}function hme(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+pt(t/60|0,"0",2)+pt(t%60,"0",2)}function wI(e,t){return pt(e.getUTCDate(),t,2)}function mme(e,t){return pt(e.getUTCHours(),t,2)}function pme(e,t){return pt(e.getUTCHours()%12||12,t,2)}function vme(e,t){return pt(1+Z0.count(Lo(e),e),t,3)}function BU(e,t){return pt(e.getUTCMilliseconds(),t,3)}function gme(e,t){return BU(e,t)+"000"}function yme(e,t){return pt(e.getUTCMonth()+1,t,2)}function xme(e,t){return pt(e.getUTCMinutes(),t,2)}function bme(e,t){return pt(e.getUTCSeconds(),t,2)}function wme(e){var t=e.getUTCDay();return t===0?7:t}function Sme(e,t){return pt(ex.count(Lo(e)-1,e),t,2)}function UU(e){var t=e.getUTCDay();return t>=4||t===0?Rf(e):Rf.ceil(e)}function Eme(e,t){return e=UU(e),pt(Rf.count(Lo(e),e)+(Lo(e).getUTCDay()===4),t,2)}function _me(e){return e.getUTCDay()}function jme(e,t){return pt(Cy.count(Lo(e)-1,e),t,2)}function Cme(e,t){return pt(e.getUTCFullYear()%100,t,2)}function Ome(e,t){return e=UU(e),pt(e.getUTCFullYear()%100,t,2)}function Ame(e,t){return pt(e.getUTCFullYear()%1e4,t,4)}function Nme(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Rf(e):Rf.ceil(e),pt(e.getUTCFullYear()%1e4,t,4)}function Tme(){return"+0000"}function SI(){return"%"}function EI(e){return+e}function _I(e){return Math.floor(+e/1e3)}var Bu,HU,FU;Pme({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 Pme(e){return Bu=Phe(e),HU=Bu.format,Bu.parse,FU=Bu.utcFormat,Bu.utcParse,Bu}function Mme(e){return new Date(e)}function kme(e){return e instanceof Date?+e:+new Date(+e)}function NO(e,t,n,r,a,i,s,c,f,u){var m=pO(),d=m.invert,v=m.domain,y=u(".%L"),b=u(":%S"),w=u("%I:%M"),S=u("%I %p"),E=u("%a %d"),O=u("%b %d"),j=u("%B"),A=u("%Y");function N(T){return(f(T)<T?y: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(d(T))},m.domain=function(T){return arguments.length?v(Array.from(T,kme)):v().map(Mme)},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:u(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(NU(P,T)):m},m.copy=function(){return Vm(m,NO(e,t,n,r,a,i,s,c,f,u))},m}function Rme(){return Pa.apply(NO(Nhe,The,Io,OO,J0,Ym,jO,EO,ic,HU).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Dme(){return Pa.apply(NO(Ohe,Ahe,Lo,AO,ex,Z0,CO,_O,ic,FU).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function tx(){var e=0,t=1,n,r,a,i,s=xr,c=!1,f;function u(d){return d==null||isNaN(d=+d)?f:s(a===0?.5:(d=(i(d)-n)*a,c?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,n=i(e=+e),r=i(t=+t),a=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(d){return arguments.length?(c=!!d,u):c},u.interpolator=function(d){return arguments.length?(s=d,u):s};function m(d){return function(v){var y,b;return arguments.length?([y,b]=v,s=d(y,b),u):[s(0),s(1)]}}return u.range=m(Co),u.rangeRound=m(mO),u.unknown=function(d){return arguments.length?(f=d,u):f},function(d){return i=d,n=d(e),r=d(t),a=n===r?0:1/(r-n),u}}function Sl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function qU(){var e=wl(tx()(xr));return e.copy=function(){return Sl(e,qU())},Ko.apply(e,arguments)}function KU(){var e=yO(tx()).domain([1,10]);return e.copy=function(){return Sl(e,KU()).base(e.base())},Ko.apply(e,arguments)}function VU(){var e=xO(tx());return e.copy=function(){return Sl(e,VU()).constant(e.constant())},Ko.apply(e,arguments)}function TO(){var e=bO(tx());return e.copy=function(){return Sl(e,TO()).exponent(e.exponent())},Ko.apply(e,arguments)}function Ime(){return TO.apply(null,arguments).exponent(.5)}function YU(){var e=[],t=xr;function n(r){if(r!=null&&!isNaN(r=+r))return t((qm(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(Zs),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)=>pde(e,i/r))},n.copy=function(){return YU(t).domain(e)},Ko.apply(n,arguments)}function nx(){var e=0,t=.5,n=1,r=1,a,i,s,c,f,u=xr,m,d=!1,v;function y(w){return isNaN(w=+w)?v:(w=.5+((w=+m(w))-i)*(r*w<r*i?c:f),u(d?Math.max(0,Math.min(1,w)):w))}y.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),f=i===s?0:.5/(s-i),r=i<a?-1:1,y):[e,t,n]},y.clamp=function(w){return arguments.length?(d=!!w,y):d},y.interpolator=function(w){return arguments.length?(u=w,y):u};function b(w){return function(S){var E,O,j;return arguments.length?([E,O,j]=S,u=Gde(w,[E,O,j]),y):[u(0),u(.5),u(1)]}}return y.range=b(Co),y.rangeRound=b(mO),y.unknown=function(w){return arguments.length?(v=w,y):v},function(w){return m=w,a=w(e),i=w(t),s=w(n),c=a===i?0:.5/(i-a),f=i===s?0:.5/(s-i),r=i<a?-1:1,y}}function GU(){var e=wl(nx()(xr));return e.copy=function(){return Sl(e,GU())},Ko.apply(e,arguments)}function XU(){var e=yO(nx()).domain([.1,1,10]);return e.copy=function(){return Sl(e,XU()).base(e.base())},Ko.apply(e,arguments)}function WU(){var e=xO(nx());return e.copy=function(){return Sl(e,WU()).constant(e.constant())},Ko.apply(e,arguments)}function PO(){var e=bO(nx());return e.copy=function(){return Sl(e,PO()).exponent(e.exponent())},Ko.apply(e,arguments)}function Lme(){return PO.apply(null,arguments).exponent(.5)}const Oh=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:fO,scaleDiverging:GU,scaleDivergingLog:XU,scaleDivergingPow:PO,scaleDivergingSqrt:Lme,scaleDivergingSymlog:WU,scaleIdentity:AU,scaleImplicit:E_,scaleLinear:OU,scaleLog:TU,scaleOrdinal:uO,scalePoint:yde,scalePow:wO,scaleQuantile:kU,scaleQuantize:RU,scaleRadial:MU,scaleSequential:qU,scaleSequentialLog:KU,scaleSequentialPow:TO,scaleSequentialQuantile:YU,scaleSequentialSqrt:Ime,scaleSequentialSymlog:VU,scaleSqrt:ghe,scaleSymlog:PU,scaleThreshold:DU,scaleTime:Rme,scaleUtc:Dme,tickFormat:CU},Symbol.toStringTag,{value:"Module"}));function zme(e){if(e in Oh)return Oh[e]();var t="scale".concat(Mm(e));if(t in Oh)return Oh[t]()}function jI(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=zme(e);if(r!=null)return r.domain(t).range(n),r}}function MO(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?jI(e.scale,n,r):jI(t,n,r)}function $me(e){return"scale".concat(Mm(e))}function Bme(e){return $me(e)in Oh}var QU=(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 Bme(r)?r:"point"}};function Ume(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 ZU(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,f=Ume(r,i);if(f<=0)return n[0];if(f>=n.length)return n[n.length-1];var u=(s=r[f-1])!==null&&s!==void 0?s:0,m=(c=r[f])!==null&&c!==void 0?c:0;return Math.abs(i-u)<=Math.abs(i-m)?n[f-1]:n[f]}}}function Hme(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):ZU(e,void 0)}function CI(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 Oy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(n),!0).forEach(function(r){Fme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fme(e,t,n){return(t=qme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qme(e){var t=Kme(e,"string");return typeof t=="symbol"?t:t+""}function Kme(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 A_=[0,"auto"],On={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"},JU=(e,t)=>e.cartesianAxis.xAxis[t],Vo=(e,t)=>{var n=JU(e,t);return n??On},An={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:A_,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:Im},eH=(e,t)=>e.cartesianAxis.yAxis[t],Yo=(e,t)=>{var n=eH(e,t);return n??An},Vme={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:""},kO=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Vme},an=(e,t,n)=>{switch(t){case"xAxis":return Vo(e,n);case"yAxis":return Yo(e,n);case"zAxis":return kO(e,n);case"angleAxis":return aO(e,n);case"radiusAxis":return iO(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Yme=(e,t,n)=>{switch(t){case"xAxis":return Vo(e,n);case"yAxis":return Yo(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},id=(e,t,n)=>{switch(t){case"xAxis":return Vo(e,n);case"yAxis":return Yo(e,n);case"angleAxis":return aO(e,n);case"radiusAxis":return iO(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},tH=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function RO(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,Gme=se([Wt,Fm],RO),DO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Gm=se([rx,an,Gme],DO,{memoizeOptions:{resultEqualityCheck:W0}}),nH=se([Gm],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(G0)),rH=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Xme=se([Gm],rH),IO=e=>e.map(t=>t.data).filter(Boolean).flat(1),Wme=se([Gm],IO,{memoizeOptions:{resultEqualityCheck:W0}}),LO=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:a}=t;return e.length>0?e:n.slice(r,a+1)},zO=se([Wme,QC],LO),$O=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Ot(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(a=>({value:Ot(a,r)}))):e.map(r=>({value:r})),Xm=se([zO,an,Gm],$O);function sf(e){if(Di(e)||e instanceof Date){var t=Number(e);if(st(t))return t}}function OI(e){if(Array.isArray(e)){var t=[sf(e[0]),sf(e[1])];return Ai(t)?t:void 0}var n=sf(e);if(n!=null)return[n,n]}function zo(e){return e.map(sf).filter(Rr)}function Qme(e,t){var n=sf(e),r=sf(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Zme=se([Xm],e=>e==null?void 0:e.map(t=>t.value).sort(Qme));function aH(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Jme(e,t,n){return!n||typeof t!="number"||Ri(t)?[]:n.length?zo(n.flatMap(r=>{var a=Ot(e,r.dataKey),i,s;if(Array.isArray(a)?[i,s]=a:i=s=a,!(!st(i)||!st(s)))return[t-i,t+s]})):[]}var Rn=e=>{var t=Fn(e),n=ad(e);return id(e,t,n)},Wm=se([Rn],e=>e==null?void 0:e.dataKey),epe=se([nH,QC,Rn],hU),iH=(e,t,n,r)=>{var a={},i=t.reduce((s,c)=>{if(c.stackId==null)return s;var f=s[c.stackId];return f==null&&(f=[]),f.push(c),s[c.stackId]=f,s},a);return Object.fromEntries(Object.entries(i).map(s=>{var[c,f]=s,u=r?[...f].reverse():f,m=u.map(sO);return[c,{stackedData:Ule(e,m,n),graphicalItems:u}]}))},N_=se([epe,nH,Hm,oU],iH),oH=(e,t,n,r)=>{var{dataStartIndex:a,dataEndIndex:i}=t;if(r==null&&n!=="zAxis"){var s=Vle(e,a,i);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},tpe=se([an],e=>e.allowDataOverflow),BO=e=>{var t;if(e==null||!("domain"in e))return A_;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=zo(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:A_},UO=se([an],BO),HO=se([UO,tpe],Y6),npe=se([N_,qo,Wt,HO],oH,{memoizeOptions:{resultEqualityCheck:X0}}),ax=e=>e.errorBars,rpe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>aH(n,r)),Ay=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]}},FO=(e,t,n,r,a)=>{var i,s;if(n.length>0&&e.forEach(c=>{n.forEach(f=>{var u,m,d=(u=r[f.id])===null||u===void 0?void 0:u.filter(E=>aH(a,E)),v=Ot(c,(m=t.dataKey)!==null&&m!==void 0?m:f.dataKey),y=Jme(c,v,d);if(y.length>=2){var b=Math.min(...y),w=Math.max(...y);(i==null||b<i)&&(i=b),(s==null||w>s)&&(s=w)}var S=OI(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 f=OI(Ot(c,t.dataKey));f!=null&&(i=i==null?f[0]:Math.min(i,f[0]),s=s==null?f[1]:Math.max(s,f[1]))}),st(i)&&st(s))return[i,s]},ape=se([zO,an,Xme,ax,Wt],FO,{memoizeOptions:{resultEqualityCheck:X0}});function ipe(e){var{value:t}=e;if(Di(t)||t instanceof Date)return t}var ope=(e,t,n)=>{var r=e.map(ipe).filter(a=>a!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&v8(r))?V6(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},sH=e=>e.referenceElements.dots,od=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),spe=se([sH,Wt,Fm],od),lH=e=>e.referenceElements.areas,lpe=se([lH,Wt,Fm],od),cH=e=>e.referenceElements.lines,cpe=se([cH,Wt,Fm],od),uH=(e,t)=>{if(e!=null){var n=zo(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},upe=se(spe,Wt,uH),fH=(e,t)=>{if(e!=null){var n=zo(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([lpe,Wt],fH);function dpe(e){var t;if(e.x!=null)return zo([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:zo(n)}function hpe(e){var t;if(e.y!=null)return zo([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:zo(n)}var dH=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?dpe(r):hpe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},mpe=se([cpe,Wt],dH),ppe=se(upe,mpe,fpe,(e,t,n)=>Ay(e,n,t)),qO=(e,t,n,r,a,i,s,c)=>{if(n!=null)return n;var f=s==="vertical"&&c==="xAxis"||s==="horizontal"&&c==="yAxis",u=f?Ay(r,i,a):Ay(i,a);return qfe(t,u,e.allowDataOverflow)},vpe=se([an,UO,HO,npe,ape,ppe,gt,Wt],qO,{memoizeOptions:{resultEqualityCheck:X0}}),gpe=[0,1],KO=(e,t,n,r,a,i,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var{dataKey:c,type:f}=e,u=Uo(t,i);if(u&&c==null){var m;return V6(0,(m=n==null?void 0:n.length)!==null&&m!==void 0?m:0)}return f==="category"?ope(r,e,u):a==="expand"?gpe:s}},VO=se([an,gt,zO,Xm,Hm,Wt,vpe],KO),El=se([an,tH,tO],QU),YO=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var a=BO(t),i=Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Ai(e)){if(i)return ID(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return LD(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(i&&Ai(e))return ID(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ai(e))return LD(e,t.tickCount,t.allowDecimals,"adaptive")}}},GO=se([VO,id,El],YO),XO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Ai(t)&&Array.isArray(n)&&n.length>0){var a,i,s=t[0],c=(a=n[0])!==null&&a!==void 0?a:0,f=t[1],u=(i=n[n.length-1])!==null&&i!==void 0?i:0;return[Math.min(s,c),Math.max(f,u)]}return t},ype=se([an,VO,GO,Wt],XO),xpe=se(Xm,an,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(zo(e.map(d=>d.value))).sort((d,v)=>d-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 f=r[c],u=r[c+1];if(!(f==null||u==null)){var m=u-f;n=Math.min(n,m)}}return n/s}}),hH=se(xpe,gt,iU,Mn,(e,t,n,r,a)=>a,(e,t,n,r,a)=>{if(!st(e))return 0;var i=t==="vertical"?r.height:r.width;if(a==="gap")return e*i/2;if(a==="no-gap"){var s=dr(n,e*i),c=e*i/2;return c-s-(c-s)/i*s}return 0}),bpe=(e,t,n)=>{var r=Vo(e,t);return r==null||typeof r.padding!="string"?0:hH(e,"xAxis",t,n,r.padding)},wpe=(e,t,n)=>{var r=Yo(e,t);return r==null||typeof r.padding!="string"?0:hH(e,"yAxis",t,n,r.padding)},Spe=se(Vo,bpe,(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}}),Epe=se(Yo,wpe,(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}}),_pe=se([Mn,Spe,$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]}),jpe=se([Mn,gt,Epe,$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]}),Qm=(e,t,n,r)=>{var a;switch(t){case"xAxis":return _pe(e,n,r);case"yAxis":return jpe(e,n,r);case"zAxis":return(a=kO(e,n))===null||a===void 0?void 0:a.range;case"angleAxis":return uU(e);case"radiusAxis":return fU(e,n);default:return}},mH=se([an,Qm],K0),Cpe=se([El,ype],mU),WO=se([an,El,Cpe,mH],MO),pH=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:a,scale:i}=n,s=Uo(e,r);if(s&&(a==="number"||i!=="auto"))return t.map(c=>c.value)}},QO=se([gt,Xm,id,Wt],pH),ix=se([WO],lO);se([WO],Hme);se([WO,Zme],ZU);se([Gm,ax,Wt],rpe);function vH(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var ox=(e,t)=>t,sx=(e,t,n)=>n,Ope=se(I0,ox,sx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(vH)),Ape=se(L0,ox,sx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(vH)),gH=(e,t)=>({width:e.width,height:t.height}),Npe=(e,t)=>{var n=typeof t.width=="number"?t.width:Im;return{width:n,height:e.height}},yH=se(Mn,Vo,gH),Tpe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Ppe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Mpe=se(Fo,Mn,Ope,ox,sx,(e,t,n,r,a)=>{var i={},s;return n.forEach(c=>{var f=gH(t,c);s==null&&(s=Tpe(t,r,e));var u=r==="top"&&!a||r==="bottom"&&a;i[c.id]=s-Number(u)*f.height,s+=(u?-1:1)*f.height}),i}),kpe=se(Ho,Mn,Ape,ox,sx,(e,t,n,r,a)=>{var i={},s;return n.forEach(c=>{var f=Npe(t,c);s==null&&(s=Ppe(t,r,e));var u=r==="left"&&!a||r==="right"&&a;i[c.id]=s-Number(u)*f.width,s+=(u?-1:1)*f.width}),i}),Rpe=(e,t)=>{var n=Vo(e,t);if(n!=null)return Mpe(e,n.orientation,n.mirror)},Dpe=se([Mn,Vo,Rpe,(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}}}),Ipe=(e,t)=>{var n=Yo(e,t);if(n!=null)return kpe(e,n.orientation,n.mirror)},Lpe=se([Mn,Yo,Ipe,(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}}}),xH=se(Mn,Yo,(e,t)=>{var n=typeof t.width=="number"?t.width:Im;return{width:n,height:e.height}}),AI=(e,t,n)=>{switch(t){case"xAxis":return yH(e,n).width;case"yAxis":return xH(e,n).height;default:return}},bH=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:a,type:i,dataKey:s}=n,c=Uo(e,r),f=t.map(u=>u.value);if(s&&c&&i==="category"&&a&&v8(f))return f}},ZO=se([gt,Xm,an,Wt],bH),NI=se([gt,Yme,El,ix,ZO,QO,Qm,GO,Wt],(e,t,n,r,a,i,s,c,f)=>{if(t!=null){var u=Uo(e,f);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:f,categoricalDomain:i,duplicateDomain:a,isCategorical:u,niceTicks:c,range:s,realScaleType:n,scale:r}}}),zpe=(e,t,n,r,a,i,s,c,f)=>{if(!(t==null||r==null)){var u=Uo(e,f),{type:m,ticks:d,tickCount:v}=t,y=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,b=m==="category"&&r.bandwidth?r.bandwidth()/y:0;b=f==="angleAxis"&&i!=null&&i.length>=2?Bn(i[0]-i[1])*2*b:b;var w=d||a;return w?w.map((S,E)=>{var O=s?s.indexOf(S):S,j=r.map(O);return st(j)?{index:E,coordinate:j+b,value:S,offset:b}:null}).filter(Rr):u&&c?c.map((S,E)=>{var O=r.map(S);return st(O)?{coordinate:O+b,value:S,index:E,offset:b}:null}).filter(Rr):r.ticks?r.ticks(v).map((S,E)=>{var O=r.map(S);return st(O)?{coordinate:O+b,value:S,index:E,offset:b}:null}).filter(Rr):r.domain().map((S,E)=>{var O=r.map(S);return st(O)?{coordinate:O+b,value:s?s[S]:S,index:E,offset:b}:null}).filter(Rr)}},wH=se([gt,id,El,ix,GO,Qm,ZO,QO,Wt],zpe),$pe=(e,t,n,r,a,i,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Uo(e,s),{tickCount:f}=t,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?Bn(r[0]-r[1])*2*u:u,c&&i?i.map((m,d)=>{var v=n.map(m);return st(v)?{coordinate:v+u,value:m,index:d,offset:u}:null}).filter(Rr):n.ticks?n.ticks(f).map((m,d)=>{var v=n.map(m);return st(v)?{coordinate:v+u,value:m,index:d,offset:u}:null}).filter(Rr):n.domain().map((m,d)=>{var v=n.map(m);return st(v)?{coordinate:v+u,value:a?a[m]:m,index:d,offset:u}:null}).filter(Rr)}},il=se([gt,id,ix,Qm,ZO,QO,Wt],$pe),ol=se(an,ix,(e,t)=>{if(!(e==null||t==null))return Oy(Oy({},e),{},{scale:t})}),Bpe=se([an,El,VO,mH],MO),Upe=se([Bpe],lO);se((e,t,n)=>kO(e,n),Upe,(e,t)=>{if(!(e==null||t==null))return Oy(Oy({},e),{},{scale:t})});var Hpe=se([gt,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}}),Fpe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};se([Fpe],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 SH=e=>e.options.defaultTooltipEventType,EH=e=>e.options.validateTooltipEventTypes;function _H(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function JO(e,t){var n=SH(e),r=EH(e);return _H(t,n,r)}function qpe(e){return Te(t=>JO(t,e))}var jH=(e,t)=>{var n,r=Number(t);if(!(Ri(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Kpe=e=>e.tooltip.settings,zs={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Vpe={itemInteraction:{click:zs,hover:zs},axisInteraction:{click:zs,hover:zs},keyboardInteraction:zs,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}},CH=mr({name:"tooltip",initialState:Vpe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:zt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,a=ja(e).tooltipItemPayloads.indexOf(n);a>-1&&(e.tooltipItemPayloads[a]=r)},prepare:zt()},removeTooltipEntrySettings:{reducer(e,t){var n=ja(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:zt()},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:Ype,replaceTooltipEntrySettings:Gpe,removeTooltipEntrySettings:Xpe,setTooltipSettingsState:Wpe,setActiveMouseOverItemIndex:OH,mouseLeaveItem:Qpe,mouseLeaveChart:AH,setActiveClickItemIndex:Zpe,setMouseOverAxisIndex:NH,setMouseClickAxisIndex:Jpe,setSyncInteraction:T_,setKeyboardInteraction:Ny}=CH.actions,eve=CH.reducer;function TI(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 Wv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(n),!0).forEach(function(r){tve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tve(e,t,n){return(t=nve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nve(e){var t=rve(e,"string");return typeof t=="symbol"?t:t+""}function rve(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 ave(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function ive(e){return e.index!=null}var TH=(e,t,n,r)=>{if(t==null)return zs;var a=ave(e,t,n);if(a==null)return zs;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(ive(a)){if(i)return Wv(Wv({},a),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Wv(Wv({},zs),{},{coordinate:a.coordinate})};function ove(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 sve(e,t){var n=ove(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 lve(e,t,n){if(n==null||t==null)return!0;var r=Ot(e,t);return r==null||!Ai(n)?!0:sve(r,n)}var eA=(e,t,n,r)=>{var a=e==null?void 0:e.index;if(a==null)return null;var i=Number(a);if(!st(i))return a;var s=0,c=1/0;t.length>0&&(c=t.length-1);var f=Math.max(s,Math.min(i,c)),u=t[f];return u==null||lve(u,n,r)?String(f):null},PH=(e,t,n,r,a,i,s)=>{if(i!=null){var c=s[0],f=c==null?void 0:c.getPosition(i);if(f!=null)return f;var u=a==null?void 0:a[Number(i)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},MH=(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})},kH=e=>e.options.tooltipPayloadSearcher,sd=e=>e.tooltip;function PI(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 MI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PI(Object(n),!0).forEach(function(r){cve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cve(e,t,n){return(t=uve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uve(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 dve(e){if(typeof e=="string"||typeof e=="number")return e}function hve(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function mve(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function kI(e){if(typeof e=="string")return e}function pve(e){if(!(e==null||typeof e!="object")){var t="name"in e?dve(e.name):void 0,n="unit"in e?hve(e.unit):void 0,r="dataKey"in e?mve(e.dataKey):void 0,a="payload"in e?e.payload:void 0,i="color"in e?kI(e.color):void 0,s="fill"in e?kI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:a,color:i,fill:s}}}function vve(e,t){return e??t}var RH=(e,t,n,r,a,i,s)=>{if(!(t==null||i==null)){var{chartData:c,computedData:f,dataStartIndex:u,dataEndIndex:m}=n,d=[];return e.reduce((v,y)=>{var b,{dataDefinedOnItem:w,settings:S}=y,E=vve(w,c),O=Array.isArray(E)?d6(E,u,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=g8(O,r,a):N=i(O,t,f,A),Array.isArray(N))N.forEach(P=>{var R,D,K=pve(P),L=K==null?void 0:K.name,I=K==null?void 0:K.dataKey,G=K==null?void 0:K.payload,z=MI(MI({},S),{},{name:L,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(_R({tooltipEntrySettings:z,dataKey:I,payload:G,value:Ot(G,I),name:L==null?void 0:String(L)}))});else{var T;v.push(_R({tooltipEntrySettings:S,dataKey:j,payload:N,value:Ot(N,j),name:(T=Ot(N,A))!==null&&T!==void 0?T:S==null?void 0:S.name}))}return v},d)}},tA=se([Rn,tH,tO],QU),gve=se([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),yve=se([Fn,ad],RO),ld=se([gve,Rn,yve],DO,{memoizeOptions:{resultEqualityCheck:W0}}),xve=se([ld],e=>e.filter(G0)),bve=se([ld],IO,{memoizeOptions:{resultEqualityCheck:W0}}),cd=se([bve,qo],LO),wve=se([xve,qo,Rn],hU),nA=se([cd,Rn,ld],$O),DH=se([Rn],BO),Sve=se([Rn],e=>e.allowDataOverflow),IH=se([DH,Sve],Y6),Eve=se([ld],e=>e.filter(G0)),_ve=se([wve,Eve,Hm,oU],iH),jve=se([_ve,qo,Fn,IH],oH),Cve=se([ld],rH),Ove=se([cd,Rn,Cve,ax,Fn],FO,{memoizeOptions:{resultEqualityCheck:X0}}),Ave=se([sH,Fn,ad],od),Nve=se([Ave,Fn],uH),Tve=se([lH,Fn,ad],od),Pve=se([Tve,Fn],fH),Mve=se([cH,Fn,ad],od),kve=se([Mve,Fn],dH),Rve=se([Nve,kve,Pve],Ay),Dve=se([Rn,DH,IH,jve,Ove,Rve,gt,Fn],qO),Zm=se([Rn,gt,cd,nA,Hm,Fn,Dve],KO),Ive=se([Zm,Rn,tA],YO),Lve=se([Rn,Zm,Ive,Fn],XO),LH=e=>{var t=Fn(e),n=ad(e),r=!1;return Qm(e,t,n,r)},zH=se([Rn,LH],K0),zve=se([Rn,tA,Lve,zH],MO),$H=se([zve],lO),$ve=se([gt,nA,Rn,Fn],bH),Bve=se([gt,nA,Rn,Fn],pH),Uve=(e,t,n,r,a,i,s,c)=>{if(t){var{type:f}=t,u=Uo(e,c);if(r){var m=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,d=f==="category"&&r.bandwidth?r.bandwidth()/m:0;return d=c==="angleAxis"&&a!=null&&(a==null?void 0:a.length)>=2?Bn(a[0]-a[1])*2*d:d,u&&s?s.map((v,y)=>{var b=r.map(v);return st(b)?{coordinate:b+d,value:v,index:y,offset:d}:null}).filter(Rr):r.domain().map((v,y)=>{var b=r.map(v);return st(b)?{coordinate:b+d,value:i?i[v]:v,index:y,offset:d}:null}).filter(Rr)}}},Go=se([gt,Rn,tA,$H,LH,$ve,Bve,Fn],Uve),rA=se([SH,EH,Kpe],(e,t,n)=>_H(n.shared,e,t)),BH=e=>e.tooltip.settings.trigger,aA=e=>e.tooltip.settings.defaultIndex,Jm=se([sd,rA,BH,aA],TH),sl=se([Jm,cd,Wm,Zm],eA),UH=se([Go,sl],jH),iA=se([Jm],e=>{if(e)return e.dataKey}),HH=se([Jm],e=>{if(e)return e.graphicalItemId}),FH=se([sd,rA,BH,aA],MH),Hve=se([Ho,Fo,gt,Mn,Go,aA,FH],PH),Fve=se([Jm,Hve],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),qve=se([Jm],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),Kve=se([FH,sl,qo,Wm,UH,kH,rA],RH),Vve=se([Kve],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function RI(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 DI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RI(Object(n),!0).forEach(function(r){Yve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yve(e,t,n){return(t=Gve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gve(e){var t=Xve(e,"string");return typeof t=="symbol"?t:t+""}function Xve(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 Wve=()=>Te(Rn),Qve=()=>{var e=Wve(),t=Te(Go),n=Te($H);return Nf(!e||!n?void 0:DI(DI({},e),{},{scale:n}),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 Uu(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){Zve(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 Zve(e,t,n){return(t=Jve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jve(e){var t=ege(e,"string");return typeof t=="symbol"?t:t+""}function ege(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 tge=(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}},nge=(e,t,n,r)=>{var a=t.find(u=>u&&u.index===n);if(a){if(e==="centric"){var i=a.coordinate,{radius:s}=r;return Uu(Uu(Uu({},r),vn(r.cx,r.cy,s,i)),{},{angle:i,radius:s})}var c=a.coordinate,{angle:f}=r;return Uu(Uu(Uu({},r),vn(r.cx,r.cy,c,f)),{},{angle:f,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 rge(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 qH=(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 f,u,m,d,v,y=c>0?(f=n[c-1])===null||f===void 0?void 0:f.coordinate:(u=n[s-1])===null||u===void 0?void 0:u.coordinate,b=(m=n[c])===null||m===void 0?void 0:m.coordinate,w=c>=s-1?(d=n[0])===null||d===void 0?void 0:d.coordinate:(v=n[c+1])===null||v===void 0?void 0:v.coordinate,S=void 0;if(!(y==null||b==null||w==null))if(Bn(b-y)!==Bn(w-b)){var E=[];if(Bn(w-b)===Bn(a[1]-a[0])){S=w;var O=b+a[1]-a[0];E[0]=Math.min(O,(O+y)/2),E[1]=Math.max(O,(O+y)/2)}else{S=y;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(y,w),P=Math.max(y,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 L=t[D+1],I=t[D-1];if(D===0&&L!=null&&e<=(K.coordinate+L.coordinate)/2||D===s-1&&I!=null&&e>(K.coordinate+I.coordinate)/2||D>0&&D<s-1&&I!=null&&L!=null&&e>(K.coordinate+I.coordinate)/2&&e<=(K.coordinate+L.coordinate)/2)return K.index}}return-1},age=()=>Te(tO),oA=(e,t)=>t,KH=(e,t,n)=>n,sA=(e,t,n,r)=>r,ige=se(Go,e=>C0(e,t=>t.coordinate)),lA=se([sd,oA,KH,sA],TH),cA=se([lA,cd,Wm,Zm],eA),oge=(e,t,n)=>{if(t!=null){var r=sd(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},VH=se([sd,oA,KH,sA],MH),Ty=se([Ho,Fo,gt,Mn,Go,sA,VH],PH),sge=se([lA,Ty],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),YH=se([Go,cA],jH),lge=se([VH,cA,qo,Wm,YH,kH,oA],RH),cge=se([lA,cA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),uge=(e,t,n,r,a,i,s)=>{if(!(!e||!n||!r||!a)&&rge(e,s)){var c=Yle(e,t),f=qH(c,i,a,n,r),u=tge(t,a,f,e);return{activeIndex:String(f),activeCoordinate:u}}},fge=(e,t,n,r,a,i,s)=>{if(!(!e||!r||!a||!i||!n)){var c=kfe(e,n);if(c){var f=Gle(c,t),u=qH(f,s,i,r,a),m=nge(t,i,u,c);return{activeIndex:String(u),activeCoordinate:m}}}},dge=(e,t,n,r,a,i,s,c)=>{if(!(!e||!t||!r||!a||!i))return t==="horizontal"||t==="vertical"?uge(e,t,r,a,i,s,c):fge(e,t,n,r,a,i,s)},hge=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}}),mge=se(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(gn)),n=Array.from(new Set(t));return n.sort((r,a)=>r-a)},{memoizeOptions:{resultEqualityCheck:rde}});function LI(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 zI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(r){pge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pge(e,t,n){return(t=vge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vge(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)}var yge={},xge={zIndexMap:Object.values(gn).reduce((e,t)=>zI(zI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),yge)},bge=new Set(Object.values(gn));function wge(e){return bge.has(e)}var GH=mr({name:"zIndex",initialState:xge,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:zt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!wge(n)&&delete e.zIndexMap[n])},prepare:zt()},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:zt()},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:zt()}}}),{registerZIndexPortal:Sge,unregisterZIndexPortal:Ege,registerZIndexPortalElement:_ge,unregisterZIndexPortalElement:jge}=GH.actions,Cge=GH.reducer;function Lr(e){var{zIndex:t,children:n}=e,r=jce(),a=r&&t!==void 0&&t!==0,i=pr(),s=Nt();x.useLayoutEffect(()=>a?(s(Sge({zIndex:t})),()=>{s(Ege({zIndex:t}))}):bl,[s,t,a]);var c=Te(f=>hge(f,t,i));return a?c?fl.createPortal(n,c):null:n}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 $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 Qv(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){Oge(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 Oge(e,t,n){return(t=Age(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Age(e){var t=Nge(e,"string");return typeof t=="symbol"?t:t+""}function Nge(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 Tge(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Pge(e){var t,{coordinate:n,payload:r,index:a,offset:i,tooltipAxisBandSize:s,layout:c,cursor:f,tooltipEventType:u,chartName:m}=e,d=n,v=r,y=a;if(!f||!d||m!=="ScatterChart"&&u!=="axis")return null;var b,w,S;if(m==="ScatterChart")b=d,w=Gue,S=gn.cursorLine;else if(m==="BarChart")b=Xue(c,d,i,s),w=U6,S=gn.cursorRectangle;else if(c==="radial"&&x8(d)){var{cx:E,cy:O,radius:j,startAngle:A,endAngle:N}=F6(d);b={cx:E,cy:O,startAngle:A,endAngle:N,innerRadius:j,outerRadius:j},w=K6,S=gn.cursorLine}else b={points:Lfe(c,d,i)},w=WC,S=gn.cursorLine;var T=typeof f=="object"&&"className"in f?f.className:void 0,P=Qv(Qv(Qv(Qv({stroke:"#ccc",pointerEvents:"none"},i),b),Ac(f)),{},{payload:v,payloadIndex:y,className:ct("recharts-tooltip-cursor",T)});return x.createElement(Lr,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},x.createElement(Tge,{cursor:f,cursorComp:w,cursorProps:P}))}function Mge(e){var t=Qve(),n=w6(),r=Gc(),a=age();return t==null||n==null||r==null||a==null?null:x.createElement(Pge,P_({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:a}))}var XH=x.createContext(null),kge=()=>x.useContext(XH),MS={exports:{}},BI;function Rge(){return BI||(BI=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(f,u,m){this.fn=f,this.context=u,this.once=m||!1}function i(f,u,m,d,v){if(typeof m!="function")throw new TypeError("The listener must be a function");var y=new a(m,d||f,v),b=n?n+u:u;return f._events[b]?f._events[b].fn?f._events[b]=[f._events[b],y]:f._events[b].push(y):(f._events[b]=y,f._eventsCount++),f}function s(f,u){--f._eventsCount===0?f._events=new r:delete f._events[u]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],m,d;if(this._eventsCount===0)return u;for(d in m=this._events)t.call(m,d)&&u.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(m)):u},c.prototype.listeners=function(u){var m=n?n+u:u,d=this._events[m];if(!d)return[];if(d.fn)return[d.fn];for(var v=0,y=d.length,b=new Array(y);v<y;v++)b[v]=d[v].fn;return b},c.prototype.listenerCount=function(u){var m=n?n+u:u,d=this._events[m];return d?d.fn?1:d.length:0},c.prototype.emit=function(u,m,d,v,y,b){var w=n?n+u:u;if(!this._events[w])return!1;var S=this._events[w],E=arguments.length,O,j;if(S.fn){switch(S.once&&this.removeListener(u,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,d),!0;case 4:return S.fn.call(S.context,m,d,v),!0;case 5:return S.fn.call(S.context,m,d,v,y),!0;case 6:return S.fn.call(S.context,m,d,v,y,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(u,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,d);break;case 4:S[j].fn.call(S[j].context,m,d,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(u,m,d){return i(this,u,m,d,!1)},c.prototype.once=function(u,m,d){return i(this,u,m,d,!0)},c.prototype.removeListener=function(u,m,d,v){var y=n?n+u:u;if(!this._events[y])return this;if(!m)return s(this,y),this;var b=this._events[y];if(b.fn)b.fn===m&&(!v||b.once)&&(!d||b.context===d)&&s(this,y);else{for(var w=0,S=[],E=b.length;w<E;w++)(b[w].fn!==m||v&&!b[w].once||d&&b[w].context!==d)&&S.push(b[w]);S.length?this._events[y]=S.length===1?S[0]:S:s(this,y)}return this},c.prototype.removeAllListeners=function(u){var m;return u?(m=n?n+u:u,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 Dge=Rge();const Ige=Za(Dge);var tm=new Ige,M_="recharts.syncEvent.tooltip",UI="recharts.syncEvent.brush",uA=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Ri(n))return e[n]}},Lge={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},WH=mr({name:"options",initialState:Lge,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),zge=WH.reducer,{createEventEmitter:$ge}=WH.actions;function Bge(e){return e.tooltip.syncInteraction}var Uge={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},QH=mr({name:"chartData",initialState:Uge,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:HI,setDataStartEndIndexes:Hge,setComputedData:E2e}=QH.actions,Fge=QH.reducer,qge=["x","y"];function FI(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 Hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FI(Object(n),!0).forEach(function(r){Kge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kge(e,t,n){return(t=Vge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vge(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)}function Gge(e,t){if(e==null)return{};var n,r,a=Xge(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 Xge(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 Wge(){var e=Te(nO),t=Te(rO),n=Nt(),r=Te(sU),a=Te(Go),i=Gc(),s=B0(),c=Te(f=>f.rootProps.className);x.useEffect(()=>{if(e==null)return bl;var f=(u,m,d)=>{if(t!==d&&e===u){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 y=m.payload.coordinate,{x:b,y:w}=y,S=Gge(y,qge),{x:E,y:O,width:j,height:A}=m.payload.sourceViewBox,N=Hu(Hu({},S),{},{x:s.x+(j?(b-E)/j:0)*s.width,y:s.y+(A?(w-O)/A:0)*s.height});n(Hu(Hu({},m),{},{payload:Hu(Hu({},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(T_({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:K,y:L}=D,I=Math.min(K,s.x+s.width),G=Math.min(L,s.y+s.height),z={x:i==="horizontal"?T.coordinate:I,y:i==="horizontal"?G:T.coordinate},V=T_({active:m.payload.active,coordinate:z,dataKey:m.payload.dataKey,index:String(T.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(V)}}};return tm.on(M_,f),()=>{tm.off(M_,f)}},[c,n,t,e,r,a,i,s])}function Qge(){var e=Te(nO),t=Te(rO),n=Nt();x.useEffect(()=>{if(e==null)return bl;var r=(a,i,s)=>{t!==s&&e===a&&n(Hge(i))};return tm.on(UI,r),()=>{tm.off(UI,r)}},[n,t,e])}function Zge(){var e=Nt();x.useEffect(()=>{e($ge())},[e]),Wge(),Qge()}function Jge(e,t,n,r,a,i){var s=Te(b=>oge(b,e,t)),c=Te(HH),f=Te(rO),u=Te(nO),m=Te(sU),d=Te(Bge),v=d==null?void 0:d.active,y=B0();x.useEffect(()=>{if(!v&&u!=null&&f!=null){var b=T_({active:i,coordinate:n,dataKey:s,index:a,label:typeof r=="number"?String(r):r,sourceViewBox:y,graphicalItemId:c});tm.emit(M_,u,b,f)}},[v,n,s,c,a,r,f,u,m,i,y])}function qI(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 KI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){eye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eye(e,t,n){return(t=tye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tye(e){var t=nye(e,"string");return typeof t=="symbol"?t:t+""}function nye(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 rye(e){return e.dataKey}function aye(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Eue,t)}var VI=[],iye={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 ZH(e){var t,n,r=bn(e,iye),{active:a,allowEscapeViewBox:i,animationDuration:s,animationEasing:c,content:f,filterNull:u,isAnimationActive:m,offset:d,payloadUniqBy:v,position:y,reverseDirection:b,useTranslate3d:w,wrapperStyle:S,cursor:E,shared:O,trigger:j,defaultIndex:A,portal:N,axisId:T}=r,P=Nt(),R=typeof A=="number"?String(A):A;x.useEffect(()=>{P(Wpe({shared:O,trigger:j,axisId:T,active:a,defaultIndex:R}))},[P,O,j,T,a,R]);var D=B0(),K=I6(),L=qpe(O),{activeIndex:I,isActive:G}=(t=Te(re=>cge(re,L,j,R)))!==null&&t!==void 0?t:{},z=Te(re=>lge(re,L,j,R)),V=Te(re=>YH(re,L,j,R)),k=Te(re=>sge(re,L,j,R)),F=z,q=kge(),U=(n=a??G)!==null&&n!==void 0?n:!1,[Y,B]=I8([F,U]),$=L==="axis"?V:void 0;Jge(L,j,k,$,I,U);var X=N??q;if(X==null||D==null||L==null)return null;var Z=F??VI;U||(Z=VI),u&&Z.length&&(Z=T8(Z.filter(re=>re.value!=null&&(re.hide!==!0||r.includeHidden)),v,rye));var ee=Z.length>0,ie=KI(KI({},r),{},{payload:Z,label:$,active:U,activeIndex:I,coordinate:k,accessibilityLayer:K}),ae=x.createElement(Rue,{allowEscapeViewBox:i,animationDuration:s,animationEasing:c,isAnimationActive:m,active:U,coordinate:k,hasPayload:ee,offset:d,position:y,reverseDirection:b,useTranslate3d:w,viewBox:D,wrapperStyle:S,lastBoundingBox:Y,innerRef:B,hasPortalFromProps:!!N},aye(f,ie));return x.createElement(x.Fragment,null,fl.createPortal(ae,X),U&&x.createElement(Mge,{cursor:E,tooltipEventType:L,coordinate:k,payload:Z,index:I}))}var ep=e=>null;ep.displayName="Cell";function oye(e,t,n){return(t=sye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sye(e){var t=lye(e,"string");return typeof t=="symbol"?t:t+""}function lye(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 cye{constructor(t){oye(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 YI(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 uye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YI(Object(n),!0).forEach(function(r){fye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fye(e,t,n){return(t=dye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dye(e){var t=hye(e,"string");return typeof t=="symbol"?t:t+""}function hye(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 mye={cacheSize:2e3,enableCache:!0},JH=uye({},mye),GI=new cye(JH.cacheSize),pye={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},XI="recharts_measurement_span";function vye(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 WI=(e,t)=>{try{var n=document.getElementById(XI);n||(n=document.createElement("span"),n.setAttribute("id",XI),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,pye,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Ph=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||$m.isSsr)return{width:0,height:0};if(!JH.enableCache)return WI(t,n);var r=vye(t,n),a=GI.get(r);if(a)return a;var i=WI(t,n);return GI.set(r,i),i},eF;function gye(e,t,n){return(t=yye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yye(e){var t=xye(e,"string");return typeof t=="symbol"?t:t+""}function xye(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 QI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ZI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,bye=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,wye=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Sye={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Eye=["cm","mm","pt","pc","in","Q","px"];function _ye(e){return Eye.includes(e)}var Ju="NaN";function jye(e,t){return e*Sye[t]}class Qn{static parse(t){var n,[,r,a]=(n=wye.exec(t))!==null&&n!==void 0?n:[];return r==null?Qn.NaN:new Qn(parseFloat(r),a??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Ri(t)&&(this.unit=""),n!==""&&!bye.test(n)&&(this.num=NaN,this.unit=""),_ye(n)&&(this.num=jye(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Qn(NaN,""):new Qn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Qn(NaN,""):new Qn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Qn(NaN,""):new Qn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Qn(NaN,""):new Qn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Ri(this.num)}}eF=Qn;gye(Qn,"NaN",new eF(NaN,""));function tF(e){if(e==null||e.includes(Ju))return Ju;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,a,i]=(n=QI.exec(t))!==null&&n!==void 0?n:[],s=Qn.parse(r??""),c=Qn.parse(i??""),f=a==="*"?s.multiply(c):s.divide(c);if(f.isNaN())return Ju;t=t.replace(QI,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,m,d,v]=(u=ZI.exec(t))!==null&&u!==void 0?u:[],y=Qn.parse(m??""),b=Qn.parse(v??""),w=d==="+"?y.add(b):y.subtract(b);if(w.isNaN())return Ju;t=t.replace(ZI,w.toString())}return t}var JI=/\(([^()]*)\)/;function Cye(e){for(var t=e,n;(n=JI.exec(t))!=null;){var[,r]=n;t=t.replace(JI,tF(r))}return t}function Oye(e){var t=e.replace(/\s+/g,"");return t=Cye(t),t=tF(t),t}function Aye(e){try{return Oye(e)}catch{return Ju}}function kS(e){var t=Aye(e.slice(5,-1));return t===Ju?"":t}var Nye=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Tye=["dx","dy","angle","className","breakAll"];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 e3(e,t){if(e==null)return{};var n,r,a=Pye(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 Pye(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 nF=/[ \f\n\r\t\v\u2028\u2029]+/,rF=e=>{var{children:t,breakAll:n,style:r}=e;try{var a=[];Yt(t)||(n?a=t.toString().split(""):a=t.toString().split(nF));var i=a.map(c=>({word:c,width:Ph(c,r).width})),s=n?0:Ph(" ",r).width;return{wordsWithComputedWidth:i,spaceWidth:s}}catch{return null}};function aF(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Mye(e){return Yt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var iF=(e,t,n,r)=>e.reduce((a,i)=>{var{word:s,width:c}=i,f=a[a.length-1];if(f&&c!=null&&(t==null||r||f.width+c+n<Number(t)))f.words.push(s),f.width+=c+n;else{var u={words:[s],width:c};a.push(u)}return a},[]),oF=e=>e.reduce((t,n)=>t.width>n.width?t:n),kye="…",t3=(e,t,n,r,a,i,s,c)=>{var f=e.slice(0,t),u=rF({breakAll:n,style:r,children:f+kye});if(!u)return[!1,[]];var m=iF(u.wordsWithComputedWidth,i,s,c),d=m.length>a||oF(m).width>Number(i);return[d,m]},Rye=(e,t,n,r,a)=>{var{maxLines:i,children:s,style:c,breakAll:f}=e,u=Oe(i),m=String(s),d=iF(t,r,n,a);if(!u||a)return d;var v=d.length>i||oF(d).width>Number(r);if(!v)return d;for(var y=0,b=m.length-1,w=0,S;y<=b&&w<=m.length-1;){var E=Math.floor((y+b)/2),O=E-1,[j,A]=t3(m,O,f,c,i,r,n,a),[N]=t3(m,E,f,c,i,r,n,a);if(!j&&!N&&(y=E+1),j&&N&&(b=E-1),!j&&N){S=A;break}w++}return S||d},n3=e=>{var t=Yt(e)?[]:e.toString().split(nF);return[{words:t,width:void 0}]},Dye=e=>{var{width:t,scaleToFit:n,children:r,style:a,breakAll:i,maxLines:s}=e;if((t||n)&&!$m.isSsr){var c,f,u=rF({breakAll:i,children:r,style:a});if(u){var{wordsWithComputedWidth:m,spaceWidth:d}=u;c=m,f=d}else return n3(r);return Rye({breakAll:i,children:r,maxLines:s,style:a},c,f,t,!!n)}return n3(r)},sF="#808080",Iye={angle:0,breakAll:!1,capHeight:"0.71em",fill:sF,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},lx=x.forwardRef((e,t)=>{var n=bn(e,Iye),{x:r,y:a,lineHeight:i,capHeight:s,fill:c,scaleToFit:f,textAnchor:u,verticalAnchor:m}=n,d=e3(n,Nye),v=x.useMemo(()=>Dye({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:f,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,f,d.style,d.width]),{dx:y,dy:b,angle:w,className:S,breakAll:E}=d,O=e3(d,Tye);if(!Di(r)||!Di(a)||v.length===0)return null;var j=Number(r)+(Oe(y)?y:0),A=Number(a)+(Oe(b)?b:0);if(!st(j)||!st(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(f&&P!=null){var R=P.width,{width:D}=d;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",k_({},br(O),{ref:t,x:j,y:A,className:ct("recharts-text",S),textAnchor:u,fill:c.includes("url")?sF:c}),v.map((K,L)=>{var I=K.words.join(E?"":" ");return x.createElement("tspan",{x:j,dy:L===0?N:i,key:"".concat(I,"-").concat(L)},I)}))});lx.displayName="Text";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 gi(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){Lye(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 Lye(e,t,n){return(t=zye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zye(e){var t=$ye(e,"string");return typeof t=="symbol"?t:t+""}function $ye(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 Bye=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:a}=e,{x:i,y:s,height:c,upperWidth:f,lowerWidth:u}=KC(t),m=i,d=i+(f-u)/2,v=(m+d)/2,y=(f+u)/2,b=m+f/2,w=c>=0?1:-1,S=w*r,E=w>0?"end":"start",O=w>0?"start":"end",j=f>=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+f/2,y:s-S,horizontalAnchor:"middle",verticalAnchor:E};return P&&(R.height=Math.max(s-P.y,0),R.width=f),R}if(n==="bottom"){var D={x:d+u/2,y:s+c+S,horizontalAnchor:"middle",verticalAnchor:O};return P&&(D.height=Math.max(P.y+P.height-(s+c),0),D.width=u),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 L={x:v+y+A,y:s+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return P&&(L.width=Math.max(P.x+P.width-L.x,0),L.height=c),L}var I=P?{width:y,height:c}:{};return n==="insideLeft"?gi({x:v+A,y:s+c/2,horizontalAnchor:T,verticalAnchor:"middle"},I):n==="insideRight"?gi({x:v+y-A,y:s+c/2,horizontalAnchor:N,verticalAnchor:"middle"},I):n==="insideTop"?gi({x:m+f/2,y:s+S,horizontalAnchor:"middle",verticalAnchor:O},I):n==="insideBottom"?gi({x:d+u/2,y:s+c-S,horizontalAnchor:"middle",verticalAnchor:E},I):n==="insideTopLeft"?gi({x:m+A,y:s+S,horizontalAnchor:T,verticalAnchor:O},I):n==="insideTopRight"?gi({x:m+f-A,y:s+S,horizontalAnchor:N,verticalAnchor:O},I):n==="insideBottomLeft"?gi({x:d+A,y:s+c-S,horizontalAnchor:T,verticalAnchor:E},I):n==="insideBottomRight"?gi({x:d+u-A,y:s+c-S,horizontalAnchor:N,verticalAnchor:E},I):n&&typeof n=="object"&&(Oe(n.x)||Pc(n.x))&&(Oe(n.y)||Pc(n.y))?gi({x:i+dr(n.x,y),y:s+dr(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},I):gi({x:b,y:s+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},I)},Uye=["labelRef"],Hye=["content"];function a3(e,t){if(e==null)return{};var n,r,a=Fye(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 Fye(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 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 Ah(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){qye(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 qye(e,t,n){return(t=Kye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kye(e){var t=Vye(e,"string");return typeof t=="symbol"?t:t+""}function Vye(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 bo(){return bo=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},bo.apply(null,arguments)}var lF=x.createContext(null),Yye=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:a,width:i,height:s,children:c}=e,f=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:a,width:i,height:s}),[t,n,r,a,i,s]);return x.createElement(lF.Provider,{value:f},c)},cF=()=>{var e=x.useContext(lF),t=B0();return e||(t?KC(t):void 0)},Gye=x.createContext(null),Xye=()=>{var e=x.useContext(Gye),t=Te(dU);return e||t},Wye=e=>{var{value:t,formatter:n}=e,r=Yt(e.children)?t:e.children;return typeof n=="function"?n(r):r},fA=e=>e!=null&&typeof e=="function",Qye=(e,t)=>{var n=Bn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Zye=(e,t,n,r,a)=>{var{offset:i,className:s}=e,{cx:c,cy:f,innerRadius:u,outerRadius:m,startAngle:d,endAngle:v,clockWise:y}=a,b=(u+m)/2,w=Qye(d,v),S=w>=0?1:-1,E,O;switch(t){case"insideStart":E=d+S*i,O=y;break;case"insideEnd":E=v-S*i,O=!y;break;case"end":E=v+S*i,O=y;break;default:throw new Error("Unsupported position ".concat(t))}O=w<=0?O:!O;var j=vn(c,f,b,E),A=vn(c,f,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=Yt(e.id)?Fh("recharts-radial-line-"):e.id;return x.createElement("text",bo({},r,{dominantBaseline:"central",className:ct("recharts-radial-bar-label",s)}),x.createElement("defs",null,x.createElement("path",{id:T,d:N})),x.createElement("textPath",{xlinkHref:"#".concat(T)},n))},Jye=(e,t,n)=>{var{cx:r,cy:a,innerRadius:i,outerRadius:s,startAngle:c,endAngle:f}=e,u=(c+f)/2;if(n==="outside"){var{x:m,y:d}=vn(r,a,s+t,u);return{x:m,y:d,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:y,y:b}=vn(r,a,v,u);return{x:y,y:b,textAnchor:"middle",verticalAnchor:"middle"}},bg=e=>e!=null&&"cx"in e&&Oe(e.cx),e0e={angle:0,offset:5,zIndex:gn.label,position:"middle",textBreakAll:!1};function t0e(e){if(!bg(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 Is(e){var t=bn(e,e0e),{viewBox:n,parentViewBox:r,position:a,value:i,children:s,content:c,className:f="",textBreakAll:u,labelRef:m}=t,d=Xye(),v=cF(),y=a==="center"?v:d??v,b,w,S;n==null?b=y:bg(n)?b=n:b=KC(n);var E=t0e(b);if(!b||Yt(i)&&Yt(s)&&!x.isValidElement(c)&&typeof c!="function")return null;var O=Ah(Ah({},t),{},{viewBox:b});if(x.isValidElement(c)){var{labelRef:j}=O,A=a3(O,Uye);return x.cloneElement(c,A)}if(typeof c=="function"){var{content:N}=O,T=a3(O,Hye);if(w=x.createElement(c,T),x.isValidElement(w))return w}else w=Wye(t);var P=br(t);if(bg(b)){if(a==="insideStart"||a==="insideEnd"||a==="end")return Zye(t,a,w,P,b);S=Jye(b,t.offset,t.position)}else{if(!E)return null;var R=Bye({viewBox:E,position:a,offset:t.offset,parentViewBox:bg(r)?void 0:r});S=Ah(Ah({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(Lr,{zIndex:t.zIndex},x.createElement(lx,bo({ref:m,className:ct("recharts-label",f)},P,S,{textAnchor:aF(P.textAnchor)?P.textAnchor:S.textAnchor,breakAll:u}),w))}Is.displayName="Label";var n0e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Is,bo({key:"label-implicit"},r)):Di(e)?x.createElement(Is,bo({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Is?x.cloneElement(e,Ah({key:"label-implicit"},r)):x.createElement(Is,bo({key:"label-implicit",content:e},r)):fA(e)?x.createElement(Is,bo({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Is,bo({},e,{key:"label-implicit"},r)):null};function r0e(e){var{label:t,labelRef:n}=e,r=cF();return n0e(t,r,n)||null}var a0e=["valueAccessor"],i0e=["dataKey","clockWise","id","textBreakAll","zIndex"];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 o3(e,t){if(e==null)return{};var n,r,a=o0e(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 o0e(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 s0e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Mye(t))return t},uF=x.createContext(void 0),fF=uF.Provider,dF=x.createContext(void 0),l0e=dF.Provider;function c0e(){return x.useContext(uF)}function u0e(){return x.useContext(dF)}function wg(e){var{valueAccessor:t=s0e}=e,n=o3(e,a0e),{dataKey:r,clockWise:a,id:i,textBreakAll:s,zIndex:c}=n,f=o3(n,i0e),u=c0e(),m=u0e(),d=u||m;return!d||!d.length?null:x.createElement(Lr,{zIndex:c??gn.label},x.createElement(Pn,{className:"recharts-label-list"},d.map((v,y)=>{var b,w=Yt(r)?t(v,y):Ot(v.payload,r),S=Yt(i)?{}:{id:"".concat(i,"-").concat(y)};return x.createElement(Is,Py({key:"label-".concat(y)},br(v),f,S,{fill:(b=n.fill)!==null&&b!==void 0?b:v.fill,parentViewBox:v.parentViewBox,value:w,textBreakAll:s,viewBox:v.viewBox,index:y,zIndex:0}))})))}wg.displayName="LabelList";function dA(e){var{label:t}=e;return t?t===!0?x.createElement(wg,{key:"labelList-implicit"}):x.isValidElement(t)||fA(t)?x.createElement(wg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(wg,Py({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}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)}var hF=e=>{var{cx:t,cy:n,r,className:a}=e,i=ct("recharts-dot",a);return Oe(t)&&Oe(n)&&Oe(r)?x.createElement("circle",R_({},aa(e),kC(e),{className:i,cx:t,cy:n,r})):null},mF=e=>e.graphicalItems.polarItems,f0e=se([Wt,Fm],RO),cx=se([mF,an,f0e],DO),d0e=se([cx],IO),ux=se([d0e,q0],LO),h0e=se([ux,an,cx],$O);se([ux,an,cx],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(a=>{var i,s=Ot(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:Ot(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var s3=()=>{},m0e=se([ux,an,cx,ax,Wt],FO),p0e=se([an,UO,HO,s3,m0e,s3,gt,Wt],qO),pF=se([an,gt,ux,h0e,Hm,Wt,p0e],KO),v0e=se([pF,id,El],YO),g0e=se([an,pF,v0e,Wt],XO);se([El,g0e],mU);var y0e={radiusAxis:{},angleAxis:{}},vF=mr({name:"polarAxis",initialState:y0e,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:_2e,removeRadiusAxis:j2e,addAngleAxis:C2e,removeAngleAxis:O2e}=vF.actions,x0e=vF.reducer;function gF(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}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 c3(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){b0e(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 b0e(e,t,n){return(t=w0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w0e(e){var t=S0e(e,"string");return typeof t=="symbol"?t:t+""}function S0e(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 E0e=(e,t)=>t,hA=se([mF,E0e],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),_0e=[],mA=(e,t,n)=>(n==null?void 0:n.length)===0?_0e:n,yF=se([q0,hA,mA],(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=>c3(c3({},t.presentationProps),i.props))),a!=null)return a}}),j0e=se([yF,hA,mA],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,a)=>{var i,s=Ot(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:ed(s,t.dataKey),color:c,payload:r,type:t.legendType}})}),C0e=se([yF,hA,mA,Mn],(e,t,n,r)=>{if(!(t==null||e==null))return Txe({offset:r,pieSettings:t,displayedData:e,cells:n})}),RS={exports:{}},Ct={};/**
 * @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 u3;function O0e(){if(u3)return Ct;u3=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"),f=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),v=Symbol.for("react.view_transition"),y=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 f:case u:case v:return w;default:switch(w=w&&w.$$typeof,w){case s:case c:case d:case m:return w;case i:return w;default:return S}}case t:return S}}}return Ct.ContextConsumer=i,Ct.ContextProvider=s,Ct.Element=e,Ct.ForwardRef=c,Ct.Fragment=n,Ct.Lazy=d,Ct.Memo=m,Ct.Portal=t,Ct.Profiler=a,Ct.StrictMode=r,Ct.Suspense=f,Ct.SuspenseList=u,Ct.isContextConsumer=function(w){return b(w)===i},Ct.isContextProvider=function(w){return b(w)===s},Ct.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Ct.isForwardRef=function(w){return b(w)===c},Ct.isFragment=function(w){return b(w)===n},Ct.isLazy=function(w){return b(w)===d},Ct.isMemo=function(w){return b(w)===m},Ct.isPortal=function(w){return b(w)===t},Ct.isProfiler=function(w){return b(w)===a},Ct.isStrictMode=function(w){return b(w)===r},Ct.isSuspense=function(w){return b(w)===f},Ct.isSuspenseList=function(w){return b(w)===u},Ct.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===a||w===r||w===f||w===u||typeof w=="object"&&w!==null&&(w.$$typeof===d||w.$$typeof===m||w.$$typeof===s||w.$$typeof===i||w.$$typeof===c||w.$$typeof===y||w.getModuleId!==void 0)},Ct.typeOf=b,Ct}var f3;function A0e(){return f3||(f3=1,RS.exports=O0e()),RS.exports}var N0e=A0e(),d3=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",h3=null,DS=null,xF=e=>{if(e===h3&&Array.isArray(DS))return DS;var t=[];return x.Children.forEach(e,n=>{Yt(n)||(N0e.isFragment(n)?t=t.concat(xF(n.props.children)):t.push(n))}),DS=t,h3=e,t};function pA(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(a=>d3(a)):r=[d3(t)],xF(e).forEach(a=>{var i=Tc(a,"type.displayName")||Tc(a,"type.name");i&&r.indexOf(i)!==-1&&n.push(a)}),n}var bF=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,IS={},m3;function T0e(){return m3||(m3=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,p3;function P0e(){return p3||(p3=1,LS=T0e().isPlainObject),LS}var M0e=P0e();const k0e=Za(M0e);var v3,g3,y3,x3,b3;function w3(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 S3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w3(Object(n),!0).forEach(function(r){R0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R0e(e,t,n){return(t=D0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D0e(e){var t=I0e(e,"string");return typeof t=="symbol"?t:t+""}function I0e(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 My(){return My=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},My.apply(null,arguments)}function gh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var E3=(e,t,n,r,a)=>{var i=n-r,s;return s=tn(v3||(v3=gh(["M ",",",""])),e,t),s+=tn(g3||(g3=gh(["L ",",",""])),e+n,t),s+=tn(y3||(y3=gh(["L ",",",""])),e+n-i/2,t+a),s+=tn(x3||(x3=gh(["L ",",",""])),e+n-i/2-r,t+a),s+=tn(b3||(b3=gh(["L ",","," Z"])),e,t),s},L0e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},z0e=e=>{var t=bn(e,L0e),{x:n,y:r,upperWidth:a,lowerWidth:i,height:s,className:c}=t,{animationEasing:f,animationDuration:u,animationBegin:m,isUpdateAnimationActive:d}=t,v=x.useRef(null),[y,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=Um(e,"trapezoid-");if(x.useEffect(()=>{if(v.current&&v.current.getTotalLength)try{var z=v.current.getTotalLength();z&&b(z)}catch{}},[]),n!==+n||r!==+r||a!==+a||i!==+i||s!==+s||a===0&&i===0||s===0)return null;var N=ct("recharts-trapezoid",c);if(!d)return x.createElement("g",null,x.createElement("path",My({},br(t),{className:N,d:E3(n,r,a,i,s)})));var T=w.current,P=S.current,R=E.current,D=O.current,K=j.current,L="0px ".concat(y===-1?1:y,"px"),I="".concat(y,"px ").concat(y,"px"),G=L6(["strokeDasharray"],u,f);return x.createElement(Bm,{animationId:A,key:A,canBegin:y>0,duration:u,easing:f,isActive:d,begin:m},z=>{var V=Ht(T,a,z),k=Ht(P,i,z),F=Ht(R,s,z),q=Ht(D,n,z),U=Ht(K,r,z);v.current&&(w.current=V,S.current=k,E.current=F,O.current=q,j.current=U);var Y=z>0?{transition:G,strokeDasharray:I}:{strokeDasharray:L};return x.createElement("path",My({},br(t),{className:N,d:E3(q,U,V,k,F),ref:v,style:S3(S3({},Y),t.style)}))})},$0e=["option","shapeType","activeClassName","inActiveClassName"];function B0e(e,t){if(e==null)return{};var n,r,a=U0e(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 U0e(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 _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 ky(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){H0e(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 H0e(e,t,n){return(t=F0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F0e(e){var t=q0e(e,"string");return typeof t=="symbol"?t:t+""}function q0e(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 K0e(e,t){return ky(ky({},t),e)}function V0e(e,t){return e==="symbols"}function j3(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(U6,n);case"trapezoid":return x.createElement(z0e,n);case"sector":return x.createElement(K6,n);case"symbols":if(V0e(t))return x.createElement(MC,n);break;case"curve":return x.createElement(WC,n);default:return null}}function Y0e(e){return x.isValidElement(e)?e.props:e}function vA(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:a="recharts-shape"}=e,i=B0e(e,$0e),s;if(x.isValidElement(t))s=x.cloneElement(t,ky(ky({},i),Y0e(t)));else if(typeof t=="function")s=t(i,i.index);else if(k0e(t)&&typeof t!="boolean"){var c=K0e(t,i);s=x.createElement(j3,{shapeType:n,elementProps:c})}else{var f=i;s=x.createElement(j3,{shapeType:n,elementProps:f})}return i.isActive?x.createElement(Pn,{className:r},s):x.createElement(Pn,{className:a},s)}var gA=(e,t,n)=>{var r=Nt();return(a,i)=>s=>{e==null||e(a,i,s),r(OH({activeIndex:String(i),activeDataKey:t,activeCoordinate:a.tooltipPosition,activeGraphicalItemId:n}))}},yA=e=>{var t=Nt();return(n,r)=>a=>{e==null||e(n,r,a),t(Qpe())}},xA=(e,t,n)=>{var r=Nt();return(a,i)=>s=>{e==null||e(a,i,s),r(Zpe({activeIndex:String(i),activeDataKey:t,activeCoordinate:a.tooltipPosition,activeGraphicalItemId:n}))}};function bA(e){var{tooltipEntrySettings:t}=e,n=Nt(),r=pr(),a=x.useRef(null);return x.useLayoutEffect(()=>{r||(a.current===null?n(Ype(t)):a.current!==t&&n(Gpe({prev:a.current,next:t})),a.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{a.current&&(n(Xpe(a.current)),a.current=null)},[n]),null}function wF(e){var{legendPayload:t}=e,n=Nt(),r=pr(),a=x.useRef(null);return x.useLayoutEffect(()=>{r||(a.current===null?n(P6(t)):a.current!==t&&n(M6({prev:a.current,next:t})),a.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{a.current&&(n(k6(a.current)),a.current=null)},[n]),null}function G0e(e){var{legendPayload:t}=e,n=Nt(),r=Te(gt),a=x.useRef(null);return x.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(a.current===null?n(P6(t)):a.current!==t&&n(M6({prev:a.current,next:t})),a.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{a.current&&(n(k6(a.current)),a.current=null)},[n]),null}var zS,X0e=()=>{var[e]=x.useState(()=>Fh("uid-"));return e},W0e=(zS=rj.useId)!==null&&zS!==void 0?zS:X0e;function Q0e(e,t){var n=W0e();return t||(e?"".concat(e,"-").concat(n):n)}var Z0e=x.createContext(void 0),wA=e=>{var{id:t,type:n,children:r}=e,a=Q0e("recharts-".concat(n),t);return x.createElement(Z0e.Provider,{value:a},r(a))},J0e={cartesianItems:[],polarItems:[]},SF=mr({name:"graphicalItems",initialState:J0e,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:zt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,a=ja(e).cartesianItems.indexOf(n);a>-1&&(e.cartesianItems[a]=r)},prepare:zt()},removeCartesianGraphicalItem:{reducer(e,t){var n=ja(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:zt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:zt()},removePolarGraphicalItem:{reducer(e,t){var n=ja(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:zt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,a=ja(e).polarItems.indexOf(n);a>-1&&(e.polarItems[a]=r)},prepare:zt()}}}),{addCartesianGraphicalItem:exe,replaceCartesianGraphicalItem:txe,removeCartesianGraphicalItem:nxe,addPolarGraphicalItem:rxe,removePolarGraphicalItem:axe,replacePolarGraphicalItem:ixe}=SF.actions,oxe=SF.reducer,sxe=e=>{var t=Nt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(exe(e)):n.current!==e&&t(txe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(nxe(n.current)),n.current=null)},[t]),null},EF=x.memo(sxe),lxe=e=>{var t=Nt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(rxe(e)):n.current!==e&&t(ixe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(axe(n.current)),n.current=null)},[t]),null},cxe=x.memo(lxe),uxe=["key"],fxe=["onMouseEnter","onClick","onMouseLeave"],dxe=["id"],hxe=["id"];function ll(){return ll=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},ll.apply(null,arguments)}function fx(e,t){if(e==null)return{};var n,r,a=mxe(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 mxe(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 Ft(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){pxe(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 pxe(e,t,n){return(t=vxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vxe(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)}function yxe(e){var t=x.useMemo(()=>pA(e.children,ep),[e.children]),n=Te(r=>j0e(r,e.id,t));return n==null?null:x.createElement(G0e,{legendPayload:n})}function xxe(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 bxe=x.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:a,strokeWidth:i,fill:s,name:c,hide:f,tooltipType:u,id:m,activeShape:d}=e,v=xxe(d),y=r.map(w=>{var S=w.tooltipPayload;return v==null||S==null?S:S.map(E=>Ft(Ft({},E),{},{color:v,fill:v}))}),b={dataDefinedOnItem:y,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:ed(c,t),hide:f,type:u,color:s,unit:"",graphicalItemId:m}};return x.createElement(bA,{tooltipEntrySettings:b})}),wxe=(e,t)=>e>t?"start":e<t?"end":"middle",Sxe=(e,t,n)=>dr(typeof t=="function"?t(e):t,n,n*.8),Exe=(e,t,n)=>{var{top:r,left:a,width:i,height:s}=t,c=H6(i,s),f=a+dr(e.cx,i,i/2),u=r+dr(e.cy,s,s/2),m=dr(e.innerRadius,c,0),d=Sxe(n,e.outerRadius,c),v=e.maxRadius||Math.sqrt(i*i+s*s)/2;return{cx:f,cy:u,innerRadius:m,outerRadius:d,maxRadius:v}},_xe=(e,t)=>{var n=Bn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},jxe=(e,t)=>{if(x.isValidElement(e))return x.cloneElement(e,t);if(typeof e=="function")return e(t);var n=ct("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,a=fx(t,uxe);return x.createElement(WC,ll({},a,{type:"linear",className:n}))},Cxe=(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=ct("recharts-pie-label-text",gF(e));return x.createElement(lx,ll({},t,{alignmentBaseline:"middle",className:a}),r)};function Oxe(e){var{sectors:t,props:n,showLabels:r}=e,{label:a,labelLine:i,dataKey:s}=n;if(!r||!a||!t)return null;var c=aa(n),f=Ac(a),u=Ac(i),m=typeof a=="object"&&"offsetRadius"in a&&typeof a.offsetRadius=="number"&&a.offsetRadius||20,d=t.map((v,y)=>{var b=(v.startAngle+v.endAngle)/2,w=vn(v.cx,v.cy,v.outerRadius+m,b),S=Ft(Ft(Ft(Ft({},c),v),{},{stroke:"none"},f),{},{index:y,textAnchor:wxe(w.x,v.cx)},w),E=Ft(Ft(Ft(Ft({},c),v),{},{fill:"none",stroke:v.fill},u),{},{index:y,points:[vn(v.cx,v.cy,v.outerRadius,b),w],key:"line"});return x.createElement(Lr,{zIndex:gn.label,key:"label-".concat(v.startAngle,"-").concat(v.endAngle,"-").concat(v.midAngle,"-").concat(y)},x.createElement(Pn,null,i&&jxe(i,E),Cxe(a,S,Ot(v,s))))});return x.createElement(Pn,{className:"recharts-pie-labels"},d)}function Axe(e){var{sectors:t,props:n,showLabels:r}=e,{label:a}=n;return typeof a=="object"&&a!=null&&"position"in a?x.createElement(dA,{label:a}):x.createElement(Oxe,{sectors:t,props:n,showLabels:r})}function Nxe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:a,shape:i,id:s}=e,c=Te(sl),f=Te(iA),u=Te(HH),{onMouseEnter:m,onClick:d,onMouseLeave:v}=a,y=fx(a,fxe),b=gA(m,a.dataKey,s),w=yA(v),S=xA(d,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=u==null||u===s,A=String(O)===c&&(f==null||a.dataKey===f)&&j,N=c?r:null,T=n&&A?n:N,P=Ft(Ft({},E),{},{stroke:E.stroke,tabIndex:-1,[v6]:O,[g6]:s});return x.createElement(Pn,ll({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"},km(y,E,O),{onMouseEnter:b(E,O),onMouseLeave:w(E,O),onClick:S(E,O)}),x.createElement(vA,ll({option:i??T,index:O,shapeType:"sector",isActive:A},P)))}))}function Txe(e){var t,{pieSettings:n,displayedData:r,cells:a,offset:i}=e,{cornerRadius:s,startAngle:c,endAngle:f,dataKey:u,nameKey:m,tooltipType:d}=n,v=Math.abs(n.minAngle),y=_xe(c,f),b=Math.abs(y),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(T=>Ot(T,u,0)!==0).length,E=(b>=360?S:S-1)*w,O=b-S*v-E,j=r.reduce((T,P)=>{var R=Ot(P,u,0);return T+(Oe(R)?R:0)},0),A;if(j>0){var N;A=r.map((T,P)=>{var R=Ot(T,u,0),D=Ot(T,m,P),K=Exe(n,i,T),L=(Oe(R)?R:0)/j,I,G=Ft(Ft({},T),a&&a[P]&&a[P].props),z=G!=null&&"fill"in G&&typeof G.fill=="string"?G.fill:n.fill;P?I=N.endAngle+Bn(y)*w*(R!==0?1:0):I=c;var V=I+Bn(y)*((R!==0?v:0)+L*O),k=(I+V)/2,F=(K.innerRadius+K.outerRadius)/2,q=[{name:D,value:R,payload:G,dataKey:u,type:d,color:z,fill:z,graphicalItemId:n.id}],U=vn(K.cx,K.cy,F,k);return N=Ft(Ft(Ft(Ft({},n.presentationProps),{},{percent:L,cornerRadius:typeof s=="string"?parseFloat(s):s,name:D,tooltipPayload:q,midAngle:k,middleRadius:F,tooltipPosition:U},G),K),{},{value:R,dataKey:u,startAngle:I,endAngle:V,payload:G,paddingAngle:Bn(y)*w}),N})}return A}function Pxe(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(l0e,{value:t?a:void 0},r)}function Mxe(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:a,isAnimationActive:i,animationBegin:s,animationDuration:c,animationEasing:f,activeShape:u,inactiveShape:m,onAnimationStart:d,onAnimationEnd:v}=t,y=Um(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 d=="function"&&d(),S(!0)},[d]);return x.createElement(Pxe,{showLabels:!w,sectors:a},x.createElement(Bm,{animationId:y,begin:s,duration:c,isActive:i,easing:f,onAnimationStart:O,onAnimationEnd:E,key:y},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],L=D>0?Tc(R,"paddingAngle",0):0;if(K){var I=Ht(K.endAngle-K.startAngle,R.endAngle-R.startAngle,j),G=Ft(Ft({},R),{},{startAngle:P+L,endAngle:P+I+L});N.push(G),P=G.endAngle}else{var{endAngle:z,startAngle:V}=R,k=Ht(0,z-V,j),F=Ft(Ft({},R),{},{startAngle:P+L,endAngle:P+k+L});N.push(F),P=F.endAngle}}),n.current=N,x.createElement(Pn,null,x.createElement(Nxe,{sectors:N,activeShape:u,inactiveShape:m,allOtherPieProps:t,shape:t.shape,id:r}))}),x.createElement(Axe,{showLabels:!w,sectors:a,props:t}),t.children)}var kxe={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:gn.area};function Rxe(e){var{id:t}=e,n=fx(e,dxe),{hide:r,className:a,rootTabIndex:i}=e,s=x.useMemo(()=>pA(e.children,ep),[e.children]),c=Te(m=>C0e(m,t,s)),f=x.useRef(null),u=ct("recharts-pie",a);return r||c==null?(f.current=null,x.createElement(Pn,{tabIndex:i,className:u})):x.createElement(Lr,{zIndex:e.zIndex},x.createElement(bxe,{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(Pn,{tabIndex:i,className:u},x.createElement(Mxe,{props:Ft(Ft({},n),{},{sectors:c}),previousSectorsRef:f,id:t})))}function Dxe(e){var t=bn(e,kxe),{id:n}=t,r=fx(t,hxe),a=aa(r);return x.createElement(wA,{id:n,type:"pie"},i=>x.createElement(x.Fragment,null,x.createElement(cxe,{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(yxe,ll({},r,{id:i})),x.createElement(Rxe,ll({},r,{id:i}))))}var _F=Dxe;_F.displayName="Pie";var Ixe=["points"];function O3(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?O3(Object(n),!0).forEach(function(r){Lxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lxe(e,t,n){return(t=zxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zxe(e){var t=$xe(e,"string");return typeof t=="symbol"?t:t+""}function $xe(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 Ry(){return Ry=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},Ry.apply(null,arguments)}function Bxe(e,t){if(e==null)return{};var n,r,a=Uxe(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 Uxe(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 Hxe(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=ct(r,typeof t!="boolean"?t.className:""),i=n??{},{points:s}=i,c=Bxe(i,Ixe);return x.createElement(hF,Ry({},c,{className:a}))}function Fxe(e,t){return e==null?!1:t?!0:e.length===1}function qxe(e){var{points:t,dot:n,className:r,dotClassName:a,dataKey:i,baseProps:s,needClip:c,clipPathId:f,zIndex:u=gn.scatter}=e;if(!Fxe(t,n))return null;var m=bF(n),d=_ie(n),v=t.map((b,w)=>{var S,E,O=$S($S($S({r:3},s),d),{},{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(Hxe,{key:"dot-".concat(w),option:n,dotProps:O,className:a})}),y={};return c&&f!=null&&(y.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(f,")")),x.createElement(Lr,{zIndex:u},x.createElement(Pn,Ry({className:r},y),v))}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 N3(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){Kxe(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 Kxe(e,t,n){return(t=Vxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vxe(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)}var jF=0,Gxe={xAxis:{},yAxis:{},zAxis:{}},CF=mr({name:"cartesianAxis",initialState:Gxe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:zt()},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:zt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:zt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:zt()},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:zt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:zt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:zt()},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:zt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:zt()},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]=N3(N3({},a),{},{width:r,widthHistory:c})}}}}),{addXAxis:Xxe,replaceXAxis:Wxe,removeXAxis:Qxe,addYAxis:Zxe,replaceYAxis:Jxe,removeYAxis:ebe,addZAxis:A2e,replaceZAxis:N2e,removeZAxis:T2e,updateYAxisWidth:tbe}=CF.actions,nbe=CF.reducer,rbe=se([Mn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),abe=se([rbe,Ho,Fo],(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)}}),SA=()=>Te(abe),ibe=()=>Te(Vve);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 BS(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){obe(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 obe(e,t,n){return(t=sbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sbe(e){var t=lbe(e,"string");return typeof t=="symbol"?t:t+""}function lbe(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 cbe=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},f=BS(BS(BS({},c),Ac(a)),kC(a)),u;return x.isValidElement(a)?u=x.cloneElement(a,f):typeof a=="function"?u=a(f):u=x.createElement(hF,f),x.createElement(Pn,{className:"recharts-active-dot",clipPath:s},u)};function ube(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:a,clipPath:i,zIndex:s=gn.activeDot}=e,c=Te(sl),f=ibe();if(t==null||f==null)return null;var u=t.find(m=>f.includes(m.payload));return Yt(u)?null:x.createElement(Lr,{zIndex:s},x.createElement(cbe,{point:u,childIndex:Number(c),mainColor:n,dataKey:a,activeDot:r,clipPath:i}))}var P3=(e,t,n)=>{var r=n??e;if(!Yt(r))return dr(r,t,0)},fbe=(e,t,n)=>{var r={},a=e.filter(G0),i=e.filter(u=>u.stackId==null),s=a.reduce((u,m)=>{var d=u[m.stackId];return d==null&&(d=[]),d.push(m),u[m.stackId]=d,u},r),c=Object.entries(s).map(u=>{var m,[d,v]=u,y=v.map(w=>w.dataKey),b=P3(t,n,(m=v[0])===null||m===void 0?void 0:m.barSize);return{stackId:d,dataKeys:y,barSize:b}}),f=i.map(u=>{var m=[u.dataKey].filter(v=>v!=null),d=P3(t,n,u.barSize);return{stackId:void 0,dataKeys:m,barSize:d}});return[...c,...f]};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 Zv(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){dbe(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 dbe(e,t,n){return(t=hbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hbe(e){var t=mbe(e,"string");return typeof t=="symbol"?t:t+""}function mbe(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 pbe(e,t,n,r,a){var i,s=r.length;if(!(s<1)){var c=dr(e,n,0,!0),f,u=[];if(st((i=r[0])===null||i===void 0?void 0:i.barSize)){var m=!1,d=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&&d>0&&(m=!0,d*=.9,v=s*d);var y=(n-v)/2>>0,b={offset:y-c,size:0};f=r.reduce((O,j)=>{var A,N={stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:b.offset+b.size+c,size:m?d:(A=j.barSize)!==null&&A!==void 0?A:0}},T=[...O,N];return b=N.position,T},u)}else{var w=dr(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=st(a)?Math.min(S,a):S;f=r.reduce((O,j,A)=>[...O,{stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:w+(S+c)*A+(S-E)/2,size:E}}],u)}return f}}var vbe=(e,t,n,r,a,i,s)=>{var c=Yt(s)?t:s,f=pbe(n,r,a!==i?a:i,e,c);return a!==i&&f!=null&&(f=f.map(u=>Zv(Zv({},u),{},{position:Zv(Zv({},u.position),{},{offset:u.position.offset-a/2})}))),f},gbe=(e,t)=>{var n=sO(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)}}}},ybe=(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 xbe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&st(e.zIndex)?e.zIndex:t}var OF=e=>{var{chartData:t}=e,n=Nt(),r=pr();return x.useEffect(()=>r?()=>{}:(n(HI(t)),()=>{n(HI(void 0))}),[t,n,r]),null},k3={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},AF=mr({name:"brush",initialState:k3,reducers:{setBrushSettings(e,t){return t.payload==null?k3:t.payload}}}),{setBrushSettings:P2e}=AF.actions,bbe=AF.reducer;function wbe(e){return(e%180+180)%180}var Sbe=function(t){var{width:n,height:r}=t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=wbe(a),s=i*Math.PI/180,c=Math.atan(r/n),f=s>c&&s<Math.PI-c?r/Math.sin(s):n/Math.cos(s);return Math.abs(f)},Ebe={dots:[],areas:[],lines:[]},NF=mr({name:"referenceElements",initialState:Ebe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ja(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=ja(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=ja(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:M2e,removeDot:k2e,addArea:R2e,removeArea:D2e,addLine:I2e,removeLine:L2e}=NF.actions,_be=NF.reducer,jbe=x.createContext(void 0),Cbe=e=>{var{children:t}=e,[n]=x.useState("".concat(Fh("recharts"),"-clip")),r=SA();if(r==null)return null;var{x:a,y:i,width:s,height:c}=r;return x.createElement(jbe.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 TF(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 Obe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Sbe(r,n)}function Abe(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 nm(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 Nbe(e,t){return TF(e,t+1)}function Tbe(e,t,n,r,a){for(var i=(r||[]).slice(),{start:s,end:c}=t,f=0,u=1,m=s,d=function(){var b=r==null?void 0:r[f];if(b===void 0)return{v:TF(r,u)};var w=f,S,E=()=>(S===void 0&&(S=n(b,w)),S),O=b.coordinate,j=f===0||nm(e,O,E,m,c);j||(f=0,m=s,u+=1),j&&(m=O+e*(E()/2+a),f+=u)},v;u<=i.length;)if(v=d(),v)return v.v;return[]}function Pbe(e,t,n,r,a){var i=(r||[]).slice(),s=i.length;if(s===0)return[];for(var{start:c,end:f}=t,u=1;u<=s;u++){for(var m=(s-1)%u,d=c,v=!0,y=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||nm(e,R,P,d,f);if(!D)return v=!1,1;D&&(d=R+e*(P()/2+a))},b,w=m;w<s&&(b=y(),!(b!==0&&b===1));w+=u);if(v){for(var S=[],E=m;E<s;E+=u){var O=r[E];O!=null&&S.push(O)}return S}}return[]}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 cr(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){Mbe(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 Mbe(e,t,n){return(t=kbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kbe(e){var t=Rbe(e,"string");return typeof t=="symbol"?t:t+""}function Rbe(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 Dbe(e,t,n,r,a){for(var i=(r||[]).slice(),s=i.length,{start:c}=t,{end:f}=t,u=function(v){var y=i[v];if(y==null)return 1;var b=y,w,S=()=>(w===void 0&&(w=n(y,v)),w);if(v===s-1){var E=e*(b.coordinate+e*S()/2-f);i[v]=b=cr(cr({},b),{},{tickCoord:E>0?b.coordinate-E*e:b.coordinate})}else i[v]=b=cr(cr({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var O=nm(e,b.tickCoord,S,c,f);O&&(f=b.tickCoord-e*(S()/2+a),i[v]=cr(cr({},b),{},{isShow:!0}))}},m=s-1;m>=0;m--)u(m);return i}function Ibe(e,t,n,r,a,i){var s=(r||[]).slice(),c=s.length,{start:f,end:u}=t;if(i){var m=r[c-1];if(m!=null){var d=n(m,c-1),v=e*(m.coordinate+e*d/2-u);if(s[c-1]=m=cr(cr({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate}),m.tickCoord!=null){var y=nm(e,m.tickCoord,()=>d,f,u);y&&(u=m.tickCoord-e*(d/2+a),s[c-1]=cr(cr({},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-f);s[O]=A=cr(cr({},A),{},{tickCoord:P<0?A.coordinate-P*e:A.coordinate})}else s[O]=A=cr(cr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var R=nm(e,A.tickCoord,T,f,u);R&&(f=A.tickCoord+e*(T()/2+a),s[O]=cr(cr({},A),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return s}function EA(e,t,n){var{tick:r,ticks:a,viewBox:i,minTickGap:s,orientation:c,interval:f,tickFormatter:u,unit:m,angle:d}=e;if(!a||!a.length||!r)return[];if(Oe(f)||$m.isSsr){var v;return(v=Nbe(a,Oe(f)?f:0))!==null&&v!==void 0?v:[]}var y=[],b=c==="top"||c==="bottom"?"width":"height",w=m&&b==="width"?Ph(m,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(N,T)=>{var P=typeof u=="function"?u(N.value,T):N.value;return b==="width"?Obe(Ph(P,{fontSize:t,letterSpacing:n}),w,d):Ph(P,{fontSize:t,letterSpacing:n})[b]},E=a[0],O=a[1],j=a.length>=2&&E!=null&&O!=null?Bn(O.coordinate-E.coordinate):1,A=Abe(i,j,b);return f==="equidistantPreserveStart"?Tbe(j,A,S,a,s):f==="equidistantPreserveEnd"?Pbe(j,A,S,a,s):(f==="preserveStart"||f==="preserveStartEnd"?y=Ibe(j,A,S,a,s,f==="preserveStartEnd"):y=Dbe(j,A,S,a,s),y.filter(N=>N.isShow))}var Lbe=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 d=m.getBoundingClientRect();d.width>s&&(s=d.width)}});var c=n?n.getBoundingClientRect().width:0,f=a+i,u=s+f+c+(n?r:0);return Math.round(u)}return 0},zbe={xAxis:{},yAxis:{}},PF=mr({name:"renderedTicks",initialState:zbe,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:$be,removeRenderedTicks:Bbe}=PF.actions,Ube=PF.reducer,Hbe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Fbe(e,t){if(e==null)return{};var n,r,a=qbe(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 qbe(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 Lc(){return Lc=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},Lc.apply(null,arguments)}function D3(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 en(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D3(Object(n),!0).forEach(function(r){Kbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kbe(e,t,n){return(t=Vbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vbe(e){var t=Ybe(e,"string");return typeof t=="symbol"?t:t+""}function Ybe(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 Oo={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:gn.axis};function Gbe(e){var{x:t,y:n,width:r,height:a,orientation:i,mirror:s,axisLine:c,otherSvgProps:f}=e;if(!c)return null;var u=en(en(en({},f),aa(c)),{},{fill:"none"});if(i==="top"||i==="bottom"){var m=+(i==="top"&&!s||i==="bottom"&&s);u=en(en({},u),{},{x1:t,y1:n+m*a,x2:t+r,y2:n+m*a})}else{var d=+(i==="left"&&!s||i==="right"&&s);u=en(en({},u),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+a})}return x.createElement("line",Lc({},u,{className:ct("recharts-cartesian-axis-line",Tc(c,"className"))}))}function Xbe(e,t,n,r,a,i,s,c,f){var u,m,d,v,y,b,w=c?-1:1,S=e.tickSize||s,E=Oe(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":u=m=e.coordinate,v=n+ +!c*a,d=v-w*S,b=d-w*f,y=E;break;case"left":d=v=e.coordinate,m=t+ +!c*r,u=m-w*S,y=u-w*f,b=E;break;case"right":d=v=e.coordinate,m=t+ +c*r,u=m+w*S,y=u+w*f,b=E;break;default:u=m=e.coordinate,v=n+ +c*a,d=v+w*S,b=d+w*f,y=E;break}return{line:{x1:u,y1:d,x2:m,y2:v},tick:{x:y,y:b}}}function Wbe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Qbe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Zbe(e){var{option:t,tickProps:n,value:r}=e,a,i=ct(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))a=x.cloneElement(t,en(en({},n),{},{className:i}));else if(typeof t=="function")a=t(en(en({},n),{},{className:i}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=ct(s,gF(t))),a=x.createElement(lx,Lc({},n,{className:s}),r)}return a}function Jbe(e){var{ticks:t,axisType:n,axisId:r}=e,a=Nt();return x.useEffect(()=>{if(r==null||n==null)return bl;var i=t.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return a($be({ticks:i,axisId:r,axisType:n})),()=>{a(Bbe({axisId:r,axisType:n}))}},[a,t,r,n]),null}var ewe=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:a,stroke:i,tickFormatter:s,unit:c,padding:f,tickTextProps:u,orientation:m,mirror:d,x:v,y,width:b,height:w,tickSize:S,tickMargin:E,fontSize:O,letterSpacing:j,getTicksConfig:A,events:N,axisType:T,axisId:P}=e,R=EA(en(en({},A),{},{ticks:n}),O,j),D=aa(A),K=Ac(r),L=aF(D.textAnchor)?D.textAnchor:Wbe(m,d),I=Qbe(m,d),G={};typeof a=="object"&&(G=a);var z=en(en({},D),{},{fill:"none"},G),V=R.map(q=>en({entry:q},Xbe(q,v,y,b,w,m,S,d,E))),k=V.map(q=>{var{entry:U,line:Y}=q;return x.createElement(Pn,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},a&&x.createElement("line",Lc({},z,Y,{className:ct("recharts-cartesian-axis-tick-line",Tc(a,"className"))})))}),F=V.map((q,U)=>{var Y,B,{entry:$,tick:X}=q,Z=en(en(en(en({verticalAnchor:I},D),{},{textAnchor:L,stroke:"none",fill:i},X),{},{index:U,payload:$,visibleTicksCount:R.length,tickFormatter:s,padding:f},u),{},{angle:(Y=(B=u==null?void 0:u.angle)!==null&&B!==void 0?B:D.angle)!==null&&Y!==void 0?Y:0}),ee=en(en({},Z),K);return x.createElement(Pn,Lc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat($.value,"-").concat($.coordinate,"-").concat($.tickCoord)},km(N,$,U)),r&&x.createElement(Zbe,{option:r,tickProps:ee,value:"".concat(typeof s=="function"?s($.value,U):$.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(T,"-ticks")},x.createElement(Jbe,{ticks:R,axisId:P,axisType:T}),F.length>0&&x.createElement(Lr,{zIndex:gn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(T,"-tick-labels"),ref:t},F)),k.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(T,"-tick-lines")},k))}),twe=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:a,className:i,hide:s,ticks:c,axisType:f,axisId:u}=e,m=Fbe(e,Hbe),[d,v]=x.useState(""),[y,b]=x.useState(""),w=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var E;return Lbe({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!==d||T!==y)&&(v(N),b(T))}}},[d,y]);return s||r!=null&&r<=0||a!=null&&a<=0?null:x.createElement(Lr,{zIndex:e.zIndex},x.createElement(Pn,{className:ct("recharts-cartesian-axis",i)},x.createElement(Gbe,{x:e.x,y:e.y,width:r,height:a,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:aa(e)}),x.createElement(ewe,{ref:S,axisType:f,events:m,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:y,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:u}),x.createElement(Yye,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(r0e,{label:e.label,labelRef:e.labelRef}),e.children)))}),_A=x.forwardRef((e,t)=>{var n=bn(e,Oo);return x.createElement(twe,Lc({},n,{ref:t}))});_A.displayName="CartesianAxis";var nwe=["x1","y1","x2","y2","key"],rwe=["offset"],awe=["xAxisId","yAxisId"],iwe=["xAxisId","yAxisId"];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 fr(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){owe(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 owe(e,t,n){return(t=swe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function swe(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 oc(){return oc=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},oc.apply(null,arguments)}function Dy(e,t){if(e==null)return{};var n,r,a=cwe(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 cwe(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 uwe=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 MF(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:f,key:u}=n,m=Dy(n,nwe),d=(a=aa(m))!==null&&a!==void 0?a:{},{offset:v}=d,y=Dy(d,rwe);r=x.createElement("line",oc({},y,{x1:i,y1:s,x2:c,y2:f,fill:"none",key:u}))}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=Dy(e,awe),f=a.map((u,m)=>{var d=fr(fr({},c),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(m),index:m});return x.createElement(MF,{key:"line-".concat(m),option:r,lineItemProps:d})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},f)}function dwe(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=Dy(e,iwe),f=a.map((u,m)=>{var d=fr(fr({},c),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(m),index:m});return x.createElement(MF,{option:r,lineItemProps:d,key:"line-".concat(m)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},f)}function hwe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:a,width:i,height:s,horizontalPoints:c,horizontal:f=!0}=e;if(!f||!t||!t.length||c==null)return null;var u=c.map(d=>Math.round(d+a-a)).sort((d,v)=>d-v);a!==u[0]&&u.unshift(0);var m=u.map((d,v)=>{var y=u[v+1],b=y==null,w=b?a+s-d:y-d;if(w<=0)return null;var S=v%t.length;return x.createElement("rect",{key:"react-".concat(v),y:d,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 mwe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:a,y:i,width:s,height:c,verticalPoints:f}=e;if(!t||!n||!n.length)return null;var u=f.map(d=>Math.round(d+a-a)).sort((d,v)=>d-v);a!==u[0]&&u.unshift(0);var m=u.map((d,v)=>{var y=u[v+1],b=y==null,w=b?a+s-d:y-d;if(w<=0)return null;var S=v%n.length;return x.createElement("rect",{key:"react-".concat(v),x:d,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 pwe=(e,t)=>{var{xAxis:n,width:r,height:a,offset:i}=e;return h6(EA(fr(fr(fr({},Oo),n),{},{ticks:m6(n),viewBox:{x:0,y:0,width:r,height:a}})),i.left,i.left+i.width,t)},vwe=(e,t)=>{var{yAxis:n,width:r,height:a,offset:i}=e;return h6(EA(fr(fr(fr({},Oo),n),{},{ticks:m6(n),viewBox:{x:0,y:0,width:r,height:a}})),i.top,i.top+i.height,t)},gwe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:gn.grid};function jA(e){var t=VC(),n=YC(),r=w6(),a=fr(fr({},bn(e,gwe)),{},{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:f,width:u,height:m,syncWithTicks:d,horizontalValues:v,verticalValues:y}=a,b=pr(),w=Te(D=>NI(D,"xAxis",i,b)),S=Te(D=>NI(D,"yAxis",s,b));if(!Ii(u)||!Ii(m)||!Oe(c)||!Oe(f))return null;var E=a.verticalCoordinatesGenerator||pwe,O=a.horizontalCoordinatesGenerator||vwe,{horizontalPoints:j,verticalPoints:A}=a;if((!j||!j.length)&&typeof O=="function"){var N=v&&v.length,T=O({yAxis:S?fr(fr({},S),{},{ticks:N?v:S.ticks}):void 0,width:t??u,height:n??m,offset:r},N?!0:d);oy(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=y&&y.length,R=E({xAxis:w?fr(fr({},w),{},{ticks:P?y:w.ticks}):void 0,width:t??u,height:n??m,offset:r},P?!0:d);oy(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof R,"]")),Array.isArray(R)&&(A=R)}return x.createElement(Lr,{zIndex:a.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(uwe,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),x.createElement(hwe,oc({},a,{horizontalPoints:j})),x.createElement(mwe,oc({},a,{verticalPoints:A})),x.createElement(fwe,oc({},a,{offset:r,horizontalPoints:j,xAxis:w,yAxis:S})),x.createElement(dwe,oc({},a,{offset:r,verticalPoints:A,xAxis:w,yAxis:S}))))}jA.displayName="CartesianGrid";var ywe={},kF=mr({name:"errorBars",initialState:ywe,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:z2e,replaceErrorBar:$2e,removeErrorBar:B2e}=kF.actions,xwe=kF.reducer,bwe=["children"];function wwe(e,t){if(e==null)return{};var n,r,a=Swe(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 Swe(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 Ewe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},_we=x.createContext(Ewe);function RF(e){var{children:t}=e,n=wwe(e,bwe);return x.createElement(_we.Provider,{value:n},t)}function CA(e,t){var n,r,a=Te(u=>Vo(u,e)),i=Te(u=>Yo(u,t)),s=(n=a==null?void 0:a.allowDataOverflow)!==null&&n!==void 0?n:On.allowDataOverflow,c=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:An.allowDataOverflow,f=s||c;return{needClip:f,needClipX:s,needClipY:c}}function DF(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,a=SA(),{needClipX:i,needClipY:s,needClip:c}=CA(t,n);if(!c||!a)return null;var{x:f,y:u,width:m,height:d}=a;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:i?f:f-m/2,y:s?u:u-d/2,width:i?m:m*2,height:s?d:d*2}))}var IF=(e,t,n,r)=>ol(e,"xAxis",t,r),LF=(e,t,n,r)=>il(e,"xAxis",t,r),zF=(e,t,n,r)=>ol(e,"yAxis",n,r),$F=(e,t,n,r)=>il(e,"yAxis",n,r),jwe=se([gt,IF,zF,LF,$F],(e,t,n,r,a)=>Uo(e,"xAxis")?Nf(t,r,!1):Nf(n,a,!1)),Cwe=(e,t,n,r,a)=>a;function Owe(e){return e.type==="line"}var Awe=se([rx,Cwe],(e,t)=>e.filter(Owe).find(n=>n.id===t)),Nwe=se([gt,IF,zF,LF,$F,Awe,jwe,QC],(e,t,n,r,a,i,s,c)=>{var{chartData:f,dataStartIndex:u,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:d,data:v}=i,y;if(v!=null&&v.length>0?y=v:y=f==null?void 0:f.slice(u,m+1),y!=null)return Wwe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:a,dataKey:d,bandSize:s,displayedData:y})}});function Twe(e){var t=Ac(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 Pwe=["id"],Mwe=["type","layout","connectNulls","needClip","shape"],kwe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function rm(){return rm=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},rm.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 wi(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){Rwe(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 Rwe(e,t,n){return(t=Dwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dwe(e){var t=Iwe(e,"string");return typeof t=="symbol"?t:t+""}function Iwe(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 OA(e,t){if(e==null)return{};var n,r,a=Lwe(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 Lwe(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 zwe=e=>{var{dataKey:t,name:n,stroke:r,legendType:a,hide:i}=e;return[{inactive:i,dataKey:t,type:a,color:r,value:ed(n,t),payload:e}]},$we=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:a,fill:i,name:s,hide:c,unit:f,tooltipType:u,id:m}=e,d={dataDefinedOnItem:n,getPosition:bl,settings:{stroke:r,strokeWidth:a,fill:i,dataKey:t,nameKey:void 0,name:ed(s,t),hide:c,type:u,color:r,unit:f,graphicalItemId:m}};return x.createElement(bA,{tooltipEntrySettings:d})}),BF=(e,t)=>"".concat(t,"px ").concat(e,"px");function Bwe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],a=0;a<t;++a)r.push(...n);return r}var Uwe=(e,t,n)=>{var r=n.reduce((v,y)=>v+y,0);if(!r)return BF(t,e);for(var a=Math.floor(e/r),i=e%r,s=[],c=0,f=0;c<n.length;f+=(u=n[c])!==null&&u!==void 0?u:0,++c){var u,m=n[c];if(m!=null&&f+m>i){s=[...n.slice(0,c),i-f];break}}var d=s.length%2===0?[0,t]:[t];return[...Bwe(n,a),...s,...d].map(v=>"".concat(v,"px")).join(", ")};function Hwe(e){var{clipPathId:t,points:n,props:r}=e,{dot:a,dataKey:i,needClip:s}=r,{id:c}=r,f=OA(r,Pwe),u=aa(f);return x.createElement(qxe,{points:n,dot:a,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:i,baseProps:u,needClip:s,clipPathId:t})}function Fwe(e){var{showLabels:t,children:n,points:r}=e,a=x.useMemo(()=>r==null?void 0:r.map(i=>{var s,c,f={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 wi(wi({},f),{},{value:i.value,payload:i.payload,viewBox:f,parentViewBox:void 0,fill:void 0})}),[r]);return x.createElement(fF,{value:t?a:void 0},n)}function z3(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:a,props:i}=e,{type:s,layout:c,connectNulls:f,needClip:u,shape:m}=i,d=OA(i,Mwe),v=wi(wi({},br(d)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:r,type:s,layout:c,connectNulls:f,strokeDasharray:a??i.strokeDasharray});return x.createElement(x.Fragment,null,(r==null?void 0:r.length)>1&&x.createElement(vA,rm({shapeType:"curve",option:m},v,{pathRef:n})),x.createElement(Hwe,{points:r,clipPathId:t,props:i}))}function qwe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Kwe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:a,longestAnimatedLengthRef:i}=e,{points:s,strokeDasharray:c,isAnimationActive:f,animationBegin:u,animationDuration:m,animationEasing:d,animateNewValues:v,width:y,height:b,onAnimationEnd:w,onAnimationStart:S}=n,E=a.current,O=Um(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=qwe(r.current),K=x.useRef(0);j.current!==O&&(K.current=i.current,j.current=O);var L=K.current;return x.createElement(Fwe,{points:s,showLabels:T},n.children,x.createElement(Bm,{animationId:O,begin:u,duration:m,isActive:f,easing:d,onAnimationEnd:P,onAnimationStart:R,key:O},I=>{var G=Ht(L,D+L,I),z=Math.min(G,D),V;if(f)if(c){var k="".concat(c).split(/[,\s]+/gim).map(U=>parseFloat(U));V=Uwe(z,D,k)}else V=BF(D,z);else V=c==null?void 0:String(c);if(I>0&&D>0&&(a.current=s,i.current=Math.max(i.current,z)),E){var F=E.length/s.length,q=I===1?s:s.map((U,Y)=>{var B=Math.floor(Y*F);if(E[B]){var $=E[B];return wi(wi({},U),{},{x:Ht($.x,U.x,I),y:Ht($.y,U.y,I)})}return v?wi(wi({},U),{},{x:Ht(y*2,U.x,I),y:Ht(b/2,U.y,I)}):wi(wi({},U),{},{x:U.x,y:U.y})});return a.current=q,x.createElement(z3,{props:n,points:q,clipPathId:t,pathRef:r,strokeDasharray:V})}return x.createElement(z3,{props:n,points:s,clipPathId:t,pathRef:r,strokeDasharray:V})}),x.createElement(dA,{label:n.label}))}function Vwe(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),a=x.useRef(0),i=x.useRef(null);return x.createElement(Kwe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:a,pathRef:i})}var Ywe=(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:Ot(e.payload,t)}};class Gwe extends x.Component{render(){var{hide:t,dot:n,points:r,className:a,xAxisId:i,yAxisId:s,top:c,left:f,width:u,height:m,id:d,needClip:v,zIndex:y}=this.props;if(t)return null;var b=ct("recharts-line",a),w=d,{r:S,strokeWidth:E}=Twe(n),O=bF(n),j=S*2+E,A=v?"url(#clipPath-".concat(O?"":"dots-").concat(w,")"):void 0;return x.createElement(Lr,{zIndex:y},x.createElement(Pn,{className:b},v&&x.createElement("defs",null,x.createElement(DF,{clipPathId:w,xAxisId:i,yAxisId:s}),!O&&x.createElement("clipPath",{id:"clipPath-dots-".concat(w)},x.createElement("rect",{x:f-j/2,y:c-j/2,width:u+j,height:m+j}))),x.createElement(RF,{xAxisId:i,yAxisId:s,data:r,dataPointFormatter:Ywe,errorBarOffset:0},x.createElement(Vwe,{props:this.props,clipPathId:w}))),x.createElement(ube,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:A}))}}var UF={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:gn.line,type:"linear"};function Xwe(e){var t=bn(e,UF),{activeDot:n,animateNewValues:r,animationBegin:a,animationDuration:i,animationEasing:s,connectNulls:c,dot:f,hide:u,isAnimationActive:m,label:d,legendType:v,xAxisId:y,yAxisId:b,id:w}=t,S=OA(t,kwe),{needClip:E}=CA(y,b),O=SA(),j=Gc(),A=pr(),N=Te(K=>Nwe(K,y,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(Gwe,rm({},S,{id:w,connectNulls:c,dot:f,activeDot:n,animateNewValues:r,animationBegin:a,animationDuration:i,animationEasing:s,isAnimationActive:m,hide:u,label:d,legendType:v,xAxisId:y,yAxisId:b,points:N,layout:j,height:T,width:P,left:R,top:D,needClip:E}))}function Wwe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:a,yAxisTicks:i,dataKey:s,bandSize:c,displayedData:f}=e;return f.map((u,m)=>{var d=Ot(u,s);if(t==="horizontal"){var v=bR({axis:n,ticks:a,bandSize:c,entry:u,index:m}),y=Yt(d)?null:r.scale.map(d);return{x:v,y:y??null,value:d,payload:u}}var b=Yt(d)?null:n.scale.map(d),w=bR({axis:r,ticks:i,bandSize:c,entry:u,index:m});return b==null||w==null?null:{x:b,y:w,value:d,payload:u}}).filter(Boolean)}function Qwe(e){var t=bn(e,UF),n=pr();return x.createElement(wA,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(wF,{legendPayload:zwe(t)}),x.createElement($we,{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(EF,{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(Xwe,rm({},t,{id:r}))))}var HF=x.memo(Qwe,td);HF.displayName="Line";function Qc(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:jF}function Zc(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:jF}var Zwe="Invariant failed";function Jwe(e,t){throw new Error(Zwe)}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)}function AA(e){return x.createElement(vA,D_({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var e1e=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)||Yt(r);return i?t(r,a):(i||Jwe(),n)}},t1e=(e,t,n)=>n,n1e=(e,t)=>t,tp=se([rx,n1e],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),r1e=se([tp],e=>e==null?void 0:e.maxBarSize),a1e=(e,t,n,r)=>r,i1e=se([gt,rx,Qc,Zc,t1e],(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")),o1e=(e,t,n)=>{var r=gt(e),a=Qc(e,t),i=Zc(e,t);if(!(a==null||i==null))return r==="horizontal"?N_(e,"yAxis",i,n):N_(e,"xAxis",a,n)},s1e=(e,t)=>{var n=gt(e),r=Qc(e,t),a=Zc(e,t);if(!(r==null||a==null))return n==="horizontal"?AI(e,"xAxis",r):AI(e,"yAxis",a)},l1e=se([i1e,Wfe,s1e],fbe),c1e=(e,t,n)=>{var r,a,i=tp(e,t);if(i==null)return 0;var s=Qc(e,t),c=Zc(e,t);if(s==null||c==null)return 0;var f=gt(e),u=aU(e),{maxBarSize:m}=i,d=Yt(m)?u:m,v,y;return f==="horizontal"?(v=ol(e,"xAxis",s,n),y=il(e,"xAxis",s,n)):(v=ol(e,"yAxis",c,n),y=il(e,"yAxis",c,n)),(r=(a=Nf(v,y,!0))!==null&&a!==void 0?a:d)!==null&&r!==void 0?r:0},FF=(e,t,n)=>{var r=gt(e),a=Qc(e,t),i=Zc(e,t);if(!(a==null||i==null)){var s,c;return r==="horizontal"?(s=ol(e,"xAxis",a,n),c=il(e,"xAxis",a,n)):(s=ol(e,"yAxis",i,n),c=il(e,"yAxis",i,n)),Nf(s,c)}},u1e=se([l1e,aU,Xfe,iU,c1e,FF,r1e],vbe),f1e=(e,t,n)=>{var r=Qc(e,t);if(r!=null)return ol(e,"xAxis",r,n)},d1e=(e,t,n)=>{var r=Zc(e,t);if(r!=null)return ol(e,"yAxis",r,n)},h1e=(e,t,n)=>{var r=Qc(e,t);if(r!=null)return il(e,"xAxis",r,n)},m1e=(e,t,n)=>{var r=Zc(e,t);if(r!=null)return il(e,"yAxis",r,n)},p1e=se([u1e,tp],ybe),v1e=se([o1e,tp],gbe),g1e=se([Mn,HC,f1e,d1e,h1e,m1e,p1e,gt,Ffe,FF,v1e,tp,a1e],(e,t,n,r,a,i,s,c,f,u,m,d,v)=>{var{chartData:y,dataStartIndex:b,dataEndIndex:w}=f;if(!(d==null||s==null||t==null||c!=="horizontal"&&c!=="vertical"||n==null||r==null||a==null||i==null||u==null)){var{data:S}=d,E;if(S!=null&&S.length>0?E=S:E=y==null?void 0:y.slice(b,w+1),E!=null)return K1e({layout:c,barSettings:d,pos:s,parentViewBox:t,bandSize:u,xAxis:n,yAxis:r,xAxisTicks:a,yAxisTicks:i,stackedData:m,displayedData:E,offset:e,cells:v,dataStartIndex:b})}}),y1e=["index"];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 x1e(e,t){if(e==null)return{};var n,r,a=b1e(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 b1e(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 qF=x.createContext(void 0),w1e=e=>{var t=x.useContext(qF);if(t!=null)return t.stackId;if(e!=null)return Hle(e)},S1e=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),E1e=e=>{var t=x.useContext(qF);if(t!=null){var{stackId:n}=t;return"url(#".concat(S1e(n,e),")")}},KF=e=>{var{index:t}=e,n=x1e(e,y1e),r=E1e(t);return x.createElement(Pn,I_({className:"recharts-bar-stack-layer",clipPath:r},n))},_1e=["onMouseEnter","onMouseLeave","onClick"],j1e=["value","background","tooltipPosition"],C1e=["id"],O1e=["onMouseEnter","onClick","onMouseLeave"];function cl(){return cl=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},cl.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 yr(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){A1e(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 A1e(e,t,n){return(t=N1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N1e(e){var t=T1e(e,"string");return typeof t=="symbol"?t:t+""}function T1e(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 Iy(e,t){if(e==null)return{};var n,r,a=P1e(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 P1e(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 M1e=e=>{var{dataKey:t,name:n,fill:r,legendType:a,hide:i}=e;return[{inactive:i,dataKey:t,type:a,color:r,value:ed(n,t),payload:e}]},k1e=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:a,name:i,hide:s,unit:c,tooltipType:f,id:u}=e,m={dataDefinedOnItem:void 0,getPosition:bl,settings:{stroke:n,strokeWidth:r,fill:a,dataKey:t,nameKey:void 0,name:ed(i,t),hide:s,type:f,color:a,unit:c,graphicalItemId:u}};return x.createElement(bA,{tooltipEntrySettings:m})});function R1e(e){var t=Te(sl),{data:n,dataKey:r,background:a,allOtherBarProps:i}=e,{onMouseEnter:s,onMouseLeave:c,onClick:f}=i,u=Iy(i,_1e),m=gA(s,r,i.id),d=yA(c),v=xA(f,r,i.id);if(!a||n==null)return null;var y=Ac(a);return x.createElement(Lr,{zIndex:xbe(a,gn.barBackground)},n.map((b,w)=>{var{value:S,background:E,tooltipPosition:O}=b,j=Iy(b,j1e);if(!E)return null;var A=m(b,w),N=d(b,w),T=v(b,w),P=yr(yr(yr(yr(yr({option:a,isActive:String(w)===t},j),{},{fill:"#eee"},E),y),km(u,b,w)),{},{onMouseEnter:A,onMouseLeave:N,onClick:T,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return x.createElement(AA,cl({key:"background-bar-".concat(w)},P))}))}function D1e(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 yr(yr({},s),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:s,fill:i.fill})});return x.createElement(fF,{value:t?a:void 0},n)}function I1e(e){var{shape:t,activeBar:n,baseProps:r,entry:a,index:i,dataKey:s}=e,c=Te(sl),f=Te(iA),u=n&&String(a.originalDataIndex)===c&&(f==null||s===f),[m,d]=x.useState(!1),[v,y]=x.useState(!1);x.useEffect(()=>{var j;return u?(d(!0),j=requestAnimationFrame(()=>{y(!0)})):y(!1),()=>{cancelAnimationFrame(j)}},[u]);var b=x.useCallback(()=>{u||d(!1)},[u]),w=u&&v,S=u||m,E;u?n===!0?E=t:E=n:E=t;var O=x.createElement(AA,cl({},r,{name:String(r.name)},a,{isActive:w,option:E,index:i,dataKey:s,onTransitionEnd:b}));return S?x.createElement(Lr,{zIndex:gn.activeBar},x.createElement(KF,{index:a.originalDataIndex},O)):O}function L1e(e){var{shape:t,baseProps:n,entry:r,index:a,dataKey:i}=e;return x.createElement(AA,cl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:a,dataKey:i}))}function z1e(e){var t,{data:n,props:r}=e,a=(t=aa(r))!==null&&t!==void 0?t:{},{id:i}=a,s=Iy(a,C1e),{shape:c,dataKey:f,activeBar:u}=r,{onMouseEnter:m,onClick:d,onMouseLeave:v}=r,y=Iy(r,O1e),b=gA(m,f,i),w=yA(v),S=xA(d,f,i);return n?x.createElement(x.Fragment,null,n.map((E,O)=>x.createElement(KF,cl({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"},km(y,E,O),{onMouseEnter:b(E,O),onMouseLeave:w(E,O),onClick:S(E,O)}),u?x.createElement(I1e,{shape:c,activeBar:u,baseProps:s,entry:E,index:O,dataKey:f}):x.createElement(L1e,{shape:c,baseProps:s,entry:E,index:O,dataKey:f})))):null}function $1e(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:a,isAnimationActive:i,animationBegin:s,animationDuration:c,animationEasing:f,onAnimationEnd:u,onAnimationStart:m}=t,d=n.current,v=Um(t,"recharts-bar-"),[y,b]=x.useState(!1),w=!y,S=x.useCallback(()=>{typeof u=="function"&&u(),b(!1)},[u]),E=x.useCallback(()=>{typeof m=="function"&&m(),b(!0)},[m]);return x.createElement(D1e,{showLabels:w,rects:r},x.createElement(Bm,{animationId:v,begin:s,duration:c,isActive:i,easing:f,onAnimationEnd:S,onAnimationStart:E,key:v},O=>{var j=O===1?r:r==null?void 0:r.map((A,N)=>{var T=d&&d[N];if(T)return yr(yr({},A),{},{x:Ht(T.x,A.x,O),y:Ht(T.y,A.y,O),width:Ht(T.width,A.width,O),height:Ht(T.height,A.height,O)});if(a==="horizontal"){var P=Ht(0,A.height,O),R=Ht(A.stackedBarStart,A.y,O);return yr(yr({},A),{},{y:R,height:P})}var D=Ht(0,A.width,O),K=Ht(A.stackedBarStart,A.x,O);return yr(yr({},A),{},{width:D,x:K})});return O>0&&(n.current=j??null),j==null?null:x.createElement(Pn,null,x.createElement(z1e,{props:t,data:j}))}),x.createElement(dA,{label:t.label}),t.children)}function B1e(e){var t=x.useRef(null);return x.createElement($1e,{previousRectanglesRef:t,props:e})}var VF=0,U1e=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Ot(e,t)}};class H1e extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:a,xAxisId:i,yAxisId:s,needClip:c,background:f,id:u}=this.props;if(t||n==null)return null;var m=ct("recharts-bar",a),d=u;return x.createElement(Pn,{className:m,id:u},c&&x.createElement("defs",null,x.createElement(DF,{clipPathId:d,xAxisId:i,yAxisId:s})),x.createElement(Pn,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(d,")"):void 0},x.createElement(R1e,{data:n,dataKey:r,background:f,allOtherBarProps:this.props}),x.createElement(B1e,this.props)))}}var F1e={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:VF,xAxisId:0,yAxisId:0,zIndex:gn.bar};function q1e(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:i,activeBar:s,animationBegin:c,animationDuration:f,animationEasing:u,isAnimationActive:m}=e,{needClip:d}=CA(t,n),v=Gc(),y=pr(),b=pA(e.children,ep),w=Te(O=>g1e(O,e.id,y,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(RF,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:U1e,errorBarOffset:S},x.createElement(H1e,cl({},e,{layout:v,needClip:d,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:i,activeBar:s,animationBegin:c,animationDuration:f,animationEasing:u,isAnimationActive:m})))}function K1e(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:a},pos:i,bandSize:s,xAxis:c,yAxis:f,xAxisTicks:u,yAxisTicks:m,stackedData:d,displayedData:v,offset:y,cells:b,parentViewBox:w,dataStartIndex:S}=e,E=t==="horizontal"?f:c,O=d?E.scale.domain():null,j=Fle({numericAxis:E}),A=E.scale.map(j);return v.map((N,T)=>{var P,R,D,K,L,I;if(d){var G=d[T+S];if(G==null)return null;P=Lle(G,O)}else P=Ot(N,n),Array.isArray(P)||(P=[j,P]);var z=e1e(r,VF)(P[1],T);if(t==="horizontal"){var V,k=f.scale.map(P[0]),F=f.scale.map(P[1]);if(k==null||F==null)return null;R=wR({axis:c,ticks:u,bandSize:s,offset:i.offset,entry:N,index:T}),D=(V=F??k)!==null&&V!==void 0?V:void 0,K=i.size;var q=k-F;if(L=Ri(q)?0:q,I={x:R,y:y.top,width:K,height:y.height},Math.abs(z)>0&&Math.abs(L)<Math.abs(z)){var U=Bn(L||z)*(Math.abs(z)-Math.abs(L));D-=U,L+=U}}else{var Y=c.scale.map(P[0]),B=c.scale.map(P[1]);if(Y==null||B==null)return null;if(R=Y,D=wR({axis:f,ticks:m,bandSize:s,offset:i.offset,entry:N,index:T}),K=B-Y,L=i.size,I={x:y.left,y:D,width:y.width,height:L},Math.abs(z)>0&&Math.abs(K)<Math.abs(z)){var $=Bn(K||z)*(Math.abs(z)-Math.abs(K));K+=$}}if(R==null||D==null||K==null||L==null||!a&&(K===0||L===0))return null;var X=yr(yr({},N),{},{stackedBarStart:A,x:R,y:D,width:K,height:L,value:d?P:P[1],payload:N,background:I,tooltipPosition:{x:R+K/2,y:D+L/2},parentViewBox:w,originalDataIndex:T},b&&b[T]&&b[T].props);return X}).filter(Boolean)}function V1e(e){var t=bn(e,F1e),n=w1e(t.stackId),r=pr();return x.createElement(wA,{id:t.id,type:"bar"},a=>x.createElement(x.Fragment,null,x.createElement(wF,{legendPayload:M1e(t)}),x.createElement(k1e,{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(EF,{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(Lr,{zIndex:t.zIndex},x.createElement(q1e,cl({},t,{id:a})))))}var L_=x.memo(V1e,td);L_.displayName="Bar";var Y1e=["domain","range"],G1e=["domain","range"];function B3(e,t){if(e==null)return{};var n,r,a=X1e(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 X1e(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 U3(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 YF(e,t){if(e===t)return!0;var{domain:n,range:r}=e,a=B3(e,Y1e),{domain:i,range:s}=t,c=B3(t,G1e);return!U3(n,i)||!U3(r,s)?!1:td(a,c)}var W1e=["type"],Q1e=["dangerouslySetInnerHTML","ticks","scale"],Z1e=["id","scale"];function z_(){return z_=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},z_.apply(null,arguments)}function H3(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 F3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H3(Object(n),!0).forEach(function(r){J1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J1e(e,t,n){return(t=eSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eSe(e){var t=tSe(e,"string");return typeof t=="symbol"?t:t+""}function tSe(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 $_(e,t){if(e==null)return{};var n,r,a=nSe(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 nSe(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 rSe(e){var t=Nt(),n=x.useRef(null),r=S6(),{type:a}=e,i=$_(e,W1e),s=V0(r,"xAxis",a),c=x.useMemo(()=>{if(s!=null)return F3(F3({},i),{},{type:s})},[i,s]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Xxe(c)):n.current!==c&&t(Wxe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(Qxe(n.current)),n.current=null)},[t]),null}var aSe=e=>{var{xAxisId:t,className:n}=e,r=Te(HC),a=pr(),i="xAxis",s=Te(E=>wH(E,i,t,a)),c=Te(E=>yH(E,t)),f=Te(E=>Dpe(E,t)),u=Te(E=>JU(E,t));if(c==null||f==null||u==null)return null;var{dangerouslySetInnerHTML:m,ticks:d,scale:v}=e,y=$_(e,Q1e),{id:b,scale:w}=u,S=$_(u,Z1e);return x.createElement(_A,z_({},y,S,{x:f.x,y:f.y,width:c.width,height:c.height,className:ct("recharts-".concat(i," ").concat(i),n),viewBox:r,ticks:s,axisType:i,axisId:t}))},iSe={allowDataOverflow:On.allowDataOverflow,allowDecimals:On.allowDecimals,allowDuplicatedCategory:On.allowDuplicatedCategory,angle:On.angle,axisLine:Oo.axisLine,height:On.height,hide:!1,includeHidden:On.includeHidden,interval:On.interval,label:!1,minTickGap:On.minTickGap,mirror:On.mirror,orientation:On.orientation,padding:On.padding,reversed:On.reversed,scale:On.scale,tick:On.tick,tickCount:On.tickCount,tickLine:Oo.tickLine,tickSize:Oo.tickSize,type:On.type,niceTicks:On.niceTicks,xAxisId:0},oSe=e=>{var t=bn(e,iSe);return x.createElement(x.Fragment,null,x.createElement(rSe,{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(aSe,t))},NA=x.memo(oSe,YF);NA.displayName="XAxis";var sSe=["type"],lSe=["dangerouslySetInnerHTML","ticks","scale"],cSe=["id","scale"];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 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){uSe(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 uSe(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=dSe(e,"string");return typeof t=="symbol"?t:t+""}function dSe(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 U_(e,t){if(e==null)return{};var n,r,a=hSe(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 hSe(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 mSe(e){var t=Nt(),n=x.useRef(null),r=S6(),{type:a}=e,i=U_(e,sSe),s=V0(r,"yAxis",a),c=x.useMemo(()=>{if(s!=null)return K3(K3({},i),{},{type:s})},[s,i]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Zxe(c)):n.current!==c&&t(Jxe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(ebe(n.current)),n.current=null)},[t]),null}function pSe(e){var{yAxisId:t,className:n,width:r,label:a}=e,i=x.useRef(null),s=x.useRef(null),c=Te(HC),f=pr(),u=Nt(),m="yAxis",d=Te(T=>xH(T,t)),v=Te(T=>Lpe(T,t)),y=Te(T=>wH(T,m,t,f)),b=Te(T=>eH(T,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!d||fA(a)||x.isValidElement(a)||b==null)){var T=i.current;if(T){var P=T.getCalculatedWidth();Math.round(d.width)!==Math.round(P)&&u(tbe({id:t,width:P}))}}},[y,d,u,a,t,r,b]),d==null||v==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:S,scale:E}=e,O=U_(e,lSe),{id:j,scale:A}=b,N=U_(b,cSe);return x.createElement(_A,B_({},O,N,{ref:i,labelRef:s,x:v.x,y:v.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:ct("recharts-".concat(m," ").concat(m),n),viewBox:c,ticks:y,axisType:m,axisId:t}))}var vSe={allowDataOverflow:An.allowDataOverflow,allowDecimals:An.allowDecimals,allowDuplicatedCategory:An.allowDuplicatedCategory,angle:An.angle,axisLine:Oo.axisLine,hide:!1,includeHidden:An.includeHidden,interval:An.interval,label:!1,minTickGap:An.minTickGap,mirror:An.mirror,orientation:An.orientation,padding:An.padding,reversed:An.reversed,scale:An.scale,tick:An.tick,tickCount:An.tickCount,tickLine:Oo.tickLine,tickSize:Oo.tickSize,type:An.type,niceTicks:An.niceTicks,width:An.width,yAxisId:0},gSe=e=>{var t=bn(e,vSe);return x.createElement(x.Fragment,null,x.createElement(mSe,{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(pSe,t))},TA=x.memo(gSe,YF);TA.displayName="YAxis";var ySe=(e,t)=>t,PA=se([ySe,gt,dU,Fn,zH,Go,ige,Mn],dge);function xSe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function MA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(xSe(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,f)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((f-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>s(c.clientX,c.clientY)):s(e.clientX,e.clientY)}var GF=ia("mouseClick"),XF=Dm();XF.startListening({actionCreator:GF,effect:(e,t)=>{var n=e.payload,r=PA(t.getState(),MA(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(Jpe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var H_=ia("mouseMove"),WF=Dm(),Fu=null,Gl=null,US=null;WF.startListening({actionCreator:H_,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"));Fu!==null&&(cancelAnimationFrame(Fu),Fu=null),Gl!==null&&(typeof a!="number"||!s)&&(clearTimeout(Gl),Gl=null),US=MA(n);var c=()=>{var f=t.getState(),u=JO(f,f.tooltip.settings.shared);if(!US){Fu=null,Gl=null;return}if(u==="axis"){var m=PA(f,US);(m==null?void 0:m.activeIndex)!=null?t.dispatch(NH({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(AH())}Fu=null,Gl=null};if(!s){c();return}a==="raf"?Fu=requestAnimationFrame(c):typeof a=="number"&&Gl===null&&(Gl=setTimeout(c,a))}});function bSe(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 V3={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},QF=mr({name:"rootProps",initialState:V3,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:V3.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}}}),wSe=QF.reducer,{updateOptions:SSe}=QF.actions,ESe=null,_Se={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)},ZF=mr({name:"polarOptions",initialState:ESe,reducers:_Se}),{updatePolarOptions:jSe}=ZF.actions,CSe=ZF.reducer,JF=ia("keyDown"),eq=ia("focus"),tq=ia("blur"),dx=Dm(),qu=null,Xl=null,Jv=null;dx.startListening({actionCreator:JF,effect:(e,t)=>{Jv=e.payload,qu!==null&&(cancelAnimationFrame(qu),qu=null);var n=t.getState(),{throttleDelay:r,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("keydown");Xl!==null&&(typeof r!="number"||!i)&&(clearTimeout(Xl),Xl=null);var s=()=>{try{var c=t.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:u}=c.tooltip,m=Jv;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var d=eA(u,cd(c),Wm(c),Zm(c)),v=d==null?-1:Number(d);if(!Number.isFinite(v)||v<0)return;var y=Go(c);if(m==="Enter"){var b=Ty(c,"axis","hover",String(u.index));t.dispatch(Ny({active:!u.active,activeIndex:u.index,activeCoordinate:b}));return}var w=Hpe(c),S=w==="left-to-right"?1:-1,E=m==="ArrowRight"?1:-1,O=v+E*S;if(y==null||O>=y.length||O<0)return;var j=Ty(c,"axis","hover",String(O));t.dispatch(Ny({active:!0,activeIndex:O.toString(),activeCoordinate:j}))}finally{qu=null,Xl=null}};if(!i){s();return}r==="raf"?qu=requestAnimationFrame(s):typeof r=="number"&&Xl===null&&(s(),Jv=null,Xl=setTimeout(()=>{Jv?s():(Xl=null,qu=null)},r))}});dx.startListening({actionCreator:eq,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=Ty(n,"axis","hover",String(i));t.dispatch(Ny({active:!0,activeIndex:i,activeCoordinate:s}))}}}});dx.startListening({actionCreator:tq,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:a}=n.tooltip;a.active&&t.dispatch(Ny({active:!1,activeIndex:a.index,activeCoordinate:a.coordinate}))}}});function nq(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 ba=ia("externalEvent"),rq=Dm(),eg=new Map,yh=new Map,HS=new Map;rq.startListening({actionCreator:ba,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var a=r.type,i=nq(r);HS.set(a,{handler:n,reactEvent:i});var s=eg.get(a);s!==void 0&&(cancelAnimationFrame(s),eg.delete(a));var c=t.getState(),{throttleDelay:f,throttledEvents:u}=c.eventSettings,m=u,d=m==="all"||(m==null?void 0:m.includes(a)),v=yh.get(a);v!==void 0&&(typeof f!="number"||!d)&&(clearTimeout(v),yh.delete(a));var y=()=>{var S=HS.get(a);try{if(!S)return;var{handler:E,reactEvent:O}=S,j=t.getState(),A={activeCoordinate:Fve(j),activeDataKey:iA(j),activeIndex:sl(j),activeLabel:UH(j),activeTooltipIndex:sl(j),isTooltipActive:qve(j)};E&&E(A,O)}finally{eg.delete(a),yh.delete(a),HS.delete(a)}};if(!d){y();return}if(f==="raf"){var b=requestAnimationFrame(y);eg.set(a,b)}else if(typeof f=="number"){if(!yh.has(a)){y();var w=setTimeout(y,f);yh.set(a,w)}}else y()}}});var OSe=se([sd],e=>e.tooltipItemPayloads),ASe=se([OSe,(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)}}}),aq=ia("touchMove"),iq=Dm(),Wl=null,Ts=null,Y3=null,xh=null;iq.startListening({actionCreator:aq,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){xh=nq(n);var r=t.getState(),{throttleDelay:a,throttledEvents:i}=r.eventSettings,s=i==="all"||i.includes("touchmove");Wl!==null&&(cancelAnimationFrame(Wl),Wl=null),Ts!==null&&(typeof a!="number"||!s)&&(clearTimeout(Ts),Ts=null),Y3=Array.from(n.touches).map(f=>MA({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(xh!=null){var f=t.getState(),u=JO(f,f.tooltip.settings.shared);if(u==="axis"){var m,d=(m=Y3)===null||m===void 0?void 0:m[0];if(d==null){Wl=null,Ts=null;return}var v=PA(f,d);(v==null?void 0:v.activeIndex)!=null&&t.dispatch(NH({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(u==="item"){var y,b=xh.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(v6),E=(y=w.getAttribute(g6))!==null&&y!==void 0?y:void 0,O=ld(f).find(N=>N.id===E);if(S==null||O==null||E==null)return;var{dataKey:j}=O,A=ASe(f,S,E);t.dispatch(OH({activeDataKey:j,activeIndex:S,activeCoordinate:A,activeGraphicalItemId:E}))}Wl=null,Ts=null}};if(!s){c();return}a==="raf"?Wl=requestAnimationFrame(c):typeof a=="number"&&Ts===null&&(c(),xh=null,Ts=setTimeout(()=>{xh?c():(Ts=null,Wl=null)},a))}}});var kA={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},oq=mr({name:"eventSettings",initialState:kA,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:NSe}=oq.actions,TSe=oq.reducer,PSe=z8({brush:bbe,cartesianAxis:nbe,chartData:Fge,errorBars:xwe,eventSettings:TSe,graphicalItems:oxe,layout:Mle,legend:$ce,options:zge,polarAxis:x0e,polarOptions:CSe,referenceElements:_be,renderedTicks:Ube,rootProps:wSe,tooltip:eve,zIndex:Cge}),MSe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return rle({reducer:PSe,preloadedState:t,middleware:r=>{var a;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((a="es6")!==null&&a!==void 0?a:"")}).concat([XF.middleware,WF.middleware,dx.middleware,rq.middleware,iq.middleware])},enhancers:r=>{var a=r;return typeof r=="function"&&(a=r()),a.concat(J8({type:"raf"}))},devTools:{serialize:{replacer:bSe},name:"recharts-".concat(n)}})};function sq(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,a=pr(),i=x.useRef(null);if(a)return n;i.current==null&&(i.current=MSe(t,r));var s=DC;return x.createElement(tue,{context:s,store:i.current},n)}function kSe(e){var{layout:t,margin:n}=e,r=Nt(),a=pr();return x.useEffect(()=>{a||(r(Nle(t)),r(Ale(n)))},[r,a,t,n]),null}var lq=x.memo(kSe,td);function cq(e){var t=Nt();return x.useEffect(()=>{t(SSe(e))},[t,e]),null}var RSe=e=>{var t=Nt();return x.useEffect(()=>{t(NSe(e))},[t,e]),null},uq=x.memo(RSe,td);function G3(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),a=Nt();return x.useLayoutEffect(()=>(r.current&&a(_ge({zIndex:t,element:r.current,isPanorama:n})),()=>{a(jge({zIndex:t,isPanorama:n}))}),[a,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function X3(e){var{children:t,isPanorama:n}=e,r=Te(mge);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(G3,{key:s,zIndex:s,isPanorama:n})),t,i.map(s=>x.createElement(G3,{key:s,zIndex:s,isPanorama:n})))}var DSe=["children"];function ISe(e,t){if(e==null)return{};var n,r,a=LSe(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 LSe(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 Ly(){return Ly=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},Ly.apply(null,arguments)}var zSe={width:"100%",height:"100%",display:"block"},$Se=x.forwardRef((e,t)=>{var n=VC(),r=YC(),a=I6();if(!Ii(n)||!Ii(r))return null;var{children:i,otherAttributes:s,title:c,desc:f}=e,u,m;return s!=null&&(typeof s.tabIndex=="number"?u=s.tabIndex:u=a?0:void 0,typeof s.role=="string"?m=s.role:m=a?"application":void 0),x.createElement(jC,Ly({},s,{title:c,desc:f,role:m,tabIndex:u,width:n,height:r,style:zSe,ref:t}),i)}),BSe=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(jC,{width:r,height:a,x:s,y:i},t)},W3=x.forwardRef((e,t)=>{var{children:n}=e,r=ISe(e,DSe),a=pr();return a?x.createElement(BSe,null,x.createElement(X3,{isPanorama:!0},n)):x.createElement($Se,Ly({ref:t},r),x.createElement(X3,{isPanorama:!1},n))});function USe(){var e=Nt(),[t,n]=x.useState(null),r=Te(Xle);return x.useEffect(()=>{if(t!=null){var a=t.getBoundingClientRect(),i=a.width/t.offsetWidth;st(i)&&i!==r&&e(Ple(i))}},[t,e,r]),n}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 HSe(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){FSe(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 FSe(e,t,n){return(t=qSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qSe(e){var t=KSe(e,"string");return typeof t=="symbol"?t:t+""}function KSe(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 Js(){return Js=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},Js.apply(null,arguments)}var VSe=()=>(Zge(),null);function zy(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var YSe=x.forwardRef((e,t)=>{var n,r,a=x.useRef(null),[i,s]=x.useState({containerWidth:zy((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:zy((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((u,m)=>{s(d=>{var v=Math.round(u),y=Math.round(m);return d.containerWidth===v&&d.containerHeight===y?d:{containerWidth:v,containerHeight:y}})},[]),f=x.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:m,height:d}=u.getBoundingClientRect();c(m,d);var v=b=>{var w=b[0];if(w!=null){var{width:S,height:E}=w.contentRect;c(S,E)}},y=new ResizeObserver(v);y.observe(u),a.current=y}},[t,c]);return x.useEffect(()=>()=>{var u=a.current;u!=null&&u.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(Lm,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Js({ref:f},e)))}),GSe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[a,i]=x.useState({containerWidth:zy(n),containerHeight:zy(r)}),s=x.useCallback((f,u)=>{i(m=>{var d=Math.round(f),v=Math.round(u);return m.containerWidth===d&&m.containerHeight===v?m:{containerWidth:d,containerHeight:v}})},[]),c=x.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null){var{width:u,height:m}=f.getBoundingClientRect();s(u,m)}},[t,s]);return x.createElement(x.Fragment,null,x.createElement(Lm,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Js({ref:c},e)))}),XSe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(Lm,{width:n,height:r}),x.createElement("div",Js({ref:t},e)))}),WSe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(GSe,Js({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(XSe,Js({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(Lm,{width:n,height:r}),x.createElement("div",Js({ref:t},e)))});function QSe(e){return e?YSe:WSe}var ZSe=x.forwardRef((e,t)=>{var{children:n,className:r,height:a,onClick:i,onContextMenu:s,onDoubleClick:c,onMouseDown:f,onMouseEnter:u,onMouseLeave:m,onMouseMove:d,onMouseUp:v,onTouchEnd:y,onTouchMove:b,onTouchStart:w,style:S,width:E,responsive:O,dispatchTouchEvents:j=!0}=e,A=x.useRef(null),N=Nt(),[T,P]=x.useState(null),[R,D]=x.useState(null),K=USe(),L=FC(),I=(L==null?void 0:L.width)>0?L.width:E,G=(L==null?void 0:L.height)>0?L.height:a,z=x.useCallback(le=>{K(le),typeof t=="function"&&t(le),P(le),D(le),le!=null&&(A.current=le)},[K,t,P,D]),V=x.useCallback(le=>{N(GF(le)),N(ba({handler:i,reactEvent:le}))},[N,i]),k=x.useCallback(le=>{N(H_(le)),N(ba({handler:u,reactEvent:le}))},[N,u]),F=x.useCallback(le=>{N(AH()),N(ba({handler:m,reactEvent:le}))},[N,m]),q=x.useCallback(le=>{N(H_(le)),N(ba({handler:d,reactEvent:le}))},[N,d]),U=x.useCallback(()=>{N(eq())},[N]),Y=x.useCallback(()=>{N(tq())},[N]),B=x.useCallback(le=>{N(JF(le.key))},[N]),$=x.useCallback(le=>{N(ba({handler:s,reactEvent:le}))},[N,s]),X=x.useCallback(le=>{N(ba({handler:c,reactEvent:le}))},[N,c]),Z=x.useCallback(le=>{N(ba({handler:f,reactEvent:le}))},[N,f]),ee=x.useCallback(le=>{N(ba({handler:v,reactEvent:le}))},[N,v]),ie=x.useCallback(le=>{N(ba({handler:w,reactEvent:le}))},[N,w]),ae=x.useCallback(le=>{j&&N(aq(le)),N(ba({handler:b,reactEvent:le}))},[N,j,b]),re=x.useCallback(le=>{N(ba({handler:y,reactEvent:le}))},[N,y]),J=QSe(O);return x.createElement(XH.Provider,{value:T},x.createElement(ZB.Provider,{value:R},x.createElement(J,{width:I??(S==null?void 0:S.width),height:G??(S==null?void 0:S.height),className:ct("recharts-wrapper",r),style:HSe({position:"relative",cursor:"default",width:I,height:G},S),onClick:V,onContextMenu:$,onDoubleClick:X,onFocus:U,onBlur:Y,onKeyDown:B,onMouseDown:Z,onMouseEnter:k,onMouseLeave:F,onMouseMove:q,onMouseUp:ee,onTouchEnd:re,onTouchMove:ae,onTouchStart:ie,ref:z},x.createElement(VSe,null),n)))}),JSe=["width","height","responsive","children","className","style","compact","title","desc"];function eEe(e,t){if(e==null)return{};var n,r,a=tEe(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 tEe(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 fq=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:a,children:i,className:s,style:c,compact:f,title:u,desc:m}=e,d=eEe(e,JSe),v=aa(d);return f?x.createElement(x.Fragment,null,x.createElement(Lm,{width:n,height:r}),x.createElement(W3,{otherAttributes:v,title:u,desc:m},i)):x.createElement(ZSe,{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(W3,{otherAttributes:v,title:u,desc:m,ref:t},x.createElement(Cbe,null,i)))});function F_(){return F_=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},F_.apply(null,arguments)}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 nEe(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){rEe(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 rEe(e,t,n){return(t=aEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aEe(e){var t=iEe(e,"string");return typeof t=="symbol"?t:t+""}function iEe(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 oEe={top:5,right:5,bottom:5,left:5},sEe=nEe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:oEe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},kA),dq=x.forwardRef(function(t,n){var r,a=bn(t.categoricalChartProps,sEe),{chartName:i,defaultTooltipEventType:s,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,categoricalChartProps:u}=t,m={chartName:i,defaultTooltipEventType:s,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,eventEmitter:void 0};return x.createElement(sq,{preloadedState:{options:m},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:i},x.createElement(OF,{chartData:u.data}),x.createElement(lq,{layout:a.layout,margin:a.margin}),x.createElement(uq,{throttleDelay:a.throttleDelay,throttledEvents:a.throttledEvents}),x.createElement(cq,{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(fq,F_({},a,{ref:n})))}),lEe=["axis"],cEe=x.forwardRef((e,t)=>x.createElement(dq,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:lEe,tooltipPayloadSearcher:uA,categoricalChartProps:e,ref:t})),uEe=["axis","item"],fEe=x.forwardRef((e,t)=>x.createElement(dq,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:uEe,tooltipPayloadSearcher:uA,categoricalChartProps:e,ref:t}));function dEe(e){var t=Nt();return x.useEffect(()=>{t(jSe(e))},[t,e]),null}var hEe=["layout"];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 mEe(e,t){if(e==null)return{};var n,r,a=pEe(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 pEe(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 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 vEe(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){gEe(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 gEe(e,t,n){return(t=yEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yEe(e){var t=xEe(e,"string");return typeof t=="symbol"?t:t+""}function xEe(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 bEe={top:5,right:5,bottom:5,left:5},hq=vEe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:bEe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},kA),wEe=x.forwardRef(function(t,n){var r,a=bn(t.categoricalChartProps,hq),{layout:i}=a,s=mEe(a,hEe),{chartName:c,defaultTooltipEventType:f,validateTooltipEventTypes:u,tooltipPayloadSearcher:m}=t,d={chartName:c,defaultTooltipEventType:f,validateTooltipEventTypes:u,tooltipPayloadSearcher:m,eventEmitter:void 0};return x.createElement(sq,{preloadedState:{options:d},reduxStoreName:(r=a.id)!==null&&r!==void 0?r:c},x.createElement(OF,{chartData:a.data}),x.createElement(lq,{layout:i,margin:a.margin}),x.createElement(uq,{throttleDelay:a.throttleDelay,throttledEvents:a.throttledEvents}),x.createElement(cq,{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(dEe,{cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius}),x.createElement(fq,q_({},s,{ref:n})))});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 tL(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){SEe(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 SEe(e,t,n){return(t=EEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EEe(e){var t=_Ee(e,"string");return typeof t=="symbol"?t:t+""}function _Ee(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 jEe=["item"],CEe=tL(tL({},hq),{},{layout:"centric",startAngle:0,endAngle:360}),OEe=x.forwardRef((e,t)=>{var n=bn(e,CEe);return x.createElement(wEe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:jEe,tooltipPayloadSearcher:uA,categoricalChartProps:n,ref:t})});function AEe({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(qC,{width:140,height:140,children:p.jsx(OEe,{children:p.jsx(_F,{data:a,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:a.map((s,c)=>p.jsx(ep,{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 nL(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function NEe({data:e}){return e.some(n=>n.total>0)?p.jsx(qC,{width:"100%",height:280,children:p.jsxs(fEe,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[p.jsx(jA,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),p.jsx(NA,{dataKey:"date",tickFormatter:nL,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),p.jsx(TA,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),p.jsx(ZH,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>nL(String(n))}),p.jsx(R6,{wrapperStyle:{fontSize:12,paddingTop:8}}),p.jsx(L_,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),p.jsx(L_,{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 rL(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function TEe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function PEe({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(qC,{width:"100%",height:280,children:p.jsxs(cEe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[p.jsx(jA,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),p.jsx(NA,{dataKey:"date",tickFormatter:rL,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),p.jsx(TA,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),p.jsx(ZH,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>rL(String(r)),formatter:r=>[TEe(Number(r)*6e4),"Avg Duration"]}),p.jsx(HF,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const MEe=["7d","30d","90d"];function kEe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function REe({projectId:e}){const[t,n]=x.useState("30d"),{data:r,isLoading:a}=bie(e,t);return a?p.jsxs("div",{className:"space-y-4",children:[p.jsx(rn,{className:"h-8 w-48"}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsx(rn,{className:"h-32"}),p.jsx(rn,{className:"h-32"}),p.jsx(rn,{className:"h-32"})]}),p.jsx(rn,{className:"h-72"})]}):r?p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"flex gap-1",children:MEe.map(i=>p.jsx(Se,{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(ln,{children:[p.jsx(Xu,{className:"pb-2",children:p.jsx(Wu,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),p.jsxs(cn,{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(ln,{children:[p.jsx(Xu,{className:"pb-2",children:p.jsx(Wu,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),p.jsx(cn,{className:"h-36",children:p.jsx(AEe,{completed:r.completed,failed:r.failed})})]}),p.jsxs(ln,{children:[p.jsx(Xu,{className:"pb-2",children:p.jsx(Wu,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),p.jsxs(cn,{children:[p.jsx("div",{className:"text-3xl font-bold",children:kEe(r.avg_duration_ms)}),p.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),p.jsxs(ln,{children:[p.jsx(Xu,{children:p.jsx(Wu,{className:"text-base",children:"Run Frequency"})}),p.jsx(cn,{children:p.jsx(NEe,{data:r.daily})})]}),p.jsxs(ln,{children:[p.jsx(Xu,{children:p.jsx(Wu,{className:"text-base",children:"Duration Trends"})}),p.jsx(cn,{children:p.jsx(PEe,{data:r.daily})})]})]}):null}function RA({className:e,orientation:t="horizontal",...n}){return p.jsx(iee,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Ce("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const DEe=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 DA({className:e,variant:t="default",...n}){return p.jsx(oee,{"data-slot":"tabs-list","data-variant":t,className:Ce(DEe({variant:t}),e),...n})}function Wr({className:e,...t}){return p.jsx(see,{"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 Qr({className:e,...t}){return p.jsx(lee,{"data-slot":"tabs-content",className:Ce("flex-1 outline-none",e),...t})}function IEe(){return p.jsxs("div",{className:"space-y-6",children:[p.jsx(rn,{className:"h-8 w-48"}),p.jsx(rn,{className:"h-24 rounded-lg"}),p.jsx(rn,{className:"h-64 rounded-lg"})]})}function LEe({projectId:e,conversationId:t,title:n,fallback:r}){const[a,i]=x.useState(!1),[s,c]=x.useState(""),f=x.useRef(null),u=vC(e);function m(y){y.stopPropagation(),c(n??""),i(!0),setTimeout(()=>{var b;return(b=f.current)==null?void 0:b.select()},0)}function d(y){y.stopPropagation();const b=s.trim();u.mutate({conversationId:t,title:b||null}),i(!1)}function v(y){y.key==="Enter"&&(y.preventDefault(),d(y)),y.key==="Escape"&&(y.stopPropagation(),i(!1))}return a?p.jsx(et,{ref:f,value:s,onChange:y=>c(y.target.value),onBlur:d,onKeyDown:v,onClick:y=>y.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(Se,{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 zEe({projectId:e,conversationId:t,label:n}){const[r,a]=x.useState(!1),i=AB(e);return r?p.jsxs("div",{className:"flex justify-end gap-1",onClick:s=>s.stopPropagation(),children:[p.jsx(Se,{size:"sm",variant:"destructive",disabled:i.isPending,onClick:s=>{s.stopPropagation(),i.mutate(t,{onSuccess:()=>a(!1),onError:()=>a(!1)})},children:"Confirm"}),p.jsx(Se,{size:"sm",variant:"outline",onClick:s=>{s.stopPropagation(),a(!1)},children:"No"})]}):p.jsx(Se,{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(pl,{className:"h-3.5 w-3.5"})})}const aL={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function $Ee(){var K,L,I;const{projectId:e}=Xy(),t=Number(e),n=ul(),r=mC(t),[a,i]=x.useState(1),[s]=x.useState(1),c=_re(t,a),f=KB(t),u=CB(t,s),m=OB(),[d,v]=x.useState(!1),[y,b]=x.useState(!1),[w,S]=x.useState("conversations"),E=r.isLoading||c.isLoading,O=r.error||c.error;if(E)return p.jsx(IEe,{});if(O)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx(ko,{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(ko,{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=f.data??[],D=R.reduce((G,z)=>(G[z.type]=(G[z.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(Se,{disabled:!j.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:G=>n(`/projects/${t}/conversations/${G.id}`)})},children:[p.jsx(mB,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),p.jsxs(Se,{variant:"outline",onClick:()=>v(!0),disabled:!j.dir_exists,children:[p.jsx(dC,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),p.jsxs(Se,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[p.jsx(x0,{className:"mr-2 h-4 w-4"}),"Install Resource"]}),p.jsx(Se,{variant:"outline",asChild:!0,children:p.jsxs(ra,{to:"/projects",children:[p.jsx(lC,{className:"mr-2 h-4 w-4"}),"Back"]})})]})]}),p.jsx(ln,{children:p.jsx(cn,{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,z])=>p.jsxs(qt,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[z," ",z===1?aL[G]??G:`${aL[G]??G}s`]},G))})})]})})}),p.jsx(Xae,{projectId:t,open:d,onOpenChange:v}),p.jsx(EC,{open:y,onOpenChange:b,projectId:t}),p.jsxs(RA,{value:w,onValueChange:S,children:[p.jsxs(DA,{children:[p.jsxs(Wr,{value:"conversations",children:["Conversations (",((K=u.data)==null?void 0:K.total)??0,")"]}),p.jsxs(Wr,{value:"sessions",children:["Sessions (",T,")"]}),p.jsx(Wr,{value:"activity",children:"Activity"}),p.jsxs(Wr,{value:"resources",children:["Resources (",R.length,")"]}),p.jsx(Wr,{value:"files",children:"Files"})]}),p.jsx(Qr,{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(ln,{children:p.jsx(cn,{className:"p-0",children:p.jsx(FE,{sessions:N})})}),p.jsx(Vae,{page:a,totalPages:P,onPageChange:i})]})}),p.jsx(Qr,{value:"conversations",className:"mt-4 space-y-3",children:(((L=u.data)==null?void 0:L.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(ln,{children:p.jsx(cn,{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=u.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(LEe,{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(zEe,{projectId:t,conversationId:G.id,label:G.title??`Conversation #${G.id}`})})]},G.id))})]})})})}),p.jsx(Qr,{value:"activity",className:"mt-4",children:p.jsx(REe,{projectId:t})}),p.jsx(Qr,{value:"resources",className:"mt-4",children:p.jsx(yie,{projectId:t,installOpen:y,onInstallOpenChange:b})}),p.jsx(Qr,{value:"files",className:"mt-4",children:p.jsx(Qae,{projectId:t})})]})]})}function wn(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=wn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var BEe={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 Sg(n)}function Sg(e){this._=e}function UEe(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}})}Sg.prototype=hx.prototype={constructor:Sg,on:function(e,t){var n=this._,r=UEe(e+"",n),a,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((a=(e=r[i]).type)&&(a=HEe(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]=iL(n[a],e.name,t);else if(t==null)for(a in n)n[a]=iL(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 Sg(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 HEe(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function iL(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=BEe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var K_="http://www.w3.org/1999/xhtml";const oL={svg:"http://www.w3.org/2000/svg",xhtml:K_,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)),oL.hasOwnProperty(t)?{space:oL[t],local:e}:e}function FEe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===K_&&t.documentElement.namespaceURI===K_?t.createElement(e):t.createElementNS(n,e)}}function qEe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mq(e){var t=mx(e);return(t.local?qEe:FEe)(t)}function KEe(){}function IA(e){return e==null?KEe:function(){return this.querySelector(e)}}function VEe(e){typeof e!="function"&&(e=IA(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),f,u,m=0;m<s;++m)(f=i[m])&&(u=e.call(f,f.__data__,m,i))&&("__data__"in f&&(u.__data__=f.__data__),c[m]=u);return new sa(r,this._parents)}function YEe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function GEe(){return[]}function pq(e){return e==null?GEe:function(){return this.querySelectorAll(e)}}function XEe(e){return function(){return YEe(e.apply(this,arguments))}}function WEe(e){typeof e=="function"?e=XEe(e):e=pq(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var s=t[i],c=s.length,f,u=0;u<c;++u)(f=s[u])&&(r.push(e.call(f,f.__data__,u,s)),a.push(f));return new sa(r,a)}function vq(e){return function(){return this.matches(e)}}function gq(e){return function(t){return t.matches(e)}}var QEe=Array.prototype.find;function ZEe(e){return function(){return QEe.call(this.children,e)}}function JEe(){return this.firstElementChild}function e_e(e){return this.select(e==null?JEe:ZEe(typeof e=="function"?e:gq(e)))}var t_e=Array.prototype.filter;function n_e(){return Array.from(this.children)}function r_e(e){return function(){return t_e.call(this.children,e)}}function a_e(e){return this.selectAll(e==null?n_e:r_e(typeof e=="function"?e:gq(e)))}function i_e(e){typeof e!="function"&&(e=vq(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]=[],f,u=0;u<s;++u)(f=i[u])&&e.call(f,f.__data__,u,i)&&c.push(f);return new sa(r,this._parents)}function yq(e){return new Array(e.length)}function o_e(){return new sa(this._enter||this._groups.map(yq),this._parents)}function $y(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}$y.prototype={constructor:$y,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 s_e(e){return function(){return e}}function l_e(e,t,n,r,a,i){for(var s=0,c,f=t.length,u=i.length;s<u;++s)(c=t[s])?(c.__data__=i[s],r[s]=c):n[s]=new $y(e,i[s]);for(;s<f;++s)(c=t[s])&&(a[s]=c)}function c_e(e,t,n,r,a,i,s){var c,f,u=new Map,m=t.length,d=i.length,v=new Array(m),y;for(c=0;c<m;++c)(f=t[c])&&(v[c]=y=s.call(f,f.__data__,c,t)+"",u.has(y)?a[c]=f:u.set(y,f));for(c=0;c<d;++c)y=s.call(e,i[c],c,i)+"",(f=u.get(y))?(r[c]=f,f.__data__=i[c],u.delete(y)):n[c]=new $y(e,i[c]);for(c=0;c<m;++c)(f=t[c])&&u.get(v[c])===f&&(a[c]=f)}function u_e(e){return e.__data__}function f_e(e,t){if(!arguments.length)return Array.from(this,u_e);var n=t?c_e:l_e,r=this._parents,a=this._groups;typeof e!="function"&&(e=s_e(e));for(var i=a.length,s=new Array(i),c=new Array(i),f=new Array(i),u=0;u<i;++u){var m=r[u],d=a[u],v=d.length,y=d_e(e.call(m,m&&m.__data__,u,r)),b=y.length,w=c[u]=new Array(b),S=s[u]=new Array(b),E=f[u]=new Array(v);n(m,d,w,S,E,y,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 sa(s,r),s._enter=c,s._exit=f,s}function d_e(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function h_e(){return new sa(this._exit||this._groups.map(yq),this._parents)}function m_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 p_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),f=0;f<s;++f)for(var u=n[f],m=r[f],d=u.length,v=c[f]=new Array(d),y,b=0;b<d;++b)(y=u[b]||m[b])&&(v[b]=y);for(;f<a;++f)c[f]=n[f];return new sa(c,this._parents)}function v_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 g_e(e){e||(e=y_e);function t(d,v){return d&&v?e(d.__data__,v.__data__):!d-!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,f=a[i]=new Array(c),u,m=0;m<c;++m)(u=s[m])&&(f[m]=u);f.sort(t)}return new sa(a,this._parents).order()}function y_e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function x_e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function b_e(){return Array.from(this)}function w_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 S_e(){let e=0;for(const t of this)++e;return e}function E_e(){return!this.node()}function __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 j_e(e){return function(){this.removeAttribute(e)}}function C_e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function O_e(e,t){return function(){this.setAttribute(e,t)}}function A_e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function N_e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function T_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 P_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?C_e:j_e:typeof t=="function"?n.local?T_e:N_e:n.local?A_e:O_e)(n,t))}function xq(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function M_e(e){return function(){this.style.removeProperty(e)}}function k_e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function R_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 D_e(e,t,n){return arguments.length>1?this.each((t==null?M_e:typeof t=="function"?R_e:k_e)(e,t,n??"")):Df(this.node(),e)}function Df(e,t){return e.style.getPropertyValue(t)||xq(e).getComputedStyle(e,null).getPropertyValue(t)}function I_e(e){return function(){delete this[e]}}function L_e(e,t){return function(){this[e]=t}}function z_e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function $_e(e,t){return arguments.length>1?this.each((t==null?I_e:typeof t=="function"?z_e:L_e)(e,t)):this.node()[e]}function bq(e){return e.trim().split(/^|\s+/)}function LA(e){return e.classList||new wq(e)}function wq(e){this._node=e,this._names=bq(e.getAttribute("class")||"")}wq.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 Sq(e,t){for(var n=LA(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function Eq(e,t){for(var n=LA(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function B_e(e){return function(){Sq(this,e)}}function U_e(e){return function(){Eq(this,e)}}function H_e(e,t){return function(){(t.apply(this,arguments)?Sq:Eq)(this,e)}}function F_e(e,t){var n=bq(e+"");if(arguments.length<2){for(var r=LA(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?H_e:t?B_e:U_e)(n,t))}function q_e(){this.textContent=""}function K_e(e){return function(){this.textContent=e}}function V_e(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Y_e(e){return arguments.length?this.each(e==null?q_e:(typeof e=="function"?V_e:K_e)(e)):this.node().textContent}function G_e(){this.innerHTML=""}function X_e(e){return function(){this.innerHTML=e}}function W_e(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Q_e(e){return arguments.length?this.each(e==null?G_e:(typeof e=="function"?W_e:X_e)(e)):this.node().innerHTML}function Z_e(){this.nextSibling&&this.parentNode.appendChild(this)}function J_e(){return this.each(Z_e)}function eje(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tje(){return this.each(eje)}function nje(e){var t=typeof e=="function"?e:mq(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function rje(){return null}function aje(e,t){var n=typeof e=="function"?e:mq(e),r=t==null?rje:typeof t=="function"?t:IA(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ije(){var e=this.parentNode;e&&e.removeChild(this)}function oje(){return this.each(ije)}function sje(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function lje(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cje(e){return this.select(e?lje:sje)}function uje(e){return arguments.length?this.property("__data__",e):this.node().__data__}function fje(e){return function(t){e.call(this,t,this.__data__)}}function dje(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 hje(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 mje(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 pje(e,t,n){var r=dje(e+""),a,i=r.length,s;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,u=c.length,m;f<u;++f)for(a=0,m=c[f];a<i;++a)if((s=r[a]).type===m.type&&s.name===m.name)return m.value}return}for(c=t?mje:hje,a=0;a<i;++a)this.each(c(r[a],t,n));return this}function _q(e,t,n){var r=xq(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 vje(e,t){return function(){return _q(this,e,t)}}function gje(e,t){return function(){return _q(this,e,t.apply(this,arguments))}}function yje(e,t){return this.each((typeof t=="function"?gje:vje)(e,t))}function*xje(){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 jq=[null];function sa(e,t){this._groups=e,this._parents=t}function np(){return new sa([[document.documentElement]],jq)}function bje(){return this}sa.prototype=np.prototype={constructor:sa,select:VEe,selectAll:WEe,selectChild:e_e,selectChildren:a_e,filter:i_e,data:f_e,enter:o_e,exit:h_e,join:m_e,merge:p_e,selection:bje,order:v_e,sort:g_e,call:x_e,nodes:b_e,node:w_e,size:S_e,empty:E_e,each:__e,attr:P_e,style:D_e,property:$_e,classed:F_e,text:Y_e,html:Q_e,raise:J_e,lower:tje,append:nje,insert:aje,remove:oje,clone:cje,datum:uje,on:pje,dispatch:yje,[Symbol.iterator]:xje};function Jr(e){return typeof e=="string"?new sa([[document.querySelector(e)]],[document.documentElement]):new sa([[e]],jq)}function wje(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ua(e,t){if(e=wje(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 Sje={passive:!1},am={capture:!0,passive:!1};function FS(e){e.stopImmediatePropagation()}function lf(e){e.preventDefault(),e.stopImmediatePropagation()}function Cq(e){var t=e.document.documentElement,n=Jr(e).on("dragstart.drag",lf,am);"onselectstart"in t?n.on("selectstart.drag",lf,am):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Oq(e,t){var n=e.document.documentElement,r=Jr(e).on("dragstart.drag",null);t&&(r.on("click.drag",lf,am),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 tg=e=>()=>e;function V_(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:i,x:s,y:c,dx:f,dy:u,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:f,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}V_.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Eje(e){return!e.ctrlKey&&!e.button}function _je(){return this.parentNode}function jje(e,t){return t??{x:e.x,y:e.y}}function Cje(){return navigator.maxTouchPoints||"ontouchstart"in this}function Aq(){var e=Eje,t=_je,n=jje,r=Cje,a={},i=hx("start","drag","end"),s=0,c,f,u,m,d=0;function v(A){A.on("mousedown.drag",y).filter(r).on("touchstart.drag",S).on("touchmove.drag",E,Sje).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(A,N){if(!(m||!e.call(this,A,N))){var T=j(this,t.call(this,A,N),A,N,"mouse");T&&(Jr(A.view).on("mousemove.drag",b,am).on("mouseup.drag",w,am),Cq(A.view),FS(A),u=!1,c=A.clientX,f=A.clientY,T("start",A))}}function b(A){if(lf(A),!u){var N=A.clientX-c,T=A.clientY-f;u=N*N+T*T>d}a.mouse("drag",A)}function w(A){Jr(A.view).on("mousemove.drag mouseup.drag",null),Oq(A.view,u),lf(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])&&(lf(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(),L=Ua(D||T,N),I,G,z;if((z=n.call(A,new V_("beforestart",{sourceEvent:T,target:v,identifier:R,active:s,x:L[0],y:L[1],dx:0,dy:0,dispatch:K}),P))!=null)return I=z.x-L[0]||0,G=z.y-L[1]||0,function V(k,F,q){var U=L,Y;switch(k){case"start":a[R]=V,Y=s++;break;case"end":delete a[R],--s;case"drag":L=Ua(q||F,N),Y=s;break}K.call(k,A,new V_(k,{sourceEvent:F,subject:z,target:v,identifier:R,active:Y,x:L[0]+I,y:L[1]+G,dx:L[0]-U[0],dy:L[1]-U[1],dispatch:K}),P)}}return v.filter=function(A){return arguments.length?(e=typeof A=="function"?A:tg(!!A),v):e},v.container=function(A){return arguments.length?(t=typeof A=="function"?A:tg(A),v):t},v.subject=function(A){return arguments.length?(n=typeof A=="function"?A:tg(A),v):n},v.touchable=function(A){return arguments.length?(r=typeof A=="function"?A:tg(!!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?(d=(A=+A)*A,v):Math.sqrt(d)},v}var If=0,Nh=0,bh=0,Nq=1e3,By,Th,Uy=0,zc=0,px=0,im=typeof performance=="object"&&performance.now?performance:Date,Tq=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zA(){return zc||(Tq(Oje),zc=im.now()+px)}function Oje(){zc=0}function Hy(){this._call=this._time=this._next=null}Hy.prototype=Pq.prototype={constructor:Hy,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?zA():+n)+(t==null?0:+t),!this._next&&Th!==this&&(Th?Th._next=this:By=this,Th=this),this._call=e,this._time=n,Y_()},stop:function(){this._call&&(this._call=null,this._time=1/0,Y_())}};function Pq(e,t,n){var r=new Hy;return r.restart(e,t,n),r}function Aje(){zA(),++If;for(var e=By,t;e;)(t=zc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--If}function sL(){zc=(Uy=im.now())+px,If=Nh=0;try{Aje()}finally{If=0,Tje(),zc=0}}function Nje(){var e=im.now(),t=e-Uy;t>Nq&&(px-=t,Uy=e)}function Tje(){for(var e,t=By,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:By=n);Th=e,Y_(r)}function Y_(e){if(!If){Nh&&(Nh=clearTimeout(Nh));var t=e-zc;t>24?(e<1/0&&(Nh=setTimeout(sL,e-im.now()-px)),bh&&(bh=clearInterval(bh))):(bh||(Uy=im.now(),bh=setInterval(Nje,Nq)),If=1,Tq(sL))}}function lL(e,t,n){var r=new Hy;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var Pje=hx("start","end","cancel","interrupt"),Mje=[],Mq=0,cL=1,G_=2,Eg=3,uL=4,X_=5,_g=6;function vx(e,t,n,r,a,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;kje(e,n,{name:t,index:r,group:a,on:Pje,tween:Mje,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Mq})}function $A(e,t){var n=ai(e,t);if(n.state>Mq)throw new Error("too late; already scheduled");return n}function Ui(e,t){var n=ai(e,t);if(n.state>Eg)throw new Error("too late; already running");return n}function ai(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function kje(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=Pq(i,0,n.time);function i(u){n.state=cL,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var m,d,v,y;if(n.state!==cL)return f();for(m in r)if(y=r[m],y.name===n.name){if(y.state===Eg)return lL(s);y.state===uL?(y.state=_g,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[m]):+m<t&&(y.state=_g,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[m])}if(lL(function(){n.state===Eg&&(n.state=uL,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=G_,n.on.call("start",e,e.__data__,n.index,n.group),n.state===G_){for(n.state=Eg,a=new Array(v=n.tween.length),m=0,d=-1;m<v;++m)(y=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(a[++d]=y);a.length=d+1}}function c(u){for(var m=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(f),n.state=X_,1),d=-1,v=a.length;++d<v;)a[d].call(e,m);n.state===X_&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=_g,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function jg(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>G_&&r.state<X_,r.state=_g,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Rje(e){return this.each(function(){jg(this,e)})}function Dje(e,t){var n,r;return function(){var a=Ui(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 Ije(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=Ui(this,e),s=i.tween;if(s!==r){a=(r=s).slice();for(var c={name:t,value:n},f=0,u=a.length;f<u;++f)if(a[f].name===t){a[f]=c;break}f===u&&a.push(c)}i.tween=a}}function Lje(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ai(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?Dje:Ije)(n,e,t))}function BA(e,t,n){var r=e._id;return e.each(function(){var a=Ui(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ai(a,r).value[t]}}function kq(e,t){var n;return(typeof t=="number"?Ha:t instanceof Ic?by:(n=Ic(t))?(t=n,by):SU)(e,t)}function zje(e){return function(){this.removeAttribute(e)}}function $je(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Bje(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 Uje(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 Hje(e,t,n){var r,a,i;return function(){var s,c=n(this),f;return c==null?void this.removeAttribute(e):(s=this.getAttribute(e),f=c+"",s===f?null:s===r&&f===a?i:(a=f,i=t(r=s,c)))}}function Fje(e,t,n){var r,a,i;return function(){var s,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),f=c+"",s===f?null:s===r&&f===a?i:(a=f,i=t(r=s,c)))}}function qje(e,t){var n=mx(e),r=n==="transform"?qde:kq;return this.attrTween(e,typeof t=="function"?(n.local?Fje:Hje)(n,r,BA(this,"attr."+e,t)):t==null?(n.local?$je:zje)(n):(n.local?Uje:Bje)(n,r,t))}function Kje(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Vje(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Yje(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 Gje(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Kje(e,i)),n}return a._value=t,a}function Xje(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?Yje:Gje)(r,t))}function Wje(e,t){return function(){$A(this,e).delay=+t.apply(this,arguments)}}function Qje(e,t){return t=+t,function(){$A(this,e).delay=t}}function Zje(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Wje:Qje)(t,e)):ai(this.node(),t).delay}function Jje(e,t){return function(){Ui(this,e).duration=+t.apply(this,arguments)}}function eCe(e,t){return t=+t,function(){Ui(this,e).duration=t}}function tCe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jje:eCe)(t,e)):ai(this.node(),t).duration}function nCe(e,t){if(typeof t!="function")throw new Error;return function(){Ui(this,e).ease=t}}function rCe(e){var t=this._id;return arguments.length?this.each(nCe(t,e)):ai(this.node(),t).ease}function aCe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ui(this,e).ease=n}}function iCe(e){if(typeof e!="function")throw new Error;return this.each(aCe(this._id,e))}function oCe(e){typeof e!="function"&&(e=vq(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]=[],f,u=0;u<s;++u)(f=i[u])&&e.call(f,f.__data__,u,i)&&c.push(f);return new $o(r,this._parents,this._name,this._id)}function sCe(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 f=t[c],u=n[c],m=f.length,d=s[c]=new Array(m),v,y=0;y<m;++y)(v=f[y]||u[y])&&(d[y]=v);for(;c<r;++c)s[c]=t[c];return new $o(s,this._parents,this._name,this._id)}function lCe(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 cCe(e,t,n){var r,a,i=lCe(t)?$A:Ui;return function(){var s=i(this,e),c=s.on;c!==r&&(a=(r=c).copy()).on(t,n),s.on=a}}function uCe(e,t){var n=this._id;return arguments.length<2?ai(this.node(),n).on.on(e):this.each(cCe(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 dCe(){return this.on("end.remove",fCe(this._id))}function hCe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=IA(e));for(var r=this._groups,a=r.length,i=new Array(a),s=0;s<a;++s)for(var c=r[s],f=c.length,u=i[s]=new Array(f),m,d,v=0;v<f;++v)(m=c[v])&&(d=e.call(m,m.__data__,v,c))&&("__data__"in m&&(d.__data__=m.__data__),u[v]=d,vx(u[v],t,n,v,u,ai(m,n)));return new $o(i,this._parents,t,n)}function mCe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=pq(e));for(var r=this._groups,a=r.length,i=[],s=[],c=0;c<a;++c)for(var f=r[c],u=f.length,m,d=0;d<u;++d)if(m=f[d]){for(var v=e.call(m,m.__data__,d,f),y,b=ai(m,n),w=0,S=v.length;w<S;++w)(y=v[w])&&vx(y,t,n,w,v,b);i.push(v),s.push(m)}return new $o(i,s,t,n)}var pCe=np.prototype.constructor;function vCe(){return new pCe(this._groups,this._parents)}function gCe(e,t){var n,r,a;return function(){var i=Df(this,e),s=(this.style.removeProperty(e),Df(this,e));return i===s?null:i===n&&s===r?a:a=t(n=i,r=s)}}function Rq(e){return function(){this.style.removeProperty(e)}}function yCe(e,t,n){var r,a=n+"",i;return function(){var s=Df(this,e);return s===a?null:s===r?i:i=t(r=s,n)}}function xCe(e,t,n){var r,a,i;return function(){var s=Df(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),Df(this,e))),s===f?null:s===r&&f===a?i:(a=f,i=t(r=s,c))}}function bCe(e,t){var n,r,a,i="style."+t,s="end."+i,c;return function(){var f=Ui(this,e),u=f.on,m=f.value[i]==null?c||(c=Rq(t)):void 0;(u!==n||a!==m)&&(r=(n=u).copy()).on(s,a=m),f.on=r}}function wCe(e,t,n){var r=(e+="")=="transform"?Fde:kq;return t==null?this.styleTween(e,gCe(e,r)).on("end.style."+e,Rq(e)):typeof t=="function"?this.styleTween(e,xCe(e,r,BA(this,"style."+e,t))).each(bCe(this._id,e)):this.styleTween(e,yCe(e,r,t),n).on("end.style."+e,null)}function SCe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ECe(e,t,n){var r,a;function i(){var s=t.apply(this,arguments);return s!==a&&(r=(a=s)&&SCe(e,s,n)),r}return i._value=t,i}function _Ce(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,ECe(e,t,n??""))}function jCe(e){return function(){this.textContent=e}}function CCe(e){return function(){var t=e(this);this.textContent=t??""}}function OCe(e){return this.tween("text",typeof e=="function"?CCe(BA(this,"text",e)):jCe(e==null?"":e+""))}function ACe(e){return function(t){this.textContent=e.call(this,t)}}function NCe(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&ACe(a)),t}return r._value=e,r}function TCe(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,NCe(e))}function PCe(){for(var e=this._name,t=this._id,n=Dq(),r=this._groups,a=r.length,i=0;i<a;++i)for(var s=r[i],c=s.length,f,u=0;u<c;++u)if(f=s[u]){var m=ai(f,t);vx(f,e,n,u,s,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new $o(r,this._parents,e,n)}function MCe(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,s){var c={value:s},f={value:function(){--a===0&&i()}};n.each(function(){var u=Ui(this,r),m=u.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),u.on=t}),a===0&&i()})}var kCe=0;function $o(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Dq(){return++kCe}var ho=np.prototype;$o.prototype={constructor:$o,select:hCe,selectAll:mCe,selectChild:ho.selectChild,selectChildren:ho.selectChildren,filter:oCe,merge:sCe,selection:vCe,transition:PCe,call:ho.call,nodes:ho.nodes,node:ho.node,size:ho.size,empty:ho.empty,each:ho.each,on:uCe,attr:qje,attrTween:Xje,style:wCe,styleTween:_Ce,text:OCe,textTween:TCe,remove:dCe,tween:Lje,delay:Zje,duration:tCe,ease:rCe,easeVarying:iCe,end:MCe,[Symbol.iterator]:ho[Symbol.iterator]};function RCe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var DCe={time:null,delay:0,duration:250,ease:RCe};function ICe(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 LCe(e){var t,n;e instanceof $o?(t=e._id,e=e._name):(t=Dq(),(n=DCe).time=zA(),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,f,u=0;u<c;++u)(f=s[u])&&vx(f,e,t,u,s,n||ICe(f,t));return new $o(r,this._parents,e,t)}np.prototype.interrupt=Rje;np.prototype.transition=LCe;const ng=e=>()=>e;function zCe(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 Eo(e,t,n){this.k=e,this.x=t,this.y=n}Eo.prototype={constructor:Eo,scale:function(e){return e===1?this:new Eo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Eo(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 Eo(1,0,0);Iq.prototype=Eo.prototype;function Iq(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gx;return e.__zoom}function qS(e){e.stopImmediatePropagation()}function wh(e){e.preventDefault(),e.stopImmediatePropagation()}function $Ce(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function BCe(){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 fL(){return this.__zoom||gx}function UCe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function HCe(){return navigator.maxTouchPoints||"ontouchstart"in this}function FCe(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 Lq(){var e=$Ce,t=BCe,n=FCe,r=UCe,a=HCe,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,f=xg,u=hx("start","zoom","end"),m,d,v,y=500,b=150,w=0,S=10;function E(z){z.property("__zoom",fL).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",K).filter(a).on("touchstart.zoom",L).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(z,V,k,F){var q=z.selection?z.selection():z;q.property("__zoom",fL),z!==q?N(z,V,k,F):q.interrupt().each(function(){T(this,arguments).event(F).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},E.scaleBy=function(z,V,k,F){E.scaleTo(z,function(){var q=this.__zoom.k,U=typeof V=="function"?V.apply(this,arguments):V;return q*U},k,F)},E.scaleTo=function(z,V,k,F){E.transform(z,function(){var q=t.apply(this,arguments),U=this.__zoom,Y=k==null?A(q):typeof k=="function"?k.apply(this,arguments):k,B=U.invert(Y),$=typeof V=="function"?V.apply(this,arguments):V;return n(j(O(U,$),Y,B),q,s)},k,F)},E.translateBy=function(z,V,k,F){E.transform(z,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),s)},null,F)},E.translateTo=function(z,V,k,F,q){E.transform(z,function(){var U=t.apply(this,arguments),Y=this.__zoom,B=F==null?A(U):typeof F=="function"?F.apply(this,arguments):F;return n(gx.translate(B[0],B[1]).scale(Y.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof k=="function"?-k.apply(this,arguments):-k),U,s)},F,q)};function O(z,V){return V=Math.max(i[0],Math.min(i[1],V)),V===z.k?z:new Eo(V,z.x,z.y)}function j(z,V,k){var F=V[0]-k[0]*z.k,q=V[1]-k[1]*z.k;return F===z.x&&q===z.y?z:new Eo(z.k,F,q)}function A(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function N(z,V,k,F){z.on("start.zoom",function(){T(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(F).end()}).tween("zoom",function(){var q=this,U=arguments,Y=T(q,U).event(F),B=t.apply(q,U),$=k==null?A(B):typeof k=="function"?k.apply(q,U):k,X=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Z=q.__zoom,ee=typeof V=="function"?V.apply(q,U):V,ie=f(Z.invert($).concat(X/Z.k),ee.invert($).concat(X/ee.k));return function(ae){if(ae===1)ae=ee;else{var re=ie(ae),J=X/re[2];ae=new Eo(J,$[0]-re[0]*J,$[1]-re[1]*J)}Y.zoom(null,ae)}})}function T(z,V,k){return!k&&z.__zooming||new P(z,V)}function P(z,V){this.that=z,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(z,V),this.taps=0}P.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,V){return this.mouse&&z!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var V=Jr(this.that).datum();u.call(z,this.that,new zCe(z,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:u}),V)}};function R(z,...V){if(!e.apply(this,arguments))return;var k=T(this,V).event(z),F=this.__zoom,q=Math.max(i[0],Math.min(i[1],F.k*Math.pow(2,r.apply(this,arguments)))),U=Ua(z);if(k.wheel)(k.mouse[0][0]!==U[0]||k.mouse[0][1]!==U[1])&&(k.mouse[1]=F.invert(k.mouse[0]=U)),clearTimeout(k.wheel);else{if(F.k===q)return;k.mouse=[U,F.invert(U)],jg(this),k.start()}wh(z),k.wheel=setTimeout(Y,b),k.zoom("mouse",n(j(O(F,q),k.mouse[0],k.mouse[1]),k.extent,s));function Y(){k.wheel=null,k.end()}}function D(z,...V){if(v||!e.apply(this,arguments))return;var k=z.currentTarget,F=T(this,V,!0).event(z),q=Jr(z.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",X,!0),U=Ua(z,k),Y=z.clientX,B=z.clientY;Cq(z.view),qS(z),F.mouse=[U,this.__zoom.invert(U)],jg(this),F.start();function $(Z){if(wh(Z),!F.moved){var ee=Z.clientX-Y,ie=Z.clientY-B;F.moved=ee*ee+ie*ie>w}F.event(Z).zoom("mouse",n(j(F.that.__zoom,F.mouse[0]=Ua(Z,k),F.mouse[1]),F.extent,s))}function X(Z){q.on("mousemove.zoom mouseup.zoom",null),Oq(Z.view,F.moved),wh(Z),F.event(Z).end()}}function K(z,...V){if(e.apply(this,arguments)){var k=this.__zoom,F=Ua(z.changedTouches?z.changedTouches[0]:z,this),q=k.invert(F),U=k.k*(z.shiftKey?.5:2),Y=n(j(O(k,U),F,q),t.apply(this,V),s);wh(z),c>0?Jr(this).transition().duration(c).call(N,Y,F,z):Jr(this).call(E.transform,Y,F,z)}}function L(z,...V){if(e.apply(this,arguments)){var k=z.touches,F=k.length,q=T(this,V,z.changedTouches.length===F).event(z),U,Y,B,$;for(qS(z),Y=0;Y<F;++Y)B=k[Y],$=Ua(B,this),$=[$,this.__zoom.invert($),B.identifier],q.touch0?!q.touch1&&q.touch0[2]!==$[2]&&(q.touch1=$,q.taps=0):(q.touch0=$,U=!0,q.taps=1+!!m);m&&(m=clearTimeout(m)),U&&(q.taps<2&&(d=$[0],m=setTimeout(function(){m=null},y)),jg(this),q.start())}}function I(z,...V){if(this.__zooming){var k=T(this,V).event(z),F=z.changedTouches,q=F.length,U,Y,B,$;for(wh(z),U=0;U<q;++U)Y=F[U],B=Ua(Y,this),k.touch0&&k.touch0[2]===Y.identifier?k.touch0[0]=B:k.touch1&&k.touch1[2]===Y.identifier&&(k.touch1[0]=B);if(Y=k.that.__zoom,k.touch1){var X=k.touch0[0],Z=k.touch0[1],ee=k.touch1[0],ie=k.touch1[1],ae=(ae=ee[0]-X[0])*ae+(ae=ee[1]-X[1])*ae,re=(re=ie[0]-Z[0])*re+(re=ie[1]-Z[1])*re;Y=O(Y,Math.sqrt(ae/re)),B=[(X[0]+ee[0])/2,(X[1]+ee[1])/2],$=[(Z[0]+ie[0])/2,(Z[1]+ie[1])/2]}else if(k.touch0)B=k.touch0[0],$=k.touch0[1];else return;k.zoom("touch",n(j(Y,B,$),k.extent,s))}}function G(z,...V){if(this.__zooming){var k=T(this,V).event(z),F=z.changedTouches,q=F.length,U,Y;for(qS(z),v&&clearTimeout(v),v=setTimeout(function(){v=null},y),U=0;U<q;++U)Y=F[U],k.touch0&&k.touch0[2]===Y.identifier?delete k.touch0:k.touch1&&k.touch1[2]===Y.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&&(Y=Ua(Y,this),Math.hypot(d[0]-Y[0],d[1]-Y[1])<S)){var B=Jr(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return E.wheelDelta=function(z){return arguments.length?(r=typeof z=="function"?z:ng(+z),E):r},E.filter=function(z){return arguments.length?(e=typeof z=="function"?z:ng(!!z),E):e},E.touchable=function(z){return arguments.length?(a=typeof z=="function"?z:ng(!!z),E):a},E.extent=function(z){return arguments.length?(t=typeof z=="function"?z:ng([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),E):t},E.scaleExtent=function(z){return arguments.length?(i[0]=+z[0],i[1]=+z[1],E):[i[0],i[1]]},E.translateExtent=function(z){return arguments.length?(s[0][0]=+z[0][0],s[1][0]=+z[1][0],s[0][1]=+z[0][1],s[1][1]=+z[1][1],E):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},E.constrain=function(z){return arguments.length?(n=z,E):n},E.duration=function(z){return arguments.length?(c=+z,E):c},E.interpolate=function(z){return arguments.length?(f=z,E):f},E.on=function(){var z=u.on.apply(u,arguments);return z===u?E:z},E.clickDistance=function(z){return arguments.length?(w=(z=+z)*z,E):Math.sqrt(w)},E.tapDistance=function(z){return arguments.length?(S=+z,E):S},E}const zi={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."},om=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],zq=["Enter"," ","Escape"],$q={"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 Lf;(function(e){e.Strict="strict",e.Loose="loose"})(Lf||(Lf={}));var xc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(xc||(xc={}));var sm;(function(e){e.Partial="partial",e.Full="full"})(sm||(sm={}));const Bq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var $s;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})($s||($s={}));var zf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(zf||(zf={}));var Le;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Le||(Le={}));const dL={[Le.Left]:Le.Right,[Le.Right]:Le.Left,[Le.Top]:Le.Bottom,[Le.Bottom]:Le.Top};function Uq(e){return e===null?null:e?"valid":"invalid"}const Hq=e=>"id"in e&&"source"in e&&"target"in e,qCe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),UA=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),rp=(e,t=[0,0])=>{const{width:n,height:r}=Xo(e),a=e.origin??t,i=n*a[0],s=r*a[1];return{x:e.position.x-i,y:e.position.y-s}},KCe=(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):UA(a)?a:t.nodeLookup.get(a.id));const c=s?Fy(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)},ap=(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,Fy(a)),r=!0)}),r?xx(n):{x:0,y:0,width:0,height:0}},HA=(e,t,[n,r,a]=[0,0,1],i=!1,s=!1)=>{const c={...op(t,[n,r,a]),width:t.width/a,height:t.height/a},f=[];for(const u of e.values()){const{measured:m,selectable:d=!0,hidden:v=!1}=u;if(s&&!d||v)continue;const y=m.width??u.width??u.initialWidth??null,b=m.height??u.height??u.initialHeight??null,w=lm(c,Bf(u)),S=(y??0)*(b??0),E=i&&w>0;(!u.internals.handleBounds||E||w>=S||u.dragging)&&f.push(u)}return f},VCe=(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 YCe(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 GCe({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const c=YCe(e,s),f=ap(c),u=FA(f,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(u,{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 Fq({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:f,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},m=s.origin??r;let d=s.extent||a;if(s.extent==="parent"&&!s.expandParent)if(!c)i==null||i("005",zi.error005());else{const y=c.measured.width,b=c.measured.height;y&&b&&(d=[[f,u],[f+y,u+b]])}else c&&Uf(s.extent)&&(d=[[s.extent[0][0]+f,s.extent[0][1]+u],[s.extent[1][0]+f,s.extent[1][1]+u]]);const v=Uf(d)?$c(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",zi.error015())),{position:{x:v.x-f+(s.measured.width??0)*m[0],y:v.y-u+(s.measured.height??0)*m[1]},positionAbsolute:v}}async function XCe({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 y=i.has(v.id),b=!y&&v.parentId&&s.find(w=>w.id===v.parentId);(y||b)&&s.push(v)}const c=new Set(t.map(v=>v.id)),f=r.filter(v=>v.deletable!==!1),m=VCe(s,f);for(const v of f)c.has(v.id)&&!m.find(b=>b.id===v.id)&&m.push(v);if(!a)return{edges:m,nodes:s};const d=await a({nodes:s,edges:m});return typeof d=="boolean"?d?{edges:m,nodes:s}:{edges:[],nodes:[]}:d}const $f=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),$c=(e={x:0,y:0},t,n)=>({x:$f(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:$f(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function qq(e,t,n){const{width:r,height:a}=Xo(n),{x:i,y:s}=n.internals.positionAbsolute;return $c(e,[[i,s],[i+r,s+a]],t)}const hL=(e,t,n)=>e<t?$f(Math.abs(e-t),1,t)/t:e>n?-$f(Math.abs(e-n),1,t)/t:0,Kq=(e,t,n=15,r=40)=>{const a=hL(e.x,r,t.width-r)*n,i=hL(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)}),W_=({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}),Bf=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=UA(e)?e.internals.positionAbsolute:rp(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}},Fy=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=UA(e)?e.internals.positionAbsolute:rp(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)}},Vq=(e,t)=>xx(yx(W_(e),W_(t))),lm=(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)},mL=e=>Va(e.width)&&Va(e.height)&&Va(e.x)&&Va(e.y),Va=e=>!isNaN(e)&&isFinite(e),WCe=(e,t)=>{},ip=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),op=({x:e,y:t},[n,r,a],i=!1,s=[1,1])=>{const c={x:(e-n)/a,y:(t-r)/a};return i?ip(c,s):c},qy=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function Ku(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 QCe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ku(e,n),a=Ku(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=Ku(e.top??e.y??0,n),a=Ku(e.bottom??e.y??0,n),i=Ku(e.left??e.x??0,t),s=Ku(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 ZCe(e,t,n,r,a,i){const{x:s,y:c}=qy(e,[t,n,r]),{x:f,y:u}=qy({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=a-f,d=i-u;return{left:Math.floor(s),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(d)}}const FA=(e,t,n,r,a,i)=>{const s=QCe(i,t,n),c=(t-s.x)/e.width,f=(n-s.y)/e.height,u=Math.min(c,f),m=$f(u,r,a),d=e.x+e.width/2,v=e.y+e.height/2,y=t/2-d*m,b=n/2-v*m,w=ZCe(e,y,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:y-S.left+S.right,y:b-S.top+S.bottom,zoom:m}},cm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Uf(e){return e!=null&&e!=="parent"}function Xo(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 Yq(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 Gq(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 pL(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function JCe(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function eOe(e){return{...$q,...e||{}}}function Mh(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:i,y:s}=Ya(e),c=op({x:i-((a==null?void 0:a.left)??0),y:s-((a==null?void 0:a.top)??0)},r),{x:f,y:u}=n?ip(c,t):c;return{xSnapped:f,ySnapped:u,...c}}const qA=e=>({width:e.offsetWidth,height:e.offsetHeight}),Xq=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},tOe=["INPUT","SELECT","TEXTAREA"];function Wq(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:tOe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Qq=e=>"clientX"in e,Ya=(e,t)=>{var i,s;const n=Qq(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)}},vL=(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,...qA(s)}})};function Zq({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:i,targetControlX:s,targetControlY:c}){const f=e*.125+a*.375+s*.375+n*.125,u=t*.125+i*.375+c*.375+r*.125,m=Math.abs(f-e),d=Math.abs(u-t);return[f,u,m,d]}function rg(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function gL({pos:e,x1:t,y1:n,x2:r,y2:a,c:i}){switch(e){case Le.Left:return[t-rg(t-r,i),n];case Le.Right:return[t+rg(r-t,i),n];case Le.Top:return[t,n-rg(n-a,i)];case Le.Bottom:return[t,n+rg(a-n,i)]}}function Jq({sourceX:e,sourceY:t,sourcePosition:n=Le.Bottom,targetX:r,targetY:a,targetPosition:i=Le.Top,curvature:s=.25}){const[c,f]=gL({pos:n,x1:e,y1:t,x2:r,y2:a,c:s}),[u,m]=gL({pos:i,x1:r,y1:a,x2:e,y2:t,c:s}),[d,v,y,b]=Zq({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:c,sourceControlY:f,targetControlX:u,targetControlY:m});return[`M${e},${t} C${c},${f} ${u},${m} ${r},${a}`,d,v,y,b]}function e9({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 nOe({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 rOe({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const i=yx(Fy(e),Fy(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 lm(s,xx(i))>0}const aOe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,iOe=(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)),oOe=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||aOe;let a;return Hq(e)?a={...e}:a={...e,id:r(e)},iOe(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function t9({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,i,s,c]=e9({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,i,s,c]}const yL={[Le.Left]:{x:-1,y:0},[Le.Right]:{x:1,y:0},[Le.Top]:{x:0,y:-1},[Le.Bottom]:{x:0,y:1}},sOe=({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},xL=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function lOe({source:e,sourcePosition:t=Le.Bottom,target:n,targetPosition:r=Le.Top,center:a,offset:i,stepPosition:s}){const c=yL[t],f=yL[r],u={x:e.x+c.x*i,y:e.y+c.y*i},m={x:n.x+f.x*i,y:n.y+f.y*i},d=sOe({source:u,sourcePosition:t,target:m}),v=d.x!==0?"x":"y",y=d[v];let b=[],w,S;const E={x:0,y:0},O={x:0,y:0},[,,j,A]=e9({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[v]*f[v]===-1){v==="x"?(w=a.x??u.x+(m.x-u.x)*s,S=a.y??(u.y+m.y)/2):(w=a.x??(u.x+m.x)/2,S=a.y??u.y+(m.y-u.y)*s);const T=[{x:w,y:u.y},{x:w,y:m.y}],P=[{x:u.x,y:S},{x:m.x,y:S}];c[v]===y?b=v==="x"?T:P:b=v==="x"?P:T}else{const T=[{x:u.x,y:m.y}],P=[{x:m.x,y:u.y}];if(v==="x"?b=c.x===y?P:T:b=c.y===y?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]===y?E[v]=(u[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]===f[I],z=u[I]>m[I],V=u[I]<m[I];(c[v]===1&&(!G&&z||G&&V)||c[v]!==1&&(!G&&V||G&&z))&&(b=v==="x"?T:P)}const R={x:u.x+E.x,y:u.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)),L=Math.max(Math.abs(R.y-b[0].y),Math.abs(D.y-b[0].y));K>=L?(w=(R.x+D.x)/2,S=b[0].y):(w=b[0].x,S=(R.y+D.y)/2)}return[[e,{x:u.x+E.x,y:u.y+E.y},...b,{x:m.x+O.x,y:m.y+O.y},n],w,S,j,A]}function cOe(e,t,n,r){const a=Math.min(xL(e,t)/2,xL(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 u=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${i+a*u},${s}Q ${i},${s} ${i},${s+a*m}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${i},${s+a*f}Q ${i},${s} ${i+a*c},${s}`}function Q_({sourceX:e,sourceY:t,sourcePosition:n=Le.Bottom,targetX:r,targetY:a,targetPosition:i=Le.Top,borderRadius:s=5,centerX:c,centerY:f,offset:u=20,stepPosition:m=.5}){const[d,v,y,b,w]=lOe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:i,center:{x:c,y:f},offset:u,stepPosition:m});return[d.reduce((E,O,j)=>{let A="";return j>0&&j<d.length-1?A=cOe(d[j-1],O,d[j+1],s):A=`${j===0?"M":"L"}${O.x} ${O.y}`,E+=A,E},""),v,y,b,w]}function bL(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function uOe(e){var d;const{sourceNode:t,targetNode:n}=e;if(!bL(t)||!bL(n))return null;const r=t.internals.handleBounds||wL(t.handles),a=n.internals.handleBounds||wL(n.handles),i=SL((r==null?void 0:r.source)??[],e.sourceHandle),s=SL(e.connectionMode===Lf.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(d=e.onError)==null||d.call(e,"008",zi.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||Le.Bottom,f=(s==null?void 0:s.position)||Le.Top,u=Bc(t,i,c),m=Bc(n,s,f);return{sourceX:u.x,sourceY:u.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:f}}function wL(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 Bc(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??Xo(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 SL(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Z_(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(f=>{if(f&&typeof f=="object"){const u=Z_(f,t);i.has(u)||(s.push({id:u,color:f.color||n,...f}),i.add(u))}}),s),[]).sort((s,c)=>s.id.localeCompare(c.id))}const n9=1e3,dOe=10,KA={nodeOrigin:[0,0],nodeExtent:om,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},hOe={...KA,checkEquality:!0};function VA(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function mOe(e,t,n){const r=VA(KA,n);for(const a of e.values())if(a.parentId)GA(a,e,t,r);else{const i=rp(a,r.nodeOrigin),s=Uf(a.extent)?a.extent:r.nodeExtent,c=$c(i,s,Xo(a));a.internals.positionAbsolute=c}}function pOe(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 YA(e){return e==="manual"}function J_(e,t,n,r={}){var u,m;const a=VA(hOe,r),i={i:0},s=new Map(t),c=a!=null&&a.elevateNodesOnSelect&&!YA(a.zIndexMode)?n9:0;let f=e.length>0;t.clear(),n.clear();for(const d of e){let v=s.get(d.id);if(a.checkEquality&&d===(v==null?void 0:v.internals.userNode))t.set(d.id,v);else{const y=rp(d,a.nodeOrigin),b=Uf(d.extent)?d.extent:a.nodeExtent,w=$c(y,b,Xo(d));v={...a.defaults,...d,measured:{width:(u=d.measured)==null?void 0:u.width,height:(m=d.measured)==null?void 0:m.height},internals:{positionAbsolute:w,handleBounds:pOe(d,v),z:r9(d,c,a.zIndexMode),userNode:d}},t.set(d.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(f=!1),d.parentId&&GA(v,t,n,r,i)}return f}function vOe(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 GA(e,t,n,r,a){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:c,zIndexMode:f}=VA(KA,r),u=e.parentId,m=t.get(u);if(!m){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}vOe(e,n),a&&!m.parentId&&m.internals.rootParentIndex===void 0&&f==="auto"&&(m.internals.rootParentIndex=++a.i,m.internals.z=m.internals.z+a.i*dOe),a&&m.internals.rootParentIndex!==void 0&&(a.i=m.internals.rootParentIndex);const d=i&&!YA(f)?n9:0,{x:v,y,z:b}=gOe(e,m,s,c,d,f),{positionAbsolute:w}=e.internals,S=v!==w.x||y!==w.y;(S||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:v,y}:w,z:b}})}function r9(e,t,n){const r=Va(e.zIndex)?e.zIndex:0;return YA(n)?r:r+(e.selected?t:0)}function gOe(e,t,n,r,a,i){const{x:s,y:c}=t.internals.positionAbsolute,f=Xo(e),u=rp(e,n),m=Uf(e.extent)?$c(u,e.extent,f):u;let d=$c({x:s+m.x,y:c+m.y},r,f);e.extent==="parent"&&(d=qq(d,f,t));const v=r9(e,a,i),y=t.internals.z??0;return{x:d.x,y:d.y,z:y>=v?y+1:v}}function XA(e,t,n,r=[0,0]){var s;const a=[],i=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const u=((s=i.get(c.parentId))==null?void 0:s.expandedRect)??Bf(f),m=Vq(u,c.rect);i.set(c.parentId,{expandedRect:m,parent:f})}return i.size>0&&i.forEach(({expandedRect:c,parent:f},u)=>{var j;const m=f.internals.positionAbsolute,d=Xo(f),v=f.origin??r,y=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(d.width,Math.round(c.width)),S=Math.max(d.height,Math.round(c.height)),E=(w-d.width)*v[0],O=(S-d.height)*v[1];(y>0||b>0||E||O)&&(a.push({id:u,type:"position",position:{x:f.position.x-y+E,y:f.position.y-b+O}}),(j=n.get(u))==null||j.forEach(A=>{e.some(N=>N.id===A.id)||a.push({id:A.id,type:"position",position:{x:A.position.x+y,y:A.position.y+b}})})),(d.width<c.width||d.height<c.height||y||b)&&a.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?v[0]*y-E:0),height:S+(b?v[1]*b-O:0)}})}),a}function yOe(e,t,n,r,a,i,s){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const u=[],m=window.getComputedStyle(c),{m22:d}=new window.DOMMatrixReadOnly(m.transform),v=[];for(const y of e.values()){const b=t.get(y.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),f=!0;continue}const w=qA(y.nodeElement),S=b.measured.width!==w.width||b.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!b.internals.handleBounds||y.force))){const O=y.nodeElement.getBoundingClientRect(),j=Uf(b.extent)?b.extent:i;let{positionAbsolute:A}=b.internals;b.parentId&&b.extent==="parent"?A=qq(A,w,t.get(b.parentId)):j&&(A=$c(A,j,w));const N={...b,measured:w,internals:{...b.internals,positionAbsolute:A,handleBounds:{source:vL("source",y.nodeElement,O,d,b.id),target:vL("target",y.nodeElement,O,d,b.id)}}};t.set(b.id,N),b.parentId&&GA(N,t,n,{nodeOrigin:a,zIndexMode:s}),f=!0,S&&(u.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&v.push({id:b.id,parentId:b.parentId,rect:Bf(N,a)}))}}if(v.length>0){const y=XA(v,t,n,a);u.push(...y)}return{changes:u,updatedInternals:f}}async function xOe({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 EL(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 f=r.get(s)||new Map;if(r.set(s,f.set(n,t)),i){s=`${a}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function a9(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:i,sourceHandle:s=null,targetHandle:c=null}=r,f={edgeId:r.id,source:a,target:i,sourceHandle:s,targetHandle:c},u=`${a}-${s}--${i}-${c}`,m=`${i}-${c}--${a}-${s}`;EL("source",f,m,e,a,s),EL("target",f,u,e,i,c),t.set(r.id,r)}}function i9(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:i9(n,t):!1}function _L(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 bOe(e,t,n,r){const a=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!i9(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,f;const a=[];for(const[u,m]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&a.push({...d,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:((f=t.get(e))==null?void 0:f.position)||i.position,dragging:r}:a[0],a]}function wOe({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=ip(i,t);return{x:s.x-i.x,y:s.y-i.y}}function SOe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let i={x:null,y:null},s=0,c=new Map,f=!1,u={x:0,y:0},m=null,d=!1,v=null,y=!1,b=!1,w=null;function S({noDragClassName:O,handleSelector:j,domNode:A,isSelectable:N,nodeId:T,nodeClickDistance:P=0}){v=Jr(A);function R({x:I,y:G}){const{nodeLookup:z,nodeExtent:V,snapGrid:k,snapToGrid:F,nodeOrigin:q,onNodeDrag:U,onSelectionDrag:Y,onError:B,updateNodePositions:$}=t();i={x:I,y:G};let X=!1;const Z=c.size>1,ee=Z&&V?W_(ap(c)):null,ie=Z&&F?wOe({dragItems:c,snapGrid:k,x:I,y:G}):null;for(const[ae,re]of c){if(!z.has(ae))continue;let J={x:I-re.distance.x,y:G-re.distance.y};F&&(J=ie?{x:Math.round(J.x+ie.x),y:Math.round(J.y+ie.y)}:ip(J,k));let le=null;if(Z&&V&&!re.extent&&ee){const{positionAbsolute:ge}=re.internals,ye=ge.x-ee.x+V[0][0],De=ge.x+re.measured.width-ee.x2+V[1][0],Me=ge.y-ee.y+V[0][1],Ke=ge.y+re.measured.height-ee.y2+V[1][1];le=[[ye,Me],[De,Ke]]}const{position:he,positionAbsolute:ne}=Fq({nodeId:ae,nextPosition:J,nodeLookup:z,nodeExtent:le||V,nodeOrigin:q,onError:B});X=X||re.position.x!==he.x||re.position.y!==he.y,re.position=he,re.internals.positionAbsolute=ne}if(b=b||X,!!X&&($(c,!0),w&&(r||U||!T&&Y))){const[ae,re]=KS({nodeId:T,dragItems:c,nodeLookup:z});r==null||r(w,c,ae,re),U==null||U(w,ae,re),T||Y==null||Y(w,re)}}async function D(){if(!m)return;const{transform:I,panBy:G,autoPanSpeed:z,autoPanOnNodeDrag:V}=t();if(!V){f=!1,cancelAnimationFrame(s);return}const[k,F]=Kq(u,m,z);(k!==0||F!==0)&&(i.x=(i.x??0)-k/I[2],i.y=(i.y??0)-F/I[2],await G({x:k,y:F})&&R(i)),s=requestAnimationFrame(D)}function K(I){var Z;const{nodeLookup:G,multiSelectionActive:z,nodesDraggable:V,transform:k,snapGrid:F,snapToGrid:q,selectNodesOnDrag:U,onNodeDragStart:Y,onSelectionDragStart:B,unselectNodesAndEdges:$}=t();d=!0,(!U||!N)&&!z&&T&&((Z=G.get(T))!=null&&Z.selected||$()),N&&U&&T&&(e==null||e(T));const X=Mh(I.sourceEvent,{transform:k,snapGrid:F,snapToGrid:q,containerBounds:m});if(i=X,c=bOe(G,V,X,T),c.size>0&&(n||Y||!T&&B)){const[ee,ie]=KS({nodeId:T,dragItems:c,nodeLookup:G});n==null||n(I.sourceEvent,c,ee,ie),Y==null||Y(I.sourceEvent,ee,ie),T||B==null||B(I.sourceEvent,ie)}}const L=Aq().clickDistance(P).on("start",I=>{const{domNode:G,nodeDragThreshold:z,transform:V,snapGrid:k,snapToGrid:F}=t();m=(G==null?void 0:G.getBoundingClientRect())||null,y=!1,b=!1,w=I.sourceEvent,z===0&&K(I),i=Mh(I.sourceEvent,{transform:V,snapGrid:k,snapToGrid:F,containerBounds:m}),u=Ya(I.sourceEvent,m)}).on("drag",I=>{const{autoPanOnNodeDrag:G,transform:z,snapGrid:V,snapToGrid:k,nodeDragThreshold:F,nodeLookup:q}=t(),U=Mh(I.sourceEvent,{transform:z,snapGrid:V,snapToGrid:k,containerBounds:m});if(w=I.sourceEvent,(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||T&&!q.has(T))&&(y=!0),!y){if(!f&&G&&d&&(f=!0,D()),!d){const Y=Ya(I.sourceEvent,m),B=Y.x-u.x,$=Y.y-u.y;Math.sqrt(B*B+$*$)>F&&K(I)}(i.x!==U.xSnapped||i.y!==U.ySnapped)&&c&&d&&(u=Ya(I.sourceEvent,m),R(U))}}).on("end",I=>{if(!(!d||y)&&(f=!1,d=!1,cancelAnimationFrame(s),c.size>0)){const{nodeLookup:G,updateNodePositions:z,onNodeDragStop:V,onSelectionDragStop:k}=t();if(b&&(z(c,!1),b=!1),a||V||!T&&k){const[F,q]=KS({nodeId:T,dragItems:c,nodeLookup:G,dragging:!1});a==null||a(I.sourceEvent,c,F,q),V==null||V(I.sourceEvent,F,q),T||k==null||k(I.sourceEvent,q)}}}).filter(I=>{const G=I.target;return!I.button&&(!O||!_L(G,`.${O}`,A))&&(!j||_L(G,j,A))});v.call(L)}function E(){v==null||v.on(".drag",null)}return{update:S,destroy:E}}function EOe(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())lm(a,Bf(i))>0&&r.push(i);return r}const _Oe=250;function jOe(e,t,n,r){var c,f;let a=[],i=1/0;const s=EOe(e,n,t+_Oe);for(const u of s){const m=[...((c=u.internals.handleBounds)==null?void 0:c.source)??[],...((f=u.internals.handleBounds)==null?void 0:f.target)??[]];for(const d of m){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:v,y}=Bc(u,d,d.position,!0),b=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(y-e.y,2));b>t||(b<i?(a=[{...d,x:v,y}],i=b):b===i&&a.push({...d,x:v,y}))}}if(!a.length)return null;if(a.length>1){const u=r.type==="source"?"target":"source";return a.find(m=>m.type===u)??a[0]}return a[0]}function o9(e,t,n,r,a,i=!1){var u,m,d;const s=r.get(e);if(!s)return null;const c=a==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((m=s.internals.handleBounds)==null?void 0:m.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],f=(n?c==null?void 0:c.find(v=>v.id===n):c==null?void 0:c[0])??null;return f&&i?{...f,...Bc(s,f,f.position,!0)}:f}function s9(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function COe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const l9=()=>!0;function OOe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:i,isTarget:s,domNode:c,nodeLookup:f,lib:u,autoPanOnConnect:m,flowId:d,panBy:v,cancelConnection:y,onConnectStart:b,onConnect:w,onConnectEnd:S,isValidConnection:E=l9,onReconnectEnd:O,updateConnection:j,getTransform:A,getFromHandle:N,autoPanSpeed:T,dragThreshold:P=1,handleDomNode:R}){const D=Xq(e.target);let K=0,L;const{x:I,y:G}=Ya(e),z=s9(i,R),V=c==null?void 0:c.getBoundingClientRect();let k=!1;if(!V||!z)return;const F=o9(a,z,r,f,t);if(!F)return;let q=Ya(e,V),U=!1,Y=null,B=!1,$=null;function X(){if(!m||!V)return;const[he,ne]=Kq(q,V,T);v({x:he,y:ne}),K=requestAnimationFrame(X)}const Z={...F,nodeId:a,type:z,position:F.position},ee=f.get(a);let ae={inProgress:!0,isValid:null,from:Bc(ee,Z,Le.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ee,to:q,toHandle:null,toPosition:dL[Z.position],toNode:null,pointer:q};function re(){k=!0,j(ae),b==null||b(e,{nodeId:a,handleId:r,handleType:z})}P===0&&re();function J(he){if(!k){const{x:Ke,y:Bt}=Ya(he),ut=Ke-I,Sn=Bt-G;if(!(ut*ut+Sn*Sn>P*P))return;re()}if(!N()||!Z){le(he);return}const ne=A();q=Ya(he,V),L=jOe(op(q,ne,!1,[1,1]),n,f,Z),U||(X(),U=!0);const ge=c9(he,{handle:L,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:s?"target":"source",isValidConnection:E,doc:D,lib:u,flowId:d,nodeLookup:f});$=ge.handleDomNode,Y=ge.connection,B=COe(!!L,ge.isValid);const ye=f.get(a),De=ye?Bc(ye,Z,Le.Left,!0):ae.from,Me={...ae,from:De,isValid:B,to:ge.toHandle&&B?qy({x:ge.toHandle.x,y:ge.toHandle.y},ne):q,toHandle:ge.toHandle,toPosition:B&&ge.toHandle?ge.toHandle.position:dL[Z.position],toNode:ge.toHandle?f.get(ge.toHandle.nodeId):null,pointer:q};j(Me),ae=Me}function le(he){if(!("touches"in he&&he.touches.length>0)){if(k){(L||$)&&Y&&B&&(w==null||w(Y));const{inProgress:ne,...ge}=ae,ye={...ge,toPosition:ae.toHandle?ae.toPosition:null};S==null||S(he,ye),i&&(O==null||O(he,ye))}y(),cancelAnimationFrame(K),U=!1,B=!1,Y=null,$=null,D.removeEventListener("mousemove",J),D.removeEventListener("mouseup",le),D.removeEventListener("touchmove",J),D.removeEventListener("touchend",le)}}D.addEventListener("mousemove",J),D.addEventListener("mouseup",le),D.addEventListener("touchmove",J),D.addEventListener("touchend",le)}function c9(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:i,doc:s,lib:c,flowId:f,isValidConnection:u=l9,nodeLookup:m}){const d=i==="target",v=t?s.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:b}=Ya(e),w=s.elementFromPoint(y,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=s9(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:d?j:r,sourceHandle:d?A:a,target:d?r:j,targetHandle:d?a:A};E.connection=P;const D=N&&T&&(n===Lf.Strict?d&&O==="source"||!d&&O==="target":j!==r||A!==a);E.isValid=D&&u(P),E.toHandle=o9(j,O,A,m,n,!0)}return E}const ej={onPointerDown:OOe,isValid:c9};function AOe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=Jr(e);function i({translateExtent:c,width:f,height:u,zoomStep:m=1,pannable:d=!0,zoomable:v=!0,inversePan:y=!1}){const b=j=>{if(j.sourceEvent.type!=="wheel"||!t)return;const A=n(),N=j.sourceEvent.ctrlKey&&cm()?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]))*(y?-1:1),R={x:A[0]-T[0]*P,y:A[1]-T[1]*P},D=[[0,0],[f,u]];t.setViewportConstrained({x:R.x,y:R.y,zoom:A[2]},D,c)},O=Lq().on("start",S).on("zoom",d?E:null).on("zoom.wheel",v?b:null);a.call(O,{})}function s(){a.on("zoom",null)}return{update:i,destroy:s,pointer:Ua}}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),ef=(e,t)=>e.target.closest(`.${t}`),u9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),NOe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,YS=(e,t=0,n=NOe,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},f9=e=>{const t=e.ctrlKey&&cm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function TOe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:u}){return m=>{if(ef(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(m.ctrlKey&&s){const S=Ua(m),E=f9(m),O=d*Math.pow(2,E);r.scaleTo(n,O,S,m);return}const v=m.deltaMode===1?20:1;let y=a===xc.Vertical?0:m.deltaX*v,b=a===xc.Horizontal?0:m.deltaY*v;!cm()&&m.shiftKey&&a!==xc.Vertical&&(y=m.deltaY*v,b=0),r.translateBy(n,-(y/d)*i,-(b/d)*i,{internal:!0});const w=bx(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(m,w),e.panScrollTimeout=setTimeout(()=>{u==null||u(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,w))}}function POe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,c=ef(r,e);if(r.ctrlKey&&i&&c&&r.preventDefault(),s||c)return null;r.preventDefault(),n.call(this,r,a)}}function MOe({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 kOe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return i=>{var s,c;e.usedRightMouseButton=!!(n&&u9(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 ROe({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&&u9(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const f=bx(s.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(s.sourceEvent,f)},n?150:0)}}}function DOe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:c,noPanClassName:f,lib:u,connectionInProgress:m}){return d=>{var S;const v=e||t,y=n&&d.ctrlKey,b=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ef(d,`${u}-flow__node`)||ef(d,`${u}-flow__edge`)))return!0;if(!r&&!v&&!a&&!i&&!n||s||m&&!b||ef(d,c)&&b||ef(d,f)&&(!b||a&&b&&!e)||!n&&d.ctrlKey&&b)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!v&&!a&&!y&&b||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||b)&&w}}function IOe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:c,onDraggingChange:f}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),d=Lq().scaleExtent([t,n]).translateExtent(r),v=Jr(e).call(d);O({x:a.x,y:a.y,zoom:$f(a.zoom,t,n)},[[0,0],[m.width,m.height]],r);const y=v.on("wheel.zoom"),b=v.on("dblclick.zoom");d.wheelDelta(f9);function w(L,I){return v?new Promise(G=>{d==null||d.interpolate((I==null?void 0:I.interpolate)==="linear"?Co:xg).transform(YS(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>G(!0)),L)}):Promise.resolve(!1)}function S({noWheelClassName:L,noPanClassName:I,onPaneContextMenu:G,userSelectionActive:z,panOnScroll:V,panOnDrag:k,panOnScrollMode:F,panOnScrollSpeed:q,preventScrolling:U,zoomOnPinch:Y,zoomOnScroll:B,zoomOnDoubleClick:$,zoomActivationKeyPressed:X,lib:Z,onTransformChange:ee,connectionInProgress:ie,paneClickDistance:ae,selectionOnDrag:re}){z&&!u.isZoomingOrPanning&&E();const J=V&&!X&&!z;d.clickDistance(re?1/0:!Va(ae)||ae<0?0:ae);const le=J?TOe({zoomPanValues:u,noWheelClassName:L,d3Selection:v,d3Zoom:d,panOnScrollMode:F,panOnScrollSpeed:q,zoomOnPinch:Y,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:c}):POe({noWheelClassName:L,preventScrolling:U,d3ZoomHandler:y});if(v.on("wheel.zoom",le,{passive:!1}),!z){const ne=MOe({zoomPanValues:u,onDraggingChange:f,onPanZoomStart:s});d.on("start",ne);const ge=kOe({zoomPanValues:u,panOnDrag:k,onPaneContextMenu:!!G,onPanZoom:i,onTransformChange:ee});d.on("zoom",ge);const ye=ROe({zoomPanValues:u,panOnDrag:k,panOnScroll:V,onPaneContextMenu:G,onPanZoomEnd:c,onDraggingChange:f});d.on("end",ye)}const he=DOe({zoomActivationKeyPressed:X,panOnDrag:k,zoomOnScroll:B,panOnScroll:V,zoomOnDoubleClick:$,zoomOnPinch:Y,userSelectionActive:z,noPanClassName:I,noWheelClassName:L,lib:Z,connectionInProgress:ie});d.filter(he),$?v.on("dblclick.zoom",b):v.on("dblclick.zoom",null)}function E(){d.on("zoom",null)}async function O(L,I,G){const z=VS(L),V=d==null?void 0:d.constrain()(z,I,G);return V&&await w(V),new Promise(k=>k(V))}async function j(L,I){const G=VS(L);return await w(G,I),new Promise(z=>z(G))}function A(L){if(v){const I=VS(L),G=v.property("__zoom");(G.k!==L.zoom||G.x!==L.x||G.y!==L.y)&&(d==null||d.transform(v,I,null,{sync:!0}))}}function N(){const L=v?Iq(v.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}function T(L,I){return v?new Promise(G=>{d==null||d.interpolate((I==null?void 0:I.interpolate)==="linear"?Co:xg).scaleTo(YS(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>G(!0)),L)}):Promise.resolve(!1)}function P(L,I){return v?new Promise(G=>{d==null||d.interpolate((I==null?void 0:I.interpolate)==="linear"?Co:xg).scaleBy(YS(v,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>G(!0)),L)}):Promise.resolve(!1)}function R(L){d==null||d.scaleExtent(L)}function D(L){d==null||d.translateExtent(L)}function K(L){const I=!Va(L)||L<0?0:L;d==null||d.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 Hf;(function(e){e.Line="line",e.Handle="handle"})(Hf||(Hf={}));function LOe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:i}){const s=e-t,c=n-r,f=[s>0?1:s<0?-1:0,c>0?1:c<0?-1:0];return s&&a&&(f[0]=f[0]*-1),c&&i&&(f[1]=f[1]*-1),f}function jL(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 Ps(e,t){return Math.max(0,t-e)}function Ms(e,t){return Math.max(0,e-t)}function ag(e,t,n){return Math.max(0,t-e,e-n)}function CL(e,t){return e?!t:t}function zOe(e,t,n,r,a,i,s,c){let{affectsX:f,affectsY:u}=t;const{isHorizontal:m,isVertical:d}=t,v=m&&d,{xSnapped:y,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?y-e.pointerX:0),D=Math.floor(d?b-e.pointerY:0);const K=N+(f?-R:R),L=T+(u?-D:D),I=-i[0]*N,G=-i[1]*T;let z=ag(K,w,S),V=ag(L,E,O);if(s){let q=0,U=0;f&&R<0?q=Ps(j+R+I,s[0][0]):!f&&R>0&&(q=Ms(j+K+I,s[1][0])),u&&D<0?U=Ps(A+D+G,s[0][1]):!u&&D>0&&(U=Ms(A+L+G,s[1][1])),z=Math.max(z,q),V=Math.max(V,U)}if(c){let q=0,U=0;f&&R>0?q=Ms(j+R,c[0][0]):!f&&R<0&&(q=Ps(j+K,c[1][0])),u&&D>0?U=Ms(A+D,c[0][1]):!u&&D<0&&(U=Ps(A+L,c[1][1])),z=Math.max(z,q),V=Math.max(V,U)}if(a){if(m){const q=ag(K/P,E,O)*P;if(z=Math.max(z,q),s){let U=0;!f&&!u||f&&!u&&v?U=Ms(A+G+K/P,s[1][1])*P:U=Ps(A+G+(f?R:-R)/P,s[0][1])*P,z=Math.max(z,U)}if(c){let U=0;!f&&!u||f&&!u&&v?U=Ps(A+K/P,c[1][1])*P:U=Ms(A+(f?R:-R)/P,c[0][1])*P,z=Math.max(z,U)}}if(d){const q=ag(L*P,w,S)/P;if(V=Math.max(V,q),s){let U=0;!f&&!u||u&&!f&&v?U=Ms(j+L*P+I,s[1][0])/P:U=Ps(j+(u?D:-D)*P+I,s[0][0])/P,V=Math.max(V,U)}if(c){let U=0;!f&&!u||u&&!f&&v?U=Ps(j+L*P,c[1][0])/P:U=Ms(j+(u?D:-D)*P,c[0][0])/P,V=Math.max(V,U)}}}D=D+(D<0?V:-V),R=R+(R<0?z:-z),a&&(v?K>L*P?D=(CL(f,u)?-R:R)/P:R=(CL(f,u)?-D:D)*P:m?(D=R/P,u=f):(R=D*P,f=u));const k=f?j+R:j,F=u?A+D:A;return{width:N+(f?-R:R),height:T+(u?-D:D),x:i[0]*R*(f?-1:1)+k,y:i[1]*D*(u?-1:1)+F}}const d9={width:0,height:0,x:0,y:0},$Oe={...d9,pointerX:0,pointerY:0,aspectRatio:1};function BOe(e){return[[0,0],[e.measured.width,e.measured.height]]}function UOe(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,f=n[1]*s;return[[r-c,a-f],[r+i-c,a+s-f]]}function HOe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const i=Jr(e);let s={controlDirection:jL("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:u,boundaries:m,keepAspectRatio:d,resizeDirection:v,onResizeStart:y,onResize:b,onResizeEnd:w,shouldResize:S}){let E={...d9},O={...$Oe};s={boundaries:m,resizeDirection:v,keepAspectRatio:d,controlDirection:jL(u)};let j,A=null,N=[],T,P,R,D=!1;const K=Aq().on("start",L=>{const{nodeLookup:I,transform:G,snapGrid:z,snapToGrid:V,nodeOrigin:k,paneDomNode:F}=n();if(j=I.get(t),!j)return;A=(F==null?void 0:F.getBoundingClientRect())??null;const{xSnapped:q,ySnapped:U}=Mh(L.sourceEvent,{transform:G,snapGrid:z,snapToGrid:V,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:U,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"?BOe(T):void 0),N=[],R=void 0;for(const[Y,B]of I)if(B.parentId===t&&(N.push({id:Y,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const $=UOe(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=$}y==null||y(L,{...E})}).on("drag",L=>{const{transform:I,snapGrid:G,snapToGrid:z,nodeOrigin:V}=n(),k=Mh(L.sourceEvent,{transform:I,snapGrid:G,snapToGrid:z,containerBounds:A}),F=[];if(!j)return;const{x:q,y:U,width:Y,height:B}=E,$={},X=j.origin??V,{width:Z,height:ee,x:ie,y:ae}=zOe(O,s.controlDirection,k,s.boundaries,s.keepAspectRatio,X,P,R),re=Z!==Y,J=ee!==B,le=ie!==q&&re,he=ae!==U&&J;if(!le&&!he&&!re&&!J)return;if((le||he||X[0]===1||X[1]===1)&&($.x=le?ie:E.x,$.y=he?ae:E.y,E.x=$.x,E.y=$.y,N.length>0)){const De=ie-q,Me=ae-U;for(const Ke of N)Ke.position={x:Ke.position.x-De+X[0]*(Z-Y),y:Ke.position.y-Me+X[1]*(ee-B)},F.push(Ke)}if((re||J)&&($.width=re&&(!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=LOe({width:E.width,prevWidth:Y,height:E.height,prevHeight:B,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),ge={...E,direction:ne};(S==null?void 0:S(L,ge))!==!1&&(D=!0,b==null||b(L,ge),r($,F))}).on("end",L=>{D&&(w==null||w(L,{...E}),a==null||a({...E}),D=!1)});i.call(K)}function f(){i.on(".drag",null)}return{update:c,destroy:f}}const FOe={},OL=e=>{let t;const n=new Set,r=(m,d)=>{const v=typeof m=="function"?m(t):m;if(!Object.is(v,t)){const y=t;t=d??(typeof v!="object"||v===null)?v:Object.assign({},t,v),n.forEach(b=>b(t,y))}},a=()=>t,f={setState:r,getState:a,getInitialState:()=>u,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(FOe?"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()}},u=t=e(r,a,f);return f},qOe=e=>e?OL(e):OL,{useDebugValue:KOe}=xe,{useSyncExternalStoreWithSelector:VOe}=lse,YOe=e=>e;function h9(e,t=YOe,n){const r=VOe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return KOe(r),r}const AL=(e,t)=>{const n=qOe(e),r=(a,i=t)=>h9(n,a,i);return Object.assign(r,n),r},GOe=(e,t)=>e?AL(e,t):AL;function Gt(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),XOe=wx.Provider,m9=zi.error001();function lt(e,t){const n=x.useContext(wx);if(n===null)throw new Error(m9);return h9(n,e,t)}function Xt(){const e=x.useContext(wx);if(e===null)throw new Error(m9);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const NL={display:"none"},WOe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},p9="react-flow__node-desc",v9="react-flow__edge-desc",QOe="react-flow__aria-live",ZOe=e=>e.ariaLiveMessage,JOe=e=>e.ariaLabelConfig;function eAe({rfId:e}){const t=lt(ZOe);return p.jsx("div",{id:`${QOe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:WOe,children:t})}function tAe({rfId:e,disableKeyboardA11y:t}){const n=lt(JOe);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${p9}-${e}`,style:NL,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${v9}-${e}`,style:NL,children:n["edge.a11yDescription.default"]}),!t&&p.jsx(eAe,{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:wn(["react-flow__panel",n,...s]),style:r,ref:i,...a,children:t})});Sx.displayName="Panel";function nAe({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 rAe=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}},ig=e=>e.id;function aAe(e,t){return Gt(e.selectedNodes.map(ig),t.selectedNodes.map(ig))&&Gt(e.selectedEdges.map(ig),t.selectedEdges.map(ig))}function iAe({onSelectionChange:e}){const t=Xt(),{selectedNodes:n,selectedEdges:r}=lt(rAe,aAe);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 oAe=e=>!!e.onSelectionChangeHandlers;function sAe({onSelectionChange:e}){const t=lt(oAe);return e||t?p.jsx(iAe,{onSelectionChange:e}):null}const g9=[0,0],lAe={x:0,y:0,zoom:1},cAe=["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"],TL=[...cAe,"rfId"],uAe=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}),PL={translateExtent:om,nodeOrigin:g9,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:f}=lt(uAe,Gt),u=Xt();x.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{m.current=PL,c()}),[]);const m=x.useRef(PL);return x.useEffect(()=>{for(const d of TL){const v=e[d],y=m.current[d];v!==y&&(typeof e[d]>"u"||(d==="nodes"?t(v):d==="edges"?n(v):d==="minZoom"?r(v):d==="maxZoom"?a(v):d==="translateExtent"?i(v):d==="nodeExtent"?s(v):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:eOe(v)}):d==="fitView"?u.setState({fitViewQueued:v}):d==="fitViewOptions"?u.setState({fitViewOptions:v}):u.setState({[d]:v})))}m.current=e},TL.map(d=>e[d])),null}function ML(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function dAe(e){var r;const[t,n]=x.useState(e==="system"?null:e);return x.useEffect(()=>{if(e!=="system"){n(e);return}const a=ML(),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=ML())!=null&&r.matches?"dark":"light"}const kL=typeof document<"u"?document:null;function um(e=null,t={target:kL,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 u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
`).replace(`

`,`
+`).split(`
`)),m=u.reduce((d,v)=>d.concat(...v),[]);return[u,m]}return[[],[]]},[e]);return x.useEffect(()=>{const f=(t==null?void 0:t.target)??kL,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=y=>{var S,E;if(a.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!a.current||a.current&&!u)&&Wq(y))return!1;const w=DL(y.code,c);if(i.current.add(y[w]),RL(s,i.current,!1)){const O=((E=(S=y.composedPath)==null?void 0:S.call(y))==null?void 0:E[0])||y.target,j=(O==null?void 0:O.nodeName)==="BUTTON"||(O==null?void 0:O.nodeName)==="A";t.preventDefault!==!1&&(a.current||!j)&&y.preventDefault(),r(!0)}},d=y=>{const b=DL(y.code,c);RL(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(y[b]),y.key==="Meta"&&i.current.clear(),a.current=!1},v=()=>{i.current.clear(),r(!1)};return f==null||f.addEventListener("keydown",m),f==null||f.addEventListener("keyup",d),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{f==null||f.removeEventListener("keydown",m),f==null||f.removeEventListener("keyup",d),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,r]),n}function RL(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function DL(e,t){return t.includes(e)?"code":"key"}const hAe=()=>{const e=Xt();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(),f=FA(t,r,a,i,s,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{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:f}=s.getBoundingClientRect(),u={x:t.x-c,y:t.y-f},m=n.snapGrid??a,d=n.snapToGrid??i;return op(u,r,d,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:i}=r.getBoundingClientRect(),s=qy(t,n);return{x:s.x+a,y:s.y+i}}}),[])};function y9(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 f of s)mAe(f,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 mAe(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 pAe(e,t){return y9(e,t)}function vAe(e,t){return y9(e,t)}function tc(e,t){return{id:e,type:"select",selected:t}}function tf(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(tc(i.id,s)))}return r}function IL({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),f=((a=c==null?void 0:c.internals)==null?void 0:a.userNode)??c;f!==void 0&&f!==s&&n.push({id:s.id,item:s,type:"replace"}),f===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 LL(e){return{id:e.id,type:"remove"}}const zL=e=>qCe(e),gAe=e=>Hq(e);function x9(e){return x.forwardRef(e)}const yAe=typeof window<"u"?x.useLayoutEffect:x.useEffect;function $L(e){const[t,n]=x.useState(BigInt(0)),[r]=x.useState(()=>xAe(()=>n(a=>a+BigInt(1))));return yAe(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function xAe(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const b9=x.createContext(null);function bAe({children:e}){const t=Xt(),n=x.useCallback(c=>{const{nodes:f=[],setNodes:u,hasDefaultNodes:m,onNodesChange:d,nodeLookup:v,fitViewQueued:y,onNodesChangeMiddlewareMap:b}=t.getState();let w=f;for(const E of c)w=typeof E=="function"?E(w):E;let S=IL({items:w,lookup:v});for(const E of b.values())S=E(S);m&&u(w),S.length>0?d==null||d(S):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:O,setNodes:j}=t.getState();E&&j(O)})},[]),r=$L(n),a=x.useCallback(c=>{const{edges:f=[],setEdges:u,hasDefaultEdges:m,onEdgesChange:d,edgeLookup:v}=t.getState();let y=f;for(const b of c)y=typeof b=="function"?b(y):b;m?u(y):d&&d(IL({items:y,lookup:v}))},[]),i=$L(a),s=x.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return p.jsx(b9.Provider,{value:s,children:e})}function wAe(){const e=x.useContext(b9);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const SAe=e=>!!e.panZoom;function Ex(){const e=hAe(),t=Xt(),n=wAe(),r=lt(SAe),a=x.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},c=d=>{n.edgeQueue.push(d)},f=d=>{var E,O;const{nodeLookup:v,nodeOrigin:y}=t.getState(),b=zL(d)?d:v.get(d.id),w=b.parentId?Gq(b.position,b.measured,b.parentId,v,y):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 Bf(S)},u=(d,v,y={replace:!1})=>{s(b=>b.map(w=>{if(w.id===d){const S=typeof v=="function"?v(w):v;return y.replace&&zL(S)?S:{...w,...S}}return w}))},m=(d,v,y={replace:!1})=>{c(b=>b.map(w=>{if(w.id===d){const S=typeof v=="function"?v(w):v;return y.replace&&gAe(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var v;return(v=i(d))==null?void 0:v.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(v=>({...v}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:c,addNodes:d=>{const v=Array.isArray(d)?d:[d];n.nodeQueue.push(y=>[...y,...v])},addEdges:d=>{const v=Array.isArray(d)?d:[d];n.edgeQueue.push(y=>[...y,...v])},toObject:()=>{const{nodes:d=[],edges:v=[],transform:y}=t.getState(),[b,w,S]=y;return{nodes:d.map(E=>({...E})),edges:v.map(E=>({...E})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:d=[],edges:v=[]})=>{const{nodes:y,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:E,triggerEdgeChanges:O,onDelete:j,onBeforeDelete:A}=t.getState(),{nodes:N,edges:T}=await XCe({nodesToRemove:d,edgesToRemove:v,nodes:y,edges:b,onBeforeDelete:A}),P=T.length>0,R=N.length>0;if(P){const D=T.map(LL);S==null||S(T),O(D)}if(R){const D=N.map(LL);w==null||w(N),E(D)}return(R||P)&&(j==null||j({nodes:N,edges:T})),{deletedNodes:N,deletedEdges:T}},getIntersectingNodes:(d,v=!0,y)=>{const b=mL(d),w=b?d:f(d),S=y!==void 0;return w?(y||t.getState().nodes).filter(E=>{const O=t.getState().nodeLookup.get(E.id);if(O&&!b&&(E.id===d.id||!O.internals.positionAbsolute))return!1;const j=Bf(S?E:O),A=lm(j,w);return v&&A>0||A>=j.width*j.height||A>=w.width*w.height}):[]},isNodeIntersecting:(d,v,y=!0)=>{const w=mL(d)?d:f(d);if(!w)return!1;const S=lm(w,v);return y&&S>0||S>=v.width*v.height||S>=w.width*w.height},updateNode:u,updateNodeData:(d,v,y={replace:!1})=>{u(d,b=>{const w=typeof v=="function"?v(b):v;return y.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},y)},updateEdge:m,updateEdgeData:(d,v,y={replace:!1})=>{m(d,b=>{const w=typeof v=="function"?v(b):v;return y.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},y)},getNodesBounds:d=>{const{nodeLookup:v,nodeOrigin:y}=t.getState();return KCe(d,{nodeLookup:v,nodeOrigin:y})},getHandleConnections:({type:d,id:v,nodeId:y})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${y}-${d}${v?`-${v}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:d,handleId:v,nodeId:y})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${y}${d?v?`-${d}-${v}`:`-${d}`:""}`))==null?void 0:b.values())??[])},fitView:async d=>{const v=t.getState().fitViewResolver??JCe();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:v}),n.nodeQueue.push(y=>[...y]),v.promise}}},[]);return x.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const BL=e=>e.selected,EAe=typeof window<"u"?window:void 0;function _Ae({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Xt(),{deleteElements:r}=Ex(),a=um(e,{actInsideInputWithModifier:!1}),i=um(t,{target:EAe});x.useEffect(()=>{if(a){const{edges:s,nodes:c}=n.getState();r({nodes:c.filter(BL),edges:s.filter(BL)}),n.setState({nodesSelectionActive:!1})}},[a]),x.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function jAe(e){const t=Xt();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=qA(e.current);(r.height===0||r.width===0)&&((c=(s=t.getState()).onError)==null||c.call(s,"004",zi.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},CAe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function OAe({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=xc.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:u,minZoom:m,maxZoom:d,zoomActivationKeyCode:v,preventScrolling:y=!0,children:b,noWheelClassName:w,noPanClassName:S,onViewportChange:E,isControlledViewport:O,paneClickDistance:j,selectionOnDrag:A}){const N=Xt(),T=x.useRef(null),{userSelectionActive:P,lib:R,connectionInProgress:D}=lt(CAe,Gt),K=um(v),L=x.useRef();jAe(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){L.current=IOe({domNode:T.current,minZoom:m,maxZoom:d,translateExtent:u,viewport:f,onDraggingChange:k=>N.setState(F=>F.paneDragging===k?F:{paneDragging:k}),onPanZoomStart:(k,F)=>{const{onViewportChangeStart:q,onMoveStart:U}=N.getState();U==null||U(k,F),q==null||q(F)},onPanZoom:(k,F)=>{const{onViewportChange:q,onMove:U}=N.getState();U==null||U(k,F),q==null||q(F)},onPanZoomEnd:(k,F)=>{const{onViewportChangeEnd:q,onMoveEnd:U}=N.getState();U==null||U(k,F),q==null||q(F)}});const{x:G,y:z,zoom:V}=L.current.getViewport();return N.setState({panZoom:L.current,transform:[G,z,V],domNode:T.current.closest(".react-flow")}),()=>{var k;(k=L.current)==null||k.destroy()}}},[]),x.useEffect(()=>{var G;(G=L.current)==null||G.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:K,preventScrolling:y,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,y,S,P,w,R,I,D,A,j]),p.jsx("div",{className:"react-flow__renderer",ref:T,style:_x,children:b})}const AAe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function NAe(){const{userSelectionActive:e,userSelectionRect:t}=lt(AAe,Gt);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))},TAe=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function PAe({isSelecting:e,selectionKeyPressed:t,selectionMode:n=sm.Full,panOnDrag:r,paneClickDistance:a,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:u,onPaneScroll:m,onPaneMouseEnter:d,onPaneMouseMove:v,onPaneMouseLeave:y,children:b}){const w=Xt(),{userSelectionActive:S,elementsSelectable:E,dragging:O,connectionInProgress:j}=lt(TAe,Gt),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}f==null||f(q),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},L=q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){q.preventDefault();return}u==null||u(q)},I=m?q=>m(q):void 0,G=q=>{D.current&&(q.stopPropagation(),D.current=!1)},z=q=>{var ee,ie;const{domNode:U}=w.getState();if(T.current=U==null?void 0:U.getBoundingClientRect(),!T.current)return;const Y=q.target===N.current;if(!Y&&!!q.target.closest(".nokey")||!e||!(i&&Y||t)||q.button!==0||!q.isPrimary)return;(ie=(ee=q.target)==null?void 0:ee.setPointerCapture)==null||ie.call(ee,q.pointerId),D.current=!1;const{x:X,y:Z}=Ya(q.nativeEvent,T.current);w.setState({userSelectionRect:{width:0,height:0,startX:X,startY:Z,x:X,y:Z}}),Y||(q.stopPropagation(),q.preventDefault())},V=q=>{const{userSelectionRect:U,transform:Y,nodeLookup:B,edgeLookup:$,connectionLookup:X,triggerNodeChanges:Z,triggerEdgeChanges:ee,defaultEdgeOptions:ie,resetSelectedElements:ae}=w.getState();if(!T.current||!U)return;const{x:re,y:J}=Ya(q.nativeEvent,T.current),{startX:le,startY:he}=U;if(!D.current){const Me=t?0:a;if(Math.hypot(re-le,J-he)<=Me)return;ae(),s==null||s(q)}D.current=!0;const ne={startX:le,startY:he,x:re<le?re:le,y:J<he?J:he,width:Math.abs(re-le),height:Math.abs(J-he)},ge=P.current,ye=R.current;P.current=new Set(HA(B,ne,Y,n===sm.Partial,!0).map(Me=>Me.id)),R.current=new Set;const De=(ie==null?void 0:ie.selectable)??!0;for(const Me of P.current){const Ke=X.get(Me);if(Ke)for(const{edgeId:Bt}of Ke.values()){const ut=$.get(Bt);ut&&(ut.selectable??De)&&R.current.add(Bt)}}if(!pL(ge,P.current)){const Me=tf(B,P.current,!0);Z(Me)}if(!pL(ye,R.current)){const Me=tf($,R.current);ee(Me)}w.setState({userSelectionRect:ne,userSelectionActive:!0,nodesSelectionActive:!1})},k=q=>{var U,Y;q.button===0&&((Y=(U=q.target)==null?void 0:U.releasePointerCapture)==null||Y.call(U,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})))},F=r===!0||Array.isArray(r)&&r.includes(0);return p.jsxs("div",{className:wn(["react-flow__pane",{draggable:F,dragging:O,selection:e}]),onClick:A?void 0:GS(K,N),onContextMenu:GS(L,N),onWheel:GS(I,N),onPointerEnter:A?void 0:d,onPointerMove:A?V:v,onPointerUp:A?k:void 0,onPointerDownCapture:A?z:void 0,onClickCapture:A?G:void 0,onPointerLeave:y,ref:N,style:_x,children:[b,p.jsx(NAe,{})]})}function tj({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:c,onError:f}=t.getState(),u=c.get(e);if(!u){f==null||f("012",zi.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):a([e])}function w9({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:i,nodeClickDistance:s}){const c=Xt(),[f,u]=x.useState(!1),m=x.useRef();return x.useEffect(()=>{m.current=SOe({getStoreItems:()=>c.getState(),onNodeMouseDown:d=>{tj({id:d,store:c,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!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 d;(d=m.current)==null||d.destroy()}},[n,r,t,i,e,a,s]),f}const MAe=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function S9(){const e=Xt();return x.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:i,nodesDraggable:s,onError:c,updateNodePositions:f,nodeLookup:u,nodeOrigin:m}=e.getState(),d=new Map,v=MAe(s),y=a?i[0]:5,b=a?i[1]:5,w=n.direction.x*y*n.factor,S=n.direction.y*b*n.factor;for(const[,E]of u){if(!v(E))continue;let O={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+S};a&&(O=ip(O,i));const{position:j,positionAbsolute:A}=Fq({nodeId:E.id,nextPosition:O,nodeLookup:u,nodeExtent:r,nodeOrigin:m,onError:c});E.position=j,E.internals.positionAbsolute=A,d.set(E.id,E)}f(d)},[])}const WA=x.createContext(null),kAe=WA.Provider;WA.Consumer;const E9=()=>x.useContext(WA),RAe=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),DAe=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:i,connection:s}=r,{fromHandle:c,toHandle:f,isValid:u}=s,m=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.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===Lf.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&&u}};function IAe({type:e="source",position:t=Le.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:s,onConnect:c,children:f,className:u,onMouseDown:m,onTouchStart:d,...v},y){var V,k;const b=s||null,w=e==="target",S=Xt(),E=E9(),{connectOnClick:O,noPanClassName:j,rfId:A}=lt(RAe,Gt),{connectingFrom:N,connectingTo:T,clickConnecting:P,isPossibleEndHandle:R,connectionInProcess:D,clickConnectionInProcess:K,valid:L}=lt(DAe(E,b,e),Gt);E||(k=(V=S.getState()).onError)==null||k.call(V,"010",zi.error010());const I=F=>{const{defaultEdgeOptions:q,onConnect:U,hasDefaultEdges:Y}=S.getState(),B={...q,...F};if(Y){const{edges:$,setEdges:X}=S.getState();X(oOe(B,$))}U==null||U(B),c==null||c(B)},G=F=>{if(!E)return;const q=Qq(F.nativeEvent);if(a&&(q&&F.button===0||!q)){const U=S.getState();ej.onPointerDown(F.nativeEvent,{handleDomNode:F.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:w,handleId:b,nodeId:E,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...Y)=>{var B,$;return($=(B=S.getState()).onConnectEnd)==null?void 0:$.call(B,...Y)},updateConnection:U.updateConnection,onConnect:I,isValidConnection:n||((...Y)=>{var B,$;return(($=(B=S.getState()).isValidConnection)==null?void 0:$.call(B,...Y))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}q?m==null||m(F):d==null||d(F)},z=F=>{const{onClickConnectStart:q,onClickConnectEnd:U,connectionClickStartHandle:Y,connectionMode:B,isValidConnection:$,lib:X,rfId:Z,nodeLookup:ee,connection:ie}=S.getState();if(!E||!Y&&!a)return;if(!Y){q==null||q(F.nativeEvent,{nodeId:E,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:E,type:e,id:b}});return}const ae=Xq(F.target),re=n||$,{connection:J,isValid:le}=ej.isValid(F.nativeEvent,{handle:{nodeId:E,id:b,type:e},connectionMode:B,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:re,flowId:Z,doc:ae,lib:X,nodeLookup:ee});le&&J&&I(J);const he=structuredClone(ie);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,U==null||U(F,he),S.setState({connectionClickStartHandle:null})};return p.jsx("div",{"data-handleid":b,"data-nodeid":E,"data-handlepos":t,"data-id":`${A}-${E}-${b}-${e}`,className:wn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",j,u,{source:!w,target:w,connectable:r,connectablestart:a,connectableend:i,clickconnecting:P,connectingfrom:N,connectingto:T,valid:L,connectionindicator:r&&(!D||R)&&(D||K?i:a)}]),onMouseDown:G,onTouchStart:G,onClick:O?z:void 0,ref:y,...v,children:f})}const Ff=x.memo(x9(IAe));function LAe({data:e,isConnectable:t,sourcePosition:n=Le.Bottom}){return p.jsxs(p.Fragment,{children:[e==null?void 0:e.label,p.jsx(Ff,{type:"source",position:n,isConnectable:t})]})}function zAe({data:e,isConnectable:t,targetPosition:n=Le.Top,sourcePosition:r=Le.Bottom}){return p.jsxs(p.Fragment,{children:[p.jsx(Ff,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,p.jsx(Ff,{type:"source",position:r,isConnectable:t})]})}function $Ae(){return null}function BAe({data:e,isConnectable:t,targetPosition:n=Le.Top}){return p.jsxs(p.Fragment,{children:[p.jsx(Ff,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ky={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},UL={input:LAe,default:zAe,output:BAe,group:$Ae};function UAe(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 HAe=e=>{const{width:t,height:n,x:r,y:a}=ap(e.nodeLookup,{filter:i=>!!i.selected});return{width:Va(t)?t:null,height:Va(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 FAe({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Xt(),{width:a,height:i,transformString:s,userSelectionActive:c}=lt(HAe,Gt),f=S9(),u=x.useRef(null);x.useEffect(()=>{var y;n||(y=u.current)==null||y.focus({preventScroll:!0})},[n]);const m=!c&&a!==null&&i!==null;if(w9({nodeRef:u,disabled:!m}),!m)return null;const d=e?y=>{const b=r.getState().nodes.filter(w=>w.selected);e(y,b)}:void 0,v=y=>{Object.prototype.hasOwnProperty.call(Ky,y.key)&&(y.preventDefault(),f({direction:Ky[y.key],factor:y.shiftKey?4:1}))};return p.jsx("div",{className:wn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:p.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:v,style:{width:a,height:i}})})}const HL=typeof window<"u"?window:void 0,qAe=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _9({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:u,selectionOnDrag:m,selectionMode:d,onSelectionStart:v,onSelectionEnd:y,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:L,maxZoom:I,preventScrolling:G,onSelectionContextMenu:z,noWheelClassName:V,noPanClassName:k,disableKeyboardA11y:F,onViewportChange:q,isControlledViewport:U}){const{nodesSelectionActive:Y,userSelectionActive:B}=lt(qAe,Gt),$=um(u,{target:HL}),X=um(w,{target:HL}),Z=X||R,ee=X||A,ie=m&&Z!==!0,ae=$||B||ie;return _Ae({deleteKeyCode:f,multiSelectionKeyCode:b}),p.jsx(OAe,{onPaneContextMenu:i,elementsSelectable:E,zoomOnScroll:O,zoomOnPinch:j,panOnScroll:ee,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:P,panOnDrag:!$&&Z,defaultViewport:D,translateExtent:K,minZoom:L,maxZoom:I,zoomActivationKeyCode:S,preventScrolling:G,noWheelClassName:V,noPanClassName:k,onViewportChange:q,isControlledViewport:U,paneClickDistance:c,selectionOnDrag:ie,children:p.jsxs(PAe,{onSelectionStart:v,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Z,isSelecting:!!ae,selectionMode:d,selectionKeyPressed:$,paneClickDistance:c,selectionOnDrag:ie,children:[e,Y&&p.jsx(FAe,{onSelectionContextMenu:z,noPanClassName:k,disableKeyboardA11y:F})]})})}_9.displayName="FlowRenderer";const KAe=x.memo(_9),VAe=e=>t=>e?HA(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 YAe(e){return lt(x.useCallback(VAe(e),[e]),Gt)}const GAe=e=>e.updateNodeInternals;function XAe(){const e=lt(GAe),[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 WAe({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=Xt(),i=x.useRef(null),s=x.useRef(null),c=x.useRef(e.sourcePosition),f=x.useRef(e.targetPosition),u=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 d=u.current!==t,v=c.current!==e.sourcePosition,y=f.current!==e.targetPosition;(d||v||y)&&(u.current=t,c.current=e.sourcePosition,f.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 QAe({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:i,onDoubleClick:s,nodesDraggable:c,elementsSelectable:f,nodesConnectable:u,nodesFocusable:m,resizeObserver:d,noDragClassName:v,noPanClassName:y,disableKeyboardA11y:b,rfId:w,nodeTypes:S,nodeClickDistance:E,onError:O}){const{node:j,internals:A,isParent:N}=lt(re=>{const J=re.nodeLookup.get(e),le=re.parentLookup.has(e);return{node:J,internals:J.internals,isParent:le}},Gt);let T=j.type||"default",P=(S==null?void 0:S[T])||UL[T];P===void 0&&(O==null||O("003",zi.error003(T)),T="default",P=(S==null?void 0:S.default)||UL.default);const R=!!(j.draggable||c&&typeof j.draggable>"u"),D=!!(j.selectable||f&&typeof j.selectable>"u"),K=!!(j.connectable||u&&typeof j.connectable>"u"),L=!!(j.focusable||m&&typeof j.focusable>"u"),I=Xt(),G=Yq(j),z=WAe({node:j,nodeType:T,hasDimensions:G,resizeObserver:d}),V=w9({nodeRef:z,disabled:j.hidden||!R,noDragClassName:v,handleSelector:j.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:E}),k=S9();if(j.hidden)return null;const F=Xo(j),q=UAe(j),U=D||R||t||n||r||a,Y=n?re=>n(re,{...A.userNode}):void 0,B=r?re=>r(re,{...A.userNode}):void 0,$=a?re=>a(re,{...A.userNode}):void 0,X=i?re=>i(re,{...A.userNode}):void 0,Z=s?re=>s(re,{...A.userNode}):void 0,ee=re=>{const{selectNodesOnDrag:J,nodeDragThreshold:le}=I.getState();D&&(!J||!R||le>0)&&tj({id:e,store:I,nodeRef:z}),t&&t(re,{...A.userNode})},ie=re=>{if(!(Wq(re.nativeEvent)||b)){if(zq.includes(re.key)&&D){const J=re.key==="Escape";tj({id:e,store:I,unselect:J,nodeRef:z})}else if(R&&j.selected&&Object.prototype.hasOwnProperty.call(Ky,re.key)){re.preventDefault();const{ariaLabelConfig:J}=I.getState();I.setState({ariaLiveMessage:J["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~A.positionAbsolute.x,y:~~A.positionAbsolute.y})}),k({direction:Ky[re.key],factor:re.shiftKey?4:1})}}},ae=()=>{var ye;if(b||!((ye=z.current)!=null&&ye.matches(":focus-visible")))return;const{transform:re,width:J,height:le,autoPanOnNodeFocus:he,setCenter:ne}=I.getState();if(!he)return;HA(new Map([[e,j]]),{x:0,y:0,width:J,height:le},re,!0).length>0||ne(j.position.x+F.width/2,j.position.y+F.height/2,{zoom:re[2]})};return p.jsx("div",{className:wn(["react-flow__node",`react-flow__node-${T}`,{[y]:R},j.className,{selected:j.selected,selectable:D,parent:N,draggable:R,dragging:V}]),ref:z,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:G?"visible":"hidden",...j.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Y,onMouseMove:B,onMouseLeave:$,onContextMenu:X,onClick:ee,onDoubleClick:Z,onKeyDown:L?ie:void 0,tabIndex:L?0:void 0,onFocus:L?ae:void 0,role:j.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${p9}-${w}`,"aria-label":j.ariaLabel,...j.domAttributes,children:p.jsx(kAe,{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:V,dragHandle:j.dragHandle,zIndex:A.z,parentId:j.parentId,...F})})})}var ZAe=x.memo(QAe);const JAe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function j9(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:i}=lt(JAe,Gt),s=YAe(e.onlyRenderVisibleElements),c=XAe();return p.jsx("div",{className:"react-flow__nodes",style:_x,children:s.map(f=>p.jsx(ZAe,{id:f,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},f))})}j9.displayName="NodeRenderer";const eNe=x.memo(j9);function tNe(e){return lt(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&&rOe({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),Gt)}const nNe=({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"})},rNe=({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"})},FL={[zf.Arrow]:nNe,[zf.ArrowClosed]:rNe};function aNe(e){const t=Xt();return x.useMemo(()=>{var a,i;return Object.prototype.hasOwnProperty.call(FL,e)?FL[e]:((i=(a=t.getState()).onError)==null||i.call(a,"009",zi.error009(e)),null)},[e])}const iNe=({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 f=aNe(t);return f?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(f,{color:n,strokeWidth:s})}):null},C9=({defaultColor:e,rfId:t})=>{const n=lt(i=>i.edges),r=lt(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(iNe,{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};C9.displayName="MarkerDefinitions";var oNe=x.memo(C9);function O9({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:c=2,children:f,className:u,...m}){const[d,v]=x.useState({x:1,y:0,width:0,height:0}),y=wn(["react-flow__edge-textwrapper",u]),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-d.width/2} ${t-d.height/2})`,className:y,visibility:d.width?"visible":"hidden",...m,children:[a&&p.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),p.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:b,style:r,children:n}),f]}):null}O9.displayName="EdgeText";const sNe=x.memo(O9);function jx({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:s,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:u=20,...m}){return p.jsxs(p.Fragment,{children:[p.jsx("path",{...m,d:e,fill:"none",className:wn(["react-flow__edge-path",m.className])}),u?p.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Va(t)&&Va(n)?p.jsx(sNe,{x:t,y:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:s,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function qL({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 A9({sourceX:e,sourceY:t,sourcePosition:n=Le.Bottom,targetX:r,targetY:a,targetPosition:i=Le.Top}){const[s,c]=qL({pos:n,x1:e,y1:t,x2:r,y2:a}),[f,u]=qL({pos:i,x1:r,y1:a,x2:e,y2:t}),[m,d,v,y]=Zq({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:s,sourceControlY:c,targetControlX:f,targetControlY:u});return[`M${e},${t} C${s},${c} ${f},${u} ${r},${a}`,m,d,v,y]}function N9(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:s,targetPosition:c,label:f,labelStyle:u,labelShowBg:m,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:S,interactionWidth:E})=>{const[O,j,A]=A9({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:f,labelStyle:u,labelShowBg:m,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:S,interactionWidth:E})})}const lNe=N9({isInternal:!1}),T9=N9({isInternal:!0});lNe.displayName="SimpleBezierEdge";T9.displayName="SimpleBezierEdgeInternal";function P9(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:s,labelStyle:c,labelShowBg:f,labelBgStyle:u,labelBgPadding:m,labelBgBorderRadius:d,style:v,sourcePosition:y=Le.Bottom,targetPosition:b=Le.Top,markerEnd:w,markerStart:S,pathOptions:E,interactionWidth:O})=>{const[j,A,N]=Q_({sourceX:n,sourceY:r,sourcePosition:y,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:f,labelBgStyle:u,labelBgPadding:m,labelBgBorderRadius:d,style:v,markerEnd:w,markerStart:S,interactionWidth:O})})}const M9=P9({isInternal:!1}),k9=P9({isInternal:!0});M9.displayName="SmoothStepEdge";k9.displayName="SmoothStepEdgeInternal";function R9(e){return x.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return p.jsx(M9,{...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 cNe=R9({isInternal:!1}),D9=R9({isInternal:!0});cNe.displayName="StepEdge";D9.displayName="StepEdgeInternal";function I9(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:s,labelStyle:c,labelShowBg:f,labelBgStyle:u,labelBgPadding:m,labelBgBorderRadius:d,style:v,markerEnd:y,markerStart:b,interactionWidth:w})=>{const[S,E,O]=t9({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:f,labelBgStyle:u,labelBgPadding:m,labelBgBorderRadius:d,style:v,markerEnd:y,markerStart:b,interactionWidth:w})})}const uNe=I9({isInternal:!1}),L9=I9({isInternal:!0});uNe.displayName="StraightEdge";L9.displayName="StraightEdgeInternal";function z9(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:s=Le.Bottom,targetPosition:c=Le.Top,label:f,labelStyle:u,labelShowBg:m,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:S,pathOptions:E,interactionWidth:O})=>{const[j,A,N]=Jq({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:f,labelStyle:u,labelShowBg:m,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:y,style:b,markerEnd:w,markerStart:S,interactionWidth:O})})}const fNe=z9({isInternal:!1}),$9=z9({isInternal:!0});fNe.displayName="BezierEdge";$9.displayName="BezierEdgeInternal";const KL={default:$9,straight:L9,step:D9,smoothstep:k9,simplebezier:T9},VL={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},dNe=(e,t,n)=>n===Le.Left?e-t:n===Le.Right?e+t:e,hNe=(e,t,n)=>n===Le.Top?e-t:n===Le.Bottom?e+t:e,YL="react-flow__edgeupdater";function GL({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:wn([YL,`${YL}-${c}`]),cx:dNe(t,r,e),cy:hNe(n,r,e),r,stroke:"transparent",fill:"transparent"})}function mNe({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:i,targetY:s,sourcePosition:c,targetPosition:f,onReconnect:u,onReconnectStart:m,onReconnectEnd:d,setReconnecting:v,setUpdateHover:y}){const b=Xt(),w=(A,N)=>{if(A.button!==0)return;const{autoPanOnConnect:T,domNode:P,connectionMode:R,connectionRadius:D,lib:K,onConnectStart:L,cancelConnection:I,nodeLookup:G,rfId:z,panBy:V,updateConnection:k}=b.getState(),F=N.type==="target",q=(B,$)=>{v(!1),d==null||d(B,n,N.type,$)},U=B=>u==null?void 0:u(n,B),Y=(B,$)=>{v(!0),m==null||m(A,n,N.type),L==null||L(B,$)};ej.onPointerDown(A.nativeEvent,{autoPanOnConnect:T,connectionMode:R,connectionRadius:D,domNode:P,handleId:N.id,nodeId:N.nodeId,nodeLookup:G,isTarget:F,edgeUpdaterType:N.type,lib:K,flowId:z,cancelConnection:I,panBy:V,isValidConnection:(...B)=>{var $,X;return((X=($=b.getState()).isValidConnection)==null?void 0:X.call($,...B))??!0},onConnect:U,onConnectStart:Y,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=()=>y(!0),j=()=>y(!1);return p.jsxs(p.Fragment,{children:[(e===!0||e==="source")&&p.jsx(GL,{position:c,centerX:r,centerY:a,radius:t,onMouseDown:S,onMouseEnter:O,onMouseOut:j,type:"source"}),(e===!0||e==="target")&&p.jsx(GL,{position:f,centerX:i,centerY:s,radius:t,onMouseDown:E,onMouseEnter:O,onMouseOut:j,type:"target"})]})}function pNe({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:i,onContextMenu:s,onMouseEnter:c,onMouseMove:f,onMouseLeave:u,reconnectRadius:m,onReconnect:d,onReconnectStart:v,onReconnectEnd:y,rfId:b,edgeTypes:w,noPanClassName:S,onError:E,disableKeyboardA11y:O}){let j=lt(ne=>ne.edgeLookup.get(e));const A=lt(ne=>ne.defaultEdgeOptions);j=A?{...A,...j}:j;let N=j.type||"default",T=(w==null?void 0:w[N])||KL[N];T===void 0&&(E==null||E("011",zi.error011(N)),N="default",T=(w==null?void 0:w.default)||KL.default);const P=!!(j.focusable||t&&typeof j.focusable>"u"),R=typeof d<"u"&&(j.reconnectable||n&&typeof j.reconnectable>"u"),D=!!(j.selectable||r&&typeof j.selectable>"u"),K=x.useRef(null),[L,I]=x.useState(!1),[G,z]=x.useState(!1),V=Xt(),{zIndex:k,sourceX:F,sourceY:q,targetX:U,targetY:Y,sourcePosition:B,targetPosition:$}=lt(x.useCallback(ne=>{const ge=ne.nodeLookup.get(j.source),ye=ne.nodeLookup.get(j.target);if(!ge||!ye)return{zIndex:j.zIndex,...VL};const De=uOe({id:e,sourceNode:ge,targetNode:ye,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:ne.connectionMode,onError:E});return{zIndex:nOe({selected:j.selected,zIndex:j.zIndex,sourceNode:ge,targetNode:ye,elevateOnSelect:ne.elevateEdgesOnSelect,zIndexMode:ne.zIndexMode}),...De||VL}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex]),Gt),X=x.useMemo(()=>j.markerStart?`url('#${Z_(j.markerStart,b)}')`:void 0,[j.markerStart,b]),Z=x.useMemo(()=>j.markerEnd?`url('#${Z_(j.markerEnd,b)}')`:void 0,[j.markerEnd,b]);if(j.hidden||F===null||q===null||U===null||Y===null)return null;const ee=ne=>{var Me;const{addSelectedEdges:ge,unselectNodesAndEdges:ye,multiSelectionActive:De}=V.getState();D&&(V.setState({nodesSelectionActive:!1}),j.selected&&De?(ye({nodes:[],edges:[j]}),(Me=K.current)==null||Me.blur()):ge([e])),a&&a(ne,j)},ie=i?ne=>{i(ne,{...j})}:void 0,ae=s?ne=>{s(ne,{...j})}:void 0,re=c?ne=>{c(ne,{...j})}:void 0,J=f?ne=>{f(ne,{...j})}:void 0,le=u?ne=>{u(ne,{...j})}:void 0,he=ne=>{var ge;if(!O&&zq.includes(ne.key)&&D){const{unselectNodesAndEdges:ye,addSelectedEdges:De}=V.getState();ne.key==="Escape"?((ge=K.current)==null||ge.blur(),ye({edges:[j]})):De([e])}};return p.jsx("svg",{style:{zIndex:k},children:p.jsxs("g",{className:wn(["react-flow__edge",`react-flow__edge-${N}`,j.className,S,{selected:j.selected,animated:j.animated,inactive:!D&&!a,updating:L,selectable:D}]),onClick:ee,onDoubleClick:ie,onContextMenu:ae,onMouseEnter:re,onMouseMove:J,onMouseLeave:le,onKeyDown:P?he: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?`${v9}-${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:F,sourceY:q,targetX:U,targetY:Y,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(mNe,{edge:j,isReconnectable:R,reconnectRadius:m,onReconnect:d,onReconnectStart:v,onReconnectEnd:y,sourceX:F,sourceY:q,targetX:U,targetY:Y,sourcePosition:B,targetPosition:$,setUpdateHover:I,setReconnecting:z})]})})}var vNe=x.memo(pNe);const gNe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function B9({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:u,onEdgeClick:m,reconnectRadius:d,onEdgeDoubleClick:v,onReconnectStart:y,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:E,elementsSelectable:O,onError:j}=lt(gNe,Gt),A=tNe(t);return p.jsxs("div",{className:"react-flow__edges",children:[p.jsx(oNe,{defaultColor:e,rfId:n}),A.map(N=>p.jsx(vNe,{id:N,edgesFocusable:S,edgesReconnectable:E,elementsSelectable:O,noPanClassName:a,onReconnect:i,onContextMenu:s,onMouseEnter:c,onMouseMove:f,onMouseLeave:u,onClick:m,reconnectRadius:d,onDoubleClick:v,onReconnectStart:y,onReconnectEnd:b,rfId:n,onError:j,edgeTypes:r,disableKeyboardA11y:w},N))]})}B9.displayName="EdgeRenderer";const yNe=x.memo(B9),xNe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function bNe({children:e}){const t=lt(xNe);return p.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function wNe(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 SNe=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function ENe(e){const t=lt(SNe),n=Xt();return x.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function _Ne(e){return e.connection.inProgress?{...e.connection,to:op(e.connection.to,e.transform)}:{...e.connection}}function jNe(e){return _Ne}function CNe(e){const t=jNe();return lt(t,Gt)}const ONe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function ANe({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:i,height:s,isValid:c,inProgress:f}=lt(ONe,Gt);return!(i&&a&&f)?null:p.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:p.jsx("g",{className:wn(["react-flow__connection",Uq(c)]),children:p.jsx(U9,{style:t,type:n,CustomComponent:r,isValid:c})})})}const U9=({style:e,type:t=$s.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:i,fromNode:s,fromHandle:c,fromPosition:f,to:u,toNode:m,toHandle:d,toPosition:v,pointer:y}=CNe();if(!a)return;if(n)return p.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:c,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:f,toPosition:v,connectionStatus:Uq(r),toNode:m,toHandle:d,pointer:y});let b="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:f,targetX:u.x,targetY:u.y,targetPosition:v};switch(t){case $s.Bezier:[b]=Jq(w);break;case $s.SimpleBezier:[b]=A9(w);break;case $s.Step:[b]=Q_({...w,borderRadius:0});break;case $s.SmoothStep:[b]=Q_(w);break;default:[b]=t9(w)}return p.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};U9.displayName="ConnectionLine";const NNe={};function XL(e=NNe){x.useRef(e),Xt(),x.useEffect(()=>{},[e])}function TNe(){Xt(),x.useRef(!1),x.useEffect(()=>{},[])}function H9({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:u,onNodeContextMenu:m,onSelectionContextMenu:d,onSelectionStart:v,onSelectionEnd:y,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:L,translateExtent:I,minZoom:G,maxZoom:z,preventScrolling:V,defaultMarkerColor:k,zoomOnScroll:F,zoomOnPinch:q,panOnScroll:U,panOnScrollSpeed:Y,panOnScrollMode:B,zoomOnDoubleClick:$,panOnDrag:X,onPaneClick:Z,onPaneMouseEnter:ee,onPaneMouseMove:ie,onPaneMouseLeave:ae,onPaneScroll:re,onPaneContextMenu:J,paneClickDistance:le,nodeClickDistance:he,onEdgeContextMenu:ne,onEdgeMouseEnter:ge,onEdgeMouseMove:ye,onEdgeMouseLeave:De,reconnectRadius:Me,onReconnect:Ke,onReconnectStart:Bt,onReconnectEnd:ut,noDragClassName:Sn,noWheelClassName:we,noPanClassName:Tt,disableKeyboardA11y:Ee,nodeExtent:dt,rfId:En,viewport:er,onViewportChange:ii}){return XL(e),XL(t),TNe(),wNe(n),ENe(er),p.jsx(KAe,{onPaneClick:Z,onPaneMouseEnter:ee,onPaneMouseMove:ie,onPaneMouseLeave:ae,onPaneContextMenu:J,onPaneScroll:re,paneClickDistance:le,deleteKeyCode:R,selectionKeyCode:O,selectionOnDrag:j,selectionMode:A,onSelectionStart:v,onSelectionEnd:y,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:P,elementsSelectable:K,zoomOnScroll:F,zoomOnPinch:q,zoomOnDoubleClick:$,panOnScroll:U,panOnScrollSpeed:Y,panOnScrollMode:B,panOnDrag:X,defaultViewport:L,translateExtent:I,minZoom:G,maxZoom:z,onSelectionContextMenu:d,preventScrolling:V,noDragClassName:Sn,noWheelClassName:we,noPanClassName:Tt,disableKeyboardA11y:Ee,onViewportChange:ii,isControlledViewport:!!er,children:p.jsxs(bNe,{children:[p.jsx(yNe,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:s,onReconnect:Ke,onReconnectStart:Bt,onReconnectEnd:ut,onlyRenderVisibleElements:D,onEdgeContextMenu:ne,onEdgeMouseEnter:ge,onEdgeMouseMove:ye,onEdgeMouseLeave:De,reconnectRadius:Me,defaultMarkerColor:k,noPanClassName:Tt,disableKeyboardA11y:Ee,rfId:En}),p.jsx(ANe,{style:w,type:b,component:S,containerStyle:E}),p.jsx("div",{className:"react-flow__edgelabel-renderer"}),p.jsx(eNe,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:u,onNodeContextMenu:m,nodeClickDistance:he,onlyRenderVisibleElements:D,noPanClassName:Tt,noDragClassName:Sn,disableKeyboardA11y:Ee,nodeExtent:dt,rfId:En}),p.jsx("div",{className:"react-flow__viewport-portal"})]})})}H9.displayName="GraphView";const PNe=x.memo(H9),WL=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:s,fitViewOptions:c,minZoom:f=.5,maxZoom:u=2,nodeOrigin:m,nodeExtent:d,zIndexMode:v="basic"}={})=>{const y=new Map,b=new Map,w=new Map,S=new Map,E=r??t??[],O=n??e??[],j=m??[0,0],A=d??om;a9(w,S,E);const N=J_(O,y,b,{nodeOrigin:j,nodeExtent:A,zIndexMode:v});let T=[0,0,1];if(s&&a&&i){const P=ap(y,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:R,y:D,zoom:K}=FA(P,a,i,f,u,(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:y,parentLookup:b,edges:E,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:f,maxZoom:u,translateExtent:om,nodeExtent:A,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Lf.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:{...Bq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:WCe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:$q,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},MNe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:s,fitViewOptions:c,minZoom:f,maxZoom:u,nodeOrigin:m,nodeExtent:d,zIndexMode:v})=>GOe((y,b)=>{async function w(){const{nodeLookup:S,panZoom:E,fitViewOptions:O,fitViewResolver:j,width:A,height:N,minZoom:T,maxZoom:P}=b();E&&(await GCe({nodes:S,width:A,height:N,panZoom:E,minZoom:T,maxZoom:P},O),j==null||j.resolve(!0),y({fitViewResolver:null}))}return{...WL({nodes:e,edges:t,width:a,height:i,fitView:s,fitViewOptions:c,minZoom:f,maxZoom:u,nodeOrigin:m,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:v}),setNodes:S=>{const{nodeLookup:E,parentLookup:O,nodeOrigin:j,elevateNodesOnSelect:A,fitViewQueued:N,zIndexMode:T}=b(),P=J_(S,E,O,{nodeOrigin:j,nodeExtent:d,elevateNodesOnSelect:A,checkEquality:!0,zIndexMode:T});N&&P?(w(),y({nodes:S,nodesInitialized:P,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:S,nodesInitialized:P})},setEdges:S=>{const{connectionLookup:E,edgeLookup:O}=b();a9(E,O,S),y({edges:S})},setDefaultNodesAndEdges:(S,E)=>{if(S){const{setNodes:O}=b();O(S),y({hasDefaultNodes:!0})}if(E){const{setEdges:O}=b();O(E),y({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:L}=yOe(S,O,j,A,N,T,D);L&&(mOe(O,j,{nodeOrigin:N,nodeExtent:T,zIndexMode:D}),R?(w(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(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 L=A.get(D),I=!!(L!=null&&L.expandParent&&(L!=null&&L.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(L&&T.inProgress&&T.fromNode.id===L.id){const z=Bc(L,T.fromHandle,Le.Left,!0);P({...T,from:z})}I&&L.parentId&&O.push({id:D,parentId:L.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(),L=XA(O,A,D,K);j.push(...L)}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=pAe(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=vAe(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=>tc(P,!0));A(T);return}A(tf(j,new Set([...S]),!0)),N(tf(O))},addSelectedEdges:S=>{const{multiSelectionActive:E,edgeLookup:O,nodeLookup:j,triggerNodeChanges:A,triggerEdgeChanges:N}=b();if(E){const T=S.map(P=>tc(P,!0));N(T);return}N(tf(O,new Set([...S]))),A(tf(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 L of P){if(!L.selected)continue;const I=A.get(L.id);I&&(I.selected=!1),D.push(tc(L.id,!1))}const K=[];for(const L of R)L.selected&&K.push(tc(L.id,!1));N(D),T(K)},setMinZoom:S=>{const{panZoom:E,maxZoom:O}=b();E==null||E.setScaleExtent([S,O]),y({minZoom:S})},setMaxZoom:S=>{const{panZoom:E,minZoom:O}=b();E==null||E.setScaleExtent([O,S]),y({maxZoom:S})},setTranslateExtent:S=>{var E;(E=b().panZoom)==null||E.setTranslateExtent(S),y({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,tc(R.id,!1)]:P,[]),T=S.reduce((P,R)=>R.selected?[...P,tc(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]||(J_(E,O,j,{nodeOrigin:A,nodeExtent:S,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:P}),y({nodeExtent:S}))},panBy:S=>{const{transform:E,width:O,height:j,panZoom:A,translateExtent:N}=b();return xOe({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:()=>{y({connection:{...Bq}})},updateConnection:S=>{y({connection:S})},reset:()=>y({...WL()})}},Object.is);function F9({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:i,initialMinZoom:s,initialMaxZoom:c,initialFitViewOptions:f,fitView:u,nodeOrigin:m,nodeExtent:d,zIndexMode:v,children:y}){const[b]=x.useState(()=>MNe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:u,minZoom:s,maxZoom:c,fitViewOptions:f,nodeOrigin:m,nodeExtent:d,zIndexMode:v}));return p.jsx(XOe,{value:b,children:p.jsx(bAe,{children:y})})}function kNe({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:i,height:s,fitView:c,fitViewOptions:f,minZoom:u,maxZoom:m,nodeOrigin:d,nodeExtent:v,zIndexMode:y}){return x.useContext(wx)?p.jsx(p.Fragment,{children:e}):p.jsx(F9,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:i,initialHeight:s,fitView:c,initialFitViewOptions:f,initialMinZoom:u,initialMaxZoom:m,nodeOrigin:d,nodeExtent:v,zIndexMode:y,children:e})}const RNe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function DNe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:i,edgeTypes:s,onNodeClick:c,onEdgeClick:f,onInit:u,onMove:m,onMoveStart:d,onMoveEnd:v,onConnect:y,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:L,onDelete:I,onSelectionChange:G,onSelectionDragStart:z,onSelectionDrag:V,onSelectionDragStop:k,onSelectionContextMenu:F,onSelectionStart:q,onSelectionEnd:U,onBeforeDelete:Y,connectionMode:B,connectionLineType:$=$s.Bezier,connectionLineStyle:X,connectionLineComponent:Z,connectionLineContainerStyle:ee,deleteKeyCode:ie="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:re=!1,selectionMode:J=sm.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:he=cm()?"Meta":"Control",zoomActivationKeyCode:ne=cm()?"Meta":"Control",snapToGrid:ge,snapGrid:ye,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:Me,nodesDraggable:Ke,autoPanOnNodeFocus:Bt,nodesConnectable:ut,nodesFocusable:Sn,nodeOrigin:we=g9,edgesFocusable:Tt,edgesReconnectable:Ee,elementsSelectable:dt=!0,defaultViewport:En=lAe,minZoom:er=.5,maxZoom:ii=2,translateExtent:oi=om,preventScrolling:_l=!0,nodeExtent:zr,defaultMarkerColor:Jc="#b1b1b7",zoomOnScroll:si=!0,zoomOnPinch:Hi=!0,panOnScroll:Kn=!1,panOnScrollSpeed:$r=.5,panOnScrollMode:Dn=xc.Free,zoomOnDoubleClick:ud=!0,panOnDrag:jl=!0,onPaneClick:la,onPaneMouseEnter:Wo,onPaneMouseMove:Qo,onPaneMouseLeave:Fi,onPaneScroll:ca,onPaneContextMenu:qe,paneClickDistance:kt=1,nodeClickDistance:un=0,children:In,onReconnect:li,onReconnectStart:Dt,onReconnectEnd:tr,onEdgeContextMenu:qi,onEdgeDoubleClick:nr,onEdgeMouseEnter:rr,onEdgeMouseMove:Zo,onEdgeMouseLeave:Br,reconnectRadius:fd=10,onNodesChange:sp,onEdgesChange:ci,noDragClassName:_n="nodrag",noWheelClassName:ar="nowheel",noPanClassName:Ki="nopan",fitView:eu,fitViewOptions:lp,connectOnClick:Cx,attributionPosition:cp,proOptions:Cl,defaultEdgeOptions:dd,elevateNodesOnSelect:Jo=!0,elevateEdgesOnSelect:es=!1,disableKeyboardA11y:ts=!1,autoPanOnConnect:ns,autoPanOnNodeDrag:fn,autoPanSpeed:up,connectionRadius:fp,isValidConnection:Vi,onError:rs,style:Ox,id:hd,nodeDragThreshold:dp,connectionDragThreshold:Ax,viewport:tu,onViewportChange:nu,width:Ma,height:Er,colorMode:hp="light",debug:Nx,onScroll:as,ariaLabelConfig:mp,zIndexMode:Ol="basic",...Tx},_r){const Al=hd||"1",pp=dAe(hp),md=x.useCallback(Yi=>{Yi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),as==null||as(Yi)},[as]);return p.jsx("div",{"data-testid":"rf__wrapper",...Tx,onScroll:md,style:{...Ox,...RNe},ref:_r,className:wn(["react-flow",a,pp]),id:hd,role:"application",children:p.jsxs(kNe,{nodes:e,edges:t,width:Ma,height:Er,fitView:eu,fitViewOptions:lp,minZoom:er,maxZoom:ii,nodeOrigin:we,nodeExtent:zr,zIndexMode:Ol,children:[p.jsx(PNe,{onInit:u,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:O,onNodeMouseMove:j,onNodeMouseLeave:A,onNodeContextMenu:N,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:s,connectionLineType:$,connectionLineStyle:X,connectionLineComponent:Z,connectionLineContainerStyle:ee,selectionKeyCode:ae,selectionOnDrag:re,selectionMode:J,deleteKeyCode:ie,multiSelectionKeyCode:he,panActivationKeyCode:le,zoomActivationKeyCode:ne,onlyRenderVisibleElements:De,defaultViewport:En,translateExtent:oi,minZoom:er,maxZoom:ii,preventScrolling:_l,zoomOnScroll:si,zoomOnPinch:Hi,zoomOnDoubleClick:ud,panOnScroll:Kn,panOnScrollSpeed:$r,panOnScrollMode:Dn,panOnDrag:jl,onPaneClick:la,onPaneMouseEnter:Wo,onPaneMouseMove:Qo,onPaneMouseLeave:Fi,onPaneScroll:ca,onPaneContextMenu:qe,paneClickDistance:kt,nodeClickDistance:un,onSelectionContextMenu:F,onSelectionStart:q,onSelectionEnd:U,onReconnect:li,onReconnectStart:Dt,onReconnectEnd:tr,onEdgeContextMenu:qi,onEdgeDoubleClick:nr,onEdgeMouseEnter:rr,onEdgeMouseMove:Zo,onEdgeMouseLeave:Br,reconnectRadius:fd,defaultMarkerColor:Jc,noDragClassName:_n,noWheelClassName:ar,noPanClassName:Ki,rfId:Al,disableKeyboardA11y:ts,nodeExtent:zr,viewport:tu,onViewportChange:nu}),p.jsx(fAe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:y,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:E,nodesDraggable:Ke,autoPanOnNodeFocus:Bt,nodesConnectable:ut,nodesFocusable:Sn,edgesFocusable:Tt,edgesReconnectable:Ee,elementsSelectable:dt,elevateNodesOnSelect:Jo,elevateEdgesOnSelect:es,minZoom:er,maxZoom:ii,nodeExtent:zr,onNodesChange:sp,onEdgesChange:ci,snapToGrid:ge,snapGrid:ye,connectionMode:B,translateExtent:oi,connectOnClick:Cx,defaultEdgeOptions:dd,fitView:eu,fitViewOptions:lp,onNodesDelete:K,onEdgesDelete:L,onDelete:I,onNodeDragStart:P,onNodeDrag:R,onNodeDragStop:D,onSelectionDrag:V,onSelectionDragStart:z,onSelectionDragStop:k,onMove:m,onMoveStart:d,onMoveEnd:v,noPanClassName:Ki,nodeOrigin:we,rfId:Al,autoPanOnConnect:ns,autoPanOnNodeDrag:fn,autoPanSpeed:up,onError:rs,connectionRadius:fp,isValidConnection:Vi,selectNodesOnDrag:Me,nodeDragThreshold:dp,connectionDragThreshold:Ax,onBeforeDelete:Y,debug:Nx,ariaLabelConfig:mp,zIndexMode:Ol}),p.jsx(sAe,{onSelectionChange:G}),In,p.jsx(nAe,{proOptions:Cl,position:cp}),p.jsx(tAe,{rfId:Al,disableKeyboardA11y:ts})]})})}var INe=x9(DNe);function LNe({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:wn(["react-flow__background-pattern",n,r])})}function zNe({radius:e,className:t}){return p.jsx("circle",{cx:e,cy:e,r:e,className:wn(["react-flow__background-pattern","dots",t])})}var el;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(el||(el={}));const $Ne={[el.Dots]:1,[el.Lines]:1,[el.Cross]:6},BNe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function q9({id:e,variant:t=el.Dots,gap:n=20,size:r,lineWidth:a=1,offset:i=0,color:s,bgColor:c,style:f,className:u,patternClassName:m}){const d=x.useRef(null),{transform:v,patternId:y}=lt(BNe,Gt),b=r||$Ne[t],w=t===el.Dots,S=t===el.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=`${y}${e||""}`;return p.jsxs("svg",{className:wn(["react-flow__background",u]),style:{...f,..._x,"--xy-background-color-props":c,"--xy-background-pattern-color-props":s},ref:d,"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(zNe,{radius:j/2,className:m}):p.jsx(LNe,{dimensions:N,lineWidth:a,variant:t,className:m})}),p.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}q9.displayName="Background";x.memo(q9);function UNe(){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 HNe(){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 FNe(){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 qNe(){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 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 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 og({children:e,className:t,...n}){return p.jsx("button",{type:"button",className:wn(["react-flow__controls-button",t]),...n,children:e})}const VNe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function K9({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:s,onFitView:c,onInteractiveChange:f,className:u,children:m,position:d="bottom-left",orientation:v="vertical","aria-label":y}){const b=Xt(),{isInteractive:w,minZoomReached:S,maxZoomReached:E,ariaLabelConfig:O}=lt(VNe,Gt),{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}),f==null||f(!w)},K=v==="horizontal"?"horizontal":"vertical";return p.jsxs(Sx,{className:wn(["react-flow__controls",K,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":y??O["controls.ariaLabel"],children:[t&&p.jsxs(p.Fragment,{children:[p.jsx(og,{onClick:T,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:E,children:p.jsx(UNe,{})}),p.jsx(og,{onClick:P,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:S,children:p.jsx(HNe,{})})]}),n&&p.jsx(og,{className:"react-flow__controls-fitview",onClick:R,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:p.jsx(FNe,{})}),r&&p.jsx(og,{className:"react-flow__controls-interactive",onClick:D,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:w?p.jsx(KNe,{}):p.jsx(qNe,{})}),m]})}K9.displayName="Controls";x.memo(K9);function YNe({id:e,x:t,y:n,width:r,height:a,style:i,color:s,strokeColor:c,strokeWidth:f,className:u,borderRadius:m,shapeRendering:d,selected:v,onClick:y}){const{background:b,backgroundColor:w}=i||{},S=s||b||w;return p.jsx("rect",{className:wn(["react-flow__minimap-node",{selected:v},u]),x:t,y:n,rx:m,ry:m,width:r,height:a,style:{fill:S,stroke:c,strokeWidth:f},shapeRendering:d,onClick:y?E=>y(E,e):void 0})}const GNe=x.memo(YNe),XNe=e=>e.nodes.map(t=>t.id),XS=e=>e instanceof Function?e:()=>e;function WNe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:i=GNe,onClick:s}){const c=lt(XNe,Gt),f=XS(t),u=XS(e),m=XS(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return p.jsx(p.Fragment,{children:c.map(v=>p.jsx(ZNe,{id:v,nodeColorFunc:f,nodeStrokeColorFunc:u,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:i,onClick:s,shapeRendering:d},v))})}function QNe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:c,onClick:f}){const{node:u,x:m,y:d,width:v,height:y}=lt(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}=Xo(S);return{node:S,x:E,y:O,width:j,height:A}},Gt);return!u||u.hidden||!Yq(u)?null:p.jsx(c,{x:m,y:d,width:v,height:y,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:a,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:f,id:u.id})}const ZNe=x.memo(QNe);var JNe=x.memo(WNe);const eTe=200,tTe=150,nTe=e=>!e.hidden,rTe=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?Vq(ap(e.nodeLookup,{filter:nTe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},aTe="react-flow__minimap-desc";function V9({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:c,bgColor:f,maskColor:u,maskStrokeColor:m,maskStrokeWidth:d,position:v="bottom-right",onClick:y,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:E,inversePan:O,zoomStep:j=1,offsetScale:A=5}){const N=Xt(),T=x.useRef(null),{boundingRect:P,viewBB:R,rfId:D,panZoom:K,translateExtent:L,flowWidth:I,flowHeight:G,ariaLabelConfig:z}=lt(rTe,Gt),V=(e==null?void 0:e.width)??eTe,k=(e==null?void 0:e.height)??tTe,F=P.width/V,q=P.height/k,U=Math.max(F,q),Y=U*V,B=U*k,$=A*U,X=P.x-(Y-P.width)/2-$,Z=P.y-(B-P.height)/2-$,ee=Y+$*2,ie=B+$*2,ae=`${aTe}-${D}`,re=x.useRef(0),J=x.useRef();re.current=U,x.useEffect(()=>{if(T.current&&K)return J.current=AOe({domNode:T.current,panZoom:K,getTransform:()=>N.getState().transform,getViewScale:()=>re.current}),()=>{var ge;(ge=J.current)==null||ge.destroy()}},[K]),x.useEffect(()=>{var ge;(ge=J.current)==null||ge.update({translateExtent:L,width:I,height:G,inversePan:O,pannable:w,zoomStep:j,zoomable:S})},[w,S,O,j,L,I,G]);const le=y?ge=>{var Me;const[ye,De]=((Me=J.current)==null?void 0:Me.pointer(ge))||[0,0];y(ge,{x:ye,y:De})}:void 0,he=b?x.useCallback((ge,ye)=>{const De=N.getState().nodeLookup.get(ye).internals.userNode;b(ge,De)},[]):void 0,ne=E??z["minimap.ariaLabel"];return p.jsx(Sx,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*U: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:wn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:p.jsxs("svg",{width:V,height:k,viewBox:`${X} ${Z} ${ee} ${ie}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:T,onClick:le,children:[ne&&p.jsx("title",{id:ae,children:ne}),p.jsx(JNe,{onClick:he,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${ie+$*2}h${-ee-$*2}z
        M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}V9.displayName="MiniMap";x.memo(V9);const iTe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,oTe={[Hf.Line]:"right",[Hf.Handle]:"bottom-right"};function sTe({nodeId:e,position:t,variant:n=Hf.Handle,className:r,style:a=void 0,children:i,color:s,minWidth:c=10,minHeight:f=10,maxWidth:u=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:v,autoScale:y=!0,shouldResize:b,onResizeStart:w,onResize:S,onResizeEnd:E}){const O=E9(),j=typeof e=="string"?e:O,A=Xt(),N=x.useRef(null),T=n===Hf.Handle,P=lt(x.useCallback(iTe(T&&y),[T,y]),Gt),R=x.useRef(null),D=t??oTe[n];x.useEffect(()=>{if(!(!N.current||!j))return R.current||(R.current=HOe({domNode:N.current,nodeId:j,getStoreItems:()=>{const{nodeLookup:L,transform:I,snapGrid:G,snapToGrid:z,nodeOrigin:V,domNode:k}=A.getState();return{nodeLookup:L,transform:I,snapGrid:G,snapToGrid:z,nodeOrigin:V,paneDomNode:k}},onChange:(L,I)=>{const{triggerNodeChanges:G,nodeLookup:z,parentLookup:V,nodeOrigin:k}=A.getState(),F=[],q={x:L.x,y:L.y},U=z.get(j);if(U&&U.expandParent&&U.parentId){const Y=U.origin??k,B=L.width??U.measured.width??0,$=L.height??U.measured.height??0,X={id:U.id,parentId:U.parentId,rect:{width:B,height:$,...Gq({x:L.x??U.position.x,y:L.y??U.position.y},{width:B,height:$},U.parentId,z,Y)}},Z=XA([X],z,V,k);F.push(...Z),q.x=L.x?Math.max(Y[0]*B,L.x):void 0,q.y=L.y?Math.max(Y[1]*$,L.y):void 0}if(q.x!==void 0&&q.y!==void 0){const Y={id:j,type:"position",position:{...q}};F.push(Y)}if(L.width!==void 0&&L.height!==void 0){const B={id:j,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};F.push(B)}for(const Y of I){const B={...Y,type:"position"};F.push(B)}G(F)},onEnd:({width:L,height:I})=>{const G={id:j,type:"dimensions",resizing:!1,dimensions:{width:L,height:I}};A.getState().triggerNodeChanges([G])}})),R.current.update({controlPosition:D,boundaries:{minWidth:c,minHeight:f,maxWidth:u,maxHeight:m},keepAspectRatio:d,resizeDirection:v,onResizeStart:w,onResize:S,onResizeEnd:E,shouldResize:b}),()=>{var L;(L=R.current)==null||L.destroy()}},[D,c,f,u,m,d,w,S,E,b]);const K=D.split("-");return p.jsx("div",{className:wn(["react-flow__resize-control","nodrag",...K,n,r]),ref:N,style:{...a,scale:P,...s&&{[T?"backgroundColor":"borderColor"]:s}},children:i})}x.memo(sTe);function lTe(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 f=JSON.parse(c.data);n(f)}catch{}},s.onerror=()=>{a(!1)},()=>{s.close(),i.current=null}},[e]),{tree:t,connected:r}}const Y9=180,cTe=70,Vy=24,uTe=60;function fTe({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${ek(e.status)}`;return p.jsxs("div",{className:t,children:[p.jsx(Ff,{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 ${ek(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(Ff,{type:"source",position:Le.Bottom})]})}const dTe={agent:fTe};function hTe(e,t){const n=new Map(e.map(c=>[c.agent_id,c])),r=new Map;for(const c of e){const f=c.parent;r.has(f)||r.set(f,[]),r.get(f).push(c.agent_id)}const a=new Map;for(const c of t){const f=c.requested_by;f&&n.has(f)&&(a.has(f)||a.set(f,[]),a.get(f).push(c))}function i(c){const f=(r.get(c)||[]).map(i),u=(a.get(c)||[]).map(m=>({id:`pending-${m.span_id}`,children:[]}));return{id:c,children:[...f,...u]}}return(r.get(null)||[]).map(i)}function Yy(e){return e.children.length===0?Y9:e.children.reduce((t,n)=>t+Yy(n)+Vy,-Vy)}function G9(e,t,n,r){if(r.set(e.id,{x:t-Y9/2,y:n}),e.children.length===0)return;const a=Yy(e);let i=t-a/2;for(const s of e.children){const c=Yy(s),f=i+c/2;G9(s,f,n+cTe+uTe,r),i+=c+Vy}}function mTe({runId:e}){return p.jsx(F9,{children:p.jsx(pTe,{runId:e})})}function pTe({runId:e}){const{tree:t,connected:n}=lTe(e),{fitView:r}=Ex(),a=x.useCallback(()=>{r({duration:300})},[r]),{flowNodes:i,flowEdges:s}=x.useMemo(()=>{if(!t)return{flowNodes:[],flowEdges:[]};const c=hTe(t.nodes,t.pending_delegations),f=new Map;let u=0;for(const b of c){const w=Yy(b),S=u+w/2;G9(b,S,0,f),u+=w+Vy*2}const m=new Map(t.nodes.map(b=>[b.agent_id,b])),d=new Map(t.pending_delegations.map(b=>[`pending-${b.span_id}`,b])),v=[];for(const[b,w]of f){const S=m.get(b),E=d.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 y=[];for(const b of t.nodes)b.parent&&y.push({id:`e-${b.parent}-${b.agent_id}`,source:b.parent,target:b.agent_id,type:"smoothstep",markerEnd:{type:zf.ArrowClosed,width:16,height:16}});for(const b of t.pending_delegations)b.requested_by&&y.push({id:`e-${b.requested_by}-pending-${b.span_id}`,source:b.requested_by,target:`pending-${b.span_id}`,type:"smoothstep",markerEnd:{type:zf.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:v,flowEdges:y}},[t]);return t?p.jsxs("div",{children:[p.jsxs("div",{className:"react-flow-wrapper",children:[p.jsx(INe,{nodes:i,edges:s,nodeTypes:dTe,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 Ql=18,QL=10;function vTe({runId:e,agents:t,active:n}){var V;const r=Object.keys(t),a=r.find(k=>t[k].parent===null)??r[0]??"",[i,s]=x.useState(a),{lines:c,connected:f,done:u}=HB(e,i,!0),[m,d]=x.useState(""),v=m.toLowerCase(),y=m?c.reduce((k,F,q)=>(F.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*Ql,P=Math.max(0,Math.floor(w/Ql)-QL),R=Math.ceil(E/Ql)+QL*2,D=Math.min(c.length,P+R),K=c.slice(P,D),L=String(c.length).length,I=x.useCallback(()=>{const k=b.current;if(!k)return;S(k.scrollTop),O(k.clientHeight);const F=k.scrollTop+k.clientHeight>=k.scrollHeight-Ql*2;A(F)},[]);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))},z=async()=>{try{const k=await fetch(`/api/sessions/${e}/logs/${i}/full`);if(!k.ok)return;const F=await k.text(),q=new Blob([F],{type:"text/plain"}),U=URL.createObjectURL(q),Y=document.createElement("a");Y.href=U,Y.download=`${i}.log`,Y.click(),URL.revokeObjectURL(U)}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(Ti,{value:i,onValueChange:s,children:[p.jsx(Mi,{className:"w-[220px]",children:p.jsx(Pi,{})}),p.jsx(ki,{children:r.map(k=>p.jsxs(Tn,{value:k,children:[t[k].role," (",k.slice(0,8),")"]},k))})]}),r.length===1&&p.jsxs("span",{className:"text-sm text-muted-foreground",children:[(V=t[i])==null?void 0:V.role," (",i.slice(0,8),")"]}),p.jsxs("div",{className:"relative ml-auto",children:[p.jsx(yB,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),p.jsx(et,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:m,onChange:k=>d(k.target.value)})]}),m&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[y.length," match",y.length!==1?"es":""]}),p.jsxs(Se,{variant:"outline",size:"sm",onClick:z,children:[p.jsx(x0,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),p.jsx(gTe,{connected:f,done:u,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&&!u?"Waiting for log output...":"No log output."}):p.jsx("div",{style:{height:T,position:"relative"},children:p.jsx("div",{style:{position:"absolute",top:P*Ql,left:0,right:0},children:K.map((k,F)=>{const q=P+F,U=m&&k.toLowerCase().includes(v);return p.jsxs("div",{className:U?"bg-yellow-900/30":void 0,style:{height:Ql,lineHeight:`${Ql}px`,display:"flex",whiteSpace:"pre"},children:[p.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(L+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:q+1}),p.jsx("span",{children:U?p.jsx(yTe,{line:k,search:v}):k})]},q)})})})}),!j&&c.length>0&&p.jsxs(Se,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:G,children:[p.jsx(Ate,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function gTe({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 yTe({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 xTe(e){return At({mutationFn:t=>$e.post(`/sessions/${e}/respond`,t)})}function bTe({runId:e,pendingAskUsers:t,initialMessages:n}){const[r,a]=x.useState([]),[i,s]=x.useState(""),c=xTe(e),f=x.useRef(null),u=x.useRef(new Set);x.useEffect(()=>{!n||n.length===0||a(v=>{const y=new Set(v.map(S=>S.id)),b=n.filter(S=>!y.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)u.current.add(S.id);return w})},[n]),x.useEffect(()=>{if(t.length===0)return;const v=[];for(const y of t)u.current.has(y.request_id)||(u.current.add(y.request_id),v.push({id:y.request_id,role:"agent",text:y.question,timestamp:y.timestamp}));v.length>0&&a(y=>[...y,...v])},[t]),x.useEffect(()=>{var v;(v=f.current)==null||v.scrollIntoView({behavior:"smooth"})},[r]);const m=async(v,y)=>{if(!v.trim())return;const b=`user-${y.request_id}`;u.current.has(b)||(u.current.add(b),a(w=>[...w,{id:b,role:"user",text:v.trim(),timestamp:Date.now()/1e3}])),s("");try{await c.mutateAsync({request_id:y.request_id,text:v.trim()})}catch{}},d=t.length>0?t[0]:null;return p.jsx(ln,{className:"flex h-[500px] flex-col",children:p.jsxs(cn,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[p.jsx(Pm,{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(mB,{className:"h-8 w-8"}),p.jsx("p",{className:"text-sm",children:"Waiting for the agent to ask a question..."})]}),r.map(v=>{const y=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})})}),(y==null?void 0:y.choices)&&y.choices.length>0&&p.jsx("div",{className:"ml-3 mt-1 flex flex-wrap gap-1.5",children:y.choices.map(b=>p.jsx(Se,{variant:"outline",size:"sm",onClick:()=>m(b,y),disabled:c.isPending,children:b},b))})]},v.id)}),p.jsx("div",{ref:f})]})}),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(),d&&m(i,d)},children:[p.jsx(et,{value:i,onChange:v=>s(v.target.value),placeholder:d?"Type your response...":"Waiting for agent question...",disabled:!d||c.isPending}),p.jsx(Se,{type:"submit",size:"icon",disabled:!d||!i.trim()||c.isPending,children:p.jsx(Nne,{className:"h-4 w-4"})})]})]})})}function wTe(e,t){const[n,r]=x.useState([]),[a,i]=x.useState(!1),s=x.useRef(null),c=x.useRef(""),f=x.useRef(void 0),u=x.useRef(1e3);return x.useEffect(()=>{if(!t)return;c.current!==e&&(r([]),c.current=e);function m(){const d=new EventSource(`/api/sessions/${e}/events`);s.current=d,d.onopen=()=>{i(!0),u.current=1e3},d.addEventListener("snapshot",v=>{try{const y=JSON.parse(v.data);y.events&&Array.isArray(y.events)&&r(y.events)}catch{}}),d.addEventListener("delta",v=>{try{const y=JSON.parse(v.data);y.events&&Array.isArray(y.events)&&r(b=>[...b,...y.events])}catch{}}),d.onmessage=v=>{try{const y=JSON.parse(v.data);y.events&&Array.isArray(y.events)&&r(y.events)}catch{}},d.onerror=()=>{d.close(),s.current=null,i(!1),f.current=setTimeout(()=>{u.current=Math.min(u.current*2,15e3),m()},u.current)}}return m(),()=>{var d;(d=s.current)==null||d.close(),s.current=null,f.current&&clearTimeout(f.current)}},[e,t]),{events:n,connected:a}}function STe(e,t){const[n,r]=x.useState([]),[a,i]=x.useState([]),s=x.useRef(null),c=x.useRef(void 0),f=x.useRef(1e3),u=x.useRef(!1);return x.useEffect(()=>{if(!t){r([]),i([]),u.current=!1;return}function m(){if(u.current)return;const d=new EventSource(`/api/sessions/${e}/tree`);s.current=d,d.onopen=()=>{f.current=1e3},d.addEventListener("chat_history",v=>{try{const y=JSON.parse(v.data);y.messages&&i(y.messages)}catch{}}),d.addEventListener("ask_user",v=>{try{const y=JSON.parse(v.data);r(b=>b.some(w=>w.request_id===y.request_id)?b:[...b,y])}catch{}}),d.addEventListener("ask_user_resolved",v=>{try{const y=JSON.parse(v.data);y.request_id?r(b=>b.filter(w=>w.request_id!==y.request_id)):r([])}catch{r([])}}),d.addEventListener("stream_complete",()=>{u.current=!0,d.close(),s.current=null}),d.onerror=()=>{d.close(),s.current=null,!u.current&&(c.current=setTimeout(()=>{f.current=Math.min(f.current*2,15e3),m()},f.current))}}return m(),()=>{var d;(d=s.current)==null||d.close(),s.current=null,c.current&&clearTimeout(c.current)}},[e,t]),{pendingAskUsers:n,chatMessages:a}}function ETe(){return p.jsxs("div",{className:"space-y-6",children:[p.jsx(rn,{className:"h-8 w-64"}),p.jsx(rn,{className:"h-32 rounded-lg"}),p.jsx(rn,{className:"h-64 rounded-lg"})]})}function _Te(){const{projectId:e,runId:t}=Xy(),[n]=BY(),r=Number(e),a=j=>j==="starting"||j==="running",i=jre(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:f}=wTe(t??"",c),u=(s==null?void 0:s.events)??[],m=f.length>0?f:u,d=!!(s!=null&&s.interactive),{pendingAskUsers:v,chatMessages:y}=STe(t??"",d),[b,w]=x.useState(void 0);if(x.useEffect(()=>{v.length>0&&w("chat")},[v]),i.isLoading)return p.jsx(ETe,{});if(i.error)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx(ko,{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(ko,{className:"h-4 w-4"}),p.jsx("span",{children:"Session not found"})]});const S=PTe(m),E=TTe(m),O=n.get("tab")??(c?d?"chat":"agent-tree":"overview");return p.jsxs("div",{className:"space-y-6",children:[p.jsx(jTe,{session:s,projectId:r,runId:t??"",onStopped:()=>i.refetch()}),p.jsx(ATe,{session:s}),p.jsxs(RA,{value:b??O,onValueChange:w,children:[p.jsxs(DA,{children:[p.jsx(Wr,{value:"overview",children:"Overview"}),d&&p.jsxs(Wr,{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(Wr,{value:"agent-tree",children:"Agent Tree"}),p.jsx(Wr,{value:"logs",children:"Logs"}),p.jsxs(Wr,{value:"trace",children:["Trace",m.length>0&&` (${m.length})`]}),p.jsxs(Wr,{value:"artifacts",children:["Artifacts",S.length>0&&` (${S.length})`]})]}),p.jsxs(Qr,{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(ln,{children:p.jsx(cn,{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(ln,{children:p.jsx(cn,{className:"pt-4",children:p.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:p.jsx(NTe,{runId:s.run_id,hash:E})})})})]}),!s.task&&!E&&p.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),d&&p.jsx(Qr,{value:"chat",children:p.jsx(bTe,{runId:s.run_id,pendingAskUsers:v,initialMessages:y})}),p.jsx(Qr,{value:"agent-tree",children:p.jsx(mTe,{runId:s.run_id})}),p.jsx(Qr,{value:"logs",children:Object.keys(s.agents).length>0?p.jsx(vTe,{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(Qr,{value:"trace",children:m.length>0?p.jsx(ITe,{events:m,runId:s.run_id}):p.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),p.jsx(Qr,{value:"artifacts",children:S.length>0?p.jsx(MTe,{artifacts:S,runId:s.run_id}):p.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function jTe({session:e,projectId:t,runId:n,onStopped:r}){const[a,i]=x.useState(!1),s=BB(),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(Se,{size:"sm",variant:"destructive",onClick:async()=>{await s.mutateAsync(n),i(!1),r()},disabled:s.isPending,children:"Confirm"}),p.jsx(Se,{size:"sm",variant:"outline",onClick:()=>i(!1),children:"Cancel"})]}):p.jsxs(Se,{variant:"destructive",onClick:()=>i(!0),children:[p.jsx(vB,{className:"mr-2 h-4 w-4"}),"Stop Session"]})),p.jsx(Se,{variant:"outline",asChild:!0,children:p.jsxs(ra,{to:`/projects/${t}`,children:[p.jsx(lC,{className:"mr-2 h-4 w-4"}),"Back"]})})]})]})}function CTe({status:e}){const t=OTe(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 OTe(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 ATe({session:e}){return p.jsx(ln,{children:p.jsx(cn,{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(CTe,{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:Fg(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:Fg(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 NTe({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 TTe(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function PTe(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 MTe({artifacts:e,runId:t}){return p.jsx("div",{className:"space-y-1",children:e.map(n=>p.jsxs(bC,{children:[p.jsxs(wC,{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(y0,{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(SC,{children:p.jsx(kTe,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function kTe({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(Pm,{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 RTe({event:e}){const t=DTe(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 DTe(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function ITe({events:e,runId:t}){const[n,r]=x.useState(null);return p.jsxs(p.Fragment,{children:[p.jsx(ln,{children:p.jsx(cn,{className:"p-0",children:p.jsxs(Kc,{children:[p.jsx(Vc,{children:p.jsxs(Ir,{children:[p.jsx(We,{children:"Time"}),p.jsx(We,{children:"Event"}),p.jsx(We,{children:"Span"}),p.jsx(We,{children:"Details"})]})}),p.jsx(Yc,{children:e.map((a,i)=>p.jsxs(Ir,{children:[p.jsx(Qe,{className:"text-sm text-muted-foreground",children:Fg(a.ts)}),p.jsx(Qe,{children:p.jsx(RTe,{event:a.event})}),p.jsx(Qe,{className:"font-mono text-xs text-muted-foreground",children:a.span_id.slice(0,8)}),p.jsx(Qe,{className:"max-w-[400px] text-sm",children:zTe(a,(s,c)=>r({hash:s,label:c}))})]},i))})]})})}),p.jsx(vl,{open:!!n,onOpenChange:()=>r(null),children:p.jsxs(gl,{className:"max-w-3xl overflow-hidden",children:[p.jsx(yl,{children:p.jsx(xl,{children:n==null?void 0:n.label})}),n&&p.jsx(LTe,{runId:t,hash:n.hash})]})})]})}function LTe({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(Pm,{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 zTe(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 $Te(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 BTe({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(Hh,{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(uC,{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(dB,{className:"h-3 w-3"}),"Failed"]}):p.jsx(qt,{variant:"outline",children:e})}function UTe({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(BTe,{status:e.status}),e.duration_ms!==null&&p.jsx("span",{className:"text-xs text-muted-foreground",children:$Te(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(Hh,{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(ra,{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(Wte,{className:"h-3 w-3"}),"View session"]})]})}function HTe({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 FTe(){var Sn;const{projectId:e,conversationId:t}=Xy(),n=Number(e),r=Number(t),[a,i]=x.useState(""),[s,c]=x.useState(""),[f,u]=x.useState(!1),[m,d]=x.useState(""),[v,y]=x.useState(!1),[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,L]=x.useState(""),I=x.useRef(null),G=x.useRef(null),z=xC(),{data:V}=_o("agents"),{data:k}=_o("memories"),q=(Sn=pC(n).data)==null?void 0:Sn.merged,{data:U,error:Y}=YM(r),B=(U==null?void 0:U.sessions.some(we=>we.status==="running"||we.status==="starting"))??!1;YM(r,{refetchInterval:B?2e3:!1});const $=bre(r),X=BB(),Z=vC(n),ee=s.trim()&&!(z.data??[]).includes(s.trim())?"Role not found in installed roles":"",ie=U==null?void 0:U.sessions[U.sessions.length-1],ae=(ie==null?void 0:ie.status)==="running"||(ie==null?void 0:ie.status)==="starting";x.useEffect(()=>{var we;(we=I.current)==null||we.scrollIntoView({behavior:"smooth"})},[U==null?void 0:U.sessions.length,ie==null?void 0:ie.summary,ie==null?void 0:ie.status]);const re=(V??[]).map(we=>we.name),J=[...new Set((k??[]).map(we=>we.name)),"none"].sort(),le=b.trim()&&re.length>0&&!re.includes(b.trim())?"Runtime not found in installed agents":"",he=S.trim()&&J.length>0&&!J.includes(S.trim())?"Memory not found in installed providers":"",ne=!!le||!!he,ge=[b,S,O,A,T,R,K].filter(we=>we.trim()).length;function ye(we){we.preventDefault();const Tt=a.trim();if(!Tt||ae||ee||ne)return;const Ee={task:Tt,role:s.trim()||void 0,system_prompt:O.trim()||void 0,runtime:b.trim()||void 0,memory:S.trim()||void 0,max_num_delegations:A.trim()?Number(A):void 0,cache_delegations:T?T==="true":void 0,cache_max_entries:R.trim()?Number(R):void 0,cache_ttl_seconds:K.trim()?Number(K):void 0};$.mutate(Ee,{onSuccess:()=>i("")})}function De(we){we.key==="Enter"&&!we.shiftKey&&(we.preventDefault(),ye(we))}function Me(){d((U==null?void 0:U.title)??""),u(!0),setTimeout(()=>{var we;return(we=G.current)==null?void 0:we.select()},0)}function Ke(){const we=m.trim();Z.mutate({conversationId:r,title:we||null}),u(!1)}function Bt(we){we.key==="Enter"&&(we.preventDefault(),Ke()),we.key==="Escape"&&u(!1)}if(Y)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx(ko,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",Y.message]})]});const ut=(U==null?void 0:U.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:f?p.jsx(et,{ref:G,value:m,onChange:we=>d(we.target.value),onBlur:Ke,onKeyDown:Bt,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:Me,title:"Click to rename",children:ut})}),U&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[U.sessions.length," session",U.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:[(U==null?void 0:U.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."}),U==null?void 0:U.sessions.map(we=>p.jsxs("div",{className:"space-y-4",children:[we.task&&p.jsx(HTe,{task:we.task}),p.jsx(UTe,{session:we,projectId:n})]},we.run_id)),p.jsx("div",{ref:I})]})}),p.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:p.jsxs("form",{onSubmit:ye,className:"mx-auto max-w-2xl space-y-2",children:[p.jsx(Of,{value:a,onChange:we=>i(we.target.value),onKeyDown:De,placeholder:ae?"Agent is working…":"Describe the next task… (Enter to submit, Shift+Enter for new line)",disabled:ae||$.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),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(et,{list:"datalist-role",value:s,onChange:we=>c(we.target.value),placeholder:"Default role",className:"w-48 text-sm"}),ee&&p.jsx("p",{className:"text-xs text-destructive",children:ee})]}),p.jsx("datalist",{id:"datalist-role",children:(z.data??[]).map(we=>p.jsx("option",{value:we},we))}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsxs(Se,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>y(!0),title:"Advanced options",children:[p.jsx(xB,{className:"h-4 w-4"}),ge>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:ge})]}),ae?p.jsxs(Se,{type:"button",variant:"destructive",onClick:()=>ie&&X.mutate(ie.run_id),disabled:X.isPending,children:[X.isPending?p.jsx(Hh,{className:"mr-2 h-4 w-4 animate-spin"}):p.jsx(Mne,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}):p.jsx(Se,{type:"submit",disabled:!a.trim()||$.isPending||!!ee||ne,children:$.isPending?p.jsx(Hh,{className:"h-4 w-4 animate-spin"}):p.jsx(Yte,{className:"h-4 w-4"})})]})]})})]})}),p.jsx(vl,{open:v,onOpenChange:y,children:p.jsxs(gl,{className:"max-w-lg",children:[p.jsx(yl,{children:p.jsx(xl,{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(ft,{children:"Runtime"}),p.jsx(et,{list:"adv-datalist-runtime",value:b,onChange:we=>w(we.target.value),placeholder:(q==null?void 0:q.runtime)??"default",className:"text-sm"}),p.jsx("datalist",{id:"adv-datalist-runtime",children:re.map(we=>p.jsx("option",{value:we},we))}),le&&p.jsx("p",{className:"text-xs text-destructive",children:le})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{children:"Memory"}),p.jsx(et,{list:"adv-datalist-memory",value:S,onChange:we=>E(we.target.value),placeholder:(q==null?void 0:q.memory)??"dial",className:"text-sm"}),p.jsx("datalist",{id:"adv-datalist-memory",children:J.map(we=>p.jsx("option",{value:we},we))}),he&&p.jsx("p",{className:"text-xs text-destructive",children:he})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{children:"System Prompt"}),p.jsx(Of,{value:O,onChange:we=>j(we.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(ft,{children:"Max Delegations"}),p.jsx(et,{type:"number",min:"0",value:A,onChange:we=>N(we.target.value),placeholder:q!=null&&q.max_num_delegations?String(q.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{children:"Cache Delegations"}),p.jsxs(Ti,{value:T||"__empty__",onValueChange:we=>P(we==="__empty__"?"":we),children:[p.jsx(Mi,{className:"h-8 text-xs",children:p.jsx(Pi,{placeholder:`Default (${(q==null?void 0:q.cache_delegations)!==!1?"true":"false"})`})}),p.jsxs(ki,{children:[p.jsxs(Tn,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(q==null?void 0:q.cache_delegations)!==!1?"true":"false",")"]}),p.jsx(Tn,{value:"true",children:"true"}),p.jsx(Tn,{value:"false",children:"false"})]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{children:"Cache Max Entries"}),p.jsx(et,{type:"number",min:"0",value:R,onChange:we=>D(we.target.value),placeholder:q!=null&&q.cache_max_entries?String(q.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{children:"Cache TTL (seconds)"}),p.jsx(et,{type:"number",min:"0",value:K,onChange:we=>L(we.target.value),placeholder:q!=null&&q.cache_ttl_seconds?String(q.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),p.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[p.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>{w(""),E(""),j(""),N(""),P(""),D(""),L("")},children:"Reset"}),p.jsx(Se,{size:"sm",onClick:()=>y(!1),children:"Done"})]})]})})]})}const qTe={skills:["denden"],roles:["ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},KTe={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function VTe(){const{resourceType:e="roles"}=Xy(),{data:t,isLoading:n}=_o(e),[r,a]=x.useState(null),[i,s]=x.useState(!1),[c,f]=x.useState(!1),{data:u}=Gae(e,r??"",{enabled:i&&!!r}),m=KTe[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(Se,{onClick:()=>f(!0),size:"sm",children:[p.jsx(x0,{className:"mr-2 h-4 w-4"}),"Install"]})]}),n?p.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((d,v)=>p.jsx(rn,{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(Kc,{children:[p.jsx(Vc,{children:p.jsxs(Ir,{children:[p.jsx(We,{children:"Name"}),p.jsx(We,{children:"Version"}),p.jsx(We,{children:"Description"}),p.jsx(We,{children:"Source"}),p.jsx(We,{className:"w-24"})]})}),p.jsx(Yc,{children:t.map(d=>{var v;return p.jsxs(Ir,{className:"cursor-pointer",onClick:()=>{a(d.name),s(!0)},children:[p.jsx(Qe,{className:"font-medium",children:d.name}),p.jsx(Qe,{className:"text-sm text-muted-foreground",children:d.version??"—"}),p.jsx(Qe,{className:"max-w-[300px] truncate text-sm",children:d.description||"—"}),p.jsx(Qe,{children:p.jsx(qt,{variant:"outline",className:"text-xs",children:d.source})}),p.jsx(Qe,{children:!((v=qTe[e])!=null&&v.includes(d.name))&&p.jsx(YTe,{resourceType:e,name:d.name})})]},d.name)})})]}),p.jsx(XB,{resource:u??null,resourceType:e,open:i,onOpenChange:s}),p.jsx(EC,{open:c,onOpenChange:f,defaultType:e})]})}function YTe({resourceType:e,name:t}){const[n,r]=x.useState(!1),a=YB(),i=s=>{s.stopPropagation(),a.mutate({type:e,name:t},{onSuccess:c=>{c.exit_code===0?xt.success(`Uninstalled ${t}`):xt.error(`Uninstall failed: ${c.stderr||c.stdout}`),r(!1)},onError:()=>{xt.error("Uninstall request failed"),r(!1)}})};return n?p.jsxs("div",{className:"flex gap-1",children:[p.jsx(Se,{size:"sm",variant:"destructive",onClick:i,disabled:a.isPending,children:"Confirm"}),p.jsx(Se,{size:"sm",variant:"outline",onClick:s=>{s.stopPropagation(),r(!1)},children:"No"})]}):p.jsx(Se,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:s=>{s.stopPropagation(),r(!0)},children:p.jsx(pl,{className:"h-4 w-4"})})}function GTe(){return xn({queryKey:Be.schedules.all,queryFn:()=>$e.get("/schedules")})}function XTe(){const e=vt();return At({mutationFn:t=>$e.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Be.schedules.all})}})}function WTe(){const e=vt();return At({mutationFn:({id:t,...n})=>$e.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:Be.schedules.all})}})}function QTe(){const e=vt();return At({mutationFn:t=>$e.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Be.schedules.all})}})}function ZTe(){const e=vt();return At({mutationFn:({id:t,enable:n})=>$e.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Be.schedules.all})}})}var WS={exports:{}},ZL;function JTe(){return ZL||(ZL=1,(function(e,t){(function(r,a){e.exports=a()})(globalThis,()=>(()=>{var n={949(s,c,f){Object.defineProperty(c,"__esModule",{value:!0}),c.CronParser=void 0;var u=f(515),m=(function(){function d(v,y,b){y===void 0&&(y=!0),b===void 0&&(b=!1),this.expression=v,this.dayOfWeekStartIndexZero=y,this.monthStartIndexZero=b}return d.prototype.parse=function(){var v,y,b=(v=this.expression)!==null&&v!==void 0?v:"";if(b==="@reboot")return y=["@reboot","","","","","",""],y;if(b.startsWith("@")){var w=this.parseSpecial(this.expression);y=this.extractParts(w)}else y=this.extractParts(this.expression);return this.normalize(y),this.validate(y),y},d.prototype.parseSpecial=function(v){var y={"@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=y[v];if(!b)throw new Error("Unknown special expression.");return b},d.prototype.extractParts=function(v){if(!this.expression)throw new Error("cron expression is empty");for(var y=v.trim().split(/[ ]+/),b=0;b<y.length;b++)if(y[b].includes(",")){var w=y[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}),y[b]=w.map(function(E){return E!==null?E.toString():""}).join(",")}if(y.length<5)throw new Error("Expression has only ".concat(y.length," part").concat(y.length==1?"":"s",". At least 5 parts are required."));if(y.length==5)y.unshift(""),y.push("");else if(y.length==6){var S=/\d{4}$/.test(y[5])||y[4]=="?"||y[2]=="?";S?y.unshift(""):y.push("")}else if(y.length>7)throw new Error("Expression has ".concat(y.length," parts; too many!"));return y},d.prototype.normalize=function(v){var y=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 y.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 y.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])}}},d.prototype.validate=function(v){var y="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(v[0],y),this.validateOnlyExpectedCharactersFound(v[1],y),this.validateOnlyExpectedCharactersFound(v[2],y),this.validateOnlyExpectedCharactersFound(v[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(v[4],y),this.validateOnlyExpectedCharactersFound(v[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(v[6],y),this.validateAnyRanges(v)},d.prototype.validateAnyRanges=function(v){u.default.secondRange(v[0]),u.default.minuteRange(v[1]),u.default.hourRange(v[2]),u.default.dayOfMonthRange(v[3]),u.default.monthRange(v[4],this.monthStartIndexZero),u.default.dayOfWeekRange(v[5],this.dayOfWeekStartIndexZero)},d.prototype.validateOnlyExpectedCharactersFound=function(v,y){var b=v.match(new RegExp("[^".concat(y,"]+"),"gi"));if(b&&b.length)throw new Error("Expression contains invalid values: '".concat(b.toString(),"'"))},d})();c.CronParser=m},333(s,c,f){Object.defineProperty(c,"__esModule",{value:!0}),c.ExpressionDescriptor=void 0;var u=f(823),m=f(949),d=(function(){function v(y,b){if(this.expression=y,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(y,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,L=w.logicalAndDayFields,I=L===void 0?!1:L,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 z=new v(y,G);return z.getFullDescription()},v.initialize=function(y,b){b===void 0&&(b="en"),v.specialCharacters=["/","-",",","*"],v.defaultLocale=b,y.load(v.locales)},v.prototype.getFullDescription=function(){var y,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=(y=this.i18n).atReboot)===null||b===void 0?void 0:b.call(y))||"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 y=this.expressionParts[0],b=this.expressionParts[1],w=this.expressionParts[2],S="";if(!u.StringUtilities.containsAny(b,v.specialCharacters)&&!u.StringUtilities.containsAny(w,v.specialCharacters)&&!u.StringUtilities.containsAny(y,v.specialCharacters))S+=this.i18n.atSpace()+this.formatTime(w,b,y);else if(!y&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!u.StringUtilities.containsAny(w,v.specialCharacters)){var E=b.split("-");S+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(w,E[0],""),this.formatTime(w,E[1],""))}else if(!y&&w.indexOf(",")>-1&&w.indexOf("-")==-1&&w.indexOf("/")==-1&&!u.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 y=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(w){return w},function(w){return u.StringUtilities.format(y.i18n.everyX0Seconds(w),w)},function(w){return y.i18n.secondsX0ThroughX1PastTheMinute()},function(w){return w=="0"?"":parseInt(w)<20?y.i18n.atX0SecondsPastTheMinute(w):y.i18n.atX0SecondsPastTheMinuteGt20()||y.i18n.atX0SecondsPastTheMinute(w)});return b},v.prototype.getMinutesDescription=function(){var y=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 u.StringUtilities.format(y.i18n.everyX0Minutes(E),E)},function(E){return y.i18n.minutesX0ThroughX1PastTheHour()},function(E){var O,j;try{return E=="0"&&w.indexOf("/")==-1&&b==""?y.i18n.everyHour():E=="0"?((j=(O=y.i18n).onTheHour)===null||j===void 0?void 0:j.call(O))||y.i18n.atX0MinutesPastTheHour(E):parseInt(E)<20?y.i18n.atX0MinutesPastTheHour(E):y.i18n.atX0MinutesPastTheHourGt20()||y.i18n.atX0MinutesPastTheHour(E)}catch{return y.i18n.atX0MinutesPastTheHour(E)}});return S},v.prototype.getHoursDescription=function(){var y=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&&y.expressionParts[1]!=="0";return E++,N?y.formatTime(j,"59",""):y.formatTime(j,"0","")},function(j){return u.StringUtilities.format(y.i18n.everyX0Hours(j),j)},function(j){return y.i18n.betweenX0AndX1()},function(j){return y.i18n.atX0()});return O},v.prototype.getDayOfWeekDescription=function(){var y=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=y.i18n.daysOfTheWeekInCase?y.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=y.i18n.first(P);break;case"2":N=y.i18n.second(P);break;case"3":N=y.i18n.third(P);break;case"4":N=y.i18n.fourth(P);break;case"5":N=y.i18n.fifth(P);break}A=N+" "+A}return A},function(S){return parseInt(S)==1?"":u.StringUtilities.format(y.i18n.commaEveryX0DaysOfTheWeek(S),S)},function(S){var E=S.substring(0,S.indexOf("-")),O=y.expressionParts[3]!="*";return O?y.i18n.commaAndX0ThroughX1(E):y.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=y.i18n.commaOnThe(O,j).trim()+y.i18n.spaceX0OfTheMonth()}else if(S.indexOf("L")>-1)E=y.i18n.commaOnTheLastX0OfTheMonth(S.replace("L",""));else{var A=y.expressionParts[3]!="*";A?y.options.logicalAndDayFields?E=y.i18n.commaOnlyOnX0(S):E=y.i18n.commaAndOnX0():E=y.i18n.commaOnlyOnX0(S)}return E}),w},v.prototype.getMonthDescription=function(){var y=this,b=this.i18n.monthsOfTheYear(),w=this.getSegmentDescription(this.expressionParts[4],"",function(S,E){return E&&y.i18n.monthsOfTheYearInCase?y.i18n.monthsOfTheYearInCase(E)[parseInt(S)-1]:b[parseInt(S)-1]},function(S){return parseInt(S)==1?"":u.StringUtilities.format(y.i18n.commaEveryX0Months(S),S)},function(S){return y.i18n.commaMonthX0ThroughMonthX1()||y.i18n.commaX0ThroughX1()},function(S){return y.i18n.commaOnlyInMonthX0?y.i18n.commaOnlyInMonthX0():y.i18n.commaOnlyInX0()});return w},v.prototype.getDayOfMonthDescription=function(){var y=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():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),E.toString());b=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),O);break}else{var j=w.match(/L-(\d{1,2})/);if(j){var A=j[1];b=u.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"?y.i18n.lastDay():y.i18n.dayX0?u.StringUtilities.format(y.i18n.dayX0(),N):N},function(N){return N=="1"?y.i18n.commaEveryDay():y.i18n.commaEveryX0Days(N)},function(N){return y.i18n.commaBetweenDayX0AndX1OfTheMonth(N)},function(N){return y.i18n.commaOnDayX0OfTheMonth(N)})}break}}return b},v.prototype.getYearDescription=function(){var y=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(w){return/^\d+$/.test(w)?new Date(parseInt(w),1).getFullYear().toString():w},function(w){return u.StringUtilities.format(y.i18n.commaEveryX0Years(w),w)},function(w){return y.i18n.commaYearX0ThroughYearX1()||y.i18n.commaX0ThroughX1()},function(w){return y.i18n.commaOnlyInYearX0?y.i18n.commaOnlyInYearX0():y.i18n.commaOnlyInX0()});return b},v.prototype.getSegmentDescription=function(y,b,w,S,E,O){var j=null,A=y.indexOf("/")>-1,N=y.indexOf("-")>-1,T=y.indexOf(",")>-1;if(!y)j="";else if(y==="*")j=b;else if(!A&&!N&&!T)j=u.StringUtilities.format(O(y),w(y));else if(T){for(var P=y.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,L=this.getSegmentDescription(P[D],b,w,S,K?this.i18n.commaX0ThroughX1:E,O);K&&(L=L.replace(", ","")),R+=L}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=u.StringUtilities.format(O(y),R)}else if(A){var P=y.split("/");if(j=u.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 z=u.StringUtilities.format(O(P[0]),w(P[0]));z=z.replace(", ",""),j+=u.StringUtilities.format(this.i18n.commaStartingX0(),z)}}else N&&(j=this.generateRangeSegmentDescription(y,E,w));return j},v.prototype.generateRangeSegmentDescription=function(y,b,w){var S="",E=y.split("-"),O=w(E[0],1),j=w(E[1],2),A=b(y);return S+=u.StringUtilities.format(A,O,j),S},v.prototype.formatTime=function(y,b,w){var S=0,E=0,O=parseInt(y)+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(y,b){if(!b&&(y=y.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),y=y.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),y=y.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),y=y.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];y=y.replace(new RegExp(O,"g"),j)}return y},v.prototype.getPeriod=function(y){return y>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},v.locales={},v})();c.ExpressionDescriptor=d},747(s,c,f){Object.defineProperty(c,"__esModule",{value:!0}),c.enLocaleLoader=void 0;var u=f(486),m=(function(){function d(){}return d.prototype.load=function(v){v.en=new u.en},d})();c.enLocaleLoader=m},486(s,c){Object.defineProperty(c,"__esModule",{value:!0}),c.en=void 0;var f=(function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days in a month"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u.prototype.onTheHour=function(){return"on the hour"},u})();c.en=f},515(s,c){Object.defineProperty(c,"__esModule",{value:!0});function f(m,d){if(!m)throw new Error(d)}var u=(function(){function m(){}return m.secondRange=function(d){for(var v=d.split(","),y=0;y<v.length;y++)if(!isNaN(parseInt(v[y],10))){var b=parseInt(v[y],10);f(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},m.minuteRange=function(d){for(var v=d.split(","),y=0;y<v.length;y++)if(!isNaN(parseInt(v[y],10))){var b=parseInt(v[y],10);f(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},m.hourRange=function(d){for(var v=d.split(","),y=0;y<v.length;y++)if(!isNaN(parseInt(v[y],10))){var b=parseInt(v[y],10);f(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},m.dayOfMonthRange=function(d){for(var v=d.split(","),y=0;y<v.length;y++)if(!isNaN(parseInt(v[y],10))){var b=parseInt(v[y],10);f(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},m.monthRange=function(d,v){for(var y=d.split(","),b=0;b<y.length;b++)if(!isNaN(parseInt(y[b],10))){var w=parseInt(y[b],10);f(w>=1&&w<=12,v?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},m.dayOfWeekRange=function(d,v){for(var y=d.split(","),b=0;b<y.length;b++)if(!isNaN(parseInt(y[b],10))){var w=parseInt(y[b],10);f(w>=0&&w<=6,v?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},m})();c.default=u},823(s,c){Object.defineProperty(c,"__esModule",{value:!0}),c.StringUtilities=void 0;var f=(function(){function u(){}return u.format=function(m){for(var d=[],v=1;v<arguments.length;v++)d[v-1]=arguments[v];return m.replace(/%s/g,function(y){return d.shift()})},u.containsAny=function(m,d){return d.some(function(v){return m.indexOf(v)>-1})},u})();c.StringUtilities=f}},r={};function a(s){var c=r[s];if(c!==void 0)return c.exports;var f=r[s]={exports:{}};return n[s](f,f.exports,a),f.exports}var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.toString=void 0;var c=a(333),f=a(747);c.ExpressionDescriptor.initialize(new f.enLocaleLoader),s.default=c.ExpressionDescriptor;var u=c.ExpressionDescriptor.toString;s.toString=u})(),i})())})(WS)),WS.exports}var e2e=JTe();const t2e=Za(e2e),n2e=[{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 r2e({open:e,onOpenChange:t,editing:n}){const{data:r}=Zf(),{data:a}=xC(),i=XTe(),s=WTe(),[c,f]=x.useState(""),[u,m]=x.useState(""),[d,v]=x.useState(""),[y,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?(f(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(){f(""),m(""),v(""),b(""),S(""),O(""),A(!0),T(!1)}async function R(I){I.preventDefault();try{const G={name:c.trim(),task:d.trim(),cron_expr:y.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(u)}),P(),t(!1)}catch{}}const D=x.useMemo(()=>{if(!y.trim())return null;try{return t2e.toString(y.trim())}catch{return null}},[y]),K=i.isPending||s.isPending,L=i.error||s.error;return p.jsx(vl,{open:e,onOpenChange:t,children:p.jsxs(gl,{className:"max-w-lg",children:[p.jsx(yl,{children:p.jsx(xl,{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(ft,{htmlFor:"sched-name",children:["Name ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx(et,{id:"sched-name",value:c,onChange:I=>f(I.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs(ft,{htmlFor:"sched-project",children:["Project ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsxs(Ti,{value:u,onValueChange:m,required:!0,children:[p.jsx(Mi,{id:"sched-project",children:p.jsx(Pi,{placeholder:"Select a project"})}),p.jsx(ki,{children:(r??[]).map(I=>p.jsx(Tn,{value:String(I.id),children:I.display_name},I.id))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs(ft,{htmlFor:"sched-task",children:["Task ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx(Of,{id:"sched-task",value:d,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(ft,{htmlFor:"sched-cron",children:["Cron Expression ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsxs(Bg,{children:[p.jsx(Ug,{asChild:!0,children:p.jsxs(Se,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",p.jsx(Uh,{className:"ml-1 h-3 w-3"})]})}),p.jsx(Hg,{align:"end",children:n2e.map(I=>p.jsxs(jh,{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(et,{id:"sched-cron",value:y,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(ft,{htmlFor:"sched-role",children:"Role"}),p.jsx(et,{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(bC,{open:N,onOpenChange:T,children:[p.jsx(wC,{asChild:!0,children:p.jsxs(Se,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[p.jsx(Uh,{className:`h-3 w-3 transition-transform ${N?"rotate-180":""}`}),"Advanced Options"]})}),p.jsx(SC,{className:"space-y-4 pt-2",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx(ft,{htmlFor:"sched-prompt",children:"System Prompt"}),p.jsx(Of,{id:"sched-prompt",value:E,onChange:I=>O(I.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),L&&p.jsx("p",{className:"text-sm text-destructive",children:L.message}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Se,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),p.jsx(Se,{type:"submit",disabled:K,children:K?"Saving...":n?"Update":"Create"})]})]})]})})}function JL(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 a2e({schedule:e}){return e.enabled?e.last_error?p.jsx(lB,{children:p.jsxs(xte,{children:[p.jsx(bte,{children:p.jsx(qt,{variant:"destructive",children:"Error"})}),p.jsx(wte,{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 i2e(){const{data:e,isLoading:t,error:n}=GTe(),[r,a]=x.useState(!1),[i,s]=x.useState(null),c=QTe(),f=ZTe();if(t)return p.jsxs("div",{className:"space-y-6",children:[p.jsx(rn,{className:"h-8 w-48"}),p.jsx(rn,{className:"h-64 rounded-lg"})]});if(n)return p.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[p.jsx(ko,{className:"h-4 w-4"}),p.jsxs("span",{children:["Error: ",n.message]})]});const u=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(Se,{onClick:()=>{s(null),a(!0)},children:[p.jsx($g,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),u.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(Se,{variant:"outline",className:"mt-4",onClick:()=>{s(null),a(!0)},children:[p.jsx($g,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):p.jsx("div",{className:"rounded-lg border",children:p.jsxs(Kc,{children:[p.jsx(Vc,{children:p.jsxs(Ir,{children:[p.jsx(We,{children:"Name"}),p.jsx(We,{children:"Project"}),p.jsx(We,{children:"Cron"}),p.jsx(We,{children:"Next Run"}),p.jsx(We,{children:"Last Run"}),p.jsx(We,{children:"Status"}),p.jsx(We,{className:"w-[120px]",children:"Actions"})]})}),p.jsx(Yc,{children:u.map(m=>p.jsxs(Ir,{children:[p.jsx(Qe,{className:"font-medium",children:m.name}),p.jsx(Qe,{className:"text-muted-foreground",children:m.project_name}),p.jsx(Qe,{children:p.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:m.cron_expr})}),p.jsx(Qe,{className:"text-sm text-muted-foreground",children:JL(m.next_run_at)}),p.jsx(Qe,{className:"text-sm text-muted-foreground",children:JL(m.last_run_at)}),p.jsx(Qe,{children:p.jsx(a2e,{schedule:m})}),p.jsx(Qe,{children:p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(Se,{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(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>f.mutate({id:m.id,enable:!m.enabled}),children:m.enabled?p.jsx(Sne,{className:"h-3.5 w-3.5"}):p.jsx(dC,{className:"h-3.5 w-3.5"})}),p.jsx(Se,{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(pl,{className:"h-3.5 w-3.5"})})]})})]},m.id))})]})}),p.jsx(r2e,{open:r,onOpenChange:a,editing:i})]})}function QS(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},a=e.trace??{};return{runtime:or(e.runtime),isolation:or(e.isolation),memory:or(e.memory),orchestrator_role:or(t.role),orchestrator_permission_mode:or(t.permission_mode),policy_max_depth:or(n.max_depth),policy_agent_timeout:or(n.agent_timeout),policy_max_delegate_retries:or(n.max_delegate_retries),policy_cache_delegations:or(n.cache_delegations),policy_cache_max_entries:or(n.cache_max_entries),policy_cache_ttl_seconds:or(n.cache_ttl_seconds),policy_max_num_delegations:or(n.max_num_delegations),session_merge_strategy:or(r.merge_strategy),session_pull_before_session:or(r.pull_before_session),session_pr_command:or(r.pr_command),trace_enabled:or(a.enabled)}}function or(e){return e==null?"":String(e)}function o2e(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 s2e=["none","worktree"],l2e=["default","plan","bypassPermissions"],c2e=["auto","local","pr"],u2e=["prompt","always","never"],ez=["true","false"],ZS="__empty__";function tz({values:e,placeholders:t,onSave:n,saving:r}){const[a,i]=x.useState(QS(e)),{data:s}=_o("agents"),{data:c}=_o("roles"),{data:f}=_o("memories"),u=t?QS(t):void 0,m=JSON.stringify(e);x.useEffect(()=>{i(QS(e))},[m]);const d=N=>T=>i(P=>({...P,[N]:T})),v=()=>{n(o2e(a))},y=(s??[]).map(N=>N.name),b=(c??[]).map(N=>N.name),w=new Set((f??[]).map(N=>N.name));w.add("none");const S=[...w].sort(),E=a.runtime&&y.length>0&&!y.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(Ls,{}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsxs(sr,{label:"Runtime",children:[p.jsx(et,{list:"cfg-dl-runtime",value:a.runtime,onChange:N=>d("runtime")(N.target.value),placeholder:(u==null?void 0:u.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),y.length>0&&p.jsx("datalist",{id:"cfg-dl-runtime",children:y.map(N=>p.jsx("option",{value:N},N))}),E&&p.jsx("p",{className:"text-xs text-destructive",children:E})]}),p.jsx(sr,{label:"Isolation",children:p.jsx(Vu,{value:a.isolation,onChange:d("isolation"),options:s2e,placeholder:(u==null?void 0:u.isolation)||"none",allowEmpty:!0})}),p.jsxs(sr,{label:"Memory",children:[p.jsx(et,{list:"cfg-dl-memory",value:a.memory,onChange:N=>d("memory")(N.target.value),placeholder:(u==null?void 0:u.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(Ls,{}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[p.jsxs(sr,{label:"Role",children:[p.jsx(et,{list:"cfg-dl-role",value:a.orchestrator_role,onChange:N=>d("orchestrator_role")(N.target.value),placeholder:(u==null?void 0:u.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(sr,{label:"Permission Mode",children:p.jsx(Vu,{value:a.orchestrator_permission_mode,onChange:d("orchestrator_permission_mode"),options:l2e,placeholder:(u==null?void 0:u.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(Ls,{}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsx(sr,{label:"Max Depth",children:p.jsx(et,{type:"number",value:a.policy_max_depth,onChange:N=>d("policy_max_depth")(N.target.value),placeholder:(u==null?void 0:u.policy_max_depth)||"3",className:"h-8 text-xs"})}),p.jsx(sr,{label:"Agent Timeout (seconds)",children:p.jsx(et,{type:"number",value:a.policy_agent_timeout,onChange:N=>d("policy_agent_timeout")(N.target.value),placeholder:(u==null?void 0:u.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),p.jsx(sr,{label:"Max Delegate Retries",children:p.jsx(et,{type:"number",value:a.policy_max_delegate_retries,onChange:N=>d("policy_max_delegate_retries")(N.target.value),placeholder:(u==null?void 0:u.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),p.jsx(sr,{label:"Cache Delegations",children:p.jsx(Vu,{value:a.policy_cache_delegations,onChange:d("policy_cache_delegations"),options:ez,placeholder:(u==null?void 0:u.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),p.jsx(sr,{label:"Cache Max Entries",children:p.jsx(et,{value:a.policy_cache_max_entries,onChange:N=>d("policy_cache_max_entries")(N.target.value),placeholder:(u==null?void 0:u.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),p.jsx(sr,{label:"Cache TTL (seconds)",children:p.jsx(et,{value:a.policy_cache_ttl_seconds,onChange:N=>d("policy_cache_ttl_seconds")(N.target.value),placeholder:(u==null?void 0:u.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),p.jsx(sr,{label:"Max Delegations",children:p.jsx(et,{type:"number",min:"0",value:a.policy_max_num_delegations,onChange:N=>d("policy_max_num_delegations")(N.target.value),placeholder:(u==null?void 0:u.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(Ls,{}),p.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[p.jsx(sr,{label:"Merge Strategy",children:p.jsx(Vu,{value:a.session_merge_strategy,onChange:d("session_merge_strategy"),options:c2e,placeholder:(u==null?void 0:u.session_merge_strategy)||"auto",allowEmpty:!0})}),p.jsx(sr,{label:"Pull Before Session",children:p.jsx(Vu,{value:a.session_pull_before_session,onChange:d("session_pull_before_session"),options:u2e,placeholder:(u==null?void 0:u.session_pull_before_session)||"prompt",allowEmpty:!0})}),p.jsx(sr,{label:"PR Command",className:"sm:col-span-3",children:p.jsx(et,{value:a.session_pr_command,onChange:N=>d("session_pr_command")(N.target.value),placeholder:(u==null?void 0:u.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(Ls,{}),p.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:p.jsx(sr,{label:"Enabled",children:p.jsx(Vu,{value:a.trace_enabled,onChange:d("trace_enabled"),options:ez,placeholder:(u==null?void 0:u.trace_enabled)||"true",allowEmpty:!0})})})]}),p.jsxs(Se,{size:"sm",onClick:v,disabled:r||A,className:"self-start",children:[p.jsx(gB,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function sr({label:e,children:t,className:n}){return p.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[p.jsx(ft,{className:"text-xs",children:e}),t]})}function Vu({value:e,onChange:t,options:n,placeholder:r,allowEmpty:a}){return p.jsxs(Ti,{value:e||(a?ZS:""),onValueChange:i=>t(i===ZS?"":i),children:[p.jsx(Mi,{className:"h-8 text-xs",children:p.jsx(Pi,{placeholder:r})}),p.jsxs(ki,{children:[a&&p.jsx(Tn,{value:ZS,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(i=>p.jsx(Tn,{value:i,children:i},i))]})]})}function f2e(){var v,y;const[e,t]=x.useState("global"),[n,r]=x.useState(null),a=vt(),i=FB(),s=Zf(),c=pC(n??0,{enabled:n!=null}),f=Rae(),u=qB(),m=b=>{f.mutate(b,{onSuccess:()=>xt.success("Global configuration saved"),onError:()=>xt.error("Failed to save global configuration")})},d=b=>{n!=null&&u.mutate({projectId:n,data:b},{onSuccess:()=>xt.success("Project configuration saved"),onError:()=>xt.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(RA,{value:e,onValueChange:t,children:[p.jsxs(DA,{children:[p.jsx(Wr,{value:"global",children:"Global"}),p.jsx(Wr,{value:"project",children:"Project"})]}),p.jsx(Qr,{value:"global",className:"mt-4",children:i.isLoading?p.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):p.jsx(tz,{values:((v=i.data)==null?void 0:v.values)??{},placeholders:(y=i.data)==null?void 0:y.defaults,onSave:m,saving:f.isPending})}),p.jsx(Qr,{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(ft,{className:"text-xs",children:"Project"}),p.jsxs(Ti,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[p.jsx(Mi,{className:"h-8 text-xs",children:p.jsx(Pi,{placeholder:"Select a project"})}),p.jsx(ki,{children:(s.data??[]).map(b=>p.jsx(Tn,{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(tz,{values:c.data.project,placeholders:c.data.merged_nested,onSave:d,saving:u.isPending},n)]})})]})]})}function d2e(){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(Se,{variant:"outline",asChild:!0,children:p.jsxs(ra,{to:"/",children:[p.jsx(sne,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const h2e=3,m2e=1e4,p2e=2e3;function v2e(){const e=vt(),t=x.useRef(null),n=x.useRef(void 0),r=x.useRef(1e3),a=x.useRef(0),i=x.useRef({});x.useEffect(()=>{function s(f){const u=Date.now();if(u-a.current<p2e)return!1;const m=(i.current[f]??[]).filter(d=>u-d<m2e);return m.length>=h2e?!1:(m.push(u),i.current[f]=m,!0)}function c(){const f=new EventSource("/api/events");t.current=f,f.onopen=()=>{r.current=1e3,a.current=Date.now()};const u=m=>{try{const d=JSON.parse(m.data),v=(d.run_id??"unknown").slice(0,12);s(m.type)&&(m.type==="session_started"?xt.info(`Session ${v} started`):m.type==="session_completed"?xt.success(`Session ${v} completed`):m.type==="session_failed"?xt.error(`Session ${v} failed`):m.type==="session_stopped"&&xt.warning(`Session ${v} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),d.project_id&&(e.invalidateQueries({queryKey:Be.projects.sessions(d.project_id)}),e.invalidateQueries({queryKey:Be.conversations.all(d.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}catch{}};f.addEventListener("session_started",u),f.addEventListener("session_completed",u),f.addEventListener("session_failed",u),f.addEventListener("session_stopped",u),f.onerror=()=>{f.close(),t.current=null,n.current=setTimeout(()=>{r.current=Math.min(r.current*2,15e3),c()},r.current)}}return c(),()=>{var f;(f=t.current)==null||f.close(),t.current=null,n.current&&clearTimeout(n.current)}},[e])}function g2e(){return v2e(),p.jsx(fY,{children:p.jsxs(La,{element:p.jsx(xae,{}),children:[p.jsx(La,{index:!0,element:p.jsx(Nae,{})}),p.jsx(La,{path:"projects",element:p.jsx($ae,{})}),p.jsx(La,{path:"projects/:projectId",element:p.jsx($Ee,{})}),p.jsx(La,{path:"projects/:projectId/sessions/:runId",element:p.jsx(_Te,{})}),p.jsx(La,{path:"projects/:projectId/conversations/:conversationId",element:p.jsx(FTe,{})}),p.jsx(La,{path:"schedules",element:p.jsx(i2e,{})}),p.jsx(La,{path:"resources/:resourceType",element:p.jsx(VTe,{})}),p.jsx(La,{path:"settings",element:p.jsx(f2e,{})}),p.jsx(La,{path:"*",element:p.jsx(d2e,{})})]})})}fV.createRoot(document.getElementById("root")).render(p.jsx(x.StrictMode,{children:p.jsx(CG,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:p.jsx(gG,{client:yre,children:p.jsxs(lB,{children:[p.jsx(IY,{children:p.jsx(g2e,{})}),p.jsx(gre,{})]})})})}));
