var xQ=Object.defineProperty;var CR=e=>{throw TypeError(e)};var bQ=(e,t,n)=>t in e?xQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ES=(e,t,n)=>bQ(e,typeof t!="symbol"?t+"":t,n),_S=(e,t,n)=>t.has(e)||CR("Cannot "+n);var W=(e,t,n)=>(_S(e,t,"read from private field"),n?n.call(e):t.get(e)),De=(e,t,n)=>t.has(e)?CR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ne=(e,t,n,r)=>(_S(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ot=(e,t,n)=>(_S(e,t,"access private method"),n);var Kv=(e,t,n,r)=>({set _(i){Ne(e,t,i,n)},get _(){return W(e,t,r)}});function wQ(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Gi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var CS={exports:{}},Xh={};/**
 * @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 NR;function SQ(){if(NR)return Xh;NR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Xh.Fragment=t,Xh.jsx=n,Xh.jsxs=n,Xh}var kR;function jQ(){return kR||(kR=1,CS.exports=SQ()),CS.exports}var f=jQ(),NS={exports:{}},ht={};/**
 * @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 AR;function EQ(){if(AR)return ht;AR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.iterator;function v(q){return q===null||typeof q!="object"?null:(q=g&&q[g]||q["@@iterator"],typeof q=="function"?q:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function j(q,$,F){this.props=q,this.context=$,this.refs=S,this.updater=F||b}j.prototype.isReactComponent={},j.prototype.setState=function(q,$){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,$,"setState")},j.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function C(){}C.prototype=j.prototype;function E(q,$,F){this.props=q,this.context=$,this.refs=S,this.updater=F||b}var k=E.prototype=new C;k.constructor=E,w(k,j.prototype),k.isPureReactComponent=!0;var O=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function B(q,$,F){var Q=F.ref;return{$$typeof:e,type:q,key:$,ref:Q!==void 0?Q:null,props:F}}function I(q,$){return B(q.type,$,q.props)}function U(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function L(q){var $={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(F){return $[F]})}var G=/\/+/g;function z(q,$){return typeof q=="object"&&q!==null&&q.key!=null?L(""+q.key):$.toString(36)}function K(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(A,A):(q.status="pending",q.then(function($){q.status==="pending"&&(q.status="fulfilled",q.value=$)},function($){q.status==="pending"&&(q.status="rejected",q.reason=$)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function P(q,$,F,Q,Z){var te=typeof q;(te==="undefined"||te==="boolean")&&(q=null);var ae=!1;if(q===null)ae=!0;else switch(te){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(q.$$typeof){case e:case t:ae=!0;break;case m:return ae=q._init,P(ae(q._payload),$,F,Q,Z)}}if(ae)return Z=Z(q),ae=Q===""?"."+z(q,0):Q,O(Z)?(F="",ae!=null&&(F=ae.replace(G,"$&/")+"/"),P(Z,$,F,"",function(se){return se})):Z!=null&&(U(Z)&&(Z=I(Z,F+(Z.key==null||q&&q.key===Z.key?"":(""+Z.key).replace(G,"$&/")+"/")+ae)),$.push(Z)),1;ae=0;var re=Q===""?".":Q+":";if(O(q))for(var ee=0;ee<q.length;ee++)Q=q[ee],te=re+z(Q,ee),ae+=P(Q,$,F,te,Z);else if(ee=v(q),typeof ee=="function")for(q=ee.call(q),ee=0;!(Q=q.next()).done;)Q=Q.value,te=re+z(Q,ee++),ae+=P(Q,$,F,te,Z);else if(te==="object"){if(typeof q.then=="function")return P(K(q),$,F,Q,Z);throw $=String(q),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ae}function H(q,$,F){if(q==null)return q;var Q=[],Z=0;return P(q,Q,"","",function(te){return $.call(F,te,Z++)}),Q}function Y(q){if(q._status===-1){var $=q._result;$=$(),$.then(function(F){(q._status===0||q._status===-1)&&(q._status=1,q._result=F)},function(F){(q._status===0||q._status===-1)&&(q._status=2,q._result=F)}),q._status===-1&&(q._status=0,q._result=$)}if(q._status===1)return q._result.default;throw q._result}var V=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},D={map:H,forEach:function(q,$,F){H(q,function(){$.apply(this,arguments)},F)},count:function(q){var $=0;return H(q,function(){$++}),$},toArray:function(q){return H(q,function($){return $})||[]},only:function(q){if(!U(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return ht.Activity=h,ht.Children=D,ht.Component=j,ht.Fragment=n,ht.Profiler=i,ht.PureComponent=E,ht.StrictMode=r,ht.Suspense=u,ht.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ht.__COMPILER_RUNTIME={__proto__:null,c:function(q){return T.H.useMemoCache(q)}},ht.cache=function(q){return function(){return q.apply(null,arguments)}},ht.cacheSignal=function(){return null},ht.cloneElement=function(q,$,F){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var Q=w({},q.props),Z=q.key;if($!=null)for(te in $.key!==void 0&&(Z=""+$.key),$)!M.call($,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&$.ref===void 0||(Q[te]=$[te]);var te=arguments.length-2;if(te===1)Q.children=F;else if(1<te){for(var ae=Array(te),re=0;re<te;re++)ae[re]=arguments[re+2];Q.children=ae}return B(q.type,Z,Q)},ht.createContext=function(q){return q={$$typeof:o,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:a,_context:q},q},ht.createElement=function(q,$,F){var Q,Z={},te=null;if($!=null)for(Q in $.key!==void 0&&(te=""+$.key),$)M.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(Z[Q]=$[Q]);var ae=arguments.length-2;if(ae===1)Z.children=F;else if(1<ae){for(var re=Array(ae),ee=0;ee<ae;ee++)re[ee]=arguments[ee+2];Z.children=re}if(q&&q.defaultProps)for(Q in ae=q.defaultProps,ae)Z[Q]===void 0&&(Z[Q]=ae[Q]);return B(q,te,Z)},ht.createRef=function(){return{current:null}},ht.forwardRef=function(q){return{$$typeof:l,render:q}},ht.isValidElement=U,ht.lazy=function(q){return{$$typeof:m,_payload:{_status:-1,_result:q},_init:Y}},ht.memo=function(q,$){return{$$typeof:d,type:q,compare:$===void 0?null:$}},ht.startTransition=function(q){var $=T.T,F={};T.T=F;try{var Q=q(),Z=T.S;Z!==null&&Z(F,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(A,V)}catch(te){V(te)}finally{$!==null&&F.types!==null&&($.types=F.types),T.T=$}},ht.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ht.use=function(q){return T.H.use(q)},ht.useActionState=function(q,$,F){return T.H.useActionState(q,$,F)},ht.useCallback=function(q,$){return T.H.useCallback(q,$)},ht.useContext=function(q){return T.H.useContext(q)},ht.useDebugValue=function(){},ht.useDeferredValue=function(q,$){return T.H.useDeferredValue(q,$)},ht.useEffect=function(q,$){return T.H.useEffect(q,$)},ht.useEffectEvent=function(q){return T.H.useEffectEvent(q)},ht.useId=function(){return T.H.useId()},ht.useImperativeHandle=function(q,$,F){return T.H.useImperativeHandle(q,$,F)},ht.useInsertionEffect=function(q,$){return T.H.useInsertionEffect(q,$)},ht.useLayoutEffect=function(q,$){return T.H.useLayoutEffect(q,$)},ht.useMemo=function(q,$){return T.H.useMemo(q,$)},ht.useOptimistic=function(q,$){return T.H.useOptimistic(q,$)},ht.useReducer=function(q,$,F){return T.H.useReducer(q,$,F)},ht.useRef=function(q){return T.H.useRef(q)},ht.useState=function(q){return T.H.useState(q)},ht.useSyncExternalStore=function(q,$,F){return T.H.useSyncExternalStore(q,$,F)},ht.useTransition=function(){return T.H.useTransition()},ht.version="19.2.4",ht}var OR;function Pf(){return OR||(OR=1,NS.exports=EQ()),NS.exports}var y=Pf();const Ce=Gi(y),NN=wQ({__proto__:null,default:Ce},[y]);var kS={exports:{}},Gh={},AS={exports:{}},OS={};/**
 * @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 TR;function _Q(){return TR||(TR=1,(function(e){function t(P,H){var Y=P.length;P.push(H);e:for(;0<Y;){var V=Y-1>>>1,D=P[V];if(0<i(D,H))P[V]=H,P[Y]=D,Y=V;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var H=P[0],Y=P.pop();if(Y!==H){P[0]=Y;e:for(var V=0,D=P.length,q=D>>>1;V<q;){var $=2*(V+1)-1,F=P[$],Q=$+1,Z=P[Q];if(0>i(F,Y))Q<D&&0>i(Z,F)?(P[V]=Z,P[Q]=Y,V=Q):(P[V]=F,P[$]=Y,V=$);else if(Q<D&&0>i(Z,Y))P[V]=Z,P[Q]=Y,V=Q;else break e}}return H}function i(P,H){var Y=P.sortIndex-H.sortIndex;return Y!==0?Y:P.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],d=[],m=1,h=null,g=3,v=!1,b=!1,w=!1,S=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function k(P){for(var H=n(d);H!==null;){if(H.callback===null)r(d);else if(H.startTime<=P)r(d),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(d)}}function O(P){if(w=!1,k(P),!b)if(n(u)!==null)b=!0,A||(A=!0,L());else{var H=n(d);H!==null&&K(O,H.startTime-P)}}var A=!1,T=-1,M=5,B=-1;function I(){return S?!0:!(e.unstable_now()-B<M)}function U(){if(S=!1,A){var P=e.unstable_now();B=P;var H=!0;try{e:{b=!1,w&&(w=!1,C(T),T=-1),v=!0;var Y=g;try{t:{for(k(P),h=n(u);h!==null&&!(h.expirationTime>P&&I());){var V=h.callback;if(typeof V=="function"){h.callback=null,g=h.priorityLevel;var D=V(h.expirationTime<=P);if(P=e.unstable_now(),typeof D=="function"){h.callback=D,k(P),H=!0;break t}h===n(u)&&r(u),k(P)}else r(u);h=n(u)}if(h!==null)H=!0;else{var q=n(d);q!==null&&K(O,q.startTime-P),H=!1}}break e}finally{h=null,g=Y,v=!1}H=void 0}}finally{H?L():A=!1}}}var L;if(typeof E=="function")L=function(){E(U)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,z=G.port2;G.port1.onmessage=U,L=function(){z.postMessage(null)}}else L=function(){j(U,0)};function K(P,H){T=j(function(){P(e.unstable_now())},H)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(P){switch(g){case 1:case 2:case 3:var H=3;break;default:H=g}var Y=g;g=H;try{return P()}finally{g=Y}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(P,H){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var Y=g;g=P;try{return H()}finally{g=Y}},e.unstable_scheduleCallback=function(P,H,Y){var V=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?V+Y:V):Y=V,P){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=Y+D,P={id:m++,callback:H,priorityLevel:P,startTime:Y,expirationTime:D,sortIndex:-1},Y>V?(P.sortIndex=Y,t(d,P),n(u)===null&&P===n(d)&&(w?(C(T),T=-1):w=!0,K(O,Y-V))):(P.sortIndex=D,t(u,P),b||v||(b=!0,A||(A=!0,L()))),P},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(P){var H=g;return function(){var Y=g;g=H;try{return P.apply(this,arguments)}finally{g=Y}}}})(OS)),OS}var PR;function CQ(){return PR||(PR=1,AS.exports=_Q()),AS.exports}var TS={exports:{}},Lr={};/**
 * @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 MR;function NQ(){if(MR)return Lr;MR=1;var e=Pf();function t(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(u,d,m){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:u,containerInfo:d,implementation:m}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Lr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Lr.createPortal=function(u,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return a(u,d,null,m)},Lr.flushSync=function(u){var d=o.T,m=r.p;try{if(o.T=null,r.p=2,u)return u()}finally{o.T=d,r.p=m,r.d.f()}},Lr.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},Lr.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Lr.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var m=d.as,h=l(m,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:g,fetchPriority:v}):m==="script"&&r.d.X(u,{crossOrigin:h,integrity:g,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Lr.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=l(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},Lr.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,h=l(m,d.crossOrigin);r.d.L(u,m,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Lr.preloadModule=function(u,d){if(typeof u=="string")if(d){var m=l(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},Lr.requestFormReset=function(u){r.d.r(u)},Lr.unstable_batchedUpdates=function(u,d){return u(d)},Lr.useFormState=function(u,d,m){return o.H.useFormState(u,d,m)},Lr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Lr.version="19.2.4",Lr}var RR;function nB(){if(RR)return TS.exports;RR=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(),TS.exports=NQ(),TS.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 DR;function kQ(){if(DR)return Gh;DR=1;var e=CQ(),t=Pf(),n=nB();function r(s){var c="https://react.dev/errors/"+s;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var c=s,p=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(p=c.return),s=c.return;while(s)}return c.tag===3?p:null}function o(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function l(s){if(s.tag===31){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function u(s){if(a(s)!==s)throw Error(r(188))}function d(s){var c=s.alternate;if(!c){if(c=a(s),c===null)throw Error(r(188));return c!==s?null:s}for(var p=s,x=c;;){var _=p.return;if(_===null)break;var N=_.alternate;if(N===null){if(x=_.return,x!==null){p=x;continue}break}if(_.child===N.child){for(N=_.child;N;){if(N===p)return u(_),s;if(N===x)return u(_),c;N=N.sibling}throw Error(r(188))}if(p.return!==x.return)p=_,x=N;else{for(var R=!1,X=_.child;X;){if(X===p){R=!0,p=_,x=N;break}if(X===x){R=!0,x=_,p=N;break}X=X.sibling}if(!R){for(X=N.child;X;){if(X===p){R=!0,p=N,x=_;break}if(X===x){R=!0,x=N,p=_;break}X=X.sibling}if(!R)throw Error(r(189))}}if(p.alternate!==x)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?s:c}function m(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s;for(s=s.child;s!==null;){if(c=m(s),c!==null)return c;s=s.sibling}return null}var h=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function L(s){return s===null||typeof s!="object"?null:(s=U&&s[U]||s["@@iterator"],typeof s=="function"?s:null)}var G=Symbol.for("react.client.reference");function z(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===G?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case j:return"Profiler";case S:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case E:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case k:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return c=s.displayName||null,c!==null?c:z(s.type)||"Memo";case M:c=s._payload,s=s._init;try{return z(s(c))}catch{}}return null}var K=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},V=[],D=-1;function q(s){return{current:s}}function $(s){0>D||(s.current=V[D],V[D]=null,D--)}function F(s,c){D++,V[D]=s.current,s.current=c}var Q=q(null),Z=q(null),te=q(null),ae=q(null);function re(s,c){switch(F(te,c),F(Z,s),F(Q,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?GM(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=GM(c),s=WM(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}$(Q),F(Q,s)}function ee(){$(Q),$(Z),$(te)}function se(s){s.memoizedState!==null&&F(ae,s);var c=Q.current,p=WM(c,s.type);c!==p&&(F(Z,s),F(Q,p))}function ve(s){Z.current===s&&($(Q),$(Z)),ae.current===s&&($(ae),qh._currentValue=Y)}var ie,Se;function Ee(s){if(ie===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);ie=c&&c[1]||"",Se=-1<p.stack.indexOf(`
    at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+s+Se}var qe=!1;function Te(s,c){if(!s||qe)return"";qe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(c){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(me){var fe=me}Reflect.construct(s,[],we)}else{try{we.call()}catch(me){fe=me}s.call(we.prototype)}}else{try{throw Error()}catch(me){fe=me}(we=s())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(me){if(me&&fe&&typeof me.stack=="string")return[me.stack,fe.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=x.DetermineComponentFrameRoot(),R=N[0],X=N[1];if(R&&X){var J=R.split(`
`),de=X.split(`
`);for(_=x=0;x<J.length&&!J[x].includes("DetermineComponentFrameRoot");)x++;for(;_<de.length&&!de[_].includes("DetermineComponentFrameRoot");)_++;if(x===J.length||_===de.length)for(x=J.length-1,_=de.length-1;1<=x&&0<=_&&J[x]!==de[_];)_--;for(;1<=x&&0<=_;x--,_--)if(J[x]!==de[_]){if(x!==1||_!==1)do if(x--,_--,0>_||J[x]!==de[_]){var ye=`
`+J[x].replace(" at new "," at ");return s.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",s.displayName)),ye}while(1<=x&&0<=_);break}}}finally{qe=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Ee(p):""}function rt(s,c){switch(s.tag){case 26:case 27:case 5:return Ee(s.type);case 16:return Ee("Lazy");case 13:return s.child!==c&&c!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Te(s.type,!1);case 11:return Te(s.type.render,!1);case 1:return Te(s.type,!0);case 31:return Ee("Activity");default:return""}}function Je(s){try{var c="",p=null;do c+=rt(s,p),p=s,s=s.return;while(s);return c}catch(x){return`
Error generating stack: `+x.message+`
`+x.stack}}var et=Object.prototype.hasOwnProperty,xt=e.unstable_scheduleCallback,dt=e.unstable_cancelCallback,Ct=e.unstable_shouldYield,mn=e.unstable_requestPaint,Ut=e.unstable_now,Kt=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,it=e.unstable_LowPriority,st=e.unstable_IdlePriority,Ht=e.log,rn=e.unstable_setDisableYieldValue,je=null,ct=null;function wt(s){if(typeof Ht=="function"&&rn(s),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(je,s)}catch{}}var ft=Math.clz32?Math.clz32:Cr,On=Math.log,un=Math.LN2;function Cr(s){return s>>>=0,s===0?32:31-(On(s)/un|0)|0}var Xr=256,Gr=262144,Wr=4194304;function gr(s){var c=s&42;if(c!==0)return c;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Xe(s,c,p){var x=s.pendingLanes;if(x===0)return 0;var _=0,N=s.suspendedLanes,R=s.pingedLanes;s=s.warmLanes;var X=x&134217727;return X!==0?(x=X&~N,x!==0?_=gr(x):(R&=X,R!==0?_=gr(R):p||(p=X&~s,p!==0&&(_=gr(p))))):(X=x&~N,X!==0?_=gr(X):R!==0?_=gr(R):p||(p=x&~s,p!==0&&(_=gr(p)))),_===0?0:c!==0&&c!==_&&(c&N)===0&&(N=_&-_,p=c&-c,N>=p||N===32&&(p&4194048)!==0)?c:_}function Mt(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function pn(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Tn(){var s=Wr;return Wr<<=1,(Wr&62914560)===0&&(Wr=4194304),s}function Ir(s){for(var c=[],p=0;31>p;p++)c.push(s);return c}function Yt(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ge(s,c,p,x,_,N){var R=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var X=s.entanglements,J=s.expirationTimes,de=s.hiddenUpdates;for(p=R&~p;0<p;){var ye=31-ft(p),we=1<<ye;X[ye]=0,J[ye]=-1;var fe=de[ye];if(fe!==null)for(de[ye]=null,ye=0;ye<fe.length;ye++){var me=fe[ye];me!==null&&(me.lane&=-536870913)}p&=~we}x!==0&&at(s,x,0),N!==0&&_===0&&s.tag!==0&&(s.suspendedLanes|=N&~(R&~c))}function at(s,c,p){s.pendingLanes|=c,s.suspendedLanes&=~c;var x=31-ft(c);s.entangledLanes|=c,s.entanglements[x]=s.entanglements[x]|1073741824|p&261930}function Lt(s,c){var p=s.entangledLanes|=c;for(s=s.entanglements;p;){var x=31-ft(p),_=1<<x;_&c|s[x]&c&&(s[x]|=c),p&=~_}}function an(s,c){var p=c&-c;return p=(p&42)!==0?1:oi(p),(p&(s.suspendedLanes|c))!==0?0:p}function oi(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function rr(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function sc(){var s=H.p;return s!==0?s:(s=window.event,s===void 0?32:xR(s.type))}function lc(s,c){var p=H.p;try{return H.p=s,c()}finally{H.p=p}}var ta=Math.random().toString(36).slice(2),Fn="__reactFiber$"+ta,ir="__reactProps$"+ta,he="__reactContainer$"+ta,pt="__reactEvents$"+ta,Nr="__reactListeners$"+ta,Qr="__reactHandles$"+ta,Fu="__reactResources$"+ta,Ra="__reactMarker$"+ta;function ih(s){delete s[Fn],delete s[ir],delete s[pt],delete s[Nr],delete s[Qr]}function Bs(s){var c=s[Fn];if(c)return c;for(var p=s.parentNode;p;){if(c=p[he]||p[Fn]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(s=rR(s);s!==null;){if(p=s[Fn])return p;s=rR(s)}return c}s=p,p=s.parentNode}return null}function Fs(s){if(s=s[Fn]||s[he]){var c=s.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return s}return null}function Us(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(r(33))}function Hs(s){var c=s[Fu];return c||(c=s[Fu]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function qn(s){s[Ra]=!0}var Tg=new Set,Pg={};function Lo(s,c){qs(s,c),qs(s+"Capture",c)}function qs(s,c){for(Pg[s]=c,s=0;s<c.length;s++)Tg.add(c[s])}var gw=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]*$"),ah={},Mg={};function vw(s){return et.call(Mg,s)?!0:et.call(ah,s)?!1:gw.test(s)?Mg[s]=!0:(ah[s]=!0,!1)}function Uu(s,c,p){if(vw(c))if(p===null)s.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":s.removeAttribute(c);return;case"boolean":var x=c.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){s.removeAttribute(c);return}}s.setAttribute(c,""+p)}}function Hu(s,c,p){if(p===null)s.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttribute(c,""+p)}}function Da(s,c,p,x){if(x===null)s.removeAttribute(p);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(p);return}s.setAttributeNS(c,p,""+x)}}function si(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Rg(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function yw(s,c,p){var x=Object.getOwnPropertyDescriptor(s.constructor.prototype,c);if(!s.hasOwnProperty(c)&&typeof x<"u"&&typeof x.get=="function"&&typeof x.set=="function"){var _=x.get,N=x.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return _.call(this)},set:function(R){p=""+R,N.call(this,R)}}),Object.defineProperty(s,c,{enumerable:x.enumerable}),{getValue:function(){return p},setValue:function(R){p=""+R},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function Vs(s){if(!s._valueTracker){var c=Rg(s)?"checked":"value";s._valueTracker=yw(s,c,""+s[c])}}function Dg(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var p=c.getValue(),x="";return s&&(x=Rg(s)?s.checked?"true":"false":s.value),s=x,s!==p?(c.setValue(s),!0):!1}function cc(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var xw=/[\n"\\]/g;function li(s){return s.replace(xw,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function uc(s,c,p,x,_,N,R,X){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),c!=null?R==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+si(c)):s.value!==""+si(c)&&(s.value=""+si(c)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),c!=null?oh(s,R,si(c)):p!=null?oh(s,R,si(p)):x!=null&&s.removeAttribute("value"),_==null&&N!=null&&(s.defaultChecked=!!N),_!=null&&(s.checked=_&&typeof _!="function"&&typeof _!="symbol"),X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?s.name=""+si(X):s.removeAttribute("name")}function Ig(s,c,p,x,_,N,R,X){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),c!=null||p!=null){if(!(N!=="submit"&&N!=="reset"||c!=null)){Vs(s);return}p=p!=null?""+si(p):"",c=c!=null?""+si(c):p,X||c===s.value||(s.value=c),s.defaultValue=c}x=x??_,x=typeof x!="function"&&typeof x!="symbol"&&!!x,s.checked=X?s.checked:!!x,s.defaultChecked=!!x,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R),Vs(s)}function oh(s,c,p){c==="number"&&cc(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function zo(s,c,p,x){if(s=s.options,c){c={};for(var _=0;_<p.length;_++)c["$"+p[_]]=!0;for(p=0;p<s.length;p++)_=c.hasOwnProperty("$"+s[p].value),s[p].selected!==_&&(s[p].selected=_),_&&x&&(s[p].defaultSelected=!0)}else{for(p=""+si(p),c=null,_=0;_<s.length;_++){if(s[_].value===p){s[_].selected=!0,x&&(s[_].defaultSelected=!0);return}c!==null||s[_].disabled||(c=s[_])}c!==null&&(c.selected=!0)}}function q2(s,c,p){if(c!=null&&(c=""+si(c),c!==s.value&&(s.value=c),p==null)){s.defaultValue!==c&&(s.defaultValue=c);return}s.defaultValue=p!=null?""+si(p):""}function V2(s,c,p,x){if(c==null){if(x!=null){if(p!=null)throw Error(r(92));if(K(x)){if(1<x.length)throw Error(r(93));x=x[0]}p=x}p==null&&(p=""),c=p}p=si(c),s.defaultValue=p,x=s.textContent,x===p&&x!==""&&x!==null&&(s.value=x),Vs(s)}function qu(s,c){if(c){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=c;return}}s.textContent=c}var mG=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 K2(s,c,p){var x=c.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?x?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="":x?s.setProperty(c,p):typeof p!="number"||p===0||mG.has(c)?c==="float"?s.cssFloat=p:s[c]=(""+p).trim():s[c]=p+"px"}function Y2(s,c,p){if(c!=null&&typeof c!="object")throw Error(r(62));if(s=s.style,p!=null){for(var x in p)!p.hasOwnProperty(x)||c!=null&&c.hasOwnProperty(x)||(x.indexOf("--")===0?s.setProperty(x,""):x==="float"?s.cssFloat="":s[x]="");for(var _ in c)x=c[_],c.hasOwnProperty(_)&&p[_]!==x&&K2(s,_,x)}else for(var N in c)c.hasOwnProperty(N)&&K2(s,N,c[N])}function bw(s){if(s.indexOf("-")===-1)return!1;switch(s){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 pG=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"]]),gG=/^[\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 Lg(s){return gG.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function $o(){}var ww=null;function Sw(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Vu=null,Ku=null;function X2(s){var c=Fs(s);if(c&&(s=c.stateNode)){var p=s[ir]||null;e:switch(s=c.stateNode,c.type){case"input":if(uc(s,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),c=p.name,p.type==="radio"&&c!=null){for(p=s;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+li(""+c)+'"][type="radio"]'),c=0;c<p.length;c++){var x=p[c];if(x!==s&&x.form===s.form){var _=x[ir]||null;if(!_)throw Error(r(90));uc(x,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(c=0;c<p.length;c++)x=p[c],x.form===s.form&&Dg(x)}break e;case"textarea":q2(s,p.value,p.defaultValue);break e;case"select":c=p.value,c!=null&&zo(s,!!p.multiple,c,!1)}}}var jw=!1;function G2(s,c,p){if(jw)return s(c,p);jw=!0;try{var x=s(c);return x}finally{if(jw=!1,(Vu!==null||Ku!==null)&&(Ev(),Vu&&(c=Vu,s=Ku,Ku=Vu=null,X2(c),s)))for(c=0;c<s.length;c++)X2(s[c])}}function sh(s,c){var p=s.stateNode;if(p===null)return null;var x=p[ir]||null;if(x===null)return null;p=x[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(s=s.type,x=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!x;break e;default:s=!1}if(s)return null;if(p&&typeof p!="function")throw Error(r(231,c,typeof p));return p}var Bo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ew=!1;if(Bo)try{var lh={};Object.defineProperty(lh,"passive",{get:function(){Ew=!0}}),window.addEventListener("test",lh,lh),window.removeEventListener("test",lh,lh)}catch{Ew=!1}var Ks=null,_w=null,zg=null;function W2(){if(zg)return zg;var s,c=_w,p=c.length,x,_="value"in Ks?Ks.value:Ks.textContent,N=_.length;for(s=0;s<p&&c[s]===_[s];s++);var R=p-s;for(x=1;x<=R&&c[p-x]===_[N-x];x++);return zg=_.slice(s,1<x?1-x:void 0)}function $g(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function Bg(){return!0}function Q2(){return!1}function ci(s){function c(p,x,_,N,R){this._reactName=p,this._targetInst=_,this.type=x,this.nativeEvent=N,this.target=R,this.currentTarget=null;for(var X in s)s.hasOwnProperty(X)&&(p=s[X],this[X]=p?p(N):N[X]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Bg:Q2,this.isPropagationStopped=Q2,this}return h(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Bg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Bg)},persist:function(){},isPersistent:Bg}),c}var dc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fg=ci(dc),ch=h({},dc,{view:0,detail:0}),vG=ci(ch),Cw,Nw,uh,Ug=h({},ch,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Aw,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==uh&&(uh&&s.type==="mousemove"?(Cw=s.screenX-uh.screenX,Nw=s.screenY-uh.screenY):Nw=Cw=0,uh=s),Cw)},movementY:function(s){return"movementY"in s?s.movementY:Nw}}),Z2=ci(Ug),yG=h({},Ug,{dataTransfer:0}),xG=ci(yG),bG=h({},ch,{relatedTarget:0}),kw=ci(bG),wG=h({},dc,{animationName:0,elapsedTime:0,pseudoElement:0}),SG=ci(wG),jG=h({},dc,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),EG=ci(jG),_G=h({},dc,{data:0}),J2=ci(_G),CG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NG={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"},kG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AG(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=kG[s])?!!c[s]:!1}function Aw(){return AG}var OG=h({},ch,{key:function(s){if(s.key){var c=CG[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=$g(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?NG[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Aw,charCode:function(s){return s.type==="keypress"?$g(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?$g(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),TG=ci(OG),PG=h({},Ug,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eT=ci(PG),MG=h({},ch,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Aw}),RG=ci(MG),DG=h({},dc,{propertyName:0,elapsedTime:0,pseudoElement:0}),IG=ci(DG),LG=h({},Ug,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),zG=ci(LG),$G=h({},dc,{newState:0,oldState:0}),BG=ci($G),FG=[9,13,27,32],Ow=Bo&&"CompositionEvent"in window,dh=null;Bo&&"documentMode"in document&&(dh=document.documentMode);var UG=Bo&&"TextEvent"in window&&!dh,tT=Bo&&(!Ow||dh&&8<dh&&11>=dh),nT=" ",rT=!1;function iT(s,c){switch(s){case"keyup":return FG.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aT(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Yu=!1;function HG(s,c){switch(s){case"compositionend":return aT(c);case"keypress":return c.which!==32?null:(rT=!0,nT);case"textInput":return s=c.data,s===nT&&rT?null:s;default:return null}}function qG(s,c){if(Yu)return s==="compositionend"||!Ow&&iT(s,c)?(s=W2(),zg=_w=Ks=null,Yu=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return tT&&c.locale!=="ko"?null:c.data;default:return null}}var VG={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 oT(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!VG[s.type]:c==="textarea"}function sT(s,c,p,x){Vu?Ku?Ku.push(x):Ku=[x]:Vu=x,c=Tv(c,"onChange"),0<c.length&&(p=new Fg("onChange","change",null,p,x),s.push({event:p,listeners:c}))}var fh=null,hh=null;function KG(s){HM(s,0)}function Hg(s){var c=Us(s);if(Dg(c))return s}function lT(s,c){if(s==="change")return c}var cT=!1;if(Bo){var Tw;if(Bo){var Pw="oninput"in document;if(!Pw){var uT=document.createElement("div");uT.setAttribute("oninput","return;"),Pw=typeof uT.oninput=="function"}Tw=Pw}else Tw=!1;cT=Tw&&(!document.documentMode||9<document.documentMode)}function dT(){fh&&(fh.detachEvent("onpropertychange",fT),hh=fh=null)}function fT(s){if(s.propertyName==="value"&&Hg(hh)){var c=[];sT(c,hh,s,Sw(s)),G2(KG,c)}}function YG(s,c,p){s==="focusin"?(dT(),fh=c,hh=p,fh.attachEvent("onpropertychange",fT)):s==="focusout"&&dT()}function XG(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Hg(hh)}function GG(s,c){if(s==="click")return Hg(c)}function WG(s,c){if(s==="input"||s==="change")return Hg(c)}function QG(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var ji=typeof Object.is=="function"?Object.is:QG;function mh(s,c){if(ji(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var p=Object.keys(s),x=Object.keys(c);if(p.length!==x.length)return!1;for(x=0;x<p.length;x++){var _=p[x];if(!et.call(c,_)||!ji(s[_],c[_]))return!1}return!0}function hT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function mT(s,c){var p=hT(s);s=0;for(var x;p;){if(p.nodeType===3){if(x=s+p.textContent.length,s<=c&&x>=c)return{node:p,offset:c-s};s=x}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=hT(p)}}function pT(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?pT(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function gT(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=cc(s.document);c instanceof s.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)s=c.contentWindow;else break;c=cc(s.document)}return c}function Mw(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var ZG=Bo&&"documentMode"in document&&11>=document.documentMode,Xu=null,Rw=null,ph=null,Dw=!1;function vT(s,c,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Dw||Xu==null||Xu!==cc(x)||(x=Xu,"selectionStart"in x&&Mw(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),ph&&mh(ph,x)||(ph=x,x=Tv(Rw,"onSelect"),0<x.length&&(c=new Fg("onSelect","select",null,c,p),s.push({event:c,listeners:x}),c.target=Xu)))}function fc(s,c){var p={};return p[s.toLowerCase()]=c.toLowerCase(),p["Webkit"+s]="webkit"+c,p["Moz"+s]="moz"+c,p}var Gu={animationend:fc("Animation","AnimationEnd"),animationiteration:fc("Animation","AnimationIteration"),animationstart:fc("Animation","AnimationStart"),transitionrun:fc("Transition","TransitionRun"),transitionstart:fc("Transition","TransitionStart"),transitioncancel:fc("Transition","TransitionCancel"),transitionend:fc("Transition","TransitionEnd")},Iw={},yT={};Bo&&(yT=document.createElement("div").style,"AnimationEvent"in window||(delete Gu.animationend.animation,delete Gu.animationiteration.animation,delete Gu.animationstart.animation),"TransitionEvent"in window||delete Gu.transitionend.transition);function hc(s){if(Iw[s])return Iw[s];if(!Gu[s])return s;var c=Gu[s],p;for(p in c)if(c.hasOwnProperty(p)&&p in yT)return Iw[s]=c[p];return s}var xT=hc("animationend"),bT=hc("animationiteration"),wT=hc("animationstart"),JG=hc("transitionrun"),eW=hc("transitionstart"),tW=hc("transitioncancel"),ST=hc("transitionend"),jT=new Map,Lw="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(" ");Lw.push("scrollEnd");function Ia(s,c){jT.set(s,c),Lo(c,[s])}var qg=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},na=[],Wu=0,zw=0;function Vg(){for(var s=Wu,c=zw=Wu=0;c<s;){var p=na[c];na[c++]=null;var x=na[c];na[c++]=null;var _=na[c];na[c++]=null;var N=na[c];if(na[c++]=null,x!==null&&_!==null){var R=x.pending;R===null?_.next=_:(_.next=R.next,R.next=_),x.pending=_}N!==0&&ET(p,_,N)}}function Kg(s,c,p,x){na[Wu++]=s,na[Wu++]=c,na[Wu++]=p,na[Wu++]=x,zw|=x,s.lanes|=x,s=s.alternate,s!==null&&(s.lanes|=x)}function $w(s,c,p,x){return Kg(s,c,p,x),Yg(s)}function mc(s,c){return Kg(s,null,null,c),Yg(s)}function ET(s,c,p){s.lanes|=p;var x=s.alternate;x!==null&&(x.lanes|=p);for(var _=!1,N=s.return;N!==null;)N.childLanes|=p,x=N.alternate,x!==null&&(x.childLanes|=p),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(_=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,_&&c!==null&&(_=31-ft(p),s=N.hiddenUpdates,x=s[_],x===null?s[_]=[c]:x.push(c),c.lane=p|536870912),N):null}function Yg(s){if(50<Lh)throw Lh=0,X1=null,Error(r(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var Qu={};function nW(s,c,p,x){this.tag=s,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ei(s,c,p,x){return new nW(s,c,p,x)}function Bw(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Fo(s,c){var p=s.alternate;return p===null?(p=Ei(s.tag,c,s.key,s.mode),p.elementType=s.elementType,p.type=s.type,p.stateNode=s.stateNode,p.alternate=s,s.alternate=p):(p.pendingProps=c,p.type=s.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=s.flags&65011712,p.childLanes=s.childLanes,p.lanes=s.lanes,p.child=s.child,p.memoizedProps=s.memoizedProps,p.memoizedState=s.memoizedState,p.updateQueue=s.updateQueue,c=s.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=s.sibling,p.index=s.index,p.ref=s.ref,p.refCleanup=s.refCleanup,p}function _T(s,c){s.flags&=65011714;var p=s.alternate;return p===null?(s.childLanes=0,s.lanes=c,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=p.childLanes,s.lanes=p.lanes,s.child=p.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=p.memoizedProps,s.memoizedState=p.memoizedState,s.updateQueue=p.updateQueue,s.type=p.type,c=p.dependencies,s.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),s}function Xg(s,c,p,x,_,N){var R=0;if(x=s,typeof s=="function")Bw(s)&&(R=1);else if(typeof s=="string")R=sQ(s,p,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case B:return s=Ei(31,p,c,_),s.elementType=B,s.lanes=N,s;case w:return pc(p.children,_,N,c);case S:R=8,_|=24;break;case j:return s=Ei(12,p,c,_|2),s.elementType=j,s.lanes=N,s;case O:return s=Ei(13,p,c,_),s.elementType=O,s.lanes=N,s;case A:return s=Ei(19,p,c,_),s.elementType=A,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case E:R=10;break e;case C:R=9;break e;case k:R=11;break e;case T:R=14;break e;case M:R=16,x=null;break e}R=29,p=Error(r(130,s===null?"null":typeof s,"")),x=null}return c=Ei(R,p,c,_),c.elementType=s,c.type=x,c.lanes=N,c}function pc(s,c,p,x){return s=Ei(7,s,x,c),s.lanes=p,s}function Fw(s,c,p){return s=Ei(6,s,null,c),s.lanes=p,s}function CT(s){var c=Ei(18,null,null,0);return c.stateNode=s,c}function Uw(s,c,p){return c=Ei(4,s.children!==null?s.children:[],s.key,c),c.lanes=p,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var NT=new WeakMap;function ra(s,c){if(typeof s=="object"&&s!==null){var p=NT.get(s);return p!==void 0?p:(c={value:s,source:c,stack:Je(c)},NT.set(s,c),c)}return{value:s,source:c,stack:Je(c)}}var Zu=[],Ju=0,Gg=null,gh=0,ia=[],aa=0,Ys=null,ao=1,oo="";function Uo(s,c){Zu[Ju++]=gh,Zu[Ju++]=Gg,Gg=s,gh=c}function kT(s,c,p){ia[aa++]=ao,ia[aa++]=oo,ia[aa++]=Ys,Ys=s;var x=ao;s=oo;var _=32-ft(x)-1;x&=~(1<<_),p+=1;var N=32-ft(c)+_;if(30<N){var R=_-_%5;N=(x&(1<<R)-1).toString(32),x>>=R,_-=R,ao=1<<32-ft(c)+_|p<<_|x,oo=N+s}else ao=1<<N|p<<_|x,oo=s}function Hw(s){s.return!==null&&(Uo(s,1),kT(s,1,0))}function qw(s){for(;s===Gg;)Gg=Zu[--Ju],Zu[Ju]=null,gh=Zu[--Ju],Zu[Ju]=null;for(;s===Ys;)Ys=ia[--aa],ia[aa]=null,oo=ia[--aa],ia[aa]=null,ao=ia[--aa],ia[aa]=null}function AT(s,c){ia[aa++]=ao,ia[aa++]=oo,ia[aa++]=Ys,ao=c.id,oo=c.overflow,Ys=s}var kr=null,gn=null,At=!1,Xs=null,oa=!1,Vw=Error(r(519));function Gs(s){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vh(ra(c,s)),Vw}function OT(s){var c=s.stateNode,p=s.type,x=s.memoizedProps;switch(c[Fn]=s,c[ir]=x,p){case"dialog":Et("cancel",c),Et("close",c);break;case"iframe":case"object":case"embed":Et("load",c);break;case"video":case"audio":for(p=0;p<$h.length;p++)Et($h[p],c);break;case"source":Et("error",c);break;case"img":case"image":case"link":Et("error",c),Et("load",c);break;case"details":Et("toggle",c);break;case"input":Et("invalid",c),Ig(c,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":Et("invalid",c);break;case"textarea":Et("invalid",c),V2(c,x.value,x.defaultValue,x.children)}p=x.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||c.textContent===""+p||x.suppressHydrationWarning===!0||YM(c.textContent,p)?(x.popover!=null&&(Et("beforetoggle",c),Et("toggle",c)),x.onScroll!=null&&Et("scroll",c),x.onScrollEnd!=null&&Et("scrollend",c),x.onClick!=null&&(c.onclick=$o),c=!0):c=!1,c||Gs(s,!0)}function TT(s){for(kr=s.return;kr;)switch(kr.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:kr=kr.return}}function ed(s){if(s!==kr)return!1;if(!At)return TT(s),At=!0,!1;var c=s.tag,p;if((p=c!==3&&c!==27)&&((p=c===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||cS(s.type,s.memoizedProps)),p=!p),p&&gn&&Gs(s),TT(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));gn=nR(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));gn=nR(s)}else c===27?(c=gn,cl(s.type)?(s=mS,mS=null,gn=s):gn=c):gn=kr?la(s.stateNode.nextSibling):null;return!0}function gc(){gn=kr=null,At=!1}function Kw(){var s=Xs;return s!==null&&(hi===null?hi=s:hi.push.apply(hi,s),Xs=null),s}function vh(s){Xs===null?Xs=[s]:Xs.push(s)}var Yw=q(null),vc=null,Ho=null;function Ws(s,c,p){F(Yw,c._currentValue),c._currentValue=p}function qo(s){s._currentValue=Yw.current,$(Yw)}function Xw(s,c,p){for(;s!==null;){var x=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),s===p)break;s=s.return}}function Gw(s,c,p,x){var _=s.child;for(_!==null&&(_.return=s);_!==null;){var N=_.dependencies;if(N!==null){var R=_.child;N=N.firstContext;e:for(;N!==null;){var X=N;N=_;for(var J=0;J<c.length;J++)if(X.context===c[J]){N.lanes|=p,X=N.alternate,X!==null&&(X.lanes|=p),Xw(N.return,p,s),x||(R=null);break e}N=X.next}}else if(_.tag===18){if(R=_.return,R===null)throw Error(r(341));R.lanes|=p,N=R.alternate,N!==null&&(N.lanes|=p),Xw(R,p,s),R=null}else R=_.child;if(R!==null)R.return=_;else for(R=_;R!==null;){if(R===s){R=null;break}if(_=R.sibling,_!==null){_.return=R.return,R=_;break}R=R.return}_=R}}function td(s,c,p,x){s=null;for(var _=c,N=!1;_!==null;){if(!N){if((_.flags&524288)!==0)N=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var R=_.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var X=_.type;ji(_.pendingProps.value,R.value)||(s!==null?s.push(X):s=[X])}}else if(_===ae.current){if(R=_.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(s!==null?s.push(qh):s=[qh])}_=_.return}s!==null&&Gw(c,s,p,x),c.flags|=262144}function Wg(s){for(s=s.firstContext;s!==null;){if(!ji(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function yc(s){vc=s,Ho=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Ar(s){return PT(vc,s)}function Qg(s,c){return vc===null&&yc(s),PT(s,c)}function PT(s,c){var p=c._currentValue;if(c={context:c,memoizedValue:p,next:null},Ho===null){if(s===null)throw Error(r(308));Ho=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else Ho=Ho.next=c;return p}var rW=typeof AbortController<"u"?AbortController:function(){var s=[],c=this.signal={aborted:!1,addEventListener:function(p,x){s.push(x)}};this.abort=function(){c.aborted=!0,s.forEach(function(p){return p()})}},iW=e.unstable_scheduleCallback,aW=e.unstable_NormalPriority,Vn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ww(){return{controller:new rW,data:new Map,refCount:0}}function yh(s){s.refCount--,s.refCount===0&&iW(aW,function(){s.controller.abort()})}var xh=null,Qw=0,nd=0,rd=null;function oW(s,c){if(xh===null){var p=xh=[];Qw=0,nd=eS(),rd={status:"pending",value:void 0,then:function(x){p.push(x)}}}return Qw++,c.then(MT,MT),c}function MT(){if(--Qw===0&&xh!==null){rd!==null&&(rd.status="fulfilled");var s=xh;xh=null,nd=0,rd=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function sW(s,c){var p=[],x={status:"pending",value:null,reason:null,then:function(_){p.push(_)}};return s.then(function(){x.status="fulfilled",x.value=c;for(var _=0;_<p.length;_++)(0,p[_])(c)},function(_){for(x.status="rejected",x.reason=_,_=0;_<p.length;_++)(0,p[_])(void 0)}),x}var RT=P.S;P.S=function(s,c){vM=Ut(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&oW(s,c),RT!==null&&RT(s,c)};var xc=q(null);function Zw(){var s=xc.current;return s!==null?s:on.pooledCache}function Zg(s,c){c===null?F(xc,xc.current):F(xc,c.pool)}function DT(){var s=Zw();return s===null?null:{parent:Vn._currentValue,pool:s}}var id=Error(r(460)),Jw=Error(r(474)),Jg=Error(r(542)),ev={then:function(){}};function IT(s){return s=s.status,s==="fulfilled"||s==="rejected"}function LT(s,c,p){switch(p=s[p],p===void 0?s.push(c):p!==c&&(c.then($o,$o),c=p),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,$T(s),s;default:if(typeof c.status=="string")c.then($o,$o);else{if(s=on,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=c,s.status="pending",s.then(function(x){if(c.status==="pending"){var _=c;_.status="fulfilled",_.value=x}},function(x){if(c.status==="pending"){var _=c;_.status="rejected",_.reason=x}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,$T(s),s}throw wc=c,id}}function bc(s){try{var c=s._init;return c(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(wc=p,id):p}}var wc=null;function zT(){if(wc===null)throw Error(r(459));var s=wc;return wc=null,s}function $T(s){if(s===id||s===Jg)throw Error(r(483))}var ad=null,bh=0;function tv(s){var c=bh;return bh+=1,ad===null&&(ad=[]),LT(ad,s,c)}function wh(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function nv(s,c){throw c.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(c),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s)))}function BT(s){function c(oe,ne){if(s){var ue=oe.deletions;ue===null?(oe.deletions=[ne],oe.flags|=16):ue.push(ne)}}function p(oe,ne){if(!s)return null;for(;ne!==null;)c(oe,ne),ne=ne.sibling;return null}function x(oe){for(var ne=new Map;oe!==null;)oe.key!==null?ne.set(oe.key,oe):ne.set(oe.index,oe),oe=oe.sibling;return ne}function _(oe,ne){return oe=Fo(oe,ne),oe.index=0,oe.sibling=null,oe}function N(oe,ne,ue){return oe.index=ue,s?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<ne?(oe.flags|=67108866,ne):ue):(oe.flags|=67108866,ne)):(oe.flags|=1048576,ne)}function R(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function X(oe,ne,ue,be){return ne===null||ne.tag!==6?(ne=Fw(ue,oe.mode,be),ne.return=oe,ne):(ne=_(ne,ue),ne.return=oe,ne)}function J(oe,ne,ue,be){var Ge=ue.type;return Ge===w?ye(oe,ne,ue.props.children,be,ue.key):ne!==null&&(ne.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===M&&bc(Ge)===ne.type)?(ne=_(ne,ue.props),wh(ne,ue),ne.return=oe,ne):(ne=Xg(ue.type,ue.key,ue.props,null,oe.mode,be),wh(ne,ue),ne.return=oe,ne)}function de(oe,ne,ue,be){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ue.containerInfo||ne.stateNode.implementation!==ue.implementation?(ne=Uw(ue,oe.mode,be),ne.return=oe,ne):(ne=_(ne,ue.children||[]),ne.return=oe,ne)}function ye(oe,ne,ue,be,Ge){return ne===null||ne.tag!==7?(ne=pc(ue,oe.mode,be,Ge),ne.return=oe,ne):(ne=_(ne,ue),ne.return=oe,ne)}function we(oe,ne,ue){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Fw(""+ne,oe.mode,ue),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ue=Xg(ne.type,ne.key,ne.props,null,oe.mode,ue),wh(ue,ne),ue.return=oe,ue;case b:return ne=Uw(ne,oe.mode,ue),ne.return=oe,ne;case M:return ne=bc(ne),we(oe,ne,ue)}if(K(ne)||L(ne))return ne=pc(ne,oe.mode,ue,null),ne.return=oe,ne;if(typeof ne.then=="function")return we(oe,tv(ne),ue);if(ne.$$typeof===E)return we(oe,Qg(oe,ne),ue);nv(oe,ne)}return null}function fe(oe,ne,ue,be){var Ge=ne!==null?ne.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ge!==null?null:X(oe,ne,""+ue,be);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===Ge?J(oe,ne,ue,be):null;case b:return ue.key===Ge?de(oe,ne,ue,be):null;case M:return ue=bc(ue),fe(oe,ne,ue,be)}if(K(ue)||L(ue))return Ge!==null?null:ye(oe,ne,ue,be,null);if(typeof ue.then=="function")return fe(oe,ne,tv(ue),be);if(ue.$$typeof===E)return fe(oe,ne,Qg(oe,ue),be);nv(oe,ue)}return null}function me(oe,ne,ue,be,Ge){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return oe=oe.get(ue)||null,X(ne,oe,""+be,Ge);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case v:return oe=oe.get(be.key===null?ue:be.key)||null,J(ne,oe,be,Ge);case b:return oe=oe.get(be.key===null?ue:be.key)||null,de(ne,oe,be,Ge);case M:return be=bc(be),me(oe,ne,ue,be,Ge)}if(K(be)||L(be))return oe=oe.get(ue)||null,ye(ne,oe,be,Ge,null);if(typeof be.then=="function")return me(oe,ne,ue,tv(be),Ge);if(be.$$typeof===E)return me(oe,ne,ue,Qg(ne,be),Ge);nv(ne,be)}return null}function $e(oe,ne,ue,be){for(var Ge=null,zt=null,Ve=ne,vt=ne=0,kt=null;Ve!==null&&vt<ue.length;vt++){Ve.index>vt?(kt=Ve,Ve=null):kt=Ve.sibling;var $t=fe(oe,Ve,ue[vt],be);if($t===null){Ve===null&&(Ve=kt);break}s&&Ve&&$t.alternate===null&&c(oe,Ve),ne=N($t,ne,vt),zt===null?Ge=$t:zt.sibling=$t,zt=$t,Ve=kt}if(vt===ue.length)return p(oe,Ve),At&&Uo(oe,vt),Ge;if(Ve===null){for(;vt<ue.length;vt++)Ve=we(oe,ue[vt],be),Ve!==null&&(ne=N(Ve,ne,vt),zt===null?Ge=Ve:zt.sibling=Ve,zt=Ve);return At&&Uo(oe,vt),Ge}for(Ve=x(Ve);vt<ue.length;vt++)kt=me(Ve,oe,vt,ue[vt],be),kt!==null&&(s&&kt.alternate!==null&&Ve.delete(kt.key===null?vt:kt.key),ne=N(kt,ne,vt),zt===null?Ge=kt:zt.sibling=kt,zt=kt);return s&&Ve.forEach(function(ml){return c(oe,ml)}),At&&Uo(oe,vt),Ge}function nt(oe,ne,ue,be){if(ue==null)throw Error(r(151));for(var Ge=null,zt=null,Ve=ne,vt=ne=0,kt=null,$t=ue.next();Ve!==null&&!$t.done;vt++,$t=ue.next()){Ve.index>vt?(kt=Ve,Ve=null):kt=Ve.sibling;var ml=fe(oe,Ve,$t.value,be);if(ml===null){Ve===null&&(Ve=kt);break}s&&Ve&&ml.alternate===null&&c(oe,Ve),ne=N(ml,ne,vt),zt===null?Ge=ml:zt.sibling=ml,zt=ml,Ve=kt}if($t.done)return p(oe,Ve),At&&Uo(oe,vt),Ge;if(Ve===null){for(;!$t.done;vt++,$t=ue.next())$t=we(oe,$t.value,be),$t!==null&&(ne=N($t,ne,vt),zt===null?Ge=$t:zt.sibling=$t,zt=$t);return At&&Uo(oe,vt),Ge}for(Ve=x(Ve);!$t.done;vt++,$t=ue.next())$t=me(Ve,oe,vt,$t.value,be),$t!==null&&(s&&$t.alternate!==null&&Ve.delete($t.key===null?vt:$t.key),ne=N($t,ne,vt),zt===null?Ge=$t:zt.sibling=$t,zt=$t);return s&&Ve.forEach(function(yQ){return c(oe,yQ)}),At&&Uo(oe,vt),Ge}function Zt(oe,ne,ue,be){if(typeof ue=="object"&&ue!==null&&ue.type===w&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var Ge=ue.key;ne!==null;){if(ne.key===Ge){if(Ge=ue.type,Ge===w){if(ne.tag===7){p(oe,ne.sibling),be=_(ne,ue.props.children),be.return=oe,oe=be;break e}}else if(ne.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===M&&bc(Ge)===ne.type){p(oe,ne.sibling),be=_(ne,ue.props),wh(be,ue),be.return=oe,oe=be;break e}p(oe,ne);break}else c(oe,ne);ne=ne.sibling}ue.type===w?(be=pc(ue.props.children,oe.mode,be,ue.key),be.return=oe,oe=be):(be=Xg(ue.type,ue.key,ue.props,null,oe.mode,be),wh(be,ue),be.return=oe,oe=be)}return R(oe);case b:e:{for(Ge=ue.key;ne!==null;){if(ne.key===Ge)if(ne.tag===4&&ne.stateNode.containerInfo===ue.containerInfo&&ne.stateNode.implementation===ue.implementation){p(oe,ne.sibling),be=_(ne,ue.children||[]),be.return=oe,oe=be;break e}else{p(oe,ne);break}else c(oe,ne);ne=ne.sibling}be=Uw(ue,oe.mode,be),be.return=oe,oe=be}return R(oe);case M:return ue=bc(ue),Zt(oe,ne,ue,be)}if(K(ue))return $e(oe,ne,ue,be);if(L(ue)){if(Ge=L(ue),typeof Ge!="function")throw Error(r(150));return ue=Ge.call(ue),nt(oe,ne,ue,be)}if(typeof ue.then=="function")return Zt(oe,ne,tv(ue),be);if(ue.$$typeof===E)return Zt(oe,ne,Qg(oe,ue),be);nv(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ne!==null&&ne.tag===6?(p(oe,ne.sibling),be=_(ne,ue),be.return=oe,oe=be):(p(oe,ne),be=Fw(ue,oe.mode,be),be.return=oe,oe=be),R(oe)):p(oe,ne)}return function(oe,ne,ue,be){try{bh=0;var Ge=Zt(oe,ne,ue,be);return ad=null,Ge}catch(Ve){if(Ve===id||Ve===Jg)throw Ve;var zt=Ei(29,Ve,null,oe.mode);return zt.lanes=be,zt.return=oe,zt}finally{}}}var Sc=BT(!0),FT=BT(!1),Qs=!1;function e1(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function t1(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Zs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Js(s,c,p){var x=s.updateQueue;if(x===null)return null;if(x=x.shared,(qt&2)!==0){var _=x.pending;return _===null?c.next=c:(c.next=_.next,_.next=c),x.pending=c,c=Yg(s),ET(s,null,p),c}return Kg(s,x,c,p),Yg(s)}function Sh(s,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194048)!==0)){var x=c.lanes;x&=s.pendingLanes,p|=x,c.lanes=p,Lt(s,p)}}function n1(s,c){var p=s.updateQueue,x=s.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var _=null,N=null;if(p=p.firstBaseUpdate,p!==null){do{var R={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};N===null?_=N=R:N=N.next=R,p=p.next}while(p!==null);N===null?_=N=c:N=N.next=c}else _=N=c;p={baseState:x.baseState,firstBaseUpdate:_,lastBaseUpdate:N,shared:x.shared,callbacks:x.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=c}var r1=!1;function jh(){if(r1){var s=rd;if(s!==null)throw s}}function Eh(s,c,p,x){r1=!1;var _=s.updateQueue;Qs=!1;var N=_.firstBaseUpdate,R=_.lastBaseUpdate,X=_.shared.pending;if(X!==null){_.shared.pending=null;var J=X,de=J.next;J.next=null,R===null?N=de:R.next=de,R=J;var ye=s.alternate;ye!==null&&(ye=ye.updateQueue,X=ye.lastBaseUpdate,X!==R&&(X===null?ye.firstBaseUpdate=de:X.next=de,ye.lastBaseUpdate=J))}if(N!==null){var we=_.baseState;R=0,ye=de=J=null,X=N;do{var fe=X.lane&-536870913,me=fe!==X.lane;if(me?(Nt&fe)===fe:(x&fe)===fe){fe!==0&&fe===nd&&(r1=!0),ye!==null&&(ye=ye.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});e:{var $e=s,nt=X;fe=c;var Zt=p;switch(nt.tag){case 1:if($e=nt.payload,typeof $e=="function"){we=$e.call(Zt,we,fe);break e}we=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=nt.payload,fe=typeof $e=="function"?$e.call(Zt,we,fe):$e,fe==null)break e;we=h({},we,fe);break e;case 2:Qs=!0}}fe=X.callback,fe!==null&&(s.flags|=64,me&&(s.flags|=8192),me=_.callbacks,me===null?_.callbacks=[fe]:me.push(fe))}else me={lane:fe,tag:X.tag,payload:X.payload,callback:X.callback,next:null},ye===null?(de=ye=me,J=we):ye=ye.next=me,R|=fe;if(X=X.next,X===null){if(X=_.shared.pending,X===null)break;me=X,X=me.next,me.next=null,_.lastBaseUpdate=me,_.shared.pending=null}}while(!0);ye===null&&(J=we),_.baseState=J,_.firstBaseUpdate=de,_.lastBaseUpdate=ye,N===null&&(_.shared.lanes=0),il|=R,s.lanes=R,s.memoizedState=we}}function UT(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function HT(s,c){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)UT(p[s],c)}var od=q(null),rv=q(0);function qT(s,c){s=Jo,F(rv,s),F(od,c),Jo=s|c.baseLanes}function i1(){F(rv,Jo),F(od,od.current)}function a1(){Jo=rv.current,$(od),$(rv)}var _i=q(null),sa=null;function el(s){var c=s.alternate;F(Un,Un.current&1),F(_i,s),sa===null&&(c===null||od.current!==null||c.memoizedState!==null)&&(sa=s)}function o1(s){F(Un,Un.current),F(_i,s),sa===null&&(sa=s)}function VT(s){s.tag===22?(F(Un,Un.current),F(_i,s),sa===null&&(sa=s)):tl()}function tl(){F(Un,Un.current),F(_i,_i.current)}function Ci(s){$(_i),sa===s&&(sa=null),$(Un)}var Un=q(0);function iv(s){for(var c=s;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||fS(p)||hS(p)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Vo=0,gt=null,Wt=null,Kn=null,av=!1,sd=!1,jc=!1,ov=0,_h=0,ld=null,lW=0;function Rn(){throw Error(r(321))}function s1(s,c){if(c===null)return!1;for(var p=0;p<c.length&&p<s.length;p++)if(!ji(s[p],c[p]))return!1;return!0}function l1(s,c,p,x,_,N){return Vo=N,gt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,P.H=s===null||s.memoizedState===null?kP:j1,jc=!1,N=p(x,_),jc=!1,sd&&(N=YT(c,p,x,_)),KT(s),N}function KT(s){P.H=kh;var c=Wt!==null&&Wt.next!==null;if(Vo=0,Kn=Wt=gt=null,av=!1,_h=0,ld=null,c)throw Error(r(300));s===null||Yn||(s=s.dependencies,s!==null&&Wg(s)&&(Yn=!0))}function YT(s,c,p,x){gt=s;var _=0;do{if(sd&&(ld=null),_h=0,sd=!1,25<=_)throw Error(r(301));if(_+=1,Kn=Wt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}P.H=AP,N=c(p,x)}while(sd);return N}function cW(){var s=P.H,c=s.useState()[0];return c=typeof c.then=="function"?Ch(c):c,s=s.useState()[0],(Wt!==null?Wt.memoizedState:null)!==s&&(gt.flags|=1024),c}function c1(){var s=ov!==0;return ov=0,s}function u1(s,c,p){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~p}function d1(s){if(av){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}av=!1}Vo=0,Kn=Wt=gt=null,sd=!1,_h=ov=0,ld=null}function Zr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?gt.memoizedState=Kn=s:Kn=Kn.next=s,Kn}function Hn(){if(Wt===null){var s=gt.alternate;s=s!==null?s.memoizedState:null}else s=Wt.next;var c=Kn===null?gt.memoizedState:Kn.next;if(c!==null)Kn=c,Wt=s;else{if(s===null)throw gt.alternate===null?Error(r(467)):Error(r(310));Wt=s,s={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},Kn===null?gt.memoizedState=Kn=s:Kn=Kn.next=s}return Kn}function sv(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ch(s){var c=_h;return _h+=1,ld===null&&(ld=[]),s=LT(ld,s,c),c=gt,(Kn===null?c.memoizedState:Kn.next)===null&&(c=c.alternate,P.H=c===null||c.memoizedState===null?kP:j1),s}function lv(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Ch(s);if(s.$$typeof===E)return Ar(s)}throw Error(r(438,String(s)))}function f1(s){var c=null,p=gt.updateQueue;if(p!==null&&(c=p.memoCache),c==null){var x=gt.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(c={data:x.data.map(function(_){return _.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),p===null&&(p=sv(),gt.updateQueue=p),p.memoCache=c,p=c.data[c.index],p===void 0)for(p=c.data[c.index]=Array(s),x=0;x<s;x++)p[x]=I;return c.index++,p}function Ko(s,c){return typeof c=="function"?c(s):c}function cv(s){var c=Hn();return h1(c,Wt,s)}function h1(s,c,p){var x=s.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=p;var _=s.baseQueue,N=x.pending;if(N!==null){if(_!==null){var R=_.next;_.next=N.next,N.next=R}c.baseQueue=_=N,x.pending=null}if(N=s.baseState,_===null)s.memoizedState=N;else{c=_.next;var X=R=null,J=null,de=c,ye=!1;do{var we=de.lane&-536870913;if(we!==de.lane?(Nt&we)===we:(Vo&we)===we){var fe=de.revertLane;if(fe===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),we===nd&&(ye=!0);else if((Vo&fe)===fe){de=de.next,fe===nd&&(ye=!0);continue}else we={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},J===null?(X=J=we,R=N):J=J.next=we,gt.lanes|=fe,il|=fe;we=de.action,jc&&p(N,we),N=de.hasEagerState?de.eagerState:p(N,we)}else fe={lane:we,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},J===null?(X=J=fe,R=N):J=J.next=fe,gt.lanes|=we,il|=we;de=de.next}while(de!==null&&de!==c);if(J===null?R=N:J.next=X,!ji(N,s.memoizedState)&&(Yn=!0,ye&&(p=rd,p!==null)))throw p;s.memoizedState=N,s.baseState=R,s.baseQueue=J,x.lastRenderedState=N}return _===null&&(x.lanes=0),[s.memoizedState,x.dispatch]}function m1(s){var c=Hn(),p=c.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var x=p.dispatch,_=p.pending,N=c.memoizedState;if(_!==null){p.pending=null;var R=_=_.next;do N=s(N,R.action),R=R.next;while(R!==_);ji(N,c.memoizedState)||(Yn=!0),c.memoizedState=N,c.baseQueue===null&&(c.baseState=N),p.lastRenderedState=N}return[N,x]}function XT(s,c,p){var x=gt,_=Hn(),N=At;if(N){if(p===void 0)throw Error(r(407));p=p()}else p=c();var R=!ji((Wt||_).memoizedState,p);if(R&&(_.memoizedState=p,Yn=!0),_=_.queue,v1(QT.bind(null,x,_,s),[s]),_.getSnapshot!==c||R||Kn!==null&&Kn.memoizedState.tag&1){if(x.flags|=2048,cd(9,{destroy:void 0},WT.bind(null,x,_,p,c),null),on===null)throw Error(r(349));N||(Vo&127)!==0||GT(x,c,p)}return p}function GT(s,c,p){s.flags|=16384,s={getSnapshot:c,value:p},c=gt.updateQueue,c===null?(c=sv(),gt.updateQueue=c,c.stores=[s]):(p=c.stores,p===null?c.stores=[s]:p.push(s))}function WT(s,c,p,x){c.value=p,c.getSnapshot=x,ZT(c)&&JT(s)}function QT(s,c,p){return p(function(){ZT(c)&&JT(s)})}function ZT(s){var c=s.getSnapshot;s=s.value;try{var p=c();return!ji(s,p)}catch{return!0}}function JT(s){var c=mc(s,2);c!==null&&mi(c,s,2)}function p1(s){var c=Zr();if(typeof s=="function"){var p=s;if(s=p(),jc){wt(!0);try{p()}finally{wt(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:s},c}function eP(s,c,p,x){return s.baseState=p,h1(s,Wt,typeof x=="function"?x:Ko)}function uW(s,c,p,x,_){if(fv(s))throw Error(r(485));if(s=c.action,s!==null){var N={payload:_,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){N.listeners.push(R)}};P.T!==null?p(!0):N.isTransition=!1,x(N),p=c.pending,p===null?(N.next=c.pending=N,tP(c,N)):(N.next=p.next,c.pending=p.next=N)}}function tP(s,c){var p=c.action,x=c.payload,_=s.state;if(c.isTransition){var N=P.T,R={};P.T=R;try{var X=p(_,x),J=P.S;J!==null&&J(R,X),nP(s,c,X)}catch(de){g1(s,c,de)}finally{N!==null&&R.types!==null&&(N.types=R.types),P.T=N}}else try{N=p(_,x),nP(s,c,N)}catch(de){g1(s,c,de)}}function nP(s,c,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(x){rP(s,c,x)},function(x){return g1(s,c,x)}):rP(s,c,p)}function rP(s,c,p){c.status="fulfilled",c.value=p,iP(c),s.state=p,c=s.pending,c!==null&&(p=c.next,p===c?s.pending=null:(p=p.next,c.next=p,tP(s,p)))}function g1(s,c,p){var x=s.pending;if(s.pending=null,x!==null){x=x.next;do c.status="rejected",c.reason=p,iP(c),c=c.next;while(c!==x)}s.action=null}function iP(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function aP(s,c){return c}function oP(s,c){if(At){var p=on.formState;if(p!==null){e:{var x=gt;if(At){if(gn){t:{for(var _=gn,N=oa;_.nodeType!==8;){if(!N){_=null;break t}if(_=la(_.nextSibling),_===null){_=null;break t}}N=_.data,_=N==="F!"||N==="F"?_:null}if(_){gn=la(_.nextSibling),x=_.data==="F!";break e}}Gs(x)}x=!1}x&&(c=p[0])}}return p=Zr(),p.memoizedState=p.baseState=c,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aP,lastRenderedState:c},p.queue=x,p=_P.bind(null,gt,x),x.dispatch=p,x=p1(!1),N=S1.bind(null,gt,!1,x.queue),x=Zr(),_={state:c,dispatch:null,action:s,pending:null},x.queue=_,p=uW.bind(null,gt,_,N,p),_.dispatch=p,x.memoizedState=s,[c,p,!1]}function sP(s){var c=Hn();return lP(c,Wt,s)}function lP(s,c,p){if(c=h1(s,c,aP)[0],s=cv(Ko)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var x=Ch(c)}catch(R){throw R===id?Jg:R}else x=c;c=Hn();var _=c.queue,N=_.dispatch;return p!==c.memoizedState&&(gt.flags|=2048,cd(9,{destroy:void 0},dW.bind(null,_,p),null)),[x,N,s]}function dW(s,c){s.action=c}function cP(s){var c=Hn(),p=Wt;if(p!==null)return lP(c,p,s);Hn(),c=c.memoizedState,p=Hn();var x=p.queue.dispatch;return p.memoizedState=s,[c,x,!1]}function cd(s,c,p,x){return s={tag:s,create:p,deps:x,inst:c,next:null},c=gt.updateQueue,c===null&&(c=sv(),gt.updateQueue=c),p=c.lastEffect,p===null?c.lastEffect=s.next=s:(x=p.next,p.next=s,s.next=x,c.lastEffect=s),s}function uP(){return Hn().memoizedState}function uv(s,c,p,x){var _=Zr();gt.flags|=s,_.memoizedState=cd(1|c,{destroy:void 0},p,x===void 0?null:x)}function dv(s,c,p,x){var _=Hn();x=x===void 0?null:x;var N=_.memoizedState.inst;Wt!==null&&x!==null&&s1(x,Wt.memoizedState.deps)?_.memoizedState=cd(c,N,p,x):(gt.flags|=s,_.memoizedState=cd(1|c,N,p,x))}function dP(s,c){uv(8390656,8,s,c)}function v1(s,c){dv(2048,8,s,c)}function fW(s){gt.flags|=4;var c=gt.updateQueue;if(c===null)c=sv(),gt.updateQueue=c,c.events=[s];else{var p=c.events;p===null?c.events=[s]:p.push(s)}}function fP(s){var c=Hn().memoizedState;return fW({ref:c,nextImpl:s}),function(){if((qt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function hP(s,c){return dv(4,2,s,c)}function mP(s,c){return dv(4,4,s,c)}function pP(s,c){if(typeof c=="function"){s=s();var p=c(s);return function(){typeof p=="function"?p():c(null)}}if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function gP(s,c,p){p=p!=null?p.concat([s]):null,dv(4,4,pP.bind(null,c,s),p)}function y1(){}function vP(s,c){var p=Hn();c=c===void 0?null:c;var x=p.memoizedState;return c!==null&&s1(c,x[1])?x[0]:(p.memoizedState=[s,c],s)}function yP(s,c){var p=Hn();c=c===void 0?null:c;var x=p.memoizedState;if(c!==null&&s1(c,x[1]))return x[0];if(x=s(),jc){wt(!0);try{s()}finally{wt(!1)}}return p.memoizedState=[x,c],x}function x1(s,c,p){return p===void 0||(Vo&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=c:(s.memoizedState=p,s=xM(),gt.lanes|=s,il|=s,p)}function xP(s,c,p,x){return ji(p,c)?p:od.current!==null?(s=x1(s,p,x),ji(s,c)||(Yn=!0),s):(Vo&42)===0||(Vo&1073741824)!==0&&(Nt&261930)===0?(Yn=!0,s.memoizedState=p):(s=xM(),gt.lanes|=s,il|=s,c)}function bP(s,c,p,x,_){var N=H.p;H.p=N!==0&&8>N?N:8;var R=P.T,X={};P.T=X,S1(s,!1,c,p);try{var J=_(),de=P.S;if(de!==null&&de(X,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ye=sW(J,x);Nh(s,c,ye,Ai(s))}else Nh(s,c,x,Ai(s))}catch(we){Nh(s,c,{then:function(){},status:"rejected",reason:we},Ai())}finally{H.p=N,R!==null&&X.types!==null&&(R.types=X.types),P.T=R}}function hW(){}function b1(s,c,p,x){if(s.tag!==5)throw Error(r(476));var _=wP(s).queue;bP(s,_,c,Y,p===null?hW:function(){return SP(s),p(x)})}function wP(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:Y},next:null};var p={};return c.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:p},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function SP(s){var c=wP(s);c.next===null&&(c=s.alternate.memoizedState),Nh(s,c.next.queue,{},Ai())}function w1(){return Ar(qh)}function jP(){return Hn().memoizedState}function EP(){return Hn().memoizedState}function mW(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var p=Ai();s=Zs(p);var x=Js(c,s,p);x!==null&&(mi(x,c,p),Sh(x,c,p)),c={cache:Ww()},s.payload=c;return}c=c.return}}function pW(s,c,p){var x=Ai();p={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},fv(s)?CP(c,p):(p=$w(s,c,p,x),p!==null&&(mi(p,s,x),NP(p,c,x)))}function _P(s,c,p){var x=Ai();Nh(s,c,p,x)}function Nh(s,c,p,x){var _={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(fv(s))CP(c,_);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=c.lastRenderedReducer,N!==null))try{var R=c.lastRenderedState,X=N(R,p);if(_.hasEagerState=!0,_.eagerState=X,ji(X,R))return Kg(s,c,_,0),on===null&&Vg(),!1}catch{}finally{}if(p=$w(s,c,_,x),p!==null)return mi(p,s,x),NP(p,c,x),!0}return!1}function S1(s,c,p,x){if(x={lane:2,revertLane:eS(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},fv(s)){if(c)throw Error(r(479))}else c=$w(s,p,x,2),c!==null&&mi(c,s,2)}function fv(s){var c=s.alternate;return s===gt||c!==null&&c===gt}function CP(s,c){sd=av=!0;var p=s.pending;p===null?c.next=c:(c.next=p.next,p.next=c),s.pending=c}function NP(s,c,p){if((p&4194048)!==0){var x=c.lanes;x&=s.pendingLanes,p|=x,c.lanes=p,Lt(s,p)}}var kh={readContext:Ar,use:lv,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useInsertionEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useSyncExternalStore:Rn,useId:Rn,useHostTransitionStatus:Rn,useFormState:Rn,useActionState:Rn,useOptimistic:Rn,useMemoCache:Rn,useCacheRefresh:Rn};kh.useEffectEvent=Rn;var kP={readContext:Ar,use:lv,useCallback:function(s,c){return Zr().memoizedState=[s,c===void 0?null:c],s},useContext:Ar,useEffect:dP,useImperativeHandle:function(s,c,p){p=p!=null?p.concat([s]):null,uv(4194308,4,pP.bind(null,c,s),p)},useLayoutEffect:function(s,c){return uv(4194308,4,s,c)},useInsertionEffect:function(s,c){uv(4,2,s,c)},useMemo:function(s,c){var p=Zr();c=c===void 0?null:c;var x=s();if(jc){wt(!0);try{s()}finally{wt(!1)}}return p.memoizedState=[x,c],x},useReducer:function(s,c,p){var x=Zr();if(p!==void 0){var _=p(c);if(jc){wt(!0);try{p(c)}finally{wt(!1)}}}else _=c;return x.memoizedState=x.baseState=_,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:_},x.queue=s,s=s.dispatch=pW.bind(null,gt,s),[x.memoizedState,s]},useRef:function(s){var c=Zr();return s={current:s},c.memoizedState=s},useState:function(s){s=p1(s);var c=s.queue,p=_P.bind(null,gt,c);return c.dispatch=p,[s.memoizedState,p]},useDebugValue:y1,useDeferredValue:function(s,c){var p=Zr();return x1(p,s,c)},useTransition:function(){var s=p1(!1);return s=bP.bind(null,gt,s.queue,!0,!1),Zr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,p){var x=gt,_=Zr();if(At){if(p===void 0)throw Error(r(407));p=p()}else{if(p=c(),on===null)throw Error(r(349));(Nt&127)!==0||GT(x,c,p)}_.memoizedState=p;var N={value:p,getSnapshot:c};return _.queue=N,dP(QT.bind(null,x,N,s),[s]),x.flags|=2048,cd(9,{destroy:void 0},WT.bind(null,x,N,p,c),null),p},useId:function(){var s=Zr(),c=on.identifierPrefix;if(At){var p=oo,x=ao;p=(x&~(1<<32-ft(x)-1)).toString(32)+p,c="_"+c+"R_"+p,p=ov++,0<p&&(c+="H"+p.toString(32)),c+="_"}else p=lW++,c="_"+c+"r_"+p.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:w1,useFormState:oP,useActionState:oP,useOptimistic:function(s){var c=Zr();c.memoizedState=c.baseState=s;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=p,c=S1.bind(null,gt,!0,p),p.dispatch=c,[s,c]},useMemoCache:f1,useCacheRefresh:function(){return Zr().memoizedState=mW.bind(null,gt)},useEffectEvent:function(s){var c=Zr(),p={impl:s};return c.memoizedState=p,function(){if((qt&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},j1={readContext:Ar,use:lv,useCallback:vP,useContext:Ar,useEffect:v1,useImperativeHandle:gP,useInsertionEffect:hP,useLayoutEffect:mP,useMemo:yP,useReducer:cv,useRef:uP,useState:function(){return cv(Ko)},useDebugValue:y1,useDeferredValue:function(s,c){var p=Hn();return xP(p,Wt.memoizedState,s,c)},useTransition:function(){var s=cv(Ko)[0],c=Hn().memoizedState;return[typeof s=="boolean"?s:Ch(s),c]},useSyncExternalStore:XT,useId:jP,useHostTransitionStatus:w1,useFormState:sP,useActionState:sP,useOptimistic:function(s,c){var p=Hn();return eP(p,Wt,s,c)},useMemoCache:f1,useCacheRefresh:EP};j1.useEffectEvent=fP;var AP={readContext:Ar,use:lv,useCallback:vP,useContext:Ar,useEffect:v1,useImperativeHandle:gP,useInsertionEffect:hP,useLayoutEffect:mP,useMemo:yP,useReducer:m1,useRef:uP,useState:function(){return m1(Ko)},useDebugValue:y1,useDeferredValue:function(s,c){var p=Hn();return Wt===null?x1(p,s,c):xP(p,Wt.memoizedState,s,c)},useTransition:function(){var s=m1(Ko)[0],c=Hn().memoizedState;return[typeof s=="boolean"?s:Ch(s),c]},useSyncExternalStore:XT,useId:jP,useHostTransitionStatus:w1,useFormState:cP,useActionState:cP,useOptimistic:function(s,c){var p=Hn();return Wt!==null?eP(p,Wt,s,c):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:f1,useCacheRefresh:EP};AP.useEffectEvent=fP;function E1(s,c,p,x){c=s.memoizedState,p=p(x,c),p=p==null?c:h({},c,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var _1={enqueueSetState:function(s,c,p){s=s._reactInternals;var x=Ai(),_=Zs(x);_.payload=c,p!=null&&(_.callback=p),c=Js(s,_,x),c!==null&&(mi(c,s,x),Sh(c,s,x))},enqueueReplaceState:function(s,c,p){s=s._reactInternals;var x=Ai(),_=Zs(x);_.tag=1,_.payload=c,p!=null&&(_.callback=p),c=Js(s,_,x),c!==null&&(mi(c,s,x),Sh(c,s,x))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var p=Ai(),x=Zs(p);x.tag=2,c!=null&&(x.callback=c),c=Js(s,x,p),c!==null&&(mi(c,s,p),Sh(c,s,p))}};function OP(s,c,p,x,_,N,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(x,N,R):c.prototype&&c.prototype.isPureReactComponent?!mh(p,x)||!mh(_,N):!0}function TP(s,c,p,x){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,x),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,x),c.state!==s&&_1.enqueueReplaceState(c,c.state,null)}function Ec(s,c){var p=c;if("ref"in c){p={};for(var x in c)x!=="ref"&&(p[x]=c[x])}if(s=s.defaultProps){p===c&&(p=h({},p));for(var _ in s)p[_]===void 0&&(p[_]=s[_])}return p}function PP(s){qg(s)}function MP(s){console.error(s)}function RP(s){qg(s)}function hv(s,c){try{var p=s.onUncaughtError;p(c.value,{componentStack:c.stack})}catch(x){setTimeout(function(){throw x})}}function DP(s,c,p){try{var x=s.onCaughtError;x(p.value,{componentStack:p.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function C1(s,c,p){return p=Zs(p),p.tag=3,p.payload={element:null},p.callback=function(){hv(s,c)},p}function IP(s){return s=Zs(s),s.tag=3,s}function LP(s,c,p,x){var _=p.type.getDerivedStateFromError;if(typeof _=="function"){var N=x.value;s.payload=function(){return _(N)},s.callback=function(){DP(c,p,x)}}var R=p.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){DP(c,p,x),typeof _!="function"&&(al===null?al=new Set([this]):al.add(this));var X=x.stack;this.componentDidCatch(x.value,{componentStack:X!==null?X:""})})}function gW(s,c,p,x,_){if(p.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(c=p.alternate,c!==null&&td(c,p,_,!0),p=_i.current,p!==null){switch(p.tag){case 31:case 13:return sa===null?_v():p.alternate===null&&Dn===0&&(Dn=3),p.flags&=-257,p.flags|=65536,p.lanes=_,x===ev?p.flags|=16384:(c=p.updateQueue,c===null?p.updateQueue=new Set([x]):c.add(x),Q1(s,x,_)),!1;case 22:return p.flags|=65536,x===ev?p.flags|=16384:(c=p.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([x])},p.updateQueue=c):(p=c.retryQueue,p===null?c.retryQueue=new Set([x]):p.add(x)),Q1(s,x,_)),!1}throw Error(r(435,p.tag))}return Q1(s,x,_),_v(),!1}if(At)return c=_i.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=_,x!==Vw&&(s=Error(r(422),{cause:x}),vh(ra(s,p)))):(x!==Vw&&(c=Error(r(423),{cause:x}),vh(ra(c,p))),s=s.current.alternate,s.flags|=65536,_&=-_,s.lanes|=_,x=ra(x,p),_=C1(s.stateNode,x,_),n1(s,_),Dn!==4&&(Dn=2)),!1;var N=Error(r(520),{cause:x});if(N=ra(N,p),Ih===null?Ih=[N]:Ih.push(N),Dn!==4&&(Dn=2),c===null)return!0;x=ra(x,p),p=c;do{switch(p.tag){case 3:return p.flags|=65536,s=_&-_,p.lanes|=s,s=C1(p.stateNode,x,s),n1(p,s),!1;case 1:if(c=p.type,N=p.stateNode,(p.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(al===null||!al.has(N))))return p.flags|=65536,_&=-_,p.lanes|=_,_=IP(_),LP(_,s,p,x),n1(p,_),!1}p=p.return}while(p!==null);return!1}var N1=Error(r(461)),Yn=!1;function Or(s,c,p,x){c.child=s===null?FT(c,null,p,x):Sc(c,s.child,p,x)}function zP(s,c,p,x,_){p=p.render;var N=c.ref;if("ref"in x){var R={};for(var X in x)X!=="ref"&&(R[X]=x[X])}else R=x;return yc(c),x=l1(s,c,p,R,N,_),X=c1(),s!==null&&!Yn?(u1(s,c,_),Yo(s,c,_)):(At&&X&&Hw(c),c.flags|=1,Or(s,c,x,_),c.child)}function $P(s,c,p,x,_){if(s===null){var N=p.type;return typeof N=="function"&&!Bw(N)&&N.defaultProps===void 0&&p.compare===null?(c.tag=15,c.type=N,BP(s,c,N,x,_)):(s=Xg(p.type,null,x,c,c.mode,_),s.ref=c.ref,s.return=c,c.child=s)}if(N=s.child,!D1(s,_)){var R=N.memoizedProps;if(p=p.compare,p=p!==null?p:mh,p(R,x)&&s.ref===c.ref)return Yo(s,c,_)}return c.flags|=1,s=Fo(N,x),s.ref=c.ref,s.return=c,c.child=s}function BP(s,c,p,x,_){if(s!==null){var N=s.memoizedProps;if(mh(N,x)&&s.ref===c.ref)if(Yn=!1,c.pendingProps=x=N,D1(s,_))(s.flags&131072)!==0&&(Yn=!0);else return c.lanes=s.lanes,Yo(s,c,_)}return k1(s,c,p,x,_)}function FP(s,c,p,x){var _=x.children,N=s!==null?s.memoizedState:null;if(s===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((c.flags&128)!==0){if(N=N!==null?N.baseLanes|p:p,s!==null){for(x=c.child=s.child,_=0;x!==null;)_=_|x.lanes|x.childLanes,x=x.sibling;x=_&~N}else x=0,c.child=null;return UP(s,c,N,p,x)}if((p&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&Zg(c,N!==null?N.cachePool:null),N!==null?qT(c,N):i1(),VT(c);else return x=c.lanes=536870912,UP(s,c,N!==null?N.baseLanes|p:p,p,x)}else N!==null?(Zg(c,N.cachePool),qT(c,N),tl(),c.memoizedState=null):(s!==null&&Zg(c,null),i1(),tl());return Or(s,c,_,p),c.child}function Ah(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function UP(s,c,p,x,_){var N=Zw();return N=N===null?null:{parent:Vn._currentValue,pool:N},c.memoizedState={baseLanes:p,cachePool:N},s!==null&&Zg(c,null),i1(),VT(c),s!==null&&td(s,c,x,!0),c.childLanes=_,null}function mv(s,c){return c=gv({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function HP(s,c,p){return Sc(c,s.child,null,p),s=mv(c,c.pendingProps),s.flags|=2,Ci(c),c.memoizedState=null,s}function vW(s,c,p){var x=c.pendingProps,_=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(At){if(x.mode==="hidden")return s=mv(c,x),c.lanes=536870912,Ah(null,s);if(o1(c),(s=gn)?(s=tR(s,oa),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Ys!==null?{id:ao,overflow:oo}:null,retryLane:536870912,hydrationErrors:null},p=CT(s),p.return=c,c.child=p,kr=c,gn=null)):s=null,s===null)throw Gs(c);return c.lanes=536870912,null}return mv(c,x)}var N=s.memoizedState;if(N!==null){var R=N.dehydrated;if(o1(c),_)if(c.flags&256)c.flags&=-257,c=HP(s,c,p);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(r(558));else if(Yn||td(s,c,p,!1),_=(p&s.childLanes)!==0,Yn||_){if(x=on,x!==null&&(R=an(x,p),R!==0&&R!==N.retryLane))throw N.retryLane=R,mc(s,R),mi(x,s,R),N1;_v(),c=HP(s,c,p)}else s=N.treeContext,gn=la(R.nextSibling),kr=c,At=!0,Xs=null,oa=!1,s!==null&&AT(c,s),c=mv(c,x),c.flags|=4096;return c}return s=Fo(s.child,{mode:x.mode,children:x.children}),s.ref=c.ref,c.child=s,s.return=c,s}function pv(s,c){var p=c.ref;if(p===null)s!==null&&s.ref!==null&&(c.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(s===null||s.ref!==p)&&(c.flags|=4194816)}}function k1(s,c,p,x,_){return yc(c),p=l1(s,c,p,x,void 0,_),x=c1(),s!==null&&!Yn?(u1(s,c,_),Yo(s,c,_)):(At&&x&&Hw(c),c.flags|=1,Or(s,c,p,_),c.child)}function qP(s,c,p,x,_,N){return yc(c),c.updateQueue=null,p=YT(c,x,p,_),KT(s),x=c1(),s!==null&&!Yn?(u1(s,c,N),Yo(s,c,N)):(At&&x&&Hw(c),c.flags|=1,Or(s,c,p,N),c.child)}function VP(s,c,p,x,_){if(yc(c),c.stateNode===null){var N=Qu,R=p.contextType;typeof R=="object"&&R!==null&&(N=Ar(R)),N=new p(x,N),c.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=_1,c.stateNode=N,N._reactInternals=c,N=c.stateNode,N.props=x,N.state=c.memoizedState,N.refs={},e1(c),R=p.contextType,N.context=typeof R=="object"&&R!==null?Ar(R):Qu,N.state=c.memoizedState,R=p.getDerivedStateFromProps,typeof R=="function"&&(E1(c,p,R,x),N.state=c.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(R=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),R!==N.state&&_1.enqueueReplaceState(N,N.state,null),Eh(c,x,N,_),jh(),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308),x=!0}else if(s===null){N=c.stateNode;var X=c.memoizedProps,J=Ec(p,X);N.props=J;var de=N.context,ye=p.contextType;R=Qu,typeof ye=="object"&&ye!==null&&(R=Ar(ye));var we=p.getDerivedStateFromProps;ye=typeof we=="function"||typeof N.getSnapshotBeforeUpdate=="function",X=c.pendingProps!==X,ye||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(X||de!==R)&&TP(c,N,x,R),Qs=!1;var fe=c.memoizedState;N.state=fe,Eh(c,x,N,_),jh(),de=c.memoizedState,X||fe!==de||Qs?(typeof we=="function"&&(E1(c,p,we,x),de=c.memoizedState),(J=Qs||OP(c,p,J,x,fe,de,R))?(ye||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=x,c.memoizedState=de),N.props=x,N.state=de,N.context=R,x=J):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),x=!1)}else{N=c.stateNode,t1(s,c),R=c.memoizedProps,ye=Ec(p,R),N.props=ye,we=c.pendingProps,fe=N.context,de=p.contextType,J=Qu,typeof de=="object"&&de!==null&&(J=Ar(de)),X=p.getDerivedStateFromProps,(de=typeof X=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(R!==we||fe!==J)&&TP(c,N,x,J),Qs=!1,fe=c.memoizedState,N.state=fe,Eh(c,x,N,_),jh();var me=c.memoizedState;R!==we||fe!==me||Qs||s!==null&&s.dependencies!==null&&Wg(s.dependencies)?(typeof X=="function"&&(E1(c,p,X,x),me=c.memoizedState),(ye=Qs||OP(c,p,ye,x,fe,me,J)||s!==null&&s.dependencies!==null&&Wg(s.dependencies))?(de||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(x,me,J),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(x,me,J)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(c.flags|=1024),c.memoizedProps=x,c.memoizedState=me),N.props=x,N.state=me,N.context=J,x=ye):(typeof N.componentDidUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(c.flags|=1024),x=!1)}return N=x,pv(s,c),x=(c.flags&128)!==0,N||x?(N=c.stateNode,p=x&&typeof p.getDerivedStateFromError!="function"?null:N.render(),c.flags|=1,s!==null&&x?(c.child=Sc(c,s.child,null,_),c.child=Sc(c,null,p,_)):Or(s,c,p,_),c.memoizedState=N.state,s=c.child):s=Yo(s,c,_),s}function KP(s,c,p,x){return gc(),c.flags|=256,Or(s,c,p,x),c.child}var A1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function O1(s){return{baseLanes:s,cachePool:DT()}}function T1(s,c,p){return s=s!==null?s.childLanes&~p:0,c&&(s|=ki),s}function YP(s,c,p){var x=c.pendingProps,_=!1,N=(c.flags&128)!==0,R;if((R=N)||(R=s!==null&&s.memoizedState===null?!1:(Un.current&2)!==0),R&&(_=!0,c.flags&=-129),R=(c.flags&32)!==0,c.flags&=-33,s===null){if(At){if(_?el(c):tl(),(s=gn)?(s=tR(s,oa),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Ys!==null?{id:ao,overflow:oo}:null,retryLane:536870912,hydrationErrors:null},p=CT(s),p.return=c,c.child=p,kr=c,gn=null)):s=null,s===null)throw Gs(c);return hS(s)?c.lanes=32:c.lanes=536870912,null}var X=x.children;return x=x.fallback,_?(tl(),_=c.mode,X=gv({mode:"hidden",children:X},_),x=pc(x,_,p,null),X.return=c,x.return=c,X.sibling=x,c.child=X,x=c.child,x.memoizedState=O1(p),x.childLanes=T1(s,R,p),c.memoizedState=A1,Ah(null,x)):(el(c),P1(c,X))}var J=s.memoizedState;if(J!==null&&(X=J.dehydrated,X!==null)){if(N)c.flags&256?(el(c),c.flags&=-257,c=M1(s,c,p)):c.memoizedState!==null?(tl(),c.child=s.child,c.flags|=128,c=null):(tl(),X=x.fallback,_=c.mode,x=gv({mode:"visible",children:x.children},_),X=pc(X,_,p,null),X.flags|=2,x.return=c,X.return=c,x.sibling=X,c.child=x,Sc(c,s.child,null,p),x=c.child,x.memoizedState=O1(p),x.childLanes=T1(s,R,p),c.memoizedState=A1,c=Ah(null,x));else if(el(c),hS(X)){if(R=X.nextSibling&&X.nextSibling.dataset,R)var de=R.dgst;R=de,x=Error(r(419)),x.stack="",x.digest=R,vh({value:x,source:null,stack:null}),c=M1(s,c,p)}else if(Yn||td(s,c,p,!1),R=(p&s.childLanes)!==0,Yn||R){if(R=on,R!==null&&(x=an(R,p),x!==0&&x!==J.retryLane))throw J.retryLane=x,mc(s,x),mi(R,s,x),N1;fS(X)||_v(),c=M1(s,c,p)}else fS(X)?(c.flags|=192,c.child=s.child,c=null):(s=J.treeContext,gn=la(X.nextSibling),kr=c,At=!0,Xs=null,oa=!1,s!==null&&AT(c,s),c=P1(c,x.children),c.flags|=4096);return c}return _?(tl(),X=x.fallback,_=c.mode,J=s.child,de=J.sibling,x=Fo(J,{mode:"hidden",children:x.children}),x.subtreeFlags=J.subtreeFlags&65011712,de!==null?X=Fo(de,X):(X=pc(X,_,p,null),X.flags|=2),X.return=c,x.return=c,x.sibling=X,c.child=x,Ah(null,x),x=c.child,X=s.child.memoizedState,X===null?X=O1(p):(_=X.cachePool,_!==null?(J=Vn._currentValue,_=_.parent!==J?{parent:J,pool:J}:_):_=DT(),X={baseLanes:X.baseLanes|p,cachePool:_}),x.memoizedState=X,x.childLanes=T1(s,R,p),c.memoizedState=A1,Ah(s.child,x)):(el(c),p=s.child,s=p.sibling,p=Fo(p,{mode:"visible",children:x.children}),p.return=c,p.sibling=null,s!==null&&(R=c.deletions,R===null?(c.deletions=[s],c.flags|=16):R.push(s)),c.child=p,c.memoizedState=null,p)}function P1(s,c){return c=gv({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function gv(s,c){return s=Ei(22,s,null,c),s.lanes=0,s}function M1(s,c,p){return Sc(c,s.child,null,p),s=P1(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function XP(s,c,p){s.lanes|=c;var x=s.alternate;x!==null&&(x.lanes|=c),Xw(s.return,c,p)}function R1(s,c,p,x,_,N){var R=s.memoizedState;R===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:x,tail:p,tailMode:_,treeForkCount:N}:(R.isBackwards=c,R.rendering=null,R.renderingStartTime=0,R.last=x,R.tail=p,R.tailMode=_,R.treeForkCount=N)}function GP(s,c,p){var x=c.pendingProps,_=x.revealOrder,N=x.tail;x=x.children;var R=Un.current,X=(R&2)!==0;if(X?(R=R&1|2,c.flags|=128):R&=1,F(Un,R),Or(s,c,x,p),x=At?gh:0,!X&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&XP(s,p,c);else if(s.tag===19)XP(s,p,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(_){case"forwards":for(p=c.child,_=null;p!==null;)s=p.alternate,s!==null&&iv(s)===null&&(_=p),p=p.sibling;p=_,p===null?(_=c.child,c.child=null):(_=p.sibling,p.sibling=null),R1(c,!1,_,p,N,x);break;case"backwards":case"unstable_legacy-backwards":for(p=null,_=c.child,c.child=null;_!==null;){if(s=_.alternate,s!==null&&iv(s)===null){c.child=_;break}s=_.sibling,_.sibling=p,p=_,_=s}R1(c,!0,p,null,N,x);break;case"together":R1(c,!1,null,null,void 0,x);break;default:c.memoizedState=null}return c.child}function Yo(s,c,p){if(s!==null&&(c.dependencies=s.dependencies),il|=c.lanes,(p&c.childLanes)===0)if(s!==null){if(td(s,c,p,!1),(p&c.childLanes)===0)return null}else return null;if(s!==null&&c.child!==s.child)throw Error(r(153));if(c.child!==null){for(s=c.child,p=Fo(s,s.pendingProps),c.child=p,p.return=c;s.sibling!==null;)s=s.sibling,p=p.sibling=Fo(s,s.pendingProps),p.return=c;p.sibling=null}return c.child}function D1(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&Wg(s)))}function yW(s,c,p){switch(c.tag){case 3:re(c,c.stateNode.containerInfo),Ws(c,Vn,s.memoizedState.cache),gc();break;case 27:case 5:se(c);break;case 4:re(c,c.stateNode.containerInfo);break;case 10:Ws(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,o1(c),null;break;case 13:var x=c.memoizedState;if(x!==null)return x.dehydrated!==null?(el(c),c.flags|=128,null):(p&c.child.childLanes)!==0?YP(s,c,p):(el(c),s=Yo(s,c,p),s!==null?s.sibling:null);el(c);break;case 19:var _=(s.flags&128)!==0;if(x=(p&c.childLanes)!==0,x||(td(s,c,p,!1),x=(p&c.childLanes)!==0),_){if(x)return GP(s,c,p);c.flags|=128}if(_=c.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),F(Un,Un.current),x)break;return null;case 22:return c.lanes=0,FP(s,c,p,c.pendingProps);case 24:Ws(c,Vn,s.memoizedState.cache)}return Yo(s,c,p)}function WP(s,c,p){if(s!==null)if(s.memoizedProps!==c.pendingProps)Yn=!0;else{if(!D1(s,p)&&(c.flags&128)===0)return Yn=!1,yW(s,c,p);Yn=(s.flags&131072)!==0}else Yn=!1,At&&(c.flags&1048576)!==0&&kT(c,gh,c.index);switch(c.lanes=0,c.tag){case 16:e:{var x=c.pendingProps;if(s=bc(c.elementType),c.type=s,typeof s=="function")Bw(s)?(x=Ec(s,x),c.tag=1,c=VP(null,c,s,x,p)):(c.tag=0,c=k1(null,c,s,x,p));else{if(s!=null){var _=s.$$typeof;if(_===k){c.tag=11,c=zP(null,c,s,x,p);break e}else if(_===T){c.tag=14,c=$P(null,c,s,x,p);break e}}throw c=z(s)||s,Error(r(306,c,""))}}return c;case 0:return k1(s,c,c.type,c.pendingProps,p);case 1:return x=c.type,_=Ec(x,c.pendingProps),VP(s,c,x,_,p);case 3:e:{if(re(c,c.stateNode.containerInfo),s===null)throw Error(r(387));x=c.pendingProps;var N=c.memoizedState;_=N.element,t1(s,c),Eh(c,x,null,p);var R=c.memoizedState;if(x=R.cache,Ws(c,Vn,x),x!==N.cache&&Gw(c,[Vn],p,!0),jh(),x=R.element,N.isDehydrated)if(N={element:x,isDehydrated:!1,cache:R.cache},c.updateQueue.baseState=N,c.memoizedState=N,c.flags&256){c=KP(s,c,x,p);break e}else if(x!==_){_=ra(Error(r(424)),c),vh(_),c=KP(s,c,x,p);break e}else{switch(s=c.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(gn=la(s.firstChild),kr=c,At=!0,Xs=null,oa=!0,p=FT(c,null,x,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(gc(),x===_){c=Yo(s,c,p);break e}Or(s,c,x,p)}c=c.child}return c;case 26:return pv(s,c),s===null?(p=sR(c.type,null,c.pendingProps,null))?c.memoizedState=p:At||(p=c.type,s=c.pendingProps,x=Pv(te.current).createElement(p),x[Fn]=c,x[ir]=s,Tr(x,p,s),qn(x),c.stateNode=x):c.memoizedState=sR(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return se(c),s===null&&At&&(x=c.stateNode=iR(c.type,c.pendingProps,te.current),kr=c,oa=!0,_=gn,cl(c.type)?(mS=_,gn=la(x.firstChild)):gn=_),Or(s,c,c.pendingProps.children,p),pv(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&At&&((_=x=gn)&&(x=XW(x,c.type,c.pendingProps,oa),x!==null?(c.stateNode=x,kr=c,gn=la(x.firstChild),oa=!1,_=!0):_=!1),_||Gs(c)),se(c),_=c.type,N=c.pendingProps,R=s!==null?s.memoizedProps:null,x=N.children,cS(_,N)?x=null:R!==null&&cS(_,R)&&(c.flags|=32),c.memoizedState!==null&&(_=l1(s,c,cW,null,null,p),qh._currentValue=_),pv(s,c),Or(s,c,x,p),c.child;case 6:return s===null&&At&&((s=p=gn)&&(p=GW(p,c.pendingProps,oa),p!==null?(c.stateNode=p,kr=c,gn=null,s=!0):s=!1),s||Gs(c)),null;case 13:return YP(s,c,p);case 4:return re(c,c.stateNode.containerInfo),x=c.pendingProps,s===null?c.child=Sc(c,null,x,p):Or(s,c,x,p),c.child;case 11:return zP(s,c,c.type,c.pendingProps,p);case 7:return Or(s,c,c.pendingProps,p),c.child;case 8:return Or(s,c,c.pendingProps.children,p),c.child;case 12:return Or(s,c,c.pendingProps.children,p),c.child;case 10:return x=c.pendingProps,Ws(c,c.type,x.value),Or(s,c,x.children,p),c.child;case 9:return _=c.type._context,x=c.pendingProps.children,yc(c),_=Ar(_),x=x(_),c.flags|=1,Or(s,c,x,p),c.child;case 14:return $P(s,c,c.type,c.pendingProps,p);case 15:return BP(s,c,c.type,c.pendingProps,p);case 19:return GP(s,c,p);case 31:return vW(s,c,p);case 22:return FP(s,c,p,c.pendingProps);case 24:return yc(c),x=Ar(Vn),s===null?(_=Zw(),_===null&&(_=on,N=Ww(),_.pooledCache=N,N.refCount++,N!==null&&(_.pooledCacheLanes|=p),_=N),c.memoizedState={parent:x,cache:_},e1(c),Ws(c,Vn,_)):((s.lanes&p)!==0&&(t1(s,c),Eh(c,null,null,p),jh()),_=s.memoizedState,N=c.memoizedState,_.parent!==x?(_={parent:x,cache:x},c.memoizedState=_,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=_),Ws(c,Vn,x)):(x=N.cache,Ws(c,Vn,x),x!==_.cache&&Gw(c,[Vn],p,!0))),Or(s,c,c.pendingProps.children,p),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function Xo(s){s.flags|=4}function I1(s,c,p,x,_){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(_&335544128)===_)if(s.stateNode.complete)s.flags|=8192;else if(jM())s.flags|=8192;else throw wc=ev,Jw}else s.flags&=-16777217}function QP(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!fR(c))if(jM())s.flags|=8192;else throw wc=ev,Jw}function vv(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?Tn():536870912,s.lanes|=c,hd|=c)}function Oh(s,c){if(!At)switch(s.tailMode){case"hidden":c=s.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?s.tail=null:p.sibling=null;break;case"collapsed":p=s.tail;for(var x=null;p!==null;)p.alternate!==null&&(x=p),p=p.sibling;x===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:x.sibling=null}}function vn(s){var c=s.alternate!==null&&s.alternate.child===s.child,p=0,x=0;if(c)for(var _=s.child;_!==null;)p|=_.lanes|_.childLanes,x|=_.subtreeFlags&65011712,x|=_.flags&65011712,_.return=s,_=_.sibling;else for(_=s.child;_!==null;)p|=_.lanes|_.childLanes,x|=_.subtreeFlags,x|=_.flags,_.return=s,_=_.sibling;return s.subtreeFlags|=x,s.childLanes=p,c}function xW(s,c,p){var x=c.pendingProps;switch(qw(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(c),null;case 1:return vn(c),null;case 3:return p=c.stateNode,x=null,s!==null&&(x=s.memoizedState.cache),c.memoizedState.cache!==x&&(c.flags|=2048),qo(Vn),ee(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(ed(c)?Xo(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Kw())),vn(c),null;case 26:var _=c.type,N=c.memoizedState;return s===null?(Xo(c),N!==null?(vn(c),QP(c,N)):(vn(c),I1(c,_,null,x,p))):N?N!==s.memoizedState?(Xo(c),vn(c),QP(c,N)):(vn(c),c.flags&=-16777217):(s=s.memoizedProps,s!==x&&Xo(c),vn(c),I1(c,_,s,x,p)),null;case 27:if(ve(c),p=te.current,_=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==x&&Xo(c);else{if(!x){if(c.stateNode===null)throw Error(r(166));return vn(c),null}s=Q.current,ed(c)?OT(c):(s=iR(_,x,p),c.stateNode=s,Xo(c))}return vn(c),null;case 5:if(ve(c),_=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==x&&Xo(c);else{if(!x){if(c.stateNode===null)throw Error(r(166));return vn(c),null}if(N=Q.current,ed(c))OT(c);else{var R=Pv(te.current);switch(N){case 1:N=R.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:N=R.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":N=R.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":N=R.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":N=R.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof x.is=="string"?R.createElement("select",{is:x.is}):R.createElement("select"),x.multiple?N.multiple=!0:x.size&&(N.size=x.size);break;default:N=typeof x.is=="string"?R.createElement(_,{is:x.is}):R.createElement(_)}}N[Fn]=c,N[ir]=x;e:for(R=c.child;R!==null;){if(R.tag===5||R.tag===6)N.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===c)break e;for(;R.sibling===null;){if(R.return===null||R.return===c)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}c.stateNode=N;e:switch(Tr(N,_,x),_){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&Xo(c)}}return vn(c),I1(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,p),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==x&&Xo(c);else{if(typeof x!="string"&&c.stateNode===null)throw Error(r(166));if(s=te.current,ed(c)){if(s=c.stateNode,p=c.memoizedProps,x=null,_=kr,_!==null)switch(_.tag){case 27:case 5:x=_.memoizedProps}s[Fn]=c,s=!!(s.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||YM(s.nodeValue,p)),s||Gs(c,!0)}else s=Pv(s).createTextNode(x),s[Fn]=c,c.stateNode=s}return vn(c),null;case 31:if(p=c.memoizedState,s===null||s.memoizedState!==null){if(x=ed(c),p!==null){if(s===null){if(!x)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Fn]=c}else gc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;vn(c),s=!1}else p=Kw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return c.flags&256?(Ci(c),c):(Ci(c),null);if((c.flags&128)!==0)throw Error(r(558))}return vn(c),null;case 13:if(x=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(_=ed(c),x!==null&&x.dehydrated!==null){if(s===null){if(!_)throw Error(r(318));if(_=c.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Fn]=c}else gc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;vn(c),_=!1}else _=Kw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=_),_=!0;if(!_)return c.flags&256?(Ci(c),c):(Ci(c),null)}return Ci(c),(c.flags&128)!==0?(c.lanes=p,c):(p=x!==null,s=s!==null&&s.memoizedState!==null,p&&(x=c.child,_=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(_=x.alternate.memoizedState.cachePool.pool),N=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(N=x.memoizedState.cachePool.pool),N!==_&&(x.flags|=2048)),p!==s&&p&&(c.child.flags|=8192),vv(c,c.updateQueue),vn(c),null);case 4:return ee(),s===null&&iS(c.stateNode.containerInfo),vn(c),null;case 10:return qo(c.type),vn(c),null;case 19:if($(Un),x=c.memoizedState,x===null)return vn(c),null;if(_=(c.flags&128)!==0,N=x.rendering,N===null)if(_)Oh(x,!1);else{if(Dn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(N=iv(s),N!==null){for(c.flags|=128,Oh(x,!1),s=N.updateQueue,c.updateQueue=s,vv(c,s),c.subtreeFlags=0,s=p,p=c.child;p!==null;)_T(p,s),p=p.sibling;return F(Un,Un.current&1|2),At&&Uo(c,x.treeForkCount),c.child}s=s.sibling}x.tail!==null&&Ut()>Sv&&(c.flags|=128,_=!0,Oh(x,!1),c.lanes=4194304)}else{if(!_)if(s=iv(N),s!==null){if(c.flags|=128,_=!0,s=s.updateQueue,c.updateQueue=s,vv(c,s),Oh(x,!0),x.tail===null&&x.tailMode==="hidden"&&!N.alternate&&!At)return vn(c),null}else 2*Ut()-x.renderingStartTime>Sv&&p!==536870912&&(c.flags|=128,_=!0,Oh(x,!1),c.lanes=4194304);x.isBackwards?(N.sibling=c.child,c.child=N):(s=x.last,s!==null?s.sibling=N:c.child=N,x.last=N)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Ut(),s.sibling=null,p=Un.current,F(Un,_?p&1|2:p&1),At&&Uo(c,x.treeForkCount),s):(vn(c),null);case 22:case 23:return Ci(c),a1(),x=c.memoizedState!==null,s!==null?s.memoizedState!==null!==x&&(c.flags|=8192):x&&(c.flags|=8192),x?(p&536870912)!==0&&(c.flags&128)===0&&(vn(c),c.subtreeFlags&6&&(c.flags|=8192)):vn(c),p=c.updateQueue,p!==null&&vv(c,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==p&&(c.flags|=2048),s!==null&&$(xc),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),c.memoizedState.cache!==p&&(c.flags|=2048),qo(Vn),vn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function bW(s,c){switch(qw(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return qo(Vn),ee(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return ve(c),null;case 31:if(c.memoizedState!==null){if(Ci(c),c.alternate===null)throw Error(r(340));gc()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Ci(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));gc()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return $(Un),null;case 4:return ee(),null;case 10:return qo(c.type),null;case 22:case 23:return Ci(c),a1(),s!==null&&$(xc),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return qo(Vn),null;case 25:return null;default:return null}}function ZP(s,c){switch(qw(c),c.tag){case 3:qo(Vn),ee();break;case 26:case 27:case 5:ve(c);break;case 4:ee();break;case 31:c.memoizedState!==null&&Ci(c);break;case 13:Ci(c);break;case 19:$(Un);break;case 10:qo(c.type);break;case 22:case 23:Ci(c),a1(),s!==null&&$(xc);break;case 24:qo(Vn)}}function Th(s,c){try{var p=c.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var _=x.next;p=_;do{if((p.tag&s)===s){x=void 0;var N=p.create,R=p.inst;x=N(),R.destroy=x}p=p.next}while(p!==_)}}catch(X){Gt(c,c.return,X)}}function nl(s,c,p){try{var x=c.updateQueue,_=x!==null?x.lastEffect:null;if(_!==null){var N=_.next;x=N;do{if((x.tag&s)===s){var R=x.inst,X=R.destroy;if(X!==void 0){R.destroy=void 0,_=c;var J=p,de=X;try{de()}catch(ye){Gt(_,J,ye)}}}x=x.next}while(x!==N)}}catch(ye){Gt(c,c.return,ye)}}function JP(s){var c=s.updateQueue;if(c!==null){var p=s.stateNode;try{HT(c,p)}catch(x){Gt(s,s.return,x)}}}function eM(s,c,p){p.props=Ec(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(x){Gt(s,c,x)}}function Ph(s,c){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var x=s.stateNode;break;case 30:x=s.stateNode;break;default:x=s.stateNode}typeof p=="function"?s.refCleanup=p(x):p.current=x}}catch(_){Gt(s,c,_)}}function so(s,c){var p=s.ref,x=s.refCleanup;if(p!==null)if(typeof x=="function")try{x()}catch(_){Gt(s,c,_)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(_){Gt(s,c,_)}else p.current=null}function tM(s){var c=s.type,p=s.memoizedProps,x=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":p.autoFocus&&x.focus();break e;case"img":p.src?x.src=p.src:p.srcSet&&(x.srcset=p.srcSet)}}catch(_){Gt(s,s.return,_)}}function L1(s,c,p){try{var x=s.stateNode;UW(x,s.type,p,c),x[ir]=c}catch(_){Gt(s,s.return,_)}}function nM(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&cl(s.type)||s.tag===4}function z1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||nM(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&cl(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function $1(s,c,p){var x=s.tag;if(x===5||x===6)s=s.stateNode,c?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,c):(c=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,c.appendChild(s),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=$o));else if(x!==4&&(x===27&&cl(s.type)&&(p=s.stateNode,c=null),s=s.child,s!==null))for($1(s,c,p),s=s.sibling;s!==null;)$1(s,c,p),s=s.sibling}function yv(s,c,p){var x=s.tag;if(x===5||x===6)s=s.stateNode,c?p.insertBefore(s,c):p.appendChild(s);else if(x!==4&&(x===27&&cl(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(yv(s,c,p),s=s.sibling;s!==null;)yv(s,c,p),s=s.sibling}function rM(s){var c=s.stateNode,p=s.memoizedProps;try{for(var x=s.type,_=c.attributes;_.length;)c.removeAttributeNode(_[0]);Tr(c,x,p),c[Fn]=s,c[ir]=p}catch(N){Gt(s,s.return,N)}}var Go=!1,Xn=!1,B1=!1,iM=typeof WeakSet=="function"?WeakSet:Set,vr=null;function wW(s,c){if(s=s.containerInfo,sS=$v,s=gT(s),Mw(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var x=p.getSelection&&p.getSelection();if(x&&x.rangeCount!==0){p=x.anchorNode;var _=x.anchorOffset,N=x.focusNode;x=x.focusOffset;try{p.nodeType,N.nodeType}catch{p=null;break e}var R=0,X=-1,J=-1,de=0,ye=0,we=s,fe=null;t:for(;;){for(var me;we!==p||_!==0&&we.nodeType!==3||(X=R+_),we!==N||x!==0&&we.nodeType!==3||(J=R+x),we.nodeType===3&&(R+=we.nodeValue.length),(me=we.firstChild)!==null;)fe=we,we=me;for(;;){if(we===s)break t;if(fe===p&&++de===_&&(X=R),fe===N&&++ye===x&&(J=R),(me=we.nextSibling)!==null)break;we=fe,fe=we.parentNode}we=me}p=X===-1||J===-1?null:{start:X,end:J}}else p=null}p=p||{start:0,end:0}}else p=null;for(lS={focusedElem:s,selectionRange:p},$v=!1,vr=c;vr!==null;)if(c=vr,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,vr=s;else for(;vr!==null;){switch(c=vr,N=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p<s.length;p++)_=s[p],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,p=c,_=N.memoizedProps,N=N.memoizedState,x=p.stateNode;try{var $e=Ec(p.type,_);s=x.getSnapshotBeforeUpdate($e,N),x.__reactInternalSnapshotBeforeUpdate=s}catch(nt){Gt(p,p.return,nt)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,p=s.nodeType,p===9)dS(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":dS(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=c.sibling,s!==null){s.return=c.return,vr=s;break}vr=c.return}}function aM(s,c,p){var x=p.flags;switch(p.tag){case 0:case 11:case 15:Qo(s,p),x&4&&Th(5,p);break;case 1:if(Qo(s,p),x&4)if(s=p.stateNode,c===null)try{s.componentDidMount()}catch(R){Gt(p,p.return,R)}else{var _=Ec(p.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(_,c,s.__reactInternalSnapshotBeforeUpdate)}catch(R){Gt(p,p.return,R)}}x&64&&JP(p),x&512&&Ph(p,p.return);break;case 3:if(Qo(s,p),x&64&&(s=p.updateQueue,s!==null)){if(c=null,p.child!==null)switch(p.child.tag){case 27:case 5:c=p.child.stateNode;break;case 1:c=p.child.stateNode}try{HT(s,c)}catch(R){Gt(p,p.return,R)}}break;case 27:c===null&&x&4&&rM(p);case 26:case 5:Qo(s,p),c===null&&x&4&&tM(p),x&512&&Ph(p,p.return);break;case 12:Qo(s,p);break;case 31:Qo(s,p),x&4&&lM(s,p);break;case 13:Qo(s,p),x&4&&cM(s,p),x&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=OW.bind(null,p),WW(s,p))));break;case 22:if(x=p.memoizedState!==null||Go,!x){c=c!==null&&c.memoizedState!==null||Xn,_=Go;var N=Xn;Go=x,(Xn=c)&&!N?Zo(s,p,(p.subtreeFlags&8772)!==0):Qo(s,p),Go=_,Xn=N}break;case 30:break;default:Qo(s,p)}}function oM(s){var c=s.alternate;c!==null&&(s.alternate=null,oM(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&ih(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var wn=null,ui=!1;function Wo(s,c,p){for(p=p.child;p!==null;)sM(s,c,p),p=p.sibling}function sM(s,c,p){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(je,p)}catch{}switch(p.tag){case 26:Xn||so(p,c),Wo(s,c,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:Xn||so(p,c);var x=wn,_=ui;cl(p.type)&&(wn=p.stateNode,ui=!1),Wo(s,c,p),Fh(p.stateNode),wn=x,ui=_;break;case 5:Xn||so(p,c);case 6:if(x=wn,_=ui,wn=null,Wo(s,c,p),wn=x,ui=_,wn!==null)if(ui)try{(wn.nodeType===9?wn.body:wn.nodeName==="HTML"?wn.ownerDocument.body:wn).removeChild(p.stateNode)}catch(N){Gt(p,c,N)}else try{wn.removeChild(p.stateNode)}catch(N){Gt(p,c,N)}break;case 18:wn!==null&&(ui?(s=wn,JM(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),wd(s)):JM(wn,p.stateNode));break;case 4:x=wn,_=ui,wn=p.stateNode.containerInfo,ui=!0,Wo(s,c,p),wn=x,ui=_;break;case 0:case 11:case 14:case 15:nl(2,p,c),Xn||nl(4,p,c),Wo(s,c,p);break;case 1:Xn||(so(p,c),x=p.stateNode,typeof x.componentWillUnmount=="function"&&eM(p,c,x)),Wo(s,c,p);break;case 21:Wo(s,c,p);break;case 22:Xn=(x=Xn)||p.memoizedState!==null,Wo(s,c,p),Xn=x;break;default:Wo(s,c,p)}}function lM(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{wd(s)}catch(p){Gt(c,c.return,p)}}}function cM(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{wd(s)}catch(p){Gt(c,c.return,p)}}function SW(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new iM),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new iM),c;default:throw Error(r(435,s.tag))}}function xv(s,c){var p=SW(s);c.forEach(function(x){if(!p.has(x)){p.add(x);var _=TW.bind(null,s,x);x.then(_,_)}})}function di(s,c){var p=c.deletions;if(p!==null)for(var x=0;x<p.length;x++){var _=p[x],N=s,R=c,X=R;e:for(;X!==null;){switch(X.tag){case 27:if(cl(X.type)){wn=X.stateNode,ui=!1;break e}break;case 5:wn=X.stateNode,ui=!1;break e;case 3:case 4:wn=X.stateNode.containerInfo,ui=!0;break e}X=X.return}if(wn===null)throw Error(r(160));sM(N,R,_),wn=null,ui=!1,N=_.alternate,N!==null&&(N.return=null),_.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)uM(c,s),c=c.sibling}var La=null;function uM(s,c){var p=s.alternate,x=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:di(c,s),fi(s),x&4&&(nl(3,s,s.return),Th(3,s),nl(5,s,s.return));break;case 1:di(c,s),fi(s),x&512&&(Xn||p===null||so(p,p.return)),x&64&&Go&&(s=s.updateQueue,s!==null&&(x=s.callbacks,x!==null&&(p=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=p===null?x:p.concat(x))));break;case 26:var _=La;if(di(c,s),fi(s),x&512&&(Xn||p===null||so(p,p.return)),x&4){var N=p!==null?p.memoizedState:null;if(x=s.memoizedState,p===null)if(x===null)if(s.stateNode===null){e:{x=s.type,p=s.memoizedProps,_=_.ownerDocument||_;t:switch(x){case"title":N=_.getElementsByTagName("title")[0],(!N||N[Ra]||N[Fn]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=_.createElement(x),_.head.insertBefore(N,_.querySelector("head > title"))),Tr(N,x,p),N[Fn]=s,qn(N),x=N;break e;case"link":var R=uR("link","href",_).get(x+(p.href||""));if(R){for(var X=0;X<R.length;X++)if(N=R[X],N.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&N.getAttribute("rel")===(p.rel==null?null:p.rel)&&N.getAttribute("title")===(p.title==null?null:p.title)&&N.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){R.splice(X,1);break t}}N=_.createElement(x),Tr(N,x,p),_.head.appendChild(N);break;case"meta":if(R=uR("meta","content",_).get(x+(p.content||""))){for(X=0;X<R.length;X++)if(N=R[X],N.getAttribute("content")===(p.content==null?null:""+p.content)&&N.getAttribute("name")===(p.name==null?null:p.name)&&N.getAttribute("property")===(p.property==null?null:p.property)&&N.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&N.getAttribute("charset")===(p.charSet==null?null:p.charSet)){R.splice(X,1);break t}}N=_.createElement(x),Tr(N,x,p),_.head.appendChild(N);break;default:throw Error(r(468,x))}N[Fn]=s,qn(N),x=N}s.stateNode=x}else dR(_,s.type,s.stateNode);else s.stateNode=cR(_,x,s.memoizedProps);else N!==x?(N===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):N.count--,x===null?dR(_,s.type,s.stateNode):cR(_,x,s.memoizedProps)):x===null&&s.stateNode!==null&&L1(s,s.memoizedProps,p.memoizedProps)}break;case 27:di(c,s),fi(s),x&512&&(Xn||p===null||so(p,p.return)),p!==null&&x&4&&L1(s,s.memoizedProps,p.memoizedProps);break;case 5:if(di(c,s),fi(s),x&512&&(Xn||p===null||so(p,p.return)),s.flags&32){_=s.stateNode;try{qu(_,"")}catch($e){Gt(s,s.return,$e)}}x&4&&s.stateNode!=null&&(_=s.memoizedProps,L1(s,_,p!==null?p.memoizedProps:_)),x&1024&&(B1=!0);break;case 6:if(di(c,s),fi(s),x&4){if(s.stateNode===null)throw Error(r(162));x=s.memoizedProps,p=s.stateNode;try{p.nodeValue=x}catch($e){Gt(s,s.return,$e)}}break;case 3:if(Dv=null,_=La,La=Mv(c.containerInfo),di(c,s),La=_,fi(s),x&4&&p!==null&&p.memoizedState.isDehydrated)try{wd(c.containerInfo)}catch($e){Gt(s,s.return,$e)}B1&&(B1=!1,dM(s));break;case 4:x=La,La=Mv(s.stateNode.containerInfo),di(c,s),fi(s),La=x;break;case 12:di(c,s),fi(s);break;case 31:di(c,s),fi(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,xv(s,x)));break;case 13:di(c,s),fi(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(wv=Ut()),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,xv(s,x)));break;case 22:_=s.memoizedState!==null;var J=p!==null&&p.memoizedState!==null,de=Go,ye=Xn;if(Go=de||_,Xn=ye||J,di(c,s),Xn=ye,Go=de,fi(s),x&8192)e:for(c=s.stateNode,c._visibility=_?c._visibility&-2:c._visibility|1,_&&(p===null||J||Go||Xn||_c(s)),p=null,c=s;;){if(c.tag===5||c.tag===26){if(p===null){J=p=c;try{if(N=J.stateNode,_)R=N.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{X=J.stateNode;var we=J.memoizedProps.style,fe=we!=null&&we.hasOwnProperty("display")?we.display:null;X.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch($e){Gt(J,J.return,$e)}}}else if(c.tag===6){if(p===null){J=c;try{J.stateNode.nodeValue=_?"":J.memoizedProps}catch($e){Gt(J,J.return,$e)}}}else if(c.tag===18){if(p===null){J=c;try{var me=J.stateNode;_?eR(me,!0):eR(J.stateNode,!1)}catch($e){Gt(J,J.return,$e)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;p===c&&(p=null),c=c.return}p===c&&(p=null),c.sibling.return=c.return,c=c.sibling}x&4&&(x=s.updateQueue,x!==null&&(p=x.retryQueue,p!==null&&(x.retryQueue=null,xv(s,p))));break;case 19:di(c,s),fi(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,xv(s,x)));break;case 30:break;case 21:break;default:di(c,s),fi(s)}}function fi(s){var c=s.flags;if(c&2){try{for(var p,x=s.return;x!==null;){if(nM(x)){p=x;break}x=x.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var _=p.stateNode,N=z1(s);yv(s,N,_);break;case 5:var R=p.stateNode;p.flags&32&&(qu(R,""),p.flags&=-33);var X=z1(s);yv(s,X,R);break;case 3:case 4:var J=p.stateNode.containerInfo,de=z1(s);$1(s,de,J);break;default:throw Error(r(161))}}catch(ye){Gt(s,s.return,ye)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function dM(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;dM(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function Qo(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)aM(s,c.alternate,c),c=c.sibling}function _c(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:nl(4,c,c.return),_c(c);break;case 1:so(c,c.return);var p=c.stateNode;typeof p.componentWillUnmount=="function"&&eM(c,c.return,p),_c(c);break;case 27:Fh(c.stateNode);case 26:case 5:so(c,c.return),_c(c);break;case 22:c.memoizedState===null&&_c(c);break;case 30:_c(c);break;default:_c(c)}s=s.sibling}}function Zo(s,c,p){for(p=p&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var x=c.alternate,_=s,N=c,R=N.flags;switch(N.tag){case 0:case 11:case 15:Zo(_,N,p),Th(4,N);break;case 1:if(Zo(_,N,p),x=N,_=x.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(de){Gt(x,x.return,de)}if(x=N,_=x.updateQueue,_!==null){var X=x.stateNode;try{var J=_.shared.hiddenCallbacks;if(J!==null)for(_.shared.hiddenCallbacks=null,_=0;_<J.length;_++)UT(J[_],X)}catch(de){Gt(x,x.return,de)}}p&&R&64&&JP(N),Ph(N,N.return);break;case 27:rM(N);case 26:case 5:Zo(_,N,p),p&&x===null&&R&4&&tM(N),Ph(N,N.return);break;case 12:Zo(_,N,p);break;case 31:Zo(_,N,p),p&&R&4&&lM(_,N);break;case 13:Zo(_,N,p),p&&R&4&&cM(_,N);break;case 22:N.memoizedState===null&&Zo(_,N,p),Ph(N,N.return);break;case 30:break;default:Zo(_,N,p)}c=c.sibling}}function F1(s,c){var p=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),s=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(s=c.memoizedState.cachePool.pool),s!==p&&(s!=null&&s.refCount++,p!=null&&yh(p))}function U1(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&yh(s))}function za(s,c,p,x){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)fM(s,c,p,x),c=c.sibling}function fM(s,c,p,x){var _=c.flags;switch(c.tag){case 0:case 11:case 15:za(s,c,p,x),_&2048&&Th(9,c);break;case 1:za(s,c,p,x);break;case 3:za(s,c,p,x),_&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&yh(s)));break;case 12:if(_&2048){za(s,c,p,x),s=c.stateNode;try{var N=c.memoizedProps,R=N.id,X=N.onPostCommit;typeof X=="function"&&X(R,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(J){Gt(c,c.return,J)}}else za(s,c,p,x);break;case 31:za(s,c,p,x);break;case 13:za(s,c,p,x);break;case 23:break;case 22:N=c.stateNode,R=c.alternate,c.memoizedState!==null?N._visibility&2?za(s,c,p,x):Mh(s,c):N._visibility&2?za(s,c,p,x):(N._visibility|=2,ud(s,c,p,x,(c.subtreeFlags&10256)!==0||!1)),_&2048&&F1(R,c);break;case 24:za(s,c,p,x),_&2048&&U1(c.alternate,c);break;default:za(s,c,p,x)}}function ud(s,c,p,x,_){for(_=_&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var N=s,R=c,X=p,J=x,de=R.flags;switch(R.tag){case 0:case 11:case 15:ud(N,R,X,J,_),Th(8,R);break;case 23:break;case 22:var ye=R.stateNode;R.memoizedState!==null?ye._visibility&2?ud(N,R,X,J,_):Mh(N,R):(ye._visibility|=2,ud(N,R,X,J,_)),_&&de&2048&&F1(R.alternate,R);break;case 24:ud(N,R,X,J,_),_&&de&2048&&U1(R.alternate,R);break;default:ud(N,R,X,J,_)}c=c.sibling}}function Mh(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var p=s,x=c,_=x.flags;switch(x.tag){case 22:Mh(p,x),_&2048&&F1(x.alternate,x);break;case 24:Mh(p,x),_&2048&&U1(x.alternate,x);break;default:Mh(p,x)}c=c.sibling}}var Rh=8192;function dd(s,c,p){if(s.subtreeFlags&Rh)for(s=s.child;s!==null;)hM(s,c,p),s=s.sibling}function hM(s,c,p){switch(s.tag){case 26:dd(s,c,p),s.flags&Rh&&s.memoizedState!==null&&lQ(p,La,s.memoizedState,s.memoizedProps);break;case 5:dd(s,c,p);break;case 3:case 4:var x=La;La=Mv(s.stateNode.containerInfo),dd(s,c,p),La=x;break;case 22:s.memoizedState===null&&(x=s.alternate,x!==null&&x.memoizedState!==null?(x=Rh,Rh=16777216,dd(s,c,p),Rh=x):dd(s,c,p));break;default:dd(s,c,p)}}function mM(s){var c=s.alternate;if(c!==null&&(s=c.child,s!==null)){c.child=null;do c=s.sibling,s.sibling=null,s=c;while(s!==null)}}function Dh(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var p=0;p<c.length;p++){var x=c[p];vr=x,gM(x,s)}mM(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)pM(s),s=s.sibling}function pM(s){switch(s.tag){case 0:case 11:case 15:Dh(s),s.flags&2048&&nl(9,s,s.return);break;case 3:Dh(s);break;case 12:Dh(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,bv(s)):Dh(s);break;default:Dh(s)}}function bv(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var p=0;p<c.length;p++){var x=c[p];vr=x,gM(x,s)}mM(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:nl(8,c,c.return),bv(c);break;case 22:p=c.stateNode,p._visibility&2&&(p._visibility&=-3,bv(c));break;default:bv(c)}s=s.sibling}}function gM(s,c){for(;vr!==null;){var p=vr;switch(p.tag){case 0:case 11:case 15:nl(8,p,c);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var x=p.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:yh(p.memoizedState.cache)}if(x=p.child,x!==null)x.return=p,vr=x;else e:for(p=s;vr!==null;){x=vr;var _=x.sibling,N=x.return;if(oM(x),x===p){vr=null;break e}if(_!==null){_.return=N,vr=_;break e}vr=N}}}var jW={getCacheForType:function(s){var c=Ar(Vn),p=c.data.get(s);return p===void 0&&(p=s(),c.data.set(s,p)),p},cacheSignal:function(){return Ar(Vn).controller.signal}},EW=typeof WeakMap=="function"?WeakMap:Map,qt=0,on=null,jt=null,Nt=0,Xt=0,Ni=null,rl=!1,fd=!1,H1=!1,Jo=0,Dn=0,il=0,Cc=0,q1=0,ki=0,hd=0,Ih=null,hi=null,V1=!1,wv=0,vM=0,Sv=1/0,jv=null,al=null,ar=0,ol=null,md=null,es=0,K1=0,Y1=null,yM=null,Lh=0,X1=null;function Ai(){return(qt&2)!==0&&Nt!==0?Nt&-Nt:P.T!==null?eS():sc()}function xM(){if(ki===0)if((Nt&536870912)===0||At){var s=Gr;Gr<<=1,(Gr&3932160)===0&&(Gr=262144),ki=s}else ki=536870912;return s=_i.current,s!==null&&(s.flags|=32),ki}function mi(s,c,p){(s===on&&(Xt===2||Xt===9)||s.cancelPendingCommit!==null)&&(pd(s,0),sl(s,Nt,ki,!1)),Yt(s,p),((qt&2)===0||s!==on)&&(s===on&&((qt&2)===0&&(Cc|=p),Dn===4&&sl(s,Nt,ki,!1)),lo(s))}function bM(s,c,p){if((qt&6)!==0)throw Error(r(327));var x=!p&&(c&127)===0&&(c&s.expiredLanes)===0||Mt(s,c),_=x?NW(s,c):W1(s,c,!0),N=x;do{if(_===0){fd&&!x&&sl(s,c,0,!1);break}else{if(p=s.current.alternate,N&&!_W(p)){_=W1(s,c,!1),N=!1;continue}if(_===2){if(N=c,s.errorRecoveryDisabledLanes&N)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){c=R;e:{var X=s;_=Ih;var J=X.current.memoizedState.isDehydrated;if(J&&(pd(X,R).flags|=256),R=W1(X,R,!1),R!==2){if(H1&&!J){X.errorRecoveryDisabledLanes|=N,Cc|=N,_=4;break e}N=hi,hi=_,N!==null&&(hi===null?hi=N:hi.push.apply(hi,N))}_=R}if(N=!1,_!==2)continue}}if(_===1){pd(s,0),sl(s,c,0,!0);break}e:{switch(x=s,N=_,N){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:sl(x,c,ki,!rl);break e;case 2:hi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(_=wv+300-Ut(),10<_)){if(sl(x,c,ki,!rl),Xe(x,0,!0)!==0)break e;es=c,x.timeoutHandle=QM(wM.bind(null,x,p,hi,jv,V1,c,ki,Cc,hd,rl,N,"Throttled",-0,0),_);break e}wM(x,p,hi,jv,V1,c,ki,Cc,hd,rl,N,null,-0,0)}}break}while(!0);lo(s)}function wM(s,c,p,x,_,N,R,X,J,de,ye,we,fe,me){if(s.timeoutHandle=-1,we=c.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$o},hM(c,N,we);var $e=(N&62914560)===N?wv-Ut():(N&4194048)===N?vM-Ut():0;if($e=cQ(we,$e),$e!==null){es=N,s.cancelPendingCommit=$e(AM.bind(null,s,c,N,p,x,_,R,X,J,ye,we,null,fe,me)),sl(s,N,R,!de);return}}AM(s,c,N,p,x,_,R,X,J)}function _W(s){for(var c=s;;){var p=c.tag;if((p===0||p===11||p===15)&&c.flags&16384&&(p=c.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var x=0;x<p.length;x++){var _=p[x],N=_.getSnapshot;_=_.value;try{if(!ji(N(),_))return!1}catch{return!1}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function sl(s,c,p,x){c&=~q1,c&=~Cc,s.suspendedLanes|=c,s.pingedLanes&=~c,x&&(s.warmLanes|=c),x=s.expirationTimes;for(var _=c;0<_;){var N=31-ft(_),R=1<<N;x[N]=-1,_&=~R}p!==0&&at(s,p,c)}function Ev(){return(qt&6)===0?(zh(0),!1):!0}function G1(){if(jt!==null){if(Xt===0)var s=jt.return;else s=jt,Ho=vc=null,d1(s),ad=null,bh=0,s=jt;for(;s!==null;)ZP(s.alternate,s),s=s.return;jt=null}}function pd(s,c){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,VW(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),es=0,G1(),on=s,jt=p=Fo(s.current,null),Nt=c,Xt=0,Ni=null,rl=!1,fd=Mt(s,c),H1=!1,hd=ki=q1=Cc=il=Dn=0,hi=Ih=null,V1=!1,(c&8)!==0&&(c|=c&32);var x=s.entangledLanes;if(x!==0)for(s=s.entanglements,x&=c;0<x;){var _=31-ft(x),N=1<<_;c|=s[_],x&=~N}return Jo=c,Vg(),p}function SM(s,c){gt=null,P.H=kh,c===id||c===Jg?(c=zT(),Xt=3):c===Jw?(c=zT(),Xt=4):Xt=c===N1?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Ni=c,jt===null&&(Dn=1,hv(s,ra(c,s.current)))}function jM(){var s=_i.current;return s===null?!0:(Nt&4194048)===Nt?sa===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===sa:!1}function EM(){var s=P.H;return P.H=kh,s===null?kh:s}function _M(){var s=P.A;return P.A=jW,s}function _v(){Dn=4,rl||(Nt&4194048)!==Nt&&_i.current!==null||(fd=!0),(il&134217727)===0&&(Cc&134217727)===0||on===null||sl(on,Nt,ki,!1)}function W1(s,c,p){var x=qt;qt|=2;var _=EM(),N=_M();(on!==s||Nt!==c)&&(jv=null,pd(s,c)),c=!1;var R=Dn;e:do try{if(Xt!==0&&jt!==null){var X=jt,J=Ni;switch(Xt){case 8:G1(),R=6;break e;case 3:case 2:case 9:case 6:_i.current===null&&(c=!0);var de=Xt;if(Xt=0,Ni=null,gd(s,X,J,de),p&&fd){R=0;break e}break;default:de=Xt,Xt=0,Ni=null,gd(s,X,J,de)}}CW(),R=Dn;break}catch(ye){SM(s,ye)}while(!0);return c&&s.shellSuspendCounter++,Ho=vc=null,qt=x,P.H=_,P.A=N,jt===null&&(on=null,Nt=0,Vg()),R}function CW(){for(;jt!==null;)CM(jt)}function NW(s,c){var p=qt;qt|=2;var x=EM(),_=_M();on!==s||Nt!==c?(jv=null,Sv=Ut()+500,pd(s,c)):fd=Mt(s,c);e:do try{if(Xt!==0&&jt!==null){c=jt;var N=Ni;t:switch(Xt){case 1:Xt=0,Ni=null,gd(s,c,N,1);break;case 2:case 9:if(IT(N)){Xt=0,Ni=null,NM(c);break}c=function(){Xt!==2&&Xt!==9||on!==s||(Xt=7),lo(s)},N.then(c,c);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:IT(N)?(Xt=0,Ni=null,NM(c)):(Xt=0,Ni=null,gd(s,c,N,7));break;case 5:var R=null;switch(jt.tag){case 26:R=jt.memoizedState;case 5:case 27:var X=jt;if(R?fR(R):X.stateNode.complete){Xt=0,Ni=null;var J=X.sibling;if(J!==null)jt=J;else{var de=X.return;de!==null?(jt=de,Cv(de)):jt=null}break t}}Xt=0,Ni=null,gd(s,c,N,5);break;case 6:Xt=0,Ni=null,gd(s,c,N,6);break;case 8:G1(),Dn=6;break e;default:throw Error(r(462))}}kW();break}catch(ye){SM(s,ye)}while(!0);return Ho=vc=null,P.H=x,P.A=_,qt=p,jt!==null?0:(on=null,Nt=0,Vg(),Dn)}function kW(){for(;jt!==null&&!Ct();)CM(jt)}function CM(s){var c=WP(s.alternate,s,Jo);s.memoizedProps=s.pendingProps,c===null?Cv(s):jt=c}function NM(s){var c=s,p=c.alternate;switch(c.tag){case 15:case 0:c=qP(p,c,c.pendingProps,c.type,void 0,Nt);break;case 11:c=qP(p,c,c.pendingProps,c.type.render,c.ref,Nt);break;case 5:d1(c);default:ZP(p,c),c=jt=_T(c,Jo),c=WP(p,c,Jo)}s.memoizedProps=s.pendingProps,c===null?Cv(s):jt=c}function gd(s,c,p,x){Ho=vc=null,d1(c),ad=null,bh=0;var _=c.return;try{if(gW(s,_,c,p,Nt)){Dn=1,hv(s,ra(p,s.current)),jt=null;return}}catch(N){if(_!==null)throw jt=_,N;Dn=1,hv(s,ra(p,s.current)),jt=null;return}c.flags&32768?(At||x===1?s=!0:fd||(Nt&536870912)!==0?s=!1:(rl=s=!0,(x===2||x===9||x===3||x===6)&&(x=_i.current,x!==null&&x.tag===13&&(x.flags|=16384))),kM(c,s)):Cv(c)}function Cv(s){var c=s;do{if((c.flags&32768)!==0){kM(c,rl);return}s=c.return;var p=xW(c.alternate,c,Jo);if(p!==null){jt=p;return}if(c=c.sibling,c!==null){jt=c;return}jt=c=s}while(c!==null);Dn===0&&(Dn=5)}function kM(s,c){do{var p=bW(s.alternate,s);if(p!==null){p.flags&=32767,jt=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!c&&(s=s.sibling,s!==null)){jt=s;return}jt=s=p}while(s!==null);Dn=6,jt=null}function AM(s,c,p,x,_,N,R,X,J){s.cancelPendingCommit=null;do Nv();while(ar!==0);if((qt&6)!==0)throw Error(r(327));if(c!==null){if(c===s.current)throw Error(r(177));if(N=c.lanes|c.childLanes,N|=zw,ge(s,p,N,R,X,J),s===on&&(jt=on=null,Nt=0),md=c,ol=s,es=p,K1=N,Y1=_,yM=x,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,PW(ze,function(){return RM(),null})):(s.callbackNode=null,s.callbackPriority=0),x=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||x){x=P.T,P.T=null,_=H.p,H.p=2,R=qt,qt|=4;try{wW(s,c,p)}finally{qt=R,H.p=_,P.T=x}}ar=1,OM(),TM(),PM()}}function OM(){if(ar===1){ar=0;var s=ol,c=md,p=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||p){p=P.T,P.T=null;var x=H.p;H.p=2;var _=qt;qt|=4;try{uM(c,s);var N=lS,R=gT(s.containerInfo),X=N.focusedElem,J=N.selectionRange;if(R!==X&&X&&X.ownerDocument&&pT(X.ownerDocument.documentElement,X)){if(J!==null&&Mw(X)){var de=J.start,ye=J.end;if(ye===void 0&&(ye=de),"selectionStart"in X)X.selectionStart=de,X.selectionEnd=Math.min(ye,X.value.length);else{var we=X.ownerDocument||document,fe=we&&we.defaultView||window;if(fe.getSelection){var me=fe.getSelection(),$e=X.textContent.length,nt=Math.min(J.start,$e),Zt=J.end===void 0?nt:Math.min(J.end,$e);!me.extend&&nt>Zt&&(R=Zt,Zt=nt,nt=R);var oe=mT(X,nt),ne=mT(X,Zt);if(oe&&ne&&(me.rangeCount!==1||me.anchorNode!==oe.node||me.anchorOffset!==oe.offset||me.focusNode!==ne.node||me.focusOffset!==ne.offset)){var ue=we.createRange();ue.setStart(oe.node,oe.offset),me.removeAllRanges(),nt>Zt?(me.addRange(ue),me.extend(ne.node,ne.offset)):(ue.setEnd(ne.node,ne.offset),me.addRange(ue))}}}}for(we=[],me=X;me=me.parentNode;)me.nodeType===1&&we.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof X.focus=="function"&&X.focus(),X=0;X<we.length;X++){var be=we[X];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}$v=!!sS,lS=sS=null}finally{qt=_,H.p=x,P.T=p}}s.current=c,ar=2}}function TM(){if(ar===2){ar=0;var s=ol,c=md,p=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||p){p=P.T,P.T=null;var x=H.p;H.p=2;var _=qt;qt|=4;try{aM(s,c.alternate,c)}finally{qt=_,H.p=x,P.T=p}}ar=3}}function PM(){if(ar===4||ar===3){ar=0,mn();var s=ol,c=md,p=es,x=yM;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?ar=5:(ar=0,md=ol=null,MM(s,s.pendingLanes));var _=s.pendingLanes;if(_===0&&(al=null),rr(p),c=c.stateNode,ct&&typeof ct.onCommitFiberRoot=="function")try{ct.onCommitFiberRoot(je,c,void 0,(c.current.flags&128)===128)}catch{}if(x!==null){c=P.T,_=H.p,H.p=2,P.T=null;try{for(var N=s.onRecoverableError,R=0;R<x.length;R++){var X=x[R];N(X.value,{componentStack:X.stack})}}finally{P.T=c,H.p=_}}(es&3)!==0&&Nv(),lo(s),_=s.pendingLanes,(p&261930)!==0&&(_&42)!==0?s===X1?Lh++:(Lh=0,X1=s):Lh=0,zh(0)}}function MM(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,yh(c)))}function Nv(){return OM(),TM(),PM(),RM()}function RM(){if(ar!==5)return!1;var s=ol,c=K1;K1=0;var p=rr(es),x=P.T,_=H.p;try{H.p=32>p?32:p,P.T=null,p=Y1,Y1=null;var N=ol,R=es;if(ar=0,md=ol=null,es=0,(qt&6)!==0)throw Error(r(331));var X=qt;if(qt|=4,pM(N.current),fM(N,N.current,R,p),qt=X,zh(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(je,N)}catch{}return!0}finally{H.p=_,P.T=x,MM(s,c)}}function DM(s,c,p){c=ra(p,c),c=C1(s.stateNode,c,2),s=Js(s,c,2),s!==null&&(Yt(s,2),lo(s))}function Gt(s,c,p){if(s.tag===3)DM(s,s,p);else for(;c!==null;){if(c.tag===3){DM(c,s,p);break}else if(c.tag===1){var x=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(al===null||!al.has(x))){s=ra(p,s),p=IP(2),x=Js(c,p,2),x!==null&&(LP(p,x,c,s),Yt(x,2),lo(x));break}}c=c.return}}function Q1(s,c,p){var x=s.pingCache;if(x===null){x=s.pingCache=new EW;var _=new Set;x.set(c,_)}else _=x.get(c),_===void 0&&(_=new Set,x.set(c,_));_.has(p)||(H1=!0,_.add(p),s=AW.bind(null,s,c,p),c.then(s,s))}function AW(s,c,p){var x=s.pingCache;x!==null&&x.delete(c),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,on===s&&(Nt&p)===p&&(Dn===4||Dn===3&&(Nt&62914560)===Nt&&300>Ut()-wv?(qt&2)===0&&pd(s,0):q1|=p,hd===Nt&&(hd=0)),lo(s)}function IM(s,c){c===0&&(c=Tn()),s=mc(s,c),s!==null&&(Yt(s,c),lo(s))}function OW(s){var c=s.memoizedState,p=0;c!==null&&(p=c.retryLane),IM(s,p)}function TW(s,c){var p=0;switch(s.tag){case 31:case 13:var x=s.stateNode,_=s.memoizedState;_!==null&&(p=_.retryLane);break;case 19:x=s.stateNode;break;case 22:x=s.stateNode._retryCache;break;default:throw Error(r(314))}x!==null&&x.delete(c),IM(s,p)}function PW(s,c){return xt(s,c)}var kv=null,vd=null,Z1=!1,Av=!1,J1=!1,ll=0;function lo(s){s!==vd&&s.next===null&&(vd===null?kv=vd=s:vd=vd.next=s),Av=!0,Z1||(Z1=!0,RW())}function zh(s,c){if(!J1&&Av){J1=!0;do for(var p=!1,x=kv;x!==null;){if(s!==0){var _=x.pendingLanes;if(_===0)var N=0;else{var R=x.suspendedLanes,X=x.pingedLanes;N=(1<<31-ft(42|s)+1)-1,N&=_&~(R&~X),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(p=!0,BM(x,N))}else N=Nt,N=Xe(x,x===on?N:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(N&3)===0||Mt(x,N)||(p=!0,BM(x,N));x=x.next}while(p);J1=!1}}function MW(){LM()}function LM(){Av=Z1=!1;var s=0;ll!==0&&qW()&&(s=ll);for(var c=Ut(),p=null,x=kv;x!==null;){var _=x.next,N=zM(x,c);N===0?(x.next=null,p===null?kv=_:p.next=_,_===null&&(vd=p)):(p=x,(s!==0||(N&3)!==0)&&(Av=!0)),x=_}ar!==0&&ar!==5||zh(s),ll!==0&&(ll=0)}function zM(s,c){for(var p=s.suspendedLanes,x=s.pingedLanes,_=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var R=31-ft(N),X=1<<R,J=_[R];J===-1?((X&p)===0||(X&x)!==0)&&(_[R]=pn(X,c)):J<=c&&(s.expiredLanes|=X),N&=~X}if(c=on,p=Nt,p=Xe(s,s===c?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x=s.callbackNode,p===0||s===c&&(Xt===2||Xt===9)||s.cancelPendingCommit!==null)return x!==null&&x!==null&&dt(x),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||Mt(s,p)){if(c=p&-p,c===s.callbackPriority)return c;switch(x!==null&&dt(x),rr(p)){case 2:case 8:p=xe;break;case 32:p=ze;break;case 268435456:p=st;break;default:p=ze}return x=$M.bind(null,s),p=xt(p,x),s.callbackPriority=c,s.callbackNode=p,c}return x!==null&&x!==null&&dt(x),s.callbackPriority=2,s.callbackNode=null,2}function $M(s,c){if(ar!==0&&ar!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(Nv()&&s.callbackNode!==p)return null;var x=Nt;return x=Xe(s,s===on?x:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x===0?null:(bM(s,x,c),zM(s,Ut()),s.callbackNode!=null&&s.callbackNode===p?$M.bind(null,s):null)}function BM(s,c){if(Nv())return null;bM(s,c,!0)}function RW(){KW(function(){(qt&6)!==0?xt(ce,MW):LM()})}function eS(){if(ll===0){var s=nd;s===0&&(s=Xr,Xr<<=1,(Xr&261888)===0&&(Xr=256)),ll=s}return ll}function FM(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Lg(""+s)}function UM(s,c){var p=c.ownerDocument.createElement("input");return p.name=c.name,p.value=c.value,s.id&&p.setAttribute("form",s.id),c.parentNode.insertBefore(p,c),s=new FormData(s),p.parentNode.removeChild(p),s}function DW(s,c,p,x,_){if(c==="submit"&&p&&p.stateNode===_){var N=FM((_[ir]||null).action),R=x.submitter;R&&(c=(c=R[ir]||null)?FM(c.formAction):R.getAttribute("formAction"),c!==null&&(N=c,R=null));var X=new Fg("action","action",null,x,_);s.push({event:X,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(ll!==0){var J=R?UM(_,R):new FormData(_);b1(p,{pending:!0,data:J,method:_.method,action:N},null,J)}}else typeof N=="function"&&(X.preventDefault(),J=R?UM(_,R):new FormData(_),b1(p,{pending:!0,data:J,method:_.method,action:N},N,J))},currentTarget:_}]})}}for(var tS=0;tS<Lw.length;tS++){var nS=Lw[tS],IW=nS.toLowerCase(),LW=nS[0].toUpperCase()+nS.slice(1);Ia(IW,"on"+LW)}Ia(xT,"onAnimationEnd"),Ia(bT,"onAnimationIteration"),Ia(wT,"onAnimationStart"),Ia("dblclick","onDoubleClick"),Ia("focusin","onFocus"),Ia("focusout","onBlur"),Ia(JG,"onTransitionRun"),Ia(eW,"onTransitionStart"),Ia(tW,"onTransitionCancel"),Ia(ST,"onTransitionEnd"),qs("onMouseEnter",["mouseout","mouseover"]),qs("onMouseLeave",["mouseout","mouseover"]),qs("onPointerEnter",["pointerout","pointerover"]),qs("onPointerLeave",["pointerout","pointerover"]),Lo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Lo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Lo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Lo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Lo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Lo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $h="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(" "),zW=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($h));function HM(s,c){c=(c&4)!==0;for(var p=0;p<s.length;p++){var x=s[p],_=x.event;x=x.listeners;e:{var N=void 0;if(c)for(var R=x.length-1;0<=R;R--){var X=x[R],J=X.instance,de=X.currentTarget;if(X=X.listener,J!==N&&_.isPropagationStopped())break e;N=X,_.currentTarget=de;try{N(_)}catch(ye){qg(ye)}_.currentTarget=null,N=J}else for(R=0;R<x.length;R++){if(X=x[R],J=X.instance,de=X.currentTarget,X=X.listener,J!==N&&_.isPropagationStopped())break e;N=X,_.currentTarget=de;try{N(_)}catch(ye){qg(ye)}_.currentTarget=null,N=J}}}}function Et(s,c){var p=c[pt];p===void 0&&(p=c[pt]=new Set);var x=s+"__bubble";p.has(x)||(qM(c,s,2,!1),p.add(x))}function rS(s,c,p){var x=0;c&&(x|=4),qM(p,s,x,c)}var Ov="_reactListening"+Math.random().toString(36).slice(2);function iS(s){if(!s[Ov]){s[Ov]=!0,Tg.forEach(function(p){p!=="selectionchange"&&(zW.has(p)||rS(p,!1,s),rS(p,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[Ov]||(c[Ov]=!0,rS("selectionchange",!1,c))}}function qM(s,c,p,x){switch(xR(c)){case 2:var _=fQ;break;case 8:_=hQ;break;default:_=xS}p=_.bind(null,c,p,s),_=void 0,!Ew||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(_=!0),x?_!==void 0?s.addEventListener(c,p,{capture:!0,passive:_}):s.addEventListener(c,p,!0):_!==void 0?s.addEventListener(c,p,{passive:_}):s.addEventListener(c,p,!1)}function aS(s,c,p,x,_){var N=x;if((c&1)===0&&(c&2)===0&&x!==null)e:for(;;){if(x===null)return;var R=x.tag;if(R===3||R===4){var X=x.stateNode.containerInfo;if(X===_)break;if(R===4)for(R=x.return;R!==null;){var J=R.tag;if((J===3||J===4)&&R.stateNode.containerInfo===_)return;R=R.return}for(;X!==null;){if(R=Bs(X),R===null)return;if(J=R.tag,J===5||J===6||J===26||J===27){x=N=R;continue e}X=X.parentNode}}x=x.return}G2(function(){var de=N,ye=Sw(p),we=[];e:{var fe=jT.get(s);if(fe!==void 0){var me=Fg,$e=s;switch(s){case"keypress":if($g(p)===0)break e;case"keydown":case"keyup":me=TG;break;case"focusin":$e="focus",me=kw;break;case"focusout":$e="blur",me=kw;break;case"beforeblur":case"afterblur":me=kw;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Z2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=xG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=RG;break;case xT:case bT:case wT:me=SG;break;case ST:me=IG;break;case"scroll":case"scrollend":me=vG;break;case"wheel":me=zG;break;case"copy":case"cut":case"paste":me=EG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=eT;break;case"toggle":case"beforetoggle":me=BG}var nt=(c&4)!==0,Zt=!nt&&(s==="scroll"||s==="scrollend"),oe=nt?fe!==null?fe+"Capture":null:fe;nt=[];for(var ne=de,ue;ne!==null;){var be=ne;if(ue=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ue===null||oe===null||(be=sh(ne,oe),be!=null&&nt.push(Bh(ne,be,ue))),Zt)break;ne=ne.return}0<nt.length&&(fe=new me(fe,$e,null,p,ye),we.push({event:fe,listeners:nt}))}}if((c&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",fe&&p!==ww&&($e=p.relatedTarget||p.fromElement)&&(Bs($e)||$e[he]))break e;if((me||fe)&&(fe=ye.window===ye?ye:(fe=ye.ownerDocument)?fe.defaultView||fe.parentWindow:window,me?($e=p.relatedTarget||p.toElement,me=de,$e=$e?Bs($e):null,$e!==null&&(Zt=a($e),nt=$e.tag,$e!==Zt||nt!==5&&nt!==27&&nt!==6)&&($e=null)):(me=null,$e=de),me!==$e)){if(nt=Z2,be="onMouseLeave",oe="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(nt=eT,be="onPointerLeave",oe="onPointerEnter",ne="pointer"),Zt=me==null?fe:Us(me),ue=$e==null?fe:Us($e),fe=new nt(be,ne+"leave",me,p,ye),fe.target=Zt,fe.relatedTarget=ue,be=null,Bs(ye)===de&&(nt=new nt(oe,ne+"enter",$e,p,ye),nt.target=ue,nt.relatedTarget=Zt,be=nt),Zt=be,me&&$e)t:{for(nt=$W,oe=me,ne=$e,ue=0,be=oe;be;be=nt(be))ue++;be=0;for(var Ge=ne;Ge;Ge=nt(Ge))be++;for(;0<ue-be;)oe=nt(oe),ue--;for(;0<be-ue;)ne=nt(ne),be--;for(;ue--;){if(oe===ne||ne!==null&&oe===ne.alternate){nt=oe;break t}oe=nt(oe),ne=nt(ne)}nt=null}else nt=null;me!==null&&VM(we,fe,me,nt,!1),$e!==null&&Zt!==null&&VM(we,Zt,$e,nt,!0)}}e:{if(fe=de?Us(de):window,me=fe.nodeName&&fe.nodeName.toLowerCase(),me==="select"||me==="input"&&fe.type==="file")var zt=lT;else if(oT(fe))if(cT)zt=WG;else{zt=XG;var Ve=YG}else me=fe.nodeName,!me||me.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&bw(de.elementType)&&(zt=lT):zt=GG;if(zt&&(zt=zt(s,de))){sT(we,zt,p,ye);break e}Ve&&Ve(s,fe,de),s==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&oh(fe,"number",fe.value)}switch(Ve=de?Us(de):window,s){case"focusin":(oT(Ve)||Ve.contentEditable==="true")&&(Xu=Ve,Rw=de,ph=null);break;case"focusout":ph=Rw=Xu=null;break;case"mousedown":Dw=!0;break;case"contextmenu":case"mouseup":case"dragend":Dw=!1,vT(we,p,ye);break;case"selectionchange":if(ZG)break;case"keydown":case"keyup":vT(we,p,ye)}var vt;if(Ow)e:{switch(s){case"compositionstart":var kt="onCompositionStart";break e;case"compositionend":kt="onCompositionEnd";break e;case"compositionupdate":kt="onCompositionUpdate";break e}kt=void 0}else Yu?iT(s,p)&&(kt="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(kt="onCompositionStart");kt&&(tT&&p.locale!=="ko"&&(Yu||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Yu&&(vt=W2()):(Ks=ye,_w="value"in Ks?Ks.value:Ks.textContent,Yu=!0)),Ve=Tv(de,kt),0<Ve.length&&(kt=new J2(kt,s,null,p,ye),we.push({event:kt,listeners:Ve}),vt?kt.data=vt:(vt=aT(p),vt!==null&&(kt.data=vt)))),(vt=UG?HG(s,p):qG(s,p))&&(kt=Tv(de,"onBeforeInput"),0<kt.length&&(Ve=new J2("onBeforeInput","beforeinput",null,p,ye),we.push({event:Ve,listeners:kt}),Ve.data=vt)),DW(we,s,de,p,ye)}HM(we,c)})}function Bh(s,c,p){return{instance:s,listener:c,currentTarget:p}}function Tv(s,c){for(var p=c+"Capture",x=[];s!==null;){var _=s,N=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||N===null||(_=sh(s,p),_!=null&&x.unshift(Bh(s,_,N)),_=sh(s,c),_!=null&&x.push(Bh(s,_,N))),s.tag===3)return x;s=s.return}return[]}function $W(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function VM(s,c,p,x,_){for(var N=c._reactName,R=[];p!==null&&p!==x;){var X=p,J=X.alternate,de=X.stateNode;if(X=X.tag,J!==null&&J===x)break;X!==5&&X!==26&&X!==27||de===null||(J=de,_?(de=sh(p,N),de!=null&&R.unshift(Bh(p,de,J))):_||(de=sh(p,N),de!=null&&R.push(Bh(p,de,J)))),p=p.return}R.length!==0&&s.push({event:c,listeners:R})}var BW=/\r\n?/g,FW=/\u0000|\uFFFD/g;function KM(s){return(typeof s=="string"?s:""+s).replace(BW,`
`).replace(FW,"")}function YM(s,c){return c=KM(c),KM(s)===c}function Qt(s,c,p,x,_,N){switch(p){case"children":typeof x=="string"?c==="body"||c==="textarea"&&x===""||qu(s,x):(typeof x=="number"||typeof x=="bigint")&&c!=="body"&&qu(s,""+x);break;case"className":Hu(s,"class",x);break;case"tabIndex":Hu(s,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":Hu(s,p,x);break;case"style":Y2(s,x,N);break;case"data":if(c!=="object"){Hu(s,"data",x);break}case"src":case"href":if(x===""&&(c!=="a"||p!=="href")){s.removeAttribute(p);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Lg(""+x),s.setAttribute(p,x);break;case"action":case"formAction":if(typeof x=="function"){s.setAttribute(p,"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 N=="function"&&(p==="formAction"?(c!=="input"&&Qt(s,c,"name",_.name,_,null),Qt(s,c,"formEncType",_.formEncType,_,null),Qt(s,c,"formMethod",_.formMethod,_,null),Qt(s,c,"formTarget",_.formTarget,_,null)):(Qt(s,c,"encType",_.encType,_,null),Qt(s,c,"method",_.method,_,null),Qt(s,c,"target",_.target,_,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Lg(""+x),s.setAttribute(p,x);break;case"onClick":x!=null&&(s.onclick=$o);break;case"onScroll":x!=null&&Et("scroll",s);break;case"onScrollEnd":x!=null&&Et("scrollend",s);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"multiple":s.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":s.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){s.removeAttribute("xlink:href");break}p=Lg(""+x),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,""+x):s.removeAttribute(p);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":x&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,""):s.removeAttribute(p);break;case"capture":case"download":x===!0?s.setAttribute(p,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,x):s.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?s.setAttribute(p,x):s.removeAttribute(p);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?s.removeAttribute(p):s.setAttribute(p,x);break;case"popover":Et("beforetoggle",s),Et("toggle",s),Uu(s,"popover",x);break;case"xlinkActuate":Da(s,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":Da(s,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":Da(s,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":Da(s,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":Da(s,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":Da(s,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":Da(s,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":Da(s,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":Da(s,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":Uu(s,"is",x);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=pG.get(p)||p,Uu(s,p,x))}}function oS(s,c,p,x,_,N){switch(p){case"style":Y2(s,x,N);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"children":typeof x=="string"?qu(s,x):(typeof x=="number"||typeof x=="bigint")&&qu(s,""+x);break;case"onScroll":x!=null&&Et("scroll",s);break;case"onScrollEnd":x!=null&&Et("scrollend",s);break;case"onClick":x!=null&&(s.onclick=$o);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pg.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(_=p.endsWith("Capture"),c=p.slice(2,_?p.length-7:void 0),N=s[ir]||null,N=N!=null?N[p]:null,typeof N=="function"&&s.removeEventListener(c,N,_),typeof x=="function")){typeof N!="function"&&N!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(c,x,_);break e}p in s?s[p]=x:x===!0?s.setAttribute(p,""):Uu(s,p,x)}}}function Tr(s,c,p){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",s),Et("load",s);var x=!1,_=!1,N;for(N in p)if(p.hasOwnProperty(N)){var R=p[N];if(R!=null)switch(N){case"src":x=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Qt(s,c,N,R,p,null)}}_&&Qt(s,c,"srcSet",p.srcSet,p,null),x&&Qt(s,c,"src",p.src,p,null);return;case"input":Et("invalid",s);var X=N=R=_=null,J=null,de=null;for(x in p)if(p.hasOwnProperty(x)){var ye=p[x];if(ye!=null)switch(x){case"name":_=ye;break;case"type":R=ye;break;case"checked":J=ye;break;case"defaultChecked":de=ye;break;case"value":N=ye;break;case"defaultValue":X=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,c));break;default:Qt(s,c,x,ye,p,null)}}Ig(s,N,X,J,de,R,_,!1);return;case"select":Et("invalid",s),x=R=N=null;for(_ in p)if(p.hasOwnProperty(_)&&(X=p[_],X!=null))switch(_){case"value":N=X;break;case"defaultValue":R=X;break;case"multiple":x=X;default:Qt(s,c,_,X,p,null)}c=N,p=R,s.multiple=!!x,c!=null?zo(s,!!x,c,!1):p!=null&&zo(s,!!x,p,!0);return;case"textarea":Et("invalid",s),N=_=x=null;for(R in p)if(p.hasOwnProperty(R)&&(X=p[R],X!=null))switch(R){case"value":x=X;break;case"defaultValue":_=X;break;case"children":N=X;break;case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(91));break;default:Qt(s,c,R,X,p,null)}V2(s,x,_,N);return;case"option":for(J in p)if(p.hasOwnProperty(J)&&(x=p[J],x!=null))switch(J){case"selected":s.selected=x&&typeof x!="function"&&typeof x!="symbol";break;default:Qt(s,c,J,x,p,null)}return;case"dialog":Et("beforetoggle",s),Et("toggle",s),Et("cancel",s),Et("close",s);break;case"iframe":case"object":Et("load",s);break;case"video":case"audio":for(x=0;x<$h.length;x++)Et($h[x],s);break;case"image":Et("error",s),Et("load",s);break;case"details":Et("toggle",s);break;case"embed":case"source":case"link":Et("error",s),Et("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in p)if(p.hasOwnProperty(de)&&(x=p[de],x!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Qt(s,c,de,x,p,null)}return;default:if(bw(c)){for(ye in p)p.hasOwnProperty(ye)&&(x=p[ye],x!==void 0&&oS(s,c,ye,x,p,void 0));return}}for(X in p)p.hasOwnProperty(X)&&(x=p[X],x!=null&&Qt(s,c,X,x,p,null))}function UW(s,c,p,x){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,N=null,R=null,X=null,J=null,de=null,ye=null;for(me in p){var we=p[me];if(p.hasOwnProperty(me)&&we!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":J=we;default:x.hasOwnProperty(me)||Qt(s,c,me,null,x,we)}}for(var fe in x){var me=x[fe];if(we=p[fe],x.hasOwnProperty(fe)&&(me!=null||we!=null))switch(fe){case"type":N=me;break;case"name":_=me;break;case"checked":de=me;break;case"defaultChecked":ye=me;break;case"value":R=me;break;case"defaultValue":X=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,c));break;default:me!==we&&Qt(s,c,fe,me,x,we)}}uc(s,R,X,J,de,ye,N,_);return;case"select":me=R=X=fe=null;for(N in p)if(J=p[N],p.hasOwnProperty(N)&&J!=null)switch(N){case"value":break;case"multiple":me=J;default:x.hasOwnProperty(N)||Qt(s,c,N,null,x,J)}for(_ in x)if(N=x[_],J=p[_],x.hasOwnProperty(_)&&(N!=null||J!=null))switch(_){case"value":fe=N;break;case"defaultValue":X=N;break;case"multiple":R=N;default:N!==J&&Qt(s,c,_,N,x,J)}c=X,p=R,x=me,fe!=null?zo(s,!!p,fe,!1):!!x!=!!p&&(c!=null?zo(s,!!p,c,!0):zo(s,!!p,p?[]:"",!1));return;case"textarea":me=fe=null;for(X in p)if(_=p[X],p.hasOwnProperty(X)&&_!=null&&!x.hasOwnProperty(X))switch(X){case"value":break;case"children":break;default:Qt(s,c,X,null,x,_)}for(R in x)if(_=x[R],N=p[R],x.hasOwnProperty(R)&&(_!=null||N!=null))switch(R){case"value":fe=_;break;case"defaultValue":me=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==N&&Qt(s,c,R,_,x,N)}q2(s,fe,me);return;case"option":for(var $e in p)if(fe=p[$e],p.hasOwnProperty($e)&&fe!=null&&!x.hasOwnProperty($e))switch($e){case"selected":s.selected=!1;break;default:Qt(s,c,$e,null,x,fe)}for(J in x)if(fe=x[J],me=p[J],x.hasOwnProperty(J)&&fe!==me&&(fe!=null||me!=null))switch(J){case"selected":s.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Qt(s,c,J,fe,x,me)}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 nt in p)fe=p[nt],p.hasOwnProperty(nt)&&fe!=null&&!x.hasOwnProperty(nt)&&Qt(s,c,nt,null,x,fe);for(de in x)if(fe=x[de],me=p[de],x.hasOwnProperty(de)&&fe!==me&&(fe!=null||me!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,c));break;default:Qt(s,c,de,fe,x,me)}return;default:if(bw(c)){for(var Zt in p)fe=p[Zt],p.hasOwnProperty(Zt)&&fe!==void 0&&!x.hasOwnProperty(Zt)&&oS(s,c,Zt,void 0,x,fe);for(ye in x)fe=x[ye],me=p[ye],!x.hasOwnProperty(ye)||fe===me||fe===void 0&&me===void 0||oS(s,c,ye,fe,x,me);return}}for(var oe in p)fe=p[oe],p.hasOwnProperty(oe)&&fe!=null&&!x.hasOwnProperty(oe)&&Qt(s,c,oe,null,x,fe);for(we in x)fe=x[we],me=p[we],!x.hasOwnProperty(we)||fe===me||fe==null&&me==null||Qt(s,c,we,fe,x,me)}function XM(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function HW(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,p=performance.getEntriesByType("resource"),x=0;x<p.length;x++){var _=p[x],N=_.transferSize,R=_.initiatorType,X=_.duration;if(N&&X&&XM(R)){for(R=0,X=_.responseEnd,x+=1;x<p.length;x++){var J=p[x],de=J.startTime;if(de>X)break;var ye=J.transferSize,we=J.initiatorType;ye&&XM(we)&&(J=J.responseEnd,R+=ye*(J<X?1:(X-de)/(J-de)))}if(--x,c+=8*(N+R)/(_.duration/1e3),s++,10<s)break}}if(0<s)return c/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var sS=null,lS=null;function Pv(s){return s.nodeType===9?s:s.ownerDocument}function GM(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function WM(s,c){if(s===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&c==="foreignObject"?0:s}function cS(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var uS=null;function qW(){var s=window.event;return s&&s.type==="popstate"?s===uS?!1:(uS=s,!0):(uS=null,!1)}var QM=typeof setTimeout=="function"?setTimeout:void 0,VW=typeof clearTimeout=="function"?clearTimeout:void 0,ZM=typeof Promise=="function"?Promise:void 0,KW=typeof queueMicrotask=="function"?queueMicrotask:typeof ZM<"u"?function(s){return ZM.resolve(null).then(s).catch(YW)}:QM;function YW(s){setTimeout(function(){throw s})}function cl(s){return s==="head"}function JM(s,c){var p=c,x=0;do{var _=p.nextSibling;if(s.removeChild(p),_&&_.nodeType===8)if(p=_.data,p==="/$"||p==="/&"){if(x===0){s.removeChild(_),wd(c);return}x--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")x++;else if(p==="html")Fh(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,Fh(p);for(var N=p.firstChild;N;){var R=N.nextSibling,X=N.nodeName;N[Ra]||X==="SCRIPT"||X==="STYLE"||X==="LINK"&&N.rel.toLowerCase()==="stylesheet"||p.removeChild(N),N=R}}else p==="body"&&Fh(s.ownerDocument.body);p=_}while(p);wd(c)}function eR(s,c){var p=s;s=0;do{var x=p.nextSibling;if(p.nodeType===1?c?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(c?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),x&&x.nodeType===8)if(p=x.data,p==="/$"){if(s===0)break;s--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||s++;p=x}while(p)}function dS(s){var c=s.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var p=c;switch(c=c.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":dS(p),ih(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function XW(s,c,p,x){for(;s.nodeType===1;){var _=p;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!x&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(x){if(!s[Ra])switch(c){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==_.rel||s.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||s.getAttribute("title")!==(_.title==null?null:_.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(_.src==null?null:_.src)||s.getAttribute("type")!==(_.type==null?null:_.type)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var N=_.name==null?null:""+_.name;if(_.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=la(s.nextSibling),s===null)break}return null}function GW(s,c,p){if(c==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=la(s.nextSibling),s===null))return null;return s}function tR(s,c){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=la(s.nextSibling),s===null))return null;return s}function fS(s){return s.data==="$?"||s.data==="$~"}function hS(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function WW(s,c){var p=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||p.readyState!=="loading")c();else{var x=function(){c(),p.removeEventListener("DOMContentLoaded",x)};p.addEventListener("DOMContentLoaded",x),s._reactRetry=x}}function la(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return s}var mS=null;function nR(s){s=s.nextSibling;for(var c=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(c===0)return la(s.nextSibling);c--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||c++}s=s.nextSibling}return null}function rR(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var p=s.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(c===0)return s;c--}else p!=="/$"&&p!=="/&"||c++}s=s.previousSibling}return null}function iR(s,c,p){switch(c=Pv(p),s){case"html":if(s=c.documentElement,!s)throw Error(r(452));return s;case"head":if(s=c.head,!s)throw Error(r(453));return s;case"body":if(s=c.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Fh(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);ih(s)}var ca=new Map,aR=new Set;function Mv(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ts=H.d;H.d={f:QW,r:ZW,D:JW,C:eQ,L:tQ,m:nQ,X:iQ,S:rQ,M:aQ};function QW(){var s=ts.f(),c=Ev();return s||c}function ZW(s){var c=Fs(s);c!==null&&c.tag===5&&c.type==="form"?SP(c):ts.r(s)}var yd=typeof document>"u"?null:document;function oR(s,c,p){var x=yd;if(x&&typeof c=="string"&&c){var _=li(c);_='link[rel="'+s+'"][href="'+_+'"]',typeof p=="string"&&(_+='[crossorigin="'+p+'"]'),aR.has(_)||(aR.add(_),s={rel:s,crossOrigin:p,href:c},x.querySelector(_)===null&&(c=x.createElement("link"),Tr(c,"link",s),qn(c),x.head.appendChild(c)))}}function JW(s){ts.D(s),oR("dns-prefetch",s,null)}function eQ(s,c){ts.C(s,c),oR("preconnect",s,c)}function tQ(s,c,p){ts.L(s,c,p);var x=yd;if(x&&s&&c){var _='link[rel="preload"][as="'+li(c)+'"]';c==="image"&&p&&p.imageSrcSet?(_+='[imagesrcset="'+li(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(_+='[imagesizes="'+li(p.imageSizes)+'"]')):_+='[href="'+li(s)+'"]';var N=_;switch(c){case"style":N=xd(s);break;case"script":N=bd(s)}ca.has(N)||(s=h({rel:"preload",href:c==="image"&&p&&p.imageSrcSet?void 0:s,as:c},p),ca.set(N,s),x.querySelector(_)!==null||c==="style"&&x.querySelector(Uh(N))||c==="script"&&x.querySelector(Hh(N))||(c=x.createElement("link"),Tr(c,"link",s),qn(c),x.head.appendChild(c)))}}function nQ(s,c){ts.m(s,c);var p=yd;if(p&&s){var x=c&&typeof c.as=="string"?c.as:"script",_='link[rel="modulepreload"][as="'+li(x)+'"][href="'+li(s)+'"]',N=_;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=bd(s)}if(!ca.has(N)&&(s=h({rel:"modulepreload",href:s},c),ca.set(N,s),p.querySelector(_)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Hh(N)))return}x=p.createElement("link"),Tr(x,"link",s),qn(x),p.head.appendChild(x)}}}function rQ(s,c,p){ts.S(s,c,p);var x=yd;if(x&&s){var _=Hs(x).hoistableStyles,N=xd(s);c=c||"default";var R=_.get(N);if(!R){var X={loading:0,preload:null};if(R=x.querySelector(Uh(N)))X.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":c},p),(p=ca.get(N))&&pS(s,p);var J=R=x.createElement("link");qn(J),Tr(J,"link",s),J._p=new Promise(function(de,ye){J.onload=de,J.onerror=ye}),J.addEventListener("load",function(){X.loading|=1}),J.addEventListener("error",function(){X.loading|=2}),X.loading|=4,Rv(R,c,x)}R={type:"stylesheet",instance:R,count:1,state:X},_.set(N,R)}}}function iQ(s,c){ts.X(s,c);var p=yd;if(p&&s){var x=Hs(p).hoistableScripts,_=bd(s),N=x.get(_);N||(N=p.querySelector(Hh(_)),N||(s=h({src:s,async:!0},c),(c=ca.get(_))&&gS(s,c),N=p.createElement("script"),qn(N),Tr(N,"link",s),p.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(_,N))}}function aQ(s,c){ts.M(s,c);var p=yd;if(p&&s){var x=Hs(p).hoistableScripts,_=bd(s),N=x.get(_);N||(N=p.querySelector(Hh(_)),N||(s=h({src:s,async:!0,type:"module"},c),(c=ca.get(_))&&gS(s,c),N=p.createElement("script"),qn(N),Tr(N,"link",s),p.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(_,N))}}function sR(s,c,p,x){var _=(_=te.current)?Mv(_):null;if(!_)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(c=xd(p.href),p=Hs(_).hoistableStyles,x=p.get(c),x||(x={type:"style",instance:null,count:0,state:null},p.set(c,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=xd(p.href);var N=Hs(_).hoistableStyles,R=N.get(s);if(R||(_=_.ownerDocument||_,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,R),(N=_.querySelector(Uh(s)))&&!N._p&&(R.instance=N,R.state.loading=5),ca.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},ca.set(s,p),N||oQ(_,s,p,R.state))),c&&x===null)throw Error(r(528,""));return R}if(c&&x!==null)throw Error(r(529,""));return null;case"script":return c=p.async,p=p.src,typeof p=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=bd(p),p=Hs(_).hoistableScripts,x=p.get(c),x||(x={type:"script",instance:null,count:0,state:null},p.set(c,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function xd(s){return'href="'+li(s)+'"'}function Uh(s){return'link[rel="stylesheet"]['+s+"]"}function lR(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function oQ(s,c,p,x){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?x.loading=1:(c=s.createElement("link"),x.preload=c,c.addEventListener("load",function(){return x.loading|=1}),c.addEventListener("error",function(){return x.loading|=2}),Tr(c,"link",p),qn(c),s.head.appendChild(c))}function bd(s){return'[src="'+li(s)+'"]'}function Hh(s){return"script[async]"+s}function cR(s,c,p){if(c.count++,c.instance===null)switch(c.type){case"style":var x=s.querySelector('style[data-href~="'+li(p.href)+'"]');if(x)return c.instance=x,qn(x),x;var _=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(s.ownerDocument||s).createElement("style"),qn(x),Tr(x,"style",_),Rv(x,p.precedence,s),c.instance=x;case"stylesheet":_=xd(p.href);var N=s.querySelector(Uh(_));if(N)return c.state.loading|=4,c.instance=N,qn(N),N;x=lR(p),(_=ca.get(_))&&pS(x,_),N=(s.ownerDocument||s).createElement("link"),qn(N);var R=N;return R._p=new Promise(function(X,J){R.onload=X,R.onerror=J}),Tr(N,"link",x),c.state.loading|=4,Rv(N,p.precedence,s),c.instance=N;case"script":return N=bd(p.src),(_=s.querySelector(Hh(N)))?(c.instance=_,qn(_),_):(x=p,(_=ca.get(N))&&(x=h({},p),gS(x,_)),s=s.ownerDocument||s,_=s.createElement("script"),qn(_),Tr(_,"link",x),s.head.appendChild(_),c.instance=_);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(x=c.instance,c.state.loading|=4,Rv(x,p.precedence,s));return c.instance}function Rv(s,c,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=x.length?x[x.length-1]:null,N=_,R=0;R<x.length;R++){var X=x[R];if(X.dataset.precedence===c)N=X;else if(N!==_)break}N?N.parentNode.insertBefore(s,N.nextSibling):(c=p.nodeType===9?p.head:p,c.insertBefore(s,c.firstChild))}function pS(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function gS(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var Dv=null;function uR(s,c,p){if(Dv===null){var x=new Map,_=Dv=new Map;_.set(p,x)}else _=Dv,x=_.get(p),x||(x=new Map,_.set(p,x));if(x.has(s))return x;for(x.set(s,null),p=p.getElementsByTagName(s),_=0;_<p.length;_++){var N=p[_];if(!(N[Ra]||N[Fn]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var R=N.getAttribute(c)||"";R=s+R;var X=x.get(R);X?X.push(N):x.set(R,[N])}}return x}function dR(s,c,p){s=s.ownerDocument||s,s.head.insertBefore(p,c==="title"?s.querySelector("head > title"):null)}function sQ(s,c,p){if(p===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function fR(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function lQ(s,c,p,x){if(p.type==="stylesheet"&&(typeof x.media!="string"||matchMedia(x.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var _=xd(x.href),N=c.querySelector(Uh(_));if(N){c=N._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=Iv.bind(s),c.then(s,s)),p.state.loading|=4,p.instance=N,qn(N);return}N=c.ownerDocument||c,x=lR(x),(_=ca.get(_))&&pS(x,_),N=N.createElement("link"),qn(N);var R=N;R._p=new Promise(function(X,J){R.onload=X,R.onerror=J}),Tr(N,"link",x),p.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,c),(c=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=Iv.bind(s),c.addEventListener("load",p),c.addEventListener("error",p))}}var vS=0;function cQ(s,c){return s.stylesheets&&s.count===0&&zv(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var x=setTimeout(function(){if(s.stylesheets&&zv(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+c);0<s.imgBytes&&vS===0&&(vS=62500*HW());var _=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&zv(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>vS?50:800)+c);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(x),clearTimeout(_)}}:null}function Iv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Lv=null;function zv(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Lv=new Map,c.forEach(uQ,s),Lv=null,Iv.call(s))}function uQ(s,c){if(!(c.state.loading&4)){var p=Lv.get(s);if(p)var x=p.get(null);else{p=new Map,Lv.set(s,p);for(var _=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<_.length;N++){var R=_[N];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(p.set(R.dataset.precedence,R),x=R)}x&&p.set(null,x)}_=c.instance,R=_.getAttribute("data-precedence"),N=p.get(R)||x,N===x&&p.set(null,_),p.set(R,_),this.count++,x=Iv.bind(this),_.addEventListener("load",x),_.addEventListener("error",x),N?N.parentNode.insertBefore(_,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(_,s.firstChild)),c.state.loading|=4}}var qh={$$typeof:E,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function dQ(s,c,p,x,_,N,R,X,J){this.tag=1,this.containerInfo=s,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=Ir(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ir(0),this.hiddenUpdates=Ir(null),this.identifierPrefix=x,this.onUncaughtError=_,this.onCaughtError=N,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function hR(s,c,p,x,_,N,R,X,J,de,ye,we){return s=new dQ(s,c,p,R,J,de,ye,we,X),c=1,N===!0&&(c|=24),N=Ei(3,null,null,c),s.current=N,N.stateNode=s,c=Ww(),c.refCount++,s.pooledCache=c,c.refCount++,N.memoizedState={element:x,isDehydrated:p,cache:c},e1(N),s}function mR(s){return s?(s=Qu,s):Qu}function pR(s,c,p,x,_,N){_=mR(_),x.context===null?x.context=_:x.pendingContext=_,x=Zs(c),x.payload={element:p},N=N===void 0?null:N,N!==null&&(x.callback=N),p=Js(s,x,c),p!==null&&(mi(p,s,c),Sh(p,s,c))}function gR(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<c?p:c}}function yS(s,c){gR(s,c),(s=s.alternate)&&gR(s,c)}function vR(s){if(s.tag===13||s.tag===31){var c=mc(s,67108864);c!==null&&mi(c,s,67108864),yS(s,67108864)}}function yR(s){if(s.tag===13||s.tag===31){var c=Ai();c=oi(c);var p=mc(s,c);p!==null&&mi(p,s,c),yS(s,c)}}var $v=!0;function fQ(s,c,p,x){var _=P.T;P.T=null;var N=H.p;try{H.p=2,xS(s,c,p,x)}finally{H.p=N,P.T=_}}function hQ(s,c,p,x){var _=P.T;P.T=null;var N=H.p;try{H.p=8,xS(s,c,p,x)}finally{H.p=N,P.T=_}}function xS(s,c,p,x){if($v){var _=bS(x);if(_===null)aS(s,c,x,Bv,p),bR(s,x);else if(pQ(_,s,c,p,x))x.stopPropagation();else if(bR(s,x),c&4&&-1<mQ.indexOf(s)){for(;_!==null;){var N=Fs(_);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var R=gr(N.pendingLanes);if(R!==0){var X=N;for(X.pendingLanes|=2,X.entangledLanes|=2;R;){var J=1<<31-ft(R);X.entanglements[1]|=J,R&=~J}lo(N),(qt&6)===0&&(Sv=Ut()+500,zh(0))}}break;case 31:case 13:X=mc(N,2),X!==null&&mi(X,N,2),Ev(),yS(N,2)}if(N=bS(x),N===null&&aS(s,c,x,Bv,p),N===_)break;_=N}_!==null&&x.stopPropagation()}else aS(s,c,x,null,p)}}function bS(s){return s=Sw(s),wS(s)}var Bv=null;function wS(s){if(Bv=null,s=Bs(s),s!==null){var c=a(s);if(c===null)s=null;else{var p=c.tag;if(p===13){if(s=o(c),s!==null)return s;s=null}else if(p===31){if(s=l(c),s!==null)return s;s=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null)}}return Bv=s,null}function xR(s){switch(s){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(Kt()){case ce:return 2;case xe:return 8;case ze:case it:return 32;case st:return 268435456;default:return 32}default:return 32}}var SS=!1,ul=null,dl=null,fl=null,Vh=new Map,Kh=new Map,hl=[],mQ="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 bR(s,c){switch(s){case"focusin":case"focusout":ul=null;break;case"dragenter":case"dragleave":dl=null;break;case"mouseover":case"mouseout":fl=null;break;case"pointerover":case"pointerout":Vh.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kh.delete(c.pointerId)}}function Yh(s,c,p,x,_,N){return s===null||s.nativeEvent!==N?(s={blockedOn:c,domEventName:p,eventSystemFlags:x,nativeEvent:N,targetContainers:[_]},c!==null&&(c=Fs(c),c!==null&&vR(c)),s):(s.eventSystemFlags|=x,c=s.targetContainers,_!==null&&c.indexOf(_)===-1&&c.push(_),s)}function pQ(s,c,p,x,_){switch(c){case"focusin":return ul=Yh(ul,s,c,p,x,_),!0;case"dragenter":return dl=Yh(dl,s,c,p,x,_),!0;case"mouseover":return fl=Yh(fl,s,c,p,x,_),!0;case"pointerover":var N=_.pointerId;return Vh.set(N,Yh(Vh.get(N)||null,s,c,p,x,_)),!0;case"gotpointercapture":return N=_.pointerId,Kh.set(N,Yh(Kh.get(N)||null,s,c,p,x,_)),!0}return!1}function wR(s){var c=Bs(s.target);if(c!==null){var p=a(c);if(p!==null){if(c=p.tag,c===13){if(c=o(p),c!==null){s.blockedOn=c,lc(s.priority,function(){yR(p)});return}}else if(c===31){if(c=l(p),c!==null){s.blockedOn=c,lc(s.priority,function(){yR(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){s.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Fv(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var p=bS(s.nativeEvent);if(p===null){p=s.nativeEvent;var x=new p.constructor(p.type,p);ww=x,p.target.dispatchEvent(x),ww=null}else return c=Fs(p),c!==null&&vR(c),s.blockedOn=p,!1;c.shift()}return!0}function SR(s,c,p){Fv(s)&&p.delete(c)}function gQ(){SS=!1,ul!==null&&Fv(ul)&&(ul=null),dl!==null&&Fv(dl)&&(dl=null),fl!==null&&Fv(fl)&&(fl=null),Vh.forEach(SR),Kh.forEach(SR)}function Uv(s,c){s.blockedOn===c&&(s.blockedOn=null,SS||(SS=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,gQ)))}var Hv=null;function jR(s){Hv!==s&&(Hv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hv===s&&(Hv=null);for(var c=0;c<s.length;c+=3){var p=s[c],x=s[c+1],_=s[c+2];if(typeof x!="function"){if(wS(x||p)===null)continue;break}var N=Fs(p);N!==null&&(s.splice(c,3),c-=3,b1(N,{pending:!0,data:_,method:p.method,action:x},x,_))}}))}function wd(s){function c(J){return Uv(J,s)}ul!==null&&Uv(ul,s),dl!==null&&Uv(dl,s),fl!==null&&Uv(fl,s),Vh.forEach(c),Kh.forEach(c);for(var p=0;p<hl.length;p++){var x=hl[p];x.blockedOn===s&&(x.blockedOn=null)}for(;0<hl.length&&(p=hl[0],p.blockedOn===null);)wR(p),p.blockedOn===null&&hl.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(x=0;x<p.length;x+=3){var _=p[x],N=p[x+1],R=_[ir]||null;if(typeof N=="function")R||jR(p);else if(R){var X=null;if(N&&N.hasAttribute("formAction")){if(_=N,R=N[ir]||null)X=R.formAction;else if(wS(_)!==null)continue}else X=R.action;typeof X=="function"?p[x+1]=X:(p.splice(x,3),x-=3),jR(p)}}}function ER(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(R){return _=R})},focusReset:"manual",scroll:"manual"})}function c(){_!==null&&(_(),_=null),x||setTimeout(p,20)}function p(){if(!x&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var x=!1,_=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(p,100),function(){x=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),_!==null&&(_(),_=null)}}}function jS(s){this._internalRoot=s}qv.prototype.render=jS.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));var p=c.current,x=Ai();pR(p,x,s,c,null,null)},qv.prototype.unmount=jS.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;pR(s.current,2,null,s,null,null),Ev(),c[he]=null}};function qv(s){this._internalRoot=s}qv.prototype.unstable_scheduleHydration=function(s){if(s){var c=sc();s={blockedOn:null,target:s,priority:c};for(var p=0;p<hl.length&&c!==0&&c<hl[p].priority;p++);hl.splice(p,0,s),p===0&&wR(s)}};var _R=t.version;if(_R!=="19.2.4")throw Error(r(527,_R,"19.2.4"));H.findDOMNode=function(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(c),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var vQ={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vv.isDisabled&&Vv.supportsFiber)try{je=Vv.inject(vQ),ct=Vv}catch{}}return Gh.createRoot=function(s,c){if(!i(s))throw Error(r(299));var p=!1,x="",_=PP,N=MP,R=RP;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(x=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(R=c.onRecoverableError)),c=hR(s,1,!1,null,null,p,x,null,_,N,R,ER),s[he]=c.current,iS(s),new jS(c)},Gh.hydrateRoot=function(s,c,p){if(!i(s))throw Error(r(299));var x=!1,_="",N=PP,R=MP,X=RP,J=null;return p!=null&&(p.unstable_strictMode===!0&&(x=!0),p.identifierPrefix!==void 0&&(_=p.identifierPrefix),p.onUncaughtError!==void 0&&(N=p.onUncaughtError),p.onCaughtError!==void 0&&(R=p.onCaughtError),p.onRecoverableError!==void 0&&(X=p.onRecoverableError),p.formState!==void 0&&(J=p.formState)),c=hR(s,1,!0,c,p??null,x,_,J,N,R,X,ER),c.context=mR(null),p=c.current,x=Ai(),x=oi(x),_=Zs(x),_.callback=null,Js(p,_,x),p=x,c.current.lanes=p,Yt(c,p),lo(c),s[he]=c.current,iS(s),new qv(c)},Gh.version="19.2.4",Gh}var IR;function AQ(){if(IR)return kS.exports;IR=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(),kS.exports=kQ(),kS.exports}var OQ=AQ();/**
 * 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 LR="popstate";function zR(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function TQ(e={}){function t(r,i){var d;let a=(d=i.state)==null?void 0:d.masked,{pathname:o,search:l,hash:u}=a||r.location;return u_("",{pathname:o,search:l,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:Im(i)}return MQ(t,n,null,e)}function bn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function PQ(){return Math.random().toString(36).substring(2,10)}function $R(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 u_(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Mf(t):t,state:n,key:t&&t.key||r||PQ(),unstable_mask:i}}function Im({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 Mf(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 MQ(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l="POP",u=null,d=m();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function m(){return(o.state||{idx:null}).idx}function h(){l="POP";let S=m(),j=S==null?null:S-d;d=S,u&&u({action:l,location:w.location,delta:j})}function g(S,j){l="PUSH";let C=zR(S)?S:u_(w.location,S,j);d=m()+1;let E=$R(C,d),k=w.createHref(C.unstable_mask||C);try{o.pushState(E,"",k)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(k)}a&&u&&u({action:l,location:w.location,delta:1})}function v(S,j){l="REPLACE";let C=zR(S)?S:u_(w.location,S,j);d=m();let E=$R(C,d),k=w.createHref(C.unstable_mask||C);o.replaceState(E,"",k),a&&u&&u({action:l,location:w.location,delta:0})}function b(S){return RQ(S)}let w={get action(){return l},get location(){return e(i,o)},listen(S){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(LR,h),u=S,()=>{i.removeEventListener(LR,h),u=null}},createHref(S){return t(i,S)},createURL:b,encodeLocation(S){let j=b(S);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:g,replace:v,go(S){return o.go(S)}};return w}function RQ(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Im(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function rB(e,t,n="/"){return DQ(e,t,n,!1)}function DQ(e,t,n,r){let i=typeof t=="string"?Mf(t):t,a=ys(i.pathname||"/",n);if(a==null)return null;let o=iB(e);IQ(o);let l=null;for(let u=0;l==null&&u<o.length;++u){let d=oB(a);l=VQ(o[u],d,r)}return l}function iB(e,t=[],n=[],r="",i=!1){let a=(o,l,u=i,d)=>{let m={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&u)return;bn(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 h=jo([r,m.relativePath]),g=n.concat(m);o.children&&o.children.length>0&&(bn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),iB(o.children,t,g,h,u)),!(o.path==null&&!o.index)&&t.push({path:h,score:HQ(h,o.index),routesMeta:g})};return e.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,l);else for(let d of aB(o.path))a(o,l,!0,d)}),t}function aB(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=aB(r.join("/")),l=[];return l.push(...o.map(u=>u===""?a:[a,u].join("/"))),i&&l.push(...o),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function IQ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:qQ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var LQ=/^:[\w-]+$/,zQ=3,$Q=2,BQ=1,FQ=10,UQ=-2,BR=e=>e==="*";function HQ(e,t){let n=e.split("/"),r=n.length;return n.some(BR)&&(r+=UQ),t&&(r+=$Q),n.filter(i=>!BR(i)).reduce((i,a)=>i+(LQ.test(a)?zQ:a===""?BQ:FQ),r)}function qQ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function VQ(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l<r.length;++l){let u=r[l],d=l===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",h=Lm({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},m),g=u.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=Lm({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},m)),!h)return null;Object.assign(i,h.params),o.push({params:i,pathname:jo([a,h.pathname]),pathnameBase:WQ(jo([a,h.pathnameBase])),route:g}),h.pathnameBase!=="/"&&(a=jo([a,h.pathnameBase]))}return o}function Lm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=KQ(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:h},g)=>{if(m==="*"){let b=l[g]||"";o=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[g];return h&&!v?d[m]=void 0:d[m]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:e}}function KQ(e,t=!1,n=!0){wa(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,u,d,m)=>{if(r.push({paramName:l,isOptional:u!=null}),u){let h=m.charAt(d+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function oB(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wa(!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 ys(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 YQ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function XQ(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Mf(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=FR(n.substring(1),"/"):a=FR(n,t)):a=t,{pathname:a,search:QQ(r),hash:ZQ(i)}}function FR(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function PS(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 GQ(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kN(e){let t=GQ(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function j0(e,t,n,r=!1){let i;typeof e=="string"?i=Mf(e):(i={...e},bn(!i.pathname||!i.pathname.includes("?"),PS("?","pathname","search",i)),bn(!i.pathname||!i.pathname.includes("#"),PS("#","pathname","hash",i)),bn(!i.search||!i.search.includes("#"),PS("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),h-=1;i.pathname=g.join("/")}l=h>=0?t[h]:"/"}let u=XQ(i,l),d=o&&o!=="/"&&o.endsWith("/"),m=(a||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||m)&&(u.pathname+="/"),u}var jo=e=>e.join("/").replace(/\/\/+/g,"/"),WQ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),QQ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZQ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,JQ=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 eZ(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function tZ(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var sB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lB(e,t){let n=e;if(typeof n!="string"||!YQ.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(sB)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),l=ys(o.pathname,t);o.origin===a.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{wa(!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:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var cB=["POST","PUT","PATCH","DELETE"];new Set(cB);var nZ=["GET",...cB];new Set(nZ);var Rf=y.createContext(null);Rf.displayName="DataRouter";var E0=y.createContext(null);E0.displayName="DataRouterState";var rZ=y.createContext(!1),uB=y.createContext({isTransitioning:!1});uB.displayName="ViewTransition";var iZ=y.createContext(new Map);iZ.displayName="Fetchers";var aZ=y.createContext(null);aZ.displayName="Await";var Wi=y.createContext(null);Wi.displayName="Navigation";var Ep=y.createContext(null);Ep.displayName="Location";var ka=y.createContext({outlet:null,matches:[],isDataRoute:!1});ka.displayName="Route";var AN=y.createContext(null);AN.displayName="RouteError";var dB="REACT_ROUTER_ERROR",oZ="REDIRECT",sZ="ROUTE_ERROR_RESPONSE";function lZ(e){if(e.startsWith(`${dB}:${oZ}:{`))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 cZ(e){if(e.startsWith(`${dB}:${sZ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new JQ(t.status,t.statusText,t.data)}catch{}}function uZ(e,{relative:t}={}){bn(Ou(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(Wi),{hash:i,pathname:a,search:o}=Cp(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:jo([n,a])),r.createHref({pathname:l,search:o,hash:i})}function Ou(){return y.useContext(Ep)!=null}function Aa(){return bn(Ou(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Ep).location}function MS(e){bn(Ou(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Aa();return y.useMemo(()=>Lm(e,oB(t)),[t,e])}var fB="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hB(e){y.useContext(Wi).static||y.useLayoutEffect(e)}function to(){let{isDataRoute:e}=y.useContext(ka);return e?_Z():dZ()}function dZ(){bn(Ou(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Rf),{basename:t,navigator:n}=y.useContext(Wi),{matches:r}=y.useContext(ka),{pathname:i}=Aa(),a=JSON.stringify(kN(r)),o=y.useRef(!1);return hB(()=>{o.current=!0}),y.useCallback((u,d={})=>{if(wa(o.current,fB),!o.current)return;if(typeof u=="number"){n.go(u);return}let m=j0(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:jo([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,a,i,e])}var fZ=y.createContext(null);function hZ(e){let t=y.useContext(ka).outlet;return y.useMemo(()=>t&&y.createElement(fZ.Provider,{value:e},t),[t,e])}function _p(){let{matches:e}=y.useContext(ka),t=e[e.length-1];return t?t.params:{}}function Cp(e,{relative:t}={}){let{matches:n}=y.useContext(ka),{pathname:r}=Aa(),i=JSON.stringify(kN(n));return y.useMemo(()=>j0(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function mZ(e,t){return mB(e,t)}function mB(e,t,n){var S;bn(Ou(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(Wi),{matches:i}=y.useContext(ka),a=i[i.length-1],o=a?a.params:{},l=a?a.pathname:"/",u=a?a.pathnameBase:"/",d=a&&a.route;{let j=d&&d.path||"";gB(l,!d||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${j}">) 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="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let m=Aa(),h;if(t){let j=typeof t=="string"?Mf(t):t;bn(u==="/"||((S=j.pathname)==null?void 0:S.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${j.pathname}" was given in the \`location\` prop.`),h=j}else h=m;let g=h.pathname||"/",v=g;if(u!=="/"){let j=u.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=rB(e,{pathname:v});wa(d||b!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),wa(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 "${h.pathname}${h.search}${h.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=xZ(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},o,j.params),pathname:jo([u,r.encodeLocation?r.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?u:jo([u,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n);return t&&w?y.createElement(Ep.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...h},navigationType:"POP"}},w):w}function pZ(){let e=EZ(),t=eZ(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)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,o)}var gZ=y.createElement(pZ,null),pB=class extends y.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=cZ(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(ka.Provider,{value:this.props.routeContext},y.createElement(AN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(vZ,{error:e},t):t}};pB.contextType=rZ;var RS=new WeakMap;function vZ({children:e,error:t}){let{basename:n}=y.useContext(Wi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=lZ(t.digest);if(r){let i=RS.get(t);if(i)throw i;let a=lB(r.location,n);if(sB&&!RS.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw RS.set(t,o),o}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function yZ({routeContext:e,match:t,children:n}){let r=y.useContext(Rf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(ka.Provider,{value:e},n)}function xZ(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 i=e,a=r==null?void 0:r.errors;if(a!=null){let m=i.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);bn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,m+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let m=0;m<i.length;m++){let h=i[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=m),h.route.id){let{loaderData:g,errors:v}=r,b=h.route.loader&&!g.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||b){n.isStatic&&(o=!0),l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}}let u=n==null?void 0:n.onError,d=r&&u?(m,h)=>{var g,v;u(m,{location:r.location,params:((v=(g=r.matches)==null?void 0:g[0])==null?void 0:v.params)??{},unstable_pattern:tZ(r.matches),errorInfo:h})}:void 0;return i.reduceRight((m,h,g)=>{let v,b=!1,w=null,S=null;r&&(v=a&&h.route.id?a[h.route.id]:void 0,w=h.route.errorElement||gZ,o&&(l<0&&g===0?(gB("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):l===g&&(b=!0,S=h.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,g+1)),C=()=>{let E;return v?E=w:b?E=S:h.route.Component?E=y.createElement(h.route.Component,null):h.route.element?E=h.route.element:E=m,y.createElement(yZ,{match:h,routeContext:{outlet:m,matches:j,isDataRoute:r!=null},children:E})};return r&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?y.createElement(pB,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:d}):C()},null)}function ON(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function bZ(e){let t=y.useContext(Rf);return bn(t,ON(e)),t}function wZ(e){let t=y.useContext(E0);return bn(t,ON(e)),t}function SZ(e){let t=y.useContext(ka);return bn(t,ON(e)),t}function TN(e){let t=SZ(e),n=t.matches[t.matches.length-1];return bn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function jZ(){return TN("useRouteId")}function EZ(){var r;let e=y.useContext(AN),t=wZ("useRouteError"),n=TN("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function _Z(){let{router:e}=bZ("useNavigate"),t=TN("useNavigate"),n=y.useRef(!1);return hB(()=>{n.current=!0}),y.useCallback(async(i,a={})=>{wa(n.current,fB),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var UR={};function gB(e,t,n){!t&&!UR[e]&&(UR[e]=!0,wa(!1,n))}y.memo(CZ);function CZ({routes:e,future:t,state:n,isStatic:r,onError:i}){return mB(e,void 0,{state:n,isStatic:r,onError:i})}function HR({to:e,replace:t,state:n,relative:r}){bn(Ou(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=y.useContext(Wi);wa(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=y.useContext(ka),{pathname:o}=Aa(),l=to(),u=j0(e,kN(a),o,r==="path"),d=JSON.stringify(u);return y.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function NZ(e){return hZ(e.context)}function yr(e){bn(!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 kZ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){bn(!Ou(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:l,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[l,i,a,o]);typeof n=="string"&&(n=Mf(n));let{pathname:d="/",search:m="",hash:h="",state:g=null,key:v="default",unstable_mask:b}=n,w=y.useMemo(()=>{let S=ys(d,l);return S==null?null:{location:{pathname:S,search:m,hash:h,state:g,key:v,unstable_mask:b},navigationType:r}},[l,d,m,h,g,v,r,b]);return wa(w!=null,`<Router basename="${l}"> is not able to match the URL "${d}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(Wi.Provider,{value:u},y.createElement(Ep.Provider,{children:t,value:w}))}function AZ({children:e,location:t}){return mZ(d_(e),t)}function d_(e,t=[]){let n=[];return y.Children.forEach(e,(r,i)=>{if(!y.isValidElement(r))return;let a=[...t,i];if(r.type===y.Fragment){n.push.apply(n,d_(r.props.children,a));return}bn(r.type===yr,`[${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>`),bn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||a.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&&(o.children=d_(r.props.children,a)),n.push(o)}),n}var My="get",Ry="application/x-www-form-urlencoded";function _0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function OZ(e){return _0(e)&&e.tagName.toLowerCase()==="button"}function TZ(e){return _0(e)&&e.tagName.toLowerCase()==="form"}function PZ(e){return _0(e)&&e.tagName.toLowerCase()==="input"}function MZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function RZ(e,t){return e.button===0&&(!t||t==="_self")&&!MZ(e)}function f_(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(i=>[n,i]):[[n,r]])},[]))}function DZ(e,t){let n=f_(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Yv=null;function IZ(){if(Yv===null)try{new FormData(document.createElement("form"),0),Yv=!1}catch{Yv=!0}return Yv}var LZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function DS(e){return e!=null&&!LZ.has(e)?(wa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ry}"`),null):e}function zZ(e,t){let n,r,i,a,o;if(TZ(e)){let l=e.getAttribute("action");r=l?ys(l,t):null,n=e.getAttribute("method")||My,i=DS(e.getAttribute("enctype"))||Ry,a=new FormData(e)}else if(OZ(e)||PZ(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?ys(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||My,i=DS(e.getAttribute("formenctype"))||DS(l.getAttribute("enctype"))||Ry,a=new FormData(l,e),!IZ()){let{name:d,type:m,value:h}=e;if(m==="image"){let g=d?`${d}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else d&&a.append(d,h)}}else{if(_0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=My,r=null,i=Ry,o=e}return a&&i==="text/plain"&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function PN(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $Z(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&ys(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function BZ(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 FZ(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 UZ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await BZ(a,n);return o.links?o.links():[]}return[]}));return KZ(r.flat(1).filter(FZ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function qR(e,t,n,r,i,a){let o=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,l=(u,d)=>{var m;return n[d].pathname!==u.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==u.params["*"]};return a==="assets"?t.filter((u,d)=>o(u,d)||l(u,d)):a==="data"?t.filter((u,d)=>{var h;let m=r.routes[u.route.id];if(!m||!m.hasLoader)return!1;if(o(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function HZ(e,t,{includeHydrateFallback:n}={}){return qZ(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function qZ(e){return[...new Set(e)]}function VZ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function KZ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(VZ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function vB(){let e=y.useContext(Rf);return PN(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function YZ(){let e=y.useContext(E0);return PN(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var MN=y.createContext(void 0);MN.displayName="FrameworkContext";function yB(){let e=y.useContext(MN);return PN(e,"You must render this element inside a <HydratedRouter> element"),e}function XZ(e,t){let n=y.useContext(MN),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:m,onTouchStart:h}=t,g=y.useRef(null);y.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=j=>{j.forEach(C=>{o(C.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return g.current&&S.observe(g.current),()=>{S.disconnect()}}},[e]),y.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let v=()=>{i(!0)},b=()=>{i(!1),o(!1)};return n?e!=="intent"?[a,g,{}]:[a,g,{onFocus:Wh(l,v),onBlur:Wh(u,b),onMouseEnter:Wh(d,v),onMouseLeave:Wh(m,b),onTouchStart:Wh(h,v)}]:[!1,g,{}]}function Wh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function GZ({page:e,...t}){let{router:n}=vB(),r=y.useMemo(()=>rB(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(QZ,{page:e,matches:r,...t}):null}function WZ(e){let{manifest:t,routeModules:n}=yB(),[r,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return UZ(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function QZ({page:e,matches:t,...n}){let r=Aa(),{future:i,manifest:a,routeModules:o}=yB(),{basename:l}=vB(),{loaderData:u,matches:d}=YZ(),m=y.useMemo(()=>qR(e,t,d,a,r,"data"),[e,t,d,a,r]),h=y.useMemo(()=>qR(e,t,d,a,r,"assets"),[e,t,d,a,r]),g=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(t.forEach(C=>{var k;let E=a.routes[C.route.id];!E||!E.hasLoader||(!m.some(O=>O.route.id===C.route.id)&&C.route.id in u&&((k=o[C.route.id])!=null&&k.shouldRevalidate)||E.hasClientLoader?S=!0:w.add(C.route.id))}),w.size===0)return[];let j=$Z(e,l,i.unstable_trailingSlashAwareDataRequests,"data");return S&&w.size>0&&j.searchParams.set("_routes",t.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[j.pathname+j.search]},[l,i.unstable_trailingSlashAwareDataRequests,u,r,a,m,t,e,o]),v=y.useMemo(()=>HZ(h,a),[h,a]),b=WZ(h);return y.createElement(y.Fragment,null,g.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:S})=>y.createElement("link",{key:w,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function ZZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var JZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{JZ&&(window.__reactRouterVersion="7.13.1")}catch{}function eJ({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=y.useRef();i.current==null&&(i.current=TQ({window:r,v5Compat:!0}));let a=i.current,[o,l]=y.useState({action:a.action,location:a.location}),u=y.useCallback(d=>{n===!1?l(d):y.startTransition(()=>l(d))},[n]);return y.useLayoutEffect(()=>a.listen(u),[a,u]),y.createElement(kZ,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var xB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dr=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:o,unstable_mask:l,state:u,target:d,to:m,preventScrollReset:h,viewTransition:g,unstable_defaultShouldRevalidate:v,...b},w){let{basename:S,navigator:j,unstable_useTransitions:C}=y.useContext(Wi),E=typeof m=="string"&&xB.test(m),k=lB(m,S);m=k.to;let O=uZ(m,{relative:i}),A=Aa(),T=null;if(l){let K=j0(l,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);S!=="/"&&(K.pathname=K.pathname==="/"?S:jo([S,K.pathname])),T=j.createHref(K)}let[M,B,I]=XZ(r,b),U=rJ(m,{replace:o,unstable_mask:l,state:u,target:d,preventScrollReset:h,relative:i,viewTransition:g,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function L(K){t&&t(K),K.defaultPrevented||U(K)}let G=!(k.isExternal||a),z=y.createElement("a",{...b,...I,href:(G?T:void 0)||k.absoluteURL||O,onClick:G?L:t,ref:ZZ(w,B),target:d,"data-discover":!E&&n==="render"?"true":void 0});return M&&!E?y.createElement(y.Fragment,null,z,y.createElement(GZ,{page:O})):z});dr.displayName="Link";var Dy=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:o,viewTransition:l,children:u,...d},m){let h=Cp(o,{relative:d.relative}),g=Aa(),v=y.useContext(E0),{navigator:b,basename:w}=y.useContext(Wi),S=v!=null&&cJ(h)&&l===!0,j=b.encodeLocation?b.encodeLocation(h).pathname:h.pathname,C=g.pathname,E=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(C=C.toLowerCase(),E=E?E.toLowerCase():null,j=j.toLowerCase()),E&&w&&(E=ys(E,w)||E);const k=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let O=C===j||!i&&C.startsWith(j)&&C.charAt(k)==="/",A=E!=null&&(E===j||!i&&E.startsWith(j)&&E.charAt(j.length)==="/"),T={isActive:O,isPending:A,isTransitioning:S},M=O?t:void 0,B;typeof r=="function"?B=r(T):B=[r,O?"active":null,A?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let I=typeof a=="function"?a(T):a;return y.createElement(dr,{...d,"aria-current":M,className:B,ref:m,style:I,to:o,viewTransition:l},typeof u=="function"?u(T):u)});Dy.displayName="NavLink";var tJ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=My,action:l,onSubmit:u,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:g,...v},b)=>{let{unstable_useTransitions:w}=y.useContext(Wi),S=sJ(),j=lJ(l,{relative:d}),C=o.toLowerCase()==="get"?"get":"post",E=typeof l=="string"&&xB.test(l),k=O=>{if(u&&u(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,T=(A==null?void 0:A.getAttribute("formmethod"))||o,M=()=>S(A||O.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:i,state:a,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:g});w&&n!==!1?y.startTransition(()=>M()):M()};return y.createElement("form",{ref:b,method:C,action:j,onSubmit:r?u:k,...v,"data-discover":!E&&e==="render"?"true":void 0})});tJ.displayName="Form";function nJ(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function bB(e){let t=y.useContext(Rf);return bn(t,nJ(e)),t}function rJ(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let m=to(),h=Aa(),g=Cp(e,{relative:o});return y.useCallback(v=>{if(RZ(v,t)){v.preventDefault();let b=n!==void 0?n:Im(h)===Im(g),w=()=>m(e,{replace:b,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:u});d?y.startTransition(()=>w()):w()}},[h,m,g,n,r,i,t,e,a,o,l,u,d])}function iJ(e){wa(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=y.useRef(f_(e)),n=y.useRef(!1),r=Aa(),i=y.useMemo(()=>DZ(r.search,n.current?null:t.current),[r.search]),a=to(),o=y.useCallback((l,u)=>{const d=f_(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,a("?"+d,u)},[a,i]);return[i,o]}var aJ=0,oJ=()=>`__${String(++aJ)}__`;function sJ(){let{router:e}=bB("useSubmit"),{basename:t}=y.useContext(Wi),n=jZ(),r=e.fetch,i=e.navigate;return y.useCallback(async(a,o={})=>{let{action:l,method:u,encType:d,formData:m,body:h}=zZ(a,t);if(o.navigate===!1){let g=o.fetcherKey||oJ();await r(g,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,body:h,formMethod:o.method||u,formEncType:o.encType||d,flushSync:o.flushSync})}else await i(o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,body:h,formMethod:o.method||u,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function lJ(e,{relative:t}={}){let{basename:n}=y.useContext(Wi),r=y.useContext(ka);bn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...Cp(e||".",{relative:t})},o=Aa();if(e==null){a.search=o.search;let l=new URLSearchParams(a.search),u=l.getAll("index");if(u.some(m=>m==="")){l.delete("index"),u.filter(h=>h).forEach(h=>l.append("index",h));let m=l.toString();a.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:jo([n,a.pathname])),Im(a)}function cJ(e,{relative:t}={}){let n=y.useContext(uB);bn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=bB("useViewTransitionState"),i=Cp(e,{relative:t});if(!n.isTransitioning)return!1;let a=ys(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ys(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Lm(i.pathname,o)!=null||Lm(i.pathname,a)!=null}var Ql=nB();const wB=Gi(Ql);var Tu=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(){}},uJ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kl,CN,q$,dJ=(q$=class{constructor(){De(this,kl,uJ);De(this,CN,!1)}setTimeoutProvider(e){Ne(this,kl,e)}setTimeout(e,t){return W(this,kl).setTimeout(e,t)}clearTimeout(e){W(this,kl).clearTimeout(e)}setInterval(e,t){return W(this,kl).setInterval(e,t)}clearInterval(e){W(this,kl).clearInterval(e)}},kl=new WeakMap,CN=new WeakMap,q$),Bc=new dJ;function fJ(e){setTimeout(e,0)}var au=typeof window>"u"||"Deno"in globalThis;function Br(){}function hJ(e,t){return typeof e=="function"?e(t):e}function h_(e){return typeof e=="number"&&e>=0&&e!==1/0}function SB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $l(e,t){return typeof e=="function"?e(t):e}function ga(e,t){return typeof e=="function"?e(t):e}function VR(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==RN(o,t.options))return!1}else if(!zm(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||a&&!a(t))}function KR(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ou(t.options.mutationKey)!==ou(a))return!1}else if(!zm(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function RN(e,t){return((t==null?void 0:t.queryKeyHashFn)||ou)(e)}function ou(e){return JSON.stringify(e,(t,n)=>m_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function zm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>zm(e[n],t[n])):!1}var mJ=Object.prototype.hasOwnProperty;function DN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=YR(e)&&YR(t);if(!r&&!(m_(e)&&m_(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,u=r?new Array(l):{};let d=0;for(let m=0;m<l;m++){const h=r?m:o[m],g=e[h],v=t[h];if(g===v){u[h]=g,(r?m<a:mJ.call(e,h))&&d++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){u[h]=v;continue}const b=DN(g,v,n+1);u[h]=b,b===g&&d++}return a===l&&d===a?e:u}function $m(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 YR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function m_(e){if(!XR(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!XR(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function XR(e){return Object.prototype.toString.call(e)==="[object Object]"}function pJ(e){return new Promise(t=>{Bc.setTimeout(t,e)})}function p_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?DN(e,t):t}function gJ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function vJ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var IN=Symbol();function jB(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===IN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function LN(e,t){return typeof e=="function"?e(...t):!!e}function yJ(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Vc,Al,Wd,V$,xJ=(V$=class extends Tu{constructor(){super();De(this,Vc);De(this,Al);De(this,Wd);Ne(this,Wd,t=>{if(!au&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Al)||this.setEventListener(W(this,Wd))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Al))==null||t.call(this),Ne(this,Al,void 0))}setEventListener(t){var n;Ne(this,Wd,t),(n=W(this,Al))==null||n.call(this),Ne(this,Al,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Vc)!==t&&(Ne(this,Vc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Vc)=="boolean"?W(this,Vc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Vc=new WeakMap,Al=new WeakMap,Wd=new WeakMap,V$),zN=new xJ;function g_(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var bJ=fJ;function wJ(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=bJ;const a=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||o()}return u},batchCalls:l=>(...u)=>{a(()=>{l(...u)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var $n=wJ(),Qd,Ol,Zd,K$,SJ=(K$=class extends Tu{constructor(){super();De(this,Qd,!0);De(this,Ol);De(this,Zd);Ne(this,Zd,t=>{if(!au&&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,Ol)||this.setEventListener(W(this,Zd))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Ol))==null||t.call(this),Ne(this,Ol,void 0))}setEventListener(t){var n;Ne(this,Zd,t),(n=W(this,Ol))==null||n.call(this),Ne(this,Ol,t(this.setOnline.bind(this)))}setOnline(t){W(this,Qd)!==t&&(Ne(this,Qd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Qd)}},Qd=new WeakMap,Ol=new WeakMap,Zd=new WeakMap,K$),Zy=new SJ;function jJ(e){return Math.min(1e3*2**e,3e4)}function EB(e){return(e??"online")==="online"?Zy.isOnline():!0}var v_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function _B(e){let t=!1,n=0,r;const i=g_(),a=()=>i.status!=="pending",o=w=>{var S;if(!a()){const j=new v_(w);g(j),(S=e.onCancel)==null||S.call(e,j)}},l=()=>{t=!0},u=()=>{t=!1},d=()=>zN.isFocused()&&(e.networkMode==="always"||Zy.isOnline())&&e.canRun(),m=()=>EB(e.networkMode)&&e.canRun(),h=w=>{a()||(r==null||r(),i.resolve(w))},g=w=>{a()||(r==null||r(),i.reject(w))},v=()=>new Promise(w=>{var S;r=j=>{(a()||d())&&w(j)},(S=e.onPause)==null||S.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(a())return;let w;const S=n===0?e.initialPromise:void 0;try{w=S??e.fn()}catch(j){w=Promise.reject(j)}Promise.resolve(w).then(h).catch(j=>{var A;if(a())return;const C=e.retry??(au?0:3),E=e.retryDelay??jJ,k=typeof E=="function"?E(n,j):E,O=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,j);if(t||!O){g(j);return}n++,(A=e.onFail)==null||A.call(e,n,j),pJ(k).then(()=>d()?void 0:v()).then(()=>{t?g(j):b()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:u,canStart:m,start:()=>(m()?b():v().then(b),i)}}var Kc,Y$,CB=(Y$=class{constructor(){De(this,Kc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),h_(this.gcTime)&&Ne(this,Kc,Bc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(au?1/0:300*1e3))}clearGcTimeout(){W(this,Kc)&&(Bc.clearTimeout(W(this,Kc)),Ne(this,Kc,void 0))}},Kc=new WeakMap,Y$),Yc,Jd,ma,Xc,xr,pp,Gc,Fa,is,X$,EJ=(X$=class extends CB{constructor(t){super();De(this,Fa);De(this,Yc);De(this,Jd);De(this,ma);De(this,Xc);De(this,xr);De(this,pp);De(this,Gc);Ne(this,Gc,!1),Ne(this,pp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ne(this,Xc,t.client),Ne(this,ma,W(this,Xc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ne(this,Yc,WR(this.options)),this.state=t.state??W(this,Yc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,xr))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,pp),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=WR(this.options);n.data!==void 0&&(this.setState(GR(n.data,n.dataUpdatedAt)),Ne(this,Yc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ma).remove(this)}setData(t,n){const r=p_(this.state.data,t,this.options);return ot(this,Fa,is).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ot(this,Fa,is).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=W(this,xr))==null?void 0:r.promise;return(i=W(this,xr))==null||i.cancel(t),n?n.then(Br).catch(Br):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Yc))}isActive(){return this.observers.some(t=>ga(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===IN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>$l(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:!SB(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,xr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,xr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,ma).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,xr)&&(W(this,Gc)?W(this,xr).cancel({revert:!0}):W(this,xr).cancelRetry()),this.scheduleGc()),W(this,ma).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ot(this,Fa,is).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,m,h,g,v,b,w,S,j,C,E;if(this.state.fetchStatus!=="idle"&&((u=W(this,xr))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,xr))return W(this,xr).continueRetry(),W(this,xr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(O=>O.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,i=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Ne(this,Gc,!0),r.signal)})},a=()=>{const k=jB(this.options,n),A=(()=>{const T={client:W(this,Xc),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return Ne(this,Gc,!1),this.options.persister?this.options.persister(k,A,this):k(A)},l=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Xc),state:this.state,fetchFn:a};return i(k),k})();(d=this.options.behavior)==null||d.onFetch(l,this),Ne(this,Jd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&ot(this,Fa,is).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),Ne(this,xr,_B({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:k=>{k instanceof v_&&k.revert&&this.setState({...W(this,Jd),fetchStatus:"idle"}),r.abort()},onFail:(k,O)=>{ot(this,Fa,is).call(this,{type:"failed",failureCount:k,error:O})},onPause:()=>{ot(this,Fa,is).call(this,{type:"pause"})},onContinue:()=>{ot(this,Fa,is).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const k=await W(this,xr).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(v=(g=W(this,ma).config).onSuccess)==null||v.call(g,k,this),(w=(b=W(this,ma).config).onSettled)==null||w.call(b,k,this.state.error,this),k}catch(k){if(k instanceof v_){if(k.silent)return W(this,xr).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw ot(this,Fa,is).call(this,{type:"error",error:k}),(j=(S=W(this,ma).config).onError)==null||j.call(S,k,this),(E=(C=W(this,ma).config).onSettled)==null||E.call(C,this.state.data,k,this),k}finally{this.scheduleGc()}}},Yc=new WeakMap,Jd=new WeakMap,ma=new WeakMap,Xc=new WeakMap,xr=new WeakMap,pp=new WeakMap,Gc=new WeakMap,Fa=new WeakSet,is=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,...NB(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...GR(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ne(this,Jd,t.manual?i:void 0),i;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),$n.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ma).notify({query:this,type:"updated",action:t})})},X$);function NB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:EB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function GR(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function WR(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 gi,Ot,gp,Jr,Wc,ef,os,Tl,vp,tf,nf,Qc,Zc,Pl,rf,Vt,bm,y_,x_,b_,w_,S_,j_,E_,kB,G$,C0=(G$=class extends Tu{constructor(t,n){super();De(this,Vt);De(this,gi);De(this,Ot);De(this,gp);De(this,Jr);De(this,Wc);De(this,ef);De(this,os);De(this,Tl);De(this,vp);De(this,tf);De(this,nf);De(this,Qc);De(this,Zc);De(this,Pl);De(this,rf,new Set);this.options=n,Ne(this,gi,t),Ne(this,Tl,null),Ne(this,os,g_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Ot).addObserver(this),QR(W(this,Ot),this.options)?ot(this,Vt,bm).call(this):this.updateResult(),ot(this,Vt,w_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return __(W(this,Ot),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return __(W(this,Ot),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,Vt,S_).call(this),ot(this,Vt,j_).call(this),W(this,Ot).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,Ot);if(this.options=W(this,gi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ga(this.options.enabled,W(this,Ot))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ot(this,Vt,E_).call(this),W(this,Ot).setOptions(this.options),n._defaulted&&!$m(this.options,n)&&W(this,gi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Ot),observer:this});const i=this.hasListeners();i&&ZR(W(this,Ot),r,this.options,n)&&ot(this,Vt,bm).call(this),this.updateResult(),i&&(W(this,Ot)!==r||ga(this.options.enabled,W(this,Ot))!==ga(n.enabled,W(this,Ot))||$l(this.options.staleTime,W(this,Ot))!==$l(n.staleTime,W(this,Ot)))&&ot(this,Vt,y_).call(this);const a=ot(this,Vt,x_).call(this);i&&(W(this,Ot)!==r||ga(this.options.enabled,W(this,Ot))!==ga(n.enabled,W(this,Ot))||a!==W(this,Pl))&&ot(this,Vt,b_).call(this,a)}getOptimisticResult(t){const n=W(this,gi).getQueryCache().build(W(this,gi),t),r=this.createResult(n,t);return CJ(this,r)&&(Ne(this,Jr,r),Ne(this,ef,this.options),Ne(this,Wc,W(this,Ot).state)),r}getCurrentResult(){return W(this,Jr)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,os).status==="pending"&&W(this,os).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,rf).add(t)}getCurrentQuery(){return W(this,Ot)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,gi).defaultQueryOptions(t),r=W(this,gi).getQueryCache().build(W(this,gi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ot(this,Vt,bm).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Jr)))}createResult(t,n){var B;const r=W(this,Ot),i=this.options,a=W(this,Jr),o=W(this,Wc),l=W(this,ef),d=t!==r?t.state:W(this,gp),{state:m}=t;let h={...m},g=!1,v;if(n._optimisticResults){const I=this.hasListeners(),U=!I&&QR(t,n),L=I&&ZR(t,r,n,i);(U||L)&&(h={...h,...NB(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=h;v=h.data;let j=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let I;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=a.data,j=!0):I=typeof n.placeholderData=="function"?n.placeholderData((B=W(this,nf))==null?void 0:B.state.data,W(this,nf)):n.placeholderData,I!==void 0&&(S="success",v=p_(a==null?void 0:a.data,I,n),g=!0)}if(n.select&&v!==void 0&&!j)if(a&&v===(o==null?void 0:o.data)&&n.select===W(this,vp))v=W(this,tf);else try{Ne(this,vp,n.select),v=n.select(v),v=p_(a==null?void 0:a.data,v,n),Ne(this,tf,v),Ne(this,Tl,null)}catch(I){Ne(this,Tl,I)}W(this,Tl)&&(b=W(this,Tl),v=W(this,tf),w=Date.now(),S="error");const C=h.fetchStatus==="fetching",E=S==="pending",k=S==="error",O=E&&C,A=v!==void 0,M={status:S,fetchStatus:h.fetchStatus,isPending:E,isSuccess:S==="success",isError:k,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!E,isLoadingError:k&&!A,isPaused:h.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&A,isStale:$N(t,n),refetch:this.refetch,promise:W(this,os),isEnabled:ga(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=M.data!==void 0,U=M.status==="error"&&!I,L=K=>{U?K.reject(M.error):I&&K.resolve(M.data)},G=()=>{const K=Ne(this,os,M.promise=g_());L(K)},z=W(this,os);switch(z.status){case"pending":t.queryHash===r.queryHash&&L(z);break;case"fulfilled":(U||M.data!==z.value)&&G();break;case"rejected":(!U||M.error!==z.reason)&&G();break}}return M}updateResult(){const t=W(this,Jr),n=this.createResult(W(this,Ot),this.options);if(Ne(this,Wc,W(this,Ot).state),Ne(this,ef,this.options),W(this,Wc).data!==void 0&&Ne(this,nf,W(this,Ot)),$m(n,t))return;Ne(this,Jr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!W(this,rf).size)return!0;const o=new Set(a??W(this,rf));return this.options.throwOnError&&o.add("error"),Object.keys(W(this,Jr)).some(l=>{const u=l;return W(this,Jr)[u]!==t[u]&&o.has(u)})};ot(this,Vt,kB).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,Vt,w_).call(this)}},gi=new WeakMap,Ot=new WeakMap,gp=new WeakMap,Jr=new WeakMap,Wc=new WeakMap,ef=new WeakMap,os=new WeakMap,Tl=new WeakMap,vp=new WeakMap,tf=new WeakMap,nf=new WeakMap,Qc=new WeakMap,Zc=new WeakMap,Pl=new WeakMap,rf=new WeakMap,Vt=new WeakSet,bm=function(t){ot(this,Vt,E_).call(this);let n=W(this,Ot).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Br)),n},y_=function(){ot(this,Vt,S_).call(this);const t=$l(this.options.staleTime,W(this,Ot));if(au||W(this,Jr).isStale||!h_(t))return;const r=SB(W(this,Jr).dataUpdatedAt,t)+1;Ne(this,Qc,Bc.setTimeout(()=>{W(this,Jr).isStale||this.updateResult()},r))},x_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Ot)):this.options.refetchInterval)??!1},b_=function(t){ot(this,Vt,j_).call(this),Ne(this,Pl,t),!(au||ga(this.options.enabled,W(this,Ot))===!1||!h_(W(this,Pl))||W(this,Pl)===0)&&Ne(this,Zc,Bc.setInterval(()=>{(this.options.refetchIntervalInBackground||zN.isFocused())&&ot(this,Vt,bm).call(this)},W(this,Pl)))},w_=function(){ot(this,Vt,y_).call(this),ot(this,Vt,b_).call(this,ot(this,Vt,x_).call(this))},S_=function(){W(this,Qc)&&(Bc.clearTimeout(W(this,Qc)),Ne(this,Qc,void 0))},j_=function(){W(this,Zc)&&(Bc.clearInterval(W(this,Zc)),Ne(this,Zc,void 0))},E_=function(){const t=W(this,gi).getQueryCache().build(W(this,gi),this.options);if(t===W(this,Ot))return;const n=W(this,Ot);Ne(this,Ot,t),Ne(this,gp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},kB=function(t){$n.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Jr))}),W(this,gi).getQueryCache().notify({query:W(this,Ot),type:"observerResultsUpdated"})})},G$);function _J(e,t){return ga(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function QR(e,t){return _J(e,t)||e.state.data!==void 0&&__(e,t,t.refetchOnMount)}function __(e,t,n){if(ga(t.enabled,e)!==!1&&$l(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&$N(e,t)}return!1}function ZR(e,t,n,r){return(e!==t||ga(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&$N(e,n)}function $N(e,t){return ga(t.enabled,e)!==!1&&e.isStaleByTime($l(t.staleTime,e))}function CJ(e,t){return!$m(e.getCurrentResult(),t)}function Jy(e){return{onFetch:(t,n)=>{var m,h,g,v,b;const r=t.options,i=(g=(h=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:h.fetchMore)==null?void 0:g.direction,a=((v=t.state.data)==null?void 0:v.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let w=!1;const S=E=>{yJ(E,()=>t.signal,()=>w=!0)},j=jB(t.options,t.fetchOptions),C=async(E,k,O)=>{if(w)return Promise.reject();if(k==null&&E.pages.length)return Promise.resolve(E);const T=(()=>{const U={client:t.client,queryKey:t.queryKey,pageParam:k,direction:O?"backward":"forward",meta:t.options.meta};return S(U),U})(),M=await j(T),{maxPages:B}=t.options,I=O?vJ:gJ;return{pages:I(E.pages,M,B),pageParams:I(E.pageParams,k,B)}};if(i&&a.length){const E=i==="backward",k=E?AB:C_,O={pages:a,pageParams:o},A=k(r,O);l=await C(O,A,E)}else{const E=e??a.length;do{const k=u===0?o[0]??r.initialPageParam:C_(r,l);if(u>0&&k==null)break;l=await C(l,k),u++}while(u<E)}return l};t.options.persister?t.fetchFn=()=>{var w,S;return(S=(w=t.options).persister)==null?void 0:S.call(w,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function C_(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 AB(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}function NJ(e,t){return t?C_(e,t)!=null:!1}function kJ(e,t){return!t||!e.getPreviousPageParam?!1:AB(e,t)!=null}var AJ=class extends C0{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Jy()})}getOptimisticResult(e){return e.behavior=Jy(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var b,w;const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:l}=r,u=(w=(b=n.fetchMeta)==null?void 0:b.fetchMore)==null?void 0:w.direction,d=o&&u==="forward",m=i&&u==="forward",h=o&&u==="backward",g=i&&u==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:NJ(t,n.data),hasPreviousPage:kJ(t,n.data),isFetchNextPageError:d,isFetchingNextPage:m,isFetchPreviousPageError:h,isFetchingPreviousPage:g,isRefetchError:l&&!d&&!h,isRefetching:a&&!m&&!g}}},yp,po,zr,Jc,go,wl,W$,OJ=(W$=class extends CB{constructor(t){super();De(this,go);De(this,yp);De(this,po);De(this,zr);De(this,Jc);Ne(this,yp,t.client),this.mutationId=t.mutationId,Ne(this,zr,t.mutationCache),Ne(this,po,[]),this.state=t.state||OB(),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,po).includes(t)||(W(this,po).push(t),this.clearGcTimeout(),W(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ne(this,po,W(this,po).filter(n=>n!==t)),this.scheduleGc(),W(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,po).length||(this.state.status==="pending"?this.scheduleGc():W(this,zr).remove(this))}continue(){var t;return((t=W(this,Jc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,u,d,m,h,g,v,b,w,S,j,C,E,k,O,A,T;const n=()=>{ot(this,go,wl).call(this,{type:"continue"})},r={client:W(this,yp),meta:this.options.meta,mutationKey:this.options.mutationKey};Ne(this,Jc,_B({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,B)=>{ot(this,go,wl).call(this,{type:"failed",failureCount:M,error:B})},onPause:()=>{ot(this,go,wl).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,zr).canRun(this)}));const i=this.state.status==="pending",a=!W(this,Jc).canStart();try{if(i)n();else{ot(this,go,wl).call(this,{type:"pending",variables:t,isPaused:a}),W(this,zr).config.onMutate&&await W(this,zr).config.onMutate(t,this,r);const B=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));B!==this.state.context&&ot(this,go,wl).call(this,{type:"pending",context:B,variables:t,isPaused:a})}const M=await W(this,Jc).start();return await((d=(u=W(this,zr).config).onSuccess)==null?void 0:d.call(u,M,t,this.state.context,this,r)),await((h=(m=this.options).onSuccess)==null?void 0:h.call(m,M,t,this.state.context,r)),await((v=(g=W(this,zr).config).onSettled)==null?void 0:v.call(g,M,null,this.state.variables,this.state.context,this,r)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,M,null,t,this.state.context,r)),ot(this,go,wl).call(this,{type:"success",data:M}),M}catch(M){try{await((j=(S=W(this,zr).config).onError)==null?void 0:j.call(S,M,t,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((E=(C=this.options).onError)==null?void 0:E.call(C,M,t,this.state.context,r))}catch(B){Promise.reject(B)}try{await((O=(k=W(this,zr).config).onSettled)==null?void 0:O.call(k,void 0,M,this.state.variables,this.state.context,this,r))}catch(B){Promise.reject(B)}try{await((T=(A=this.options).onSettled)==null?void 0:T.call(A,void 0,M,t,this.state.context,r))}catch(B){Promise.reject(B)}throw ot(this,go,wl).call(this,{type:"error",error:M}),M}finally{W(this,zr).runNext(this)}}},yp=new WeakMap,po=new WeakMap,zr=new WeakMap,Jc=new WeakMap,go=new WeakSet,wl=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),$n.batch(()=>{W(this,po).forEach(r=>{r.onMutationUpdate(t)}),W(this,zr).notify({mutation:this,type:"updated",action:t})})},W$);function OB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ss,Ua,xp,Q$,TJ=(Q$=class extends Tu{constructor(t={}){super();De(this,ss);De(this,Ua);De(this,xp);this.config=t,Ne(this,ss,new Set),Ne(this,Ua,new Map),Ne(this,xp,0)}build(t,n,r){const i=new OJ({client:t,mutationCache:this,mutationId:++Kv(this,xp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,ss).add(t);const n=Xv(t);if(typeof n=="string"){const r=W(this,Ua).get(n);r?r.push(t):W(this,Ua).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,ss).delete(t)){const n=Xv(t);if(typeof n=="string"){const r=W(this,Ua).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&W(this,Ua).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Xv(t);if(typeof n=="string"){const r=W(this,Ua).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Xv(t);if(typeof n=="string"){const i=(r=W(this,Ua).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){$n.batch(()=>{W(this,ss).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,ss).clear(),W(this,Ua).clear()})}getAll(){return Array.from(W(this,ss))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>KR(n,r))}findAll(t={}){return this.getAll().filter(n=>KR(t,n))}notify(t){$n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return $n.batch(()=>Promise.all(t.map(n=>n.continue().catch(Br))))}},ss=new WeakMap,Ua=new WeakMap,xp=new WeakMap,Q$);function Xv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ls,Ml,vi,cs,vs,Iy,N_,Z$,PJ=(Z$=class extends Tu{constructor(n,r){super();De(this,vs);De(this,ls);De(this,Ml);De(this,vi);De(this,cs);Ne(this,ls,n),this.setOptions(r),this.bindMethods(),ot(this,vs,Iy).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=W(this,ls).defaultMutationOptions(n),$m(this.options,r)||W(this,ls).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,vi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ou(r.mutationKey)!==ou(this.options.mutationKey)?this.reset():((i=W(this,vi))==null?void 0:i.state.status)==="pending"&&W(this,vi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,vi))==null||n.removeObserver(this)}onMutationUpdate(n){ot(this,vs,Iy).call(this),ot(this,vs,N_).call(this,n)}getCurrentResult(){return W(this,Ml)}reset(){var n;(n=W(this,vi))==null||n.removeObserver(this),Ne(this,vi,void 0),ot(this,vs,Iy).call(this),ot(this,vs,N_).call(this)}mutate(n,r){var i;return Ne(this,cs,r),(i=W(this,vi))==null||i.removeObserver(this),Ne(this,vi,W(this,ls).getMutationCache().build(W(this,ls),this.options)),W(this,vi).addObserver(this),W(this,vi).execute(n)}},ls=new WeakMap,Ml=new WeakMap,vi=new WeakMap,cs=new WeakMap,vs=new WeakSet,Iy=function(){var r;const n=((r=W(this,vi))==null?void 0:r.state)??OB();Ne(this,Ml,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},N_=function(n){$n.batch(()=>{var r,i,a,o,l,u,d,m;if(W(this,cs)&&this.hasListeners()){const h=W(this,Ml).variables,g=W(this,Ml).context,v={client:W(this,ls),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,cs)).onSuccess)==null||i.call(r,n.data,h,g,v)}catch(b){Promise.reject(b)}try{(o=(a=W(this,cs)).onSettled)==null||o.call(a,n.data,null,h,g,v)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(u=(l=W(this,cs)).onError)==null||u.call(l,n.error,h,g,v)}catch(b){Promise.reject(b)}try{(m=(d=W(this,cs)).onSettled)==null||m.call(d,void 0,n.error,h,g,v)}catch(b){Promise.reject(b)}}}this.listeners.forEach(h=>{h(W(this,Ml))})})},Z$);function JR(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function MJ(e,t,n){const r=e.slice(0);return r[t]=n,r}var af,Mi,of,sf,pa,Rl,bp,wp,Sp,jp,Dr,k_,A_,O_,T_,P_,J$,RJ=(J$=class extends Tu{constructor(t,n,r){super();De(this,Dr);De(this,af);De(this,Mi);De(this,of);De(this,sf);De(this,pa);De(this,Rl);De(this,bp);De(this,wp);De(this,Sp);De(this,jp,[]);Ne(this,af,t),Ne(this,sf,r),Ne(this,of,[]),Ne(this,pa,[]),Ne(this,Mi,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,pa).forEach(t=>{t.subscribe(n=>{ot(this,Dr,T_).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,pa).forEach(t=>{t.destroy()})}setQueries(t,n){Ne(this,of,t),Ne(this,sf,n),$n.batch(()=>{const r=W(this,pa),i=ot(this,Dr,O_).call(this,W(this,of));i.forEach(h=>h.observer.setOptions(h.defaultedQueryOptions));const a=i.map(h=>h.observer),o=a.map(h=>h.getCurrentResult()),l=r.length!==a.length,u=a.some((h,g)=>h!==r[g]),d=l||u,m=d?!0:o.some((h,g)=>{const v=W(this,Mi)[g];return!v||!$m(h,v)});!d&&!m||(d&&(Ne(this,jp,i),Ne(this,pa,a)),Ne(this,Mi,o),this.hasListeners()&&(d&&(JR(r,a).forEach(h=>{h.destroy()}),JR(a,r).forEach(h=>{h.subscribe(g=>{ot(this,Dr,T_).call(this,h,g)})})),ot(this,Dr,P_).call(this)))})}getCurrentResult(){return W(this,Mi)}getQueries(){return W(this,pa).map(t=>t.getCurrentQuery())}getObservers(){return W(this,pa)}getOptimisticResult(t,n){const r=ot(this,Dr,O_).call(this,t),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>ot(this,Dr,A_).call(this,o??i,n,a),()=>ot(this,Dr,k_).call(this,i,r)]}},af=new WeakMap,Mi=new WeakMap,of=new WeakMap,sf=new WeakMap,pa=new WeakMap,Rl=new WeakMap,bp=new WeakMap,wp=new WeakMap,Sp=new WeakMap,jp=new WeakMap,Dr=new WeakSet,k_=function(t,n){return n.map((r,i)=>{const a=t[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,o=>{n.forEach(l=>{l.observer.trackProp(o)})})})},A_=function(t,n,r){if(n){const i=W(this,Sp),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((o,l)=>o!==i[l]));return(!W(this,Rl)||W(this,Mi)!==W(this,wp)||a||n!==W(this,bp))&&(Ne(this,bp,n),Ne(this,wp,W(this,Mi)),r!==void 0&&Ne(this,Sp,r),Ne(this,Rl,DN(W(this,Rl),n(t)))),W(this,Rl)}return t},O_=function(t){const n=new Map;W(this,pa).forEach(i=>{const a=i.options.queryHash;if(!a)return;const o=n.get(a);o?o.push(i):n.set(a,[i])});const r=[];return t.forEach(i=>{var u;const a=W(this,af).defaultQueryOptions(i),l=((u=n.get(a.queryHash))==null?void 0:u.shift())??new C0(W(this,af),a);r.push({defaultedQueryOptions:a,observer:l})}),r},T_=function(t,n){const r=W(this,pa).indexOf(t);r!==-1&&(Ne(this,Mi,MJ(W(this,Mi),r,n)),ot(this,Dr,P_).call(this))},P_=function(){var t;if(this.hasListeners()){const n=W(this,Rl),r=ot(this,Dr,k_).call(this,W(this,Mi),W(this,jp)),i=ot(this,Dr,A_).call(this,r,(t=W(this,sf))==null?void 0:t.combine);n!==i&&$n.batch(()=>{this.listeners.forEach(a=>{a(W(this,Mi))})})}},J$),vo,eB,DJ=(eB=class extends Tu{constructor(t={}){super();De(this,vo);this.config=t,Ne(this,vo,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??RN(i,n);let o=this.get(a);return o||(o=new EJ({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){W(this,vo).has(t.queryHash)||(W(this,vo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,vo).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,vo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$n.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,vo).get(t)}getAll(){return[...W(this,vo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>VR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>VR(t,r)):n}notify(t){$n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){$n.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$n.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},vo=new WeakMap,eB),In,Dl,Il,lf,cf,Ll,uf,df,tB,IJ=(tB=class{constructor(e={}){De(this,In);De(this,Dl);De(this,Il);De(this,lf);De(this,cf);De(this,Ll);De(this,uf);De(this,df);Ne(this,In,e.queryCache||new DJ),Ne(this,Dl,e.mutationCache||new TJ),Ne(this,Il,e.defaultOptions||{}),Ne(this,lf,new Map),Ne(this,cf,new Map),Ne(this,Ll,0)}mount(){Kv(this,Ll)._++,W(this,Ll)===1&&(Ne(this,uf,zN.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,In).onFocus())})),Ne(this,df,Zy.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,In).onOnline())})))}unmount(){var e,t;Kv(this,Ll)._--,W(this,Ll)===0&&((e=W(this,uf))==null||e.call(this),Ne(this,uf,void 0),(t=W(this,df))==null||t.call(this),Ne(this,df,void 0))}isFetching(e){return W(this,In).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Dl).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,In).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,In).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime($l(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,In).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=W(this,In).get(r.queryHash),a=i==null?void 0:i.state.data,o=hJ(t,a);if(o!==void 0)return W(this,In).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return $n.batch(()=>W(this,In).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,In).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,In);$n.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,In);return $n.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=$n.batch(()=>W(this,In).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Br).catch(Br)}invalidateQueries(e,t={}){return $n.batch(()=>(W(this,In).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=$n.batch(()=>W(this,In).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Br)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Br)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,In).build(this,t);return n.isStaleByTime($l(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Br).catch(Br)}fetchInfiniteQuery(e){return e.behavior=Jy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Br).catch(Br)}ensureInfiniteQueryData(e){return e.behavior=Jy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Zy.isOnline()?W(this,Dl).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,In)}getMutationCache(){return W(this,Dl)}getDefaultOptions(){return W(this,Il)}setDefaultOptions(e){Ne(this,Il,e)}setQueryDefaults(e,t){W(this,lf).set(ou(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,lf).values()],n={};return t.forEach(r=>{zm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,cf).set(ou(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,cf).values()],n={};return t.forEach(r=>{zm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Il).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=RN(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===IN&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Il).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,In).clear(),W(this,Dl).clear()}},In=new WeakMap,Dl=new WeakMap,Il=new WeakMap,lf=new WeakMap,cf=new WeakMap,Ll=new WeakMap,uf=new WeakMap,df=new WeakMap,tB),TB=y.createContext(void 0),Qe=e=>{const t=y.useContext(TB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},LJ=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(TB.Provider,{value:e,children:t})),PB=y.createContext(!1),MB=()=>y.useContext(PB);PB.Provider;function zJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $J=y.createContext(zJ()),RB=()=>y.useContext($J),DB=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?LN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},IB=e=>{y.useEffect(()=>{e.clearReset()},[e])},LB=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||LN(n,[e.error,r])),zB=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},BJ=(e,t)=>e.isLoading&&e.isFetching&&!t,M_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,R_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function FJ({queries:e,...t},n){const r=Qe(),i=MB(),a=RB(),o=y.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);o.forEach(w=>{zB(w);const S=r.getQueryCache().get(w.queryHash);DB(w,a,S)}),IB(a);const[l]=y.useState(()=>new RJ(r,o,t)),[u,d,m]=l.getOptimisticResult(o,t.combine),h=!i&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(w=>h?l.subscribe($n.batchCalls(w)):Br,[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const v=u.some((w,S)=>M_(o[S],w))?u.flatMap((w,S)=>{const j=o[S];if(j&&M_(j,w)){const C=new C0(r,j);return R_(j,C,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=u.find((w,S)=>{const j=o[S];return j&&LB({result:w,errorResetBoundary:a,throwOnError:j.throwOnError,query:r.getQueryCache().get(j.queryHash),suspense:j.suspense})});if(b!=null&&b.error)throw b.error;return d(m())}function $B(e,t,n){var g,v,b,w;const r=MB(),i=RB(),a=Qe(),o=a.defaultQueryOptions(e);(v=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||v.call(g,o);const l=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",zB(o),DB(o,i,l),IB(i);const u=!a.getQueryCache().get(o.queryHash),[d]=y.useState(()=>new t(a,o)),m=d.getOptimisticResult(o),h=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(S=>{const j=h?d.subscribe($n.batchCalls(S)):Br;return d.updateResult(),j},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),y.useEffect(()=>{d.setOptions(o)},[o,d]),M_(o,m))throw R_(o,d,i);if(LB({result:m,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw m.error;if((w=(b=a.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||w.call(b,o,m),o.experimental_prefetchInRender&&!au&&BJ(m,r)){const S=u?R_(o,d,i):l==null?void 0:l.promise;S==null||S.catch(Br).finally(()=>{d.updateResult()})}return o.notifyOnChangeProps?m:d.trackResult(m)}function Pn(e,t){return $B(e,C0)}function ut(e,t){const n=Qe(),[r]=y.useState(()=>new PJ(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const i=y.useSyncExternalStore(y.useCallback(o=>r.subscribe($n.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((o,l)=>{r.mutate(o,l).catch(Br)},[r]);if(i.error&&LN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function UJ(e,t){return $B(e,AJ)}var HJ=(e,t,n,r,i,a,o,l)=>{let u=document.documentElement,d=["light","dark"];function m(v){(Array.isArray(e)?e:[e]).forEach(b=>{let w=b==="class",S=w&&a?i.map(j=>a[j]||j):i;w?(u.classList.remove(...S),u.classList.add(a&&a[v]?a[v]:v)):u.setAttribute(b,v)}),h(v)}function h(v){l&&d.includes(v)&&(u.style.colorScheme=v)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let v=localStorage.getItem(t)||n,b=o&&v==="system"?g():v;m(b)}catch{}},eD=["light","dark"],BB="(prefers-color-scheme: dark)",qJ=typeof window>"u",BN=y.createContext(void 0),VJ={setTheme:e=>{},themes:[]},FN=()=>{var e;return(e=y.useContext(BN))!=null?e:VJ},KJ=e=>y.useContext(BN)?y.createElement(y.Fragment,null,e.children):y.createElement(XJ,{...e}),YJ=["light","dark"],XJ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:a=YJ,defaultTheme:o=n?"system":"light",attribute:l="data-theme",value:u,children:d,nonce:m,scriptProps:h})=>{let[g,v]=y.useState(()=>WJ(i,o)),[b,w]=y.useState(()=>g==="system"?IS():g),S=u?Object.values(u):a,j=y.useCallback(O=>{let A=O;if(!A)return;O==="system"&&n&&(A=IS());let T=u?u[A]:A,M=t?QJ(m):null,B=document.documentElement,I=U=>{U==="class"?(B.classList.remove(...S),T&&B.classList.add(T)):U.startsWith("data-")&&(T?B.setAttribute(U,T):B.removeAttribute(U))};if(Array.isArray(l)?l.forEach(I):I(l),r){let U=eD.includes(o)?o:null,L=eD.includes(A)?A:U;B.style.colorScheme=L}M==null||M()},[m]),C=y.useCallback(O=>{let A=typeof O=="function"?O(g):O;v(A);try{localStorage.setItem(i,A)}catch{}},[g]),E=y.useCallback(O=>{let A=IS(O);w(A),g==="system"&&n&&!e&&j("system")},[g,e]);y.useEffect(()=>{let O=window.matchMedia(BB);return O.addListener(E),E(O),()=>O.removeListener(E)},[E]),y.useEffect(()=>{let O=A=>{A.key===i&&(A.newValue?v(A.newValue):C(o))};return window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)},[C]),y.useEffect(()=>{j(e??g)},[e,g]);let k=y.useMemo(()=>({theme:g,setTheme:C,forcedTheme:e,resolvedTheme:g==="system"?b:g,themes:n?[...a,"system"]:a,systemTheme:n?b:void 0}),[g,C,e,b,n,a]);return y.createElement(BN.Provider,{value:k},y.createElement(GJ,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:u,themes:a,nonce:m,scriptProps:h}),d)},GJ=y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:l,nonce:u,scriptProps:d})=>{let m=JSON.stringify([n,t,a,e,l,o,r,i]).slice(1,-1);return y.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${HJ.toString()})(${m})`}})}),WJ=(e,t)=>{if(qJ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},QJ=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)}},IS=e=>(e||(e=window.matchMedia(BB)),e.matches?"dark":"light");function tD(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xs(...e){return t=>{let n=!1;const r=e.map(i=>{const a=tD(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():tD(e[i],null)}}}}function St(...e){return y.useCallback(xs(...e),e)}function su(e){const t=ZJ(e),n=y.forwardRef((r,i)=>{const{children:a,...o}=r,l=y.Children.toArray(a),u=l.find(eee);if(u){const d=u.props.children,m=l.map(h=>h===u?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:h);return f.jsx(t,{...o,ref:i,children:y.isValidElement(d)?y.cloneElement(d,void 0,m):null})}return f.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var UN=su("Slot");function ZJ(e){const t=y.forwardRef((n,r)=>{const{children:i,...a}=n;if(y.isValidElement(i)){const o=nee(i),l=tee(a,i.props);return i.type!==y.Fragment&&(l.ref=r?xs(r,o):o),y.cloneElement(i,l)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var FB=Symbol("radix.slottable");function JJ(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=FB,t}function eee(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FB}function tee(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...l)=>{const u=a(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function nee(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ree=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=ree.reduce((e,t)=>{const n=su(`Primitive.${t}`),r=y.forwardRef((i,a)=>{const{asChild:o,...l}=i,u=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function UB(e,t){e&&Ql.flushSync(()=>e.dispatchEvent(t))}var HB=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"}),iee="VisuallyHidden",qB=y.forwardRef((e,t)=>f.jsx(Ke.span,{...e,ref:t,style:{...HB,...e.style}}));qB.displayName=iee;var aee=qB;function oee(e,t){const n=y.createContext(t),r=a=>{const{children:o,...l}=a,u=y.useMemo(()=>l,Object.values(l));return f.jsx(n.Provider,{value:u,children:o})};r.displayName=e+"Provider";function i(a){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Oa(e,t=[]){let n=[];function r(a,o){const l=y.createContext(o),u=n.length;n=[...n,o];const d=h=>{var j;const{scope:g,children:v,...b}=h,w=((j=g==null?void 0:g[e])==null?void 0:j[u])||l,S=y.useMemo(()=>b,Object.values(b));return f.jsx(w.Provider,{value:S,children:v})};d.displayName=a+"Provider";function m(h,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[u])||l,b=y.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[d,m]}const i=()=>{const a=n.map(o=>y.createContext(o));return function(l){const u=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,see(i,...t)]}function see(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const h=u(a)[`__scope${d}`];return{...l,...h}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function HN(e){const t=e+"CollectionProvider",[n,r]=Oa(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:S,children:j}=w,C=Ce.useRef(null),E=Ce.useRef(new Map).current;return f.jsx(i,{scope:S,itemMap:E,collectionRef:C,children:j})};o.displayName=t;const l=e+"CollectionSlot",u=su(l),d=Ce.forwardRef((w,S)=>{const{scope:j,children:C}=w,E=a(l,j),k=St(S,E.collectionRef);return f.jsx(u,{ref:k,children:C})});d.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",g=su(m),v=Ce.forwardRef((w,S)=>{const{scope:j,children:C,...E}=w,k=Ce.useRef(null),O=St(S,k),A=a(m,j);return Ce.useEffect(()=>(A.itemMap.set(k,{ref:k,...E}),()=>void A.itemMap.delete(k))),f.jsx(g,{[h]:"",ref:O,children:C})});v.displayName=m;function b(w){const S=a(e+"CollectionConsumer",w);return Ce.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const E=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(S.itemMap.values()).sort((A,T)=>E.indexOf(A.ref.current)-E.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},b,r]}function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var jr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},lee=NN[" useInsertionEffect ".trim().toString()]||jr;function bs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=cee({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const h=m.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"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=l},[l,r])}const d=y.useCallback(m=>{var h;if(l){const g=uee(m)?m(e):m;g!==e&&((h=o.current)==null||h.call(o,g))}else a(m)},[l,e,a,o]);return[u,d]}function cee({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return lee(()=>{a.current=t},[t]),y.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,r,a]}function uee(e){return typeof e=="function"}function dee(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=fee(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=St(r.ref,hee(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};qr.displayName="Presence";function fee(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,u]=dee(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=Gv(r.current);a.current=l==="mounted"?d:"none"},[l]),jr(()=>{const d=r.current,m=i.current;if(m!==e){const g=a.current,v=Gv(d);e?u("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),jr(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,h=v=>{const w=Gv(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(u("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=v=>{v.target===t&&(a.current=Gv(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Gv(e){return(e==null?void 0:e.animationName)||"none"}function hee(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mee=NN[" useId ".trim().toString()]||(()=>{}),pee=0;function Sr(e){const[t,n]=y.useState(mee());return jr(()=>{n(r=>r??String(pee++))},[e]),e||(t?`radix-${t}`:"")}var N0="Collapsible",[gee]=Oa(N0),[vee,qN]=gee(N0),VB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[u,d]=bs({prop:r,defaultProp:i??!1,onChange:o,caller:N0});return f.jsx(vee,{scope:n,disabled:a,contentId:Sr(),open:u,onOpenToggle:y.useCallback(()=>d(m=>!m),[d]),children:f.jsx(Ke.div,{"data-state":KN(u),"data-disabled":a?"":void 0,...l,ref:t})})});VB.displayName=N0;var KB="CollapsibleTrigger",YB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=qN(KB,n);return f.jsx(Ke.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":KN(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Oe(e.onClick,i.onOpenToggle)})});YB.displayName=KB;var VN="CollapsibleContent",XB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=qN(VN,e.__scopeCollapsible);return f.jsx(qr,{present:n||i.open,children:({present:a})=>f.jsx(yee,{...r,ref:t,present:a})})});XB.displayName=VN;var yee=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=qN(VN,n),[l,u]=y.useState(r),d=y.useRef(null),m=St(t,d),h=y.useRef(0),g=h.current,v=y.useRef(0),b=v.current,w=o.open||l,S=y.useRef(w),j=y.useRef(void 0);return y.useEffect(()=>{const C=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(C)},[]),jr(()=>{const C=d.current;if(C){j.current=j.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const E=C.getBoundingClientRect();h.current=E.height,v.current=E.width,S.current||(C.style.transitionDuration=j.current.transitionDuration,C.style.animationName=j.current.animationName),u(r)}},[o.open,r]),f.jsx(Ke.div,{"data-state":KN(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...a,ref:m,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:w&&i})});function KN(e){return e?"open":"closed"}var xee=VB,bee=y.createContext(void 0);function Np(e){const t=y.useContext(bee);return e||t||"ltr"}function Rr(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function wee(e,t=globalThis==null?void 0:globalThis.document){const n=Rr(e);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var See="DismissableLayer",D_="dismissableLayer.update",jee="dismissableLayer.pointerDownOutside",Eee="dismissableLayer.focusOutside",nD,GB=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kp=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...u}=e,d=y.useContext(GB),[m,h]=y.useState(null),g=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),b=St(t,T=>h(T)),w=Array.from(d.layers),[S]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf(S),C=m?w.indexOf(m):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,k=C>=j,O=Nee(T=>{const M=T.target,B=[...d.branches].some(I=>I.contains(M));!k||B||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},g),A=kee(T=>{const M=T.target;[...d.branches].some(I=>I.contains(M))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},g);return wee(T=>{C===d.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),y.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(nD=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),rD(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=nD)}},[m,g,n,d]),y.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),rD())},[m,d]),y.useEffect(()=>{const T=()=>v({});return document.addEventListener(D_,T),()=>document.removeEventListener(D_,T)},[]),f.jsx(Ke.div,{...u,ref:b,style:{pointerEvents:E?k?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,O.onPointerDownCapture)})});kp.displayName=See;var _ee="DismissableLayerBranch",Cee=y.forwardRef((e,t)=>{const n=y.useContext(GB),r=y.useRef(null),i=St(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),f.jsx(Ke.div,{...e,ref:i})});Cee.displayName=_ee;function Nee(e,t=globalThis==null?void 0:globalThis.document){const n=Rr(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let u=function(){WB(jee,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kee(e,t=globalThis==null?void 0:globalThis.document){const n=Rr(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&WB(Eee,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function rD(){const e=new CustomEvent(D_);document.dispatchEvent(e)}function WB(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?UB(i,a):i.dispatchEvent(a)}var LS="focusScope.autoFocusOnMount",zS="focusScope.autoFocusOnUnmount",iD={bubbles:!1,cancelable:!0},Aee="FocusScope",k0=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,u]=y.useState(null),d=Rr(i),m=Rr(a),h=y.useRef(null),g=St(t,w=>u(w)),v=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let w=function(E){if(v.paused||!l)return;const k=E.target;l.contains(k)?h.current=k:Sl(h.current,{select:!0})},S=function(E){if(v.paused||!l)return;const k=E.relatedTarget;k!==null&&(l.contains(k)||Sl(h.current,{select:!0}))},j=function(E){if(document.activeElement===document.body)for(const O of E)O.removedNodes.length>0&&Sl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const C=new MutationObserver(j);return l&&C.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),C.disconnect()}}},[r,l,v.paused]),y.useEffect(()=>{if(l){oD.add(v);const w=document.activeElement;if(!l.contains(w)){const j=new CustomEvent(LS,iD);l.addEventListener(LS,d),l.dispatchEvent(j),j.defaultPrevented||(Oee(Dee(QB(l)),{select:!0}),document.activeElement===w&&Sl(l))}return()=>{l.removeEventListener(LS,d),setTimeout(()=>{const j=new CustomEvent(zS,iD);l.addEventListener(zS,m),l.dispatchEvent(j),j.defaultPrevented||Sl(w??document.body,{select:!0}),l.removeEventListener(zS,m),oD.remove(v)},0)}}},[l,d,m,v]);const b=y.useCallback(w=>{if(!n&&!r||v.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,j=document.activeElement;if(S&&j){const C=w.currentTarget,[E,k]=Tee(C);E&&k?!w.shiftKey&&j===k?(w.preventDefault(),n&&Sl(E,{select:!0})):w.shiftKey&&j===E&&(w.preventDefault(),n&&Sl(k,{select:!0})):j===C&&w.preventDefault()}},[n,r,v.paused]);return f.jsx(Ke.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});k0.displayName=Aee;function Oee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Sl(r,{select:t}),document.activeElement!==n)return}function Tee(e){const t=QB(e),n=aD(t,e),r=aD(t.reverse(),e);return[n,r]}function QB(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function aD(e,t){for(const n of e)if(!Pee(n,{upTo:t}))return n}function Pee(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 Mee(e){return e instanceof HTMLInputElement&&"select"in e}function Sl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Mee(e)&&t&&e.select()}}var oD=Ree();function Ree(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sD(e,t),e.unshift(t)},remove(t){var n;e=sD(e,t),(n=e[0])==null||n.resume()}}}function sD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Dee(e){return e.filter(t=>t.tagName!=="A")}var Iee="Portal",Ap=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=y.useState(!1);jr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?wB.createPortal(f.jsx(Ke.div,{...r,ref:t}),o):null});Ap.displayName=Iee;var $S=0;function YN(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lD()),document.body.insertAdjacentElement("beforeend",e[1]??lD()),$S++,()=>{$S===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),$S--}},[])}function lD(){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 xo=function(){return xo=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},xo.apply(this,arguments)};function ZB(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Lee(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ly="right-scroll-bar-position",zy="width-before-scroll-bar",zee="with-scroll-bars-hidden",$ee="--removed-body-scroll-bar-size";function BS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Bee(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Fee=typeof window<"u"?y.useLayoutEffect:y.useEffect,cD=new WeakMap;function Uee(e,t){var n=Bee(null,function(r){return e.forEach(function(i){return BS(i,r)})});return Fee(function(){var r=cD.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||BS(l,null)}),a.forEach(function(l){i.has(l)||BS(l,o)})}cD.set(n,e)},[e]),n}function Hee(e){return e}function qee(e,t){t===void 0&&(t=Hee);var n=[],r=!1,i={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(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var u=function(){var m=o;o=[],m.forEach(a)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(m){o.push(m),d()},filter:function(m){return o=o.filter(m),n}}}};return i}function Vee(e){e===void 0&&(e={});var t=qee(null);return t.options=xo({async:!0,ssr:!1},e),t}var JB=function(e){var t=e.sideCar,n=ZB(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 y.createElement(r,xo({},n))};JB.isSideCarExport=!0;function Kee(e,t){return e.useMedium(t),JB}var e6=Vee(),FS=function(){},A0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:FS,onWheelCapture:FS,onTouchMoveCapture:FS}),i=r[0],a=r[1],o=e.forwardProps,l=e.children,u=e.className,d=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,j=e.as,C=j===void 0?"div":j,E=e.gapMode,k=ZB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=Uee([n,t]),T=xo(xo({},k),i);return y.createElement(y.Fragment,null,m&&y.createElement(O,{sideCar:e6,removeScrollBar:d,shards:h,noRelative:v,noIsolation:b,inert:w,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:E}),o?y.cloneElement(y.Children.only(l),xo(xo({},T),{ref:A})):y.createElement(C,xo({},T,{className:u,ref:A}),l))});A0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};A0.classNames={fullWidth:zy,zeroRight:Ly};var Yee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Yee();return t&&e.setAttribute("nonce",t),e}function Gee(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wee(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Qee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xee())&&(Gee(t,n),Wee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zee=function(){var e=Qee();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},t6=function(){var e=Zee(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Jee={left:0,top:0,right:0,gap:0},US=function(e){return parseInt(e||"",10)||0},ete=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[US(n),US(r),US(i)]},tte=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Jee;var t=ete(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])}},nte=t6(),Hd="data-scroll-locked",rte=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(zee,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(Hd,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(a,`px;
    padding-right: `).concat(o,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(Ly,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(zy,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(Ly," .").concat(Ly,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(zy," .").concat(zy,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Hd,`] {
    `).concat($ee,": ").concat(l,`px;
  }
`)},uD=function(){var e=parseInt(document.body.getAttribute(Hd)||"0",10);return isFinite(e)?e:0},ite=function(){y.useEffect(function(){return document.body.setAttribute(Hd,(uD()+1).toString()),function(){var e=uD()-1;e<=0?document.body.removeAttribute(Hd):document.body.setAttribute(Hd,e.toString())}},[])},ate=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;ite();var a=y.useMemo(function(){return tte(i)},[i]);return y.createElement(nte,{styles:rte(a,!t,i,n?"":"!important")})},I_=!1;if(typeof window<"u")try{var Wv=Object.defineProperty({},"passive",{get:function(){return I_=!0,!0}});window.addEventListener("test",Wv,Wv),window.removeEventListener("test",Wv,Wv)}catch{I_=!1}var Sd=I_?{passive:!1}:!1,ote=function(e){return e.tagName==="TEXTAREA"},n6=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ote(e)&&n[t]==="visible")},ste=function(e){return n6(e,"overflowY")},lte=function(e){return n6(e,"overflowX")},dD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=r6(e,r);if(i){var a=i6(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cte=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ute=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},r6=function(e,t){return e==="v"?ste(t):lte(t)},i6=function(e,t){return e==="v"?cte(t):ute(t)},dte=function(e,t){return e==="h"&&t==="rtl"?-1:1},fte=function(e,t,n,r,i){var a=dte(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,u=t.contains(l),d=!1,m=o>0,h=0,g=0;do{if(!l)break;var v=i6(e,l),b=v[0],w=v[1],S=v[2],j=w-S-a*b;(b||j)&&r6(e,l)&&(h+=j,g+=b);var C=l.parentNode;l=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(m&&Math.abs(h)<1||!m&&Math.abs(g)<1)&&(d=!0),d},Qv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fD=function(e){return[e.deltaX,e.deltaY]},hD=function(e){return e&&"current"in e?e.current:e},hte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mte=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},pte=0,jd=[];function gte(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(pte++)[0],a=y.useState(t6)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=Lee([e.lockRef.current],(e.shards||[]).map(hD),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var j=Qv(w),C=n.current,E="deltaX"in w?w.deltaX:C[0]-j[0],k="deltaY"in w?w.deltaY:C[1]-j[1],O,A=w.target,T=Math.abs(E)>Math.abs(k)?"h":"v";if("touches"in w&&T==="h"&&A.type==="range")return!1;var M=window.getSelection(),B=M&&M.anchorNode,I=B?B===A||B.contains(A):!1;if(I)return!1;var U=dD(T,A);if(!U)return!0;if(U?O=T:(O=T==="v"?"h":"v",U=dD(T,A)),!U)return!1;if(!r.current&&"changedTouches"in w&&(E||k)&&(r.current=O),!O)return!0;var L=r.current||O;return fte(L,S,w,L==="h"?E:k)},[]),u=y.useCallback(function(w){var S=w;if(!(!jd.length||jd[jd.length-1]!==a)){var j="deltaY"in S?fD(S):Qv(S),C=t.current.filter(function(O){return O.name===S.type&&(O.target===S.target||S.target===O.shadowParent)&&hte(O.delta,j)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var E=(o.current.shards||[]).map(hD).filter(Boolean).filter(function(O){return O.contains(S.target)}),k=E.length>0?l(S,E[0]):!o.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),d=y.useCallback(function(w,S,j,C){var E={name:w,delta:S,target:j,should:C,shadowParent:vte(j)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(k){return k!==E})},1)},[]),m=y.useCallback(function(w){n.current=Qv(w),r.current=void 0},[]),h=y.useCallback(function(w){d(w.type,fD(w),w.target,l(w,e.lockRef.current))},[]),g=y.useCallback(function(w){d(w.type,Qv(w),w.target,l(w,e.lockRef.current))},[]);y.useEffect(function(){return jd.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Sd),document.addEventListener("touchmove",u,Sd),document.addEventListener("touchstart",m,Sd),function(){jd=jd.filter(function(w){return w!==a}),document.removeEventListener("wheel",u,Sd),document.removeEventListener("touchmove",u,Sd),document.removeEventListener("touchstart",m,Sd)}},[]);var v=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(a,{styles:mte(i)}):null,v?y.createElement(ate,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vte(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const yte=Kee(e6,gte);var O0=y.forwardRef(function(e,t){return y.createElement(A0,xo({},e,{ref:t,sideCar:yte}))});O0.classNames=A0.classNames;var xte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ed=new WeakMap,Zv=new WeakMap,Jv={},HS=0,a6=function(e){return e&&(e.host||a6(e.parentNode))},bte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=a6(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})},wte=function(e,t,n,r){var i=bte(t,Array.isArray(e)?e:[e]);Jv[n]||(Jv[n]=new WeakMap);var a=Jv[n],o=[],l=new Set,u=new Set(i),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};i.forEach(d);var m=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(g){if(l.has(g))m(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",w=(Ed.get(g)||0)+1,S=(a.get(g)||0)+1;Ed.set(g,w),a.set(g,S),o.push(g),w===1&&b&&Zv.set(g,!0),S===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(j){console.error("aria-hidden: cannot operate on ",g,j)}})};return m(t),l.clear(),HS++,function(){o.forEach(function(h){var g=Ed.get(h)-1,v=a.get(h)-1;Ed.set(h,g),a.set(h,v),g||(Zv.has(h)||h.removeAttribute(r),Zv.delete(h)),v||h.removeAttribute(n)}),HS--,HS||(Ed=new WeakMap,Ed=new WeakMap,Zv=new WeakMap,Jv={})}},XN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=xte(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),wte(r,i,n,"aria-hidden")):function(){return null}},T0="Dialog",[o6]=Oa(T0),[Ste,no]=o6(T0),s6=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=y.useRef(null),u=y.useRef(null),[d,m]=bs({prop:r,defaultProp:i??!1,onChange:a,caller:T0});return f.jsx(Ste,{scope:t,triggerRef:l,contentRef:u,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),open:d,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(h=>!h),[m]),modal:o,children:n})};s6.displayName=T0;var l6="DialogTrigger",jte=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(l6,n),a=St(t,i.triggerRef);return f.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":QN(i.open),...r,ref:a,onClick:Oe(e.onClick,i.onOpenToggle)})});jte.displayName=l6;var GN="DialogPortal",[Ete,c6]=o6(GN,{forceMount:void 0}),u6=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=no(GN,t);return f.jsx(Ete,{scope:t,forceMount:n,children:y.Children.map(r,o=>f.jsx(qr,{present:n||a.open,children:f.jsx(Ap,{asChild:!0,container:i,children:o})}))})};u6.displayName=GN;var ex="DialogOverlay",d6=y.forwardRef((e,t)=>{const n=c6(ex,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=no(ex,e.__scopeDialog);return a.modal?f.jsx(qr,{present:r||a.open,children:f.jsx(Cte,{...i,ref:t})}):null});d6.displayName=ex;var _te=su("DialogOverlay.RemoveScroll"),Cte=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(ex,n);return f.jsx(O0,{as:_te,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(Ke.div,{"data-state":QN(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),lu="DialogContent",f6=y.forwardRef((e,t)=>{const n=c6(lu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=no(lu,e.__scopeDialog);return f.jsx(qr,{present:r||a.open,children:a.modal?f.jsx(Nte,{...i,ref:t}):f.jsx(kte,{...i,ref:t})})});f6.displayName=lu;var Nte=y.forwardRef((e,t)=>{const n=no(lu,e.__scopeDialog),r=y.useRef(null),i=St(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return XN(a)},[]),f.jsx(h6,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,a=>a.preventDefault())})}),kte=y.forwardRef((e,t)=>{const n=no(lu,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return f.jsx(h6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),h6=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=no(lu,n),u=y.useRef(null),d=St(t,u);return YN(),f.jsxs(f.Fragment,{children:[f.jsx(k0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:f.jsx(kp,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":QN(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(Ate,{titleId:l.titleId}),f.jsx(Tte,{contentRef:u,descriptionId:l.descriptionId})]})]})}),WN="DialogTitle",m6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(WN,n);return f.jsx(Ke.h2,{id:i.titleId,...r,ref:t})});m6.displayName=WN;var p6="DialogDescription",g6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(p6,n);return f.jsx(Ke.p,{id:i.descriptionId,...r,ref:t})});g6.displayName=p6;var v6="DialogClose",y6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=no(v6,n);return f.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>i.onOpenChange(!1))})});y6.displayName=v6;function QN(e){return e?"open":"closed"}var x6="DialogTitleWarning",[mBe,b6]=oee(x6,{contentName:lu,titleName:WN,docsSlug:"dialog"}),Ate=({titleId:e})=>{const t=b6(x6),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 y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ote="DialogDescriptionWarning",Tte=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${b6(Ote).contentName}}.`;return y.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ZN=s6,JN=u6,ek=d6,tk=f6,w6=m6,S6=g6,nk=y6,qS={exports:{}},VS={};/**
 * @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 mD;function Pte(){if(mD)return VS;mD=1;var e=Pf();function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(h,g){var v=g(),b=r({inst:{value:v,getSnapshot:g}}),w=b[0].inst,S=b[1];return a(function(){w.value=v,w.getSnapshot=g,u(w)&&S({inst:w})},[h,v,g]),i(function(){return u(w)&&S({inst:w}),h(function(){u(w)&&S({inst:w})})},[h]),o(v),v}function u(h){var g=h.getSnapshot;h=h.value;try{var v=g();return!n(h,v)}catch{return!0}}function d(h,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return VS.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,VS}var pD;function Mte(){return pD||(pD=1,qS.exports=Pte()),qS.exports}function j6(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function E6(e){const[t,n]=y.useState(void 0);return jr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,l;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Rte=["top","right","bottom","left"],Hl=Math.min,Ri=Math.max,tx=Math.round,ey=Math.floor,Eo=e=>({x:e,y:e}),Dte={left:"right",right:"left",bottom:"top",top:"bottom"};function L_(e,t,n){return Ri(e,Hl(t,n))}function ws(e,t){return typeof e=="function"?e(t):e}function Ss(e){return e.split("-")[0]}function Df(e){return e.split("-")[1]}function rk(e){return e==="x"?"y":"x"}function ik(e){return e==="y"?"height":"width"}function bo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ak(e){return rk(bo(e))}function Ite(e,t,n){n===void 0&&(n=!1);const r=Df(e),i=ak(e),a=ik(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=nx(o)),[o,nx(o)]}function Lte(e){const t=nx(e);return[z_(e),t,z_(t)]}function z_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gD=["left","right"],vD=["right","left"],zte=["top","bottom"],$te=["bottom","top"];function Bte(e,t,n){switch(e){case"top":case"bottom":return n?t?vD:gD:t?gD:vD;case"left":case"right":return t?zte:$te;default:return[]}}function Fte(e,t,n,r){const i=Df(e);let a=Bte(Ss(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(z_)))),a}function nx(e){const t=Ss(e);return Dte[t]+e.slice(t.length)}function Ute(e){return{top:0,right:0,bottom:0,left:0,...e}}function _6(e){return typeof e!="number"?Ute(e):{top:e,right:e,bottom:e,left:e}}function rx(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function yD(e,t,n){let{reference:r,floating:i}=e;const a=bo(t),o=ak(t),l=ik(o),u=Ss(t),d=a==="y",m=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,g=r[l]/2-i[l]/2;let v;switch(u){case"top":v={x:m,y:r.y-i.height};break;case"bottom":v={x:m,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-i.width,y:h};break;default:v={x:r.x,y:r.y}}switch(Df(t)){case"start":v[o]-=g*(n&&d?-1:1);break;case"end":v[o]+=g*(n&&d?-1:1);break}return v}async function Hte(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:g=!1,padding:v=0}=ws(t,e),b=_6(v),S=l[g?h==="floating"?"reference":"floating":h],j=rx(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(S)))==null||n?S:S.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:d,rootBoundary:m,strategy:u})),C=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),k=await(a.isElement==null?void 0:a.isElement(E))?await(a.getScale==null?void 0:a.getScale(E))||{x:1,y:1}:{x:1,y:1},O=rx(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:E,strategy:u}):C);return{top:(j.top-O.top+b.top)/k.y,bottom:(O.bottom-j.bottom+b.bottom)/k.y,left:(j.left-O.left+b.left)/k.x,right:(O.right-j.right+b.right)/k.x}}const qte=50,Vte=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:Hte},u=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:h}=yD(d,r,u),g=r,v=0;const b={};for(let w=0;w<a.length;w++){const S=a[w];if(!S)continue;const{name:j,fn:C}=S,{x:E,y:k,data:O,reset:A}=await C({x:m,y:h,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:d,platform:l,elements:{reference:e,floating:t}});m=E??m,h=k??h,b[j]={...b[j],...O},A&&v<qte&&(v++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(d=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:m,y:h}=yD(d,g,u)),w=-1)}return{x:m,y:h,placement:g,strategy:i,middlewareData:b}},Kte=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:l,middlewareData:u}=t,{element:d,padding:m=0}=ws(e,t)||{};if(d==null)return{};const h=_6(m),g={x:n,y:r},v=ak(i),b=ik(v),w=await o.getDimensions(d),S=v==="y",j=S?"top":"left",C=S?"bottom":"right",E=S?"clientHeight":"clientWidth",k=a.reference[b]+a.reference[v]-g[v]-a.floating[b],O=g[v]-a.reference[v],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let T=A?A[E]:0;(!T||!await(o.isElement==null?void 0:o.isElement(A)))&&(T=l.floating[E]||a.floating[b]);const M=k/2-O/2,B=T/2-w[b]/2-1,I=Hl(h[j],B),U=Hl(h[C],B),L=I,G=T-w[b]-U,z=T/2-w[b]/2+M,K=L_(L,z,G),P=!u.arrow&&Df(i)!=null&&z!==K&&a.reference[b]/2-(z<L?I:U)-w[b]/2<0,H=P?z<L?z-L:z-G:0;return{[v]:g[v]+H,data:{[v]:K,centerOffset:z-K-H,...P&&{alignmentOffset:H}},reset:P}}}),Yte=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=ws(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const j=Ss(i),C=bo(l),E=Ss(l)===l,k=await(u.isRTL==null?void 0:u.isRTL(d.floating)),O=g||(E||!w?[nx(l)]:Lte(l)),A=b!=="none";!g&&A&&O.push(...Fte(l,w,b,k));const T=[l,...O],M=await u.detectOverflow(t,S),B=[];let I=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&B.push(M[j]),h){const z=Ite(i,o,k);B.push(M[z[0]],M[z[1]])}if(I=[...I,{placement:i,overflows:B}],!B.every(z=>z<=0)){var U,L;const z=(((U=a.flip)==null?void 0:U.index)||0)+1,K=T[z];if(K&&(!(h==="alignment"?C!==bo(K):!1)||I.every(Y=>bo(Y.placement)===C?Y.overflows[0]>0:!0)))return{data:{index:z,overflows:I},reset:{placement:K}};let P=(L=I.filter(H=>H.overflows[0]<=0).sort((H,Y)=>H.overflows[1]-Y.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(v){case"bestFit":{var G;const H=(G=I.filter(Y=>{if(A){const V=bo(Y.placement);return V===C||V==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(V=>V>0).reduce((V,D)=>V+D,0)]).sort((Y,V)=>Y[1]-V[1])[0])==null?void 0:G[0];H&&(P=H);break}case"initialPlacement":P=l;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function xD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bD(e){return Rte.some(t=>e[t]>=0)}const Xte=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=ws(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=xD(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:bD(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=xD(o,n.floating);return{data:{escapedOffsets:l,escaped:bD(l)}}}default:return{}}}}},C6=new Set(["left","top"]);async function Gte(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ss(n),l=Df(n),u=bo(n)==="y",d=C6.has(o)?-1:1,m=a&&u?-1:1,h=ws(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),u?{x:v*m,y:g*d}:{x:g*d,y:v*m}}const Wte=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:l}=t,u=await Gte(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:a+u.y,data:{...u,placement:o}}}}},Qte=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:j=>{let{x:C,y:E}=j;return{x:C,y:E}}},...d}=ws(e,t),m={x:n,y:r},h=await a.detectOverflow(t,d),g=bo(Ss(i)),v=rk(g);let b=m[v],w=m[g];if(o){const j=v==="y"?"top":"left",C=v==="y"?"bottom":"right",E=b+h[j],k=b-h[C];b=L_(E,b,k)}if(l){const j=g==="y"?"top":"left",C=g==="y"?"bottom":"right",E=w+h[j],k=w-h[C];w=L_(E,w,k)}const S=u.fn({...t,[v]:b,[g]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[g]:l}}}}}},Zte=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=ws(e,t),m={x:n,y:r},h=bo(i),g=rk(h);let v=m[g],b=m[h];const w=ws(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const E=g==="y"?"height":"width",k=a.reference[g]-a.floating[E]+S.mainAxis,O=a.reference[g]+a.reference[E]-S.mainAxis;v<k?v=k:v>O&&(v=O)}if(d){var j,C;const E=g==="y"?"width":"height",k=C6.has(Ss(i)),O=a.reference[h]-a.floating[E]+(k&&((j=o.offset)==null?void 0:j[h])||0)+(k?0:S.crossAxis),A=a.reference[h]+a.reference[E]+(k?0:((C=o.offset)==null?void 0:C[h])||0)-(k?S.crossAxis:0);b<O?b=O:b>A&&(b=A)}return{[g]:v,[h]:b}}}},Jte=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:l}=t,{apply:u=()=>{},...d}=ws(e,t),m=await o.detectOverflow(t,d),h=Ss(i),g=Df(i),v=bo(i)==="y",{width:b,height:w}=a.floating;let S,j;h==="top"||h==="bottom"?(S=h,j=g===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(j=h,S=g==="end"?"top":"bottom");const C=w-m.top-m.bottom,E=b-m.left-m.right,k=Hl(w-m[S],C),O=Hl(b-m[j],E),A=!t.middlewareData.shift;let T=k,M=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),A&&!g){const I=Ri(m.left,0),U=Ri(m.right,0),L=Ri(m.top,0),G=Ri(m.bottom,0);v?M=b-2*(I!==0||U!==0?I+U:Ri(m.left,m.right)):T=w-2*(L!==0||G!==0?L+G:Ri(m.top,m.bottom))}await u({...t,availableWidth:M,availableHeight:T});const B=await o.getDimensions(l.floating);return b!==B.width||w!==B.height?{reset:{rects:!0}}:{}}}};function P0(){return typeof window<"u"}function If(e){return N6(e)?(e.nodeName||"").toLowerCase():"#document"}function zi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mo(e){var t;return(t=(N6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function N6(e){return P0()?e instanceof Node||e instanceof zi(e).Node:!1}function Za(e){return P0()?e instanceof Element||e instanceof zi(e).Element:!1}function As(e){return P0()?e instanceof HTMLElement||e instanceof zi(e).HTMLElement:!1}function wD(e){return!P0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zi(e).ShadowRoot}function Op(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ja(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function ene(e){return/^(table|td|th)$/.test(If(e))}function M0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const tne=/transform|translate|scale|rotate|perspective|filter/,nne=/paint|layout|strict|content/,Nc=e=>!!e&&e!=="none";let KS;function ok(e){const t=Za(e)?Ja(e):e;return Nc(t.transform)||Nc(t.translate)||Nc(t.scale)||Nc(t.rotate)||Nc(t.perspective)||!sk()&&(Nc(t.backdropFilter)||Nc(t.filter))||tne.test(t.willChange||"")||nne.test(t.contain||"")}function rne(e){let t=ql(e);for(;As(t)&&!ff(t);){if(ok(t))return t;if(M0(t))return null;t=ql(t)}return null}function sk(){return KS==null&&(KS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),KS}function ff(e){return/^(html|body|#document)$/.test(If(e))}function Ja(e){return zi(e).getComputedStyle(e)}function R0(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ql(e){if(If(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wD(e)&&e.host||Mo(e);return wD(t)?t.host:t}function k6(e){const t=ql(e);return ff(t)?e.ownerDocument?e.ownerDocument.body:e.body:As(t)&&Op(t)?t:k6(t)}function Bm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=k6(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=zi(i);if(a){const l=$_(o);return t.concat(o,o.visualViewport||[],Op(i)?i:[],l&&n?Bm(l):[])}else return t.concat(i,Bm(i,[],n))}function $_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function A6(e){const t=Ja(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=As(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=tx(n)!==a||tx(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function lk(e){return Za(e)?e:e.contextElement}function qd(e){const t=lk(e);if(!As(t))return Eo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=A6(t);let o=(a?tx(n.width):n.width)/r,l=(a?tx(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const ine=Eo(0);function O6(e){const t=zi(e);return!sk()||!t.visualViewport?ine:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ane(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==zi(e)?!1:t}function cu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=lk(e);let o=Eo(1);t&&(r?Za(r)&&(o=qd(r)):o=qd(e));const l=ane(a,n,r)?O6(a):Eo(0);let u=(i.left+l.x)/o.x,d=(i.top+l.y)/o.y,m=i.width/o.x,h=i.height/o.y;if(a){const g=zi(a),v=r&&Za(r)?zi(r):r;let b=g,w=$_(b);for(;w&&r&&v!==b;){const S=qd(w),j=w.getBoundingClientRect(),C=Ja(w),E=j.left+(w.clientLeft+parseFloat(C.paddingLeft))*S.x,k=j.top+(w.clientTop+parseFloat(C.paddingTop))*S.y;u*=S.x,d*=S.y,m*=S.x,h*=S.y,u+=E,d+=k,b=zi(w),w=$_(b)}}return rx({width:m,height:h,x:u,y:d})}function D0(e,t){const n=R0(e).scrollLeft;return t?t.left+n:cu(Mo(e)).left+n}function T6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-D0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function one(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Mo(r),l=t?M0(t.floating):!1;if(r===o||l&&a)return n;let u={scrollLeft:0,scrollTop:0},d=Eo(1);const m=Eo(0),h=As(r);if((h||!h&&!a)&&((If(r)!=="body"||Op(o))&&(u=R0(r)),h)){const v=cu(r);d=qd(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const g=o&&!h&&!a?T6(o,u):Eo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+m.x+g.x,y:n.y*d.y-u.scrollTop*d.y+m.y+g.y}}function sne(e){return Array.from(e.getClientRects())}function lne(e){const t=Mo(e),n=R0(e),r=e.ownerDocument.body,i=Ri(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ri(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+D0(e);const l=-n.scrollTop;return Ja(r).direction==="rtl"&&(o+=Ri(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}const SD=25;function cne(e,t){const n=zi(e),r=Mo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,u=0;if(i){a=i.width,o=i.height;const m=sk();(!m||m&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}const d=D0(r);if(d<=0){const m=r.ownerDocument,h=m.body,g=getComputedStyle(h),v=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-v);b<=SD&&(a-=b)}else d<=SD&&(a+=d);return{width:a,height:o,x:l,y:u}}function une(e,t){const n=cu(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=As(e)?qd(e):Eo(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,u=i*a.x,d=r*a.y;return{width:o,height:l,x:u,y:d}}function jD(e,t,n){let r;if(t==="viewport")r=cne(e,n);else if(t==="document")r=lne(Mo(e));else if(Za(t))r=une(t,n);else{const i=O6(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return rx(r)}function P6(e,t){const n=ql(e);return n===t||!Za(n)||ff(n)?!1:Ja(n).position==="fixed"||P6(n,t)}function dne(e,t){const n=t.get(e);if(n)return n;let r=Bm(e,[],!1).filter(l=>Za(l)&&If(l)!=="body"),i=null;const a=Ja(e).position==="fixed";let o=a?ql(e):e;for(;Za(o)&&!ff(o);){const l=Ja(o),u=ok(o);!u&&l.position==="fixed"&&(i=null),(a?!u&&!i:!u&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Op(o)&&!u&&P6(e,o))?r=r.filter(m=>m!==o):i=l,o=ql(o)}return t.set(e,r),r}function fne(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?M0(t)?[]:dne(t,this._c):[].concat(n),r],l=jD(t,o[0],i);let u=l.top,d=l.right,m=l.bottom,h=l.left;for(let g=1;g<o.length;g++){const v=jD(t,o[g],i);u=Ri(v.top,u),d=Hl(v.right,d),m=Hl(v.bottom,m),h=Ri(v.left,h)}return{width:d-h,height:m-u,x:h,y:u}}function hne(e){const{width:t,height:n}=A6(e);return{width:t,height:n}}function mne(e,t,n){const r=As(t),i=Mo(t),a=n==="fixed",o=cu(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const u=Eo(0);function d(){u.x=D0(i)}if(r||!r&&!a)if((If(t)!=="body"||Op(i))&&(l=R0(t)),r){const v=cu(t,!0,a,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else i&&d();a&&!r&&i&&d();const m=i&&!r&&!a?T6(i,l):Eo(0),h=o.left+l.scrollLeft-u.x-m.x,g=o.top+l.scrollTop-u.y-m.y;return{x:h,y:g,width:o.width,height:o.height}}function YS(e){return Ja(e).position==="static"}function ED(e,t){if(!As(e)||Ja(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mo(e)===n&&(n=n.ownerDocument.body),n}function M6(e,t){const n=zi(e);if(M0(e))return n;if(!As(e)){let i=ql(e);for(;i&&!ff(i);){if(Za(i)&&!YS(i))return i;i=ql(i)}return n}let r=ED(e,t);for(;r&&ene(r)&&YS(r);)r=ED(r,t);return r&&ff(r)&&YS(r)&&!ok(r)?n:r||rne(e)||n}const pne=async function(e){const t=this.getOffsetParent||M6,n=this.getDimensions,r=await n(e.floating);return{reference:mne(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gne(e){return Ja(e).direction==="rtl"}const vne={convertOffsetParentRelativeRectToViewportRelativeRect:one,getDocumentElement:Mo,getClippingRect:fne,getOffsetParent:M6,getElementRects:pne,getClientRects:sne,getDimensions:hne,getScale:qd,isElement:Za,isRTL:gne};function R6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yne(e,t){let n=null,r;const i=Mo(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),a();const d=e.getBoundingClientRect(),{left:m,top:h,width:g,height:v}=d;if(l||t(),!g||!v)return;const b=ey(h),w=ey(i.clientWidth-(m+g)),S=ey(i.clientHeight-(h+v)),j=ey(m),E={rootMargin:-b+"px "+-w+"px "+-S+"px "+-j+"px",threshold:Ri(0,Hl(1,u))||1};let k=!0;function O(A){const T=A[0].intersectionRatio;if(T!==u){if(!k)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!R6(d,e.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(O,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,E)}n.observe(e)}return o(!0),a}function xne(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=lk(e),m=i||a?[...d?Bm(d):[],...t?Bm(t):[]]:[];m.forEach(j=>{i&&j.addEventListener("scroll",n,{passive:!0}),a&&j.addEventListener("resize",n)});const h=d&&l?yne(d,n):null;let g=-1,v=null;o&&(v=new ResizeObserver(j=>{let[C]=j;C&&C.target===d&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(t)})),n()}),d&&!u&&v.observe(d),t&&v.observe(t));let b,w=u?cu(e):null;u&&S();function S(){const j=cu(e);w&&!R6(w,j)&&n(),w=j,b=requestAnimationFrame(S)}return n(),()=>{var j;m.forEach(C=>{i&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),h==null||h(),(j=v)==null||j.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const bne=Wte,wne=Qte,Sne=Yte,jne=Jte,Ene=Xte,_D=Kte,_ne=Zte,Cne=(e,t,n)=>{const r=new Map,i={platform:vne,...n},a={...i.platform,_c:r};return Vte(e,t,{...i,platform:a})};var Nne=typeof document<"u",kne=function(){},$y=Nne?y.useLayoutEffect:kne;function ix(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,i;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(!ix(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!ix(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function D6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function CD(e,t){const n=D6(e);return Math.round(t*n)/n}function XS(e){const t=y.useRef(e);return $y(()=>{t.current=e}),t}function Ane(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[m,h]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=y.useState(r);ix(g,r)||v(r);const[b,w]=y.useState(null),[S,j]=y.useState(null),C=y.useCallback(Y=>{Y!==A.current&&(A.current=Y,w(Y))},[]),E=y.useCallback(Y=>{Y!==T.current&&(T.current=Y,j(Y))},[]),k=a||b,O=o||S,A=y.useRef(null),T=y.useRef(null),M=y.useRef(m),B=u!=null,I=XS(u),U=XS(i),L=XS(d),G=y.useCallback(()=>{if(!A.current||!T.current)return;const Y={placement:t,strategy:n,middleware:g};U.current&&(Y.platform=U.current),Cne(A.current,T.current,Y).then(V=>{const D={...V,isPositioned:L.current!==!1};z.current&&!ix(M.current,D)&&(M.current=D,Ql.flushSync(()=>{h(D)}))})},[g,t,n,U,L]);$y(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(Y=>({...Y,isPositioned:!1})))},[d]);const z=y.useRef(!1);$y(()=>(z.current=!0,()=>{z.current=!1}),[]),$y(()=>{if(k&&(A.current=k),O&&(T.current=O),k&&O){if(I.current)return I.current(k,O,G);G()}},[k,O,G,I,B]);const K=y.useMemo(()=>({reference:A,floating:T,setReference:C,setFloating:E}),[C,E]),P=y.useMemo(()=>({reference:k,floating:O}),[k,O]),H=y.useMemo(()=>{const Y={position:n,left:0,top:0};if(!P.floating)return Y;const V=CD(P.floating,m.x),D=CD(P.floating,m.y);return l?{...Y,transform:"translate("+V+"px, "+D+"px)",...D6(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:D}},[n,l,P.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:G,refs:K,elements:P,floatingStyles:H}),[m,G,K,P,H])}const One=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?_D({element:r.current,padding:i}).fn(n):{}:r?_D({element:r,padding:i}).fn(n):{}}}},Tne=(e,t)=>{const n=bne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pne=(e,t)=>{const n=wne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mne=(e,t)=>({fn:_ne(e).fn,options:[e,t]}),Rne=(e,t)=>{const n=Sne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dne=(e,t)=>{const n=jne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ine=(e,t)=>{const n=Ene(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lne=(e,t)=>{const n=One(e);return{name:n.name,fn:n.fn,options:[e,t]}};var zne="Arrow",I6=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return f.jsx(Ke.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});I6.displayName=zne;var $ne=I6,ck="Popper",[L6,Lf]=Oa(ck),[Bne,z6]=L6(ck),$6=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return f.jsx(Bne,{scope:t,anchor:r,onAnchorChange:i,children:n})};$6.displayName=ck;var B6="PopperAnchor",F6=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=z6(B6,n),o=y.useRef(null),l=St(t,o),u=y.useRef(null);return y.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||o.current,d!==u.current&&a.onAnchorChange(u.current)}),r?null:f.jsx(Ke.div,{...i,ref:l})});F6.displayName=B6;var uk="PopperContent",[Fne,Une]=L6(uk),U6=y.forwardRef((e,t)=>{var ae,re,ee,se,ve,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...w}=e,S=z6(uk,n),[j,C]=y.useState(null),E=St(t,Se=>C(Se)),[k,O]=y.useState(null),A=E6(k),T=(A==null?void 0:A.width)??0,M=(A==null?void 0:A.height)??0,B=r+(a!=="center"?"-"+a:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},U=Array.isArray(d)?d:[d],L=U.length>0,G={padding:I,boundary:U.filter(qne),altBoundary:L},{refs:z,floatingStyles:K,placement:P,isPositioned:H,middlewareData:Y}=Ane({strategy:"fixed",placement:B,whileElementsMounted:(...Se)=>xne(...Se,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[Tne({mainAxis:i+M,alignmentAxis:o}),u&&Pne({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Mne():void 0,...G}),u&&Rne({...G}),Dne({...G,apply:({elements:Se,rects:Ee,availableWidth:qe,availableHeight:Te})=>{const{width:rt,height:Je}=Ee.reference,et=Se.floating.style;et.setProperty("--radix-popper-available-width",`${qe}px`),et.setProperty("--radix-popper-available-height",`${Te}px`),et.setProperty("--radix-popper-anchor-width",`${rt}px`),et.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),k&&Lne({element:k,padding:l}),Vne({arrowWidth:T,arrowHeight:M}),g&&Ine({strategy:"referenceHidden",...G})]}),[V,D]=V6(P),q=Rr(b);jr(()=>{H&&(q==null||q())},[H,q]);const $=(ae=Y.arrow)==null?void 0:ae.x,F=(re=Y.arrow)==null?void 0:re.y,Q=((ee=Y.arrow)==null?void 0:ee.centerOffset)!==0,[Z,te]=y.useState();return jr(()=>{j&&te(window.getComputedStyle(j).zIndex)},[j]),f.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:H?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(se=Y.transformOrigin)==null?void 0:se.x,(ve=Y.transformOrigin)==null?void 0:ve.y].join(" "),...((ie=Y.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(Fne,{scope:n,placedSide:V,onArrowChange:O,arrowX:$,arrowY:F,shouldHideArrow:Q,children:f.jsx(Ke.div,{"data-side":V,"data-align":D,...w,ref:E,style:{...w.style,animation:H?void 0:"none"}})})})});U6.displayName=uk;var H6="PopperArrow",Hne={top:"bottom",right:"left",bottom:"top",left:"right"},q6=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=Une(H6,r),o=Hne[a.placedSide];return f.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:f.jsx($ne,{...i,ref:n,style:{...i.style,display:"block"}})})});q6.displayName=H6;function qne(e){return e!==null}var Vne=e=>({name:"transformOrigin",options:e,fn(t){var S,j,C;const{placement:n,rects:r,middlewareData:i}=t,o=((S=i.arrow)==null?void 0:S.centerOffset)!==0,l=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[d,m]=V6(n),h={start:"0%",center:"50%",end:"100%"}[m],g=(((j=i.arrow)==null?void 0:j.x)??0)+l/2,v=(((C=i.arrow)==null?void 0:C.y)??0)+u/2;let b="",w="";return d==="bottom"?(b=o?h:`${g}px`,w=`${-u}px`):d==="top"?(b=o?h:`${g}px`,w=`${r.floating.height+u}px`):d==="right"?(b=`${-u}px`,w=o?h:`${v}px`):d==="left"&&(b=`${r.floating.width+u}px`,w=o?h:`${v}px`),{data:{x:b,y:w}}}});function V6(e){const[t,n="center"]=e.split("-");return[t,n]}var dk=$6,fk=F6,hk=U6,mk=q6,GS="rovingFocusGroup.onEntryFocus",Kne={bubbles:!1,cancelable:!0},Tp="RovingFocusGroup",[B_,K6,Yne]=HN(Tp),[Xne,I0]=Oa(Tp,[Yne]),[Gne,Wne]=Xne(Tp),Y6=y.forwardRef((e,t)=>f.jsx(B_.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(B_.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Qne,{...e,ref:t})})}));Y6.displayName=Tp;var Qne=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...h}=e,g=y.useRef(null),v=St(t,g),b=Np(a),[w,S]=bs({prop:o,defaultProp:l??null,onChange:u,caller:Tp}),[j,C]=y.useState(!1),E=Rr(d),k=K6(n),O=y.useRef(!1),[A,T]=y.useState(0);return y.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(GS,E),()=>M.removeEventListener(GS,E)},[E]),f.jsx(Gne,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:y.useCallback(M=>S(M),[S]),onItemShiftTab:y.useCallback(()=>C(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:y.useCallback(()=>T(M=>M-1),[]),children:f.jsx(Ke.div,{tabIndex:j||A===0?-1:0,"data-orientation":r,...h,ref:v,style:{outline:"none",...e.style},onMouseDown:Oe(e.onMouseDown,()=>{O.current=!0}),onFocus:Oe(e.onFocus,M=>{const B=!O.current;if(M.target===M.currentTarget&&B&&!j){const I=new CustomEvent(GS,Kne);if(M.currentTarget.dispatchEvent(I),!I.defaultPrevented){const U=k().filter(P=>P.focusable),L=U.find(P=>P.active),G=U.find(P=>P.id===w),K=[L,G,...U].filter(Boolean).map(P=>P.ref.current);W6(K,m)}}O.current=!1}),onBlur:Oe(e.onBlur,()=>C(!1))})})}),X6="RovingFocusGroupItem",G6=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,u=Sr(),d=a||u,m=Wne(X6,n),h=m.currentTabStopId===d,g=K6(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=m;return y.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),f.jsx(B_.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:f.jsx(Ke.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:Oe(e.onMouseDown,S=>{r?m.onItemFocus(d):S.preventDefault()}),onFocus:Oe(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:Oe(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){m.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const j=ere(S,m.orientation,m.dir);if(j!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let E=g().filter(k=>k.focusable).map(k=>k.ref.current);if(j==="last")E.reverse();else if(j==="prev"||j==="next"){j==="prev"&&E.reverse();const k=E.indexOf(S.currentTarget);E=m.loop?tre(E,k+1):E.slice(k+1)}setTimeout(()=>W6(E))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:w!=null}):o})})});G6.displayName=X6;var Zne={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jne(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ere(e,t,n){const r=Jne(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Zne[r]}function W6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q6=Y6,Z6=G6,F_=["Enter"," "],nre=["ArrowDown","PageUp","Home"],J6=["ArrowUp","PageDown","End"],rre=[...nre,...J6],ire={ltr:[...F_,"ArrowRight"],rtl:[...F_,"ArrowLeft"]},are={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pp="Menu",[Fm,ore,sre]=HN(Pp),[Pu,e8]=Oa(Pp,[sre,Lf,I0]),L0=Lf(),t8=I0(),[lre,Mu]=Pu(Pp),[cre,Mp]=Pu(Pp),n8=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=L0(t),[u,d]=y.useState(null),m=y.useRef(!1),h=Rr(a),g=Np(i);return y.useEffect(()=>{const v=()=>{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",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),f.jsx(dk,{...l,children:f.jsx(lre,{scope:t,open:n,onOpenChange:h,content:u,onContentChange:d,children:f.jsx(cre,{scope:t,onClose:y.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:g,modal:o,children:r})})})};n8.displayName=Pp;var ure="MenuAnchor",pk=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=L0(n);return f.jsx(fk,{...i,...r,ref:t})});pk.displayName=ure;var gk="MenuPortal",[dre,r8]=Pu(gk,{forceMount:void 0}),i8=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Mu(gk,t);return f.jsx(dre,{scope:t,forceMount:n,children:f.jsx(qr,{present:n||a.open,children:f.jsx(Ap,{asChild:!0,container:i,children:r})})})};i8.displayName=gk;var ba="MenuContent",[fre,vk]=Pu(ba),a8=y.forwardRef((e,t)=>{const n=r8(ba,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Mu(ba,e.__scopeMenu),o=Mp(ba,e.__scopeMenu);return f.jsx(Fm.Provider,{scope:e.__scopeMenu,children:f.jsx(qr,{present:r||a.open,children:f.jsx(Fm.Slot,{scope:e.__scopeMenu,children:o.modal?f.jsx(hre,{...i,ref:t}):f.jsx(mre,{...i,ref:t})})})})}),hre=y.forwardRef((e,t)=>{const n=Mu(ba,e.__scopeMenu),r=y.useRef(null),i=St(t,r);return y.useEffect(()=>{const a=r.current;if(a)return XN(a)},[]),f.jsx(yk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mre=y.forwardRef((e,t)=>{const n=Mu(ba,e.__scopeMenu);return f.jsx(yk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pre=su("MenuContent.ScrollLock"),yk=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...w}=e,S=Mu(ba,n),j=Mp(ba,n),C=L0(n),E=t8(n),k=ore(n),[O,A]=y.useState(null),T=y.useRef(null),M=St(t,T,S.onContentChange),B=y.useRef(0),I=y.useRef(""),U=y.useRef(0),L=y.useRef(null),G=y.useRef("right"),z=y.useRef(0),K=b?O0:y.Fragment,P=b?{as:pre,allowPinchZoom:!0}:void 0,H=V=>{var ae,re;const D=I.current+V,q=k().filter(ee=>!ee.disabled),$=document.activeElement,F=(ae=q.find(ee=>ee.ref.current===$))==null?void 0:ae.textValue,Q=q.map(ee=>ee.textValue),Z=Nre(Q,D,F),te=(re=q.find(ee=>ee.textValue===Z))==null?void 0:re.ref.current;(function ee(se){I.current=se,window.clearTimeout(B.current),se!==""&&(B.current=window.setTimeout(()=>ee(""),1e3))})(D),te&&setTimeout(()=>te.focus())};y.useEffect(()=>()=>window.clearTimeout(B.current),[]),YN();const Y=y.useCallback(V=>{var q,$;return G.current===((q=L.current)==null?void 0:q.side)&&Are(V,($=L.current)==null?void 0:$.area)},[]);return f.jsx(fre,{scope:n,searchRef:I,onItemEnter:y.useCallback(V=>{Y(V)&&V.preventDefault()},[Y]),onItemLeave:y.useCallback(V=>{var D;Y(V)||((D=T.current)==null||D.focus(),A(null))},[Y]),onTriggerLeave:y.useCallback(V=>{Y(V)&&V.preventDefault()},[Y]),pointerGraceTimerRef:U,onPointerGraceIntentChange:y.useCallback(V=>{L.current=V},[]),children:f.jsx(K,{...P,children:f.jsx(k0,{asChild:!0,trapped:i,onMountAutoFocus:Oe(a,V=>{var D;V.preventDefault(),(D=T.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:f.jsx(kp,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:v,children:f.jsx(Q6,{asChild:!0,...E,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Oe(u,V=>{j.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(hk,{role:"menu","aria-orientation":"vertical","data-state":w8(S.open),"data-radix-menu-content":"",dir:j.dir,...C,...w,ref:M,style:{outline:"none",...w.style},onKeyDown:Oe(w.onKeyDown,V=>{const q=V.target.closest("[data-radix-menu-content]")===V.currentTarget,$=V.ctrlKey||V.altKey||V.metaKey,F=V.key.length===1;q&&(V.key==="Tab"&&V.preventDefault(),!$&&F&&H(V.key));const Q=T.current;if(V.target!==Q||!rre.includes(V.key))return;V.preventDefault();const te=k().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);J6.includes(V.key)&&te.reverse(),_re(te)}),onBlur:Oe(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(B.current),I.current="")}),onPointerMove:Oe(e.onPointerMove,Um(V=>{const D=V.target,q=z.current!==V.clientX;if(V.currentTarget.contains(D)&&q){const $=V.clientX>z.current?"right":"left";G.current=$,z.current=V.clientX}}))})})})})})})});a8.displayName=ba;var gre="MenuGroup",xk=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{role:"group",...r,ref:t})});xk.displayName=gre;var vre="MenuLabel",o8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{...r,ref:t})});o8.displayName=vre;var ax="MenuItem",ND="menu.itemSelect",z0=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=Mp(ax,e.__scopeMenu),l=vk(ax,e.__scopeMenu),u=St(t,a),d=y.useRef(!1),m=()=>{const h=a.current;if(!n&&h){const g=new CustomEvent(ND,{bubbles:!0,cancelable:!0});h.addEventListener(ND,v=>r==null?void 0:r(v),{once:!0}),UB(h,g),g.defaultPrevented?d.current=!1:o.onClose()}};return f.jsx(s8,{...i,ref:u,disabled:n,onClick:Oe(e.onClick,m),onPointerDown:h=>{var g;(g=e.onPointerDown)==null||g.call(e,h),d.current=!0},onPointerUp:Oe(e.onPointerUp,h=>{var g;d.current||(g=h.currentTarget)==null||g.click()}),onKeyDown:Oe(e.onKeyDown,h=>{const g=l.searchRef.current!=="";n||g&&h.key===" "||F_.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});z0.displayName=ax;var s8=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=vk(ax,n),l=t8(n),u=y.useRef(null),d=St(t,u),[m,h]=y.useState(!1),[g,v]=y.useState("");return y.useEffect(()=>{const b=u.current;b&&v((b.textContent??"").trim())},[a.children]),f.jsx(Fm.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:f.jsx(Z6,{asChild:!0,...l,focusable:!r,children:f.jsx(Ke.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:Oe(e.onPointerMove,Um(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(e.onPointerLeave,Um(b=>o.onItemLeave(b))),onFocus:Oe(e.onFocus,()=>h(!0)),onBlur:Oe(e.onBlur,()=>h(!1))})})})}),yre="MenuCheckboxItem",l8=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return f.jsx(h8,{scope:e.__scopeMenu,checked:n,children:f.jsx(z0,{role:"menuitemcheckbox","aria-checked":ox(n)?"mixed":n,...i,ref:t,"data-state":wk(n),onSelect:Oe(i.onSelect,()=>r==null?void 0:r(ox(n)?!0:!n),{checkForDefaultPrevented:!1})})})});l8.displayName=yre;var c8="MenuRadioGroup",[xre,bre]=Pu(c8,{value:void 0,onValueChange:()=>{}}),u8=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Rr(r);return f.jsx(xre,{scope:e.__scopeMenu,value:n,onValueChange:a,children:f.jsx(xk,{...i,ref:t})})});u8.displayName=c8;var d8="MenuRadioItem",f8=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=bre(d8,e.__scopeMenu),a=n===i.value;return f.jsx(h8,{scope:e.__scopeMenu,checked:a,children:f.jsx(z0,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":wk(a),onSelect:Oe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});f8.displayName=d8;var bk="MenuItemIndicator",[h8,wre]=Pu(bk,{checked:!1}),m8=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=wre(bk,n);return f.jsx(qr,{present:r||ox(a.checked)||a.checked===!0,children:f.jsx(Ke.span,{...i,ref:t,"data-state":wk(a.checked)})})});m8.displayName=bk;var Sre="MenuSeparator",p8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});p8.displayName=Sre;var jre="MenuArrow",g8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=L0(n);return f.jsx(mk,{...i,...r,ref:t})});g8.displayName=jre;var Ere="MenuSub",[pBe,v8]=Pu(Ere),wm="MenuSubTrigger",y8=y.forwardRef((e,t)=>{const n=Mu(wm,e.__scopeMenu),r=Mp(wm,e.__scopeMenu),i=v8(wm,e.__scopeMenu),a=vk(wm,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),u(null)}},[l,u]),f.jsx(pk,{asChild:!0,...d,children:f.jsx(s8,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":w8(n.open),...e,ref:xs(t,i.onTriggerChange),onClick:h=>{var g;(g=e.onClick)==null||g.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(e.onPointerMove,Um(h=>{a.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Oe(e.onPointerLeave,Um(h=>{var v,b;m();const g=(v=n.content)==null?void 0:v.getBoundingClientRect();if(g){const w=(b=n.content)==null?void 0:b.dataset.side,S=w==="right",j=S?-5:5,C=g[S?"left":"right"],E=g[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:h.clientX+j,y:h.clientY},{x:C,y:g.top},{x:E,y:g.top},{x:E,y:g.bottom},{x:C,y:g.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(h),h.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(e.onKeyDown,h=>{var v;const g=a.searchRef.current!=="";e.disabled||g&&h.key===" "||ire[r.dir].includes(h.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),h.preventDefault())})})})});y8.displayName=wm;var x8="MenuSubContent",b8=y.forwardRef((e,t)=>{const n=r8(ba,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Mu(ba,e.__scopeMenu),o=Mp(ba,e.__scopeMenu),l=v8(x8,e.__scopeMenu),u=y.useRef(null),d=St(t,u);return f.jsx(Fm.Provider,{scope:e.__scopeMenu,children:f.jsx(qr,{present:r||a.open,children:f.jsx(Fm.Slot,{scope:e.__scopeMenu,children:f.jsx(yk,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var h;o.isUsingKeyboardRef.current&&((h=u.current)==null||h.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Oe(e.onFocusOutside,m=>{m.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Oe(e.onEscapeKeyDown,m=>{o.onClose(),m.preventDefault()}),onKeyDown:Oe(e.onKeyDown,m=>{var v;const h=m.currentTarget.contains(m.target),g=are[o.dir].includes(m.key);h&&g&&(a.onOpenChange(!1),(v=l.trigger)==null||v.focus(),m.preventDefault())})})})})})});b8.displayName=x8;function w8(e){return e?"open":"closed"}function ox(e){return e==="indeterminate"}function wk(e){return ox(e)?"indeterminate":e?"checked":"unchecked"}function _re(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Cre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nre(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=Cre(e,Math.max(a,0));i.length===1&&(o=o.filter(d=>d!==n));const u=o.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function kre(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],u=t[o],d=l.x,m=l.y,h=u.x,g=u.y;m>r!=g>r&&n<(h-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function Are(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return kre(n,t)}function Um(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ore=n8,Tre=pk,Pre=i8,Mre=a8,Rre=xk,Dre=o8,Ire=z0,Lre=l8,zre=u8,$re=f8,Bre=m8,Fre=p8,Ure=g8,Hre=y8,qre=b8,$0="DropdownMenu",[Vre]=Oa($0,[e8]),ai=e8(),[Kre,S8]=Vre($0),j8=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,u=ai(t),d=y.useRef(null),[m,h]=bs({prop:i,defaultProp:a??!1,onChange:o,caller:$0});return f.jsx(Kre,{scope:t,triggerId:Sr(),triggerRef:d,contentId:Sr(),open:m,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(g=>!g),[h]),modal:l,children:f.jsx(Ore,{...u,open:m,onOpenChange:h,dir:r,modal:l,children:n})})};j8.displayName=$0;var E8="DropdownMenuTrigger",_8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=S8(E8,n),o=ai(n);return f.jsx(Tre,{asChild:!0,...o,children:f.jsx(Ke.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:xs(t,a.triggerRef),onPointerDown:Oe(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:Oe(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});_8.displayName=E8;var Yre="DropdownMenuPortal",C8=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ai(t);return f.jsx(Pre,{...r,...n})};C8.displayName=Yre;var N8="DropdownMenuContent",k8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=S8(N8,n),a=ai(n),o=y.useRef(!1);return f.jsx(Mre,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Oe(e.onCloseAutoFocus,l=>{var u;o.current||(u=i.triggerRef.current)==null||u.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Oe(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,m=u.button===2||d;(!i.modal||m)&&(o.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)"}})});k8.displayName=N8;var Xre="DropdownMenuGroup",Gre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Rre,{...i,...r,ref:t})});Gre.displayName=Xre;var Wre="DropdownMenuLabel",Qre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Dre,{...i,...r,ref:t})});Qre.displayName=Wre;var Zre="DropdownMenuItem",A8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Ire,{...i,...r,ref:t})});A8.displayName=Zre;var Jre="DropdownMenuCheckboxItem",O8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Lre,{...i,...r,ref:t})});O8.displayName=Jre;var eie="DropdownMenuRadioGroup",tie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(zre,{...i,...r,ref:t})});tie.displayName=eie;var nie="DropdownMenuRadioItem",rie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx($re,{...i,...r,ref:t})});rie.displayName=nie;var iie="DropdownMenuItemIndicator",T8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Bre,{...i,...r,ref:t})});T8.displayName=iie;var aie="DropdownMenuSeparator",oie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Fre,{...i,...r,ref:t})});oie.displayName=aie;var sie="DropdownMenuArrow",lie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Ure,{...i,...r,ref:t})});lie.displayName=sie;var cie="DropdownMenuSubTrigger",uie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(Hre,{...i,...r,ref:t})});uie.displayName=cie;var die="DropdownMenuSubContent",fie=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ai(n);return f.jsx(qre,{...i,...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)"}})});fie.displayName=die;var hie=j8,mie=_8,pie=C8,gie=k8,vie=A8,yie=O8,xie=T8,bie="Label",P8=y.forwardRef((e,t)=>f.jsx(Ke.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));P8.displayName=bie;var wie=P8;function U_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sie(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Sk="ScrollArea",[M8]=Oa(Sk),[jie,Ta]=M8(Sk),R8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,u]=y.useState(null),[d,m]=y.useState(null),[h,g]=y.useState(null),[v,b]=y.useState(null),[w,S]=y.useState(null),[j,C]=y.useState(0),[E,k]=y.useState(0),[O,A]=y.useState(!1),[T,M]=y.useState(!1),B=St(t,U=>u(U)),I=Np(i);return f.jsx(jie,{scope:n,type:r,dir:I,scrollHideDelay:a,scrollArea:l,viewport:d,onViewportChange:m,content:h,onContentChange:g,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:O,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:M,onCornerWidthChange:C,onCornerHeightChange:k,children:f.jsx(Ke.div,{dir:I,...o,ref:B,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});R8.displayName=Sk;var D8="ScrollAreaViewport",I8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Ta(D8,n),l=y.useRef(null),u=St(t,l,o.onViewportChange);return f.jsxs(f.Fragment,{children:[f.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:i}),f.jsx(Ke.div,{"data-radix-scroll-area-viewport":"",...a,ref:u,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:f.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});I8.displayName=D8;var Ro="ScrollAreaScrollbar",L8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ta(Ro,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,l=e.orientation==="horizontal";return y.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),i.type==="hover"?f.jsx(Eie,{...r,ref:t,forceMount:n}):i.type==="scroll"?f.jsx(_ie,{...r,ref:t,forceMount:n}):i.type==="auto"?f.jsx(z8,{...r,ref:t,forceMount:n}):i.type==="always"?f.jsx(jk,{...r,ref:t}):null});L8.displayName=Ro;var Eie=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ta(Ro,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{const l=i.scrollArea;let u=0;if(l){const d=()=>{window.clearTimeout(u),o(!0)},m=()=>{u=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),f.jsx(qr,{present:n||a,children:f.jsx(z8,{"data-state":a?"visible":"hidden",...r,ref:t})})}),_ie=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ta(Ro,e.__scopeScrollArea),a=e.orientation==="horizontal",o=F0(()=>u("SCROLL_END"),100),[l,u]=Sie("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 y.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,i.scrollHideDelay,u]),y.useEffect(()=>{const d=i.viewport,m=a?"scrollLeft":"scrollTop";if(d){let h=d[m];const g=()=>{const v=d[m];h!==v&&(u("SCROLL"),o()),h=v};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[i.viewport,a,u,o]),f.jsx(qr,{present:n||l!=="hidden",children:f.jsx(jk,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Oe(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Oe(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),z8=y.forwardRef((e,t)=>{const n=Ta(Ro,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),l=e.orientation==="horizontal",u=F0(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?d:m)}},10);return hf(n.viewport,u),hf(n.content,u),f.jsx(qr,{present:r||a,children:f.jsx(jk,{"data-state":a?"visible":"hidden",...i,ref:t})})}),jk=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Ta(Ro,e.__scopeScrollArea),a=y.useRef(null),o=y.useRef(0),[l,u]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=H8(l.viewport,l.content),m={...r,sizes:l,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:g=>a.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function h(g,v){return Tie(g,o.current,l,v)}return n==="horizontal"?f.jsx(Cie,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollLeft,v=kD(g,l,i.dir);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=h(g,i.dir))}}):n==="vertical"?f.jsx(Nie,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollTop,v=kD(g,l);a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=h(g))}}):null}),Cie=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ta(Ro,e.__scopeScrollArea),[o,l]=y.useState(),u=y.useRef(null),d=St(t,u,a.onScrollbarXChange);return y.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),f.jsx(B8,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":B0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(a.viewport){const g=a.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),V8(g,h)&&m.preventDefault()}},onResize:()=>{u.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:lx(o.paddingLeft),paddingEnd:lx(o.paddingRight)}})}})}),Nie=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ta(Ro,e.__scopeScrollArea),[o,l]=y.useState(),u=y.useRef(null),d=St(t,u,a.onScrollbarYChange);return y.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),f.jsx(B8,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":B0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(a.viewport){const g=a.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),V8(g,h)&&m.preventDefault()}},onResize:()=>{u.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:lx(o.paddingTop),paddingEnd:lx(o.paddingBottom)}})}})}),[kie,$8]=M8(Ro),B8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:m,onResize:h,...g}=e,v=Ta(Ro,n),[b,w]=y.useState(null),S=St(t,B=>w(B)),j=y.useRef(null),C=y.useRef(""),E=v.viewport,k=r.content-r.viewport,O=Rr(m),A=Rr(u),T=F0(h,10);function M(B){if(j.current){const I=B.clientX-j.current.left,U=B.clientY-j.current.top;d({x:I,y:U})}}return y.useEffect(()=>{const B=I=>{const U=I.target;(b==null?void 0:b.contains(U))&&O(I,k)};return document.addEventListener("wheel",B,{passive:!1}),()=>document.removeEventListener("wheel",B,{passive:!1})},[E,b,k,O]),y.useEffect(A,[r,A]),hf(b,T),hf(v.content,T),f.jsx(kie,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:Rr(a),onThumbPointerUp:Rr(o),onThumbPositionChange:A,onThumbPointerDown:Rr(l),children:f.jsx(Ke.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:Oe(e.onPointerDown,B=>{B.button===0&&(B.target.setPointerCapture(B.pointerId),j.current=b.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),M(B))}),onPointerMove:Oe(e.onPointerMove,M),onPointerUp:Oe(e.onPointerUp,B=>{const I=B.target;I.hasPointerCapture(B.pointerId)&&I.releasePointerCapture(B.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),sx="ScrollAreaThumb",F8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$8(sx,e.__scopeScrollArea);return f.jsx(qr,{present:n||i.hasThumb,children:f.jsx(Aie,{ref:t,...r})})}),Aie=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=Ta(sx,n),o=$8(sx,n),{onThumbPositionChange:l}=o,u=St(t,h=>o.onThumbChange(h)),d=y.useRef(void 0),m=F0(()=>{d.current&&(d.current(),d.current=void 0)},100);return y.useEffect(()=>{const h=a.viewport;if(h){const g=()=>{if(m(),!d.current){const v=Pie(h,l);d.current=v,l()}};return l(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[a.viewport,m,l]),f.jsx(Ke.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Oe(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),b=h.clientX-v.left,w=h.clientY-v.top;o.onThumbPointerDown({x:b,y:w})}),onPointerUp:Oe(e.onPointerUp,o.onThumbPointerUp)})});F8.displayName=sx;var Ek="ScrollAreaCorner",U8=y.forwardRef((e,t)=>{const n=Ta(Ek,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?f.jsx(Oie,{...e,ref:t}):null});U8.displayName=Ek;var Oie=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Ta(Ek,n),[a,o]=y.useState(0),[l,u]=y.useState(0),d=!!(a&&l);return hf(i.scrollbarX,()=>{var h;const m=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(m),u(m)}),hf(i.scrollbarY,()=>{var h;const m=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(m),o(m)}),d?f.jsx(Ke.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function lx(e){return e?parseInt(e,10):0}function H8(e,t){const n=e/t;return isNaN(n)?0:n}function B0(e){const t=H8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Tie(e,t,n,r="ltr"){const i=B0(n),a=i/2,o=t||a,l=i-o,u=n.scrollbar.paddingStart+o,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return q8([u,d],h)(e)}function kD(e,t,n="ltr"){const r=B0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,l=a-r,u=n==="ltr"?[0,o]:[o*-1,0],d=U_(e,u);return q8([0,o],[0,l])(d)}function q8(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 V8(e,t){return e>0&&e<t}var Pie=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function F0(e,t){const n=Rr(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hf(e,t){const n=Rr(t);jr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var Mie=R8,Rie=I8,Die=U8,Iie=[" ","Enter","ArrowUp","ArrowDown"],Lie=[" ","Enter"],uu="Select",[U0,H0,zie]=HN(uu),[zf]=Oa(uu,[zie,Lf]),q0=Lf(),[$ie,Zl]=zf(uu),[Bie,Fie]=zf(uu),K8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:u,dir:d,name:m,autoComplete:h,disabled:g,required:v,form:b}=e,w=q0(t),[S,j]=y.useState(null),[C,E]=y.useState(null),[k,O]=y.useState(!1),A=Np(d),[T,M]=bs({prop:r,defaultProp:i??!1,onChange:a,caller:uu}),[B,I]=bs({prop:o,defaultProp:l,onChange:u,caller:uu}),U=y.useRef(null),L=S?b||!!S.closest("form"):!0,[G,z]=y.useState(new Set),K=Array.from(G).map(P=>P.props.value).join(";");return f.jsx(dk,{...w,children:f.jsxs($ie,{required:v,scope:t,trigger:S,onTriggerChange:j,valueNode:C,onValueNodeChange:E,valueNodeHasChildren:k,onValueNodeHasChildrenChange:O,contentId:Sr(),value:B,onValueChange:I,open:T,onOpenChange:M,dir:A,triggerPointerDownPosRef:U,disabled:g,children:[f.jsx(U0.Provider,{scope:t,children:f.jsx(Bie,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(P=>{z(H=>new Set(H).add(P))},[]),onNativeOptionRemove:y.useCallback(P=>{z(H=>{const Y=new Set(H);return Y.delete(P),Y})},[]),children:n})}),L?f.jsxs(mF,{"aria-hidden":!0,required:v,tabIndex:-1,name:m,autoComplete:h,value:B,onChange:P=>I(P.target.value),disabled:g,form:b,children:[B===void 0?f.jsx("option",{value:""}):null,Array.from(G)]},K):null]})})};K8.displayName=uu;var Y8="SelectTrigger",X8=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=q0(n),o=Zl(Y8,n),l=o.disabled||r,u=St(t,o.onTriggerChange),d=H0(n),m=y.useRef("touch"),[h,g,v]=gF(w=>{const S=d().filter(E=>!E.disabled),j=S.find(E=>E.value===o.value),C=vF(S,w,j);C!==void 0&&o.onValueChange(C.value)}),b=w=>{l||(o.onOpenChange(!0),v()),w&&(o.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return f.jsx(fk,{asChild:!0,...a,children:f.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":pF(o.value)?"":void 0,...i,ref:u,onClick:Oe(i.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&b(w)}),onPointerDown:Oe(i.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:Oe(i.onKeyDown,w=>{const S=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(S&&w.key===" ")&&Iie.includes(w.key)&&(b(),w.preventDefault())})})})});X8.displayName=Y8;var G8="SelectValue",W8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,u=Zl(G8,n),{onValueNodeHasChildrenChange:d}=u,m=a!==void 0,h=St(t,u.onValueNodeChange);return jr(()=>{d(m)},[d,m]),f.jsx(Ke.span,{...l,ref:h,style:{pointerEvents:"none"},children:pF(u.value)?f.jsx(f.Fragment,{children:o}):a})});W8.displayName=G8;var Uie="SelectIcon",Q8=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(Ke.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Q8.displayName=Uie;var Hie="SelectPortal",Z8=e=>f.jsx(Ap,{asChild:!0,...e});Z8.displayName=Hie;var du="SelectContent",J8=y.forwardRef((e,t)=>{const n=Zl(du,e.__scopeSelect),[r,i]=y.useState();if(jr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Ql.createPortal(f.jsx(eF,{scope:e.__scopeSelect,children:f.jsx(U0.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),a):null}return f.jsx(tF,{...e,ref:t})});J8.displayName=du;var Ba=10,[eF,Jl]=zf(du),qie="SelectContentImpl",Vie=su("SelectContent.RemoveScroll"),tF=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:u,align:d,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S,...j}=e,C=Zl(du,n),[E,k]=y.useState(null),[O,A]=y.useState(null),T=St(t,ae=>k(ae)),[M,B]=y.useState(null),[I,U]=y.useState(null),L=H0(n),[G,z]=y.useState(!1),K=y.useRef(!1);y.useEffect(()=>{if(E)return XN(E)},[E]),YN();const P=y.useCallback(ae=>{const[re,...ee]=L().map(ie=>ie.ref.current),[se]=ee.slice(-1),ve=document.activeElement;for(const ie of ae)if(ie===ve||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===re&&O&&(O.scrollTop=0),ie===se&&O&&(O.scrollTop=O.scrollHeight),ie==null||ie.focus(),document.activeElement!==ve))return},[L,O]),H=y.useCallback(()=>P([M,E]),[P,M,E]);y.useEffect(()=>{G&&H()},[G,H]);const{onOpenChange:Y,triggerPointerDownPosRef:V}=C;y.useEffect(()=>{if(E){let ae={x:0,y:0};const re=se=>{var ve,ie;ae={x:Math.abs(Math.round(se.pageX)-(((ve=V.current)==null?void 0:ve.x)??0)),y:Math.abs(Math.round(se.pageY)-(((ie=V.current)==null?void 0:ie.y)??0))}},ee=se=>{ae.x<=10&&ae.y<=10?se.preventDefault():E.contains(se.target)||Y(!1),document.removeEventListener("pointermove",re),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ee,{capture:!0})}}},[E,Y,V]),y.useEffect(()=>{const ae=()=>Y(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[Y]);const[D,q]=gF(ae=>{const re=L().filter(ve=>!ve.disabled),ee=re.find(ve=>ve.ref.current===document.activeElement),se=vF(re,ae,ee);se&&setTimeout(()=>se.ref.current.focus())}),$=y.useCallback((ae,re,ee)=>{const se=!K.current&&!ee;(C.value!==void 0&&C.value===re||se)&&(B(ae),se&&(K.current=!0))},[C.value]),F=y.useCallback(()=>E==null?void 0:E.focus(),[E]),Q=y.useCallback((ae,re,ee)=>{const se=!K.current&&!ee;(C.value!==void 0&&C.value===re||se)&&U(ae)},[C.value]),Z=r==="popper"?H_:nF,te=Z===H_?{side:l,sideOffset:u,align:d,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return f.jsx(eF,{scope:n,content:E,viewport:O,onViewportChange:A,itemRefCallback:$,selectedItem:M,onItemLeave:F,itemTextRefCallback:Q,focusSelectedItem:H,selectedItemText:I,position:r,isPositioned:G,searchRef:D,children:f.jsx(O0,{as:Vie,allowPinchZoom:!0,children:f.jsx(k0,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Oe(i,ae=>{var re;(re=C.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:f.jsx(kp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:f.jsx(Z,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...j,...te,onPlaced:()=>z(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Oe(j.onKeyDown,ae=>{const re=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!re&&ae.key.length===1&&q(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let se=L().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const ve=ae.target,ie=se.indexOf(ve);se=se.slice(ie+1)}setTimeout(()=>P(se)),ae.preventDefault()}})})})})})})});tF.displayName=qie;var Kie="SelectItemAlignedPosition",nF=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Zl(du,n),o=Jl(du,n),[l,u]=y.useState(null),[d,m]=y.useState(null),h=St(t,T=>m(T)),g=H0(n),v=y.useRef(!1),b=y.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:j,focusSelectedItem:C}=o,E=y.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&w&&S&&j){const T=a.trigger.getBoundingClientRect(),M=d.getBoundingClientRect(),B=a.valueNode.getBoundingClientRect(),I=j.getBoundingClientRect();if(a.dir!=="rtl"){const ve=I.left-M.left,ie=B.left-ve,Se=T.left-ie,Ee=T.width+Se,qe=Math.max(Ee,M.width),Te=window.innerWidth-Ba,rt=U_(ie,[Ba,Math.max(Ba,Te-qe)]);l.style.minWidth=Ee+"px",l.style.left=rt+"px"}else{const ve=M.right-I.right,ie=window.innerWidth-B.right-ve,Se=window.innerWidth-T.right-ie,Ee=T.width+Se,qe=Math.max(Ee,M.width),Te=window.innerWidth-Ba,rt=U_(ie,[Ba,Math.max(Ba,Te-qe)]);l.style.minWidth=Ee+"px",l.style.right=rt+"px"}const U=g(),L=window.innerHeight-Ba*2,G=w.scrollHeight,z=window.getComputedStyle(d),K=parseInt(z.borderTopWidth,10),P=parseInt(z.paddingTop,10),H=parseInt(z.borderBottomWidth,10),Y=parseInt(z.paddingBottom,10),V=K+P+G+Y+H,D=Math.min(S.offsetHeight*5,V),q=window.getComputedStyle(w),$=parseInt(q.paddingTop,10),F=parseInt(q.paddingBottom,10),Q=T.top+T.height/2-Ba,Z=L-Q,te=S.offsetHeight/2,ae=S.offsetTop+te,re=K+P+ae,ee=V-re;if(re<=Q){const ve=U.length>0&&S===U[U.length-1].ref.current;l.style.bottom="0px";const ie=d.clientHeight-w.offsetTop-w.offsetHeight,Se=Math.max(Z,te+(ve?F:0)+ie+H),Ee=re+Se;l.style.height=Ee+"px"}else{const ve=U.length>0&&S===U[0].ref.current;l.style.top="0px";const Se=Math.max(Q,K+w.offsetTop+(ve?$:0)+te)+ee;l.style.height=Se+"px",w.scrollTop=re-Q+w.offsetTop}l.style.margin=`${Ba}px 0`,l.style.minHeight=D+"px",l.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[g,a.trigger,a.valueNode,l,d,w,S,j,a.dir,r]);jr(()=>E(),[E]);const[k,O]=y.useState();jr(()=>{d&&O(window.getComputedStyle(d).zIndex)},[d]);const A=y.useCallback(T=>{T&&b.current===!0&&(E(),C==null||C(),b.current=!1)},[E,C]);return f.jsx(Xie,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:f.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:f.jsx(Ke.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});nF.displayName=Kie;var Yie="SelectPopperPosition",H_=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ba,...a}=e,o=q0(n);return f.jsx(hk,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.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)"}})});H_.displayName=Yie;var[Xie,_k]=zf(du,{}),q_="SelectViewport",rF=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=Jl(q_,n),o=_k(q_,n),l=St(t,a.onViewportChange),u=y.useRef(0);return f.jsxs(f.Fragment,{children:[f.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}),f.jsx(U0.Slot,{scope:n,children:f.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,d=>{const m=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&h){const v=Math.abs(u.current-m.scrollTop);if(v>0){const b=window.innerHeight-Ba*2,w=parseFloat(h.style.minHeight),S=parseFloat(h.style.height),j=Math.max(w,S);if(j<b){const C=j+v,E=Math.min(b,C),k=C-E;h.style.height=E+"px",h.style.bottom==="0px"&&(m.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}u.current=m.scrollTop})})})]})});rF.displayName=q_;var iF="SelectGroup",[Gie,Wie]=zf(iF),Qie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Sr();return f.jsx(Gie,{scope:n,id:i,children:f.jsx(Ke.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Qie.displayName=iF;var aF="SelectLabel",Zie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Wie(aF,n);return f.jsx(Ke.div,{id:i.id,...r,ref:t})});Zie.displayName=aF;var cx="SelectItem",[Jie,oF]=zf(cx),sF=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Zl(cx,n),u=Jl(cx,n),d=l.value===r,[m,h]=y.useState(a??""),[g,v]=y.useState(!1),b=St(t,C=>{var E;return(E=u.itemRefCallback)==null?void 0:E.call(u,C,r,i)}),w=Sr(),S=y.useRef("touch"),j=()=>{i||(l.onValueChange(r),l.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 f.jsx(Jie,{scope:n,value:r,disabled:i,textId:w,isSelected:d,onItemTextChange:y.useCallback(C=>{h(E=>E||((C==null?void 0:C.textContent)??"").trim())},[]),children:f.jsx(U0.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:f.jsx(Ke.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:b,onFocus:Oe(o.onFocus,()=>v(!0)),onBlur:Oe(o.onBlur,()=>v(!1)),onClick:Oe(o.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:Oe(o.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:Oe(o.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Oe(o.onPointerMove,C=>{var E;S.current=C.pointerType,i?(E=u.onItemLeave)==null||E.call(u):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(o.onPointerLeave,C=>{var E;C.currentTarget===document.activeElement&&((E=u.onItemLeave)==null||E.call(u))}),onKeyDown:Oe(o.onKeyDown,C=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&C.key===" "||(Lie.includes(C.key)&&j(),C.key===" "&&C.preventDefault())})})})})});sF.displayName=cx;var Sm="SelectItemText",lF=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Zl(Sm,n),l=Jl(Sm,n),u=oF(Sm,n),d=Fie(Sm,n),[m,h]=y.useState(null),g=St(t,j=>h(j),u.onItemTextChange,j=>{var C;return(C=l.itemTextRefCallback)==null?void 0:C.call(l,j,u.value,u.disabled)}),v=m==null?void 0:m.textContent,b=y.useMemo(()=>f.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=d;return jr(()=>(w(b),()=>S(b)),[w,S,b]),f.jsxs(f.Fragment,{children:[f.jsx(Ke.span,{id:u.textId,...a,ref:g}),u.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ql.createPortal(a.children,o.valueNode):null]})});lF.displayName=Sm;var cF="SelectItemIndicator",uF=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return oF(cF,n).isSelected?f.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});uF.displayName=cF;var V_="SelectScrollUpButton",dF=y.forwardRef((e,t)=>{const n=Jl(V_,e.__scopeSelect),r=_k(V_,e.__scopeSelect),[i,a]=y.useState(!1),o=St(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollTop>0;a(d)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?f.jsx(hF,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});dF.displayName=V_;var K_="SelectScrollDownButton",fF=y.forwardRef((e,t)=>{const n=Jl(K_,e.__scopeSelect),r=_k(K_,e.__scopeSelect),[i,a]=y.useState(!1),o=St(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,m=Math.ceil(u.scrollTop)<d;a(m)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?f.jsx(hF,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});fF.displayName=K_;var hF=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Jl("SelectScrollButton",n),o=y.useRef(null),l=H0(n),u=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>u(),[u]),jr(()=>{var m;const d=l().find(h=>h.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),f.jsx(Ke.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{u()})})}),eae="SelectSeparator",tae=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});tae.displayName=eae;var Y_="SelectArrow",nae=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=q0(n),a=Zl(Y_,n),o=Jl(Y_,n);return a.open&&o.position==="popper"?f.jsx(mk,{...i,...r,ref:t}):null});nae.displayName=Y_;var rae="SelectBubbleInput",mF=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),a=St(r,i),o=j6(t);return y.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(u,"value").set;if(o!==t&&m){const h=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(h)}},[o,t]),f.jsx(Ke.select,{...n,style:{...HB,...n.style},ref:a,defaultValue:t})});mF.displayName=rae;function pF(e){return e===""||e===void 0}function gF(e){const t=Rr(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(o=>{const l=n.current+o;t(l),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(l)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function vF(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=iae(e,Math.max(a,0));i.length===1&&(o=o.filter(d=>d!==n));const u=o.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function iae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aae=K8,oae=X8,sae=W8,lae=Q8,cae=Z8,uae=J8,dae=rF,fae=sF,hae=lF,mae=uF,pae=dF,gae=fF,vae="Separator",AD="horizontal",yae=["horizontal","vertical"],yF=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=AD,...i}=e,a=xae(r)?r:AD,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return f.jsx(Ke.div,{"data-orientation":a,...l,...i,ref:t})});yF.displayName=vae;function xae(e){return yae.includes(e)}var bae=yF,V0="Switch",[wae]=Oa(V0),[Sae,jae]=wae(V0),xF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:l,value:u="on",onCheckedChange:d,form:m,...h}=e,[g,v]=y.useState(null),b=St(t,E=>v(E)),w=y.useRef(!1),S=g?m||!!g.closest("form"):!0,[j,C]=bs({prop:i,defaultProp:a??!1,onChange:d,caller:V0});return f.jsxs(Sae,{scope:n,checked:j,disabled:l,children:[f.jsx(Ke.button,{type:"button",role:"switch","aria-checked":j,"aria-required":o,"data-state":jF(j),"data-disabled":l?"":void 0,disabled:l,value:u,...h,ref:b,onClick:Oe(e.onClick,E=>{C(k=>!k),S&&(w.current=E.isPropagationStopped(),w.current||E.stopPropagation())})}),S&&f.jsx(SF,{control:g,bubbles:!w.current,name:r,value:u,checked:j,required:o,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});xF.displayName=V0;var bF="SwitchThumb",wF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=jae(bF,n);return f.jsx(Ke.span,{"data-state":jF(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});wF.displayName=bF;var Eae="SwitchBubbleInput",SF=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{const o=y.useRef(null),l=St(o,a),u=j6(n),d=E6(t);return y.useEffect(()=>{const m=o.current;if(!m)return;const h=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(h,"checked").set;if(u!==n&&v){const b=new Event("click",{bubbles:r});v.call(m,n),m.dispatchEvent(b)}},[u,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SF.displayName=Eae;function jF(e){return e?"checked":"unchecked"}var _ae=xF,Cae=wF,K0="Tabs",[Nae]=Oa(K0,[I0]),EF=I0(),[kae,Ck]=Nae(K0),_F=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:u="automatic",...d}=e,m=Np(l),[h,g]=bs({prop:r,onChange:i,defaultProp:a??"",caller:K0});return f.jsx(kae,{scope:n,baseId:Sr(),value:h,onValueChange:g,orientation:o,dir:m,activationMode:u,children:f.jsx(Ke.div,{dir:m,"data-orientation":o,...d,ref:t})})});_F.displayName=K0;var CF="TabsList",NF=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=Ck(CF,n),o=EF(n);return f.jsx(Q6,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:f.jsx(Ke.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});NF.displayName=CF;var kF="TabsTrigger",AF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Ck(kF,n),l=EF(n),u=PF(o.baseId,r),d=MF(o.baseId,r),m=r===o.value;return f.jsx(Z6,{asChild:!0,...l,focusable:!i,active:m,children:f.jsx(Ke.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...a,ref:t,onMouseDown:Oe(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:Oe(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:Oe(e.onFocus,()=>{const h=o.activationMode!=="manual";!m&&!i&&h&&o.onValueChange(r)})})})});AF.displayName=kF;var OF="TabsContent",TF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=Ck(OF,n),u=PF(l.baseId,r),d=MF(l.baseId,r),m=r===l.value,h=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(g)},[]),f.jsx(qr,{present:i||m,children:({present:g})=>f.jsx(Ke.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:g&&a})})});TF.displayName=OF;function PF(e,t){return`${e}-trigger-${t}`}function MF(e,t){return`${e}-content-${t}`}var Aae=_F,Oae=NF,Tae=AF,Pae=TF,[Y0]=Oa("Tooltip",[Lf]),X0=Lf(),RF="TooltipProvider",Mae=700,X_="tooltip.open",[Rae,Nk]=Y0(RF),DF=e=>{const{__scopeTooltip:t,delayDuration:n=Mae,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),l=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),f.jsx(Rae,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(u.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:a})};DF.displayName=RF;var Hm="Tooltip",[Dae,Rp]=Y0(Hm),IF=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,u=Nk(Hm,e.__scopeTooltip),d=X0(t),[m,h]=y.useState(null),g=Sr(),v=y.useRef(0),b=o??u.disableHoverableContent,w=l??u.delayDuration,S=y.useRef(!1),[j,C]=bs({prop:r,defaultProp:i??!1,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(X_))):u.onClose(),a==null||a(T)},caller:Hm}),E=y.useMemo(()=>j?S.current?"delayed-open":"instant-open":"closed",[j]),k=y.useCallback(()=>{window.clearTimeout(v.current),v.current=0,S.current=!1,C(!0)},[C]),O=y.useCallback(()=>{window.clearTimeout(v.current),v.current=0,C(!1)},[C]),A=y.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.current=!0,C(!0),v.current=0},w)},[w,C]);return y.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),f.jsx(dk,{...d,children:f.jsx(Dae,{scope:t,contentId:g,open:j,stateAttribute:E,trigger:m,onTriggerChange:h,onTriggerEnter:y.useCallback(()=>{u.isOpenDelayedRef.current?A():k()},[u.isOpenDelayedRef,A,k]),onTriggerLeave:y.useCallback(()=>{b?O():(window.clearTimeout(v.current),v.current=0)},[O,b]),onOpen:k,onClose:O,disableHoverableContent:b,children:n})})};IF.displayName=Hm;var G_="TooltipTrigger",LF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Rp(G_,n),a=Nk(G_,n),o=X0(n),l=y.useRef(null),u=St(t,l,i.onTriggerChange),d=y.useRef(!1),m=y.useRef(!1),h=y.useCallback(()=>d.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),f.jsx(fk,{asChild:!0,...o,children:f.jsx(Ke.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:Oe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Oe(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:Oe(e.onBlur,i.onClose),onClick:Oe(e.onClick,i.onClose)})})});LF.displayName=G_;var kk="TooltipPortal",[Iae,Lae]=Y0(kk,{forceMount:void 0}),zF=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Rp(kk,t);return f.jsx(Iae,{scope:t,forceMount:n,children:f.jsx(qr,{present:n||a.open,children:f.jsx(Ap,{asChild:!0,container:i,children:r})})})};zF.displayName=kk;var mf="TooltipContent",$F=y.forwardRef((e,t)=>{const n=Lae(mf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Rp(mf,e.__scopeTooltip);return f.jsx(qr,{present:r||o.open,children:o.disableHoverableContent?f.jsx(BF,{side:i,...a,ref:t}):f.jsx(zae,{side:i,...a,ref:t})})}),zae=y.forwardRef((e,t)=>{const n=Rp(mf,e.__scopeTooltip),r=Nk(mf,e.__scopeTooltip),i=y.useRef(null),a=St(t,i),[o,l]=y.useState(null),{trigger:u,onClose:d}=n,m=i.current,{onPointerInTransitChange:h}=r,g=y.useCallback(()=>{l(null),h(!1)},[h]),v=y.useCallback((b,w)=>{const S=b.currentTarget,j={x:b.clientX,y:b.clientY},C=Uae(j,S.getBoundingClientRect()),E=Hae(j,C),k=qae(w.getBoundingClientRect()),O=Kae([...E,...k]);l(O),h(!0)},[h]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(u&&m){const b=S=>v(S,m),w=S=>v(S,u);return u.addEventListener("pointerleave",b),m.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",w)}}},[u,m,v,g]),y.useEffect(()=>{if(o){const b=w=>{const S=w.target,j={x:w.clientX,y:w.clientY},C=(u==null?void 0:u.contains(S))||(m==null?void 0:m.contains(S)),E=!Vae(j,o);C?g():E&&(g(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,m,o,d,g]),f.jsx(BF,{...e,ref:a})}),[$ae,Bae]=Y0(Hm,{isInside:!1}),Fae=JJ("TooltipContent"),BF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,u=Rp(mf,n),d=X0(n),{onClose:m}=u;return y.useEffect(()=>(document.addEventListener(X_,m),()=>document.removeEventListener(X_,m)),[m]),y.useEffect(()=>{if(u.trigger){const h=g=>{const v=g.target;v!=null&&v.contains(u.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,m]),f.jsx(kp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:f.jsxs(hk,{"data-state":u.stateAttribute,...d,...l,ref:t,style:{...l.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:[f.jsx(Fae,{children:r}),f.jsx($ae,{scope:n,isInside:!0,children:f.jsx(aee,{id:u.contentId,role:"tooltip",children:i||r})})]})})});$F.displayName=mf;var FF="TooltipArrow",UF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=X0(n);return Bae(FF,n).isInside?null:f.jsx(mk,{...i,...r,ref:t})});UF.displayName=FF;function Uae(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Hae(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 qae(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Vae(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],u=t[o],d=l.x,m=l.y,h=u.x,g=u.y;m>r!=g>r&&n<(h-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function Kae(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),Yae(t)}function Yae(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}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 Xae=DF,Gae=IF,Wae=LF,Qae=zF,Zae=$F,Jae=UF;function HF(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=HF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function It(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=HF(e))&&(r&&(r+=" "),r+=t);return r}const eoe=(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},toe=(e,t)=>({classGroupId:e,validator:t}),qF=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ux="-",OD=[],noe="arbitrary..",roe=e=>{const t=aoe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return ioe(o);const l=o.split(ux),u=l[0]===""&&l.length>1?1:0;return VF(l,u,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?eoe(d,u):u:d||OD}return n[o]||OD}}},VF=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const d=VF(e,t+1,a);if(d)return d}const o=n.validators;if(o===null)return;const l=t===0?e.join(ux):e.slice(t).join(ux),u=o.length;for(let d=0;d<u;d++){const m=o[d];if(m.validator(l))return m.classGroupId}},ioe=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?noe+r:void 0})(),aoe=e=>{const{theme:t,classGroups:n}=e;return ooe(n,t)},ooe=(e,t)=>{const n=qF();for(const r in e){const i=e[r];Ak(i,n,r,t)}return n},Ak=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];soe(o,t,n,r)}},soe=(e,t,n,r)=>{if(typeof e=="string"){loe(e,t,n);return}if(typeof e=="function"){coe(e,t,n,r);return}uoe(e,t,n,r)},loe=(e,t,n)=>{const r=e===""?t:KF(t,e);r.classGroupId=n},coe=(e,t,n,r)=>{if(doe(e)){Ak(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(toe(n,e))},uoe=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[l,u]=i[o];Ak(u,KF(t,l),n,r)}},KF=(e,t)=>{let n=e;const r=t.split(ux),i=r.length;for(let a=0;a<i;a++){const o=r[a];let l=n.nextPart.get(o);l||(l=qF(),n.nextPart.set(o,l)),n=l}return n},doe=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,foe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},W_="!",TD=":",hoe=[],PD=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),moe=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,l=0,u=0,d;const m=i.length;for(let w=0;w<m;w++){const S=i[w];if(o===0&&l===0){if(S===TD){a.push(i.slice(u,w)),u=w+1;continue}if(S==="/"){d=w;continue}}S==="["?o++:S==="]"?o--:S==="("?l++:S===")"&&l--}const h=a.length===0?i:i.slice(u);let g=h,v=!1;h.endsWith(W_)?(g=h.slice(0,-1),v=!0):h.startsWith(W_)&&(g=h.slice(1),v=!0);const b=d&&d>u?d-u:void 0;return PD(a,v,g,b)};if(t){const i=t+TD,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):PD(hoe,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},poe=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],l=o[0]==="[",u=t.has(o);l||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},goe=e=>({cache:foe(e.cacheSize),parseClassName:moe(e),sortModifiers:poe(e),...roe(e)}),voe=/\s+/,yoe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],l=e.trim().split(voe);let u="";for(let d=l.length-1;d>=0;d-=1){const m=l[d],{isExternal:h,modifiers:g,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:w}=n(m);if(h){u=m+(u.length>0?" "+u:u);continue}let S=!!w,j=r(S?b.substring(0,w):b);if(!j){if(!S){u=m+(u.length>0?" "+u:u);continue}if(j=r(b),!j){u=m+(u.length>0?" "+u:u);continue}S=!1}const C=g.length===0?"":g.length===1?g[0]:a(g).join(":"),E=v?C+W_:C,k=E+j;if(o.indexOf(k)>-1)continue;o.push(k);const O=i(j,S);for(let A=0;A<O.length;++A){const T=O[A];o.push(E+T)}u=m+(u.length>0?" "+u:u)}return u},xoe=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=YF(n))&&(i&&(i+=" "),i+=r);return i},YF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=YF(e[r]))&&(n&&(n+=" "),n+=t);return n},boe=(e,...t)=>{let n,r,i,a;const o=u=>{const d=t.reduce((m,h)=>h(m),e());return n=goe(d),r=n.cache.get,i=n.cache.set,a=l,l(u)},l=u=>{const d=r(u);if(d)return d;const m=yoe(u,n);return i(u,m),m};return a=o,(...u)=>a(xoe(...u))},woe=[],or=e=>{const t=n=>n[e]||woe;return t.isThemeGetter=!0,t},XF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,GF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Soe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,joe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Eoe=/\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$/,_oe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Coe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Noe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pl=e=>Soe.test(e),bt=e=>!!e&&!Number.isNaN(Number(e)),gl=e=>!!e&&Number.isInteger(Number(e)),WS=e=>e.endsWith("%")&&bt(e.slice(0,-1)),ns=e=>joe.test(e),WF=()=>!0,koe=e=>Eoe.test(e)&&!_oe.test(e),Ok=()=>!1,Aoe=e=>Coe.test(e),Ooe=e=>Noe.test(e),Toe=e=>!Fe(e)&&!He(e),Poe=e=>ec(e,JF,Ok),Fe=e=>XF.test(e),kc=e=>ec(e,eU,koe),MD=e=>ec(e,Boe,bt),Moe=e=>ec(e,nU,WF),Roe=e=>ec(e,tU,Ok),RD=e=>ec(e,QF,Ok),Doe=e=>ec(e,ZF,Ooe),ty=e=>ec(e,rU,Aoe),He=e=>GF.test(e),Qh=e=>Ru(e,eU),Ioe=e=>Ru(e,tU),DD=e=>Ru(e,QF),Loe=e=>Ru(e,JF),zoe=e=>Ru(e,ZF),ny=e=>Ru(e,rU,!0),$oe=e=>Ru(e,nU,!0),ec=(e,t,n)=>{const r=XF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ru=(e,t,n=!1)=>{const r=GF.exec(e);return r?r[1]?t(r[1]):n:!1},QF=e=>e==="position"||e==="percentage",ZF=e=>e==="image"||e==="url",JF=e=>e==="length"||e==="size"||e==="bg-size",eU=e=>e==="length",Boe=e=>e==="number",tU=e=>e==="family-name",nU=e=>e==="number"||e==="weight",rU=e=>e==="shadow",Foe=()=>{const e=or("color"),t=or("font"),n=or("text"),r=or("font-weight"),i=or("tracking"),a=or("leading"),o=or("breakpoint"),l=or("container"),u=or("spacing"),d=or("radius"),m=or("shadow"),h=or("inset-shadow"),g=or("text-shadow"),v=or("drop-shadow"),b=or("blur"),w=or("perspective"),S=or("aspect"),j=or("ease"),C=or("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...k(),He,Fe],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],M=()=>[He,Fe,u],B=()=>[pl,"full","auto",...M()],I=()=>[gl,"none","subgrid",He,Fe],U=()=>["auto",{span:["full",gl,He,Fe]},gl,He,Fe],L=()=>[gl,"auto",He,Fe],G=()=>["auto","min","max","fr",He,Fe],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...M()],H=()=>[pl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],Y=()=>[pl,"screen","full","dvw","lvw","svw","min","max","fit",...M()],V=()=>[pl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],D=()=>[e,He,Fe],q=()=>[...k(),DD,RD,{position:[He,Fe]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",Loe,Poe,{size:[He,Fe]}],Q=()=>[WS,Qh,kc],Z=()=>["","none","full",d,He,Fe],te=()=>["",bt,Qh,kc],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"],ee=()=>[bt,WS,DD,RD],se=()=>["","none",b,He,Fe],ve=()=>["none",bt,He,Fe],ie=()=>["none",bt,He,Fe],Se=()=>[bt,He,Fe],Ee=()=>[pl,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ns],breakpoint:[ns],color:[WF],container:[ns],"drop-shadow":[ns],ease:["in","out","in-out"],font:[Toe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ns],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ns],shadow:[ns],spacing:["px",bt],text:[ns],"text-shadow":[ns],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pl,Fe,He,S]}],container:["container"],columns:[{columns:[bt,Fe,He,l]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[gl,"auto",He,Fe]}],basis:[{basis:[pl,"full","auto",l,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[bt,pl,"auto","initial","none",Fe]}],grow:[{grow:["",bt,He,Fe]}],shrink:[{shrink:["",bt,He,Fe]}],order:[{order:[gl,"first","last","none",He,Fe]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[l,"screen",...H()]}],"min-w":[{"min-w":[l,"screen","none",...H()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,Qh,kc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,$oe,Moe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",WS,Fe]}],"font-family":[{font:[Ioe,Roe,t]}],"font-features":[{"font-features":[Fe]}],"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:[i,He,Fe]}],"line-clamp":[{"line-clamp":[bt,"none",He,MD]}],leading:[{leading:[a,...M()]}],"list-image":[{"list-image":["none",He,Fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",He,Fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[bt,"from-font","auto",He,kc]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[bt,"auto",He,Fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He,Fe]}],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",He,Fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gl,He,Fe],radial:["",He,Fe],conic:[gl,He,Fe]},zoe,Doe]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[bt,He,Fe]}],"outline-w":[{outline:["",bt,Qh,kc]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",m,ny,ty]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",h,ny,ty]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[bt,kc]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",g,ny,ty]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[bt,He,Fe]}],"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":[bt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[He,Fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[bt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",He,Fe]}],filter:[{filter:["","none",He,Fe]}],blur:[{blur:se()}],brightness:[{brightness:[bt,He,Fe]}],contrast:[{contrast:[bt,He,Fe]}],"drop-shadow":[{"drop-shadow":["","none",v,ny,ty]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",bt,He,Fe]}],"hue-rotate":[{"hue-rotate":[bt,He,Fe]}],invert:[{invert:["",bt,He,Fe]}],saturate:[{saturate:[bt,He,Fe]}],sepia:[{sepia:["",bt,He,Fe]}],"backdrop-filter":[{"backdrop-filter":["","none",He,Fe]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[bt,He,Fe]}],"backdrop-contrast":[{"backdrop-contrast":[bt,He,Fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",bt,He,Fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[bt,He,Fe]}],"backdrop-invert":[{"backdrop-invert":["",bt,He,Fe]}],"backdrop-opacity":[{"backdrop-opacity":[bt,He,Fe]}],"backdrop-saturate":[{"backdrop-saturate":[bt,He,Fe]}],"backdrop-sepia":[{"backdrop-sepia":["",bt,He,Fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",He,Fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[bt,"initial",He,Fe]}],ease:[{ease:["linear","initial",j,He,Fe]}],delay:[{delay:[bt,He,Fe]}],animate:[{animate:["none",C,He,Fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,He,Fe]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[He,Fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",He,Fe]}],"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":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",He,Fe]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[bt,Qh,kc,MD]}],stroke:[{stroke:["none",...D()]}],"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"]}},Uoe=boe(Foe);function ke(...e){return Uoe(It(e))}function iU(e){const t=e.split(/\s+/);if(t.length<5)return e;const[n,r,...i]=t,a=parseInt(r,10),o=parseInt(n,10);if(isNaN(a)||isNaN(o))return e;const l=new Date;return l.setUTCHours(a,o,0,0),`${l.getMinutes()} ${l.getHours()} ${i.join(" ")}`}function Hoe(e){const t=e.split(/\s+/);if(t.length<5)return e;const[n,r,...i]=t,a=parseInt(r,10),o=parseInt(n,10);if(isNaN(a)||isNaN(o))return e;const l=new Date;return l.setHours(a,o,0,0),`${l.getUTCMinutes()} ${l.getUTCHours()} ${i.join(" ")}`}function Tk({delayDuration:e=0,...t}){return f.jsx(Xae,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function aU({...e}){return f.jsx(Gae,{"data-slot":"tooltip",...e})}function oU({...e}){return f.jsx(Wae,{"data-slot":"tooltip-trigger",...e})}function sU({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(Qae,{children:f.jsxs(Zae,{"data-slot":"tooltip-content",sideOffset:t,className:ke("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,f.jsx(Jae,{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 lU=(...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 qoe=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 Voe=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 ID=e=>{const t=Voe(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 Koe={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 Yoe=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 Xoe=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},u)=>y.createElement("svg",{ref:u,...Koe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lU("lucide",i),...!a&&!Yoe(l)&&{"aria-hidden":"true"},...l},[...o.map(([d,m])=>y.createElement(d,m)),...Array.isArray(a)?a:[a]]));/**
 * @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 Ue=(e,t)=>{const n=y.forwardRef(({className:r,...i},a)=>y.createElement(Xoe,{ref:a,iconNode:t,className:lU(`lucide-${qoe(ID(e))}`,`lucide-${e}`,r),...i}));return n.displayName=ID(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 Goe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],cU=Ue("arrow-down",Goe);/**
 * @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 Woe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],G0=Ue("arrow-left",Woe);/**
 * @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 Qoe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],LD=Ue("arrow-up-right",Qoe);/**
 * @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 Zoe=[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z",key:"11gyqh"}],["path",{d:"M9 11v2",key:"1ueba0"}]],Dp=Ue("bot-message-square",Zoe);/**
 * @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 Joe=[["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"}]],uU=Ue("bot",Joe);/**
 * @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 ese=[["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"}]],Pk=Ue("brain",ese);/**
 * @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 tse=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],nse=Ue("calendar-clock",tse);/**
 * @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 rse=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],dU=Ue("calendar",rse);/**
 * @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 ise=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fU=Ue("check",ise);/**
 * @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 ase=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fu=Ue("chevron-down",ase);/**
 * @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 ose=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],sse=Ue("chevron-left",ose);/**
 * @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 lse=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ip=Ue("chevron-right",lse);/**
 * @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 cse=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],hU=Ue("chevron-up",cse);/**
 * @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 use=[["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"}]],Sa=Ue("circle-alert",use);/**
 * @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 dse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$f=Ue("circle-check",dse);/**
 * @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 fse=[["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"}]],Lp=Ue("circle-x",fse);/**
 * @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 hse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],mse=Ue("clock",hse);/**
 * @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 pse=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],gse=Ue("copy",pse);/**
 * @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 vse=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],dx=Ue("corner-down-left",vse);/**
 * @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 yse=[["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"}]],zp=Ue("download",yse);/**
 * @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 xse=[["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"}]],Mk=Ue("external-link",xse);/**
 * @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 bse=[["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"}]],mU=Ue("eye-off",bse);/**
 * @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 wse=[["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"}]],pU=Ue("eye",wse);/**
 * @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 Sse=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],jse=Ue("file-plus",Sse);/**
 * @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 Ese=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_se=Ue("file-text",Ese);/**
 * @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 Cse=[["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"}]],Q_=Ue("folder-kanban",Cse);/**
 * @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 Nse=[["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"}]],kse=Ue("folder-up",Nse);/**
 * @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 Ase=[["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"}]],Ose=Ue("folder",Ase);/**
 * @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 Tse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Pse=Ue("globe",Tse);/**
 * @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 Mse=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],zD=Ue("hash",Mse);/**
 * @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 Rse=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Dse=Ue("history",Rse);/**
 * @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 Ise=[["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"}]],Lse=Ue("house",Ise);/**
 * @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 zse=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$se=Ue("info",zse);/**
 * @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 Bse=[["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"}]],Fse=Ue("key-round",Bse);/**
 * @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 Use=[["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"}]],gU=Ue("layout-dashboard",Use);/**
 * @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 Hse=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ur=Ue("loader-circle",Hse);/**
 * @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 qse=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Vse=Ue("message-circle",qse);/**
 * @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 Kse=[["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"}]],hu=Ue("message-square",Kse);/**
 * @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 Yse=[["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"}]],Xse=Ue("monitor",Yse);/**
 * @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 Gse=[["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"}]],vU=Ue("moon",Gse);/**
 * @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 Wse=[["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"}]],yU=Ue("octagon-x",Wse);/**
 * @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 Qse=[["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"}]],Rk=Ue("paperclip",Qse);/**
 * @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 Zse=[["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"}]],xU=Ue("pause",Zse);/**
 * @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 Jse=[["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"}]],Bf=Ue("pencil",Jse);/**
 * @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 ele=[["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"}]],$p=Ue("play",ele);/**
 * @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 tle=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],nle=Ue("plug",tle);/**
 * @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 rle=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mu=Ue("plus",rle);/**
 * @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 ile=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],ale=Ue("radio",ile);/**
 * @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 ole=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],qm=Ue("refresh-cw",ole);/**
 * @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 sle=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],lle=Ue("rotate-ccw",sle);/**
 * @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 cle=[["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"}]],bU=Ue("save",cle);/**
 * @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 ule=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],W0=Ue("search",ule);/**
 * @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 dle=[["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"}]],fle=Ue("send",dle);/**
 * @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 hle=[["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"}]],Q0=Ue("settings",hle);/**
 * @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 mle=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Dk=Ue("square",mle);/**
 * @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 ple=[["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"}]],wU=Ue("sun",ple);/**
 * @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 gle=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],SU=Ue("terminal",gle);/**
 * @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 vle=[["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"}]],Pa=Ue("trash-2",vle);/**
 * @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 yle=[["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"}]],xle=Ue("triangle-alert",yle);/**
 * @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 ble=[["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"}]],Z0=Ue("upload",ble);/**
 * @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 wle=[["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"}]],Ik=Ue("users",wle);/**
 * @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 Sle=[["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"}]],jU=Ue("wrench",Sle);/**
 * @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 jle=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wa=Ue("x",jle);/**
 * @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 Ele=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],_le=Ue("zap",Ele);function Cle(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 Nle=e=>{switch(e){case"success":return Ole;case"info":return Ple;case"warning":return Tle;case"error":return Mle;default:return null}},kle=Array(12).fill(0),Ale=({visible:e,className:t})=>Ce.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ce.createElement("div",{className:"sonner-spinner"},kle.map((n,r)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Ole=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.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"})),Tle=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ce.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"})),Ple=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.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"})),Mle=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.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"})),Rle=Ce.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"},Ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Dle=()=>{const[e,t]=Ce.useState(document.hidden);return Ce.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Z_=1;class Ile{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,...i}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Z_++,o=this.toasts.find(u=>u.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...t,id:a,title:r}),{...u,...t,id:a,dismissible:l,title:r}):u):this.addToast({title:r,...i,dismissible:l,id:a}),a},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 i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,o;const l=i.then(async d=>{if(o=["resolve",d],Ce.isValidElement(d))a=!1,this.create({id:r,type:"default",message:d});else if(zle(d)&&!d.ok){a=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,b=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...b})}else if(d instanceof Error){a=!1;const h=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,b=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:g,...b})}else if(n.success!==void 0){a=!1;const h=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,b=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:g,...b})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){a=!1;const m=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,v=typeof m=="object"&&!Ce.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,m)=>l.then(()=>o[0]==="reject"?m(o[1]):d(o[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Z_++;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 yi=new Ile,Lle=(e,t)=>{const n=(t==null?void 0:t.id)||Z_++;return yi.addToast({title:e,...t,id:n}),n},zle=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",$le=Lle,Ble=()=>yi.toasts,Fle=()=>yi.getActiveToasts(),We=Object.assign($le,{success:yi.success,info:yi.info,warning:yi.warning,error:yi.error,custom:yi.custom,message:yi.message,promise:yi.promise,dismiss:yi.dismiss,loading:yi.loading},{getHistory:Ble,getToasts:Fle});Cle("[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 ry(e){return e.label!==void 0}const Ule=3,Hle="24px",qle="16px",$D=4e3,Vle=356,Kle=14,Yle=45,Xle=200;function co(...e){return e.filter(Boolean).join(" ")}function Gle(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Wle=e=>{var t,n,r,i,a,o,l,u,d;const{invert:m,toast:h,unstyled:g,interacting:v,setHeights:b,visibleToasts:w,heights:S,index:j,toasts:C,expanded:E,removeToast:k,defaultRichColors:O,closeButton:A,style:T,cancelButtonStyle:M,actionButtonStyle:B,className:I="",descriptionClassName:U="",duration:L,position:G,gap:z,expandByDefault:K,classNames:P,icons:H,closeButtonAriaLabel:Y="Close toast"}=e,[V,D]=Ce.useState(null),[q,$]=Ce.useState(null),[F,Q]=Ce.useState(!1),[Z,te]=Ce.useState(!1),[ae,re]=Ce.useState(!1),[ee,se]=Ce.useState(!1),[ve,ie]=Ce.useState(!1),[Se,Ee]=Ce.useState(0),[qe,Te]=Ce.useState(0),rt=Ce.useRef(h.duration||L||$D),Je=Ce.useRef(null),et=Ce.useRef(null),xt=j===0,dt=j+1<=w,Ct=h.type,mn=h.dismissible!==!1,Ut=h.className||"",Kt=h.descriptionClassName||"",ce=Ce.useMemo(()=>S.findIndex(Xe=>Xe.toastId===h.id)||0,[S,h.id]),xe=Ce.useMemo(()=>{var Xe;return(Xe=h.closeButton)!=null?Xe:A},[h.closeButton,A]),ze=Ce.useMemo(()=>h.duration||L||$D,[h.duration,L]),it=Ce.useRef(0),st=Ce.useRef(0),Ht=Ce.useRef(0),rn=Ce.useRef(null),[je,ct]=G.split("-"),wt=Ce.useMemo(()=>S.reduce((Xe,Mt,pn)=>pn>=ce?Xe:Xe+Mt.height,0),[S,ce]),ft=Dle(),On=h.invert||m,un=Ct==="loading";st.current=Ce.useMemo(()=>ce*z+wt,[ce,wt]),Ce.useEffect(()=>{rt.current=ze},[ze]),Ce.useEffect(()=>{Q(!0)},[]),Ce.useEffect(()=>{const Xe=et.current;if(Xe){const Mt=Xe.getBoundingClientRect().height;return Te(Mt),b(pn=>[{toastId:h.id,height:Mt,position:h.position},...pn]),()=>b(pn=>pn.filter(Tn=>Tn.toastId!==h.id))}},[b,h.id]),Ce.useLayoutEffect(()=>{if(!F)return;const Xe=et.current,Mt=Xe.style.height;Xe.style.height="auto";const pn=Xe.getBoundingClientRect().height;Xe.style.height=Mt,Te(pn),b(Tn=>Tn.find(Yt=>Yt.toastId===h.id)?Tn.map(Yt=>Yt.toastId===h.id?{...Yt,height:pn}:Yt):[{toastId:h.id,height:pn,position:h.position},...Tn])},[F,h.title,h.description,b,h.id,h.jsx,h.action,h.cancel]);const Cr=Ce.useCallback(()=>{te(!0),Ee(st.current),b(Xe=>Xe.filter(Mt=>Mt.toastId!==h.id)),setTimeout(()=>{k(h)},Xle)},[h,k,b,st]);Ce.useEffect(()=>{if(h.promise&&Ct==="loading"||h.duration===1/0||h.type==="loading")return;let Xe;return E||v||ft?(()=>{if(Ht.current<it.current){const Tn=new Date().getTime()-it.current;rt.current=rt.current-Tn}Ht.current=new Date().getTime()})():(()=>{rt.current!==1/0&&(it.current=new Date().getTime(),Xe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Cr()},rt.current))})(),()=>clearTimeout(Xe)},[E,v,h,Ct,ft,Cr]),Ce.useEffect(()=>{h.delete&&(Cr(),h.onDismiss==null||h.onDismiss.call(h,h))},[Cr,h.delete]);function Xr(){var Xe;if(H!=null&&H.loading){var Mt;return Ce.createElement("div",{className:co(P==null?void 0:P.loader,h==null||(Mt=h.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":Ct==="loading"},H.loading)}return Ce.createElement(Ale,{className:co(P==null?void 0:P.loader,h==null||(Xe=h.classNames)==null?void 0:Xe.loader),visible:Ct==="loading"})}const Gr=h.icon||(H==null?void 0:H[Ct])||Nle(Ct);var Wr,gr;return Ce.createElement("li",{tabIndex:0,ref:et,className:co(I,Ut,P==null?void 0:P.toast,h==null||(t=h.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[Ct],h==null||(n=h.classNames)==null?void 0:n[Ct]),"data-sonner-toast":"","data-rich-colors":(Wr=h.richColors)!=null?Wr:O,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":F,"data-promise":!!h.promise,"data-swiped":ve,"data-removed":Z,"data-visible":dt,"data-y-position":je,"data-x-position":ct,"data-index":j,"data-front":xt,"data-swiping":ae,"data-dismissible":mn,"data-type":Ct,"data-invert":On,"data-swipe-out":ee,"data-swipe-direction":q,"data-expanded":!!(E||K&&F),"data-testid":h.testId,style:{"--index":j,"--toasts-before":j,"--z-index":C.length-j,"--offset":`${Z?Se:st.current}px`,"--initial-height":K?"auto":`${qe}px`,...T,...h.style},onDragEnd:()=>{re(!1),D(null),rn.current=null},onPointerDown:Xe=>{Xe.button!==2&&(un||!mn||(Je.current=new Date,Ee(st.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(re(!0),rn.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,Mt,pn;if(ee||!mn)return;rn.current=null;const Tn=Number(((Xe=et.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ir=Number(((Mt=et.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Yt=new Date().getTime()-((pn=Je.current)==null?void 0:pn.getTime()),ge=V==="x"?Tn:Ir,at=Math.abs(ge)/Yt;if(Math.abs(ge)>=Yle||at>.11){Ee(st.current),h.onDismiss==null||h.onDismiss.call(h,h),$(V==="x"?Tn>0?"right":"left":Ir>0?"down":"up"),Cr(),se(!0);return}else{var Lt,an;(Lt=et.current)==null||Lt.style.setProperty("--swipe-amount-x","0px"),(an=et.current)==null||an.style.setProperty("--swipe-amount-y","0px")}ie(!1),re(!1),D(null)},onPointerMove:Xe=>{var Mt,pn,Tn;if(!rn.current||!mn||((Mt=window.getSelection())==null?void 0:Mt.toString().length)>0)return;const Yt=Xe.clientY-rn.current.y,ge=Xe.clientX-rn.current.x;var at;const Lt=(at=e.swipeDirections)!=null?at:Gle(G);!V&&(Math.abs(ge)>1||Math.abs(Yt)>1)&&D(Math.abs(ge)>Math.abs(Yt)?"x":"y");let an={x:0,y:0};const oi=rr=>1/(1.5+Math.abs(rr)/20);if(V==="y"){if(Lt.includes("top")||Lt.includes("bottom"))if(Lt.includes("top")&&Yt<0||Lt.includes("bottom")&&Yt>0)an.y=Yt;else{const rr=Yt*oi(Yt);an.y=Math.abs(rr)<Math.abs(Yt)?rr:Yt}}else if(V==="x"&&(Lt.includes("left")||Lt.includes("right")))if(Lt.includes("left")&&ge<0||Lt.includes("right")&&ge>0)an.x=ge;else{const rr=ge*oi(ge);an.x=Math.abs(rr)<Math.abs(ge)?rr:ge}(Math.abs(an.x)>0||Math.abs(an.y)>0)&&ie(!0),(pn=et.current)==null||pn.style.setProperty("--swipe-amount-x",`${an.x}px`),(Tn=et.current)==null||Tn.style.setProperty("--swipe-amount-y",`${an.y}px`)}},xe&&!h.jsx&&Ct!=="loading"?Ce.createElement("button",{"aria-label":Y,"data-disabled":un,"data-close-button":!0,onClick:un||!mn?()=>{}:()=>{Cr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:co(P==null?void 0:P.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(gr=H==null?void 0:H.close)!=null?gr:Rle):null,(Ct||h.icon||h.promise)&&h.icon!==null&&((H==null?void 0:H[Ct])!==null||h.icon)?Ce.createElement("div",{"data-icon":"",className:co(P==null?void 0:P.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Xr():null,h.type!=="loading"?Gr:null):null,Ce.createElement("div",{"data-content":"",className:co(P==null?void 0:P.content,h==null||(a=h.classNames)==null?void 0:a.content)},Ce.createElement("div",{"data-title":"",className:co(P==null?void 0:P.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ce.createElement("div",{"data-description":"",className:co(U,Kt,P==null?void 0:P.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),Ce.isValidElement(h.cancel)?h.cancel:h.cancel&&ry(h.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:Xe=>{ry(h.cancel)&&mn&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Xe),Cr())},className:co(P==null?void 0:P.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,Ce.isValidElement(h.action)?h.action:h.action&&ry(h.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||B,onClick:Xe=>{ry(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Xe),!Xe.defaultPrevented&&Cr())},className:co(P==null?void 0:P.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function BD(){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 Qle(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?qle:Hle;function u(d){["top","right","bottom","left"].forEach(m=>{n[`${o}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const Zle=Ce.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:m,mobileOffset:h,theme:g="light",richColors:v,duration:b,style:w,visibleToasts:S=Ule,toastOptions:j,dir:C=BD(),gap:E=Kle,icons:k,containerAriaLabel:O="Notifications"}=t,[A,T]=Ce.useState([]),M=Ce.useMemo(()=>r?A.filter(F=>F.toasterId===r):A.filter(F=>!F.toasterId),[A,r]),B=Ce.useMemo(()=>Array.from(new Set([a].concat(M.filter(F=>F.position).map(F=>F.position)))),[M,a]),[I,U]=Ce.useState([]),[L,G]=Ce.useState(!1),[z,K]=Ce.useState(!1),[P,H]=Ce.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=Ce.useRef(null),V=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Ce.useRef(null),q=Ce.useRef(!1),$=Ce.useCallback(F=>{T(Q=>{var Z;return(Z=Q.find(te=>te.id===F.id))!=null&&Z.delete||yi.dismiss(F.id),Q.filter(({id:te})=>te!==F.id)})},[]);return Ce.useEffect(()=>yi.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(Z=>Z.id===F.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{wB.flushSync(()=>{T(Q=>{const Z=Q.findIndex(te=>te.id===F.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...F},...Q.slice(Z+1)]:[F,...Q]})})})}),[A]),Ce.useEffect(()=>{if(g!=="system"){H(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Q})=>{H(Q?"dark":"light")})}catch{F.addListener(({matches:Z})=>{try{H(Z?"dark":"light")}catch(te){console.error(te)}})}},[g]),Ce.useEffect(()=>{A.length<=1&&G(!1)},[A]),Ce.useEffect(()=>{const F=Q=>{var Z;if(o.every(re=>Q[re]||Q.code===re)){var ae;G(!0),(ae=Y.current)==null||ae.focus()}Q.code==="Escape"&&(document.activeElement===Y.current||(Z=Y.current)!=null&&Z.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),Ce.useEffect(()=>{if(Y.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,q.current=!1)}},[Y.current]),Ce.createElement("section",{ref:n,"aria-label":`${O} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((F,Q)=>{var Z;const[te,ae]=F.split("-");return M.length?Ce.createElement("ol",{key:F,dir:C==="auto"?BD():C,tabIndex:-1,ref:Y,className:d,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":te,"data-x-position":ae,style:{"--front-toast-height":`${((Z=I[0])==null?void 0:Z.height)||0}px`,"--width":`${Vle}px`,"--gap":`${E}px`,...w,...Qle(m,h)},onBlur:re=>{q.current&&!re.currentTarget.contains(re.relatedTarget)&&(q.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||q.current||(q.current=!0,D.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"||K(!0)},onPointerUp:()=>K(!1)},M.filter(re=>!re.position&&Q===0||re.position===F).map((re,ee)=>{var se,ve;return Ce.createElement(Wle,{key:re.id,icons:k,index:ee,toast:re,defaultRichColors:v,duration:(se=j==null?void 0:j.duration)!=null?se:b,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:i,visibleToasts:S,closeButton:(ve=j==null?void 0:j.closeButton)!=null?ve:u,interacting:z,position:F,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,closeButtonAriaLabel:j==null?void 0:j.closeButtonAriaLabel,removeToast:$,toasts:M.filter(ie=>ie.position==re.position),heights:I.filter(ie=>ie.position==re.position),setHeights:U,expandByDefault:l,gap:E,expanded:L,swipeDirections:t.swipeDirections})})):null}))}),Jle=({...e})=>{const{theme:t="system"}=FN();return f.jsx(Zle,{theme:t,className:"toaster group",icons:{success:f.jsx($f,{className:"size-4"}),info:f.jsx($se,{className:"size-4"}),warning:f.jsx(xle,{className:"size-4"}),error:f.jsx(yU,{className:"size-4"}),loading:f.jsx(ur,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},ece=new IJ({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),EU="/api";class _U extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function Zh(e,t){const n=`${EU}${e}`,r=new AbortController,i=setTimeout(()=>r.abort(),3e4);let a;try{a=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(i)}if(!a.ok){const o=await a.json().catch(()=>null);throw new _U(a.status,a.statusText,o)}if(!(a.status===204||a.headers.get("content-length")==="0"))return a.json()}async function tce(e,t){const n=`${EU}${e}`,r=new AbortController,i=setTimeout(()=>r.abort(),6e4);let a;try{a=await fetch(n,{method:"POST",body:t,signal:r.signal})}finally{clearTimeout(i)}if(!a.ok){const o=await a.json().catch(()=>null);throw new _U(a.status,a.statusText,o)}return a.json()}const Ae={get:e=>Zh(e),post:(e,t)=>Zh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Zh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Zh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Zh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),tce(e,n)}},Pe={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"],runs:["schedules","runs"]},conversations:{all:e=>["conversations",e],detail:e=>["conversations","detail",e]},integrations:{all:e=>["integrations",e],detail:(e,t)=>["integrations",e,t],config:(e,t)=>["integrations",e,"config",t]}};function Ff(){return Pn({queryKey:Pe.projects.all,queryFn:()=>Ae.get("/projects")})}function Lk(e,t){return Pn({queryKey:Pe.projects.detail(e),queryFn:()=>Ae.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function J0(e){return Pn({queryKey:Pe.projects.files(e),queryFn:()=>Ae.get(`/projects/${e}/files`)})}function zk(e,t){return Pn({queryKey:Pe.projects.config(e),queryFn:()=>Ae.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function fx(e,t){return UJ({queryKey:Pe.conversations.detail(e),queryFn:({pageParam:n})=>Ae.get(`/conversations/${e}?limit=20${n?`&before_id=${encodeURIComponent(n)}`:""}`),initialPageParam:null,getPreviousPageParam:()=>null,getNextPageParam:n=>{var r;return n.has_more?((r=n.sessions[0])==null?void 0:r.run_id)??null:null},...t})}function nce(e=10){return Pn({queryKey:["conversations","recent",e],queryFn:()=>Ae.get(`/conversations/recent?limit=${e}`)})}function Uf(){return Pn({queryKey:["imu","conversations"],queryFn:()=>Ae.get("/imu/conversations")})}function Bp(e,t=1,n=20){return Pn({queryKey:[...Pe.conversations.all(e),t,n],queryFn:()=>Ae.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function eb(){const e=Qe();return ut({mutationFn:t=>Ae.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.conversations.all(n.project_id)})}})}function CU(e){const t=Qe();return ut({mutationFn:n=>Ae.post(`/conversations/${e}/tasks`,n),onSuccess:(n,r)=>{n.queued&&t.setQueryData(Pe.conversations.detail(e),i=>{if(!i)return i;const a=i.pages.map((o,l)=>{if(l!==0)return o;const u={id:-Date.now(),task:r.task,source:"user",source_id:null,created_at:new Date().toISOString()},d=[...o.queued_tasks??[],u];return{...o,queued_tasks:d,pending_task:d.map(m=>m.task).join(`

`)||null}});return{...i,pages:a}}),t.invalidateQueries({queryKey:Pe.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["imu","conversations"]})}})}function $k(e){const t=Qe();return ut({mutationFn:({conversationId:n,title:r})=>Ae.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:Pe.conversations.all(e)}),t.invalidateQueries({queryKey:Pe.conversations.detail(r)})}})}function NU(e){const t=Qe();return ut({mutationFn:()=>Ae.delete(`/conversations/${e}/pending_task`),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.conversations.detail(e)})}})}function kU(e){const t=Qe();return ut({mutationFn:n=>Ae.delete(`/conversations/${e}/queued_tasks/${n}`),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.conversations.detail(e)})}})}function tb(){const e=Qe();return ut({mutationFn:()=>Ae.post("/imu/conversations",{}),onSuccess:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function Bk(){const e=Qe();return ut({mutationFn:({conversationId:t,title:n})=>Ae.patch(`/conversations/${t}`,{title:n}),onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["imu","conversations"]}),e.invalidateQueries({queryKey:Pe.conversations.detail(n)})}})}function AU(){const e=Qe();return ut({mutationFn:t=>Ae.delete(`/conversations/${t}`),onMutate:async t=>{await e.cancelQueries({queryKey:["imu","conversations"]});const n=e.getQueryData(["imu","conversations"]);return e.setQueryData(["imu","conversations"],r=>r&&r.filter(i=>i.id!==t)),e.removeQueries({queryKey:Pe.conversations.detail(t)}),{previous:n}},onError:(t,n,r)=>{r!=null&&r.previous&&e.setQueryData(["imu","conversations"],r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function OU(e){const t=Qe();return ut({mutationFn:n=>Ae.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:Pe.conversations.all(e)});const r=t.getQueryData(Pe.conversations.all(e));return t.setQueryData(Pe.conversations.all(e),i=>i&&{...i,items:i.items.filter(a=>a.id!==n),total:i.total-1}),t.removeQueries({queryKey:Pe.conversations.detail(n)}),{previous:r}},onError:(n,r,i)=>{i!=null&&i.previous&&t.setQueryData(Pe.conversations.all(e),i.previous)},onSettled:()=>{t.invalidateQueries({queryKey:Pe.conversations.all(e)})}})}function Ze({className:e,type:t,...n}){return f.jsx("input",{type:t,"data-slot":"input",className:ke("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 rce=500;function ice({onCommandPalette:e,onShortcutsHelp:t}){const n=to(),r=y.useRef(null),i=y.useRef(void 0);y.useEffect(()=>{function a(o){const l=o.target;if(!(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)){if((o.metaKey||o.ctrlKey)&&o.key==="k"){o.preventDefault(),e();return}if(!(o.metaKey||o.ctrlKey||o.altKey)){if(o.key==="?"){o.preventDefault(),t();return}if(r.current==="g"){if(r.current=null,clearTimeout(i.current),o.key==="d"){o.preventDefault(),n("/");return}if(o.key==="p"){o.preventDefault(),n("/projects");return}}if(o.key==="g"){r.current="g",i.current=setTimeout(()=>{r.current=null},rce);return}}}}return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),clearTimeout(i.current)}},[n,e,t])}function TU(e){const t=e?"?"+new URLSearchParams(e).toString():"";return Pn({queryKey:Pe.sessions.all(e),queryFn:()=>Ae.get(`/sessions${t}`)})}function Fk(){return TU({status:"running",per_page:"50"})}function ace(){return TU({per_page:"10"})}function PU(e,t=1,n=20){return Pn({queryKey:[...Pe.projects.sessions(e),t,n],queryFn:()=>Ae.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function oce(e,t,n){return Pn({queryKey:Pe.sessions.detail(e,t),queryFn:()=>Ae.get(`/projects/${e}/sessions/${t}`),...n})}var FD=1,sce=.9,lce=.8,cce=.17,QS=.1,ZS=.999,uce=.9999,dce=.99,fce=/[\\\/_+.#"@\[\(\{&]/,hce=/[\\\/_+.#"@\[\(\{&]/g,mce=/[\s-]/,MU=/[\s-]/g;function J_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?FD:dce;var l=`${i},${a}`;if(o[l]!==void 0)return o[l];for(var u=r.charAt(a),d=n.indexOf(u,i),m=0,h,g,v,b;d>=0;)h=J_(e,t,n,r,d+1,a+1,o),h>m&&(d===i?h*=FD:fce.test(e.charAt(d-1))?(h*=lce,v=e.slice(i,d-1).match(hce),v&&i>0&&(h*=Math.pow(ZS,v.length))):mce.test(e.charAt(d-1))?(h*=sce,b=e.slice(i,d-1).match(MU),b&&i>0&&(h*=Math.pow(ZS,b.length))):(h*=cce,i>0&&(h*=Math.pow(ZS,d-i))),e.charAt(d)!==t.charAt(a)&&(h*=uce)),(h<QS&&n.charAt(d-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(d-1)!==r.charAt(a))&&(g=J_(e,t,n,r,d+1,a+2,o),g*QS>h&&(h=g*QS)),h>m&&(m=h),d=n.indexOf(u,d+1);return o[l]=m,m}function UD(e){return e.toLowerCase().replace(MU," ")}function pce(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,J_(e,t,UD(e),UD(t),0,0,{})}var Jh='[cmdk-group=""]',JS='[cmdk-group-items=""]',gce='[cmdk-group-heading=""]',RU='[cmdk-item=""]',HD=`${RU}:not([aria-disabled="true"])`,eC="cmdk-item-select",Dd="data-value",vce=(e,t,n)=>pce(e,t,n),DU=y.createContext(void 0),Fp=()=>y.useContext(DU),IU=y.createContext(void 0),Uk=()=>y.useContext(IU),LU=y.createContext(void 0),zU=y.forwardRef((e,t)=>{let n=Id(()=>{var $,F;return{search:"",value:(F=($=e.value)!=null?$:e.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Id(()=>new Set),i=Id(()=>new Map),a=Id(()=>new Map),o=Id(()=>new Set),l=$U(e),{label:u,children:d,value:m,onValueChange:h,filter:g,shouldFilter:v,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...j}=e,C=Sr(),E=Sr(),k=Sr(),O=y.useRef(null),A=kce();pu(()=>{if(m!==void 0){let $=m.trim();n.current.value=$,T.emit()}},[m]),pu(()=>{A(6,G)},[]);let T=y.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>n.current,setState:($,F,Q)=>{var Z,te,ae,re;if(!Object.is(n.current[$],F)){if(n.current[$]=F,$==="search")L(),I(),A(1,U);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(k);ee?ee.focus():(Z=document.getElementById(C))==null||Z.focus()}if(A(7,()=>{var ee;n.current.selectedItemId=(ee=z())==null?void 0:ee.id,T.emit()}),Q||A(5,G),((te=l.current)==null?void 0:te.value)!==void 0){let ee=F??"";(re=(ae=l.current).onValueChange)==null||re.call(ae,ee);return}}T.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),M=y.useMemo(()=>({value:($,F,Q)=>{var Z;F!==((Z=a.current.get($))==null?void 0:Z.value)&&(a.current.set($,{value:F,keywords:Q}),n.current.filtered.items.set($,B(F,Q)),A(2,()=>{I(),T.emit()}))},item:($,F)=>(r.current.add($),F&&(i.current.has(F)?i.current.get(F).add($):i.current.set(F,new Set([$]))),A(3,()=>{L(),I(),n.current.value||U(),T.emit()}),()=>{a.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let Q=z();A(4,()=>{L(),(Q==null?void 0:Q.getAttribute("id"))===$&&U(),T.emit()})}),group:$=>(i.current.has($)||i.current.set($,new Set),()=>{a.current.delete($),i.current.delete($)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:C,inputId:k,labelId:E,listInnerRef:O}),[]);function B($,F){var Q,Z;let te=(Z=(Q=l.current)==null?void 0:Q.filter)!=null?Z:vce;return $?te($,n.current.search,F):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let $=n.current.filtered.items,F=[];n.current.filtered.groups.forEach(Z=>{let te=i.current.get(Z),ae=0;te.forEach(re=>{let ee=$.get(re);ae=Math.max(ee,ae)}),F.push([Z,ae])});let Q=O.current;K().sort((Z,te)=>{var ae,re;let ee=Z.getAttribute("id"),se=te.getAttribute("id");return((ae=$.get(se))!=null?ae:0)-((re=$.get(ee))!=null?re:0)}).forEach(Z=>{let te=Z.closest(JS);te?te.appendChild(Z.parentElement===te?Z:Z.closest(`${JS} > *`)):Q.appendChild(Z.parentElement===Q?Z:Z.closest(`${JS} > *`))}),F.sort((Z,te)=>te[1]-Z[1]).forEach(Z=>{var te;let ae=(te=O.current)==null?void 0:te.querySelector(`${Jh}[${Dd}="${encodeURIComponent(Z[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function U(){let $=K().find(Q=>Q.getAttribute("aria-disabled")!=="true"),F=$==null?void 0:$.getAttribute(Dd);T.setState("value",F||void 0)}function L(){var $,F,Q,Z;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let ae of r.current){let re=(F=($=a.current.get(ae))==null?void 0:$.value)!=null?F:"",ee=(Z=(Q=a.current.get(ae))==null?void 0:Q.keywords)!=null?Z:[],se=B(re,ee);n.current.filtered.items.set(ae,se),se>0&&te++}for(let[ae,re]of i.current)for(let ee of re)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=te}function G(){var $,F,Q;let Z=z();Z&&((($=Z.parentElement)==null?void 0:$.firstChild)===Z&&((Q=(F=Z.closest(Jh))==null?void 0:F.querySelector(gce))==null||Q.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function z(){var $;return($=O.current)==null?void 0:$.querySelector(`${RU}[aria-selected="true"]`)}function K(){var $;return Array.from((($=O.current)==null?void 0:$.querySelectorAll(HD))||[])}function P($){let F=K()[$];F&&T.setState("value",F.getAttribute(Dd))}function H($){var F;let Q=z(),Z=K(),te=Z.findIndex(re=>re===Q),ae=Z[te+$];(F=l.current)!=null&&F.loop&&(ae=te+$<0?Z[Z.length-1]:te+$===Z.length?Z[0]:Z[te+$]),ae&&T.setState("value",ae.getAttribute(Dd))}function Y($){let F=z(),Q=F==null?void 0:F.closest(Jh),Z;for(;Q&&!Z;)Q=$>0?Cce(Q,Jh):Nce(Q,Jh),Z=Q==null?void 0:Q.querySelector(HD);Z?T.setState("value",Z.getAttribute(Dd)):H($)}let V=()=>P(K().length-1),D=$=>{$.preventDefault(),$.metaKey?V():$.altKey?Y(1):H(1)},q=$=>{$.preventDefault(),$.metaKey?P(0):$.altKey?Y(-1):H(-1)};return y.createElement(Ke.div,{ref:t,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:$=>{var F;(F=j.onKeyDown)==null||F.call(j,$);let Q=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||Q))switch($.key){case"n":case"j":{S&&$.ctrlKey&&D($);break}case"ArrowDown":{D($);break}case"p":case"k":{S&&$.ctrlKey&&q($);break}case"ArrowUp":{q($);break}case"Home":{$.preventDefault(),P(0);break}case"End":{$.preventDefault(),V();break}case"Enter":{$.preventDefault();let Z=z();if(Z){let te=new Event(eC);Z.dispatchEvent(te)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:Oce},u),nb(e,$=>y.createElement(IU.Provider,{value:T},y.createElement(DU.Provider,{value:M},$))))}),yce=y.forwardRef((e,t)=>{var n,r;let i=Sr(),a=y.useRef(null),o=y.useContext(LU),l=Fp(),u=$U(e),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;pu(()=>{if(!d)return l.item(i,o==null?void 0:o.id)},[d]);let m=BU(i,a,[e.value,e.children,a],e.keywords),h=Uk(),g=Vl(A=>A.value&&A.value===m.current),v=Vl(A=>d||l.filter()===!1?!0:A.search?A.filtered.items.get(i)>0:!0);y.useEffect(()=>{let A=a.current;if(!(!A||e.disabled))return A.addEventListener(eC,b),()=>A.removeEventListener(eC,b)},[v,e.onSelect,e.disabled]);function b(){var A,T;w(),(T=(A=u.current).onSelect)==null||T.call(A,m.current)}function w(){h.setState("value",m.current,!0)}if(!v)return null;let{disabled:S,value:j,onSelect:C,forceMount:E,keywords:k,...O}=e;return y.createElement(Ke.div,{ref:xs(a,t),...O,id:i,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||l.getDisablePointerSelection()?void 0:w,onClick:S?void 0:b},e.children)}),xce=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Sr(),l=y.useRef(null),u=y.useRef(null),d=Sr(),m=Fp(),h=Vl(v=>i||m.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);pu(()=>m.group(o),[]),BU(o,l,[e.value,e.heading,u]);let g=y.useMemo(()=>({id:o,forceMount:i}),[i]);return y.createElement(Ke.div,{ref:xs(l,t),...a,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&y.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),nb(e,v=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},y.createElement(LU.Provider,{value:g},v))))}),bce=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=y.useRef(null),a=Vl(o=>!o.search);return!n&&!a?null:y.createElement(Ke.div,{ref:xs(i,t),...r,"cmdk-separator":"",role:"separator"})}),wce=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Uk(),o=Vl(d=>d.search),l=Vl(d=>d.selectedItemId),u=Fp();return y.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),y.createElement(Ke.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:i?e.value:o,onChange:d=>{i||a.setState("search",d.target.value),n==null||n(d.target.value)}})}),Sce=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=y.useRef(null),o=y.useRef(null),l=Vl(d=>d.selectedItemId),u=Fp();return y.useEffect(()=>{if(o.current&&a.current){let d=o.current,m=a.current,h,g=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let v=d.offsetHeight;m.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(h),g.unobserve(d)}}},[]),y.createElement(Ke.div,{ref:xs(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},nb(e,d=>y.createElement("div",{ref:xs(o,u.listInnerRef),"cmdk-list-sizer":""},d)))}),jce=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return y.createElement(ZN,{open:n,onOpenChange:r},y.createElement(JN,{container:o},y.createElement(ek,{"cmdk-overlay":"",className:i}),y.createElement(tk,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(zU,{ref:t,...l}))))}),Ece=y.forwardRef((e,t)=>Vl(n=>n.filtered.count===0)?y.createElement(Ke.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),_ce=y.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return y.createElement(Ke.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},nb(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),Hf=Object.assign(zU,{List:Sce,Item:yce,Input:wce,Group:xce,Separator:bce,Dialog:jce,Empty:Ece,Loading:_ce});function Cce(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nce(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $U(e){let t=y.useRef(e);return pu(()=>{t.current=e}),t}var pu=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Id(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Vl(e){let t=Uk(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function BU(e,t,n,r=[]){let i=y.useRef(),a=Fp();return pu(()=>{var o;let l=(()=>{var d;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(d=m.current.textContent)==null?void 0:d.trim():i.current}})(),u=r.map(d=>d.trim());a.value(e,l,u),(o=t.current)==null||o.setAttribute(Dd,l),i.current=l}),i}var kce=()=>{let[e,t]=y.useState(),n=Id(()=>new Map);return pu(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function Ace(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function nb({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(Ace(t),{ref:t.ref},n(t.props.children)):n(t)}var Oce={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const qD=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,VD=It,rb=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return VD(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(d=>{const m=n==null?void 0:n[d],h=a==null?void 0:a[d];if(m===null)return null;const g=qD(m)||qD(h);return i[d][g]}),l=n&&Object.entries(n).reduce((d,m)=>{let[h,g]=m;return g===void 0||(d[h]=g),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:h,className:g,...v}=m;return Object.entries(v).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...a,...l}[w]):{...a,...l}[w]===S})?[...d,h,g]:d},[]);return VD(e,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},Tce=rb("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 pe({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const a=r?UN:"button";return f.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:ke(Tce({variant:t,size:n,className:e})),...i})}function Qi({...e}){return f.jsx(ZN,{"data-slot":"dialog",...e})}function Pce({...e}){return f.jsx(JN,{"data-slot":"dialog-portal",...e})}function Mce({className:e,...t}){return f.jsx(ek,{"data-slot":"dialog-overlay",className:ke("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 Zi({className:e,children:t,showCloseButton:n=!0,...r}){return f.jsxs(Pce,{"data-slot":"dialog-portal",children:[f.jsx(Mce,{}),f.jsxs(tk,{"data-slot":"dialog-content",className:ke("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&&f.jsxs(nk,{"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:[f.jsx(Wa,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ji({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:ke("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Up({className:e,showCloseButton:t=!1,children:n,...r}){return f.jsxs("div",{"data-slot":"dialog-footer",className:ke("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&f.jsx(nk,{asChild:!0,children:f.jsx(pe,{variant:"outline",children:"Close"})})]})}function ea({className:e,...t}){return f.jsx(w6,{"data-slot":"dialog-title",className:ke("text-lg leading-none font-semibold",e),...t})}function Hp({className:e,...t}){return f.jsx(S6,{"data-slot":"dialog-description",className:ke("text-sm text-muted-foreground",e),...t})}function Rce({className:e,...t}){return f.jsx(Hf,{"data-slot":"command",className:ke("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function Dce({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!0,...a}){return f.jsxs(Qi,{...a,children:[f.jsxs(Ji,{className:"sr-only",children:[f.jsx(ea,{children:e}),f.jsx(Hp,{children:t})]}),f.jsx(Zi,{className:ke("overflow-hidden p-0",r),showCloseButton:i,children:f.jsx(Rce,{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 Ice({className:e,...t}){return f.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[f.jsx(W0,{className:"size-4 shrink-0 opacity-50"}),f.jsx(Hf.Input,{"data-slot":"command-input",className:ke("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 Lce({className:e,...t}){return f.jsx(Hf.List,{"data-slot":"command-list",className:ke("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function zce({...e}){return f.jsx(Hf.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function em({className:e,...t}){return f.jsx(Hf.Group,{"data-slot":"command-group",className:ke("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 $a({className:e,...t}){return f.jsx(Hf.Item,{"data-slot":"command-item",className:ke("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 KD({className:e,...t}){return f.jsx("span",{"data-slot":"command-shortcut",className:ke("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function $ce({open:e,onOpenChange:t}){var d;const n=to(),{setTheme:r}=FN(),i=Ff(),a=Fk(),o=i.data??[],l=((d=a.data)==null?void 0:d.items)??[],u=m=>{t(!1),n(m)};return f.jsxs(Dce,{open:e,onOpenChange:t,showCloseButton:!1,children:[f.jsx(Ice,{placeholder:"Type a command or search..."}),f.jsxs(Lce,{children:[f.jsx(zce,{children:"No results found."}),f.jsxs(em,{heading:"Navigation",children:[f.jsxs($a,{onSelect:()=>u("/"),children:[f.jsx(gU,{}),"Dashboard",f.jsx(KD,{children:"G D"})]}),f.jsxs($a,{onSelect:()=>u("/projects"),children:[f.jsx(Q_,{}),"Projects",f.jsx(KD,{children:"G P"})]})]}),o.length>0&&f.jsx(em,{heading:"Projects",children:o.map(m=>f.jsxs($a,{onSelect:()=>u(`/projects/${m.id}`),children:[f.jsx(Q_,{}),m.display_name]},m.id))}),l.length>0&&f.jsx(em,{heading:"Running Sessions",children:l.map(m=>f.jsxs($a,{onSelect:()=>u(`/projects/${m.project_id}/sessions/${m.run_id}`),children:[f.jsx($p,{}),m.role," (",m.run_id.slice(0,8),")"]},m.run_id))}),f.jsxs(em,{heading:"Resources",children:[f.jsxs($a,{onSelect:()=>u("/resources/roles"),children:[f.jsx(Ik,{}),"Roles"]}),f.jsxs($a,{onSelect:()=>u("/resources/skills"),children:[f.jsx(jU,{}),"Skills"]}),f.jsxs($a,{onSelect:()=>u("/resources/agents"),children:[f.jsx(uU,{}),"Agents"]}),f.jsxs($a,{onSelect:()=>u("/resources/memories"),children:[f.jsx(Pk,{}),"Memory"]})]}),f.jsxs(em,{heading:"Theme",children:[f.jsxs($a,{onSelect:()=>{r("light"),t(!1)},children:[f.jsx(wU,{}),"Light"]}),f.jsxs($a,{onSelect:()=>{r("dark"),t(!1)},children:[f.jsx(vU,{}),"Dark"]}),f.jsxs($a,{onSelect:()=>{r("system"),t(!1)},children:[f.jsx(Xse,{}),"System"]})]})]})]})}const Bce=[{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 Fce({open:e,onOpenChange:t}){return f.jsx(Qi,{open:e,onOpenChange:t,children:f.jsxs(Zi,{className:"max-w-sm",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Keyboard Shortcuts"})}),f.jsx("div",{className:"space-y-2",children:Bce.map(n=>f.jsxs("div",{className:"flex items-center justify-between text-sm",children:[f.jsx("span",{className:"text-muted-foreground",children:n.description}),f.jsx("div",{className:"flex gap-1",children:n.keys.map(r=>f.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 Uce({...e}){return f.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Hce({className:e,...t}){return f.jsx("ol",{"data-slot":"breadcrumb-list",className:ke("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function qce({className:e,...t}){return f.jsx("li",{"data-slot":"breadcrumb-item",className:ke("inline-flex items-center gap-1.5",e),...t})}function Vce({asChild:e,className:t,...n}){const r=e?UN:"a";return f.jsx(r,{"data-slot":"breadcrumb-link",className:ke("transition-colors hover:text-foreground",t),...n})}function Kce({className:e,...t}){return f.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:ke("font-normal text-foreground",e),...t})}function Yce({children:e,className:t,...n}){return f.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:ke("[&>svg]:size-3.5",t),...n,children:e??f.jsx(Ip,{})})}function qp({...e}){return f.jsx(hie,{"data-slot":"dropdown-menu",...e})}function Vp({...e}){return f.jsx(mie,{"data-slot":"dropdown-menu-trigger",...e})}function Kp({className:e,sideOffset:t=4,...n}){return f.jsx(pie,{children:f.jsx(gie,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ke("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 By({className:e,inset:t,variant:n="default",...r}){return f.jsx(vie,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ke("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 Hk({className:e,children:t,checked:n,...r}){return f.jsxs(yie,{"data-slot":"dropdown-menu-checkbox-item",className:ke("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:[f.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:f.jsx(xie,{children:f.jsx(fU,{className:"size-4"})})}),t]})}function _l({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(bae,{"data-slot":"separator",decorative:n,orientation:t,className:ke("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 Xce=[{to:"/imu",label:"Bot Imu",icon:Dp},{to:"/dashboard",label:"Dashboard",icon:gU,end:!0},{to:"/projects",label:"Projects",icon:Q_},{to:"/settings",label:"Settings",icon:Q0}],Gce=[{to:"/schedules/runs",label:"Run History",icon:Dse},{to:"/schedules/recurring",label:"Recurring",icon:mse},{to:"/schedules/one-time",label:"One-Time",icon:nse}],Wce=[{to:"/resources/roles",label:"Roles",icon:Ik},{to:"/resources/skills",label:"Skills",icon:jU},{to:"/resources/agents",label:"Agents",icon:uU},{to:"/resources/memories",label:"Memory",icon:Pk},{to:"/integrations",label:"Integrations",icon:nle}];function Qce({conv:e,projectId:t,isActive:n,navigate:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(!1),[u,d]=y.useState(!1),[m,h]=y.useState(""),g=y.useRef(null),v=$k(t),b=OU(t),w=j=>{j.stopPropagation(),j.preventDefault(),h(e.title??""),a(!0),setTimeout(()=>{var C;return(C=g.current)==null?void 0:C.focus()},0)},S=()=>{const j=m.trim();v.mutate({conversationId:e.id,title:j||null}),a(!1)};return i?f.jsx("div",{className:"px-1",children:f.jsx(Ze,{ref:g,value:m,onChange:j=>h(j.target.value),onBlur:S,onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),S()),j.key==="Escape"&&(j.stopPropagation(),a(!1))},onClick:j=>j.stopPropagation(),className:"h-7 text-xs px-2"})}):f.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:ke("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:[f.jsx("button",{onClick:()=>r(`/projects/${t}/conversations/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:f.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),u?f.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[f.jsx("button",{onClick:j=>{j.stopPropagation(),b.mutate(e.id),d(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:b.isPending,children:"Delete"}),f.jsx("button",{onClick:j=>{j.stopPropagation(),d(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):f.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:o?1:0},children:[f.jsx("button",{onClick:w,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:f.jsx(Bf,{className:"h-3 w-3"})}),!n&&f.jsx("button",{onClick:j=>{j.stopPropagation(),d(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:f.jsx(Pa,{className:"h-3 w-3"})})]})]})}function Zce({conv:e,isActive:t,navigate:n}){const[r,i]=y.useState(!1),[a,o]=y.useState(!1),[l,u]=y.useState(!1),[d,m]=y.useState(""),h=y.useRef(null),g=Bk(),v=AU(),b=S=>{S.stopPropagation(),S.preventDefault(),m(e.title??""),i(!0),setTimeout(()=>{var j;return(j=h.current)==null?void 0:j.focus()},0)},w=()=>{const S=d.trim();g.mutate({conversationId:e.id,title:S||null}),i(!1)};return r?f.jsx("div",{className:"px-1",children:f.jsx(Ze,{ref:h,value:d,onChange:S=>m(S.target.value),onBlur:w,onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),w()),S.key==="Escape"&&(S.stopPropagation(),i(!1))},onClick:S=>S.stopPropagation(),className:"h-7 text-xs px-2"})}):f.jsxs("div",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:ke("flex items-center gap-1 rounded-md px-2 py-1.5 transition-colors",t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx("button",{onClick:()=>n(`/imu/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:f.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),l?f.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[f.jsx("button",{onClick:S=>{S.stopPropagation(),v.mutate(e.id),u(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:v.isPending,children:"Delete"}),f.jsx("button",{onClick:S=>{S.stopPropagation(),u(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):f.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:a?1:0},children:[f.jsx("button",{onClick:b,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:f.jsx(Bf,{className:"h-3 w-3"})}),!t&&f.jsx("button",{onClick:S=>{S.stopPropagation(),u(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:f.jsx(Pa,{className:"h-3 w-3"})})]})]})}function Jce({conversationId:e}){const t=to(),n=Uf(),r=tb();return f.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[f.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:f.jsx(dr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),f.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[f.jsxs("button",{onClick:()=>t("/imu"),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:[f.jsx(G0,{className:"h-4 w-4 shrink-0"}),f.jsx(Dp,{className:"h-4 w-4 shrink-0"}),f.jsx("span",{className:"truncate",children:"Bot Imu"})]}),f.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[f.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),f.jsx("button",{onClick:()=>r.mutate(void 0,{onSuccess:i=>t(`/imu/${i.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:f.jsx(mu,{className:"h-3.5 w-3.5"})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(n.data??[]).map(i=>f.jsx(Zce,{conv:i,isActive:i.id===e,navigate:t},i.id))})]})]})}function eue({projectId:e,conversationId:t}){var o,l;const n=to(),r=Bp(e,1,50),i=eb(),a=Lk(e);return f.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[f.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:f.jsx(dr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),f.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[f.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:[f.jsx(G0,{className:"h-4 w-4 shrink-0"}),f.jsx("span",{className:"truncate",children:((o=a.data)==null?void 0:o.display_name)??"Back to Project"})]}),f.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[f.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),f.jsx("button",{onClick:()=>i.mutate({project_id:e},{onSuccess:u=>n(`/projects/${e}/conversations/${u.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:f.jsx(mu,{className:"h-3.5 w-3.5"})})]}),f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(((l=r.data)==null?void 0:l.items)??[]).map(u=>f.jsx(Qce,{conv:u,projectId:e,isActive:u.id===t,navigate:n},u.id))})]})]})}function tue(){var h,g;const t=Aa().pathname.split("/").filter(Boolean),n=t[0]==="projects"&&t[1]?Number(t[1]):0,r=t[2]==="conversations"&&t[3]?Number(t[3]):0,{data:i}=Lk(n,{enabled:n>0}),{data:a}=Bp(n,1,50),o=((h=a==null?void 0:a.items.find(v=>v.id===r))==null?void 0:h.title)??null,l=t[0]==="imu"&&t[1]?Number(t[1]):0,{data:u}=Uf(),d=((g=u==null?void 0:u.find(v=>v.id===l))==null?void 0:g.title)??null,m=[];if(t[0]==="projects"){if(n===0)m.push({label:"Bot Imu",href:"/imu"}),t[2]==="sessions"&&t[3]&&m.push({label:`Session ${t[3].slice(0,8)}…`});else if(m.push({label:"Projects",href:"/projects"}),t[1]){const v=`/projects/${t[1]}`,b=(i==null?void 0:i.display_name)??`Project #${t[1]}`;m.push({label:b,href:v}),t[2]==="sessions"&&t[3]?m.push({label:`Session ${t[3].slice(0,8)}…`}):t[2]==="conversations"&&t[3]&&m.push({label:o??`Conversation #${t[3]}`})}}if(t[0]==="imu"&&(m.push({label:"Bot Imu",href:"/imu"}),t[1]&&m.push({label:d??`Conversation #${t[1]}`})),t[0]==="schedules"){const v={recurring:"Recurring Schedules","one-time":"One-Time Schedules",runs:"Run History"},b=t[1];b&&v[b]?(m.push({label:"Schedules",href:"/schedules/recurring"}),m.push({label:v[b]})):m.push({label:"Schedules"})}if(t[0]==="settings"&&m.push({label:"Settings"}),t[0]==="integrations"&&m.push({label:"Integrations"}),t[0]==="resources"){const v={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory"};m.push({label:"Resources"}),t[1]&&(m[m.length-1].href=`/resources/${t[1]}`,m.push({label:v[t[1]]??t[1]}))}return m}function nue(){const e=tue(),{data:t}=Uf(),n=(t??[]).some(b=>b.active_session_count>0),{setTheme:r}=FN(),[i,a]=y.useState(!1),[o,l]=y.useState(!1),u=MS("/projects/:projectId/conversations/:conversationId"),d=u?Number(u.params.projectId):0,m=u?Number(u.params.conversationId):0,h=MS("/imu/:conversationId"),g=h?Number(h.params.conversationId):0,v=MS("/projects/0/sessions/:runId");return ice({onCommandPalette:()=>a(!0),onShortcutsHelp:()=>l(!0)}),f.jsxs("div",{className:"flex h-screen",children:[u?f.jsx(eue,{projectId:d,conversationId:m}):h?f.jsx(Jce,{conversationId:g}):f.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[f.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:f.jsx(dr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),f.jsxs("nav",{className:"flex flex-col gap-1 p-3",children:[Xce.map(({to:b,label:w,icon:S,end:j})=>f.jsxs(Dy,{to:b,end:j,className:({isActive:C})=>ke("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",(C||b==="/imu"&&!!v)&&!(b==="/projects"&&v)?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(S,{className:"h-4 w-4"}),w,b==="/imu"&&n&&f.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-green-500 animate-pulse"})]},b)),f.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Schedules"}),Gce.map(({to:b,label:w,icon:S})=>f.jsxs(Dy,{to:b,className:({isActive:j})=>ke("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",j?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(S,{className:"h-4 w-4"}),w]},b)),f.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),Wce.map(({to:b,label:w,icon:S})=>f.jsxs(Dy,{to:b,className:({isActive:j})=>ke("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",j?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[f.jsx(S,{className:"h-4 w-4"}),w]},b))]})]}),f.jsxs("div",{className:"flex flex-1 flex-col",children:[f.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border px-6",children:[f.jsx(Uce,{children:f.jsx(Hce,{children:e.map((b,w)=>{const S=w===e.length-1;return f.jsxs(qce,{children:[w>0&&f.jsx(Yce,{}),S?f.jsx(Kce,{children:b.label}):f.jsx(Vce,{href:b.href,children:b.label})]},b.label)})})}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("button",{onClick:()=>a(!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:f.jsx("kbd",{className:"font-mono",children:"⌘K"})}),f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[f.jsx(wU,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),f.jsx(vU,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),f.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),f.jsxs(Kp,{align:"end",children:[f.jsx(By,{onClick:()=>r("light"),children:"Light"}),f.jsx(By,{onClick:()=>r("dark"),children:"Dark"}),f.jsx(By,{onClick:()=>r("system"),children:"System"})]})]})]})]}),f.jsx(_l,{}),f.jsx("main",{className:"flex-1 overflow-auto p-6",children:f.jsx(NZ,{})})]}),f.jsx($ce,{open:i,onOpenChange:a}),f.jsx(Fce,{open:o,onOpenChange:l})]})}function rue(){const e=Qe();return ut({mutationFn:t=>Ae.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function qk(){const e=Qe();return ut({mutationFn:t=>Ae.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["conversations"]})}})}function iue(){const e=Qe();return ut({mutationFn:t=>Ae.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["conversations"]})}})}function FU(){const e=Qe();return ut({mutationFn:({runId:t,agentId:n,force:r=!1})=>Ae.post(`/sessions/${t}/agents/${n}/cancel`,{force:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const aue=rb("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 mt({className:e,variant:t="default",asChild:n=!1,...r}){const i=n?UN:"span";return f.jsx(i,{"data-slot":"badge","data-variant":t,className:ke(aue({variant:t}),e),...r})}function Ui({className:e,...t}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:ke("w-full caption-bottom text-sm",e),...t})})}function Hi({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:ke("[&_tr]:border-b",e),...t})}function qi({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:ke("[&_tr:last-child]:border-0",e),...t})}function sn({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:ke("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function Re({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:ke("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 Me({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:ke("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function hx({sessions:e,projectNames:t}){return f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Run ID"}),t&&f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Role"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{children:"Started"}),f.jsx(Re,{children:"Duration"}),f.jsx(Re,{children:"Task"}),f.jsx(Re,{className:"w-[80px]"})]})}),f.jsx(qi,{children:e.map(n=>f.jsxs(sn,{children:[f.jsx(Me,{children:f.jsx(dr,{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&&f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${n.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:t.get(n.project_id)??`#${n.project_id}`})}),f.jsx(Me,{className:"text-sm",children:n.role}),f.jsx(Me,{children:f.jsx(oue,{status:n.status})}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:mx(n.started_at)}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:ib(n.duration_ms)}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm",children:n.user_task??n.task??"—"}),f.jsx(Me,{children:f.jsx(lue,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function oue({status:e}){const t=UU(e);return f.jsxs(mt,{variant:"outline",className:ke("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==="cancelling"&&"animate-pulse border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-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"&&f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e==="cancelling"&&f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-orange-500"}),e]})}const sue=UU;function UU(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":case"cancelled":return"warning";case"cancelling":return"cancelling";default:return"default"}}function mx(e){try{return new Date(e).toLocaleString()}catch{return e}}function ib(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 lue({runId:e,disabled:t}){const[n,r]=y.useState(!1),i=iue(),a=async()=>{try{await i.mutateAsync(e)}catch{}};return n?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:f.jsx(Pa,{className:"h-4 w-4"})})}function En({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:ke("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function tm({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:ke("@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 nm({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:ke("leading-none font-semibold",e),...t})}function _n({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:ke("px-6",e),...t})}const ej=1e4;function cue(e,t,n){const[r,i]=y.useState([]),[a,o]=y.useState(!1),[l,u]=y.useState(!1),d=y.useRef(null),m=y.useRef(void 0),h=y.useRef(1e3),g=y.useRef("");return y.useEffect(()=>{if(!t)return;const v=`${e}:${t}`;g.current!==v&&(i([]),u(!1),g.current=v);function b(){const w=new EventSource(`/api/sessions/${e}/logs/${t}`);d.current=w,w.onopen=()=>{o(!0),h.current=1e3},w.addEventListener("snapshot",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&i(j.lines.slice(-ej))}catch{}}),w.addEventListener("append",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&j.lines.length>0&&i(C=>{const E=[...C,...j.lines];return E.length>ej?E.slice(-ej):E})}catch{}}),w.addEventListener("done",()=>{u(!0),w.close(),d.current=null}),w.onerror=()=>{w.close(),d.current=null,o(!1),m.current=setTimeout(()=>{h.current=Math.min(h.current*2,15e3),b()},h.current)}}return b(),()=>{var w;(w=d.current)==null||w.close(),d.current=null,m.current&&clearTimeout(m.current)}},[e,t,n]),{lines:r,connected:a,done:l}}const uue=5e3;function due({runId:e,projectId:t,agentId:n,role:r,runtime:i,startedAt:a}){const{lines:o,done:l}=cue(e,n,!0),u=o.slice(-4),d=FU(),[m,h]=y.useState(!1),[g,v]=y.useState("");y.useEffect(()=>{const E=new Date(a).getTime(),k=()=>{const A=Date.now()-E,T=Math.floor(A/1e3)%60,M=Math.floor(A/6e4)%60,B=Math.floor(A/36e5);v(B>0?`${B}h ${M}m`:`${M}m ${T}s`)};k();const O=setInterval(k,1e3);return()=>clearInterval(O)},[a]);const b=y.useRef(o.length),w=y.useRef(Date.now()),[S,j]=y.useState(!1);y.useEffect(()=>{o.length!==b.current&&(b.current=o.length,w.current=Date.now(),j(!1))},[o.length]),y.useEffect(()=>{const E=setInterval(()=>{Date.now()-w.current>uue&&j(!0)},1e3);return()=>clearInterval(E)},[]);const C=async()=>{try{await d.mutateAsync({runId:e,agentId:n}),We.success(`Cancel signal sent for ${r}`)}catch(E){We.error(`Failed to cancel agent: ${E instanceof Error?E.message:"Unknown error"}`)}h(!1)};return f.jsx(En,{className:"overflow-hidden",children:f.jsxs(_n,{className:"space-y-2 pt-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l?"bg-muted-foreground":S?"bg-green-300":"animate-pulse bg-green-500"}`}),f.jsx("span",{className:"font-medium text-sm",children:r})]}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(mt,{variant:"outline",className:"text-xs",children:i.replace("strawpot-","")}),!l&&(m?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",className:"h-5 px-1.5 text-[10px]",onClick:C,disabled:d.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",className:"h-5 px-1.5 text-[10px]",onClick:()=>h(!1),children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"h-5 w-5 p-0 text-muted-foreground hover:text-destructive",onClick:()=>h(!0),title:"Cancel agent",children:f.jsx(Wa,{className:"h-3 w-3"})}))]})]}),f.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[f.jsxs("span",{children:["Session: ",e.slice(0,12)]}),f.jsx("span",{children:"·"}),f.jsx("span",{children:g})]}),f.jsx("div",{className:"rounded bg-[#1e1e1e] px-2 py-1.5 font-mono text-[11px] leading-[16px] text-[#d4d4d4]",children:u.length>0?u.map((E,k)=>f.jsxs("div",{className:"truncate",children:[f.jsx("span",{className:"text-[#666]",children:"> "}),E]},k)):f.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),f.jsx("div",{className:"flex justify-end",children:f.jsxs(dr,{to:`/projects/${t}/sessions/${e}?tab=logs`,className:"inline-flex items-center gap-0.5 text-xs text-primary hover:underline",children:["View Session",f.jsx(Ip,{className:"h-3 w-3"})]})})]})})}const tj=8;function fue(){var o;const t=((o=Fk().data)==null?void 0:o.items)??[],n=FJ({queries:t.slice(0,tj).map(l=>({queryKey:Pe.sessions.detail(l.project_id,l.run_id),queryFn:()=>Ae.get(`/projects/${l.project_id}/sessions/${l.run_id}`),staleTime:1e4}))}),r=[];for(const l of n){if(!l.data)continue;const u=l.data;for(const[d,m]of Object.entries(u.agents))r.push({runId:u.run_id,projectId:u.project_id,agentId:d,role:m.role,runtime:m.runtime,startedAt:m.started_at})}if(r.length===0)return null;const i=r.slice(0,tj),a=r.length-tj;return f.jsxs("section",{className:"space-y-3",children:[f.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Active Agents (",r.length,")"]}),f.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:i.map(l=>f.jsx(due,{runId:l.runId,projectId:l.projectId,agentId:l.agentId,role:l.role,runtime:l.runtime,startedAt:l.startedAt},`${l.runId}:${l.agentId}`))}),a>0&&f.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",a," more agent",a!==1?"s":""," running"]})]})}function en({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:ke("animate-pulse rounded-md bg-accent",e),...t})}function hue(){return f.jsxs("div",{className:"space-y-8",children:[f.jsx(en,{className:"h-8 w-40"}),f.jsxs("div",{className:"space-y-3",children:[f.jsx(en,{className:"h-4 w-24"}),f.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:[1,2,3].map(e=>f.jsx(en,{className:"h-28 rounded-lg"},e))})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsx(en,{className:"h-4 w-32"}),f.jsx(en,{className:"h-48 rounded-lg"})]})]})}function mue(){var h,g;const e=Ff(),t=Fk(),n=ace(),r=nce(10),i=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(i)return f.jsx(hue,{});if(a)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",a.message]})]});const o=e.data??[],l=((h=t.data)==null?void 0:h.items)??[],u=((g=n.data)==null?void 0:g.items)??[],d=new Map;for(const v of o)d.set(v.id,v.display_name);const m=new Map;for(const v of l)m.set(v.project_id,(m.get(v.project_id)??0)+1);return f.jsxs("div",{className:"space-y-8",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),f.jsx(fue,{}),f.jsxs("section",{className:"space-y-3",children:[f.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",o.length,")"]}),o.length===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Directory"}),f.jsx(Re,{children:"Status"})]})}),f.jsxs(qi,{children:[o.slice(0,10).map(v=>f.jsxs(sn,{children:[f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.display_name})}),f.jsx(Me,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:v.working_dir}),f.jsx(Me,{children:f.jsxs("div",{className:"flex gap-1.5",children:[!v.dir_exists&&f.jsx(mt,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Directory missing"}),(m.get(v.id)??0)>0&&f.jsxs(mt,{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:[f.jsx("span",{className:"mr-1 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),m.get(v.id)," running"]})]})})]},v.id)),o.length>10&&f.jsx(sn,{children:f.jsx(Me,{colSpan:3,className:"text-center",children:f.jsxs(dr,{to:"/projects",className:"text-sm text-muted-foreground underline-offset-4 hover:underline",children:["+",o.length-10," more — view all projects"]})})})]})]})})})]}),l.length>0&&f.jsxs("section",{className:"space-y-3",children:[f.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",l.length,")"]}),f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsx(hx,{sessions:l,projectNames:d})})})]}),(r.data??[]).length>0&&f.jsxs("section",{className:"space-y-3",children:[f.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Conversations"}),f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Title"}),f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Sessions"}),f.jsx(Re,{children:"Last Activity"})]})}),f.jsx(qi,{children:(r.data??[]).map(v=>f.jsxs(sn,{children:[f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${v.project_id}/conversations/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.title??`Conversation #${v.id}`})}),f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${v.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:v.project_name})}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:v.session_count}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:v.last_activity?new Date(v.last_activity).toLocaleString():"—"})]},v.id))})]})})})]}),f.jsxs("section",{className:"space-y-3",children:[f.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),u.length===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsx(hx,{sessions:u,projectNames:d})})})]})]})}function pue(){const e=Qe();return ut({mutationFn:t=>Ae.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.projects.all})}})}function gue(){const e=Qe();return ut({mutationFn:t=>Ae.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.projects.all})}})}function vue(){const e=Qe();return ut({mutationFn:({projectId:t,files:n})=>Ae.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.projects.files(n.projectId)})}})}function yue(){const e=Qe();return ut({mutationFn:({projectId:t,filePath:n})=>Ae.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.projects.files(n.projectId)})}})}function qf({className:e,children:t,...n}){return f.jsxs(Mie,{"data-slot":"scroll-area",className:ke("relative",e),...n,children:[f.jsx(Rie,{"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}),f.jsx(xue,{}),f.jsx(Die,{})]})}function xue({className:e,orientation:t="vertical",...n}){return f.jsx(L8,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ke("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:f.jsx(F8,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function bue({initialPath:e,onSelect:t,onCancel:n}){const[r,i]=y.useState(null),[a,o]=y.useState(!0),[l,u]=y.useState(null),[d,m]=y.useState(null),h=v=>{o(!0),u(null);const b=v?`?path=${encodeURIComponent(v)}`:"";Ae.get(`/fs/browse${b}`).then(i).catch(w=>u(w.message??"Failed to browse")).finally(()=>o(!1))},g=async()=>{if(!(!r||!(d!=null&&d.trim())))try{const v=await Ae.post("/fs/mkdir",{path:r.path,name:d.trim()});m(null),h(v.path)}catch(v){u(v instanceof Error?v.message:"Failed to create folder")}};return y.useEffect(()=>{h(e||void 0)},[]),f.jsx(Qi,{open:!0,onOpenChange:v=>!v&&n(),children:f.jsxs(Zi,{className:"sm:max-w-[480px]",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Select Directory"})}),r&&f.jsx("div",{className:"break-all rounded-md bg-muted px-3 py-1.5 font-mono text-xs",children:r.path}),l&&f.jsx("p",{className:"text-sm text-destructive",children:l}),a&&!r?f.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Loading..."}):f.jsx(qf,{className:"h-[300px]",children:f.jsxs("div",{className:"space-y-0.5",children:[(r==null?void 0:r.parent)&&f.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:()=>h(r.parent),children:[f.jsx(kse,{className:"h-4 w-4"}),".."]}),r==null?void 0:r.entries.map(v=>f.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:()=>h(v.path),children:[f.jsx(Ose,{className:"h-4 w-4"}),v.name]},v.path)),(r==null?void 0:r.entries.length)===0&&f.jsx("p",{className:"px-3 py-4 text-sm italic text-muted-foreground",children:"No subdirectories"})]})}),f.jsx(Up,{children:d!==null?f.jsxs("div",{className:"flex w-full gap-2",children:[f.jsx(Ze,{value:d,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Enter"&&g(),v.key==="Escape"&&m(null)},placeholder:"Folder name",autoFocus:!0,className:"flex-1"}),f.jsx(pe,{size:"sm",onClick:g,children:"Create"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>m(null),children:"Cancel"})]}):f.jsxs(f.Fragment,{children:[f.jsx(pe,{variant:"outline",onClick:()=>m(""),disabled:!r,children:"New Folder"}),f.jsx("div",{className:"flex-1"}),f.jsx(pe,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),f.jsx(pe,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function lt({className:e,...t}){return f.jsx(wie,{"data-slot":"label",className:ke("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 wue(){const{data:e,isLoading:t,error:n}=Ff(),[r,i]=y.useState(!1);if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-32"}),f.jsx(en,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",n.message]})]});const a=e??[];return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Projects"}),f.jsxs(pe,{onClick:()=>i(!0),children:[f.jsx(mu,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&f.jsx(Sue,{onDone:()=>i(!1),onCancel:()=>i(!1)}),a.length===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered yet."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Directory"}),f.jsx(Re,{children:"Created"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{className:"w-[80px]"})]})}),f.jsx(qi,{children:a.map(o=>f.jsxs(sn,{children:[f.jsx(Me,{children:f.jsx(dr,{to:`/projects/${o.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:o.display_name})}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:o.working_dir}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:Eue(o.created_at)}),f.jsx(Me,{children:o.dir_exists?f.jsx(mt,{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"}):f.jsx(mt,{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"})}),f.jsx(Me,{children:f.jsx(jue,{projectId:o.id})})]},o.id))})]})})})]})}function Sue({onDone:e,onCancel:t}){const[n,r]=y.useState(""),[i,a]=y.useState(""),[o,l]=y.useState(!1),u=pue(),d=async m=>{m.preventDefault();try{await u.mutateAsync({display_name:n.trim(),working_dir:i.trim()}),e()}catch{}};return f.jsx(En,{children:f.jsx(_n,{className:"pt-6",children:f.jsxs("form",{onSubmit:d,className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"display-name",children:"Display Name"}),f.jsx(Ze,{id:"display-name",value:n,onChange:m=>r(m.target.value),required:!0,autoFocus:!0})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"working-dir",children:"Working Directory"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ze,{id:"working-dir",value:i,onChange:m=>a(m.target.value),placeholder:"/path/to/project",required:!0}),f.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!o),children:"Browse"})]})]})]}),o&&f.jsx(bue,{initialPath:i||void 0,onSelect:m=>{a(m),l(!1)},onCancel:()=>l(!1)}),u.error&&f.jsx("p",{className:"text-sm text-destructive",children:u.error.message}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(pe,{type:"submit",disabled:u.isPending,children:u.isPending?"Adding...":"Add"}),f.jsx(pe,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function jue({projectId:e}){const[t,n]=y.useState(!1),r=gue(),i=async()=>{try{await r.mutateAsync(e)}catch{}};return t?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:i,disabled:r.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:f.jsx(Pa,{className:"h-4 w-4"})})}function Eue(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function Vf(e){return Pn({queryKey:Pe.projects.resources(e),queryFn:()=>Ae.get(`/projects/${e}/resources`)})}function _ue(e,t,n,r){return Pn({queryKey:Pe.projects.resourceDetail(e,t,n),queryFn:()=>Ae.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function Cue(e,t,n,r){return Pn({queryKey:Pe.projects.resourceConfig(e,t,n),queryFn:()=>Ae.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function Nue(e,t){if(t<=7)return Array.from({length:t},(a,o)=>o+1);const n=[1];e>3&&n.push("...");const r=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let a=r;a<=i;a++)n.push(a);return e<t-2&&n.push("..."),n.push(t),n}function Vk({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=Nue(e,t);return f.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[f.jsx(pe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:f.jsx(sse,{className:"h-4 w-4"})}),r.map((i,a)=>i==="..."?f.jsx("span",{className:"px-1 text-sm text-muted-foreground",children:"..."},`ellipsis-${a}`):f.jsx(pe,{variant:i===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(i),children:i},i)),f.jsx(pe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:f.jsx(Ip,{className:"h-4 w-4"})})]})}function HU(e,t,n){return Pn({queryKey:Pe.registry.config(e,t),queryFn:()=>Ae.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function ja({...e}){return f.jsx(aae,{"data-slot":"select",...e})}function Ea({...e}){return f.jsx(sae,{"data-slot":"select-value",...e})}function _a({className:e,size:t="default",children:n,...r}){return f.jsxs(oae,{"data-slot":"select-trigger","data-size":t,className:ke("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,f.jsx(lae,{asChild:!0,children:f.jsx(fu,{className:"size-4 opacity-50"})})]})}function Ca({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return f.jsx(cae,{children:f.jsxs(uae,{"data-slot":"select-content",className:ke("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,...i,children:[f.jsx(kue,{}),f.jsx(dae,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(Aue,{})]})})}function hn({className:e,children:t,...n}){return f.jsxs(fae,{"data-slot":"select-item",className:ke("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:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(mae,{children:f.jsx(fU,{className:"size-4"})})}),f.jsx(hae,{children:t})]})}function kue({className:e,...t}){return f.jsx(pae,{"data-slot":"select-scroll-up-button",className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(hU,{className:"size-4"})})}function Aue({className:e,...t}){return f.jsx(gae,{"data-slot":"select-scroll-down-button",className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(fu,{className:"size-4"})})}function No({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:ke("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 Yp({...e}){return f.jsx(xee,{"data-slot":"collapsible",...e})}function Xp({...e}){return f.jsx(YB,{"data-slot":"collapsible-trigger",...e})}function Gp({...e}){return f.jsx(XB,{"data-slot":"collapsible-content",...e})}function Oue({projectId:e,open:t,onOpenChange:n}){var xe,ze,it,st,Ht,rn;const r=to(),i=zk(e),{data:a}=Vf(e),o=J0(e),l=rue(),u=(xe=i.data)==null?void 0:xe.merged,d="__empty__",[m,h]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,E]=y.useState(""),[k,O]=y.useState(""),[A,T]=y.useState(""),[M,B]=y.useState(""),[I,U]=y.useState(""),[L,G]=y.useState(!1),[z,K]=y.useState([]),[P,H]=y.useState(!1),[Y,V]=y.useState(""),[D,q]=y.useState(!1),[$,F]=y.useState(!1),Q=Qe(),Z=()=>{h(""),v(""),w(""),j(""),E(""),O(""),T(""),B(""),U(""),G(!1),K([]),H(!1)},te=je=>{je.preventDefault(),q(!0)},ae=je=>{je.preventDefault(),q(!0)},re=je=>{je.preventDefault(),q(!1)},ee=async je=>{je.preventDefault(),q(!1);const ct=Array.from(je.dataTransfer.files);if(ct.length){F(!0);try{const wt=await Ae.upload(`/projects/${e}/files`,ct);Q.invalidateQueries({queryKey:Pe.projects.files(e)}),K(ft=>{const On=wt.map(un=>un.path).filter(un=>!ft.includes(un));return[...ft,...On]})}catch{}finally{F(!1)}}},se=je=>{K(ct=>ct.includes(je)?ct.filter(wt=>wt!==je):[...ct,je])},ve=async je=>{je.preventDefault();try{const ct={project_id:e,task:m.trim()};g.trim()&&(ct.role=g.trim());const wt={};b.trim()&&(wt.runtime=b.trim()),S.trim()&&(wt.memory=S.trim()),C&&(wt.cache_delegations=C==="true"),k.trim()&&(wt.cache_max_entries=Number(k.trim())),A.trim()&&(wt.cache_ttl_seconds=Number(A.trim())),M.trim()&&(wt.max_num_delegations=Number(M.trim())),Object.keys(wt).length>0&&(ct.overrides=wt),z.length>0&&(ct.context_files=z),I.trim()&&(ct.system_prompt=I.trim()),L&&(ct.interactive=!0);const ft=await l.mutateAsync(ct);Z(),n(!1),r(`/projects/${e}/sessions/${ft.run_id}`)}catch{}},ie=(u==null?void 0:u.orchestrator_role)??"orchestrator",Ee=(a??[]).filter(je=>je.type==="roles").map(je=>je.name).filter(je=>je!==ie),qe=[ie,...Ee],Te=(a??[]).filter(je=>je.type==="agents").map(je=>je.name),rt=new Set((a??[]).filter(je=>je.type==="memories").map(je=>je.name));rt.add("none");const Je=[...rt].sort(),et=g.trim()||ie,xt=HU("roles",et,{enabled:!!et}),dt=((it=(ze=xt.data)==null?void 0:ze.params_values)==null?void 0:it.default_agent)??((rn=(Ht=(st=xt.data)==null?void 0:st.params_schema)==null?void 0:Ht.default_agent)==null?void 0:rn.default)??"",Ct=dt&&Te.includes(dt)?dt:(u==null?void 0:u.runtime)??"strawpot-claude-code",mn=g.trim()&&!qe.includes(g.trim())?"Role not found in installed roles":"",Ut=b.trim()&&Te.length>0&&!Te.includes(b.trim())?"Runtime not found in installed agents":"",Kt=S.trim()&&!Je.includes(S.trim())?"Memory not found in installed providers":"",ce=!!mn||!!Ut||!!Kt;return f.jsx(Qi,{open:t,onOpenChange:n,children:f.jsxs(Zi,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Launch Session"})}),f.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"task",children:["Task ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs("div",{className:"relative",onDragOver:te,onDragEnter:ae,onDragLeave:re,onDrop:ee,children:[f.jsx(No,{id:"task",value:m,onChange:je=>h(je.target.value),placeholder:"Describe what the agent should do… (drag & drop files to attach)",required:!0,autoFocus:!0,rows:3}),(D||$)&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:$?f.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[f.jsx(ur,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(Z0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]})]}),(o.data??[]).length>0&&f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"outline",size:"sm",children:[f.jsx(Rk,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),f.jsxs(Kp,{align:"start",className:"w-64",onCloseAutoFocus:je=>je.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(Ze,{placeholder:"Filter files...",value:Y,onChange:je=>V(je.target.value),className:"h-7 text-xs",onKeyDown:je=>je.stopPropagation()})}),f.jsx("div",{className:"max-h-48 overflow-y-auto",children:(o.data??[]).filter(je=>je.path.toLowerCase().includes(Y.toLowerCase())).map(je=>f.jsx(Hk,{checked:z.includes(je.path),onCheckedChange:()=>se(je.path),onSelect:ct=>ct.preventDefault(),children:f.jsx("span",{className:"font-mono text-xs",children:je.path})},je.path))})]})]}),z.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[z.length," file(s) attached"]})]}),z.length>0&&f.jsxs("div",{className:"flex flex-wrap gap-1",children:[(P?z:z.slice(0,3)).map(je=>f.jsxs(mt,{variant:"secondary",className:"max-w-[200px] gap-1 font-mono text-xs",children:[f.jsx("button",{type:"button",onClick:()=>se(je),className:"mr-0.5 shrink-0 rounded-sm hover:bg-muted",children:f.jsx(Wa,{className:"h-3 w-3"})}),f.jsxs("span",{className:"truncate",children:["@",je]})]},je)),!P&&z.length>3&&f.jsxs("button",{type:"button",onClick:()=>H(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",z.length-3," more"]}),P&&z.length>3&&f.jsx("button",{type:"button",onClick:()=>H(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"role",children:"Role"}),f.jsx(Ze,{id:"role",list:"datalist-role",value:g,onChange:je=>v(je.target.value),placeholder:ie}),f.jsxs("datalist",{id:"datalist-role",children:[f.jsx("option",{value:ie}),Ee.map(je=>f.jsx("option",{value:je},je))]}),mn&&f.jsx("p",{className:"text-xs text-destructive",children:mn})]}),f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:L,onChange:je=>G(je.target.checked),className:"rounded border-input"}),f.jsx("span",{className:"text-sm",children:"Interactive mode"}),f.jsx("span",{className:"text-xs text-muted-foreground",children:"Allow the agent to ask you questions via a chat panel"})]}),f.jsxs(Yp,{children:[f.jsx(Xp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",children:[f.jsx(fu,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),f.jsxs(Gp,{className:"mt-3 space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"runtime",children:"Runtime"}),f.jsx(Ze,{id:"runtime",list:"datalist-runtime",value:b,onChange:je=>w(je.target.value),placeholder:Ct}),Te.length>0&&f.jsx("datalist",{id:"datalist-runtime",children:Te.map(je=>f.jsx("option",{value:je},je))}),Ut&&f.jsx("p",{className:"text-xs text-destructive",children:Ut})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"memory",children:"Memory"}),f.jsx(Ze,{id:"memory",list:"datalist-memory",value:S,onChange:je=>j(je.target.value),placeholder:(u==null?void 0:u.memory)||"dial"}),f.jsx("datalist",{id:"datalist-memory",children:Je.map(je=>f.jsx("option",{value:je},je))}),Kt&&f.jsx("p",{className:"text-xs text-destructive",children:Kt})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"system-prompt",children:"System Prompt"}),f.jsx(No,{id:"system-prompt",value:I,onChange:je=>U(je.target.value),placeholder:"Additional instructions for the agent...",rows:3})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Max Delegations"}),f.jsx(Ze,{type:"number",min:"0",value:M,onChange:je=>B(je.target.value),placeholder:u!=null&&u.max_num_delegations?String(u.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Delegations"}),f.jsxs(ja,{value:C||d,onValueChange:je=>E(je===d?"":je),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:(u==null?void 0:u.cache_delegations)!==!1?"true":"false"})}),f.jsxs(Ca,{children:[f.jsxs(hn,{value:d,className:"text-muted-foreground",children:["Default (",(u==null?void 0:u.cache_delegations)!==!1?"true":"false",")"]}),f.jsx(hn,{value:"true",children:"true"}),f.jsx(hn,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Max Entries"}),f.jsx(Ze,{type:"number",min:"0",value:k,onChange:je=>O(je.target.value),placeholder:u!=null&&u.cache_max_entries?String(u.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache TTL (seconds)"}),f.jsx(Ze,{type:"number",min:"0",value:A,onChange:je=>T(je.target.value),placeholder:u!=null&&u.cache_ttl_seconds?String(u.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]})]}),l.error&&f.jsx("p",{className:"text-sm text-destructive",children:l.error.message}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(pe,{type:"submit",disabled:l.isPending||ce,children:l.isPending?"Launching...":"Launch"}),f.jsx(pe,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function Tue(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function qU({projectId:e}){const t=J0(e),n=vue(),r=yue(),i=y.useRef(null),[a,o]=y.useState(!1),[l,u]=y.useState(null),d=y.useCallback(j=>{const C=Array.from(j);C.length!==0&&n.mutate({projectId:e,files:C},{onSuccess:()=>We.success(`Uploaded ${C.length} file(s)`),onError:()=>We.error("Upload failed")})},[e,n]),m=y.useCallback(j=>{j.preventDefault(),o(!1),d(j.dataTransfer.files)},[d]),h=y.useCallback(j=>{j.preventDefault(),o(!0)},[]),g=y.useCallback(j=>{j.preventDefault(),o(!1)},[]),v=y.useCallback(()=>{var j;(j=i.current)==null||j.click()},[]),b=y.useCallback(j=>{j.target.files&&(d(j.target.files),j.target.value="")},[d]),w=y.useCallback(j=>{r.mutate({projectId:e,filePath:j},{onSuccess:()=>{We.success("File deleted"),u(null)},onError:()=>{We.error("Failed to delete file"),u(null)}})},[e,r]),S=t.data??[];return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{onDrop:m,onDragOver:h,onDragLeave:g,className:`flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 transition-colors ${a?"border-primary bg-primary/5":"border-muted-foreground/25"}`,children:[f.jsx(Z0,{className:"h-8 w-8 text-muted-foreground"}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Drag & drop files here, or"," ",f.jsx("button",{type:"button",onClick:v,className:"font-medium text-primary underline-offset-4 hover:underline",children:"browse"})]}),n.isPending&&f.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploading..."}),f.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:b})]}),S.length===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{className:"w-24",children:"Size"}),f.jsx(Re,{className:"w-44",children:"Modified"}),f.jsx(Re,{className:"w-28"})]})}),f.jsx(qi,{children:S.map(j=>f.jsxs(sn,{children:[f.jsx(Me,{className:"font-mono text-xs",children:j.path}),f.jsx(Me,{className:"text-xs text-muted-foreground",children:Tue(j.size)}),f.jsx(Me,{className:"text-xs text-muted-foreground",children:new Date(j.modified_at).toLocaleString()}),f.jsx(Me,{children:l===j.path?f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:()=>w(j.path),disabled:r.isPending,className:"text-xs text-destructive hover:text-destructive/80 font-medium",children:"Confirm"}),f.jsx("button",{type:"button",onClick:()=>u(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):f.jsx("div",{className:"flex justify-end",children:f.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>u(j.path),disabled:r.isPending,children:f.jsx(Pa,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},j.path))})]})})})]})}function Wp({className:e,orientation:t="horizontal",...n}){return f.jsx(Aae,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ke("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const Pue=rb("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 Qp({className:e,variant:t="default",...n}){return f.jsx(Oae,{"data-slot":"tabs-list","data-variant":t,className:ke(Pue({variant:t}),e),...n})}function Wn({className:e,...t}){return f.jsx(Tae,{"data-slot":"tabs-trigger",className:ke("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 Qn({className:e,...t}){return f.jsx(Pae,{"data-slot":"tabs-content",className:ke("flex-1 outline-none",e),...t})}function Mue(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Rue=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Due=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Iue={};function YD(e,t){return(Iue.jsx?Due:Rue).test(e)}const Lue=/[ \t\n\f\r]/g;function zue(e){return typeof e=="object"?e.type==="text"?XD(e.value):!1:XD(e)}function XD(e){return e.replace(Lue,"")===""}class Zp{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Zp.prototype.normal={};Zp.prototype.property={};Zp.prototype.space=void 0;function VU(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Zp(n,r,t)}function tC(e){return e.toLowerCase()}class wi{constructor(t,n){this.attribute=n,this.property=t}}wi.prototype.attribute="";wi.prototype.booleanish=!1;wi.prototype.boolean=!1;wi.prototype.commaOrSpaceSeparated=!1;wi.prototype.commaSeparated=!1;wi.prototype.defined=!1;wi.prototype.mustUseProperty=!1;wi.prototype.number=!1;wi.prototype.overloadedBoolean=!1;wi.prototype.property="";wi.prototype.spaceSeparated=!1;wi.prototype.space=void 0;let $ue=0;const yt=Du(),Gn=Du(),nC=Du(),_e=Du(),dn=Du(),Vd=Du(),Pi=Du();function Du(){return 2**++$ue}const rC=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Gn,commaOrSpaceSeparated:Pi,commaSeparated:Vd,number:_e,overloadedBoolean:nC,spaceSeparated:dn},Symbol.toStringTag,{value:"Module"})),nj=Object.keys(rC);class Kk extends wi{constructor(t,n,r,i){let a=-1;if(super(t,n),GD(this,"space",i),typeof r=="number")for(;++a<nj.length;){const o=nj[a];GD(this,nj[a],(r&rC[o])===rC[o])}}}Kk.prototype.defined=!0;function GD(e,t,n){n&&(e[t]=n)}function Kf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Kk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[tC(r)]=r,n[tC(a.attribute)]=r}return new Zp(t,n,e.space)}const KU=Kf({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:dn,ariaCurrent:null,ariaDescribedBy:dn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:dn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:dn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dn,ariaLevel:_e,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:dn,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:dn,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:Gn,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function YU(e,t){return t in e?e[t]:t}function XU(e,t){return YU(e,t.toLowerCase())}const Bue=Kf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vd,acceptCharset:dn,accessKey:dn,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:dn,autoFocus:yt,autoPlay:yt,blocking:dn,capture:null,charSet:null,checked:yt,cite:null,className:dn,cols:_e,colSpan:null,content:null,contentEditable:Gn,controls:yt,controlsList:dn,coords:_e|Vd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:nC,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:dn,height:_e,hidden:nC,high:_e,href:null,hrefLang:null,htmlFor:dn,httpEquiv:dn,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:dn,itemRef:dn,itemScope:yt,itemType:dn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:_e,pattern:null,ping:dn,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:dn,required:yt,reversed:yt,rows:_e,rowSpan:_e,sandbox:dn,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Gn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dn,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:XU}),Fue=Kf({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Pi,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:dn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Vd,g2:Vd,glyphName:Vd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:Pi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_e,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pi,rev:Pi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pi,requiredFeatures:Pi,requiredFonts:Pi,requiredFormats:Pi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:Pi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pi,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:YU}),GU=Kf({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),WU=Kf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:XU}),QU=Kf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Uue={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Hue=/[A-Z]/g,WD=/-[a-z]/g,que=/^data[-\w.:]+$/i;function Vue(e,t){const n=tC(t);let r=t,i=wi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&que.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(WD,Yue);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!WD.test(a)){let o=a.replace(Hue,Kue);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Kk}return new i(r,t)}function Kue(e){return"-"+e.toLowerCase()}function Yue(e){return e.charAt(1).toUpperCase()}const Xue=VU([KU,Bue,GU,WU,QU],"html"),Yk=VU([KU,Fue,GU,WU,QU],"svg");function Gue(e){return e.join(" ").trim()}var _d={},rj,QD;function Wue(){if(QD)return rj;QD=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
`,d="/",m="*",h="",g="comment",v="declaration";function b(S,j){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];j=j||{};var C=1,E=1;function k(z){var K=z.match(t);K&&(C+=K.length);var P=z.lastIndexOf(u);E=~P?z.length-P:E+z.length}function O(){var z={line:C,column:E};return function(K){return K.position=new A(z),B(),K}}function A(z){this.start=z,this.end={line:C,column:E},this.source=j.source}A.prototype.content=S;function T(z){var K=new Error(j.source+":"+C+":"+E+": "+z);if(K.reason=z,K.filename=j.source,K.line=C,K.column=E,K.source=S,!j.silent)throw K}function M(z){var K=z.exec(S);if(K){var P=K[0];return k(P),S=S.slice(P.length),K}}function B(){M(n)}function I(z){var K;for(z=z||[];K=U();)K!==!1&&z.push(K);return z}function U(){var z=O();if(!(d!=S.charAt(0)||m!=S.charAt(1))){for(var K=2;h!=S.charAt(K)&&(m!=S.charAt(K)||d!=S.charAt(K+1));)++K;if(K+=2,h===S.charAt(K-1))return T("End of comment missing");var P=S.slice(2,K-2);return E+=2,k(P),S=S.slice(K),E+=2,z({type:g,comment:P})}}function L(){var z=O(),K=M(r);if(K){if(U(),!M(i))return T("property missing ':'");var P=M(a),H=z({type:v,property:w(K[0].replace(e,h)),value:P?w(P[0].replace(e,h)):h});return M(o),H}}function G(){var z=[];I(z);for(var K;K=L();)K!==!1&&(z.push(K),I(z));return z}return B(),G()}function w(S){return S?S.replace(l,h):h}return rj=b,rj}var ZD;function Que(){if(ZD)return _d;ZD=1;var e=_d&&_d.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_d,"__esModule",{value:!0}),_d.default=n;const t=e(Wue());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:m}=u;l?i(d,m,u):m&&(a=a||{},a[d]=m)}),a}return _d}var rm={},JD;function Zue(){if(JD)return rm;JD=1,Object.defineProperty(rm,"__esModule",{value:!0}),rm.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},o=function(d,m){return m.toUpperCase()},l=function(d,m){return"".concat(m,"-")},u=function(d,m){return m===void 0&&(m={}),a(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,o))};return rm.camelCase=u,rm}var im,eI;function Jue(){if(eI)return im;eI=1;var e=im&&im.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Que()),n=Zue();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return r.default=r,im=r,im}var ede=Jue();const tde=Gi(ede),ZU=JU("end"),Xk=JU("start");function JU(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function nde(e){const t=Xk(e),n=ZU(e);if(t&&n)return{start:t,end:n}}function km(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tI(e.position):"start"in e||"end"in e?tI(e):"line"in e||"column"in e?iC(e):""}function iC(e){return nI(e&&e.line)+":"+nI(e&&e.column)}function tI(e){return iC(e&&e.start)+"-"+iC(e&&e.end)}function nI(e){return e&&typeof e=="number"?e:1}class Vr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=km(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Vr.prototype.file="";Vr.prototype.name="";Vr.prototype.reason="";Vr.prototype.message="";Vr.prototype.stack="";Vr.prototype.column=void 0;Vr.prototype.line=void 0;Vr.prototype.ancestors=void 0;Vr.prototype.cause=void 0;Vr.prototype.fatal=void 0;Vr.prototype.place=void 0;Vr.prototype.ruleId=void 0;Vr.prototype.source=void 0;const Gk={}.hasOwnProperty,rde=new Map,ide=/[A-Z]/g,ade=new Set(["table","tbody","thead","tfoot","tr"]),ode=new Set(["td","th"]),eH="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sde(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=pde(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mde(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Yk:Xue,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=tH(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function tH(e,t,n){if(t.type==="element")return lde(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return cde(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return dde(e,t,n);if(t.type==="mdxjsEsm")return ude(e,t);if(t.type==="root")return fde(e,t,n);if(t.type==="text")return hde(e,t)}function lde(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yk,e.schema=i),e.ancestors.push(t);const a=rH(e,t.tagName,!1),o=gde(e,t);let l=Qk(e,t);return ade.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!zue(u):!0})),nH(e,o,a,t),Wk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cde(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Vm(e,t.position)}function ude(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vm(e,t.position)}function dde(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Yk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:rH(e,t.name,!0),o=vde(e,t),l=Qk(e,t);return nH(e,o,a,t),Wk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function fde(e,t,n){const r={};return Wk(r,Qk(e,t)),e.create(t,e.Fragment,r,n)}function hde(e,t){return t.value}function nH(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mde(e,t,n){return r;function r(i,a,o,l){const d=Array.isArray(o.children)?n:t;return l?d(a,o,l):d(a,o)}}function pde(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),u=Xk(r);return t(i,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function gde(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Gk.call(t.properties,i)){const a=yde(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&ode.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vde(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Vm(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Vm(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Qk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:rde;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const d=i.get(u)||0;o=u+"-"+d,i.set(u,d+1)}}const l=tH(e,a,o);l!==void 0&&n.push(l)}return n}function yde(e,t,n){const r=Vue(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Mue(n):Gue(n)),r.property==="style"){let i=typeof n=="object"?n:xde(e,String(n));return e.stylePropertyNameCase==="css"&&(i=bde(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Uue[r.property]||r.property:r.attribute,n]}}function xde(e,t){try{return tde(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Vr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=eH+"#cannot-parse-style-attribute",i}}function rH(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const l=YD(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=YD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Gk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vm(e)}function Vm(e,t){const n=new Vr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=eH+"#cannot-handle-mdx-estrees-without-createevaluater",n}function bde(e){const t={};let n;for(n in e)Gk.call(e,n)&&(t[wde(n)]=e[n]);return t}function wde(e){let t=e.replace(ide,Sde);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Sde(e){return"-"+e.toLowerCase()}const ij={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},jde={};function Zk(e,t){const n=jde,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return iH(e,r,i)}function iH(e,t,n){if(Ede(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return rI(e.children,t,n)}return Array.isArray(e)?rI(e,t,n):""}function rI(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=iH(e[i],t,n);return r.join("")}function Ede(e){return!!(e&&typeof e=="object")}const iI=document.createElement("i");function Jk(e){const t="&"+e+";";iI.innerHTML=t;const n=iI.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $i(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function va(e,t){return e.length>0?($i(e,e.length,0,t),e):t}const aI={}.hasOwnProperty;function aH(e){const t={};let n=-1;for(;++n<e.length;)_de(t,e[n]);return t}function _de(e,t){let n;for(n in t){const i=(aI.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){aI.call(i,o)||(i[o]=[]);const l=a[o];Cde(i[o],Array.isArray(l)?l:l?[l]:[])}}}function Cde(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$i(e,0,0,r)}function oH(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ti=tc(/[A-Za-z]/),Ur=tc(/[\dA-Za-z]/),Nde=tc(/[#-'*+\--9=?A-Z^-~]/);function px(e){return e!==null&&(e<32||e===127)}const aC=tc(/\d/),kde=tc(/[\dA-Fa-f]/),Ade=tc(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function cn(e){return e!==null&&(e<0||e===32)}function _t(e){return e===-2||e===-1||e===32}const ab=tc(new RegExp("\\p{P}|\\p{S}","u")),gu=tc(/\s/);function tc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yf(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Ur(e.charCodeAt(n+1))&&Ur(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Rt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return _t(u)?(e.enter(n),l(u)):t(u)}function l(u){return _t(u)&&a++<i?(e.consume(u),l):(e.exit(n),t(u))}}const Ode={tokenize:Tde};function Tde(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Rt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return tt(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const Pde={tokenize:Mde},oI={tokenize:Rde};function Mde(e){const t=this,n=[];let r=0,i,a,o;return l;function l(E){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,u,d)(E)}return d(E)}function u(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const k=t.events.length;let O=k,A;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){A=t.events[O][1].end;break}j(r);let T=k;for(;T<t.events.length;)t.events[T][1].end={...A},T++;return $i(t.events,O+1,0,t.events.slice(k)),t.events.length=T,d(E)}return l(E)}function d(E){if(r===n.length){if(!i)return g(E);if(i.currentConstruct&&i.currentConstruct.concrete)return b(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(oI,m,h)(E)}function m(E){return i&&C(),j(r),g(E)}function h(E){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,b(E)}function g(E){return t.containerState={},e.attempt(oI,v,b)(E)}function v(E){return r++,n.push([t.currentConstruct,t.containerState]),g(E)}function b(E){if(E===null){i&&C(),j(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(E)}function w(E){if(E===null){S(e.exit("chunkFlow"),!0),j(0),e.consume(E);return}return tt(E)?(e.consume(E),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(E),w)}function S(E,k){const O=t.sliceStream(E);if(k&&O.push(null),E.previous=a,a&&(a.next=E),a=E,i.defineSkip(E.start),i.write(O),t.parser.lazy[E.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<o&&(!i.events[A][1].end||i.events[A][1].end.offset>o))return;const T=t.events.length;let M=T,B,I;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(B){I=t.events[M][1].end;break}B=!0}for(j(r),A=T;A<t.events.length;)t.events[A][1].end={...I},A++;$i(t.events,M+1,0,t.events.slice(T)),t.events.length=A}}function j(E){let k=n.length;for(;k-- >E;){const O=n[k];t.containerState=O[1],O[0].exit.call(t,e)}n.length=E}function C(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Rde(e,t,n){return Rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pf(e){if(e===null||cn(e)||gu(e))return 1;if(ab(e))return 2}function ob(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const oC={name:"attention",resolveAll:Dde,tokenize:Ide};function Dde(e,t){let n=-1,r,i,a,o,l,u,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},g={...e[n][1].start};sI(h,-u),sI(g,u),o={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=va(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=va(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=va(d,ob(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=va(d,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=va(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,$i(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ide(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=pf(r);let a;return o;function o(u){return a=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===a)return e.consume(u),l;const d=e.exit("attentionSequence"),m=pf(u),h=!m||m===2&&i||n.includes(u),g=!i||i===2&&m||n.includes(r);return d._open=!!(a===42?h:h&&(i||!g)),d._close=!!(a===42?g:g&&(m||!h)),t(u)}}function sI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Lde={name:"autolink",tokenize:zde};function zde(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return ti(v)?(e.consume(v),o):v===64?n(v):d(v)}function o(v){return v===43||v===45||v===46||Ur(v)?(r=1,l(v)):d(v)}function l(v){return v===58?(e.consume(v),r=0,u):(v===43||v===45||v===46||Ur(v))&&r++<32?(e.consume(v),l):(r=0,d(v))}function u(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||px(v)?n(v):(e.consume(v),u)}function d(v){return v===64?(e.consume(v),m):Nde(v)?(e.consume(v),d):n(v)}function m(v){return Ur(v)?h(v):n(v)}function h(v){return v===46?(e.consume(v),r=0,m):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):g(v)}function g(v){if((v===45||Ur(v))&&r++<63){const b=v===45?g:h;return e.consume(v),b}return n(v)}}const Jp={partial:!0,tokenize:$de};function $de(e,t,n){return r;function r(a){return _t(a)?Rt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||tt(a)?t(a):n(a)}}const sH={continuation:{tokenize:Fde},exit:Ude,name:"blockQuote",tokenize:Bde};function Bde(e,t,n){const r=this;return i;function i(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return _t(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Fde(e,t,n){const r=this;return i;function i(o){return _t(o)?Rt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(sH,t,n)(o)}}function Ude(e){e.exit("blockQuote")}const lH={name:"characterEscape",tokenize:Hde};function Hde(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Ade(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const cH={name:"characterReference",tokenize:qde};function qde(e,t,n){const r=this;let i=0,a,o;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,o=Ur,m(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=kde,m):(e.enter("characterReferenceValue"),a=7,o=aC,m(h))}function m(h){if(h===59&&i){const g=e.exit("characterReferenceValue");return o===Ur&&!Jk(r.sliceSerialize(g))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(h)&&i++<a?(e.consume(h),m):n(h)}}const lI={partial:!0,tokenize:Kde},cI={concrete:!0,name:"codeFenced",tokenize:Vde};function Vde(e,t,n){const r=this,i={partial:!0,tokenize:O};let a=0,o=0,l;return u;function u(A){return d(A)}function d(A){const T=r.events[r.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===l?(o++,e.consume(A),m):o<3?n(A):(e.exit("codeFencedFenceSequence"),_t(A)?Rt(e,h,"whitespace")(A):h(A))}function h(A){return A===null||tt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(lI,w,k)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):_t(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Rt(e,v,"whitespace")(A)):A===96&&A===l?n(A):(e.consume(A),g)}function v(A){return A===null||tt(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===l?n(A):(e.consume(A),b)}function w(A){return e.attempt(i,k,S)(A)}function S(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),j}function j(A){return a>0&&_t(A)?Rt(e,C,"linePrefix",a+1)(A):C(A)}function C(A){return A===null||tt(A)?e.check(lI,w,k)(A):(e.enter("codeFlowValue"),E(A))}function E(A){return A===null||tt(A)?(e.exit("codeFlowValue"),C(A)):(e.consume(A),E)}function k(A){return e.exit("codeFenced"),t(A)}function O(A,T,M){let B=0;return I;function I(K){return A.enter("lineEnding"),A.consume(K),A.exit("lineEnding"),U}function U(K){return A.enter("codeFencedFence"),_t(K)?Rt(A,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):L(K)}function L(K){return K===l?(A.enter("codeFencedFenceSequence"),G(K)):M(K)}function G(K){return K===l?(B++,A.consume(K),G):B>=o?(A.exit("codeFencedFenceSequence"),_t(K)?Rt(A,z,"whitespace")(K):z(K)):M(K)}function z(K){return K===null||tt(K)?(A.exit("codeFencedFence"),T(K)):M(K)}}}function Kde(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const aj={name:"codeIndented",tokenize:Xde},Yde={partial:!0,tokenize:Gde};function Xde(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Rt(e,a,"linePrefix",5)(d)}function a(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?u(d):tt(d)?e.attempt(Yde,o,u)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||tt(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function u(d){return e.exit("codeIndented"),t(d)}}function Gde(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):tt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Rt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):tt(o)?i(o):n(o)}}const Wde={name:"codeText",previous:Zde,resolve:Qde,tokenize:Jde};function Qde(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Zde(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Jde(e,t,n){let r=0,i,a;return o;function o(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(a=e.enter("codeTextSequence"),i=0,m(h)):tt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||tt(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),d)}function m(h){return h===96?(e.consume(h),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",d(h))}}class efe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&am(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),am(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),am(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);am(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);am(this.left,n.reverse())}}}function am(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uH(e){const t={};let n=-1,r,i,a,o,l,u,d;const m=new efe(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,tfe(m,n)),n=t[n],d=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=m.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},l=m.slice(i,n),l.unshift(r),m.splice(i,n-i+1,l))}}return $i(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function tfe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,u=[],d={};let m,h,g=-1,v=n,b=0,w=0;const S=[w];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(m=r.sliceStream(v),v.next||m.push(null),h&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(m),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=v,v=v.next}for(v=n;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(w=g+1,S.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),g=S.length;g--;){const j=l.slice(S[g],S[g+1]),C=a.pop();u.push([C,C+j.length-1]),e.splice(C,2,j)}for(u.reverse(),g=-1;++g<u.length;)d[b+u[g][0]]=b+u[g][1],b+=u[g][1]-u[g][0]-1;return d}const nfe={resolve:ife,tokenize:afe},rfe={partial:!0,tokenize:ofe};function ife(e){return uH(e),e}function afe(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):tt(l)?e.check(rfe,o,a)(l):(e.consume(l),i)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ofe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Rt(e,a,"linePrefix")}function a(o){if(o===null||tt(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function dH(e,t,n,r,i,a,o,l,u){const d=u||Number.POSITIVE_INFINITY;let m=0;return h;function h(j){return j===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(j),e.exit(a),g):j===null||j===32||j===41||px(j)?n(j):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(j))}function g(j){return j===62?(e.enter(a),e.consume(j),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===62?(e.exit("chunkString"),e.exit(l),g(j)):j===null||j===60||tt(j)?n(j):(e.consume(j),j===92?b:v)}function b(j){return j===60||j===62||j===92?(e.consume(j),v):v(j)}function w(j){return!m&&(j===null||j===41||cn(j))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(j)):m<d&&j===40?(e.consume(j),m++,w):j===41?(e.consume(j),m--,w):j===null||j===32||j===40||px(j)?n(j):(e.consume(j),j===92?S:w)}function S(j){return j===40||j===41||j===92?(e.consume(j),w):w(j)}}function fH(e,t,n,r,i,a){const o=this;let l=0,u;return d;function d(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),m}function m(v){return l>999||v===null||v===91||v===93&&!u||v===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):tt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||v===91||v===93||tt(v)||l++>999?(e.exit("chunkString"),m(v)):(e.consume(v),u||(u=!_t(v)),v===92?g:h)}function g(v){return v===91||v===92||v===93?(e.consume(v),l++,h):h(v)}}function hH(e,t,n,r,i,a){let o;return l;function l(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),o=g===40?41:g,u):n(g)}function u(g){return g===o?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),d(g))}function d(g){return g===o?(e.exit(a),u(o)):g===null?n(g):tt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Rt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===o||g===null||tt(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?h:m)}function h(g){return g===o||g===92?(e.consume(g),m):m(g)}}function Am(e,t){let n;return r;function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_t(i)?Rt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const sfe={name:"definition",tokenize:cfe},lfe={partial:!0,tokenize:ufe};function cfe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return fH.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return i=Qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),u):n(v)}function u(v){return cn(v)?Am(e,d)(v):d(v)}function d(v){return dH(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(lfe,h,h)(v)}function h(v){return _t(v)?Rt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||tt(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function ufe(e,t,n){return r;function r(l){return cn(l)?Am(e,i)(l):n(l)}function i(l){return hH(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return _t(l)?Rt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||tt(l)?t(l):n(l)}}const dfe={name:"hardBreakEscape",tokenize:ffe};function ffe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return tt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const hfe={name:"headingAtx",resolve:mfe,tokenize:pfe};function mfe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},$i(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function pfe(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),o(m)}function o(m){return m===35&&r++<6?(e.consume(m),o):m===null||cn(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||tt(m)?(e.exit("atxHeading"),t(m)):_t(m)?Rt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),l(m))}function d(m){return m===null||m===35||cn(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),d)}}const gfe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],uI=["pre","script","style","textarea"],vfe={concrete:!0,name:"htmlFlow",resolveTo:bfe,tokenize:wfe},yfe={partial:!0,tokenize:jfe},xfe={partial:!0,tokenize:Sfe};function bfe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wfe(e,t,n){const r=this;let i,a,o,l,u;return d;function d(F){return m(F)}function m(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),h}function h(F){return F===33?(e.consume(F),g):F===47?(e.consume(F),a=!0,w):F===63?(e.consume(F),i=3,r.interrupt?t:D):ti(F)?(e.consume(F),o=String.fromCharCode(F),S):n(F)}function g(F){return F===45?(e.consume(F),i=2,v):F===91?(e.consume(F),i=5,l=0,b):ti(F)?(e.consume(F),i=4,r.interrupt?t:D):n(F)}function v(F){return F===45?(e.consume(F),r.interrupt?t:D):n(F)}function b(F){const Q="CDATA[";return F===Q.charCodeAt(l++)?(e.consume(F),l===Q.length?r.interrupt?t:L:b):n(F)}function w(F){return ti(F)?(e.consume(F),o=String.fromCharCode(F),S):n(F)}function S(F){if(F===null||F===47||F===62||cn(F)){const Q=F===47,Z=o.toLowerCase();return!Q&&!a&&uI.includes(Z)?(i=1,r.interrupt?t(F):L(F)):gfe.includes(o.toLowerCase())?(i=6,Q?(e.consume(F),j):r.interrupt?t(F):L(F)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):a?C(F):E(F))}return F===45||Ur(F)?(e.consume(F),o+=String.fromCharCode(F),S):n(F)}function j(F){return F===62?(e.consume(F),r.interrupt?t:L):n(F)}function C(F){return _t(F)?(e.consume(F),C):I(F)}function E(F){return F===47?(e.consume(F),I):F===58||F===95||ti(F)?(e.consume(F),k):_t(F)?(e.consume(F),E):I(F)}function k(F){return F===45||F===46||F===58||F===95||Ur(F)?(e.consume(F),k):O(F)}function O(F){return F===61?(e.consume(F),A):_t(F)?(e.consume(F),O):E(F)}function A(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),u=F,T):_t(F)?(e.consume(F),A):M(F)}function T(F){return F===u?(e.consume(F),u=null,B):F===null||tt(F)?n(F):(e.consume(F),T)}function M(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||cn(F)?O(F):(e.consume(F),M)}function B(F){return F===47||F===62||_t(F)?E(F):n(F)}function I(F){return F===62?(e.consume(F),U):n(F)}function U(F){return F===null||tt(F)?L(F):_t(F)?(e.consume(F),U):n(F)}function L(F){return F===45&&i===2?(e.consume(F),P):F===60&&i===1?(e.consume(F),H):F===62&&i===4?(e.consume(F),q):F===63&&i===3?(e.consume(F),D):F===93&&i===5?(e.consume(F),V):tt(F)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(yfe,$,G)(F)):F===null||tt(F)?(e.exit("htmlFlowData"),G(F)):(e.consume(F),L)}function G(F){return e.check(xfe,z,$)(F)}function z(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),K}function K(F){return F===null||tt(F)?G(F):(e.enter("htmlFlowData"),L(F))}function P(F){return F===45?(e.consume(F),D):L(F)}function H(F){return F===47?(e.consume(F),o="",Y):L(F)}function Y(F){if(F===62){const Q=o.toLowerCase();return uI.includes(Q)?(e.consume(F),q):L(F)}return ti(F)&&o.length<8?(e.consume(F),o+=String.fromCharCode(F),Y):L(F)}function V(F){return F===93?(e.consume(F),D):L(F)}function D(F){return F===62?(e.consume(F),q):F===45&&i===2?(e.consume(F),D):L(F)}function q(F){return F===null||tt(F)?(e.exit("htmlFlowData"),$(F)):(e.consume(F),q)}function $(F){return e.exit("htmlFlow"),t(F)}}function Sfe(e,t,n){const r=this;return i;function i(o){return tt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function jfe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Jp,t,n)}}const Efe={name:"htmlText",tokenize:_fe};function _fe(e,t,n){const r=this;let i,a,o;return l;function l(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),u}function u(D){return D===33?(e.consume(D),d):D===47?(e.consume(D),O):D===63?(e.consume(D),E):ti(D)?(e.consume(D),M):n(D)}function d(D){return D===45?(e.consume(D),m):D===91?(e.consume(D),a=0,b):ti(D)?(e.consume(D),C):n(D)}function m(D){return D===45?(e.consume(D),v):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),g):tt(D)?(o=h,H(D)):(e.consume(D),h)}function g(D){return D===45?(e.consume(D),v):h(D)}function v(D){return D===62?P(D):D===45?g(D):h(D)}function b(D){const q="CDATA[";return D===q.charCodeAt(a++)?(e.consume(D),a===q.length?w:b):n(D)}function w(D){return D===null?n(D):D===93?(e.consume(D),S):tt(D)?(o=w,H(D)):(e.consume(D),w)}function S(D){return D===93?(e.consume(D),j):w(D)}function j(D){return D===62?P(D):D===93?(e.consume(D),j):w(D)}function C(D){return D===null||D===62?P(D):tt(D)?(o=C,H(D)):(e.consume(D),C)}function E(D){return D===null?n(D):D===63?(e.consume(D),k):tt(D)?(o=E,H(D)):(e.consume(D),E)}function k(D){return D===62?P(D):E(D)}function O(D){return ti(D)?(e.consume(D),A):n(D)}function A(D){return D===45||Ur(D)?(e.consume(D),A):T(D)}function T(D){return tt(D)?(o=T,H(D)):_t(D)?(e.consume(D),T):P(D)}function M(D){return D===45||Ur(D)?(e.consume(D),M):D===47||D===62||cn(D)?B(D):n(D)}function B(D){return D===47?(e.consume(D),P):D===58||D===95||ti(D)?(e.consume(D),I):tt(D)?(o=B,H(D)):_t(D)?(e.consume(D),B):P(D)}function I(D){return D===45||D===46||D===58||D===95||Ur(D)?(e.consume(D),I):U(D)}function U(D){return D===61?(e.consume(D),L):tt(D)?(o=U,H(D)):_t(D)?(e.consume(D),U):B(D)}function L(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,G):tt(D)?(o=L,H(D)):_t(D)?(e.consume(D),L):(e.consume(D),z)}function G(D){return D===i?(e.consume(D),i=void 0,K):D===null?n(D):tt(D)?(o=G,H(D)):(e.consume(D),G)}function z(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||cn(D)?B(D):(e.consume(D),z)}function K(D){return D===47||D===62||cn(D)?B(D):n(D)}function P(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function H(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Y}function Y(D){return _t(D)?Rt(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):V(D)}function V(D){return e.enter("htmlTextData"),o(D)}}const eA={name:"labelEnd",resolveAll:Afe,resolveTo:Ofe,tokenize:Tfe},Cfe={tokenize:Pfe},Nfe={tokenize:Mfe},kfe={tokenize:Rfe};function Afe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&$i(e,0,e.length,n),e}function Ofe(e,t){let n=e.length,r=0,i,a,o,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const u={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",u,t],["enter",d,t]],l=va(l,e.slice(a+1,a+r+3)),l=va(l,[["enter",m,t]]),l=va(l,ob(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=va(l,[["exit",m,t],e[o-2],e[o-1],["exit",d,t]]),l=va(l,e.slice(o+1)),l=va(l,[["exit",u,t]]),$i(e,a,e.length,l),e}function Tfe(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(g){return a?a._inactive?h(g):(o=r.parser.defined.includes(Qa(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),u):n(g)}function u(g){return g===40?e.attempt(Cfe,m,o?m:h)(g):g===91?e.attempt(Nfe,m,o?d:h)(g):o?m(g):h(g)}function d(g){return e.attempt(kfe,m,h)(g)}function m(g){return t(g)}function h(g){return a._balanced=!0,n(g)}}function Pfe(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return cn(h)?Am(e,a)(h):a(h)}function a(h){return h===41?m(h):dH(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return cn(h)?Am(e,u)(h):m(h)}function l(h){return n(h)}function u(h){return h===34||h===39||h===40?hH(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return cn(h)?Am(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Mfe(e,t,n){const r=this;return i;function i(l){return fH.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Rfe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Dfe={name:"labelStartImage",resolveAll:eA.resolveAll,tokenize:Ife};function Ife(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Lfe={name:"labelStartLink",resolveAll:eA.resolveAll,tokenize:zfe};function zfe(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const oj={name:"lineEnding",tokenize:$fe};function $fe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Rt(e,t,"linePrefix")}}const Fy={name:"thematicBreak",tokenize:Bfe};function Bfe(e,t,n){let r=0,i;return a;function a(d){return e.enter("thematicBreak"),o(d)}function o(d){return i=d,l(d)}function l(d){return d===i?(e.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||tt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),_t(d)?Rt(e,l,"whitespace")(d):l(d))}}const pi={continuation:{tokenize:qfe},exit:Kfe,name:"list",tokenize:Hfe},Ffe={partial:!0,tokenize:Yfe},Ufe={partial:!0,tokenize:Vfe};function Hfe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(v){const b=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:aC(v)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Fy,n,d)(v):d(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(v)}return n(v)}function u(v){return aC(v)&&++o<10?(e.consume(v),u):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):n(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Jp,r.interrupt?n:m,e.attempt(Ffe,g,h))}function m(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function h(v){return _t(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function qfe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Jp,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Rt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!_t(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ufe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Rt(e,e.attempt(pi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Vfe(e,t,n){const r=this;return Rt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Kfe(e){e.exit(this.containerState.type)}function Yfe(e,t,n){const r=this;return Rt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!_t(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const dI={name:"setextUnderline",resolveTo:Xfe,tokenize:Gfe};function Xfe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Gfe(e,t,n){const r=this;let i;return a;function a(d){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),_t(d)?Rt(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||tt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Wfe={tokenize:Qfe};function Qfe(e){const t=this,n=e.attempt(Jp,r,e.attempt(this.parser.constructs.flowInitial,i,Rt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nfe,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Zfe={resolveAll:pH()},Jfe=mH("string"),ehe=mH("text");function mH(e){return{resolveAll:pH(e==="text"?the:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(m){return d(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),u}function u(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),u)}function d(m){if(m===null)return!0;const h=i[m];let g=-1;if(h)for(;++g<h.length;){const v=h[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function pH(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function the(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,l=0,u;for(;a--;){const d=i[a];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(d===-2)u=!0,l++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const d={type:n===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const nhe={42:pi,43:pi,45:pi,48:pi,49:pi,50:pi,51:pi,52:pi,53:pi,54:pi,55:pi,56:pi,57:pi,62:sH},rhe={91:sfe},ihe={[-2]:aj,[-1]:aj,32:aj},ahe={35:hfe,42:Fy,45:[dI,Fy],60:vfe,61:dI,95:Fy,96:cI,126:cI},ohe={38:cH,92:lH},she={[-5]:oj,[-4]:oj,[-3]:oj,33:Dfe,38:cH,42:oC,60:[Lde,Efe],91:Lfe,92:[dfe,lH],93:eA,95:oC,96:Wde},lhe={null:[oC,Zfe]},che={null:[42,95]},uhe={null:[]},dhe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:che,contentInitial:rhe,disable:uhe,document:nhe,flow:ahe,flowInitial:ihe,insideSpan:lhe,string:ohe,text:she},Symbol.toStringTag,{value:"Module"}));function fhe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],l=[];const u={attempt:T(O),check:T(A),consume:C,enter:E,exit:k,interrupt:T(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:b,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:h};let m=t.tokenize.call(d,u);return t.resolveAll&&a.push(t),d;function h(U){return o=va(o,U),S(),o[o.length-1]!==null?[]:(M(t,0),d.events=ob(a,d.events,d),d.events)}function g(U,L){return mhe(v(U),L)}function v(U){return hhe(o,U)}function b(){const{_bufferIndex:U,_index:L,line:G,column:z,offset:K}=r;return{_bufferIndex:U,_index:L,line:G,column:z,offset:K}}function w(U){i[U.line]=U.column,I()}function S(){let U;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<L.length;)j(L.charCodeAt(r._bufferIndex));else j(L)}}function j(U){m=m(U)}function C(U){tt(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,I()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=U}function E(U,L){const G=L||{};return G.type=U,G.start=b(),d.events.push(["enter",G,d]),l.push(G),G}function k(U){const L=l.pop();return L.end=b(),d.events.push(["exit",L,d]),L}function O(U,L){M(U,L.from)}function A(U,L){L.restore()}function T(U,L){return G;function G(z,K,P){let H,Y,V,D;return Array.isArray(z)?$(z):"tokenize"in z?$([z]):q(z);function q(te){return ae;function ae(re){const ee=re!==null&&te[re],se=re!==null&&te.null,ve=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(se)?se:se?[se]:[]];return $(ve)(re)}}function $(te){return H=te,Y=0,te.length===0?P:F(te[Y])}function F(te){return ae;function ae(re){return D=B(),V=te,te.partial||(d.currentConstruct=te),te.name&&d.parser.constructs.disable.null.includes(te.name)?Z():te.tokenize.call(L?Object.assign(Object.create(d),L):d,u,Q,Z)(re)}}function Q(te){return U(V,D),K}function Z(te){return D.restore(),++Y<H.length?F(H[Y]):P}}}function M(U,L){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&$i(d.events,L,d.events.length-L,U.resolve(d.events.slice(L),d)),U.resolveTo&&(d.events=U.resolveTo(d.events,d))}function B(){const U=b(),L=d.previous,G=d.currentConstruct,z=d.events.length,K=Array.from(l);return{from:z,restore:P};function P(){r=U,d.previous=L,d.currentConstruct=G,d.events.length=z,l=K,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hhe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function mhe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
`;break}case-3:{o=`\r
`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function phe(e){const r={constructs:aH([dhe,...(e||{}).extensions||[]]),content:i(Ode),defined:[],document:i(Pde),flow:i(Wfe),lazy:{},string:i(Jfe),text:i(ehe)};return r;function i(a){return o;function o(l){return fhe(r,a,l)}}}function ghe(e){for(;!uH(e););return e}const fI=/[\0\t\n\r]/g;function vhe(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const u=[];let d,m,h,g,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(fI.lastIndex=h,d=fI.exec(a),g=d&&d.index!==void 0?d.index:a.length,v=a.charCodeAt(g),!d){t=a.slice(h);break}if(v===10&&h===g&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<g&&(u.push(a.slice(h,g)),e+=g-h),v){case 0:{u.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=g+1}return l&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const yhe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xhe(e){return e.replace(yhe,bhe)}function bhe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return oH(n.slice(a?2:1),a?16:10)}return Jk(n)||e}const gH={}.hasOwnProperty;function whe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),She(n)(ghe(phe(n).document().write(vhe()(e,t,!0))))}function She(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(et),autolinkProtocol:B,autolinkEmail:B,atxHeading:a(qe),blockQuote:a(se),characterEscape:B,characterReference:B,codeFenced:a(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ve,o),codeText:a(ie,o),codeTextData:B,data:B,codeFlowValue:B,definition:a(Se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ee),hardBreakEscape:a(Te),hardBreakTrailing:a(Te),htmlFlow:a(rt,o),htmlFlowData:B,htmlText:a(rt,o),htmlTextData:B,image:a(Je),label:o,link:a(et),listItem:a(dt),listItemValue:g,listOrdered:a(xt,h),listUnordered:a(xt),paragraph:a(Ct),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(qe),strong:a(mn),thematicBreak:a(Kt)},exit:{atxHeading:u(),atxHeadingSequence:O,autolink:u(),autolinkEmail:ee,autolinkProtocol:re,blockQuote:u(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:te,characterReference:ae,codeFenced:u(S),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:I,codeIndented:u(j),codeText:u(K),codeTextData:I,data:I,definition:u(),definitionDestinationString:k,definitionLabelString:C,definitionTitleString:E,emphasis:u(),hardBreakEscape:u(L),hardBreakTrailing:u(L),htmlFlow:u(G),htmlFlowData:I,htmlText:u(z),htmlTextData:I,image:u(H),label:V,labelText:Y,lineEnding:U,link:u(P),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Q,resourceDestinationString:D,resourceTitleString:q,resource:$,setextHeading:u(M),setextHeadingLineSequence:T,setextHeadingText:A,strong:u(),thematicBreak:u()}};vH(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let xe={type:"root",children:[]};const ze={stack:[xe],tokenStack:[],config:t,enter:l,exit:d,buffer:o,resume:m,data:n},it=[];let st=-1;for(;++st<ce.length;)if(ce[st][1].type==="listOrdered"||ce[st][1].type==="listUnordered")if(ce[st][0]==="enter")it.push(st);else{const Ht=it.pop();st=i(ce,Ht,st)}for(st=-1;++st<ce.length;){const Ht=t[ce[st][0]];gH.call(Ht,ce[st][1].type)&&Ht[ce[st][1].type].call(Object.assign({sliceSerialize:ce[st][2].sliceSerialize},ze),ce[st][1])}if(ze.tokenStack.length>0){const Ht=ze.tokenStack[ze.tokenStack.length-1];(Ht[1]||hI).call(ze,void 0,Ht[0])}for(xe.position={start:vl(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:vl(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},st=-1;++st<t.transforms.length;)xe=t.transforms[st](xe)||xe;return xe}function i(ce,xe,ze){let it=xe-1,st=-1,Ht=!1,rn,je,ct,wt;for(;++it<=ze;){const ft=ce[it];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?st++:st--,wt=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(rn&&!wt&&!st&&!ct&&(ct=it),wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wt=void 0}if(!st&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||st===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(rn){let On=it;for(je=void 0;On--;){const un=ce[On];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;je&&(ce[je][1].type="lineEndingBlank",Ht=!0),un[1].type="lineEnding",je=On}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}ct&&(!je||ct<je)&&(rn._spread=!0),rn.end=Object.assign({},je?ce[je][1].start:ft[1].end),ce.splice(je||it,0,["exit",rn,ft[2]]),it++,ze++}if(ft[1].type==="listItemPrefix"){const On={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};rn=On,ce.splice(it,0,["enter",On,ft[2]]),it++,ze++,ct=void 0,wt=!0}}}return ce[xe][1]._spread=Ht,ze}function a(ce,xe){return ze;function ze(it){l.call(this,ce(it),it),xe&&xe.call(this,it)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(ce,xe,ze){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([xe,ze||void 0]),ce.position={start:vl(xe.start),end:void 0}}function u(ce){return xe;function xe(ze){ce&&ce.call(this,ze),d.call(this,ze)}}function d(ce,xe){const ze=this.stack.pop(),it=this.tokenStack.pop();if(it)it[0].type!==ce.type&&(xe?xe.call(this,ce,it[0]):(it[1]||hI).call(this,ce,it[0]));else throw new Error("Cannot close `"+ce.type+"` ("+km({start:ce.start,end:ce.end})+"): it’s not open");ze.position.end=vl(ce.end)}function m(){return Zk(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(ce){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=ce}function b(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=ce}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce.replace(/(\r?\n|\r)$/g,"")}function C(ce){const xe=this.resume(),ze=this.stack[this.stack.length-1];ze.label=xe,ze.identifier=Qa(this.sliceSerialize(ce)).toLowerCase()}function E(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ce}function k(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ce}function O(ce){const xe=this.stack[this.stack.length-1];if(!xe.depth){const ze=this.sliceSerialize(ce).length;xe.depth=ze}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function T(ce){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function B(ce){const ze=this.stack[this.stack.length-1].children;let it=ze[ze.length-1];(!it||it.type!=="text")&&(it=Ut(),it.position={start:vl(ce.start),end:void 0},ze.push(it)),this.stack.push(it)}function I(ce){const xe=this.stack.pop();xe.value+=this.sliceSerialize(ce),xe.position.end=vl(ce.end)}function U(ce){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=xe.children[xe.children.length-1];ze.position.end=vl(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(B.call(this,ce),I.call(this,ce))}function L(){this.data.atHardBreak=!0}function G(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce}function z(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce}function K(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce}function P(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=xe,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function H(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=xe,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function Y(ce){const xe=this.sliceSerialize(ce),ze=this.stack[this.stack.length-2];ze.label=xhe(xe),ze.identifier=Qa(xe).toLowerCase()}function V(){const ce=this.stack[this.stack.length-1],xe=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const it=ce.children;ze.children=it}else ze.alt=xe}function D(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ce}function q(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ce}function $(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Q(ce){const xe=this.resume(),ze=this.stack[this.stack.length-1];ze.label=xe,ze.identifier=Qa(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function Z(ce){this.data.characterReferenceType=ce.type}function te(ce){const xe=this.sliceSerialize(ce),ze=this.data.characterReferenceType;let it;ze?(it=oH(xe,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):it=Jk(xe);const st=this.stack[this.stack.length-1];st.value+=it}function ae(ce){const xe=this.stack.pop();xe.position.end=vl(ce.end)}function re(ce){I.call(this,ce);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(ce)}function ee(ce){I.call(this,ce);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(ce)}function se(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function rt(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function et(){return{type:"link",title:null,url:"",children:[]}}function xt(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function dt(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Ct(){return{type:"paragraph",children:[]}}function mn(){return{type:"strong",children:[]}}function Ut(){return{type:"text",value:""}}function Kt(){return{type:"thematicBreak"}}}function vl(e){return{line:e.line,column:e.column,offset:e.offset}}function vH(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?vH(e,r):jhe(e,r)}}function jhe(e,t){let n;for(n in t)if(gH.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function hI(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+km({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+km({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+km({start:t.start,end:t.end})+") is still open")}function Ehe(e){const t=this;t.parser=n;function n(r){return whe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function _he(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Che(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function Nhe(e,t){const n=t.value?t.value+`
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function khe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ahe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ohe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Yf(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function The(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Phe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yH(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Mhe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yH(e,t);const i={src:Yf(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Rhe(e,t){const n={src:Yf(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Dhe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Ihe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yH(e,t);const i={href:Yf(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Lhe(e,t){const n={href:Yf(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zhe(e,t,n){const r=e.all(t),i=n?$he(n):xH(t),a={},o=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const m=r[l];(i||l!==0||m.type!=="element"||m.tagName!=="p")&&o.push({type:"text",value:`
`}),m.type==="element"&&m.tagName==="p"&&!i?o.push(...m.children):o.push(m)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
`});const d={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,d),e.applyData(t,d)}function $he(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=xH(n[r])}return t}function xH(e){const t=e.spread;return t??e.children.length>1}function Bhe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Fhe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uhe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Hhe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qhe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Xk(t.children[1]),u=ZU(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Vhe(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const d=[];for(;++u<l;){const h=t.children[u],g={},v=o?o[u]:void 0;v&&(g.align=v);let b={type:"element",tagName:a,properties:g,children:[]};h&&(b.children=e.all(h),e.patch(h,b),b=e.applyData(h,b)),d.push(b)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function Khe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mI=9,pI=32;function Yhe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(gI(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(gI(t.slice(i),i>0,!1)),a.join("")}function gI(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===mI||a===pI;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===mI||a===pI;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Xhe(e,t){const n={type:"text",value:Yhe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ghe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Whe={blockquote:_he,break:Che,code:Nhe,delete:khe,emphasis:Ahe,footnoteReference:Ohe,heading:The,html:Phe,imageReference:Mhe,image:Rhe,inlineCode:Dhe,linkReference:Ihe,link:Lhe,listItem:zhe,list:Bhe,paragraph:Fhe,root:Uhe,strong:Hhe,table:qhe,tableCell:Khe,tableRow:Vhe,text:Xhe,thematicBreak:Ghe,toml:iy,yaml:iy,definition:iy,footnoteDefinition:iy};function iy(){}const bH=-1,sb=0,Om=1,gx=2,tA=3,nA=4,rA=5,iA=6,wH=7,SH=8,vI=typeof self=="object"?self:globalThis,Qhe=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case sb:case bH:return n(o,i);case Om:{const l=n([],i);for(const u of o)l.push(r(u));return l}case gx:{const l=n({},i);for(const[u,d]of o)l[r(u)]=r(d);return l}case tA:return n(new Date(o),i);case nA:{const{source:l,flags:u}=o;return n(new RegExp(l,u),i)}case rA:{const l=n(new Map,i);for(const[u,d]of o)l.set(r(u),r(d));return l}case iA:{const l=n(new Set,i);for(const u of o)l.add(r(u));return l}case wH:{const{name:l,message:u}=o;return n(new vI[l](u),i)}case SH:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new vI[a](o),i)};return r},yI=e=>Qhe(new Map,e)(0),Cd="",{toString:Zhe}={},{keys:Jhe}=Object,om=e=>{const t=typeof e;if(t!=="object"||!e)return[sb,t];const n=Zhe.call(e).slice(8,-1);switch(n){case"Array":return[Om,Cd];case"Object":return[gx,Cd];case"Date":return[tA,Cd];case"RegExp":return[nA,Cd];case"Map":return[rA,Cd];case"Set":return[iA,Cd];case"DataView":return[Om,n]}return n.includes("Array")?[Om,n]:n.includes("Error")?[wH,n]:[gx,n]},ay=([e,t])=>e===sb&&(t==="function"||t==="symbol"),eme=(e,t,n,r)=>{const i=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=om(o);switch(l){case sb:{let m=o;switch(u){case"bigint":l=SH,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([bH],o)}return i([l,m],o)}case Om:{if(u){let g=o;return u==="DataView"?g=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(g=new Uint8Array(o)),i([u,[...g]],o)}const m=[],h=i([l,m],o);for(const g of o)m.push(a(g));return h}case gx:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const m=[],h=i([l,m],o);for(const g of Jhe(o))(e||!ay(om(o[g])))&&m.push([a(g),a(o[g])]);return h}case tA:return i([l,o.toISOString()],o);case nA:{const{source:m,flags:h}=o;return i([l,{source:m,flags:h}],o)}case rA:{const m=[],h=i([l,m],o);for(const[g,v]of o)(e||!(ay(om(g))||ay(om(v))))&&m.push([a(g),a(v)]);return h}case iA:{const m=[],h=i([l,m],o);for(const g of o)(e||!ay(om(g)))&&m.push(a(g));return h}}const{message:d}=o;return i([l,{name:u,message:d}],o)};return a},xI=(e,{json:t,lossy:n}={})=>{const r=[];return eme(!(t||n),!!t,new Map,r)(e),r},vx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?yI(xI(e,t)):structuredClone(e):(e,t)=>yI(xI(e,t));function tme(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nme(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rme(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tme,r=e.options.footnoteBackLabel||nme,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const m=e.all(d),h=String(d.identifier).toUpperCase(),g=Yf(h.toLowerCase());let v=0;const b=[],w=e.footnoteCounts.get(h);for(;w!==void 0&&++v<=w;){b.length>0&&b.push({type:"text",value:" "});let C=typeof n=="string"?n:n(u,v);typeof C=="string"&&(C={type:"text",value:C}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,v),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const S=m[m.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const C=S.children[S.children.length-1];C&&C.type==="text"?C.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...b)}else m.push(...b);const j={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(m,!0)};e.patch(d,j),l.push(j)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...vx(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
`}]}}const lb=(function(e){if(e==null)return sme;if(typeof e=="function")return cb(e);if(typeof e=="object")return Array.isArray(e)?ime(e):ame(e);if(typeof e=="string")return ome(e);throw new Error("Expected function, string, or object as test")});function ime(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=lb(e[n]);return cb(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function ame(e){const t=e;return cb(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function ome(e){return cb(t);function t(n){return n&&n.type===e}}function cb(e){return t;function t(n,r,i){return!!(lme(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function sme(){return!0}function lme(e){return e!==null&&typeof e=="object"&&"type"in e}const jH=[],cme=!0,sC=!1,ume="skip";function EH(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=lb(i),o=r?-1:1;l(e,void 0,[])();function l(u,d,m){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const v=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=jH,b,w,S;if((!t||a(u,d,m[m.length-1]||void 0))&&(v=dme(n(u,m)),v[0]===sC))return v;if("children"in u&&u.children){const j=u;if(j.children&&v[0]!==ume)for(w=(r?j.children.length:-1)+o,S=m.concat(j);w>-1&&w<j.children.length;){const C=j.children[w];if(b=l(C,w,S)(),b[0]===sC)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function dme(e){return Array.isArray(e)?e:typeof e=="number"?[cme,e]:e==null?jH:[e]}function aA(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),EH(e,a,l,i);function l(u,d){const m=d[d.length-1],h=m?m.children.indexOf(u):void 0;return o(u,h,m)}}const lC={}.hasOwnProperty,fme={};function hme(e,t){const n=t||fme,r=new Map,i=new Map,a=new Map,o={...Whe,...n.handlers},l={all:d,applyData:pme,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:u,options:n,patch:mme,wrap:vme};return aA(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();h.has(g)||h.set(g,m)}}),l;function u(m,h){const g=m.type,v=l.handlers[g];if(lC.call(l.handlers,g)&&v)return v(l,m,h);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in m){const{children:w,...S}=m,j=vx(S);return j.children=l.all(m),j}return vx(m)}return(l.options.unknownHandler||gme)(l,m,h)}function d(m){const h=[];if("children"in m){const g=m.children;let v=-1;for(;++v<g.length;){const b=l.one(g[v],m);if(b){if(v&&g[v-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=bI(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=bI(w.value))}Array.isArray(b)?h.push(...b):h.push(b)}}}return h}}function mme(e,t){e.position&&(t.position=nde(e))}function pme(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,vx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function gme(e,t){const n=t.data||{},r="value"in t&&!(lC.call(n,"hProperties")||lC.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vme(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function bI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function wI(e,t){const n=hme(e,t),r=n.one(e,void 0),i=rme(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function yme(e,t){return e&&"run"in e?async function(n,r){const i=wI(n,{file:r,...t});await e.run(i,r)}:function(n,r){return wI(n,{file:r,...e||t})}}function SI(e){if(e)throw e}var sj,jI;function xme(){if(jI)return sj;jI=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!h)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},o=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},l=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return sj=function u(){var d,m,h,g,v,b,w=arguments[0],S=1,j=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});S<j;++S)if(d=arguments[S],d!=null)for(m in d)h=l(w,m),g=l(d,m),w!==g&&(C&&g&&(a(g)||(v=i(g)))?(v?(v=!1,b=h&&i(h)?h:[]):b=h&&a(h)?h:{},o(w,{name:m,newValue:u(C,b,g)})):typeof g<"u"&&o(w,{name:m,newValue:g}));return w},sj}var bme=xme();const lj=Gi(bme);function cC(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function wme(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(u,...d){const m=e[++a];let h=-1;if(u){o(u);return}for(;++h<i.length;)(d[h]===null||d[h]===void 0)&&(d[h]=i[h]);i=d,m?Sme(m,l)(...d):o(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Sme(e,t){let n;return r;function r(...o){const l=e.length>o.length;let u;l&&o.push(i);try{u=e.apply(this,o)}catch(d){const m=d;if(l&&n)throw m;return i(m)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const mo={basename:jme,dirname:Eme,extname:_me,join:Cme,sep:"/"};function jme(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');eg(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Eme(e){if(eg(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function _me(e){eg(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Cme(...e){let t=-1,n;for(;++t<e.length;)eg(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Nme(n)}function Nme(e){eg(e);const t=e.codePointAt(0)===47;let n=kme(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kme(e,t){let n="",r=0,i=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function eg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ame={cwd:Ome};function Ome(){return"/"}function uC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Tme(e){if(typeof e=="string")e=new URL(e);else if(!uC(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Pme(e)}function Pme(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const cj=["history","path","basename","stem","extname","dirname"];class _H{constructor(t){let n;t?uC(t)?n={path:t}:typeof t=="string"||Mme(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ame.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cj.length;){const a=cj[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)cj.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?mo.basename(this.path):void 0}set basename(t){dj(t,"basename"),uj(t,"basename"),this.path=mo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?mo.dirname(this.path):void 0}set dirname(t){EI(this.basename,"dirname"),this.path=mo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?mo.extname(this.path):void 0}set extname(t){if(uj(t,"extname"),EI(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=mo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){uC(t)&&(t=Tme(t)),dj(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?mo.basename(this.path,this.extname):void 0}set stem(t){dj(t,"stem"),uj(t,"stem"),this.path=mo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Vr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function uj(e,t){if(e&&e.includes(mo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+mo.sep+"`")}function dj(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function EI(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Mme(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Rme=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Dme={}.hasOwnProperty;class oA extends Rme{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wme()}copy(){const t=new oA;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(lj(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(mj("data",this.frozen),this.namespace[t]=n,this):Dme.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mj("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=oy(t),r=this.parser||this.Parser;return fj("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),fj("process",this.parser||this.Parser),hj("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=oy(t),u=r.parse(l);r.run(u,l,function(m,h,g){if(m||!h||!g)return d(m);const v=h,b=r.stringify(v,g);zme(b)?g.value=b:g.result=b,d(m,g)});function d(m,h){m||!h?o(m):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),fj("processSync",this.parser||this.Parser),hj("processSync",this.compiler||this.Compiler),this.process(t,i),CI("processSync","process",n),r;function i(a,o){n=!0,SI(a),r=o}}run(t,n,r){_I(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const u=oy(n);i.run(t,u,d);function d(m,h,g){const v=h||t;m?l(m):o?o(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),CI("runSync","run",r),i;function a(o,l){SI(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=oy(n),i=this.compiler||this.Compiler;return hj("stringify",i),_I(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(mj("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...h]=d;u(m,h)}else o(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function o(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(d.plugins),d.settings&&(i.settings=lj(!0,i.settings,d.settings))}function l(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const h=d[m];a(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,m){let h=-1,g=-1;for(;++h<r.length;)if(r[h][0]===d){g=h;break}if(g===-1)r.push([d,...m]);else if(m.length>0){let[v,...b]=m;const w=r[g][1];cC(w)&&cC(v)&&(v=lj(!0,w,v)),r[g]=[d,v,...b]}}}}const Ime=new oA().freeze();function fj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mj(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _I(e){if(!cC(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function CI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oy(e){return Lme(e)?e:new _H(e)}function Lme(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function zme(e){return typeof e=="string"||$me(e)}function $me(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bme="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",NI=[],kI={allowDangerousHtml:!0},Fme=/^(https?|ircs?|mailto|xmpp)$/i,Ume=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Hme(e){const t=qme(e),n=Vme(e);return Kme(t.runSync(t.parse(n),n),e)}function qme(e){const t=e.rehypePlugins||NI,n=e.remarkPlugins||NI,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kI}:kI;return Ime().use(Ehe).use(n).use(yme,r).use(t)}function Vme(e){const t=e.children||"",n=new _H;return typeof t=="string"&&(n.value=t),n}function Kme(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||Yme;for(const m of Ume)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Bme+m.id,void 0);return aA(e,d),sde(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function d(m,h,g){if(m.type==="raw"&&g&&typeof h=="number")return o?g.children.splice(h,1):g.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let v;for(v in ij)if(Object.hasOwn(ij,v)&&Object.hasOwn(m.properties,v)){const b=m.properties[v],w=ij[v];(w===null||w.includes(m.tagName))&&(m.properties[v]=u(String(b||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!v&&r&&typeof h=="number"&&(v=!r(m,h,g)),v&&g&&typeof h=="number")return l&&m.children?g.children.splice(h,1,...m.children):g.children.splice(h,1),h}}}function Yme(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Fme.test(e.slice(0,t))?e:""}function AI(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Xme(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Gme(e,t,n){const i=lb((n||{}).ignore||[]),a=Wme(t);let o=-1;for(;++o<a.length;)EH(e,"text",l);function l(d,m){let h=-1,g;for(;++h<m.length;){const v=m[h],b=g?g.children:void 0;if(i(v,b?b.indexOf(v):void 0,g))return;g=v}if(g)return u(d,m)}function u(d,m){const h=m[m.length-1],g=a[o][0],v=a[o][1];let b=0;const S=h.children.indexOf(d);let j=!1,C=[];g.lastIndex=0;let E=g.exec(d.value);for(;E;){const k=E.index,O={index:E.index,input:E.input,stack:[...m,d]};let A=v(...E,O);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?g.lastIndex=k+1:(b!==k&&C.push({type:"text",value:d.value.slice(b,k)}),Array.isArray(A)?C.push(...A):A&&C.push(A),b=k+E[0].length,j=!0),!g.global)break;E=g.exec(d.value)}return j?(b<d.value.length&&C.push({type:"text",value:d.value.slice(b)}),h.children.splice(S,1,...C)):C=[d],S+C.length}}function Wme(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Qme(i[0]),Zme(i[1])])}return t}function Qme(e){return typeof e=="string"?new RegExp(Xme(e),"g"):e}function Zme(e){return typeof e=="function"?e:function(){return e}}const pj="phrasing",gj=["autolink","link","image","label"];function Jme(){return{transforms:[ope],enter:{literalAutolink:tpe,literalAutolinkEmail:vj,literalAutolinkHttp:vj,literalAutolinkWww:vj},exit:{literalAutolink:ape,literalAutolinkEmail:ipe,literalAutolinkHttp:npe,literalAutolinkWww:rpe}}}function epe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pj,notInConstruct:gj},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pj,notInConstruct:gj},{character:":",before:"[ps]",after:"\\/",inConstruct:pj,notInConstruct:gj}]}}function tpe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vj(e){this.config.enter.autolinkProtocol.call(this,e)}function npe(e){this.config.exit.autolinkProtocol.call(this,e)}function rpe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ipe(e){this.config.exit.autolinkEmail.call(this,e)}function ape(e){this.exit(e)}function ope(e){Gme(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,spe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lpe]],{ignore:["link","linkReference"]})}function spe(e,t,n,r,i){let a="";if(!CH(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!cpe(n)))return!1;const o=upe(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function lpe(e,t,n,r){return!CH(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function cpe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function upe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=AI(e,"(");let a=AI(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function CH(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gu(n)||ab(n))&&(!t||n!==47)}NH.peek=xpe;function dpe(){this.buffer()}function fpe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hpe(){this.buffer()}function mpe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ppe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gpe(e){this.exit(e)}function vpe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ype(e){this.exit(e)}function xpe(){return"["}function NH(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function bpe(){return{enter:{gfmFootnoteCallString:dpe,gfmFootnoteCall:fpe,gfmFootnoteDefinitionLabelString:hpe,gfmFootnoteDefinition:mpe},exit:{gfmFootnoteCallString:ppe,gfmFootnoteCall:gpe,gfmFootnoteDefinitionLabelString:vpe,gfmFootnoteDefinition:ype}}}function wpe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:NH},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let u=l.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return u+=l.move(a.safe(a.associationId(r),{before:u,after:"]"})),m(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?`
`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?kH:Spe))),d(),u}}function Spe(e,t,n){return t===0?e:kH(e,t,n)}function kH(e,t,n){return(n?"":"    ")+e}const jpe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];AH.peek=kpe;function Epe(){return{canContainEols:["delete"],enter:{strikethrough:Cpe},exit:{strikethrough:Npe}}}function _pe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:jpe}],handlers:{delete:AH}}}function Cpe(e){this.enter({type:"delete",children:[]},e)}function Npe(e){this.exit(e)}function AH(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function kpe(){return"~"}function Ape(e){return e.length}function Ope(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ape,a=[],o=[],l=[],u=[];let d=0,m=-1;for(;++m<e.length;){const w=[],S=[];let j=-1;for(e[m].length>d&&(d=e[m].length);++j<e[m].length;){const C=Tpe(e[m][j]);if(n.alignDelimiters!==!1){const E=i(C);S[j]=E,(u[j]===void 0||E>u[j])&&(u[j]=E)}w.push(C)}o[m]=w,l[m]=S}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)a[h]=OI(r[h]);else{const w=OI(r);for(;++h<d;)a[h]=w}h=-1;const g=[],v=[];for(;++h<d;){const w=a[h];let S="",j="";w===99?(S=":",j=":"):w===108?S=":":w===114&&(j=":");let C=n.alignDelimiters===!1?1:Math.max(1,u[h]-S.length-j.length);const E=S+"-".repeat(C)+j;n.alignDelimiters!==!1&&(C=S.length+C+j.length,C>u[h]&&(u[h]=C),v[h]=C),g[h]=E}o.splice(1,0,g),l.splice(1,0,v),m=-1;const b=[];for(;++m<o.length;){const w=o[m],S=l[m];h=-1;const j=[];for(;++h<d;){const C=w[h]||"";let E="",k="";if(n.alignDelimiters!==!1){const O=u[h]-(S[h]||0),A=a[h];A===114?E=" ".repeat(O):A===99?O%2?(E=" ".repeat(O/2+.5),k=" ".repeat(O/2-.5)):(E=" ".repeat(O/2),k=E):k=" ".repeat(O)}n.delimiterStart!==!1&&!h&&j.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||h)&&j.push(" "),n.alignDelimiters!==!1&&j.push(E),j.push(C),n.alignDelimiters!==!1&&j.push(k),n.padding!==!1&&j.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&j.push("|")}b.push(n.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return b.join(`
`)}function Tpe(e){return e==null?"":String(e)}function OI(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Ppe(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),Mpe);return i(),o}function Mpe(e,t,n){return">"+(n?"":" ")+e}function Rpe(e,t){return TI(e,t.inConstruct,!0)&&!TI(e,t.notInConstruct,!1)}function TI(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function PI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&Rpe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function Dpe(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ipe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Lpe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zpe(e,t,n,r){const i=Lpe(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Ipe(e,n)){const h=n.enter("codeIndented"),g=n.indentLines(a,$pe);return h(),g}const l=n.createTracker(r),u=i.repeat(Math.max(Dpe(a,i)+1,3)),d=n.enter("codeFenced");let m=l.move(u);if(e.lang){const h=n.enter(`codeFencedLang${o}`);m+=l.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...l.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${o}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,{before:m,after:`
`,encode:["`"],...l.current()})),h()}return m+=l.move(`
`),a&&(m+=l.move(a+`
`)),m+=l.move(u),d(),m}function $pe(e,t,n){return(n?"":"    ")+e}function sA(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Bpe(e,t,n,r){const i=sA(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":`
`,...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),o(),d}function Fpe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Km(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yx(e,t,n){const r=pf(e),i=pf(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}OH.peek=Upe;function OH(e,t,n,r){const i=Fpe(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=u.charCodeAt(0),m=yx(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Km(d)+u.slice(1));const h=u.charCodeAt(u.length-1),g=yx(r.after.charCodeAt(0),h,i);g.inside&&(u=u.slice(0,-1)+Km(h));const v=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+u+v}function Upe(e,t,n){return n.options.emphasis||"*"}function Hpe(e,t){let n=!1;return aA(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,sC}),!!((!e.depth||e.depth<3)&&Zk(e)&&(t.options.setext||n))}function qpe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Hpe(e,n)){const m=n.enter("headingSetext"),h=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:`
`,after:`
`});return h(),m(),g+`
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");a.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(d)&&(d=Km(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),u(),l(),d}TH.peek=Vpe;function TH(e){return e.value||""}function Vpe(){return"<"}PH.peek=Kpe;function PH(e,t,n,r){const i=sA(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(l=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),l()),d+=u.move(")"),o(),d}function Kpe(){return"!"}MH.peek=Ype;function MH(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const d=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==h?u+=l.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Ype(){return"!"}RH.peek=Xpe;function RH(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],l=n.compilePattern(o);let u;if(o.atBreak)for(;u=l.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function Xpe(){return"`"}function DH(e,t){const n=Zk(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}IH.peek=Gpe;function IH(e,t,n,r){const i=sA(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,u;if(DH(e,n)){const m=n.stack;n.stack=[],l=n.enter("autolink");let h=o.move("<");return h+=o.move(n.containerPhrasing(e,{before:h,after:">",...o.current()})),h+=o.move(">"),l(),n.stack=m,h}l=n.enter("link"),u=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(u=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${a}`),d+=o.move(" "+i),d+=o.move(n.safe(e.title,{before:d,after:i,...o.current()})),d+=o.move(i),u()),d+=o.move(")"),l(),d}function Gpe(e,t,n){return DH(e,n)?"<":"["}LH.peek=Wpe;function LH(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==h?u+=l.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Wpe(){return"["}function lA(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Qpe(e){const t=lA(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Zpe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function zH(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Jpe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?Zpe(n):lA(n);const l=e.ordered?o==="."?")":".":Qpe(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),zH(n)===o&&m){let h=-1;for(;++h<e.children.length;){const g=e.children[h];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(o=l),n.bulletCurrent=o;const d=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),d}function ege(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function tge(e,t,n,r){const i=ege(n);let a=n.bulletCurrent||lA(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),m);return u(),d;function m(h,g,v){return g?(v?"":" ".repeat(o))+h:(v?a:a+" ".repeat(o-a.length))+h}}function nge(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const rge=lb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ige(e,t,n,r){return(e.children.some(function(o){return rge(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function age(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$H.peek=oge;function $H(e,t,n,r){const i=age(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=u.charCodeAt(0),m=yx(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(u=Km(d)+u.slice(1));const h=u.charCodeAt(u.length-1),g=yx(r.after.charCodeAt(0),h,i);g.inside&&(u=u.slice(0,-1)+Km(h));const v=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+u+v}function oge(e,t,n){return n.options.strong||"*"}function sge(e,t,n,r){return n.safe(e.value,r)}function lge(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function cge(e,t,n){const r=(zH(n)+(n.options.ruleSpaces?" ":"")).repeat(lge(n));return n.options.ruleSpaces?r.slice(0,-1):r}const BH={blockquote:Ppe,break:PI,code:zpe,definition:Bpe,emphasis:OH,hardBreak:PI,heading:qpe,html:TH,image:PH,imageReference:MH,inlineCode:RH,link:IH,linkReference:LH,list:Jpe,listItem:tge,paragraph:nge,root:ige,strong:$H,text:sge,thematicBreak:cge};function uge(){return{enter:{table:dge,tableData:MI,tableHeader:MI,tableRow:hge},exit:{codeText:mge,table:fge,tableData:yj,tableHeader:yj,tableRow:yj}}}function dge(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function fge(e){this.exit(e),this.data.inTable=void 0}function hge(e){this.enter({type:"tableRow",children:[]},e)}function yj(e){this.exit(e)}function MI(e){this.enter({type:"tableCell",children:[]},e)}function mge(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pge));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pge(e,t){return t==="|"?t:e}function gge(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:o,tableCell:u,tableRow:l}};function o(v,b,w,S){return d(m(v,w,S),v.align)}function l(v,b,w,S){const j=h(v,w,S),C=d([j]);return C.slice(0,C.indexOf(`
`))}function u(v,b,w,S){const j=w.enter("tableCell"),C=w.enter("phrasing"),E=w.containerPhrasing(v,{...S,before:a,after:a});return C(),j(),E}function d(v,b){return Ope(v,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function m(v,b,w){const S=v.children;let j=-1;const C=[],E=b.enter("table");for(;++j<S.length;)C[j]=h(S[j],b,w);return E(),C}function h(v,b,w){const S=v.children;let j=-1;const C=[],E=b.enter("tableRow");for(;++j<S.length;)C[j]=u(S[j],v,b,w);return E(),C}function g(v,b,w){let S=BH.inlineCode(v,b,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function vge(){return{exit:{taskListCheckValueChecked:RI,taskListCheckValueUnchecked:RI,paragraph:xge}}}function yge(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bge}}}function RI(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function xge(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,o;for(;++a<i.length;){const l=i[a];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function bge(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(o);let u=BH.listItem(e,t,n,{...r,...l.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(m){return m+o}}function wge(){return[Jme(),bpe(),Epe(),uge(),vge()]}function Sge(e){return{extensions:[epe(),wpe(e),_pe(),gge(e),yge()]}}const jge={tokenize:Age,partial:!0},FH={tokenize:Oge,partial:!0},UH={tokenize:Tge,partial:!0},HH={tokenize:Pge,partial:!0},Ege={tokenize:Mge,partial:!0},qH={name:"wwwAutolink",tokenize:Nge,previous:KH},VH={name:"protocolAutolink",tokenize:kge,previous:YH},Os={name:"emailAutolink",tokenize:Cge,previous:XH},Do={};function _ge(){return{text:Do}}let Ac=48;for(;Ac<123;)Do[Ac]=Os,Ac++,Ac===58?Ac=65:Ac===91&&(Ac=97);Do[43]=Os;Do[45]=Os;Do[46]=Os;Do[95]=Os;Do[72]=[Os,VH];Do[104]=[Os,VH];Do[87]=[Os,qH];Do[119]=[Os,qH];function Cge(e,t,n){const r=this;let i,a;return o;function o(h){return!dC(h)||!XH.call(r,r.previous)||cA(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(h))}function l(h){return dC(h)?(e.consume(h),l):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(Ege,m,d)(h):h===45||h===95||Ur(h)?(a=!0,e.consume(h),u):m(h)}function d(h){return e.consume(h),i=!0,u}function m(h){return a&&i&&ti(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function Nge(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!KH.call(r,r.previous)||cA(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(jge,e.attempt(FH,e.attempt(UH,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function kge(e,t,n){const r=this;let i="",a=!1;return o;function o(h){return(h===72||h===104)&&YH.call(r,r.previous)&&!cA(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),l):n(h)}function l(h){if(ti(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),l;if(h===58){const g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),a?d:(a=!0,u)):n(h)}function d(h){return h===null||px(h)||cn(h)||gu(h)||ab(h)?n(h):e.attempt(FH,e.attempt(UH,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function Age(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function Oge(e,t,n){let r,i,a;return o;function o(d){return d===46||d===95?e.check(HH,u,l)(d):d===null||cn(d)||gu(d)||d!==45&&ab(d)?u(d):(a=!0,e.consume(d),o)}function l(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),o}function u(d){return i||r||!a?n(d):t(d)}}function Tge(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(HH,t,a)(o):o===null||cn(o)||gu(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function Pge(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),a):l===93?(e.consume(l),i):l===60||l===null||cn(l)||gu(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||cn(l)||gu(l)?t(l):r(l)}function a(l){return ti(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):ti(l)?(e.consume(l),o):n(l)}}function Mge(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ur(a)?n(a):t(a)}}function KH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||cn(e)}function YH(e){return!ti(e)}function XH(e){return!(e===47||dC(e))}function dC(e){return e===43||e===45||e===46||e===95||Ur(e)}function cA(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Rge={tokenize:Uge,partial:!0};function Dge(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$ge,continuation:{tokenize:Bge},exit:Fge}},text:{91:{name:"gfmFootnoteCall",tokenize:zge},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ige,resolveTo:Lge}}}}function Ige(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!o||!o._balanced)return n(u);const d=Qa(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Lge(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function zge(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(a>999||h===93&&!o||h===null||h===91||cn(h))return n(h);if(h===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(Qa(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return cn(h)||(o=!0),a++,e.consume(h),h===92?m:d}function m(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function $ge(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(b)}function m(b){if(o>999||b===93&&!l||b===null||b===91||cn(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Qa(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return cn(b)||(l=!0),o++,e.consume(b),b===92?h:m}function h(b){return b===91||b===92||b===93?(e.consume(b),o++,m):m(b)}function g(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(a)||i.push(a),Rt(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function Bge(e,t,n){return e.check(Jp,t,e.attempt(Rge,t,n))}function Fge(e){e.exit("gfmFootnoteDefinition")}function Uge(e,t,n){const r=this;return Rt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function Hge(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let u=-1;for(;++u<o.length;)if(o[u][0]==="enter"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._close){let d=u;for(;d--;)if(o[d][0]==="exit"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._open&&o[u][1].end.offset-o[u][1].start.offset===o[d][1].end.offset-o[d][1].start.offset){o[u][1].type="strikethroughSequence",o[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},o[d][1].start),end:Object.assign({},o[u][1].end)},h={type:"strikethroughText",start:Object.assign({},o[d][1].end),end:Object.assign({},o[u][1].start)},g=[["enter",m,l],["enter",o[d][1],l],["exit",o[d][1],l],["enter",h,l]],v=l.parser.constructs.insideSpan.null;v&&$i(g,g.length,0,ob(v,o.slice(d+1,u),l)),$i(g,g.length,0,[["exit",h,l],["enter",o[u][1],l],["exit",o[u][1],l],["exit",m,l]]),$i(o,d-1,u-d+3,g),u=d+g.length-2;break}}for(u=-1;++u<o.length;)o[u][1].type==="strikethroughSequenceTemporary"&&(o[u][1].type="data");return o}function a(o,l,u){const d=this.previous,m=this.events;let h=0;return g;function g(b){return d===126&&m[m.length-1][1].type!=="characterEscape"?u(b):(o.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const w=pf(d);if(b===126)return h>1?u(b):(o.consume(b),h++,v);if(h<2&&!n)return u(b);const S=o.exit("strikethroughSequenceTemporary"),j=pf(b);return S._open=!j||j===2&&!!w,S._close=!w||w===2&&!!j,l(b)}}}class qge{constructor(){this.map=[]}add(t,n,r){Vge(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function Vge(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Kge(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Yge(){return{flow:{null:{name:"table",tokenize:Xge,resolveAll:Gge}}}}function Xge(e,t,n){const r=this;let i=0,a=0,o;return l;function l(I){let U=r.events.length-1;for(;U>-1;){const z=r.events[U][1].type;if(z==="lineEnding"||z==="linePrefix")U--;else break}const L=U>-1?r.events[U][1].type:null,G=L==="tableHead"||L==="tableRow"?A:u;return G===A&&r.parser.lazy[r.now().line]?n(I):G(I)}function u(I){return e.enter("tableHead"),e.enter("tableRow"),d(I)}function d(I){return I===124||(o=!0,a+=1),m(I)}function m(I){return I===null?n(I):tt(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),v):n(I):_t(I)?Rt(e,m,"whitespace")(I):(a+=1,o&&(o=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),h(I)))}function h(I){return I===null||I===124||cn(I)?(e.exit("data"),m(I)):(e.consume(I),I===92?g:h)}function g(I){return I===92||I===124?(e.consume(I),h):h(I)}function v(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,_t(I)?Rt(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):b(I))}function b(I){return I===45||I===58?S(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),w):O(I)}function w(I){return _t(I)?Rt(e,S,"whitespace")(I):S(I)}function S(I){return I===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),j):I===45?(a+=1,j(I)):I===null||tt(I)?k(I):O(I)}function j(I){return I===45?(e.enter("tableDelimiterFiller"),C(I)):O(I)}function C(I){return I===45?(e.consume(I),C):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(I))}function E(I){return _t(I)?Rt(e,k,"whitespace")(I):k(I)}function k(I){return I===124?b(I):I===null||tt(I)?!o||i!==a?O(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):O(I)}function O(I){return n(I)}function A(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||tt(I)?(e.exit("tableRow"),t(I)):_t(I)?Rt(e,T,"whitespace")(I):(e.enter("data"),M(I))}function M(I){return I===null||I===124||cn(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?B:M)}function B(I){return I===92||I===124?(e.consume(I),M):M(I)}}function Gge(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,u=0,d,m,h;const g=new qge;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,u!==0&&(DI(g,t,u,d,m),m=void 0,u=0),d={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",d,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,m={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",m,t]])),i=b.type==="tableDelimiterRow"?2:m?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],h=sy(g,t,a,i,void 0,h),a=[0,0,0,0]),o[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],h=sy(g,t,a,i,void 0,h)),a=o,o=[a[1],n,0,0])):b.type==="tableHead"?(l=!0,u=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(u=n,a[1]!==0?(o[0]=o[1],h=sy(g,t,a,i,n,h)):o[1]!==0&&(h=sy(g,t,o,i,n,h)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(u!==0&&DI(g,t,u,d,m),g.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=Kge(t.events,n))}return e}function sy(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Ld(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const u=Ld(t.events,n[1]);if(a={type:o,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const d=Ld(t.events,n[2]),m=Ld(t.events,n[3]),h={type:l,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const g=t.events[n[2]],v=t.events[n[3]];if(g[1].end=Object.assign({},v[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,w=n[3]-n[2]-1;e.add(b,w,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(a.end=Object.assign({},Ld(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function DI(e,t,n,r,i){const a=[],o=Ld(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function Ld(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Wge={name:"tasklistCheck",tokenize:Zge};function Qge(){return{text:{91:Wge}}}function Zge(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return cn(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return tt(u)?t(u):_t(u)?e.check({tokenize:Jge},t,n)(u):n(u)}}function Jge(e,t,n){return Rt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function eve(e){return aH([_ge(),Dge(),Hge(e),Yge(),Qge()])}const tve={};function nve(e){const t=this,n=e||tve,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(eve(n)),a.push(wge()),o.push(Sge(n))}function Bi({content:e,className:t}){return f.jsx("div",{className:t,children:f.jsx(Hme,{remarkPlugins:[nve],components:{h1:({children:n})=>f.jsx("h1",{className:"mb-2 mt-4 text-base font-bold first:mt-0",children:n}),h2:({children:n})=>f.jsx("h2",{className:"mb-2 mt-3 text-sm font-bold first:mt-0",children:n}),h3:({children:n})=>f.jsx("h3",{className:"mb-1 mt-3 text-sm font-semibold first:mt-0",children:n}),p:({children:n})=>f.jsx("p",{className:"mb-2 last:mb-0 leading-relaxed",children:n}),ul:({children:n})=>f.jsx("ul",{className:"mb-2 ml-4 list-disc space-y-0.5",children:n}),ol:({children:n})=>f.jsx("ol",{className:"mb-2 ml-4 list-decimal space-y-0.5",children:n}),li:({children:n})=>f.jsx("li",{className:"leading-relaxed",children:n}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?f.jsx("code",{className:"block whitespace-pre-wrap break-words rounded bg-muted/60 px-2 py-1.5 font-mono text-xs leading-relaxed",children:n}):f.jsx("code",{className:"rounded bg-muted/60 px-1 py-0.5 font-mono text-xs",children:n}),pre:({children:n})=>f.jsx("pre",{className:"mb-2 overflow-x-auto rounded-md bg-muted/60 p-0",children:n}),blockquote:({children:n})=>f.jsx("blockquote",{className:"mb-2 border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground",children:n}),a:({href:n,children:r})=>f.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:no-underline",children:r}),table:({children:n})=>f.jsx("div",{className:"mb-2 overflow-x-auto",children:f.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>f.jsx("th",{className:"border border-border bg-muted/50 px-2 py-1 text-left font-medium",children:n}),td:({children:n})=>f.jsx("td",{className:"border border-border px-2 py-1",children:n}),hr:()=>f.jsx("hr",{className:"my-3 border-border"}),strong:({children:n})=>f.jsx("strong",{className:"font-semibold",children:n}),em:({children:n})=>f.jsx("em",{className:"italic",children:n})},children:e})})}function ub({view:e,onChange:t}){return f.jsxs("div",{className:"mb-3 flex gap-1",children:[f.jsx("button",{className:ke("rounded px-2 py-1 text-xs font-medium",e==="markdown"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"),onClick:()=>t("markdown"),children:"Markdown"}),f.jsx("button",{className:ke("rounded px-2 py-1 text-xs font-medium",e==="raw"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"),onClick:()=>t("raw"),children:"Raw"})]})}function rve(){const e=Qe();return ut({mutationFn:t=>Ae.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function GH(){const e=Qe();return ut({mutationFn:({type:t,name:n})=>Ae.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function ive(){const e=Qe();return ut({mutationFn:t=>Ae.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function WH(){const e=Qe();return ut({mutationFn:t=>{const n=new AbortController;return setTimeout(()=>n.abort(),15e4),fetch("/api/registry/update-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?{resource_type:t}:{}),signal:n.signal}).then(async i=>{if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return i.json()})},onSettled:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function ave(){const e=Qe();return ut({mutationFn:t=>Ae.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function ove(){const e=Qe();return ut({mutationFn:({type:t,name:n,env_values:r,params_values:i})=>Ae.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Pe.registry.config(n.type,n.name)})}})}function sve(e){const t=Qe();return ut({mutationFn:n=>Ae.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function QH(e){const t=Qe();return ut({mutationFn:({type:n,name:r})=>Ae.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function lve(e){const t=Qe();return ut({mutationFn:n=>Ae.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function cve(e){const t=Qe();return ut({mutationFn:n=>{const r=new AbortController;setTimeout(()=>r.abort(),15e4);const i=n?{resource_type:n}:{};return fetch(`/api/projects/${e}/resources/update-all`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),signal:r.signal}).then(async a=>{if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()})},onSettled:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function uve(e){const t=Qe();return ut({mutationFn:n=>Ae.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Pe.projects.resources(e)})}})}function dve(e){const t=Qe();return ut({mutationFn:({type:n,name:r,env_values:i,params_values:a})=>Ae.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:i,params_values:a}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Pe.projects.resourceConfig(e,r.type,r.name)})}})}function uA({...e}){return f.jsx(ZN,{"data-slot":"sheet",...e})}function fve({...e}){return f.jsx(JN,{"data-slot":"sheet-portal",...e})}function hve({className:e,...t}){return f.jsx(ek,{"data-slot":"sheet-overlay",className:ke("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 dA({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return f.jsxs(fve,{children:[f.jsx(hve,{}),f.jsxs(tk,{"data-slot":"sheet-content",className:ke("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),...i,children:[t,r&&f.jsxs(nk,{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:[f.jsx(Wa,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function fA({className:e,...t}){return f.jsx("div",{"data-slot":"sheet-header",className:ke("flex flex-col gap-1.5 p-4",e),...t})}function hA({className:e,...t}){return f.jsx(w6,{"data-slot":"sheet-title",className:ke("font-semibold text-foreground",e),...t})}function mA({className:e,...t}){return f.jsx(S6,{"data-slot":"sheet-description",className:ke("text-sm text-muted-foreground",e),...t})}function mve(e){return Pn({queryKey:Pe.registry.validate(e??""),queryFn:()=>Ae.get(`/registry/agents/${e}/validate`),enabled:!!e})}function eu(e,t){return Pn({queryKey:Pe.registry.list(e),queryFn:()=>Ae.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function pve(e,t,n){return Pn({queryKey:Pe.registry.detail(e,t),queryFn:()=>Ae.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}const gve=rb("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 Tm({className:e,variant:t,...n}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:ke(gve({variant:t}),e),...n})}function Pm({className:e,...t}){return f.jsx("div",{"data-slot":"alert-title",className:ke("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Mm({className:e,...t}){return f.jsx("div",{"data-slot":"alert-description",className:ke("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function vve({agentName:e}){const{data:t}=mve(e);return!t||!(!t.tools_ok||t.setup_command||!t.env_ok)?null:f.jsxs("div",{className:"mb-4 space-y-3",children:[!t.tools_ok&&f.jsxs(Tm,{variant:"destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsx(Pm,{children:"Missing Prerequisites"}),f.jsx(Mm,{children:t.missing_tools.map(r=>f.jsxs("div",{className:"mt-1",children:[f.jsx("strong",{children:r.name})," not found on PATH.",r.install_hint&&f.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&&f.jsxs(Tm,{children:[f.jsx(SU,{className:"h-4 w-4"}),f.jsx(Pm,{children:"Setup"}),f.jsxs(Mm,{children:[f.jsx("p",{children:t.setup_description||"Run initial authentication in your terminal:"}),f.jsx("code",{className:"mt-1 block rounded bg-muted px-2 py-1 text-xs",children:t.setup_command}),f.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&&f.jsxs(Tm,{children:[f.jsx(Fse,{className:"h-4 w-4"}),f.jsx(Pm,{children:"API Key Required"}),f.jsx(Mm,{children:f.jsxs("p",{children:["Set"," ",t.missing_env.map((r,i)=>f.jsxs("span",{children:[i>0&&", ",f.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:r})]},r))," ","in the config below to authenticate."]})})]})]})}function yve({resourceType:e,resourceName:t,enabled:n,projectId:r}){const i=HU(e,t,{enabled:n&&!r}),a=Cue(r??0,e,t,{enabled:n&&!!r}),{data:o,isLoading:l}=r?a:i,u=ove(),d=dve(r??0),m=r?d:u,{data:h}=eu("agents",{enabled:n&&e==="roles"}),[g,v]=y.useState({}),[b,w]=y.useState({}),[S,j]=y.useState(new Set);if(y.useEffect(()=>{o&&(v({...o.env_values}),w({...o.params_values}))},[o]),l||!o)return null;const C=Object.keys(o.env_schema),E=Object.keys(o.params_schema);if(C.length===0&&E.length===0)return null;const k=B=>j(I=>{const U=new Set(I);return U.has(B)?U.delete(B):U.add(B),U}),O=(h??[]).map(B=>B.name),A=String(b.default_agent??"").trim(),T=e==="roles"&&A&&O.length>0&&!O.includes(A)?"Agent not found in installed agents":"",M=()=>{m.mutate({type:e,name:t,env_values:C.length>0?g:void 0,params_values:E.length>0?b:void 0},{onSuccess:()=>We.success("Configuration saved"),onError:()=>We.error("Failed to save configuration")})};return f.jsxs("div",{className:"flex flex-col gap-4",children:[C.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(_l,{}),f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),C.map(B=>{const I=o.env_schema[B],U=S.has(B);return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(lt,{className:"text-xs font-mono",children:B}),I.required&&f.jsx(mt,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),I.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),f.jsxs("div",{className:"relative",children:[f.jsx(Ze,{type:U?"text":"password",value:g[B]??"",onChange:L=>v(G=>({...G,[B]:L.target.value})),placeholder:B,className:"h-8 pr-8 text-xs font-mono"}),f.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>k(B),children:U?f.jsx(mU,{className:"h-3.5 w-3.5"}):f.jsx(pU,{className:"h-3.5 w-3.5"})})]})]},B)})]})]}),E.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(_l,{}),f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),E.map(B=>{const I=o.params_schema[B],U=b[B],L=I.default;if(I.type==="boolean")return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(lt,{className:"text-xs font-mono",children:B}),I.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),f.jsxs(ja,{value:U!=null?String(U):L!=null?String(L):"",onValueChange:H=>w(Y=>({...Y,[B]:H==="true"})),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"true",children:"true"}),f.jsx(hn,{value:"false",children:"false"})]})]})]},B);const G=I.type==="int"||I.type==="float"?"number":"text",z=I.type==="float"?"any":void 0,K=B==="default_agent"&&h?h.map(H=>H.name):void 0,P=K?`datalist-${B}`:void 0;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(lt,{className:"text-xs font-mono",children:B}),I.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),f.jsx(Ze,{type:G,step:z,list:P,value:U!=null?String(U):"",onChange:H=>w(Y=>({...Y,[B]:G==="number"&&H.target.value!==""?Number(H.target.value):H.target.value})),placeholder:L!=null?String(L):void 0,className:"h-8 text-xs font-mono"}),K&&f.jsx("datalist",{id:P,children:K.map(H=>f.jsx("option",{value:H},H))}),B==="default_agent"&&T&&f.jsx("p",{className:"text-xs text-destructive",children:T})]},B)})]})]}),f.jsxs(pe,{size:"sm",onClick:M,disabled:m.isPending||!!T,className:"self-start",children:[f.jsx(bU,{className:"mr-2 h-3.5 w-3.5"}),m.isPending?"Saving...":"Save Configuration"]})]})}function ZH({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:i}){var L,G;const a=Qe(),o=()=>{i!=null&&a.invalidateQueries({queryKey:Pe.projects.resources(i)})},l=GH(),u=ive(),d=ave(),m=QH(i??0),h=lve(i??0),g=uve(i??0),v=i!=null&&(e==null?void 0:e.source)==="project",b=v?m:l,w=v?h:u,S=v?g:d,[j,C]=y.useState(!1),[E,k]=y.useState("markdown"),O=w.isPending||S.isPending||b.isPending;if(!e)return null;const A=()=>{if(!j){C(!0);return}b.mutate({type:t,name:e.name},{onSuccess:z=>{z.exit_code===0?(We.success(`Uninstalled ${e.name}`),v||o(),r(!1)):We.error(`Uninstall failed: ${z.stderr||z.stdout}`),C(!1)},onError:()=>{We.error("Uninstall request failed"),C(!1)}})},T=()=>{w.mutate({type:t,name:e.name},{onSuccess:z=>{z.exit_code===0?(We.success(`Updated ${e.name}`),v||o()):We.error(`Update failed: ${z.stderr||z.stdout}`)},onError:()=>We.error("Update request failed")})},M=()=>{S.mutate({type:t,name:e.name},{onSuccess:z=>{z.exit_code===0?(We.success(`Reinstalled ${e.name}`),v||o()):We.error(`Reinstall failed: ${z.stderr||z.stdout}`)},onError:()=>We.error("Reinstall request failed")})},I=((L={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:L.includes(e.name))??!1,U=(G=e.frontmatter)==null?void 0:G.metadata;return f.jsx(uA,{open:n,onOpenChange:z=>{r(z),C(!1),k("markdown")},children:f.jsxs(dA,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[f.jsxs(fA,{className:"shrink-0",children:[f.jsxs(hA,{className:"flex items-center gap-2",children:[e.name,e.version&&f.jsxs(mt,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),f.jsx(mA,{children:e.description||"No description"})]}),f.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[f.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[f.jsxs("span",{children:["Source: ",f.jsx("strong",{children:e.source})]}),f.jsxs("span",{children:["Path: ",f.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]})]}),U&&Object.keys(U).length>0&&f.jsxs("details",{className:"text-sm",children:[f.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"Metadata"}),f.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(U,null,2)})]})]}),f.jsx(qf,{className:"min-h-0 flex-1",children:f.jsxs("div",{className:"px-4 overflow-hidden",children:[t==="agents"&&f.jsx(vve,{agentName:e.name}),f.jsx(yve,{resourceType:t,resourceName:e.name,enabled:n,projectId:i}),f.jsx("div",{className:"mt-4",children:e.body?f.jsxs(f.Fragment,{children:[f.jsx(ub,{view:E,onChange:k}),E==="markdown"?f.jsx(Bi,{content:e.body,className:"text-sm"}):f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e.body})]}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No content."})})]})}),f.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[f.jsx(pe,{size:"sm",onClick:T,disabled:O,children:w.isPending?"Updating...":"Update"}),f.jsx(pe,{variant:"outline",size:"sm",onClick:M,disabled:O,children:S.isPending?"Reinstalling...":"Reinstall"}),f.jsx("div",{className:"flex-1"}),!I&&f.jsxs(f.Fragment,{children:[f.jsx(pe,{variant:j?"destructive":"outline",size:"sm",onClick:A,disabled:O,children:b.isPending?"Uninstalling...":j?"Confirm Uninstall":"Uninstall"}),j&&!b.isPending&&f.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>C(!1),children:"Cancel"})]})]})]})})}const xve=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function pA({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[i,a]=y.useState(n??"roles"),[o,l]=y.useState(""),[u,d]=y.useState(null),[m,h]=y.useState(null);y.useEffect(()=>{e&&n&&a(n)},[e,n]);const g=rve(),v=sve(r??0),b=r?v:g,w=(u==null?void 0:u.status)==="success",S=()=>{o.trim()&&(d(null),h(null),b.mutate({type:i,name:o.trim()},{onSuccess:C=>{C.exit_code===0?(We.success(`Installed ${o.trim()}`),d({status:"success",message:`Successfully installed ${o.trim()}`}),h(C.stdout||null)):(d({status:"error",message:"Installation failed"}),h(C.stderr||C.stdout||"Unknown error."))},onError:()=>{d({status:"error",message:"Install request failed"}),We.error("Install request failed")}}))},j=C=>{C||(d(null),h(null),l("")),t(C)};return f.jsx(Qi,{open:e,onOpenChange:j,children:f.jsxs(Zi,{className:"sm:max-w-md",children:[f.jsxs(Ji,{children:[f.jsx(ea,{children:r?"Install Resource to Project":"Install Resource"}),f.jsx(Hp,{children:"Install a resource from StrawHub by name."})]}),f.jsxs("div",{className:"flex flex-col gap-4",children:[u&&f.jsxs(Tm,{variant:u.status==="error"?"destructive":"default",className:u.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[u.status==="success"?f.jsx($f,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):f.jsx(Lp,{className:"h-4 w-4"}),f.jsx(Pm,{children:u.status==="success"?"Installed":"Error"}),f.jsx(Mm,{children:u.message})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(lt,{htmlFor:"install-type",children:"Type"}),f.jsxs(ja,{value:i,onValueChange:a,disabled:w,children:[f.jsx(_a,{id:"install-type",children:f.jsx(Ea,{})}),f.jsx(Ca,{children:xve.map(C=>f.jsx(hn,{value:C.value,children:C.label},C.value))})]})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(lt,{htmlFor:"install-name",children:"Package Name"}),f.jsx(Ze,{id:"install-name",autoFocus:!0,value:o,onChange:C=>l(C.target.value),placeholder:"e.g. strawpot-claude-code",readOnly:w,onKeyDown:C=>{C.key==="Enter"&&S()}})]}),m&&f.jsxs("details",{className:"text-sm",children:[f.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),f.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:m})]})]}),f.jsx(Up,{children:(u==null?void 0:u.status)==="success"?f.jsx(pe,{onClick:()=>j(!1),children:"Done"}):f.jsx(pe,{onClick:S,disabled:!o.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const bve=/^No\b.*\bpackages to update/;function wve(e){const t=e.split(`
`).map(r=>r.trim()).filter(Boolean).filter(r=>!bve.test(r)).map(r=>({text:r,updated:!r.includes("already up to date")})),n=t.filter(r=>r.updated).length;return{lines:t,updated:n,upToDate:t.length-n}}const Sve={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers",integrations:"Integrations"};function gA({open:e,onOpenChange:t,onUpdate:n,scope:r,resourceType:i}){var w,S;const[a,o]=y.useState("idle"),[l,u]=y.useState(null),d=l?wve(l.stdout):null,m=((w=l==null?void 0:l.stderr)==null?void 0:w.trim())||((S=l==null?void 0:l.stdout)==null?void 0:S.trim())||"Unknown error",h=i?Sve[i]??i:null,g=(h==null?void 0:h.toLowerCase())??"resources",v=async()=>{o("running"),u(null);try{const j=await n();u(j),o(j.exit_code===0?"done":"error")}catch(j){u({exit_code:-1,stdout:"",stderr:j instanceof Error?j.message:String(j)}),o("error")}},b=()=>{o("idle"),u(null),t(!1)};return f.jsx(Qi,{open:e,onOpenChange:a==="running"?void 0:b,children:f.jsxs(Zi,{className:"sm:max-w-lg",children:[f.jsxs(Ji,{children:[f.jsxs(ea,{children:["Update All ",h??"Resources"]}),f.jsxs(Hp,{children:[a==="idle"&&`Update all installed ${g} (${r}) to their latest versions.`,a==="running"&&"Updating resources...",a==="done"&&d&&(d.updated===0&&d.upToDate===0?`No ${g} to update.`:`${d.updated} updated, ${d.upToDate} already up to date.`),a==="error"&&"Update failed."]})]}),a==="running"&&f.jsx("div",{className:"flex items-center justify-center py-8",children:f.jsx(ur,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),a==="done"&&d&&d.lines.length>0&&f.jsx(qf,{className:"max-h-64 rounded-md border p-3",children:f.jsx("div",{className:"space-y-1 text-sm font-mono",children:d.lines.map((j,C)=>f.jsxs("div",{className:"flex items-start gap-2",children:[j.updated?f.jsx(qm,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-blue-500"}):f.jsx($f,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-green-500"}),f.jsx("span",{className:j.updated?"text-foreground":"text-muted-foreground",children:j.text})]},C))})}),a==="error"&&f.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-3",children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx(Lp,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),f.jsx("pre",{className:"whitespace-pre-wrap text-sm text-destructive",children:m})]})}),f.jsxs(Up,{children:[a==="idle"&&f.jsxs(f.Fragment,{children:[f.jsx(pe,{variant:"outline",onClick:b,children:"Cancel"}),f.jsxs(pe,{onClick:v,children:[f.jsx(qm,{className:"mr-2 h-4 w-4"}),"Update All",h?` ${h}`:""]})]}),a==="running"&&f.jsxs(pe,{disabled:!0,children:[f.jsx(ur,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}),(a==="done"||a==="error")&&f.jsx(pe,{onClick:b,children:"Close"})]})]})})}function JH(e){return e!=null?`?project_id=${e}`:""}function vA(e){return Pn({queryKey:Pe.integrations.all(e),queryFn:()=>Ae.get(`/integrations${JH(e)}`),refetchInterval:1e4})}function jve(e,t){const n=t==null?void 0:t.projectId;return Pn({queryKey:Pe.integrations.config(e,n),queryFn:()=>Ae.get(`/integrations/${e}/config${JH(n)}`),enabled:(t==null?void 0:t.enabled)??!!e})}function tg(e){return e!=null?`?project_id=${e}`:""}function nc(e){e.invalidateQueries({queryKey:["integrations"]})}function Eve(){const e=Qe();return ut({mutationFn:({name:t,projectId:n})=>Ae.post(`/integrations/${t}/start${tg(n)}`),onSuccess:()=>nc(e)})}function _ve(){const e=Qe();return ut({mutationFn:({name:t,projectId:n})=>Ae.post(`/integrations/${t}/stop${tg(n)}`),onSuccess:()=>nc(e)})}function Cve(){const e=Qe();return ut({mutationFn:({name:t,config_values:n,projectId:r})=>Ae.put(`/integrations/${t}/config${tg(r)}`,{config_values:n}),onSuccess:()=>nc(e)})}function Nve(){const e=Qe();return ut({mutationFn:({name:t,projectId:n})=>Ae.post("/integrations/install",{name:t,...n!=null&&{project_id:n}}),onSuccess:()=>nc(e)})}function kve(){const e=Qe();return ut({mutationFn:({name:t,projectId:n})=>Ae.delete(`/integrations/${t}${tg(n)}`),onSuccess:()=>nc(e)})}function Ave(){const e=Qe();return ut({mutationFn:({name:t,projectId:n})=>Ae.post("/integrations/update",{name:t,...n!=null&&{project_id:n}}),onSuccess:()=>nc(e)})}function Ove(){const e=Qe();return ut({mutationFn:({name:t,projectId:n})=>Ae.post("/integrations/reinstall",{name:t,...n!=null&&{project_id:n}}),onSuccess:()=>nc(e)})}function Tve(){const e=Qe();return ut({mutationFn:({name:t,enabled:n,projectId:r})=>Ae.put(`/integrations/${t}/auto-start${tg(r)}`,{enabled:n}),onSuccess:()=>nc(e)})}function Pve({className:e,size:t="default",...n}){return f.jsx(_ae,{"data-slot":"switch","data-size":t,className:ke("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),...n,children:f.jsx(Cae,{"data-slot":"switch-thumb",className:ke("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}function eq({integration:e,open:t,onOpenChange:n,onLogs:r}){const i=Eve(),a=_ve(),o=Tve(),l=Ave(),u=Ove(),d=kve(),[m,h]=y.useState(!1);if(!e)return null;const g=e.status==="running",v=l.isPending||u.isPending||d.isPending,b={name:e.name,projectId:e.project_id},w=()=>{g?a.mutate(b,{onSuccess:()=>We.success(`Stopped ${e.name}`),onError:E=>We.error(`Failed to stop: ${E.message}`)}):i.mutate(b,{onSuccess:()=>We.success(`Started ${e.name}`),onError:E=>We.error(`Failed to start: ${E.message}`)})},S=()=>{l.mutate(b,{onSuccess:E=>{E.exit_code===0?We.success(`Updated ${e.name}`):We.error(`Update failed: ${E.stderr||E.stdout}`)},onError:E=>We.error(`Failed to update: ${E.message}`)})},j=()=>{u.mutate(b,{onSuccess:E=>{E.exit_code===0?We.success(`Reinstalled ${e.name}`):We.error(`Reinstall failed: ${E.stderr||E.stdout}`)},onError:E=>We.error(`Failed to reinstall: ${E.message}`)})},C=()=>{if(!m){h(!0);return}d.mutate(b,{onSuccess:E=>{E.exit_code===0?(We.success(`Uninstalled ${e.name}`),n(!1)):We.error(`Uninstall failed: ${E.stderr||E.stdout}`),h(!1)},onError:E=>{We.error(`Failed to uninstall: ${E.message}`),h(!1)}})};return f.jsx(uA,{open:t,onOpenChange:E=>{n(E),h(!1)},children:f.jsxs(dA,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[f.jsxs(fA,{className:"shrink-0",children:[f.jsxs(hA,{className:"flex items-center gap-2",children:[e.name,f.jsx(Mve,{status:e.status}),g&&f.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]}),f.jsx(mA,{children:e.description||"No description"})]}),f.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[f.jsxs("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:[f.jsxs("span",{children:["Path:"," ",f.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]}),e.started_at&&f.jsxs("span",{children:["Started:"," ",f.jsx("strong",{children:new Date(e.started_at).toLocaleString()})]}),e.pid&&f.jsxs("span",{children:["PID: ",f.jsx("strong",{children:e.pid})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Pve,{id:"auto-start",checked:e.auto_start,onCheckedChange:E=>{o.mutate({...b,enabled:E},{onSuccess:()=>We.success(E?"Auto-start enabled":"Auto-start disabled"),onError:k=>We.error(`Failed to update: ${k.message}`)})},disabled:o.isPending}),f.jsx(lt,{htmlFor:"auto-start",className:"text-xs",children:"Start automatically when StrawPot launches"})]}),e.last_error&&f.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-xs text-destructive",children:e.last_error})]}),f.jsx(qf,{className:"min-h-0 flex-1",children:f.jsx("div",{className:"px-4 space-y-6",children:f.jsx(Rve,{name:e.name,projectId:e.project_id,enabled:t})})}),f.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[f.jsx(pe,{size:"sm",variant:g?"destructive":"default",onClick:w,disabled:i.isPending||a.isPending,children:g?f.jsxs(f.Fragment,{children:[f.jsx(Dk,{className:"mr-1 h-3.5 w-3.5"})," Stop"]}):f.jsxs(f.Fragment,{children:[f.jsx($p,{className:"mr-1 h-3.5 w-3.5"})," Start"]})}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>r(e.name,e.project_id),children:"Logs"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:S,disabled:v,children:l.isPending?"Updating...":"Update"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:j,disabled:v,children:u.isPending?"Reinstalling...":"Reinstall"}),f.jsx("div",{className:"flex-1"}),f.jsx(pe,{variant:m?"destructive":"outline",size:"sm",onClick:C,disabled:v,children:d.isPending?"Uninstalling...":m?"Confirm Uninstall":"Uninstall"}),m&&!d.isPending&&f.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>h(!1),children:"Cancel"})]})]})})}function Mve({status:e}){const t={running:{variant:"default",label:"Running"},stopped:{variant:"secondary",label:"Stopped"},error:{variant:"destructive",label:"Error"}},{variant:n,label:r}=t[e]??{variant:"outline",label:e};return f.jsx(mt,{variant:n,children:r})}function Rve({name:e,projectId:t,enabled:n}){const{data:r}=jve(e,{enabled:n,projectId:t}),i=Cve(),[a,o]=y.useState({}),[l,u]=y.useState(!1);if(r&&!l){const h={};for(const g of Object.keys(r.env_schema))h[g]=r.config_values[g]??"";o(h),u(!0)}const d=(r==null?void 0:r.env_schema)??{};if(Object.keys(d).length===0)return null;const m=()=>{i.mutate({name:e,projectId:t,config_values:a},{onSuccess:()=>We.success("Configuration saved"),onError:h=>We.error(`Failed to save: ${h.message}`)})};return f.jsxs("div",{className:"space-y-4",children:[f.jsx("h3",{className:"text-sm font-medium",children:"Configuration"}),Object.entries(d).map(([h,g])=>f.jsx(Dve,{name:h,field:g,value:a[h]??"",onChange:v=>o(b=>({...b,[h]:v}))},h)),f.jsx(pe,{size:"sm",onClick:m,disabled:i.isPending,children:i.isPending?"Saving...":"Save Configuration"})]})}function Dve({name:e,field:t,value:n,onChange:r}){const[i,a]=y.useState(!1);return f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs(lt,{htmlFor:`config-${e}`,children:[e,t.required&&f.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),f.jsxs("div",{className:"relative",children:[f.jsx(Ze,{id:`config-${e}`,type:i?"text":"password",value:n,onChange:o=>r(o.target.value),placeholder:t.description,className:"pr-8"}),f.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>a(o=>!o),children:i?f.jsx(mU,{className:"h-3.5 w-3.5"}):f.jsx(pU,{className:"h-3.5 w-3.5"})})]}),t.description&&f.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]})}function Ive(e,t){const[n,r]=y.useState([]),[i,a]=y.useState(!1),[o,l]=y.useState(!1),u=y.useRef(null),d=y.useCallback(()=>{if(!e)return;const h=window.location.protocol==="https:"?"wss:":"ws:",g=t!=null?`?project_id=${t}`:"",v=`${h}//${window.location.host}/api/integrations/${e}/logs/ws${g}`,b=new WebSocket(v);return u.current=b,b.onopen=()=>l(!0),b.onmessage=w=>{try{const S=JSON.parse(w.data);switch(S.type){case"log_snapshot":r(S.lines??[]);break;case"log_delta":r(j=>[...j,...S.lines??[]]);break;case"log_done":a(!0);break;case"error":a(!0);break}}catch{}},b.onclose=()=>{l(!1),u.current=null},b.onerror=()=>{l(!1)},b},[e,t]);y.useEffect(()=>{r([]),a(!1),l(!1);const h=d();return()=>{h&&h.readyState<=WebSocket.OPEN&&h.close()}},[d]);const m=y.useCallback(()=>{if(e){const h=t!=null?`?project_id=${t}`:"";Ae.delete(`/integrations/${e}/logs${h}`).catch(()=>{})}r([])},[e,t]);return{lines:n,done:i,connected:o,clearLines:m}}const Oc=18,II=10;function tq({name:e,projectId:t,open:n,onOpenChange:r}){const i=n?e:null,{lines:a,done:o,connected:l,clearLines:u}=Ive(i,t);return f.jsx(uA,{open:n,onOpenChange:r,children:f.jsxs(dA,{side:"right",className:"flex h-full w-[700px] flex-col sm:max-w-[700px] overflow-hidden",children:[f.jsxs(fA,{children:[f.jsxs(hA,{children:["Logs: ",e]}),f.jsx(mA,{children:"Adapter stdout/stderr output"})]}),f.jsx("div",{className:"flex-1 min-h-0 min-w-0 px-4 pb-4",children:f.jsx(Lve,{lines:a,done:o,connected:l,onClear:u,onClose:()=>r(!1)})})]})})}function Lve({lines:e,done:t,connected:n,onClear:r,onClose:i}){const[a,o]=y.useState(""),[l,u]=y.useState(!1),d=a.toLowerCase(),m=a?e.reduce((L,G,z)=>(G.toLowerCase().includes(d)&&L.push(z),L),[]):[],h=y.useRef(null),[g,v]=y.useState(0),[b,w]=y.useState(0),[S,j]=y.useState(!0),C=y.useRef(0),E=e.length*Oc,k=Math.max(0,Math.floor(g/Oc)-II),O=Math.ceil(b/Oc)+II*2,A=Math.min(e.length,k+O),T=e.slice(k,A),M=String(e.length).length,B=y.useCallback(()=>{const L=h.current;if(!L)return;v(L.scrollTop),w(L.clientHeight);const G=L.scrollTop+L.clientHeight>=L.scrollHeight-Oc*2;j(G)},[]);y.useEffect(()=>{const L=h.current;L&&w(L.clientHeight)},[]),y.useEffect(()=>{if(S&&e.length>C.current){const L=h.current;L&&(L.scrollTop=L.scrollHeight)}C.current=e.length},[e.length,S]);const I=()=>{const L=h.current;L&&(L.scrollTop=L.scrollHeight,j(!0))},U=y.useCallback(L=>{if((L.metaKey||L.ctrlKey)&&L.key==="a"){L.preventDefault();const G=h.current;if(G){const z=window.getSelection(),K=document.createRange();K.selectNodeContents(G),z==null||z.removeAllRanges(),z==null||z.addRange(K)}}},[]);return f.jsxs("div",{className:"flex h-full flex-col gap-3",children:[f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[f.jsxs("div",{className:"relative",children:[f.jsx(W0,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),f.jsx(Ze,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:a,onChange:L=>o(L.target.value)})]}),a&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.length," match",m.length!==1?"es":""]}),e.length>0&&f.jsxs(pe,{variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:()=>{navigator.clipboard.writeText(e.join(`
`)),We.success("Copied all logs to clipboard")},children:[f.jsx(gse,{className:"mr-1 h-3 w-3"}),"Copy all"]}),f.jsx("span",{className:"ml-auto flex items-center gap-1 text-xs text-muted-foreground",children:t?"Stream ended":f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${n?"animate-pulse bg-green-500":"bg-orange-400"}`}),n?"Live":"Connecting..."]})})]}),f.jsxs("div",{className:"relative min-h-0 flex-1",children:[f.jsx("div",{ref:h,tabIndex:0,className:"absolute inset-0 overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4] select-text focus:outline-none focus:ring-1 focus:ring-ring",onScroll:B,onKeyDown:U,children:e.length===0?f.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:t?"No log output.":"Waiting for log output..."}):f.jsx("div",{style:{height:E,position:"relative",minWidth:"fit-content"},children:f.jsx("div",{style:{position:"absolute",top:k*Oc,left:0},children:T.map((L,G)=>{const z=k+G,K=a&&L.toLowerCase().includes(d);return f.jsxs("div",{className:K?"bg-yellow-900/30":void 0,style:{height:Oc,lineHeight:`${Oc}px`,display:"flex",whiteSpace:"pre"},children:[f.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(M+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:z+1}),f.jsx("span",{className:"pr-4",children:L})]},z)})})})}),!S&&e.length>0&&f.jsxs(pe,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:I,children:[f.jsx(cU,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2 pt-1",children:[f.jsx(pe,{size:"sm",variant:"ghost",onClick:i,children:"Close"}),f.jsx("div",{className:"flex-1"}),l?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"Clear all logs?"}),f.jsx(pe,{size:"sm",variant:"destructive",onClick:()=>{r(),u(!1)},children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"ghost",onClick:()=>u(!1),children:"Cancel"})]}):f.jsxs(pe,{size:"sm",variant:"ghost",className:"text-xs",disabled:e.length===0,onClick:()=>u(!0),children:[f.jsx(Pa,{className:"mr-1 h-3 w-3"}),"Clear"]})]})]})}function zve({status:e}){const t={running:{variant:"default",label:"Running"},stopped:{variant:"secondary",label:"Stopped"},error:{variant:"destructive",label:"Error"}},{variant:n,label:r}=t[e]??{variant:"outline",label:e};return f.jsx(mt,{variant:n,children:r})}function $ve({projectId:e}){const{data:t,isLoading:n}=vA(e),[r,i]=y.useState(null),[a,o]=y.useState(!1),[l,u]=y.useState(null),[d,m]=y.useState(void 0),h=t??[],g=r?h.find(v=>v.name===r.name&&v.project_id===r.project_id)??r:null;return f.jsxs("div",{className:"space-y-4",children:[n?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((v,b)=>f.jsx(en,{className:"h-12 w-full"},b))}):h.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:[f.jsx("p",{children:"No integrations installed yet."}),f.jsx("p",{className:"mt-1 text-xs",children:"Install an integration from Strawhub to get started."})]}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Version"}),f.jsx(Re,{children:"Description"}),f.jsx(Re,{children:"Status"})]})}),f.jsx(qi,{children:h.map(v=>f.jsxs(sn,{className:"cursor-pointer",onClick:()=>{i(v),o(!0)},children:[f.jsx(Me,{className:"font-medium",children:v.name}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:v.version?`v${v.version}`:"—"}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:v.description||"—"}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(zve,{status:v.status}),v.status==="running"&&f.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]})})]},v.name))})]})})}),f.jsx(eq,{integration:g,open:a,onOpenChange:o,onLogs:(v,b)=>{u(v),m(b)}}),f.jsx(tq,{name:l,projectId:d,open:!!l,onOpenChange:v=>{v||u(null)}})]})}const fC=["roles","skills","agents","memories"],Bve=[...fC,"integrations"],hC={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memories",integrations:"Integrations"};function Fve({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:i}=Vf(e),{data:a}=vA(e),o=(a??[]).length,[l,u]=y.useState(null),[d,m]=y.useState(""),[h,g]=y.useState(!1),[v,b]=y.useState(!1),[w,S]=y.useState(!1),[j,C]=y.useState("all"),E=cve(e),k=t??v,O=n??b,A=Bve.includes(j)?j:void 0,T=A?hC[A]??A:null,{data:M}=_ue(e,d,l??"",{enabled:h&&!!l&&!!d}),B=I=>{u(I.name),m(I.type),g(!0)};return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"Resources available to this project"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(pe,{onClick:()=>S(!0),size:"sm",variant:"outline",children:[f.jsx(qm,{className:"mr-2 h-4 w-4"}),"Update All",T?` ${T}`:""]}),f.jsxs(pe,{onClick:()=>O(!0),size:"sm",children:[f.jsx(zp,{className:"mr-2 h-4 w-4"}),"Install"]})]})]}),i?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((I,U)=>f.jsx(en,{className:"h-12 w-full"},U))}):!r||r.length===0&&o===0?f.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources available yet."}):f.jsxs(Wp,{defaultValue:r.length>0?"all":"integrations",onValueChange:C,children:[f.jsxs(Qp,{children:[f.jsx(Wn,{value:"all",children:"All"}),fC.map(I=>{const U=r.filter(L=>L.type===I).length;return f.jsxs(Wn,{value:I,disabled:U===0,children:[hC[I]," (",U,")"]},I)}),f.jsxs(Wn,{value:"integrations",children:["Integrations (",o,")"]})]}),f.jsx(Qn,{value:"all",children:f.jsx(LI,{resources:r,showType:!0,projectId:e,onSelect:B})}),fC.map(I=>f.jsx(Qn,{value:I,children:f.jsx(LI,{resources:r.filter(U=>U.type===I),projectId:e,onSelect:B})},I)),f.jsx(Qn,{value:"integrations",children:f.jsx($ve,{projectId:e})})]}),f.jsx(ZH,{resource:M??null,resourceType:d,open:h,onOpenChange:g,projectId:e}),f.jsx(pA,{open:k,onOpenChange:O,projectId:e}),f.jsx(gA,{open:w,onOpenChange:S,onUpdate:()=>E.mutateAsync(A),scope:"project",resourceType:A})]})}function LI({resources:e,showType:t,projectId:n,onSelect:r}){return e.length===0?f.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources in this category."}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Source"}),t&&f.jsx(Re,{children:"Type"}),f.jsx(Re,{children:"Version"}),f.jsx(Re,{children:"Description"}),f.jsx(Re,{children:"Config"}),f.jsx(Re,{className:"w-24"})]})}),f.jsx(qi,{children:e.map(i=>f.jsxs(sn,{className:"cursor-pointer",onClick:()=>r(i),children:[f.jsx(Me,{className:"font-medium",children:i.name}),f.jsx(Me,{children:f.jsx(mt,{variant:"outline",className:`text-xs ${i.source==="global"?"border-dashed":""}`,children:i.source==="global"?"Global":"Project"})}),t&&f.jsx(Me,{children:f.jsx(mt,{variant:"outline",className:"text-xs",children:hC[i.type]??i.type})}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:i.version??"—"}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm",children:i.description||"—"}),f.jsx(Me,{children:i.config_count>0&&f.jsxs(mt,{variant:"secondary",className:"text-xs gap-1",children:[f.jsx(Q0,{className:"h-3 w-3"}),i.config_count]})}),f.jsx(Me,{children:i.source==="project"&&f.jsx(Uve,{projectId:n,resourceType:i.type,name:i.name})})]},`${i.type}-${i.name}`))})]})})})}function Uve({projectId:e,resourceType:t,name:n}){const[r,i]=y.useState(!1),a=QH(e),o=l=>{l.stopPropagation(),a.mutate({type:t,name:n},{onSuccess:u=>{u.exit_code===0?We.success(`Uninstalled ${n}`):We.error(`Uninstall failed: ${u.stderr||u.stdout}`),i(!1)},onError:()=>{We.error("Uninstall request failed"),i(!1)}})};return r?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:o,disabled:a.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:l=>{l.stopPropagation(),i(!1)},children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l=>{l.stopPropagation(),i(!0)},children:f.jsx(Pa,{className:"h-4 w-4"})})}function Hve(e,t="30d"){return Pn({queryKey:Pe.projects.stats(e,t),queryFn:()=>Ae.get(`/projects/${e}/stats?period=${t}`)})}var qve=["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 yA(e){if(typeof e!="string")return!1;var t=qve;return t.includes(e)}var Vve=["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"],Kve=new Set(Vve);function nq(e){return typeof e!="string"?!1:Kve.has(e)}function rq(e){return typeof e=="string"&&e.startsWith("data-")}function Vi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(nq(n)||rq(n))&&(t[n]=e[n]);return t}function vu(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Vi(t)}return typeof e=="object"&&!Array.isArray(e)?Vi(e):null}function ri(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(nq(n)||rq(n)||yA(n))&&(t[n]=e[n]);return t}function Yve(e){return e==null?null:y.isValidElement(e)?ri(e.props):typeof e=="object"&&!Array.isArray(e)?ri(e):null}var Xve=["children","width","height","viewBox","className","style","title","desc"];function mC(){return mC=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},mC.apply(null,arguments)}function Gve(e,t){if(e==null)return{};var n,r,i=Wve(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Wve(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 xA=y.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:u,desc:d}=e,m=Gve(e,Xve),h=a||{width:r,height:i,x:0,y:0},g=It("recharts-surface",o);return y.createElement("svg",mC({},ri(m),{className:g,width:r,height:i,style:l,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height),ref:t}),y.createElement("title",null,u),y.createElement("desc",null,d),n)}),Qve=["children","className"];function pC(){return pC=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},pC.apply(null,arguments)}function Zve(e,t){if(e==null)return{};var n,r,i=Jve(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jve(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 fr=y.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Zve(e,Qve),a=It("recharts-layer",r);return y.createElement("g",pC({className:a},ri(i),{ref:t}),n)}),iq=y.createContext(null),eye=()=>y.useContext(iq);function fn(e){return function(){return e}}const aq=Math.cos,xx=Math.sin,ro=Math.sqrt,bx=Math.PI,db=2*bx,gC=Math.PI,vC=2*gC,Ic=1e-6,tye=vC-Ic;function oq(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function nye(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return oq;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class rye{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?oq:nye(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,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,u=r-t,d=i-n,m=o-t,h=l-n,g=m*m+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Ic)if(!(Math.abs(h*u-d*m)>Ic)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,b=i-l,w=u*u+d*d,S=v*v+b*b,j=Math.sqrt(w),C=Math.sqrt(g),E=a*Math.tan((gC-Math.acos((w+g-S)/(2*j*C)))/2),k=E/C,O=E/j;Math.abs(k-1)>Ic&&this._append`L${t+k*m},${n+k*h}`,this._append`A${a},${a},0,0,${+(h*v>m*b)},${this._x1=t+O*u},${this._y1=n+O*d}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),u=r*Math.sin(i),d=t+l,m=n+u,h=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>Ic||Math.abs(this._y1-m)>Ic)&&this._append`L${d},${m}`,r&&(g<0&&(g=g%vC+vC),g>tye?this._append`A${r},${r},0,1,${h},${t-l},${n-u}A${r},${r},0,1,${h},${this._x1=d},${this._y1=m}`:g>Ic&&this._append`A${r},${r},0,${+(g>=gC)},${h},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function bA(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 rye(t)}function wA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sq(e){this._context=e}sq.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 fb(e){return new sq(e)}function lq(e){return e[0]}function cq(e){return e[1]}function uq(e,t){var n=fn(!0),r=null,i=fb,a=null,o=bA(l);e=typeof e=="function"?e:e===void 0?lq:fn(e),t=typeof t=="function"?t:t===void 0?cq:fn(t);function l(u){var d,m=(u=wA(u)).length,h,g=!1,v;for(r==null&&(a=i(v=o())),d=0;d<=m;++d)!(d<m&&n(h=u[d],d,u))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(h,d,u),+t(h,d,u));if(v)return a=null,v+""||null}return l.x=function(u){return arguments.length?(e=typeof u=="function"?u:fn(+u),l):e},l.y=function(u){return arguments.length?(t=typeof u=="function"?u:fn(+u),l):t},l.defined=function(u){return arguments.length?(n=typeof u=="function"?u:fn(!!u),l):n},l.curve=function(u){return arguments.length?(i=u,r!=null&&(a=i(r)),l):i},l.context=function(u){return arguments.length?(u==null?r=a=null:a=i(r=u),l):r},l}function ly(e,t,n){var r=null,i=fn(!0),a=null,o=fb,l=null,u=bA(d);e=typeof e=="function"?e:e===void 0?lq:fn(+e),t=typeof t=="function"?t:fn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?cq:fn(+n);function d(h){var g,v,b,w=(h=wA(h)).length,S,j=!1,C,E=new Array(w),k=new Array(w);for(a==null&&(l=o(C=u())),g=0;g<=w;++g){if(!(g<w&&i(S=h[g],g,h))===j)if(j=!j)v=g,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),b=g-1;b>=v;--b)l.point(E[b],k[b]);l.lineEnd(),l.areaEnd()}j&&(E[g]=+e(S,g,h),k[g]=+t(S,g,h),l.point(r?+r(S,g,h):E[g],n?+n(S,g,h):k[g]))}if(C)return l=null,C+""||null}function m(){return uq().defined(i).curve(o).context(a)}return d.x=function(h){return arguments.length?(e=typeof h=="function"?h:fn(+h),r=null,d):e},d.x0=function(h){return arguments.length?(e=typeof h=="function"?h:fn(+h),d):e},d.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:fn(+h),d):r},d.y=function(h){return arguments.length?(t=typeof h=="function"?h:fn(+h),n=null,d):t},d.y0=function(h){return arguments.length?(t=typeof h=="function"?h:fn(+h),d):t},d.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:fn(+h),d):n},d.lineX0=d.lineY0=function(){return m().x(e).y(t)},d.lineY1=function(){return m().x(e).y(n)},d.lineX1=function(){return m().x(r).y(t)},d.defined=function(h){return arguments.length?(i=typeof h=="function"?h:fn(!!h),d):i},d.curve=function(h){return arguments.length?(o=h,a!=null&&(l=o(a)),d):o},d.context=function(h){return arguments.length?(h==null?a=l=null:l=o(a=h),d):a},d}class dq{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 iye(e){return new dq(e,!0)}function aye(e){return new dq(e,!1)}const SA={draw(e,t){const n=ro(t/bx);e.moveTo(n,0),e.arc(0,0,n,0,db)}},oye={draw(e,t){const n=ro(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()}},fq=ro(1/3),sye=fq*2,lye={draw(e,t){const n=ro(t/sye),r=n*fq;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},cye={draw(e,t){const n=ro(t),r=-n/2;e.rect(r,r,n,n)}},uye=.8908130915292852,hq=xx(bx/10)/xx(7*bx/10),dye=xx(db/10)*hq,fye=-aq(db/10)*hq,hye={draw(e,t){const n=ro(t*uye),r=dye*n,i=fye*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=db*a/5,l=aq(o),u=xx(o);e.lineTo(u*n,-l*n),e.lineTo(l*r-u*i,u*r+l*i)}e.closePath()}},xj=ro(3),mye={draw(e,t){const n=-ro(t/(xj*3));e.moveTo(0,n*2),e.lineTo(-xj*n,-n),e.lineTo(xj*n,-n),e.closePath()}},ua=-.5,da=ro(3)/2,yC=1/ro(12),pye=(yC/2+1)*3,gye={draw(e,t){const n=ro(t/pye),r=n/2,i=n*yC,a=r,o=n*yC+n,l=-a,u=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,u),e.lineTo(ua*r-da*i,da*r+ua*i),e.lineTo(ua*a-da*o,da*a+ua*o),e.lineTo(ua*l-da*u,da*l+ua*u),e.lineTo(ua*r+da*i,ua*i-da*r),e.lineTo(ua*a+da*o,ua*o-da*a),e.lineTo(ua*l+da*u,ua*u-da*l),e.closePath()}};function vye(e,t){let n=null,r=bA(i);e=typeof e=="function"?e:fn(e||SA),t=typeof t=="function"?t:fn(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:fn(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:fn(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function wx(){}function Sx(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 mq(e){this._context=e}mq.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:Sx(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:Sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yye(e){return new mq(e)}function pq(e){this._context=e}pq.prototype={areaStart:wx,areaEnd:wx,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:Sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xye(e){return new pq(e)}function gq(e){this._context=e}gq.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:Sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bye(e){return new gq(e)}function vq(e){this._context=e}vq.prototype={areaStart:wx,areaEnd:wx,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 wye(e){return new vq(e)}function zI(e){return e<0?-1:1}function $I(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(a*i+o*r)/(r+i);return(zI(a)+zI(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function BI(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function bj(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,o-l*n,a,o)}function jx(e){this._context=e}jx.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:bj(this,this._t0,BI(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,bj(this,BI(this,n=$I(this,e,t)),n);break;default:bj(this,this._t0,n=$I(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function yq(e){this._context=new xq(e)}(yq.prototype=Object.create(jx.prototype)).point=function(e,t){jx.prototype.point.call(this,t,e)};function xq(e){this._context=e}xq.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,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Sye(e){return new jx(e)}function jye(e){return new yq(e)}function bq(e){this._context=e}bq.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=FI(e),i=FI(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(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 FI(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Eye(e){return new bq(e)}function hb(e,t){this._context=e,this._t=t}hb.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 _ye(e){return new hb(e,.5)}function Cye(e){return new hb(e,0)}function Nye(e){return new hb(e,1)}function yu(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function xC(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function kye(e,t){return e[t]}function Aye(e){const t=[];return t.key=e,t}function Oye(){var e=fn([]),t=xC,n=yu,r=kye;function i(a){var o=Array.from(e.apply(this,arguments),Aye),l,u=o.length,d=-1,m;for(const h of a)for(l=0,++d;l<u;++l)(o[l][d]=[0,+r(h,o[l].key,d,a)]).data=h;for(l=0,m=wA(t(o));l<u;++l)o[m[l]].index=l;return n(o,m),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:fn(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:fn(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?xC:typeof a=="function"?a:fn(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??yu,i):n},i}function Tye(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}yu(e,t)}}function Pye(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,l=0;o<i;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}yu(e,t)}}function Mye(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var l=0,u=0,d=0;l<o;++l){for(var m=e[t[l]],h=m[r][1]||0,g=m[r-1][1]||0,v=(h-g)/2,b=0;b<l;++b){var w=e[t[b]],S=w[r][1]||0,j=w[r-1][1]||0;v+=S-j}u+=h,d+=v*h}i[r-1][1]+=i[r-1][0]=n,u&&(n-=d/u)}i[r-1][1]+=i[r-1][0]=n,yu(e,t)}}var wj={},Sj={},UI;function Rye(){return UI||(UI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(Sj)),Sj}var jj={},HI;function wq(){return HI||(HI=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})(jj)),jj}var Ej={},qI;function jA(){return qI||(qI=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})(Ej)),Ej}var _j={},Cj={},VI;function Dye(){return VI||(VI=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})(Cj)),Cj}var KI;function EA(){return KI||(KI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dye(),n=jA();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let l=0,u="",d="",m=!1;for(i.charCodeAt(0)===46&&(a.push(""),l++);l<o;){const h=i[l];d?h==="\\"&&l+1<o?(l++,u+=i[l]):h===d?d="":u+=h:m?h==='"'||h==="'"?d=h:h==="]"?(m=!1,a.push(u),u=""):u+=h:h==="["?(m=!0,u&&(a.push(u),u="")):h==="."?u&&(a.push(u),u=""):u+=h,l++}return u&&a.push(u),a}e.toPath=r})(_j)),_j}var YI;function _A(){return YI||(YI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rye(),n=wq(),r=jA(),i=EA();function a(l,u,d){if(l==null)return d;switch(typeof u){case"string":{if(t.isUnsafeProperty(u))return d;const m=l[u];return m===void 0?n.isDeepKey(u)?a(l,i.toPath(u),d):d:m}case"number":case"symbol":{typeof u=="number"&&(u=r.toKey(u));const m=l[u];return m===void 0?d:m}default:{if(Array.isArray(u))return o(l,u,d);if(Object.is(u==null?void 0:u.valueOf(),-0)?u="-0":u=String(u),t.isUnsafeProperty(u))return d;const m=l[u];return m===void 0?d:m}}}function o(l,u,d){if(u.length===0)return d;let m=l;for(let h=0;h<u.length;h++){if(m==null||t.isUnsafeProperty(u[h]))return d;m=m[u[h]]}return m===void 0?d:m}e.get=a})(wj)),wj}var Nj,XI;function Iye(){return XI||(XI=1,Nj=_A().get),Nj}var Lye=Iye();const xu=Gi(Lye);var zye=4;function zl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zye,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function zn(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((i,a,o)=>{var l=n[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+zl(l)+a:i+a},"")}var wr=e=>e===0?0:e>0?1:-1,ko=e=>typeof e=="number"&&e!=+e,bu=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ie=e=>(typeof e=="number"||e instanceof Number)&&!ko(e),Ao=e=>Ie(e)||typeof e=="string",$ye=0,Ym=e=>{var t=++$ye;return"".concat(e||"").concat(t)},Hr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ie(t)&&typeof t!="string")return r;var a;if(bu(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return ko(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},Sq=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 Sn(e,t,n){return Ie(e)&&Ie(t)?zl(e+n*(t-e)):t}function jq(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):xu(r,t))===n)}var Nn=e=>e===null||typeof e>"u",ng=e=>Nn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function xi(e){return e!=null}function rc(){}var Bye=["type","size","sizeType"];function bC(){return bC=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},bC.apply(null,arguments)}function GI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?GI(Object(n),!0).forEach(function(r){Fye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fye(e,t,n){return(t=Uye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uye(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)}function qye(e,t){if(e==null)return{};var n,r,i=Vye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Vye(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 Eq={symbolCircle:SA,symbolCross:oye,symbolDiamond:lye,symbolSquare:cye,symbolStar:hye,symbolTriangle:mye,symbolWye:gye},Kye=Math.PI/180,Yye=e=>{var t="symbol".concat(ng(e));return Eq[t]||SA},Xye=(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*Kye;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}},Gye=(e,t)=>{Eq["symbol".concat(ng(e))]=t},CA=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=qye(e,Bye),a=WI(WI({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var g=Yye(o),v=vye().type(g).size(Xye(n,r,o)),b=v();if(b!==null)return b},{className:u,cx:d,cy:m}=a,h=ri(a);return Ie(d)&&Ie(m)&&Ie(n)?y.createElement("path",bC({},h,{className:It("recharts-symbols",u),transform:"translate(".concat(d,", ").concat(m,")"),d:l()})):null};CA.registerSymbol=Gye;var _q=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,NA=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(y.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{yA(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Wye=(e,t,n)=>r=>(e(t,n,r),null),rg=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];yA(i)&&typeof a=="function"&&(r||(r={}),r[i]=Wye(a,t,n))}),r};function QI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qye(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){Zye(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 Zye(e,t,n){return(t=Jye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jye(e){var t=exe(e,"string");return typeof t=="symbol"?t:t+""}function exe(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 tr(e,t){var n=Qye({},e),r=t,i=Object.keys(t),a=i.reduce((o,l)=>(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return a}function Ex(){return Ex=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},Ex.apply(null,arguments)}function ZI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZI(Object(n),!0).forEach(function(r){txe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function txe(e,t,n){return(t=nxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nxe(e){var t=rxe(e,"string");return typeof t=="symbol"?t:t+""}function rxe(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 ha=32,ixe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function axe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function oxe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=ha/2,a=ha/6,o=ha/3,l=t.inactive?r:t.color,u=n??t.type;if(u==="none")return null;if(u==="plainline")return y.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:axe(t.payload),x1:0,y1:i,x2:ha,y2:i,className:"recharts-legend-icon"});if(u==="line")return y.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
            H`).concat(ha,"M").concat(2*o,",").concat(i,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(u==="rect")return y.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(ha/8,"h").concat(ha,"v").concat(ha*3/4,"h").concat(-ha,"z"),className:"recharts-legend-icon"});if(y.isValidElement(t.legendIcon)){var d=Cq({},t);return delete d.legendIcon,y.cloneElement(t.legendIcon,d)}return y.createElement(CA,{fill:l,cx:i,cy:i,size:ha,sizeType:"diameter",type:u})}function sxe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:l}=e,u={x:0,y:0,width:ha,height:ha},d={display:r==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((h,g)=>{var v=h.formatter||i,b=It({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:h.inactive});if(h.type==="none")return null;var w=typeof l=="object"?Cq({},l):{};w.color=h.inactive?a:w.color||h.color;var S=v?v(h.value,h,g):h.value;return y.createElement("li",Ex({className:b,style:d,key:"legend-item-".concat(g)},rg(e,h,g)),y.createElement(xA,{width:n,height:n,viewBox:u,style:m,"aria-label":"".concat(S," legend icon")},y.createElement(oxe,{data:h,iconType:o,inactiveColor:a})),y.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var lxe=e=>{var t=tr(e,ixe),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return y.createElement("ul",{className:"recharts-default-legend",style:a},y.createElement(sxe,Ex({},t,{payload:n})))},kj={},Aj={},JI;function cxe(){return JI||(JI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],l=r(o,a,n);i.has(l)||i.set(l,o)}return Array.from(i.values())}e.uniqBy=t})(Aj)),Aj}var Oj={},eL;function uxe(){return eL||(eL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(Oj)),Oj}var Tj={},tL;function Nq(){return tL||(tL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Tj)),Tj}var Pj={},Mj={},Rj={},nL;function dxe(){return nL||(nL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Rj)),Rj}var rL;function kq(){return rL||(rL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dxe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Mj)),Mj}var Dj={},iL;function fxe(){return iL||(iL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Dj)),Dj}var aL;function hxe(){return aL||(aL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kq(),n=fxe();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Pj)),Pj}var Ij={},Lj={},oL;function mxe(){return oL||(oL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_A();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Lj)),Lj}var zj={},$j={},Bj={},Fj={},sL;function Aq(){return sL||(sL=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})(Fj)),Fj}var Uj={},lL;function Oq(){return lL||(lL=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})(Uj)),Uj}var Hj={},cL;function Tq(){return cL||(cL=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})(Hj)),Hj}var uL;function pxe(){return uL||(uL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Aq(),n=Oq(),r=Tq();function i(m,h,g){return typeof g!="function"?i(m,h,()=>{}):a(m,h,function v(b,w,S,j,C,E){const k=g(b,w,S,j,C,E);return k!==void 0?!!k:a(b,w,v,E)},new Map)}function a(m,h,g,v){if(h===m)return!0;switch(typeof h){case"object":return o(m,h,g,v);case"function":return Object.keys(h).length>0?a(m,{...h},g,v):r.isEqualsSameValueZero(m,h);default:return t.isObject(m)?typeof h=="string"?h==="":!0:r.isEqualsSameValueZero(m,h)}}function o(m,h,g,v){if(h==null)return!0;if(Array.isArray(h))return u(m,h,g,v);if(h instanceof Map)return l(m,h,g,v);if(h instanceof Set)return d(m,h,g,v);const b=Object.keys(h);if(m==null||n.isPrimitive(m))return b.length===0;if(b.length===0)return!0;if(v!=null&&v.has(h))return v.get(h)===m;v==null||v.set(h,m);try{for(let w=0;w<b.length;w++){const S=b[w];if(!n.isPrimitive(m)&&!(S in m)||h[S]===void 0&&m[S]!==void 0||h[S]===null&&m[S]!==null||!g(m[S],h[S],S,m,h,v))return!1}return!0}finally{v==null||v.delete(h)}}function l(m,h,g,v){if(h.size===0)return!0;if(!(m instanceof Map))return!1;for(const[b,w]of h.entries()){const S=m.get(b);if(g(S,w,b,m,h,v)===!1)return!1}return!0}function u(m,h,g,v){if(h.length===0)return!0;if(!Array.isArray(m))return!1;const b=new Set;for(let w=0;w<h.length;w++){const S=h[w];let j=!1;for(let C=0;C<m.length;C++){if(b.has(C))continue;const E=m[C];let k=!1;if(g(E,S,w,m,h,v)&&(k=!0),k){b.add(C),j=!0;break}}if(!j)return!1}return!0}function d(m,h,g,v){return h.size===0?!0:m instanceof Set?u([...m],[...h],g,v):!1}e.isMatchWith=i,e.isSetMatch=d})(Bj)),Bj}var dL;function Pq(){return dL||(dL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pxe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})($j)),$j}var qj={},Vj={},Kj={},fL;function gxe(){return fL||(fL=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})(Kj)),Kj}var Yj={},hL;function kA(){return hL||(hL=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})(Yj)),Yj}var Xj={},mL;function Mq(){return mL||(mL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",l="[object Date]",u="[object Map]",d="[object Set]",m="[object Array]",h="[object Function]",g="[object ArrayBuffer]",v="[object Object]",b="[object Error]",w="[object DataView]",S="[object Uint8Array]",j="[object Uint8ClampedArray]",C="[object Uint16Array]",E="[object Uint32Array]",k="[object BigUint64Array]",O="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",M="[object BigInt64Array]",B="[object Float32Array]",I="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=m,e.bigInt64ArrayTag=M,e.bigUint64ArrayTag=k,e.booleanTag=i,e.dataViewTag=w,e.dateTag=l,e.errorTag=b,e.float32ArrayTag=B,e.float64ArrayTag=I,e.functionTag=h,e.int16ArrayTag=A,e.int32ArrayTag=T,e.int8ArrayTag=O,e.mapTag=u,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=d,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=C,e.uint32ArrayTag=E,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=j})(Xj)),Xj}var Gj={},pL;function vxe(){return pL||(pL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Gj)),Gj}var gL;function Rq(){return gL||(gL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gxe(),n=kA(),r=Mq(),i=Oq(),a=vxe();function o(m,h){return l(m,void 0,m,new Map,h)}function l(m,h,g,v=new Map,b=void 0){const w=b==null?void 0:b(m,h,g,v);if(w!==void 0)return w;if(i.isPrimitive(m))return m;if(v.has(m))return v.get(m);if(Array.isArray(m)){const S=new Array(m.length);v.set(m,S);for(let j=0;j<m.length;j++)S[j]=l(m[j],j,g,v,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;v.set(m,S);for(const[j,C]of m)S.set(j,l(C,j,g,v,b));return S}if(m instanceof Set){const S=new Set;v.set(m,S);for(const j of m)S.add(l(j,void 0,g,v,b));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(m))return m.subarray();if(a.isTypedArray(m)){const S=new(Object.getPrototypeOf(m)).constructor(m.length);v.set(m,S);for(let j=0;j<m.length;j++)S[j]=l(m[j],j,g,v,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 v.set(m,S),u(S,m,g,v,b),S}if(typeof File<"u"&&m instanceof File){const S=new File([m],m.name,{type:m.type});return v.set(m,S),u(S,m,g,v,b),S}if(typeof Blob<"u"&&m instanceof Blob){const S=new Blob([m],{type:m.type});return v.set(m,S),u(S,m,g,v,b),S}if(m instanceof Error){const S=structuredClone(m);return v.set(m,S),S.message=m.message,S.name=m.name,S.stack=m.stack,S.cause=m.cause,S.constructor=m.constructor,u(S,m,g,v,b),S}if(m instanceof Boolean){const S=new Boolean(m.valueOf());return v.set(m,S),u(S,m,g,v,b),S}if(m instanceof Number){const S=new Number(m.valueOf());return v.set(m,S),u(S,m,g,v,b),S}if(m instanceof String){const S=new String(m.valueOf());return v.set(m,S),u(S,m,g,v,b),S}if(typeof m=="object"&&d(m)){const S=Object.create(Object.getPrototypeOf(m));return v.set(m,S),u(S,m,g,v,b),S}return m}function u(m,h,g=m,v,b){const w=[...Object.keys(h),...t.getSymbols(h)];for(let S=0;S<w.length;S++){const j=w[S],C=Object.getOwnPropertyDescriptor(m,j);(C==null||C.writable)&&(m[j]=l(h[j],j,g,v,b))}}function d(m){switch(n.getTag(m)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=u})(Vj)),Vj}var vL;function yxe(){return vL||(vL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rq();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(qj)),qj}var yL;function xxe(){return yL||(yL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pq(),n=yxe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(zj)),zj}var Wj={},Qj={},Zj={},xL;function bxe(){return xL||(xL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rq(),n=kA(),r=Mq();function i(a,o){return t.cloneDeepWith(a,(l,u,d,m)=>{const h=o==null?void 0:o(l,u,d,m);if(h!==void 0)return h;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return m.set(a,g),t.copyProperties(g,a,d,m),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(Zj)),Zj}var bL;function wxe(){return bL||(bL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bxe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Qj)),Qj}var Jj={},eE={},wL;function Dq(){return wL||(wL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(eE)),eE}var tE={},SL;function Sxe(){return SL||(SL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kA();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(tE)),tE}var jL;function jxe(){return jL||(jL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wq(),n=Dq(),r=Sxe(),i=EA();function a(o,l){let u;if(Array.isArray(l)?u=l:typeof l=="string"&&t.isDeepKey(l)&&(o==null?void 0:o[l])==null?u=i.toPath(l):u=[l],u.length===0)return!1;let d=o;for(let m=0;m<u.length;m++){const h=u[m];if((d==null||!Object.hasOwn(d,h))&&!((Array.isArray(d)||r.isArguments(d))&&n.isIndex(h)&&h<d.length))return!1;d=d[h]}return!0}e.has=a})(Jj)),Jj}var EL;function Exe(){return EL||(EL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pq(),n=jA(),r=wxe(),i=_A(),a=jxe();function o(l,u){switch(typeof l){case"object":{Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break}case"number":{l=n.toKey(l);break}}return u=r.cloneDeep(u),function(d){const m=i.get(d,l);return m===void 0?a.has(d,l):u===void 0?m===void 0:t.isMatch(m,u)}}e.matchesProperty=o})(Wj)),Wj}var _L;function _xe(){return _L||(_L=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nq(),n=mxe(),r=xxe(),i=Exe();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})(Ij)),Ij}var CL;function Cxe(){return CL||(CL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cxe(),n=uxe(),r=Nq(),i=hxe(),a=_xe();function o(l,u=r.identity){return i.isArrayLikeObject(l)?t.uniqBy(Array.from(l),n.ary(a.iteratee(u),1)):[]}e.uniqBy=o})(kj)),kj}var nE,NL;function Nxe(){return NL||(NL=1,nE=Cxe().uniqBy),nE}var kxe=Nxe();const kL=Gi(kxe);function Iq(e,t,n){return t===!0?kL(e,n):typeof t=="function"?kL(e,t):e}var rE={exports:{}},iE={};/**
 * @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 AL;function Axe(){if(AL)return iE;AL=1;var e=Pf(),t=Mte();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,u=e.useDebugValue;return iE.useSyncExternalStoreWithSelector=function(d,m,h,g,v){var b=a(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=l(function(){function j(A){if(!C){if(C=!0,E=A,A=g(A),v!==void 0&&w.hasValue){var T=w.value;if(v(T,A))return k=T}return k=A}if(T=k,r(E,A))return T;var M=g(A);return v!==void 0&&v(T,M)?(E=A,T):(E=A,k=M)}var C=!1,E,k,O=h===void 0?null:h;return[function(){return j(m())},O===null?void 0:function(){return j(O())}]},[m,h,g,v]);var S=i(d,b[0],b[1]);return o(function(){w.hasValue=!0,w.value=S},[S]),u(S),S},iE}var OL;function Oxe(){return OL||(OL=1,rE.exports=Axe()),rE.exports}var Lq=Oxe();const Txe=Gi(Lq);var AA=y.createContext(null),Pxe=e=>e,nn=()=>{var e=y.useContext(AA);return e?e.store.dispatch:Pxe},Uy=()=>{},Mxe=()=>Uy,Rxe=(e,t)=>e===t;function Be(e){var t=y.useContext(AA),n=y.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Uy,[t,e]);return Lq.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Mxe,t?t.store.getState:Uy,t?t.store.getState:Uy,n,Rxe)}function Dxe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ixe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Lxe(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 TL=e=>Array.isArray(e)?e:[e];function zxe(e){const t=Array.isArray(e[0])?e[0]:e;return Lxe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function $xe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Bxe=class{constructor(e){this.value=e}deref(){return this.value}},Fxe=typeof WeakRef<"u"?WeakRef:Bxe,Uxe=0,PL=1;function cy(){return{s:Uxe,v:void 0,o:null,p:null}}function zq(e,t={}){let n=cy();const{resultEqualityCheck:r}=t;let i,a=0;function o(){var h;let l=n;const{length:u}=arguments;for(let g=0,v=u;g<v;g++){const b=arguments[g];if(typeof b=="function"||typeof b=="object"&&b!==null){let w=l.o;w===null&&(l.o=w=new WeakMap);const S=w.get(b);S===void 0?(l=cy(),w.set(b,l)):l=S}else{let w=l.p;w===null&&(l.p=w=new Map);const S=w.get(b);S===void 0?(l=cy(),w.set(b,l)):l=S}}const d=l;let m;if(l.s===PL)m=l.v;else if(m=e.apply(null,arguments),a++,r){const g=((h=i==null?void 0:i.deref)==null?void 0:h.call(i))??i;g!=null&&r(g,m)&&(m=g,a!==0&&a--),i=typeof m=="object"&&m!==null||typeof m=="function"?new Fxe(m):m}return d.s=PL,d.v=m,m}return o.clearCache=()=>{n=cy(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Hxe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,l,u={},d=i.pop();typeof d=="object"&&(u=d,d=i.pop()),Dxe(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...u},{memoize:h,memoizeOptions:g=[],argsMemoize:v=zq,argsMemoizeOptions:b=[]}=m,w=TL(g),S=TL(b),j=zxe(i),C=h(function(){return a++,d.apply(null,arguments)},...w),E=v(function(){o++;const O=$xe(j,arguments);return l=C.apply(null,O),l},...S);return Object.assign(E,{resultFunc:d,memoizedResultFunc:C,dependencies:j,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:h,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=Hxe(zq),qxe=Object.assign((e,t=le)=>{Ixe(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(a=>e[a]);return t(r,(...a)=>a.reduce((o,l,u)=>(o[n[u]]=l,o),{}))},{withTypes:()=>qxe}),aE={},oE={},sE={},ML;function Vxe(){return ML||(ML=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,i,a)=>{if(r!==i){const o=t(r),l=t(i);if(o===l&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?l-o:o-l}return 0};e.compareValues=n})(sE)),sE}var lE={},cE={},RL;function $q(){return RL||(RL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(cE)),cE}var DL;function Kxe(){return DL||(DL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$q(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(lE)),lE}var IL;function Yxe(){return IL||(IL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vxe(),n=Kxe(),r=EA();function i(a,o,l,u){if(a==null)return[];l=u?void 0:l,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(v=>String(v));const d=(v,b)=>{let w=v;for(let S=0;S<b.length&&w!=null;++S)w=w[b[S]];return w},m=(v,b)=>b==null||v==null?b:typeof v=="object"&&"key"in v?Object.hasOwn(b,v.key)?b[v.key]:d(b,v.path):typeof v=="function"?v(b):Array.isArray(v)?d(b,v):typeof b=="object"?b[v]:b,h=o.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:h.map(b=>m(b,v))})).slice().sort((v,b)=>{for(let w=0;w<h.length;w++){const S=t.compareValues(v.criteria[w],b.criteria[w],l[w]);if(S!==0)return S}return 0}).map(v=>v.original)}e.orderBy=i})(oE)),oE}var uE={},LL;function Xxe(){return LL||(LL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(l,u)=>{for(let d=0;d<l.length;d++){const m=l[d];Array.isArray(m)&&u<a?o(m,u+1):i.push(m)}};return o(n,0),i}e.flatten=t})(uE)),uE}var dE={},zL;function Bq(){return zL||(zL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dq(),n=kq(),r=Aq(),i=Tq();function a(o,l,u){return r.isObject(u)&&(typeof l=="number"&&n.isArrayLike(u)&&t.isIndex(l)&&l<u.length||typeof l=="string"&&l in u)?i.isEqualsSameValueZero(u[l],o):!1}e.isIterateeCall=a})(dE)),dE}var $L;function Gxe(){return $L||($L=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yxe(),n=Xxe(),r=Bq();function i(a,...o){const l=o.length;return l>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:l>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(aE)),aE}var fE,BL;function Wxe(){return BL||(BL=1,fE=Gxe().sortBy),fE}var Qxe=Wxe();const mb=Gi(Qxe);var Fq=e=>e.legend.settings,Zxe=e=>e.legend.size,Jxe=e=>e.legend.payload,e0e=le([Jxe,Fq],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?mb(r,n):r});function t0e(){return Be(e0e)}var uy=1;function Uq(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=y.useState({height:0,left:0,top:0,width:0}),r=y.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>uy||Math.abs(o.left-t.left)>uy||Math.abs(o.top-t.top)>uy||Math.abs(o.width-t.width)>uy)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Pr(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 n0e=typeof Symbol=="function"&&Symbol.observable||"@@observable",FL=n0e,hE=()=>Math.random().toString(36).substring(7).split("").join("."),r0e={INIT:`@@redux/INIT${hE()}`,REPLACE:`@@redux/REPLACE${hE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${hE()}`},_x=r0e;function OA(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 Hq(e,t,n){if(typeof e!="function")throw new Error(Pr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Pr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Pr(1));return n(Hq)(e,t)}let r=e,i=t,a=new Map,o=a,l=0,u=!1;function d(){o===a&&(o=new Map,a.forEach((S,j)=>{o.set(j,S)}))}function m(){if(u)throw new Error(Pr(3));return i}function h(S){if(typeof S!="function")throw new Error(Pr(4));if(u)throw new Error(Pr(5));let j=!0;d();const C=l++;return o.set(C,S),function(){if(j){if(u)throw new Error(Pr(6));j=!1,d(),o.delete(C),a=null}}}function g(S){if(!OA(S))throw new Error(Pr(7));if(typeof S.type>"u")throw new Error(Pr(8));if(typeof S.type!="string")throw new Error(Pr(17));if(u)throw new Error(Pr(9));try{u=!0,i=r(i,S)}finally{u=!1}return(a=o).forEach(C=>{C()}),S}function v(S){if(typeof S!="function")throw new Error(Pr(10));r=S,g({type:_x.REPLACE})}function b(){const S=h;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Pr(11));function C(){const k=j;k.next&&k.next(m())}return C(),{unsubscribe:S(C)}},[FL](){return this}}}return g({type:_x.INIT}),{dispatch:g,subscribe:h,getState:m,replaceReducer:v,[FL]:b}}function i0e(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:_x.INIT})>"u")throw new Error(Pr(12));if(typeof n(void 0,{type:_x.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pr(13))})}function qq(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{i0e(n)}catch(a){i=a}return function(o={},l){if(i)throw i;let u=!1;const d={};for(let m=0;m<r.length;m++){const h=r[m],g=n[h],v=o[h],b=g(v,l);if(typeof b>"u")throw l&&l.type,new Error(Pr(14));d[h]=b,u=u||b!==v}return u=u||r.length!==Object.keys(o).length,u?d:o}}function Cx(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function a0e(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Pr(15))};const o={getState:i.getState,dispatch:(u,...d)=>a(u,...d)},l=e.map(u=>u(o));return a=Cx(...l)(i.dispatch),{...i,dispatch:a}}}function Vq(e){return OA(e)&&"type"in e&&typeof e.type=="string"}var Kq=Symbol.for("immer-nothing"),UL=Symbol.for("immer-draftable"),ii=Symbol.for("immer-state");function Va(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Li=Object,gf=Li.getPrototypeOf,Nx="constructor",pb="prototype",wC="configurable",kx="enumerable",Hy="writable",Xm="value",js=e=>!!e&&!!e[ii];function eo(e){var t;return e?Yq(e)||vb(e)||!!e[UL]||!!((t=e[Nx])!=null&&t[UL])||yb(e)||xb(e):!1}var o0e=Li[pb][Nx].toString(),HL=new WeakMap;function Yq(e){if(!e||!TA(e))return!1;const t=gf(e);if(t===null||t===Li[pb])return!0;const n=Li.hasOwnProperty.call(t,Nx)&&t[Nx];if(n===Object)return!0;if(!zd(n))return!1;let r=HL.get(n);return r===void 0&&(r=Function.toString.call(n),HL.set(n,r)),r===o0e}function gb(e,t,n=!0){ig(e)===0?(n?Reflect.ownKeys(e):Li.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function ig(e){const t=e[ii];return t?t.type_:vb(e)?1:yb(e)?2:xb(e)?3:0}var qL=(e,t,n=ig(e))=>n===2?e.has(t):Li[pb].hasOwnProperty.call(e,t),SC=(e,t,n=ig(e))=>n===2?e.get(t):e[t],Ax=(e,t,n,r=ig(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function s0e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var vb=Array.isArray,yb=e=>e instanceof Map,xb=e=>e instanceof Set,TA=e=>typeof e=="object",zd=e=>typeof e=="function",mE=e=>typeof e=="boolean";function l0e(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var as=e=>e.copy_||e.base_,PA=e=>e.modified_?e.copy_:e.base_;function jC(e,t){if(yb(e))return new Map(e);if(xb(e))return new Set(e);if(vb(e))return Array[pb].slice.call(e);const n=Yq(e);if(t===!0||t==="class_only"&&!n){const r=Li.getOwnPropertyDescriptors(e);delete r[ii];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l[Hy]===!1&&(l[Hy]=!0,l[wC]=!0),(l.get||l.set)&&(r[o]={[wC]:!0,[Hy]:!0,[kx]:l[kx],[Xm]:e[o]})}return Li.create(gf(e),r)}else{const r=gf(e);if(r!==null&&n)return{...e};const i=Li.create(r);return Li.assign(i,e)}}function MA(e,t=!1){return bb(e)||js(e)||!eo(e)||(ig(e)>1&&Li.defineProperties(e,{set:dy,add:dy,clear:dy,delete:dy}),Li.freeze(e),t&&gb(e,(n,r)=>{MA(r,!0)},!1)),e}function c0e(){Va(2)}var dy={[Xm]:c0e};function bb(e){return e===null||!TA(e)?!0:Li.isFrozen(e)}var Ox="MapSet",EC="Patches",VL="ArrayMethods",Xq={};function wu(e){const t=Xq[e];return t||Va(0,e),t}var KL=e=>!!Xq[e],Gm,Gq=()=>Gm,u0e=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:KL(Ox)?wu(Ox):void 0,arrayMethodsPlugin_:KL(VL)?wu(VL):void 0});function YL(e,t){t&&(e.patchPlugin_=wu(EC),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _C(e){CC(e),e.drafts_.forEach(d0e),e.drafts_=null}function CC(e){e===Gm&&(Gm=e.parent_)}var XL=e=>Gm=u0e(Gm,e);function d0e(e){const t=e[ii];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function GL(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ii].modified_&&(_C(t),Va(4)),eo(e)&&(e=WL(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ii].base_,e,t)}else e=WL(t,n);return f0e(t,e,!0),_C(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Kq?e:void 0}function WL(e,t){if(bb(t))return t;const n=t[ii];if(!n)return Tx(t,e.handledSet_,e);if(!wb(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);Zq(n,e)}return n.copy_}function f0e(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&MA(t,n)}function Wq(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var wb=(e,t)=>e.scope_===t,h0e=[];function Qq(e,t,n,r){const i=as(e),a=e.type_;if(r!==void 0&&SC(i,r,a)===t){Ax(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;gb(i,(u,d)=>{if(js(d)){const m=l.get(d)||[];m.push(u),l.set(d,m)}})}const o=e.draftLocations_.get(t)??h0e;for(const l of o)Ax(i,l,n,a)}function m0e(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!wb(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=PA(a);Qq(e,a.draft_??a,o,n),Zq(a,i)})}function Zq(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_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}Wq(e)}}function p0e(e,t,n){const{scope_:r}=e;if(js(n)){const i=n[ii];wb(i,r)&&i.callbacks_.push(function(){qy(e);const o=PA(i);Qq(e,n,o,t)})}else eo(n)&&e.callbacks_.push(function(){const a=as(e);e.type_===3?a.has(n)&&Tx(n,r.handledSet_,r):SC(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Tx(SC(e.copy_,t,e.type_),r.handledSet_,r)})}function Tx(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||js(e)||t.has(e)||!eo(e)||bb(e)||(t.add(e),gb(e,(r,i)=>{if(js(i)){const a=i[ii];if(wb(a,n)){const o=PA(a);Ax(e,r,o,e.type_),Wq(a)}}else eo(i)&&Tx(i,t,n)})),e}function g0e(e,t){const n=vb(e),r={type_:n?1:0,scope_:t?t.scope_:Gq(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Px;n&&(i=[r],a=Wm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var Px={get(e,t){if(t===ii)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 i=as(e);if(!qL(i,t,e.type_))return v0e(e,i,t);const a=i[t];if(e.finalized_||!eo(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&l0e(t))return a;if(a===pE(e.base_,t)){qy(e);const o=e.type_===1?+t:t,l=kC(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in as(e)},ownKeys(e){return Reflect.ownKeys(as(e))},set(e,t,n){const r=Jq(as(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=pE(as(e),t),a=i==null?void 0:i[ii];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(s0e(n,i)&&(n!==void 0||qL(e.base_,t,e.type_)))return!0;qy(e),NC(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),p0e(e,t,n)),!0},deleteProperty(e,t){return qy(e),pE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),NC(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=as(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Hy]:!0,[wC]:e.type_!==1||t!=="length",[kx]:r[kx],[Xm]:n[t]}},defineProperty(){Va(11)},getPrototypeOf(e){return gf(e.base_)},setPrototypeOf(){Va(12)}},Wm={};for(let e in Px){let t=Px[e];Wm[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Wm.deleteProperty=function(e,t){return Wm.set.call(this,e,t,void 0)};Wm.set=function(e,t,n){return Px.set.call(this,e[0],t,n,e[0])};function pE(e,t){const n=e[ii];return(n?as(n):e)[t]}function v0e(e,t,n){var i;const r=Jq(t,n);return r?Xm in r?r[Xm]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Jq(e,t){if(!(t in e))return;let n=gf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=gf(n)}}function NC(e){e.modified_||(e.modified_=!0,e.parent_&&NC(e.parent_))}function qy(e){e.copy_||(e.assigned_=new Map,e.copy_=jC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var y0e=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(zd(n)&&!zd(r)){const o=r;r=n;const l=this;return function(d=o,...m){return l.produce(d,h=>r.call(this,h,...m))}}zd(r)||Va(6),i!==void 0&&!zd(i)&&Va(7);let a;if(eo(n)){const o=XL(this),l=kC(o,n,void 0);let u=!0;try{a=r(l),u=!1}finally{u?_C(o):CC(o)}return YL(o,i),GL(a,o)}else if(!n||!TA(n)){if(a=r(n),a===void 0&&(a=n),a===Kq&&(a=void 0),this.autoFreeze_&&MA(a,!0),i){const o=[],l=[];wu(EC).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else Va(1,n)},this.produceWithPatches=(n,r)=>{if(zd(n))return(l,...u)=>this.produceWithPatches(l,d=>n(d,...u));let i,a;return[this.produce(n,r,(l,u)=>{i=l,a=u}),i,a]},mE(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),mE(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),mE(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){eo(t)||Va(8),js(t)&&(t=ya(t));const n=XL(this),r=kC(n,t,void 0);return r[ii].isManual_=!0,CC(n),r}finishDraft(t,n){const r=t&&t[ii];(!r||!r.isManual_)&&Va(9);const{scope_:i}=r;return YL(i,n),GL(void 0,i)}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 a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=wu(EC).applyPatches_;return js(t)?i(t,n):this.produce(t,a=>i(a,n))}};function kC(e,t,n,r){const[i,a]=yb(t)?wu(Ox).proxyMap_(t,n):xb(t)?wu(Ox).proxySet_(t,n):g0e(t,n);return((n==null?void 0:n.scope_)??Gq()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?m0e(n,a,r):a.callbacks_.push(function(u){var m;(m=u.mapSetPlugin_)==null||m.fixSetContents(a);const{patchPlugin_:d}=u;a.modified_&&d&&d.generatePatches_(a,[],u)}),i}function ya(e){return js(e)||Va(10,e),e9(e)}function e9(e){if(!eo(e)||bb(e))return e;const t=e[ii];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=jC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=jC(e,!0);return gb(n,(i,a)=>{Ax(n,i,e9(a))},r),t&&(t.finalized_=!1),n}var x0e=new y0e,t9=x0e.produce;function n9(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var b0e=n9(),w0e=n9,S0e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cx:Cx.apply(null,arguments)};function Ki(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Fi(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Vq(r)&&r.type===e,n}var r9=class jm extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,jm.prototype)}static get[Symbol.species](){return jm}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new jm(...t[0].concat(this)):new jm(...t.concat(this))}};function QL(e){return eo(e)?t9(e,()=>{}):e}function fy(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function j0e(e){return typeof e=="boolean"}var E0e=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new r9;return n&&(j0e(n)?o.push(b0e):o.push(w0e(n.extraArgument))),o},i9="RTK_autoBatch",yn=()=>e=>({payload:e,meta:{[i9]:!0}}),ZL=e=>t=>{setTimeout(t,e)},a9=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const l=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ZL(10):e.type==="callback"?e.queueNotification:ZL(e.timeout),d=()=>{o=!1,a&&(a=!1,l.forEach(m=>m()))};return Object.assign({},r,{subscribe(m){const h=()=>i&&m(),g=r.subscribe(h);return l.add(m),()=>{g(),l.delete(m)}},dispatch(m){var h;try{return i=!((h=m==null?void 0:m.meta)!=null&&h[i9]),a=!i,a&&(o||(o=!0,u(d))),r.dispatch(m)}finally{i=!0}}})},_0e=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new r9(e);return r&&i.push(a9(typeof r=="object"?r:void 0)),i};function C0e(e){const t=E0e(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(OA(n))l=qq(n);else throw new Error(Fi(1));let u;typeof r=="function"?u=r(t):u=t();let d=Cx;i&&(d=S0e({trace:!1,...typeof i=="object"&&i}));const m=a0e(...u),h=_0e(m);let g=typeof o=="function"?o(h):h();const v=d(...g);return Hq(l,a,v)}function o9(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Fi(28));if(l in t)throw new Error(Fi(29));return t[l]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function N0e(e){return typeof e=="function"}function k0e(e,t){let[n,r,i]=o9(t),a;if(N0e(e))a=()=>QL(e());else{const l=QL(e);a=()=>l}function o(l=a(),u){let d=[n[u.type],...r.filter(({matcher:m})=>m(u)).map(({reducer:m})=>m)];return d.filter(m=>!!m).length===0&&(d=[i]),d.reduce((m,h)=>{if(h)if(js(m)){const v=h(m,u);return v===void 0?m:v}else{if(eo(m))return t9(m,g=>h(g,u));{const g=h(m,u);if(g===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return m},l)}return o.getInitialState=a,o}var A0e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",O0e=(e=21)=>{let t="",n=e;for(;n--;)t+=A0e[Math.random()*64|0];return t},T0e=Symbol.for("rtk-slice-createasyncthunk");function P0e(e,t){return`${e}/${t}`}function M0e({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[T0e];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Fi(11));const l=(typeof i.reducers=="function"?i.reducers(D0e()):i.reducers)||{},u=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(k,O){const A=typeof k=="string"?k:k.type;if(!A)throw new Error(Fi(12));if(A in d.sliceCaseReducersByType)throw new Error(Fi(13));return d.sliceCaseReducersByType[A]=O,m},addMatcher(k,O){return d.sliceMatchers.push({matcher:k,reducer:O}),m},exposeAction(k,O){return d.actionCreators[k]=O,m},exposeCaseReducer(k,O){return d.sliceCaseReducersByName[k]=O,m}};u.forEach(k=>{const O=l[k],A={reducerName:k,type:P0e(a,k),createNotation:typeof i.reducers=="function"};L0e(O)?$0e(A,O,m,t):I0e(A,O,m)});function h(){const[k={},O=[],A=void 0]=typeof i.extraReducers=="function"?o9(i.extraReducers):[i.extraReducers],T={...k,...d.sliceCaseReducersByType};return k0e(i.initialState,M=>{for(let B in T)M.addCase(B,T[B]);for(let B of d.sliceMatchers)M.addMatcher(B.matcher,B.reducer);for(let B of O)M.addMatcher(B.matcher,B.reducer);A&&M.addDefaultCase(A)})}const g=k=>k,v=new Map,b=new WeakMap;let w;function S(k,O){return w||(w=h()),w(k,O)}function j(){return w||(w=h()),w.getInitialState()}function C(k,O=!1){function A(M){let B=M[k];return typeof B>"u"&&O&&(B=fy(b,A,j)),B}function T(M=g){const B=fy(v,O,()=>new WeakMap);return fy(B,M,()=>{const I={};for(const[U,L]of Object.entries(i.selectors??{}))I[U]=R0e(L,M,()=>fy(b,M,j),O);return I})}return{reducerPath:k,getSelectors:T,get selectors(){return T(A)},selectSlice:A}}const E={name:a,reducer:S,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...C(o),injectInto(k,{reducerPath:O,...A}={}){const T=O??o;return k.inject({reducerPath:T,reducer:S},A),{...E,...C(T,!0)}}};return E}}function R0e(e,t,n,r){function i(a,...o){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...o)}return i.unwrapped=e,i}var Kr=M0e();function D0e(){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 I0e({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!z0e(r))throw new Error(Fi(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Ki(e,o):Ki(e))}function L0e(e){return e._reducerDefinitionType==="asyncThunk"}function z0e(e){return e._reducerDefinitionType==="reducerWithPrepare"}function $0e({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Fi(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:u,settled:d,options:m}=n,h=i(e,a,m);r.exposeAction(t,h),o&&r.addCase(h.fulfilled,o),l&&r.addCase(h.pending,l),u&&r.addCase(h.rejected,u),d&&r.addMatcher(h.settled,d),r.exposeCaseReducer(t,{fulfilled:o||hy,pending:l||hy,rejected:u||hy,settled:d||hy})}function hy(){}var B0e="task",s9="listener",l9="completed",RA="cancelled",F0e=`task-${RA}`,U0e=`task-${l9}`,AC=`${s9}-${RA}`,H0e=`${s9}-${l9}`,Sb=class{constructor(e){ES(this,"name","TaskAbortError");ES(this,"message");this.code=e,this.message=`${B0e} ${RA} (reason: ${e})`}},DA=(e,t)=>{if(typeof e!="function")throw new TypeError(Fi(32))},Mx=()=>{},c9=(e,t=Mx)=>(e.catch(t),e),u9=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),tu=e=>{if(e.aborted)throw new Sb(e.reason)};function d9(e,t){let n=Mx;return new Promise((r,i)=>{const a=()=>i(new Sb(e.reason));if(e.aborted){a();return}n=u9(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Mx})}var q0e=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Sb?"cancelled":"rejected",error:n}}finally{t==null||t()}},Rx=e=>t=>c9(d9(e,t).then(n=>(tu(e),n))),f9=e=>{const t=Rx(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Kd}=Object,JL={},jb="listenerMiddleware",V0e=(e,t)=>{const n=r=>u9(e,()=>r.abort(e.reason));return(r,i)=>{DA(r);const a=new AbortController;n(a);const o=q0e(async()=>{tu(e),tu(a.signal);const l=await r({pause:Rx(a.signal),delay:f9(a.signal),signal:a.signal});return tu(a.signal),l},()=>a.abort(U0e));return i!=null&&i.autoJoin&&t.push(o.catch(Mx)),{result:Rx(e)(o),cancel(){a.abort(F0e)}}}},K0e=(e,t)=>{const n=async(r,i)=>{tu(t);let a=()=>{};const l=[new Promise((u,d)=>{let m=e({predicate:r,effect:(h,g)=>{g.unsubscribe(),u([h,g.getState(),g.getOriginalState()])}});a=()=>{m(),d()}})];i!=null&&l.push(new Promise(u=>setTimeout(u,i,null)));try{const u=await d9(t,Promise.race(l));return tu(t),u}finally{a()}};return(r,i)=>c9(n(r,i))},h9=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Ki(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Fi(21));return DA(a),{predicate:i,type:t,effect:a}},m9=Kd(e=>{const{type:t,predicate:n,effect:r}=h9(e);return{id:O0e(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Fi(22))}}},{withTypes:()=>m9}),e3=(e,t)=>{const{type:n,effect:r,predicate:i}=h9(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},OC=e=>{e.pending.forEach(t=>{t.abort(AC)})},Y0e=(e,t)=>()=>{for(const n of t.keys())OC(n);e.clear()},t3=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},p9=Kd(Ki(`${jb}/add`),{withTypes:()=>p9}),X0e=Ki(`${jb}/removeAll`),g9=Kd(Ki(`${jb}/remove`),{withTypes:()=>g9}),G0e=(...e)=>{console.error(`${jb}/error`,...e)},ag=(e={})=>{const t=new Map,n=new Map,r=v=>{const b=n.get(v)??0;n.set(v,b+1)},i=v=>{const b=n.get(v)??1;b===1?n.delete(v):n.set(v,b-1)},{extra:a,onError:o=G0e}=e;DA(o);const l=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&OC(v)}),u=v=>{const b=e3(t,v)??m9(v);return l(b)};Kd(u,{withTypes:()=>u});const d=v=>{const b=e3(t,v);return b&&(b.unsubscribe(),v.cancelActive&&OC(b)),!!b};Kd(d,{withTypes:()=>d});const m=async(v,b,w,S)=>{const j=new AbortController,C=K0e(u,j.signal),E=[];try{v.pending.add(j),r(v),await Promise.resolve(v.effect(b,Kd({},w,{getOriginalState:S,condition:(k,O)=>C(k,O).then(Boolean),take:C,delay:f9(j.signal),pause:Rx(j.signal),extra:a,signal:j.signal,fork:V0e(j.signal,E),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((k,O,A)=>{k!==j&&(k.abort(AC),A.delete(k))})},cancel:()=>{j.abort(AC),v.pending.delete(j)},throwIfCancelled:()=>{tu(j.signal)}})))}catch(k){k instanceof Sb||t3(o,k,{raisedBy:"effect"})}finally{await Promise.all(E),j.abort(H0e),i(v),v.pending.delete(j)}},h=Y0e(t,n);return{middleware:v=>b=>w=>{if(!Vq(w))return b(w);if(p9.match(w))return u(w.payload);if(X0e.match(w)){h();return}if(g9.match(w))return d(w.payload);let S=v.getState();const j=()=>{if(S===JL)throw new Error(Fi(23));return S};let C;try{if(C=b(w),t.size>0){const E=v.getState(),k=Array.from(t.values());for(const O of k){let A=!1;try{A=O.predicate(w,E,S)}catch(T){A=!1,t3(o,T,{raisedBy:"predicate"})}A&&m(O,w,v,j)}}}finally{S=JL}return C},startListening:u,stopListening:d,clearListeners:h}};function Fi(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 W0e={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},v9=Kr({name:"chartLayout",initialState:W0e,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,i,a;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=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Q0e,setLayout:Z0e,setChartSize:J0e,setScale:ebe}=v9.actions,tbe=v9.reducer;function y9(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Pt(e){return Number.isFinite(e)}function Oo(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function n3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n3(Object(n),!0).forEach(function(r){nbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nbe(e,t,n){return(t=rbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rbe(e){var t=ibe(e,"string");return typeof t=="symbol"?t:t+""}function ibe(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 tn(e,t,n){return Nn(e)||Nn(t)?n:Ao(t)?xu(e,t,n):typeof t=="function"?t(e):n}var abe=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&a!=="center"&&Ie(e[a]))return $d($d({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&Ie(e[o]))return $d($d({},e),{},{[o]:e[o]+(i||0)})}return e},Ts=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",x9=(e,t,n,r)=>{if(r)return e.map(l=>l.coordinate);var i,a,o=e.map(l=>(l.coordinate===t&&(i=!0),l.coordinate===n&&(a=!0),l.coordinate));return i||o.push(t),a||o.push(n),o},b9=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:l,isCategorical:u,categoricalDomain:d,tickCount:m,ticks:h,niceTicks:g,axisType:v}=e;if(!o)return null;var b=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,w=i==="category"&&o.bandwidth?o.bandwidth()/b:0;if(w=v==="angleAxis"&&a&&a.length>=2?wr(a[0]-a[1])*2*w:w,h||g){var S=(h||g||[]).map((j,C)=>{var E=r?r.indexOf(j):j,k=o.map(E);return Pt(k)?{coordinate:k+w,value:j,offset:w,index:C}:null}).filter(xi);return S}return u&&d?d.map((j,C)=>{var E=o.map(j);return Pt(E)?{coordinate:E+w,value:j,index:C,offset:w}:null}).filter(xi):o.ticks&&m!=null?o.ticks(m).map((j,C)=>{var E=o.map(j);return Pt(E)?{coordinate:E+w,value:j,index:C,offset:w}:null}).filter(xi):o.domain().map((j,C)=>{var E=o.map(j);return Pt(E)?{coordinate:E+w,value:r?r[j]:j,index:C,offset:w}:null}).filter(xi)},obe=(e,t)=>{if(!t||t.length!==2||!Ie(t[0])||!Ie(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Ie(e[0])||e[0]<n)&&(i[0]=n),(!Ie(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},sbe=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 i=0;i<r;++i)for(var a=0,o=0,l=0;l<n;++l){var u=e[l],d=u==null?void 0:u[i];if(d!=null){var m=d[1],h=d[0],g=ko(m)?h:m;g>=0?(d[0]=a,a+=g,d[1]=a):(d[0]=o,o+=g,d[1]=o)}}}},lbe=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 i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var l=e[o],u=l==null?void 0:l[i];if(u!=null){var d=ko(u[1])?u[0]:u[1];d>=0?(u[0]=a,a+=d,u[1]=a):(u[0]=0,u[1]=0)}}}},cbe={sign:sbe,expand:Tye,none:yu,silhouette:Pye,wiggle:Mye,positive:lbe},ube=(e,t,n)=>{var r,i=(r=cbe[n])!==null&&r!==void 0?r:yu,a=Oye().keys(t).value((l,u)=>Number(tn(l,u,0))).order(xC).offset(i),o=a(e);return o.forEach((l,u)=>{l.forEach((d,m)=>{var h=tn(e[m],t[u],0);Array.isArray(h)&&h.length===2&&Ie(h[0])&&Ie(h[1])&&(d[0]=h[0],d[1]=h[1])})}),o};function dbe(e){return e==null?void 0:String(e)}function r3(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Nn(i[t.dataKey])){var l=jq(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var u=tn(i,Nn(o)?t.dataKey:o),d=t.scale.map(u);return Ie(d)?d:null}var i3=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type==="category")return n[o]?n[o].coordinate+r:null;var l=tn(a,t.dataKey,t.scale.domain()[o]);if(Nn(l))return null;var u=t.scale.map(l);return Ie(u)?u-i/2+r:null},fbe=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},hbe=e=>{var t=e.flat(2).filter(Ie);return[Math.min(...t),Math.max(...t)]},mbe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],pbe=(e,t,n)=>{if(e!=null)return mbe(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,l=o.reduce((u,d)=>{var m=y9(d,t,n),h=hbe(m);return!Pt(h[0])||!Pt(h[1])?u:[Math.min(u[0],h[0]),Math.max(u[1],h[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},a3=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,o3=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vf=(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 i=mb(t,m=>m.coordinate),a=1/0,o=1,l=i.length;o<l;o++){var u=i[o],d=i[o-1];a=Math.min(((u==null?void 0:u.coordinate)||0)-((d==null?void 0:d.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function s3(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return $d($d({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Xf(e,t){if(e)return String(e);if(typeof t=="string")return t}var gbe=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},vbe=(e,t)=>t==="centric"?e.angle:e.radius,Ps=e=>e.layout.width,Ms=e=>e.layout.height,ybe=e=>e.layout.scale,w9=e=>e.layout.margin,Eb=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),_b=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),S9="data-recharts-item-index",j9="data-recharts-item-id",og=60;function l3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function my(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l3(Object(n),!0).forEach(function(r){xbe(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 xbe(e,t,n){return(t=bbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bbe(e){var t=wbe(e,"string");return typeof t=="symbol"?t:t+""}function wbe(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 Sbe=e=>e.brush.height;function jbe(e){var t=_b(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:og;return n+i}return n},0)}function Ebe(e){var t=_b(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:og;return n+i}return n},0)}function _be(e){var t=Eb(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Cbe(e){var t=Eb(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var hr=le([Ps,Ms,w9,Sbe,jbe,Ebe,_be,Cbe,Fq,Zxe],(e,t,n,r,i,a,o,l,u,d)=>{var m={left:(n.left||0)+i,right:(n.right||0)+a},h={top:(n.top||0)+o,bottom:(n.bottom||0)+l},g=my(my({},h),m),v=g.bottom;g.bottom+=r,g=abe(g,u,d);var b=e-g.left-g.right,w=t-g.top-g.bottom;return my(my({brushBottom:v},g),{},{width:Math.max(b,0),height:Math.max(w,0)})}),Nbe=le(hr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),IA=le(Ps,Ms,(e,t)=>({x:0,y:0,width:e,height:t})),kbe=y.createContext(null),Yr=()=>y.useContext(kbe)!=null,Cb=e=>e.brush,Nb=le([Cb,hr,w9],(e,t,n)=>({height:e.height,x:Ie(e.x)?e.x:t.left,y:Ie(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Ie(e.width)?e.width:t.width})),gE={},vE={},yE={},c3;function Abe(){return c3||(c3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,l=null;const u=a!=null&&a.includes("leading"),d=a==null||a.includes("trailing"),m=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},h=()=>{d&&m(),w()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,h()},r)},b=()=>{g!==null&&(clearTimeout(g),g=null)},w=()=>{b(),o=void 0,l=null},S=()=>{m()},j=function(...C){if(i!=null&&i.aborted)return;o=this,l=C;const E=g==null;v(),u&&E&&m()};return j.schedule=v,j.cancel=w,j.flush=S,i==null||i.addEventListener("abort",w,{once:!0}),j}e.debounce=t})(yE)),yE}var u3;function Obe(){return u3||(u3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Abe();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:l=!0,maxWait:u}=a,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let m,h=null;const g=t.debounce(function(...w){m=r.apply(this,w),h=null},i,{edges:d}),v=function(...w){return u!=null&&(h===null&&(h=Date.now()),Date.now()-h>=u)?(m=r.apply(this,w),h=Date.now(),g.cancel(),g.schedule(),m):(g.apply(this,w),m)},b=()=>(g.flush(),m);return v.cancel=g.cancel,v.flush=b,v}e.debounce=n})(vE)),vE}var d3;function Tbe(){return d3||(d3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Obe();function n(r,i=0,a={}){const{leading:o=!0,trailing:l=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:l})}e.throttle=n})(gE)),gE}var xE,f3;function Pbe(){return f3||(f3=1,xE=Tbe().throttle),xE}var Mbe=Pbe();const Rbe=Gi(Mbe);var Dx=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];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 o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},wo={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},E9=(e,t,n)=>{var{width:r=wo.width,height:i=wo.height,aspect:a,maxHeight:o}=n,l=bu(r)?e:Number(r),u=bu(i)?t:Number(i);return a&&a>0&&(l?u=l/a:u&&(l=u*a),o&&u!=null&&u>o&&(u=o)),{calculatedWidth:l,calculatedHeight:u}},Dbe={width:0,height:0,overflow:"visible"},Ibe={width:0,overflowX:"visible"},Lbe={height:0,overflowY:"visible"},zbe={},$be=e=>{var{width:t,height:n}=e,r=bu(t),i=bu(n);return r&&i?Dbe:r?Ibe:i?Lbe:zbe};function Bbe(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=wo.width,a=wo.height):i===void 0?i=r&&r>0?void 0:wo.width:a===void 0&&(a=r&&r>0?void 0:wo.height),{width:i,height:a}}function TC(){return TC=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},TC.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(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function m3(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){Fbe(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 Fbe(e,t,n){return(t=Ube(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ube(e){var t=Hbe(e,"string");return typeof t=="symbol"?t:t+""}function Hbe(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 _9=y.createContext(wo.initialDimension);function qbe(e){return Oo(e.width)&&Oo(e.height)}function C9(e){var{children:t,width:n,height:r}=e,i=y.useMemo(()=>({width:n,height:r}),[n,r]);return qbe(i)?y.createElement(_9.Provider,{value:i},t):null}var LA=()=>y.useContext(_9),Vbe=y.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=wo.initialDimension,width:i,height:a,minWidth:o=wo.minWidth,minHeight:l,maxHeight:u,children:d,debounce:m=wo.debounce,id:h,className:g,onResize:v,style:b={}}=e,w=y.useRef(null),S=y.useRef();S.current=v,y.useImperativeHandle(t,()=>w.current);var[j,C]=y.useState({containerWidth:r.width,containerHeight:r.height}),E=y.useCallback((M,B)=>{C(I=>{var U=Math.round(M),L=Math.round(B);return I.containerWidth===U&&I.containerHeight===L?I:{containerWidth:U,containerHeight:L}})},[]);y.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return rc;var M=L=>{var G,z=L[0];if(z!=null){var{width:K,height:P}=z.contentRect;E(K,P),(G=S.current)===null||G===void 0||G.call(S,K,P)}};m>0&&(M=Rbe(M,m,{trailing:!0,leading:!1}));var B=new ResizeObserver(M),{width:I,height:U}=w.current.getBoundingClientRect();return E(I,U),B.observe(w.current),()=>{B.disconnect()}},[E,m]);var{containerWidth:k,containerHeight:O}=j;Dx(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:T}=E9(k,O,{width:i,height:a,aspect:n,maxHeight:u});return Dx(A!=null&&A>0||T!=null&&T>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.`,A,T,i,a,o,l,n),y.createElement("div",{id:h?"".concat(h):void 0,className:It("recharts-responsive-container",g),style:m3(m3({},b),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:u}),ref:w},y.createElement("div",{style:$be({width:i,height:a})},y.createElement(C9,{width:A,height:T},d)))}),zA=y.forwardRef((e,t)=>{var n=LA();if(Oo(n.width)&&Oo(n.height))return e.children;var{width:r,height:i}=Bbe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=E9(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ie(a)&&Ie(o)?y.createElement(C9,{width:a,height:o},e.children):y.createElement(Vbe,TC({},e,{width:r,height:i,ref:t}))});function $A(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 kb=()=>{var e,t=Yr(),n=Be(Nbe),r=Be(Nb),i=(e=Be(Cb))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},Kbe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},N9=()=>{var e;return(e=Be(hr))!==null&&e!==void 0?e:Kbe},BA=()=>Be(Ps),FA=()=>Be(Ms),Ybe=()=>Be(e=>e.layout.margin),Ft=e=>e.layout.layoutType,Iu=()=>Be(Ft),k9=()=>{var e=Iu();if(e==="horizontal"||e==="vertical")return e},A9=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Xbe=()=>{var e=Iu();return e!==void 0},sg=e=>{var t=nn(),n=Yr(),{width:r,height:i}=e,a=LA(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),y.useEffect(()=>{!n&&Oo(o)&&Oo(l)&&t(J0e({width:o,height:l}))},[t,n,o,l]),null},O9=Symbol.for("immer-nothing"),p3=Symbol.for("immer-draftable"),Yi=Symbol.for("immer-state");function Ka(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Qm=Object.getPrototypeOf;function yf(e){return!!e&&!!e[Yi]}function Su(e){var t;return e?T9(e)||Array.isArray(e)||!!e[p3]||!!((t=e.constructor)!=null&&t[p3])||lg(e)||Ob(e):!1}var Gbe=Object.prototype.constructor.toString(),g3=new WeakMap;function T9(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=g3.get(n);return r===void 0&&(r=Function.toString.call(n),g3.set(n,r)),r===Gbe}function Ix(e,t,n=!0){Ab(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Ab(e){const t=e[Yi];return t?t.type_:Array.isArray(e)?1:lg(e)?2:Ob(e)?3:0}function PC(e,t){return Ab(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function P9(e,t,n){const r=Ab(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Wbe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function lg(e){return e instanceof Map}function Ob(e){return e instanceof Set}function Lc(e){return e.copy_||e.base_}function MC(e,t){if(lg(e))return new Map(e);if(Ob(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=T9(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Yi];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(Qm(e),r)}else{const r=Qm(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function UA(e,t=!1){return Tb(e)||yf(e)||!Su(e)||(Ab(e)>1&&Object.defineProperties(e,{set:py,add:py,clear:py,delete:py}),Object.freeze(e),t&&Object.values(e).forEach(n=>UA(n,!0))),e}function Qbe(){Ka(2)}var py={value:Qbe};function Tb(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Zbe={};function ju(e){const t=Zbe[e];return t||Ka(0,e),t}var Zm;function M9(){return Zm}function Jbe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function v3(e,t){t&&(ju("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function RC(e){DC(e),e.drafts_.forEach(ewe),e.drafts_=null}function DC(e){e===Zm&&(Zm=e.parent_)}function y3(e){return Zm=Jbe(Zm,e)}function ewe(e){const t=e[Yi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function x3(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Yi].modified_&&(RC(t),Ka(4)),Su(e)&&(e=Lx(t,e),t.parent_||zx(t,e)),t.patches_&&ju("Patches").generateReplacementPatches_(n[Yi].base_,e,t.patches_,t.inversePatches_)):e=Lx(t,n,[]),RC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==O9?e:void 0}function Lx(e,t,n){if(Tb(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Yi];if(!i)return Ix(t,(a,o)=>b3(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return zx(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,l=!1;i.type_===3&&(o=new Set(a),a.clear(),l=!0),Ix(o,(u,d)=>b3(e,i,a,u,d,n,l),r),zx(e,a,!1),n&&e.patches_&&ju("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function b3(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=Tb(i);if(!(l&&!o)){if(yf(i)){const u=a&&t&&t.type_!==3&&!PC(t.assigned_,r)?a.concat(r):void 0,d=Lx(e,i,u);if(P9(n,r,d),yf(d))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Su(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;Lx(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(lg(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&zx(e,i)}}}function zx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&UA(t,n)}function twe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:M9(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=HA;n&&(i=[r],a=Jm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var HA={get(e,t){if(t===Yi)return e;const n=Lc(e);if(!PC(n,t))return nwe(e,n,t);const r=n[t];return e.finalized_||!Su(r)?r:r===bE(e.base_,t)?(wE(e),e.copy_[t]=LC(r,e)):r},has(e,t){return t in Lc(e)},ownKeys(e){return Reflect.ownKeys(Lc(e))},set(e,t,n){const r=R9(Lc(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=bE(Lc(e),t),a=i==null?void 0:i[Yi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Wbe(n,i)&&(n!==void 0||PC(e.base_,t)))return!0;wE(e),IC(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 bE(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,wE(e),IC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Lc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Ka(11)},getPrototypeOf(e){return Qm(e.base_)},setPrototypeOf(){Ka(12)}},Jm={};Ix(HA,(e,t)=>{Jm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Jm.deleteProperty=function(e,t){return Jm.set.call(this,e,t,void 0)};Jm.set=function(e,t,n){return HA.set.call(this,e[0],t,n,e[0])};function bE(e,t){const n=e[Yi];return(n?Lc(n):e)[t]}function nwe(e,t,n){var i;const r=R9(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function R9(e,t){if(!(t in e))return;let n=Qm(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Qm(n)}}function IC(e){e.modified_||(e.modified_=!0,e.parent_&&IC(e.parent_))}function wE(e){e.copy_||(e.copy_=MC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var rwe=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 a=n;n=t;const o=this;return function(u=a,...d){return o.produce(u,m=>n.call(this,m,...d))}}typeof n!="function"&&Ka(6),r!==void 0&&typeof r!="function"&&Ka(7);let i;if(Su(t)){const a=y3(this),o=LC(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?RC(a):DC(a)}return v3(a,r),x3(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===O9&&(i=void 0),this.autoFreeze_&&UA(i,!0),r){const a=[],o=[];ju("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Ka(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,u=>t(u,...l));let r,i;return[this.produce(t,n,(o,l)=>{r=o,i=l}),r,i]},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){Su(e)||Ka(8),yf(e)&&(e=iwe(e));const t=y3(this),n=LC(e,void 0);return n[Yi].isManual_=!0,DC(t),n}finishDraft(e,t){const n=e&&e[Yi];(!n||!n.isManual_)&&Ka(9);const{scope_:r}=n;return v3(r,t),x3(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 i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=ju("Patches").applyPatches_;return yf(e)?r(e,t):this.produce(e,i=>r(i,t))}};function LC(e,t){const n=lg(e)?ju("MapSet").proxyMap_(e,t):Ob(e)?ju("MapSet").proxySet_(e,t):twe(e,t);return(t?t.scope_:M9()).drafts_.push(n),n}function iwe(e){return yf(e)||Ka(10,e),D9(e)}function D9(e){if(!Su(e)||Tb(e))return e;const t=e[Yi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=MC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=MC(e,!0);return Ix(n,(i,a)=>{P9(n,i,D9(a))},r),t&&(t.finalized_=!1),n}var awe=new rwe;awe.produce;var owe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},I9=Kr({name:"legend",initialState:owe,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:yn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ya(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:yn()},removeLegendPayload:{reducer(e,t){var n=ya(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:yn()}}}),{setLegendSize:w3,setLegendSettings:swe,addLegendPayload:L9,replaceLegendPayload:z9,removeLegendPayload:$9}=I9.actions,lwe=I9.reducer,SE={exports:{}},jE={};/**
 * @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 S3;function cwe(){if(S3)return jE;S3=1;var e=Pf();function t(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return jE.useSyncExternalStoreWithSelector=function(u,d,m,h,g){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=o(function(){function S(O){if(!j){if(j=!0,C=O,O=h(O),g!==void 0&&b.hasValue){var A=b.value;if(g(A,O))return E=A}return E=O}if(A=E,n(C,O))return A;var T=h(O);return g!==void 0&&g(A,T)?(C=O,A):(C=O,E=T)}var j=!1,C,E,k=m===void 0?null:m;return[function(){return S(d())},k===null?void 0:function(){return S(k())}]},[d,m,h,g]);var w=r(u,v[0],v[1]);return a(function(){b.hasValue=!0,b.value=w},[w]),l(w),w},jE}var j3;function uwe(){return j3||(j3=1,SE.exports=cwe()),SE.exports}uwe();function dwe(e){e()}function fwe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){dwe(()=>{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 i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var E3={notify(){},get:()=>[]};function hwe(e,t){let n,r=E3,i=0,a=!1;function o(w){m();const S=r.subscribe(w);let j=!1;return()=>{j||(j=!0,S(),h())}}function l(){r.notify()}function u(){b.onStateChange&&b.onStateChange()}function d(){return a}function m(){i++,n||(n=e.subscribe(u),r=fwe())}function h(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=E3)}function g(){a||(a=!0,m())}function v(){a&&(a=!1,h())}const b={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:u,isSubscribed:d,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return b}var mwe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pwe=mwe(),gwe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",vwe=gwe(),ywe=()=>pwe||vwe?y.useLayoutEffect:y.useEffect,xwe=ywe();function _3(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function bwe(e,t){if(_3(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 i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!_3(e[n[i]],t[n[i]]))return!1;return!0}var EE=Symbol.for("react-redux-context"),_E=typeof globalThis<"u"?globalThis:{};function wwe(){if(!y.createContext)return{};const e=_E[EE]??(_E[EE]=new Map);let t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var Swe=wwe();function jwe(e){const{children:t,context:n,serverState:r,store:i}=e,a=y.useMemo(()=>{const u=hwe(i);return{store:i,subscription:u,getServerState:r?()=>r:void 0}},[i,r]),o=y.useMemo(()=>i.getState(),[i]);xwe(()=>{const{subscription:u}=a;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),o!==i.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[a,o]);const l=n||Swe;return y.createElement(l.Provider,{value:a},t)}var Ewe=jwe,_we=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Cwe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Gf(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(_we.has(r)){if(e[r]==null&&t[r]==null)continue;if(!bwe(e[r],t[r]))return!1}else if(!Cwe(e[r],t[r]))return!1;return!0}var Nwe=["contextPayload"];function zC(){return zC=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},zC.apply(null,arguments)}function C3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xf(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){kwe(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 kwe(e,t,n){return(t=Awe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Awe(e){var t=Owe(e,"string");return typeof t=="symbol"?t:t+""}function Owe(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 Twe(e,t){if(e==null)return{};var n,r,i=Pwe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pwe(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 Mwe(e){return e.value}function Rwe(e){var{contextPayload:t}=e,n=Twe(e,Nwe),r=Iq(t,e.payloadUniqBy,Mwe),i=xf(xf({},n),{},{payload:r});return y.isValidElement(e.content)?y.cloneElement(e.content,i):typeof e.content=="function"?y.createElement(e.content,i):y.createElement(lxe,i)}function Dwe(e,t,n,r,i,a){var{layout:o,align:l,verticalAlign:u}=t,d,m;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l==="center"&&o==="vertical"?d={left:((r||0)-a.width)/2}:d=l==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u==="middle"?m={top:((i||0)-a.height)/2}:m=u==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),xf(xf({},d),m)}function Iwe(e){var t=nn();return y.useEffect(()=>{t(swe(e))},[t,e]),null}function Lwe(e){var t=nn();return y.useEffect(()=>(t(w3(e)),()=>{t(w3({width:0,height:0}))}),[t,e]),null}function zwe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var $we={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Bwe(e){var t=tr(e,$we),n=t0e(),r=eye(),i=Ybe(),{width:a,height:o,wrapperStyle:l,portal:u}=t,[d,m]=Uq([n]),h=BA(),g=FA();if(h==null||g==null)return null;var v=h-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),b=zwe(t.layout,o,a,v),w=u?l:xf(xf({position:"absolute",width:(b==null?void 0:b.width)||a||"auto",height:(b==null?void 0:b.height)||o||"auto"},Dwe(l,t,i,h,g,d)),l),S=u??r;if(S==null||n==null)return null;var j=y.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:m},y.createElement(Iwe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!u&&y.createElement(Lwe,{width:d.width,height:d.height}),y.createElement(Rwe,zC({},t,b,{margin:i,chartWidth:h,chartHeight:g,contextPayload:n})));return Ql.createPortal(j,S)}var B9=y.memo(Bwe,Gf);B9.displayName="Legend";function $C(){return $C=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},$C.apply(null,arguments)}function N3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N3(Object(n),!0).forEach(function(r){Fwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fwe(e,t,n){return(t=Uwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uwe(e){var t=Hwe(e,"string");return typeof t=="symbol"?t:t+""}function Hwe(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 qwe(e){return Array.isArray(e)&&Ao(e[0])&&Ao(e[1])?e.join(" ~ "):e}var Nd={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 Vwe(e,t){return t==null?e:mb(e,t)}var Kwe=e=>{var{separator:t=Nd.separator,contentStyle:n,itemStyle:r,labelStyle:i=Nd.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:u,labelClassName:d,label:m,labelFormatter:h,accessibilityLayer:g=Nd.accessibilityLayer}=e,v=()=>{if(a&&a.length){var O={padding:0,margin:0},A=Vwe(a,l),T=A.map((M,B)=>{if(M.type==="none")return null;var I=M.formatter||o||qwe,{value:U,name:L}=M,G=U,z=L;if(I){var K=I(U,L,M,B,a);if(Array.isArray(K))[G,z]=K;else if(K!=null)G=K;else return null}var P=sm(sm({},Nd.itemStyle),{},{color:M.color||Nd.itemStyle.color},r);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(B),style:P},Ao(z)?y.createElement("span",{className:"recharts-tooltip-item-name"},z):null,Ao(z)?y.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,y.createElement("span",{className:"recharts-tooltip-item-value"},G),y.createElement("span",{className:"recharts-tooltip-item-unit"},M.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:O},T)}return null},b=sm(sm({},Nd.contentStyle),n),w=sm({margin:0},i),S=!Nn(m),j=S?m:"",C=It("recharts-default-tooltip",u),E=It("recharts-tooltip-label",d);S&&h&&a!==void 0&&a!==null&&(j=h(m,a));var k=g?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",$C({className:C,style:b},k),y.createElement("p",{className:E,style:w},y.isValidElement(j)?j:"".concat(j)),v())},lm="recharts-tooltip-wrapper",Ywe={visibility:"hidden"};function Xwe(e){var{coordinate:t,translateX:n,translateY:r}=e;return It(lm,{["".concat(lm,"-right")]:Ie(n)&&t&&Ie(t.x)&&n>=t.x,["".concat(lm,"-left")]:Ie(n)&&t&&Ie(t.x)&&n<t.x,["".concat(lm,"-bottom")]:Ie(r)&&t&&Ie(t.y)&&r>=t.y,["".concat(lm,"-top")]:Ie(r)&&t&&Ie(t.y)&&r<t.y})}function k3(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:l,viewBox:u,viewBoxDimension:d}=e;if(a&&Ie(a[r]))return a[r];var m=n[r]-l-(i>0?i:0),h=n[r]+i;if(t[r])return o[r]?m:h;var g=u[r];if(g==null)return 0;if(o[r]){var v=m,b=g;return v<b?Math.max(h,g):Math.max(m,g)}if(d==null)return 0;var w=h+l,S=g+d;return w>S?Math.max(m,g):Math.max(h,g)}function Gwe(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 Wwe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:l,useTranslate3d:u,viewBox:d}=e,m,h,g;return l.height>0&&l.width>0&&n?(h=k3({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),g=k3({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),m=Gwe({translateX:h,translateY:g,useTranslate3d:u})):m=Ywe,{cssProperties:m,cssClasses:Xwe({translateX:h,translateY:g,coordinate:n})}}var Qwe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),cg={isSsr:Qwe()};function F9(){var[e,t]=y.useState(()=>cg.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return y.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 A3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kd(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){Zwe(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 Zwe(e,t,n){return(t=Jwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jwe(e){var t=e1e(e,"string");return typeof t=="symbol"?t:t+""}function e1e(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 t1e(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function n1e(e){var t,n,r,i,a,o,l=F9(),[u,d]=y.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));y.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,j,C,E;d({dismissed:!0,dismissedAtCoordinate:{x:(S=(j=e.coordinate)===null||j===void 0?void 0:j.x)!==null&&S!==void 0?S:0,y:(C=(E=e.coordinate)===null||E===void 0?void 0:E.y)!==null&&C!==void 0?C:0}})}};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),u.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==u.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==u.dismissedAtCoordinate.y)&&d(kd(kd({},u),{},{dismissed:!1}));var{cssClasses:m,cssProperties:h}=Wwe({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}),g=e.hasPortalFromProps?{}:kd(kd({transition:t1e({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},h),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=kd(kd({},g),{},{visibility:!u.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:v,ref:e.innerRef},e.children)}var r1e=y.memo(n1e),U9=()=>{var e;return(e=Be(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function BC(){return BC=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},BC.apply(null,arguments)}function O3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function T3(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){i1e(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 i1e(e,t,n){return(t=a1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a1e(e){var t=o1e(e,"string");return typeof t=="symbol"?t:t+""}function o1e(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 P3={curveBasisClosed:xye,curveBasisOpen:bye,curveBasis:yye,curveBumpX:iye,curveBumpY:aye,curveLinearClosed:wye,curveLinear:fb,curveMonotoneX:Sye,curveMonotoneY:jye,curveNatural:Eye,curveStep:_ye,curveStepAfter:Nye,curveStepBefore:Cye},$x=e=>Pt(e.x)&&Pt(e.y),M3=e=>e.base!=null&&$x(e.base)&&$x(e),cm=e=>e.x,um=e=>e.y,s1e=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ng(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=P3["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return P3[n]||fb},R3={connectNulls:!1,type:"linear"},l1e=e=>{var{type:t=R3.type,points:n=[],baseLine:r,layout:i,connectNulls:a=R3.connectNulls}=e,o=s1e(t,i),l=a?n.filter($x):n;if(Array.isArray(r)){var u,d=n.map((b,w)=>T3(T3({},b),{},{base:r[w]}));i==="vertical"?u=ly().y(um).x1(cm).x0(b=>b.base.x):u=ly().x(cm).y1(um).y0(b=>b.base.y);var m=u.defined(M3).curve(o),h=a?d.filter(M3):d;return m(h)}var g;i==="vertical"&&Ie(r)?g=ly().y(um).x1(cm).x0(r):Ie(r)?g=ly().x(cm).y1(um).y0(r):g=uq().x(cm).y(um);var v=g.defined($x).curve(o);return v(l)},qA=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Iu();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?l1e(o):r;return y.createElement("path",BC({},Vi(e),NA(e),{className:It("recharts-curve",t),d:l===null?void 0:l,ref:i}))},c1e=["x","y","top","left","width","height","className"];function FC(){return FC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FC.apply(null,arguments)}function D3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function u1e(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){d1e(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 d1e(e,t,n){return(t=f1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f1e(e){var t=h1e(e,"string");return typeof t=="symbol"?t:t+""}function h1e(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 m1e(e,t){if(e==null)return{};var n,r,i=p1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}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 g1e=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),v1e=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,u=m1e(e,c1e),d=u1e({x:t,y:n,top:r,left:i,width:a,height:o},u);return!Ie(t)||!Ie(n)||!Ie(a)||!Ie(o)||!Ie(r)||!Ie(i)?null:y.createElement("path",FC({},ri(d),{className:It("recharts-cross",l),d:g1e(t,n,a,o,r,i)}))};function y1e(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function I3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function L3(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){x1e(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 x1e(e,t,n){return(t=b1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b1e(e){var t=w1e(e,"string");return typeof t=="symbol"?t:t+""}function w1e(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 S1e=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),H9=(e,t,n)=>e.map(r=>"".concat(S1e(r)," ").concat(t,"ms ").concat(n)).join(","),j1e=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),ep=(e,t)=>Object.keys(t).reduce((n,r)=>L3(L3({},n),{},{[r]:e(r,t[r])}),{});function z3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?z3(Object(n),!0).forEach(function(r){E1e(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 E1e(e,t,n){return(t=_1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _1e(e){var t=C1e(e,"string");return typeof t=="symbol"?t:t+""}function C1e(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 Bx=(e,t,n)=>e+(t-e)*n,UC=e=>{var{from:t,to:n}=e;return t!==n},q9=(e,t,n)=>{var r=ep((i,a)=>{if(UC(a)){var[o,l]=e(a.from,a.to,a.velocity);return cr(cr({},a),{},{from:o,velocity:l})}return a},t);return n<1?ep((i,a)=>UC(a)&&r[i]!=null?cr(cr({},a),{},{velocity:Bx(a.velocity,r[i].velocity,n),from:Bx(a.from,r[i].from,n)}):a,t):q9(e,r,n-1)};function N1e(e,t,n,r,i,a){var o,l=r.reduce((g,v)=>cr(cr({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),u=()=>ep((g,v)=>v.from,l),d=()=>!Object.values(l).filter(UC).length,m=null,h=g=>{o||(o=g);var v=g-o,b=v/n.dt;l=q9(n,l,b),i(cr(cr(cr({},e),t),u())),o=g,d()||(m=a.setTimeout(h))};return()=>(m=a.setTimeout(h),()=>{var g;(g=m)===null||g===void 0||g()})}function k1e(e,t,n,r,i,a,o){var l=null,u=i.reduce((h,g)=>{var v=e[g],b=t[g];return v==null||b==null?h:cr(cr({},h),{},{[g]:[v,b]})},{}),d,m=h=>{d||(d=h);var g=(h-d)/r,v=ep((w,S)=>Bx(...S,n(g)),u);if(a(cr(cr(cr({},e),t),v)),g<1)l=o.setTimeout(m);else{var b=ep((w,S)=>Bx(...S,n(1)),u);a(cr(cr(cr({},e),t),b))}};return()=>(l=o.setTimeout(m),()=>{var h;(h=l)===null||h===void 0||h()})}const A1e=(e,t,n,r,i,a)=>{var o=j1e(e,t);return n==null?()=>(i(cr(cr({},e),t)),()=>{}):n.isStepper===!0?N1e(e,t,n,o,i,a):k1e(e,t,n,r,o,i,a)};var Fx=1e-4,V9=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],K9=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),$3=(e,t)=>n=>{var r=V9(e,t);return K9(r,n)},O1e=(e,t)=>n=>{var r=V9(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return K9(i,n)},T1e=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 i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},P1e=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 i=T1e(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},M1e=(e,t,n,r)=>{var i=$3(e,n),a=$3(t,r),o=O1e(e,n),l=d=>d>1?1:d<0?0:d,u=d=>{for(var m=d>1?1:d,h=m,g=0;g<8;++g){var v=i(h)-m,b=o(h);if(Math.abs(v-m)<Fx||b<Fx)return a(h);h=l(h-v/b)}return a(h)};return u.isStepper=!1,u},B3=function(){return M1e(...P1e(...arguments))},R1e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,l,u)=>{var d=-(o-l)*n,m=u*r,h=u+(d-m)*i/1e3,g=u*i/1e3+o;return Math.abs(g-l)<Fx&&Math.abs(h)<Fx?[l,0]:[g,h]};return a.isStepper=!0,a.dt=i,a},D1e=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return B3(e);case"spring":return R1e();default:if(e.split("(")[0]==="cubic-bezier")return B3(e)}return typeof e=="function"?e:null};function I1e(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,[u,...d]=l;if(typeof u=="number"){i=e.setTimeout(a.bind(null,d),u);return}a(u),i=e.setTimeout(a.bind(null,d));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class L1e{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function z1e(){return I1e(new L1e)}var $1e=y.createContext(z1e);function B1e(e,t){var n=y.useContext($1e);return y.useMemo(()=>t??n(e),[e,t,n])}var F1e={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},F3={t:0},CE={t:1};function ug(e){var t=tr(e,F1e),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:u,children:d}=t,m=F9(),h=n==="auto"?!cg.isSsr&&!m:n,g=B1e(t.animationId,t.animationManager),[v,b]=y.useState(h?F3:CE),w=y.useRef(null);return y.useEffect(()=>{h||b(CE)},[h]),y.useEffect(()=>{if(!h||!r)return rc;var S=A1e(F3,CE,D1e(a),i,b,g.getTimeoutController()),j=()=>{w.current=S()};return g.start([u,o,j,i,l]),()=>{g.stop(),w.current&&w.current(),l()}},[h,r,i,a,o,u,l,g]),d(v.t)}function dg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=y.useRef(Ym(t)),r=y.useRef(e);return r.current!==e&&(n.current=Ym(t),r.current=e),n.current}var U1e=["radius"],H1e=["radius"],U3,H3,q3,V3,K3,Y3,X3,G3,W3,Q3;function Z3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function J3(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){q1e(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 q1e(e,t,n){return(t=V1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V1e(e){var t=K1e(e,"string");return typeof t=="symbol"?t:t+""}function K1e(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 Ux(){return Ux=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},Ux.apply(null,arguments)}function e4(e,t){if(e==null)return{};var n,r,i=Y1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Y1e(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 uo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var t4=(e,t,n,r,i)=>{var a=zl(n),o=zl(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),u=o>=0?1:-1,d=a>=0?1:-1,m=o>=0&&a>=0||o<0&&a<0?1:0,h;if(l>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,b=4;v<b;v++){var w,S=(w=i[v])!==null&&w!==void 0?w:0;g[v]=S>l?l:S}h=zn(U3||(U3=uo(["M",",",""])),e,t+u*g[0]),g[0]>0&&(h+=zn(H3||(H3=uo(["A ",",",",0,0,",",",",",""])),g[0],g[0],m,e+d*g[0],t)),h+=zn(q3||(q3=uo(["L ",",",""])),e+n-d*g[1],t),g[1]>0&&(h+=zn(V3||(V3=uo(["A ",",",",0,0,",`,
        `,",",""])),g[1],g[1],m,e+n,t+u*g[1])),h+=zn(K3||(K3=uo(["L ",",",""])),e+n,t+r-u*g[2]),g[2]>0&&(h+=zn(Y3||(Y3=uo(["A ",",",",0,0,",`,
        `,",",""])),g[2],g[2],m,e+n-d*g[2],t+r)),h+=zn(X3||(X3=uo(["L ",",",""])),e+d*g[3],t+r),g[3]>0&&(h+=zn(G3||(G3=uo(["A ",",",",0,0,",`,
        `,",",""])),g[3],g[3],m,e,t+r-u*g[3])),h+="Z"}else if(l>0&&i===+i&&i>0){var j=Math.min(l,i);h=zn(W3||(W3=uo(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+u*j,j,j,m,e+d*j,t,e+n-d*j,t,j,j,m,e+n,t+u*j,e+n,t+r-u*j,j,j,m,e+n-d*j,t+r,e+d*j,t+r,j,j,m,e,t+r-u*j)}else h=zn(Q3||(Q3=uo(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return h},n4={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Y9=e=>{var t=tr(e,n4),n=y.useRef(null),[r,i]=y.useState(-1);y.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var H=n.current.getTotalLength();H&&i(H)}catch{}},[]);var{x:a,y:o,width:l,height:u,radius:d,className:m}=t,{animationEasing:h,animationDuration:g,animationBegin:v,isAnimationActive:b,isUpdateAnimationActive:w}=t,S=y.useRef(l),j=y.useRef(u),C=y.useRef(a),E=y.useRef(o),k=y.useMemo(()=>({x:a,y:o,width:l,height:u,radius:d}),[a,o,l,u,d]),O=dg(k,"rectangle-");if(a!==+a||o!==+o||l!==+l||u!==+u||l===0||u===0)return null;var A=It("recharts-rectangle",m);if(!w){var T=ri(t),{radius:M}=T,B=e4(T,U1e);return y.createElement("path",Ux({},B,{x:zl(a),y:zl(o),width:zl(l),height:zl(u),radius:typeof d=="number"?d:void 0,className:A,d:t4(a,o,l,u,d)}))}var I=S.current,U=j.current,L=C.current,G=E.current,z="0px ".concat(r===-1?1:r,"px"),K="".concat(r,"px ").concat(r,"px"),P=H9(["strokeDasharray"],g,typeof h=="string"?h:n4.animationEasing);return y.createElement(ug,{animationId:O,key:O,canBegin:r>0,duration:g,easing:h,isActive:w,begin:v},H=>{var Y=Sn(I,l,H),V=Sn(U,u,H),D=Sn(L,a,H),q=Sn(G,o,H);n.current&&(S.current=Y,j.current=V,C.current=D,E.current=q);var $;b?H>0?$={transition:P,strokeDasharray:K}:$={strokeDasharray:z}:$={strokeDasharray:K};var F=ri(t),{radius:Q}=F,Z=e4(F,H1e);return y.createElement("path",Ux({},Z,{radius:typeof d=="number"?d:void 0,className:A,d:t4(D,q,Y,V,d),ref:n,style:J3(J3({},$),t.style)}))})};function r4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r4(Object(n),!0).forEach(function(r){X1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function X1e(e,t,n){return(t=G1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G1e(e){var t=W1e(e,"string");return typeof t=="symbol"?t:t+""}function W1e(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 Hx=Math.PI/180,Q1e=e=>e*180/Math.PI,Zn=(e,t,n,r)=>({x:e+Math.cos(-Hx*r)*n,y:t+Math.sin(-Hx*r)*n}),X9=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},Z1e=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},J1e=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Z1e({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var l=(n-i)/o,u=Math.acos(l);return r>a&&(u=2*Math.PI-u),{radius:o,angle:Q1e(u),angleInRadian:u}},eSe=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},tSe=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},nSe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=J1e({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:u,endAngle:d}=eSe(t),m=a,h;if(u<=d){for(;m>d;)m-=360;for(;m<u;)m+=360;h=m>=u&&m<=d}else{for(;m>u;)m-=360;for(;m<d;)m+=360;h=m>=d&&m<=u}return h?i4(i4({},t),{},{radius:i,angle:tSe(m,t)}):null};function G9(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Zn(t,n,r,i),l=Zn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var a4,o4,s4,l4,c4,u4,d4;function HC(){return HC=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},HC.apply(null,arguments)}function Fc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rSe=(e,t)=>{var n=wr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},gy=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:l,cornerIsExternal:u}=e,d=l*(o?1:-1)+r,m=Math.asin(l/d)/Hx,h=u?i:i+a*m,g=Zn(t,n,d,h),v=Zn(t,n,r,h),b=u?i-a*m:i,w=Zn(t,n,d*Math.cos(m*Hx),b);return{center:g,circleTangency:v,lineTangency:w,theta:m}},W9=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=rSe(a,o),u=a+l,d=Zn(t,n,i,a),m=Zn(t,n,i,u),h=zn(a4||(a4=Fc(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),d.x,d.y,i,i,+(Math.abs(l)>180),+(a>u),m.x,m.y);if(r>0){var g=Zn(t,n,r,a),v=Zn(t,n,r,u);h+=zn(o4||(o4=Fc(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),v.x,v.y,r,r,+(Math.abs(l)>180),+(a<=u),g.x,g.y)}else h+=zn(s4||(s4=Fc(["L ",","," Z"])),t,n);return h},iSe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:u,endAngle:d}=e,m=wr(d-u),{circleTangency:h,lineTangency:g,theta:v}=gy({cx:t,cy:n,radius:i,angle:u,sign:m,cornerRadius:a,cornerIsExternal:l}),{circleTangency:b,lineTangency:w,theta:S}=gy({cx:t,cy:n,radius:i,angle:d,sign:-m,cornerRadius:a,cornerIsExternal:l}),j=l?Math.abs(u-d):Math.abs(u-d)-v-S;if(j<0)return o?zn(l4||(l4=Fc(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),g.x,g.y,a,a,a*2,a,a,-a*2):W9({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:u,endAngle:d});var C=zn(c4||(c4=Fc(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),g.x,g.y,a,a,+(m<0),h.x,h.y,i,i,+(j>180),+(m<0),b.x,b.y,a,a,+(m<0),w.x,w.y);if(r>0){var{circleTangency:E,lineTangency:k,theta:O}=gy({cx:t,cy:n,radius:r,angle:u,sign:m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:A,lineTangency:T,theta:M}=gy({cx:t,cy:n,radius:r,angle:d,sign:-m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),B=l?Math.abs(u-d):Math.abs(u-d)-O-M;if(B<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=zn(u4||(u4=Fc(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(m<0),A.x,A.y,r,r,+(B>180),+(m>0),E.x,E.y,a,a,+(m<0),k.x,k.y)}else C+=zn(d4||(d4=Fc(["L",",","Z"])),t,n);return C},aSe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Q9=e=>{var t=tr(e,aSe),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:m,className:h}=t;if(a<i||d===m)return null;var g=It("recharts-sector",h),v=a-i,b=Hr(o,v,0,!0),w;return b>0&&Math.abs(d-m)<360?w=iSe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(b,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:m}):w=W9({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:d,endAngle:m}),y.createElement("path",HC({},ri(t),{className:g,d:w}))};function oSe(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(_q(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,u=Zn(r,i,a,l),d=Zn(r,i,o,l);return[{x:u.x,y:u.y},{x:d.x,y:d.y}]}return G9(t)}}var NE={},kE={},AE={},f4;function sSe(){return f4||(f4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$q();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(AE)),AE}var h4;function lSe(){return h4||(h4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sSe();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})(kE)),kE}var m4;function cSe(){return m4||(m4=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bq(),n=lSe();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const l=Math.max(Math.ceil((a-i)/(o||1)),0),u=new Array(l);for(let d=0;d<l;d++)u[d]=i,i+=o;return u}e.range=r})(NE)),NE}var OE,p4;function uSe(){return p4||(p4=1,OE=cSe().range),OE}var dSe=uSe();const Z9=Gi(dSe);var Rs=e=>e.chartData,Pb=le([Rs],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),VA=(e,t,n,r)=>r?Pb(e):Rs(e),fSe=(e,t,n)=>n?Pb(e):Rs(e);function _o(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Pt(t)&&Pt(n))return!0}return!1}function g4(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function J9(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Pt(n))i=n;else if(typeof n=="function")return;if(Pt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(_o(o))return o}}function hSe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(_o(r))return g4(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,l;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Ie(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&a3.test(i)){var u=a3.exec(i);if(u==null||u[1]==null||t==null)o=void 0;else{var d=+u[1];o=t[0]-d}}else o=t==null?void 0:t[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(Ie(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&o3.test(a)){var m=o3.exec(a);if(m==null||m[1]==null||t==null)l=void 0;else{var h=+m[1];l=t[1]+h}}else l=t==null?void 0:t[1];var g=[o,l];if(_o(g))return t==null?g:g4(g,t,n)}}}var Wf=1e9,mSe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},YA,Cn=!0,Na="[DecimalError] ",nu=Na+"Invalid argument: ",KA=Na+"Exponent out of range: ",Qf=Math.floor,zc=Math.pow,pSe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Di,br=1e7,xn=7,e7=9007199254740991,qx=Qf(e7/xn),Le={};Le.absoluteValue=Le.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Le.comparedTo=Le.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Le.decimalPlaces=Le.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*xn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Le.dividedBy=Le.div=function(e){return ms(this,new this.constructor(e))};Le.dividedToIntegerBy=Le.idiv=function(e){var t=this,n=t.constructor;return ln(ms(t,new n(e),0,1),n.precision)};Le.equals=Le.eq=function(e){return!this.cmp(e)};Le.exponent=function(){return er(this)};Le.greaterThan=Le.gt=function(e){return this.cmp(e)>0};Le.greaterThanOrEqualTo=Le.gte=function(e){return this.cmp(e)>=0};Le.isInteger=Le.isint=function(){return this.e>this.d.length-2};Le.isNegative=Le.isneg=function(){return this.s<0};Le.isPositive=Le.ispos=function(){return this.s>0};Le.isZero=function(){return this.s===0};Le.lessThan=Le.lt=function(e){return this.cmp(e)<0};Le.lessThanOrEqualTo=Le.lte=function(e){return this.cmp(e)<1};Le.logarithm=Le.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Di))throw Error(Na+"NaN");if(n.s<1)throw Error(Na+(n.s?"NaN":"-Infinity"));return n.eq(Di)?new r(0):(Cn=!1,t=ms(tp(n,a),tp(e,a),a),Cn=!0,ln(t,i))};Le.minus=Le.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?r7(t,e):t7(t,(e.s=-e.s,e))};Le.modulo=Le.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Na+"NaN");return n.s?(Cn=!1,t=ms(n,e,0,1).times(e),Cn=!0,n.minus(t)):ln(new r(n),i)};Le.naturalExponential=Le.exp=function(){return n7(this)};Le.naturalLogarithm=Le.ln=function(){return tp(this)};Le.negated=Le.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Le.plus=Le.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?t7(t,e):r7(t,(e.s=-e.s,e))};Le.precision=Le.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(nu+e);if(t=er(i)+1,r=i.d.length-1,n=r*xn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Le.squareRoot=Le.sqrt=function(){var e,t,n,r,i,a,o,l=this,u=l.constructor;if(l.s<1){if(!l.s)return new u(0);throw Error(Na+"NaN")}for(e=er(l),Cn=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=So(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Qf((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new u(t)):r=new u(i.toString()),n=u.precision,i=o=n+3;;)if(a=r,r=a.plus(ms(l,a,o+2)).times(.5),So(a.d).slice(0,o)===(t=So(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ln(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Cn=!0,ln(r,n)};Le.times=Le.mul=function(e){var t,n,r,i,a,o,l,u,d,m=this,h=m.constructor,g=m.d,v=(e=new h(e)).d;if(!m.s||!e.s)return new h(0);for(e.s*=m.s,n=m.e+e.e,u=g.length,d=v.length,u<d&&(a=g,g=v,v=a,o=u,u=d,d=o),a=[],o=u+d,r=o;r--;)a.push(0);for(r=d;--r>=0;){for(t=0,i=u+r;i>r;)l=a[i]+v[r]*g[i-r-1]+t,a[i--]=l%br|0,t=l/br|0;a[i]=(a[i]+t)%br|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Cn?ln(e,h.precision):e};Le.toDecimalPlaces=Le.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(To(e,0,Wf),t===void 0?t=r.rounding:To(t,0,8),ln(n,e+er(n)+1,t))};Le.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Eu(r,!0):(To(e,0,Wf),t===void 0?t=i.rounding:To(t,0,8),r=ln(new i(r),e+1,t),n=Eu(r,!0,e+1)),n};Le.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Eu(i):(To(e,0,Wf),t===void 0?t=a.rounding:To(t,0,8),r=ln(new a(i),e+er(i)+1,t),n=Eu(r.abs(),!1,e+er(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Le.toInteger=Le.toint=function(){var e=this,t=e.constructor;return ln(new t(e),er(e)+1,t.rounding)};Le.toNumber=function(){return+this};Le.toPower=Le.pow=function(e){var t,n,r,i,a,o,l=this,u=l.constructor,d=12,m=+(e=new u(e));if(!e.s)return new u(Di);if(l=new u(l),!l.s){if(e.s<1)throw Error(Na+"Infinity");return l}if(l.eq(Di))return l;if(r=u.precision,e.eq(Di))return ln(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=m<0?-m:m)<=e7){for(i=new u(Di),t=Math.ceil(r/xn+4),Cn=!1;n%2&&(i=i.times(l),y4(i.d,t)),n=Qf(n/2),n!==0;)l=l.times(l),y4(l.d,t);return Cn=!0,e.s<0?new u(Di).div(i):ln(i,r)}}else if(a<0)throw Error(Na+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Cn=!1,i=e.times(tp(l,r+d)),Cn=!0,i=n7(i),i.s=a,i};Le.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=er(i),r=Eu(i,n<=a.toExpNeg||n>=a.toExpPos)):(To(e,1,Wf),t===void 0?t=a.rounding:To(t,0,8),i=ln(new a(i),e,t),n=er(i),r=Eu(i,e<=n||n<=a.toExpNeg,e)),r};Le.toSignificantDigits=Le.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(To(e,1,Wf),t===void 0?t=r.rounding:To(t,0,8)),ln(new r(n),e,t)};Le.toString=Le.valueOf=Le.val=Le.toJSON=Le[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=er(e),n=e.constructor;return Eu(e,t<=n.toExpNeg||t>=n.toExpPos)};function t7(e,t){var n,r,i,a,o,l,u,d,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Cn?ln(t,h):t;if(u=e.d,d=t.d,o=e.e,i=t.e,u=u.slice(),a=o-i,a){for(a<0?(r=u,a=-a,l=d.length):(r=d,i=o,l=u.length),o=Math.ceil(h/xn),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=u.length,a=d.length,l-a<0&&(a=l,r=d,d=u,u=r),n=0;a;)n=(u[--a]=u[a]+d[a]+n)/br|0,u[a]%=br;for(n&&(u.unshift(n),++i),l=u.length;u[--l]==0;)u.pop();return t.d=u,t.e=i,Cn?ln(t,h):t}function To(e,t,n){if(e!==~~e||e<t||e>n)throw Error(nu+e)}function So(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=xn-r.length,n&&(a+=jl(n)),a+=r;o=e[t],r=o+"",n=xn-r.length,n&&(a+=jl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ms=(function(){function e(r,i){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+o,r[l]=a%br|0,o=a/br|0;return o&&r.unshift(o),r}function t(r,i,a,o){var l,u;if(a!=o)u=a>o?1:-1;else for(l=u=0;l<a;l++)if(r[l]!=i[l]){u=r[l]>i[l]?1:-1;break}return u}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*br+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,u,d,m,h,g,v,b,w,S,j,C,E,k,O,A,T,M,B=r.constructor,I=r.s==i.s?1:-1,U=r.d,L=i.d;if(!r.s)return new B(r);if(!i.s)throw Error(Na+"Division by zero");for(u=r.e-i.e,T=L.length,O=U.length,v=new B(I),b=v.d=[],d=0;L[d]==(U[d]||0);)++d;if(L[d]>(U[d]||0)&&--u,a==null?C=a=B.precision:o?C=a+(er(r)-er(i))+1:C=a,C<0)return new B(0);if(C=C/xn+2|0,d=0,T==1)for(m=0,L=L[0],C++;(d<O||m)&&C--;d++)E=m*br+(U[d]||0),b[d]=E/L|0,m=E%L|0;else{for(m=br/(L[0]+1)|0,m>1&&(L=e(L,m),U=e(U,m),T=L.length,O=U.length),k=T,w=U.slice(0,T),S=w.length;S<T;)w[S++]=0;M=L.slice(),M.unshift(0),A=L[0],L[1]>=br/2&&++A;do m=0,l=t(L,w,T,S),l<0?(j=w[0],T!=S&&(j=j*br+(w[1]||0)),m=j/A|0,m>1?(m>=br&&(m=br-1),h=e(L,m),g=h.length,S=w.length,l=t(h,w,g,S),l==1&&(m--,n(h,T<g?M:L,g))):(m==0&&(l=m=1),h=L.slice()),g=h.length,g<S&&h.unshift(0),n(w,h,S),l==-1&&(S=w.length,l=t(L,w,T,S),l<1&&(m++,n(w,T<S?M:L,S))),S=w.length):l===0&&(m++,w=[0]),b[d++]=m,l&&w[0]?w[S++]=U[k]||0:(w=[U[k]],S=1);while((k++<O||w[0]!==void 0)&&C--)}return b[0]||b.shift(),v.e=u,ln(v,o?a+er(v)+1:a)}})();function n7(e,t){var n,r,i,a,o,l,u=0,d=0,m=e.constructor,h=m.precision;if(er(e)>16)throw Error(KA+er(e));if(!e.s)return new m(Di);for(Cn=!1,l=h,o=new m(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(r=Math.log(zc(2,d))/Math.LN10*2+5|0,l+=r,n=i=a=new m(Di),m.precision=l;;){if(i=ln(i.times(e),l),n=n.times(++u),o=a.plus(ms(i,n,l)),So(o.d).slice(0,l)===So(a.d).slice(0,l)){for(;d--;)a=ln(a.times(a),l);return m.precision=h,t==null?(Cn=!0,ln(a,h)):a}a=o}}function er(e){for(var t=e.e*xn,n=e.d[0];n>=10;n/=10)t++;return t}function TE(e,t,n){if(t>e.LN10.sd())throw Cn=!0,n&&(e.precision=n),Error(Na+"LN10 precision limit exceeded");return ln(new e(e.LN10),t)}function jl(e){for(var t="";e--;)t+="0";return t}function tp(e,t){var n,r,i,a,o,l,u,d,m,h=1,g=10,v=e,b=v.d,w=v.constructor,S=w.precision;if(v.s<1)throw Error(Na+(v.s?"NaN":"-Infinity"));if(v.eq(Di))return new w(0);if(t==null?(Cn=!1,d=S):d=t,v.eq(10))return t==null&&(Cn=!0),TE(w,d);if(d+=g,w.precision=d,n=So(b),r=n.charAt(0),a=er(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=So(v.d),r=n.charAt(0),h++;a=er(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return u=TE(w,d+2,S).times(a+""),v=tp(new w(r+"."+n.slice(1)),d-g).plus(u),w.precision=S,t==null?(Cn=!0,ln(v,S)):v;for(l=o=v=ms(v.minus(Di),v.plus(Di),d),m=ln(v.times(v),d),i=3;;){if(o=ln(o.times(m),d),u=l.plus(ms(o,new w(i),d)),So(u.d).slice(0,d)===So(l.d).slice(0,d))return l=l.times(2),a!==0&&(l=l.plus(TE(w,d+2,S).times(a+""))),l=ms(l,new w(h),d),w.precision=S,t==null?(Cn=!0,ln(l,S)):l;l=u,i+=2}}function v4(e,t){var n,r,i;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(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Qf(n/xn),e.d=[],r=(n+1)%xn,n<0&&(r+=xn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=xn;r<i;)e.d.push(+t.slice(r,r+=xn));t=t.slice(r),r=xn-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Cn&&(e.e>qx||e.e<-qx))throw Error(KA+n)}else e.s=0,e.e=0,e.d=[0];return e}function ln(e,t,n){var r,i,a,o,l,u,d,m,h=e.d;for(o=1,a=h[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=xn,i=t,d=h[m=0];else{if(m=Math.ceil((r+1)/xn),a=h.length,m>=a)return e;for(d=a=h[m],o=1;a>=10;a/=10)o++;r%=xn,i=r-xn+o}if(n!==void 0&&(a=zc(10,o-i-1),l=d/a%10|0,u=t<0||h[m+1]!==void 0||d%a,u=n<4?(l||u)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||u||n==6&&(r>0?i>0?d/zc(10,o-i):0:h[m-1])%10&1||n==(e.s<0?8:7))),t<1||!h[0])return u?(a=er(e),h.length=1,t=t-a-1,h[0]=zc(10,(xn-t%xn)%xn),e.e=Qf(-t/xn)||0):(h.length=1,h[0]=e.e=e.s=0),e;if(r==0?(h.length=m,a=1,m--):(h.length=m+1,a=zc(10,xn-r),h[m]=i>0?(d/zc(10,o-i)%zc(10,i)|0)*a:0),u)for(;;)if(m==0){(h[0]+=a)==br&&(h[0]=1,++e.e);break}else{if(h[m]+=a,h[m]!=br)break;h[m--]=0,a=1}for(r=h.length;h[--r]===0;)h.pop();if(Cn&&(e.e>qx||e.e<-qx))throw Error(KA+er(e));return e}function r7(e,t){var n,r,i,a,o,l,u,d,m,h,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Cn?ln(t,v):t;if(u=e.d,h=t.d,r=t.e,d=e.e,u=u.slice(),o=d-r,o){for(m=o<0,m?(n=u,o=-o,l=h.length):(n=h,r=d,l=u.length),i=Math.max(Math.ceil(v/xn),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=u.length,l=h.length,m=i<l,m&&(l=i),i=0;i<l;i++)if(u[i]!=h[i]){m=u[i]<h[i];break}o=0}for(m&&(n=u,u=h,h=n,t.s=-t.s),l=u.length,i=h.length-l;i>0;--i)u[l++]=0;for(i=h.length;i>o;){if(u[--i]<h[i]){for(a=i;a&&u[--a]===0;)u[a]=br-1;--u[a],u[i]+=br}u[i]-=h[i]}for(;u[--l]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(t.d=u,t.e=r,Cn?ln(t,v):t):new g(0)}function Eu(e,t,n){var r,i=er(e),a=So(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+jl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+jl(-i-1)+a,n&&(r=n-o)>0&&(a+=jl(r))):i>=o?(a+=jl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+jl(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=jl(r))),e.s<0?"-"+a:a}function y4(e,t){if(e.length>t)return e.length=t,!0}function i7(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(nu+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return v4(o,a.toString())}else if(typeof a!="string")throw Error(nu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,pSe.test(a))v4(o,a);else throw Error(nu+a)}if(i.prototype=Le,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=i7,i.config=i.set=gSe,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 i.config(e),i}function gSe(e){if(!e||typeof e!="object")throw Error(Na+"Object expected");var t,n,r,i=["precision",1,Wf,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Qf(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(nu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(nu+n+": "+r);return this}var YA=i7(mSe);Di=new YA(1);const Tt=YA;function a7(e){var t;return e===0?t=1:t=Math.floor(new Tt(e).abs().log(10).toNumber())+1,t}function o7(e,t,n){for(var r=new Tt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var s7=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},XA=(e,t,n)=>{if(e.lte(0))return new Tt(0);var r=a7(e.toNumber()),i=new Tt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new Tt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),u=l.mul(i);return t?new Tt(u.toNumber()):new Tt(Math.ceil(u.toNumber()))},l7=(e,t,n)=>{var r;if(e.lte(0))return new Tt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new Tt(a).abs().log(10).toNumber()),l=new Tt(10).pow(o),u=e.div(l).toNumber(),d=i.findIndex(v=>v>=u-1e-10);if(d===-1&&(l=l.mul(10),d=0),d+=n,d>=i.length){var m=Math.floor(d/i.length);d%=i.length,l=l.mul(new Tt(10).pow(m))}var h=(r=i[d])!==null&&r!==void 0?r:1,g=new Tt(h).mul(l);return t?g:new Tt(Math.ceil(g.toNumber()))},vSe=(e,t,n)=>{var r=new Tt(1),i=new Tt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Tt(10).pow(a7(e)-1),i=new Tt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Tt(Math.floor(e)))}else e===0?i=new Tt(Math.floor((t-1)/2)):n||(i=new Tt(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],u=0;u<t;u++)l.push(i.add(new Tt(u-o).mul(r)).toNumber());return l},c7=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:XA;if(!Number.isFinite((n-t)/(r-1)))return{step:new Tt(0),tickMin:new Tt(0),tickMax:new Tt(0)};var l=o(new Tt(n).sub(t).div(r-1),i,a),u;t<=0&&n>=0?u=new Tt(0):(u=new Tt(t).add(n).div(2),u=u.sub(new Tt(u).mod(l)));var d=Math.ceil(u.sub(t).div(l).toNumber()),m=Math.ceil(new Tt(n).sub(u).div(l).toNumber()),h=d+m+1;return h>r?c7(t,n,r,i,a+1,o):(h<r&&(m=n>0?m+(r-h):m,d=n>0?d:d+(r-h)),{step:l,tickMin:u.sub(new Tt(d).mul(l)),tickMax:u.add(new Tt(m).mul(l))})},x4=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(i,2),[u,d]=s7([n,r]);if(u===-1/0||d===1/0){var m=d===1/0?[u,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),d];return n>r?m.reverse():m}if(u===d)return vSe(u,i,a);var h=o==="snap125"?l7:XA,{step:g,tickMin:v,tickMax:b}=c7(u,d,l,a,0,h),w=o7(v,b.add(new Tt(.1).mul(g)),g);return n>r?w.reverse():w},b4=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[l,u]=s7([r,i]);if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var d=o==="snap125"?l7:XA,m=Math.max(n,2),h=d(new Tt(u).sub(l).div(m-1),a,0),g=[...o7(new Tt(l),new Tt(u),h),u];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},u7=e=>e.rootProps.maxBarSize,ySe=e=>e.rootProps.barGap,d7=e=>e.rootProps.barCategoryGap,xSe=e=>e.rootProps.barSize,fg=e=>e.rootProps.stackOffset,f7=e=>e.rootProps.reverseStackOrder,GA=e=>e.options.chartName,WA=e=>e.rootProps.syncId,h7=e=>e.rootProps.syncMethod,QA=e=>e.options.eventEmitter,Jn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Tc={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},fo={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Mb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Rb(e,t,n){if(n!=="auto")return n;if(e!=null)return Ts(e,t)?"category":"number"}function w4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w4(Object(n),!0).forEach(function(r){bSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bSe(e,t,n){return(t=wSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wSe(e){var t=SSe(e,"string");return typeof t=="symbol"?t:t+""}function SSe(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 S4={allowDataOverflow:Tc.allowDataOverflow,allowDecimals:Tc.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Tc.angleAxisId,includeHidden:!1,name:void 0,reversed:Tc.reversed,scale:Tc.scale,tick:Tc.tick,tickCount:void 0,ticks:void 0,type:Tc.type,unit:void 0,niceTicks:"auto"},j4={allowDataOverflow:fo.allowDataOverflow,allowDecimals:fo.allowDecimals,allowDuplicatedCategory:fo.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:fo.radiusAxisId,includeHidden:fo.includeHidden,name:void 0,reversed:fo.reversed,scale:fo.scale,tick:fo.tick,tickCount:fo.tickCount,ticks:void 0,type:fo.type,unit:void 0,niceTicks:"auto"},jSe=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},ZA=le([jSe,A9],(e,t)=>{var n;if(e!=null)return e;var r=(n=Rb(t,"angleAxis",S4.type))!==null&&n!==void 0?n:"category";return Vx(Vx({},S4),{},{type:r})}),ESe=(e,t)=>e.polarAxis.radiusAxis[t],JA=le([ESe,A9],(e,t)=>{var n;if(e!=null)return e;var r=(n=Rb(t,"radiusAxis",j4.type))!==null&&n!==void 0?n:"category";return Vx(Vx({},j4),{},{type:r})}),Db=e=>e.polarOptions,eO=le([Ps,Ms,hr],X9),m7=le([Db,eO],(e,t)=>{if(e!=null)return Hr(e.innerRadius,t,0)}),p7=le([Db,eO],(e,t)=>{if(e!=null)return Hr(e.outerRadius,t,t*.8)}),_Se=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},g7=le([Db],_Se);le([ZA,g7],Mb);var v7=le([eO,m7,p7],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([JA,v7],Mb);var y7=le([Ft,Db,m7,p7,Ps,Ms],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:u,endAngle:d}=t;return{cx:Hr(o,i,i/2),cy:Hr(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:u,endAngle:d,clockWise:!1}}}),Mn=(e,t)=>t,hg=(e,t,n)=>n;function tO(e){return e==null?void 0:e.id}function x7(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(l=>{var u,d=(u=l.data)!==null&&u!==void 0?u:r;if(!(d==null||d.length===0)){var m=tO(l);d.forEach((h,g)=>{var v=a==null||i?g:String(tn(h,a,null)),b=tn(h,l.dataKey,0),w;o.has(v)?w=o.get(v):w={},Object.assign(w,{[m]:b}),o.set(v,w)})}}),Array.from(o.values())}function Ib(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Lb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function zb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function CSe(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 Er=e=>{var t=Ft(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Zf=e=>e.tooltip.settings.axisId;function nO(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],l=i[1];return o<=l?a>=o&&a<=l:a>=l&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var l=e(a);if(l!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var u=e.bandwidth();switch(o.position){case"middle":l+=u/2;break;case"end":l+=u;break}}return l}}}}}var b7=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!_o(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Pt(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Bl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function NSe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function rO(e){let t,n,r;e.length!==2?(t=Bl,n=(l,u)=>Bl(e(l),u),r=(l,u)=>e(l)-u):(t=e===Bl||e===NSe?e:kSe,n=e,r=e);function i(l,u,d=0,m=l.length){if(d<m){if(t(u,u)!==0)return m;do{const h=d+m>>>1;n(l[h],u)<0?d=h+1:m=h}while(d<m)}return d}function a(l,u,d=0,m=l.length){if(d<m){if(t(u,u)!==0)return m;do{const h=d+m>>>1;n(l[h],u)<=0?d=h+1:m=h}while(d<m)}return d}function o(l,u,d=0,m=l.length){const h=i(l,u,d,m-1);return h>d&&r(l[h-1],u)>-r(l[h],u)?h-1:h}return{left:i,center:o,right:a}}function kSe(){return 0}function w7(e){return e===null?NaN:+e}function*ASe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const OSe=rO(Bl),mg=OSe.right;rO(w7).center;class E4 extends Map{constructor(t,n=MSe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(_4(this,t))}has(t){return super.has(_4(this,t))}set(t,n){return super.set(TSe(this,t),n)}delete(t){return super.delete(PSe(this,t))}}function _4({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function TSe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function PSe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function MSe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function RSe(e=Bl){if(e===Bl)return S7;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 S7(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const DSe=Math.sqrt(50),ISe=Math.sqrt(10),LSe=Math.sqrt(2);function Kx(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=DSe?10:a>=ISe?5:a>=LSe?2:1;let l,u,d;return i<0?(d=Math.pow(10,-i)/o,l=Math.round(e*d),u=Math.round(t*d),l/d<e&&++l,u/d>t&&--u,d=-d):(d=Math.pow(10,i)*o,l=Math.round(e/d),u=Math.round(t/d),l*d<e&&++l,u*d>t&&--u),u<l&&.5<=n&&n<2?Kx(e,t,n*2):[l,u,d]}function qC(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Kx(t,e,n):Kx(e,t,n);if(!(a>=i))return[];const l=a-i+1,u=new Array(l);if(r)if(o<0)for(let d=0;d<l;++d)u[d]=(a-d)/-o;else for(let d=0;d<l;++d)u[d]=(a-d)*o;else if(o<0)for(let d=0;d<l;++d)u[d]=(i+d)/-o;else for(let d=0;d<l;++d)u[d]=(i+d)*o;return u}function VC(e,t,n){return t=+t,e=+e,n=+n,Kx(e,t,n)[2]}function KC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?VC(t,e,n):VC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function C4(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function N4(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function j7(e,t,n=0,r=1/0,i){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(i=i===void 0?S7:RSe(i);r>n;){if(r-n>600){const u=r-n+1,d=t-n+1,m=Math.log(u),h=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*h*(u-h)/u)*(d-u/2<0?-1:1),v=Math.max(n,Math.floor(t-d*h/u+g)),b=Math.min(r,Math.floor(t+(u-d)*h/u+g));j7(e,t,v,b,i)}const a=e[t];let o=n,l=r;for(dm(e,n,t),i(e[r],a)>0&&dm(e,n,r);o<l;){for(dm(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?dm(e,n,l):(++l,dm(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function dm(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function zSe(e,t,n){if(e=Float64Array.from(ASe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return N4(e);if(t>=1)return C4(e);var r,i=(r-1)*t,a=Math.floor(i),o=C4(j7(e,a).subarray(0,a+1)),l=N4(e.subarray(a+1));return o+(l-o)*(i-a)}}function $Se(e,t,n=w7){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,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(i-a)}}function BSe(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Ma(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ds(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 YC=Symbol("implicit");function iO(){var e=new E4,t=[],n=[],r=YC;function i(a){let o=e.get(a);if(o===void 0){if(r!==YC)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new E4;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return iO(t,n).unknown(r)},Ma.apply(i,arguments),i}function aO(){var e=iO().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,u=0,d=0,m=.5;delete e.unknown;function h(){var g=t().length,v=i<r,b=v?i:r,w=v?r:i;a=(w-b)/Math.max(1,g-u+d*2),l&&(a=Math.floor(a)),b+=(w-b-a*(g-u))*m,o=a*(1-u),l&&(b=Math.round(b),o=Math.round(o));var S=BSe(g).map(function(j){return b+a*j});return n(v?S.reverse():S)}return e.domain=function(g){return arguments.length?(t(g),h()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,l=!0,h()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(g){return arguments.length?(l=!!g,h()):l},e.padding=function(g){return arguments.length?(u=Math.min(1,d=+g),h()):u},e.paddingInner=function(g){return arguments.length?(u=Math.min(1,g),h()):u},e.paddingOuter=function(g){return arguments.length?(d=+g,h()):d},e.align=function(g){return arguments.length?(m=Math.max(0,Math.min(1,g)),h()):m},e.copy=function(){return aO(t(),[r,i]).round(l).paddingInner(u).paddingOuter(d).align(m)},Ma.apply(h(),arguments)}function E7(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return E7(t())},e}function FSe(){return E7(aO.apply(null,arguments).paddingInner(1))}function oO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _7(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pg(){}var np=.7,Yx=1/np,Yd="\\s*([+-]?\\d+)\\s*",rp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Co="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",USe=/^#([0-9a-f]{3,8})$/,HSe=new RegExp(`^rgb\\(${Yd},${Yd},${Yd}\\)$`),qSe=new RegExp(`^rgb\\(${Co},${Co},${Co}\\)$`),VSe=new RegExp(`^rgba\\(${Yd},${Yd},${Yd},${rp}\\)$`),KSe=new RegExp(`^rgba\\(${Co},${Co},${Co},${rp}\\)$`),YSe=new RegExp(`^hsl\\(${rp},${Co},${Co}\\)$`),XSe=new RegExp(`^hsla\\(${rp},${Co},${Co},${rp}\\)$`),k4={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};oO(pg,_u,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:A4,formatHex:A4,formatHex8:GSe,formatHsl:WSe,formatRgb:O4,toString:O4});function A4(){return this.rgb().formatHex()}function GSe(){return this.rgb().formatHex8()}function WSe(){return C7(this).formatHsl()}function O4(){return this.rgb().formatRgb()}function _u(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=USe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?T4(t):n===3?new bi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vy(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=HSe.exec(e))?new bi(t[1],t[2],t[3],1):(t=qSe.exec(e))?new bi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=VSe.exec(e))?vy(t[1],t[2],t[3],t[4]):(t=KSe.exec(e))?vy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=YSe.exec(e))?R4(t[1],t[2]/100,t[3]/100,1):(t=XSe.exec(e))?R4(t[1],t[2]/100,t[3]/100,t[4]):k4.hasOwnProperty(e)?T4(k4[e]):e==="transparent"?new bi(NaN,NaN,NaN,0):null}function T4(e){return new bi(e>>16&255,e>>8&255,e&255,1)}function vy(e,t,n,r){return r<=0&&(e=t=n=NaN),new bi(e,t,n,r)}function QSe(e){return e instanceof pg||(e=_u(e)),e?(e=e.rgb(),new bi(e.r,e.g,e.b,e.opacity)):new bi}function XC(e,t,n,r){return arguments.length===1?QSe(e):new bi(e,t,n,r??1)}function bi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}oO(bi,XC,_7(pg,{brighter(e){return e=e==null?Yx:Math.pow(Yx,e),new bi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?np:Math.pow(np,e),new bi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bi(ru(this.r),ru(this.g),ru(this.b),Xx(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:P4,formatHex:P4,formatHex8:ZSe,formatRgb:M4,toString:M4}));function P4(){return`#${Uc(this.r)}${Uc(this.g)}${Uc(this.b)}`}function ZSe(){return`#${Uc(this.r)}${Uc(this.g)}${Uc(this.b)}${Uc((isNaN(this.opacity)?1:this.opacity)*255)}`}function M4(){const e=Xx(this.opacity);return`${e===1?"rgb(":"rgba("}${ru(this.r)}, ${ru(this.g)}, ${ru(this.b)}${e===1?")":`, ${e})`}`}function Xx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ru(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Uc(e){return e=ru(e),(e<16?"0":"")+e.toString(16)}function R4(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ya(e,t,n,r)}function C7(e){if(e instanceof Ya)return new Ya(e.h,e.s,e.l,e.opacity);if(e instanceof pg||(e=_u(e)),!e)return new Ya;if(e instanceof Ya)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,u=(a+i)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=u<.5?a+i:2-a-i,o*=60):l=u>0&&u<1?0:o,new Ya(o,l,u,e.opacity)}function JSe(e,t,n,r){return arguments.length===1?C7(e):new Ya(e,t,n,r??1)}function Ya(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}oO(Ya,JSe,_7(pg,{brighter(e){return e=e==null?Yx:Math.pow(Yx,e),new Ya(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?np:Math.pow(np,e),new Ya(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,i=2*n-r;return new bi(PE(e>=240?e-240:e+120,i,r),PE(e,i,r),PE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ya(D4(this.h),yy(this.s),yy(this.l),Xx(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=Xx(this.opacity);return`${e===1?"hsl(":"hsla("}${D4(this.h)}, ${yy(this.s)*100}%, ${yy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function D4(e){return e=(e||0)%360,e<0?e+360:e}function yy(e){return Math.max(0,Math.min(1,e||0))}function PE(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 sO=e=>()=>e;function eje(e,t){return function(n){return e+n*t}}function tje(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 nje(e){return(e=+e)==1?N7:function(t,n){return n-t?tje(t,n,e):sO(isNaN(t)?n:t)}}function N7(e,t){var n=t-e;return n?eje(e,n):sO(isNaN(e)?t:e)}const Gx=(function e(t){var n=nje(t);function r(i,a){var o=n((i=XC(i)).r,(a=XC(a)).r),l=n(i.g,a.g),u=n(i.b,a.b),d=N7(i.opacity,a.opacity);return function(m){return i.r=o(m),i.g=l(m),i.b=u(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function rje(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function ije(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function aje(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=ps(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=i[o](l);return a}}function oje(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function qa(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function sje(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ps(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var GC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ME=new RegExp(GC.source,"g");function lje(e){return function(){return e}}function cje(e){return function(t){return e(t)+""}}function k7(e,t){var n=GC.lastIndex=ME.lastIndex=0,r,i,a,o=-1,l=[],u=[];for(e=e+"",t=t+"";(r=GC.exec(e))&&(i=ME.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,u.push({i:o,x:qa(r,i)})),n=ME.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?u[0]?cje(u[0].x):lje(t):(t=u.length,function(d){for(var m=0,h;m<t;++m)l[(h=u[m]).i]=h.x(d);return l.join("")})}function ps(e,t){var n=typeof t,r;return t==null||n==="boolean"?sO(t):(n==="number"?qa:n==="string"?(r=_u(t))?(t=r,Gx):k7:t instanceof _u?Gx:t instanceof Date?oje:ije(t)?rje:Array.isArray(t)?aje:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?sje:qa)(e,t)}function lO(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var I4=180/Math.PI,WC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function A7(e,t,n,r,i,a){var o,l,u;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*I4,skewX:Math.atan(u)*I4,scaleX:o,scaleY:l}}var xy;function uje(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?WC:A7(t.a,t.b,t.c,t.d,t.e,t.f)}function dje(e){return e==null||(xy||(xy=document.createElementNS("http://www.w3.org/2000/svg","g")),xy.setAttribute("transform",e),!(e=xy.transform.baseVal.consolidate()))?WC:(e=e.matrix,A7(e.a,e.b,e.c,e.d,e.e,e.f))}function O7(e,t,n,r){function i(d){return d.length?d.pop()+" ":""}function a(d,m,h,g,v,b){if(d!==h||m!==g){var w=v.push("translate(",null,t,null,n);b.push({i:w-4,x:qa(d,h)},{i:w-2,x:qa(m,g)})}else(h||g)&&v.push("translate("+h+t+g+n)}function o(d,m,h,g){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),g.push({i:h.push(i(h)+"rotate(",null,r)-2,x:qa(d,m)})):m&&h.push(i(h)+"rotate("+m+r)}function l(d,m,h,g){d!==m?g.push({i:h.push(i(h)+"skewX(",null,r)-2,x:qa(d,m)}):m&&h.push(i(h)+"skewX("+m+r)}function u(d,m,h,g,v,b){if(d!==h||m!==g){var w=v.push(i(v)+"scale(",null,",",null,")");b.push({i:w-4,x:qa(d,h)},{i:w-2,x:qa(m,g)})}else(h!==1||g!==1)&&v.push(i(v)+"scale("+h+","+g+")")}return function(d,m){var h=[],g=[];return d=e(d),m=e(m),a(d.translateX,d.translateY,m.translateX,m.translateY,h,g),o(d.rotate,m.rotate,h,g),l(d.skewX,m.skewX,h,g),u(d.scaleX,d.scaleY,m.scaleX,m.scaleY,h,g),d=m=null,function(v){for(var b=-1,w=g.length,S;++b<w;)h[(S=g[b]).i]=S.x(v);return h.join("")}}}var fje=O7(uje,"px, ","px)","deg)"),hje=O7(dje,", ",")",")"),mje=1e-12;function L4(e){return((e=Math.exp(e))+1/e)/2}function pje(e){return((e=Math.exp(e))-1/e)/2}function gje(e){return((e=Math.exp(2*e))-1)/(e+1)}const Vy=(function e(t,n,r){function i(a,o){var l=a[0],u=a[1],d=a[2],m=o[0],h=o[1],g=o[2],v=m-l,b=h-u,w=v*v+b*b,S,j;if(w<mje)j=Math.log(g/d)/t,S=function(T){return[l+T*v,u+T*b,d*Math.exp(t*T*j)]};else{var C=Math.sqrt(w),E=(g*g-d*d+r*w)/(2*d*n*C),k=(g*g-d*d-r*w)/(2*g*n*C),O=Math.log(Math.sqrt(E*E+1)-E),A=Math.log(Math.sqrt(k*k+1)-k);j=(A-O)/t,S=function(T){var M=T*j,B=L4(O),I=d/(n*C)*(B*gje(t*M+O)-pje(O));return[l+I*v,u+I*b,d*B/L4(t*M+O)]}}return S.duration=j*1e3*t/Math.SQRT2,S}return i.rho=function(a){var o=Math.max(.001,+a),l=o*o,u=l*l;return e(o,l,u)},i})(Math.SQRT2,2,4);function vje(e,t){t===void 0&&(t=e,e=ps);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function yje(e){return function(){return e}}function Wx(e){return+e}var z4=[0,1];function ni(e){return e}function QC(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:yje(isNaN(t)?NaN:.5)}function xje(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function bje(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=QC(i,r),a=n(o,a)):(r=QC(r,i),a=n(a,o)),function(l){return a(r(l))}}function wje(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=QC(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var u=mg(e,l,1,r)-1;return a[u](i[u](l))}}function gg(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function $b(){var e=z4,t=z4,n=ps,r,i,a,o=ni,l,u,d;function m(){var g=Math.min(e.length,t.length);return o!==ni&&(o=xje(e[0],e[g-1])),l=g>2?wje:bje,u=d=null,h}function h(g){return g==null||isNaN(g=+g)?a:(u||(u=l(e.map(r),t,n)))(r(o(g)))}return h.invert=function(g){return o(i((d||(d=l(t,e.map(r),qa)))(g)))},h.domain=function(g){return arguments.length?(e=Array.from(g,Wx),m()):e.slice()},h.range=function(g){return arguments.length?(t=Array.from(g),m()):t.slice()},h.rangeRound=function(g){return t=Array.from(g),n=lO,m()},h.clamp=function(g){return arguments.length?(o=g?!0:ni,m()):o!==ni},h.interpolate=function(g){return arguments.length?(n=g,m()):n},h.unknown=function(g){return arguments.length?(a=g,h):a},function(g,v){return r=g,i=v,m()}}function cO(){return $b()(ni,ni)}function Sje(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qx(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 bf(e){return e=Qx(Math.abs(e)),e?e[1]:NaN}function jje(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],u=0;i>0&&l>0&&(u+l+1>r&&(l=Math.max(1,r-u)),a.push(n.substring(i-=l,i+l)),!((u+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Eje(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var _je=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ip(e){if(!(t=_je.exec(e)))throw new Error("invalid format: "+e);var t;return new uO({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]})}ip.prototype=uO.prototype;function uO(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+""}uO.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 Cje(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Zx;function Nje(e,t){var n=Qx(e,t);if(!n)return Zx=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Zx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Qx(e,Math.max(0,t+a-1))[0]}function $4(e,t){var n=Qx(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const B4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Sje,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)=>$4(e*100,t),r:$4,s:Nje,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function F4(e){return e}var U4=Array.prototype.map,H4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kje(e){var t=e.grouping===void 0||e.thousands===void 0?F4:jje(U4.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?F4:Eje(U4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function d(h,g){h=ip(h);var v=h.fill,b=h.align,w=h.sign,S=h.symbol,j=h.zero,C=h.width,E=h.comma,k=h.precision,O=h.trim,A=h.type;A==="n"?(E=!0,A="g"):B4[A]||(k===void 0&&(k=12),O=!0,A="g"),(j||v==="0"&&b==="=")&&(j=!0,v="0",b="=");var T=(g&&g.prefix!==void 0?g.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),M=(S==="$"?r:/[%p]/.test(A)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),B=B4[A],I=/[defgprs%]/.test(A);k=k===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function U(L){var G=T,z=M,K,P,H;if(A==="c")z=B(L)+z,L="";else{L=+L;var Y=L<0||1/L<0;if(L=isNaN(L)?u:B(Math.abs(L),k),O&&(L=Cje(L)),Y&&+L==0&&w!=="+"&&(Y=!1),G=(Y?w==="("?w:l:w==="-"||w==="("?"":w)+G,z=(A==="s"&&!isNaN(L)&&Zx!==void 0?H4[8+Zx/3]:"")+z+(Y&&w==="("?")":""),I){for(K=-1,P=L.length;++K<P;)if(H=L.charCodeAt(K),48>H||H>57){z=(H===46?i+L.slice(K+1):L.slice(K))+z,L=L.slice(0,K);break}}}E&&!j&&(L=t(L,1/0));var V=G.length+L.length+z.length,D=V<C?new Array(C-V+1).join(v):"";switch(E&&j&&(L=t(D+L,D.length?C-z.length:1/0),D=""),b){case"<":L=G+L+z+D;break;case"=":L=G+D+L+z;break;case"^":L=D.slice(0,V=D.length>>1)+G+L+z+D.slice(V);break;default:L=D+G+L+z;break}return a(L)}return U.toString=function(){return h+""},U}function m(h,g){var v=Math.max(-8,Math.min(8,Math.floor(bf(g)/3)))*3,b=Math.pow(10,-v),w=d((h=ip(h),h.type="f",h),{suffix:H4[8+v/3]});return function(S){return w(b*S)}}return{format:d,formatPrefix:m}}var by,dO,T7;Aje({thousands:",",grouping:[3],currency:["$",""]});function Aje(e){return by=kje(e),dO=by.format,T7=by.formatPrefix,by}function Oje(e){return Math.max(0,-bf(Math.abs(e)))}function Tje(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(bf(t)/3)))*3-bf(Math.abs(e)))}function Pje(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,bf(t)-bf(e))+1}function P7(e,t,n,r){var i=KC(e,t,n),a;switch(r=ip(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Tje(i,o))&&(r.precision=a),T7(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Pje(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Oje(i))&&(r.precision=a-(r.type==="%")*2);break}}return dO(r)}function ic(e){var t=e.domain;return e.ticks=function(n){var r=t();return qC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return P7(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],l=r[a],u,d,m=10;for(l<o&&(d=o,o=l,l=d,d=i,i=a,a=d);m-- >0;){if(d=VC(o,l,n),d===u)return r[i]=o,r[a]=l,t(r);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;u=d}return e},e}function M7(){var e=cO();return e.copy=function(){return gg(e,M7())},Ma.apply(e,arguments),ic(e)}function R7(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,Wx),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return R7(e).unknown(t)},e=arguments.length?Array.from(e,Wx):[0,1],ic(n)}function D7(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function q4(e){return Math.log(e)}function V4(e){return Math.exp(e)}function Mje(e){return-Math.log(-e)}function Rje(e){return-Math.exp(-e)}function Dje(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Ije(e){return e===10?Dje:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Lje(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 K4(e){return(t,n)=>-e(-t,n)}function fO(e){const t=e(q4,V4),n=t.domain;let r=10,i,a;function o(){return i=Lje(r),a=Ije(r),n()[0]<0?(i=K4(i),a=K4(a),e(Mje,Rje)):e(q4,V4),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const u=n();let d=u[0],m=u[u.length-1];const h=m<d;h&&([d,m]=[m,d]);let g=i(d),v=i(m),b,w;const S=l==null?10:+l;let j=[];if(!(r%1)&&v-g<S){if(g=Math.floor(g),v=Math.ceil(v),d>0){for(;g<=v;++g)for(b=1;b<r;++b)if(w=g<0?b/a(-g):b*a(g),!(w<d)){if(w>m)break;j.push(w)}}else for(;g<=v;++g)for(b=r-1;b>=1;--b)if(w=g>0?b/a(-g):b*a(g),!(w<d)){if(w>m)break;j.push(w)}j.length*2<S&&(j=qC(d,m,S))}else j=qC(g,v,Math.min(v-g,S)).map(a);return h?j.reverse():j},t.tickFormat=(l,u)=>{if(l==null&&(l=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=ip(u)).precision==null&&(u.trim=!0),u=dO(u)),l===1/0)return u;const d=Math.max(1,r*l/t.ticks().length);return m=>{let h=m/a(Math.round(i(m)));return h*r<r-.5&&(h*=r),h<=d?u(m):""}},t.nice=()=>n(D7(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function I7(){const e=fO($b()).domain([1,10]);return e.copy=()=>gg(e,I7()).base(e.base()),Ma.apply(e,arguments),e}function Y4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function X4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function hO(e){var t=1,n=e(Y4(t),X4(t));return n.constant=function(r){return arguments.length?e(Y4(t=+r),X4(t)):t},ic(n)}function L7(){var e=hO($b());return e.copy=function(){return gg(e,L7()).constant(e.constant())},Ma.apply(e,arguments)}function G4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function zje(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function $je(e){return e<0?-e*e:e*e}function mO(e){var t=e(ni,ni),n=1;function r(){return n===1?e(ni,ni):n===.5?e(zje,$je):e(G4(n),G4(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ic(t)}function pO(){var e=mO($b());return e.copy=function(){return gg(e,pO()).exponent(e.exponent())},Ma.apply(e,arguments),e}function Bje(){return pO.apply(null,arguments).exponent(.5)}function W4(e){return Math.sign(e)*e*e}function Fje(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function z7(){var e=cO(),t=[0,1],n=!1,r;function i(a){var o=Fje(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(W4(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Wx)).map(W4)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return z7(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ma.apply(i,arguments),ic(i)}function $7(){var e=[],t=[],n=[],r;function i(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=$Se(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[mg(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Bl),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return $7().domain(e).range(t).unknown(r)},Ma.apply(a,arguments)}function B7(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[mg(r,u,0,n)]:a}function l(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*t-(u-n)*e)/(n+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,l()):[e,t]},o.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,l()):i.slice()},o.invertExtent=function(u){var d=i.indexOf(u);return d<0?[NaN,NaN]:d<1?[e,r[0]]:d>=n?[r[n-1],t]:[r[d-1],r[d]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return r.slice()},o.copy=function(){return B7().domain([e,t]).range(i).unknown(a)},Ma.apply(ic(o),arguments)}function F7(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[mg(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return F7().domain(e).range(t).unknown(n)},Ma.apply(i,arguments)}const RE=new Date,DE=new Date;function mr(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const u=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return u;let d;do u.push(d=new Date(+a)),t(a,l),e(a);while(d<a&&a<o);return u},i.filter=a=>mr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(RE.setTime(+a),DE.setTime(+o),e(RE),e(DE),Math.floor(n(RE,DE))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Jx=mr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Jx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?mr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Jx);Jx.range;const ds=1e3,xa=ds*60,fs=xa*60,Es=fs*24,gO=Es*7,Q4=Es*30,IE=Es*365,Hc=mr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ds)},(e,t)=>(t-e)/ds,e=>e.getUTCSeconds());Hc.range;const vO=mr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ds)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getMinutes());vO.range;const yO=mr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getUTCMinutes());yO.range;const xO=mr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ds-e.getMinutes()*xa)},(e,t)=>{e.setTime(+e+t*fs)},(e,t)=>(t-e)/fs,e=>e.getHours());xO.range;const bO=mr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fs)},(e,t)=>(t-e)/fs,e=>e.getUTCHours());bO.range;const vg=mr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xa)/Es,e=>e.getDate()-1);vg.range;const Bb=mr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Es,e=>e.getUTCDate()-1);Bb.range;const U7=mr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Es,e=>Math.floor(e/Es));U7.range;function Lu(e){return mr(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())*xa)/gO)}const Fb=Lu(0),e0=Lu(1),Uje=Lu(2),Hje=Lu(3),wf=Lu(4),qje=Lu(5),Vje=Lu(6);Fb.range;e0.range;Uje.range;Hje.range;wf.range;qje.range;Vje.range;function zu(e){return mr(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)/gO)}const Ub=zu(0),t0=zu(1),Kje=zu(2),Yje=zu(3),Sf=zu(4),Xje=zu(5),Gje=zu(6);Ub.range;t0.range;Kje.range;Yje.range;Sf.range;Xje.range;Gje.range;const wO=mr(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());wO.range;const SO=mr(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());SO.range;const _s=mr(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());_s.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mr(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)});_s.range;const Cs=mr(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());Cs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mr(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)});Cs.range;function H7(e,t,n,r,i,a){const o=[[Hc,1,ds],[Hc,5,5*ds],[Hc,15,15*ds],[Hc,30,30*ds],[a,1,xa],[a,5,5*xa],[a,15,15*xa],[a,30,30*xa],[i,1,fs],[i,3,3*fs],[i,6,6*fs],[i,12,12*fs],[r,1,Es],[r,2,2*Es],[n,1,gO],[t,1,Q4],[t,3,3*Q4],[e,1,IE]];function l(d,m,h){const g=m<d;g&&([d,m]=[m,d]);const v=h&&typeof h.range=="function"?h:u(d,m,h),b=v?v.range(d,+m+1):[];return g?b.reverse():b}function u(d,m,h){const g=Math.abs(m-d)/h,v=rO(([,,S])=>S).right(o,g);if(v===o.length)return e.every(KC(d/IE,m/IE,h));if(v===0)return Jx.every(Math.max(KC(d,m,h),1));const[b,w]=o[g/o[v-1][2]<o[v][2]/g?v-1:v];return b.every(w)}return[l,u]}const[Wje,Qje]=H7(Cs,SO,Ub,U7,bO,yO),[Zje,Jje]=H7(_s,wO,Fb,vg,xO,vO);function LE(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 zE(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 fm(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function eEe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,u=e.shortMonths,d=hm(i),m=mm(i),h=hm(a),g=mm(a),v=hm(o),b=mm(o),w=hm(l),S=mm(l),j=hm(u),C=mm(u),E={a:H,A:Y,b:V,B:D,c:null,d:rz,e:rz,f:jEe,g:MEe,G:DEe,H:bEe,I:wEe,j:SEe,L:q7,m:EEe,M:_Ee,p:q,q:$,Q:oz,s:sz,S:CEe,u:NEe,U:kEe,V:AEe,w:OEe,W:TEe,x:null,X:null,y:PEe,Y:REe,Z:IEe,"%":az},k={a:F,A:Q,b:Z,B:te,c:null,d:iz,e:iz,f:BEe,g:WEe,G:ZEe,H:LEe,I:zEe,j:$Ee,L:K7,m:FEe,M:UEe,p:ae,q:re,Q:oz,s:sz,S:HEe,u:qEe,U:VEe,V:KEe,w:YEe,W:XEe,x:null,X:null,y:GEe,Y:QEe,Z:JEe,"%":az},O={a:I,A:U,b:L,B:G,c:z,d:tz,e:tz,f:gEe,g:ez,G:J4,H:nz,I:nz,j:fEe,L:pEe,m:dEe,M:hEe,p:B,q:uEe,Q:yEe,s:xEe,S:mEe,u:aEe,U:oEe,V:sEe,w:iEe,W:lEe,x:K,X:P,y:ez,Y:J4,Z:cEe,"%":vEe};E.x=A(n,E),E.X=A(r,E),E.c=A(t,E),k.x=A(n,k),k.X=A(r,k),k.c=A(t,k);function A(ee,se){return function(ve){var ie=[],Se=-1,Ee=0,qe=ee.length,Te,rt,Je;for(ve instanceof Date||(ve=new Date(+ve));++Se<qe;)ee.charCodeAt(Se)===37&&(ie.push(ee.slice(Ee,Se)),(rt=Z4[Te=ee.charAt(++Se)])!=null?Te=ee.charAt(++Se):rt=Te==="e"?" ":"0",(Je=se[Te])&&(Te=Je(ve,rt)),ie.push(Te),Ee=Se+1);return ie.push(ee.slice(Ee,Se)),ie.join("")}}function T(ee,se){return function(ve){var ie=fm(1900,void 0,1),Se=M(ie,ee,ve+="",0),Ee,qe;if(Se!=ve.length)return null;if("Q"in ie)return new Date(ie.Q);if("s"in ie)return new Date(ie.s*1e3+("L"in ie?ie.L:0));if(se&&!("Z"in ie)&&(ie.Z=0),"p"in ie&&(ie.H=ie.H%12+ie.p*12),ie.m===void 0&&(ie.m="q"in ie?ie.q:0),"V"in ie){if(ie.V<1||ie.V>53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Ee=zE(fm(ie.y,0,1)),qe=Ee.getUTCDay(),Ee=qe>4||qe===0?t0.ceil(Ee):t0(Ee),Ee=Bb.offset(Ee,(ie.V-1)*7),ie.y=Ee.getUTCFullYear(),ie.m=Ee.getUTCMonth(),ie.d=Ee.getUTCDate()+(ie.w+6)%7):(Ee=LE(fm(ie.y,0,1)),qe=Ee.getDay(),Ee=qe>4||qe===0?e0.ceil(Ee):e0(Ee),Ee=vg.offset(Ee,(ie.V-1)*7),ie.y=Ee.getFullYear(),ie.m=Ee.getMonth(),ie.d=Ee.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),qe="Z"in ie?zE(fm(ie.y,0,1)).getUTCDay():LE(fm(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(qe+5)%7:ie.w+ie.U*7-(qe+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,zE(ie)):LE(ie)}}function M(ee,se,ve,ie){for(var Se=0,Ee=se.length,qe=ve.length,Te,rt;Se<Ee;){if(ie>=qe)return-1;if(Te=se.charCodeAt(Se++),Te===37){if(Te=se.charAt(Se++),rt=O[Te in Z4?se.charAt(Se++):Te],!rt||(ie=rt(ee,ve,ie))<0)return-1}else if(Te!=ve.charCodeAt(ie++))return-1}return ie}function B(ee,se,ve){var ie=d.exec(se.slice(ve));return ie?(ee.p=m.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function I(ee,se,ve){var ie=v.exec(se.slice(ve));return ie?(ee.w=b.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function U(ee,se,ve){var ie=h.exec(se.slice(ve));return ie?(ee.w=g.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function L(ee,se,ve){var ie=j.exec(se.slice(ve));return ie?(ee.m=C.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function G(ee,se,ve){var ie=w.exec(se.slice(ve));return ie?(ee.m=S.get(ie[0].toLowerCase()),ve+ie[0].length):-1}function z(ee,se,ve){return M(ee,t,se,ve)}function K(ee,se,ve){return M(ee,n,se,ve)}function P(ee,se,ve){return M(ee,r,se,ve)}function H(ee){return o[ee.getDay()]}function Y(ee){return a[ee.getDay()]}function V(ee){return u[ee.getMonth()]}function D(ee){return l[ee.getMonth()]}function q(ee){return i[+(ee.getHours()>=12)]}function $(ee){return 1+~~(ee.getMonth()/3)}function F(ee){return o[ee.getUTCDay()]}function Q(ee){return a[ee.getUTCDay()]}function Z(ee){return u[ee.getUTCMonth()]}function te(ee){return l[ee.getUTCMonth()]}function ae(ee){return i[+(ee.getUTCHours()>=12)]}function re(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var se=A(ee+="",E);return se.toString=function(){return ee},se},parse:function(ee){var se=T(ee+="",!1);return se.toString=function(){return ee},se},utcFormat:function(ee){var se=A(ee+="",k);return se.toString=function(){return ee},se},utcParse:function(ee){var se=T(ee+="",!0);return se.toString=function(){return ee},se}}}var Z4={"-":"",_:" ",0:"0"},_r=/^\s*\d+/,tEe=/^%/,nEe=/[\\^$*+?|[\]().{}]/g;function Bt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function rEe(e){return e.replace(nEe,"\\$&")}function hm(e){return new RegExp("^(?:"+e.map(rEe).join("|")+")","i")}function mm(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function iEe(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function aEe(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function oEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function sEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function lEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function J4(e,t,n){var r=_r.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ez(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function cEe(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 uEe(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function dEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function tz(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function fEe(e,t,n){var r=_r.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function nz(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function hEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function mEe(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function pEe(e,t,n){var r=_r.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function gEe(e,t,n){var r=_r.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function vEe(e,t,n){var r=tEe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function yEe(e,t,n){var r=_r.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function xEe(e,t,n){var r=_r.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function rz(e,t){return Bt(e.getDate(),t,2)}function bEe(e,t){return Bt(e.getHours(),t,2)}function wEe(e,t){return Bt(e.getHours()%12||12,t,2)}function SEe(e,t){return Bt(1+vg.count(_s(e),e),t,3)}function q7(e,t){return Bt(e.getMilliseconds(),t,3)}function jEe(e,t){return q7(e,t)+"000"}function EEe(e,t){return Bt(e.getMonth()+1,t,2)}function _Ee(e,t){return Bt(e.getMinutes(),t,2)}function CEe(e,t){return Bt(e.getSeconds(),t,2)}function NEe(e){var t=e.getDay();return t===0?7:t}function kEe(e,t){return Bt(Fb.count(_s(e)-1,e),t,2)}function V7(e){var t=e.getDay();return t>=4||t===0?wf(e):wf.ceil(e)}function AEe(e,t){return e=V7(e),Bt(wf.count(_s(e),e)+(_s(e).getDay()===4),t,2)}function OEe(e){return e.getDay()}function TEe(e,t){return Bt(e0.count(_s(e)-1,e),t,2)}function PEe(e,t){return Bt(e.getFullYear()%100,t,2)}function MEe(e,t){return e=V7(e),Bt(e.getFullYear()%100,t,2)}function REe(e,t){return Bt(e.getFullYear()%1e4,t,4)}function DEe(e,t){var n=e.getDay();return e=n>=4||n===0?wf(e):wf.ceil(e),Bt(e.getFullYear()%1e4,t,4)}function IEe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Bt(t/60|0,"0",2)+Bt(t%60,"0",2)}function iz(e,t){return Bt(e.getUTCDate(),t,2)}function LEe(e,t){return Bt(e.getUTCHours(),t,2)}function zEe(e,t){return Bt(e.getUTCHours()%12||12,t,2)}function $Ee(e,t){return Bt(1+Bb.count(Cs(e),e),t,3)}function K7(e,t){return Bt(e.getUTCMilliseconds(),t,3)}function BEe(e,t){return K7(e,t)+"000"}function FEe(e,t){return Bt(e.getUTCMonth()+1,t,2)}function UEe(e,t){return Bt(e.getUTCMinutes(),t,2)}function HEe(e,t){return Bt(e.getUTCSeconds(),t,2)}function qEe(e){var t=e.getUTCDay();return t===0?7:t}function VEe(e,t){return Bt(Ub.count(Cs(e)-1,e),t,2)}function Y7(e){var t=e.getUTCDay();return t>=4||t===0?Sf(e):Sf.ceil(e)}function KEe(e,t){return e=Y7(e),Bt(Sf.count(Cs(e),e)+(Cs(e).getUTCDay()===4),t,2)}function YEe(e){return e.getUTCDay()}function XEe(e,t){return Bt(t0.count(Cs(e)-1,e),t,2)}function GEe(e,t){return Bt(e.getUTCFullYear()%100,t,2)}function WEe(e,t){return e=Y7(e),Bt(e.getUTCFullYear()%100,t,2)}function QEe(e,t){return Bt(e.getUTCFullYear()%1e4,t,4)}function ZEe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Sf(e):Sf.ceil(e),Bt(e.getUTCFullYear()%1e4,t,4)}function JEe(){return"+0000"}function az(){return"%"}function oz(e){return+e}function sz(e){return Math.floor(+e/1e3)}var Ad,X7,G7;e_e({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 e_e(e){return Ad=eEe(e),X7=Ad.format,Ad.parse,G7=Ad.utcFormat,Ad.utcParse,Ad}function t_e(e){return new Date(e)}function n_e(e){return e instanceof Date?+e:+new Date(+e)}function jO(e,t,n,r,i,a,o,l,u,d){var m=cO(),h=m.invert,g=m.domain,v=d(".%L"),b=d(":%S"),w=d("%I:%M"),S=d("%I %p"),j=d("%a %d"),C=d("%b %d"),E=d("%B"),k=d("%Y");function O(A){return(u(A)<A?v:l(A)<A?b:o(A)<A?w:a(A)<A?S:r(A)<A?i(A)<A?j:C:n(A)<A?E:k)(A)}return m.invert=function(A){return new Date(h(A))},m.domain=function(A){return arguments.length?g(Array.from(A,n_e)):g().map(t_e)},m.ticks=function(A){var T=g();return e(T[0],T[T.length-1],A??10)},m.tickFormat=function(A,T){return T==null?O:d(T)},m.nice=function(A){var T=g();return(!A||typeof A.range!="function")&&(A=t(T[0],T[T.length-1],A??10)),A?g(D7(T,A)):m},m.copy=function(){return gg(m,jO(e,t,n,r,i,a,o,l,u,d))},m}function r_e(){return Ma.apply(jO(Zje,Jje,_s,wO,Fb,vg,xO,vO,Hc,X7).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function i_e(){return Ma.apply(jO(Wje,Qje,Cs,SO,Ub,Bb,bO,yO,Hc,G7).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Hb(){var e=0,t=1,n,r,i,a,o=ni,l=!1,u;function d(h){return h==null||isNaN(h=+h)?u:o(i===0?.5:(h=(a(h)-n)*i,l?Math.max(0,Math.min(1,h)):h))}d.domain=function(h){return arguments.length?([e,t]=h,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),d):[e,t]},d.clamp=function(h){return arguments.length?(l=!!h,d):l},d.interpolator=function(h){return arguments.length?(o=h,d):o};function m(h){return function(g){var v,b;return arguments.length?([v,b]=g,o=h(v,b),d):[o(0),o(1)]}}return d.range=m(ps),d.rangeRound=m(lO),d.unknown=function(h){return arguments.length?(u=h,d):u},function(h){return a=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),d}}function ac(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function W7(){var e=ic(Hb()(ni));return e.copy=function(){return ac(e,W7())},Ds.apply(e,arguments)}function Q7(){var e=fO(Hb()).domain([1,10]);return e.copy=function(){return ac(e,Q7()).base(e.base())},Ds.apply(e,arguments)}function Z7(){var e=hO(Hb());return e.copy=function(){return ac(e,Z7()).constant(e.constant())},Ds.apply(e,arguments)}function EO(){var e=mO(Hb());return e.copy=function(){return ac(e,EO()).exponent(e.exponent())},Ds.apply(e,arguments)}function a_e(){return EO.apply(null,arguments).exponent(.5)}function J7(){var e=[],t=ni;function n(r){if(r!=null&&!isNaN(r=+r))return t((mg(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Bl),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>zSe(e,a/r))},n.copy=function(){return J7(t).domain(e)},Ds.apply(n,arguments)}function qb(){var e=0,t=.5,n=1,r=1,i,a,o,l,u,d=ni,m,h=!1,g;function v(w){return isNaN(w=+w)?g:(w=.5+((w=+m(w))-a)*(r*w<r*a?l:u),d(h?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([e,t,n]=w,i=m(e=+e),a=m(t=+t),o=m(n=+n),l=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(w){return arguments.length?(h=!!w,v):h},v.interpolator=function(w){return arguments.length?(d=w,v):d};function b(w){return function(S){var j,C,E;return arguments.length?([j,C,E]=S,d=vje(w,[j,C,E]),v):[d(0),d(.5),d(1)]}}return v.range=b(ps),v.rangeRound=b(lO),v.unknown=function(w){return arguments.length?(g=w,v):g},function(w){return m=w,i=w(e),a=w(t),o=w(n),l=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function eV(){var e=ic(qb()(ni));return e.copy=function(){return ac(e,eV())},Ds.apply(e,arguments)}function tV(){var e=fO(qb()).domain([.1,1,10]);return e.copy=function(){return ac(e,tV()).base(e.base())},Ds.apply(e,arguments)}function nV(){var e=hO(qb());return e.copy=function(){return ac(e,nV()).constant(e.constant())},Ds.apply(e,arguments)}function _O(){var e=mO(qb());return e.copy=function(){return ac(e,_O()).exponent(e.exponent())},Ds.apply(e,arguments)}function o_e(){return _O.apply(null,arguments).exponent(.5)}const Em=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:aO,scaleDiverging:eV,scaleDivergingLog:tV,scaleDivergingPow:_O,scaleDivergingSqrt:o_e,scaleDivergingSymlog:nV,scaleIdentity:R7,scaleImplicit:YC,scaleLinear:M7,scaleLog:I7,scaleOrdinal:iO,scalePoint:FSe,scalePow:pO,scaleQuantile:$7,scaleQuantize:B7,scaleRadial:z7,scaleSequential:W7,scaleSequentialLog:Q7,scaleSequentialPow:EO,scaleSequentialQuantile:J7,scaleSequentialSqrt:a_e,scaleSequentialSymlog:Z7,scaleSqrt:Bje,scaleSymlog:L7,scaleThreshold:F7,scaleTime:r_e,scaleUtc:i_e,tickFormat:P7},Symbol.toStringTag,{value:"Module"}));function s_e(e){if(e in Em)return Em[e]();var t="scale".concat(ng(e));if(t in Em)return Em[t]()}function lz(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=s_e(e);if(r!=null)return r.domain(t).range(n),r}}function CO(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?lz(e.scale,n,r):lz(t,n,r)}function l_e(e){return"scale".concat(ng(e))}function c_e(e){return l_e(e)in Em}var rV=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return c_e(r)?r:"point"}};function u_e(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function iV(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,l,u=u_e(r,a);if(u<=0)return n[0];if(u>=n.length)return n[n.length-1];var d=(o=r[u-1])!==null&&o!==void 0?o:0,m=(l=r[u])!==null&&l!==void 0?l:0;return Math.abs(a-d)<=Math.abs(a-m)?n[u-1]:n[u]}}}function d_e(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):iV(e,void 0)}function cz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function n0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cz(Object(n),!0).forEach(function(r){f_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f_e(e,t,n){return(t=h_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h_e(e){var t=m_e(e,"string");return typeof t=="symbol"?t:t+""}function m_e(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 ZC=[0,"auto"],sr={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"},aV=(e,t)=>e.cartesianAxis.xAxis[t],Is=(e,t)=>{var n=aV(e,t);return n??sr},lr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:ZC,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:og},oV=(e,t)=>e.cartesianAxis.yAxis[t],Ls=(e,t)=>{var n=oV(e,t);return n??lr},p_e={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:""},NO=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??p_e},Bn=(e,t,n)=>{switch(t){case"xAxis":return Is(e,n);case"yAxis":return Ls(e,n);case"zAxis":return NO(e,n);case"angleAxis":return ZA(e,n);case"radiusAxis":return JA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},g_e=(e,t,n)=>{switch(t){case"xAxis":return Is(e,n);case"yAxis":return Ls(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Jf=(e,t,n)=>{switch(t){case"xAxis":return Is(e,n);case"yAxis":return Ls(e,n);case"angleAxis":return ZA(e,n);case"radiusAxis":return JA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},sV=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function kO(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 Vb=e=>e.graphicalItems.cartesianItems,v_e=le([Mn,hg],kO),AO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),yg=le([Vb,Bn,v_e],AO,{memoizeOptions:{resultEqualityCheck:zb}}),lV=le([yg],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Ib)),cV=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),y_e=le([yg],cV),OO=e=>e.map(t=>t.data).filter(Boolean).flat(1),x_e=le([yg],OO,{memoizeOptions:{resultEqualityCheck:zb}}),TO=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},PO=le([x_e,VA],TO),MO=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:tn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:tn(i,r)}))):e.map(r=>({value:r})),xg=le([PO,Bn,yg],MO);function Xd(e){if(Ao(e)||e instanceof Date){var t=Number(e);if(Pt(t))return t}}function uz(e){if(Array.isArray(e)){var t=[Xd(e[0]),Xd(e[1])];return _o(t)?t:void 0}var n=Xd(e);if(n!=null)return[n,n]}function Ns(e){return e.map(Xd).filter(xi)}function b_e(e,t){var n=Xd(e),r=Xd(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var w_e=le([xg],e=>e==null?void 0:e.map(t=>t.value).sort(b_e));function uV(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function S_e(e,t,n){return!n||typeof t!="number"||ko(t)?[]:n.length?Ns(n.flatMap(r=>{var i=tn(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!Pt(a)||!Pt(o)))return[t-a,t+o]})):[]}var pr=e=>{var t=Er(e),n=Zf(e);return Jf(e,t,n)},bg=le([pr],e=>e==null?void 0:e.dataKey),j_e=le([lV,VA,pr],x7),dV=(e,t,n,r)=>{var i={},a=t.reduce((o,l)=>{if(l.stackId==null)return o;var u=o[l.stackId];return u==null&&(u=[]),u.push(l),o[l.stackId]=u,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[l,u]=o,d=r?[...u].reverse():u,m=d.map(tO);return[l,{stackedData:ube(e,m,n),graphicalItems:d}]}))},JC=le([j_e,lV,fg,f7],dV),fV=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=pbe(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},E_e=le([Bn],e=>e.allowDataOverflow),RO=e=>{var t;if(e==null||!("domain"in e))return ZC;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ns(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:ZC},DO=le([Bn],RO),IO=le([DO,E_e],J9),__e=le([JC,Rs,Mn,IO],fV,{memoizeOptions:{resultEqualityCheck:Lb}}),Kb=e=>e.errorBars,C_e=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>uV(n,r)),r0=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),l=Math.max(...a);return[o,l]}},LO=(e,t,n,r,i)=>{var a,o;if(n.length>0&&e.forEach(l=>{n.forEach(u=>{var d,m,h=(d=r[u.id])===null||d===void 0?void 0:d.filter(j=>uV(i,j)),g=tn(l,(m=t.dataKey)!==null&&m!==void 0?m:u.dataKey),v=S_e(l,g,h);if(v.length>=2){var b=Math.min(...v),w=Math.max(...v);(a==null||b<a)&&(a=b),(o==null||w>o)&&(o=w)}var S=uz(g);S!=null&&(a=a==null?S[0]:Math.min(a,S[0]),o=o==null?S[1]:Math.max(o,S[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var u=uz(tn(l,t.dataKey));u!=null&&(a=a==null?u[0]:Math.min(a,u[0]),o=o==null?u[1]:Math.max(o,u[1]))}),Pt(a)&&Pt(o))return[a,o]},N_e=le([PO,Bn,y_e,Kb,Mn],LO,{memoizeOptions:{resultEqualityCheck:Lb}});function k_e(e){var{value:t}=e;if(Ao(t)||t instanceof Date)return t}var A_e=(e,t,n)=>{var r=e.map(k_e).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&Sq(r))?Z9(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},hV=e=>e.referenceElements.dots,eh=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),O_e=le([hV,Mn,hg],eh),mV=e=>e.referenceElements.areas,T_e=le([mV,Mn,hg],eh),pV=e=>e.referenceElements.lines,P_e=le([pV,Mn,hg],eh),gV=(e,t)=>{if(e!=null){var n=Ns(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},M_e=le(O_e,Mn,gV),vV=(e,t)=>{if(e!=null){var n=Ns(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)]}},R_e=le([T_e,Mn],vV);function D_e(e){var t;if(e.x!=null)return Ns([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ns(n)}function I_e(e){var t;if(e.y!=null)return Ns([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ns(n)}var yV=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?D_e(r):I_e(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},L_e=le([P_e,Mn],yV),z_e=le(M_e,L_e,R_e,(e,t,n)=>r0(e,n,t)),zO=(e,t,n,r,i,a,o,l)=>{if(n!=null)return n;var u=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=u?r0(r,a,i):r0(a,i);return hSe(t,d,e.allowDataOverflow)},$_e=le([Bn,DO,IO,__e,N_e,z_e,Ft,Mn],zO,{memoizeOptions:{resultEqualityCheck:Lb}}),B_e=[0,1],$O=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:l,type:u}=e,d=Ts(t,a);if(d&&l==null){var m;return Z9(0,(m=n==null?void 0:n.length)!==null&&m!==void 0?m:0)}return u==="category"?A_e(r,e,d):i==="expand"?B_e:o}},BO=le([Bn,Ft,PO,xg,fg,Mn,$_e],$O),oc=le([Bn,sV,GA],rV),FO=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=RO(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&_o(e)){if(a)return x4(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return b4(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&_o(e))return x4(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&_o(e))return b4(e,t.tickCount,t.allowDecimals,"adaptive")}}},UO=le([BO,Jf,oc],FO),HO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&_o(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,u=t[1],d=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(u,d)]}return t},F_e=le([Bn,BO,UO,Mn],HO),U_e=le(xg,Bn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ns(e.map(h=>h.value))).sort((h,g)=>h-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var l=0;l<r.length-1;l++){var u=r[l],d=r[l+1];if(!(u==null||d==null)){var m=d-u;n=Math.min(n,m)}}return n/o}}),xV=le(U_e,Ft,d7,hr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Pt(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=Hr(n,e*a),l=e*a/2;return l-o-(l-o)/a*o}return 0}),H_e=(e,t,n)=>{var r=Is(e,t);return r==null||typeof r.padding!="string"?0:xV(e,"xAxis",t,n,r.padding)},q_e=(e,t,n)=>{var r=Ls(e,t);return r==null||typeof r.padding!="string"?0:xV(e,"yAxis",t,n,r.padding)},V_e=le(Is,H_e,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),K_e=le(Ls,q_e,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),Y_e=le([hr,V_e,Nb,Cb,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),X_e=le([hr,Ft,K_e,Nb,Cb,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),wg=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Y_e(e,n,r);case"yAxis":return X_e(e,n,r);case"zAxis":return(i=NO(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return g7(e);case"radiusAxis":return v7(e,n);default:return}},bV=le([Bn,wg],Mb),G_e=le([oc,F_e],b7),qO=le([Bn,oc,G_e,bV],CO),wV=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Ts(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},VO=le([Ft,xg,Jf,Mn],wV),Yb=le([qO],nO);le([qO],d_e);le([qO,w_e],iV);le([yg,Kb,Mn],C_e);function SV(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Xb=(e,t)=>t,Gb=(e,t,n)=>n,W_e=le(Eb,Xb,Gb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(SV)),Q_e=le(_b,Xb,Gb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(SV)),jV=(e,t)=>({width:e.width,height:t.height}),Z_e=(e,t)=>{var n=typeof t.width=="number"?t.width:og;return{width:n,height:e.height}},EV=le(hr,Is,jV),J_e=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},eCe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},tCe=le(Ms,hr,W_e,Xb,Gb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var u=jV(t,l);o==null&&(o=J_e(t,r,e));var d=r==="top"&&!i||r==="bottom"&&i;a[l.id]=o-Number(d)*u.height,o+=(d?-1:1)*u.height}),a}),nCe=le(Ps,hr,Q_e,Xb,Gb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var u=Z_e(t,l);o==null&&(o=eCe(t,r,e));var d=r==="left"&&!i||r==="right"&&i;a[l.id]=o-Number(d)*u.width,o+=(d?-1:1)*u.width}),a}),rCe=(e,t)=>{var n=Is(e,t);if(n!=null)return tCe(e,n.orientation,n.mirror)},iCe=le([hr,Is,rCe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),aCe=(e,t)=>{var n=Ls(e,t);if(n!=null)return nCe(e,n.orientation,n.mirror)},oCe=le([hr,Ls,aCe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),_V=le(hr,Ls,(e,t)=>{var n=typeof t.width=="number"?t.width:og;return{width:n,height:e.height}}),dz=(e,t,n)=>{switch(t){case"xAxis":return EV(e,n).width;case"yAxis":return _V(e,n).height;default:return}},CV=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=Ts(e,r),u=t.map(d=>d.value);if(o&&l&&a==="category"&&i&&Sq(u))return u}},KO=le([Ft,xg,Bn,Mn],CV),fz=le([Ft,g_e,oc,Yb,KO,VO,wg,UO,Mn],(e,t,n,r,i,a,o,l,u)=>{if(t!=null){var d=Ts(e,u);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:u,categoricalDomain:a,duplicateDomain:i,isCategorical:d,niceTicks:l,range:o,realScaleType:n,scale:r}}}),sCe=(e,t,n,r,i,a,o,l,u)=>{if(!(t==null||r==null)){var d=Ts(e,u),{type:m,ticks:h,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,b=m==="category"&&r.bandwidth?r.bandwidth()/v:0;b=u==="angleAxis"&&a!=null&&a.length>=2?wr(a[0]-a[1])*2*b:b;var w=h||i;return w?w.map((S,j)=>{var C=o?o.indexOf(S):S,E=r.map(C);return Pt(E)?{index:j,coordinate:E+b,value:S,offset:b}:null}).filter(xi):d&&l?l.map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(xi):r.ticks?r.ticks(g).map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(xi):r.domain().map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:o?o[S]:S,index:j,offset:b}:null}).filter(xi)}},NV=le([Ft,Jf,oc,Yb,UO,wg,KO,VO,Mn],sCe),lCe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=Ts(e,o),{tickCount:u}=t,d=0;return d=o==="angleAxis"&&(r==null?void 0:r.length)>=2?wr(r[0]-r[1])*2*d:d,l&&a?a.map((m,h)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:m,index:h,offset:d}:null}).filter(xi):n.ticks?n.ticks(u).map((m,h)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:m,index:h,offset:d}:null}).filter(xi):n.domain().map((m,h)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:i?i[m]:m,index:h,offset:d}:null}).filter(xi)}},Kl=le([Ft,Jf,Yb,wg,KO,VO,Mn],lCe),Yl=le(Bn,Yb,(e,t)=>{if(!(e==null||t==null))return n0(n0({},e),{},{scale:t})}),cCe=le([Bn,oc,BO,bV],CO),uCe=le([cCe],nO);le((e,t,n)=>NO(e,n),uCe,(e,t)=>{if(!(e==null||t==null))return n0(n0({},e),{},{scale:t})});var dCe=le([Ft,Eb,_b],(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}}),fCe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([fCe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var kV=e=>e.options.defaultTooltipEventType,AV=e=>e.options.validateTooltipEventTypes;function OV(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function YO(e,t){var n=kV(e),r=AV(e);return OV(t,n,r)}function hCe(e){return Be(t=>YO(t,e))}var TV=(e,t)=>{var n,r=Number(t);if(!(ko(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},mCe=e=>e.tooltip.settings,Cl={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},pCe={itemInteraction:{click:Cl,hover:Cl},axisInteraction:{click:Cl,hover:Cl},keyboardInteraction:Cl,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}},PV=Kr({name:"tooltip",initialState:pCe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:yn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ya(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:yn()},removeTooltipEntrySettings:{reducer(e,t){var n=ya(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:yn()},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:gCe,replaceTooltipEntrySettings:vCe,removeTooltipEntrySettings:yCe,setTooltipSettingsState:xCe,setActiveMouseOverItemIndex:MV,mouseLeaveItem:bCe,mouseLeaveChart:RV,setActiveClickItemIndex:wCe,setMouseOverAxisIndex:DV,setMouseClickAxisIndex:SCe,setSyncInteraction:eN,setKeyboardInteraction:i0}=PV.actions,jCe=PV.reducer;function hz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hz(Object(n),!0).forEach(function(r){ECe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ECe(e,t,n){return(t=_Ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Ce(e){var t=CCe(e,"string");return typeof t=="symbol"?t:t+""}function CCe(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 NCe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function kCe(e){return e.index!=null}var IV=(e,t,n,r)=>{if(t==null)return Cl;var i=NCe(e,t,n);if(i==null)return Cl;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(kCe(i)){if(a)return wy(wy({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return wy(wy({},Cl),{},{coordinate:i.coordinate})};function ACe(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 OCe(e,t){var n=ACe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function TCe(e,t,n){if(n==null||t==null)return!0;var r=tn(e,t);return r==null||!_o(n)?!0:OCe(r,n)}var XO=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Pt(a))return i;var o=0,l=1/0;t.length>0&&(l=t.length-1);var u=Math.max(o,Math.min(a,l)),d=t[u];return d==null||TCe(d,n,r)?String(u):null},LV=(e,t,n,r,i,a,o)=>{if(a!=null){var l=o[0],u=l==null?void 0:l.getPosition(a);if(u!=null)return u;var d=i==null?void 0:i[Number(a)];if(d)switch(n){case"horizontal":return{x:d.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:d.coordinate}}}},zV=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},$V=e=>e.options.tooltipPayloadSearcher,th=e=>e.tooltip;function mz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mz(Object(n),!0).forEach(function(r){PCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PCe(e,t,n){return(t=MCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MCe(e){var t=RCe(e,"string");return typeof t=="symbol"?t:t+""}function RCe(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 DCe(e){if(typeof e=="string"||typeof e=="number")return e}function ICe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function LCe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function gz(e){if(typeof e=="string")return e}function zCe(e){if(!(e==null||typeof e!="object")){var t="name"in e?DCe(e.name):void 0,n="unit"in e?ICe(e.unit):void 0,r="dataKey"in e?LCe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?gz(e.color):void 0,o="fill"in e?gz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function $Ce(e,t){return e??t}var BV=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:l,computedData:u,dataStartIndex:d,dataEndIndex:m}=n,h=[];return e.reduce((g,v)=>{var b,{dataDefinedOnItem:w,settings:S}=v,j=$Ce(w,l),C=Array.isArray(j)?y9(j,d,m):j,E=(b=S==null?void 0:S.dataKey)!==null&&b!==void 0?b:r,k=S==null?void 0:S.nameKey,O;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&o==="axis"?O=jq(C,r,i):O=a(C,t,u,k),Array.isArray(O))O.forEach(T=>{var M,B,I=zCe(T),U=I==null?void 0:I.name,L=I==null?void 0:I.dataKey,G=I==null?void 0:I.payload,z=pz(pz({},S),{},{name:U,unit:I==null?void 0:I.unit,color:(M=I==null?void 0:I.color)!==null&&M!==void 0?M:S==null?void 0:S.color,fill:(B=I==null?void 0:I.fill)!==null&&B!==void 0?B:S==null?void 0:S.fill});g.push(s3({tooltipEntrySettings:z,dataKey:L,payload:G,value:tn(G,L),name:U==null?void 0:String(U)}))});else{var A;g.push(s3({tooltipEntrySettings:S,dataKey:E,payload:O,value:tn(O,E),name:(A=tn(O,k))!==null&&A!==void 0?A:S==null?void 0:S.name}))}return g},h)}},GO=le([pr,sV,GA],rV),BCe=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),FCe=le([Er,Zf],kO),nh=le([BCe,pr,FCe],AO,{memoizeOptions:{resultEqualityCheck:zb}}),UCe=le([nh],e=>e.filter(Ib)),HCe=le([nh],OO,{memoizeOptions:{resultEqualityCheck:zb}}),rh=le([HCe,Rs],TO),qCe=le([UCe,Rs,pr],x7),WO=le([rh,pr,nh],MO),FV=le([pr],RO),VCe=le([pr],e=>e.allowDataOverflow),UV=le([FV,VCe],J9),KCe=le([nh],e=>e.filter(Ib)),YCe=le([qCe,KCe,fg,f7],dV),XCe=le([YCe,Rs,Er,UV],fV),GCe=le([nh],cV),WCe=le([rh,pr,GCe,Kb,Er],LO,{memoizeOptions:{resultEqualityCheck:Lb}}),QCe=le([hV,Er,Zf],eh),ZCe=le([QCe,Er],gV),JCe=le([mV,Er,Zf],eh),eNe=le([JCe,Er],vV),tNe=le([pV,Er,Zf],eh),nNe=le([tNe,Er],yV),rNe=le([ZCe,nNe,eNe],r0),iNe=le([pr,FV,UV,XCe,WCe,rNe,Ft,Er],zO),Sg=le([pr,Ft,rh,WO,fg,Er,iNe],$O),aNe=le([Sg,pr,GO],FO),oNe=le([pr,Sg,aNe,Er],HO),HV=e=>{var t=Er(e),n=Zf(e),r=!1;return wg(e,t,n,r)},qV=le([pr,HV],Mb),sNe=le([pr,GO,oNe,qV],CO),VV=le([sNe],nO),lNe=le([Ft,WO,pr,Er],CV),cNe=le([Ft,WO,pr,Er],wV),uNe=(e,t,n,r,i,a,o,l)=>{if(t){var{type:u}=t,d=Ts(e,l);if(r){var m=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,h=u==="category"&&r.bandwidth?r.bandwidth()/m:0;return h=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?wr(i[0]-i[1])*2*h:h,d&&o?o.map((g,v)=>{var b=r.map(g);return Pt(b)?{coordinate:b+h,value:g,index:v,offset:h}:null}).filter(xi):r.domain().map((g,v)=>{var b=r.map(g);return Pt(b)?{coordinate:b+h,value:a?a[g]:g,index:v,offset:h}:null}).filter(xi)}}},zs=le([Ft,pr,GO,VV,HV,lNe,cNe,Er],uNe),QO=le([kV,AV,mCe],(e,t,n)=>OV(n.shared,e,t)),KV=e=>e.tooltip.settings.trigger,ZO=e=>e.tooltip.settings.defaultIndex,jg=le([th,QO,KV,ZO],IV),Xl=le([jg,rh,bg,Sg],XO),YV=le([zs,Xl],TV),JO=le([jg],e=>{if(e)return e.dataKey}),XV=le([jg],e=>{if(e)return e.graphicalItemId}),GV=le([th,QO,KV,ZO],zV),dNe=le([Ps,Ms,Ft,hr,zs,ZO,GV],LV),fNe=le([jg,dNe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),hNe=le([jg],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),mNe=le([GV,Xl,Rs,bg,YV,$V,QO],BV),pNe=le([mNe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vz(Object(n),!0).forEach(function(r){gNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gNe(e,t,n){return(t=vNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vNe(e){var t=yNe(e,"string");return typeof t=="symbol"?t:t+""}function yNe(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 xNe=()=>Be(pr),bNe=()=>{var e=xNe(),t=Be(zs),n=Be(VV);return vf(!e||!n?void 0:yz(yz({},e),{},{scale:n}),t)};function xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Od(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xz(Object(n),!0).forEach(function(r){wNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wNe(e,t,n){return(t=SNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SNe(e){var t=jNe(e,"string");return typeof t=="symbol"?t:t+""}function jNe(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 ENe=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},_Ne=(e,t,n,r)=>{var i=t.find(d=>d&&d.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return Od(Od(Od({},r),Zn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:u}=r;return Od(Od(Od({},r),Zn(r.cx,r.cy,l,u)),{},{angle:u,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function CNe(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 WV=(e,t,n,r,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l<o;l++){var u,d,m,h,g,v=l>0?(u=n[l-1])===null||u===void 0?void 0:u.coordinate:(d=n[o-1])===null||d===void 0?void 0:d.coordinate,b=(m=n[l])===null||m===void 0?void 0:m.coordinate,w=l>=o-1?(h=n[0])===null||h===void 0?void 0:h.coordinate:(g=n[l+1])===null||g===void 0?void 0:g.coordinate,S=void 0;if(!(v==null||b==null||w==null))if(wr(b-v)!==wr(w-b)){var j=[];if(wr(w-b)===wr(i[1]-i[0])){S=w;var C=b+i[1]-i[0];j[0]=Math.min(C,(C+v)/2),j[1]=Math.max(C,(C+v)/2)}else{S=v;var E=w+i[1]-i[0];j[0]=Math.min(b,(E+b)/2),j[1]=Math.max(b,(E+b)/2)}var k=[Math.min(b,(S+b)/2),Math.max(b,(S+b)/2)];if(e>k[0]&&e<=k[1]||e>=j[0]&&e<=j[1]){var O;return(O=n[l])===null||O===void 0?void 0:O.index}}else{var A=Math.min(v,w),T=Math.max(v,w);if(e>(A+b)/2&&e<=(T+b)/2){var M;return(M=n[l])===null||M===void 0?void 0:M.index}}}else if(t)for(var B=0;B<o;B++){var I=t[B];if(I!=null){var U=t[B+1],L=t[B-1];if(B===0&&U!=null&&e<=(I.coordinate+U.coordinate)/2||B===o-1&&L!=null&&e>(I.coordinate+L.coordinate)/2||B>0&&B<o-1&&L!=null&&U!=null&&e>(I.coordinate+L.coordinate)/2&&e<=(I.coordinate+U.coordinate)/2)return I.index}}return-1},NNe=()=>Be(GA),e2=(e,t)=>t,QV=(e,t,n)=>n,t2=(e,t,n,r)=>r,kNe=le(zs,e=>mb(e,t=>t.coordinate)),n2=le([th,e2,QV,t2],IV),r2=le([n2,rh,bg,Sg],XO),ANe=(e,t,n)=>{if(t!=null){var r=th(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},ZV=le([th,e2,QV,t2],zV),a0=le([Ps,Ms,Ft,hr,zs,t2,ZV],LV),ONe=le([n2,a0],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),JV=le([zs,r2],TV),TNe=le([ZV,r2,Rs,bg,JV,$V,e2],BV),PNe=le([n2,r2],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),MNe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&CNe(e,o)){var l=gbe(e,t),u=WV(l,a,i,n,r),d=ENe(t,i,u,e);return{activeIndex:String(u),activeCoordinate:d}}},RNe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=nSe(e,n);if(l){var u=vbe(l,t),d=WV(u,o,a,r,i),m=_Ne(t,a,d,l);return{activeIndex:String(d),activeCoordinate:m}}}},DNe=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?MNe(e,t,r,i,a,o,l):RNe(e,t,n,r,i,a,o)},INe=le(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}}),LNe=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Jn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:CSe}});function bz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bz(Object(n),!0).forEach(function(r){zNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zNe(e,t,n){return(t=$Ne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ne(e){var t=BNe(e,"string");return typeof t=="symbol"?t:t+""}function BNe(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 FNe={},UNe={zIndexMap:Object.values(Jn).reduce((e,t)=>wz(wz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),FNe)},HNe=new Set(Object.values(Jn));function qNe(e){return HNe.has(e)}var eK=Kr({name:"zIndex",initialState:UNe,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:yn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!qNe(n)&&delete e.zIndexMap[n])},prepare:yn()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:yn()},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:yn()}}}),{registerZIndexPortal:VNe,unregisterZIndexPortal:KNe,registerZIndexPortalElement:YNe,unregisterZIndexPortalElement:XNe}=eK.actions,GNe=eK.reducer;function Si(e){var{zIndex:t,children:n}=e,r=Xbe(),i=r&&t!==void 0&&t!==0,a=Yr(),o=nn();y.useLayoutEffect(()=>i?(o(VNe({zIndex:t})),()=>{o(KNe({zIndex:t}))}):rc,[o,t,i]);var l=Be(u=>INe(u,t,a));return i?l?Ql.createPortal(n,l):null:n}function tN(){return tN=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},tN.apply(null,arguments)}function Sz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sz(Object(n),!0).forEach(function(r){WNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WNe(e,t,n){return(t=QNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QNe(e){var t=ZNe(e,"string");return typeof t=="symbol"?t:t+""}function ZNe(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 JNe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return y.isValidElement(t)?y.cloneElement(t,r):y.createElement(n,r)}function eke(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:l,cursor:u,tooltipEventType:d,chartName:m}=e,h=n,g=r,v=i;if(!u||!h||m!=="ScatterChart"&&d!=="axis")return null;var b,w,S;if(m==="ScatterChart")b=h,w=v1e,S=Jn.cursorLine;else if(m==="BarChart")b=y1e(l,h,a,o),w=Y9,S=Jn.cursorRectangle;else if(l==="radial"&&_q(h)){var{cx:j,cy:C,radius:E,startAngle:k,endAngle:O}=G9(h);b={cx:j,cy:C,startAngle:k,endAngle:O,innerRadius:E,outerRadius:E},w=Q9,S=Jn.cursorLine}else b={points:oSe(l,h,a)},w=qA,S=Jn.cursorLine;var A=typeof u=="object"&&"className"in u?u.className:void 0,T=Sy(Sy(Sy(Sy({stroke:"#ccc",pointerEvents:"none"},a),b),vu(u)),{},{payload:g,payloadIndex:v,className:It("recharts-tooltip-cursor",A)});return y.createElement(Si,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},y.createElement(JNe,{cursor:u,cursorComp:w,cursorProps:T}))}function tke(e){var t=bNe(),n=N9(),r=Iu(),i=NNe();return t==null||n==null||r==null||i==null?null:y.createElement(eke,tN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var tK=y.createContext(null),nke=()=>y.useContext(tK),$E={exports:{}},jz;function rke(){return jz||(jz=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(u,d,m){this.fn=u,this.context=d,this.once=m||!1}function a(u,d,m,h,g){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new i(m,h||u,g),b=n?n+d:d;return u._events[b]?u._events[b].fn?u._events[b]=[u._events[b],v]:u._events[b].push(v):(u._events[b]=v,u._eventsCount++),u}function o(u,d){--u._eventsCount===0?u._events=new r:delete u._events[d]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],m,h;if(this._eventsCount===0)return d;for(h in m=this._events)t.call(m,h)&&d.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},l.prototype.listeners=function(d){var m=n?n+d:d,h=this._events[m];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,v=h.length,b=new Array(v);g<v;g++)b[g]=h[g].fn;return b},l.prototype.listenerCount=function(d){var m=n?n+d:d,h=this._events[m];return h?h.fn?1:h.length:0},l.prototype.emit=function(d,m,h,g,v,b){var w=n?n+d:d;if(!this._events[w])return!1;var S=this._events[w],j=arguments.length,C,E;if(S.fn){switch(S.once&&this.removeListener(d,S.fn,void 0,!0),j){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,h),!0;case 4:return S.fn.call(S.context,m,h,g),!0;case 5:return S.fn.call(S.context,m,h,g,v),!0;case 6:return S.fn.call(S.context,m,h,g,v,b),!0}for(E=1,C=new Array(j-1);E<j;E++)C[E-1]=arguments[E];S.fn.apply(S.context,C)}else{var k=S.length,O;for(E=0;E<k;E++)switch(S[E].once&&this.removeListener(d,S[E].fn,void 0,!0),j){case 1:S[E].fn.call(S[E].context);break;case 2:S[E].fn.call(S[E].context,m);break;case 3:S[E].fn.call(S[E].context,m,h);break;case 4:S[E].fn.call(S[E].context,m,h,g);break;default:if(!C)for(O=1,C=new Array(j-1);O<j;O++)C[O-1]=arguments[O];S[E].fn.apply(S[E].context,C)}}return!0},l.prototype.on=function(d,m,h){return a(this,d,m,h,!1)},l.prototype.once=function(d,m,h){return a(this,d,m,h,!0)},l.prototype.removeListener=function(d,m,h,g){var v=n?n+d:d;if(!this._events[v])return this;if(!m)return o(this,v),this;var b=this._events[v];if(b.fn)b.fn===m&&(!g||b.once)&&(!h||b.context===h)&&o(this,v);else{for(var w=0,S=[],j=b.length;w<j;w++)(b[w].fn!==m||g&&!b[w].once||h&&b[w].context!==h)&&S.push(b[w]);S.length?this._events[v]=S.length===1?S[0]:S:o(this,v)}return this},l.prototype.removeAllListeners=function(d){var m;return d?(m=n?n+d:d,this._events[m]&&o(this,m)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})($E)),$E.exports}var ike=rke();const ake=Gi(ike);var ap=new ake,nN="recharts.syncEvent.tooltip",Ez="recharts.syncEvent.brush",i2=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ko(n))return e[n]}},oke={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},nK=Kr({name:"options",initialState:oke,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),ske=nK.reducer,{createEventEmitter:lke}=nK.actions;function cke(e){return e.tooltip.syncInteraction}var uke={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},rK=Kr({name:"chartData",initialState:uke,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:_z,setDataStartEndIndexes:dke,setComputedData:vBe}=rK.actions,fke=rK.reducer,hke=["x","y"];function Cz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Td(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cz(Object(n),!0).forEach(function(r){mke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mke(e,t,n){return(t=pke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pke(e){var t=gke(e,"string");return typeof t=="symbol"?t:t+""}function gke(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 vke(e,t){if(e==null)return{};var n,r,i=yke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yke(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 xke(){var e=Be(WA),t=Be(QA),n=nn(),r=Be(h7),i=Be(zs),a=Iu(),o=kb(),l=Be(u=>u.rootProps.className);y.useEffect(()=>{if(e==null)return rc;var u=(d,m,h)=>{if(t!==h&&e===d){if(r==="index"){var g;if(o&&m!==null&&m!==void 0&&(g=m.payload)!==null&&g!==void 0&&g.coordinate&&m.payload.sourceViewBox){var v=m.payload.coordinate,{x:b,y:w}=v,S=vke(v,hke),{x:j,y:C,width:E,height:k}=m.payload.sourceViewBox,O=Td(Td({},S),{},{x:o.x+(E?(b-j)/E:0)*o.width,y:o.y+(k?(w-C)/k:0)*o.height});n(Td(Td({},m),{},{payload:Td(Td({},m.payload),{},{coordinate:O})}))}else n(m);return}if(i!=null){var A;if(typeof r=="function"){var T={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},M=r(i,T);A=i[M]}else r==="value"&&(A=i.find(P=>String(P.value)===m.payload.label));var{coordinate:B}=m.payload;if(A==null||m.payload.active===!1||B==null||o==null){n(eN({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:I,y:U}=B,L=Math.min(I,o.x+o.width),G=Math.min(U,o.y+o.height),z={x:a==="horizontal"?A.coordinate:L,y:a==="horizontal"?G:A.coordinate},K=eN({active:m.payload.active,coordinate:z,dataKey:m.payload.dataKey,index:String(A.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(K)}}};return ap.on(nN,u),()=>{ap.off(nN,u)}},[l,n,t,e,r,i,a,o])}function bke(){var e=Be(WA),t=Be(QA),n=nn();y.useEffect(()=>{if(e==null)return rc;var r=(i,a,o)=>{t!==o&&e===i&&n(dke(a))};return ap.on(Ez,r),()=>{ap.off(Ez,r)}},[n,t,e])}function wke(){var e=nn();y.useEffect(()=>{e(lke())},[e]),xke(),bke()}function Ske(e,t,n,r,i,a){var o=Be(b=>ANe(b,e,t)),l=Be(XV),u=Be(QA),d=Be(WA),m=Be(h7),h=Be(cke),g=h==null?void 0:h.active,v=kb();y.useEffect(()=>{if(!g&&d!=null&&u!=null){var b=eN({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:l});ap.emit(nN,d,b,u)}},[g,n,o,l,i,r,u,d,m,a,v])}function Nz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nz(Object(n),!0).forEach(function(r){jke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jke(e,t,n){return(t=Eke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eke(e){var t=_ke(e,"string");return typeof t=="symbol"?t:t+""}function _ke(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 Cke(e){return e.dataKey}function Nke(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(Kwe,t)}var Az=[],kke={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 iK(e){var t,n,r=tr(e,kke),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:l,content:u,filterNull:d,isAnimationActive:m,offset:h,payloadUniqBy:g,position:v,reverseDirection:b,useTranslate3d:w,wrapperStyle:S,cursor:j,shared:C,trigger:E,defaultIndex:k,portal:O,axisId:A}=r,T=nn(),M=typeof k=="number"?String(k):k;y.useEffect(()=>{T(xCe({shared:C,trigger:E,axisId:A,active:i,defaultIndex:M}))},[T,C,E,A,i,M]);var B=kb(),I=U9(),U=hCe(C),{activeIndex:L,isActive:G}=(t=Be(re=>PNe(re,U,E,M)))!==null&&t!==void 0?t:{},z=Be(re=>TNe(re,U,E,M)),K=Be(re=>JV(re,U,E,M)),P=Be(re=>ONe(re,U,E,M)),H=z,Y=nke(),V=(n=i??G)!==null&&n!==void 0?n:!1,[D,q]=Uq([H,V]),$=U==="axis"?K:void 0;Ske(U,E,P,$,L,V);var F=O??Y;if(F==null||B==null||U==null)return null;var Q=H??Az;V||(Q=Az),d&&Q.length&&(Q=Iq(Q.filter(re=>re.value!=null&&(re.hide!==!0||r.includeHidden)),g,Cke));var Z=Q.length>0,te=kz(kz({},r),{},{payload:Q,label:$,active:V,activeIndex:L,coordinate:P,accessibilityLayer:I}),ae=y.createElement(r1e,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:m,active:V,coordinate:P,hasPayload:Z,offset:h,position:v,reverseDirection:b,useTranslate3d:w,viewBox:B,wrapperStyle:S,lastBoundingBox:D,innerRef:q,hasPortalFromProps:!!O},Nke(u,te));return y.createElement(y.Fragment,null,Ql.createPortal(ae,F),V&&y.createElement(tke,{cursor:j,tooltipEventType:U,coordinate:P,payload:Q,index:L}))}var Eg=e=>null;Eg.displayName="Cell";function Ake(e,t,n){return(t=Oke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oke(e){var t=Tke(e,"string");return typeof t=="symbol"?t:t+""}function Tke(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 Pke{constructor(t){Ake(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 Oz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oz(Object(n),!0).forEach(function(r){Rke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rke(e,t,n){return(t=Dke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dke(e){var t=Ike(e,"string");return typeof t=="symbol"?t:t+""}function Ike(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 Lke={cacheSize:2e3,enableCache:!0},aK=Mke({},Lke),Tz=new Pke(aK.cacheSize),zke={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Pz="recharts_measurement_span";function $ke(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(l)}var Mz=(e,t)=>{try{var n=document.getElementById(Pz);n||(n=document.createElement("span"),n.setAttribute("id",Pz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,zke,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Rm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||cg.isSsr)return{width:0,height:0};if(!aK.enableCache)return Mz(t,n);var r=$ke(t,n),i=Tz.get(r);if(i)return i;var a=Mz(t,n);return Tz.set(r,a),a},oK;function Bke(e,t,n){return(t=Fke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fke(e){var t=Uke(e,"string");return typeof t=="symbol"?t:t+""}function Uke(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 Rz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Dz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Hke=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,qke=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Vke={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Kke=["cm","mm","pt","pc","in","Q","px"];function Yke(e){return Kke.includes(e)}var Bd="NaN";function Xke(e,t){return e*Vke[t]}class Mr{static parse(t){var n,[,r,i]=(n=qke.exec(t))!==null&&n!==void 0?n:[];return r==null?Mr.NaN:new Mr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ko(t)&&(this.unit=""),n!==""&&!Hke.test(n)&&(this.num=NaN,this.unit=""),Yke(n)&&(this.num=Xke(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Mr(NaN,""):new Mr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Mr(NaN,""):new Mr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Mr(NaN,""):new Mr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Mr(NaN,""):new Mr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ko(this.num)}}oK=Mr;Bke(Mr,"NaN",new oK(NaN,""));function sK(e){if(e==null||e.includes(Bd))return Bd;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=Rz.exec(t))!==null&&n!==void 0?n:[],o=Mr.parse(r??""),l=Mr.parse(a??""),u=i==="*"?o.multiply(l):o.divide(l);if(u.isNaN())return Bd;t=t.replace(Rz,u.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,m,h,g]=(d=Dz.exec(t))!==null&&d!==void 0?d:[],v=Mr.parse(m??""),b=Mr.parse(g??""),w=h==="+"?v.add(b):v.subtract(b);if(w.isNaN())return Bd;t=t.replace(Dz,w.toString())}return t}var Iz=/\(([^()]*)\)/;function Gke(e){for(var t=e,n;(n=Iz.exec(t))!=null;){var[,r]=n;t=t.replace(Iz,sK(r))}return t}function Wke(e){var t=e.replace(/\s+/g,"");return t=Gke(t),t=sK(t),t}function Qke(e){try{return Wke(e)}catch{return Bd}}function BE(e){var t=Qke(e.slice(5,-1));return t===Bd?"":t}var Zke=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Jke=["dx","dy","angle","className","breakAll"];function rN(){return rN=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},rN.apply(null,arguments)}function Lz(e,t){if(e==null)return{};var n,r,i=eAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eAe(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 lK=/[ \f\n\r\t\v\u2028\u2029]+/,cK=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Nn(t)||(n?i=t.toString().split(""):i=t.toString().split(lK));var a=i.map(l=>({word:l,width:Rm(l,r).width})),o=n?0:Rm(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function uK(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function tAe(e){return Nn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var dK=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:l}=a,u=i[i.length-1];if(u&&l!=null&&(t==null||r||u.width+l+n<Number(t)))u.words.push(o),u.width+=l+n;else{var d={words:[o],width:l};i.push(d)}return i},[]),fK=e=>e.reduce((t,n)=>t.width>n.width?t:n),nAe="…",zz=(e,t,n,r,i,a,o,l)=>{var u=e.slice(0,t),d=cK({breakAll:n,style:r,children:u+nAe});if(!d)return[!1,[]];var m=dK(d.wordsWithComputedWidth,a,o,l),h=m.length>i||fK(m).width>Number(a);return[h,m]},rAe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:u}=e,d=Ie(a),m=String(o),h=dK(t,r,n,i);if(!d||i)return h;var g=h.length>a||fK(h).width>Number(r);if(!g)return h;for(var v=0,b=m.length-1,w=0,S;v<=b&&w<=m.length-1;){var j=Math.floor((v+b)/2),C=j-1,[E,k]=zz(m,C,u,l,a,r,n,i),[O]=zz(m,j,u,l,a,r,n,i);if(!E&&!O&&(v=j+1),E&&O&&(b=j-1),!E&&O){S=k;break}w++}return S||h},$z=e=>{var t=Nn(e)?[]:e.toString().split(lK);return[{words:t,width:void 0}]},iAe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!cg.isSsr){var l,u,d=cK({breakAll:a,children:r,style:i});if(d){var{wordsWithComputedWidth:m,spaceWidth:h}=d;l=m,u=h}else return $z(r);return rAe({breakAll:a,children:r,maxLines:o,style:i},l,u,t,!!n)}return $z(r)},hK="#808080",aAe={angle:0,breakAll:!1,capHeight:"0.71em",fill:hK,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Wb=y.forwardRef((e,t)=>{var n=tr(e,aAe),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:u,textAnchor:d,verticalAnchor:m}=n,h=Lz(n,Zke),g=y.useMemo(()=>iAe({breakAll:h.breakAll,children:h.children,maxLines:h.maxLines,scaleToFit:u,style:h.style,width:h.width}),[h.breakAll,h.children,h.maxLines,u,h.style,h.width]),{dx:v,dy:b,angle:w,className:S,breakAll:j}=h,C=Lz(h,Jke);if(!Ao(r)||!Ao(i)||g.length===0)return null;var E=Number(r)+(Ie(v)?v:0),k=Number(i)+(Ie(b)?b:0);if(!Pt(E)||!Pt(k))return null;var O;switch(m){case"start":O=BE("calc(".concat(o,")"));break;case"middle":O=BE("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=BE("calc(".concat(g.length-1," * -").concat(a,")"));break}var A=[],T=g[0];if(u&&T!=null){var M=T.width,{width:B}=h;A.push("scale(".concat(Ie(B)&&Ie(M)?B/M:1,")"))}return w&&A.push("rotate(".concat(w,", ").concat(E,", ").concat(k,")")),A.length&&(C.transform=A.join(" ")),y.createElement("text",rN({},ri(C),{ref:t,x:E,y:k,className:It("recharts-text",S),textAnchor:d,fill:l.includes("url")?hK:l}),g.map((I,U)=>{var L=I.words.join(j?"":" ");return y.createElement("tspan",{x:E,dy:U===0?O:a,key:"".concat(L,"-").concat(U)},L)}))});Wb.displayName="Text";function Bz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ho(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bz(Object(n),!0).forEach(function(r){oAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oAe(e,t,n){return(t=sAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sAe(e){var t=lAe(e,"string");return typeof t=="symbol"?t:t+""}function lAe(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 cAe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:u,lowerWidth:d}=$A(t),m=a,h=a+(u-d)/2,g=(m+h)/2,v=(u+d)/2,b=m+u/2,w=l>=0?1:-1,S=w*r,j=w>0?"end":"start",C=w>0?"start":"end",E=u>=0?1:-1,k=E*r,O=E>0?"end":"start",A=E>0?"start":"end",T=i;if(n==="top"){var M={x:m+u/2,y:o-S,horizontalAnchor:"middle",verticalAnchor:j};return T&&(M.height=Math.max(o-T.y,0),M.width=u),M}if(n==="bottom"){var B={x:h+d/2,y:o+l+S,horizontalAnchor:"middle",verticalAnchor:C};return T&&(B.height=Math.max(T.y+T.height-(o+l),0),B.width=d),B}if(n==="left"){var I={x:g-k,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"};return T&&(I.width=Math.max(I.x-T.x,0),I.height=l),I}if(n==="right"){var U={x:g+v+k,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"};return T&&(U.width=Math.max(T.x+T.width-U.x,0),U.height=l),U}var L=T?{width:v,height:l}:{};return n==="insideLeft"?ho({x:g+k,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"},L):n==="insideRight"?ho({x:g+v-k,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"},L):n==="insideTop"?ho({x:m+u/2,y:o+S,horizontalAnchor:"middle",verticalAnchor:C},L):n==="insideBottom"?ho({x:h+d/2,y:o+l-S,horizontalAnchor:"middle",verticalAnchor:j},L):n==="insideTopLeft"?ho({x:m+k,y:o+S,horizontalAnchor:A,verticalAnchor:C},L):n==="insideTopRight"?ho({x:m+u-k,y:o+S,horizontalAnchor:O,verticalAnchor:C},L):n==="insideBottomLeft"?ho({x:h+k,y:o+l-S,horizontalAnchor:A,verticalAnchor:j},L):n==="insideBottomRight"?ho({x:h+d-k,y:o+l-S,horizontalAnchor:O,verticalAnchor:j},L):n&&typeof n=="object"&&(Ie(n.x)||bu(n.x))&&(Ie(n.y)||bu(n.y))?ho({x:a+Hr(n.x,v),y:o+Hr(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},L):ho({x:b,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},uAe=["labelRef"],dAe=["content"];function Fz(e,t){if(e==null)return{};var n,r,i=fAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fAe(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 Uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _m(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uz(Object(n),!0).forEach(function(r){hAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hAe(e,t,n){return(t=mAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mAe(e){var t=pAe(e,"string");return typeof t=="symbol"?t:t+""}function pAe(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 us(){return us=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},us.apply(null,arguments)}var mK=y.createContext(null),gAe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:l}=e,u=y.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return y.createElement(mK.Provider,{value:u},l)},pK=()=>{var e=y.useContext(mK),t=kb();return e||(t?$A(t):void 0)},vAe=y.createContext(null),yAe=()=>{var e=y.useContext(vAe),t=Be(y7);return e||t},xAe=e=>{var{value:t,formatter:n}=e,r=Nn(e.children)?t:e.children;return typeof n=="function"?n(r):r},a2=e=>e!=null&&typeof e=="function",bAe=(e,t)=>{var n=wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},wAe=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:l,cy:u,innerRadius:d,outerRadius:m,startAngle:h,endAngle:g,clockWise:v}=i,b=(d+m)/2,w=bAe(h,g),S=w>=0?1:-1,j,C;switch(t){case"insideStart":j=h+S*a,C=v;break;case"insideEnd":j=g-S*a,C=!v;break;case"end":j=g+S*a,C=v;break;default:throw new Error("Unsupported position ".concat(t))}C=w<=0?C:!C;var E=Zn(l,u,b,j),k=Zn(l,u,b,j+(C?1:-1)*359),O="M".concat(E.x,",").concat(E.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
    `).concat(k.x,",").concat(k.y),A=Nn(e.id)?Ym("recharts-radial-line-"):e.id;return y.createElement("text",us({},r,{dominantBaseline:"central",className:It("recharts-radial-bar-label",o)}),y.createElement("defs",null,y.createElement("path",{id:A,d:O})),y.createElement("textPath",{xlinkHref:"#".concat(A)},n))},SAe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:l,endAngle:u}=e,d=(l+u)/2;if(n==="outside"){var{x:m,y:h}=Zn(r,i,o+t,d);return{x:m,y:h,textAnchor:m>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var g=(a+o)/2,{x:v,y:b}=Zn(r,i,g,d);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Ky=e=>e!=null&&"cx"in e&&Ie(e.cx),jAe={angle:0,offset:5,zIndex:Jn.label,position:"middle",textBreakAll:!1};function EAe(e){if(!Ky(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function El(e){var t=tr(e,jAe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:u="",textBreakAll:d,labelRef:m}=t,h=yAe(),g=pK(),v=i==="center"?g:h??g,b,w,S;n==null?b=v:Ky(n)?b=n:b=$A(n);var j=EAe(b);if(!b||Nn(a)&&Nn(o)&&!y.isValidElement(l)&&typeof l!="function")return null;var C=_m(_m({},t),{},{viewBox:b});if(y.isValidElement(l)){var{labelRef:E}=C,k=Fz(C,uAe);return y.cloneElement(l,k)}if(typeof l=="function"){var{content:O}=C,A=Fz(C,dAe);if(w=y.createElement(l,A),y.isValidElement(w))return w}else w=xAe(t);var T=ri(t);if(Ky(b)){if(i==="insideStart"||i==="insideEnd"||i==="end")return wAe(t,i,w,T,b);S=SAe(b,t.offset,t.position)}else{if(!j)return null;var M=cAe({viewBox:j,position:i,offset:t.offset,parentViewBox:Ky(r)?void 0:r});S=_m(_m({x:M.x,y:M.y,textAnchor:M.horizontalAnchor,verticalAnchor:M.verticalAnchor},M.width!==void 0?{width:M.width}:{}),M.height!==void 0?{height:M.height}:{})}return y.createElement(Si,{zIndex:t.zIndex},y.createElement(Wb,us({ref:m,className:It("recharts-label",u)},T,S,{textAnchor:uK(T.textAnchor)?T.textAnchor:S.textAnchor,breakAll:d}),w))}El.displayName="Label";var _Ae=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?y.createElement(El,us({key:"label-implicit"},r)):Ao(e)?y.createElement(El,us({key:"label-implicit",value:e},r)):y.isValidElement(e)?e.type===El?y.cloneElement(e,_m({key:"label-implicit"},r)):y.createElement(El,us({key:"label-implicit",content:e},r)):a2(e)?y.createElement(El,us({key:"label-implicit",content:e},r)):e&&typeof e=="object"?y.createElement(El,us({},e,{key:"label-implicit"},r)):null};function CAe(e){var{label:t,labelRef:n}=e,r=pK();return _Ae(t,r,n)||null}var NAe=["valueAccessor"],kAe=["dataKey","clockWise","id","textBreakAll","zIndex"];function o0(){return o0=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},o0.apply(null,arguments)}function Hz(e,t){if(e==null)return{};var n,r,i=AAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function AAe(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 OAe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(tAe(t))return t},gK=y.createContext(void 0),vK=gK.Provider,yK=y.createContext(void 0),TAe=yK.Provider;function PAe(){return y.useContext(gK)}function MAe(){return y.useContext(yK)}function Yy(e){var{valueAccessor:t=OAe}=e,n=Hz(e,NAe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,u=Hz(n,kAe),d=PAe(),m=MAe(),h=d||m;return!h||!h.length?null:y.createElement(Si,{zIndex:l??Jn.label},y.createElement(fr,{className:"recharts-label-list"},h.map((g,v)=>{var b,w=Nn(r)?t(g,v):tn(g.payload,r),S=Nn(a)?{}:{id:"".concat(a,"-").concat(v)};return y.createElement(El,o0({key:"label-".concat(v)},ri(g),u,S,{fill:(b=n.fill)!==null&&b!==void 0?b:g.fill,parentViewBox:g.parentViewBox,value:w,textBreakAll:o,viewBox:g.viewBox,index:v,zIndex:0}))})))}Yy.displayName="LabelList";function o2(e){var{label:t}=e;return t?t===!0?y.createElement(Yy,{key:"labelList-implicit"}):y.isValidElement(t)||a2(t)?y.createElement(Yy,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(Yy,o0({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function iN(){return iN=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},iN.apply(null,arguments)}var xK=e=>{var{cx:t,cy:n,r,className:i}=e,a=It("recharts-dot",i);return Ie(t)&&Ie(n)&&Ie(r)?y.createElement("circle",iN({},Vi(e),NA(e),{className:a,cx:t,cy:n,r})):null},bK=e=>e.graphicalItems.polarItems,RAe=le([Mn,hg],kO),Qb=le([bK,Bn,RAe],AO),DAe=le([Qb],OO),Zb=le([DAe,Pb],TO),IAe=le([Zb,Bn,Qb],MO);le([Zb,Bn,Qb],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=tn(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:tn(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var qz=()=>{},LAe=le([Zb,Bn,Qb,Kb,Mn],LO),zAe=le([Bn,DO,IO,qz,LAe,qz,Ft,Mn],zO),wK=le([Bn,Ft,Zb,IAe,fg,Mn,zAe],$O),$Ae=le([wK,Jf,oc],FO),BAe=le([Bn,wK,$Ae,Mn],HO);le([oc,BAe],b7);var FAe={radiusAxis:{},angleAxis:{}},SK=Kr({name:"polarAxis",initialState:FAe,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:yBe,removeRadiusAxis:xBe,addAngleAxis:bBe,removeAngleAxis:wBe}=SK.actions,UAe=SK.reducer;function jK(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function Vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vz(Object(n),!0).forEach(function(r){HAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HAe(e,t,n){return(t=qAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qAe(e){var t=VAe(e,"string");return typeof t=="symbol"?t:t+""}function VAe(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 KAe=(e,t)=>t,s2=le([bK,KAe],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),YAe=[],l2=(e,t,n)=>(n==null?void 0:n.length)===0?YAe:n,EK=le([Pb,s2,l2],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(a=>Kz(Kz({},t.presentationProps),a.props))),i!=null)return i}}),XAe=le([EK,s2,l2],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=tn(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:Xf(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),GAe=le([EK,s2,l2,hr],(e,t,n,r)=>{if(!(t==null||e==null))return JOe({offset:r,pieSettings:t,displayedData:e,cells:n})}),FE={exports:{}},Jt={};/**
 * @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 Yz;function WAe(){if(Yz)return Jt;Yz=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),v=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 i:case r:case u:case d:case g:return w;default:switch(w=w&&w.$$typeof,w){case o:case l:case h:case m:return w;case a:return w;default:return S}}case t:return S}}}return Jt.ContextConsumer=a,Jt.ContextProvider=o,Jt.Element=e,Jt.ForwardRef=l,Jt.Fragment=n,Jt.Lazy=h,Jt.Memo=m,Jt.Portal=t,Jt.Profiler=i,Jt.StrictMode=r,Jt.Suspense=u,Jt.SuspenseList=d,Jt.isContextConsumer=function(w){return b(w)===a},Jt.isContextProvider=function(w){return b(w)===o},Jt.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Jt.isForwardRef=function(w){return b(w)===l},Jt.isFragment=function(w){return b(w)===n},Jt.isLazy=function(w){return b(w)===h},Jt.isMemo=function(w){return b(w)===m},Jt.isPortal=function(w){return b(w)===t},Jt.isProfiler=function(w){return b(w)===i},Jt.isStrictMode=function(w){return b(w)===r},Jt.isSuspense=function(w){return b(w)===u},Jt.isSuspenseList=function(w){return b(w)===d},Jt.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===i||w===r||w===u||w===d||typeof w=="object"&&w!==null&&(w.$$typeof===h||w.$$typeof===m||w.$$typeof===o||w.$$typeof===a||w.$$typeof===l||w.$$typeof===v||w.getModuleId!==void 0)},Jt.typeOf=b,Jt}var Xz;function QAe(){return Xz||(Xz=1,FE.exports=WAe()),FE.exports}var ZAe=QAe(),Gz=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Wz=null,UE=null,_K=e=>{if(e===Wz&&Array.isArray(UE))return UE;var t=[];return y.Children.forEach(e,n=>{Nn(n)||(ZAe.isFragment(n)?t=t.concat(_K(n.props.children)):t.push(n))}),UE=t,Wz=e,t};function c2(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>Gz(i)):r=[Gz(t)],_K(e).forEach(i=>{var a=xu(i,"type.displayName")||xu(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var CK=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,HE={},Qz;function JAe(){return Qz||(Qz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var i;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const a=n[Symbol.toStringTag];return a==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${a}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(HE)),HE}var qE,Zz;function eOe(){return Zz||(Zz=1,qE=JAe().isPlainObject),qE}var tOe=eOe();const nOe=Gi(tOe);var Jz,e5,t5,n5,r5;function i5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function a5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i5(Object(n),!0).forEach(function(r){rOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rOe(e,t,n){return(t=iOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iOe(e){var t=aOe(e,"string");return typeof t=="symbol"?t:t+""}function aOe(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 s0(){return s0=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},s0.apply(null,arguments)}function pm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var o5=(e,t,n,r,i)=>{var a=n-r,o;return o=zn(Jz||(Jz=pm(["M ",",",""])),e,t),o+=zn(e5||(e5=pm(["L ",",",""])),e+n,t),o+=zn(t5||(t5=pm(["L ",",",""])),e+n-a/2,t+i),o+=zn(n5||(n5=pm(["L ",",",""])),e+n-a/2-r,t+i),o+=zn(r5||(r5=pm(["L ",","," Z"])),e,t),o},oOe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},sOe=e=>{var t=tr(e,oOe),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:u,animationDuration:d,animationBegin:m,isUpdateAnimationActive:h}=t,g=y.useRef(null),[v,b]=y.useState(-1),w=y.useRef(i),S=y.useRef(a),j=y.useRef(o),C=y.useRef(n),E=y.useRef(r),k=dg(e,"trapezoid-");if(y.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var z=g.current.getTotalLength();z&&b(z)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var O=It("recharts-trapezoid",l);if(!h)return y.createElement("g",null,y.createElement("path",s0({},ri(t),{className:O,d:o5(n,r,i,a,o)})));var A=w.current,T=S.current,M=j.current,B=C.current,I=E.current,U="0px ".concat(v===-1?1:v,"px"),L="".concat(v,"px ").concat(v,"px"),G=H9(["strokeDasharray"],d,u);return y.createElement(ug,{animationId:k,key:k,canBegin:v>0,duration:d,easing:u,isActive:h,begin:m},z=>{var K=Sn(A,i,z),P=Sn(T,a,z),H=Sn(M,o,z),Y=Sn(B,n,z),V=Sn(I,r,z);g.current&&(w.current=K,S.current=P,j.current=H,C.current=Y,E.current=V);var D=z>0?{transition:G,strokeDasharray:L}:{strokeDasharray:U};return y.createElement("path",s0({},ri(t),{className:O,d:o5(Y,V,K,P,H),ref:g,style:a5(a5({},D),t.style)}))})},lOe=["option","shapeType","activeClassName","inActiveClassName"];function cOe(e,t){if(e==null)return{};var n,r,i=uOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uOe(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 s5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function l0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s5(Object(n),!0).forEach(function(r){dOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dOe(e,t,n){return(t=fOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fOe(e){var t=hOe(e,"string");return typeof t=="symbol"?t:t+""}function hOe(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 mOe(e,t){return l0(l0({},t),e)}function pOe(e,t){return e==="symbols"}function l5(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return y.createElement(Y9,n);case"trapezoid":return y.createElement(sOe,n);case"sector":return y.createElement(Q9,n);case"symbols":if(pOe(t))return y.createElement(CA,n);break;case"curve":return y.createElement(qA,n);default:return null}}function gOe(e){return y.isValidElement(e)?e.props:e}function u2(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=cOe(e,lOe),o;if(y.isValidElement(t))o=y.cloneElement(t,l0(l0({},a),gOe(t)));else if(typeof t=="function")o=t(a,a.index);else if(nOe(t)&&typeof t!="boolean"){var l=mOe(t,a);o=y.createElement(l5,{shapeType:n,elementProps:l})}else{var u=a;o=y.createElement(l5,{shapeType:n,elementProps:u})}return a.isActive?y.createElement(fr,{className:r},o):y.createElement(fr,{className:i},o)}var d2=(e,t,n)=>{var r=nn();return(i,a)=>o=>{e==null||e(i,a,o),r(MV({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},f2=e=>{var t=nn();return(n,r)=>i=>{e==null||e(n,r,i),t(bCe())}},h2=(e,t,n)=>{var r=nn();return(i,a)=>o=>{e==null||e(i,a,o),r(wCe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function m2(e){var{tooltipEntrySettings:t}=e,n=nn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(gCe(t)):i.current!==t&&n(vCe({prev:i.current,next:t})),i.current=t)},[t,n,r]),y.useLayoutEffect(()=>()=>{i.current&&(n(yCe(i.current)),i.current=null)},[n]),null}function NK(e){var{legendPayload:t}=e,n=nn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(L9(t)):i.current!==t&&n(z9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n($9(i.current)),i.current=null)},[n]),null}function vOe(e){var{legendPayload:t}=e,n=nn(),r=Be(Ft),i=y.useRef(null);return y.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(L9(t)):i.current!==t&&n(z9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n($9(i.current)),i.current=null)},[n]),null}var VE,yOe=()=>{var[e]=y.useState(()=>Ym("uid-"));return e},xOe=(VE=NN.useId)!==null&&VE!==void 0?VE:yOe;function bOe(e,t){var n=xOe();return t||(e?"".concat(e,"-").concat(n):n)}var wOe=y.createContext(void 0),p2=e=>{var{id:t,type:n,children:r}=e,i=bOe("recharts-".concat(n),t);return y.createElement(wOe.Provider,{value:i},r(i))},SOe={cartesianItems:[],polarItems:[]},kK=Kr({name:"graphicalItems",initialState:SOe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:yn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ya(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:yn()},removeCartesianGraphicalItem:{reducer(e,t){var n=ya(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:yn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:yn()},removePolarGraphicalItem:{reducer(e,t){var n=ya(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:yn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ya(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:yn()}}}),{addCartesianGraphicalItem:jOe,replaceCartesianGraphicalItem:EOe,removeCartesianGraphicalItem:_Oe,addPolarGraphicalItem:COe,removePolarGraphicalItem:NOe,replacePolarGraphicalItem:kOe}=kK.actions,AOe=kK.reducer,OOe=e=>{var t=nn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(jOe(e)):n.current!==e&&t(EOe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(_Oe(n.current)),n.current=null)},[t]),null},AK=y.memo(OOe),TOe=e=>{var t=nn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(COe(e)):n.current!==e&&t(kOe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(NOe(n.current)),n.current=null)},[t]),null},POe=y.memo(TOe),MOe=["key"],ROe=["onMouseEnter","onClick","onMouseLeave"],DOe=["id"],IOe=["id"];function Gl(){return Gl=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},Gl.apply(null,arguments)}function Jb(e,t){if(e==null)return{};var n,r,i=LOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function LOe(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 c5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c5(Object(n),!0).forEach(function(r){zOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zOe(e,t,n){return(t=$Oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Oe(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 FOe(e){var t=y.useMemo(()=>c2(e.children,Eg),[e.children]),n=Be(r=>XAe(r,e.id,t));return n==null?null:y.createElement(vOe,{legendPayload:n})}function UOe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(y.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 HOe=y.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:l,hide:u,tooltipType:d,id:m,activeShape:h}=e,g=UOe(h),v=r.map(w=>{var S=w.tooltipPayload;return g==null||S==null?S:S.map(j=>jn(jn({},j),{},{color:g,fill:g}))}),b={dataDefinedOnItem:v,getPosition:w=>{var S;return(S=r[Number(w)])===null||S===void 0?void 0:S.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:Xf(l,t),hide:u,type:d,color:o,unit:"",graphicalItemId:m}};return y.createElement(m2,{tooltipEntrySettings:b})}),qOe=(e,t)=>e>t?"start":e<t?"end":"middle",VOe=(e,t,n)=>Hr(typeof t=="function"?t(e):t,n,n*.8),KOe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=X9(a,o),u=i+Hr(e.cx,a,a/2),d=r+Hr(e.cy,o,o/2),m=Hr(e.innerRadius,l,0),h=VOe(n,e.outerRadius,l),g=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:u,cy:d,innerRadius:m,outerRadius:h,maxRadius:g}},YOe=(e,t)=>{var n=wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},XOe=(e,t)=>{if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e=="function")return e(t);var n=It("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=Jb(t,MOe);return y.createElement(qA,Gl({},i,{type:"linear",className:n}))},GOe=(e,t,n)=>{if(y.isValidElement(e))return y.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),y.isValidElement(r)))return r;var i=It("recharts-pie-label-text",jK(e));return y.createElement(Wb,Gl({},t,{alignmentBaseline:"middle",className:i}),r)};function WOe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=Vi(n),u=vu(i),d=vu(a),m=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,h=t.map((g,v)=>{var b=(g.startAngle+g.endAngle)/2,w=Zn(g.cx,g.cy,g.outerRadius+m,b),S=jn(jn(jn(jn({},l),g),{},{stroke:"none"},u),{},{index:v,textAnchor:qOe(w.x,g.cx)},w),j=jn(jn(jn(jn({},l),g),{},{fill:"none",stroke:g.fill},d),{},{index:v,points:[Zn(g.cx,g.cy,g.outerRadius,b),w],key:"line"});return y.createElement(Si,{zIndex:Jn.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},y.createElement(fr,null,a&&XOe(a,j),GOe(i,S,tn(g,o))))});return y.createElement(fr,{className:"recharts-pie-labels"},h)}function QOe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?y.createElement(o2,{label:i}):y.createElement(WOe,{sectors:t,props:n,showLabels:r})}function ZOe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=Be(Xl),u=Be(JO),d=Be(XV),{onMouseEnter:m,onClick:h,onMouseLeave:g}=i,v=Jb(i,ROe),b=d2(m,i.dataKey,o),w=f2(g),S=h2(h,i.dataKey,o);return t==null||t.length===0?null:y.createElement(y.Fragment,null,t.map((j,C)=>{if((j==null?void 0:j.startAngle)===0&&(j==null?void 0:j.endAngle)===0&&t.length!==1)return null;var E=d==null||d===o,k=String(C)===l&&(u==null||i.dataKey===u)&&E,O=l?r:null,A=n&&k?n:O,T=jn(jn({},j),{},{stroke:j.stroke,tabIndex:-1,[S9]:C,[j9]:o});return y.createElement(fr,Gl({key:"sector-".concat(j==null?void 0:j.startAngle,"-").concat(j==null?void 0:j.endAngle,"-").concat(j.midAngle,"-").concat(C),tabIndex:-1,className:"recharts-pie-sector"},rg(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),y.createElement(u2,Gl({option:a??A,index:C,shapeType:"sector",isActive:k},T)))}))}function JOe(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:l,endAngle:u,dataKey:d,nameKey:m,tooltipType:h}=n,g=Math.abs(n.minAngle),v=YOe(l,u),b=Math.abs(v),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(A=>tn(A,d,0)!==0).length,j=(b>=360?S:S-1)*w,C=b-S*g-j,E=r.reduce((A,T)=>{var M=tn(T,d,0);return A+(Ie(M)?M:0)},0),k;if(E>0){var O;k=r.map((A,T)=>{var M=tn(A,d,0),B=tn(A,m,T),I=KOe(n,a,A),U=(Ie(M)?M:0)/E,L,G=jn(jn({},A),i&&i[T]&&i[T].props),z=G!=null&&"fill"in G&&typeof G.fill=="string"?G.fill:n.fill;T?L=O.endAngle+wr(v)*w*(M!==0?1:0):L=l;var K=L+wr(v)*((M!==0?g:0)+U*C),P=(L+K)/2,H=(I.innerRadius+I.outerRadius)/2,Y=[{name:B,value:M,payload:G,dataKey:d,type:h,color:z,fill:z,graphicalItemId:n.id}],V=Zn(I.cx,I.cy,H,P);return O=jn(jn(jn(jn({},n.presentationProps),{},{percent:U,cornerRadius:typeof o=="string"?parseFloat(o):o,name:B,tooltipPayload:Y,midAngle:P,middleRadius:H,tooltipPosition:V},G),I),{},{value:M,dataKey:d,startAngle:L,endAngle:K,payload:G,paddingAngle:wr(v)*w}),O})}return k}function e2e(e){var{showLabels:t,sectors:n,children:r}=e,i=y.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return y.createElement(TAe,{value:t?i:void 0},r)}function t2e(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:u,activeShape:d,inactiveShape:m,onAnimationStart:h,onAnimationEnd:g}=t,v=dg(t,"recharts-pie-"),b=n.current,[w,S]=y.useState(!1),j=y.useCallback(()=>{typeof g=="function"&&g(),S(!1)},[g]),C=y.useCallback(()=>{typeof h=="function"&&h(),S(!0)},[h]);return y.createElement(e2e,{showLabels:!w,sectors:i},y.createElement(ug,{animationId:v,begin:o,duration:l,isActive:a,easing:u,onAnimationStart:C,onAnimationEnd:j,key:v},E=>{var k,O=[],A=i&&i[0],T=(k=A==null?void 0:A.startAngle)!==null&&k!==void 0?k:0;return i==null||i.forEach((M,B)=>{var I=b&&b[B],U=B>0?xu(M,"paddingAngle",0):0;if(I){var L=Sn(I.endAngle-I.startAngle,M.endAngle-M.startAngle,E),G=jn(jn({},M),{},{startAngle:T+U,endAngle:T+L+U});O.push(G),T=G.endAngle}else{var{endAngle:z,startAngle:K}=M,P=Sn(0,z-K,E),H=jn(jn({},M),{},{startAngle:T+U,endAngle:T+P+U});O.push(H),T=H.endAngle}}),n.current=O,y.createElement(fr,null,y.createElement(ZOe,{sectors:O,activeShape:d,inactiveShape:m,allOtherPieProps:t,shape:t.shape,id:r}))}),y.createElement(QOe,{showLabels:!w,sectors:i,props:t}),t.children)}var n2e={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:Jn.area};function r2e(e){var{id:t}=e,n=Jb(e,DOe),{hide:r,className:i,rootTabIndex:a}=e,o=y.useMemo(()=>c2(e.children,Eg),[e.children]),l=Be(m=>GAe(m,t,o)),u=y.useRef(null),d=It("recharts-pie",i);return r||l==null?(u.current=null,y.createElement(fr,{tabIndex:a,className:d})):y.createElement(Si,{zIndex:e.zIndex},y.createElement(HOe,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),y.createElement(fr,{tabIndex:a,className:d},y.createElement(t2e,{props:jn(jn({},n),{},{sectors:l}),previousSectorsRef:u,id:t})))}function i2e(e){var t=tr(e,n2e),{id:n}=t,r=Jb(t,IOe),i=Vi(r);return y.createElement(p2,{id:n,type:"pie"},a=>y.createElement(y.Fragment,null,y.createElement(POe,{type:"pie",id:a,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:i,maxRadius:t.maxRadius}),y.createElement(FOe,Gl({},r,{id:a})),y.createElement(r2e,Gl({},r,{id:a}))))}var OK=i2e;OK.displayName="Pie";var a2e=["points"];function u5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u5(Object(n),!0).forEach(function(r){o2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o2e(e,t,n){return(t=s2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s2e(e){var t=l2e(e,"string");return typeof t=="symbol"?t:t+""}function l2e(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 c0(){return c0=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},c0.apply(null,arguments)}function c2e(e,t){if(e==null)return{};var n,r,i=u2e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u2e(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 d2e(e){var{option:t,dotProps:n,className:r}=e;if(y.isValidElement(t))return y.cloneElement(t,n);if(typeof t=="function")return t(n);var i=It(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,l=c2e(a,a2e);return y.createElement(xK,c0({},l,{className:i}))}function f2e(e,t){return e==null?!1:t?!0:e.length===1}function h2e(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:l,clipPathId:u,zIndex:d=Jn.scatter}=e;if(!f2e(t,n))return null;var m=CK(n),h=Yve(n),g=t.map((b,w)=>{var S,j,C=KE(KE(KE({r:3},o),h),{},{index:w,cx:(S=b.x)!==null&&S!==void 0?S:void 0,cy:(j=b.y)!==null&&j!==void 0?j:void 0,dataKey:a,value:b.value,payload:b.payload,points:t});return y.createElement(d2e,{key:"dot-".concat(w),option:n,dotProps:C,className:i})}),v={};return l&&u!=null&&(v.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(u,")")),y.createElement(Si,{zIndex:d},y.createElement(fr,c0({className:r},v),g))}function d5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function f5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d5(Object(n),!0).forEach(function(r){m2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m2e(e,t,n){return(t=p2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p2e(e){var t=g2e(e,"string");return typeof t=="symbol"?t:t+""}function g2e(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 TK=0,v2e={xAxis:{},yAxis:{},zAxis:{}},PK=Kr({name:"cartesianAxis",initialState:v2e,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:yn()},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:yn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:yn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:yn()},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:yn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:yn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:yn()},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:yn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:yn()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...o,r].slice(-3);e.yAxis[n]=f5(f5({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:y2e,replaceXAxis:x2e,removeXAxis:b2e,addYAxis:w2e,replaceYAxis:S2e,removeYAxis:j2e,addZAxis:SBe,replaceZAxis:jBe,removeZAxis:EBe,updateYAxisWidth:E2e}=PK.actions,_2e=PK.reducer,C2e=le([hr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),N2e=le([C2e,Ps,Ms],(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)}}),g2=()=>Be(N2e),k2e=()=>Be(pNe);function h5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function YE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h5(Object(n),!0).forEach(function(r){A2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function A2e(e,t,n){return(t=O2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O2e(e){var t=T2e(e,"string");return typeof t=="symbol"?t:t+""}function T2e(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 P2e=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},u=YE(YE(YE({},l),vu(i)),NA(i)),d;return y.isValidElement(i)?d=y.cloneElement(i,u):typeof i=="function"?d=i(u):d=y.createElement(xK,u),y.createElement(fr,{className:"recharts-active-dot",clipPath:o},d)};function M2e(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Jn.activeDot}=e,l=Be(Xl),u=k2e();if(t==null||u==null)return null;var d=t.find(m=>u.includes(m.payload));return Nn(d)?null:y.createElement(Si,{zIndex:o},y.createElement(P2e,{point:d,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var m5=(e,t,n)=>{var r=n??e;if(!Nn(r))return Hr(r,t,0)},R2e=(e,t,n)=>{var r={},i=e.filter(Ib),a=e.filter(d=>d.stackId==null),o=i.reduce((d,m)=>{var h=d[m.stackId];return h==null&&(h=[]),h.push(m),d[m.stackId]=h,d},r),l=Object.entries(o).map(d=>{var m,[h,g]=d,v=g.map(w=>w.dataKey),b=m5(t,n,(m=g[0])===null||m===void 0?void 0:m.barSize);return{stackId:h,dataKeys:v,barSize:b}}),u=a.map(d=>{var m=[d.dataKey].filter(g=>g!=null),h=m5(t,n,d.barSize);return{stackId:void 0,dataKeys:m,barSize:h}});return[...l,...u]};function p5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p5(Object(n),!0).forEach(function(r){D2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function D2e(e,t,n){return(t=I2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I2e(e){var t=L2e(e,"string");return typeof t=="symbol"?t:t+""}function L2e(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 z2e(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var l=Hr(e,n,0,!0),u,d=[];if(Pt((a=r[0])===null||a===void 0?void 0:a.barSize)){var m=!1,h=n/o,g=r.reduce((C,E)=>C+(E.barSize||0),0);g+=(o-1)*l,g>=n&&(g-=(o-1)*l,l=0),g>=n&&h>0&&(m=!0,h*=.9,g=o*h);var v=(n-g)/2>>0,b={offset:v-l,size:0};u=r.reduce((C,E)=>{var k,O={stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:b.offset+b.size+l,size:m?h:(k=E.barSize)!==null&&k!==void 0?k:0}},A=[...C,O];return b=O.position,A},d)}else{var w=Hr(t,n,0,!0);n-2*w-(o-1)*l<=0&&(l=0);var S=(n-2*w-(o-1)*l)/o;S>1&&(S>>=0);var j=Pt(i)?Math.min(S,i):S;u=r.reduce((C,E,k)=>[...C,{stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:w+(S+l)*k+(S-j)/2,size:j}}],d)}return u}}var $2e=(e,t,n,r,i,a,o)=>{var l=Nn(o)?t:o,u=z2e(n,r,i!==a?i:a,e,l);return i!==a&&u!=null&&(u=u.map(d=>jy(jy({},d),{},{position:jy(jy({},d.position),{},{offset:d.position.offset-i/2})}))),u},B2e=(e,t)=>{var n=tO(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(o=>o.key===n)}}}},F2e=(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 U2e(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Pt(e.zIndex)?e.zIndex:t}var MK=e=>{var{chartData:t}=e,n=nn(),r=Yr();return y.useEffect(()=>r?()=>{}:(n(_z(t)),()=>{n(_z(void 0))}),[t,n,r]),null},g5={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},RK=Kr({name:"brush",initialState:g5,reducers:{setBrushSettings(e,t){return t.payload==null?g5:t.payload}}}),{setBrushSettings:_Be}=RK.actions,H2e=RK.reducer;function q2e(e){return(e%180+180)%180}var V2e=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=q2e(i),o=a*Math.PI/180,l=Math.atan(r/n),u=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(u)},K2e={dots:[],areas:[],lines:[]},DK=Kr({name:"referenceElements",initialState:K2e,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ya(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=ya(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=ya(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:CBe,removeDot:NBe,addArea:kBe,removeArea:ABe,addLine:OBe,removeLine:TBe}=DK.actions,Y2e=DK.reducer,X2e=y.createContext(void 0),G2e=e=>{var{children:t}=e,[n]=y.useState("".concat(Ym("recharts"),"-clip")),r=g2();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return y.createElement(X2e.Provider,{value:n},y.createElement("defs",null,y.createElement("clipPath",{id:n},y.createElement("rect",{x:i,y:a,height:l,width:o}))),t)};function IK(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function W2e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return V2e(r,n)}function Q2e(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:l}=e;return t===1?{start:r?i:a,end:r?i+o:a+l}:{start:r?i+o:a+l,end:r?i:a}}function op(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function Z2e(e,t){return IK(e,t+1)}function J2e(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:l}=t,u=0,d=1,m=o,h=function(){var b=r==null?void 0:r[u];if(b===void 0)return{v:IK(r,d)};var w=u,S,j=()=>(S===void 0&&(S=n(b,w)),S),C=b.coordinate,E=u===0||op(e,C,j,m,l);E||(u=0,m=o,d+=1),E&&(m=C+e*(j()/2+i),u+=d)},g;d<=a.length;)if(g=h(),g)return g.v;return[]}function eTe(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:l,end:u}=t,d=1;d<=o;d++){for(var m=(o-1)%d,h=l,g=!0,v=function(){var k=r[w];if(k==null)return 0;var O=w,A,T=()=>(A===void 0&&(A=n(k,O)),A),M=k.coordinate,B=w===m||op(e,M,T,h,u);if(!B)return g=!1,1;B&&(h=M+e*(T()/2+i))},b,w=m;w<o&&(b=v(),!(b!==0&&b===1));w+=d);if(g){for(var S=[],j=m;j<o;j+=d){var C=r[j];C!=null&&S.push(C)}return S}}return[]}function v5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v5(Object(n),!0).forEach(function(r){tTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tTe(e,t,n){return(t=nTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nTe(e){var t=rTe(e,"string");return typeof t=="symbol"?t:t+""}function rTe(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 iTe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:l}=t,{end:u}=t,d=function(g){var v=a[g];if(v==null)return 1;var b=v,w,S=()=>(w===void 0&&(w=n(v,g)),w);if(g===o-1){var j=e*(b.coordinate+e*S()/2-u);a[g]=b=$r($r({},b),{},{tickCoord:j>0?b.coordinate-j*e:b.coordinate})}else a[g]=b=$r($r({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var C=op(e,b.tickCoord,S,l,u);C&&(u=b.tickCoord-e*(S()/2+i),a[g]=$r($r({},b),{},{isShow:!0}))}},m=o-1;m>=0;m--)d(m);return a}function aTe(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,{start:u,end:d}=t;if(a){var m=r[l-1];if(m!=null){var h=n(m,l-1),g=e*(m.coordinate+e*h/2-d);if(o[l-1]=m=$r($r({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate}),m.tickCoord!=null){var v=op(e,m.tickCoord,()=>h,u,d);v&&(d=m.tickCoord-e*(h/2+i),o[l-1]=$r($r({},m),{},{isShow:!0}))}}}for(var b=a?l-1:l,w=function(C){var E=o[C];if(E==null)return 1;var k=E,O,A=()=>(O===void 0&&(O=n(E,C)),O);if(C===0){var T=e*(k.coordinate-e*A()/2-u);o[C]=k=$r($r({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else o[C]=k=$r($r({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var M=op(e,k.tickCoord,A,u,d);M&&(u=k.tickCoord+e*(A()/2+i),o[C]=$r($r({},k),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return o}function v2(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:l,interval:u,tickFormatter:d,unit:m,angle:h}=e;if(!i||!i.length||!r)return[];if(Ie(u)||cg.isSsr){var g;return(g=Z2e(i,Ie(u)?u:0))!==null&&g!==void 0?g:[]}var v=[],b=l==="top"||l==="bottom"?"width":"height",w=m&&b==="width"?Rm(m,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(O,A)=>{var T=typeof d=="function"?d(O.value,A):O.value;return b==="width"?W2e(Rm(T,{fontSize:t,letterSpacing:n}),w,h):Rm(T,{fontSize:t,letterSpacing:n})[b]},j=i[0],C=i[1],E=i.length>=2&&j!=null&&C!=null?wr(C.coordinate-j.coordinate):1,k=Q2e(a,E,b);return u==="equidistantPreserveStart"?J2e(E,k,S,i,o):u==="equidistantPreserveEnd"?eTe(E,k,S,i,o):(u==="preserveStart"||u==="preserveStartEnd"?v=aTe(E,k,S,i,o,u==="preserveStartEnd"):v=iTe(E,k,S,i,o),v.filter(O=>O.isShow))}var oTe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(m=>{if(m){var h=m.getBoundingClientRect();h.width>o&&(o=h.width)}});var l=n?n.getBoundingClientRect().width:0,u=i+a,d=o+u+l+(n?r:0);return Math.round(d)}return 0},sTe={xAxis:{},yAxis:{}},LK=Kr({name:"renderedTicks",initialState:sTe,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:lTe,removeRenderedTicks:cTe}=LK.actions,uTe=LK.reducer,dTe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function fTe(e,t){if(e==null)return{};var n,r,i=hTe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hTe(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 Cu(){return Cu=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},Cu.apply(null,arguments)}function y5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y5(Object(n),!0).forEach(function(r){mTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mTe(e,t,n){return(t=pTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pTe(e){var t=gTe(e,"string");return typeof t=="symbol"?t:t+""}function gTe(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 gs={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:Jn.axis};function vTe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:l,otherSvgProps:u}=e;if(!l)return null;var d=Ln(Ln(Ln({},u),Vi(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var m=+(a==="top"&&!o||a==="bottom"&&o);d=Ln(Ln({},d),{},{x1:t,y1:n+m*i,x2:t+r,y2:n+m*i})}else{var h=+(a==="left"&&!o||a==="right"&&o);d=Ln(Ln({},d),{},{x1:t+h*r,y1:n,x2:t+h*r,y2:n+i})}return y.createElement("line",Cu({},d,{className:It("recharts-cartesian-axis-line",xu(l,"className"))}))}function yTe(e,t,n,r,i,a,o,l,u){var d,m,h,g,v,b,w=l?-1:1,S=e.tickSize||o,j=Ie(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":d=m=e.coordinate,g=n+ +!l*i,h=g-w*S,b=h-w*u,v=j;break;case"left":h=g=e.coordinate,m=t+ +!l*r,d=m-w*S,v=d-w*u,b=j;break;case"right":h=g=e.coordinate,m=t+ +l*r,d=m+w*S,v=d+w*u,b=j;break;default:d=m=e.coordinate,g=n+ +l*i,h=g+w*S,b=h+w*u,v=j;break}return{line:{x1:d,y1:h,x2:m,y2:g},tick:{x:v,y:b}}}function xTe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function bTe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function wTe(e){var{option:t,tickProps:n,value:r}=e,i,a=It(n.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))i=y.cloneElement(t,Ln(Ln({},n),{},{className:a}));else if(typeof t=="function")i=t(Ln(Ln({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=It(o,jK(t))),i=y.createElement(Wb,Cu({},n,{className:o}),r)}return i}function STe(e){var{ticks:t,axisType:n,axisId:r}=e,i=nn();return y.useEffect(()=>{if(r==null||n==null)return rc;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(lTe({ticks:a,axisId:r,axisType:n})),()=>{i(cTe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var jTe=y.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:l,padding:u,tickTextProps:d,orientation:m,mirror:h,x:g,y:v,width:b,height:w,tickSize:S,tickMargin:j,fontSize:C,letterSpacing:E,getTicksConfig:k,events:O,axisType:A,axisId:T}=e,M=v2(Ln(Ln({},k),{},{ticks:n}),C,E),B=Vi(k),I=vu(r),U=uK(B.textAnchor)?B.textAnchor:xTe(m,h),L=bTe(m,h),G={};typeof i=="object"&&(G=i);var z=Ln(Ln({},B),{},{fill:"none"},G),K=M.map(Y=>Ln({entry:Y},yTe(Y,g,v,b,w,m,S,h,j))),P=K.map(Y=>{var{entry:V,line:D}=Y;return y.createElement(fr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},i&&y.createElement("line",Cu({},z,D,{className:It("recharts-cartesian-axis-tick-line",xu(i,"className"))})))}),H=K.map((Y,V)=>{var D,q,{entry:$,tick:F}=Y,Q=Ln(Ln(Ln(Ln({verticalAnchor:L},B),{},{textAnchor:U,stroke:"none",fill:a},F),{},{index:V,payload:$,visibleTicksCount:M.length,tickFormatter:o,padding:u},d),{},{angle:(D=(q=d==null?void 0:d.angle)!==null&&q!==void 0?q:B.angle)!==null&&D!==void 0?D:0}),Z=Ln(Ln({},Q),I);return y.createElement(fr,Cu({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat($.value,"-").concat($.coordinate,"-").concat($.tickCoord)},rg(O,$,V)),r&&y.createElement(wTe,{option:r,tickProps:Z,value:"".concat(typeof o=="function"?o($.value,V):$.value).concat(l||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},y.createElement(STe,{ticks:M,axisId:T,axisType:A}),H.length>0&&y.createElement(Si,{zIndex:Jn.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},H)),P.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},P))}),ETe=y.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:l,axisType:u,axisId:d}=e,m=fTe(e,dTe),[h,g]=y.useState(""),[v,b]=y.useState(""),w=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return oTe({ticks:w.current,label:(j=e.labelRef)===null||j===void 0?void 0:j.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=y.useCallback(j=>{if(j){var C=j.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=C;var E=C[0];if(E){var k=window.getComputedStyle(E),O=k.fontSize,A=k.letterSpacing;(O!==h||A!==v)&&(g(O),b(A))}}},[h,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:y.createElement(Si,{zIndex:e.zIndex},y.createElement(fr,{className:It("recharts-cartesian-axis",a)},y.createElement(vTe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Vi(e)}),y.createElement(jTe,{ref:S,axisType:u,events:m,fontSize:h,getTicksConfig:e,height:e.height,letterSpacing:v,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:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:d}),y.createElement(gAe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(CAe,{label:e.label,labelRef:e.labelRef}),e.children)))}),y2=y.forwardRef((e,t)=>{var n=tr(e,gs);return y.createElement(ETe,Cu({},n,{ref:t}))});y2.displayName="CartesianAxis";var _Te=["x1","y1","x2","y2","key"],CTe=["offset"],NTe=["xAxisId","yAxisId"],kTe=["xAxisId","yAxisId"];function x5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?x5(Object(n),!0).forEach(function(r){ATe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ATe(e,t,n){return(t=OTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OTe(e){var t=TTe(e,"string");return typeof t=="symbol"?t:t+""}function TTe(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 qc(){return qc=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},qc.apply(null,arguments)}function u0(e,t){if(e==null)return{};var n,r,i=PTe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function PTe(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 MTe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:l}=e;return y.createElement("rect",{x:r,y:i,ry:l,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function zK(e){var{option:t,lineItemProps:n}=e,r;if(y.isValidElement(t))r=y.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:l,y2:u,key:d}=n,m=u0(n,_Te),h=(i=Vi(m))!==null&&i!==void 0?i:{},{offset:g}=h,v=u0(h,CTe);r=y.createElement("line",qc({},v,{x1:a,y1:o,x2:l,y2:u,fill:"none",key:d}))}return r}function RTe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,l=u0(e,NTe),u=i.map((d,m)=>{var h=Fr(Fr({},l),{},{x1:t,y1:d,x2:t+n,y2:d,key:"line-".concat(m),index:m});return y.createElement(zK,{key:"line-".concat(m),option:r,lineItemProps:h})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function DTe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,l=u0(e,kTe),u=i.map((d,m)=>{var h=Fr(Fr({},l),{},{x1:d,y1:t,x2:d,y2:t+n,key:"line-".concat(m),index:m});return y.createElement(zK,{option:r,lineItemProps:h,key:"line-".concat(m)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function ITe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:l,horizontal:u=!0}=e;if(!u||!t||!t.length||l==null)return null;var d=l.map(h=>Math.round(h+i-i)).sort((h,g)=>h-g);i!==d[0]&&d.unshift(0);var m=d.map((h,g)=>{var v=d[g+1],b=v==null,w=b?i+o-h:v-h;if(w<=0)return null;var S=g%t.length;return y.createElement("rect",{key:"react-".concat(g),y:h,x:r,height:w,width:a,stroke:"none",fill:t[S],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function LTe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:l,verticalPoints:u}=e;if(!t||!n||!n.length)return null;var d=u.map(h=>Math.round(h+i-i)).sort((h,g)=>h-g);i!==d[0]&&d.unshift(0);var m=d.map((h,g)=>{var v=d[g+1],b=v==null,w=b?i+o-h:v-h;if(w<=0)return null;var S=g%n.length;return y.createElement("rect",{key:"react-".concat(g),x:h,y:a,width:w,height:l,stroke:"none",fill:n[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var zTe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return x9(v2(Fr(Fr(Fr({},gs),n),{},{ticks:b9(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},$Te=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return x9(v2(Fr(Fr(Fr({},gs),n),{},{ticks:b9(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},BTe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Jn.grid};function x2(e){var t=BA(),n=FA(),r=N9(),i=Fr(Fr({},tr(e,BTe)),{},{x:Ie(e.x)?e.x:r.left,y:Ie(e.y)?e.y:r.top,width:Ie(e.width)?e.width:r.width,height:Ie(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:l,y:u,width:d,height:m,syncWithTicks:h,horizontalValues:g,verticalValues:v}=i,b=Yr(),w=Be(B=>fz(B,"xAxis",a,b)),S=Be(B=>fz(B,"yAxis",o,b));if(!Oo(d)||!Oo(m)||!Ie(l)||!Ie(u))return null;var j=i.verticalCoordinatesGenerator||zTe,C=i.horizontalCoordinatesGenerator||$Te,{horizontalPoints:E,verticalPoints:k}=i;if((!E||!E.length)&&typeof C=="function"){var O=g&&g.length,A=C({yAxis:S?Fr(Fr({},S),{},{ticks:O?g:S.ticks}):void 0,width:t??d,height:n??m,offset:r},O?!0:h);Dx(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(E=A)}if((!k||!k.length)&&typeof j=="function"){var T=v&&v.length,M=j({xAxis:w?Fr(Fr({},w),{},{ticks:T?v:w.ticks}):void 0,width:t??d,height:n??m,offset:r},T?!0:h);Dx(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(k=M)}return y.createElement(Si,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(MTe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement(ITe,qc({},i,{horizontalPoints:E})),y.createElement(LTe,qc({},i,{verticalPoints:k})),y.createElement(RTe,qc({},i,{offset:r,horizontalPoints:E,xAxis:w,yAxis:S})),y.createElement(DTe,qc({},i,{offset:r,verticalPoints:k,xAxis:w,yAxis:S}))))}x2.displayName="CartesianGrid";var FTe={},$K=Kr({name:"errorBars",initialState:FTe,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:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:PBe,replaceErrorBar:MBe,removeErrorBar:RBe}=$K.actions,UTe=$K.reducer,HTe=["children"];function qTe(e,t){if(e==null)return{};var n,r,i=VTe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VTe(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 KTe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},YTe=y.createContext(KTe);function BK(e){var{children:t}=e,n=qTe(e,HTe);return y.createElement(YTe.Provider,{value:n},t)}function b2(e,t){var n,r,i=Be(d=>Is(d,e)),a=Be(d=>Ls(d,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:sr.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:lr.allowDataOverflow,u=o||l;return{needClip:u,needClipX:o,needClipY:l}}function FK(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=g2(),{needClipX:a,needClipY:o,needClip:l}=b2(t,n);if(!l||!i)return null;var{x:u,y:d,width:m,height:h}=i;return y.createElement("clipPath",{id:"clipPath-".concat(r)},y.createElement("rect",{x:a?u:u-m/2,y:o?d:d-h/2,width:a?m:m*2,height:o?h:h*2}))}var UK=(e,t,n,r)=>Yl(e,"xAxis",t,r),HK=(e,t,n,r)=>Kl(e,"xAxis",t,r),qK=(e,t,n,r)=>Yl(e,"yAxis",n,r),VK=(e,t,n,r)=>Kl(e,"yAxis",n,r),XTe=le([Ft,UK,qK,HK,VK],(e,t,n,r,i)=>Ts(e,"xAxis")?vf(t,r,!1):vf(n,i,!1)),GTe=(e,t,n,r,i)=>i;function WTe(e){return e.type==="line"}var QTe=le([Vb,GTe],(e,t)=>e.filter(WTe).find(n=>n.id===t)),ZTe=le([Ft,UK,qK,HK,VK,QTe,XTe,VA],(e,t,n,r,i,a,o,l)=>{var{chartData:u,dataStartIndex:d,dataEndIndex:m}=l;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:h,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=u==null?void 0:u.slice(d,m+1),v!=null)return xPe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:h,bandSize:o,displayedData:v})}});function JTe(e){var t=vu(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),l=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(l)||l<0)&&(l=r),{r:o,strokeWidth:l}}return{r:n,strokeWidth:r}}var ePe=["id"],tPe=["type","layout","connectNulls","needClip","shape"],nPe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function sp(){return sp=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},sp.apply(null,arguments)}function b5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b5(Object(n),!0).forEach(function(r){rPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rPe(e,t,n){return(t=iPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iPe(e){var t=aPe(e,"string");return typeof t=="symbol"?t:t+""}function aPe(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 w2(e,t){if(e==null)return{};var n,r,i=oPe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oPe(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 sPe=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Xf(n,t),payload:e}]},lPe=y.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:l,unit:u,tooltipType:d,id:m}=e,h={dataDefinedOnItem:n,getPosition:rc,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Xf(o,t),hide:l,type:d,color:r,unit:u,graphicalItemId:m}};return y.createElement(m2,{tooltipEntrySettings:h})}),KK=(e,t)=>"".concat(t,"px ").concat(e,"px");function cPe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var uPe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return KK(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],l=0,u=0;l<n.length;u+=(d=n[l])!==null&&d!==void 0?d:0,++l){var d,m=n[l];if(m!=null&&u+m>a){o=[...n.slice(0,l),a-u];break}}var h=o.length%2===0?[0,t]:[t];return[...cPe(n,i),...o,...h].map(g=>"".concat(g,"px")).join(", ")};function dPe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:l}=r,u=w2(r,ePe),d=Vi(u);return y.createElement(h2e,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:d,needClip:o,clipPathId:t})}function fPe(e){var{showLabels:t,children:n,points:r}=e,i=y.useMemo(()=>r==null?void 0:r.map(a=>{var o,l,u={x:(o=a.x)!==null&&o!==void 0?o:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return yo(yo({},u),{},{value:a.value,payload:a.payload,viewBox:u,parentViewBox:void 0,fill:void 0})}),[r]);return y.createElement(vK,{value:t?i:void 0},n)}function w5(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:l,connectNulls:u,needClip:d,shape:m}=a,h=w2(a,tPe),g=yo(yo({},ri(h)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):void 0,points:r,type:o,layout:l,connectNulls:u,strokeDasharray:i??a.strokeDasharray});return y.createElement(y.Fragment,null,(r==null?void 0:r.length)>1&&y.createElement(u2,sp({shapeType:"curve",option:m},g,{pathRef:n})),y.createElement(dPe,{points:r,clipPathId:t,props:a}))}function hPe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function mPe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:l,isAnimationActive:u,animationBegin:d,animationDuration:m,animationEasing:h,animateNewValues:g,width:v,height:b,onAnimationEnd:w,onAnimationStart:S}=n,j=i.current,C=dg(o,"recharts-line-"),E=y.useRef(C),[k,O]=y.useState(!1),A=!k,T=y.useCallback(()=>{typeof w=="function"&&w(),O(!1)},[w]),M=y.useCallback(()=>{typeof S=="function"&&S(),O(!0)},[S]),B=hPe(r.current),I=y.useRef(0);E.current!==C&&(I.current=a.current,E.current=C);var U=I.current;return y.createElement(fPe,{points:o,showLabels:A},n.children,y.createElement(ug,{animationId:C,begin:d,duration:m,isActive:u,easing:h,onAnimationEnd:T,onAnimationStart:M,key:C},L=>{var G=Sn(U,B+U,L),z=Math.min(G,B),K;if(u)if(l){var P="".concat(l).split(/[,\s]+/gim).map(V=>parseFloat(V));K=uPe(z,B,P)}else K=KK(B,z);else K=l==null?void 0:String(l);if(L>0&&B>0&&(i.current=o,a.current=Math.max(a.current,z)),j){var H=j.length/o.length,Y=L===1?o:o.map((V,D)=>{var q=Math.floor(D*H);if(j[q]){var $=j[q];return yo(yo({},V),{},{x:Sn($.x,V.x,L),y:Sn($.y,V.y,L)})}return g?yo(yo({},V),{},{x:Sn(v*2,V.x,L),y:Sn(b/2,V.y,L)}):yo(yo({},V),{},{x:V.x,y:V.y})});return i.current=Y,y.createElement(w5,{props:n,points:Y,clipPathId:t,pathRef:r,strokeDasharray:K})}return y.createElement(w5,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:K})}),y.createElement(o2,{label:n.label}))}function pPe(e){var{clipPathId:t,props:n}=e,r=y.useRef(null),i=y.useRef(0),a=y.useRef(null);return y.createElement(mPe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var gPe=(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:tn(e.payload,t)}};class vPe extends y.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:l,left:u,width:d,height:m,id:h,needClip:g,zIndex:v}=this.props;if(t)return null;var b=It("recharts-line",i),w=h,{r:S,strokeWidth:j}=JTe(n),C=CK(n),E=S*2+j,k=g?"url(#clipPath-".concat(C?"":"dots-").concat(w,")"):void 0;return y.createElement(Si,{zIndex:v},y.createElement(fr,{className:b},g&&y.createElement("defs",null,y.createElement(FK,{clipPathId:w,xAxisId:a,yAxisId:o}),!C&&y.createElement("clipPath",{id:"clipPath-dots-".concat(w)},y.createElement("rect",{x:u-E/2,y:l-E/2,width:d+E,height:m+E}))),y.createElement(BK,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:gPe,errorBarOffset:0},y.createElement(pPe,{props:this.props,clipPathId:w}))),y.createElement(M2e,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var YK={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:Jn.line,type:"linear"};function yPe(e){var t=tr(e,YK),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:l,dot:u,hide:d,isAnimationActive:m,label:h,legendType:g,xAxisId:v,yAxisId:b,id:w}=t,S=w2(t,nPe),{needClip:j}=b2(v,b),C=g2(),E=Iu(),k=Yr(),O=Be(I=>ZTe(I,v,b,k,w));if(E!=="horizontal"&&E!=="vertical"||O==null||C==null)return null;var{height:A,width:T,x:M,y:B}=C;return y.createElement(vPe,sp({},S,{id:w,connectNulls:l,dot:u,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:m,hide:d,label:h,legendType:g,xAxisId:v,yAxisId:b,points:O,layout:E,height:A,width:T,left:M,top:B,needClip:j}))}function xPe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:l,displayedData:u}=e;return u.map((d,m)=>{var h=tn(d,o);if(t==="horizontal"){var g=r3({axis:n,ticks:i,bandSize:l,entry:d,index:m}),v=Nn(h)?null:r.scale.map(h);return{x:g,y:v??null,value:h,payload:d}}var b=Nn(h)?null:n.scale.map(h),w=r3({axis:r,ticks:a,bandSize:l,entry:d,index:m});return b==null||w==null?null:{x:b,y:w,value:h,payload:d}}).filter(Boolean)}function bPe(e){var t=tr(e,YK),n=Yr();return y.createElement(p2,{id:t.id,type:"line"},r=>y.createElement(y.Fragment,null,y.createElement(NK,{legendPayload:sPe(t)}),y.createElement(lPe,{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}),y.createElement(AK,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),y.createElement(yPe,sp({},t,{id:r}))))}var XK=y.memo(bPe,Gf);XK.displayName="Line";function $u(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:TK}function Bu(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:TK}var wPe="Invariant failed";function SPe(e,t){throw new Error(wPe)}function aN(){return aN=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},aN.apply(null,arguments)}function S2(e){return y.createElement(u2,aN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var jPe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Ie(t))return t;var a=Ie(r)||Nn(r);return a?t(r,i):(a||SPe(),n)}},EPe=(e,t,n)=>n,_Pe=(e,t)=>t,_g=le([Vb,_Pe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),CPe=le([_g],e=>e==null?void 0:e.maxBarSize),NPe=(e,t,n,r)=>r,kPe=le([Ft,Vb,$u,Bu,EPe],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),APe=(e,t,n)=>{var r=Ft(e),i=$u(e,t),a=Bu(e,t);if(!(i==null||a==null))return r==="horizontal"?JC(e,"yAxis",a,n):JC(e,"xAxis",i,n)},OPe=(e,t)=>{var n=Ft(e),r=$u(e,t),i=Bu(e,t);if(!(r==null||i==null))return n==="horizontal"?dz(e,"xAxis",r):dz(e,"yAxis",i)},TPe=le([kPe,xSe,OPe],R2e),PPe=(e,t,n)=>{var r,i,a=_g(e,t);if(a==null)return 0;var o=$u(e,t),l=Bu(e,t);if(o==null||l==null)return 0;var u=Ft(e),d=u7(e),{maxBarSize:m}=a,h=Nn(m)?d:m,g,v;return u==="horizontal"?(g=Yl(e,"xAxis",o,n),v=Kl(e,"xAxis",o,n)):(g=Yl(e,"yAxis",l,n),v=Kl(e,"yAxis",l,n)),(r=(i=vf(g,v,!0))!==null&&i!==void 0?i:h)!==null&&r!==void 0?r:0},GK=(e,t,n)=>{var r=Ft(e),i=$u(e,t),a=Bu(e,t);if(!(i==null||a==null)){var o,l;return r==="horizontal"?(o=Yl(e,"xAxis",i,n),l=Kl(e,"xAxis",i,n)):(o=Yl(e,"yAxis",a,n),l=Kl(e,"yAxis",a,n)),vf(o,l)}},MPe=le([TPe,u7,ySe,d7,PPe,GK,CPe],$2e),RPe=(e,t,n)=>{var r=$u(e,t);if(r!=null)return Yl(e,"xAxis",r,n)},DPe=(e,t,n)=>{var r=Bu(e,t);if(r!=null)return Yl(e,"yAxis",r,n)},IPe=(e,t,n)=>{var r=$u(e,t);if(r!=null)return Kl(e,"xAxis",r,n)},LPe=(e,t,n)=>{var r=Bu(e,t);if(r!=null)return Kl(e,"yAxis",r,n)},zPe=le([MPe,_g],F2e),$Pe=le([APe,_g],B2e),BPe=le([hr,IA,RPe,DPe,IPe,LPe,zPe,Ft,fSe,GK,$Pe,_g,NPe],(e,t,n,r,i,a,o,l,u,d,m,h,g)=>{var{chartData:v,dataStartIndex:b,dataEndIndex:w}=u;if(!(h==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||d==null)){var{data:S}=h,j;if(S!=null&&S.length>0?j=S:j=v==null?void 0:v.slice(b,w+1),j!=null)return mMe({layout:l,barSettings:h,pos:o,parentViewBox:t,bandSize:d,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:m,displayedData:j,offset:e,cells:g,dataStartIndex:b})}}),FPe=["index"];function oN(){return oN=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},oN.apply(null,arguments)}function UPe(e,t){if(e==null)return{};var n,r,i=HPe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function HPe(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 WK=y.createContext(void 0),qPe=e=>{var t=y.useContext(WK);if(t!=null)return t.stackId;if(e!=null)return dbe(e)},VPe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),KPe=e=>{var t=y.useContext(WK);if(t!=null){var{stackId:n}=t;return"url(#".concat(VPe(n,e),")")}},QK=e=>{var{index:t}=e,n=UPe(e,FPe),r=KPe(t);return y.createElement(fr,oN({className:"recharts-bar-stack-layer",clipPath:r},n))},YPe=["onMouseEnter","onMouseLeave","onClick"],XPe=["value","background","tooltipPosition"],GPe=["id"],WPe=["onMouseEnter","onClick","onMouseLeave"];function Wl(){return Wl=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},Wl.apply(null,arguments)}function S5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S5(Object(n),!0).forEach(function(r){QPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QPe(e,t,n){return(t=ZPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZPe(e){var t=JPe(e,"string");return typeof t=="symbol"?t:t+""}function JPe(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 d0(e,t){if(e==null)return{};var n,r,i=eMe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eMe(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 tMe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Xf(n,t),payload:e}]},nMe=y.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:l,tooltipType:u,id:d}=e,m={dataDefinedOnItem:void 0,getPosition:rc,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Xf(a,t),hide:o,type:u,color:i,unit:l,graphicalItemId:d}};return y.createElement(m2,{tooltipEntrySettings:m})});function rMe(e){var t=Be(Xl),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:l,onClick:u}=a,d=d0(a,YPe),m=d2(o,r,a.id),h=f2(l),g=h2(u,r,a.id);if(!i||n==null)return null;var v=vu(i);return y.createElement(Si,{zIndex:U2e(i,Jn.barBackground)},n.map((b,w)=>{var{value:S,background:j,tooltipPosition:C}=b,E=d0(b,XPe);if(!j)return null;var k=m(b,w),O=h(b,w),A=g(b,w),T=ei(ei(ei(ei(ei({option:i,isActive:String(w)===t},E),{},{fill:"#eee"},j),v),rg(d,b,w)),{},{onMouseEnter:k,onMouseLeave:O,onClick:A,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return y.createElement(S2,Wl({key:"background-bar-".concat(w)},T))}))}function iMe(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return ei(ei({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return y.createElement(vK,{value:t?i:void 0},n)}function aMe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,l=Be(Xl),u=Be(JO),d=n&&String(i.originalDataIndex)===l&&(u==null||o===u),[m,h]=y.useState(!1),[g,v]=y.useState(!1);y.useEffect(()=>{var E;return d?(h(!0),E=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(E)}},[d]);var b=y.useCallback(()=>{d||h(!1)},[d]),w=d&&g,S=d||m,j;d?n===!0?j=t:j=n:j=t;var C=y.createElement(S2,Wl({},r,{name:String(r.name)},i,{isActive:w,option:j,index:a,dataKey:o,onTransitionEnd:b}));return S?y.createElement(Si,{zIndex:Jn.activeBar},y.createElement(QK,{index:i.originalDataIndex},C)):C}function oMe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return y.createElement(S2,Wl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function sMe(e){var t,{data:n,props:r}=e,i=(t=Vi(r))!==null&&t!==void 0?t:{},{id:a}=i,o=d0(i,GPe),{shape:l,dataKey:u,activeBar:d}=r,{onMouseEnter:m,onClick:h,onMouseLeave:g}=r,v=d0(r,WPe),b=d2(m,u,a),w=f2(g),S=h2(h,u,a);return n?y.createElement(y.Fragment,null,n.map((j,C)=>y.createElement(QK,Wl({index:j.originalDataIndex,key:"rectangle-".concat(j==null?void 0:j.x,"-").concat(j==null?void 0:j.y,"-").concat(j==null?void 0:j.value,"-").concat(C),className:"recharts-bar-rectangle"},rg(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),d?y.createElement(aMe,{shape:l,activeBar:d,baseProps:o,entry:j,index:C,dataKey:u}):y.createElement(oMe,{shape:l,baseProps:o,entry:j,index:C,dataKey:u})))):null}function lMe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:u,onAnimationEnd:d,onAnimationStart:m}=t,h=n.current,g=dg(t,"recharts-bar-"),[v,b]=y.useState(!1),w=!v,S=y.useCallback(()=>{typeof d=="function"&&d(),b(!1)},[d]),j=y.useCallback(()=>{typeof m=="function"&&m(),b(!0)},[m]);return y.createElement(iMe,{showLabels:w,rects:r},y.createElement(ug,{animationId:g,begin:o,duration:l,isActive:a,easing:u,onAnimationEnd:S,onAnimationStart:j,key:g},C=>{var E=C===1?r:r==null?void 0:r.map((k,O)=>{var A=h&&h[O];if(A)return ei(ei({},k),{},{x:Sn(A.x,k.x,C),y:Sn(A.y,k.y,C),width:Sn(A.width,k.width,C),height:Sn(A.height,k.height,C)});if(i==="horizontal"){var T=Sn(0,k.height,C),M=Sn(k.stackedBarStart,k.y,C);return ei(ei({},k),{},{y:M,height:T})}var B=Sn(0,k.width,C),I=Sn(k.stackedBarStart,k.x,C);return ei(ei({},k),{},{width:B,x:I})});return C>0&&(n.current=E??null),E==null?null:y.createElement(fr,null,y.createElement(sMe,{props:t,data:E}))}),y.createElement(o2,{label:t.label}),t.children)}function cMe(e){var t=y.useRef(null);return y.createElement(lMe,{previousRectanglesRef:t,props:e})}var ZK=0,uMe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:tn(e,t)}};class dMe extends y.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:l,background:u,id:d}=this.props;if(t||n==null)return null;var m=It("recharts-bar",i),h=d;return y.createElement(fr,{className:m,id:d},l&&y.createElement("defs",null,y.createElement(FK,{clipPathId:h,xAxisId:a,yAxisId:o})),y.createElement(fr,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(h,")"):void 0},y.createElement(rMe,{data:n,dataKey:r,background:u,allOtherBarProps:this.props}),y.createElement(cMe,this.props)))}}var fMe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:ZK,xAxisId:0,yAxisId:0,zIndex:Jn.bar};function hMe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:u,animationEasing:d,isAnimationActive:m}=e,{needClip:h}=b2(t,n),g=Iu(),v=Yr(),b=c2(e.children,Eg),w=Be(C=>BPe(C,e.id,v,b));if(g!=="vertical"&&g!=="horizontal")return null;var S,j=w==null?void 0:w[0];return j==null||j.height==null||j.width==null?S=0:S=g==="vertical"?j.height/2:j.width/2,y.createElement(BK,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:uMe,errorBarOffset:S},y.createElement(dMe,Wl({},e,{layout:g,needClip:h,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:u,animationEasing:d,isAnimationActive:m})))}function mMe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:l,yAxis:u,xAxisTicks:d,yAxisTicks:m,stackedData:h,displayedData:g,offset:v,cells:b,parentViewBox:w,dataStartIndex:S}=e,j=t==="horizontal"?u:l,C=h?j.scale.domain():null,E=fbe({numericAxis:j}),k=j.scale.map(E);return g.map((O,A)=>{var T,M,B,I,U,L;if(h){var G=h[A+S];if(G==null)return null;T=obe(G,C)}else T=tn(O,n),Array.isArray(T)||(T=[E,T]);var z=jPe(r,ZK)(T[1],A);if(t==="horizontal"){var K,P=u.scale.map(T[0]),H=u.scale.map(T[1]);if(P==null||H==null)return null;M=i3({axis:l,ticks:d,bandSize:o,offset:a.offset,entry:O,index:A}),B=(K=H??P)!==null&&K!==void 0?K:void 0,I=a.size;var Y=P-H;if(U=ko(Y)?0:Y,L={x:M,y:v.top,width:I,height:v.height},Math.abs(z)>0&&Math.abs(U)<Math.abs(z)){var V=wr(U||z)*(Math.abs(z)-Math.abs(U));B-=V,U+=V}}else{var D=l.scale.map(T[0]),q=l.scale.map(T[1]);if(D==null||q==null)return null;if(M=D,B=i3({axis:u,ticks:m,bandSize:o,offset:a.offset,entry:O,index:A}),I=q-D,U=a.size,L={x:v.left,y:B,width:v.width,height:U},Math.abs(z)>0&&Math.abs(I)<Math.abs(z)){var $=wr(I||z)*(Math.abs(z)-Math.abs(I));I+=$}}if(M==null||B==null||I==null||U==null||!i&&(I===0||U===0))return null;var F=ei(ei({},O),{},{stackedBarStart:k,x:M,y:B,width:I,height:U,value:h?T:T[1],payload:O,background:L,tooltipPosition:{x:M+I/2,y:B+U/2},parentViewBox:w,originalDataIndex:A},b&&b[A]&&b[A].props);return F}).filter(Boolean)}function pMe(e){var t=tr(e,fMe),n=qPe(t.stackId),r=Yr();return y.createElement(p2,{id:t.id,type:"bar"},i=>y.createElement(y.Fragment,null,y.createElement(NK,{legendPayload:tMe(t)}),y.createElement(nMe,{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:i}),y.createElement(AK,{type:"bar",id:i,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}),y.createElement(Si,{zIndex:t.zIndex},y.createElement(hMe,Wl({},t,{id:i})))))}var sN=y.memo(pMe,Gf);sN.displayName="Bar";var gMe=["domain","range"],vMe=["domain","range"];function j5(e,t){if(e==null)return{};var n,r,i=yMe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yMe(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 E5(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 JK(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=j5(e,gMe),{domain:a,range:o}=t,l=j5(t,vMe);return!E5(n,a)||!E5(r,o)?!1:Gf(i,l)}var xMe=["type"],bMe=["dangerouslySetInnerHTML","ticks","scale"],wMe=["id","scale"];function lN(){return lN=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},lN.apply(null,arguments)}function _5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function C5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_5(Object(n),!0).forEach(function(r){SMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SMe(e,t,n){return(t=jMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jMe(e){var t=EMe(e,"string");return typeof t=="symbol"?t:t+""}function EMe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cN(e,t){if(e==null)return{};var n,r,i=_Me(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _Me(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 CMe(e){var t=nn(),n=y.useRef(null),r=k9(),{type:i}=e,a=cN(e,xMe),o=Rb(r,"xAxis",i),l=y.useMemo(()=>{if(o!=null)return C5(C5({},a),{},{type:o})},[a,o]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(y2e(l)):n.current!==l&&t(x2e({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(b2e(n.current)),n.current=null)},[t]),null}var NMe=e=>{var{xAxisId:t,className:n}=e,r=Be(IA),i=Yr(),a="xAxis",o=Be(j=>NV(j,a,t,i)),l=Be(j=>EV(j,t)),u=Be(j=>iCe(j,t)),d=Be(j=>aV(j,t));if(l==null||u==null||d==null)return null;var{dangerouslySetInnerHTML:m,ticks:h,scale:g}=e,v=cN(e,bMe),{id:b,scale:w}=d,S=cN(d,wMe);return y.createElement(y2,lN({},v,S,{x:u.x,y:u.y,width:l.width,height:l.height,className:It("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},kMe={allowDataOverflow:sr.allowDataOverflow,allowDecimals:sr.allowDecimals,allowDuplicatedCategory:sr.allowDuplicatedCategory,angle:sr.angle,axisLine:gs.axisLine,height:sr.height,hide:!1,includeHidden:sr.includeHidden,interval:sr.interval,label:!1,minTickGap:sr.minTickGap,mirror:sr.mirror,orientation:sr.orientation,padding:sr.padding,reversed:sr.reversed,scale:sr.scale,tick:sr.tick,tickCount:sr.tickCount,tickLine:gs.tickLine,tickSize:gs.tickSize,type:sr.type,niceTicks:sr.niceTicks,xAxisId:0},AMe=e=>{var t=tr(e,kMe);return y.createElement(y.Fragment,null,y.createElement(CMe,{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}),y.createElement(NMe,t))},j2=y.memo(AMe,JK);j2.displayName="XAxis";var OMe=["type"],TMe=["dangerouslySetInnerHTML","ticks","scale"],PMe=["id","scale"];function uN(){return uN=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},uN.apply(null,arguments)}function N5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function k5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N5(Object(n),!0).forEach(function(r){MMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MMe(e,t,n){return(t=RMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RMe(e){var t=DMe(e,"string");return typeof t=="symbol"?t:t+""}function DMe(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 dN(e,t){if(e==null)return{};var n,r,i=IMe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function IMe(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 LMe(e){var t=nn(),n=y.useRef(null),r=k9(),{type:i}=e,a=dN(e,OMe),o=Rb(r,"yAxis",i),l=y.useMemo(()=>{if(o!=null)return k5(k5({},a),{},{type:o})},[o,a]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(w2e(l)):n.current!==l&&t(S2e({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(j2e(n.current)),n.current=null)},[t]),null}function zMe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=y.useRef(null),o=y.useRef(null),l=Be(IA),u=Yr(),d=nn(),m="yAxis",h=Be(A=>_V(A,t)),g=Be(A=>oCe(A,t)),v=Be(A=>NV(A,m,t,u)),b=Be(A=>oV(A,t));if(y.useLayoutEffect(()=>{if(!(r!=="auto"||!h||a2(i)||y.isValidElement(i)||b==null)){var A=a.current;if(A){var T=A.getCalculatedWidth();Math.round(h.width)!==Math.round(T)&&d(E2e({id:t,width:T}))}}},[v,h,d,i,t,r,b]),h==null||g==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:S,scale:j}=e,C=dN(e,TMe),{id:E,scale:k}=b,O=dN(b,PMe);return y.createElement(y2,uN({},C,O,{ref:a,labelRef:o,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:h.width,height:h.height,className:It("recharts-".concat(m," ").concat(m),n),viewBox:l,ticks:v,axisType:m,axisId:t}))}var $Me={allowDataOverflow:lr.allowDataOverflow,allowDecimals:lr.allowDecimals,allowDuplicatedCategory:lr.allowDuplicatedCategory,angle:lr.angle,axisLine:gs.axisLine,hide:!1,includeHidden:lr.includeHidden,interval:lr.interval,label:!1,minTickGap:lr.minTickGap,mirror:lr.mirror,orientation:lr.orientation,padding:lr.padding,reversed:lr.reversed,scale:lr.scale,tick:lr.tick,tickCount:lr.tickCount,tickLine:gs.tickLine,tickSize:gs.tickSize,type:lr.type,niceTicks:lr.niceTicks,width:lr.width,yAxisId:0},BMe=e=>{var t=tr(e,$Me);return y.createElement(y.Fragment,null,y.createElement(LMe,{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}),y.createElement(zMe,t))},E2=y.memo(BMe,JK);E2.displayName="YAxis";var FMe=(e,t)=>t,_2=le([FMe,Ft,y7,Er,qV,zs,kNe,hr],DNe);function UMe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function C2(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(UMe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(l,u)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((u-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>o(l.clientX,l.clientY)):o(e.clientX,e.clientY)}var eY=Ki("mouseClick"),tY=ag();tY.startListening({actionCreator:eY,effect:(e,t)=>{var n=e.payload,r=_2(t.getState(),C2(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(SCe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var fN=Ki("mouseMove"),nY=ag(),Pd=null,Pc=null,XE=null;nY.startListening({actionCreator:fN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||(a==null?void 0:a.includes("mousemove"));Pd!==null&&(cancelAnimationFrame(Pd),Pd=null),Pc!==null&&(typeof i!="number"||!o)&&(clearTimeout(Pc),Pc=null),XE=C2(n);var l=()=>{var u=t.getState(),d=YO(u,u.tooltip.settings.shared);if(!XE){Pd=null,Pc=null;return}if(d==="axis"){var m=_2(u,XE);(m==null?void 0:m.activeIndex)!=null?t.dispatch(DV({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(RV())}Pd=null,Pc=null};if(!o){l();return}i==="raf"?Pd=requestAnimationFrame(l):typeof i=="number"&&Pc===null&&(Pc=setTimeout(l,i))}});function HMe(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 A5={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},rY=Kr({name:"rootProps",initialState:A5,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:A5.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}}}),qMe=rY.reducer,{updateOptions:VMe}=rY.actions,KMe=null,YMe={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)},iY=Kr({name:"polarOptions",initialState:KMe,reducers:YMe}),{updatePolarOptions:XMe}=iY.actions,GMe=iY.reducer,aY=Ki("keyDown"),oY=Ki("focus"),sY=Ki("blur"),ew=ag(),Md=null,Mc=null,Ey=null;ew.startListening({actionCreator:aY,effect:(e,t)=>{Ey=e.payload,Md!==null&&(cancelAnimationFrame(Md),Md=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Mc!==null&&(typeof r!="number"||!a)&&(clearTimeout(Mc),Mc=null);var o=()=>{try{var l=t.getState(),u=l.rootProps.accessibilityLayer!==!1;if(!u)return;var{keyboardInteraction:d}=l.tooltip,m=Ey;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var h=XO(d,rh(l),bg(l),Sg(l)),g=h==null?-1:Number(h);if(!Number.isFinite(g)||g<0)return;var v=zs(l);if(m==="Enter"){var b=a0(l,"axis","hover",String(d.index));t.dispatch(i0({active:!d.active,activeIndex:d.index,activeCoordinate:b}));return}var w=dCe(l),S=w==="left-to-right"?1:-1,j=m==="ArrowRight"?1:-1,C=g+j*S;if(v==null||C>=v.length||C<0)return;var E=a0(l,"axis","hover",String(C));t.dispatch(i0({active:!0,activeIndex:C.toString(),activeCoordinate:E}))}finally{Md=null,Mc=null}};if(!a){o();return}r==="raf"?Md=requestAnimationFrame(o):typeof r=="number"&&Mc===null&&(o(),Ey=null,Mc=setTimeout(()=>{Ey?o():(Mc=null,Md=null)},r))}});ew.startListening({actionCreator:oY,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",o=a0(n,"axis","hover",String(a));t.dispatch(i0({active:!0,activeIndex:a,activeCoordinate:o}))}}}});ew.startListening({actionCreator:sY,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(i0({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function lY(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var fa=Ki("externalEvent"),cY=ag(),_y=new Map,gm=new Map,GE=new Map;cY.startListening({actionCreator:fa,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=lY(r);GE.set(i,{handler:n,reactEvent:a});var o=_y.get(i);o!==void 0&&(cancelAnimationFrame(o),_y.delete(i));var l=t.getState(),{throttleDelay:u,throttledEvents:d}=l.eventSettings,m=d,h=m==="all"||(m==null?void 0:m.includes(i)),g=gm.get(i);g!==void 0&&(typeof u!="number"||!h)&&(clearTimeout(g),gm.delete(i));var v=()=>{var S=GE.get(i);try{if(!S)return;var{handler:j,reactEvent:C}=S,E=t.getState(),k={activeCoordinate:fNe(E),activeDataKey:JO(E),activeIndex:Xl(E),activeLabel:YV(E),activeTooltipIndex:Xl(E),isTooltipActive:hNe(E)};j&&j(k,C)}finally{_y.delete(i),gm.delete(i),GE.delete(i)}};if(!h){v();return}if(u==="raf"){var b=requestAnimationFrame(v);_y.set(i,b)}else if(typeof u=="number"){if(!gm.has(i)){v();var w=setTimeout(v,u);gm.set(i,w)}}else v()}}});var WMe=le([th],e=>e.tooltipItemPayloads),QMe=le([WMe,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),uY=Ki("touchMove"),dY=ag(),Rc=null,yl=null,O5=null,vm=null;dY.startListening({actionCreator:uY,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){vm=lY(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");Rc!==null&&(cancelAnimationFrame(Rc),Rc=null),yl!==null&&(typeof i!="number"||!o)&&(clearTimeout(yl),yl=null),O5=Array.from(n.touches).map(u=>C2({clientX:u.clientX,clientY:u.clientY,currentTarget:n.currentTarget}));var l=()=>{if(vm!=null){var u=t.getState(),d=YO(u,u.tooltip.settings.shared);if(d==="axis"){var m,h=(m=O5)===null||m===void 0?void 0:m[0];if(h==null){Rc=null,yl=null;return}var g=_2(u,h);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(DV({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(d==="item"){var v,b=vm.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(S9),j=(v=w.getAttribute(j9))!==null&&v!==void 0?v:void 0,C=nh(u).find(O=>O.id===j);if(S==null||C==null||j==null)return;var{dataKey:E}=C,k=QMe(u,S,j);t.dispatch(MV({activeDataKey:E,activeIndex:S,activeCoordinate:k,activeGraphicalItemId:j}))}Rc=null,yl=null}};if(!o){l();return}i==="raf"?Rc=requestAnimationFrame(l):typeof i=="number"&&yl===null&&(l(),vm=null,yl=setTimeout(()=>{vm?l():(yl=null,Rc=null)},i))}}});var N2={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},fY=Kr({name:"eventSettings",initialState:N2,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:ZMe}=fY.actions,JMe=fY.reducer,eRe=qq({brush:H2e,cartesianAxis:_2e,chartData:fke,errorBars:UTe,eventSettings:JMe,graphicalItems:AOe,layout:tbe,legend:lwe,options:ske,polarAxis:UAe,polarOptions:GMe,referenceElements:Y2e,renderedTicks:uTe,rootProps:qMe,tooltip:jCe,zIndex:GNe}),tRe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return C0e({reducer:eRe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([tY.middleware,nY.middleware,ew.middleware,cY.middleware,dY.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(a9({type:"raf"}))},devTools:{serialize:{replacer:HMe},name:"recharts-".concat(n)}})};function hY(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Yr(),a=y.useRef(null);if(i)return n;a.current==null&&(a.current=tRe(t,r));var o=AA;return y.createElement(Ewe,{context:o,store:a.current},n)}function nRe(e){var{layout:t,margin:n}=e,r=nn(),i=Yr();return y.useEffect(()=>{i||(r(Z0e(t)),r(Q0e(n)))},[r,i,t,n]),null}var mY=y.memo(nRe,Gf);function pY(e){var t=nn();return y.useEffect(()=>{t(VMe(e))},[t,e]),null}var rRe=e=>{var t=nn();return y.useEffect(()=>{t(ZMe(e))},[t,e]),null},gY=y.memo(rRe,Gf);function T5(e){var{zIndex:t,isPanorama:n}=e,r=y.useRef(null),i=nn();return y.useLayoutEffect(()=>(r.current&&i(YNe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(XNe({zIndex:t,isPanorama:n}))}),[i,t,n]),y.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function P5(e){var{children:t,isPanorama:n}=e,r=Be(LNe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return y.createElement(y.Fragment,null,i.map(o=>y.createElement(T5,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>y.createElement(T5,{key:o,zIndex:o,isPanorama:n})))}var iRe=["children"];function aRe(e,t){if(e==null)return{};var n,r,i=oRe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oRe(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 f0(){return f0=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},f0.apply(null,arguments)}var sRe={width:"100%",height:"100%",display:"block"},lRe=y.forwardRef((e,t)=>{var n=BA(),r=FA(),i=U9();if(!Oo(n)||!Oo(r))return null;var{children:a,otherAttributes:o,title:l,desc:u}=e,d,m;return o!=null&&(typeof o.tabIndex=="number"?d=o.tabIndex:d=i?0:void 0,typeof o.role=="string"?m=o.role:m=i?"application":void 0),y.createElement(xA,f0({},o,{title:l,desc:u,role:m,tabIndex:d,width:n,height:r,style:sRe,ref:t}),a)}),cRe=e=>{var{children:t}=e,n=Be(Nb);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return y.createElement(xA,{width:r,height:i,x:o,y:a},t)},M5=y.forwardRef((e,t)=>{var{children:n}=e,r=aRe(e,iRe),i=Yr();return i?y.createElement(cRe,null,y.createElement(P5,{isPanorama:!0},n)):y.createElement(lRe,f0({ref:t},r),y.createElement(P5,{isPanorama:!1},n))});function uRe(){var e=nn(),[t,n]=y.useState(null),r=Be(ybe);return y.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Pt(a)&&a!==r&&e(ebe(a))}},[t,e,r]),n}function R5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dRe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R5(Object(n),!0).forEach(function(r){fRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fRe(e,t,n){return(t=hRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hRe(e){var t=mRe(e,"string");return typeof t=="symbol"?t:t+""}function mRe(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 Fl(){return Fl=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},Fl.apply(null,arguments)}var pRe=()=>(wke(),null);function h0(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var gRe=y.forwardRef((e,t)=>{var n,r,i=y.useRef(null),[a,o]=y.useState({containerWidth:h0((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:h0((r=e.style)===null||r===void 0?void 0:r.height)}),l=y.useCallback((d,m)=>{o(h=>{var g=Math.round(d),v=Math.round(m);return h.containerWidth===g&&h.containerHeight===v?h:{containerWidth:g,containerHeight:v}})},[]),u=y.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:m,height:h}=d.getBoundingClientRect();l(m,h);var g=b=>{var w=b[0];if(w!=null){var{width:S,height:j}=w.contentRect;l(S,j)}},v=new ResizeObserver(g);v.observe(d),i.current=v}},[t,l]);return y.useEffect(()=>()=>{var d=i.current;d!=null&&d.disconnect()},[l]),y.createElement(y.Fragment,null,y.createElement(sg,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",Fl({ref:u},e)))}),vRe=y.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=y.useState({containerWidth:h0(n),containerHeight:h0(r)}),o=y.useCallback((u,d)=>{a(m=>{var h=Math.round(u),g=Math.round(d);return m.containerWidth===h&&m.containerHeight===g?m:{containerWidth:h,containerHeight:g}})},[]),l=y.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null){var{width:d,height:m}=u.getBoundingClientRect();o(d,m)}},[t,o]);return y.createElement(y.Fragment,null,y.createElement(sg,{width:i.containerWidth,height:i.containerHeight}),y.createElement("div",Fl({ref:l},e)))}),yRe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return y.createElement(y.Fragment,null,y.createElement(sg,{width:n,height:r}),y.createElement("div",Fl({ref:t},e)))}),xRe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?y.createElement(vRe,Fl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?y.createElement(yRe,Fl({},e,{width:n,height:r,ref:t})):y.createElement(y.Fragment,null,y.createElement(sg,{width:n,height:r}),y.createElement("div",Fl({ref:t},e)))});function bRe(e){return e?gRe:xRe}var wRe=y.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:l,onMouseDown:u,onMouseEnter:d,onMouseLeave:m,onMouseMove:h,onMouseUp:g,onTouchEnd:v,onTouchMove:b,onTouchStart:w,style:S,width:j,responsive:C,dispatchTouchEvents:E=!0}=e,k=y.useRef(null),O=nn(),[A,T]=y.useState(null),[M,B]=y.useState(null),I=uRe(),U=LA(),L=(U==null?void 0:U.width)>0?U.width:j,G=(U==null?void 0:U.height)>0?U.height:i,z=y.useCallback(se=>{I(se),typeof t=="function"&&t(se),T(se),B(se),se!=null&&(k.current=se)},[I,t,T,B]),K=y.useCallback(se=>{O(eY(se)),O(fa({handler:a,reactEvent:se}))},[O,a]),P=y.useCallback(se=>{O(fN(se)),O(fa({handler:d,reactEvent:se}))},[O,d]),H=y.useCallback(se=>{O(RV()),O(fa({handler:m,reactEvent:se}))},[O,m]),Y=y.useCallback(se=>{O(fN(se)),O(fa({handler:h,reactEvent:se}))},[O,h]),V=y.useCallback(()=>{O(oY())},[O]),D=y.useCallback(()=>{O(sY())},[O]),q=y.useCallback(se=>{O(aY(se.key))},[O]),$=y.useCallback(se=>{O(fa({handler:o,reactEvent:se}))},[O,o]),F=y.useCallback(se=>{O(fa({handler:l,reactEvent:se}))},[O,l]),Q=y.useCallback(se=>{O(fa({handler:u,reactEvent:se}))},[O,u]),Z=y.useCallback(se=>{O(fa({handler:g,reactEvent:se}))},[O,g]),te=y.useCallback(se=>{O(fa({handler:w,reactEvent:se}))},[O,w]),ae=y.useCallback(se=>{E&&O(uY(se)),O(fa({handler:b,reactEvent:se}))},[O,E,b]),re=y.useCallback(se=>{O(fa({handler:v,reactEvent:se}))},[O,v]),ee=bRe(C);return y.createElement(tK.Provider,{value:A},y.createElement(iq.Provider,{value:M},y.createElement(ee,{width:L??(S==null?void 0:S.width),height:G??(S==null?void 0:S.height),className:It("recharts-wrapper",r),style:dRe({position:"relative",cursor:"default",width:L,height:G},S),onClick:K,onContextMenu:$,onDoubleClick:F,onFocus:V,onBlur:D,onKeyDown:q,onMouseDown:Q,onMouseEnter:P,onMouseLeave:H,onMouseMove:Y,onMouseUp:Z,onTouchEnd:re,onTouchMove:ae,onTouchStart:te,ref:z},y.createElement(pRe,null),n)))}),SRe=["width","height","responsive","children","className","style","compact","title","desc"];function jRe(e,t){if(e==null)return{};var n,r,i=ERe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ERe(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 vY=y.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:u,title:d,desc:m}=e,h=jRe(e,SRe),g=Vi(h);return u?y.createElement(y.Fragment,null,y.createElement(sg,{width:n,height:r}),y.createElement(M5,{otherAttributes:g,title:d,desc:m},a)):y.createElement(wRe,{className:o,style:l,width:n,height:r,responsive:i??!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},y.createElement(M5,{otherAttributes:g,title:d,desc:m,ref:t},y.createElement(G2e,null,a)))});function hN(){return hN=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},hN.apply(null,arguments)}function D5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _Re(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D5(Object(n),!0).forEach(function(r){CRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CRe(e,t,n){return(t=NRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NRe(e){var t=kRe(e,"string");return typeof t=="symbol"?t:t+""}function kRe(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 ARe={top:5,right:5,bottom:5,left:5},ORe=_Re({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:ARe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},N2),yY=y.forwardRef(function(t,n){var r,i=tr(t.categoricalChartProps,ORe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:u,categoricalChartProps:d}=t,m={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:u,eventEmitter:void 0};return y.createElement(hY,{preloadedState:{options:m},reduxStoreName:(r=d.id)!==null&&r!==void 0?r:a},y.createElement(MK,{chartData:d.data}),y.createElement(mY,{layout:i.layout,margin:i.margin}),y.createElement(gY,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(pY,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),y.createElement(vY,hN({},i,{ref:n})))}),TRe=["axis"],PRe=y.forwardRef((e,t)=>y.createElement(yY,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:TRe,tooltipPayloadSearcher:i2,categoricalChartProps:e,ref:t})),MRe=["axis","item"],RRe=y.forwardRef((e,t)=>y.createElement(yY,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:MRe,tooltipPayloadSearcher:i2,categoricalChartProps:e,ref:t}));function DRe(e){var t=nn();return y.useEffect(()=>{t(XMe(e))},[t,e]),null}var IRe=["layout"];function mN(){return mN=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},mN.apply(null,arguments)}function LRe(e,t){if(e==null)return{};var n,r,i=zRe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zRe(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 I5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $Re(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I5(Object(n),!0).forEach(function(r){BRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BRe(e,t,n){return(t=FRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FRe(e){var t=URe(e,"string");return typeof t=="symbol"?t:t+""}function URe(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 HRe={top:5,right:5,bottom:5,left:5},xY=$Re({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:HRe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},N2),qRe=y.forwardRef(function(t,n){var r,i=tr(t.categoricalChartProps,xY),{layout:a}=i,o=LRe(i,IRe),{chartName:l,defaultTooltipEventType:u,validateTooltipEventTypes:d,tooltipPayloadSearcher:m}=t,h={chartName:l,defaultTooltipEventType:u,validateTooltipEventTypes:d,tooltipPayloadSearcher:m,eventEmitter:void 0};return y.createElement(hY,{preloadedState:{options:h},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},y.createElement(MK,{chartData:i.data}),y.createElement(mY,{layout:a,margin:i.margin}),y.createElement(gY,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(pY,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),y.createElement(DRe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),y.createElement(vY,mN({},o,{ref:n})))});function L5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function z5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L5(Object(n),!0).forEach(function(r){VRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VRe(e,t,n){return(t=KRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KRe(e){var t=YRe(e,"string");return typeof t=="symbol"?t:t+""}function YRe(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 XRe=["item"],GRe=z5(z5({},xY),{},{layout:"centric",startAngle:0,endAngle:360}),WRe=y.forwardRef((e,t)=>{var n=tr(e,GRe);return y.createElement(qRe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:XRe,tooltipPayloadSearcher:i2,categoricalChartProps:n,ref:t})});function QRe({completed:e,failed:t}){const n=e+t;if(n===0)return f.jsx("div",{className:"flex h-full items-center justify-center",children:f.jsxs("div",{className:"relative h-32 w-32",children:[f.jsx("svg",{viewBox:"0 0 100 100",className:"h-full w-full",children:f.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"12"})}),f.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:f.jsx("span",{className:"text-sm text-muted-foreground",children:"N/A"})})]})});const r=Math.round(e/n*1e3)/10,i=[{name:"Completed",value:e},{name:"Failed",value:t}],a=["#2e7d32","#c62828"];return f.jsxs("div",{className:"relative flex h-full items-center justify-center",children:[f.jsx(zA,{width:140,height:140,children:f.jsx(WRe,{children:f.jsx(OK,{data:i,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:i.map((o,l)=>f.jsx(Eg,{fill:a[l]},l))})})}),f.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:f.jsxs("span",{className:"text-lg font-semibold",children:[r,"%"]})})]})}function $5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ZRe({data:e}){return e.some(n=>n.total>0)?f.jsx(zA,{width:"100%",height:280,children:f.jsxs(RRe,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[f.jsx(x2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),f.jsx(j2,{dataKey:"date",tickFormatter:$5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(E2,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(iK,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>$5(String(n))}),f.jsx(B9,{wrapperStyle:{fontSize:12,paddingTop:8}}),f.jsx(sN,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),f.jsx(sN,{dataKey:"failed",name:"Failed",stackId:"a",fill:"#c62828",radius:[2,2,0,0]})]})}):f.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"})}function B5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function JRe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function eDe({data:e}){if(e.filter(r=>r.avg_duration_ms!==null).length===0)return f.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 f.jsx(zA,{width:"100%",height:280,children:f.jsxs(PRe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[f.jsx(x2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),f.jsx(j2,{dataKey:"date",tickFormatter:B5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),f.jsx(E2,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),f.jsx(iK,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>B5(String(r)),formatter:r=>[JRe(Number(r)*6e4),"Avg Duration"]}),f.jsx(XK,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const tDe=["7d","30d","90d"];function nDe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function bY({projectId:e}){const[t,n]=y.useState("30d"),{data:r,isLoading:i}=Hve(e,t);return i?f.jsxs("div",{className:"space-y-4",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsx(en,{className:"h-32"}),f.jsx(en,{className:"h-32"}),f.jsx(en,{className:"h-32"})]}),f.jsx(en,{className:"h-72"})]}):r?f.jsxs("div",{className:"space-y-6",children:[f.jsx("div",{className:"flex gap-1",children:tDe.map(a=>f.jsx(pe,{size:"sm",variant:t===a?"default":"outline",onClick:()=>n(a),children:a},a))}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsxs(En,{children:[f.jsx(tm,{className:"pb-2",children:f.jsx(nm,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),f.jsxs(_n,{children:[f.jsx("div",{className:"text-3xl font-bold",children:r.total_runs}),f.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[r.completed," completed · ",r.failed," failed"]})]})]}),f.jsxs(En,{children:[f.jsx(tm,{className:"pb-2",children:f.jsx(nm,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),f.jsx(_n,{className:"h-36",children:f.jsx(QRe,{completed:r.completed,failed:r.failed})})]}),f.jsxs(En,{children:[f.jsx(tm,{className:"pb-2",children:f.jsx(nm,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),f.jsxs(_n,{children:[f.jsx("div",{className:"text-3xl font-bold",children:nDe(r.avg_duration_ms)}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),f.jsxs(En,{children:[f.jsx(tm,{children:f.jsx(nm,{className:"text-base",children:"Run Frequency"})}),f.jsx(_n,{children:f.jsx(ZRe,{data:r.daily})})]}),f.jsxs(En,{children:[f.jsx(tm,{children:f.jsx(nm,{className:"text-base",children:"Duration Trends"})}),f.jsx(_n,{children:f.jsx(eDe,{data:r.daily})})]})]}):null}function rDe(){return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsx(en,{className:"h-24 rounded-lg"}),f.jsx(en,{className:"h-64 rounded-lg"})]})}const iDe={telegram:{icon:Vse,label:"Telegram"},slack:{icon:zD,label:"Slack"},discord:{icon:zD,label:"Discord"},scheduler:{icon:dU,label:"Scheduler"},webhook:{icon:ale,label:"Webhook"}};function tw({source:e,meta:t}){if(!e)return null;const n=iDe[e]??{icon:Pse,label:e},r=n.icon,i=t||n.label;return f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",title:t?`via ${n.label}: ${t}`:`via ${n.label}`,children:[f.jsx(r,{className:"h-3 w-3"}),i]})}function aDe({projectId:e,conversationId:t,title:n,fallback:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(""),u=y.useRef(null),d=$k(e);function m(v){v.stopPropagation(),l(n??""),a(!0),setTimeout(()=>{var b;return(b=u.current)==null?void 0:b.select()},0)}function h(v){v.stopPropagation();const b=o.trim();d.mutate({conversationId:t,title:b||null}),a(!1)}function g(v){v.key==="Enter"&&(v.preventDefault(),h(v)),v.key==="Escape"&&(v.stopPropagation(),a(!1))}return i?f.jsx(Ze,{ref:u,value:o,onChange:v=>l(v.target.value),onBlur:h,onKeyDown:g,onClick:v=>v.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:r}):f.jsxs("div",{className:"flex items-center gap-1.5 group",children:[f.jsx("span",{className:"font-medium",children:n??r}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:m,"aria-label":"Rename",children:f.jsx(Bf,{className:"h-3 w-3"})})]})}function oDe({projectId:e,conversationId:t,label:n}){const[r,i]=y.useState(!1),a=OU(e);return r?f.jsxs("div",{className:"flex justify-end gap-1",onClick:o=>o.stopPropagation(),children:[f.jsx(pe,{size:"sm",variant:"destructive",disabled:a.isPending,onClick:o=>{o.stopPropagation(),a.mutate(t,{onSuccess:()=>i(!1),onError:()=>i(!1)})},children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),i(!1)},children:"No"})]}):f.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),i(!0)},"aria-label":`Delete ${n}`,children:f.jsx(Pa,{className:"h-3.5 w-3.5"})})}const F5={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function sDe(){var I,U,L;const{projectId:e}=_p(),t=Number(e),n=to(),r=Lk(t),[i,a]=y.useState(1),[o]=y.useState(1),l=PU(t,i),u=Vf(t),d=Bp(t,o),m=eb(),[h,g]=y.useState(!1),[v,b]=y.useState(!1),[w,S]=y.useState("conversations"),j=r.isLoading||l.isLoading,C=r.error||l.error;if(j)return f.jsx(rDe,{});if(C)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",C.message]})]});if(!r.data)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsx("span",{children:"Project not found"})]});const E=r.data,k=l.data,O=(k==null?void 0:k.items)??[],A=(k==null?void 0:k.total)??0,T=k?Math.ceil(k.total/k.per_page):0,M=u.data??[],B=M.reduce((G,z)=>(G[z.type]=(G[z.type]||0)+1,G),{});return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(pe,{variant:"outline",size:"sm",asChild:!0,children:f.jsxs(dr,{to:"/projects",children:[f.jsx(G0,{className:"mr-2 h-4 w-4"}),"Back"]})}),f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:E.display_name})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(pe,{disabled:!E.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:G=>n(`/projects/${t}/conversations/${G.id}`)})},children:[f.jsx(hu,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),f.jsxs(pe,{variant:"outline",onClick:()=>g(!0),disabled:!E.dir_exists,children:[f.jsx($p,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),f.jsxs(pe,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[f.jsx(zp,{className:"mr-2 h-4 w-4"}),"Install Resource"]})]})]}),f.jsx(En,{children:f.jsx(_n,{className:"pt-6",children:f.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Directory"}),f.jsxs("dd",{className:"flex items-center gap-2 break-all",children:[E.working_dir,E.dir_exists?f.jsx(mt,{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"}):f.jsx(mt,{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"})]}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Created"}),f.jsx("dd",{children:new Date(E.created_at).toLocaleString()}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),f.jsx("dd",{children:M.length===0?f.jsx("span",{className:"text-sm text-muted-foreground",children:"None installed"}):f.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(B).map(([G,z])=>f.jsxs(mt,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[z," ",z===1?F5[G]??G:`${F5[G]??G}s`]},G))})})]})})}),f.jsx(Oue,{projectId:t,open:h,onOpenChange:g}),f.jsx(pA,{open:v,onOpenChange:b,projectId:t}),f.jsxs(Wp,{value:w,onValueChange:S,children:[f.jsxs(Qp,{children:[f.jsxs(Wn,{value:"conversations",children:["Conversations (",((I=d.data)==null?void 0:I.total)??0,")"]}),f.jsxs(Wn,{value:"sessions",children:["Sessions (",A,")"]}),f.jsx(Wn,{value:"activity",children:"Activity"}),f.jsxs(Wn,{value:"resources",children:["Resources (",M.length,")"]}),f.jsx(Wn,{value:"files",children:"Files"})]}),f.jsx(Qn,{value:"sessions",className:"mt-4 space-y-3",children:A===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):f.jsxs(f.Fragment,{children:[f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsx(hx,{sessions:O})})}),f.jsx(Vk,{page:i,totalPages:T,onPageChange:a})]})}),f.jsx(Qn,{value:"conversations",className:"mt-4 space-y-3",children:(((U=d.data)==null?void 0:U.items)??[]).length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[f.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"No conversations yet."}),f.jsxs(pe,{disabled:!E.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:G=>n(`/projects/${t}/conversations/${G.id}`)})},children:[f.jsx(hu,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[f.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),f.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),f.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),f.jsx("th",{className:"px-4 py-2"})]})}),f.jsx("tbody",{children:(((L=d.data)==null?void 0:L.items)??[]).map(G=>f.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>n(`/projects/${t}/conversations/${G.id}`),children:[f.jsx("td",{className:"px-4 py-2",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(aDe,{projectId:t,conversationId:G.id,title:G.title,fallback:`Conversation #${G.id}`}),f.jsx(tw,{source:G.source,meta:G.source_meta})]})}),f.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:G.session_count}),f.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:G.last_activity?new Date(G.last_activity).toLocaleString():"—"}),f.jsx("td",{className:"px-4 py-2 text-right",children:f.jsx(oDe,{projectId:t,conversationId:G.id,label:G.title??`Conversation #${G.id}`})})]},G.id))})]})})})}),f.jsx(Qn,{value:"activity",className:"mt-4",children:f.jsx(bY,{projectId:t})}),f.jsx(Qn,{value:"resources",className:"mt-4",children:f.jsx(Fve,{projectId:t,installOpen:v,onInstallOpenChange:b})}),f.jsx(Qn,{value:"files",className:"mt-4",children:f.jsx(qU,{projectId:t})})]})]})}function nr(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=nr(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var lDe={value:()=>{}};function nw(){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 Xy(n)}function Xy(e){this._=e}function cDe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Xy.prototype=nw.prototype={constructor:Xy,on:function(e,t){var n=this._,r=cDe(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=uDe(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=U5(n[i],e.name,t);else if(t==null)for(i in n)n[i]=U5(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Xy(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[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],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function uDe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function U5(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=lDe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var pN="http://www.w3.org/1999/xhtml";const H5={svg:"http://www.w3.org/2000/svg",xhtml:pN,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rw(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),H5.hasOwnProperty(t)?{space:H5[t],local:e}:e}function dDe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===pN&&t.documentElement.namespaceURI===pN?t.createElement(e):t.createElementNS(n,e)}}function fDe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wY(e){var t=rw(e);return(t.local?fDe:dDe)(t)}function hDe(){}function k2(e){return e==null?hDe:function(){return this.querySelector(e)}}function mDe(e){typeof e!="function"&&(e=k2(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=new Array(o),u,d,m=0;m<o;++m)(u=a[m])&&(d=e.call(u,u.__data__,m,a))&&("__data__"in u&&(d.__data__=u.__data__),l[m]=d);return new Xi(r,this._parents)}function pDe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function gDe(){return[]}function SY(e){return e==null?gDe:function(){return this.querySelectorAll(e)}}function vDe(e){return function(){return pDe(e.apply(this,arguments))}}function yDe(e){typeof e=="function"?e=vDe(e):e=SY(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],l=o.length,u,d=0;d<l;++d)(u=o[d])&&(r.push(e.call(u,u.__data__,d,o)),i.push(u));return new Xi(r,i)}function jY(e){return function(){return this.matches(e)}}function EY(e){return function(t){return t.matches(e)}}var xDe=Array.prototype.find;function bDe(e){return function(){return xDe.call(this.children,e)}}function wDe(){return this.firstElementChild}function SDe(e){return this.select(e==null?wDe:bDe(typeof e=="function"?e:EY(e)))}var jDe=Array.prototype.filter;function EDe(){return Array.from(this.children)}function _De(e){return function(){return jDe.call(this.children,e)}}function CDe(e){return this.selectAll(e==null?EDe:_De(typeof e=="function"?e:EY(e)))}function NDe(e){typeof e!="function"&&(e=jY(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],u,d=0;d<o;++d)(u=a[d])&&e.call(u,u.__data__,d,a)&&l.push(u);return new Xi(r,this._parents)}function _Y(e){return new Array(e.length)}function kDe(){return new Xi(this._enter||this._groups.map(_Y),this._parents)}function m0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}m0.prototype={constructor:m0,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 ADe(e){return function(){return e}}function ODe(e,t,n,r,i,a){for(var o=0,l,u=t.length,d=a.length;o<d;++o)(l=t[o])?(l.__data__=a[o],r[o]=l):n[o]=new m0(e,a[o]);for(;o<u;++o)(l=t[o])&&(i[o]=l)}function TDe(e,t,n,r,i,a,o){var l,u,d=new Map,m=t.length,h=a.length,g=new Array(m),v;for(l=0;l<m;++l)(u=t[l])&&(g[l]=v=o.call(u,u.__data__,l,t)+"",d.has(v)?i[l]=u:d.set(v,u));for(l=0;l<h;++l)v=o.call(e,a[l],l,a)+"",(u=d.get(v))?(r[l]=u,u.__data__=a[l],d.delete(v)):n[l]=new m0(e,a[l]);for(l=0;l<m;++l)(u=t[l])&&d.get(g[l])===u&&(i[l]=u)}function PDe(e){return e.__data__}function MDe(e,t){if(!arguments.length)return Array.from(this,PDe);var n=t?TDe:ODe,r=this._parents,i=this._groups;typeof e!="function"&&(e=ADe(e));for(var a=i.length,o=new Array(a),l=new Array(a),u=new Array(a),d=0;d<a;++d){var m=r[d],h=i[d],g=h.length,v=RDe(e.call(m,m&&m.__data__,d,r)),b=v.length,w=l[d]=new Array(b),S=o[d]=new Array(b),j=u[d]=new Array(g);n(m,h,w,S,j,v,t);for(var C=0,E=0,k,O;C<b;++C)if(k=w[C]){for(C>=E&&(E=C+1);!(O=S[E])&&++E<b;);k._next=O||null}}return o=new Xi(o,r),o._enter=l,o._exit=u,o}function RDe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function DDe(){return new Xi(this._exit||this._groups.map(_Y),this._parents)}function IDe(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function LDe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),l=new Array(i),u=0;u<o;++u)for(var d=n[u],m=r[u],h=d.length,g=l[u]=new Array(h),v,b=0;b<h;++b)(v=d[b]||m[b])&&(g[b]=v);for(;u<i;++u)l[u]=n[u];return new Xi(l,this._parents)}function zDe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function $De(e){e||(e=BDe);function t(h,g){return h&&g?e(h.__data__,g.__data__):!h-!g}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],l=o.length,u=i[a]=new Array(l),d,m=0;m<l;++m)(d=o[m])&&(u[m]=d);u.sort(t)}return new Xi(i,this._parents).order()}function BDe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function FDe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function UDe(){return Array.from(this)}function HDe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function qDe(){let e=0;for(const t of this)++e;return e}function VDe(){return!this.node()}function KDe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,l;a<o;++a)(l=i[a])&&e.call(l,l.__data__,a,i);return this}function YDe(e){return function(){this.removeAttribute(e)}}function XDe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function GDe(e,t){return function(){this.setAttribute(e,t)}}function WDe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function QDe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ZDe(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 JDe(e,t){var n=rw(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?XDe:YDe:typeof t=="function"?n.local?ZDe:QDe:n.local?WDe:GDe)(n,t))}function CY(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function eIe(e){return function(){this.style.removeProperty(e)}}function tIe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function nIe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function rIe(e,t,n){return arguments.length>1?this.each((t==null?eIe:typeof t=="function"?nIe:tIe)(e,t,n??"")):jf(this.node(),e)}function jf(e,t){return e.style.getPropertyValue(t)||CY(e).getComputedStyle(e,null).getPropertyValue(t)}function iIe(e){return function(){delete this[e]}}function aIe(e,t){return function(){this[e]=t}}function oIe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function sIe(e,t){return arguments.length>1?this.each((t==null?iIe:typeof t=="function"?oIe:aIe)(e,t)):this.node()[e]}function NY(e){return e.trim().split(/^|\s+/)}function A2(e){return e.classList||new kY(e)}function kY(e){this._node=e,this._names=NY(e.getAttribute("class")||"")}kY.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 AY(e,t){for(var n=A2(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function OY(e,t){for(var n=A2(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function lIe(e){return function(){AY(this,e)}}function cIe(e){return function(){OY(this,e)}}function uIe(e,t){return function(){(t.apply(this,arguments)?AY:OY)(this,e)}}function dIe(e,t){var n=NY(e+"");if(arguments.length<2){for(var r=A2(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?uIe:t?lIe:cIe)(n,t))}function fIe(){this.textContent=""}function hIe(e){return function(){this.textContent=e}}function mIe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function pIe(e){return arguments.length?this.each(e==null?fIe:(typeof e=="function"?mIe:hIe)(e)):this.node().textContent}function gIe(){this.innerHTML=""}function vIe(e){return function(){this.innerHTML=e}}function yIe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function xIe(e){return arguments.length?this.each(e==null?gIe:(typeof e=="function"?yIe:vIe)(e)):this.node().innerHTML}function bIe(){this.nextSibling&&this.parentNode.appendChild(this)}function wIe(){return this.each(bIe)}function SIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jIe(){return this.each(SIe)}function EIe(e){var t=typeof e=="function"?e:wY(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _Ie(){return null}function CIe(e,t){var n=typeof e=="function"?e:wY(e),r=t==null?_Ie:typeof t=="function"?t:k2(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function NIe(){var e=this.parentNode;e&&e.removeChild(this)}function kIe(){return this.each(NIe)}function AIe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function OIe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function TIe(e){return this.select(e?OIe:AIe)}function PIe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function MIe(e){return function(t){e.call(this,t,this.__data__)}}function RIe(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 DIe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function IIe(e,t,n){return function(){var r=this.__on,i,a=MIe(t);if(r){for(var o=0,l=r.length;o<l;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function LIe(e,t,n){var r=RIe(e+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,d=l.length,m;u<d;++u)for(i=0,m=l[u];i<a;++i)if((o=r[i]).type===m.type&&o.name===m.name)return m.value}return}for(l=t?IIe:DIe,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function TY(e,t,n){var r=CY(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function zIe(e,t){return function(){return TY(this,e,t)}}function $Ie(e,t){return function(){return TY(this,e,t.apply(this,arguments))}}function BIe(e,t){return this.each((typeof t=="function"?$Ie:zIe)(e,t))}function*FIe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var PY=[null];function Xi(e,t){this._groups=e,this._parents=t}function Cg(){return new Xi([[document.documentElement]],PY)}function UIe(){return this}Xi.prototype=Cg.prototype={constructor:Xi,select:mDe,selectAll:yDe,selectChild:SDe,selectChildren:CDe,filter:NDe,data:MDe,enter:kDe,exit:DDe,join:IDe,merge:LDe,selection:UIe,order:zDe,sort:$De,call:FDe,nodes:UDe,node:HDe,size:qDe,empty:VDe,each:KDe,attr:JDe,style:rIe,property:sIe,classed:dIe,text:pIe,html:xIe,raise:wIe,lower:jIe,append:EIe,insert:CIe,remove:kIe,clone:TIe,datum:PIe,on:LIe,dispatch:BIe,[Symbol.iterator]:FIe};function Ii(e){return typeof e=="string"?new Xi([[document.querySelector(e)]],[document.documentElement]):new Xi([[e]],PY)}function HIe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ha(e,t){if(e=HIe(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const qIe={passive:!1},lp={capture:!0,passive:!1};function WE(e){e.stopImmediatePropagation()}function Gd(e){e.preventDefault(),e.stopImmediatePropagation()}function MY(e){var t=e.document.documentElement,n=Ii(e).on("dragstart.drag",Gd,lp);"onselectstart"in t?n.on("selectstart.drag",Gd,lp):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function RY(e,t){var n=e.document.documentElement,r=Ii(e).on("dragstart.drag",null);t&&(r.on("click.drag",Gd,lp),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 Cy=e=>()=>e;function gN(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:u,dy:d,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}gN.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function VIe(e){return!e.ctrlKey&&!e.button}function KIe(){return this.parentNode}function YIe(e,t){return t??{x:e.x,y:e.y}}function XIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function DY(){var e=VIe,t=KIe,n=YIe,r=XIe,i={},a=nw("start","drag","end"),o=0,l,u,d,m,h=0;function g(k){k.on("mousedown.drag",v).filter(r).on("touchstart.drag",S).on("touchmove.drag",j,qIe).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(k,O){if(!(m||!e.call(this,k,O))){var A=E(this,t.call(this,k,O),k,O,"mouse");A&&(Ii(k.view).on("mousemove.drag",b,lp).on("mouseup.drag",w,lp),MY(k.view),WE(k),d=!1,l=k.clientX,u=k.clientY,A("start",k))}}function b(k){if(Gd(k),!d){var O=k.clientX-l,A=k.clientY-u;d=O*O+A*A>h}i.mouse("drag",k)}function w(k){Ii(k.view).on("mousemove.drag mouseup.drag",null),RY(k.view,d),Gd(k),i.mouse("end",k)}function S(k,O){if(e.call(this,k,O)){var A=k.changedTouches,T=t.call(this,k,O),M=A.length,B,I;for(B=0;B<M;++B)(I=E(this,T,k,O,A[B].identifier,A[B]))&&(WE(k),I("start",k,A[B]))}}function j(k){var O=k.changedTouches,A=O.length,T,M;for(T=0;T<A;++T)(M=i[O[T].identifier])&&(Gd(k),M("drag",k,O[T]))}function C(k){var O=k.changedTouches,A=O.length,T,M;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),T=0;T<A;++T)(M=i[O[T].identifier])&&(WE(k),M("end",k,O[T]))}function E(k,O,A,T,M,B){var I=a.copy(),U=Ha(B||A,O),L,G,z;if((z=n.call(k,new gN("beforestart",{sourceEvent:A,target:g,identifier:M,active:o,x:U[0],y:U[1],dx:0,dy:0,dispatch:I}),T))!=null)return L=z.x-U[0]||0,G=z.y-U[1]||0,function K(P,H,Y){var V=U,D;switch(P){case"start":i[M]=K,D=o++;break;case"end":delete i[M],--o;case"drag":U=Ha(Y||H,O),D=o;break}I.call(P,k,new gN(P,{sourceEvent:H,subject:z,target:g,identifier:M,active:D,x:U[0]+L,y:U[1]+G,dx:U[0]-V[0],dy:U[1]-V[1],dispatch:I}),T)}}return g.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Cy(!!k),g):e},g.container=function(k){return arguments.length?(t=typeof k=="function"?k:Cy(k),g):t},g.subject=function(k){return arguments.length?(n=typeof k=="function"?k:Cy(k),g):n},g.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:Cy(!!k),g):r},g.on=function(){var k=a.on.apply(a,arguments);return k===a?g:k},g.clickDistance=function(k){return arguments.length?(h=(k=+k)*k,g):Math.sqrt(h)},g}var Ef=0,Cm=0,ym=0,IY=1e3,p0,Nm,g0=0,Nu=0,iw=0,cp=typeof performance=="object"&&performance.now?performance:Date,LY=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function O2(){return Nu||(LY(GIe),Nu=cp.now()+iw)}function GIe(){Nu=0}function v0(){this._call=this._time=this._next=null}v0.prototype=zY.prototype={constructor:v0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?O2():+n)+(t==null?0:+t),!this._next&&Nm!==this&&(Nm?Nm._next=this:p0=this,Nm=this),this._call=e,this._time=n,vN()},stop:function(){this._call&&(this._call=null,this._time=1/0,vN())}};function zY(e,t,n){var r=new v0;return r.restart(e,t,n),r}function WIe(){O2(),++Ef;for(var e=p0,t;e;)(t=Nu-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ef}function q5(){Nu=(g0=cp.now())+iw,Ef=Cm=0;try{WIe()}finally{Ef=0,ZIe(),Nu=0}}function QIe(){var e=cp.now(),t=e-g0;t>IY&&(iw-=t,g0=e)}function ZIe(){for(var e,t=p0,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:p0=n);Nm=e,vN(r)}function vN(e){if(!Ef){Cm&&(Cm=clearTimeout(Cm));var t=e-Nu;t>24?(e<1/0&&(Cm=setTimeout(q5,e-cp.now()-iw)),ym&&(ym=clearInterval(ym))):(ym||(g0=cp.now(),ym=setInterval(QIe,IY)),Ef=1,LY(q5))}}function V5(e,t,n){var r=new v0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var JIe=nw("start","end","cancel","interrupt"),eLe=[],$Y=0,K5=1,yN=2,Gy=3,Y5=4,xN=5,Wy=6;function aw(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;tLe(e,n,{name:t,index:r,group:i,on:JIe,tween:eLe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:$Y})}function T2(e,t){var n=io(e,t);if(n.state>$Y)throw new Error("too late; already scheduled");return n}function Io(e,t){var n=io(e,t);if(n.state>Gy)throw new Error("too late; already running");return n}function io(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function tLe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zY(a,0,n.time);function a(d){n.state=K5,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var m,h,g,v;if(n.state!==K5)return u();for(m in r)if(v=r[m],v.name===n.name){if(v.state===Gy)return V5(o);v.state===Y5?(v.state=Wy,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[m]):+m<t&&(v.state=Wy,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[m])}if(V5(function(){n.state===Gy&&(n.state=Y5,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=yN,n.on.call("start",e,e.__data__,n.index,n.group),n.state===yN){for(n.state=Gy,i=new Array(g=n.tween.length),m=0,h=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=v);i.length=h+1}}function l(d){for(var m=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(u),n.state=xN,1),h=-1,g=i.length;++h<g;)i[h].call(e,m);n.state===xN&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Wy,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Qy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>yN&&r.state<xN,r.state=Wy,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function nLe(e){return this.each(function(){Qy(this,e)})}function rLe(e,t){var n,r;return function(){var i=Io(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function iLe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Io(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},u=0,d=i.length;u<d;++u)if(i[u].name===t){i[u]=l;break}u===d&&i.push(l)}a.tween=i}}function aLe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=io(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?rLe:iLe)(n,e,t))}function P2(e,t,n){var r=e._id;return e.each(function(){var i=Io(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return io(i,r).value[t]}}function BY(e,t){var n;return(typeof t=="number"?qa:t instanceof _u?Gx:(n=_u(t))?(t=n,Gx):k7)(e,t)}function oLe(e){return function(){this.removeAttribute(e)}}function sLe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lLe(e,t,n){var r,i=n+"",a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function cLe(e,t,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function uLe(e,t,n){var r,i,a;return function(){var o,l=n(this),u;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),u=l+"",o===u?null:o===r&&u===i?a:(i=u,a=t(r=o,l)))}}function dLe(e,t,n){var r,i,a;return function(){var o,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),u=l+"",o===u?null:o===r&&u===i?a:(i=u,a=t(r=o,l)))}}function fLe(e,t){var n=rw(e),r=n==="transform"?hje:BY;return this.attrTween(e,typeof t=="function"?(n.local?dLe:uLe)(n,r,P2(this,"attr."+e,t)):t==null?(n.local?sLe:oLe)(n):(n.local?cLe:lLe)(n,r,t))}function hLe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function mLe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function pLe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&mLe(e,a)),n}return i._value=t,i}function gLe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&hLe(e,a)),n}return i._value=t,i}function vLe(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=rw(e);return this.tween(n,(r.local?pLe:gLe)(r,t))}function yLe(e,t){return function(){T2(this,e).delay=+t.apply(this,arguments)}}function xLe(e,t){return t=+t,function(){T2(this,e).delay=t}}function bLe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yLe:xLe)(t,e)):io(this.node(),t).delay}function wLe(e,t){return function(){Io(this,e).duration=+t.apply(this,arguments)}}function SLe(e,t){return t=+t,function(){Io(this,e).duration=t}}function jLe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wLe:SLe)(t,e)):io(this.node(),t).duration}function ELe(e,t){if(typeof t!="function")throw new Error;return function(){Io(this,e).ease=t}}function _Le(e){var t=this._id;return arguments.length?this.each(ELe(t,e)):io(this.node(),t).ease}function CLe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Io(this,e).ease=n}}function NLe(e){if(typeof e!="function")throw new Error;return this.each(CLe(this._id,e))}function kLe(e){typeof e!="function"&&(e=jY(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],u,d=0;d<o;++d)(u=a[d])&&e.call(u,u.__data__,d,a)&&l.push(u);return new ks(r,this._parents,this._name,this._id)}function ALe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=new Array(r),l=0;l<a;++l)for(var u=t[l],d=n[l],m=u.length,h=o[l]=new Array(m),g,v=0;v<m;++v)(g=u[v]||d[v])&&(h[v]=g);for(;l<r;++l)o[l]=t[l];return new ks(o,this._parents,this._name,this._id)}function OLe(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 TLe(e,t,n){var r,i,a=OLe(t)?T2:Io;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function PLe(e,t){var n=this._id;return arguments.length<2?io(this.node(),n).on.on(e):this.each(TLe(n,e,t))}function MLe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function RLe(){return this.on("end.remove",MLe(this._id))}function DLe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=k2(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var l=r[o],u=l.length,d=a[o]=new Array(u),m,h,g=0;g<u;++g)(m=l[g])&&(h=e.call(m,m.__data__,g,l))&&("__data__"in m&&(h.__data__=m.__data__),d[g]=h,aw(d[g],t,n,g,d,io(m,n)));return new ks(a,this._parents,t,n)}function ILe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=SY(e));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var u=r[l],d=u.length,m,h=0;h<d;++h)if(m=u[h]){for(var g=e.call(m,m.__data__,h,u),v,b=io(m,n),w=0,S=g.length;w<S;++w)(v=g[w])&&aw(v,t,n,w,g,b);a.push(g),o.push(m)}return new ks(a,o,t,n)}var LLe=Cg.prototype.constructor;function zLe(){return new LLe(this._groups,this._parents)}function $Le(e,t){var n,r,i;return function(){var a=jf(this,e),o=(this.style.removeProperty(e),jf(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function FY(e){return function(){this.style.removeProperty(e)}}function BLe(e,t,n){var r,i=n+"",a;return function(){var o=jf(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function FLe(e,t,n){var r,i,a;return function(){var o=jf(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),jf(this,e))),o===u?null:o===r&&u===i?a:(i=u,a=t(r=o,l))}}function ULe(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var u=Io(this,e),d=u.on,m=u.value[a]==null?l||(l=FY(t)):void 0;(d!==n||i!==m)&&(r=(n=d).copy()).on(o,i=m),u.on=r}}function HLe(e,t,n){var r=(e+="")=="transform"?fje:BY;return t==null?this.styleTween(e,$Le(e,r)).on("end.style."+e,FY(e)):typeof t=="function"?this.styleTween(e,FLe(e,r,P2(this,"style."+e,t))).each(ULe(this._id,e)):this.styleTween(e,BLe(e,r,t),n).on("end.style."+e,null)}function qLe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function VLe(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&qLe(e,o,n)),r}return a._value=t,a}function KLe(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,VLe(e,t,n??""))}function YLe(e){return function(){this.textContent=e}}function XLe(e){return function(){var t=e(this);this.textContent=t??""}}function GLe(e){return this.tween("text",typeof e=="function"?XLe(P2(this,"text",e)):YLe(e==null?"":e+""))}function WLe(e){return function(t){this.textContent=e.call(this,t)}}function QLe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&WLe(i)),t}return r._value=e,r}function ZLe(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,QLe(e))}function JLe(){for(var e=this._name,t=this._id,n=UY(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,u,d=0;d<l;++d)if(u=o[d]){var m=io(u,t);aw(u,e,n,d,o,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new ks(r,this._parents,e,n)}function e3e(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var l={value:o},u={value:function(){--i===0&&a()}};n.each(function(){var d=Io(this,r),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),d.on=t}),i===0&&a()})}var t3e=0;function ks(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function UY(){return++t3e}var rs=Cg.prototype;ks.prototype={constructor:ks,select:DLe,selectAll:ILe,selectChild:rs.selectChild,selectChildren:rs.selectChildren,filter:kLe,merge:ALe,selection:zLe,transition:JLe,call:rs.call,nodes:rs.nodes,node:rs.node,size:rs.size,empty:rs.empty,each:rs.each,on:PLe,attr:fLe,attrTween:vLe,style:HLe,styleTween:KLe,text:GLe,textTween:ZLe,remove:RLe,tween:aLe,delay:bLe,duration:jLe,ease:_Le,easeVarying:NLe,end:e3e,[Symbol.iterator]:rs[Symbol.iterator]};function n3e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var r3e={time:null,delay:0,duration:250,ease:n3e};function i3e(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 a3e(e){var t,n;e instanceof ks?(t=e._id,e=e._name):(t=UY(),(n=r3e).time=O2(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,u,d=0;d<l;++d)(u=o[d])&&aw(u,e,t,d,o,n||i3e(u,t));return new ks(r,this._parents,e,t)}Cg.prototype.interrupt=nLe;Cg.prototype.transition=a3e;const Ny=e=>()=>e;function o3e(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function hs(e,t,n){this.k=e,this.x=t,this.y=n}hs.prototype={constructor:hs,scale:function(e){return e===1?this:new hs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new hs(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 ow=new hs(1,0,0);HY.prototype=hs.prototype;function HY(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ow;return e.__zoom}function QE(e){e.stopImmediatePropagation()}function xm(e){e.preventDefault(),e.stopImmediatePropagation()}function s3e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function l3e(){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 X5(){return this.__zoom||ow}function c3e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function u3e(){return navigator.maxTouchPoints||"ontouchstart"in this}function d3e(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function qY(){var e=s3e,t=l3e,n=d3e,r=c3e,i=u3e,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Vy,d=nw("start","zoom","end"),m,h,g,v=500,b=150,w=0,S=10;function j(z){z.property("__zoom",X5).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",U).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(z,K,P,H){var Y=z.selection?z.selection():z;Y.property("__zoom",X5),z!==Y?O(z,K,P,H):Y.interrupt().each(function(){A(this,arguments).event(H).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},j.scaleBy=function(z,K,P,H){j.scaleTo(z,function(){var Y=this.__zoom.k,V=typeof K=="function"?K.apply(this,arguments):K;return Y*V},P,H)},j.scaleTo=function(z,K,P,H){j.transform(z,function(){var Y=t.apply(this,arguments),V=this.__zoom,D=P==null?k(Y):typeof P=="function"?P.apply(this,arguments):P,q=V.invert(D),$=typeof K=="function"?K.apply(this,arguments):K;return n(E(C(V,$),D,q),Y,o)},P,H)},j.translateBy=function(z,K,P,H){j.transform(z,function(){return n(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),o)},null,H)},j.translateTo=function(z,K,P,H,Y){j.transform(z,function(){var V=t.apply(this,arguments),D=this.__zoom,q=H==null?k(V):typeof H=="function"?H.apply(this,arguments):H;return n(ow.translate(q[0],q[1]).scale(D.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof P=="function"?-P.apply(this,arguments):-P),V,o)},H,Y)};function C(z,K){return K=Math.max(a[0],Math.min(a[1],K)),K===z.k?z:new hs(K,z.x,z.y)}function E(z,K,P){var H=K[0]-P[0]*z.k,Y=K[1]-P[1]*z.k;return H===z.x&&Y===z.y?z:new hs(z.k,H,Y)}function k(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function O(z,K,P,H){z.on("start.zoom",function(){A(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(H).end()}).tween("zoom",function(){var Y=this,V=arguments,D=A(Y,V).event(H),q=t.apply(Y,V),$=P==null?k(q):typeof P=="function"?P.apply(Y,V):P,F=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),Q=Y.__zoom,Z=typeof K=="function"?K.apply(Y,V):K,te=u(Q.invert($).concat(F/Q.k),Z.invert($).concat(F/Z.k));return function(ae){if(ae===1)ae=Z;else{var re=te(ae),ee=F/re[2];ae=new hs(ee,$[0]-re[0]*ee,$[1]-re[1]*ee)}D.zoom(null,ae)}})}function A(z,K,P){return!P&&z.__zooming||new T(z,K)}function T(z,K){this.that=z,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(z,K),this.taps=0}T.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,K){return this.mouse&&z!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var K=Ii(this.that).datum();d.call(z,this.that,new o3e(z,{sourceEvent:this.sourceEvent,target:j,transform:this.that.__zoom,dispatch:d}),K)}};function M(z,...K){if(!e.apply(this,arguments))return;var P=A(this,K).event(z),H=this.__zoom,Y=Math.max(a[0],Math.min(a[1],H.k*Math.pow(2,r.apply(this,arguments)))),V=Ha(z);if(P.wheel)(P.mouse[0][0]!==V[0]||P.mouse[0][1]!==V[1])&&(P.mouse[1]=H.invert(P.mouse[0]=V)),clearTimeout(P.wheel);else{if(H.k===Y)return;P.mouse=[V,H.invert(V)],Qy(this),P.start()}xm(z),P.wheel=setTimeout(D,b),P.zoom("mouse",n(E(C(H,Y),P.mouse[0],P.mouse[1]),P.extent,o));function D(){P.wheel=null,P.end()}}function B(z,...K){if(g||!e.apply(this,arguments))return;var P=z.currentTarget,H=A(this,K,!0).event(z),Y=Ii(z.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",F,!0),V=Ha(z,P),D=z.clientX,q=z.clientY;MY(z.view),QE(z),H.mouse=[V,this.__zoom.invert(V)],Qy(this),H.start();function $(Q){if(xm(Q),!H.moved){var Z=Q.clientX-D,te=Q.clientY-q;H.moved=Z*Z+te*te>w}H.event(Q).zoom("mouse",n(E(H.that.__zoom,H.mouse[0]=Ha(Q,P),H.mouse[1]),H.extent,o))}function F(Q){Y.on("mousemove.zoom mouseup.zoom",null),RY(Q.view,H.moved),xm(Q),H.event(Q).end()}}function I(z,...K){if(e.apply(this,arguments)){var P=this.__zoom,H=Ha(z.changedTouches?z.changedTouches[0]:z,this),Y=P.invert(H),V=P.k*(z.shiftKey?.5:2),D=n(E(C(P,V),H,Y),t.apply(this,K),o);xm(z),l>0?Ii(this).transition().duration(l).call(O,D,H,z):Ii(this).call(j.transform,D,H,z)}}function U(z,...K){if(e.apply(this,arguments)){var P=z.touches,H=P.length,Y=A(this,K,z.changedTouches.length===H).event(z),V,D,q,$;for(QE(z),D=0;D<H;++D)q=P[D],$=Ha(q,this),$=[$,this.__zoom.invert($),q.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==$[2]&&(Y.touch1=$,Y.taps=0):(Y.touch0=$,V=!0,Y.taps=1+!!m);m&&(m=clearTimeout(m)),V&&(Y.taps<2&&(h=$[0],m=setTimeout(function(){m=null},v)),Qy(this),Y.start())}}function L(z,...K){if(this.__zooming){var P=A(this,K).event(z),H=z.changedTouches,Y=H.length,V,D,q,$;for(xm(z),V=0;V<Y;++V)D=H[V],q=Ha(D,this),P.touch0&&P.touch0[2]===D.identifier?P.touch0[0]=q:P.touch1&&P.touch1[2]===D.identifier&&(P.touch1[0]=q);if(D=P.that.__zoom,P.touch1){var F=P.touch0[0],Q=P.touch0[1],Z=P.touch1[0],te=P.touch1[1],ae=(ae=Z[0]-F[0])*ae+(ae=Z[1]-F[1])*ae,re=(re=te[0]-Q[0])*re+(re=te[1]-Q[1])*re;D=C(D,Math.sqrt(ae/re)),q=[(F[0]+Z[0])/2,(F[1]+Z[1])/2],$=[(Q[0]+te[0])/2,(Q[1]+te[1])/2]}else if(P.touch0)q=P.touch0[0],$=P.touch0[1];else return;P.zoom("touch",n(E(D,q,$),P.extent,o))}}function G(z,...K){if(this.__zooming){var P=A(this,K).event(z),H=z.changedTouches,Y=H.length,V,D;for(QE(z),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),V=0;V<Y;++V)D=H[V],P.touch0&&P.touch0[2]===D.identifier?delete P.touch0:P.touch1&&P.touch1[2]===D.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(D=Ha(D,this),Math.hypot(h[0]-D[0],h[1]-D[1])<S)){var q=Ii(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return j.wheelDelta=function(z){return arguments.length?(r=typeof z=="function"?z:Ny(+z),j):r},j.filter=function(z){return arguments.length?(e=typeof z=="function"?z:Ny(!!z),j):e},j.touchable=function(z){return arguments.length?(i=typeof z=="function"?z:Ny(!!z),j):i},j.extent=function(z){return arguments.length?(t=typeof z=="function"?z:Ny([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),j):t},j.scaleExtent=function(z){return arguments.length?(a[0]=+z[0],a[1]=+z[1],j):[a[0],a[1]]},j.translateExtent=function(z){return arguments.length?(o[0][0]=+z[0][0],o[1][0]=+z[1][0],o[0][1]=+z[0][1],o[1][1]=+z[1][1],j):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},j.constrain=function(z){return arguments.length?(n=z,j):n},j.duration=function(z){return arguments.length?(l=+z,j):l},j.interpolate=function(z){return arguments.length?(u=z,j):u},j.on=function(){var z=d.on.apply(d,arguments);return z===d?j:z},j.clickDistance=function(z){return arguments.length?(w=(z=+z)*z,j):Math.sqrt(w)},j.tapDistance=function(z){return arguments.length?(S=+z,j):S},j}const Po={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."},up=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],VY=["Enter"," ","Escape"],KY={"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 _f;(function(e){e.Strict="strict",e.Loose="loose"})(_f||(_f={}));var iu;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(iu||(iu={}));var dp;(function(e){e.Partial="partial",e.Full="full"})(dp||(dp={}));const YY={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Nl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Nl||(Nl={}));var Cf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Cf||(Cf={}));var Ye;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ye||(Ye={}));const G5={[Ye.Left]:Ye.Right,[Ye.Right]:Ye.Left,[Ye.Top]:Ye.Bottom,[Ye.Bottom]:Ye.Top};function XY(e){return e===null?null:e?"valid":"invalid"}const GY=e=>"id"in e&&"source"in e&&"target"in e,f3e=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),M2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ng=(e,t=[0,0])=>{const{width:n,height:r}=$s(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},h3e=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):M2(i)?i:t.nodeLookup.get(i.id));const l=o?y0(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return sw(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return lw(n)},kg=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=sw(n,y0(i)),r=!0)}),r?lw(n):{x:0,y:0,width:0,height:0}},R2=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...Og(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const d of e.values()){const{measured:m,selectable:h=!0,hidden:g=!1}=d;if(o&&!h||g)continue;const v=m.width??d.width??d.initialWidth??null,b=m.height??d.height??d.initialHeight??null,w=fp(l,kf(d)),S=(v??0)*(b??0),j=a&&w>0;(!d.internals.handleBounds||j||w>=S||d.dragging)&&u.push(d)}return u},m3e=(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 p3e(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function g3e({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=p3e(e,o),u=kg(l),d=D2(u,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function WY({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:u,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},m=o.origin??r;let h=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Po.error005());else{const v=l.measured.width,b=l.measured.height;v&&b&&(h=[[u,d],[u+v,d+b]])}else l&&Af(o.extent)&&(h=[[o.extent[0][0]+u,o.extent[0][1]+d],[o.extent[1][0]+u,o.extent[1][1]+d]]);const g=Af(h)?ku(t,h,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Po.error015())),{position:{x:g.x-u+(o.measured.width??0)*m[0],y:g.y-d+(o.measured.height??0)*m[1]},positionAbsolute:g}}async function v3e({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),o=[];for(const g of n){if(g.deletable===!1)continue;const v=a.has(g.id),b=!v&&g.parentId&&o.find(w=>w.id===g.parentId);(v||b)&&o.push(g)}const l=new Set(t.map(g=>g.id)),u=r.filter(g=>g.deletable!==!1),m=m3e(o,u);for(const g of u)l.has(g.id)&&!m.find(b=>b.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:o};const h=await i({nodes:o,edges:m});return typeof h=="boolean"?h?{edges:m,nodes:o}:{edges:[],nodes:[]}:h}const Nf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ku=(e={x:0,y:0},t,n)=>({x:Nf(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Nf(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function QY(e,t,n){const{width:r,height:i}=$s(n),{x:a,y:o}=n.internals.positionAbsolute;return ku(e,[[a,o],[a+r,o+i]],t)}const W5=(e,t,n)=>e<t?Nf(Math.abs(e-t),1,t)/t:e>n?-Nf(Math.abs(e-n),1,t)/t:0,ZY=(e,t,n=15,r=40)=>{const i=W5(e.x,r,t.width-r)*n,a=W5(e.y,r,t.height-r)*n;return[i,a]},sw=(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)}),bN=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),lw=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),kf=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=M2(e)?e.internals.positionAbsolute:Ng(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},y0=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=M2(e)?e.internals.positionAbsolute:Ng(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},JY=(e,t)=>lw(sw(bN(e),bN(t))),fp=(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)},Q5=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),y3e=(e,t)=>{},Ag=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Og=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?Ag(l,o):l},x0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Rd(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 x3e(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Rd(e,n),i=Rd(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Rd(e.top??e.y??0,n),i=Rd(e.bottom??e.y??0,n),a=Rd(e.left??e.x??0,t),o=Rd(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function b3e(e,t,n,r,i,a){const{x:o,y:l}=x0(e,[t,n,r]),{x:u,y:d}=x0({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-u,h=a-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(m),bottom:Math.floor(h)}}const D2=(e,t,n,r,i,a)=>{const o=x3e(a,t,n),l=(t-o.x)/e.width,u=(n-o.y)/e.height,d=Math.min(l,u),m=Nf(d,r,i),h=e.x+e.width/2,g=e.y+e.height/2,v=t/2-h*m,b=n/2-g*m,w=b3e(e,v,b,m,t,n),S={left:Math.min(w.left-o.left,0),top:Math.min(w.top-o.top,0),right:Math.min(w.right-o.right,0),bottom:Math.min(w.bottom-o.bottom,0)};return{x:v-S.left+S.right,y:b-S.top+S.bottom,zoom:m}},hp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Af(e){return e!=null&&e!=="parent"}function $s(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 eX(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 tX(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function Z5(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function w3e(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function S3e(e){return{...KY,...e||{}}}function Dm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Ga(e),l=Og({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:u,y:d}=n?Ag(l,t):l;return{xSnapped:u,ySnapped:d,...l}}const I2=e=>({width:e.offsetWidth,height:e.offsetHeight}),nX=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},j3e=["INPUT","SELECT","TEXTAREA"];function rX(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:j3e.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const iX=e=>"clientX"in e,Ga=(e,t)=>{var a,o;const n=iX(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},J5=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...I2(o)}})};function aX({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const u=e*.125+i*.375+o*.375+n*.125,d=t*.125+a*.375+l*.375+r*.125,m=Math.abs(u-e),h=Math.abs(d-t);return[u,d,m,h]}function ky(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function e$({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Ye.Left:return[t-ky(t-r,a),n];case Ye.Right:return[t+ky(r-t,a),n];case Ye.Top:return[t,n-ky(n-i,a)];case Ye.Bottom:return[t,n+ky(i-n,a)]}}function oX({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:a=Ye.Top,curvature:o=.25}){const[l,u]=e$({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,m]=e$({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[h,g,v,b]=aX({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:m});return[`M${e},${t} C${l},${u} ${d},${m} ${r},${i}`,h,g,v,b]}function sX({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[a,l,i,o]}function E3e({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a="basic"}){if(a==="manual")return r;const o=i&&n?r+1e3:r,l=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return o+l}function _3e({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=sw(y0(e),y0(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return fp(o,lw(a))>0}const C3e=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,N3e=(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)),k3e=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||C3e;let i;return GY(e)?i={...e}:i={...e,id:r(e)},N3e(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function lX({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=sX({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const t$={[Ye.Left]:{x:-1,y:0},[Ye.Right]:{x:1,y:0},[Ye.Top]:{x:0,y:-1},[Ye.Bottom]:{x:0,y:1}},A3e=({source:e,sourcePosition:t=Ye.Bottom,target:n})=>t===Ye.Left||t===Ye.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},n$=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function O3e({source:e,sourcePosition:t=Ye.Bottom,target:n,targetPosition:r=Ye.Top,center:i,offset:a,stepPosition:o}){const l=t$[t],u=t$[r],d={x:e.x+l.x*a,y:e.y+l.y*a},m={x:n.x+u.x*a,y:n.y+u.y*a},h=A3e({source:d,sourcePosition:t,target:m}),g=h.x!==0?"x":"y",v=h[g];let b=[],w,S;const j={x:0,y:0},C={x:0,y:0},[,,E,k]=sX({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*u[g]===-1){g==="x"?(w=i.x??d.x+(m.x-d.x)*o,S=i.y??(d.y+m.y)/2):(w=i.x??(d.x+m.x)/2,S=i.y??d.y+(m.y-d.y)*o);const A=[{x:w,y:d.y},{x:w,y:m.y}],T=[{x:d.x,y:S},{x:m.x,y:S}];l[g]===v?b=g==="x"?A:T:b=g==="x"?T:A}else{const A=[{x:d.x,y:m.y}],T=[{x:m.x,y:d.y}];if(g==="x"?b=l.x===v?T:A:b=l.y===v?A:T,t===r){const L=Math.abs(e[g]-n[g]);if(L<=a){const G=Math.min(a-1,a-L);l[g]===v?j[g]=(d[g]>e[g]?-1:1)*G:C[g]=(m[g]>n[g]?-1:1)*G}}if(t!==r){const L=g==="x"?"y":"x",G=l[g]===u[L],z=d[L]>m[L],K=d[L]<m[L];(l[g]===1&&(!G&&z||G&&K)||l[g]!==1&&(!G&&K||G&&z))&&(b=g==="x"?A:T)}const M={x:d.x+j.x,y:d.y+j.y},B={x:m.x+C.x,y:m.y+C.y},I=Math.max(Math.abs(M.x-b[0].x),Math.abs(B.x-b[0].x)),U=Math.max(Math.abs(M.y-b[0].y),Math.abs(B.y-b[0].y));I>=U?(w=(M.x+B.x)/2,S=b[0].y):(w=b[0].x,S=(M.y+B.y)/2)}return[[e,{x:d.x+j.x,y:d.y+j.y},...b,{x:m.x+C.x,y:m.y+C.y},n],w,S,E,k]}function T3e(e,t,n,r){const i=Math.min(n$(e,t)/2,n$(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const d=e.x<n.x?-1:1,m=e.y<n.y?1:-1;return`L ${a+i*d},${o}Q ${a},${o} ${a},${o+i*m}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${a},${o+i*u}Q ${a},${o} ${a+i*l},${o}`}function wN({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:a=Ye.Top,borderRadius:o=5,centerX:l,centerY:u,offset:d=20,stepPosition:m=.5}){const[h,g,v,b,w]=O3e({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:l,y:u},offset:d,stepPosition:m});return[h.reduce((j,C,E)=>{let k="";return E>0&&E<h.length-1?k=T3e(h[E-1],C,h[E+1],o):k=`${E===0?"M":"L"}${C.x} ${C.y}`,j+=k,j},""),g,v,b,w]}function r$(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function P3e(e){var h;const{sourceNode:t,targetNode:n}=e;if(!r$(t)||!r$(n))return null;const r=t.internals.handleBounds||i$(t.handles),i=n.internals.handleBounds||i$(n.handles),a=a$((r==null?void 0:r.source)??[],e.sourceHandle),o=a$(e.connectionMode===_f.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!a||!o)return(h=e.onError)==null||h.call(e,"008",Po.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||Ye.Bottom,u=(o==null?void 0:o.position)||Ye.Top,d=Au(t,a,l),m=Au(n,o,u);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:l,targetPosition:u}}function i$(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 Au(e,t,n=Ye.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??$s(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case Ye.Top:return{x:i+o/2,y:a};case Ye.Right:return{x:i+o,y:a+l/2};case Ye.Bottom:return{x:i+o/2,y:a+l};case Ye.Left:return{x:i,y:a+l/2}}}function a$(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function SN(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function M3e(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const d=SN(u,t);a.has(d)||(o.push({id:d,color:u.color||n,...u}),a.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const cX=1e3,R3e=10,L2={nodeOrigin:[0,0],nodeExtent:up,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},D3e={...L2,checkEquality:!0};function z2(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function I3e(e,t,n){const r=z2(L2,n);for(const i of e.values())if(i.parentId)B2(i,e,t,r);else{const a=Ng(i,r.nodeOrigin),o=Af(i.extent)?i.extent:r.nodeExtent,l=ku(a,o,$s(i));i.internals.positionAbsolute=l}}function L3e(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function $2(e){return e==="manual"}function jN(e,t,n,r={}){var d,m;const i=z2(D3e,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!$2(i.zIndexMode)?cX:0;let u=e.length>0;t.clear(),n.clear();for(const h of e){let g=o.get(h.id);if(i.checkEquality&&h===(g==null?void 0:g.internals.userNode))t.set(h.id,g);else{const v=Ng(h,i.nodeOrigin),b=Af(h.extent)?h.extent:i.nodeExtent,w=ku(v,b,$s(h));g={...i.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(m=h.measured)==null?void 0:m.height},internals:{positionAbsolute:w,handleBounds:L3e(h,g),z:uX(h,l,i.zIndexMode),userNode:h}},t.set(h.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),h.parentId&&B2(g,t,n,r,a)}return u}function z3e(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 B2(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:u}=z2(L2,r),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}z3e(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&u==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*R3e),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const h=a&&!$2(u)?cX:0,{x:g,y:v,z:b}=$3e(e,m,o,l,h,u),{positionAbsolute:w}=e.internals,S=g!==w.x||v!==w.y;(S||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:g,y:v}:w,z:b}})}function uX(e,t,n){const r=Xa(e.zIndex)?e.zIndex:0;return $2(n)?r:r+(e.selected?t:0)}function $3e(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,u=$s(e),d=Ng(e,n),m=Af(e.extent)?ku(d,e.extent,u):d;let h=ku({x:o+m.x,y:l+m.y},r,u);e.extent==="parent"&&(h=QY(h,u,t));const g=uX(e,i,a),v=t.internals.z??0;return{x:h.x,y:h.y,z:v>=g?v+1:g}}function F2(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const d=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??kf(u),m=JY(d,l.rect);a.set(l.parentId,{expandedRect:m,parent:u})}return a.size>0&&a.forEach(({expandedRect:l,parent:u},d)=>{var E;const m=u.internals.positionAbsolute,h=$s(u),g=u.origin??r,v=l.x<m.x?Math.round(Math.abs(m.x-l.x)):0,b=l.y<m.y?Math.round(Math.abs(m.y-l.y)):0,w=Math.max(h.width,Math.round(l.width)),S=Math.max(h.height,Math.round(l.height)),j=(w-h.width)*g[0],C=(S-h.height)*g[1];(v>0||b>0||j||C)&&(i.push({id:d,type:"position",position:{x:u.position.x-v+j,y:u.position.y-b+C}}),(E=n.get(d))==null||E.forEach(k=>{e.some(O=>O.id===k.id)||i.push({id:k.id,type:"position",position:{x:k.position.x+v,y:k.position.y+b}})})),(h.width<l.width||h.height<l.height||v||b)&&i.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-j:0),height:S+(b?g[1]*b-C:0)}})}),i}function B3e(e,t,n,r,i,a,o){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const d=[],m=window.getComputedStyle(l),{m22:h}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const b=t.get(v.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const w=I2(v.nodeElement),S=b.measured.width!==w.width||b.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!b.internals.handleBounds||v.force))){const C=v.nodeElement.getBoundingClientRect(),E=Af(b.extent)?b.extent:a;let{positionAbsolute:k}=b.internals;b.parentId&&b.extent==="parent"?k=QY(k,w,t.get(b.parentId)):E&&(k=ku(k,E,w));const O={...b,measured:w,internals:{...b.internals,positionAbsolute:k,handleBounds:{source:J5("source",v.nodeElement,C,h,b.id),target:J5("target",v.nodeElement,C,h,b.id)}}};t.set(b.id,O),b.parentId&&B2(O,t,n,{nodeOrigin:i,zIndexMode:o}),u=!0,S&&(d.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:kf(O,i)}))}}if(g.length>0){const v=F2(g,t,n,i);d.push(...v)}return{changes:d,updatedInternals:u}}async function F3e({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function o$(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const u=r.get(o)||new Map;if(r.set(o,u.set(n,t)),a){o=`${i}-${e}-${a}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function dX(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,u={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},d=`${i}-${o}--${a}-${l}`,m=`${a}-${l}--${i}-${o}`;o$("source",u,m,e,i,o),o$("target",u,d,e,a,l),t.set(r.id,r)}}function fX(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:fX(n,t):!1}function s$(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function U3e(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!fX(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function ZE({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,u;const i=[];for(const[d,m]of t){const h=(o=n.get(d))==null?void 0:o.internals.userNode;h&&i.push({...h,position:m.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((u=t.get(e))==null?void 0:u.position)||a.position,dragging:r}:i[0],i]}function H3e({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},o=Ag(a,t);return{x:o.x-a.x,y:o.y-a.y}}function q3e({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,u=!1,d={x:0,y:0},m=null,h=!1,g=null,v=!1,b=!1,w=null;function S({noDragClassName:C,handleSelector:E,domNode:k,isSelectable:O,nodeId:A,nodeClickDistance:T=0}){g=Ii(k);function M({x:L,y:G}){const{nodeLookup:z,nodeExtent:K,snapGrid:P,snapToGrid:H,nodeOrigin:Y,onNodeDrag:V,onSelectionDrag:D,onError:q,updateNodePositions:$}=t();a={x:L,y:G};let F=!1;const Q=l.size>1,Z=Q&&K?bN(kg(l)):null,te=Q&&H?H3e({dragItems:l,snapGrid:P,x:L,y:G}):null;for(const[ae,re]of l){if(!z.has(ae))continue;let ee={x:L-re.distance.x,y:G-re.distance.y};H&&(ee=te?{x:Math.round(ee.x+te.x),y:Math.round(ee.y+te.y)}:Ag(ee,P));let se=null;if(Q&&K&&!re.extent&&Z){const{positionAbsolute:Se}=re.internals,Ee=Se.x-Z.x+K[0][0],qe=Se.x+re.measured.width-Z.x2+K[1][0],Te=Se.y-Z.y+K[0][1],rt=Se.y+re.measured.height-Z.y2+K[1][1];se=[[Ee,Te],[qe,rt]]}const{position:ve,positionAbsolute:ie}=WY({nodeId:ae,nextPosition:ee,nodeLookup:z,nodeExtent:se||K,nodeOrigin:Y,onError:q});F=F||re.position.x!==ve.x||re.position.y!==ve.y,re.position=ve,re.internals.positionAbsolute=ie}if(b=b||F,!!F&&($(l,!0),w&&(r||V||!A&&D))){const[ae,re]=ZE({nodeId:A,dragItems:l,nodeLookup:z});r==null||r(w,l,ae,re),V==null||V(w,ae,re),A||D==null||D(w,re)}}async function B(){if(!m)return;const{transform:L,panBy:G,autoPanSpeed:z,autoPanOnNodeDrag:K}=t();if(!K){u=!1,cancelAnimationFrame(o);return}const[P,H]=ZY(d,m,z);(P!==0||H!==0)&&(a.x=(a.x??0)-P/L[2],a.y=(a.y??0)-H/L[2],await G({x:P,y:H})&&M(a)),o=requestAnimationFrame(B)}function I(L){var Q;const{nodeLookup:G,multiSelectionActive:z,nodesDraggable:K,transform:P,snapGrid:H,snapToGrid:Y,selectNodesOnDrag:V,onNodeDragStart:D,onSelectionDragStart:q,unselectNodesAndEdges:$}=t();h=!0,(!V||!O)&&!z&&A&&((Q=G.get(A))!=null&&Q.selected||$()),O&&V&&A&&(e==null||e(A));const F=Dm(L.sourceEvent,{transform:P,snapGrid:H,snapToGrid:Y,containerBounds:m});if(a=F,l=U3e(G,K,F,A),l.size>0&&(n||D||!A&&q)){const[Z,te]=ZE({nodeId:A,dragItems:l,nodeLookup:G});n==null||n(L.sourceEvent,l,Z,te),D==null||D(L.sourceEvent,Z,te),A||q==null||q(L.sourceEvent,te)}}const U=DY().clickDistance(T).on("start",L=>{const{domNode:G,nodeDragThreshold:z,transform:K,snapGrid:P,snapToGrid:H}=t();m=(G==null?void 0:G.getBoundingClientRect())||null,v=!1,b=!1,w=L.sourceEvent,z===0&&I(L),a=Dm(L.sourceEvent,{transform:K,snapGrid:P,snapToGrid:H,containerBounds:m}),d=Ga(L.sourceEvent,m)}).on("drag",L=>{const{autoPanOnNodeDrag:G,transform:z,snapGrid:K,snapToGrid:P,nodeDragThreshold:H,nodeLookup:Y}=t(),V=Dm(L.sourceEvent,{transform:z,snapGrid:K,snapToGrid:P,containerBounds:m});if(w=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||A&&!Y.has(A))&&(v=!0),!v){if(!u&&G&&h&&(u=!0,B()),!h){const D=Ga(L.sourceEvent,m),q=D.x-d.x,$=D.y-d.y;Math.sqrt(q*q+$*$)>H&&I(L)}(a.x!==V.xSnapped||a.y!==V.ySnapped)&&l&&h&&(d=Ga(L.sourceEvent,m),M(V))}}).on("end",L=>{if(!(!h||v)&&(u=!1,h=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:G,updateNodePositions:z,onNodeDragStop:K,onSelectionDragStop:P}=t();if(b&&(z(l,!1),b=!1),i||K||!A&&P){const[H,Y]=ZE({nodeId:A,dragItems:l,nodeLookup:G,dragging:!1});i==null||i(L.sourceEvent,l,H,Y),K==null||K(L.sourceEvent,H,Y),A||P==null||P(L.sourceEvent,Y)}}}).filter(L=>{const G=L.target;return!L.button&&(!C||!s$(G,`.${C}`,k))&&(!E||s$(G,E,k))});g.call(U)}function j(){g==null||g.on(".drag",null)}return{update:S,destroy:j}}function V3e(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())fp(i,kf(a))>0&&r.push(a);return r}const K3e=250;function Y3e(e,t,n,r){var l,u;let i=[],a=1/0;const o=V3e(e,n,t+K3e);for(const d of o){const m=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const h of m){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:g,y:v}=Au(d,h,h.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));b>t||(b<a?(i=[{...h,x:g,y:v}],a=b):b===a&&i.push({...h,x:g,y:v}))}}if(!i.length)return null;if(i.length>1){const d=r.type==="source"?"target":"source";return i.find(m=>m.type===d)??i[0]}return i[0]}function hX(e,t,n,r,i,a=!1){var d,m,h;const o=r.get(e);if(!o)return null;const l=i==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((m=o.internals.handleBounds)==null?void 0:m.source)??[],...((h=o.internals.handleBounds)==null?void 0:h.target)??[]],u=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return u&&a?{...u,...Au(o,u,u.position,!0)}:u}function mX(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function X3e(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const pX=()=>!0;function G3e(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:u,lib:d,autoPanOnConnect:m,flowId:h,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:w,onConnectEnd:S,isValidConnection:j=pX,onReconnectEnd:C,updateConnection:E,getTransform:k,getFromHandle:O,autoPanSpeed:A,dragThreshold:T=1,handleDomNode:M}){const B=nX(e.target);let I=0,U;const{x:L,y:G}=Ga(e),z=mX(a,M),K=l==null?void 0:l.getBoundingClientRect();let P=!1;if(!K||!z)return;const H=hX(i,z,r,u,t);if(!H)return;let Y=Ga(e,K),V=!1,D=null,q=!1,$=null;function F(){if(!m||!K)return;const[ve,ie]=ZY(Y,K,A);g({x:ve,y:ie}),I=requestAnimationFrame(F)}const Q={...H,nodeId:i,type:z,position:H.position},Z=u.get(i);let ae={inProgress:!0,isValid:null,from:Au(Z,Q,Ye.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:Z,to:Y,toHandle:null,toPosition:G5[Q.position],toNode:null,pointer:Y};function re(){P=!0,E(ae),b==null||b(e,{nodeId:i,handleId:r,handleType:z})}T===0&&re();function ee(ve){if(!P){const{x:rt,y:Je}=Ga(ve),et=rt-L,xt=Je-G;if(!(et*et+xt*xt>T*T))return;re()}if(!O()||!Q){se(ve);return}const ie=k();Y=Ga(ve,K),U=Y3e(Og(Y,ie,!1,[1,1]),n,u,Q),V||(F(),V=!0);const Se=gX(ve,{handle:U,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:j,doc:B,lib:d,flowId:h,nodeLookup:u});$=Se.handleDomNode,D=Se.connection,q=X3e(!!U,Se.isValid);const Ee=u.get(i),qe=Ee?Au(Ee,Q,Ye.Left,!0):ae.from,Te={...ae,from:qe,isValid:q,to:Se.toHandle&&q?x0({x:Se.toHandle.x,y:Se.toHandle.y},ie):Y,toHandle:Se.toHandle,toPosition:q&&Se.toHandle?Se.toHandle.position:G5[Q.position],toNode:Se.toHandle?u.get(Se.toHandle.nodeId):null,pointer:Y};E(Te),ae=Te}function se(ve){if(!("touches"in ve&&ve.touches.length>0)){if(P){(U||$)&&D&&q&&(w==null||w(D));const{inProgress:ie,...Se}=ae,Ee={...Se,toPosition:ae.toHandle?ae.toPosition:null};S==null||S(ve,Ee),a&&(C==null||C(ve,Ee))}v(),cancelAnimationFrame(I),V=!1,q=!1,D=null,$=null,B.removeEventListener("mousemove",ee),B.removeEventListener("mouseup",se),B.removeEventListener("touchmove",ee),B.removeEventListener("touchend",se)}}B.addEventListener("mousemove",ee),B.addEventListener("mouseup",se),B.addEventListener("touchmove",ee),B.addEventListener("touchend",se)}function gX(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:u,isValidConnection:d=pX,nodeLookup:m}){const h=a==="target",g=t?o.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Ga(e),w=o.elementFromPoint(v,b),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:g,j={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const C=mX(void 0,S),E=S.getAttribute("data-nodeid"),k=S.getAttribute("data-handleid"),O=S.classList.contains("connectable"),A=S.classList.contains("connectableend");if(!E||!C)return j;const T={source:h?E:r,sourceHandle:h?k:i,target:h?r:E,targetHandle:h?i:k};j.connection=T;const B=O&&A&&(n===_f.Strict?h&&C==="source"||!h&&C==="target":E!==r||k!==i);j.isValid=B&&d(T),j.toHandle=hX(E,C,k,m,n,!0)}return j}const EN={onPointerDown:G3e,isValid:gX};function W3e({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Ii(e);function a({translateExtent:l,width:u,height:d,zoomStep:m=1,pannable:h=!0,zoomable:g=!0,inversePan:v=!1}){const b=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const k=n(),O=E.sourceEvent.ctrlKey&&hp()?10:1,A=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*m,T=k[2]*Math.pow(2,A*O);t.scaleTo(T)};let w=[0,0];const S=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(w=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},j=E=>{const k=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const O=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],A=[O[0]-w[0],O[1]-w[1]];w=O;const T=r()*Math.max(k[2],Math.log(k[2]))*(v?-1:1),M={x:k[0]-A[0]*T,y:k[1]-A[1]*T},B=[[0,0],[u,d]];t.setViewportConstrained({x:M.x,y:M.y,zoom:k[2]},B,l)},C=qY().on("start",S).on("zoom",h?j:null).on("zoom.wheel",g?b:null);i.call(C,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:Ha}}const cw=e=>({x:e.x,y:e.y,zoom:e.k}),JE=({x:e,y:t,zoom:n})=>ow.translate(e,t).scale(n),Fd=(e,t)=>e.target.closest(`.${t}`),vX=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Q3e=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,e_=(e,t=0,n=Q3e,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},yX=e=>{const t=e.ctrlKey&&hp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Z3e({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:d}){return m=>{if(Fd(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(m.ctrlKey&&o){const S=Ha(m),j=yX(m),C=h*Math.pow(2,j);r.scaleTo(n,C,S,m);return}const g=m.deltaMode===1?20:1;let v=i===iu.Vertical?0:m.deltaX*g,b=i===iu.Horizontal?0:m.deltaY*g;!hp()&&m.shiftKey&&i!==iu.Vertical&&(v=m.deltaY*g,b=0),r.translateBy(n,-(v/h)*a,-(b/h)*a,{internal:!0});const w=cw(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(m,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(m,w))}}function J3e({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Fd(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function e4e({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=cw(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function t4e({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&vX(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,cw(a.transform)))}}function n4e({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&vX(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const u=cw(o.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,u)},n?150:0)}}}function r4e({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:u,lib:d,connectionInProgress:m}){return h=>{var S;const g=e||t,v=n&&h.ctrlKey,b=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Fd(h,`${d}-flow__node`)||Fd(h,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||m&&!b||Fd(h,l)&&b||Fd(h,u)&&(!b||i&&b&&!e)||!n&&h.ctrlKey&&b)return!1;if(!n&&h.type==="touchstart"&&((S=h.touches)==null?void 0:S.length)>1)return h.preventDefault(),!1;if(!g&&!i&&!v&&b||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||b)&&w}}function i4e({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),h=qY().scaleExtent([t,n]).translateExtent(r),g=Ii(e).call(h);C({x:i.x,y:i.y,zoom:Nf(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");h.wheelDelta(yX);function w(U,L){return g?new Promise(G=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?ps:Vy).transform(e_(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),U)}):Promise.resolve(!1)}function S({noWheelClassName:U,noPanClassName:L,onPaneContextMenu:G,userSelectionActive:z,panOnScroll:K,panOnDrag:P,panOnScrollMode:H,panOnScrollSpeed:Y,preventScrolling:V,zoomOnPinch:D,zoomOnScroll:q,zoomOnDoubleClick:$,zoomActivationKeyPressed:F,lib:Q,onTransformChange:Z,connectionInProgress:te,paneClickDistance:ae,selectionOnDrag:re}){z&&!d.isZoomingOrPanning&&j();const ee=K&&!F&&!z;h.clickDistance(re?1/0:!Xa(ae)||ae<0?0:ae);const se=ee?Z3e({zoomPanValues:d,noWheelClassName:U,d3Selection:g,d3Zoom:h,panOnScrollMode:H,panOnScrollSpeed:Y,zoomOnPinch:D,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):J3e({noWheelClassName:U,preventScrolling:V,d3ZoomHandler:v});if(g.on("wheel.zoom",se,{passive:!1}),!z){const ie=e4e({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:o});h.on("start",ie);const Se=t4e({zoomPanValues:d,panOnDrag:P,onPaneContextMenu:!!G,onPanZoom:a,onTransformChange:Z});h.on("zoom",Se);const Ee=n4e({zoomPanValues:d,panOnDrag:P,panOnScroll:K,onPaneContextMenu:G,onPanZoomEnd:l,onDraggingChange:u});h.on("end",Ee)}const ve=r4e({zoomActivationKeyPressed:F,panOnDrag:P,zoomOnScroll:q,panOnScroll:K,zoomOnDoubleClick:$,zoomOnPinch:D,userSelectionActive:z,noPanClassName:L,noWheelClassName:U,lib:Q,connectionInProgress:te});h.filter(ve),$?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function j(){h.on("zoom",null)}async function C(U,L,G){const z=JE(U),K=h==null?void 0:h.constrain()(z,L,G);return K&&await w(K),new Promise(P=>P(K))}async function E(U,L){const G=JE(U);return await w(G,L),new Promise(z=>z(G))}function k(U){if(g){const L=JE(U),G=g.property("__zoom");(G.k!==U.zoom||G.x!==U.x||G.y!==U.y)&&(h==null||h.transform(g,L,null,{sync:!0}))}}function O(){const U=g?HY(g.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function A(U,L){return g?new Promise(G=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?ps:Vy).scaleTo(e_(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),U)}):Promise.resolve(!1)}function T(U,L){return g?new Promise(G=>{h==null||h.interpolate((L==null?void 0:L.interpolate)==="linear"?ps:Vy).scaleBy(e_(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),U)}):Promise.resolve(!1)}function M(U){h==null||h.scaleExtent(U)}function B(U){h==null||h.translateExtent(U)}function I(U){const L=!Xa(U)||U<0?0:U;h==null||h.clickDistance(L)}return{update:S,destroy:j,setViewport:E,setViewportConstrained:C,getViewport:O,scaleTo:A,scaleBy:T,setScaleExtent:M,setTranslateExtent:B,syncViewport:k,setClickDistance:I}}var Of;(function(e){e.Line="line",e.Handle="handle"})(Of||(Of={}));function a4e({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,u=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(u[0]=u[0]*-1),l&&a&&(u[1]=u[1]*-1),u}function l$(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function xl(e,t){return Math.max(0,t-e)}function bl(e,t){return Math.max(0,e-t)}function Ay(e,t,n){return Math.max(0,t-e,e-n)}function c$(e,t){return e?!t:t}function o4e(e,t,n,r,i,a,o,l){let{affectsX:u,affectsY:d}=t;const{isHorizontal:m,isVertical:h}=t,g=m&&h,{xSnapped:v,ySnapped:b}=n,{minWidth:w,maxWidth:S,minHeight:j,maxHeight:C}=r,{x:E,y:k,width:O,height:A,aspectRatio:T}=e;let M=Math.floor(m?v-e.pointerX:0),B=Math.floor(h?b-e.pointerY:0);const I=O+(u?-M:M),U=A+(d?-B:B),L=-a[0]*O,G=-a[1]*A;let z=Ay(I,w,S),K=Ay(U,j,C);if(o){let Y=0,V=0;u&&M<0?Y=xl(E+M+L,o[0][0]):!u&&M>0&&(Y=bl(E+I+L,o[1][0])),d&&B<0?V=xl(k+B+G,o[0][1]):!d&&B>0&&(V=bl(k+U+G,o[1][1])),z=Math.max(z,Y),K=Math.max(K,V)}if(l){let Y=0,V=0;u&&M>0?Y=bl(E+M,l[0][0]):!u&&M<0&&(Y=xl(E+I,l[1][0])),d&&B>0?V=bl(k+B,l[0][1]):!d&&B<0&&(V=xl(k+U,l[1][1])),z=Math.max(z,Y),K=Math.max(K,V)}if(i){if(m){const Y=Ay(I/T,j,C)*T;if(z=Math.max(z,Y),o){let V=0;!u&&!d||u&&!d&&g?V=bl(k+G+I/T,o[1][1])*T:V=xl(k+G+(u?M:-M)/T,o[0][1])*T,z=Math.max(z,V)}if(l){let V=0;!u&&!d||u&&!d&&g?V=xl(k+I/T,l[1][1])*T:V=bl(k+(u?M:-M)/T,l[0][1])*T,z=Math.max(z,V)}}if(h){const Y=Ay(U*T,w,S)/T;if(K=Math.max(K,Y),o){let V=0;!u&&!d||d&&!u&&g?V=bl(E+U*T+L,o[1][0])/T:V=xl(E+(d?B:-B)*T+L,o[0][0])/T,K=Math.max(K,V)}if(l){let V=0;!u&&!d||d&&!u&&g?V=xl(E+U*T,l[1][0])/T:V=bl(E+(d?B:-B)*T,l[0][0])/T,K=Math.max(K,V)}}}B=B+(B<0?K:-K),M=M+(M<0?z:-z),i&&(g?I>U*T?B=(c$(u,d)?-M:M)/T:M=(c$(u,d)?-B:B)*T:m?(B=M/T,d=u):(M=B*T,u=d));const P=u?E+M:E,H=d?k+B:k;return{width:O+(u?-M:M),height:A+(d?-B:B),x:a[0]*M*(u?-1:1)+P,y:a[1]*B*(d?-1:1)+H}}const xX={width:0,height:0,x:0,y:0},s4e={...xX,pointerX:0,pointerY:0,aspectRatio:1};function l4e(e){return[[0,0],[e.measured.width,e.measured.height]]}function c4e(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,u=n[1]*o;return[[r-l,i-u],[r+a-l,i+o-u]]}function u4e({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Ii(e);let o={controlDirection:l$("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:d,boundaries:m,keepAspectRatio:h,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:w,shouldResize:S}){let j={...xX},C={...s4e};o={boundaries:m,resizeDirection:g,keepAspectRatio:h,controlDirection:l$(d)};let E,k=null,O=[],A,T,M,B=!1;const I=DY().on("start",U=>{const{nodeLookup:L,transform:G,snapGrid:z,snapToGrid:K,nodeOrigin:P,paneDomNode:H}=n();if(E=L.get(t),!E)return;k=(H==null?void 0:H.getBoundingClientRect())??null;const{xSnapped:Y,ySnapped:V}=Dm(U.sourceEvent,{transform:G,snapGrid:z,snapToGrid:K,containerBounds:k});j={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},C={...j,pointerX:Y,pointerY:V,aspectRatio:j.width/j.height},A=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(A=L.get(E.parentId),T=A&&E.extent==="parent"?l4e(A):void 0),O=[],M=void 0;for(const[D,q]of L)if(q.parentId===t&&(O.push({id:D,position:{...q.position},extent:q.extent}),q.extent==="parent"||q.expandParent)){const $=c4e(q,E,q.origin??P);M?M=[[Math.min($[0][0],M[0][0]),Math.min($[0][1],M[0][1])],[Math.max($[1][0],M[1][0]),Math.max($[1][1],M[1][1])]]:M=$}v==null||v(U,{...j})}).on("drag",U=>{const{transform:L,snapGrid:G,snapToGrid:z,nodeOrigin:K}=n(),P=Dm(U.sourceEvent,{transform:L,snapGrid:G,snapToGrid:z,containerBounds:k}),H=[];if(!E)return;const{x:Y,y:V,width:D,height:q}=j,$={},F=E.origin??K,{width:Q,height:Z,x:te,y:ae}=o4e(C,o.controlDirection,P,o.boundaries,o.keepAspectRatio,F,T,M),re=Q!==D,ee=Z!==q,se=te!==Y&&re,ve=ae!==V&&ee;if(!se&&!ve&&!re&&!ee)return;if((se||ve||F[0]===1||F[1]===1)&&($.x=se?te:j.x,$.y=ve?ae:j.y,j.x=$.x,j.y=$.y,O.length>0)){const qe=te-Y,Te=ae-V;for(const rt of O)rt.position={x:rt.position.x-qe+F[0]*(Q-D),y:rt.position.y-Te+F[1]*(Z-q)},H.push(rt)}if((re||ee)&&($.width=re&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Q:j.width,$.height=ee&&(!o.resizeDirection||o.resizeDirection==="vertical")?Z:j.height,j.width=$.width,j.height=$.height),A&&E.expandParent){const qe=F[0]*($.width??0);$.x&&$.x<qe&&(j.x=qe,C.x=C.x-($.x-qe));const Te=F[1]*($.height??0);$.y&&$.y<Te&&(j.y=Te,C.y=C.y-($.y-Te))}const ie=a4e({width:j.width,prevWidth:D,height:j.height,prevHeight:q,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),Se={...j,direction:ie};(S==null?void 0:S(U,Se))!==!1&&(B=!0,b==null||b(U,Se),r($,H))}).on("end",U=>{B&&(w==null||w(U,{...j}),i==null||i({...j}),B=!1)});a.call(I)}function u(){a.on(".drag",null)}return{update:l,destroy:u}}const d4e={},u$=e=>{let t;const n=new Set,r=(m,h)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=h??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,v))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(d4e?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,i,u);return u},f4e=e=>e?u$(e):u$,{useDebugValue:h4e}=Ce,{useSyncExternalStoreWithSelector:m4e}=Txe,p4e=e=>e;function bX(e,t=p4e,n){const r=m4e(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return h4e(r),r}const d$=(e,t)=>{const n=f4e(e),r=(i,a=t)=>bX(n,i,a);return Object.assign(r,n),r},g4e=(e,t)=>e?d$(e,t):d$;function kn(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,i]of e)if(!Object.is(i,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 uw=y.createContext(null),v4e=uw.Provider,wX=Po.error001();function Dt(e,t){const n=y.useContext(uw);if(n===null)throw new Error(wX);return bX(n,e,t)}function An(){const e=y.useContext(uw);if(e===null)throw new Error(wX);return y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const f$={display:"none"},y4e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},SX="react-flow__node-desc",jX="react-flow__edge-desc",x4e="react-flow__aria-live",b4e=e=>e.ariaLiveMessage,w4e=e=>e.ariaLabelConfig;function S4e({rfId:e}){const t=Dt(b4e);return f.jsx("div",{id:`${x4e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:y4e,children:t})}function j4e({rfId:e,disableKeyboardA11y:t}){const n=Dt(w4e);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${SX}-${e}`,style:f$,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${jX}-${e}`,style:f$,children:n["edge.a11yDescription.default"]}),!t&&f.jsx(S4e,{rfId:e})]})}const dw=y.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return f.jsx("div",{className:nr(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});dw.displayName="Panel";function E4e({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(dw,{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:f.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const _4e=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}},Oy=e=>e.id;function C4e(e,t){return kn(e.selectedNodes.map(Oy),t.selectedNodes.map(Oy))&&kn(e.selectedEdges.map(Oy),t.selectedEdges.map(Oy))}function N4e({onSelectionChange:e}){const t=An(),{selectedNodes:n,selectedEdges:r}=Dt(_4e,C4e);return y.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const k4e=e=>!!e.onSelectionChangeHandlers;function A4e({onSelectionChange:e}){const t=Dt(k4e);return e||t?f.jsx(N4e,{onSelectionChange:e}):null}const EX=[0,0],O4e={x:0,y:0,zoom:1},T4e=["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"],h$=[...T4e,"rfId"],P4e=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}),m$={translateExtent:up,nodeOrigin:EX,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function M4e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:u}=Dt(P4e,kn),d=An();y.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{m.current=m$,l()}),[]);const m=y.useRef(m$);return y.useEffect(()=>{for(const h of h$){const g=e[h],v=m.current[h];g!==v&&(typeof e[h]>"u"||(h==="nodes"?t(g):h==="edges"?n(g):h==="minZoom"?r(g):h==="maxZoom"?i(g):h==="translateExtent"?a(g):h==="nodeExtent"?o(g):h==="ariaLabelConfig"?d.setState({ariaLabelConfig:S3e(g)}):h==="fitView"?d.setState({fitViewQueued:g}):h==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[h]:g})))}m.current=e},h$.map(h=>e[h])),null}function p$(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function R4e(e){var r;const[t,n]=y.useState(e==="system"?null:e);return y.useEffect(()=>{if(e!=="system"){n(e);return}const i=p$(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=p$())!=null&&r.matches?"dark":"light"}const g$=typeof document<"u"?document:null;function mp(e=null,t={target:g$,actInsideInputWithModifier:!0}){const[n,r]=y.useState(!1),i=y.useRef(!1),a=y.useRef(new Set([])),[o,l]=y.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
`).replace(`

`,`
+`).split(`
`)),m=d.reduce((h,g)=>h.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return y.useEffect(()=>{const u=(t==null?void 0:t.target)??g$,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var S,j;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!d)&&rX(v))return!1;const w=y$(v.code,l);if(a.current.add(v[w]),v$(o,a.current,!1)){const C=((j=(S=v.composedPath)==null?void 0:S.call(v))==null?void 0:j[0])||v.target,E=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!E)&&v.preventDefault(),r(!0)}},h=v=>{const b=y$(v.code,l);v$(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(v[b]),v.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",m),u==null||u.addEventListener("keyup",h),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{u==null||u.removeEventListener("keydown",m),u==null||u.removeEventListener("keyup",h),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function v$(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function y$(e,t){return t.includes(e)?"code":"key"}const D4e=()=>{const e=An();return y.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,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},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:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),u=D2(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:u}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-u},m=n.snapGrid??i,h=n.snapToGrid??a;return Og(d,r,h,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=x0(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function _X(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const u of o)I4e(u,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function I4e(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 L4e(e,t){return _X(e,t)}function z4e(e,t){return _X(e,t)}function $c(e,t){return{id:e,type:"select",selected:t}}function Ud(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push($c(a.id,o)))}return r}function x$({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==o&&n.push({id:o.id,item:o,type:"replace"}),u===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function b$(e){return{id:e.id,type:"remove"}}const w$=e=>f3e(e),$4e=e=>GY(e);function CX(e){return y.forwardRef(e)}const B4e=typeof window<"u"?y.useLayoutEffect:y.useEffect;function S$(e){const[t,n]=y.useState(BigInt(0)),[r]=y.useState(()=>F4e(()=>n(i=>i+BigInt(1))));return B4e(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function F4e(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const NX=y.createContext(null);function U4e({children:e}){const t=An(),n=y.useCallback(l=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:m,onNodesChange:h,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let w=u;for(const j of l)w=typeof j=="function"?j(w):j;let S=x$({items:w,lookup:g});for(const j of b.values())S=j(S);m&&d(w),S.length>0?h==null||h(S):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:j,nodes:C,setNodes:E}=t.getState();j&&E(C)})},[]),r=S$(n),i=y.useCallback(l=>{const{edges:u=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:h,edgeLookup:g}=t.getState();let v=u;for(const b of l)v=typeof b=="function"?b(v):b;m?d(v):h&&h(x$({items:v,lookup:g}))},[]),a=S$(i),o=y.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return f.jsx(NX.Provider,{value:o,children:e})}function H4e(){const e=y.useContext(NX);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const q4e=e=>!!e.panZoom;function fw(){const e=D4e(),t=An(),n=H4e(),r=Dt(q4e),i=y.useMemo(()=>{const a=h=>t.getState().nodeLookup.get(h),o=h=>{n.nodeQueue.push(h)},l=h=>{n.edgeQueue.push(h)},u=h=>{var j,C;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=w$(h)?h:g.get(h.id),w=b.parentId?tX(b.position,b.measured,b.parentId,g,v):b.position,S={...b,position:w,width:((j=b.measured)==null?void 0:j.width)??b.width,height:((C=b.measured)==null?void 0:C.height)??b.height};return kf(S)},d=(h,g,v={replace:!1})=>{o(b=>b.map(w=>{if(w.id===h){const S=typeof g=="function"?g(w):g;return v.replace&&w$(S)?S:{...w,...S}}return w}))},m=(h,g,v={replace:!1})=>{l(b=>b.map(w=>{if(w.id===h){const S=typeof g=="function"?g(w):g;return v.replace&&$4e(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var g;return(g=a(h))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(g=>({...g}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:o,setEdges:l,addNodes:h=>{const g=Array.isArray(h)?h:[h];n.nodeQueue.push(v=>[...v,...g])},addEdges:h=>{const g=Array.isArray(h)?h:[h];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:h=[],edges:g=[],transform:v}=t.getState(),[b,w,S]=v;return{nodes:h.map(j=>({...j})),edges:g.map(j=>({...j})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:h=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:j,triggerEdgeChanges:C,onDelete:E,onBeforeDelete:k}=t.getState(),{nodes:O,edges:A}=await v3e({nodesToRemove:h,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:k}),T=A.length>0,M=O.length>0;if(T){const B=A.map(b$);S==null||S(A),C(B)}if(M){const B=O.map(b$);w==null||w(O),j(B)}return(M||T)&&(E==null||E({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(h,g=!0,v)=>{const b=Q5(h),w=b?h:u(h),S=v!==void 0;return w?(v||t.getState().nodes).filter(j=>{const C=t.getState().nodeLookup.get(j.id);if(C&&!b&&(j.id===h.id||!C.internals.positionAbsolute))return!1;const E=kf(S?j:C),k=fp(E,w);return g&&k>0||k>=E.width*E.height||k>=w.width*w.height}):[]},isNodeIntersecting:(h,g,v=!0)=>{const w=Q5(h)?h:u(h);if(!w)return!1;const S=fp(w,g);return v&&S>0||S>=g.width*g.height||S>=w.width*w.height},updateNode:d,updateNodeData:(h,g,v={replace:!1})=>{d(h,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},updateEdge:m,updateEdgeData:(h,g,v={replace:!1})=>{m(h,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},getNodesBounds:h=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return h3e(h,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:h,id:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${h}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:h,handleId:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${h?g?`-${h}-${g}`:`-${h}`:""}`))==null?void 0:b.values())??[])},fitView:async h=>{const g=t.getState().fitViewResolver??w3e();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return y.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const j$=e=>e.selected,V4e=typeof window<"u"?window:void 0;function K4e({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=An(),{deleteElements:r}=fw(),i=mp(e,{actInsideInputWithModifier:!1}),a=mp(t,{target:V4e});y.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(j$),edges:o.filter(j$)}),n.setState({nodesSelectionActive:!1})}},[i]),y.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function Y4e(e){const t=An();y.useEffect(()=>{const n=()=>{var i,a,o,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=I2(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Po.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 hw={position:"absolute",width:"100%",height:"100%",top:0,left:0},X4e=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function G4e({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=iu.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:d,minZoom:m,maxZoom:h,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:S,onViewportChange:j,isControlledViewport:C,paneClickDistance:E,selectionOnDrag:k}){const O=An(),A=y.useRef(null),{userSelectionActive:T,lib:M,connectionInProgress:B}=Dt(X4e,kn),I=mp(g),U=y.useRef();Y4e(A);const L=y.useCallback(G=>{j==null||j({x:G[0],y:G[1],zoom:G[2]}),C||O.setState({transform:G})},[j,C]);return y.useEffect(()=>{if(A.current){U.current=i4e({domNode:A.current,minZoom:m,maxZoom:h,translateExtent:d,viewport:u,onDraggingChange:P=>O.setState(H=>H.paneDragging===P?H:{paneDragging:P}),onPanZoomStart:(P,H)=>{const{onViewportChangeStart:Y,onMoveStart:V}=O.getState();V==null||V(P,H),Y==null||Y(H)},onPanZoom:(P,H)=>{const{onViewportChange:Y,onMove:V}=O.getState();V==null||V(P,H),Y==null||Y(H)},onPanZoomEnd:(P,H)=>{const{onViewportChangeEnd:Y,onMoveEnd:V}=O.getState();V==null||V(P,H),Y==null||Y(H)}});const{x:G,y:z,zoom:K}=U.current.getViewport();return O.setState({panZoom:U.current,transform:[G,z,K],domNode:A.current.closest(".react-flow")}),()=>{var P;(P=U.current)==null||P.destroy()}}},[]),y.useEffect(()=>{var G;(G=U.current)==null||G.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:v,noPanClassName:S,userSelectionActive:T,noWheelClassName:w,lib:M,onTransformChange:L,connectionInProgress:B,selectionOnDrag:k,paneClickDistance:E})},[e,t,n,r,i,a,o,l,I,v,S,T,w,M,L,B,k,E]),f.jsx("div",{className:"react-flow__renderer",ref:A,style:hw,children:b})}const W4e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Q4e(){const{userSelectionActive:e,userSelectionRect:t}=Dt(W4e,kn);return e&&t?f.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 t_=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Z4e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function J4e({isSelecting:e,selectionKeyPressed:t,selectionMode:n=dp.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:m,onPaneMouseEnter:h,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const w=An(),{userSelectionActive:S,elementsSelectable:j,dragging:C,connectionInProgress:E}=Dt(Z4e,kn),k=j&&(e||S),O=y.useRef(null),A=y.useRef(),T=y.useRef(new Set),M=y.useRef(new Set),B=y.useRef(!1),I=Y=>{if(B.current||E){B.current=!1;return}u==null||u(Y),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},U=Y=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Y.preventDefault();return}d==null||d(Y)},L=m?Y=>m(Y):void 0,G=Y=>{B.current&&(Y.stopPropagation(),B.current=!1)},z=Y=>{var Z,te;const{domNode:V}=w.getState();if(A.current=V==null?void 0:V.getBoundingClientRect(),!A.current)return;const D=Y.target===O.current;if(!D&&!!Y.target.closest(".nokey")||!e||!(a&&D||t)||Y.button!==0||!Y.isPrimary)return;(te=(Z=Y.target)==null?void 0:Z.setPointerCapture)==null||te.call(Z,Y.pointerId),B.current=!1;const{x:F,y:Q}=Ga(Y.nativeEvent,A.current);w.setState({userSelectionRect:{width:0,height:0,startX:F,startY:Q,x:F,y:Q}}),D||(Y.stopPropagation(),Y.preventDefault())},K=Y=>{const{userSelectionRect:V,transform:D,nodeLookup:q,edgeLookup:$,connectionLookup:F,triggerNodeChanges:Q,triggerEdgeChanges:Z,defaultEdgeOptions:te,resetSelectedElements:ae}=w.getState();if(!A.current||!V)return;const{x:re,y:ee}=Ga(Y.nativeEvent,A.current),{startX:se,startY:ve}=V;if(!B.current){const Te=t?0:i;if(Math.hypot(re-se,ee-ve)<=Te)return;ae(),o==null||o(Y)}B.current=!0;const ie={startX:se,startY:ve,x:re<se?re:se,y:ee<ve?ee:ve,width:Math.abs(re-se),height:Math.abs(ee-ve)},Se=T.current,Ee=M.current;T.current=new Set(R2(q,ie,D,n===dp.Partial,!0).map(Te=>Te.id)),M.current=new Set;const qe=(te==null?void 0:te.selectable)??!0;for(const Te of T.current){const rt=F.get(Te);if(rt)for(const{edgeId:Je}of rt.values()){const et=$.get(Je);et&&(et.selectable??qe)&&M.current.add(Je)}}if(!Z5(Se,T.current)){const Te=Ud(q,T.current,!0);Q(Te)}if(!Z5(Ee,M.current)){const Te=Ud($,M.current);Z(Te)}w.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},P=Y=>{var V,D;Y.button===0&&((D=(V=Y.target)==null?void 0:V.releasePointerCapture)==null||D.call(V,Y.pointerId),!S&&Y.target===O.current&&w.getState().userSelectionRect&&(I==null||I(Y)),w.setState({userSelectionActive:!1,userSelectionRect:null}),B.current&&(l==null||l(Y),w.setState({nodesSelectionActive:T.current.size>0})))},H=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:nr(["react-flow__pane",{draggable:H,dragging:C,selection:e}]),onClick:k?void 0:t_(I,O),onContextMenu:t_(U,O),onWheel:t_(L,O),onPointerEnter:k?void 0:h,onPointerMove:k?K:g,onPointerUp:k?P:void 0,onPointerDownCapture:k?z:void 0,onClickCapture:k?G:void 0,onPointerLeave:v,ref:O,style:hw,children:[b,f.jsx(Q4e,{})]})}function _N({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:u}=t.getState(),d=l.get(e);if(!d){u==null||u("012",Po.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):i([e])}function kX({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=An(),[u,d]=y.useState(!1),m=y.useRef();return y.useEffect(()=>{m.current=q3e({getStoreItems:()=>l.getState(),onNodeMouseDown:h=>{_N({id:h,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),y.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var h;(h=m.current)==null||h.destroy()}},[n,r,t,a,e,i,o]),u}const eze=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function AX(){const e=An();return y.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:u,nodeLookup:d,nodeOrigin:m}=e.getState(),h=new Map,g=eze(o),v=i?a[0]:5,b=i?a[1]:5,w=n.direction.x*v*n.factor,S=n.direction.y*b*n.factor;for(const[,j]of d){if(!g(j))continue;let C={x:j.internals.positionAbsolute.x+w,y:j.internals.positionAbsolute.y+S};i&&(C=Ag(C,a));const{position:E,positionAbsolute:k}=WY({nodeId:j.id,nextPosition:C,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:l});j.position=E,j.internals.positionAbsolute=k,h.set(j.id,j)}u(h)},[])}const U2=y.createContext(null),tze=U2.Provider;U2.Consumer;const OX=()=>y.useContext(U2),nze=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rze=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:u,isValid:d}=o,m=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:m,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===_f.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:m&&d}};function ize({type:e="source",position:t=Ye.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:u,className:d,onMouseDown:m,onTouchStart:h,...g},v){var K,P;const b=o||null,w=e==="target",S=An(),j=OX(),{connectOnClick:C,noPanClassName:E,rfId:k}=Dt(nze,kn),{connectingFrom:O,connectingTo:A,clickConnecting:T,isPossibleEndHandle:M,connectionInProcess:B,clickConnectionInProcess:I,valid:U}=Dt(rze(j,b,e),kn);j||(P=(K=S.getState()).onError)==null||P.call(K,"010",Po.error010());const L=H=>{const{defaultEdgeOptions:Y,onConnect:V,hasDefaultEdges:D}=S.getState(),q={...Y,...H};if(D){const{edges:$,setEdges:F}=S.getState();F(k3e(q,$))}V==null||V(q),l==null||l(q)},G=H=>{if(!j)return;const Y=iX(H.nativeEvent);if(i&&(Y&&H.button===0||!Y)){const V=S.getState();EN.onPointerDown(H.nativeEvent,{handleDomNode:H.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:w,handleId:b,nodeId:j,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:(...D)=>{var q,$;return($=(q=S.getState()).onConnectEnd)==null?void 0:$.call(q,...D)},updateConnection:V.updateConnection,onConnect:L,isValidConnection:n||((...D)=>{var q,$;return(($=(q=S.getState()).isValidConnection)==null?void 0:$.call(q,...D))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}Y?m==null||m(H):h==null||h(H)},z=H=>{const{onClickConnectStart:Y,onClickConnectEnd:V,connectionClickStartHandle:D,connectionMode:q,isValidConnection:$,lib:F,rfId:Q,nodeLookup:Z,connection:te}=S.getState();if(!j||!D&&!i)return;if(!D){Y==null||Y(H.nativeEvent,{nodeId:j,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:j,type:e,id:b}});return}const ae=nX(H.target),re=n||$,{connection:ee,isValid:se}=EN.isValid(H.nativeEvent,{handle:{nodeId:j,id:b,type:e},connectionMode:q,fromNodeId:D.nodeId,fromHandleId:D.id||null,fromType:D.type,isValidConnection:re,flowId:Q,doc:ae,lib:F,nodeLookup:Z});se&&ee&&L(ee);const ve=structuredClone(te);delete ve.inProgress,ve.toPosition=ve.toHandle?ve.toHandle.position:null,V==null||V(H,ve),S.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":b,"data-nodeid":j,"data-handlepos":t,"data-id":`${k}-${j}-${b}-${e}`,className:nr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,d,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:T,connectingfrom:O,connectingto:A,valid:U,connectionindicator:r&&(!B||M)&&(B||I?a:i)}]),onMouseDown:G,onTouchStart:G,onClick:C?z:void 0,ref:v,...g,children:u})}const Tf=y.memo(CX(ize));function aze({data:e,isConnectable:t,sourcePosition:n=Ye.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Tf,{type:"source",position:n,isConnectable:t})]})}function oze({data:e,isConnectable:t,targetPosition:n=Ye.Top,sourcePosition:r=Ye.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Tf,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,f.jsx(Tf,{type:"source",position:r,isConnectable:t})]})}function sze(){return null}function lze({data:e,isConnectable:t,targetPosition:n=Ye.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Tf,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const b0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},E$={input:aze,default:oze,output:lze,group:sze};function cze(e){var t,n,r,i;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??((i=e.style)==null?void 0:i.height)}}const uze=e=>{const{width:t,height:n,x:r,y:i}=kg(e.nodeLookup,{filter:a=>!!a.selected});return{width:Xa(t)?t:null,height:Xa(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function dze({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=An(),{width:i,height:a,transformString:o,userSelectionActive:l}=Dt(uze,kn),u=AX(),d=y.useRef(null);y.useEffect(()=>{var v;n||(v=d.current)==null||v.focus({preventScroll:!0})},[n]);const m=!l&&i!==null&&a!==null;if(kX({nodeRef:d,disabled:!m}),!m)return null;const h=e?v=>{const b=r.getState().nodes.filter(w=>w.selected);e(v,b)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(b0,v.key)&&(v.preventDefault(),u({direction:b0[v.key],factor:v.shiftKey?4:1}))};return f.jsx("div",{className:nr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:f.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const _$=typeof window<"u"?window:void 0,fze=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function TX({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:m,selectionMode:h,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:E,panOnScroll:k,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:M,defaultViewport:B,translateExtent:I,minZoom:U,maxZoom:L,preventScrolling:G,onSelectionContextMenu:z,noWheelClassName:K,noPanClassName:P,disableKeyboardA11y:H,onViewportChange:Y,isControlledViewport:V}){const{nodesSelectionActive:D,userSelectionActive:q}=Dt(fze,kn),$=mp(d,{target:_$}),F=mp(w,{target:_$}),Q=F||M,Z=F||k,te=m&&Q!==!0,ae=$||q||te;return K4e({deleteKeyCode:u,multiSelectionKeyCode:b}),f.jsx(G4e,{onPaneContextMenu:a,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:E,panOnScroll:Z,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:!$&&Q,defaultViewport:B,translateExtent:I,minZoom:U,maxZoom:L,zoomActivationKeyCode:S,preventScrolling:G,noWheelClassName:K,noPanClassName:P,onViewportChange:Y,isControlledViewport:V,paneClickDistance:l,selectionOnDrag:te,children:f.jsxs(J4e,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:Q,isSelecting:!!ae,selectionMode:h,selectionKeyPressed:$,paneClickDistance:l,selectionOnDrag:te,children:[e,D&&f.jsx(dze,{onSelectionContextMenu:z,noPanClassName:P,disableKeyboardA11y:H})]})})}TX.displayName="FlowRenderer";const hze=y.memo(TX),mze=e=>t=>e?R2(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 pze(e){return Dt(y.useCallback(mze(e),[e]),kn)}const gze=e=>e.updateNodeInternals;function vze(){const e=Dt(gze),[t]=y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return y.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function yze({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=An(),a=y.useRef(null),o=y.useRef(null),l=y.useRef(e.sourcePosition),u=y.useRef(e.targetPosition),d=y.useRef(t),m=n&&!!e.internals.handleBounds;return y.useEffect(()=>{a.current&&!e.hidden&&(!m||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[m,e.hidden]),y.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),y.useEffect(()=>{if(a.current){const h=d.current!==t,g=l.current!==e.sourcePosition,v=u.current!==e.targetPosition;(h||g||v)&&(d.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function xze({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:u,nodesConnectable:d,nodesFocusable:m,resizeObserver:h,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:w,nodeTypes:S,nodeClickDistance:j,onError:C}){const{node:E,internals:k,isParent:O}=Dt(re=>{const ee=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:se}},kn);let A=E.type||"default",T=(S==null?void 0:S[A])||E$[A];T===void 0&&(C==null||C("003",Po.error003(A)),A="default",T=(S==null?void 0:S.default)||E$.default);const M=!!(E.draggable||l&&typeof E.draggable>"u"),B=!!(E.selectable||u&&typeof E.selectable>"u"),I=!!(E.connectable||d&&typeof E.connectable>"u"),U=!!(E.focusable||m&&typeof E.focusable>"u"),L=An(),G=eX(E),z=yze({node:E,nodeType:A,hasDimensions:G,resizeObserver:h}),K=kX({nodeRef:z,disabled:E.hidden||!M,noDragClassName:g,handleSelector:E.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:j}),P=AX();if(E.hidden)return null;const H=$s(E),Y=cze(E),V=B||M||t||n||r||i,D=n?re=>n(re,{...k.userNode}):void 0,q=r?re=>r(re,{...k.userNode}):void 0,$=i?re=>i(re,{...k.userNode}):void 0,F=a?re=>a(re,{...k.userNode}):void 0,Q=o?re=>o(re,{...k.userNode}):void 0,Z=re=>{const{selectNodesOnDrag:ee,nodeDragThreshold:se}=L.getState();B&&(!ee||!M||se>0)&&_N({id:e,store:L,nodeRef:z}),t&&t(re,{...k.userNode})},te=re=>{if(!(rX(re.nativeEvent)||b)){if(VY.includes(re.key)&&B){const ee=re.key==="Escape";_N({id:e,store:L,unselect:ee,nodeRef:z})}else if(M&&E.selected&&Object.prototype.hasOwnProperty.call(b0,re.key)){re.preventDefault();const{ariaLabelConfig:ee}=L.getState();L.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),P({direction:b0[re.key],factor:re.shiftKey?4:1})}}},ae=()=>{var Ee;if(b||!((Ee=z.current)!=null&&Ee.matches(":focus-visible")))return;const{transform:re,width:ee,height:se,autoPanOnNodeFocus:ve,setCenter:ie}=L.getState();if(!ve)return;R2(new Map([[e,E]]),{x:0,y:0,width:ee,height:se},re,!0).length>0||ie(E.position.x+H.width/2,E.position.y+H.height/2,{zoom:re[2]})};return f.jsx("div",{className:nr(["react-flow__node",`react-flow__node-${A}`,{[v]:M},E.className,{selected:E.selected,selectable:B,parent:O,draggable:M,dragging:K}]),ref:z,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:G?"visible":"hidden",...E.style,...Y},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:D,onMouseMove:q,onMouseLeave:$,onContextMenu:F,onClick:Z,onDoubleClick:Q,onKeyDown:U?te:void 0,tabIndex:U?0:void 0,onFocus:U?ae:void 0,role:E.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${SX}-${w}`,"aria-label":E.ariaLabel,...E.domAttributes,children:f.jsx(tze,{value:e,children:f.jsx(T,{id:e,data:E.data,type:A,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:E.selected??!1,selectable:B,draggable:M,deletable:E.deletable??!0,isConnectable:I,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:K,dragHandle:E.dragHandle,zIndex:k.z,parentId:E.parentId,...H})})})}var bze=y.memo(xze);const wze=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function PX(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Dt(wze,kn),o=pze(e.onlyRenderVisibleElements),l=vze();return f.jsx("div",{className:"react-flow__nodes",style:hw,children:o.map(u=>f.jsx(bze,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}PX.displayName="NodeRenderer";const Sze=y.memo(PX);function jze(e){return Dt(y.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&_3e({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),kn)}const Eze=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},_ze=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},C$={[Cf.Arrow]:Eze,[Cf.ArrowClosed]:_ze};function Cze(e){const t=An();return y.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(C$,e)?C$[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Po.error009(e)),null)},[e])}const Nze=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const u=Cze(t);return u?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:f.jsx(u,{color:n,strokeWidth:o})}):null},MX=({defaultColor:e,rfId:t})=>{const n=Dt(a=>a.edges),r=Dt(a=>a.defaultEdgeOptions),i=y.useMemo(()=>M3e(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:i.map(a=>f.jsx(Nze,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};MX.displayName="MarkerDefinitions";var kze=y.memo(MX);function RX({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:u,className:d,...m}){const[h,g]=y.useState({x:1,y:0,width:0,height:0}),v=nr(["react-flow__edge-textwrapper",d]),b=y.useRef(null);return y.useEffect(()=>{if(b.current){const w=b.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?f.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:v,visibility:h.width?"visible":"hidden",...m,children:[i&&f.jsx("rect",{width:h.width+2*o[0],x:-o[0],y:-o[1],height:h.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),f.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}RX.displayName="EdgeText";const Aze=y.memo(RX);function mw({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:d=20,...m}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...m,d:e,fill:"none",className:nr(["react-flow__edge-path",m.className])}),d?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&Xa(t)&&Xa(n)?f.jsx(Aze,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function N$({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ye.Left||e===Ye.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function DX({sourceX:e,sourceY:t,sourcePosition:n=Ye.Bottom,targetX:r,targetY:i,targetPosition:a=Ye.Top}){const[o,l]=N$({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,d]=N$({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,h,g,v]=aX({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${o},${l} ${u},${d} ${r},${i}`,m,h,g,v]}function IX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})=>{const[C,E,k]=DX({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),O=e.isInternal?void 0:t;return f.jsx(mw,{id:O,path:C,labelX:E,labelY:k,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})})}const Oze=IX({isInternal:!1}),LX=IX({isInternal:!0});Oze.displayName="SimpleBezierEdge";LX.displayName="SimpleBezierEdgeInternal";function zX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,sourcePosition:v=Ye.Bottom,targetPosition:b=Ye.Top,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[E,k,O]=wN({sourceX:n,sourceY:r,sourcePosition:v,targetX:i,targetY:a,targetPosition:b,borderRadius:j==null?void 0:j.borderRadius,offset:j==null?void 0:j.offset,stepPosition:j==null?void 0:j.stepPosition}),A=e.isInternal?void 0:t;return f.jsx(mw,{id:A,path:E,labelX:k,labelY:O,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:w,markerStart:S,interactionWidth:C})})}const $X=zX({isInternal:!1}),BX=zX({isInternal:!0});$X.displayName="SmoothStepEdge";BX.displayName="SmoothStepEdgeInternal";function FX(e){return y.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return f.jsx($X,{...n,id:r,pathOptions:y.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Tze=FX({isInternal:!1}),UX=FX({isInternal:!0});Tze.displayName="StepEdge";UX.displayName="StepEdgeInternal";function HX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[S,j,C]=lX({sourceX:n,sourceY:r,targetX:i,targetY:a}),E=e.isInternal?void 0:t;return f.jsx(mw,{id:E,path:S,labelX:j,labelY:C,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:b,interactionWidth:w})})}const Pze=HX({isInternal:!1}),qX=HX({isInternal:!0});Pze.displayName="StraightEdge";qX.displayName="StraightEdgeInternal";function VX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Ye.Bottom,targetPosition:l=Ye.Top,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[E,k,O]=oX({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:j==null?void 0:j.curvature}),A=e.isInternal?void 0:t;return f.jsx(mw,{id:A,path:E,labelX:k,labelY:O,label:u,labelStyle:d,labelShowBg:m,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:C})})}const Mze=VX({isInternal:!1}),KX=VX({isInternal:!0});Mze.displayName="BezierEdge";KX.displayName="BezierEdgeInternal";const k$={default:KX,straight:qX,step:UX,smoothstep:BX,simplebezier:LX},A$={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Rze=(e,t,n)=>n===Ye.Left?e-t:n===Ye.Right?e+t:e,Dze=(e,t,n)=>n===Ye.Top?e-t:n===Ye.Bottom?e+t:e,O$="react-flow__edgeupdater";function T$({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return f.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:nr([O$,`${O$}-${l}`]),cx:Rze(t,r,e),cy:Dze(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Ize({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:u,onReconnect:d,onReconnectStart:m,onReconnectEnd:h,setReconnecting:g,setUpdateHover:v}){const b=An(),w=(k,O)=>{if(k.button!==0)return;const{autoPanOnConnect:A,domNode:T,connectionMode:M,connectionRadius:B,lib:I,onConnectStart:U,cancelConnection:L,nodeLookup:G,rfId:z,panBy:K,updateConnection:P}=b.getState(),H=O.type==="target",Y=(q,$)=>{g(!1),h==null||h(q,n,O.type,$)},V=q=>d==null?void 0:d(n,q),D=(q,$)=>{g(!0),m==null||m(k,n,O.type),U==null||U(q,$)};EN.onPointerDown(k.nativeEvent,{autoPanOnConnect:A,connectionMode:M,connectionRadius:B,domNode:T,handleId:O.id,nodeId:O.nodeId,nodeLookup:G,isTarget:H,edgeUpdaterType:O.type,lib:I,flowId:z,cancelConnection:L,panBy:K,isValidConnection:(...q)=>{var $,F;return((F=($=b.getState()).isValidConnection)==null?void 0:F.call($,...q))??!0},onConnect:V,onConnectStart:D,onConnectEnd:(...q)=>{var $,F;return(F=($=b.getState()).onConnectEnd)==null?void 0:F.call($,...q)},onReconnectEnd:Y,updateConnection:P,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},S=k=>w(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),j=k=>w(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>v(!0),E=()=>v(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(T$,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&f.jsx(T$,{position:u,centerX:a,centerY:o,radius:t,onMouseDown:j,onMouseEnter:C,onMouseOut:E,type:"target"})]})}function Lze({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:w,noPanClassName:S,onError:j,disableKeyboardA11y:C}){let E=Dt(ie=>ie.edgeLookup.get(e));const k=Dt(ie=>ie.defaultEdgeOptions);E=k?{...k,...E}:E;let O=E.type||"default",A=(w==null?void 0:w[O])||k$[O];A===void 0&&(j==null||j("011",Po.error011(O)),O="default",A=(w==null?void 0:w.default)||k$.default);const T=!!(E.focusable||t&&typeof E.focusable>"u"),M=typeof h<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),B=!!(E.selectable||r&&typeof E.selectable>"u"),I=y.useRef(null),[U,L]=y.useState(!1),[G,z]=y.useState(!1),K=An(),{zIndex:P,sourceX:H,sourceY:Y,targetX:V,targetY:D,sourcePosition:q,targetPosition:$}=Dt(y.useCallback(ie=>{const Se=ie.nodeLookup.get(E.source),Ee=ie.nodeLookup.get(E.target);if(!Se||!Ee)return{zIndex:E.zIndex,...A$};const qe=P3e({id:e,sourceNode:Se,targetNode:Ee,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ie.connectionMode,onError:j});return{zIndex:E3e({selected:E.selected,zIndex:E.zIndex,sourceNode:Se,targetNode:Ee,elevateOnSelect:ie.elevateEdgesOnSelect,zIndexMode:ie.zIndexMode}),...qe||A$}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),kn),F=y.useMemo(()=>E.markerStart?`url('#${SN(E.markerStart,b)}')`:void 0,[E.markerStart,b]),Q=y.useMemo(()=>E.markerEnd?`url('#${SN(E.markerEnd,b)}')`:void 0,[E.markerEnd,b]);if(E.hidden||H===null||Y===null||V===null||D===null)return null;const Z=ie=>{var Te;const{addSelectedEdges:Se,unselectNodesAndEdges:Ee,multiSelectionActive:qe}=K.getState();B&&(K.setState({nodesSelectionActive:!1}),E.selected&&qe?(Ee({nodes:[],edges:[E]}),(Te=I.current)==null||Te.blur()):Se([e])),i&&i(ie,E)},te=a?ie=>{a(ie,{...E})}:void 0,ae=o?ie=>{o(ie,{...E})}:void 0,re=l?ie=>{l(ie,{...E})}:void 0,ee=u?ie=>{u(ie,{...E})}:void 0,se=d?ie=>{d(ie,{...E})}:void 0,ve=ie=>{var Se;if(!C&&VY.includes(ie.key)&&B){const{unselectNodesAndEdges:Ee,addSelectedEdges:qe}=K.getState();ie.key==="Escape"?((Se=I.current)==null||Se.blur(),Ee({edges:[E]})):qe([e])}};return f.jsx("svg",{style:{zIndex:P},children:f.jsxs("g",{className:nr(["react-flow__edge",`react-flow__edge-${O}`,E.className,S,{selected:E.selected,animated:E.animated,inactive:!B&&!i,updating:U,selectable:B}]),onClick:Z,onDoubleClick:te,onContextMenu:ae,onMouseEnter:re,onMouseMove:ee,onMouseLeave:se,onKeyDown:T?ve:void 0,tabIndex:T?0:void 0,role:E.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":T?`${jX}-${b}`:void 0,ref:I,...E.domAttributes,children:[!G&&f.jsx(A,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:B,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:H,sourceY:Y,targetX:V,targetY:D,sourcePosition:q,targetPosition:$,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:F,markerEnd:Q,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),M&&f.jsx(Ize,{edge:E,isReconnectable:M,reconnectRadius:m,onReconnect:h,onReconnectStart:g,onReconnectEnd:v,sourceX:H,sourceY:Y,targetX:V,targetY:D,sourcePosition:q,targetPosition:$,setUpdateHover:L,setReconnecting:z})]})})}var zze=y.memo(Lze);const $ze=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function YX({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:h,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,onError:E}=Dt($ze,kn),k=jze(t);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(kze,{defaultColor:e,rfId:n}),k.map(O=>f.jsx(zze,{id:O,edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,onClick:m,reconnectRadius:h,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:E,edgeTypes:r,disableKeyboardA11y:w},O))]})}YX.displayName="EdgeRenderer";const Bze=y.memo(YX),Fze=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Uze({children:e}){const t=Dt(Fze);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Hze(e){const t=fw(),n=y.useRef(!1);y.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const qze=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Vze(e){const t=Dt(qze),n=An();return y.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Kze(e){return e.connection.inProgress?{...e.connection,to:Og(e.connection.to,e.transform)}:{...e.connection}}function Yze(e){return Kze}function Xze(e){const t=Yze();return Dt(t,kn)}const Gze=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Wze({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:u}=Dt(Gze,kn);return!(a&&i&&u)?null:f.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:nr(["react-flow__connection",XY(l)]),children:f.jsx(XX,{style:t,type:n,CustomComponent:r,isValid:l})})})}const XX=({style:e,type:t=Nl.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:u,to:d,toNode:m,toHandle:h,toPosition:g,pointer:v}=Xze();if(!i)return;if(n)return f.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:g,connectionStatus:XY(r),toNode:m,toHandle:h,pointer:v});let b="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case Nl.Bezier:[b]=oX(w);break;case Nl.SimpleBezier:[b]=DX(w);break;case Nl.Step:[b]=wN({...w,borderRadius:0});break;case Nl.SmoothStep:[b]=wN(w);break;default:[b]=lX(w)}return f.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};XX.displayName="ConnectionLine";const Qze={};function P$(e=Qze){y.useRef(e),An(),y.useEffect(()=>{},[e])}function Zze(){An(),y.useRef(!1),y.useEffect(()=>{},[])}function GX({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:h,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:j,selectionKeyCode:C,selectionOnDrag:E,selectionMode:k,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,deleteKeyCode:M,onlyRenderVisibleElements:B,elementsSelectable:I,defaultViewport:U,translateExtent:L,minZoom:G,maxZoom:z,preventScrolling:K,defaultMarkerColor:P,zoomOnScroll:H,zoomOnPinch:Y,panOnScroll:V,panOnScrollSpeed:D,panOnScrollMode:q,zoomOnDoubleClick:$,panOnDrag:F,onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneScroll:re,onPaneContextMenu:ee,paneClickDistance:se,nodeClickDistance:ve,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:qe,reconnectRadius:Te,onReconnect:rt,onReconnectStart:Je,onReconnectEnd:et,noDragClassName:xt,noWheelClassName:dt,noPanClassName:Ct,disableKeyboardA11y:mn,nodeExtent:Ut,rfId:Kt,viewport:ce,onViewportChange:xe}){return P$(e),P$(t),Zze(),Hze(n),Vze(ce),f.jsx(hze,{onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneContextMenu:ee,onPaneScroll:re,paneClickDistance:se,deleteKeyCode:M,selectionKeyCode:C,selectionOnDrag:E,selectionMode:k,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:H,zoomOnPinch:Y,zoomOnDoubleClick:$,panOnScroll:V,panOnScrollSpeed:D,panOnScrollMode:q,panOnDrag:F,defaultViewport:U,translateExtent:L,minZoom:G,maxZoom:z,onSelectionContextMenu:h,preventScrolling:K,noDragClassName:xt,noWheelClassName:dt,noPanClassName:Ct,disableKeyboardA11y:mn,onViewportChange:xe,isControlledViewport:!!ce,children:f.jsxs(Uze,{children:[f.jsx(Bze,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:rt,onReconnectStart:Je,onReconnectEnd:et,onlyRenderVisibleElements:B,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:qe,reconnectRadius:Te,defaultMarkerColor:P,noPanClassName:Ct,disableKeyboardA11y:mn,rfId:Kt}),f.jsx(Wze,{style:w,type:b,component:S,containerStyle:j}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(Sze,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:ve,onlyRenderVisibleElements:B,noPanClassName:Ct,noDragClassName:xt,disableKeyboardA11y:mn,nodeExtent:Ut,rfId:Kt}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}GX.displayName="GraphView";const Jze=y.memo(GX),M$=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:h,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,w=new Map,S=new Map,j=r??t??[],C=n??e??[],E=m??[0,0],k=h??up;dX(w,S,j);const O=jN(C,v,b,{nodeOrigin:E,nodeExtent:k,zIndexMode:g});let A=[0,0,1];if(o&&i&&a){const T=kg(v,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:M,y:B,zoom:I}=D2(T,i,a,u,d,(l==null?void 0:l.padding)??.1);A=[M,B,I]}return{rfId:"1",width:i??0,height:a??0,transform:A,nodes:C,nodesInitialized:O,nodeLookup:v,parentLookup:b,edges:j,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:up,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:_f.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,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:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...YY},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:y3e,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:KY,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},e5e=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g})=>g4e((v,b)=>{async function w(){const{nodeLookup:S,panZoom:j,fitViewOptions:C,fitViewResolver:E,width:k,height:O,minZoom:A,maxZoom:T}=b();j&&(await g3e({nodes:S,width:k,height:O,panZoom:j,minZoom:A,maxZoom:T},C),E==null||E.resolve(!0),v({fitViewResolver:null}))}return{...M$({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:m,nodeExtent:h,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:S=>{const{nodeLookup:j,parentLookup:C,nodeOrigin:E,elevateNodesOnSelect:k,fitViewQueued:O,zIndexMode:A}=b(),T=jN(S,j,C,{nodeOrigin:E,nodeExtent:h,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:A});O&&T?(w(),v({nodes:S,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:S,nodesInitialized:T})},setEdges:S=>{const{connectionLookup:j,edgeLookup:C}=b();dX(j,C,S),v({edges:S})},setDefaultNodesAndEdges:(S,j)=>{if(S){const{setNodes:C}=b();C(S),v({hasDefaultNodes:!0})}if(j){const{setEdges:C}=b();C(j),v({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:j,nodeLookup:C,parentLookup:E,domNode:k,nodeOrigin:O,nodeExtent:A,debug:T,fitViewQueued:M,zIndexMode:B}=b(),{changes:I,updatedInternals:U}=B3e(S,C,E,k,O,A,B);U&&(I3e(C,E,{nodeOrigin:O,nodeExtent:A,zIndexMode:B}),M?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),j==null||j(I)))},updateNodePositions:(S,j=!1)=>{const C=[];let E=[];const{nodeLookup:k,triggerNodeChanges:O,connection:A,updateConnection:T,onNodesChangeMiddlewareMap:M}=b();for(const[B,I]of S){const U=k.get(B),L=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(I!=null&&I.position)),G={id:B,type:"position",position:L?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:j};if(U&&A.inProgress&&A.fromNode.id===U.id){const z=Au(U,A.fromHandle,Ye.Left,!0);T({...A,from:z})}L&&U.parentId&&C.push({id:B,parentId:U.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),E.push(G)}if(C.length>0){const{parentLookup:B,nodeOrigin:I}=b(),U=F2(C,k,B,I);E.push(...U)}for(const B of M.values())E=B(E);O(E)},triggerNodeChanges:S=>{const{onNodesChange:j,setNodes:C,nodes:E,hasDefaultNodes:k,debug:O}=b();if(S!=null&&S.length){if(k){const A=L4e(S,E);C(A)}O&&console.log("React Flow: trigger node changes",S),j==null||j(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:j,setEdges:C,edges:E,hasDefaultEdges:k,debug:O}=b();if(S!=null&&S.length){if(k){const A=z4e(S,E);C(A)}O&&console.log("React Flow: trigger edge changes",S),j==null||j(S)}},addSelectedNodes:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:E,triggerNodeChanges:k,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>$c(T,!0));k(A);return}k(Ud(E,new Set([...S]),!0)),O(Ud(C))},addSelectedEdges:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:E,triggerNodeChanges:k,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>$c(T,!0));O(A);return}O(Ud(C,new Set([...S]))),k(Ud(E,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:j}={})=>{const{edges:C,nodes:E,nodeLookup:k,triggerNodeChanges:O,triggerEdgeChanges:A}=b(),T=S||E,M=j||C,B=[];for(const U of T){if(!U.selected)continue;const L=k.get(U.id);L&&(L.selected=!1),B.push($c(U.id,!1))}const I=[];for(const U of M)U.selected&&I.push($c(U.id,!1));O(B),A(I)},setMinZoom:S=>{const{panZoom:j,maxZoom:C}=b();j==null||j.setScaleExtent([S,C]),v({minZoom:S})},setMaxZoom:S=>{const{panZoom:j,minZoom:C}=b();j==null||j.setScaleExtent([C,S]),v({maxZoom:S})},setTranslateExtent:S=>{var j;(j=b().panZoom)==null||j.setTranslateExtent(S),v({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:j,triggerNodeChanges:C,triggerEdgeChanges:E,elementsSelectable:k}=b();if(!k)return;const O=j.reduce((T,M)=>M.selected?[...T,$c(M.id,!1)]:T,[]),A=S.reduce((T,M)=>M.selected?[...T,$c(M.id,!1)]:T,[]);C(O),E(A)},setNodeExtent:S=>{const{nodes:j,nodeLookup:C,parentLookup:E,nodeOrigin:k,elevateNodesOnSelect:O,nodeExtent:A,zIndexMode:T}=b();S[0][0]===A[0][0]&&S[0][1]===A[0][1]&&S[1][0]===A[1][0]&&S[1][1]===A[1][1]||(jN(j,C,E,{nodeOrigin:k,nodeExtent:S,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:T}),v({nodeExtent:S}))},panBy:S=>{const{transform:j,width:C,height:E,panZoom:k,translateExtent:O}=b();return F3e({delta:S,panZoom:k,transform:j,translateExtent:O,width:C,height:E})},setCenter:async(S,j,C)=>{const{width:E,height:k,maxZoom:O,panZoom:A}=b();if(!A)return Promise.resolve(!1);const T=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:O;return await A.setViewport({x:E/2-S*T,y:k/2-j*T,zoom:T},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...YY}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...M$()})}},Object.is);function WX({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:u,fitView:d,nodeOrigin:m,nodeExtent:h,zIndexMode:g,children:v}){const[b]=y.useState(()=>e5e({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:u,nodeOrigin:m,nodeExtent:h,zIndexMode:g}));return f.jsx(v4e,{value:b,children:f.jsx(U4e,{children:v})})}function t5e({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v}){return y.useContext(uw)?f.jsx(f.Fragment,{children:e}):f.jsx(WX,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:h,nodeExtent:g,zIndexMode:v,children:e})}const n5e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function r5e({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:u,onInit:d,onMove:m,onMoveStart:h,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,onNodeMouseEnter:C,onNodeMouseMove:E,onNodeMouseLeave:k,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:T,onNodeDrag:M,onNodeDragStop:B,onNodesDelete:I,onEdgesDelete:U,onDelete:L,onSelectionChange:G,onSelectionDragStart:z,onSelectionDrag:K,onSelectionDragStop:P,onSelectionContextMenu:H,onSelectionStart:Y,onSelectionEnd:V,onBeforeDelete:D,connectionMode:q,connectionLineType:$=Nl.Bezier,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:Z,deleteKeyCode:te="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:re=!1,selectionMode:ee=dp.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ve=hp()?"Meta":"Control",zoomActivationKeyCode:ie=hp()?"Meta":"Control",snapToGrid:Se,snapGrid:Ee,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Te,nodesDraggable:rt,autoPanOnNodeFocus:Je,nodesConnectable:et,nodesFocusable:xt,nodeOrigin:dt=EX,edgesFocusable:Ct,edgesReconnectable:mn,elementsSelectable:Ut=!0,defaultViewport:Kt=O4e,minZoom:ce=.5,maxZoom:xe=2,translateExtent:ze=up,preventScrolling:it=!0,nodeExtent:st,defaultMarkerColor:Ht="#b1b1b7",zoomOnScroll:rn=!0,zoomOnPinch:je=!0,panOnScroll:ct=!1,panOnScrollSpeed:wt=.5,panOnScrollMode:ft=iu.Free,zoomOnDoubleClick:On=!0,panOnDrag:un=!0,onPaneClick:Cr,onPaneMouseEnter:Xr,onPaneMouseMove:Gr,onPaneMouseLeave:Wr,onPaneScroll:gr,onPaneContextMenu:Xe,paneClickDistance:Mt=1,nodeClickDistance:pn=0,children:Tn,onReconnect:Ir,onReconnectStart:Yt,onReconnectEnd:ge,onEdgeContextMenu:at,onEdgeDoubleClick:Lt,onEdgeMouseEnter:an,onEdgeMouseMove:oi,onEdgeMouseLeave:rr,reconnectRadius:sc=10,onNodesChange:lc,onEdgesChange:ta,noDragClassName:Fn="nodrag",noWheelClassName:ir="nowheel",noPanClassName:he="nopan",fitView:pt,fitViewOptions:Nr,connectOnClick:Qr,attributionPosition:Fu,proOptions:Ra,defaultEdgeOptions:ih,elevateNodesOnSelect:Bs=!0,elevateEdgesOnSelect:Fs=!1,disableKeyboardA11y:Us=!1,autoPanOnConnect:Hs,autoPanOnNodeDrag:qn,autoPanSpeed:Tg,connectionRadius:Pg,isValidConnection:Lo,onError:qs,style:gw,id:ah,nodeDragThreshold:Mg,connectionDragThreshold:vw,viewport:Uu,onViewportChange:Hu,width:Da,height:si,colorMode:Rg="light",debug:yw,onScroll:Vs,ariaLabelConfig:Dg,zIndexMode:cc="basic",...xw},li){const uc=ah||"1",Ig=R4e(Rg),oh=y.useCallback(zo=>{zo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Vs==null||Vs(zo)},[Vs]);return f.jsx("div",{"data-testid":"rf__wrapper",...xw,onScroll:oh,style:{...gw,...n5e},ref:li,className:nr(["react-flow",i,Ig]),id:ah,role:"application",children:f.jsxs(t5e,{nodes:e,edges:t,width:Da,height:si,fitView:pt,fitViewOptions:Nr,minZoom:ce,maxZoom:xe,nodeOrigin:dt,nodeExtent:st,zIndexMode:cc,children:[f.jsx(Jze,{onInit:d,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:C,onNodeMouseMove:E,onNodeMouseLeave:k,onNodeContextMenu:O,onNodeDoubleClick:A,nodeTypes:a,edgeTypes:o,connectionLineType:$,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:Z,selectionKeyCode:ae,selectionOnDrag:re,selectionMode:ee,deleteKeyCode:te,multiSelectionKeyCode:ve,panActivationKeyCode:se,zoomActivationKeyCode:ie,onlyRenderVisibleElements:qe,defaultViewport:Kt,translateExtent:ze,minZoom:ce,maxZoom:xe,preventScrolling:it,zoomOnScroll:rn,zoomOnPinch:je,zoomOnDoubleClick:On,panOnScroll:ct,panOnScrollSpeed:wt,panOnScrollMode:ft,panOnDrag:un,onPaneClick:Cr,onPaneMouseEnter:Xr,onPaneMouseMove:Gr,onPaneMouseLeave:Wr,onPaneScroll:gr,onPaneContextMenu:Xe,paneClickDistance:Mt,nodeClickDistance:pn,onSelectionContextMenu:H,onSelectionStart:Y,onSelectionEnd:V,onReconnect:Ir,onReconnectStart:Yt,onReconnectEnd:ge,onEdgeContextMenu:at,onEdgeDoubleClick:Lt,onEdgeMouseEnter:an,onEdgeMouseMove:oi,onEdgeMouseLeave:rr,reconnectRadius:sc,defaultMarkerColor:Ht,noDragClassName:Fn,noWheelClassName:ir,noPanClassName:he,rfId:uc,disableKeyboardA11y:Us,nodeExtent:st,viewport:Uu,onViewportChange:Hu}),f.jsx(M4e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,nodesDraggable:rt,autoPanOnNodeFocus:Je,nodesConnectable:et,nodesFocusable:xt,edgesFocusable:Ct,edgesReconnectable:mn,elementsSelectable:Ut,elevateNodesOnSelect:Bs,elevateEdgesOnSelect:Fs,minZoom:ce,maxZoom:xe,nodeExtent:st,onNodesChange:lc,onEdgesChange:ta,snapToGrid:Se,snapGrid:Ee,connectionMode:q,translateExtent:ze,connectOnClick:Qr,defaultEdgeOptions:ih,fitView:pt,fitViewOptions:Nr,onNodesDelete:I,onEdgesDelete:U,onDelete:L,onNodeDragStart:T,onNodeDrag:M,onNodeDragStop:B,onSelectionDrag:K,onSelectionDragStart:z,onSelectionDragStop:P,onMove:m,onMoveStart:h,onMoveEnd:g,noPanClassName:he,nodeOrigin:dt,rfId:uc,autoPanOnConnect:Hs,autoPanOnNodeDrag:qn,autoPanSpeed:Tg,onError:qs,connectionRadius:Pg,isValidConnection:Lo,selectNodesOnDrag:Te,nodeDragThreshold:Mg,connectionDragThreshold:vw,onBeforeDelete:D,debug:yw,ariaLabelConfig:Dg,zIndexMode:cc}),f.jsx(A4e,{onSelectionChange:G}),Tn,f.jsx(E4e,{proOptions:Ra,position:Fu}),f.jsx(j4e,{rfId:uc,disableKeyboardA11y:Us})]})})}var i5e=CX(r5e);function a5e({dimensions:e,lineWidth:t,variant:n,className:r}){return f.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:nr(["react-flow__background-pattern",n,r])})}function o5e({radius:e,className:t}){return f.jsx("circle",{cx:e,cy:e,r:e,className:nr(["react-flow__background-pattern","dots",t])})}var Ul;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ul||(Ul={}));const s5e={[Ul.Dots]:1,[Ul.Lines]:1,[Ul.Cross]:6},l5e=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function QX({id:e,variant:t=Ul.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:u,className:d,patternClassName:m}){const h=y.useRef(null),{transform:g,patternId:v}=Dt(l5e,kn),b=r||s5e[t],w=t===Ul.Dots,S=t===Ul.Cross,j=Array.isArray(n)?n:[n,n],C=[j[0]*g[2]||1,j[1]*g[2]||1],E=b*g[2],k=Array.isArray(a)?a:[a,a],O=S?[E,E]:C,A=[k[0]*g[2]||1+O[0]/2,k[1]*g[2]||1+O[1]/2],T=`${v}${e||""}`;return f.jsxs("svg",{className:nr(["react-flow__background",d]),style:{...u,...hw,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:h,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:g[0]%C[0],y:g[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:w?f.jsx(o5e,{radius:E/2,className:m}):f.jsx(a5e,{dimensions:O,lineWidth:i,variant:t,className:m})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}QX.displayName="Background";y.memo(QX);function c5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function u5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function d5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 f5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 h5e(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 Ty({children:e,className:t,...n}){return f.jsx("button",{type:"button",className:nr(["react-flow__controls-button",t]),...n,children:e})}const m5e=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ZX({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:u,className:d,children:m,position:h="bottom-left",orientation:g="vertical","aria-label":v}){const b=An(),{isInteractive:w,minZoomReached:S,maxZoomReached:j,ariaLabelConfig:C}=Dt(m5e,kn),{zoomIn:E,zoomOut:k,fitView:O}=fw(),A=()=>{E(),a==null||a()},T=()=>{k(),o==null||o()},M=()=>{O(i),l==null||l()},B=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},I=g==="horizontal"?"horizontal":"vertical";return f.jsxs(dw,{className:nr(["react-flow__controls",I,d]),position:h,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&f.jsxs(f.Fragment,{children:[f.jsx(Ty,{onClick:A,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:j,children:f.jsx(c5e,{})}),f.jsx(Ty,{onClick:T,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:f.jsx(u5e,{})})]}),n&&f.jsx(Ty,{className:"react-flow__controls-fitview",onClick:M,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:f.jsx(d5e,{})}),r&&f.jsx(Ty,{className:"react-flow__controls-interactive",onClick:B,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?f.jsx(h5e,{}):f.jsx(f5e,{})}),m]})}ZX.displayName="Controls";y.memo(ZX);function p5e({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:u,className:d,borderRadius:m,shapeRendering:h,selected:g,onClick:v}){const{background:b,backgroundColor:w}=a||{},S=o||b||w;return f.jsx("rect",{className:nr(["react-flow__minimap-node",{selected:g},d]),x:t,y:n,rx:m,ry:m,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:u},shapeRendering:h,onClick:v?j=>v(j,e):void 0})}const g5e=y.memo(p5e),v5e=e=>e.nodes.map(t=>t.id),n_=e=>e instanceof Function?e:()=>e;function y5e({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=g5e,onClick:o}){const l=Dt(v5e,kn),u=n_(t),d=n_(e),m=n_(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:l.map(g=>f.jsx(b5e,{id:g,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:h},g))})}function x5e({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:u}){const{node:d,x:m,y:h,width:g,height:v}=Dt(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:j,y:C}=w.internals.positionAbsolute,{width:E,height:k}=$s(S);return{node:S,x:j,y:C,width:E,height:k}},kn);return!d||d.hidden||!eX(d)?null:f.jsx(l,{x:m,y:h,width:g,height:v,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:i,strokeColor:n(d),strokeWidth:a,shapeRendering:o,onClick:u,id:d.id})}const b5e=y.memo(x5e);var w5e=y.memo(y5e);const S5e=200,j5e=150,E5e=e=>!e.hidden,_5e=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?JY(kg(e.nodeLookup,{filter:E5e}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},C5e="react-flow__minimap-desc";function JX({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:u,maskColor:d,maskStrokeColor:m,maskStrokeWidth:h,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:j,inversePan:C,zoomStep:E=1,offsetScale:k=5}){const O=An(),A=y.useRef(null),{boundingRect:T,viewBB:M,rfId:B,panZoom:I,translateExtent:U,flowWidth:L,flowHeight:G,ariaLabelConfig:z}=Dt(_5e,kn),K=(e==null?void 0:e.width)??S5e,P=(e==null?void 0:e.height)??j5e,H=T.width/K,Y=T.height/P,V=Math.max(H,Y),D=V*K,q=V*P,$=k*V,F=T.x-(D-T.width)/2-$,Q=T.y-(q-T.height)/2-$,Z=D+$*2,te=q+$*2,ae=`${C5e}-${B}`,re=y.useRef(0),ee=y.useRef();re.current=V,y.useEffect(()=>{if(A.current&&I)return ee.current=W3e({domNode:A.current,panZoom:I,getTransform:()=>O.getState().transform,getViewScale:()=>re.current}),()=>{var Se;(Se=ee.current)==null||Se.destroy()}},[I]),y.useEffect(()=>{var Se;(Se=ee.current)==null||Se.update({translateExtent:U,width:L,height:G,inversePan:C,pannable:w,zoomStep:E,zoomable:S})},[w,S,C,E,U,L,G]);const se=v?Se=>{var Te;const[Ee,qe]=((Te=ee.current)==null?void 0:Te.pointer(Se))||[0,0];v(Se,{x:Ee,y:qe})}:void 0,ve=b?y.useCallback((Se,Ee)=>{const qe=O.getState().nodeLookup.get(Ee).internals.userNode;b(Se,qe)},[]):void 0,ie=j??z["minimap.ariaLabel"];return f.jsx(dw,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*V: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 o=="number"?o:void 0},className:nr(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:K,height:P,viewBox:`${F} ${Q} ${Z} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:A,onClick:se,children:[ie&&f.jsx("title",{id:ae,children:ie}),f.jsx(w5e,{onClick:ve,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-$},${Q-$}h${Z+$*2}v${te+$*2}h${-Z-$*2}z
        M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}JX.displayName="MiniMap";y.memo(JX);const N5e=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,k5e={[Of.Line]:"right",[Of.Handle]:"bottom-right"};function A5e({nodeId:e,position:t,variant:n=Of.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:w,onResize:S,onResizeEnd:j}){const C=OX(),E=typeof e=="string"?e:C,k=An(),O=y.useRef(null),A=n===Of.Handle,T=Dt(y.useCallback(N5e(A&&v),[A,v]),kn),M=y.useRef(null),B=t??k5e[n];y.useEffect(()=>{if(!(!O.current||!E))return M.current||(M.current=u4e({domNode:O.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:U,transform:L,snapGrid:G,snapToGrid:z,nodeOrigin:K,domNode:P}=k.getState();return{nodeLookup:U,transform:L,snapGrid:G,snapToGrid:z,nodeOrigin:K,paneDomNode:P}},onChange:(U,L)=>{const{triggerNodeChanges:G,nodeLookup:z,parentLookup:K,nodeOrigin:P}=k.getState(),H=[],Y={x:U.x,y:U.y},V=z.get(E);if(V&&V.expandParent&&V.parentId){const D=V.origin??P,q=U.width??V.measured.width??0,$=U.height??V.measured.height??0,F={id:V.id,parentId:V.parentId,rect:{width:q,height:$,...tX({x:U.x??V.position.x,y:U.y??V.position.y},{width:q,height:$},V.parentId,z,D)}},Q=F2([F],z,K,P);H.push(...Q),Y.x=U.x?Math.max(D[0]*q,U.x):void 0,Y.y=U.y?Math.max(D[1]*$,U.y):void 0}if(Y.x!==void 0&&Y.y!==void 0){const D={id:E,type:"position",position:{...Y}};H.push(D)}if(U.width!==void 0&&U.height!==void 0){const q={id:E,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};H.push(q)}for(const D of L){const q={...D,type:"position"};H.push(q)}G(H)},onEnd:({width:U,height:L})=>{const G={id:E,type:"dimensions",resizing:!1,dimensions:{width:U,height:L}};k.getState().triggerNodeChanges([G])}})),M.current.update({controlPosition:B,boundaries:{minWidth:l,minHeight:u,maxWidth:d,maxHeight:m},keepAspectRatio:h,resizeDirection:g,onResizeStart:w,onResize:S,onResizeEnd:j,shouldResize:b}),()=>{var U;(U=M.current)==null||U.destroy()}},[B,l,u,d,m,h,w,S,j,b]);const I=B.split("-");return f.jsx("div",{className:nr(["react-flow__resize-control","nodrag",...I,n,r]),ref:O,style:{...i,scale:T,...o&&{[A?"backgroundColor":"borderColor"]:o}},children:a})}y.memo(A5e);function R$(e){switch(e){case"cancelling":return"cancelling";case"cancelled":return"cancelled";default:return sue(e)}}const eG=180,O5e=70,w0=24,T5e=60;function P5e({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${R$(e.status)}`;return f.jsxs("div",{className:`${t} relative`,children:[f.jsx(Tf,{type:"target",position:Ye.Top}),f.jsx("div",{className:"agent-flow-role",children:e.pending?`[pending: ${e.role}]`:e.role}),!e.pending&&f.jsxs("div",{className:"agent-flow-meta",children:[f.jsx("span",{className:`status-dot ${R$(e.status)}`}),f.jsx("span",{children:e.status}),e.duration_ms!=null&&f.jsx("span",{children:ib(e.duration_ms)}),e.exit_code!=null&&f.jsxs("span",{children:["exit ",e.exit_code]})]}),e.status==="running"&&e.onCancel&&f.jsx("button",{className:"absolute -right-1 -top-1 flex h-4 w-4 items-center justify-center rounded-full bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",onClick:n=>{n.stopPropagation(),e.onCancel(e.agentId,e.role)},title:"Cancel agent",children:f.jsx(Wa,{className:"h-2.5 w-2.5"})}),f.jsx(Tf,{type:"source",position:Ye.Bottom})]})}const M5e={agent:P5e};function tG(e,t){return e.filter(r=>r.parent===t&&r.status==="running").reduce((r,i)=>r+1+tG(e,i.agent_id),0)}function R5e(e,t){const n=new Map(e.map(l=>[l.agent_id,l])),r=new Map;for(const l of e){const u=l.parent;r.has(u)||r.set(u,[]),r.get(u).push(l.agent_id)}const i=new Map;for(const l of t){const u=l.requested_by;u&&n.has(u)&&(i.has(u)||i.set(u,[]),i.get(u).push(l))}function a(l){const u=(r.get(l)||[]).map(a),d=(i.get(l)||[]).map(m=>({id:`pending-${m.span_id}`,children:[]}));return{id:l,children:[...u,...d]}}return(r.get(null)||[]).map(a)}function S0(e){return e.children.length===0?eG:e.children.reduce((t,n)=>t+S0(n)+w0,-w0)}function nG(e,t,n,r){if(r.set(e.id,{x:t-eG/2,y:n}),e.children.length===0)return;const i=S0(e);let a=t-i/2;for(const o of e.children){const l=S0(o),u=a+l/2;nG(o,u,n+O5e+T5e,r),a+=l+w0}}function D5e({treeData:e,connected:t,runId:n}){return f.jsx(WX,{children:f.jsx(I5e,{treeData:e,connected:t,runId:n})})}function I5e({treeData:e,connected:t,runId:n}){const{fitView:r}=fw(),i=FU(),[a,o]=y.useState(null),[l,u]=y.useState(!1),d=a&&e?tG(e.nodes,a.agentId):0,m=y.useCallback((w,S)=>{o({agentId:w,role:S}),u(!1)},[]),h=y.useCallback(async()=>{if(a){try{await i.mutateAsync({runId:n,agentId:a.agentId,force:l}),We.success(`Cancel signal sent for ${a.role}`)}catch(w){We.error(`Failed to cancel agent: ${w instanceof Error?w.message:"Unknown error"}`)}o(null)}},[a,i,n,l]),g=y.useCallback(()=>{r({duration:300})},[r]),{flowNodes:v,flowEdges:b}=y.useMemo(()=>{if(!e)return{flowNodes:[],flowEdges:[]};const w=R5e(e.nodes,e.pending_delegations),S=new Map;let j=0;for(const A of w){const T=S0(A),M=j+T/2;nG(A,M,0,S),j+=T+w0*2}const C=new Map(e.nodes.map(A=>[A.agent_id,A])),E=new Map(e.pending_delegations.map(A=>[`pending-${A.span_id}`,A])),k=[];for(const[A,T]of S){const M=C.get(A),B=E.get(A);M?k.push({id:A,type:"agent",position:T,data:{label:M.role,role:M.role,status:M.status,runtime:M.runtime,duration_ms:M.duration_ms,exit_code:M.exit_code,agentId:M.agent_id,onCancel:m}}):B&&k.push({id:A,type:"agent",position:T,data:{label:B.role,role:B.role,status:"running",runtime:"",duration_ms:null,exit_code:null,pending:!0,agentId:""}})}const O=[];for(const A of e.nodes)A.parent&&O.push({id:`e-${A.parent}-${A.agent_id}`,source:A.parent,target:A.agent_id,type:"smoothstep",markerEnd:{type:Cf.ArrowClosed,width:16,height:16}});for(const A of e.pending_delegations)A.requested_by&&O.push({id:`e-${A.requested_by}-pending-${A.span_id}`,source:A.requested_by,target:`pending-${A.span_id}`,type:"smoothstep",markerEnd:{type:Cf.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:k,flowEdges:O}},[e,m]);return e?f.jsxs("div",{children:[f.jsxs("div",{className:"react-flow-wrapper",children:[f.jsx(i5e,{nodes:v,edges:b,nodeTypes:M5e,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,onNodeClick:()=>{},proOptions:{hideAttribution:!0}}),f.jsx("button",{className:"tree-reset-btn",onClick:g,children:"Reset View"})]}),e.denied_delegations.length>0&&f.jsxs("div",{className:"denied-list",children:[f.jsx("strong",{children:"Denied delegations:"}),e.denied_delegations.map(w=>f.jsxs("span",{className:"denied-item",children:[w.role," (",w.reason,")"]},w.span_id))]}),f.jsx(Qi,{open:!!a,onOpenChange:w=>{w||o(null)},children:f.jsxs(Zi,{children:[f.jsxs(Ji,{children:[f.jsx(ea,{children:"Cancel Agent"}),f.jsxs(Hp,{children:["Cancel ",f.jsx("strong",{children:a==null?void 0:a.role}),"?",d>0?` This will also cancel ${d} running descendant${d===1?"":"s"}.`:" This agent has no running descendants."]})]}),f.jsxs("div",{className:"space-y-3",children:[f.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agent ID: ",f.jsx("code",{children:a==null?void 0:a.agentId.slice(0,16)})]}),f.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[f.jsx("input",{type:"checkbox",checked:l,onChange:w=>u(w.target.checked),className:"h-4 w-4 rounded border-input"}),"Force cancel (skip graceful shutdown)"]})]}),f.jsxs(Up,{children:[f.jsx(pe,{variant:"outline",onClick:()=>o(null),children:"Keep Running"}),f.jsx(pe,{variant:"destructive",onClick:h,disabled:i.isPending,children:i.isPending?"Cancelling...":"Cancel Agent"})]})]})})]}):f.jsx("div",{className:"agent-tree",children:f.jsx("p",{className:"agent-meta",children:t?"Loading tree...":"Connecting..."})})}const Dc=18,D$=10;function L5e({runId:e,agents:t,active:n,agentLogs:r,wsConnected:i,subscribeLogs:a,unsubscribeLogs:o}){var q;const l=Object.keys(t),u=l.find($=>t[$].parent===null)??l[0]??"",[d,m]=y.useState(u),h=y.useRef(null);y.useEffect(()=>{!d||!i||(h.current&&h.current!==d&&o(h.current),h.current=d,a(d))},[d,i,a,o]);const g=r.get(d),v=(g==null?void 0:g.lines)??[],b=(g==null?void 0:g.done)??!1,w=i,[S,j]=y.useState(""),C=S.toLowerCase(),E=S?v.reduce(($,F,Q)=>(F.toLowerCase().includes(C)&&$.push(Q),$),[]):[],k=y.useRef(null),[O,A]=y.useState(0),[T,M]=y.useState(0),[B,I]=y.useState(!0),U=y.useRef(0),L=v.length*Dc,G=Math.max(0,Math.floor(O/Dc)-D$),z=Math.ceil(T/Dc)+D$*2,K=Math.min(v.length,G+z),P=v.slice(G,K),H=String(v.length).length,Y=y.useCallback(()=>{const $=k.current;if(!$)return;A($.scrollTop),M($.clientHeight);const F=$.scrollTop+$.clientHeight>=$.scrollHeight-Dc*2;I(F)},[]);y.useEffect(()=>{const $=k.current;$&&M($.clientHeight)},[]),y.useEffect(()=>{if(B&&v.length>U.current){const $=k.current;$&&($.scrollTop=$.scrollHeight)}U.current=v.length},[v.length,B]);const V=()=>{const $=k.current;$&&($.scrollTop=$.scrollHeight,I(!0))},D=async()=>{try{const $=await fetch(`/api/sessions/${e}/logs/${d}/full`);if(!$.ok)return;const F=await $.text(),Q=new Blob([F],{type:"text/plain"}),Z=URL.createObjectURL(Q),te=document.createElement("a");te.href=Z,te.download=`${d}.log`,te.click(),URL.revokeObjectURL(Z)}catch{}};return f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[l.length>1&&f.jsxs(ja,{value:d,onValueChange:m,children:[f.jsx(_a,{className:"w-[220px]",children:f.jsx(Ea,{})}),f.jsx(Ca,{children:l.map($=>f.jsxs(hn,{value:$,children:[t[$].role," (",$.slice(0,8),")"]},$))})]}),l.length===1&&f.jsxs("span",{className:"text-sm text-muted-foreground",children:[(q=t[d])==null?void 0:q.role," (",d.slice(0,8),")"]}),f.jsxs("div",{className:"relative ml-auto",children:[f.jsx(W0,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),f.jsx(Ze,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:S,onChange:$=>j($.target.value)})]}),S&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[E.length," match",E.length!==1?"es":""]}),f.jsxs(pe,{variant:"outline",size:"sm",onClick:D,children:[f.jsx(zp,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),f.jsx(z5e,{connected:w,done:b,active:n})]}),f.jsxs("div",{className:"relative",children:[f.jsx("div",{ref:k,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:Y,children:v.length===0?f.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:n&&!b?"Waiting for log output...":"No log output."}):f.jsx("div",{style:{height:L,position:"relative"},children:f.jsx("div",{style:{position:"absolute",top:G*Dc,left:0,right:0},children:P.map(($,F)=>{const Q=G+F,Z=S&&$.toLowerCase().includes(C);return f.jsxs("div",{className:Z?"bg-yellow-900/30":void 0,style:{height:Dc,lineHeight:`${Dc}px`,display:"flex",whiteSpace:"pre"},children:[f.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(H+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:Q+1}),f.jsx("span",{children:Z?f.jsx($5e,{line:$,search:C}):$})]},Q)})})})}),!B&&v.length>0&&f.jsxs(pe,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:V,children:[f.jsx(cU,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function z5e({connected:e,done:t,active:n}){return t||!n?f.jsx("span",{className:"text-xs text-muted-foreground",children:"Session ended"}):f.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[f.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 $5e({line:e,search:t}){const n=[],r=e.toLowerCase();let i=0,a=r.indexOf(t,i),o=0;for(;a!==-1;)a>i&&n.push(e.slice(i,a)),n.push(f.jsx("span",{className:"bg-yellow-500/60 text-white",children:e.slice(a,a+t.length)},o++)),i=a+t.length,a=r.indexOf(t,i);return i<e.length&&n.push(e.slice(i)),f.jsx(f.Fragment,{children:n})}const r_=500;function pw({children:e,className:t,gradientColor:n="var(--color-muted)"}){const r=y.useRef(null),i=y.useRef(null),[a,o]=y.useState(!0),[l,u]=y.useState(0),d=l>r_,m=d?Math.max(0,Math.round((l-r_)/20)):0;y.useLayoutEffect(()=>{const g=r.current;if(!g)return;const v=()=>u(g.scrollHeight);v();const b=new ResizeObserver(v);return b.observe(g),()=>b.disconnect()},[]);const h=y.useCallback(()=>{!a&&i.current&&requestAnimationFrame(()=>{var g;(g=i.current)==null||g.scrollIntoView({block:"nearest",behavior:"smooth"})}),o(g=>!g)},[a]);return f.jsxs("div",{ref:i,className:ke(d&&"relative",t),children:[f.jsx("div",{ref:r,"data-testid":"collapsible-content",className:ke(d&&"overflow-hidden transition-[max-height] duration-300 ease-in-out"),style:d?{maxHeight:a?`${r_}px`:`${l}px`}:void 0,children:e}),d&&a&&f.jsx("div",{"data-testid":"gradient-overlay",className:"pointer-events-none absolute bottom-6 left-0 right-0 h-16",style:{background:`linear-gradient(to bottom, transparent, ${n})`}}),d&&f.jsx("button",{type:"button",onClick:h,className:ke("flex w-full items-center justify-center gap-1 pt-1 pb-0.5","text-xs text-muted-foreground hover:text-foreground","cursor-pointer rounded-b-lg transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),"aria-expanded":!a,children:a?f.jsxs(f.Fragment,{children:[f.jsx(fu,{className:"h-3 w-3"}),"Show more",m>0&&f.jsxs("span",{className:"text-muted-foreground/70",children:["(~",m," more lines)"]})]}):f.jsxs(f.Fragment,{children:[f.jsx(hU,{className:"h-3 w-3"}),"Show less"]})})]})}function B5e({pendingAskUsers:e,initialMessages:t,respond:n}){const[r,i]=y.useState([]),[a,o]=y.useState(""),l=y.useRef(null),u=y.useRef(new Set);y.useEffect(()=>{!t||t.length===0||i(h=>{const g=new Set(h.map(w=>w.id)),v=t.filter(w=>!g.has(w.id));if(v.length===0)return h;const b=[...v,...h];b.sort((w,S)=>w.timestamp-S.timestamp);for(const w of b)u.current.add(w.id);return b})},[t]),y.useEffect(()=>{if(e.length===0)return;const h=[];for(const g of e)u.current.has(g.request_id)||(u.current.add(g.request_id),h.push({id:g.request_id,role:"agent",text:g.question,timestamp:g.timestamp}));h.length>0&&i(g=>[...g,...h])},[e]),y.useEffect(()=>{var h;(h=l.current)==null||h.scrollIntoView({behavior:"smooth"})},[r]);const d=(h,g)=>{if(!h.trim())return;const v=`user-${g.request_id}`;u.current.has(v)||(u.current.add(v),i(b=>[...b,{id:v,role:"user",text:h.trim(),timestamp:Date.now()/1e3}])),o(""),n(g.request_id,h.trim())},m=e.length>0?e[0]:null;return f.jsx(En,{className:"flex h-[500px] flex-col",children:f.jsxs(_n,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[f.jsx(qf,{className:"flex-1",children:f.jsxs("div",{className:"space-y-3 pr-3",children:[r.length===0&&f.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-muted-foreground",children:[f.jsx(hu,{className:"h-8 w-8"}),f.jsx("p",{className:"text-sm",children:"Waiting for the agent to ask a question..."})]}),r.map(h=>{const g=h.role==="agent"?e.find(v=>v.request_id===h.id):void 0;return f.jsxs("div",{children:[f.jsx("div",{className:ke("flex",h.role==="user"?"justify-end":"justify-start"),children:f.jsx("div",{className:ke("max-w-[80%] rounded-lg px-3 py-2 text-sm",h.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:f.jsx(pw,{gradientColor:h.role==="user"?"var(--color-primary)":"var(--color-muted)",children:f.jsx(Bi,{content:h.text,className:"whitespace-pre-wrap"})})})}),(g==null?void 0:g.choices)&&g.choices.length>0&&f.jsx("div",{className:"ml-3 mt-1 flex flex-wrap gap-1.5",children:g.choices.map(v=>f.jsx(pe,{variant:"outline",size:"sm",onClick:()=>d(v,g),children:v},v))})]},h.id)}),f.jsx("div",{ref:l})]})}),e.length>0&&f.jsx("div",{className:"flex items-center gap-2",children:f.jsxs(mt,{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:[f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-amber-500"}),e.length===1?"Waiting for response":`${e.length} questions waiting`]})}),f.jsxs("form",{className:"flex gap-2",onSubmit:h=>{h.preventDefault(),m&&d(a,m)},children:[f.jsx(Ze,{value:a,onChange:h=>o(h.target.value),placeholder:m?"Type your response...":"Waiting for agent question...",disabled:!m}),f.jsx(pe,{type:"submit",size:"icon",disabled:!m||!a.trim(),children:f.jsx(fle,{className:"h-4 w-4"})})]})]})})}const i_=1e4;function H2(e,t,n){const[r,i]=y.useState([]),[a,o]=y.useState([]),[l,u]=y.useState([]),[d,m]=y.useState(null),[h,g]=y.useState(!1),[v,b]=y.useState(new Map),w=y.useRef(null),S=y.useRef(0),j=y.useRef(void 0),C=y.useRef(1e3),E=y.useRef(e),k=y.useRef(n),O=E.current!==e||k.current!==n,A=y.useRef(!1),T=y.useRef(new Set),M=y.useCallback((U,L)=>{var G;(G=w.current)==null||G.send(JSON.stringify({type:"ask_user_response",request_id:U,text:L}))},[]),B=y.useCallback((U,L)=>{var G;T.current.add(U),(G=w.current)==null||G.send(JSON.stringify({type:"subscribe_logs",agent_id:U,...L!=null&&{offset:L}}))},[]),I=y.useCallback(U=>{var L;T.current.delete(U),b(G=>{const z=new Map(G);return z.delete(U),z}),(L=w.current)==null||L.send(JSON.stringify({type:"unsubscribe_logs",agent_id:U}))},[]);return y.useEffect(()=>{E.current=e,k.current=n,i([]),o([]),u([]),m(null),b(new Map),T.current.clear(),A.current=!1,S.current=0},[e,n]),y.useEffect(()=>{if(!t){i([]),g(!1);return}function U(){if(A.current)return;const G=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/sessions/${e}`,z=new WebSocket(G);w.current=z,z.onopen=()=>{g(!0),C.current=1e3,z.send(JSON.stringify({type:"init",trace_offset:S.current}));for(const K of T.current)z.send(JSON.stringify({type:"subscribe_logs",agent_id:K}))},z.onmessage=K=>{let P;try{P=JSON.parse(K.data)}catch{return}switch(P.type){case"tree_snapshot":case"tree_delta":{const{type:H,...Y}=P;m(Y);break}case"trace_snapshot":Array.isArray(P.events)&&u(P.events),typeof P.next_offset=="number"&&(S.current=P.next_offset);break;case"trace_delta":Array.isArray(P.events)&&u(H=>[...H,...P.events]),typeof P.next_offset=="number"&&(S.current=P.next_offset);break;case"ask_user":{const H=P;i(Y=>Y.some(V=>V.request_id===H.request_id)?Y:[...Y,H]);break}case"ask_user_resolved":typeof P.request_id=="string"?i(H=>H.filter(Y=>Y.request_id!==P.request_id)):i([]);break;case"chat_history":Array.isArray(P.messages)&&o(P.messages);break;case"agent_log_snapshot":{const H=P.agent_id,Y=P.lines??[],V=P.offset??0;b(D=>{const q=new Map(D);return q.set(H,{lines:Y.slice(-i_),offset:V,done:!1}),q});break}case"agent_log_delta":{const H=P.agent_id,Y=P.lines??[],V=P.offset??0;Y.length>0&&b(D=>{const q=new Map(D),$=q.get(H),F=[...($==null?void 0:$.lines)??[],...Y];return q.set(H,{lines:F.length>i_?F.slice(-i_):F,offset:V,done:($==null?void 0:$.done)??!1}),q});break}case"agent_log_done":{const H=P.agent_id;b(Y=>{const V=new Map(Y),D=V.get(H);return D&&V.set(H,{...D,done:!0}),V});break}case"stream_complete":A.current=!0,i([]),m(H=>!H||!H.nodes.some(V=>V.status==="running"||V.status==="cancelling")?H:{...H,nodes:H.nodes.map(V=>V.status==="running"?{...V,status:"completed",current_activity:null}:V.status==="cancelling"?{...V,status:"cancelled",current_activity:null}:V),pending_delegations:[]}),z.close(),w.current=null,g(!1);break}},z.onclose=()=>{w.current===z&&(w.current=null,g(!1),!A.current&&(j.current=setTimeout(()=>{C.current=Math.min(C.current*2,15e3),U()},C.current)))},z.onerror=()=>{z.close()}}return U(),()=>{var L;(L=w.current)==null||L.close(),w.current=null,j.current&&clearTimeout(j.current)}},[e,t,n]),{pendingAskUsers:O?[]:r,chatMessages:O?[]:a,traceEvents:O?[]:l,treeData:O?null:d,connected:O?!1:h,agentLogs:O?new Map:v,respond:M,subscribeLogs:B,unsubscribeLogs:I}}function F5e(){return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-64"}),f.jsx(en,{className:"h-32 rounded-lg"}),f.jsx(en,{className:"h-64 rounded-lg"})]})}function U5e(){const{projectId:e,runId:t}=_p(),[n]=iJ(),r=Number(e),i=I=>I==="starting"||I==="running",a=oce(r,t??"",{refetchInterval:void 0}),o=a.data,l=i(o==null?void 0:o.status);y.useEffect(()=>{if(!l)return;const I=setInterval(()=>a.refetch(),2e3);return()=>clearInterval(I)},[l,a]);const u=!!(o!=null&&o.interactive),{pendingAskUsers:d,chatMessages:m,traceEvents:h,treeData:g,connected:v,agentLogs:b,respond:w,subscribeLogs:S,unsubscribeLogs:j}=H2(t??"",!0),C=g??(o==null?void 0:o.tree)??null,E=(o==null?void 0:o.events)??[],k=h.length>0?h:E,[O,A]=y.useState(void 0);if(y.useEffect(()=>{d.length>0&&A("chat")},[d]),a.isLoading)return f.jsx(F5e,{});if(a.error)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",a.error.message]})]});if(!o)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsx("span",{children:"Session not found"})]});const T=G5e(k),M=X5e(k),B=n.get("tab")??(l?"agent-tree":"overview");return f.jsxs("div",{className:"space-y-6",children:[f.jsx(H5e,{session:o,projectId:r,runId:t??"",onStopped:()=>a.refetch()}),f.jsx(K5e,{session:o}),f.jsxs(Wp,{value:O??B,onValueChange:A,children:[f.jsxs(Qp,{children:[f.jsx(Wn,{value:"overview",children:"Overview"}),u&&f.jsxs(Wn,{value:"chat",className:"relative",children:["Chat",d.length>0&&f.jsx("span",{className:"ml-1.5 inline-block h-2 w-2 animate-pulse rounded-full bg-amber-500"})]}),f.jsx(Wn,{value:"agent-tree",children:"Agent Tree"}),f.jsx(Wn,{value:"logs",children:"Logs"}),f.jsxs(Wn,{value:"trace",children:["Trace",k.length>0&&` (${k.length})`]}),f.jsxs(Wn,{value:"artifacts",children:["Artifacts",T.length>0&&` (${T.length})`]})]}),f.jsxs(Qn,{value:"overview",className:"space-y-4",children:[o.user_task&&f.jsx(a_,{label:"User Task",defaultOpen:!0,children:f.jsx(I$,{content:o.user_task})}),o.task&&f.jsx(a_,{label:"Task",defaultOpen:!o.user_task,children:f.jsx(I$,{content:o.task})}),M&&f.jsx(a_,{label:"Output",defaultOpen:!0,children:f.jsx(Y5e,{runId:o.run_id,hash:M})}),!o.user_task&&!o.task&&!M&&f.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),u&&f.jsx(Qn,{value:"chat",children:f.jsx(B5e,{pendingAskUsers:d,initialMessages:m,respond:w})}),f.jsx(Qn,{value:"agent-tree",children:f.jsx(D5e,{treeData:C,connected:v,runId:t??""})}),f.jsx(Qn,{value:"logs",children:Object.keys(o.agents).length>0?f.jsx(L5e,{runId:o.run_id,agents:o.agents,active:l,agentLogs:b,wsConnected:v,subscribeLogs:S,unsubscribeLogs:j}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),f.jsx(Qn,{value:"trace",children:k.length>0?f.jsx(e$e,{events:k,runId:o.run_id}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),f.jsx(Qn,{value:"artifacts",children:T.length>0?f.jsx(W5e,{artifacts:T,runId:o.run_id}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function H5e({session:e,projectId:t,runId:n,onStopped:r}){const[i,a]=y.useState(!1),o=qk(),l=e.status==="starting"||e.status==="running";return f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(pe,{variant:"outline",size:"sm",asChild:!0,children:f.jsxs(dr,{to:t===0?"/imu":`/projects/${t}`,children:[f.jsx(G0,{className:"mr-2 h-4 w-4"}),"Back"]})}),f.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:["Session ",e.run_id.slice(0,16)]})]}),f.jsx("div",{className:"flex gap-2",children:l&&(i?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:async()=>{await o.mutateAsync(n),a(!1),r()},disabled:o.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>a(!1),children:"Cancel"})]}):f.jsxs(pe,{variant:"destructive",onClick:()=>a(!0),children:[f.jsx(yU,{className:"mr-2 h-4 w-4"}),"Stop Session"]}))})]})}function q5e({status:e}){const t=V5e(e);return f.jsxs(mt,{variant:"outline",className:ke("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==="cancelling"&&"animate-pulse border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-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"&&f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e==="cancelling"&&f.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-orange-500"}),e]})}function V5e(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":case"cancelled":return"warning";case"cancelling":return"cancelling";default:return"default"}}function K5e({session:e}){return f.jsx(En,{children:f.jsx(_n,{className:"pt-6",children:f.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status"}),f.jsx("dd",{children:f.jsx(q5e,{status:e.status})}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Role"}),f.jsx("dd",{children:e.role}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Runtime"}),f.jsx("dd",{children:e.runtime}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),f.jsx("dd",{children:mx(e.started_at)}),e.ended_at&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Ended"}),f.jsx("dd",{children:mx(e.ended_at)})]}),f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),f.jsx("dd",{children:ib(e.duration_ms)}),e.exit_code!==null&&f.jsxs(f.Fragment,{children:[f.jsx("dt",{className:"font-medium text-muted-foreground",children:"Exit Code"}),f.jsx("dd",{children:e.exit_code})]})]})})})}function a_({label:e,defaultOpen:t,children:n}){return f.jsx(Yp,{defaultOpen:t,children:f.jsxs("div",{className:"space-y-2",children:[f.jsxs(Xp,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[f.jsx(Ip,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),e]}),f.jsx(Gp,{children:f.jsx(En,{children:f.jsx(_n,{className:"pt-4",children:n})})})]})})}function I$({content:e}){const[t,n]=y.useState("markdown");return f.jsxs(f.Fragment,{children:[f.jsx(ub,{view:t,onChange:n}),t==="markdown"?f.jsx(Bi,{content:e,className:"text-sm"}):f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e})]})}function Y5e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState("markdown");return y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(u=>{if(!u.ok)throw new Error(`${u.status} ${u.statusText}`);return u.text()}).then(r).catch(u=>a(u.message))},[e,t]),i?f.jsxs("span",{className:"text-destructive",children:["Error: ",i]}):n===null?f.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):f.jsxs(f.Fragment,{children:[f.jsx(ub,{view:o,onChange:l}),o==="markdown"?f.jsx(Bi,{content:n,className:"text-sm"}):f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:n})]})}function X5e(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function G5e(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==="memory_remember"&&r.content_ref&&t.push({label:`Memory Remember (${r.provider||"memory"})`,hash:String(r.content_ref),event:n.event}),n.event==="memory_recall"&&r.results_ref&&t.push({label:`Memory Recall (${r.provider||"memory"})`,hash:String(r.results_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 W5e({artifacts:e,runId:t}){return f.jsx("div",{className:"space-y-1",children:e.map(n=>f.jsxs(Yp,{children:[f.jsxs(Xp,{className:"flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-sm hover:bg-muted",children:[f.jsx(Ip,{className:"h-3 w-3 transition-transform [[data-state=open]>&]:rotate-90"}),f.jsx("span",{className:"font-medium text-primary",children:n.label})]}),f.jsx(Gp,{children:f.jsx(Q5e,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function Q5e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null);return y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(o=>{if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.text()}).then(r).catch(o=>a(o.message))},[e,t]),i?f.jsxs("p",{className:"px-3 py-2 text-sm text-destructive",children:["Error: ",i]}):n===null?f.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading..."}):f.jsx(qf,{className:"max-h-[300px] overflow-hidden",children:f.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 Z5e({event:e}){const t=J5e(e);return f.jsx(mt,{variant:"outline",className:ke("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 J5e(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function e$e({events:e,runId:t}){const[n,r]=y.useState(null);return f.jsxs(f.Fragment,{children:[f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Time"}),f.jsx(Re,{children:"Event"}),f.jsx(Re,{children:"Span"}),f.jsx(Re,{children:"Details"})]})}),f.jsx(qi,{children:e.map((i,a)=>f.jsxs(sn,{children:[f.jsx(Me,{className:"text-sm text-muted-foreground",children:mx(i.ts)}),f.jsx(Me,{children:f.jsx(Z5e,{event:i.event})}),f.jsx(Me,{className:"font-mono text-xs text-muted-foreground",children:i.span_id.slice(0,8)}),f.jsx(Me,{className:"max-w-[400px] text-sm",children:n$e(i,(o,l)=>r({hash:o,label:l}))})]},a))})]})})}),f.jsx(Qi,{open:!!n,onOpenChange:()=>r(null),children:f.jsxs(Zi,{className:"max-w-3xl overflow-hidden",children:[f.jsx(Ji,{children:f.jsx(ea,{children:n==null?void 0:n.label})}),n&&f.jsx(t$e,{runId:t,hash:n.hash})]})})]})}function t$e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState("markdown"),u=y.useRef(null),d=y.useRef(null);return y.useEffect(()=>{const m=h=>{const g=d.current??u.current;if(g&&(h.metaKey||h.ctrlKey)&&h.key==="a"){h.preventDefault();const v=window.getSelection();if(v){v.removeAllRanges();const b=document.createRange();b.selectNodeContents(g),v.addRange(b)}}};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]),y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(m=>{if(!m.ok)throw new Error(`${m.status} ${m.statusText}`);return m.text()}).then(r).catch(m=>a(m.message))},[e,t]),f.jsx("div",{ref:u,className:"space-y-2",children:i?f.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",i]}):n===null?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):f.jsxs(f.Fragment,{children:[f.jsx(ub,{view:o,onChange:l}),f.jsx("div",{ref:d,className:"max-h-[60vh] overflow-y-auto",children:o==="markdown"?f.jsx("div",{className:"p-4",children:f.jsx(Bi,{content:n,className:"text-sm"})}):f.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-4 font-mono text-xs leading-relaxed",children:n})})]})})}function n$e(e,t){const n=e.data,r=[];for(const[a,o]of Object.entries(n))if(a.endsWith("_ref")&&o){const l=a.replace(/_ref$/,"");r.push(f.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(o),l),children:l},a))}const i=[];for(const[a,o]of Object.entries(n)){if(a.endsWith("_ref")||o==null||o==="")continue;const l=a==="duration_ms"?ib(o):Array.isArray(o)?o.join(", "):String(o);i.push(f.jsxs("span",{children:[f.jsxs("span",{className:"text-muted-foreground",children:[a,"="]}),f.jsx("span",{children:l})]},a))}return f.jsxs(f.Fragment,{children:[r.length>0&&f.jsx("div",{className:"mb-1 flex flex-wrap gap-1",children:r}),i.length>0&&f.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:i})]})}function r$e(e){const t=e.selectionStart,n=e.value.indexOf(`
`);return n===-1?!0:t<=n}function i$e(e){const t=e.selectionStart,n=e.value.lastIndexOf(`
`);return n===-1?!0:t>n}function rG({text:e,setText:t}){const n=y.useRef([]),r=y.useRef(-1),i=y.useRef(""),a=y.useRef(e);a.current=e;const o=y.useCallback(u=>{const d=u.trim();if(!d)return;const m=n.current;(m.length===0||m[m.length-1]!==d)&&m.push(d),r.current=-1,i.current=""},[]);return{handleHistoryKeyDown:y.useCallback(u=>{const d=u.currentTarget,m=n.current;if(u.key==="ArrowUp"){if(!r$e(d)||m.length===0)return;if(u.preventDefault(),r.current===-1)i.current=a.current,r.current=m.length-1;else if(r.current>0)r.current-=1;else return;t(m[r.current])}else if(u.key==="ArrowDown"){if(!i$e(d)||r.current===-1)return;u.preventDefault(),r.current<m.length-1?(r.current+=1,t(m[r.current])):(r.current=-1,t(i.current))}},[t]),addToHistory:o}}function iG(e){return`${e.role}: ${e.current_activity}`}function aG(e){return`${e} agent${e===1?"":"s"} running`}function oG(e,t){let n=1;for(const r of e)r.parent===t&&r.status==="running"&&(n+=oG(e,r.agent_id));return n}function sG(e,t){const n=t??e.length,r=e.filter(o=>o.current_activity),i=r[r.length-1],a=e[e.length-1];return{header:aG(n),childActivity:i?iG(i):a?`${a.role}: Working…`:"Working…",activityAction:(i==null?void 0:i.activity_action)??null}}function a$e(e,t){const n=e.find(i=>i.agent_id===t);if(!n)return null;const r=e.filter(i=>i.parent===t&&i.status==="running");if(r.length>0){const i=oG(e,t);return sG(r,i)}return n.current_activity?{header:iG(n),childActivity:null,activityAction:n.activity_action}:null}function lG(e){if(e.length===0)return null;const t=e.filter(r=>r.parent===null&&r.status==="running");if(t.length===1)return a$e(e,t[0].agent_id);if(t.length>1){const r=e.filter(i=>i.status==="running").length;return{header:aG(r),childActivity:null,activityAction:null}}const n=e.filter(r=>r.status==="running");return n.length===0?null:sG(n)}const L$={Read:_se,Edit:Bf,Write:jse,Bash:SU,Search:W0,Agent:Ik,Think:Pk};function o$e(e){return e&&e in L$?{icon:L$[e],spin:!1}:{icon:ur,spin:!0}}function cG({detail:e}){const{icon:t,spin:n}=o$e(e==null?void 0:e.activityAction);return f.jsxs("div",{className:"flex flex-col gap-1 text-muted-foreground",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(t,{className:`h-3.5 w-3.5${n?" animate-spin":""}`}),f.jsx("span",{className:"truncate",children:(e==null?void 0:e.header)??"Working…"})]}),(e==null?void 0:e.childActivity)&&f.jsxs("span",{className:"ml-5.5 flex items-center gap-1.5 truncate text-xs",children:[f.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse"}),f.jsx("span",{className:"text-muted-foreground/70",children:e.childActivity})]})]})}function s$e(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 l$e({status:e}){return e==="running"||e==="starting"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[f.jsx(ur,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[f.jsx($f,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[f.jsx(Lp,{className:"h-3 w-3"}),"Failed"]}):f.jsx(mt,{variant:"outline",children:e})}function c$e({session:e,projectId:t,treeData:n}){const r=e.status==="running"||e.status==="starting",i=r&&n?lG(n.nodes):null;return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"StrawPot"}),f.jsx(l$e,{status:e.status}),e.duration_ms!==null&&f.jsx("span",{className:"text-xs text-muted-foreground",children:s$e(e.duration_ms)}),f.jsx("span",{className:"text-xs text-muted-foreground",children:e.role})]}),f.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:r?f.jsx(cG,{detail:i}):e.summary?f.jsx(pw,{gradientColor:"var(--color-muted)",children:f.jsx(Bi,{content:e.summary,className:"text-sm text-foreground"})}):f.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),f.jsxs("a",{href:`/projects/${t}/sessions/${e.run_id}`,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[f.jsx(Mk,{className:"h-3 w-3"}),"View session"]})]})}function u$e({task:e}){return f.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),f.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:f.jsx(pw,{gradientColor:"var(--color-primary)",children:f.jsx("p",{className:"whitespace-pre-wrap",children:e})})})]})}function d$e(){var ir;const{projectId:e,conversationId:t}=_p(),n=Number(e),r=Number(t),[i,a]=y.useState(""),[o,l]=y.useState(""),[u,d]=y.useState([]),[m,h]=y.useState(!1),[g,v]=y.useState(!1),[b,w]=y.useState(!1),[S,j]=y.useState(""),[C,E]=y.useState(!1),[k,O]=y.useState(""),[A,T]=y.useState(!1),[M,B]=y.useState(""),[I,U]=y.useState(""),[L,G]=y.useState(""),[z,K]=y.useState(""),[P,H]=y.useState(""),[Y,V]=y.useState(""),[D,q]=y.useState(""),[$,F]=y.useState(()=>{try{return localStorage.getItem(`conv:${r}:interactive`)==="true"}catch{return!1}});y.useEffect(()=>{try{F(localStorage.getItem(`conv:${r}:interactive`)==="true")}catch{}},[r]),y.useEffect(()=>{try{localStorage.setItem(`conv:${r}:interactive`,String($))}catch{}},[r,$]);const[Q,Z]=y.useState(""),te=y.useRef(null),ae=y.useRef(null),re=y.useRef(0),ee=y.useRef(void 0),se=y.useRef(0),ve=y.useRef(null),ie=y.useRef(null),Se=Qe(),{data:Ee}=Vf(n),qe=(Ee??[]).filter(he=>he.type==="roles").map(he=>he.name),Te=zk(n),rt=J0(n),Je=(ir=Te.data)==null?void 0:ir.merged,{data:et,isLoading:xt,error:dt,fetchNextPage:Ct,hasNextPage:mn,isFetchingNextPage:Ut}=fx(r),Kt=(et==null?void 0:et.pages.slice().reverse().flatMap(he=>he.sessions))??[],ce=et==null?void 0:et.pages[0],xe=Kt[Kt.length-1],ze=(xe==null?void 0:xe.status)==="running"||(xe==null?void 0:xe.status)==="starting";fx(r,{refetchInterval:ze?2e3:!1});const{handleHistoryKeyDown:it,addToHistory:st}=rG({text:i,setText:a}),Ht=CU(r),rn=qk(),je=NU(r),ct=kU(r),wt=$k(n),{pendingAskUsers:ft,chatMessages:On,treeData:un,respond:Cr}=H2((xe==null?void 0:xe.run_id)??"",ze,r),Xr=o.trim()&&!qe.includes(o.trim())?"Role not found in installed roles":"",Gr=ze;y.useEffect(()=>{if(!te.current)return;const he=te.current.scrollHeight-re.current;he>0&&(te.current.scrollTop+=he,re.current=0)},[et==null?void 0:et.pages.length]),y.useEffect(()=>{te.current&&((xe==null?void 0:xe.run_id)!==ee.current&&(te.current.scrollTop=te.current.scrollHeight),ee.current=xe==null?void 0:xe.run_id)},[xe==null?void 0:xe.run_id]),y.useEffect(()=>{te.current&&(On.length>se.current&&(te.current.scrollTop=te.current.scrollHeight),se.current=On.length)},[On.length]),y.useEffect(()=>{if(!ae.current||!te.current)return;const he=new IntersectionObserver(([pt])=>{var Nr;pt.isIntersecting&&mn&&!Ut&&(re.current=((Nr=te.current)==null?void 0:Nr.scrollHeight)??0,Ct())},{root:te.current,threshold:.1});return he.observe(ae.current),()=>he.disconnect()},[mn,Ut,Ct]);const Wr=(Ee??[]).filter(he=>he.type==="agents").map(he=>he.name),gr=[...new Set((Ee??[]).filter(he=>he.type==="memories").map(he=>he.name)),"none"].sort(),Xe=M.trim()&&Wr.length>0&&!Wr.includes(M.trim())?"Runtime not found in installed agents":"",Mt=I.trim()&&gr.length>0&&!gr.includes(I.trim())?"Memory not found in installed providers":"",pn=!!Xe||!!Mt,Tn=[M,I,L,z,P,Y,D].filter(he=>he.trim()).length,Ir=he=>d(pt=>pt.includes(he)?pt.filter(Nr=>Nr!==he):[...pt,he]),Yt=he=>{he.preventDefault(),v(!0)},ge=he=>{he.preventDefault(),v(!0)},at=he=>{he.preventDefault(),v(!1)},Lt=async he=>{he.preventDefault(),v(!1);const pt=Array.from(he.dataTransfer.files);if(pt.length){w(!0);try{const Nr=await Ae.upload(`/projects/${n}/files`,pt);Se.invalidateQueries({queryKey:Pe.projects.files(n)}),d(Qr=>{const Fu=Nr.map(Ra=>Ra.path).filter(Ra=>!Qr.includes(Ra));return[...Qr,...Fu]})}catch{}finally{w(!1)}}};function an(he){he.preventDefault();const pt=i.trim();if(!pt||Xr||pn)return;const Nr={task:pt,role:o.trim()||void 0,context_files:u.length>0?u:void 0,interactive:$,system_prompt:L.trim()||void 0,runtime:M.trim()||void 0,memory:I.trim()||void 0,max_num_delegations:z.trim()?Number(z):void 0,cache_delegations:P?P==="true":void 0,cache_max_entries:Y.trim()?Number(Y):void 0,cache_ttl_seconds:D.trim()?Number(D):void 0};st(pt),Ht.mutate(Nr,{onSuccess:()=>{a(""),d([]),h(!1),setTimeout(()=>{var Qr;return(Qr=ie.current)==null?void 0:Qr.focus()},0)}})}function oi(he,pt){pt.trim()&&(Cr(he.request_id,pt.trim()),Z(""))}function rr(he){if(he.key==="Enter"&&!he.shiftKey){he.preventDefault(),an(he);return}it(he)}function sc(){O((ce==null?void 0:ce.title)??""),E(!0),setTimeout(()=>{var he;return(he=ve.current)==null?void 0:he.select()},0)}function lc(){const he=k.trim();wt.mutate({conversationId:r,title:he||null}),E(!1)}function ta(he){he.key==="Enter"&&(he.preventDefault(),lc()),he.key==="Escape"&&E(!1)}if(dt)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",dt.message]})]});const Fn=(ce==null?void 0:ce.title)??`Conversation #${r}`;return f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[C?f.jsx(Ze,{ref:ve,value:k,onChange:he=>O(he.target.value),onBlur:lc,onKeyDown:ta,className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${r}`}):f.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:sc,title:"Click to rename",children:Fn}),f.jsx(tw,{source:ce==null?void 0:ce.source,meta:ce==null?void 0:ce.source_meta})]}),Kt.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[Kt.length," session",Kt.length!==1?"s":""]})]}),(ce==null?void 0:ce.parent)&&f.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 rounded px-3 py-1.5 mb-3",children:[f.jsx(Dp,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:"Spawned from"}),f.jsxs(dr,{to:`/imu/${ce.parent.id}`,className:"text-primary hover:underline inline-flex items-center gap-1",children:[ce.parent.title||`imu conversation #${ce.parent.id}`,f.jsx(LD,{className:"h-3 w-3"})]})]}),(ce==null?void 0:ce.children)&&ce.children.length>0&&f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground bg-muted/50 rounded px-3 py-1.5 mb-3",children:[f.jsx(Mk,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:"Delegated to:"}),ce.children.map(he=>f.jsxs(dr,{to:`/projects/${he.project_id}/conversations/${he.id}`,className:"text-primary hover:underline inline-flex items-center gap-1",children:[he.project_name,": ",he.title||`#${he.id}`,f.jsx(LD,{className:"h-3 w-3"})]},he.id))]}),f.jsx("div",{ref:te,className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[f.jsx("div",{ref:ae,className:"h-1"}),Ut&&f.jsx("div",{className:"flex justify-center py-2",children:f.jsx(ur,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!xt&&Kt.length===0&&f.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),Kt.map((he,pt)=>{const Nr=pt===Kt.length-1;return f.jsxs("div",{className:"space-y-4",children:[(he.user_task??he.task)&&f.jsx(u$e,{task:he.user_task??he.task}),(Nr&&ze?On:he.chat_messages??[]).map(Qr=>f.jsx("div",{className:`flex ${Qr.role==="user"?"justify-end":"justify-start"}`,children:f.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${Qr.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:f.jsx(pw,{gradientColor:Qr.role==="user"?"var(--color-primary)":"var(--color-muted)",children:f.jsx(Bi,{content:Qr.text,className:"whitespace-pre-wrap"})})})},Qr.id)),f.jsx(c$e,{session:he,projectId:n,treeData:he.run_id===(xe==null?void 0:xe.run_id)?un:void 0})]},he.run_id)})]})}),(ce==null?void 0:ce.queued_tasks)&&ce.queued_tasks.length>0&&(()=>{const he=ce.queued_tasks;return f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:f.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[he.map((pt,Nr)=>f.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[f.jsx(ur,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),pt.source!=="user"&&f.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex-shrink-0",children:pt.source}),f.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",he.length>1?` (${Nr+1}/${he.length})`:"",":"," ",f.jsx("span",{className:"text-foreground",children:pt.task.split(`
`)[0]})]}),f.jsx(pe,{type:"button",variant:"ghost",size:"icon-xs",className:"flex-shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>ct.mutate(pt.id),disabled:ct.isPending,children:f.jsx(Wa,{})})]},pt.id)),he.length>1&&f.jsx("div",{className:"flex justify-end",children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>je.mutate(),disabled:je.isPending,children:[f.jsx(Wa,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),ft.length>0&&f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:f.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:ft.map(he=>f.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[f.jsx(Bi,{content:he.question,className:"text-sm font-medium"}),he.why&&f.jsx(Bi,{content:he.why,className:"text-xs text-muted-foreground"}),he.choices&&f.jsx("div",{className:"flex flex-wrap gap-1.5",children:he.choices.map(pt=>f.jsx(pe,{type:"button",size:"sm",variant:"outline",onClick:()=>oi(he,pt),children:pt},pt))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ze,{value:Q,onChange:pt=>Z(pt.target.value),onKeyDown:pt=>{pt.key==="Enter"&&!pt.shiftKey&&(pt.preventDefault(),oi(he,Q))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),f.jsx(pe,{type:"button",size:"icon",disabled:!Q.trim(),onClick:()=>oi(he,Q),children:f.jsx(dx,{className:"h-4 w-4"})})]})]},he.request_id))})}),f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:f.jsxs("form",{onSubmit:an,className:"mx-auto max-w-2xl space-y-2",children:[f.jsxs("div",{className:"relative",onDragOver:Yt,onDragEnter:ge,onDragLeave:at,onDrop:Lt,children:[f.jsx(No,{ref:ie,value:i,onChange:he=>a(he.target.value),onKeyDown:rr,placeholder:Gr?"Queue a follow-up task… (Enter to queue, runs after current session)":"Describe the next task… (Enter to submit, Shift+Enter for new line, drag & drop files to attach)",disabled:Ht.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(g||b)&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:b?f.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[f.jsx(ur,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(Z0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(rt.data??[]).length>0&&f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[f.jsx(Rk,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),f.jsxs(Kp,{align:"start",className:"w-64",onCloseAutoFocus:he=>he.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(Ze,{placeholder:"Filter files…",value:S,onChange:he=>j(he.target.value),className:"h-7 text-xs",onKeyDown:he=>he.stopPropagation()})}),f.jsx("div",{className:"max-h-48 overflow-y-auto",children:(rt.data??[]).filter(he=>he.path.toLowerCase().includes(S.toLowerCase())).map(he=>f.jsx(Hk,{checked:u.includes(he.path),onCheckedChange:()=>Ir(he.path),onSelect:pt=>pt.preventDefault(),children:f.jsx("span",{className:"font-mono text-xs",children:he.path})},he.path))})]})]}),u.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.length," attached"]})]}),u.length>0&&f.jsxs("div",{className:"flex flex-wrap gap-1",children:[(m?u:u.slice(0,3)).map(he=>f.jsxs(mt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[f.jsx("button",{type:"button",onClick:()=>Ir(he),className:"mr-0.5 rounded-sm hover:bg-muted",children:f.jsx(Wa,{className:"h-3 w-3"})}),"@",he]},he)),!m&&u.length>3&&f.jsxs("button",{type:"button",onClick:()=>h(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",u.length-3," more"]}),m&&u.length>3&&f.jsx("button",{type:"button",onClick:()=>h(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),f.jsx("div",{className:"flex flex-col gap-1.5",children:f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(Ze,{list:"datalist-role",value:o,onChange:he=>l(he.target.value),placeholder:"Default role",className:"w-48 text-sm"}),Xr&&f.jsx("p",{className:"text-xs text-destructive",children:Xr})]}),f.jsx("datalist",{id:"datalist-role",children:qe.map(he=>f.jsx("option",{value:he},he))}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(pe,{type:"button",variant:$?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>F(he=>!he),title:$?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[f.jsx(hu,{className:"h-3.5 w-3.5"}),$?"Interactive":"Auto"]}),f.jsxs(pe,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>T(!0),title:"Advanced options",children:[f.jsx(Q0,{className:"h-4 w-4"}),Tn>0&&f.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:Tn})]}),Gr&&f.jsxs(pe,{type:"button",variant:"destructive",onClick:()=>xe&&rn.mutate(xe.run_id),disabled:rn.isPending,children:[rn.isPending?f.jsx(ur,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(Dk,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),f.jsx(pe,{type:"submit",disabled:!i.trim()||Ht.isPending||!!Xr||pn,variant:Gr?"outline":"default",title:Gr?"Queue task (runs after current session)":void 0,children:Ht.isPending?f.jsx(ur,{className:"h-4 w-4 animate-spin"}):f.jsx(dx,{className:"h-4 w-4"})})]})]})})]})}),f.jsx(Qi,{open:A,onOpenChange:T,children:f.jsxs(Zi,{className:"max-w-lg",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Advanced Options"})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Runtime"}),f.jsx(Ze,{list:"adv-datalist-runtime",value:M,onChange:he=>B(he.target.value),placeholder:(Je==null?void 0:Je.runtime)??"default",className:"text-sm"}),f.jsx("datalist",{id:"adv-datalist-runtime",children:Wr.map(he=>f.jsx("option",{value:he},he))}),Xe&&f.jsx("p",{className:"text-xs text-destructive",children:Xe})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Memory"}),f.jsx(Ze,{list:"adv-datalist-memory",value:I,onChange:he=>U(he.target.value),placeholder:(Je==null?void 0:Je.memory)??"dial",className:"text-sm"}),f.jsx("datalist",{id:"adv-datalist-memory",children:gr.map(he=>f.jsx("option",{value:he},he))}),Mt&&f.jsx("p",{className:"text-xs text-destructive",children:Mt})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"System Prompt"}),f.jsx(No,{value:L,onChange:he=>G(he.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Max Delegations"}),f.jsx(Ze,{type:"number",min:"0",value:z,onChange:he=>K(he.target.value),placeholder:Je!=null&&Je.max_num_delegations?String(Je.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Delegations"}),f.jsxs(ja,{value:P||"__empty__",onValueChange:he=>H(he==="__empty__"?"":he),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:`Default (${(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false"})`})}),f.jsxs(Ca,{children:[f.jsxs(hn,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false",")"]}),f.jsx(hn,{value:"true",children:"true"}),f.jsx(hn,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Max Entries"}),f.jsx(Ze,{type:"number",min:"0",value:Y,onChange:he=>V(he.target.value),placeholder:Je!=null&&Je.cache_max_entries?String(Je.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache TTL (seconds)"}),f.jsx(Ze,{type:"number",min:"0",value:D,onChange:he=>q(he.target.value),placeholder:Je!=null&&Je.cache_ttl_seconds?String(Je.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>{B(""),U(""),G(""),K(""),H(""),V(""),q("")},children:"Reset"}),f.jsx(pe,{size:"sm",onClick:()=>T(!1),children:"Done"})]})]})})]})}const o_="imu";function f$e(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 h$e({status:e}){return e==="running"||e==="starting"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[f.jsx(ur,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[f.jsx($f,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?f.jsxs(mt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[f.jsx(Lp,{className:"h-3 w-3"}),"Failed"]}):f.jsx(mt,{variant:"outline",children:e})}function m$e({session:e,treeData:t}){const n=e.status==="running"||e.status==="starting",r=n&&t?lG(t.nodes):null;return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Bot Imu"}),f.jsx(h$e,{status:e.status}),e.duration_ms!==null&&f.jsx("span",{className:"text-xs text-muted-foreground",children:f$e(e.duration_ms)})]}),f.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:n?f.jsx(cG,{detail:r}):e.summary?f.jsx(Bi,{content:e.summary,className:"text-sm text-foreground"}):f.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),f.jsxs("a",{href:`/projects/0/sessions/${e.run_id}`,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[f.jsx(Mk,{className:"h-3 w-3"}),"View session"]})]})}function p$e({task:e}){return f.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),f.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:f.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}const g$e=[{group:"Getting started",prompts:[{label:"What can you do?",text:"What can you do?"}]},{group:"Do something",prompts:[{label:"Show me all my projects",text:"Show me all my projects"},{label:"What roles and skills are available?",text:"What roles and skills are available?"},{label:"Register my project",text:"Register my project at ~/path/to/repo"}]},{group:"Integrations",prompts:[{label:"How to integrate with Telegram?",text:"How to integrate with Telegram?"},{label:"How to integrate with Slack or Discord?",text:"How to integrate with Slack or Discord?"}]}];function v$e({onSelectPrompt:e}){return f.jsxs("div",{className:"flex flex-col items-center gap-6 py-12 px-4",children:[f.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[f.jsx(Dp,{className:"h-10 w-10 text-muted-foreground"}),f.jsx("h2",{className:"text-lg font-semibold",children:"Hi, I'm Imu"}),f.jsx("p",{className:"max-w-md text-sm text-muted-foreground",children:"Your StrawPot operator. I manage projects, run agents, and keep things on schedule."})]}),f.jsx("div",{className:"w-full max-w-md space-y-4",children:g$e.map(t=>f.jsxs("div",{className:"space-y-2",children:[f.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t.group}),f.jsx("div",{className:"flex flex-col gap-1.5",children:t.prompts.map(n=>f.jsx("button",{type:"button",onClick:()=>e(n.text),className:"rounded-lg border border-border px-3 py-2 text-left text-sm hover:bg-muted/50 transition-colors",children:n.label},n.label))})]},t.group))})]})}function y$e({cid:e}){const[t,n]=y.useState(""),[r,i]=y.useState(()=>{try{return localStorage.getItem(`conv:${e}:interactive`)==="true"}catch{return!1}});y.useEffect(()=>{try{i(localStorage.getItem(`conv:${e}:interactive`)==="true")}catch{}},[e]),y.useEffect(()=>{try{localStorage.setItem(`conv:${e}:interactive`,String(r))}catch{}},[e,r]);const[a,o]=y.useState(!1),[l,u]=y.useState(""),[d,m]=y.useState(!1),[h,g]=y.useState(""),[v,b]=y.useState(""),[w,S]=y.useState(""),[j,C]=y.useState(""),[E,k]=y.useState(""),[O,A]=y.useState(""),[T,M]=y.useState(""),[B,I]=y.useState(!1),[U,L]=y.useState(!1),[G,z]=y.useState([]),[K,P]=y.useState(!1),[H,Y]=y.useState(""),[V,D]=y.useState(""),q=Qe(),$=y.useRef(null),F=y.useRef(null),Q=y.useRef(0),Z=y.useRef(void 0),te=y.useRef(0),ae=y.useRef(null),re=y.useRef(null),{data:ee}=eu("agents"),{data:se}=eu("memories"),ve=J0(0),ie=ge=>z(at=>at.includes(ge)?at.filter(Lt=>Lt!==ge):[...at,ge]),{data:Se,isLoading:Ee,error:qe,fetchNextPage:Te,hasNextPage:rt,isFetchingNextPage:Je}=fx(e),et=(Se==null?void 0:Se.pages.slice().reverse().flatMap(ge=>ge.sessions))??[],xt=Se==null?void 0:Se.pages[0],dt=et[et.length-1],Ct=(dt==null?void 0:dt.status)==="running"||(dt==null?void 0:dt.status)==="starting";fx(e,{refetchInterval:Ct?2e3:!1});const{handleHistoryKeyDown:mn,addToHistory:Ut}=rG({text:t,setText:n}),Kt=CU(e),ce=qk(),xe=NU(e),ze=kU(e),it=Bk(),{pendingAskUsers:st,chatMessages:Ht,treeData:rn,respond:je}=H2((dt==null?void 0:dt.run_id)??"",Ct,e),ct=(ee??[]).map(ge=>ge.name),wt=[...new Set((se??[]).map(ge=>ge.name)),"none"].sort(),ft=h.trim()&&ct.length>0&&!ct.includes(h.trim())?"Runtime not found in installed agents":"",On=v.trim()&&wt.length>0&&!wt.includes(v.trim())?"Memory not found in installed providers":"",un=!!ft||!!On,Cr=[h,v,w,j,E,O,T].filter(ge=>ge.trim()).length;y.useEffect(()=>{if(!$.current)return;const ge=$.current.scrollHeight-Q.current;ge>0&&($.current.scrollTop+=ge,Q.current=0)},[Se==null?void 0:Se.pages.length]),y.useEffect(()=>{$.current&&((dt==null?void 0:dt.run_id)!==Z.current&&($.current.scrollTop=$.current.scrollHeight),Z.current=dt==null?void 0:dt.run_id)},[dt==null?void 0:dt.run_id]),y.useEffect(()=>{$.current&&(Ht.length>te.current&&($.current.scrollTop=$.current.scrollHeight),te.current=Ht.length)},[Ht.length]),y.useEffect(()=>{if(!F.current||!$.current)return;const ge=new IntersectionObserver(([at])=>{var Lt;at.isIntersecting&&rt&&!Je&&(Q.current=((Lt=$.current)==null?void 0:Lt.scrollHeight)??0,Te())},{root:$.current,threshold:.1});return ge.observe(F.current),()=>ge.disconnect()},[rt,Je,Te]);const Xr=ge=>{ge.preventDefault(),I(!0)},Gr=ge=>{ge.preventDefault(),I(!0)},Wr=ge=>{ge.preventDefault(),I(!1)},gr=async ge=>{ge.preventDefault(),I(!1);const at=Array.from(ge.dataTransfer.files);if(at.length){L(!0);try{const Lt=await Ae.upload("/projects/0/files",at);q.invalidateQueries({queryKey:Pe.projects.files(0)}),z(an=>{const oi=Lt.map(rr=>rr.path).filter(rr=>!an.includes(rr));return[...an,...oi]})}catch{}finally{L(!1)}}};function Xe(ge){ge.preventDefault();const at=t.trim();!at||un||(Ut(at),Kt.mutate({task:at,role:o_,interactive:r,context_files:G.length>0?G:void 0,system_prompt:w.trim()||void 0,runtime:h.trim()||void 0,memory:v.trim()||void 0,max_num_delegations:j.trim()?Number(j):void 0,cache_delegations:E?E==="true":void 0,cache_max_entries:O.trim()?Number(O):void 0,cache_ttl_seconds:T.trim()?Number(T):void 0},{onSuccess:()=>{n(""),z([]),P(!1),setTimeout(()=>{var Lt;return(Lt=re.current)==null?void 0:Lt.focus()},0)}}))}function Mt(ge,at){at.trim()&&(je(ge.request_id,at.trim()),D(""))}function pn(ge){if(ge.key==="Enter"&&!ge.shiftKey){ge.preventDefault(),Xe(ge);return}mn(ge)}function Tn(){u((xt==null?void 0:xt.title)??""),o(!0),setTimeout(()=>{var ge;return(ge=ae.current)==null?void 0:ge.select()},0)}function Ir(){const ge=l.trim();it.mutate({conversationId:e,title:ge||null}),o(!1)}if(qe)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",qe.message]})]});const Yt=(xt==null?void 0:xt.title)??`Conversation #${e}`;return f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[a?f.jsx(Ze,{ref:ae,value:l,onChange:ge=>u(ge.target.value),onBlur:Ir,onKeyDown:ge=>{ge.key==="Enter"&&(ge.preventDefault(),Ir()),ge.key==="Escape"&&o(!1)},className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${e}`}):f.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:Tn,title:"Click to rename",children:Yt}),f.jsx(tw,{source:xt==null?void 0:xt.source,meta:xt==null?void 0:xt.source_meta})]}),et.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[et.length," session",et.length!==1?"s":""]})]}),f.jsx("div",{ref:$,className:"min-h-0 flex-1 overflow-y-auto",children:f.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[f.jsx("div",{ref:F,className:"h-1"}),Je&&f.jsx("div",{className:"flex justify-center py-2",children:f.jsx(ur,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!Ee&&et.length===0&&f.jsx(v$e,{onSelectPrompt:ge=>{Kt.mutate({task:ge,role:o_,interactive:r},{onSuccess:()=>{setTimeout(()=>{var at;return(at=re.current)==null?void 0:at.focus()},0)}})}}),et.map((ge,at)=>{const Lt=at===et.length-1;return f.jsxs("div",{className:"space-y-4",children:[(ge.user_task??ge.task)&&f.jsx(p$e,{task:ge.user_task??ge.task}),(Lt&&Ct?Ht:ge.chat_messages??[]).map(an=>f.jsx("div",{className:`flex ${an.role==="user"?"justify-end":"justify-start"}`,children:f.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${an.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:f.jsx(Bi,{content:an.text,className:"whitespace-pre-wrap"})})},an.id)),f.jsx(m$e,{session:ge,treeData:ge.run_id===(dt==null?void 0:dt.run_id)?rn:void 0})]},ge.run_id)})]})}),(xt==null?void 0:xt.queued_tasks)&&xt.queued_tasks.length>0&&(()=>{const ge=xt.queued_tasks;return f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:f.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[ge.map((at,Lt)=>f.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[f.jsx(ur,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),at.source!=="user"&&f.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex-shrink-0",children:at.source}),f.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",ge.length>1?` (${Lt+1}/${ge.length})`:"",":"," ",f.jsx("span",{className:"text-foreground",children:at.task.split(`
`)[0]})]}),f.jsx(pe,{type:"button",variant:"ghost",size:"icon-xs",className:"flex-shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>ze.mutate(at.id),disabled:ze.isPending,children:f.jsx(Wa,{})})]},at.id)),ge.length>1&&f.jsx("div",{className:"flex justify-end",children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>xe.mutate(),disabled:xe.isPending,children:[f.jsx(Wa,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),st.length>0&&f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:f.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:st.map(ge=>f.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[f.jsx(Bi,{content:ge.question,className:"text-sm font-medium"}),ge.why&&f.jsx(Bi,{content:ge.why,className:"text-xs text-muted-foreground"}),ge.choices&&f.jsx("div",{className:"flex flex-wrap gap-1.5",children:ge.choices.map(at=>f.jsx(pe,{type:"button",size:"sm",variant:"outline",onClick:()=>Mt(ge,at),children:at},at))}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ze,{value:V,onChange:at=>D(at.target.value),onKeyDown:at=>{at.key==="Enter"&&!at.shiftKey&&(at.preventDefault(),Mt(ge,V))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),f.jsx(pe,{type:"button",size:"icon",disabled:!V.trim(),onClick:()=>Mt(ge,V),children:f.jsx(dx,{className:"h-4 w-4"})})]})]},ge.request_id))})}),f.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:f.jsxs("form",{onSubmit:Xe,className:"mx-auto max-w-2xl space-y-2",children:[f.jsxs("div",{className:"relative",onDragOver:Xr,onDragEnter:Gr,onDragLeave:Wr,onDrop:gr,children:[f.jsx(No,{ref:re,value:t,onChange:ge=>n(ge.target.value),onKeyDown:pn,placeholder:Ct?"Queue a follow-up task… (Enter to queue, runs after current session)":"Ask Bot Imu anything… (Enter to send, Shift+Enter for new line, drag & drop files to attach)",disabled:Kt.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(B||U)&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:U?f.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[f.jsx(ur,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):f.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[f.jsx(Z0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[f.jsx(Rk,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),f.jsxs(Kp,{align:"start",className:"w-64",onCloseAutoFocus:ge=>ge.preventDefault(),children:[f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(Ze,{placeholder:"Filter files…",value:H,onChange:ge=>Y(ge.target.value),className:"h-7 text-xs",onKeyDown:ge=>ge.stopPropagation()})}),f.jsx("div",{className:"max-h-48 overflow-y-auto",children:(ve.data??[]).filter(ge=>ge.path.toLowerCase().includes(H.toLowerCase())).map(ge=>f.jsx(Hk,{checked:G.includes(ge.path),onCheckedChange:()=>ie(ge.path),onSelect:at=>at.preventDefault(),children:f.jsx("span",{className:"font-mono text-xs",children:ge.path})},ge.path))})]})]}),G.length>0&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:[G.length," attached"]})]}),G.length>0&&f.jsxs("div",{className:"flex flex-wrap gap-1",children:[(K?G:G.slice(0,3)).map(ge=>f.jsxs(mt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[f.jsx("button",{type:"button",onClick:()=>ie(ge),className:"mr-0.5 rounded-sm hover:bg-muted",children:f.jsx(Wa,{className:"h-3 w-3"})}),"@",ge]},ge)),!K&&G.length>3&&f.jsxs("button",{type:"button",onClick:()=>P(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",G.length-3," more"]}),K&&G.length>3&&f.jsx("button",{type:"button",onClick:()=>P(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("span",{className:"text-xs text-muted-foreground px-1",children:["Role: ",o_]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(pe,{type:"button",variant:r?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>i(ge=>!ge),title:r?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[f.jsx(hu,{className:"h-3.5 w-3.5"}),r?"Interactive":"Auto"]}),f.jsxs(pe,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>m(!0),title:"Advanced options",children:[f.jsx(Q0,{className:"h-4 w-4"}),Cr>0&&f.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:Cr})]}),Ct&&f.jsxs(pe,{type:"button",variant:"destructive",onClick:()=>dt&&ce.mutate(dt.run_id),disabled:ce.isPending,children:[ce.isPending?f.jsx(ur,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(Dk,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),f.jsx(pe,{type:"submit",disabled:!t.trim()||Kt.isPending||un,variant:Ct?"outline":"default",title:Ct?"Queue task (runs after current session)":void 0,children:Kt.isPending?f.jsx(ur,{className:"h-4 w-4 animate-spin"}):f.jsx(dx,{className:"h-4 w-4"})})]})]})]})}),f.jsx(Qi,{open:d,onOpenChange:m,children:f.jsxs(Zi,{className:"max-w-lg",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Advanced Options"})}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Runtime"}),f.jsx(Ze,{list:"imu-adv-runtime",value:h,onChange:ge=>g(ge.target.value),placeholder:"default",className:"text-sm"}),f.jsx("datalist",{id:"imu-adv-runtime",children:ct.map(ge=>f.jsx("option",{value:ge},ge))}),ft&&f.jsx("p",{className:"text-xs text-destructive",children:ft})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Memory"}),f.jsx(Ze,{list:"imu-adv-memory",value:v,onChange:ge=>b(ge.target.value),placeholder:"dial",className:"text-sm"}),f.jsx("datalist",{id:"imu-adv-memory",children:wt.map(ge=>f.jsx("option",{value:ge},ge))}),On&&f.jsx("p",{className:"text-xs text-destructive",children:On})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"System Prompt"}),f.jsx(No,{value:w,onChange:ge=>S(ge.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Max Delegations"}),f.jsx(Ze,{type:"number",min:"0",value:j,onChange:ge=>C(ge.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Delegations"}),f.jsxs(ja,{value:E||"__empty__",onValueChange:ge=>k(ge==="__empty__"?"":ge),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:"Default (true)"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"__empty__",className:"text-muted-foreground",children:"Default (true)"}),f.jsx(hn,{value:"true",children:"true"}),f.jsx(hn,{value:"false",children:"false"})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache Max Entries"}),f.jsx(Ze,{type:"number",min:"0",value:O,onChange:ge=>A(ge.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{children:"Cache TTL (seconds)"}),f.jsx(Ze,{type:"number",min:"0",value:T,onChange:ge=>M(ge.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[f.jsx(pe,{variant:"ghost",size:"sm",onClick:()=>{g(""),b(""),S(""),C(""),k(""),A(""),M("")},children:"Reset"}),f.jsx(pe,{size:"sm",onClick:()=>m(!1),children:"Done"})]})]})})]})}function x$e({conv:e}){const[t,n]=y.useState(!1),[r,i]=y.useState(""),a=y.useRef(null),o=Bk();function l(d){d.stopPropagation(),i(e.title??""),n(!0),setTimeout(()=>{var m;return(m=a.current)==null?void 0:m.select()},0)}function u(d){d.stopPropagation(),o.mutate({conversationId:e.id,title:r.trim()||null}),n(!1)}return t?f.jsx(Ze,{ref:a,value:r,onChange:d=>i(d.target.value),onBlur:u,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u(d)),d.key==="Escape"&&(d.stopPropagation(),n(!1))},onClick:d=>d.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:`Conversation #${e.id}`}):f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-medium",children:e.title??`Conversation #${e.id}`}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:l,"aria-label":"Rename",children:f.jsx(Bf,{className:"h-3 w-3"})})]})}function b$e({conv:e}){const[t,n]=y.useState(!1),r=AU();return t?f.jsxs("div",{className:"flex justify-end gap-1",onClick:i=>i.stopPropagation(),children:[f.jsx(pe,{size:"sm",variant:"destructive",disabled:r.isPending,onClick:i=>{i.stopPropagation(),r.mutate(e.id,{onSuccess:()=>n(!1),onError:()=>n(!1)})},children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:i=>{i.stopPropagation(),n(!1)},children:"No"})]}):f.jsx(pe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:i=>{i.stopPropagation(),n(!0)},"aria-label":"Delete conversation",children:f.jsx(Pa,{className:"h-3.5 w-3.5"})})}function w$e(){var h,g,v;const e=to(),t=Uf(),n=tb(),[r,i]=y.useState(1),a=PU(0,r),[o,l]=y.useState("conversations"),u=((h=a.data)==null?void 0:h.items)??[],d=((g=a.data)==null?void 0:g.total)??0,m=a.data?Math.ceil(a.data.total/a.data.per_page):0;return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{children:[f.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[f.jsx(Dp,{className:"h-6 w-6"}),"Bot Imu"]}),f.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Your personal StrawPot overlord. Ask it to manage projects, run agents, configure schedules, or anything else in your StrawPot workspace."})]}),f.jsxs(pe,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?f.jsx(ur,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(hu,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}),f.jsxs(Wp,{value:o,onValueChange:l,children:[f.jsxs(Qp,{children:[f.jsxs(Wn,{value:"conversations",children:["Conversations (",((v=t.data)==null?void 0:v.length)??0,")"]}),f.jsxs(Wn,{value:"sessions",children:["Sessions (",d,")"]}),f.jsx(Wn,{value:"activity",children:"Activity"}),f.jsx(Wn,{value:"files",children:"Files"})]}),f.jsx(Qn,{value:"conversations",className:"mt-4 space-y-3",children:(t.data??[]).length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[f.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"No conversations yet."}),f.jsxs(pe,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?f.jsx(ur,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(hu,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}):f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsxs("table",{className:"w-full text-sm",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[f.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),f.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),f.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),f.jsx("th",{className:"px-4 py-2"})]})}),f.jsx("tbody",{children:(t.data??[]).map(b=>f.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>e(`/imu/${b.id}`),children:[f.jsx("td",{className:"px-4 py-2",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(x$e,{conv:b}),f.jsx(tw,{source:b.source,meta:b.source_meta})]})}),f.jsxs("td",{className:"px-4 py-2 text-muted-foreground",children:[b.session_count,b.spawned_count>0&&f.jsxs("span",{className:"ml-1.5 text-xs text-primary",title:`${b.spawned_count} delegated conversation${b.spawned_count!==1?"s":""}`,children:["+",b.spawned_count]})]}),f.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:b.updated_at?new Date(b.updated_at).toLocaleString():new Date(b.created_at).toLocaleString()}),f.jsx("td",{className:"px-4 py-2 text-right",children:f.jsx(b$e,{conv:b})})]},b.id))})]})})})}),f.jsx(Qn,{value:"sessions",className:"mt-4 space-y-3",children:d===0?f.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):f.jsxs(f.Fragment,{children:[f.jsx(En,{children:f.jsx(_n,{className:"p-0",children:f.jsx(hx,{sessions:u})})}),f.jsx(Vk,{page:r,totalPages:m,onPageChange:i})]})}),f.jsx(Qn,{value:"activity",className:"mt-4",children:f.jsx(bY,{projectId:0})}),f.jsx(Qn,{value:"files",className:"mt-4",children:f.jsx(qU,{projectId:0})})]})]})}function z$(){const{conversationId:e}=_p(),t=e?Number(e):null;return t!==null?f.jsx(y$e,{cid:t}):f.jsx(w$e,{})}const S$e={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},j$e={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers",integrations:"Integrations"};function E$e(){const{resourceType:e="roles"}=_p(),{data:t,isLoading:n}=eu(e),[r,i]=y.useState(null),[a,o]=y.useState(!1),[l,u]=y.useState(!1),[d,m]=y.useState(!1),h=WH(),{data:g}=pve(e,r??"",{enabled:a&&!!r}),v=j$e[e]??e;return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:v}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",v.toLowerCase()," from StrawHub"]})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(pe,{onClick:()=>m(!0),size:"sm",variant:"outline",children:[f.jsx(qm,{className:"mr-2 h-4 w-4"}),"Update All ",v]}),f.jsxs(pe,{onClick:()=>u(!0),size:"sm",children:[f.jsx(zp,{className:"mr-2 h-4 w-4"}),"Install"]})]})]}),n?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((b,w)=>f.jsx(en,{className:"h-12 w-full"},w))}):!t||t.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",v.toLowerCase()," installed yet."]}):f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Version"}),f.jsx(Re,{children:"Description"}),f.jsx(Re,{children:"Source"}),f.jsx(Re,{className:"w-24"})]})}),f.jsx(qi,{children:t.map(b=>{var w;return f.jsxs(sn,{className:"cursor-pointer",onClick:()=>{i(b.name),o(!0)},children:[f.jsx(Me,{className:"font-medium",children:b.name}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:b.version??"—"}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm",children:b.description||"—"}),f.jsx(Me,{children:f.jsx(mt,{variant:"outline",className:"text-xs",children:b.source})}),f.jsx(Me,{children:!((w=S$e[e])!=null&&w.includes(b.name))&&f.jsx(_$e,{resourceType:e,name:b.name})})]},b.name)})})]}),f.jsx(ZH,{resource:g??null,resourceType:e,open:a,onOpenChange:o}),f.jsx(pA,{open:l,onOpenChange:u,defaultType:e}),f.jsx(gA,{open:d,onOpenChange:m,onUpdate:()=>h.mutateAsync(e),scope:"global",resourceType:e})]})}function _$e({resourceType:e,name:t}){const[n,r]=y.useState(!1),i=GH(),a=o=>{o.stopPropagation(),i.mutate({type:e,name:t},{onSuccess:l=>{l.exit_code===0?We.success(`Uninstalled ${t}`):We.error(`Uninstall failed: ${l.stderr||l.stdout}`),r(!1)},onError:()=>{We.error("Uninstall request failed"),r(!1)}})};return n?f.jsxs("div",{className:"flex gap-1",children:[f.jsx(pe,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),r(!1)},children:"No"})]}):f.jsx(pe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),r(!0)},children:f.jsx(Pa,{className:"h-4 w-4"})})}var s_={exports:{}},$$;function C$e(){return $$||($$=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var n={949(o,l,u){Object.defineProperty(l,"__esModule",{value:!0}),l.CronParser=void 0;var d=u(515),m=(function(){function h(g,v,b){v===void 0&&(v=!0),b===void 0&&(b=!1),this.expression=g,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=b}return h.prototype.parse=function(){var g,v,b=(g=this.expression)!==null&&g!==void 0?g:"";if(b==="@reboot")return v=["@reboot","","","","","",""],v;if(b.startsWith("@")){var w=this.parseSpecial(this.expression);v=this.extractParts(w)}else v=this.extractParts(this.expression);return this.normalize(v),this.validate(v),v},h.prototype.parseSpecial=function(g){var v={"@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=v[g];if(!b)throw new Error("Unknown special expression.");return b},h.prototype.extractParts=function(g){if(!this.expression)throw new Error("cron expression is empty");for(var v=g.trim().split(/[ ]+/),b=0;b<v.length;b++)if(v[b].includes(",")){var w=v[b].split(",").map(function(j){return j.trim()}).filter(function(j){return j!==""}).map(function(j){return isNaN(Number(j))?j:Number(j)}).filter(function(j){return j!==null&&j!==""});w.length===0&&w.push("*"),w.sort(function(j,C){return j!==null&&C!==null?j-C:0}),v[b]=w.map(function(j){return j!==null?j.toString():""}).join(",")}if(v.length<5)throw new Error("Expression has only ".concat(v.length," part").concat(v.length==1?"":"s",". At least 5 parts are required."));if(v.length==5)v.unshift(""),v.push("");else if(v.length==6){var S=/\d{4}$/.test(v[5])||v[4]=="?"||v[2]=="?";S?v.unshift(""):v.push("")}else if(v.length>7)throw new Error("Expression has ".concat(v.length," parts; too many!"));return v},h.prototype.normalize=function(g){var v=this;if(g[3]=g[3].replace("?","*"),g[5]=g[5].replace("?","*"),g[2]=g[2].replace("?","*"),g[0].indexOf("0/")==0&&(g[0]=g[0].replace("0/","*/")),g[1].indexOf("0/")==0&&(g[1]=g[1].replace("0/","*/")),g[2].indexOf("0/")==0&&(g[2]=g[2].replace("0/","*/")),g[3].indexOf("1/")==0&&(g[3]=g[3].replace("1/","*/")),g[4].indexOf("1/")==0&&(g[4]=g[4].replace("1/","*/")),g[6].indexOf("1/")==0&&(g[6]=g[6].replace("1/","*/")),g[5]=g[5].replace(/(^\d)|([^#/\s]\d)/g,function(O){var A=O.replace(/\D/,""),T=A;return v.dayOfWeekStartIndexZero?A=="7"&&(T="0"):T=(parseInt(A)-1).toString(),O.replace(A,T)}),g[5]=="L"&&(g[5]="6"),g[3]=="?"&&(g[3]="*"),g[3].indexOf("W")>-1&&(g[3].indexOf(",")>-1||g[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)g[5]=g[5].replace(new RegExp(w,"gi"),b[w].toString());g[4]=g[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(O){var A=O.replace(/\D/,""),T=A;return v.monthStartIndexZero&&(T=(parseInt(A)+1).toString()),O.replace(A,T)});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 j in S)g[4]=g[4].replace(new RegExp(j,"gi"),S[j].toString());g[0]=="0"&&(g[0]=""),!/\*|\-|\,|\//.test(g[2])&&(/\*|\//.test(g[1])||/\*|\//.test(g[0]))&&(g[2]+="-".concat(g[2]));for(var C=0;C<g.length;C++)if(g[C].indexOf(",")!=-1&&(g[C]=g[C].split(",").filter(function(O){return O!==""}).join(",")||"*"),g[C]=="*/1"&&(g[C]="*"),g[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(g[C])){var E=null;switch(C){case 4:E="12";break;case 5:E="6";break;case 6:E="9999";break;default:E=null;break}if(E!==null){var k=g[C].split("/");g[C]="".concat(k[0],"-").concat(E,"/").concat(k[1])}}},h.prototype.validate=function(g){var v="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(g[0],v),this.validateOnlyExpectedCharactersFound(g[1],v),this.validateOnlyExpectedCharactersFound(g[2],v),this.validateOnlyExpectedCharactersFound(g[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(g[4],v),this.validateOnlyExpectedCharactersFound(g[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(g[6],v),this.validateAnyRanges(g)},h.prototype.validateAnyRanges=function(g){d.default.secondRange(g[0]),d.default.minuteRange(g[1]),d.default.hourRange(g[2]),d.default.dayOfMonthRange(g[3]),d.default.monthRange(g[4],this.monthStartIndexZero),d.default.dayOfWeekRange(g[5],this.dayOfWeekStartIndexZero)},h.prototype.validateOnlyExpectedCharactersFound=function(g,v){var b=g.match(new RegExp("[^".concat(v,"]+"),"gi"));if(b&&b.length)throw new Error("Expression contains invalid values: '".concat(b.toString(),"'"))},h})();l.CronParser=m},333(o,l,u){Object.defineProperty(l,"__esModule",{value:!0}),l.ExpressionDescriptor=void 0;var d=u(823),m=u(949),h=(function(){function g(v,b){if(this.expression=v,this.options=b,this.expressionParts=new Array(5),!this.options.locale&&g.defaultLocale&&(this.options.locale=g.defaultLocale),!g.locales[this.options.locale]){var w=Object.keys(g.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(w,"'.")),this.options.locale=w}this.i18n=g.locales[this.options.locale],b.use24HourTimeFormat===void 0&&(b.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return g.toString=function(v,b){var w=b===void 0?{}:b,S=w.throwExceptionOnParseError,j=S===void 0?!0:S,C=w.verbose,E=C===void 0?!1:C,k=w.dayOfWeekStartIndexZero,O=k===void 0?!0:k,A=w.monthStartIndexZero,T=A===void 0?!1:A,M=w.use24HourTimeFormat,B=w.locale,I=B===void 0?null:B,U=w.logicalAndDayFields,L=U===void 0?!1:U,G={throwExceptionOnParseError:j,verbose:E,dayOfWeekStartIndexZero:O,monthStartIndexZero:T,use24HourTimeFormat:M,locale:I,logicalAndDayFields:L};G.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var z=new g(v,G);return z.getFullDescription()},g.initialize=function(v,b){b===void 0&&(b="en"),g.specialCharacters=["/","-",",","*"],g.defaultLocale=b,v.load(g.locales)},g.prototype.getFullDescription=function(){var v,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=(v=this.i18n).atReboot)===null||b===void 0?void 0:b.call(v))||"Run once, at startup";var j=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),E=this.getMonthDescription(),k=this.getDayOfWeekDescription(),O=this.getYearDescription();w+=j+C+k+E+O,w=this.transformVerbosity(w,!!this.options.verbose),w=w.charAt(0).toLocaleUpperCase()+w.substr(1)}catch(A){if(!this.options.throwExceptionOnParseError)w=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(A)}return w},g.prototype.getTimeOfDayDescription=function(){var v=this.expressionParts[0],b=this.expressionParts[1],w=this.expressionParts[2],S="";if(!d.StringUtilities.containsAny(b,g.specialCharacters)&&!d.StringUtilities.containsAny(w,g.specialCharacters)&&!d.StringUtilities.containsAny(v,g.specialCharacters))S+=this.i18n.atSpace()+this.formatTime(w,b,v);else if(!v&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!d.StringUtilities.containsAny(w,g.specialCharacters)){var j=b.split("-");S+=d.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(w,j[0],""),this.formatTime(w,j[1],""))}else if(!v&&w.indexOf(",")>-1&&w.indexOf("-")==-1&&w.indexOf("/")==-1&&!d.StringUtilities.containsAny(b,g.specialCharacters)){var C=w.split(",");S+=this.i18n.at();for(var E=0;E<C.length;E++)S+=" ",S+=this.formatTime(C[E],b,""),E<C.length-2&&(S+=","),E==C.length-2&&(S+=this.i18n.spaceAnd())}else{var k=this.getSecondsDescription(),O=this.getMinutesDescription(),A=this.getHoursDescription();if(S+=k,S&&O&&(S+=", "),S+=O,O===A)return S;S&&A&&(S+=", "),S+=A}return S},g.prototype.getSecondsDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(w){return w},function(w){return d.StringUtilities.format(v.i18n.everyX0Seconds(w),w)},function(w){return v.i18n.secondsX0ThroughX1PastTheMinute()},function(w){return w=="0"?"":parseInt(w)<20?v.i18n.atX0SecondsPastTheMinute(w):v.i18n.atX0SecondsPastTheMinuteGt20()||v.i18n.atX0SecondsPastTheMinute(w)});return b},g.prototype.getMinutesDescription=function(){var v=this,b=this.expressionParts[0],w=this.expressionParts[2],S=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(j){return j},function(j){return d.StringUtilities.format(v.i18n.everyX0Minutes(j),j)},function(j){return v.i18n.minutesX0ThroughX1PastTheHour()},function(j){var C,E;try{return j=="0"&&w.indexOf("/")==-1&&b==""?v.i18n.everyHour():j=="0"?((E=(C=v.i18n).onTheHour)===null||E===void 0?void 0:E.call(C))||v.i18n.atX0MinutesPastTheHour(j):parseInt(j)<20?v.i18n.atX0MinutesPastTheHour(j):v.i18n.atX0MinutesPastTheHourGt20()||v.i18n.atX0MinutesPastTheHour(j)}catch{return v.i18n.atX0MinutesPastTheHour(j)}});return S},g.prototype.getHoursDescription=function(){var v=this,b=this.expressionParts[2],w=0,S=[];b.split("/")[0].split(",").forEach(function(E){var k=E.split("-");k.length===2&&S.push({value:k[1],index:w+1}),w+=k.length});var j=0,C=this.getSegmentDescription(b,this.i18n.everyHour(),function(E){var k=S.find(function(A){return A.value===E&&A.index===j}),O=k&&v.expressionParts[1]!=="0";return j++,O?v.formatTime(E,"59",""):v.formatTime(E,"0","")},function(E){return d.StringUtilities.format(v.i18n.everyX0Hours(E),E)},function(E){return v.i18n.betweenX0AndX1()},function(E){return v.i18n.atX0()});return C},g.prototype.getDayOfWeekDescription=function(){var v=this,b=this.i18n.daysOfTheWeek(),w=null;return this.expressionParts[5]=="*"?w="":w=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(S,j){var C=S;S.indexOf("#")>-1?C=S.substring(0,S.indexOf("#")):S.indexOf("L")>-1&&(C=C.replace("L",""));var E=parseInt(C),k=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(j)[E]:b[E];if(S.indexOf("#")>-1){var O=null,A=S.substring(S.indexOf("#")+1),T=S.substring(0,S.indexOf("#"));switch(A){case"1":O=v.i18n.first(T);break;case"2":O=v.i18n.second(T);break;case"3":O=v.i18n.third(T);break;case"4":O=v.i18n.fourth(T);break;case"5":O=v.i18n.fifth(T);break}k=O+" "+k}return k},function(S){return parseInt(S)==1?"":d.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(S),S)},function(S){var j=S.substring(0,S.indexOf("-")),C=v.expressionParts[3]!="*";return C?v.i18n.commaAndX0ThroughX1(j):v.i18n.commaX0ThroughX1(j)},function(S){var j=null;if(S.indexOf("#")>-1){var C=S.substring(S.indexOf("#")+1),E=S.substring(0,S.indexOf("#"));j=v.i18n.commaOnThe(C,E).trim()+v.i18n.spaceX0OfTheMonth()}else if(S.indexOf("L")>-1)j=v.i18n.commaOnTheLastX0OfTheMonth(S.replace("L",""));else{var k=v.expressionParts[3]!="*";k?v.options.logicalAndDayFields?j=v.i18n.commaOnlyOnX0(S):j=v.i18n.commaAndOnX0():j=v.i18n.commaOnlyOnX0(S)}return j}),w},g.prototype.getMonthDescription=function(){var v=this,b=this.i18n.monthsOfTheYear(),w=this.getSegmentDescription(this.expressionParts[4],"",function(S,j){return j&&v.i18n.monthsOfTheYearInCase?v.i18n.monthsOfTheYearInCase(j)[parseInt(S)-1]:b[parseInt(S)-1]},function(S){return parseInt(S)==1?"":d.StringUtilities.format(v.i18n.commaEveryX0Months(S),S)},function(S){return v.i18n.commaMonthX0ThroughMonthX1()||v.i18n.commaX0ThroughX1()},function(S){return v.i18n.commaOnlyInMonthX0?v.i18n.commaOnlyInMonthX0():v.i18n.commaOnlyInX0()});return w},g.prototype.getDayOfMonthDescription=function(){var v=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 j=parseInt(S[0].replace("W","")),C=j==1?this.i18n.firstWeekday():d.StringUtilities.format(this.i18n.weekdayNearestDayX0(),j.toString());b=d.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var E=w.match(/L-(\d{1,2})/);if(E){var k=E[1];b=d.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(k),k);break}else{if(w=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(w,this.i18n.commaEveryDay(),function(O){return O=="L"?v.i18n.lastDay():v.i18n.dayX0?d.StringUtilities.format(v.i18n.dayX0(),O):O},function(O){return O=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(O)},function(O){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(O)},function(O){return v.i18n.commaOnDayX0OfTheMonth(O)})}break}}return b},g.prototype.getYearDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(w){return/^\d+$/.test(w)?new Date(parseInt(w),1).getFullYear().toString():w},function(w){return d.StringUtilities.format(v.i18n.commaEveryX0Years(w),w)},function(w){return v.i18n.commaYearX0ThroughYearX1()||v.i18n.commaX0ThroughX1()},function(w){return v.i18n.commaOnlyInYearX0?v.i18n.commaOnlyInYearX0():v.i18n.commaOnlyInX0()});return b},g.prototype.getSegmentDescription=function(v,b,w,S,j,C){var E=null,k=v.indexOf("/")>-1,O=v.indexOf("-")>-1,A=v.indexOf(",")>-1;if(!v)E="";else if(v==="*")E=b;else if(!k&&!O&&!A)E=d.StringUtilities.format(C(v),w(v));else if(A){for(var T=v.split(","),M="",B=0;B<T.length;B++)if(B>0&&T.length>2&&(M+=",",B<T.length-1&&(M+=" ")),B>0&&T.length>1&&(B==T.length-1||T.length==2)&&(M+="".concat(this.i18n.spaceAnd()," ")),T[B].indexOf("/")>-1||T[B].indexOf("-")>-1){var I=T[B].indexOf("-")>-1&&T[B].indexOf("/")==-1,U=this.getSegmentDescription(T[B],b,w,S,I?this.i18n.commaX0ThroughX1:j,C);I&&(U=U.replace(", ","")),M+=U}else if(!k)M+=w(T[B]);else{var L=this.getSegmentDescription(T[B],b,w,S,j,C);L&&L.startsWith(", ")&&(L=L.substring(2)),M+=L}k?E=M:E=d.StringUtilities.format(C(v),M)}else if(k){var T=v.split("/");if(E=d.StringUtilities.format(S(T[1]),T[1]),T[0].indexOf("-")>-1){var G=this.generateRangeSegmentDescription(T[0],j,w);G.indexOf(", ")!=0&&(E+=", "),E+=G}else if(T[0].indexOf("*")==-1){var z=d.StringUtilities.format(C(T[0]),w(T[0]));z=z.replace(", ",""),E+=d.StringUtilities.format(this.i18n.commaStartingX0(),z)}}else O&&(E=this.generateRangeSegmentDescription(v,j,w));return E},g.prototype.generateRangeSegmentDescription=function(v,b,w){var S="",j=v.split("-"),C=w(j[0],1),E=w(j[1],2),k=b(v);return S+=d.StringUtilities.format(k,C,E),S},g.prototype.formatTime=function(v,b,w){var S=0,j=0,C=parseInt(v)+S,E=parseInt(b)+j;E>=60?(E-=60,C+=1):E<0&&(E+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var k="",O=!1;this.options.use24HourTimeFormat||(O=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),k=O?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var A="";return w&&(A=":".concat(("00"+w).substring(w.length))),"".concat(O?k:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+E.toString()).substring(E.toString().length)).concat(A).concat(O?"":k)},g.prototype.transformVerbosity=function(v,b){if(!b&&(v=v.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),v=v.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),v=v.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),v=v.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var w=0,S=Object.entries(this.i18n.conciseVerbosityReplacements());w<S.length;w++){var j=S[w],C=j[0],E=j[1];v=v.replace(new RegExp(C,"g"),E)}return v},g.prototype.getPeriod=function(v){return v>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},g.locales={},g})();l.ExpressionDescriptor=h},747(o,l,u){Object.defineProperty(l,"__esModule",{value:!0}),l.enLocaleLoader=void 0;var d=u(486),m=(function(){function h(){}return h.prototype.load=function(g){g.en=new d.en},h})();l.enLocaleLoader=m},486(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.en=void 0;var u=(function(){function d(){}return d.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},d.prototype.atX0MinutesPastTheHourGt20=function(){return null},d.prototype.commaMonthX0ThroughMonthX1=function(){return null},d.prototype.commaYearX0ThroughYearX1=function(){return null},d.prototype.use24HourTimeFormatByDefault=function(){return!1},d.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},d.prototype.everyMinute=function(){return"every minute"},d.prototype.everyHour=function(){return"every hour"},d.prototype.atSpace=function(){return"At "},d.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},d.prototype.at=function(){return"At"},d.prototype.spaceAnd=function(){return" and"},d.prototype.everySecond=function(){return"every second"},d.prototype.everyX0Seconds=function(){return"every %s seconds"},d.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},d.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},d.prototype.everyX0Minutes=function(){return"every %s minutes"},d.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},d.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},d.prototype.everyX0Hours=function(){return"every %s hours"},d.prototype.betweenX0AndX1=function(){return"between %s and %s"},d.prototype.atX0=function(){return"at %s"},d.prototype.commaEveryDay=function(){return", every day"},d.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},d.prototype.commaX0ThroughX1=function(){return", %s through %s"},d.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},d.prototype.first=function(){return"first"},d.prototype.second=function(){return"second"},d.prototype.third=function(){return"third"},d.prototype.fourth=function(){return"fourth"},d.prototype.fifth=function(){return"fifth"},d.prototype.commaOnThe=function(){return", on the "},d.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},d.prototype.lastDay=function(){return"the last day"},d.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},d.prototype.commaOnlyOnX0=function(){return", only on %s"},d.prototype.commaAndOnX0=function(){return", and on %s"},d.prototype.commaEveryX0Months=function(){return", every %s months"},d.prototype.commaOnlyInX0=function(){return", only in %s"},d.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},d.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},d.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},d.prototype.firstWeekday=function(){return"first weekday"},d.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},d.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},d.prototype.commaEveryX0Days=function(){return", every %s days in a month"},d.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},d.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},d.prototype.commaEveryHour=function(){return", every hour"},d.prototype.commaEveryX0Years=function(){return", every %s years"},d.prototype.commaStartingX0=function(){return", starting %s"},d.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},d.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},d.prototype.atReboot=function(){return"Run once, at startup"},d.prototype.onTheHour=function(){return"on the hour"},d})();l.en=u},515(o,l){Object.defineProperty(l,"__esModule",{value:!0});function u(m,h){if(!m)throw new Error(h)}var d=(function(){function m(){}return m.secondRange=function(h){for(var g=h.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);u(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},m.minuteRange=function(h){for(var g=h.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);u(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},m.hourRange=function(h){for(var g=h.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);u(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},m.dayOfMonthRange=function(h){for(var g=h.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);u(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},m.monthRange=function(h,g){for(var v=h.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var w=parseInt(v[b],10);u(w>=1&&w<=12,g?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},m.dayOfWeekRange=function(h,g){for(var v=h.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var w=parseInt(v[b],10);u(w>=0&&w<=6,g?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},m})();l.default=d},823(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.StringUtilities=void 0;var u=(function(){function d(){}return d.format=function(m){for(var h=[],g=1;g<arguments.length;g++)h[g-1]=arguments[g];return m.replace(/%s/g,function(v){return h.shift()})},d.containsAny=function(m,h){return h.some(function(g){return m.indexOf(g)>-1})},d})();l.StringUtilities=u}},r={};function i(o){var l=r[o];if(l!==void 0)return l.exports;var u=r[o]={exports:{}};return n[o](u,u.exports,i),u.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.toString=void 0;var l=i(333),u=i(747);l.ExpressionDescriptor.initialize(new u.enLocaleLoader),o.default=l.ExpressionDescriptor;var d=l.ExpressionDescriptor.toString;o.toString=d})(),a})())})(s_)),s_.exports}var N$e=C$e();const uG=Gi(N$e);function dG(e){return Pn({queryKey:e?[...Pe.schedules.all,e]:Pe.schedules.all,queryFn:()=>Ae.get(e?`/schedules?type=${e}`:"/schedules")})}function k$e(e=1,t=20){return Pn({queryKey:[...Pe.schedules.runs,e,t],queryFn:()=>Ae.get(`/schedules/runs?page=${e}&per_page=${t}`)})}function A$e(){const e=Qe();return ut({mutationFn:t=>Ae.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function O$e(){const e=Qe();return ut({mutationFn:t=>Ae.post("/schedules/one-time",t),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function T$e(){const e=Qe();return ut({mutationFn:({id:t,...n})=>Ae.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function fG(){const e=Qe();return ut({mutationFn:t=>Ae.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function hG(){const e=Qe();return ut({mutationFn:({id:t,enable:n})=>Ae.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all})}})}function P$e(){const e=Qe();return ut({mutationFn:t=>Ae.post(`/schedules/${t}/trigger`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.all}),e.invalidateQueries({queryKey:Pe.schedules.runs})}})}function M$e(){const e=Qe();return ut({mutationFn:t=>Ae.post(`/schedules/runs/${t}/rerun`),onSuccess:()=>{e.invalidateQueries({queryKey:Pe.schedules.runs})}})}const R$e=[{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:"Weekdays at 10am",value:"0 10 * * 1-5"},{label:"Weekly Monday 9am",value:"0 9 * * 1"}];function D$e({open:e,onOpenChange:t,editing:n}){const{data:r}=Ff(),i=A$e(),a=T$e(),o=eb(),l=tb(),[u,d]=y.useState(""),[m,h]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,E]=y.useState(""),[k,O]=y.useState(!0),[A,T]=y.useState("none"),[M,B]=y.useState(!1),I=n?n.project_id:m?Number(m):-1,U=I===0,{data:L}=Vf(I),{data:G}=Bp(I),{data:z}=Uf(),K=y.useMemo(()=>I===0?(z??[]).map($=>({id:$.id,title:$.title})):((G==null?void 0:G.items)??[]).map($=>({id:$.id,title:$.title})),[I,G,z]),P=y.useMemo(()=>(L??[]).filter($=>$.type==="roles").map($=>$.name),[L]);y.useEffect(()=>{j(U?"imu":"")},[U]),y.useEffect(()=>{e&&n?(d(n.name),h(String(n.project_id)),v(n.task),w(n.cron_expr?iU(n.cron_expr):""),j(n.role??""),E(n.system_prompt??""),O(n.skip_if_running),T(n.conversation_id?String(n.conversation_id):"none")):e&&!n&&H()},[e,n]);function H(){d(""),h(""),v(""),w(""),j(""),E(""),O(!0),T("none"),B(!1)}async function Y($){$.preventDefault();try{let F=null;const Q=n?n.project_id:Number(m);A==="new"?Q===0?F=(await l.mutateAsync()).id:F=(await o.mutateAsync({project_id:Q,title:u.trim()||void 0})).id:A!=="none"&&(F=Number(A));const Z={name:u.trim(),task:g.trim(),cron_expr:Hoe(b.trim()),role:S.trim()||void 0,system_prompt:C.trim()||void 0,skip_if_running:k,conversation_id:F};n?await a.mutateAsync({id:n.id,...Z}):await i.mutateAsync({...Z,project_id:Q}),H(),t(!1)}catch{}}const V=y.useMemo(()=>{if(!b.trim())return null;try{return uG.toString(b.trim())}catch{return null}},[b]),D=i.isPending||a.isPending||o.isPending||l.isPending,q=i.error||a.error;return f.jsx(Qi,{open:e,onOpenChange:t,children:f.jsxs(Zi,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[f.jsx(Ji,{children:f.jsx(ea,{children:n?"Edit Schedule":"Create Schedule"})}),f.jsxs("form",{onSubmit:Y,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"sched-name",children:["Name ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(Ze,{id:"sched-name",value:u,onChange:$=>d($.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"sched-project",children:["Project ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(ja,{value:m,onValueChange:h,required:!0,children:[f.jsx(_a,{id:"sched-project",children:f.jsx(Ea,{placeholder:"Select a project"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"0",children:"Imu"}),(r??[]).map($=>f.jsx(hn,{value:String($.id),children:$.display_name},$.id))]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"sched-task",children:["Task ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(No,{id:"sched-task",value:g,onChange:$=>v($.target.value),placeholder:"What should the agent do each time this runs?",required:!0,rows:3})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs(lt,{htmlFor:"sched-cron",children:["Cron Expression ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(qp,{children:[f.jsx(Vp,{asChild:!0,children:f.jsxs(pe,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",f.jsx(fu,{className:"ml-1 h-3 w-3"})]})}),f.jsx(Kp,{align:"end",children:R$e.map($=>f.jsxs(By,{onClick:()=>w($.value),children:[f.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:$.value}),$.label]},$.value))})]})]}),f.jsx(Ze,{id:"sched-cron",value:b,onChange:$=>w($.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),V&&f.jsx("p",{className:"text-xs text-muted-foreground",children:V})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"sched-role",children:"Role"}),f.jsx(Ze,{id:"sched-role",value:S,onChange:$=>j($.target.value),placeholder:P[0]??"orchestrator",list:"sched-role-list",disabled:U}),f.jsx("datalist",{id:"sched-role-list",children:P.map($=>f.jsx("option",{value:$},$))}),!U&&S.trim()&&P.length>0&&!P.includes(S.trim())&&f.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),f.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:k,onChange:$=>O($.target.checked),className:"rounded border-input"}),f.jsx("span",{className:"text-sm",children:"Skip if already running"}),f.jsx("span",{className:"text-xs text-muted-foreground",children:"— don't start a new session while a previous one is still active"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"sched-conversation",children:"Conversation"}),f.jsxs(ja,{value:A,onValueChange:T,children:[f.jsx(_a,{id:"sched-conversation",children:f.jsx(Ea,{placeholder:"No conversation"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"none",children:"No conversation"}),f.jsx(hn,{value:"new",children:"Create new conversation"}),K.map($=>f.jsx(hn,{value:String($.id),children:$.title||`Conversation #${$.id}`},$.id))]})]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:A==="none"?"Each run starts a standalone session.":A==="new"?"A new conversation will be created — all runs share it.":"All runs continue this conversation's context."})]}),f.jsxs(Yp,{open:M,onOpenChange:B,children:[f.jsx(Xp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[f.jsx(fu,{className:`h-3 w-3 transition-transform ${M?"rotate-180":""}`}),"Advanced Options"]})}),f.jsx(Gp,{className:"space-y-4 pt-2",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"sched-prompt",children:"System Prompt"}),f.jsx(No,{id:"sched-prompt",value:C,onChange:$=>E($.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),q&&f.jsx("p",{className:"text-sm text-destructive",children:q.message}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(pe,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(pe,{type:"submit",disabled:D||!!S.trim()&&P.length>0&&!P.includes(S.trim()),children:D?"Saving...":n?"Update":"Create"})]})]})]})})}function I$e(e){if(!e)return"—";try{return uG.toString(iU(e))}catch{return e}}function B$(e){if(!e)return"—";try{const t=new Date(e),n=new Date,r=t.getTime()-n.getTime(),i=Math.abs(r);if(i<6e4)return r>0?"in < 1m":"< 1m ago";if(i<36e5){const a=Math.round(i/6e4);return r>0?`in ${a}m`:`${a}m ago`}if(i<864e5){const a=Math.round(i/36e5);return r>0?`in ${a}h`:`${a}h ago`}return t.toLocaleDateString()}catch{return"—"}}function L$e(e){if(!e)return"—";try{return new Date(e).toLocaleString(void 0,{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return"—"}}function z$e({schedule:e}){return e.enabled?e.last_error?f.jsx(Tk,{children:f.jsxs(aU,{children:[f.jsx(oU,{children:f.jsx(mt,{variant:"destructive",children:"Error"})}),f.jsx(sU,{className:"max-w-xs",children:f.jsx("p",{className:"text-xs",children:e.last_error})})]})}):f.jsx(mt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):f.jsx(mt,{variant:"secondary",children:"Disabled"})}function $$e(){const{data:e,isLoading:t,error:n}=dG("recurring"),[r,i]=y.useState(!1),[a,o]=y.useState(null),l=fG(),u=hG(),d=P$e(),[m,h]=y.useState(null);if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsx(en,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",n.message]})]});const g=e??[];return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Recurring Schedules"}),f.jsxs(pe,{onClick:()=>{o(null),i(!0)},children:[f.jsx(mu,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),g.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[f.jsx("p",{className:"text-muted-foreground",children:"No recurring schedules yet."}),f.jsxs(pe,{variant:"outline",className:"mt-4",onClick:()=>{o(null),i(!0)},children:[f.jsx(mu,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):f.jsx("div",{className:"rounded-lg border",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Schedule"}),f.jsx(Re,{children:"Next Run"}),f.jsx(Re,{children:"Last Run"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{className:"w-[120px]",children:"Actions"})]})}),f.jsx(qi,{children:g.map(v=>f.jsxs(sn,{children:[f.jsx(Me,{className:"font-medium",children:v.name}),f.jsx(Me,{className:"text-muted-foreground",children:v.project_name}),f.jsx(Me,{className:"text-sm",children:I$e(v.cron_expr)}),f.jsxs(Me,{className:"text-sm text-muted-foreground",children:[f.jsx("span",{children:L$e(v.next_run_at)}),f.jsxs("span",{className:"ml-1 text-xs opacity-60",children:["(",B$(v.next_run_at),")"]})]}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:B$(v.last_run_at)}),f.jsx(Me,{children:f.jsx(z$e,{schedule:v})}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-1",children:[m===v.id?f.jsxs(f.Fragment,{children:[f.jsx(pe,{size:"sm",variant:"default",onClick:()=>{d.mutate(v.id,{onSettled:()=>h(null)})},disabled:d.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>h(null),children:"No"})]}):f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>h(v.id),title:"Run Now",children:f.jsx(_le,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{o(v),i(!0)},children:f.jsx(Bf,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u.mutate({id:v.id,enable:!v.enabled}),children:v.enabled?f.jsx(xU,{className:"h-3.5 w-3.5"}):f.jsx($p,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${v.name}"?`)&&l.mutate(v.id)},children:f.jsx(Pa,{className:"h-3.5 w-3.5"})})]})})]},v.id))})]})}),f.jsx(D$e,{open:r,onOpenChange:i,editing:a})]})}function B$e({open:e,onOpenChange:t}){const{data:n}=Ff(),r=O$e(),i=eb(),a=tb(),[o,l]=y.useState(""),[u,d]=y.useState(""),[m,h]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,E]=y.useState("none"),[k,O]=y.useState(!1),A=u?Number(u):-1,T=A===0,{data:M}=Vf(A),{data:B}=Bp(A),{data:I}=Uf(),U=y.useMemo(()=>A===0?(I??[]).map(P=>({id:P.id,title:P.title})):((B==null?void 0:B.items)??[]).map(P=>({id:P.id,title:P.title})),[A,B,I]),L=y.useMemo(()=>(M??[]).filter(P=>P.type==="roles").map(P=>P.name),[M]);y.useEffect(()=>{w(T?"imu":"")},[T]),y.useEffect(()=>{e&&G()},[e]);function G(){l(""),d(""),h(""),v(""),w(""),j(""),E("none"),O(!1)}async function z(P){P.preventDefault();try{const H=Number(u);let Y=null;C==="new"?H===0?Y=(await a.mutateAsync()).id:Y=(await i.mutateAsync({project_id:H,title:o.trim()||void 0})).id:C!=="none"&&(Y=Number(C));const V=new Date(g);await r.mutateAsync({name:o.trim(),project_id:H,task:m.trim(),run_at:V.toISOString(),role:b.trim()||void 0,system_prompt:S.trim()||void 0,conversation_id:Y}),G(),t(!1)}catch{}}const K=y.useMemo(()=>{const P=new Date(Date.now()+6e4);return P.setSeconds(0,0),P.toISOString().slice(0,16)},[e]);return f.jsx(Qi,{open:e,onOpenChange:t,children:f.jsxs(Zi,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[f.jsx(Ji,{children:f.jsx(ea,{children:"Create One-Time Schedule"})}),f.jsxs("form",{onSubmit:z,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"ot-name",children:["Name ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(Ze,{id:"ot-name",value:o,onChange:P=>l(P.target.value),placeholder:"e.g. deploy-tonight",required:!0,autoFocus:!0})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"ot-project",children:["Project ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs(ja,{value:u,onValueChange:d,required:!0,children:[f.jsx(_a,{id:"ot-project",children:f.jsx(Ea,{placeholder:"Select a project"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"0",children:"Imu"}),(n??[]).map(P=>f.jsx(hn,{value:String(P.id),children:P.display_name},P.id))]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"ot-task",children:["Task ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(No,{id:"ot-task",value:m,onChange:P=>h(P.target.value),placeholder:"What should the agent do?",required:!0,rows:3})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs(lt,{htmlFor:"ot-run-at",children:["Run At ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx(Ze,{id:"ot-run-at",type:"datetime-local",value:g,onChange:P=>v(P.target.value),min:K,required:!0}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Schedule will fire once at this time and then auto-disable."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"ot-role",children:"Role"}),f.jsx(Ze,{id:"ot-role",value:b,onChange:P=>w(P.target.value),placeholder:L[0]??"orchestrator",list:"ot-role-list",disabled:T}),f.jsx("datalist",{id:"ot-role-list",children:L.map(P=>f.jsx("option",{value:P},P))}),!T&&b.trim()&&L.length>0&&!L.includes(b.trim())&&f.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"ot-conversation",children:"Conversation"}),f.jsxs(ja,{value:C,onValueChange:E,children:[f.jsx(_a,{id:"ot-conversation",children:f.jsx(Ea,{placeholder:"No conversation"})}),f.jsxs(Ca,{children:[f.jsx(hn,{value:"none",children:"No conversation"}),f.jsx(hn,{value:"new",children:"Create new conversation"}),U.map(P=>f.jsx(hn,{value:String(P.id),children:P.title||`Conversation #${P.id}`},P.id))]})]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:C==="none"?"Starts a standalone session.":C==="new"?"A new conversation will be created for this run.":"Continues this conversation's context."})]}),f.jsxs(Yp,{open:k,onOpenChange:O,children:[f.jsx(Xp,{asChild:!0,children:f.jsxs(pe,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[f.jsx(fu,{className:`h-3 w-3 transition-transform ${k?"rotate-180":""}`}),"Advanced Options"]})}),f.jsx(Gp,{className:"space-y-4 pt-2",children:f.jsxs("div",{className:"space-y-2",children:[f.jsx(lt,{htmlFor:"ot-prompt",children:"System Prompt"}),f.jsx(No,{id:"ot-prompt",value:S,onChange:P=>j(P.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),r.error&&f.jsx("p",{className:"text-sm text-destructive",children:r.error.message}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(pe,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(pe,{type:"submit",disabled:r.isPending||i.isPending||a.isPending||!!b.trim()&&L.length>0&&!L.includes(b.trim()),children:r.isPending?"Creating...":"Create"})]})]})]})})}function F$(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function F$e({schedule:e}){return!e.enabled&&e.last_run_at?f.jsx(mt,{variant:"secondary",children:"Fired"}):e.enabled?e.last_error?f.jsx(Tk,{children:f.jsxs(aU,{children:[f.jsx(oU,{children:f.jsx(mt,{variant:"destructive",children:"Error"})}),f.jsx(sU,{className:"max-w-xs",children:f.jsx("p",{className:"text-xs",children:e.last_error})})]})}):f.jsx(mt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Pending"}):f.jsx(mt,{variant:"secondary",children:"Disabled"})}function U$e(){const{data:e,isLoading:t,error:n}=dG("one_time"),[r,i]=y.useState(!1),a=fG(),o=hG();if(t)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsx(en,{className:"h-64 rounded-lg"})]});if(n)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",n.message]})]});const l=e??[];return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"One-Time Schedules"}),f.jsxs(pe,{onClick:()=>i(!0),children:[f.jsx(mu,{className:"mr-2 h-4 w-4"}),"Create One-Time Schedule"]})]}),l.length===0?f.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[f.jsx("p",{className:"text-muted-foreground",children:"No one-time schedules yet."}),f.jsxs(pe,{variant:"outline",className:"mt-4",onClick:()=>i(!0),children:[f.jsx(mu,{className:"mr-2 h-4 w-4"}),"Create your first one-time schedule"]})]}):f.jsx("div",{className:"rounded-lg border",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Scheduled For"}),f.jsx(Re,{children:"Last Run"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{className:"w-[100px]",children:"Actions"})]})}),f.jsx(qi,{children:l.map(u=>f.jsxs(sn,{children:[f.jsx(Me,{className:"font-medium",children:u.name}),f.jsx(Me,{className:"text-muted-foreground",children:u.project_name}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:F$(u.run_at)}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:F$(u.last_run_at)}),f.jsx(Me,{children:f.jsx(F$e,{schedule:u})}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o.mutate({id:u.id,enable:!u.enabled}),children:u.enabled?f.jsx(xU,{className:"h-3.5 w-3.5"}):f.jsx($p,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${u.name}"?`)&&a.mutate(u.id)},children:f.jsx(Pa,{className:"h-3.5 w-3.5"})})]})})]},u.id))})]})}),f.jsx(B$e,{open:r,onOpenChange:i})]})}function H$e(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function q$e(e){if(e==null)return"—";if(e<1e3)return`${e}ms`;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 V$e({status:e}){switch(e){case"completed":return f.jsx(mt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Completed"});case"running":case"starting":return f.jsx(mt,{className:"bg-blue-600 hover:bg-blue-600",children:"Running"});case"failed":return f.jsx(mt,{variant:"destructive",children:"Failed"});default:return f.jsx(mt,{variant:"secondary",children:e})}}function K$e({type:e}){return f.jsx(mt,{variant:"outline",className:"text-xs",children:e==="one_time"?"One-Time":"Recurring"})}function Y$e(e){return`/projects/${e.project_id}/sessions/${e.run_id}`}function X$e(e){return e.schedule_type==="one_time"?"/schedules/one-time":"/schedules/recurring"}function G$e(){const[e,t]=y.useState(1),{data:n,isLoading:r,error:i}=k$e(e),a=to(),o=M$e(),[l,u]=y.useState(null);if(r)return f.jsxs("div",{className:"space-y-6",children:[f.jsx(en,{className:"h-8 w-48"}),f.jsx(en,{className:"h-64 rounded-lg"})]});if(i)return f.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[f.jsx(Sa,{className:"h-4 w-4"}),f.jsxs("span",{children:["Error: ",i.message]})]});const d=(n==null?void 0:n.items)??[],m=n?Math.ceil(n.total/n.per_page):0;return f.jsxs("div",{className:"space-y-6",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Run History"}),(n==null?void 0:n.total)===0?f.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[f.jsx("p",{className:"text-muted-foreground",children:"No schedule runs yet."}),f.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sessions triggered by schedules will appear here."})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"rounded-lg border",children:f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Schedule"}),f.jsx(Re,{children:"Type"}),f.jsx(Re,{children:"Project"}),f.jsx(Re,{children:"Status"}),f.jsx(Re,{children:"Started"}),f.jsx(Re,{children:"Duration"}),f.jsx(Re,{className:"w-[100px]",children:"Actions"})]})}),f.jsx(qi,{children:d.map(h=>f.jsxs(sn,{children:[f.jsx(Me,{className:"font-medium",children:f.jsx(dr,{to:Y$e(h),className:"hover:underline text-foreground",children:h.schedule_name})}),f.jsx(Me,{children:f.jsx(K$e,{type:h.schedule_type})}),f.jsx(Me,{className:"text-muted-foreground",children:h.project_name}),f.jsx(Me,{children:f.jsx(V$e,{status:h.status})}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:H$e(h.started_at)}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:q$e(h.duration_ms)}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-1",children:[l===h.run_id?f.jsxs(f.Fragment,{children:[f.jsx(pe,{size:"sm",variant:"default",onClick:()=>{o.mutate(h.run_id,{onSettled:()=>u(null)})},disabled:o.isPending,children:"Confirm"}),f.jsx(pe,{size:"sm",variant:"outline",onClick:()=>u(null),children:"No"})]}):f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u(h.run_id),title:"Re-run",children:f.jsx(lle,{className:"h-3.5 w-3.5"})}),f.jsx(pe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a(X$e(h)),title:"View Schedule",children:f.jsx(dU,{className:"h-3.5 w-3.5"})})]})})]},h.run_id))})]})}),f.jsx(Vk,{page:e,totalPages:m,onPageChange:t})]})]})}function W$e(){return Pn({queryKey:Pe.config.global,queryFn:()=>Ae.get("/config/global")})}function Q$e(){const e=Qe();return ut({mutationFn:t=>Ae.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(Pe.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:Pe.config.global})}})}function Z$e(){const e=Qe();return ut({mutationFn:({projectId:t,data:n})=>Ae.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData(Pe.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:Pe.projects.config(n.projectId)})}})}function l_(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},i=e.trace??{};return{runtime:Oi(e.runtime),memory:Oi(e.memory),orchestrator_role:Oi(t.role),orchestrator_permission_mode:Oi(t.permission_mode),policy_max_depth:Oi(n.max_depth),policy_agent_timeout:Oi(n.agent_timeout),policy_max_delegate_retries:Oi(n.max_delegate_retries),policy_cache_delegations:Oi(n.cache_delegations),policy_cache_max_entries:Oi(n.cache_max_entries),policy_cache_ttl_seconds:Oi(n.cache_ttl_seconds),policy_max_num_delegations:Oi(n.max_num_delegations),session_pull_before_session:Oi(r.pull_before_session),trace_enabled:Oi(i.enabled)}}function Oi(e){return e==null?"":String(e)}function J$e(e){const t={};e.runtime&&(t.runtime=e.runtime),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 i={};e.session_pull_before_session&&(i.pull_before_session=e.session_pull_before_session),Object.keys(i).length>0&&(t.session=i);const a={};return e.trace_enabled&&(a.enabled=e.trace_enabled==="true"),Object.keys(a).length>0&&(t.trace=a),t}const eBe=["default","plan","bypassPermissions"],tBe=["prompt","always","never"],U$=["true","false"],c_="__empty__";function H$({values:e,placeholders:t,onSave:n,saving:r}){const[i,a]=y.useState(l_(e)),{data:o}=eu("agents"),{data:l}=eu("roles"),{data:u}=eu("memories"),d=t?l_(t):void 0,m=JSON.stringify(e);y.useEffect(()=>{a(l_(e))},[m]);const h=O=>A=>a(T=>({...T,[O]:A})),g=()=>{n(J$e(i))},v=(o??[]).map(O=>O.name),b=(l??[]).map(O=>O.name),w=new Set((u??[]).map(O=>O.name));w.add("none");const S=[...w].sort(),j=i.runtime&&v.length>0&&!v.includes(i.runtime)?"Runtime not found in installed agents":"",C=i.orchestrator_role&&b.length>0&&!b.includes(i.orchestrator_role)?"Role not found in installed roles":"",E=i.memory&&!S.includes(i.memory)?"Memory not found in installed providers":"",k=!!j||!!C||!!E;return f.jsxs("div",{className:"flex flex-col gap-6",children:[f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"General"}),f.jsx(_l,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs(Ti,{label:"Runtime",children:[f.jsx(Ze,{list:"cfg-dl-runtime",value:i.runtime,onChange:O=>h("runtime")(O.target.value),placeholder:(d==null?void 0:d.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),v.length>0&&f.jsx("datalist",{id:"cfg-dl-runtime",children:v.map(O=>f.jsx("option",{value:O},O))}),j&&f.jsx("p",{className:"text-xs text-destructive",children:j})]}),f.jsxs(Ti,{label:"Memory",children:[f.jsx(Ze,{list:"cfg-dl-memory",value:i.memory,onChange:O=>h("memory")(O.target.value),placeholder:(d==null?void 0:d.memory)||"dial",className:"h-8 text-xs"}),f.jsx("datalist",{id:"cfg-dl-memory",children:S.map(O=>f.jsx("option",{value:O},O))}),E&&f.jsx("p",{className:"text-xs text-destructive",children:E})]})]})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),f.jsx(_l,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[f.jsxs(Ti,{label:"Role",children:[f.jsx(Ze,{list:"cfg-dl-role",value:i.orchestrator_role,onChange:O=>h("orchestrator_role")(O.target.value),placeholder:(d==null?void 0:d.orchestrator_role)||"ai-ceo",className:"h-8 text-xs"}),b.length>0&&f.jsx("datalist",{id:"cfg-dl-role",children:b.map(O=>f.jsx("option",{value:O},O))}),C&&f.jsx("p",{className:"text-xs text-destructive",children:C})]}),f.jsx(Ti,{label:"Permission Mode",children:f.jsx(Py,{value:i.orchestrator_permission_mode,onChange:h("orchestrator_permission_mode"),options:eBe,placeholder:(d==null?void 0:d.orchestrator_permission_mode)||"default",allowEmpty:!0})})]})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Policy"}),f.jsx(_l,{}),f.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[f.jsx(Ti,{label:"Max Depth",children:f.jsx(Ze,{type:"number",value:i.policy_max_depth,onChange:O=>h("policy_max_depth")(O.target.value),placeholder:(d==null?void 0:d.policy_max_depth)||"3",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Agent Timeout (seconds)",children:f.jsx(Ze,{type:"number",value:i.policy_agent_timeout,onChange:O=>h("policy_agent_timeout")(O.target.value),placeholder:(d==null?void 0:d.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Max Delegate Retries",children:f.jsx(Ze,{type:"number",value:i.policy_max_delegate_retries,onChange:O=>h("policy_max_delegate_retries")(O.target.value),placeholder:(d==null?void 0:d.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Cache Delegations",children:f.jsx(Py,{value:i.policy_cache_delegations,onChange:h("policy_cache_delegations"),options:U$,placeholder:(d==null?void 0:d.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),f.jsx(Ti,{label:"Cache Max Entries",children:f.jsx(Ze,{value:i.policy_cache_max_entries,onChange:O=>h("policy_cache_max_entries")(O.target.value),placeholder:(d==null?void 0:d.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Cache TTL (seconds)",children:f.jsx(Ze,{value:i.policy_cache_ttl_seconds,onChange:O=>h("policy_cache_ttl_seconds")(O.target.value),placeholder:(d==null?void 0:d.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),f.jsx(Ti,{label:"Max Delegations",children:f.jsx(Ze,{type:"number",min:"0",value:i.policy_max_num_delegations,onChange:O=>h("policy_max_num_delegations")(O.target.value),placeholder:(d==null?void 0:d.policy_max_num_delegations)||"0 (unlimited)",className:"h-8 text-xs"})})]})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Session"}),f.jsx(_l,{}),f.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:f.jsx(Ti,{label:"Pull Before Session",children:f.jsx(Py,{value:i.session_pull_before_session,onChange:h("session_pull_before_session"),options:tBe,placeholder:(d==null?void 0:d.session_pull_before_session)||"prompt",allowEmpty:!0})})})]}),f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),f.jsx(_l,{}),f.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:f.jsx(Ti,{label:"Enabled",children:f.jsx(Py,{value:i.trace_enabled,onChange:h("trace_enabled"),options:U$,placeholder:(d==null?void 0:d.trace_enabled)||"true",allowEmpty:!0})})})]}),f.jsxs(pe,{size:"sm",onClick:g,disabled:r||k,className:"self-start",children:[f.jsx(bU,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function Ti({label:e,children:t,className:n}){return f.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[f.jsx(lt,{className:"text-xs",children:e}),t]})}function Py({value:e,onChange:t,options:n,placeholder:r,allowEmpty:i}){return f.jsxs(ja,{value:e||(i?c_:""),onValueChange:a=>t(a===c_?"":a),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:r})}),f.jsxs(Ca,{children:[i&&f.jsx(hn,{value:c_,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(a=>f.jsx(hn,{value:a,children:a},a))]})]})}function nBe(){var g,v;const[e,t]=y.useState("global"),[n,r]=y.useState(null),i=Qe(),a=W$e(),o=Ff(),l=zk(n??0,{enabled:n!=null}),u=Q$e(),d=Z$e(),m=b=>{u.mutate(b,{onSuccess:()=>We.success("Global configuration saved"),onError:()=>We.error("Failed to save global configuration")})},h=b=>{n!=null&&d.mutate({projectId:n,data:b},{onSuccess:()=>We.success("Project configuration saved"),onError:()=>We.error("Failed to save project configuration")})};return y.useEffect(()=>{e==="project"&&n!=null&&i.invalidateQueries({queryKey:Pe.projects.config(n)})},[e,n,i]),f.jsxs("div",{className:"space-y-6",children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),f.jsxs(Wp,{value:e,onValueChange:t,children:[f.jsxs(Qp,{children:[f.jsx(Wn,{value:"global",children:"Global"}),f.jsx(Wn,{value:"project",children:"Project"})]}),f.jsx(Qn,{value:"global",className:"mt-4",children:a.isLoading?f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):f.jsx(H$,{values:((g=a.data)==null?void 0:g.values)??{},placeholders:(v=a.data)==null?void 0:v.defaults,onSave:m,saving:u.isPending})}),f.jsx(Qn,{value:"project",className:"mt-4",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[f.jsx(lt,{className:"text-xs",children:"Project"}),f.jsxs(ja,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[f.jsx(_a,{className:"h-8 text-xs",children:f.jsx(Ea,{placeholder:"Select a project"})}),f.jsx(Ca,{children:(o.data??[]).map(b=>f.jsx(hn,{value:String(b.id),children:b.display_name},b.id))})]})]}),n!=null&&l.isLoading&&f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),n!=null&&l.data&&f.jsx(H$,{values:l.data.project,placeholders:l.data.merged_nested,onSave:h,saving:d.isPending},n)]})})]})]})}function rBe({status:e}){const t={running:{variant:"default",label:"Running"},stopped:{variant:"secondary",label:"Stopped"},error:{variant:"destructive",label:"Error"}},{variant:n,label:r}=t[e]??{variant:"outline",label:e};return f.jsx(mt,{variant:n,children:r})}function iBe(){const{data:e,isLoading:t}=vA(),[n,r]=y.useState(null),[i,a]=y.useState(!1),[o,l]=y.useState(null),[u,d]=y.useState(void 0),[m,h]=y.useState(!1),[g,v]=y.useState(!1),b=WH(),w=n?(e==null?void 0:e.find(S=>S.name===n.name&&S.project_id===n.project_id))??n:null;return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"Chat and community platform adapters"})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(pe,{onClick:()=>v(!0),size:"sm",variant:"outline",children:[f.jsx(qm,{className:"mr-2 h-4 w-4"}),"Update All Integrations"]}),f.jsxs(pe,{onClick:()=>h(!0),size:"sm",children:[f.jsx(zp,{className:"mr-2 h-4 w-4"}),"Install"]})]})]}),t?f.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((S,j)=>f.jsx(en,{className:"h-12 w-full"},j))}):!e||e.length===0?f.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:[f.jsx("p",{children:"No integrations installed yet."}),f.jsxs("p",{className:"mt-1 text-xs",children:["Install from Strawhub or place adapter directories in ",f.jsx("code",{className:"rounded bg-muted px-1",children:"~/.strawpot/integrations/"})]})]}):f.jsxs(Ui,{children:[f.jsx(Hi,{children:f.jsxs(sn,{children:[f.jsx(Re,{children:"Name"}),f.jsx(Re,{children:"Version"}),f.jsx(Re,{children:"Description"}),f.jsx(Re,{children:"Status"})]})}),f.jsx(qi,{children:e.map(S=>f.jsxs(sn,{className:"cursor-pointer",onClick:()=>{r(S),a(!0)},children:[f.jsx(Me,{className:"font-medium",children:S.name}),f.jsx(Me,{className:"text-sm text-muted-foreground",children:S.version?`v${S.version}`:"—"}),f.jsx(Me,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:S.description||"—"}),f.jsx(Me,{children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(rBe,{status:S.status}),S.status==="running"&&f.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]})})]},`${S.name}:${S.project_id}`))})]}),f.jsx(eq,{integration:w,open:i,onOpenChange:a,onLogs:(S,j)=>{l(S),d(j)}}),f.jsx(tq,{name:o,projectId:u,open:!!o,onOpenChange:S=>{S||l(null)}}),f.jsx(aBe,{open:m,onOpenChange:h}),f.jsx(gA,{open:g,onOpenChange:v,onUpdate:()=>b.mutateAsync("integrations"),scope:"global",resourceType:"integrations"})]})}function aBe({open:e,onOpenChange:t}){const n=Nve(),[r,i]=y.useState(""),[a,o]=y.useState(null),[l,u]=y.useState(null),d=(a==null?void 0:a.status)==="success",m=()=>{r.trim()&&(o(null),u(null),n.mutate({name:r.trim()},{onSuccess:g=>{g.exit_code===0?(We.success(`Installed ${r.trim()}`),o({status:"success",message:`Successfully installed ${r.trim()}`}),u(g.stdout||null)):(o({status:"error",message:"Installation failed"}),u(g.stderr||g.stdout||"Unknown error."))},onError:()=>{o({status:"error",message:"Install request failed"}),We.error("Install request failed")}}))},h=g=>{g||(o(null),u(null),i("")),t(g)};return f.jsx(Qi,{open:e,onOpenChange:h,children:f.jsxs(Zi,{className:"sm:max-w-md",children:[f.jsxs(Ji,{children:[f.jsx(ea,{children:"Install Integration"}),f.jsx(Hp,{children:"Install a chat adapter from Strawhub by name."})]}),f.jsxs("div",{className:"flex flex-col gap-4",children:[a&&f.jsxs(Tm,{variant:a.status==="error"?"destructive":"default",className:a.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[a.status==="success"?f.jsx($f,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):f.jsx(Lp,{className:"h-4 w-4"}),f.jsx(Pm,{children:a.status==="success"?"Installed":"Error"}),f.jsx(Mm,{children:a.message})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(lt,{htmlFor:"install-integration-name",children:"Package Name"}),f.jsx(Ze,{id:"install-integration-name",autoFocus:!0,value:r,onChange:g=>i(g.target.value),placeholder:"e.g. telegram",readOnly:d,onKeyDown:g=>{g.key==="Enter"&&m()}})]}),l&&f.jsxs("details",{className:"text-sm",children:[f.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),f.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:l})]})]}),f.jsx(Up,{children:d?f.jsx(pe,{onClick:()=>h(!1),children:"Done"}):f.jsx(pe,{onClick:m,disabled:!r.trim()||n.isPending,children:n.isPending?"Installing...":"Install"})})]})})}function oBe(){return f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20",children:[f.jsx("h1",{className:"text-2xl font-bold",children:"Page not found"}),f.jsx(pe,{variant:"outline",asChild:!0,children:f.jsxs(dr,{to:"/",children:[f.jsx(Lse,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const sBe=3,lBe=1e4,cBe=2e3;function uBe(){const e=Qe(),t=y.useRef(null),n=y.useRef(void 0),r=y.useRef(1e3),i=y.useRef(0),a=y.useRef({}),o=y.useRef(!0);y.useEffect(()=>{function l(m){const h=Date.now();if(h-i.current<cBe)return!1;const g=(a.current[m]??[]).filter(v=>h-v<lBe);return g.length>=sBe?!1:(g.push(h),a.current[m]=g,!0)}function u(m){const h=m.type,g=(m.run_id??"unknown").slice(0,12);l(h)&&(h==="session_started"?We.info(`Session ${g} started`):h==="session_completed"?We.success(`Session ${g} completed`):h==="session_failed"?We.error(`Session ${g} failed`):h==="session_stopped"&&We.warning(`Session ${g} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),m.project_id&&(e.invalidateQueries({queryKey:Pe.projects.sessions(m.project_id)}),e.invalidateQueries({queryKey:Pe.conversations.all(m.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}function d(){const h=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`,g=new WebSocket(h);t.current=g,g.onopen=()=>{r.current=1e3,i.current=Date.now(),o.current||(e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["conversations"]})),o.current=!1},g.onmessage=v=>{let b;try{b=JSON.parse(v.data)}catch{return}b.type!=="ping"&&u(b)},g.onclose=()=>{t.current=null,n.current=setTimeout(()=>{r.current=Math.min(r.current*2,15e3),d()},r.current)},g.onerror=()=>{g.close()}}return d(),()=>{var m;(m=t.current)==null||m.close(),t.current=null,n.current&&clearTimeout(n.current)}},[e])}function dBe(){return uBe(),f.jsx(AZ,{children:f.jsxs(yr,{element:f.jsx(nue,{}),children:[f.jsx(yr,{index:!0,element:f.jsx(HR,{to:"/imu",replace:!0})}),f.jsx(yr,{path:"dashboard",element:f.jsx(mue,{})}),f.jsx(yr,{path:"projects",element:f.jsx(wue,{})}),f.jsx(yr,{path:"projects/:projectId",element:f.jsx(sDe,{})}),f.jsx(yr,{path:"projects/:projectId/sessions/:runId",element:f.jsx(U5e,{})}),f.jsx(yr,{path:"projects/:projectId/conversations/:conversationId",element:f.jsx(d$e,{})}),f.jsx(yr,{path:"imu",element:f.jsx(z$,{})}),f.jsx(yr,{path:"imu/:conversationId",element:f.jsx(z$,{})}),f.jsx(yr,{path:"schedules",element:f.jsx(HR,{to:"/schedules/recurring",replace:!0})}),f.jsx(yr,{path:"schedules/recurring",element:f.jsx($$e,{})}),f.jsx(yr,{path:"schedules/one-time",element:f.jsx(U$e,{})}),f.jsx(yr,{path:"schedules/runs",element:f.jsx(G$e,{})}),f.jsx(yr,{path:"resources/:resourceType",element:f.jsx(E$e,{})}),f.jsx(yr,{path:"integrations",element:f.jsx(iBe,{})}),f.jsx(yr,{path:"settings",element:f.jsx(nBe,{})}),f.jsx(yr,{path:"*",element:f.jsx(oBe,{})})]})})}OQ.createRoot(document.getElementById("root")).render(f.jsx(y.StrictMode,{children:f.jsx(KJ,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:f.jsx(LJ,{client:ece,children:f.jsxs(Tk,{children:[f.jsx(eJ,{children:f.jsx(dBe,{})}),f.jsx(Jle,{position:"top-right",offset:{top:"8px",right:"60px"}})]})})})}));
