var qW=Object.defineProperty;var hR=e=>{throw TypeError(e)};var VW=(e,t,n)=>t in e?qW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var mS=(e,t,n)=>VW(e,typeof t!="symbol"?t+"":t,n),pS=(e,t,n)=>t.has(e)||hR("Cannot "+n);var W=(e,t,n)=>(pS(e,t,"read from private field"),n?n.call(e):t.get(e)),Re=(e,t,n)=>t.has(e)?hR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ne=(e,t,n,r)=>(pS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ot=(e,t,n)=>(pS(e,t,"access private method"),n);var $v=(e,t,n,r)=>({set _(i){Ne(e,t,i,n)},get _(){return W(e,t,r)}});function KW(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 Hi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gS={exports:{}},Hh={};/**
 * @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 mR;function YW(){if(mR)return Hh;mR=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 Hh.Fragment=t,Hh.jsx=n,Hh.jsxs=n,Hh}var pR;function XW(){return pR||(pR=1,gS.exports=YW()),gS.exports}var h=XW(),vS={exports:{}},dt={};/**
 * @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 gR;function GW(){if(gR)return dt;gR=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"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function v(H){return H===null||typeof H!="object"?null:(H=g&&H[g]||H["@@iterator"],typeof H=="function"?H:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function j(H,U,B){this.props=H,this.context=U,this.refs=S,this.updater=B||b}j.prototype.isReactComponent={},j.prototype.setState=function(H,U){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,U,"setState")},j.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function C(){}C.prototype=j.prototype;function _(H,U,B){this.props=H,this.context=U,this.refs=S,this.updater=B||b}var k=_.prototype=new C;k.constructor=_,w(k,j.prototype),k.isPureReactComponent=!0;var O=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function z(H,U,B){var Q=B.ref;return{$$typeof:e,type:H,key:U,ref:Q!==void 0?Q:null,props:B}}function L(H,U){return z(H.type,U,H.props)}function F(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function D(H){var U={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(B){return U[B]})}var X=/\/+/g;function R(H,U){return typeof H=="object"&&H!==null&&H.key!=null?D(""+H.key):U.toString(36)}function q(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(A,A):(H.status="pending",H.then(function(U){H.status==="pending"&&(H.status="fulfilled",H.value=U)},function(U){H.status==="pending"&&(H.status="rejected",H.reason=U)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function $(H,U,B,Q,Z){var te=typeof H;(te==="undefined"||te==="boolean")&&(H=null);var ae=!1;if(H===null)ae=!0;else switch(te){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(H.$$typeof){case e:case t:ae=!0;break;case m:return ae=H._init,$(ae(H._payload),U,B,Q,Z)}}if(ae)return Z=Z(H),ae=Q===""?"."+R(H,0):Q,O(Z)?(B="",ae!=null&&(B=ae.replace(X,"$&/")+"/"),$(Z,U,B,"",function(se){return se})):Z!=null&&(F(Z)&&(Z=L(Z,B+(Z.key==null||H&&H.key===Z.key?"":(""+Z.key).replace(X,"$&/")+"/")+ae)),U.push(Z)),1;ae=0;var re=Q===""?".":Q+":";if(O(H))for(var ee=0;ee<H.length;ee++)Q=H[ee],te=re+R(Q,ee),ae+=$(Q,U,B,te,Z);else if(ee=v(H),typeof ee=="function")for(H=ee.call(H),ee=0;!(Q=H.next()).done;)Q=Q.value,te=re+R(Q,ee++),ae+=$(Q,U,B,te,Z);else if(te==="object"){if(typeof H.then=="function")return $(q(H),U,B,Q,Z);throw U=String(H),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ae}function V(H,U,B){if(H==null)return H;var Q=[],Z=0;return $(H,Q,"","",function(te){return U.call(B,te,Z++)}),Q}function G(H){if(H._status===-1){var U=H._result;U=U(),U.then(function(B){(H._status===0||H._status===-1)&&(H._status=1,H._result=B)},function(B){(H._status===0||H._status===-1)&&(H._status=2,H._result=B)}),H._status===-1&&(H._status=0,H._result=U)}if(H._status===1)return H._result.default;throw H._result}var K=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},I={map:V,forEach:function(H,U,B){V(H,function(){U.apply(this,arguments)},B)},count:function(H){var U=0;return V(H,function(){U++}),U},toArray:function(H){return V(H,function(U){return U})||[]},only:function(H){if(!F(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return dt.Activity=f,dt.Children=I,dt.Component=j,dt.Fragment=n,dt.Profiler=i,dt.PureComponent=_,dt.StrictMode=r,dt.Suspense=c,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,dt.__COMPILER_RUNTIME={__proto__:null,c:function(H){return T.H.useMemoCache(H)}},dt.cache=function(H){return function(){return H.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(H,U,B){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Q=w({},H.props),Z=H.key;if(U!=null)for(te in U.key!==void 0&&(Z=""+U.key),U)!P.call(U,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&U.ref===void 0||(Q[te]=U[te]);var te=arguments.length-2;if(te===1)Q.children=B;else if(1<te){for(var ae=Array(te),re=0;re<te;re++)ae[re]=arguments[re+2];Q.children=ae}return z(H.type,Z,Q)},dt.createContext=function(H){return H={$$typeof:o,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:a,_context:H},H},dt.createElement=function(H,U,B){var Q,Z={},te=null;if(U!=null)for(Q in U.key!==void 0&&(te=""+U.key),U)P.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(Z[Q]=U[Q]);var ae=arguments.length-2;if(ae===1)Z.children=B;else if(1<ae){for(var re=Array(ae),ee=0;ee<ae;ee++)re[ee]=arguments[ee+2];Z.children=re}if(H&&H.defaultProps)for(Q in ae=H.defaultProps,ae)Z[Q]===void 0&&(Z[Q]=ae[Q]);return z(H,te,Z)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(H){return{$$typeof:l,render:H}},dt.isValidElement=F,dt.lazy=function(H){return{$$typeof:m,_payload:{_status:-1,_result:H},_init:G}},dt.memo=function(H,U){return{$$typeof:d,type:H,compare:U===void 0?null:U}},dt.startTransition=function(H){var U=T.T,B={};T.T=B;try{var Q=H(),Z=T.S;Z!==null&&Z(B,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(A,K)}catch(te){K(te)}finally{U!==null&&B.types!==null&&(U.types=B.types),T.T=U}},dt.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},dt.use=function(H){return T.H.use(H)},dt.useActionState=function(H,U,B){return T.H.useActionState(H,U,B)},dt.useCallback=function(H,U){return T.H.useCallback(H,U)},dt.useContext=function(H){return T.H.useContext(H)},dt.useDebugValue=function(){},dt.useDeferredValue=function(H,U){return T.H.useDeferredValue(H,U)},dt.useEffect=function(H,U){return T.H.useEffect(H,U)},dt.useEffectEvent=function(H){return T.H.useEffectEvent(H)},dt.useId=function(){return T.H.useId()},dt.useImperativeHandle=function(H,U,B){return T.H.useImperativeHandle(H,U,B)},dt.useInsertionEffect=function(H,U){return T.H.useInsertionEffect(H,U)},dt.useLayoutEffect=function(H,U){return T.H.useLayoutEffect(H,U)},dt.useMemo=function(H,U){return T.H.useMemo(H,U)},dt.useOptimistic=function(H,U){return T.H.useOptimistic(H,U)},dt.useReducer=function(H,U,B){return T.H.useReducer(H,U,B)},dt.useRef=function(H){return T.H.useRef(H)},dt.useState=function(H){return T.H.useState(H)},dt.useSyncExternalStore=function(H,U,B){return T.H.useSyncExternalStore(H,U,B)},dt.useTransition=function(){return T.H.useTransition()},dt.version="19.2.4",dt}var vR;function Pf(){return vR||(vR=1,vS.exports=GW()),vS.exports}var y=Pf();const Ce=Hi(y),mN=KW({__proto__:null,default:Ce},[y]);var yS={exports:{}},qh={},xS={exports:{}},bS={};/**
 * @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 yR;function WW(){return yR||(yR=1,(function(e){function t($,V){var G=$.length;$.push(V);e:for(;0<G;){var K=G-1>>>1,I=$[K];if(0<i(I,V))$[K]=V,$[G]=I,G=K;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var V=$[0],G=$.pop();if(G!==V){$[0]=G;e:for(var K=0,I=$.length,H=I>>>1;K<H;){var U=2*(K+1)-1,B=$[U],Q=U+1,Z=$[Q];if(0>i(B,G))Q<I&&0>i(Z,B)?($[K]=Z,$[Q]=G,K=Q):($[K]=B,$[U]=G,K=U);else if(Q<I&&0>i(Z,G))$[K]=Z,$[Q]=G,K=Q;else break e}}return V}function i($,V){var G=$.sortIndex-V.sortIndex;return G!==0?G:$.id-V.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 c=[],d=[],m=1,f=null,g=3,v=!1,b=!1,w=!1,S=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function k($){for(var V=n(d);V!==null;){if(V.callback===null)r(d);else if(V.startTime<=$)r(d),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(d)}}function O($){if(w=!1,k($),!b)if(n(c)!==null)b=!0,A||(A=!0,D());else{var V=n(d);V!==null&&q(O,V.startTime-$)}}var A=!1,T=-1,P=5,z=-1;function L(){return S?!0:!(e.unstable_now()-z<P)}function F(){if(S=!1,A){var $=e.unstable_now();z=$;var V=!0;try{e:{b=!1,w&&(w=!1,C(T),T=-1),v=!0;var G=g;try{t:{for(k($),f=n(c);f!==null&&!(f.expirationTime>$&&L());){var K=f.callback;if(typeof K=="function"){f.callback=null,g=f.priorityLevel;var I=K(f.expirationTime<=$);if($=e.unstable_now(),typeof I=="function"){f.callback=I,k($),V=!0;break t}f===n(c)&&r(c),k($)}else r(c);f=n(c)}if(f!==null)V=!0;else{var H=n(d);H!==null&&q(O,H.startTime-$),V=!1}}break e}finally{f=null,g=G,v=!1}V=void 0}}finally{V?D():A=!1}}}var D;if(typeof _=="function")D=function(){_(F)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,R=X.port2;X.port1.onmessage=F,D=function(){R.postMessage(null)}}else D=function(){j(F,0)};function q($,V){T=j(function(){$(e.unstable_now())},V)}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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function($){switch(g){case 1:case 2:case 3:var V=3;break;default:V=g}var G=g;g=V;try{return $()}finally{g=G}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function($,V){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var G=g;g=$;try{return V()}finally{g=G}},e.unstable_scheduleCallback=function($,V,G){var K=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?K+G:K):G=K,$){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=G+I,$={id:m++,callback:V,priorityLevel:$,startTime:G,expirationTime:I,sortIndex:-1},G>K?($.sortIndex=G,t(d,$),n(c)===null&&$===n(d)&&(w?(C(T),T=-1):w=!0,q(O,G-K))):($.sortIndex=I,t(c,$),b||v||(b=!0,A||(A=!0,D()))),$},e.unstable_shouldYield=L,e.unstable_wrapCallback=function($){var V=g;return function(){var G=g;g=V;try{return $.apply(this,arguments)}finally{g=G}}}})(bS)),bS}var xR;function QW(){return xR||(xR=1,xS.exports=WW()),xS.exports}var wS={exports:{}},Dr={};/**
 * @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 bR;function ZW(){if(bR)return Dr;bR=1;var e=Pf();function t(c){var d="https://react.dev/errors/"+c;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 #"+c+"; 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(c,d,m){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:f==null?null:""+f,children:c,containerInfo:d,implementation:m}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,d){if(c==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Dr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dr.createPortal=function(c,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(c,d,null,m)},Dr.flushSync=function(c){var d=o.T,m=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=d,r.p=m,r.d.f()}},Dr.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(c,d))},Dr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Dr.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var m=d.as,f=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(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:f,integrity:g,fetchPriority:v}):m==="script"&&r.d.X(c,{crossOrigin:f,integrity:g,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Dr.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=l(d.as,d.crossOrigin);r.d.M(c,{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(c)},Dr.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,f=l(m,d.crossOrigin);r.d.L(c,m,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Dr.preloadModule=function(c,d){if(typeof c=="string")if(d){var m=l(d.as,d.crossOrigin);r.d.m(c,{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(c)},Dr.requestFormReset=function(c){r.d.r(c)},Dr.unstable_batchedUpdates=function(c,d){return c(d)},Dr.useFormState=function(c,d,m){return o.H.useFormState(c,d,m)},Dr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Dr.version="19.2.4",Dr}var wR;function U$(){if(wR)return wS.exports;wR=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(),wS.exports=ZW(),wS.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 SR;function JW(){if(SR)return qh;SR=1;var e=QW(),t=Pf(),n=U$();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)u+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+s+"; visit "+u+" 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 u=s,p=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(p=u.return),s=u.return;while(s)}return u.tag===3?p:null}function o(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function l(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function c(s){if(a(s)!==s)throw Error(r(188))}function d(s){var u=s.alternate;if(!u){if(u=a(s),u===null)throw Error(r(188));return u!==s?null:s}for(var p=s,x=u;;){var E=p.return;if(E===null)break;var N=E.alternate;if(N===null){if(x=E.return,x!==null){p=x;continue}break}if(E.child===N.child){for(N=E.child;N;){if(N===p)return c(E),s;if(N===x)return c(E),u;N=N.sibling}throw Error(r(188))}if(p.return!==x.return)p=E,x=N;else{for(var M=!1,Y=E.child;Y;){if(Y===p){M=!0,p=E,x=N;break}if(Y===x){M=!0,x=E,p=N;break}Y=Y.sibling}if(!M){for(Y=N.child;Y;){if(Y===p){M=!0,p=N,x=E;break}if(Y===x){M=!0,x=N,p=E;break}Y=Y.sibling}if(!M)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:u}function m(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=m(s),u!==null)return u;s=s.sibling}return null}var f=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"),_=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"),P=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function D(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var X=Symbol.for("react.client.reference");function R(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===X?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 z:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case _:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case k:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return u=s.displayName||null,u!==null?u:R(s.type)||"Memo";case P:u=s._payload,s=s._init;try{return R(s(u))}catch{}}return null}var q=Array.isArray,$=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},K=[],I=-1;function H(s){return{current:s}}function U(s){0>I||(s.current=K[I],K[I]=null,I--)}function B(s,u){I++,K[I]=s.current,s.current=u}var Q=H(null),Z=H(null),te=H(null),ae=H(null);function re(s,u){switch(B(te,u),B(Z,s),B(Q,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?IM(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=IM(u),s=LM(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(Q),B(Q,s)}function ee(){U(Q),U(Z),U(te)}function se(s){s.memoizedState!==null&&B(ae,s);var u=Q.current,p=LM(u,s.type);u!==p&&(B(Z,s),B(Q,p))}function ge(s){Z.current===s&&(U(Q),U(Z)),ae.current===s&&(U(ae),$h._currentValue=G)}var ie,Se;function Ee(s){if(ie===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);ie=u&&u[1]||"",Se=-1<p.stack.indexOf(`
    at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+s+Se}var He=!1;function Oe(s,u){if(!s||He)return"";He=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(u){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(he){var fe=he}Reflect.construct(s,[],we)}else{try{we.call()}catch(he){fe=he}s.call(we.prototype)}}else{try{throw Error()}catch(he){fe=he}(we=s())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(he){if(he&&fe&&typeof he.stack=="string")return[he.stack,fe.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=x.DetermineComponentFrameRoot(),M=N[0],Y=N[1];if(M&&Y){var J=M.split(`
`),de=Y.split(`
`);for(E=x=0;x<J.length&&!J[x].includes("DetermineComponentFrameRoot");)x++;for(;E<de.length&&!de[E].includes("DetermineComponentFrameRoot");)E++;if(x===J.length||E===de.length)for(x=J.length-1,E=de.length-1;1<=x&&0<=E&&J[x]!==de[E];)E--;for(;1<=x&&0<=E;x--,E--)if(J[x]!==de[E]){if(x!==1||E!==1)do if(x--,E--,0>E||J[x]!==de[E]){var ve=`
`+J[x].replace(" at new "," at ");return s.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",s.displayName)),ve}while(1<=x&&0<=E);break}}}finally{He=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Ee(p):""}function at(s,u){switch(s.tag){case 26:case 27:case 5:return Ee(s.type);case 16:return Ee("Lazy");case 13:return s.child!==u&&u!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Oe(s.type,!1);case 11:return Oe(s.type.render,!1);case 1:return Oe(s.type,!0);case 31:return Ee("Activity");default:return""}}function Je(s){try{var u="",p=null;do u+=at(s,p),p=s,s=s.return;while(s);return u}catch(x){return`
Error generating stack: `+x.message+`
`+x.stack}}var We=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,mt=e.unstable_cancelCallback,_t=e.unstable_shouldYield,Kt=e.unstable_requestPaint,It=e.unstable_now,dn=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,et=e.unstable_LowPriority,tt=e.unstable_IdlePriority,Gt=e.log,nn=e.unstable_setDisableYieldValue,je=null,ut=null;function wt(s){if(typeof Gt=="function"&&nn(s),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(je,s)}catch{}}var ct=Math.clz32?Math.clz32:hr,Bn=Math.log,rn=Math.LN2;function hr(s){return s>>>=0,s===0?32:31-(Bn(s)/rn|0)|0}var Xr=256,Rr=262144,ai=4194304;function Er(s){var u=s&42;if(u!==0)return u;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 Qe(s,u,p){var x=s.pendingLanes;if(x===0)return 0;var E=0,N=s.suspendedLanes,M=s.pingedLanes;s=s.warmLanes;var Y=x&134217727;return Y!==0?(x=Y&~N,x!==0?E=Er(x):(M&=Y,M!==0?E=Er(M):p||(p=Y&~s,p!==0&&(E=Er(p))))):(Y=x&~N,Y!==0?E=Er(Y):M!==0?E=Er(M):p||(p=x&~s,p!==0&&(E=Er(p)))),E===0?0:u!==0&&u!==E&&(u&N)===0&&(N=E&-E,p=u&-u,N>=p||N===32&&(p&4194048)!==0)?u:E}function qt(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function me(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 Ze(){var s=ai;return ai<<=1,(ai&62914560)===0&&(ai=4194304),s}function an(s){for(var u=[],p=0;31>p;p++)u.push(s);return u}function Ct(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Pn(s,u,p,x,E,N){var M=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 Y=s.entanglements,J=s.expirationTimes,de=s.hiddenUpdates;for(p=M&~p;0<p;){var ve=31-ct(p),we=1<<ve;Y[ve]=0,J[ve]=-1;var fe=de[ve];if(fe!==null)for(de[ve]=null,ve=0;ve<fe.length;ve++){var he=fe[ve];he!==null&&(he.lane&=-536870913)}p&=~we}x!==0&&Gr(s,x,0),N!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=N&~(M&~u))}function Gr(s,u,p){s.pendingLanes|=u,s.suspendedLanes&=~u;var x=31-ct(u);s.entangledLanes|=u,s.entanglements[x]=s.entanglements[x]|1073741824|p&261930}function mr(s,u){var p=s.entangledLanes|=u;for(s=s.entanglements;p;){var x=31-ct(p),E=1<<x;E&u|s[x]&u&&(s[x]|=u),p&=~E}}function er(s,u){var p=u&-u;return p=(p&42)!==0?1:eo(p),(p&(s.suspendedLanes|u))!==0?0:p}function eo(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 Wr(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Ls(){var s=V.p;return s!==0?s:(s=window.event,s===void 0?32:oR(s.type))}function pe(s,u){var p=V.p;try{return V.p=s,u()}finally{V.p=p}}var pt=Math.random().toString(36).slice(2),Lt="__reactFiber$"+pt,on="__reactProps$"+pt,Na="__reactContainer$"+pt,to="__reactEvents$"+pt,Sg="__reactListeners$"+pt,aw="__reactHandles$"+pt,jg="__reactResources$"+pt,iu="__reactMarker$"+pt;function Jf(s){delete s[Lt],delete s[on],delete s[to],delete s[Sg],delete s[aw]}function zs(s){var u=s[Lt];if(u)return u;for(var p=s.parentNode;p;){if(u=p[Na]||p[Lt]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(s=qM(s);s!==null;){if(p=s[Lt])return p;s=qM(s)}return u}s=p,p=s.parentNode}return null}function $s(s){if(s=s[Lt]||s[Na]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Bs(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function Fs(s){var u=s[jg];return u||(u=s[jg]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function Hn(s){s[iu]=!0}var Eg=new Set,_g={};function Ro(s,u){Us(s,u),Us(s+"Capture",u)}function Us(s,u){for(_g[s]=u,s=0;s<u.length;s++)Eg.add(u[s])}var ow=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]*$"),eh={},Cg={};function sw(s){return We.call(Cg,s)?!0:We.call(eh,s)?!1:ow.test(s)?Cg[s]=!0:(eh[s]=!0,!1)}function Lc(s,u,p){if(sw(u))if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var x=u.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+p)}}function zc(s,u,p){if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+p)}}function ka(s,u,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(u,p,""+x)}}function oi(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Ng(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function lw(s,u,p){var x=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof x<"u"&&typeof x.get=="function"&&typeof x.set=="function"){var E=x.get,N=x.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(M){p=""+M,N.call(this,M)}}),Object.defineProperty(s,u,{enumerable:x.enumerable}),{getValue:function(){return p},setValue:function(M){p=""+M},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Hs(s){if(!s._valueTracker){var u=Ng(s)?"checked":"value";s._valueTracker=lw(s,u,""+s[u])}}function kg(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var p=u.getValue(),x="";return s&&(x=Ng(s)?s.checked?"true":"false":s.value),s=x,s!==p?(u.setValue(s),!0):!1}function au(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 uw=/[\n"\\]/g;function si(s){return s.replace(uw,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function ou(s,u,p,x,E,N,M,Y){s.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.type=M:s.removeAttribute("type"),u!=null?M==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+oi(u)):s.value!==""+oi(u)&&(s.value=""+oi(u)):M!=="submit"&&M!=="reset"||s.removeAttribute("value"),u!=null?th(s,M,oi(u)):p!=null?th(s,M,oi(p)):x!=null&&s.removeAttribute("value"),E==null&&N!=null&&(s.defaultChecked=!!N),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?s.name=""+oi(Y):s.removeAttribute("name")}function Ag(s,u,p,x,E,N,M,Y){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),u!=null||p!=null){if(!(N!=="submit"&&N!=="reset"||u!=null)){Hs(s);return}p=p!=null?""+oi(p):"",u=u!=null?""+oi(u):p,Y||u===s.value||(s.value=u),s.defaultValue=u}x=x??E,x=typeof x!="function"&&typeof x!="symbol"&&!!x,s.checked=Y?s.checked:!!x,s.defaultChecked=!!x,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.name=M),Hs(s)}function th(s,u,p){u==="number"&&au(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function Do(s,u,p,x){if(s=s.options,u){u={};for(var E=0;E<p.length;E++)u["$"+p[E]]=!0;for(p=0;p<s.length;p++)E=u.hasOwnProperty("$"+s[p].value),s[p].selected!==E&&(s[p].selected=E),E&&x&&(s[p].defaultSelected=!0)}else{for(p=""+oi(p),u=null,E=0;E<s.length;E++){if(s[E].value===p){s[E].selected=!0,x&&(s[E].defaultSelected=!0);return}u!==null||s[E].disabled||(u=s[E])}u!==null&&(u.selected=!0)}}function T2(s,u,p){if(u!=null&&(u=""+oi(u),u!==s.value&&(s.value=u),p==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=p!=null?""+oi(p):""}function P2(s,u,p,x){if(u==null){if(x!=null){if(p!=null)throw Error(r(92));if(q(x)){if(1<x.length)throw Error(r(93));x=x[0]}p=x}p==null&&(p=""),u=p}p=oi(u),s.defaultValue=p,x=s.textContent,x===p&&x!==""&&x!==null&&(s.value=x),Hs(s)}function $c(s,u){if(u){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=u;return}}s.textContent=u}var $X=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 M2(s,u,p){var x=u.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?x?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":x?s.setProperty(u,p):typeof p!="number"||p===0||$X.has(u)?u==="float"?s.cssFloat=p:s[u]=(""+p).trim():s[u]=p+"px"}function R2(s,u,p){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,p!=null){for(var x in p)!p.hasOwnProperty(x)||u!=null&&u.hasOwnProperty(x)||(x.indexOf("--")===0?s.setProperty(x,""):x==="float"?s.cssFloat="":s[x]="");for(var E in u)x=u[E],u.hasOwnProperty(E)&&p[E]!==x&&M2(s,E,x)}else for(var N in u)u.hasOwnProperty(N)&&M2(s,N,u[N])}function cw(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 BX=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"]]),FX=/^[\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 Og(s){return FX.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Io(){}var dw=null;function fw(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Bc=null,Fc=null;function D2(s){var u=$s(s);if(u&&(s=u.stateNode)){var p=s[on]||null;e:switch(s=u.stateNode,u.type){case"input":if(ou(s,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),u=p.name,p.type==="radio"&&u!=null){for(p=s;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+si(""+u)+'"][type="radio"]'),u=0;u<p.length;u++){var x=p[u];if(x!==s&&x.form===s.form){var E=x[on]||null;if(!E)throw Error(r(90));ou(x,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<p.length;u++)x=p[u],x.form===s.form&&kg(x)}break e;case"textarea":T2(s,p.value,p.defaultValue);break e;case"select":u=p.value,u!=null&&Do(s,!!p.multiple,u,!1)}}}var hw=!1;function I2(s,u,p){if(hw)return s(u,p);hw=!0;try{var x=s(u);return x}finally{if(hw=!1,(Bc!==null||Fc!==null)&&(vv(),Bc&&(u=Bc,s=Fc,Fc=Bc=null,D2(u),s)))for(u=0;u<s.length;u++)D2(s[u])}}function nh(s,u){var p=s.stateNode;if(p===null)return null;var x=p[on]||null;if(x===null)return null;p=x[u];e:switch(u){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,u,typeof p));return p}var Lo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mw=!1;if(Lo)try{var rh={};Object.defineProperty(rh,"passive",{get:function(){mw=!0}}),window.addEventListener("test",rh,rh),window.removeEventListener("test",rh,rh)}catch{mw=!1}var qs=null,pw=null,Tg=null;function L2(){if(Tg)return Tg;var s,u=pw,p=u.length,x,E="value"in qs?qs.value:qs.textContent,N=E.length;for(s=0;s<p&&u[s]===E[s];s++);var M=p-s;for(x=1;x<=M&&u[p-x]===E[N-x];x++);return Tg=E.slice(s,1<x?1-x:void 0)}function Pg(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function Mg(){return!0}function z2(){return!1}function li(s){function u(p,x,E,N,M){this._reactName=p,this._targetInst=E,this.type=x,this.nativeEvent=N,this.target=M,this.currentTarget=null;for(var Y in s)s.hasOwnProperty(Y)&&(p=s[Y],this[Y]=p?p(N):N[Y]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Mg:z2,this.isPropagationStopped=z2,this}return f(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Mg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Mg)},persist:function(){},isPersistent:Mg}),u}var su={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rg=li(su),ih=f({},su,{view:0,detail:0}),UX=li(ih),gw,vw,ah,Dg=f({},ih,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xw,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!==ah&&(ah&&s.type==="mousemove"?(gw=s.screenX-ah.screenX,vw=s.screenY-ah.screenY):vw=gw=0,ah=s),gw)},movementY:function(s){return"movementY"in s?s.movementY:vw}}),$2=li(Dg),HX=f({},Dg,{dataTransfer:0}),qX=li(HX),VX=f({},ih,{relatedTarget:0}),yw=li(VX),KX=f({},su,{animationName:0,elapsedTime:0,pseudoElement:0}),YX=li(KX),XX=f({},su,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),GX=li(XX),WX=f({},su,{data:0}),B2=li(WX),QX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZX={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"},JX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eG(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=JX[s])?!!u[s]:!1}function xw(){return eG}var tG=f({},ih,{key:function(s){if(s.key){var u=QX[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=Pg(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?ZX[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xw,charCode:function(s){return s.type==="keypress"?Pg(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Pg(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),nG=li(tG),rG=f({},Dg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),F2=li(rG),iG=f({},ih,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xw}),aG=li(iG),oG=f({},su,{propertyName:0,elapsedTime:0,pseudoElement:0}),sG=li(oG),lG=f({},Dg,{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}),uG=li(lG),cG=f({},su,{newState:0,oldState:0}),dG=li(cG),fG=[9,13,27,32],bw=Lo&&"CompositionEvent"in window,oh=null;Lo&&"documentMode"in document&&(oh=document.documentMode);var hG=Lo&&"TextEvent"in window&&!oh,U2=Lo&&(!bw||oh&&8<oh&&11>=oh),H2=" ",q2=!1;function V2(s,u){switch(s){case"keyup":return fG.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function K2(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Uc=!1;function mG(s,u){switch(s){case"compositionend":return K2(u);case"keypress":return u.which!==32?null:(q2=!0,H2);case"textInput":return s=u.data,s===H2&&q2?null:s;default:return null}}function pG(s,u){if(Uc)return s==="compositionend"||!bw&&V2(s,u)?(s=L2(),Tg=pw=qs=null,Uc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return U2&&u.locale!=="ko"?null:u.data;default:return null}}var gG={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 Y2(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!gG[s.type]:u==="textarea"}function X2(s,u,p,x){Bc?Fc?Fc.push(x):Fc=[x]:Bc=x,u=Ev(u,"onChange"),0<u.length&&(p=new Rg("onChange","change",null,p,x),s.push({event:p,listeners:u}))}var sh=null,lh=null;function vG(s){OM(s,0)}function Ig(s){var u=Bs(s);if(kg(u))return s}function G2(s,u){if(s==="change")return u}var W2=!1;if(Lo){var ww;if(Lo){var Sw="oninput"in document;if(!Sw){var Q2=document.createElement("div");Q2.setAttribute("oninput","return;"),Sw=typeof Q2.oninput=="function"}ww=Sw}else ww=!1;W2=ww&&(!document.documentMode||9<document.documentMode)}function Z2(){sh&&(sh.detachEvent("onpropertychange",J2),lh=sh=null)}function J2(s){if(s.propertyName==="value"&&Ig(lh)){var u=[];X2(u,lh,s,fw(s)),I2(vG,u)}}function yG(s,u,p){s==="focusin"?(Z2(),sh=u,lh=p,sh.attachEvent("onpropertychange",J2)):s==="focusout"&&Z2()}function xG(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Ig(lh)}function bG(s,u){if(s==="click")return Ig(u)}function wG(s,u){if(s==="input"||s==="change")return Ig(u)}function SG(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Si=typeof Object.is=="function"?Object.is:SG;function uh(s,u){if(Si(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var p=Object.keys(s),x=Object.keys(u);if(p.length!==x.length)return!1;for(x=0;x<p.length;x++){var E=p[x];if(!We.call(u,E)||!Si(s[E],u[E]))return!1}return!0}function eT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function tT(s,u){var p=eT(s);s=0;for(var x;p;){if(p.nodeType===3){if(x=s+p.textContent.length,s<=u&&x>=u)return{node:p,offset:u-s};s=x}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=eT(p)}}function nT(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?nT(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function rT(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=au(s.document);u instanceof s.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)s=u.contentWindow;else break;u=au(s.document)}return u}function jw(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var jG=Lo&&"documentMode"in document&&11>=document.documentMode,Hc=null,Ew=null,ch=null,_w=!1;function iT(s,u,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;_w||Hc==null||Hc!==au(x)||(x=Hc,"selectionStart"in x&&jw(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}),ch&&uh(ch,x)||(ch=x,x=Ev(Ew,"onSelect"),0<x.length&&(u=new Rg("onSelect","select",null,u,p),s.push({event:u,listeners:x}),u.target=Hc)))}function lu(s,u){var p={};return p[s.toLowerCase()]=u.toLowerCase(),p["Webkit"+s]="webkit"+u,p["Moz"+s]="moz"+u,p}var qc={animationend:lu("Animation","AnimationEnd"),animationiteration:lu("Animation","AnimationIteration"),animationstart:lu("Animation","AnimationStart"),transitionrun:lu("Transition","TransitionRun"),transitionstart:lu("Transition","TransitionStart"),transitioncancel:lu("Transition","TransitionCancel"),transitionend:lu("Transition","TransitionEnd")},Cw={},aT={};Lo&&(aT=document.createElement("div").style,"AnimationEvent"in window||(delete qc.animationend.animation,delete qc.animationiteration.animation,delete qc.animationstart.animation),"TransitionEvent"in window||delete qc.transitionend.transition);function uu(s){if(Cw[s])return Cw[s];if(!qc[s])return s;var u=qc[s],p;for(p in u)if(u.hasOwnProperty(p)&&p in aT)return Cw[s]=u[p];return s}var oT=uu("animationend"),sT=uu("animationiteration"),lT=uu("animationstart"),EG=uu("transitionrun"),_G=uu("transitionstart"),CG=uu("transitioncancel"),uT=uu("transitionend"),cT=new Map,Nw="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(" ");Nw.push("scrollEnd");function Aa(s,u){cT.set(s,u),Ro(u,[s])}var Lg=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=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(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Vi=[],Vc=0,kw=0;function zg(){for(var s=Vc,u=kw=Vc=0;u<s;){var p=Vi[u];Vi[u++]=null;var x=Vi[u];Vi[u++]=null;var E=Vi[u];Vi[u++]=null;var N=Vi[u];if(Vi[u++]=null,x!==null&&E!==null){var M=x.pending;M===null?E.next=E:(E.next=M.next,M.next=E),x.pending=E}N!==0&&dT(p,E,N)}}function $g(s,u,p,x){Vi[Vc++]=s,Vi[Vc++]=u,Vi[Vc++]=p,Vi[Vc++]=x,kw|=x,s.lanes|=x,s=s.alternate,s!==null&&(s.lanes|=x)}function Aw(s,u,p,x){return $g(s,u,p,x),Bg(s)}function cu(s,u){return $g(s,null,null,u),Bg(s)}function dT(s,u,p){s.lanes|=p;var x=s.alternate;x!==null&&(x.lanes|=p);for(var E=!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||(E=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,E&&u!==null&&(E=31-ct(p),s=N.hiddenUpdates,x=s[E],x===null?s[E]=[u]:x.push(u),u.lane=p|536870912),N):null}function Bg(s){if(50<Ph)throw Ph=0,z1=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Kc={};function NG(s,u,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=u,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 ji(s,u,p,x){return new NG(s,u,p,x)}function Ow(s){return s=s.prototype,!(!s||!s.isReactComponent)}function zo(s,u){var p=s.alternate;return p===null?(p=ji(s.tag,u,s.key,s.mode),p.elementType=s.elementType,p.type=s.type,p.stateNode=s.stateNode,p.alternate=s,s.alternate=p):(p.pendingProps=u,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,u=s.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=s.sibling,p.index=s.index,p.ref=s.ref,p.refCleanup=s.refCleanup,p}function fT(s,u){s.flags&=65011714;var p=s.alternate;return p===null?(s.childLanes=0,s.lanes=u,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,u=p.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function Fg(s,u,p,x,E,N){var M=0;if(x=s,typeof s=="function")Ow(s)&&(M=1);else if(typeof s=="string")M=PW(s,p,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case z:return s=ji(31,p,u,E),s.elementType=z,s.lanes=N,s;case w:return du(p.children,E,N,u);case S:M=8,E|=24;break;case j:return s=ji(12,p,u,E|2),s.elementType=j,s.lanes=N,s;case O:return s=ji(13,p,u,E),s.elementType=O,s.lanes=N,s;case A:return s=ji(19,p,u,E),s.elementType=A,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:M=10;break e;case C:M=9;break e;case k:M=11;break e;case T:M=14;break e;case P:M=16,x=null;break e}M=29,p=Error(r(130,s===null?"null":typeof s,"")),x=null}return u=ji(M,p,u,E),u.elementType=s,u.type=x,u.lanes=N,u}function du(s,u,p,x){return s=ji(7,s,x,u),s.lanes=p,s}function Tw(s,u,p){return s=ji(6,s,null,u),s.lanes=p,s}function hT(s){var u=ji(18,null,null,0);return u.stateNode=s,u}function Pw(s,u,p){return u=ji(4,s.children!==null?s.children:[],s.key,u),u.lanes=p,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var mT=new WeakMap;function Ki(s,u){if(typeof s=="object"&&s!==null){var p=mT.get(s);return p!==void 0?p:(u={value:s,source:u,stack:Je(u)},mT.set(s,u),u)}return{value:s,source:u,stack:Je(u)}}var Yc=[],Xc=0,Ug=null,dh=0,Yi=[],Xi=0,Vs=null,no=1,ro="";function $o(s,u){Yc[Xc++]=dh,Yc[Xc++]=Ug,Ug=s,dh=u}function pT(s,u,p){Yi[Xi++]=no,Yi[Xi++]=ro,Yi[Xi++]=Vs,Vs=s;var x=no;s=ro;var E=32-ct(x)-1;x&=~(1<<E),p+=1;var N=32-ct(u)+E;if(30<N){var M=E-E%5;N=(x&(1<<M)-1).toString(32),x>>=M,E-=M,no=1<<32-ct(u)+E|p<<E|x,ro=N+s}else no=1<<N|p<<E|x,ro=s}function Mw(s){s.return!==null&&($o(s,1),pT(s,1,0))}function Rw(s){for(;s===Ug;)Ug=Yc[--Xc],Yc[Xc]=null,dh=Yc[--Xc],Yc[Xc]=null;for(;s===Vs;)Vs=Yi[--Xi],Yi[Xi]=null,ro=Yi[--Xi],Yi[Xi]=null,no=Yi[--Xi],Yi[Xi]=null}function gT(s,u){Yi[Xi++]=no,Yi[Xi++]=ro,Yi[Xi++]=Vs,no=u.id,ro=u.overflow,Vs=s}var _r=null,mn=null,At=!1,Ks=null,Gi=!1,Dw=Error(r(519));function Ys(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fh(Ki(u,s)),Dw}function vT(s){var u=s.stateNode,p=s.type,x=s.memoizedProps;switch(u[Lt]=s,u[on]=x,p){case"dialog":jt("cancel",u),jt("close",u);break;case"iframe":case"object":case"embed":jt("load",u);break;case"video":case"audio":for(p=0;p<Rh.length;p++)jt(Rh[p],u);break;case"source":jt("error",u);break;case"img":case"image":case"link":jt("error",u),jt("load",u);break;case"details":jt("toggle",u);break;case"input":jt("invalid",u),Ag(u,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":jt("invalid",u);break;case"textarea":jt("invalid",u),P2(u,x.value,x.defaultValue,x.children)}p=x.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||u.textContent===""+p||x.suppressHydrationWarning===!0||RM(u.textContent,p)?(x.popover!=null&&(jt("beforetoggle",u),jt("toggle",u)),x.onScroll!=null&&jt("scroll",u),x.onScrollEnd!=null&&jt("scrollend",u),x.onClick!=null&&(u.onclick=Io),u=!0):u=!1,u||Ys(s,!0)}function yT(s){for(_r=s.return;_r;)switch(_r.tag){case 5:case 31:case 13:Gi=!1;return;case 27:case 3:Gi=!0;return;default:_r=_r.return}}function Gc(s){if(s!==_r)return!1;if(!At)return yT(s),At=!0,!1;var u=s.tag,p;if((p=u!==3&&u!==27)&&((p=u===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||J1(s.type,s.memoizedProps)),p=!p),p&&mn&&Ys(s),yT(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));mn=HM(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));mn=HM(s)}else u===27?(u=mn,sl(s.type)?(s=iS,iS=null,mn=s):mn=u):mn=_r?Qi(s.stateNode.nextSibling):null;return!0}function fu(){mn=_r=null,At=!1}function Iw(){var s=Ks;return s!==null&&(fi===null?fi=s:fi.push.apply(fi,s),Ks=null),s}function fh(s){Ks===null?Ks=[s]:Ks.push(s)}var Lw=H(null),hu=null,Bo=null;function Xs(s,u,p){B(Lw,u._currentValue),u._currentValue=p}function Fo(s){s._currentValue=Lw.current,U(Lw)}function zw(s,u,p){for(;s!==null;){var x=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,x!==null&&(x.childLanes|=u)):x!==null&&(x.childLanes&u)!==u&&(x.childLanes|=u),s===p)break;s=s.return}}function $w(s,u,p,x){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var N=E.dependencies;if(N!==null){var M=E.child;N=N.firstContext;e:for(;N!==null;){var Y=N;N=E;for(var J=0;J<u.length;J++)if(Y.context===u[J]){N.lanes|=p,Y=N.alternate,Y!==null&&(Y.lanes|=p),zw(N.return,p,s),x||(M=null);break e}N=Y.next}}else if(E.tag===18){if(M=E.return,M===null)throw Error(r(341));M.lanes|=p,N=M.alternate,N!==null&&(N.lanes|=p),zw(M,p,s),M=null}else M=E.child;if(M!==null)M.return=E;else for(M=E;M!==null;){if(M===s){M=null;break}if(E=M.sibling,E!==null){E.return=M.return,M=E;break}M=M.return}E=M}}function Wc(s,u,p,x){s=null;for(var E=u,N=!1;E!==null;){if(!N){if((E.flags&524288)!==0)N=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var M=E.alternate;if(M===null)throw Error(r(387));if(M=M.memoizedProps,M!==null){var Y=E.type;Si(E.pendingProps.value,M.value)||(s!==null?s.push(Y):s=[Y])}}else if(E===ae.current){if(M=E.alternate,M===null)throw Error(r(387));M.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push($h):s=[$h])}E=E.return}s!==null&&$w(u,s,p,x),u.flags|=262144}function Hg(s){for(s=s.firstContext;s!==null;){if(!Si(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function mu(s){hu=s,Bo=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Cr(s){return xT(hu,s)}function qg(s,u){return hu===null&&mu(s),xT(s,u)}function xT(s,u){var p=u._currentValue;if(u={context:u,memoizedValue:p,next:null},Bo===null){if(s===null)throw Error(r(308));Bo=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else Bo=Bo.next=u;return p}var kG=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(p,x){s.push(x)}};this.abort=function(){u.aborted=!0,s.forEach(function(p){return p()})}},AG=e.unstable_scheduleCallback,OG=e.unstable_NormalPriority,qn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bw(){return{controller:new kG,data:new Map,refCount:0}}function hh(s){s.refCount--,s.refCount===0&&AG(OG,function(){s.controller.abort()})}var mh=null,Fw=0,Qc=0,Zc=null;function TG(s,u){if(mh===null){var p=mh=[];Fw=0,Qc=q1(),Zc={status:"pending",value:void 0,then:function(x){p.push(x)}}}return Fw++,u.then(bT,bT),u}function bT(){if(--Fw===0&&mh!==null){Zc!==null&&(Zc.status="fulfilled");var s=mh;mh=null,Qc=0,Zc=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function PG(s,u){var p=[],x={status:"pending",value:null,reason:null,then:function(E){p.push(E)}};return s.then(function(){x.status="fulfilled",x.value=u;for(var E=0;E<p.length;E++)(0,p[E])(u)},function(E){for(x.status="rejected",x.reason=E,E=0;E<p.length;E++)(0,p[E])(void 0)}),x}var wT=$.S;$.S=function(s,u){iM=It(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&TG(s,u),wT!==null&&wT(s,u)};var pu=H(null);function Uw(){var s=pu.current;return s!==null?s:sn.pooledCache}function Vg(s,u){u===null?B(pu,pu.current):B(pu,u.pool)}function ST(){var s=Uw();return s===null?null:{parent:qn._currentValue,pool:s}}var Jc=Error(r(460)),Hw=Error(r(474)),Kg=Error(r(542)),Yg={then:function(){}};function jT(s){return s=s.status,s==="fulfilled"||s==="rejected"}function ET(s,u,p){switch(p=s[p],p===void 0?s.push(u):p!==u&&(u.then(Io,Io),u=p),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,CT(s),s;default:if(typeof u.status=="string")u.then(Io,Io);else{if(s=sn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(x){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=x}},function(x){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=x}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,CT(s),s}throw vu=u,Jc}}function gu(s){try{var u=s._init;return u(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(vu=p,Jc):p}}var vu=null;function _T(){if(vu===null)throw Error(r(459));var s=vu;return vu=null,s}function CT(s){if(s===Jc||s===Kg)throw Error(r(483))}var ed=null,ph=0;function Xg(s){var u=ph;return ph+=1,ed===null&&(ed=[]),ET(ed,s,u)}function gh(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function Gg(s,u){throw u.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function NT(s){function u(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;)u(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 E(oe,ne){return oe=zo(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 M(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function Y(oe,ne,ue,ye){return ne===null||ne.tag!==6?(ne=Tw(ue,oe.mode,ye),ne.return=oe,ne):(ne=E(ne,ue),ne.return=oe,ne)}function J(oe,ne,ue,ye){var Ye=ue.type;return Ye===w?ve(oe,ne,ue.props.children,ye,ue.key):ne!==null&&(ne.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===P&&gu(Ye)===ne.type)?(ne=E(ne,ue.props),gh(ne,ue),ne.return=oe,ne):(ne=Fg(ue.type,ue.key,ue.props,null,oe.mode,ye),gh(ne,ue),ne.return=oe,ne)}function de(oe,ne,ue,ye){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ue.containerInfo||ne.stateNode.implementation!==ue.implementation?(ne=Pw(ue,oe.mode,ye),ne.return=oe,ne):(ne=E(ne,ue.children||[]),ne.return=oe,ne)}function ve(oe,ne,ue,ye,Ye){return ne===null||ne.tag!==7?(ne=du(ue,oe.mode,ye,Ye),ne.return=oe,ne):(ne=E(ne,ue),ne.return=oe,ne)}function we(oe,ne,ue){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Tw(""+ne,oe.mode,ue),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ue=Fg(ne.type,ne.key,ne.props,null,oe.mode,ue),gh(ue,ne),ue.return=oe,ue;case b:return ne=Pw(ne,oe.mode,ue),ne.return=oe,ne;case P:return ne=gu(ne),we(oe,ne,ue)}if(q(ne)||D(ne))return ne=du(ne,oe.mode,ue,null),ne.return=oe,ne;if(typeof ne.then=="function")return we(oe,Xg(ne),ue);if(ne.$$typeof===_)return we(oe,qg(oe,ne),ue);Gg(oe,ne)}return null}function fe(oe,ne,ue,ye){var Ye=ne!==null?ne.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ye!==null?null:Y(oe,ne,""+ue,ye);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===Ye?J(oe,ne,ue,ye):null;case b:return ue.key===Ye?de(oe,ne,ue,ye):null;case P:return ue=gu(ue),fe(oe,ne,ue,ye)}if(q(ue)||D(ue))return Ye!==null?null:ve(oe,ne,ue,ye,null);if(typeof ue.then=="function")return fe(oe,ne,Xg(ue),ye);if(ue.$$typeof===_)return fe(oe,ne,qg(oe,ue),ye);Gg(oe,ue)}return null}function he(oe,ne,ue,ye,Ye){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return oe=oe.get(ue)||null,Y(ne,oe,""+ye,Ye);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case v:return oe=oe.get(ye.key===null?ue:ye.key)||null,J(ne,oe,ye,Ye);case b:return oe=oe.get(ye.key===null?ue:ye.key)||null,de(ne,oe,ye,Ye);case P:return ye=gu(ye),he(oe,ne,ue,ye,Ye)}if(q(ye)||D(ye))return oe=oe.get(ue)||null,ve(ne,oe,ye,Ye,null);if(typeof ye.then=="function")return he(oe,ne,ue,Xg(ye),Ye);if(ye.$$typeof===_)return he(oe,ne,ue,qg(ne,ye),Ye);Gg(ne,ye)}return null}function Le(oe,ne,ue,ye){for(var Ye=null,$t=null,qe=ne,gt=ne=0,kt=null;qe!==null&&gt<ue.length;gt++){qe.index>gt?(kt=qe,qe=null):kt=qe.sibling;var Bt=fe(oe,qe,ue[gt],ye);if(Bt===null){qe===null&&(qe=kt);break}s&&qe&&Bt.alternate===null&&u(oe,qe),ne=N(Bt,ne,gt),$t===null?Ye=Bt:$t.sibling=Bt,$t=Bt,qe=kt}if(gt===ue.length)return p(oe,qe),At&&$o(oe,gt),Ye;if(qe===null){for(;gt<ue.length;gt++)qe=we(oe,ue[gt],ye),qe!==null&&(ne=N(qe,ne,gt),$t===null?Ye=qe:$t.sibling=qe,$t=qe);return At&&$o(oe,gt),Ye}for(qe=x(qe);gt<ue.length;gt++)kt=he(qe,oe,gt,ue[gt],ye),kt!==null&&(s&&kt.alternate!==null&&qe.delete(kt.key===null?gt:kt.key),ne=N(kt,ne,gt),$t===null?Ye=kt:$t.sibling=kt,$t=kt);return s&&qe.forEach(function(fl){return u(oe,fl)}),At&&$o(oe,gt),Ye}function rt(oe,ne,ue,ye){if(ue==null)throw Error(r(151));for(var Ye=null,$t=null,qe=ne,gt=ne=0,kt=null,Bt=ue.next();qe!==null&&!Bt.done;gt++,Bt=ue.next()){qe.index>gt?(kt=qe,qe=null):kt=qe.sibling;var fl=fe(oe,qe,Bt.value,ye);if(fl===null){qe===null&&(qe=kt);break}s&&qe&&fl.alternate===null&&u(oe,qe),ne=N(fl,ne,gt),$t===null?Ye=fl:$t.sibling=fl,$t=fl,qe=kt}if(Bt.done)return p(oe,qe),At&&$o(oe,gt),Ye;if(qe===null){for(;!Bt.done;gt++,Bt=ue.next())Bt=we(oe,Bt.value,ye),Bt!==null&&(ne=N(Bt,ne,gt),$t===null?Ye=Bt:$t.sibling=Bt,$t=Bt);return At&&$o(oe,gt),Ye}for(qe=x(qe);!Bt.done;gt++,Bt=ue.next())Bt=he(qe,oe,gt,Bt.value,ye),Bt!==null&&(s&&Bt.alternate!==null&&qe.delete(Bt.key===null?gt:Bt.key),ne=N(Bt,ne,gt),$t===null?Ye=Bt:$t.sibling=Bt,$t=Bt);return s&&qe.forEach(function(HW){return u(oe,HW)}),At&&$o(oe,gt),Ye}function Zt(oe,ne,ue,ye){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 Ye=ue.key;ne!==null;){if(ne.key===Ye){if(Ye=ue.type,Ye===w){if(ne.tag===7){p(oe,ne.sibling),ye=E(ne,ue.props.children),ye.return=oe,oe=ye;break e}}else if(ne.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===P&&gu(Ye)===ne.type){p(oe,ne.sibling),ye=E(ne,ue.props),gh(ye,ue),ye.return=oe,oe=ye;break e}p(oe,ne);break}else u(oe,ne);ne=ne.sibling}ue.type===w?(ye=du(ue.props.children,oe.mode,ye,ue.key),ye.return=oe,oe=ye):(ye=Fg(ue.type,ue.key,ue.props,null,oe.mode,ye),gh(ye,ue),ye.return=oe,oe=ye)}return M(oe);case b:e:{for(Ye=ue.key;ne!==null;){if(ne.key===Ye)if(ne.tag===4&&ne.stateNode.containerInfo===ue.containerInfo&&ne.stateNode.implementation===ue.implementation){p(oe,ne.sibling),ye=E(ne,ue.children||[]),ye.return=oe,oe=ye;break e}else{p(oe,ne);break}else u(oe,ne);ne=ne.sibling}ye=Pw(ue,oe.mode,ye),ye.return=oe,oe=ye}return M(oe);case P:return ue=gu(ue),Zt(oe,ne,ue,ye)}if(q(ue))return Le(oe,ne,ue,ye);if(D(ue)){if(Ye=D(ue),typeof Ye!="function")throw Error(r(150));return ue=Ye.call(ue),rt(oe,ne,ue,ye)}if(typeof ue.then=="function")return Zt(oe,ne,Xg(ue),ye);if(ue.$$typeof===_)return Zt(oe,ne,qg(oe,ue),ye);Gg(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ne!==null&&ne.tag===6?(p(oe,ne.sibling),ye=E(ne,ue),ye.return=oe,oe=ye):(p(oe,ne),ye=Tw(ue,oe.mode,ye),ye.return=oe,oe=ye),M(oe)):p(oe,ne)}return function(oe,ne,ue,ye){try{ph=0;var Ye=Zt(oe,ne,ue,ye);return ed=null,Ye}catch(qe){if(qe===Jc||qe===Kg)throw qe;var $t=ji(29,qe,null,oe.mode);return $t.lanes=ye,$t.return=oe,$t}finally{}}}var yu=NT(!0),kT=NT(!1),Gs=!1;function qw(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vw(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ws(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Qs(s,u,p){var x=s.updateQueue;if(x===null)return null;if(x=x.shared,(Ht&2)!==0){var E=x.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),x.pending=u,u=Bg(s),dT(s,null,p),u}return $g(s,x,u,p),Bg(s)}function vh(s,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194048)!==0)){var x=u.lanes;x&=s.pendingLanes,p|=x,u.lanes=p,mr(s,p)}}function Kw(s,u){var p=s.updateQueue,x=s.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var E=null,N=null;if(p=p.firstBaseUpdate,p!==null){do{var M={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};N===null?E=N=M:N=N.next=M,p=p.next}while(p!==null);N===null?E=N=u:N=N.next=u}else E=N=u;p={baseState:x.baseState,firstBaseUpdate:E,lastBaseUpdate:N,shared:x.shared,callbacks:x.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=u:s.next=u,p.lastBaseUpdate=u}var Yw=!1;function yh(){if(Yw){var s=Zc;if(s!==null)throw s}}function xh(s,u,p,x){Yw=!1;var E=s.updateQueue;Gs=!1;var N=E.firstBaseUpdate,M=E.lastBaseUpdate,Y=E.shared.pending;if(Y!==null){E.shared.pending=null;var J=Y,de=J.next;J.next=null,M===null?N=de:M.next=de,M=J;var ve=s.alternate;ve!==null&&(ve=ve.updateQueue,Y=ve.lastBaseUpdate,Y!==M&&(Y===null?ve.firstBaseUpdate=de:Y.next=de,ve.lastBaseUpdate=J))}if(N!==null){var we=E.baseState;M=0,ve=de=J=null,Y=N;do{var fe=Y.lane&-536870913,he=fe!==Y.lane;if(he?(Nt&fe)===fe:(x&fe)===fe){fe!==0&&fe===Qc&&(Yw=!0),ve!==null&&(ve=ve.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var Le=s,rt=Y;fe=u;var Zt=p;switch(rt.tag){case 1:if(Le=rt.payload,typeof Le=="function"){we=Le.call(Zt,we,fe);break e}we=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=rt.payload,fe=typeof Le=="function"?Le.call(Zt,we,fe):Le,fe==null)break e;we=f({},we,fe);break e;case 2:Gs=!0}}fe=Y.callback,fe!==null&&(s.flags|=64,he&&(s.flags|=8192),he=E.callbacks,he===null?E.callbacks=[fe]:he.push(fe))}else he={lane:fe,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},ve===null?(de=ve=he,J=we):ve=ve.next=he,M|=fe;if(Y=Y.next,Y===null){if(Y=E.shared.pending,Y===null)break;he=Y,Y=he.next,he.next=null,E.lastBaseUpdate=he,E.shared.pending=null}}while(!0);ve===null&&(J=we),E.baseState=J,E.firstBaseUpdate=de,E.lastBaseUpdate=ve,N===null&&(E.shared.lanes=0),nl|=M,s.lanes=M,s.memoizedState=we}}function AT(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function OT(s,u){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)AT(p[s],u)}var td=H(null),Wg=H(0);function TT(s,u){s=Wo,B(Wg,s),B(td,u),Wo=s|u.baseLanes}function Xw(){B(Wg,Wo),B(td,td.current)}function Gw(){Wo=Wg.current,U(td),U(Wg)}var Ei=H(null),Wi=null;function Zs(s){var u=s.alternate;B(Fn,Fn.current&1),B(Ei,s),Wi===null&&(u===null||td.current!==null||u.memoizedState!==null)&&(Wi=s)}function Ww(s){B(Fn,Fn.current),B(Ei,s),Wi===null&&(Wi=s)}function PT(s){s.tag===22?(B(Fn,Fn.current),B(Ei,s),Wi===null&&(Wi=s)):Js()}function Js(){B(Fn,Fn.current),B(Ei,Ei.current)}function _i(s){U(Ei),Wi===s&&(Wi=null),U(Fn)}var Fn=H(0);function Qg(s){for(var u=s;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||nS(p)||rS(p)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Uo=0,ht=null,Wt=null,Vn=null,Zg=!1,nd=!1,xu=!1,Jg=0,bh=0,rd=null,MG=0;function Mn(){throw Error(r(321))}function Qw(s,u){if(u===null)return!1;for(var p=0;p<u.length&&p<s.length;p++)if(!Si(s[p],u[p]))return!1;return!0}function Zw(s,u,p,x,E,N){return Uo=N,ht=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,$.H=s===null||s.memoizedState===null?pP:h1,xu=!1,N=p(x,E),xu=!1,nd&&(N=RT(u,p,x,E)),MT(s),N}function MT(s){$.H=jh;var u=Wt!==null&&Wt.next!==null;if(Uo=0,Vn=Wt=ht=null,Zg=!1,bh=0,rd=null,u)throw Error(r(300));s===null||Kn||(s=s.dependencies,s!==null&&Hg(s)&&(Kn=!0))}function RT(s,u,p,x){ht=s;var E=0;do{if(nd&&(rd=null),bh=0,nd=!1,25<=E)throw Error(r(301));if(E+=1,Vn=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)}$.H=gP,N=u(p,x)}while(nd);return N}function RG(){var s=$.H,u=s.useState()[0];return u=typeof u.then=="function"?wh(u):u,s=s.useState()[0],(Wt!==null?Wt.memoizedState:null)!==s&&(ht.flags|=1024),u}function Jw(){var s=Jg!==0;return Jg=0,s}function e1(s,u,p){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~p}function t1(s){if(Zg){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}Zg=!1}Uo=0,Vn=Wt=ht=null,nd=!1,bh=Jg=0,rd=null}function Qr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?ht.memoizedState=Vn=s:Vn=Vn.next=s,Vn}function Un(){if(Wt===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=Wt.next;var u=Vn===null?ht.memoizedState:Vn.next;if(u!==null)Vn=u,Wt=s;else{if(s===null)throw ht.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},Vn===null?ht.memoizedState=Vn=s:Vn=Vn.next=s}return Vn}function ev(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wh(s){var u=bh;return bh+=1,rd===null&&(rd=[]),s=ET(rd,s,u),u=ht,(Vn===null?u.memoizedState:Vn.next)===null&&(u=u.alternate,$.H=u===null||u.memoizedState===null?pP:h1),s}function tv(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return wh(s);if(s.$$typeof===_)return Cr(s)}throw Error(r(438,String(s)))}function n1(s){var u=null,p=ht.updateQueue;if(p!==null&&(u=p.memoCache),u==null){var x=ht.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(u={data:x.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),p===null&&(p=ev(),ht.updateQueue=p),p.memoCache=u,p=u.data[u.index],p===void 0)for(p=u.data[u.index]=Array(s),x=0;x<s;x++)p[x]=L;return u.index++,p}function Ho(s,u){return typeof u=="function"?u(s):u}function nv(s){var u=Un();return r1(u,Wt,s)}function r1(s,u,p){var x=s.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=p;var E=s.baseQueue,N=x.pending;if(N!==null){if(E!==null){var M=E.next;E.next=N.next,N.next=M}u.baseQueue=E=N,x.pending=null}if(N=s.baseState,E===null)s.memoizedState=N;else{u=E.next;var Y=M=null,J=null,de=u,ve=!1;do{var we=de.lane&-536870913;if(we!==de.lane?(Nt&we)===we:(Uo&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===Qc&&(ve=!0);else if((Uo&fe)===fe){de=de.next,fe===Qc&&(ve=!0);continue}else we={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},J===null?(Y=J=we,M=N):J=J.next=we,ht.lanes|=fe,nl|=fe;we=de.action,xu&&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?(Y=J=fe,M=N):J=J.next=fe,ht.lanes|=we,nl|=we;de=de.next}while(de!==null&&de!==u);if(J===null?M=N:J.next=Y,!Si(N,s.memoizedState)&&(Kn=!0,ve&&(p=Zc,p!==null)))throw p;s.memoizedState=N,s.baseState=M,s.baseQueue=J,x.lastRenderedState=N}return E===null&&(x.lanes=0),[s.memoizedState,x.dispatch]}function i1(s){var u=Un(),p=u.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var x=p.dispatch,E=p.pending,N=u.memoizedState;if(E!==null){p.pending=null;var M=E=E.next;do N=s(N,M.action),M=M.next;while(M!==E);Si(N,u.memoizedState)||(Kn=!0),u.memoizedState=N,u.baseQueue===null&&(u.baseState=N),p.lastRenderedState=N}return[N,x]}function DT(s,u,p){var x=ht,E=Un(),N=At;if(N){if(p===void 0)throw Error(r(407));p=p()}else p=u();var M=!Si((Wt||E).memoizedState,p);if(M&&(E.memoizedState=p,Kn=!0),E=E.queue,s1(zT.bind(null,x,E,s),[s]),E.getSnapshot!==u||M||Vn!==null&&Vn.memoizedState.tag&1){if(x.flags|=2048,id(9,{destroy:void 0},LT.bind(null,x,E,p,u),null),sn===null)throw Error(r(349));N||(Uo&127)!==0||IT(x,u,p)}return p}function IT(s,u,p){s.flags|=16384,s={getSnapshot:u,value:p},u=ht.updateQueue,u===null?(u=ev(),ht.updateQueue=u,u.stores=[s]):(p=u.stores,p===null?u.stores=[s]:p.push(s))}function LT(s,u,p,x){u.value=p,u.getSnapshot=x,$T(u)&&BT(s)}function zT(s,u,p){return p(function(){$T(u)&&BT(s)})}function $T(s){var u=s.getSnapshot;s=s.value;try{var p=u();return!Si(s,p)}catch{return!0}}function BT(s){var u=cu(s,2);u!==null&&hi(u,s,2)}function a1(s){var u=Qr();if(typeof s=="function"){var p=s;if(s=p(),xu){wt(!0);try{p()}finally{wt(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:s},u}function FT(s,u,p,x){return s.baseState=p,r1(s,Wt,typeof x=="function"?x:Ho)}function DG(s,u,p,x,E){if(av(s))throw Error(r(485));if(s=u.action,s!==null){var N={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){N.listeners.push(M)}};$.T!==null?p(!0):N.isTransition=!1,x(N),p=u.pending,p===null?(N.next=u.pending=N,UT(u,N)):(N.next=p.next,u.pending=p.next=N)}}function UT(s,u){var p=u.action,x=u.payload,E=s.state;if(u.isTransition){var N=$.T,M={};$.T=M;try{var Y=p(E,x),J=$.S;J!==null&&J(M,Y),HT(s,u,Y)}catch(de){o1(s,u,de)}finally{N!==null&&M.types!==null&&(N.types=M.types),$.T=N}}else try{N=p(E,x),HT(s,u,N)}catch(de){o1(s,u,de)}}function HT(s,u,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(x){qT(s,u,x)},function(x){return o1(s,u,x)}):qT(s,u,p)}function qT(s,u,p){u.status="fulfilled",u.value=p,VT(u),s.state=p,u=s.pending,u!==null&&(p=u.next,p===u?s.pending=null:(p=p.next,u.next=p,UT(s,p)))}function o1(s,u,p){var x=s.pending;if(s.pending=null,x!==null){x=x.next;do u.status="rejected",u.reason=p,VT(u),u=u.next;while(u!==x)}s.action=null}function VT(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function KT(s,u){return u}function YT(s,u){if(At){var p=sn.formState;if(p!==null){e:{var x=ht;if(At){if(mn){t:{for(var E=mn,N=Gi;E.nodeType!==8;){if(!N){E=null;break t}if(E=Qi(E.nextSibling),E===null){E=null;break t}}N=E.data,E=N==="F!"||N==="F"?E:null}if(E){mn=Qi(E.nextSibling),x=E.data==="F!";break e}}Ys(x)}x=!1}x&&(u=p[0])}}return p=Qr(),p.memoizedState=p.baseState=u,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:KT,lastRenderedState:u},p.queue=x,p=fP.bind(null,ht,x),x.dispatch=p,x=a1(!1),N=f1.bind(null,ht,!1,x.queue),x=Qr(),E={state:u,dispatch:null,action:s,pending:null},x.queue=E,p=DG.bind(null,ht,E,N,p),E.dispatch=p,x.memoizedState=s,[u,p,!1]}function XT(s){var u=Un();return GT(u,Wt,s)}function GT(s,u,p){if(u=r1(s,u,KT)[0],s=nv(Ho)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var x=wh(u)}catch(M){throw M===Jc?Kg:M}else x=u;u=Un();var E=u.queue,N=E.dispatch;return p!==u.memoizedState&&(ht.flags|=2048,id(9,{destroy:void 0},IG.bind(null,E,p),null)),[x,N,s]}function IG(s,u){s.action=u}function WT(s){var u=Un(),p=Wt;if(p!==null)return GT(u,p,s);Un(),u=u.memoizedState,p=Un();var x=p.queue.dispatch;return p.memoizedState=s,[u,x,!1]}function id(s,u,p,x){return s={tag:s,create:p,deps:x,inst:u,next:null},u=ht.updateQueue,u===null&&(u=ev(),ht.updateQueue=u),p=u.lastEffect,p===null?u.lastEffect=s.next=s:(x=p.next,p.next=s,s.next=x,u.lastEffect=s),s}function QT(){return Un().memoizedState}function rv(s,u,p,x){var E=Qr();ht.flags|=s,E.memoizedState=id(1|u,{destroy:void 0},p,x===void 0?null:x)}function iv(s,u,p,x){var E=Un();x=x===void 0?null:x;var N=E.memoizedState.inst;Wt!==null&&x!==null&&Qw(x,Wt.memoizedState.deps)?E.memoizedState=id(u,N,p,x):(ht.flags|=s,E.memoizedState=id(1|u,N,p,x))}function ZT(s,u){rv(8390656,8,s,u)}function s1(s,u){iv(2048,8,s,u)}function LG(s){ht.flags|=4;var u=ht.updateQueue;if(u===null)u=ev(),ht.updateQueue=u,u.events=[s];else{var p=u.events;p===null?u.events=[s]:p.push(s)}}function JT(s){var u=Un().memoizedState;return LG({ref:u,nextImpl:s}),function(){if((Ht&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function eP(s,u){return iv(4,2,s,u)}function tP(s,u){return iv(4,4,s,u)}function nP(s,u){if(typeof u=="function"){s=s();var p=u(s);return function(){typeof p=="function"?p():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function rP(s,u,p){p=p!=null?p.concat([s]):null,iv(4,4,nP.bind(null,u,s),p)}function l1(){}function iP(s,u){var p=Un();u=u===void 0?null:u;var x=p.memoizedState;return u!==null&&Qw(u,x[1])?x[0]:(p.memoizedState=[s,u],s)}function aP(s,u){var p=Un();u=u===void 0?null:u;var x=p.memoizedState;if(u!==null&&Qw(u,x[1]))return x[0];if(x=s(),xu){wt(!0);try{s()}finally{wt(!1)}}return p.memoizedState=[x,u],x}function u1(s,u,p){return p===void 0||(Uo&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=u:(s.memoizedState=p,s=oM(),ht.lanes|=s,nl|=s,p)}function oP(s,u,p,x){return Si(p,u)?p:td.current!==null?(s=u1(s,p,x),Si(s,u)||(Kn=!0),s):(Uo&42)===0||(Uo&1073741824)!==0&&(Nt&261930)===0?(Kn=!0,s.memoizedState=p):(s=oM(),ht.lanes|=s,nl|=s,u)}function sP(s,u,p,x,E){var N=V.p;V.p=N!==0&&8>N?N:8;var M=$.T,Y={};$.T=Y,f1(s,!1,u,p);try{var J=E(),de=$.S;if(de!==null&&de(Y,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ve=PG(J,x);Sh(s,u,ve,ki(s))}else Sh(s,u,x,ki(s))}catch(we){Sh(s,u,{then:function(){},status:"rejected",reason:we},ki())}finally{V.p=N,M!==null&&Y.types!==null&&(M.types=Y.types),$.T=M}}function zG(){}function c1(s,u,p,x){if(s.tag!==5)throw Error(r(476));var E=lP(s).queue;sP(s,E,u,G,p===null?zG:function(){return uP(s),p(x)})}function lP(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:G},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:p},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function uP(s){var u=lP(s);u.next===null&&(u=s.alternate.memoizedState),Sh(s,u.next.queue,{},ki())}function d1(){return Cr($h)}function cP(){return Un().memoizedState}function dP(){return Un().memoizedState}function $G(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var p=ki();s=Ws(p);var x=Qs(u,s,p);x!==null&&(hi(x,u,p),vh(x,u,p)),u={cache:Bw()},s.payload=u;return}u=u.return}}function BG(s,u,p){var x=ki();p={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},av(s)?hP(u,p):(p=Aw(s,u,p,x),p!==null&&(hi(p,s,x),mP(p,u,x)))}function fP(s,u,p){var x=ki();Sh(s,u,p,x)}function Sh(s,u,p,x){var E={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(av(s))hP(u,E);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=u.lastRenderedReducer,N!==null))try{var M=u.lastRenderedState,Y=N(M,p);if(E.hasEagerState=!0,E.eagerState=Y,Si(Y,M))return $g(s,u,E,0),sn===null&&zg(),!1}catch{}finally{}if(p=Aw(s,u,E,x),p!==null)return hi(p,s,x),mP(p,u,x),!0}return!1}function f1(s,u,p,x){if(x={lane:2,revertLane:q1(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},av(s)){if(u)throw Error(r(479))}else u=Aw(s,p,x,2),u!==null&&hi(u,s,2)}function av(s){var u=s.alternate;return s===ht||u!==null&&u===ht}function hP(s,u){nd=Zg=!0;var p=s.pending;p===null?u.next=u:(u.next=p.next,p.next=u),s.pending=u}function mP(s,u,p){if((p&4194048)!==0){var x=u.lanes;x&=s.pendingLanes,p|=x,u.lanes=p,mr(s,p)}}var jh={readContext:Cr,use:tv,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useLayoutEffect:Mn,useInsertionEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useSyncExternalStore:Mn,useId:Mn,useHostTransitionStatus:Mn,useFormState:Mn,useActionState:Mn,useOptimistic:Mn,useMemoCache:Mn,useCacheRefresh:Mn};jh.useEffectEvent=Mn;var pP={readContext:Cr,use:tv,useCallback:function(s,u){return Qr().memoizedState=[s,u===void 0?null:u],s},useContext:Cr,useEffect:ZT,useImperativeHandle:function(s,u,p){p=p!=null?p.concat([s]):null,rv(4194308,4,nP.bind(null,u,s),p)},useLayoutEffect:function(s,u){return rv(4194308,4,s,u)},useInsertionEffect:function(s,u){rv(4,2,s,u)},useMemo:function(s,u){var p=Qr();u=u===void 0?null:u;var x=s();if(xu){wt(!0);try{s()}finally{wt(!1)}}return p.memoizedState=[x,u],x},useReducer:function(s,u,p){var x=Qr();if(p!==void 0){var E=p(u);if(xu){wt(!0);try{p(u)}finally{wt(!1)}}}else E=u;return x.memoizedState=x.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},x.queue=s,s=s.dispatch=BG.bind(null,ht,s),[x.memoizedState,s]},useRef:function(s){var u=Qr();return s={current:s},u.memoizedState=s},useState:function(s){s=a1(s);var u=s.queue,p=fP.bind(null,ht,u);return u.dispatch=p,[s.memoizedState,p]},useDebugValue:l1,useDeferredValue:function(s,u){var p=Qr();return u1(p,s,u)},useTransition:function(){var s=a1(!1);return s=sP.bind(null,ht,s.queue,!0,!1),Qr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,p){var x=ht,E=Qr();if(At){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),sn===null)throw Error(r(349));(Nt&127)!==0||IT(x,u,p)}E.memoizedState=p;var N={value:p,getSnapshot:u};return E.queue=N,ZT(zT.bind(null,x,N,s),[s]),x.flags|=2048,id(9,{destroy:void 0},LT.bind(null,x,N,p,u),null),p},useId:function(){var s=Qr(),u=sn.identifierPrefix;if(At){var p=ro,x=no;p=(x&~(1<<32-ct(x)-1)).toString(32)+p,u="_"+u+"R_"+p,p=Jg++,0<p&&(u+="H"+p.toString(32)),u+="_"}else p=MG++,u="_"+u+"r_"+p.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:d1,useFormState:YT,useActionState:YT,useOptimistic:function(s){var u=Qr();u.memoizedState=u.baseState=s;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=p,u=f1.bind(null,ht,!0,p),p.dispatch=u,[s,u]},useMemoCache:n1,useCacheRefresh:function(){return Qr().memoizedState=$G.bind(null,ht)},useEffectEvent:function(s){var u=Qr(),p={impl:s};return u.memoizedState=p,function(){if((Ht&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},h1={readContext:Cr,use:tv,useCallback:iP,useContext:Cr,useEffect:s1,useImperativeHandle:rP,useInsertionEffect:eP,useLayoutEffect:tP,useMemo:aP,useReducer:nv,useRef:QT,useState:function(){return nv(Ho)},useDebugValue:l1,useDeferredValue:function(s,u){var p=Un();return oP(p,Wt.memoizedState,s,u)},useTransition:function(){var s=nv(Ho)[0],u=Un().memoizedState;return[typeof s=="boolean"?s:wh(s),u]},useSyncExternalStore:DT,useId:cP,useHostTransitionStatus:d1,useFormState:XT,useActionState:XT,useOptimistic:function(s,u){var p=Un();return FT(p,Wt,s,u)},useMemoCache:n1,useCacheRefresh:dP};h1.useEffectEvent=JT;var gP={readContext:Cr,use:tv,useCallback:iP,useContext:Cr,useEffect:s1,useImperativeHandle:rP,useInsertionEffect:eP,useLayoutEffect:tP,useMemo:aP,useReducer:i1,useRef:QT,useState:function(){return i1(Ho)},useDebugValue:l1,useDeferredValue:function(s,u){var p=Un();return Wt===null?u1(p,s,u):oP(p,Wt.memoizedState,s,u)},useTransition:function(){var s=i1(Ho)[0],u=Un().memoizedState;return[typeof s=="boolean"?s:wh(s),u]},useSyncExternalStore:DT,useId:cP,useHostTransitionStatus:d1,useFormState:WT,useActionState:WT,useOptimistic:function(s,u){var p=Un();return Wt!==null?FT(p,Wt,s,u):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:n1,useCacheRefresh:dP};gP.useEffectEvent=JT;function m1(s,u,p,x){u=s.memoizedState,p=p(x,u),p=p==null?u:f({},u,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var p1={enqueueSetState:function(s,u,p){s=s._reactInternals;var x=ki(),E=Ws(x);E.payload=u,p!=null&&(E.callback=p),u=Qs(s,E,x),u!==null&&(hi(u,s,x),vh(u,s,x))},enqueueReplaceState:function(s,u,p){s=s._reactInternals;var x=ki(),E=Ws(x);E.tag=1,E.payload=u,p!=null&&(E.callback=p),u=Qs(s,E,x),u!==null&&(hi(u,s,x),vh(u,s,x))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var p=ki(),x=Ws(p);x.tag=2,u!=null&&(x.callback=u),u=Qs(s,x,p),u!==null&&(hi(u,s,p),vh(u,s,p))}};function vP(s,u,p,x,E,N,M){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(x,N,M):u.prototype&&u.prototype.isPureReactComponent?!uh(p,x)||!uh(E,N):!0}function yP(s,u,p,x){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,x),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,x),u.state!==s&&p1.enqueueReplaceState(u,u.state,null)}function bu(s,u){var p=u;if("ref"in u){p={};for(var x in u)x!=="ref"&&(p[x]=u[x])}if(s=s.defaultProps){p===u&&(p=f({},p));for(var E in s)p[E]===void 0&&(p[E]=s[E])}return p}function xP(s){Lg(s)}function bP(s){console.error(s)}function wP(s){Lg(s)}function ov(s,u){try{var p=s.onUncaughtError;p(u.value,{componentStack:u.stack})}catch(x){setTimeout(function(){throw x})}}function SP(s,u,p){try{var x=s.onCaughtError;x(p.value,{componentStack:p.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function g1(s,u,p){return p=Ws(p),p.tag=3,p.payload={element:null},p.callback=function(){ov(s,u)},p}function jP(s){return s=Ws(s),s.tag=3,s}function EP(s,u,p,x){var E=p.type.getDerivedStateFromError;if(typeof E=="function"){var N=x.value;s.payload=function(){return E(N)},s.callback=function(){SP(u,p,x)}}var M=p.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(s.callback=function(){SP(u,p,x),typeof E!="function"&&(rl===null?rl=new Set([this]):rl.add(this));var Y=x.stack;this.componentDidCatch(x.value,{componentStack:Y!==null?Y:""})})}function FG(s,u,p,x,E){if(p.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(u=p.alternate,u!==null&&Wc(u,p,E,!0),p=Ei.current,p!==null){switch(p.tag){case 31:case 13:return Wi===null?yv():p.alternate===null&&Rn===0&&(Rn=3),p.flags&=-257,p.flags|=65536,p.lanes=E,x===Yg?p.flags|=16384:(u=p.updateQueue,u===null?p.updateQueue=new Set([x]):u.add(x),F1(s,x,E)),!1;case 22:return p.flags|=65536,x===Yg?p.flags|=16384:(u=p.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([x])},p.updateQueue=u):(p=u.retryQueue,p===null?u.retryQueue=new Set([x]):p.add(x)),F1(s,x,E)),!1}throw Error(r(435,p.tag))}return F1(s,x,E),yv(),!1}if(At)return u=Ei.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,x!==Dw&&(s=Error(r(422),{cause:x}),fh(Ki(s,p)))):(x!==Dw&&(u=Error(r(423),{cause:x}),fh(Ki(u,p))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,x=Ki(x,p),E=g1(s.stateNode,x,E),Kw(s,E),Rn!==4&&(Rn=2)),!1;var N=Error(r(520),{cause:x});if(N=Ki(N,p),Th===null?Th=[N]:Th.push(N),Rn!==4&&(Rn=2),u===null)return!0;x=Ki(x,p),p=u;do{switch(p.tag){case 3:return p.flags|=65536,s=E&-E,p.lanes|=s,s=g1(p.stateNode,x,s),Kw(p,s),!1;case 1:if(u=p.type,N=p.stateNode,(p.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(rl===null||!rl.has(N))))return p.flags|=65536,E&=-E,p.lanes|=E,E=jP(E),EP(E,s,p,x),Kw(p,E),!1}p=p.return}while(p!==null);return!1}var v1=Error(r(461)),Kn=!1;function Nr(s,u,p,x){u.child=s===null?kT(u,null,p,x):yu(u,s.child,p,x)}function _P(s,u,p,x,E){p=p.render;var N=u.ref;if("ref"in x){var M={};for(var Y in x)Y!=="ref"&&(M[Y]=x[Y])}else M=x;return mu(u),x=Zw(s,u,p,M,N,E),Y=Jw(),s!==null&&!Kn?(e1(s,u,E),qo(s,u,E)):(At&&Y&&Mw(u),u.flags|=1,Nr(s,u,x,E),u.child)}function CP(s,u,p,x,E){if(s===null){var N=p.type;return typeof N=="function"&&!Ow(N)&&N.defaultProps===void 0&&p.compare===null?(u.tag=15,u.type=N,NP(s,u,N,x,E)):(s=Fg(p.type,null,x,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(N=s.child,!_1(s,E)){var M=N.memoizedProps;if(p=p.compare,p=p!==null?p:uh,p(M,x)&&s.ref===u.ref)return qo(s,u,E)}return u.flags|=1,s=zo(N,x),s.ref=u.ref,s.return=u,u.child=s}function NP(s,u,p,x,E){if(s!==null){var N=s.memoizedProps;if(uh(N,x)&&s.ref===u.ref)if(Kn=!1,u.pendingProps=x=N,_1(s,E))(s.flags&131072)!==0&&(Kn=!0);else return u.lanes=s.lanes,qo(s,u,E)}return y1(s,u,p,x,E)}function kP(s,u,p,x){var E=x.children,N=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((u.flags&128)!==0){if(N=N!==null?N.baseLanes|p:p,s!==null){for(x=u.child=s.child,E=0;x!==null;)E=E|x.lanes|x.childLanes,x=x.sibling;x=E&~N}else x=0,u.child=null;return AP(s,u,N,p,x)}if((p&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Vg(u,N!==null?N.cachePool:null),N!==null?TT(u,N):Xw(),PT(u);else return x=u.lanes=536870912,AP(s,u,N!==null?N.baseLanes|p:p,p,x)}else N!==null?(Vg(u,N.cachePool),TT(u,N),Js(),u.memoizedState=null):(s!==null&&Vg(u,null),Xw(),Js());return Nr(s,u,E,p),u.child}function Eh(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function AP(s,u,p,x,E){var N=Uw();return N=N===null?null:{parent:qn._currentValue,pool:N},u.memoizedState={baseLanes:p,cachePool:N},s!==null&&Vg(u,null),Xw(),PT(u),s!==null&&Wc(s,u,x,!0),u.childLanes=E,null}function sv(s,u){return u=uv({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function OP(s,u,p){return yu(u,s.child,null,p),s=sv(u,u.pendingProps),s.flags|=2,_i(u),u.memoizedState=null,s}function UG(s,u,p){var x=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(At){if(x.mode==="hidden")return s=sv(u,x),u.lanes=536870912,Eh(null,s);if(Ww(u),(s=mn)?(s=UM(s,Gi),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Vs!==null?{id:no,overflow:ro}:null,retryLane:536870912,hydrationErrors:null},p=hT(s),p.return=u,u.child=p,_r=u,mn=null)):s=null,s===null)throw Ys(u);return u.lanes=536870912,null}return sv(u,x)}var N=s.memoizedState;if(N!==null){var M=N.dehydrated;if(Ww(u),E)if(u.flags&256)u.flags&=-257,u=OP(s,u,p);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Kn||Wc(s,u,p,!1),E=(p&s.childLanes)!==0,Kn||E){if(x=sn,x!==null&&(M=er(x,p),M!==0&&M!==N.retryLane))throw N.retryLane=M,cu(s,M),hi(x,s,M),v1;yv(),u=OP(s,u,p)}else s=N.treeContext,mn=Qi(M.nextSibling),_r=u,At=!0,Ks=null,Gi=!1,s!==null&&gT(u,s),u=sv(u,x),u.flags|=4096;return u}return s=zo(s.child,{mode:x.mode,children:x.children}),s.ref=u.ref,u.child=s,s.return=u,s}function lv(s,u){var p=u.ref;if(p===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(s===null||s.ref!==p)&&(u.flags|=4194816)}}function y1(s,u,p,x,E){return mu(u),p=Zw(s,u,p,x,void 0,E),x=Jw(),s!==null&&!Kn?(e1(s,u,E),qo(s,u,E)):(At&&x&&Mw(u),u.flags|=1,Nr(s,u,p,E),u.child)}function TP(s,u,p,x,E,N){return mu(u),u.updateQueue=null,p=RT(u,x,p,E),MT(s),x=Jw(),s!==null&&!Kn?(e1(s,u,N),qo(s,u,N)):(At&&x&&Mw(u),u.flags|=1,Nr(s,u,p,N),u.child)}function PP(s,u,p,x,E){if(mu(u),u.stateNode===null){var N=Kc,M=p.contextType;typeof M=="object"&&M!==null&&(N=Cr(M)),N=new p(x,N),u.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=p1,u.stateNode=N,N._reactInternals=u,N=u.stateNode,N.props=x,N.state=u.memoizedState,N.refs={},qw(u),M=p.contextType,N.context=typeof M=="object"&&M!==null?Cr(M):Kc,N.state=u.memoizedState,M=p.getDerivedStateFromProps,typeof M=="function"&&(m1(u,p,M,x),N.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(M=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),M!==N.state&&p1.enqueueReplaceState(N,N.state,null),xh(u,x,N,E),yh(),N.state=u.memoizedState),typeof N.componentDidMount=="function"&&(u.flags|=4194308),x=!0}else if(s===null){N=u.stateNode;var Y=u.memoizedProps,J=bu(p,Y);N.props=J;var de=N.context,ve=p.contextType;M=Kc,typeof ve=="object"&&ve!==null&&(M=Cr(ve));var we=p.getDerivedStateFromProps;ve=typeof we=="function"||typeof N.getSnapshotBeforeUpdate=="function",Y=u.pendingProps!==Y,ve||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Y||de!==M)&&yP(u,N,x,M),Gs=!1;var fe=u.memoizedState;N.state=fe,xh(u,x,N,E),yh(),de=u.memoizedState,Y||fe!==de||Gs?(typeof we=="function"&&(m1(u,p,we,x),de=u.memoizedState),(J=Gs||vP(u,p,J,x,fe,de,M))?(ve||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"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=de),N.props=x,N.state=de,N.context=M,x=J):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{N=u.stateNode,Vw(s,u),M=u.memoizedProps,ve=bu(p,M),N.props=ve,we=u.pendingProps,fe=N.context,de=p.contextType,J=Kc,typeof de=="object"&&de!==null&&(J=Cr(de)),Y=p.getDerivedStateFromProps,(de=typeof Y=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(M!==we||fe!==J)&&yP(u,N,x,J),Gs=!1,fe=u.memoizedState,N.state=fe,xh(u,x,N,E),yh();var he=u.memoizedState;M!==we||fe!==he||Gs||s!==null&&s.dependencies!==null&&Hg(s.dependencies)?(typeof Y=="function"&&(m1(u,p,Y,x),he=u.memoizedState),(ve=Gs||vP(u,p,ve,x,fe,he,J)||s!==null&&s.dependencies!==null&&Hg(s.dependencies))?(de||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(x,he,J),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(x,he,J)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||M===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||M===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=he),N.props=x,N.state=he,N.context=J,x=ve):(typeof N.componentDidUpdate!="function"||M===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||M===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),x=!1)}return N=x,lv(s,u),x=(u.flags&128)!==0,N||x?(N=u.stateNode,p=x&&typeof p.getDerivedStateFromError!="function"?null:N.render(),u.flags|=1,s!==null&&x?(u.child=yu(u,s.child,null,E),u.child=yu(u,null,p,E)):Nr(s,u,p,E),u.memoizedState=N.state,s=u.child):s=qo(s,u,E),s}function MP(s,u,p,x){return fu(),u.flags|=256,Nr(s,u,p,x),u.child}var x1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function b1(s){return{baseLanes:s,cachePool:ST()}}function w1(s,u,p){return s=s!==null?s.childLanes&~p:0,u&&(s|=Ni),s}function RP(s,u,p){var x=u.pendingProps,E=!1,N=(u.flags&128)!==0,M;if((M=N)||(M=s!==null&&s.memoizedState===null?!1:(Fn.current&2)!==0),M&&(E=!0,u.flags&=-129),M=(u.flags&32)!==0,u.flags&=-33,s===null){if(At){if(E?Zs(u):Js(),(s=mn)?(s=UM(s,Gi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Vs!==null?{id:no,overflow:ro}:null,retryLane:536870912,hydrationErrors:null},p=hT(s),p.return=u,u.child=p,_r=u,mn=null)):s=null,s===null)throw Ys(u);return rS(s)?u.lanes=32:u.lanes=536870912,null}var Y=x.children;return x=x.fallback,E?(Js(),E=u.mode,Y=uv({mode:"hidden",children:Y},E),x=du(x,E,p,null),Y.return=u,x.return=u,Y.sibling=x,u.child=Y,x=u.child,x.memoizedState=b1(p),x.childLanes=w1(s,M,p),u.memoizedState=x1,Eh(null,x)):(Zs(u),S1(u,Y))}var J=s.memoizedState;if(J!==null&&(Y=J.dehydrated,Y!==null)){if(N)u.flags&256?(Zs(u),u.flags&=-257,u=j1(s,u,p)):u.memoizedState!==null?(Js(),u.child=s.child,u.flags|=128,u=null):(Js(),Y=x.fallback,E=u.mode,x=uv({mode:"visible",children:x.children},E),Y=du(Y,E,p,null),Y.flags|=2,x.return=u,Y.return=u,x.sibling=Y,u.child=x,yu(u,s.child,null,p),x=u.child,x.memoizedState=b1(p),x.childLanes=w1(s,M,p),u.memoizedState=x1,u=Eh(null,x));else if(Zs(u),rS(Y)){if(M=Y.nextSibling&&Y.nextSibling.dataset,M)var de=M.dgst;M=de,x=Error(r(419)),x.stack="",x.digest=M,fh({value:x,source:null,stack:null}),u=j1(s,u,p)}else if(Kn||Wc(s,u,p,!1),M=(p&s.childLanes)!==0,Kn||M){if(M=sn,M!==null&&(x=er(M,p),x!==0&&x!==J.retryLane))throw J.retryLane=x,cu(s,x),hi(M,s,x),v1;nS(Y)||yv(),u=j1(s,u,p)}else nS(Y)?(u.flags|=192,u.child=s.child,u=null):(s=J.treeContext,mn=Qi(Y.nextSibling),_r=u,At=!0,Ks=null,Gi=!1,s!==null&&gT(u,s),u=S1(u,x.children),u.flags|=4096);return u}return E?(Js(),Y=x.fallback,E=u.mode,J=s.child,de=J.sibling,x=zo(J,{mode:"hidden",children:x.children}),x.subtreeFlags=J.subtreeFlags&65011712,de!==null?Y=zo(de,Y):(Y=du(Y,E,p,null),Y.flags|=2),Y.return=u,x.return=u,x.sibling=Y,u.child=x,Eh(null,x),x=u.child,Y=s.child.memoizedState,Y===null?Y=b1(p):(E=Y.cachePool,E!==null?(J=qn._currentValue,E=E.parent!==J?{parent:J,pool:J}:E):E=ST(),Y={baseLanes:Y.baseLanes|p,cachePool:E}),x.memoizedState=Y,x.childLanes=w1(s,M,p),u.memoizedState=x1,Eh(s.child,x)):(Zs(u),p=s.child,s=p.sibling,p=zo(p,{mode:"visible",children:x.children}),p.return=u,p.sibling=null,s!==null&&(M=u.deletions,M===null?(u.deletions=[s],u.flags|=16):M.push(s)),u.child=p,u.memoizedState=null,p)}function S1(s,u){return u=uv({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function uv(s,u){return s=ji(22,s,null,u),s.lanes=0,s}function j1(s,u,p){return yu(u,s.child,null,p),s=S1(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function DP(s,u,p){s.lanes|=u;var x=s.alternate;x!==null&&(x.lanes|=u),zw(s.return,u,p)}function E1(s,u,p,x,E,N){var M=s.memoizedState;M===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:p,tailMode:E,treeForkCount:N}:(M.isBackwards=u,M.rendering=null,M.renderingStartTime=0,M.last=x,M.tail=p,M.tailMode=E,M.treeForkCount=N)}function IP(s,u,p){var x=u.pendingProps,E=x.revealOrder,N=x.tail;x=x.children;var M=Fn.current,Y=(M&2)!==0;if(Y?(M=M&1|2,u.flags|=128):M&=1,B(Fn,M),Nr(s,u,x,p),x=At?dh:0,!Y&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&DP(s,p,u);else if(s.tag===19)DP(s,p,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(E){case"forwards":for(p=u.child,E=null;p!==null;)s=p.alternate,s!==null&&Qg(s)===null&&(E=p),p=p.sibling;p=E,p===null?(E=u.child,u.child=null):(E=p.sibling,p.sibling=null),E1(u,!1,E,p,N,x);break;case"backwards":case"unstable_legacy-backwards":for(p=null,E=u.child,u.child=null;E!==null;){if(s=E.alternate,s!==null&&Qg(s)===null){u.child=E;break}s=E.sibling,E.sibling=p,p=E,E=s}E1(u,!0,p,null,N,x);break;case"together":E1(u,!1,null,null,void 0,x);break;default:u.memoizedState=null}return u.child}function qo(s,u,p){if(s!==null&&(u.dependencies=s.dependencies),nl|=u.lanes,(p&u.childLanes)===0)if(s!==null){if(Wc(s,u,p,!1),(p&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,p=zo(s,s.pendingProps),u.child=p,p.return=u;s.sibling!==null;)s=s.sibling,p=p.sibling=zo(s,s.pendingProps),p.return=u;p.sibling=null}return u.child}function _1(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Hg(s)))}function HG(s,u,p){switch(u.tag){case 3:re(u,u.stateNode.containerInfo),Xs(u,qn,s.memoizedState.cache),fu();break;case 27:case 5:se(u);break;case 4:re(u,u.stateNode.containerInfo);break;case 10:Xs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Ww(u),null;break;case 13:var x=u.memoizedState;if(x!==null)return x.dehydrated!==null?(Zs(u),u.flags|=128,null):(p&u.child.childLanes)!==0?RP(s,u,p):(Zs(u),s=qo(s,u,p),s!==null?s.sibling:null);Zs(u);break;case 19:var E=(s.flags&128)!==0;if(x=(p&u.childLanes)!==0,x||(Wc(s,u,p,!1),x=(p&u.childLanes)!==0),E){if(x)return IP(s,u,p);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),B(Fn,Fn.current),x)break;return null;case 22:return u.lanes=0,kP(s,u,p,u.pendingProps);case 24:Xs(u,qn,s.memoizedState.cache)}return qo(s,u,p)}function LP(s,u,p){if(s!==null)if(s.memoizedProps!==u.pendingProps)Kn=!0;else{if(!_1(s,p)&&(u.flags&128)===0)return Kn=!1,HG(s,u,p);Kn=(s.flags&131072)!==0}else Kn=!1,At&&(u.flags&1048576)!==0&&pT(u,dh,u.index);switch(u.lanes=0,u.tag){case 16:e:{var x=u.pendingProps;if(s=gu(u.elementType),u.type=s,typeof s=="function")Ow(s)?(x=bu(s,x),u.tag=1,u=PP(null,u,s,x,p)):(u.tag=0,u=y1(null,u,s,x,p));else{if(s!=null){var E=s.$$typeof;if(E===k){u.tag=11,u=_P(null,u,s,x,p);break e}else if(E===T){u.tag=14,u=CP(null,u,s,x,p);break e}}throw u=R(s)||s,Error(r(306,u,""))}}return u;case 0:return y1(s,u,u.type,u.pendingProps,p);case 1:return x=u.type,E=bu(x,u.pendingProps),PP(s,u,x,E,p);case 3:e:{if(re(u,u.stateNode.containerInfo),s===null)throw Error(r(387));x=u.pendingProps;var N=u.memoizedState;E=N.element,Vw(s,u),xh(u,x,null,p);var M=u.memoizedState;if(x=M.cache,Xs(u,qn,x),x!==N.cache&&$w(u,[qn],p,!0),yh(),x=M.element,N.isDehydrated)if(N={element:x,isDehydrated:!1,cache:M.cache},u.updateQueue.baseState=N,u.memoizedState=N,u.flags&256){u=MP(s,u,x,p);break e}else if(x!==E){E=Ki(Error(r(424)),u),fh(E),u=MP(s,u,x,p);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(mn=Qi(s.firstChild),_r=u,At=!0,Ks=null,Gi=!0,p=kT(u,null,x,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(fu(),x===E){u=qo(s,u,p);break e}Nr(s,u,x,p)}u=u.child}return u;case 26:return lv(s,u),s===null?(p=XM(u.type,null,u.pendingProps,null))?u.memoizedState=p:At||(p=u.type,s=u.pendingProps,x=_v(te.current).createElement(p),x[Lt]=u,x[on]=s,kr(x,p,s),Hn(x),u.stateNode=x):u.memoizedState=XM(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return se(u),s===null&&At&&(x=u.stateNode=VM(u.type,u.pendingProps,te.current),_r=u,Gi=!0,E=mn,sl(u.type)?(iS=E,mn=Qi(x.firstChild)):mn=E),Nr(s,u,u.pendingProps.children,p),lv(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&At&&((E=x=mn)&&(x=xW(x,u.type,u.pendingProps,Gi),x!==null?(u.stateNode=x,_r=u,mn=Qi(x.firstChild),Gi=!1,E=!0):E=!1),E||Ys(u)),se(u),E=u.type,N=u.pendingProps,M=s!==null?s.memoizedProps:null,x=N.children,J1(E,N)?x=null:M!==null&&J1(E,M)&&(u.flags|=32),u.memoizedState!==null&&(E=Zw(s,u,RG,null,null,p),$h._currentValue=E),lv(s,u),Nr(s,u,x,p),u.child;case 6:return s===null&&At&&((s=p=mn)&&(p=bW(p,u.pendingProps,Gi),p!==null?(u.stateNode=p,_r=u,mn=null,s=!0):s=!1),s||Ys(u)),null;case 13:return RP(s,u,p);case 4:return re(u,u.stateNode.containerInfo),x=u.pendingProps,s===null?u.child=yu(u,null,x,p):Nr(s,u,x,p),u.child;case 11:return _P(s,u,u.type,u.pendingProps,p);case 7:return Nr(s,u,u.pendingProps,p),u.child;case 8:return Nr(s,u,u.pendingProps.children,p),u.child;case 12:return Nr(s,u,u.pendingProps.children,p),u.child;case 10:return x=u.pendingProps,Xs(u,u.type,x.value),Nr(s,u,x.children,p),u.child;case 9:return E=u.type._context,x=u.pendingProps.children,mu(u),E=Cr(E),x=x(E),u.flags|=1,Nr(s,u,x,p),u.child;case 14:return CP(s,u,u.type,u.pendingProps,p);case 15:return NP(s,u,u.type,u.pendingProps,p);case 19:return IP(s,u,p);case 31:return UG(s,u,p);case 22:return kP(s,u,p,u.pendingProps);case 24:return mu(u),x=Cr(qn),s===null?(E=Uw(),E===null&&(E=sn,N=Bw(),E.pooledCache=N,N.refCount++,N!==null&&(E.pooledCacheLanes|=p),E=N),u.memoizedState={parent:x,cache:E},qw(u),Xs(u,qn,E)):((s.lanes&p)!==0&&(Vw(s,u),xh(u,null,null,p),yh()),E=s.memoizedState,N=u.memoizedState,E.parent!==x?(E={parent:x,cache:x},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),Xs(u,qn,x)):(x=N.cache,Xs(u,qn,x),x!==E.cache&&$w(u,[qn],p,!0))),Nr(s,u,u.pendingProps.children,p),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Vo(s){s.flags|=4}function C1(s,u,p,x,E){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(cM())s.flags|=8192;else throw vu=Yg,Hw}else s.flags&=-16777217}function zP(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!JM(u))if(cM())s.flags|=8192;else throw vu=Yg,Hw}function cv(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?Ze():536870912,s.lanes|=u,ld|=u)}function _h(s,u){if(!At)switch(s.tailMode){case"hidden":u=s.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.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?u||s.tail===null?s.tail=null:s.tail.sibling=null:x.sibling=null}}function pn(s){var u=s.alternate!==null&&s.alternate.child===s.child,p=0,x=0;if(u)for(var E=s.child;E!==null;)p|=E.lanes|E.childLanes,x|=E.subtreeFlags&65011712,x|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)p|=E.lanes|E.childLanes,x|=E.subtreeFlags,x|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=x,s.childLanes=p,u}function qG(s,u,p){var x=u.pendingProps;switch(Rw(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(u),null;case 1:return pn(u),null;case 3:return p=u.stateNode,x=null,s!==null&&(x=s.memoizedState.cache),u.memoizedState.cache!==x&&(u.flags|=2048),Fo(qn),ee(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(Gc(u)?Vo(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Iw())),pn(u),null;case 26:var E=u.type,N=u.memoizedState;return s===null?(Vo(u),N!==null?(pn(u),zP(u,N)):(pn(u),C1(u,E,null,x,p))):N?N!==s.memoizedState?(Vo(u),pn(u),zP(u,N)):(pn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==x&&Vo(u),pn(u),C1(u,E,s,x,p)),null;case 27:if(ge(u),p=te.current,E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==x&&Vo(u);else{if(!x){if(u.stateNode===null)throw Error(r(166));return pn(u),null}s=Q.current,Gc(u)?vT(u):(s=VM(E,x,p),u.stateNode=s,Vo(u))}return pn(u),null;case 5:if(ge(u),E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==x&&Vo(u);else{if(!x){if(u.stateNode===null)throw Error(r(166));return pn(u),null}if(N=Q.current,Gc(u))vT(u);else{var M=_v(te.current);switch(N){case 1:N=M.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:N=M.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":N=M.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":N=M.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":N=M.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof x.is=="string"?M.createElement("select",{is:x.is}):M.createElement("select"),x.multiple?N.multiple=!0:x.size&&(N.size=x.size);break;default:N=typeof x.is=="string"?M.createElement(E,{is:x.is}):M.createElement(E)}}N[Lt]=u,N[on]=x;e:for(M=u.child;M!==null;){if(M.tag===5||M.tag===6)N.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===u)break e;for(;M.sibling===null;){if(M.return===null||M.return===u)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}u.stateNode=N;e:switch(kr(N,E,x),E){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&Vo(u)}}return pn(u),C1(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,p),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==x&&Vo(u);else{if(typeof x!="string"&&u.stateNode===null)throw Error(r(166));if(s=te.current,Gc(u)){if(s=u.stateNode,p=u.memoizedProps,x=null,E=_r,E!==null)switch(E.tag){case 27:case 5:x=E.memoizedProps}s[Lt]=u,s=!!(s.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||RM(s.nodeValue,p)),s||Ys(u,!0)}else s=_v(s).createTextNode(x),s[Lt]=u,u.stateNode=s}return pn(u),null;case 31:if(p=u.memoizedState,s===null||s.memoizedState!==null){if(x=Gc(u),p!==null){if(s===null){if(!x)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Lt]=u}else fu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;pn(u),s=!1}else p=Iw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return u.flags&256?(_i(u),u):(_i(u),null);if((u.flags&128)!==0)throw Error(r(558))}return pn(u),null;case 13:if(x=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=Gc(u),x!==null&&x.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[Lt]=u}else fu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;pn(u),E=!1}else E=Iw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(_i(u),u):(_i(u),null)}return _i(u),(u.flags&128)!==0?(u.lanes=p,u):(p=x!==null,s=s!==null&&s.memoizedState!==null,p&&(x=u.child,E=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(E=x.alternate.memoizedState.cachePool.pool),N=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(N=x.memoizedState.cachePool.pool),N!==E&&(x.flags|=2048)),p!==s&&p&&(u.child.flags|=8192),cv(u,u.updateQueue),pn(u),null);case 4:return ee(),s===null&&X1(u.stateNode.containerInfo),pn(u),null;case 10:return Fo(u.type),pn(u),null;case 19:if(U(Fn),x=u.memoizedState,x===null)return pn(u),null;if(E=(u.flags&128)!==0,N=x.rendering,N===null)if(E)_h(x,!1);else{if(Rn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(N=Qg(s),N!==null){for(u.flags|=128,_h(x,!1),s=N.updateQueue,u.updateQueue=s,cv(u,s),u.subtreeFlags=0,s=p,p=u.child;p!==null;)fT(p,s),p=p.sibling;return B(Fn,Fn.current&1|2),At&&$o(u,x.treeForkCount),u.child}s=s.sibling}x.tail!==null&&It()>pv&&(u.flags|=128,E=!0,_h(x,!1),u.lanes=4194304)}else{if(!E)if(s=Qg(N),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,cv(u,s),_h(x,!0),x.tail===null&&x.tailMode==="hidden"&&!N.alternate&&!At)return pn(u),null}else 2*It()-x.renderingStartTime>pv&&p!==536870912&&(u.flags|=128,E=!0,_h(x,!1),u.lanes=4194304);x.isBackwards?(N.sibling=u.child,u.child=N):(s=x.last,s!==null?s.sibling=N:u.child=N,x.last=N)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=It(),s.sibling=null,p=Fn.current,B(Fn,E?p&1|2:p&1),At&&$o(u,x.treeForkCount),s):(pn(u),null);case 22:case 23:return _i(u),Gw(),x=u.memoizedState!==null,s!==null?s.memoizedState!==null!==x&&(u.flags|=8192):x&&(u.flags|=8192),x?(p&536870912)!==0&&(u.flags&128)===0&&(pn(u),u.subtreeFlags&6&&(u.flags|=8192)):pn(u),p=u.updateQueue,p!==null&&cv(u,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==p&&(u.flags|=2048),s!==null&&U(pu),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),Fo(qn),pn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function VG(s,u){switch(Rw(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Fo(qn),ee(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return ge(u),null;case 31:if(u.memoizedState!==null){if(_i(u),u.alternate===null)throw Error(r(340));fu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(_i(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));fu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return U(Fn),null;case 4:return ee(),null;case 10:return Fo(u.type),null;case 22:case 23:return _i(u),Gw(),s!==null&&U(pu),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Fo(qn),null;case 25:return null;default:return null}}function $P(s,u){switch(Rw(u),u.tag){case 3:Fo(qn),ee();break;case 26:case 27:case 5:ge(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&_i(u);break;case 13:_i(u);break;case 19:U(Fn);break;case 10:Fo(u.type);break;case 22:case 23:_i(u),Gw(),s!==null&&U(pu);break;case 24:Fo(qn)}}function Ch(s,u){try{var p=u.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var E=x.next;p=E;do{if((p.tag&s)===s){x=void 0;var N=p.create,M=p.inst;x=N(),M.destroy=x}p=p.next}while(p!==E)}}catch(Y){Xt(u,u.return,Y)}}function el(s,u,p){try{var x=u.updateQueue,E=x!==null?x.lastEffect:null;if(E!==null){var N=E.next;x=N;do{if((x.tag&s)===s){var M=x.inst,Y=M.destroy;if(Y!==void 0){M.destroy=void 0,E=u;var J=p,de=Y;try{de()}catch(ve){Xt(E,J,ve)}}}x=x.next}while(x!==N)}}catch(ve){Xt(u,u.return,ve)}}function BP(s){var u=s.updateQueue;if(u!==null){var p=s.stateNode;try{OT(u,p)}catch(x){Xt(s,s.return,x)}}}function FP(s,u,p){p.props=bu(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(x){Xt(s,u,x)}}function Nh(s,u){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(E){Xt(s,u,E)}}function io(s,u){var p=s.ref,x=s.refCleanup;if(p!==null)if(typeof x=="function")try{x()}catch(E){Xt(s,u,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(E){Xt(s,u,E)}else p.current=null}function UP(s){var u=s.type,p=s.memoizedProps,x=s.stateNode;try{e:switch(u){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(E){Xt(s,s.return,E)}}function N1(s,u,p){try{var x=s.stateNode;hW(x,s.type,p,u),x[on]=u}catch(E){Xt(s,s.return,E)}}function HP(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&sl(s.type)||s.tag===4}function k1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||HP(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&&sl(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 A1(s,u,p){var x=s.tag;if(x===5||x===6)s=s.stateNode,u?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,u):(u=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,u.appendChild(s),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=Io));else if(x!==4&&(x===27&&sl(s.type)&&(p=s.stateNode,u=null),s=s.child,s!==null))for(A1(s,u,p),s=s.sibling;s!==null;)A1(s,u,p),s=s.sibling}function dv(s,u,p){var x=s.tag;if(x===5||x===6)s=s.stateNode,u?p.insertBefore(s,u):p.appendChild(s);else if(x!==4&&(x===27&&sl(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(dv(s,u,p),s=s.sibling;s!==null;)dv(s,u,p),s=s.sibling}function qP(s){var u=s.stateNode,p=s.memoizedProps;try{for(var x=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);kr(u,x,p),u[Lt]=s,u[on]=p}catch(N){Xt(s,s.return,N)}}var Ko=!1,Yn=!1,O1=!1,VP=typeof WeakSet=="function"?WeakSet:Set,pr=null;function KG(s,u){if(s=s.containerInfo,Q1=Pv,s=rT(s),jw(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 E=x.anchorOffset,N=x.focusNode;x=x.focusOffset;try{p.nodeType,N.nodeType}catch{p=null;break e}var M=0,Y=-1,J=-1,de=0,ve=0,we=s,fe=null;t:for(;;){for(var he;we!==p||E!==0&&we.nodeType!==3||(Y=M+E),we!==N||x!==0&&we.nodeType!==3||(J=M+x),we.nodeType===3&&(M+=we.nodeValue.length),(he=we.firstChild)!==null;)fe=we,we=he;for(;;){if(we===s)break t;if(fe===p&&++de===E&&(Y=M),fe===N&&++ve===x&&(J=M),(he=we.nextSibling)!==null)break;we=fe,fe=we.parentNode}we=he}p=Y===-1||J===-1?null:{start:Y,end:J}}else p=null}p=p||{start:0,end:0}}else p=null;for(Z1={focusedElem:s,selectionRange:p},Pv=!1,pr=u;pr!==null;)if(u=pr,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,pr=s;else for(;pr!==null;){switch(u=pr,N=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p<s.length;p++)E=s[p],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,p=u,E=N.memoizedProps,N=N.memoizedState,x=p.stateNode;try{var Le=bu(p.type,E);s=x.getSnapshotBeforeUpdate(Le,N),x.__reactInternalSnapshotBeforeUpdate=s}catch(rt){Xt(p,p.return,rt)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,p=s.nodeType,p===9)tS(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":tS(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=u.sibling,s!==null){s.return=u.return,pr=s;break}pr=u.return}}function KP(s,u,p){var x=p.flags;switch(p.tag){case 0:case 11:case 15:Xo(s,p),x&4&&Ch(5,p);break;case 1:if(Xo(s,p),x&4)if(s=p.stateNode,u===null)try{s.componentDidMount()}catch(M){Xt(p,p.return,M)}else{var E=bu(p.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(E,u,s.__reactInternalSnapshotBeforeUpdate)}catch(M){Xt(p,p.return,M)}}x&64&&BP(p),x&512&&Nh(p,p.return);break;case 3:if(Xo(s,p),x&64&&(s=p.updateQueue,s!==null)){if(u=null,p.child!==null)switch(p.child.tag){case 27:case 5:u=p.child.stateNode;break;case 1:u=p.child.stateNode}try{OT(s,u)}catch(M){Xt(p,p.return,M)}}break;case 27:u===null&&x&4&&qP(p);case 26:case 5:Xo(s,p),u===null&&x&4&&UP(p),x&512&&Nh(p,p.return);break;case 12:Xo(s,p);break;case 31:Xo(s,p),x&4&&GP(s,p);break;case 13:Xo(s,p),x&4&&WP(s,p),x&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=tW.bind(null,p),wW(s,p))));break;case 22:if(x=p.memoizedState!==null||Ko,!x){u=u!==null&&u.memoizedState!==null||Yn,E=Ko;var N=Yn;Ko=x,(Yn=u)&&!N?Go(s,p,(p.subtreeFlags&8772)!==0):Xo(s,p),Ko=E,Yn=N}break;case 30:break;default:Xo(s,p)}}function YP(s){var u=s.alternate;u!==null&&(s.alternate=null,YP(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Jf(u)),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 bn=null,ui=!1;function Yo(s,u,p){for(p=p.child;p!==null;)XP(s,u,p),p=p.sibling}function XP(s,u,p){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(je,p)}catch{}switch(p.tag){case 26:Yn||io(p,u),Yo(s,u,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:Yn||io(p,u);var x=bn,E=ui;sl(p.type)&&(bn=p.stateNode,ui=!1),Yo(s,u,p),Ih(p.stateNode),bn=x,ui=E;break;case 5:Yn||io(p,u);case 6:if(x=bn,E=ui,bn=null,Yo(s,u,p),bn=x,ui=E,bn!==null)if(ui)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(p.stateNode)}catch(N){Xt(p,u,N)}else try{bn.removeChild(p.stateNode)}catch(N){Xt(p,u,N)}break;case 18:bn!==null&&(ui?(s=bn,BM(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),gd(s)):BM(bn,p.stateNode));break;case 4:x=bn,E=ui,bn=p.stateNode.containerInfo,ui=!0,Yo(s,u,p),bn=x,ui=E;break;case 0:case 11:case 14:case 15:el(2,p,u),Yn||el(4,p,u),Yo(s,u,p);break;case 1:Yn||(io(p,u),x=p.stateNode,typeof x.componentWillUnmount=="function"&&FP(p,u,x)),Yo(s,u,p);break;case 21:Yo(s,u,p);break;case 22:Yn=(x=Yn)||p.memoizedState!==null,Yo(s,u,p),Yn=x;break;default:Yo(s,u,p)}}function GP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{gd(s)}catch(p){Xt(u,u.return,p)}}}function WP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{gd(s)}catch(p){Xt(u,u.return,p)}}function YG(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new VP),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new VP),u;default:throw Error(r(435,s.tag))}}function fv(s,u){var p=YG(s);u.forEach(function(x){if(!p.has(x)){p.add(x);var E=nW.bind(null,s,x);x.then(E,E)}})}function ci(s,u){var p=u.deletions;if(p!==null)for(var x=0;x<p.length;x++){var E=p[x],N=s,M=u,Y=M;e:for(;Y!==null;){switch(Y.tag){case 27:if(sl(Y.type)){bn=Y.stateNode,ui=!1;break e}break;case 5:bn=Y.stateNode,ui=!1;break e;case 3:case 4:bn=Y.stateNode.containerInfo,ui=!0;break e}Y=Y.return}if(bn===null)throw Error(r(160));XP(N,M,E),bn=null,ui=!1,N=E.alternate,N!==null&&(N.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)QP(u,s),u=u.sibling}var Oa=null;function QP(s,u){var p=s.alternate,x=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ci(u,s),di(s),x&4&&(el(3,s,s.return),Ch(3,s),el(5,s,s.return));break;case 1:ci(u,s),di(s),x&512&&(Yn||p===null||io(p,p.return)),x&64&&Ko&&(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 E=Oa;if(ci(u,s),di(s),x&512&&(Yn||p===null||io(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,E=E.ownerDocument||E;t:switch(x){case"title":N=E.getElementsByTagName("title")[0],(!N||N[iu]||N[Lt]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=E.createElement(x),E.head.insertBefore(N,E.querySelector("head > title"))),kr(N,x,p),N[Lt]=s,Hn(N),x=N;break e;case"link":var M=QM("link","href",E).get(x+(p.href||""));if(M){for(var Y=0;Y<M.length;Y++)if(N=M[Y],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)){M.splice(Y,1);break t}}N=E.createElement(x),kr(N,x,p),E.head.appendChild(N);break;case"meta":if(M=QM("meta","content",E).get(x+(p.content||""))){for(Y=0;Y<M.length;Y++)if(N=M[Y],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)){M.splice(Y,1);break t}}N=E.createElement(x),kr(N,x,p),E.head.appendChild(N);break;default:throw Error(r(468,x))}N[Lt]=s,Hn(N),x=N}s.stateNode=x}else ZM(E,s.type,s.stateNode);else s.stateNode=WM(E,x,s.memoizedProps);else N!==x?(N===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):N.count--,x===null?ZM(E,s.type,s.stateNode):WM(E,x,s.memoizedProps)):x===null&&s.stateNode!==null&&N1(s,s.memoizedProps,p.memoizedProps)}break;case 27:ci(u,s),di(s),x&512&&(Yn||p===null||io(p,p.return)),p!==null&&x&4&&N1(s,s.memoizedProps,p.memoizedProps);break;case 5:if(ci(u,s),di(s),x&512&&(Yn||p===null||io(p,p.return)),s.flags&32){E=s.stateNode;try{$c(E,"")}catch(Le){Xt(s,s.return,Le)}}x&4&&s.stateNode!=null&&(E=s.memoizedProps,N1(s,E,p!==null?p.memoizedProps:E)),x&1024&&(O1=!0);break;case 6:if(ci(u,s),di(s),x&4){if(s.stateNode===null)throw Error(r(162));x=s.memoizedProps,p=s.stateNode;try{p.nodeValue=x}catch(Le){Xt(s,s.return,Le)}}break;case 3:if(kv=null,E=Oa,Oa=Cv(u.containerInfo),ci(u,s),Oa=E,di(s),x&4&&p!==null&&p.memoizedState.isDehydrated)try{gd(u.containerInfo)}catch(Le){Xt(s,s.return,Le)}O1&&(O1=!1,ZP(s));break;case 4:x=Oa,Oa=Cv(s.stateNode.containerInfo),ci(u,s),di(s),Oa=x;break;case 12:ci(u,s),di(s);break;case 31:ci(u,s),di(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,fv(s,x)));break;case 13:ci(u,s),di(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(mv=It()),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,fv(s,x)));break;case 22:E=s.memoizedState!==null;var J=p!==null&&p.memoizedState!==null,de=Ko,ve=Yn;if(Ko=de||E,Yn=ve||J,ci(u,s),Yn=ve,Ko=de,di(s),x&8192)e:for(u=s.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(p===null||J||Ko||Yn||wu(s)),p=null,u=s;;){if(u.tag===5||u.tag===26){if(p===null){J=p=u;try{if(N=J.stateNode,E)M=N.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{Y=J.stateNode;var we=J.memoizedProps.style,fe=we!=null&&we.hasOwnProperty("display")?we.display:null;Y.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Le){Xt(J,J.return,Le)}}}else if(u.tag===6){if(p===null){J=u;try{J.stateNode.nodeValue=E?"":J.memoizedProps}catch(Le){Xt(J,J.return,Le)}}}else if(u.tag===18){if(p===null){J=u;try{var he=J.stateNode;E?FM(he,!0):FM(J.stateNode,!1)}catch(Le){Xt(J,J.return,Le)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}x&4&&(x=s.updateQueue,x!==null&&(p=x.retryQueue,p!==null&&(x.retryQueue=null,fv(s,p))));break;case 19:ci(u,s),di(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,fv(s,x)));break;case 30:break;case 21:break;default:ci(u,s),di(s)}}function di(s){var u=s.flags;if(u&2){try{for(var p,x=s.return;x!==null;){if(HP(x)){p=x;break}x=x.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var E=p.stateNode,N=k1(s);dv(s,N,E);break;case 5:var M=p.stateNode;p.flags&32&&($c(M,""),p.flags&=-33);var Y=k1(s);dv(s,Y,M);break;case 3:case 4:var J=p.stateNode.containerInfo,de=k1(s);A1(s,de,J);break;default:throw Error(r(161))}}catch(ve){Xt(s,s.return,ve)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function ZP(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;ZP(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Xo(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)KP(s,u.alternate,u),u=u.sibling}function wu(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:el(4,u,u.return),wu(u);break;case 1:io(u,u.return);var p=u.stateNode;typeof p.componentWillUnmount=="function"&&FP(u,u.return,p),wu(u);break;case 27:Ih(u.stateNode);case 26:case 5:io(u,u.return),wu(u);break;case 22:u.memoizedState===null&&wu(u);break;case 30:wu(u);break;default:wu(u)}s=s.sibling}}function Go(s,u,p){for(p=p&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var x=u.alternate,E=s,N=u,M=N.flags;switch(N.tag){case 0:case 11:case 15:Go(E,N,p),Ch(4,N);break;case 1:if(Go(E,N,p),x=N,E=x.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(de){Xt(x,x.return,de)}if(x=N,E=x.updateQueue,E!==null){var Y=x.stateNode;try{var J=E.shared.hiddenCallbacks;if(J!==null)for(E.shared.hiddenCallbacks=null,E=0;E<J.length;E++)AT(J[E],Y)}catch(de){Xt(x,x.return,de)}}p&&M&64&&BP(N),Nh(N,N.return);break;case 27:qP(N);case 26:case 5:Go(E,N,p),p&&x===null&&M&4&&UP(N),Nh(N,N.return);break;case 12:Go(E,N,p);break;case 31:Go(E,N,p),p&&M&4&&GP(E,N);break;case 13:Go(E,N,p),p&&M&4&&WP(E,N);break;case 22:N.memoizedState===null&&Go(E,N,p),Nh(N,N.return);break;case 30:break;default:Go(E,N,p)}u=u.sibling}}function T1(s,u){var p=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==p&&(s!=null&&s.refCount++,p!=null&&hh(p))}function P1(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&hh(s))}function Ta(s,u,p,x){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)JP(s,u,p,x),u=u.sibling}function JP(s,u,p,x){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Ta(s,u,p,x),E&2048&&Ch(9,u);break;case 1:Ta(s,u,p,x);break;case 3:Ta(s,u,p,x),E&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&hh(s)));break;case 12:if(E&2048){Ta(s,u,p,x),s=u.stateNode;try{var N=u.memoizedProps,M=N.id,Y=N.onPostCommit;typeof Y=="function"&&Y(M,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(J){Xt(u,u.return,J)}}else Ta(s,u,p,x);break;case 31:Ta(s,u,p,x);break;case 13:Ta(s,u,p,x);break;case 23:break;case 22:N=u.stateNode,M=u.alternate,u.memoizedState!==null?N._visibility&2?Ta(s,u,p,x):kh(s,u):N._visibility&2?Ta(s,u,p,x):(N._visibility|=2,ad(s,u,p,x,(u.subtreeFlags&10256)!==0||!1)),E&2048&&T1(M,u);break;case 24:Ta(s,u,p,x),E&2048&&P1(u.alternate,u);break;default:Ta(s,u,p,x)}}function ad(s,u,p,x,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var N=s,M=u,Y=p,J=x,de=M.flags;switch(M.tag){case 0:case 11:case 15:ad(N,M,Y,J,E),Ch(8,M);break;case 23:break;case 22:var ve=M.stateNode;M.memoizedState!==null?ve._visibility&2?ad(N,M,Y,J,E):kh(N,M):(ve._visibility|=2,ad(N,M,Y,J,E)),E&&de&2048&&T1(M.alternate,M);break;case 24:ad(N,M,Y,J,E),E&&de&2048&&P1(M.alternate,M);break;default:ad(N,M,Y,J,E)}u=u.sibling}}function kh(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var p=s,x=u,E=x.flags;switch(x.tag){case 22:kh(p,x),E&2048&&T1(x.alternate,x);break;case 24:kh(p,x),E&2048&&P1(x.alternate,x);break;default:kh(p,x)}u=u.sibling}}var Ah=8192;function od(s,u,p){if(s.subtreeFlags&Ah)for(s=s.child;s!==null;)eM(s,u,p),s=s.sibling}function eM(s,u,p){switch(s.tag){case 26:od(s,u,p),s.flags&Ah&&s.memoizedState!==null&&MW(p,Oa,s.memoizedState,s.memoizedProps);break;case 5:od(s,u,p);break;case 3:case 4:var x=Oa;Oa=Cv(s.stateNode.containerInfo),od(s,u,p),Oa=x;break;case 22:s.memoizedState===null&&(x=s.alternate,x!==null&&x.memoizedState!==null?(x=Ah,Ah=16777216,od(s,u,p),Ah=x):od(s,u,p));break;default:od(s,u,p)}}function tM(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function Oh(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var p=0;p<u.length;p++){var x=u[p];pr=x,rM(x,s)}tM(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)nM(s),s=s.sibling}function nM(s){switch(s.tag){case 0:case 11:case 15:Oh(s),s.flags&2048&&el(9,s,s.return);break;case 3:Oh(s);break;case 12:Oh(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,hv(s)):Oh(s);break;default:Oh(s)}}function hv(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var p=0;p<u.length;p++){var x=u[p];pr=x,rM(x,s)}tM(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:el(8,u,u.return),hv(u);break;case 22:p=u.stateNode,p._visibility&2&&(p._visibility&=-3,hv(u));break;default:hv(u)}s=s.sibling}}function rM(s,u){for(;pr!==null;){var p=pr;switch(p.tag){case 0:case 11:case 15:el(8,p,u);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:hh(p.memoizedState.cache)}if(x=p.child,x!==null)x.return=p,pr=x;else e:for(p=s;pr!==null;){x=pr;var E=x.sibling,N=x.return;if(YP(x),x===p){pr=null;break e}if(E!==null){E.return=N,pr=E;break e}pr=N}}}var XG={getCacheForType:function(s){var u=Cr(qn),p=u.data.get(s);return p===void 0&&(p=s(),u.data.set(s,p)),p},cacheSignal:function(){return Cr(qn).controller.signal}},GG=typeof WeakMap=="function"?WeakMap:Map,Ht=0,sn=null,St=null,Nt=0,Yt=0,Ci=null,tl=!1,sd=!1,M1=!1,Wo=0,Rn=0,nl=0,Su=0,R1=0,Ni=0,ld=0,Th=null,fi=null,D1=!1,mv=0,iM=0,pv=1/0,gv=null,rl=null,tr=0,il=null,ud=null,Qo=0,I1=0,L1=null,aM=null,Ph=0,z1=null;function ki(){return(Ht&2)!==0&&Nt!==0?Nt&-Nt:$.T!==null?q1():Ls()}function oM(){if(Ni===0)if((Nt&536870912)===0||At){var s=Rr;Rr<<=1,(Rr&3932160)===0&&(Rr=262144),Ni=s}else Ni=536870912;return s=Ei.current,s!==null&&(s.flags|=32),Ni}function hi(s,u,p){(s===sn&&(Yt===2||Yt===9)||s.cancelPendingCommit!==null)&&(cd(s,0),al(s,Nt,Ni,!1)),Ct(s,p),((Ht&2)===0||s!==sn)&&(s===sn&&((Ht&2)===0&&(Su|=p),Rn===4&&al(s,Nt,Ni,!1)),ao(s))}function sM(s,u,p){if((Ht&6)!==0)throw Error(r(327));var x=!p&&(u&127)===0&&(u&s.expiredLanes)===0||qt(s,u),E=x?ZG(s,u):B1(s,u,!0),N=x;do{if(E===0){sd&&!x&&al(s,u,0,!1);break}else{if(p=s.current.alternate,N&&!WG(p)){E=B1(s,u,!1),N=!1;continue}if(E===2){if(N=u,s.errorRecoveryDisabledLanes&N)var M=0;else M=s.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){u=M;e:{var Y=s;E=Th;var J=Y.current.memoizedState.isDehydrated;if(J&&(cd(Y,M).flags|=256),M=B1(Y,M,!1),M!==2){if(M1&&!J){Y.errorRecoveryDisabledLanes|=N,Su|=N,E=4;break e}N=fi,fi=E,N!==null&&(fi===null?fi=N:fi.push.apply(fi,N))}E=M}if(N=!1,E!==2)continue}}if(E===1){cd(s,0),al(s,u,0,!0);break}e:{switch(x=s,N=E,N){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:al(x,u,Ni,!tl);break e;case 2:fi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=mv+300-It(),10<E)){if(al(x,u,Ni,!tl),Qe(x,0,!0)!==0)break e;Qo=u,x.timeoutHandle=zM(lM.bind(null,x,p,fi,gv,D1,u,Ni,Su,ld,tl,N,"Throttled",-0,0),E);break e}lM(x,p,fi,gv,D1,u,Ni,Su,ld,tl,N,null,-0,0)}}break}while(!0);ao(s)}function lM(s,u,p,x,E,N,M,Y,J,de,ve,we,fe,he){if(s.timeoutHandle=-1,we=u.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Io},eM(u,N,we);var Le=(N&62914560)===N?mv-It():(N&4194048)===N?iM-It():0;if(Le=RW(we,Le),Le!==null){Qo=N,s.cancelPendingCommit=Le(gM.bind(null,s,u,N,p,x,E,M,Y,J,ve,we,null,fe,he)),al(s,N,M,!de);return}}gM(s,u,N,p,x,E,M,Y,J)}function WG(s){for(var u=s;;){var p=u.tag;if((p===0||p===11||p===15)&&u.flags&16384&&(p=u.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var x=0;x<p.length;x++){var E=p[x],N=E.getSnapshot;E=E.value;try{if(!Si(N(),E))return!1}catch{return!1}}if(p=u.child,u.subtreeFlags&16384&&p!==null)p.return=u,u=p;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function al(s,u,p,x){u&=~R1,u&=~Su,s.suspendedLanes|=u,s.pingedLanes&=~u,x&&(s.warmLanes|=u),x=s.expirationTimes;for(var E=u;0<E;){var N=31-ct(E),M=1<<N;x[N]=-1,E&=~M}p!==0&&Gr(s,p,u)}function vv(){return(Ht&6)===0?(Mh(0),!1):!0}function $1(){if(St!==null){if(Yt===0)var s=St.return;else s=St,Bo=hu=null,t1(s),ed=null,ph=0,s=St;for(;s!==null;)$P(s.alternate,s),s=s.return;St=null}}function cd(s,u){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,gW(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),Qo=0,$1(),sn=s,St=p=zo(s.current,null),Nt=u,Yt=0,Ci=null,tl=!1,sd=qt(s,u),M1=!1,ld=Ni=R1=Su=nl=Rn=0,fi=Th=null,D1=!1,(u&8)!==0&&(u|=u&32);var x=s.entangledLanes;if(x!==0)for(s=s.entanglements,x&=u;0<x;){var E=31-ct(x),N=1<<E;u|=s[E],x&=~N}return Wo=u,zg(),p}function uM(s,u){ht=null,$.H=jh,u===Jc||u===Kg?(u=_T(),Yt=3):u===Hw?(u=_T(),Yt=4):Yt=u===v1?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Ci=u,St===null&&(Rn=1,ov(s,Ki(u,s.current)))}function cM(){var s=Ei.current;return s===null?!0:(Nt&4194048)===Nt?Wi===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===Wi:!1}function dM(){var s=$.H;return $.H=jh,s===null?jh:s}function fM(){var s=$.A;return $.A=XG,s}function yv(){Rn=4,tl||(Nt&4194048)!==Nt&&Ei.current!==null||(sd=!0),(nl&134217727)===0&&(Su&134217727)===0||sn===null||al(sn,Nt,Ni,!1)}function B1(s,u,p){var x=Ht;Ht|=2;var E=dM(),N=fM();(sn!==s||Nt!==u)&&(gv=null,cd(s,u)),u=!1;var M=Rn;e:do try{if(Yt!==0&&St!==null){var Y=St,J=Ci;switch(Yt){case 8:$1(),M=6;break e;case 3:case 2:case 9:case 6:Ei.current===null&&(u=!0);var de=Yt;if(Yt=0,Ci=null,dd(s,Y,J,de),p&&sd){M=0;break e}break;default:de=Yt,Yt=0,Ci=null,dd(s,Y,J,de)}}QG(),M=Rn;break}catch(ve){uM(s,ve)}while(!0);return u&&s.shellSuspendCounter++,Bo=hu=null,Ht=x,$.H=E,$.A=N,St===null&&(sn=null,Nt=0,zg()),M}function QG(){for(;St!==null;)hM(St)}function ZG(s,u){var p=Ht;Ht|=2;var x=dM(),E=fM();sn!==s||Nt!==u?(gv=null,pv=It()+500,cd(s,u)):sd=qt(s,u);e:do try{if(Yt!==0&&St!==null){u=St;var N=Ci;t:switch(Yt){case 1:Yt=0,Ci=null,dd(s,u,N,1);break;case 2:case 9:if(jT(N)){Yt=0,Ci=null,mM(u);break}u=function(){Yt!==2&&Yt!==9||sn!==s||(Yt=7),ao(s)},N.then(u,u);break e;case 3:Yt=7;break e;case 4:Yt=5;break e;case 7:jT(N)?(Yt=0,Ci=null,mM(u)):(Yt=0,Ci=null,dd(s,u,N,7));break;case 5:var M=null;switch(St.tag){case 26:M=St.memoizedState;case 5:case 27:var Y=St;if(M?JM(M):Y.stateNode.complete){Yt=0,Ci=null;var J=Y.sibling;if(J!==null)St=J;else{var de=Y.return;de!==null?(St=de,xv(de)):St=null}break t}}Yt=0,Ci=null,dd(s,u,N,5);break;case 6:Yt=0,Ci=null,dd(s,u,N,6);break;case 8:$1(),Rn=6;break e;default:throw Error(r(462))}}JG();break}catch(ve){uM(s,ve)}while(!0);return Bo=hu=null,$.H=x,$.A=E,Ht=p,St!==null?0:(sn=null,Nt=0,zg(),Rn)}function JG(){for(;St!==null&&!_t();)hM(St)}function hM(s){var u=LP(s.alternate,s,Wo);s.memoizedProps=s.pendingProps,u===null?xv(s):St=u}function mM(s){var u=s,p=u.alternate;switch(u.tag){case 15:case 0:u=TP(p,u,u.pendingProps,u.type,void 0,Nt);break;case 11:u=TP(p,u,u.pendingProps,u.type.render,u.ref,Nt);break;case 5:t1(u);default:$P(p,u),u=St=fT(u,Wo),u=LP(p,u,Wo)}s.memoizedProps=s.pendingProps,u===null?xv(s):St=u}function dd(s,u,p,x){Bo=hu=null,t1(u),ed=null,ph=0;var E=u.return;try{if(FG(s,E,u,p,Nt)){Rn=1,ov(s,Ki(p,s.current)),St=null;return}}catch(N){if(E!==null)throw St=E,N;Rn=1,ov(s,Ki(p,s.current)),St=null;return}u.flags&32768?(At||x===1?s=!0:sd||(Nt&536870912)!==0?s=!1:(tl=s=!0,(x===2||x===9||x===3||x===6)&&(x=Ei.current,x!==null&&x.tag===13&&(x.flags|=16384))),pM(u,s)):xv(u)}function xv(s){var u=s;do{if((u.flags&32768)!==0){pM(u,tl);return}s=u.return;var p=qG(u.alternate,u,Wo);if(p!==null){St=p;return}if(u=u.sibling,u!==null){St=u;return}St=u=s}while(u!==null);Rn===0&&(Rn=5)}function pM(s,u){do{var p=VG(s.alternate,s);if(p!==null){p.flags&=32767,St=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!u&&(s=s.sibling,s!==null)){St=s;return}St=s=p}while(s!==null);Rn=6,St=null}function gM(s,u,p,x,E,N,M,Y,J){s.cancelPendingCommit=null;do bv();while(tr!==0);if((Ht&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(N=u.lanes|u.childLanes,N|=kw,Pn(s,p,N,M,Y,J),s===sn&&(St=sn=null,Nt=0),ud=u,il=s,Qo=p,I1=N,L1=E,aM=x,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,rW(Me,function(){return wM(),null})):(s.callbackNode=null,s.callbackPriority=0),x=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||x){x=$.T,$.T=null,E=V.p,V.p=2,M=Ht,Ht|=4;try{KG(s,u,p)}finally{Ht=M,V.p=E,$.T=x}}tr=1,vM(),yM(),xM()}}function vM(){if(tr===1){tr=0;var s=il,u=ud,p=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||p){p=$.T,$.T=null;var x=V.p;V.p=2;var E=Ht;Ht|=4;try{QP(u,s);var N=Z1,M=rT(s.containerInfo),Y=N.focusedElem,J=N.selectionRange;if(M!==Y&&Y&&Y.ownerDocument&&nT(Y.ownerDocument.documentElement,Y)){if(J!==null&&jw(Y)){var de=J.start,ve=J.end;if(ve===void 0&&(ve=de),"selectionStart"in Y)Y.selectionStart=de,Y.selectionEnd=Math.min(ve,Y.value.length);else{var we=Y.ownerDocument||document,fe=we&&we.defaultView||window;if(fe.getSelection){var he=fe.getSelection(),Le=Y.textContent.length,rt=Math.min(J.start,Le),Zt=J.end===void 0?rt:Math.min(J.end,Le);!he.extend&&rt>Zt&&(M=Zt,Zt=rt,rt=M);var oe=tT(Y,rt),ne=tT(Y,Zt);if(oe&&ne&&(he.rangeCount!==1||he.anchorNode!==oe.node||he.anchorOffset!==oe.offset||he.focusNode!==ne.node||he.focusOffset!==ne.offset)){var ue=we.createRange();ue.setStart(oe.node,oe.offset),he.removeAllRanges(),rt>Zt?(he.addRange(ue),he.extend(ne.node,ne.offset)):(ue.setEnd(ne.node,ne.offset),he.addRange(ue))}}}}for(we=[],he=Y;he=he.parentNode;)he.nodeType===1&&we.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<we.length;Y++){var ye=we[Y];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Pv=!!Q1,Z1=Q1=null}finally{Ht=E,V.p=x,$.T=p}}s.current=u,tr=2}}function yM(){if(tr===2){tr=0;var s=il,u=ud,p=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||p){p=$.T,$.T=null;var x=V.p;V.p=2;var E=Ht;Ht|=4;try{KP(s,u.alternate,u)}finally{Ht=E,V.p=x,$.T=p}}tr=3}}function xM(){if(tr===4||tr===3){tr=0,Kt();var s=il,u=ud,p=Qo,x=aM;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?tr=5:(tr=0,ud=il=null,bM(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(rl=null),Wr(p),u=u.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(je,u,void 0,(u.current.flags&128)===128)}catch{}if(x!==null){u=$.T,E=V.p,V.p=2,$.T=null;try{for(var N=s.onRecoverableError,M=0;M<x.length;M++){var Y=x[M];N(Y.value,{componentStack:Y.stack})}}finally{$.T=u,V.p=E}}(Qo&3)!==0&&bv(),ao(s),E=s.pendingLanes,(p&261930)!==0&&(E&42)!==0?s===z1?Ph++:(Ph=0,z1=s):Ph=0,Mh(0)}}function bM(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,hh(u)))}function bv(){return vM(),yM(),xM(),wM()}function wM(){if(tr!==5)return!1;var s=il,u=I1;I1=0;var p=Wr(Qo),x=$.T,E=V.p;try{V.p=32>p?32:p,$.T=null,p=L1,L1=null;var N=il,M=Qo;if(tr=0,ud=il=null,Qo=0,(Ht&6)!==0)throw Error(r(331));var Y=Ht;if(Ht|=4,nM(N.current),JP(N,N.current,M,p),Ht=Y,Mh(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(je,N)}catch{}return!0}finally{V.p=E,$.T=x,bM(s,u)}}function SM(s,u,p){u=Ki(p,u),u=g1(s.stateNode,u,2),s=Qs(s,u,2),s!==null&&(Ct(s,2),ao(s))}function Xt(s,u,p){if(s.tag===3)SM(s,s,p);else for(;u!==null;){if(u.tag===3){SM(u,s,p);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(rl===null||!rl.has(x))){s=Ki(p,s),p=jP(2),x=Qs(u,p,2),x!==null&&(EP(p,x,u,s),Ct(x,2),ao(x));break}}u=u.return}}function F1(s,u,p){var x=s.pingCache;if(x===null){x=s.pingCache=new GG;var E=new Set;x.set(u,E)}else E=x.get(u),E===void 0&&(E=new Set,x.set(u,E));E.has(p)||(M1=!0,E.add(p),s=eW.bind(null,s,u,p),u.then(s,s))}function eW(s,u,p){var x=s.pingCache;x!==null&&x.delete(u),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,sn===s&&(Nt&p)===p&&(Rn===4||Rn===3&&(Nt&62914560)===Nt&&300>It()-mv?(Ht&2)===0&&cd(s,0):R1|=p,ld===Nt&&(ld=0)),ao(s)}function jM(s,u){u===0&&(u=Ze()),s=cu(s,u),s!==null&&(Ct(s,u),ao(s))}function tW(s){var u=s.memoizedState,p=0;u!==null&&(p=u.retryLane),jM(s,p)}function nW(s,u){var p=0;switch(s.tag){case 31:case 13:var x=s.stateNode,E=s.memoizedState;E!==null&&(p=E.retryLane);break;case 19:x=s.stateNode;break;case 22:x=s.stateNode._retryCache;break;default:throw Error(r(314))}x!==null&&x.delete(u),jM(s,p)}function rW(s,u){return zt(s,u)}var wv=null,fd=null,U1=!1,Sv=!1,H1=!1,ol=0;function ao(s){s!==fd&&s.next===null&&(fd===null?wv=fd=s:fd=fd.next=s),Sv=!0,U1||(U1=!0,aW())}function Mh(s,u){if(!H1&&Sv){H1=!0;do for(var p=!1,x=wv;x!==null;){if(s!==0){var E=x.pendingLanes;if(E===0)var N=0;else{var M=x.suspendedLanes,Y=x.pingedLanes;N=(1<<31-ct(42|s)+1)-1,N&=E&~(M&~Y),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(p=!0,NM(x,N))}else N=Nt,N=Qe(x,x===sn?N:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(N&3)===0||qt(x,N)||(p=!0,NM(x,N));x=x.next}while(p);H1=!1}}function iW(){EM()}function EM(){Sv=U1=!1;var s=0;ol!==0&&pW()&&(s=ol);for(var u=It(),p=null,x=wv;x!==null;){var E=x.next,N=_M(x,u);N===0?(x.next=null,p===null?wv=E:p.next=E,E===null&&(fd=p)):(p=x,(s!==0||(N&3)!==0)&&(Sv=!0)),x=E}tr!==0&&tr!==5||Mh(s),ol!==0&&(ol=0)}function _M(s,u){for(var p=s.suspendedLanes,x=s.pingedLanes,E=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var M=31-ct(N),Y=1<<M,J=E[M];J===-1?((Y&p)===0||(Y&x)!==0)&&(E[M]=me(Y,u)):J<=u&&(s.expiredLanes|=Y),N&=~Y}if(u=sn,p=Nt,p=Qe(s,s===u?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x=s.callbackNode,p===0||s===u&&(Yt===2||Yt===9)||s.cancelPendingCommit!==null)return x!==null&&x!==null&&mt(x),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||qt(s,p)){if(u=p&-p,u===s.callbackPriority)return u;switch(x!==null&&mt(x),Wr(p)){case 2:case 8:p=be;break;case 32:p=Me;break;case 268435456:p=tt;break;default:p=Me}return x=CM.bind(null,s),p=zt(p,x),s.callbackPriority=u,s.callbackNode=p,u}return x!==null&&x!==null&&mt(x),s.callbackPriority=2,s.callbackNode=null,2}function CM(s,u){if(tr!==0&&tr!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(bv()&&s.callbackNode!==p)return null;var x=Nt;return x=Qe(s,s===sn?x:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x===0?null:(sM(s,x,u),_M(s,It()),s.callbackNode!=null&&s.callbackNode===p?CM.bind(null,s):null)}function NM(s,u){if(bv())return null;sM(s,u,!0)}function aW(){vW(function(){(Ht&6)!==0?zt(ce,iW):EM()})}function q1(){if(ol===0){var s=Qc;s===0&&(s=Xr,Xr<<=1,(Xr&261888)===0&&(Xr=256)),ol=s}return ol}function kM(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Og(""+s)}function AM(s,u){var p=u.ownerDocument.createElement("input");return p.name=u.name,p.value=u.value,s.id&&p.setAttribute("form",s.id),u.parentNode.insertBefore(p,u),s=new FormData(s),p.parentNode.removeChild(p),s}function oW(s,u,p,x,E){if(u==="submit"&&p&&p.stateNode===E){var N=kM((E[on]||null).action),M=x.submitter;M&&(u=(u=M[on]||null)?kM(u.formAction):M.getAttribute("formAction"),u!==null&&(N=u,M=null));var Y=new Rg("action","action",null,x,E);s.push({event:Y,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(ol!==0){var J=M?AM(E,M):new FormData(E);c1(p,{pending:!0,data:J,method:E.method,action:N},null,J)}}else typeof N=="function"&&(Y.preventDefault(),J=M?AM(E,M):new FormData(E),c1(p,{pending:!0,data:J,method:E.method,action:N},N,J))},currentTarget:E}]})}}for(var V1=0;V1<Nw.length;V1++){var K1=Nw[V1],sW=K1.toLowerCase(),lW=K1[0].toUpperCase()+K1.slice(1);Aa(sW,"on"+lW)}Aa(oT,"onAnimationEnd"),Aa(sT,"onAnimationIteration"),Aa(lT,"onAnimationStart"),Aa("dblclick","onDoubleClick"),Aa("focusin","onFocus"),Aa("focusout","onBlur"),Aa(EG,"onTransitionRun"),Aa(_G,"onTransitionStart"),Aa(CG,"onTransitionCancel"),Aa(uT,"onTransitionEnd"),Us("onMouseEnter",["mouseout","mouseover"]),Us("onMouseLeave",["mouseout","mouseover"]),Us("onPointerEnter",["pointerout","pointerover"]),Us("onPointerLeave",["pointerout","pointerover"]),Ro("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ro("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ro("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ro("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ro("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ro("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rh="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(" "),uW=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rh));function OM(s,u){u=(u&4)!==0;for(var p=0;p<s.length;p++){var x=s[p],E=x.event;x=x.listeners;e:{var N=void 0;if(u)for(var M=x.length-1;0<=M;M--){var Y=x[M],J=Y.instance,de=Y.currentTarget;if(Y=Y.listener,J!==N&&E.isPropagationStopped())break e;N=Y,E.currentTarget=de;try{N(E)}catch(ve){Lg(ve)}E.currentTarget=null,N=J}else for(M=0;M<x.length;M++){if(Y=x[M],J=Y.instance,de=Y.currentTarget,Y=Y.listener,J!==N&&E.isPropagationStopped())break e;N=Y,E.currentTarget=de;try{N(E)}catch(ve){Lg(ve)}E.currentTarget=null,N=J}}}}function jt(s,u){var p=u[to];p===void 0&&(p=u[to]=new Set);var x=s+"__bubble";p.has(x)||(TM(u,s,2,!1),p.add(x))}function Y1(s,u,p){var x=0;u&&(x|=4),TM(p,s,x,u)}var jv="_reactListening"+Math.random().toString(36).slice(2);function X1(s){if(!s[jv]){s[jv]=!0,Eg.forEach(function(p){p!=="selectionchange"&&(uW.has(p)||Y1(p,!1,s),Y1(p,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[jv]||(u[jv]=!0,Y1("selectionchange",!1,u))}}function TM(s,u,p,x){switch(oR(u)){case 2:var E=LW;break;case 8:E=zW;break;default:E=uS}p=E.bind(null,u,p,s),E=void 0,!mw||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),x?E!==void 0?s.addEventListener(u,p,{capture:!0,passive:E}):s.addEventListener(u,p,!0):E!==void 0?s.addEventListener(u,p,{passive:E}):s.addEventListener(u,p,!1)}function G1(s,u,p,x,E){var N=x;if((u&1)===0&&(u&2)===0&&x!==null)e:for(;;){if(x===null)return;var M=x.tag;if(M===3||M===4){var Y=x.stateNode.containerInfo;if(Y===E)break;if(M===4)for(M=x.return;M!==null;){var J=M.tag;if((J===3||J===4)&&M.stateNode.containerInfo===E)return;M=M.return}for(;Y!==null;){if(M=zs(Y),M===null)return;if(J=M.tag,J===5||J===6||J===26||J===27){x=N=M;continue e}Y=Y.parentNode}}x=x.return}I2(function(){var de=N,ve=fw(p),we=[];e:{var fe=cT.get(s);if(fe!==void 0){var he=Rg,Le=s;switch(s){case"keypress":if(Pg(p)===0)break e;case"keydown":case"keyup":he=nG;break;case"focusin":Le="focus",he=yw;break;case"focusout":Le="blur",he=yw;break;case"beforeblur":case"afterblur":he=yw;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":he=$2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=qX;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=aG;break;case oT:case sT:case lT:he=YX;break;case uT:he=sG;break;case"scroll":case"scrollend":he=UX;break;case"wheel":he=uG;break;case"copy":case"cut":case"paste":he=GX;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=F2;break;case"toggle":case"beforetoggle":he=dG}var rt=(u&4)!==0,Zt=!rt&&(s==="scroll"||s==="scrollend"),oe=rt?fe!==null?fe+"Capture":null:fe;rt=[];for(var ne=de,ue;ne!==null;){var ye=ne;if(ue=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ue===null||oe===null||(ye=nh(ne,oe),ye!=null&&rt.push(Dh(ne,ye,ue))),Zt)break;ne=ne.return}0<rt.length&&(fe=new he(fe,Le,null,p,ve),we.push({event:fe,listeners:rt}))}}if((u&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",fe&&p!==dw&&(Le=p.relatedTarget||p.fromElement)&&(zs(Le)||Le[Na]))break e;if((he||fe)&&(fe=ve.window===ve?ve:(fe=ve.ownerDocument)?fe.defaultView||fe.parentWindow:window,he?(Le=p.relatedTarget||p.toElement,he=de,Le=Le?zs(Le):null,Le!==null&&(Zt=a(Le),rt=Le.tag,Le!==Zt||rt!==5&&rt!==27&&rt!==6)&&(Le=null)):(he=null,Le=de),he!==Le)){if(rt=$2,ye="onMouseLeave",oe="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(rt=F2,ye="onPointerLeave",oe="onPointerEnter",ne="pointer"),Zt=he==null?fe:Bs(he),ue=Le==null?fe:Bs(Le),fe=new rt(ye,ne+"leave",he,p,ve),fe.target=Zt,fe.relatedTarget=ue,ye=null,zs(ve)===de&&(rt=new rt(oe,ne+"enter",Le,p,ve),rt.target=ue,rt.relatedTarget=Zt,ye=rt),Zt=ye,he&&Le)t:{for(rt=cW,oe=he,ne=Le,ue=0,ye=oe;ye;ye=rt(ye))ue++;ye=0;for(var Ye=ne;Ye;Ye=rt(Ye))ye++;for(;0<ue-ye;)oe=rt(oe),ue--;for(;0<ye-ue;)ne=rt(ne),ye--;for(;ue--;){if(oe===ne||ne!==null&&oe===ne.alternate){rt=oe;break t}oe=rt(oe),ne=rt(ne)}rt=null}else rt=null;he!==null&&PM(we,fe,he,rt,!1),Le!==null&&Zt!==null&&PM(we,Zt,Le,rt,!0)}}e:{if(fe=de?Bs(de):window,he=fe.nodeName&&fe.nodeName.toLowerCase(),he==="select"||he==="input"&&fe.type==="file")var $t=G2;else if(Y2(fe))if(W2)$t=wG;else{$t=xG;var qe=yG}else he=fe.nodeName,!he||he.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&cw(de.elementType)&&($t=G2):$t=bG;if($t&&($t=$t(s,de))){X2(we,$t,p,ve);break e}qe&&qe(s,fe,de),s==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&th(fe,"number",fe.value)}switch(qe=de?Bs(de):window,s){case"focusin":(Y2(qe)||qe.contentEditable==="true")&&(Hc=qe,Ew=de,ch=null);break;case"focusout":ch=Ew=Hc=null;break;case"mousedown":_w=!0;break;case"contextmenu":case"mouseup":case"dragend":_w=!1,iT(we,p,ve);break;case"selectionchange":if(jG)break;case"keydown":case"keyup":iT(we,p,ve)}var gt;if(bw)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 Uc?V2(s,p)&&(kt="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(kt="onCompositionStart");kt&&(U2&&p.locale!=="ko"&&(Uc||kt!=="onCompositionStart"?kt==="onCompositionEnd"&&Uc&&(gt=L2()):(qs=ve,pw="value"in qs?qs.value:qs.textContent,Uc=!0)),qe=Ev(de,kt),0<qe.length&&(kt=new B2(kt,s,null,p,ve),we.push({event:kt,listeners:qe}),gt?kt.data=gt:(gt=K2(p),gt!==null&&(kt.data=gt)))),(gt=hG?mG(s,p):pG(s,p))&&(kt=Ev(de,"onBeforeInput"),0<kt.length&&(qe=new B2("onBeforeInput","beforeinput",null,p,ve),we.push({event:qe,listeners:kt}),qe.data=gt)),oW(we,s,de,p,ve)}OM(we,u)})}function Dh(s,u,p){return{instance:s,listener:u,currentTarget:p}}function Ev(s,u){for(var p=u+"Capture",x=[];s!==null;){var E=s,N=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||N===null||(E=nh(s,p),E!=null&&x.unshift(Dh(s,E,N)),E=nh(s,u),E!=null&&x.push(Dh(s,E,N))),s.tag===3)return x;s=s.return}return[]}function cW(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function PM(s,u,p,x,E){for(var N=u._reactName,M=[];p!==null&&p!==x;){var Y=p,J=Y.alternate,de=Y.stateNode;if(Y=Y.tag,J!==null&&J===x)break;Y!==5&&Y!==26&&Y!==27||de===null||(J=de,E?(de=nh(p,N),de!=null&&M.unshift(Dh(p,de,J))):E||(de=nh(p,N),de!=null&&M.push(Dh(p,de,J)))),p=p.return}M.length!==0&&s.push({event:u,listeners:M})}var dW=/\r\n?/g,fW=/\u0000|\uFFFD/g;function MM(s){return(typeof s=="string"?s:""+s).replace(dW,`
`).replace(fW,"")}function RM(s,u){return u=MM(u),MM(s)===u}function Qt(s,u,p,x,E,N){switch(p){case"children":typeof x=="string"?u==="body"||u==="textarea"&&x===""||$c(s,x):(typeof x=="number"||typeof x=="bigint")&&u!=="body"&&$c(s,""+x);break;case"className":zc(s,"class",x);break;case"tabIndex":zc(s,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":zc(s,p,x);break;case"style":R2(s,x,N);break;case"data":if(u!=="object"){zc(s,"data",x);break}case"src":case"href":if(x===""&&(u!=="a"||p!=="href")){s.removeAttribute(p);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Og(""+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"?(u!=="input"&&Qt(s,u,"name",E.name,E,null),Qt(s,u,"formEncType",E.formEncType,E,null),Qt(s,u,"formMethod",E.formMethod,E,null),Qt(s,u,"formTarget",E.formTarget,E,null)):(Qt(s,u,"encType",E.encType,E,null),Qt(s,u,"method",E.method,E,null),Qt(s,u,"target",E.target,E,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Og(""+x),s.setAttribute(p,x);break;case"onClick":x!=null&&(s.onclick=Io);break;case"onScroll":x!=null&&jt("scroll",s);break;case"onScrollEnd":x!=null&&jt("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(E.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=Og(""+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":jt("beforetoggle",s),jt("toggle",s),Lc(s,"popover",x);break;case"xlinkActuate":ka(s,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":ka(s,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":ka(s,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":ka(s,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":ka(s,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":ka(s,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":ka(s,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":ka(s,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":ka(s,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":Lc(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=BX.get(p)||p,Lc(s,p,x))}}function W1(s,u,p,x,E,N){switch(p){case"style":R2(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(E.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"children":typeof x=="string"?$c(s,x):(typeof x=="number"||typeof x=="bigint")&&$c(s,""+x);break;case"onScroll":x!=null&&jt("scroll",s);break;case"onScrollEnd":x!=null&&jt("scrollend",s);break;case"onClick":x!=null&&(s.onclick=Io);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_g.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(E=p.endsWith("Capture"),u=p.slice(2,E?p.length-7:void 0),N=s[on]||null,N=N!=null?N[p]:null,typeof N=="function"&&s.removeEventListener(u,N,E),typeof x=="function")){typeof N!="function"&&N!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(u,x,E);break e}p in s?s[p]=x:x===!0?s.setAttribute(p,""):Lc(s,p,x)}}}function kr(s,u,p){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",s),jt("load",s);var x=!1,E=!1,N;for(N in p)if(p.hasOwnProperty(N)){var M=p[N];if(M!=null)switch(N){case"src":x=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Qt(s,u,N,M,p,null)}}E&&Qt(s,u,"srcSet",p.srcSet,p,null),x&&Qt(s,u,"src",p.src,p,null);return;case"input":jt("invalid",s);var Y=N=M=E=null,J=null,de=null;for(x in p)if(p.hasOwnProperty(x)){var ve=p[x];if(ve!=null)switch(x){case"name":E=ve;break;case"type":M=ve;break;case"checked":J=ve;break;case"defaultChecked":de=ve;break;case"value":N=ve;break;case"defaultValue":Y=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,u));break;default:Qt(s,u,x,ve,p,null)}}Ag(s,N,Y,J,de,M,E,!1);return;case"select":jt("invalid",s),x=M=N=null;for(E in p)if(p.hasOwnProperty(E)&&(Y=p[E],Y!=null))switch(E){case"value":N=Y;break;case"defaultValue":M=Y;break;case"multiple":x=Y;default:Qt(s,u,E,Y,p,null)}u=N,p=M,s.multiple=!!x,u!=null?Do(s,!!x,u,!1):p!=null&&Do(s,!!x,p,!0);return;case"textarea":jt("invalid",s),N=E=x=null;for(M in p)if(p.hasOwnProperty(M)&&(Y=p[M],Y!=null))switch(M){case"value":x=Y;break;case"defaultValue":E=Y;break;case"children":N=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(91));break;default:Qt(s,u,M,Y,p,null)}P2(s,x,E,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,u,J,x,p,null)}return;case"dialog":jt("beforetoggle",s),jt("toggle",s),jt("cancel",s),jt("close",s);break;case"iframe":case"object":jt("load",s);break;case"video":case"audio":for(x=0;x<Rh.length;x++)jt(Rh[x],s);break;case"image":jt("error",s),jt("load",s);break;case"details":jt("toggle",s);break;case"embed":case"source":case"link":jt("error",s),jt("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,u));default:Qt(s,u,de,x,p,null)}return;default:if(cw(u)){for(ve in p)p.hasOwnProperty(ve)&&(x=p[ve],x!==void 0&&W1(s,u,ve,x,p,void 0));return}}for(Y in p)p.hasOwnProperty(Y)&&(x=p[Y],x!=null&&Qt(s,u,Y,x,p,null))}function hW(s,u,p,x){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,N=null,M=null,Y=null,J=null,de=null,ve=null;for(he in p){var we=p[he];if(p.hasOwnProperty(he)&&we!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":J=we;default:x.hasOwnProperty(he)||Qt(s,u,he,null,x,we)}}for(var fe in x){var he=x[fe];if(we=p[fe],x.hasOwnProperty(fe)&&(he!=null||we!=null))switch(fe){case"type":N=he;break;case"name":E=he;break;case"checked":de=he;break;case"defaultChecked":ve=he;break;case"value":M=he;break;case"defaultValue":Y=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,u));break;default:he!==we&&Qt(s,u,fe,he,x,we)}}ou(s,M,Y,J,de,ve,N,E);return;case"select":he=M=Y=fe=null;for(N in p)if(J=p[N],p.hasOwnProperty(N)&&J!=null)switch(N){case"value":break;case"multiple":he=J;default:x.hasOwnProperty(N)||Qt(s,u,N,null,x,J)}for(E in x)if(N=x[E],J=p[E],x.hasOwnProperty(E)&&(N!=null||J!=null))switch(E){case"value":fe=N;break;case"defaultValue":Y=N;break;case"multiple":M=N;default:N!==J&&Qt(s,u,E,N,x,J)}u=Y,p=M,x=he,fe!=null?Do(s,!!p,fe,!1):!!x!=!!p&&(u!=null?Do(s,!!p,u,!0):Do(s,!!p,p?[]:"",!1));return;case"textarea":he=fe=null;for(Y in p)if(E=p[Y],p.hasOwnProperty(Y)&&E!=null&&!x.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:Qt(s,u,Y,null,x,E)}for(M in x)if(E=x[M],N=p[M],x.hasOwnProperty(M)&&(E!=null||N!=null))switch(M){case"value":fe=E;break;case"defaultValue":he=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==N&&Qt(s,u,M,E,x,N)}T2(s,fe,he);return;case"option":for(var Le in p)if(fe=p[Le],p.hasOwnProperty(Le)&&fe!=null&&!x.hasOwnProperty(Le))switch(Le){case"selected":s.selected=!1;break;default:Qt(s,u,Le,null,x,fe)}for(J in x)if(fe=x[J],he=p[J],x.hasOwnProperty(J)&&fe!==he&&(fe!=null||he!=null))switch(J){case"selected":s.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Qt(s,u,J,fe,x,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var rt in p)fe=p[rt],p.hasOwnProperty(rt)&&fe!=null&&!x.hasOwnProperty(rt)&&Qt(s,u,rt,null,x,fe);for(de in x)if(fe=x[de],he=p[de],x.hasOwnProperty(de)&&fe!==he&&(fe!=null||he!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,u));break;default:Qt(s,u,de,fe,x,he)}return;default:if(cw(u)){for(var Zt in p)fe=p[Zt],p.hasOwnProperty(Zt)&&fe!==void 0&&!x.hasOwnProperty(Zt)&&W1(s,u,Zt,void 0,x,fe);for(ve in x)fe=x[ve],he=p[ve],!x.hasOwnProperty(ve)||fe===he||fe===void 0&&he===void 0||W1(s,u,ve,fe,x,he);return}}for(var oe in p)fe=p[oe],p.hasOwnProperty(oe)&&fe!=null&&!x.hasOwnProperty(oe)&&Qt(s,u,oe,null,x,fe);for(we in x)fe=x[we],he=p[we],!x.hasOwnProperty(we)||fe===he||fe==null&&he==null||Qt(s,u,we,fe,x,he)}function DM(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mW(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,p=performance.getEntriesByType("resource"),x=0;x<p.length;x++){var E=p[x],N=E.transferSize,M=E.initiatorType,Y=E.duration;if(N&&Y&&DM(M)){for(M=0,Y=E.responseEnd,x+=1;x<p.length;x++){var J=p[x],de=J.startTime;if(de>Y)break;var ve=J.transferSize,we=J.initiatorType;ve&&DM(we)&&(J=J.responseEnd,M+=ve*(J<Y?1:(Y-de)/(J-de)))}if(--x,u+=8*(N+M)/(E.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Q1=null,Z1=null;function _v(s){return s.nodeType===9?s:s.ownerDocument}function IM(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 LM(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function J1(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var eS=null;function pW(){var s=window.event;return s&&s.type==="popstate"?s===eS?!1:(eS=s,!0):(eS=null,!1)}var zM=typeof setTimeout=="function"?setTimeout:void 0,gW=typeof clearTimeout=="function"?clearTimeout:void 0,$M=typeof Promise=="function"?Promise:void 0,vW=typeof queueMicrotask=="function"?queueMicrotask:typeof $M<"u"?function(s){return $M.resolve(null).then(s).catch(yW)}:zM;function yW(s){setTimeout(function(){throw s})}function sl(s){return s==="head"}function BM(s,u){var p=u,x=0;do{var E=p.nextSibling;if(s.removeChild(p),E&&E.nodeType===8)if(p=E.data,p==="/$"||p==="/&"){if(x===0){s.removeChild(E),gd(u);return}x--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")x++;else if(p==="html")Ih(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,Ih(p);for(var N=p.firstChild;N;){var M=N.nextSibling,Y=N.nodeName;N[iu]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&N.rel.toLowerCase()==="stylesheet"||p.removeChild(N),N=M}}else p==="body"&&Ih(s.ownerDocument.body);p=E}while(p);gd(u)}function FM(s,u){var p=s;s=0;do{var x=p.nextSibling;if(p.nodeType===1?u?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(u?(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 tS(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var p=u;switch(u=u.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":tS(p),Jf(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function xW(s,u,p,x){for(;s.nodeType===1;){var E=p;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!x&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(x){if(!s[iu])switch(u){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!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var N=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=Qi(s.nextSibling),s===null)break}return null}function bW(s,u,p){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=Qi(s.nextSibling),s===null))return null;return s}function UM(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Qi(s.nextSibling),s===null))return null;return s}function nS(s){return s.data==="$?"||s.data==="$~"}function rS(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function wW(s,u){var p=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||p.readyState!=="loading")u();else{var x=function(){u(),p.removeEventListener("DOMContentLoaded",x)};p.addEventListener("DOMContentLoaded",x),s._reactRetry=x}}function Qi(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var iS=null;function HM(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(u===0)return Qi(s.nextSibling);u--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||u++}s=s.nextSibling}return null}function qM(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var p=s.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(u===0)return s;u--}else p!=="/$"&&p!=="/&"||u++}s=s.previousSibling}return null}function VM(s,u,p){switch(u=_v(p),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Ih(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Jf(s)}var Zi=new Map,KM=new Set;function Cv(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Zo=V.d;V.d={f:SW,r:jW,D:EW,C:_W,L:CW,m:NW,X:AW,S:kW,M:OW};function SW(){var s=Zo.f(),u=vv();return s||u}function jW(s){var u=$s(s);u!==null&&u.tag===5&&u.type==="form"?uP(u):Zo.r(s)}var hd=typeof document>"u"?null:document;function YM(s,u,p){var x=hd;if(x&&typeof u=="string"&&u){var E=si(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof p=="string"&&(E+='[crossorigin="'+p+'"]'),KM.has(E)||(KM.add(E),s={rel:s,crossOrigin:p,href:u},x.querySelector(E)===null&&(u=x.createElement("link"),kr(u,"link",s),Hn(u),x.head.appendChild(u)))}}function EW(s){Zo.D(s),YM("dns-prefetch",s,null)}function _W(s,u){Zo.C(s,u),YM("preconnect",s,u)}function CW(s,u,p){Zo.L(s,u,p);var x=hd;if(x&&s&&u){var E='link[rel="preload"][as="'+si(u)+'"]';u==="image"&&p&&p.imageSrcSet?(E+='[imagesrcset="'+si(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(E+='[imagesizes="'+si(p.imageSizes)+'"]')):E+='[href="'+si(s)+'"]';var N=E;switch(u){case"style":N=md(s);break;case"script":N=pd(s)}Zi.has(N)||(s=f({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:s,as:u},p),Zi.set(N,s),x.querySelector(E)!==null||u==="style"&&x.querySelector(Lh(N))||u==="script"&&x.querySelector(zh(N))||(u=x.createElement("link"),kr(u,"link",s),Hn(u),x.head.appendChild(u)))}}function NW(s,u){Zo.m(s,u);var p=hd;if(p&&s){var x=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+si(x)+'"][href="'+si(s)+'"]',N=E;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=pd(s)}if(!Zi.has(N)&&(s=f({rel:"modulepreload",href:s},u),Zi.set(N,s),p.querySelector(E)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(zh(N)))return}x=p.createElement("link"),kr(x,"link",s),Hn(x),p.head.appendChild(x)}}}function kW(s,u,p){Zo.S(s,u,p);var x=hd;if(x&&s){var E=Fs(x).hoistableStyles,N=md(s);u=u||"default";var M=E.get(N);if(!M){var Y={loading:0,preload:null};if(M=x.querySelector(Lh(N)))Y.loading=5;else{s=f({rel:"stylesheet",href:s,"data-precedence":u},p),(p=Zi.get(N))&&aS(s,p);var J=M=x.createElement("link");Hn(J),kr(J,"link",s),J._p=new Promise(function(de,ve){J.onload=de,J.onerror=ve}),J.addEventListener("load",function(){Y.loading|=1}),J.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,Nv(M,u,x)}M={type:"stylesheet",instance:M,count:1,state:Y},E.set(N,M)}}}function AW(s,u){Zo.X(s,u);var p=hd;if(p&&s){var x=Fs(p).hoistableScripts,E=pd(s),N=x.get(E);N||(N=p.querySelector(zh(E)),N||(s=f({src:s,async:!0},u),(u=Zi.get(E))&&oS(s,u),N=p.createElement("script"),Hn(N),kr(N,"link",s),p.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(E,N))}}function OW(s,u){Zo.M(s,u);var p=hd;if(p&&s){var x=Fs(p).hoistableScripts,E=pd(s),N=x.get(E);N||(N=p.querySelector(zh(E)),N||(s=f({src:s,async:!0,type:"module"},u),(u=Zi.get(E))&&oS(s,u),N=p.createElement("script"),Hn(N),kr(N,"link",s),p.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(E,N))}}function XM(s,u,p,x){var E=(E=te.current)?Cv(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=md(p.href),p=Fs(E).hoistableStyles,x=p.get(u),x||(x={type:"style",instance:null,count:0,state:null},p.set(u,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=md(p.href);var N=Fs(E).hoistableStyles,M=N.get(s);if(M||(E=E.ownerDocument||E,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,M),(N=E.querySelector(Lh(s)))&&!N._p&&(M.instance=N,M.state.loading=5),Zi.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},Zi.set(s,p),N||TW(E,s,p,M.state))),u&&x===null)throw Error(r(528,""));return M}if(u&&x!==null)throw Error(r(529,""));return null;case"script":return u=p.async,p=p.src,typeof p=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=pd(p),p=Fs(E).hoistableScripts,x=p.get(u),x||(x={type:"script",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function md(s){return'href="'+si(s)+'"'}function Lh(s){return'link[rel="stylesheet"]['+s+"]"}function GM(s){return f({},s,{"data-precedence":s.precedence,precedence:null})}function TW(s,u,p,x){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?x.loading=1:(u=s.createElement("link"),x.preload=u,u.addEventListener("load",function(){return x.loading|=1}),u.addEventListener("error",function(){return x.loading|=2}),kr(u,"link",p),Hn(u),s.head.appendChild(u))}function pd(s){return'[src="'+si(s)+'"]'}function zh(s){return"script[async]"+s}function WM(s,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var x=s.querySelector('style[data-href~="'+si(p.href)+'"]');if(x)return u.instance=x,Hn(x),x;var E=f({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(s.ownerDocument||s).createElement("style"),Hn(x),kr(x,"style",E),Nv(x,p.precedence,s),u.instance=x;case"stylesheet":E=md(p.href);var N=s.querySelector(Lh(E));if(N)return u.state.loading|=4,u.instance=N,Hn(N),N;x=GM(p),(E=Zi.get(E))&&aS(x,E),N=(s.ownerDocument||s).createElement("link"),Hn(N);var M=N;return M._p=new Promise(function(Y,J){M.onload=Y,M.onerror=J}),kr(N,"link",x),u.state.loading|=4,Nv(N,p.precedence,s),u.instance=N;case"script":return N=pd(p.src),(E=s.querySelector(zh(N)))?(u.instance=E,Hn(E),E):(x=p,(E=Zi.get(N))&&(x=f({},p),oS(x,E)),s=s.ownerDocument||s,E=s.createElement("script"),Hn(E),kr(E,"link",x),s.head.appendChild(E),u.instance=E);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(x=u.instance,u.state.loading|=4,Nv(x,p.precedence,s));return u.instance}function Nv(s,u,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=x.length?x[x.length-1]:null,N=E,M=0;M<x.length;M++){var Y=x[M];if(Y.dataset.precedence===u)N=Y;else if(N!==E)break}N?N.parentNode.insertBefore(s,N.nextSibling):(u=p.nodeType===9?p.head:p,u.insertBefore(s,u.firstChild))}function aS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function oS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var kv=null;function QM(s,u,p){if(kv===null){var x=new Map,E=kv=new Map;E.set(p,x)}else E=kv,x=E.get(p),x||(x=new Map,E.set(p,x));if(x.has(s))return x;for(x.set(s,null),p=p.getElementsByTagName(s),E=0;E<p.length;E++){var N=p[E];if(!(N[iu]||N[Lt]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var M=N.getAttribute(u)||"";M=s+M;var Y=x.get(M);Y?Y.push(N):x.set(M,[N])}}return x}function ZM(s,u,p){s=s.ownerDocument||s,s.head.insertBefore(p,u==="title"?s.querySelector("head > title"):null)}function PW(s,u,p){if(p===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function JM(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function MW(s,u,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 E=md(x.href),N=u.querySelector(Lh(E));if(N){u=N._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=Av.bind(s),u.then(s,s)),p.state.loading|=4,p.instance=N,Hn(N);return}N=u.ownerDocument||u,x=GM(x),(E=Zi.get(E))&&aS(x,E),N=N.createElement("link"),Hn(N);var M=N;M._p=new Promise(function(Y,J){M.onload=Y,M.onerror=J}),kr(N,"link",x),p.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=Av.bind(s),u.addEventListener("load",p),u.addEventListener("error",p))}}var sS=0;function RW(s,u){return s.stylesheets&&s.count===0&&Tv(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var x=setTimeout(function(){if(s.stylesheets&&Tv(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+u);0<s.imgBytes&&sS===0&&(sS=62500*mW());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Tv(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>sS?50:800)+u);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(x),clearTimeout(E)}}:null}function Av(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Ov=null;function Tv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Ov=new Map,u.forEach(DW,s),Ov=null,Av.call(s))}function DW(s,u){if(!(u.state.loading&4)){var p=Ov.get(s);if(p)var x=p.get(null);else{p=new Map,Ov.set(s,p);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<E.length;N++){var M=E[N];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(p.set(M.dataset.precedence,M),x=M)}x&&p.set(null,x)}E=u.instance,M=E.getAttribute("data-precedence"),N=p.get(M)||x,N===x&&p.set(null,E),p.set(M,E),this.count++,x=Av.bind(this),E.addEventListener("load",x),E.addEventListener("error",x),N?N.parentNode.insertBefore(E,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var $h={$$typeof:_,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function IW(s,u,p,x,E,N,M,Y,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=an(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=an(0),this.hiddenUpdates=an(null),this.identifierPrefix=x,this.onUncaughtError=E,this.onCaughtError=N,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function eR(s,u,p,x,E,N,M,Y,J,de,ve,we){return s=new IW(s,u,p,M,J,de,ve,we,Y),u=1,N===!0&&(u|=24),N=ji(3,null,null,u),s.current=N,N.stateNode=s,u=Bw(),u.refCount++,s.pooledCache=u,u.refCount++,N.memoizedState={element:x,isDehydrated:p,cache:u},qw(N),s}function tR(s){return s?(s=Kc,s):Kc}function nR(s,u,p,x,E,N){E=tR(E),x.context===null?x.context=E:x.pendingContext=E,x=Ws(u),x.payload={element:p},N=N===void 0?null:N,N!==null&&(x.callback=N),p=Qs(s,x,u),p!==null&&(hi(p,s,u),vh(p,s,u))}function rR(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<u?p:u}}function lS(s,u){rR(s,u),(s=s.alternate)&&rR(s,u)}function iR(s){if(s.tag===13||s.tag===31){var u=cu(s,67108864);u!==null&&hi(u,s,67108864),lS(s,67108864)}}function aR(s){if(s.tag===13||s.tag===31){var u=ki();u=eo(u);var p=cu(s,u);p!==null&&hi(p,s,u),lS(s,u)}}var Pv=!0;function LW(s,u,p,x){var E=$.T;$.T=null;var N=V.p;try{V.p=2,uS(s,u,p,x)}finally{V.p=N,$.T=E}}function zW(s,u,p,x){var E=$.T;$.T=null;var N=V.p;try{V.p=8,uS(s,u,p,x)}finally{V.p=N,$.T=E}}function uS(s,u,p,x){if(Pv){var E=cS(x);if(E===null)G1(s,u,x,Mv,p),sR(s,x);else if(BW(E,s,u,p,x))x.stopPropagation();else if(sR(s,x),u&4&&-1<$W.indexOf(s)){for(;E!==null;){var N=$s(E);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var M=Er(N.pendingLanes);if(M!==0){var Y=N;for(Y.pendingLanes|=2,Y.entangledLanes|=2;M;){var J=1<<31-ct(M);Y.entanglements[1]|=J,M&=~J}ao(N),(Ht&6)===0&&(pv=It()+500,Mh(0))}}break;case 31:case 13:Y=cu(N,2),Y!==null&&hi(Y,N,2),vv(),lS(N,2)}if(N=cS(x),N===null&&G1(s,u,x,Mv,p),N===E)break;E=N}E!==null&&x.stopPropagation()}else G1(s,u,x,null,p)}}function cS(s){return s=fw(s),dS(s)}var Mv=null;function dS(s){if(Mv=null,s=zs(s),s!==null){var u=a(s);if(u===null)s=null;else{var p=u.tag;if(p===13){if(s=o(u),s!==null)return s;s=null}else if(p===31){if(s=l(u),s!==null)return s;s=null}else if(p===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return Mv=s,null}function oR(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(dn()){case ce:return 2;case be:return 8;case Me:case et:return 32;case tt:return 268435456;default:return 32}default:return 32}}var fS=!1,ll=null,ul=null,cl=null,Bh=new Map,Fh=new Map,dl=[],$W="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 sR(s,u){switch(s){case"focusin":case"focusout":ll=null;break;case"dragenter":case"dragleave":ul=null;break;case"mouseover":case"mouseout":cl=null;break;case"pointerover":case"pointerout":Bh.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fh.delete(u.pointerId)}}function Uh(s,u,p,x,E,N){return s===null||s.nativeEvent!==N?(s={blockedOn:u,domEventName:p,eventSystemFlags:x,nativeEvent:N,targetContainers:[E]},u!==null&&(u=$s(u),u!==null&&iR(u)),s):(s.eventSystemFlags|=x,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function BW(s,u,p,x,E){switch(u){case"focusin":return ll=Uh(ll,s,u,p,x,E),!0;case"dragenter":return ul=Uh(ul,s,u,p,x,E),!0;case"mouseover":return cl=Uh(cl,s,u,p,x,E),!0;case"pointerover":var N=E.pointerId;return Bh.set(N,Uh(Bh.get(N)||null,s,u,p,x,E)),!0;case"gotpointercapture":return N=E.pointerId,Fh.set(N,Uh(Fh.get(N)||null,s,u,p,x,E)),!0}return!1}function lR(s){var u=zs(s.target);if(u!==null){var p=a(u);if(p!==null){if(u=p.tag,u===13){if(u=o(p),u!==null){s.blockedOn=u,pe(s.priority,function(){aR(p)});return}}else if(u===31){if(u=l(p),u!==null){s.blockedOn=u,pe(s.priority,function(){aR(p)});return}}else if(u===3&&p.stateNode.current.memoizedState.isDehydrated){s.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Rv(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var p=cS(s.nativeEvent);if(p===null){p=s.nativeEvent;var x=new p.constructor(p.type,p);dw=x,p.target.dispatchEvent(x),dw=null}else return u=$s(p),u!==null&&iR(u),s.blockedOn=p,!1;u.shift()}return!0}function uR(s,u,p){Rv(s)&&p.delete(u)}function FW(){fS=!1,ll!==null&&Rv(ll)&&(ll=null),ul!==null&&Rv(ul)&&(ul=null),cl!==null&&Rv(cl)&&(cl=null),Bh.forEach(uR),Fh.forEach(uR)}function Dv(s,u){s.blockedOn===u&&(s.blockedOn=null,fS||(fS=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,FW)))}var Iv=null;function cR(s){Iv!==s&&(Iv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Iv===s&&(Iv=null);for(var u=0;u<s.length;u+=3){var p=s[u],x=s[u+1],E=s[u+2];if(typeof x!="function"){if(dS(x||p)===null)continue;break}var N=$s(p);N!==null&&(s.splice(u,3),u-=3,c1(N,{pending:!0,data:E,method:p.method,action:x},x,E))}}))}function gd(s){function u(J){return Dv(J,s)}ll!==null&&Dv(ll,s),ul!==null&&Dv(ul,s),cl!==null&&Dv(cl,s),Bh.forEach(u),Fh.forEach(u);for(var p=0;p<dl.length;p++){var x=dl[p];x.blockedOn===s&&(x.blockedOn=null)}for(;0<dl.length&&(p=dl[0],p.blockedOn===null);)lR(p),p.blockedOn===null&&dl.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(x=0;x<p.length;x+=3){var E=p[x],N=p[x+1],M=E[on]||null;if(typeof N=="function")M||cR(p);else if(M){var Y=null;if(N&&N.hasAttribute("formAction")){if(E=N,M=N[on]||null)Y=M.formAction;else if(dS(E)!==null)continue}else Y=M.action;typeof Y=="function"?p[x+1]=Y:(p.splice(x,3),x-=3),cR(p)}}}function dR(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(M){return E=M})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=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,E=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(p,100),function(){x=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),E!==null&&(E(),E=null)}}}function hS(s){this._internalRoot=s}Lv.prototype.render=hS.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var p=u.current,x=ki();nR(p,x,s,u,null,null)},Lv.prototype.unmount=hS.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;nR(s.current,2,null,s,null,null),vv(),u[Na]=null}};function Lv(s){this._internalRoot=s}Lv.prototype.unstable_scheduleHydration=function(s){if(s){var u=Ls();s={blockedOn:null,target:s,priority:u};for(var p=0;p<dl.length&&u!==0&&u<dl[p].priority;p++);dl.splice(p,0,s),p===0&&lR(s)}};var fR=t.version;if(fR!=="19.2.4")throw Error(r(527,fR,"19.2.4"));V.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(u),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var UW={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zv.isDisabled&&zv.supportsFiber)try{je=zv.inject(UW),ut=zv}catch{}}return qh.createRoot=function(s,u){if(!i(s))throw Error(r(299));var p=!1,x="",E=xP,N=bP,M=wP;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(M=u.onRecoverableError)),u=eR(s,1,!1,null,null,p,x,null,E,N,M,dR),s[Na]=u.current,X1(s),new hS(u)},qh.hydrateRoot=function(s,u,p){if(!i(s))throw Error(r(299));var x=!1,E="",N=xP,M=bP,Y=wP,J=null;return p!=null&&(p.unstable_strictMode===!0&&(x=!0),p.identifierPrefix!==void 0&&(E=p.identifierPrefix),p.onUncaughtError!==void 0&&(N=p.onUncaughtError),p.onCaughtError!==void 0&&(M=p.onCaughtError),p.onRecoverableError!==void 0&&(Y=p.onRecoverableError),p.formState!==void 0&&(J=p.formState)),u=eR(s,1,!0,u,p??null,x,E,J,N,M,Y,dR),u.context=tR(null),p=u.current,x=ki(),x=eo(x),E=Ws(x),E.callback=null,Qs(p,E,x),p=x,u.current.lanes=p,Ct(u,p),ao(u),s[Na]=u.current,X1(s),new Lv(u)},qh.version="19.2.4",qh}var jR;function eQ(){if(jR)return yS.exports;jR=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(),yS.exports=JW(),yS.exports}var tQ=eQ();/**
 * 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 ER="popstate";function _R(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function nQ(e={}){function t(r,i){var d;let a=(d=i.state)==null?void 0:d.masked,{pathname:o,search:l,hash:c}=a||r.location;return JE("",{pathname:o,search:l,hash:c},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:Pm(i)}return iQ(t,n,null,e)}function xn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ca(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function rQ(){return Math.random().toString(36).substring(2,10)}function CR(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 JE(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||rQ(),unstable_mask:i}}function Pm({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 iQ(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l="POP",c=null,d=m();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function m(){return(o.state||{idx:null}).idx}function f(){l="POP";let S=m(),j=S==null?null:S-d;d=S,c&&c({action:l,location:w.location,delta:j})}function g(S,j){l="PUSH";let C=_R(S)?S:JE(w.location,S,j);d=m()+1;let _=CR(C,d),k=w.createHref(C.unstable_mask||C);try{o.pushState(_,"",k)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(k)}a&&c&&c({action:l,location:w.location,delta:1})}function v(S,j){l="REPLACE";let C=_R(S)?S:JE(w.location,S,j);d=m();let _=CR(C,d),k=w.createHref(C.unstable_mask||C);o.replaceState(_,"",k),a&&c&&c({action:l,location:w.location,delta:0})}function b(S){return aQ(S)}let w={get action(){return l},get location(){return e(i,o)},listen(S){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(ER,f),c=S,()=>{i.removeEventListener(ER,f),c=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 aQ(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Pm(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function H$(e,t,n="/"){return oQ(e,t,n,!1)}function oQ(e,t,n,r){let i=typeof t=="string"?Mf(t):t,a=ps(i.pathname||"/",n);if(a==null)return null;let o=q$(e);sQ(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=K$(a);l=gQ(o[c],d,r)}return l}function q$(e,t=[],n=[],r="",i=!1){let a=(o,l,c=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)&&c)return;xn(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let f=bo([r,m.relativePath]),g=n.concat(m);o.children&&o.children.length>0&&(xn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),q$(o.children,t,g,f,c)),!(o.path==null&&!o.index)&&t.push({path:f,score:mQ(f,o.index),routesMeta:g})};return e.forEach((o,l)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))a(o,l);else for(let d of V$(o.path))a(o,l,!0,d)}),t}function V$(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=V$(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function sQ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:pQ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var lQ=/^:[\w-]+$/,uQ=3,cQ=2,dQ=1,fQ=10,hQ=-2,NR=e=>e==="*";function mQ(e,t){let n=e.split("/"),r=n.length;return n.some(NR)&&(r+=hQ),t&&(r+=cQ),n.filter(i=>!NR(i)).reduce((i,a)=>i+(lQ.test(a)?uQ:a===""?dQ:fQ),r)}function pQ(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 gQ(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",f=Mm({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},m),g=c.route;if(!f&&d&&n&&!r[r.length-1].route.index&&(f=Mm({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:bo([a,f.pathname]),pathnameBase:wQ(bo([a,f.pathnameBase])),route:g}),f.pathnameBase!=="/"&&(a=bo([a,f.pathnameBase]))}return o}function Mm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=vQ(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:f},g)=>{if(m==="*"){let b=l[g]||"";o=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[g];return f&&!v?d[m]=void 0:d[m]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:e}}function vQ(e,t=!1,n=!0){ca(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,c,d,m)=>{if(r.push({paramName:l,isOptional:c!=null}),c){let f=m.charAt(d+o.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 K$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ca(!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 ps(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=kR(n.substring(1),"/"):a=kR(n,t)):a=t,{pathname:a,search:SQ(r),hash:jQ(i)}}function kR(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 SS(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 bQ(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pN(e){let t=bQ(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function m0(e,t,n,r=!1){let i;typeof e=="string"?i=Mf(e):(i={...e},xn(!i.pathname||!i.pathname.includes("?"),SS("?","pathname","search",i)),xn(!i.pathname||!i.pathname.includes("#"),SS("#","pathname","hash",i)),xn(!i.search||!i.search.includes("#"),SS("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),f-=1;i.pathname=g.join("/")}l=f>=0?t[f]:"/"}let c=xQ(i,l),d=o&&o!=="/"&&o.endsWith("/"),m=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}var bo=e=>e.join("/").replace(/\/\/+/g,"/"),wQ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),SQ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jQ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,EQ=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 _Q(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function CQ(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Y$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function X$(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(Y$)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),l=ps(o.pathname,t);o.origin===a.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{ca(!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 G$=["POST","PUT","PATCH","DELETE"];new Set(G$);var NQ=["GET",...G$];new Set(NQ);var Rf=y.createContext(null);Rf.displayName="DataRouter";var p0=y.createContext(null);p0.displayName="DataRouterState";var kQ=y.createContext(!1),W$=y.createContext({isTransitioning:!1});W$.displayName="ViewTransition";var AQ=y.createContext(new Map);AQ.displayName="Fetchers";var OQ=y.createContext(null);OQ.displayName="Await";var qi=y.createContext(null);qi.displayName="Navigation";var xp=y.createContext(null);xp.displayName="Location";var ba=y.createContext({outlet:null,matches:[],isDataRoute:!1});ba.displayName="Route";var gN=y.createContext(null);gN.displayName="RouteError";var Q$="REACT_ROUTER_ERROR",TQ="REDIRECT",PQ="ROUTE_ERROR_RESPONSE";function MQ(e){if(e.startsWith(`${Q$}:${TQ}:{`))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 RQ(e){if(e.startsWith(`${Q$}:${PQ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new EQ(t.status,t.statusText,t.data)}catch{}}function DQ(e,{relative:t}={}){xn(_c(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(qi),{hash:i,pathname:a,search:o}=wp(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:bo([n,a])),r.createHref({pathname:l,search:o,hash:i})}function _c(){return y.useContext(xp)!=null}function wa(){return xn(_c(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(xp).location}function jS(e){xn(_c(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=wa();return y.useMemo(()=>Mm(e,K$(t)),[t,e])}var Z$="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function J$(e){y.useContext(qi).static||y.useLayoutEffect(e)}function Sa(){let{isDataRoute:e}=y.useContext(ba);return e?WQ():IQ()}function IQ(){xn(_c(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Rf),{basename:t,navigator:n}=y.useContext(qi),{matches:r}=y.useContext(ba),{pathname:i}=wa(),a=JSON.stringify(pN(r)),o=y.useRef(!1);return J$(()=>{o.current=!0}),y.useCallback((c,d={})=>{if(ca(o.current,Z$),!o.current)return;if(typeof c=="number"){n.go(c);return}let m=m0(c,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:bo([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,a,i,e])}var LQ=y.createContext(null);function zQ(e){let t=y.useContext(ba).outlet;return y.useMemo(()=>t&&y.createElement(LQ.Provider,{value:e},t),[t,e])}function bp(){let{matches:e}=y.useContext(ba),t=e[e.length-1];return t?t.params:{}}function wp(e,{relative:t}={}){let{matches:n}=y.useContext(ba),{pathname:r}=wa(),i=JSON.stringify(pN(n));return y.useMemo(()=>m0(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function $Q(e,t){return eB(e,t)}function eB(e,t,n){var S;xn(_c(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(qi),{matches:i}=y.useContext(ba),a=i[i.length-1],o=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",d=a&&a.route;{let j=d&&d.path||"";nB(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=wa(),f;if(t){let j=typeof t=="string"?Mf(t):t;xn(c==="/"||((S=j.pathname)==null?void 0:S.startsWith(c)),`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 "${c}" but pathname "${j.pathname}" was given in the \`location\` prop.`),f=j}else f=m;let g=f.pathname||"/",v=g;if(c!=="/"){let j=c.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=H$(e,{pathname:v});ca(d||b!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ca(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=qQ(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},o,j.params),pathname:bo([c,r.encodeLocation?r.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:bo([c,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n);return t&&w?y.createElement(xp.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...f},navigationType:"POP"}},w):w}function BQ(){let e=GQ(),t=_Q(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 FQ=y.createElement(BQ,null),tB=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=RQ(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(ba.Provider,{value:this.props.routeContext},y.createElement(gN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(UQ,{error:e},t):t}};tB.contextType=kQ;var ES=new WeakMap;function UQ({children:e,error:t}){let{basename:n}=y.useContext(qi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=MQ(t.digest);if(r){let i=ES.get(t);if(i)throw i;let a=X$(r.location,n);if(Y$&&!ES.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 ES.set(t,o),o}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function HQ({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(ba.Provider,{value:e},n)}function qQ(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(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);xn(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 f=i[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(l=m),f.route.id){let{loaderData:g,errors:v}=r,b=f.route.loader&&!g.hasOwnProperty(f.route.id)&&(!v||v[f.route.id]===void 0);if(f.route.lazy||b){n.isStatic&&(o=!0),l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}}let c=n==null?void 0:n.onError,d=r&&c?(m,f)=>{var g,v;c(m,{location:r.location,params:((v=(g=r.matches)==null?void 0:g[0])==null?void 0:v.params)??{},unstable_pattern:CQ(r.matches),errorInfo:f})}:void 0;return i.reduceRight((m,f,g)=>{let v,b=!1,w=null,S=null;r&&(v=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||FQ,o&&(l<0&&g===0?(nB("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):l===g&&(b=!0,S=f.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,g+1)),C=()=>{let _;return v?_=w:b?_=S:f.route.Component?_=y.createElement(f.route.Component,null):f.route.element?_=f.route.element:_=m,y.createElement(HQ,{match:f,routeContext:{outlet:m,matches:j,isDataRoute:r!=null},children:_})};return r&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?y.createElement(tB,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:d}):C()},null)}function vN(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function VQ(e){let t=y.useContext(Rf);return xn(t,vN(e)),t}function KQ(e){let t=y.useContext(p0);return xn(t,vN(e)),t}function YQ(e){let t=y.useContext(ba);return xn(t,vN(e)),t}function yN(e){let t=YQ(e),n=t.matches[t.matches.length-1];return xn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function XQ(){return yN("useRouteId")}function GQ(){var r;let e=y.useContext(gN),t=KQ("useRouteError"),n=yN("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function WQ(){let{router:e}=VQ("useNavigate"),t=yN("useNavigate"),n=y.useRef(!1);return J$(()=>{n.current=!0}),y.useCallback(async(i,a={})=>{ca(n.current,Z$),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var AR={};function nB(e,t,n){!t&&!AR[e]&&(AR[e]=!0,ca(!1,n))}y.memo(QQ);function QQ({routes:e,future:t,state:n,isStatic:r,onError:i}){return eB(e,void 0,{state:n,isStatic:r,onError:i})}function OR({to:e,replace:t,state:n,relative:r}){xn(_c(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=y.useContext(qi);ca(!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(ba),{pathname:o}=wa(),l=Sa(),c=m0(e,pN(a),o,r==="path"),d=JSON.stringify(c);return y.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function ZQ(e){return zQ(e.context)}function gr(e){xn(!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 JQ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){xn(!_c(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=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:f="",state:g=null,key:v="default",unstable_mask:b}=n,w=y.useMemo(()=>{let S=ps(d,l);return S==null?null:{location:{pathname:S,search:m,hash:f,state:g,key:v,unstable_mask:b},navigationType:r}},[l,d,m,f,g,v,r,b]);return ca(w!=null,`<Router basename="${l}"> is not able to match the URL "${d}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(qi.Provider,{value:c},y.createElement(xp.Provider,{children:t,value:w}))}function eZ({children:e,location:t}){return $Q(e_(e),t)}function e_(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,e_(r.props.children,a));return}xn(r.type===gr,`[${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>`),xn(!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=e_(r.props.children,a)),n.push(o)}),n}var _y="get",Cy="application/x-www-form-urlencoded";function g0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function tZ(e){return g0(e)&&e.tagName.toLowerCase()==="button"}function nZ(e){return g0(e)&&e.tagName.toLowerCase()==="form"}function rZ(e){return g0(e)&&e.tagName.toLowerCase()==="input"}function iZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function aZ(e,t){return e.button===0&&(!t||t==="_self")&&!iZ(e)}function t_(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 oZ(e,t){let n=t_(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Bv=null;function sZ(){if(Bv===null)try{new FormData(document.createElement("form"),0),Bv=!1}catch{Bv=!0}return Bv}var lZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _S(e){return e!=null&&!lZ.has(e)?(ca(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cy}"`),null):e}function uZ(e,t){let n,r,i,a,o;if(nZ(e)){let l=e.getAttribute("action");r=l?ps(l,t):null,n=e.getAttribute("method")||_y,i=_S(e.getAttribute("enctype"))||Cy,a=new FormData(e)}else if(tZ(e)||rZ(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 c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?ps(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||_y,i=_S(e.getAttribute("formenctype"))||_S(l.getAttribute("enctype"))||Cy,a=new FormData(l,e),!sZ()){let{name:d,type:m,value:f}=e;if(m==="image"){let g=d?`${d}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else d&&a.append(d,f)}}else{if(g0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=_y,r=null,i=Cy,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 xN(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cZ(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&&ps(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function dZ(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 hZ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await dZ(a,n);return o.links?o.links():[]}return[]}));return vZ(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 TR(e,t,n,r,i,a){let o=(c,d)=>n[d]?c.route.id!==n[d].route.id:!0,l=(c,d)=>{var m;return n[d].pathname!==c.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==c.params["*"]};return a==="assets"?t.filter((c,d)=>o(c,d)||l(c,d)):a==="data"?t.filter((c,d)=>{var f;let m=r.routes[c.route.id];if(!m||!m.hasLoader)return!1;if(o(c,d)||l(c,d))return!0;if(c.route.shouldRevalidate){let g=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function mZ(e,t,{includeHydrateFallback:n}={}){return pZ(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 pZ(e){return[...new Set(e)]}function gZ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function vZ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(gZ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function rB(){let e=y.useContext(Rf);return xN(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function yZ(){let e=y.useContext(p0);return xN(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var bN=y.createContext(void 0);bN.displayName="FrameworkContext";function iB(){let e=y.useContext(bN);return xN(e,"You must render this element inside a <HydratedRouter> element"),e}function xZ(e,t){let n=y.useContext(bN),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:d,onMouseLeave:m,onTouchStart:f}=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:Vh(l,v),onBlur:Vh(c,b),onMouseEnter:Vh(d,v),onMouseLeave:Vh(m,b),onTouchStart:Vh(f,v)}]:[!1,g,{}]}function Vh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function bZ({page:e,...t}){let{router:n}=rB(),r=y.useMemo(()=>H$(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(SZ,{page:e,matches:r,...t}):null}function wZ(e){let{manifest:t,routeModules:n}=iB(),[r,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return hZ(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function SZ({page:e,matches:t,...n}){let r=wa(),{future:i,manifest:a,routeModules:o}=iB(),{basename:l}=rB(),{loaderData:c,matches:d}=yZ(),m=y.useMemo(()=>TR(e,t,d,a,r,"data"),[e,t,d,a,r]),f=y.useMemo(()=>TR(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 _=a.routes[C.route.id];!_||!_.hasLoader||(!m.some(O=>O.route.id===C.route.id)&&C.route.id in c&&((k=o[C.route.id])!=null&&k.shouldRevalidate)||_.hasClientLoader?S=!0:w.add(C.route.id))}),w.size===0)return[];let j=cZ(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,c,r,a,m,t,e,o]),v=y.useMemo(()=>mZ(f,a),[f,a]),b=wZ(f);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 jZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var EZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{EZ&&(window.__reactRouterVersion="7.13.1")}catch{}function _Z({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=y.useRef();i.current==null&&(i.current=nQ({window:r,v5Compat:!0}));let a=i.current,[o,l]=y.useState({action:a.action,location:a.location}),c=y.useCallback(d=>{n===!1?l(d):y.startTransition(()=>l(d))},[n]);return y.useLayoutEffect(()=>a.listen(c),[a,c]),y.createElement(JQ,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var aB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lr=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:o,unstable_mask:l,state:c,target:d,to:m,preventScrollReset:f,viewTransition:g,unstable_defaultShouldRevalidate:v,...b},w){let{basename:S,navigator:j,unstable_useTransitions:C}=y.useContext(qi),_=typeof m=="string"&&aB.test(m),k=X$(m,S);m=k.to;let O=DQ(m,{relative:i}),A=wa(),T=null;if(l){let q=m0(l,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);S!=="/"&&(q.pathname=q.pathname==="/"?S:bo([S,q.pathname])),T=j.createHref(q)}let[P,z,L]=xZ(r,b),F=kZ(m,{replace:o,unstable_mask:l,state:c,target:d,preventScrollReset:f,relative:i,viewTransition:g,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function D(q){t&&t(q),q.defaultPrevented||F(q)}let X=!(k.isExternal||a),R=y.createElement("a",{...b,...L,href:(X?T:void 0)||k.absoluteURL||O,onClick:X?D:t,ref:jZ(w,z),target:d,"data-discover":!_&&n==="render"?"true":void 0});return P&&!_?y.createElement(y.Fragment,null,R,y.createElement(bZ,{page:O})):R});lr.displayName="Link";var Ny=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:o,viewTransition:l,children:c,...d},m){let f=wp(o,{relative:d.relative}),g=wa(),v=y.useContext(p0),{navigator:b,basename:w}=y.useContext(qi),S=v!=null&&RZ(f)&&l===!0,j=b.encodeLocation?b.encodeLocation(f).pathname:f.pathname,C=g.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(C=C.toLowerCase(),_=_?_.toLowerCase():null,j=j.toLowerCase()),_&&w&&(_=ps(_,w)||_);const k=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let O=C===j||!i&&C.startsWith(j)&&C.charAt(k)==="/",A=_!=null&&(_===j||!i&&_.startsWith(j)&&_.charAt(j.length)==="/"),T={isActive:O,isPending:A,isTransitioning:S},P=O?t:void 0,z;typeof r=="function"?z=r(T):z=[r,O?"active":null,A?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let L=typeof a=="function"?a(T):a;return y.createElement(lr,{...d,"aria-current":P,className:z,ref:m,style:L,to:o,viewTransition:l},typeof c=="function"?c(T):c)});Ny.displayName="NavLink";var CZ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=_y,action:l,onSubmit:c,relative:d,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:g,...v},b)=>{let{unstable_useTransitions:w}=y.useContext(qi),S=PZ(),j=MZ(l,{relative:d}),C=o.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&aB.test(l),k=O=>{if(c&&c(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,T=(A==null?void 0:A.getAttribute("formmethod"))||o,P=()=>S(A||O.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:i,state:a,relative:d,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:g});w&&n!==!1?y.startTransition(()=>P()):P()};return y.createElement("form",{ref:b,method:C,action:j,onSubmit:r?c:k,...v,"data-discover":!_&&e==="render"?"true":void 0})});CZ.displayName="Form";function NZ(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function oB(e){let t=y.useContext(Rf);return xn(t,NZ(e)),t}function kZ(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:d}={}){let m=Sa(),f=wa(),g=wp(e,{relative:o});return y.useCallback(v=>{if(aZ(v,t)){v.preventDefault();let b=n!==void 0?n:Pm(f)===Pm(g),w=()=>m(e,{replace:b,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});d?y.startTransition(()=>w()):w()}},[f,m,g,n,r,i,t,e,a,o,l,c,d])}function AZ(e){ca(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(t_(e)),n=y.useRef(!1),r=wa(),i=y.useMemo(()=>oZ(r.search,n.current?null:t.current),[r.search]),a=Sa(),o=y.useCallback((l,c)=>{const d=t_(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,a("?"+d,c)},[a,i]);return[i,o]}var OZ=0,TZ=()=>`__${String(++OZ)}__`;function PZ(){let{router:e}=oB("useSubmit"),{basename:t}=y.useContext(qi),n=XQ(),r=e.fetch,i=e.navigate;return y.useCallback(async(a,o={})=>{let{action:l,method:c,encType:d,formData:m,body:f}=uZ(a,t);if(o.navigate===!1){let g=o.fetcherKey||TZ();await r(g,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,body:f,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await i(o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,body:f,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function MZ(e,{relative:t}={}){let{basename:n}=y.useContext(qi),r=y.useContext(ba);xn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...wp(e||".",{relative:t})},o=wa();if(e==null){a.search=o.search;let l=new URLSearchParams(a.search),c=l.getAll("index");if(c.some(m=>m==="")){l.delete("index"),c.filter(f=>f).forEach(f=>l.append("index",f));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:bo([n,a.pathname])),Pm(a)}function RZ(e,{relative:t}={}){let n=y.useContext(W$);xn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=oB("useViewTransitionState"),i=wp(e,{relative:t});if(!n.isTransitioning)return!1;let a=ps(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ps(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Mm(i.pathname,o)!=null||Mm(i.pathname,a)!=null}var Gl=U$();const sB=Hi(Gl);var Cc=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(){}},DZ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Cl,hN,O$,IZ=(O$=class{constructor(){Re(this,Cl,DZ);Re(this,hN,!1)}setTimeoutProvider(e){Ne(this,Cl,e)}setTimeout(e,t){return W(this,Cl).setTimeout(e,t)}clearTimeout(e){W(this,Cl).clearTimeout(e)}setInterval(e,t){return W(this,Cl).setInterval(e,t)}clearInterval(e){W(this,Cl).clearInterval(e)}},Cl=new WeakMap,hN=new WeakMap,O$),Iu=new IZ;function LZ(e){setTimeout(e,0)}var tc=typeof window>"u"||"Deno"in globalThis;function Br(){}function zZ(e,t){return typeof e=="function"?e(t):e}function n_(e){return typeof e=="number"&&e>=0&&e!==1/0}function lB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ll(e,t){return typeof e=="function"?e(t):e}function aa(e,t){return typeof e=="function"?e(t):e}function PR(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==wN(o,t.options))return!1}else if(!Rm(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||a&&!a(t))}function MR(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(nc(t.options.mutationKey)!==nc(a))return!1}else if(!Rm(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function wN(e,t){return((t==null?void 0:t.queryKeyHashFn)||nc)(e)}function nc(e){return JSON.stringify(e,(t,n)=>r_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Rm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Rm(e[n],t[n])):!1}var $Z=Object.prototype.hasOwnProperty;function SN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=RR(e)&&RR(t);if(!r&&!(r_(e)&&r_(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,c=r?new Array(l):{};let d=0;for(let m=0;m<l;m++){const f=r?m:o[m],g=e[f],v=t[f];if(g===v){c[f]=g,(r?m<a:$Z.call(e,f))&&d++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[f]=v;continue}const b=SN(g,v,n+1);c[f]=b,b===g&&d++}return a===l&&d===a?e:c}function Dm(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 RR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function r_(e){if(!DR(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!DR(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function DR(e){return Object.prototype.toString.call(e)==="[object Object]"}function BZ(e){return new Promise(t=>{Iu.setTimeout(t,e)})}function i_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?SN(e,t):t}function FZ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function UZ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var jN=Symbol();function uB(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===jN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function EN(e,t){return typeof e=="function"?e(...t):!!e}function HZ(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 Fu,Nl,Kd,T$,qZ=(T$=class extends Cc{constructor(){super();Re(this,Fu);Re(this,Nl);Re(this,Kd);Ne(this,Kd,t=>{if(!tc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Nl)||this.setEventListener(W(this,Kd))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Nl))==null||t.call(this),Ne(this,Nl,void 0))}setEventListener(t){var n;Ne(this,Kd,t),(n=W(this,Nl))==null||n.call(this),Ne(this,Nl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Fu)!==t&&(Ne(this,Fu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Fu)=="boolean"?W(this,Fu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Fu=new WeakMap,Nl=new WeakMap,Kd=new WeakMap,T$),_N=new qZ;function a_(){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 VZ=LZ;function KZ(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=VZ;const a=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var zn=KZ(),Yd,kl,Xd,P$,YZ=(P$=class extends Cc{constructor(){super();Re(this,Yd,!0);Re(this,kl);Re(this,Xd);Ne(this,Xd,t=>{if(!tc&&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,kl)||this.setEventListener(W(this,Xd))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,kl))==null||t.call(this),Ne(this,kl,void 0))}setEventListener(t){var n;Ne(this,Xd,t),(n=W(this,kl))==null||n.call(this),Ne(this,kl,t(this.setOnline.bind(this)))}setOnline(t){W(this,Yd)!==t&&(Ne(this,Yd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Yd)}},Yd=new WeakMap,kl=new WeakMap,Xd=new WeakMap,P$),Hy=new YZ;function XZ(e){return Math.min(1e3*2**e,3e4)}function cB(e){return(e??"online")==="online"?Hy.isOnline():!0}var o_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dB(e){let t=!1,n=0,r;const i=a_(),a=()=>i.status!=="pending",o=w=>{var S;if(!a()){const j=new o_(w);g(j),(S=e.onCancel)==null||S.call(e,j)}},l=()=>{t=!0},c=()=>{t=!1},d=()=>_N.isFocused()&&(e.networkMode==="always"||Hy.isOnline())&&e.canRun(),m=()=>cB(e.networkMode)&&e.canRun(),f=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(f).catch(j=>{var A;if(a())return;const C=e.retry??(tc?0:3),_=e.retryDelay??XZ,k=typeof _=="function"?_(n,j):_,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),BZ(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:c,canStart:m,start:()=>(m()?b():v().then(b),i)}}var Uu,M$,fB=(M$=class{constructor(){Re(this,Uu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),n_(this.gcTime)&&Ne(this,Uu,Iu.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tc?1/0:300*1e3))}clearGcTimeout(){W(this,Uu)&&(Iu.clearTimeout(W(this,Uu)),Ne(this,Uu,void 0))}},Uu=new WeakMap,M$),Hu,Gd,ra,qu,vr,cp,Vu,Ra,ts,R$,GZ=(R$=class extends fB{constructor(t){super();Re(this,Ra);Re(this,Hu);Re(this,Gd);Re(this,ra);Re(this,qu);Re(this,vr);Re(this,cp);Re(this,Vu);Ne(this,Vu,!1),Ne(this,cp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ne(this,qu,t.client),Ne(this,ra,W(this,qu).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ne(this,Hu,LR(this.options)),this.state=t.state??W(this,Hu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,vr))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,cp),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=LR(this.options);n.data!==void 0&&(this.setState(IR(n.data,n.dataUpdatedAt)),Ne(this,Hu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ra).remove(this)}setData(t,n){const r=i_(this.state.data,t,this.options);return ot(this,Ra,ts).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,Ra,ts).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=W(this,vr))==null?void 0:r.promise;return(i=W(this,vr))==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,Hu))}isActive(){return this.observers.some(t=>aa(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ll(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:!lB(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,vr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,vr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,ra).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,vr)&&(W(this,Vu)?W(this,vr).cancel({revert:!0}):W(this,vr).cancelRetry()),this.scheduleGc()),W(this,ra).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ot(this,Ra,ts).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,m,f,g,v,b,w,S,j,C,_;if(this.state.fetchStatus!=="idle"&&((c=W(this,vr))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,vr))return W(this,vr).continueRetry(),W(this,vr).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,Vu,!0),r.signal)})},a=()=>{const k=uB(this.options,n),A=(()=>{const T={client:W(this,qu),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return Ne(this,Vu,!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,qu),state:this.state,fetchFn:a};return i(k),k})();(d=this.options.behavior)==null||d.onFetch(l,this),Ne(this,Gd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&ot(this,Ra,ts).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),Ne(this,vr,dB({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:k=>{k instanceof o_&&k.revert&&this.setState({...W(this,Gd),fetchStatus:"idle"}),r.abort()},onFail:(k,O)=>{ot(this,Ra,ts).call(this,{type:"failed",failureCount:k,error:O})},onPause:()=>{ot(this,Ra,ts).call(this,{type:"pause"})},onContinue:()=>{ot(this,Ra,ts).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const k=await W(this,vr).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(v=(g=W(this,ra).config).onSuccess)==null||v.call(g,k,this),(w=(b=W(this,ra).config).onSettled)==null||w.call(b,k,this.state.error,this),k}catch(k){if(k instanceof o_){if(k.silent)return W(this,vr).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw ot(this,Ra,ts).call(this,{type:"error",error:k}),(j=(S=W(this,ra).config).onError)==null||j.call(S,k,this),(_=(C=W(this,ra).config).onSettled)==null||_.call(C,this.state.data,k,this),k}finally{this.scheduleGc()}}},Hu=new WeakMap,Gd=new WeakMap,ra=new WeakMap,qu=new WeakMap,vr=new WeakMap,cp=new WeakMap,Vu=new WeakMap,Ra=new WeakSet,ts=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,...hB(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...IR(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ne(this,Gd,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),zn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ra).notify({query:this,type:"updated",action:t})})},R$);function hB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function IR(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function LR(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 pi,Ot,dp,Zr,Ku,Wd,rs,Al,fp,Qd,Zd,Yu,Xu,Ol,Jd,Vt,pm,s_,l_,u_,c_,d_,f_,h_,mB,D$,v0=(D$=class extends Cc{constructor(t,n){super();Re(this,Vt);Re(this,pi);Re(this,Ot);Re(this,dp);Re(this,Zr);Re(this,Ku);Re(this,Wd);Re(this,rs);Re(this,Al);Re(this,fp);Re(this,Qd);Re(this,Zd);Re(this,Yu);Re(this,Xu);Re(this,Ol);Re(this,Jd,new Set);this.options=n,Ne(this,pi,t),Ne(this,Al,null),Ne(this,rs,a_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Ot).addObserver(this),zR(W(this,Ot),this.options)?ot(this,Vt,pm).call(this):this.updateResult(),ot(this,Vt,c_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return m_(W(this,Ot),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return m_(W(this,Ot),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,Vt,d_).call(this),ot(this,Vt,f_).call(this),W(this,Ot).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,Ot);if(this.options=W(this,pi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof aa(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,h_).call(this),W(this,Ot).setOptions(this.options),n._defaulted&&!Dm(this.options,n)&&W(this,pi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Ot),observer:this});const i=this.hasListeners();i&&$R(W(this,Ot),r,this.options,n)&&ot(this,Vt,pm).call(this),this.updateResult(),i&&(W(this,Ot)!==r||aa(this.options.enabled,W(this,Ot))!==aa(n.enabled,W(this,Ot))||Ll(this.options.staleTime,W(this,Ot))!==Ll(n.staleTime,W(this,Ot)))&&ot(this,Vt,s_).call(this);const a=ot(this,Vt,l_).call(this);i&&(W(this,Ot)!==r||aa(this.options.enabled,W(this,Ot))!==aa(n.enabled,W(this,Ot))||a!==W(this,Ol))&&ot(this,Vt,u_).call(this,a)}getOptimisticResult(t){const n=W(this,pi).getQueryCache().build(W(this,pi),t),r=this.createResult(n,t);return QZ(this,r)&&(Ne(this,Zr,r),Ne(this,Wd,this.options),Ne(this,Ku,W(this,Ot).state)),r}getCurrentResult(){return W(this,Zr)}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,rs).status==="pending"&&W(this,rs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,Jd).add(t)}getCurrentQuery(){return W(this,Ot)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,pi).defaultQueryOptions(t),r=W(this,pi).getQueryCache().build(W(this,pi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ot(this,Vt,pm).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Zr)))}createResult(t,n){var z;const r=W(this,Ot),i=this.options,a=W(this,Zr),o=W(this,Ku),l=W(this,Wd),d=t!==r?t.state:W(this,dp),{state:m}=t;let f={...m},g=!1,v;if(n._optimisticResults){const L=this.hasListeners(),F=!L&&zR(t,n),D=L&&$R(t,r,n,i);(F||D)&&(f={...f,...hB(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=f;v=f.data;let j=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let L;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(L=a.data,j=!0):L=typeof n.placeholderData=="function"?n.placeholderData((z=W(this,Zd))==null?void 0:z.state.data,W(this,Zd)):n.placeholderData,L!==void 0&&(S="success",v=i_(a==null?void 0:a.data,L,n),g=!0)}if(n.select&&v!==void 0&&!j)if(a&&v===(o==null?void 0:o.data)&&n.select===W(this,fp))v=W(this,Qd);else try{Ne(this,fp,n.select),v=n.select(v),v=i_(a==null?void 0:a.data,v,n),Ne(this,Qd,v),Ne(this,Al,null)}catch(L){Ne(this,Al,L)}W(this,Al)&&(b=W(this,Al),v=W(this,Qd),w=Date.now(),S="error");const C=f.fetchStatus==="fetching",_=S==="pending",k=S==="error",O=_&&C,A=v!==void 0,P={status:S,fetchStatus:f.fetchStatus,isPending:_,isSuccess:S==="success",isError:k,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!_,isLoadingError:k&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&A,isStale:CN(t,n),refetch:this.refetch,promise:W(this,rs),isEnabled:aa(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const L=P.data!==void 0,F=P.status==="error"&&!L,D=q=>{F?q.reject(P.error):L&&q.resolve(P.data)},X=()=>{const q=Ne(this,rs,P.promise=a_());D(q)},R=W(this,rs);switch(R.status){case"pending":t.queryHash===r.queryHash&&D(R);break;case"fulfilled":(F||P.data!==R.value)&&X();break;case"rejected":(!F||P.error!==R.reason)&&X();break}}return P}updateResult(){const t=W(this,Zr),n=this.createResult(W(this,Ot),this.options);if(Ne(this,Ku,W(this,Ot).state),Ne(this,Wd,this.options),W(this,Ku).data!==void 0&&Ne(this,Zd,W(this,Ot)),Dm(n,t))return;Ne(this,Zr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!W(this,Jd).size)return!0;const o=new Set(a??W(this,Jd));return this.options.throwOnError&&o.add("error"),Object.keys(W(this,Zr)).some(l=>{const c=l;return W(this,Zr)[c]!==t[c]&&o.has(c)})};ot(this,Vt,mB).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,Vt,c_).call(this)}},pi=new WeakMap,Ot=new WeakMap,dp=new WeakMap,Zr=new WeakMap,Ku=new WeakMap,Wd=new WeakMap,rs=new WeakMap,Al=new WeakMap,fp=new WeakMap,Qd=new WeakMap,Zd=new WeakMap,Yu=new WeakMap,Xu=new WeakMap,Ol=new WeakMap,Jd=new WeakMap,Vt=new WeakSet,pm=function(t){ot(this,Vt,h_).call(this);let n=W(this,Ot).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Br)),n},s_=function(){ot(this,Vt,d_).call(this);const t=Ll(this.options.staleTime,W(this,Ot));if(tc||W(this,Zr).isStale||!n_(t))return;const r=lB(W(this,Zr).dataUpdatedAt,t)+1;Ne(this,Yu,Iu.setTimeout(()=>{W(this,Zr).isStale||this.updateResult()},r))},l_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Ot)):this.options.refetchInterval)??!1},u_=function(t){ot(this,Vt,f_).call(this),Ne(this,Ol,t),!(tc||aa(this.options.enabled,W(this,Ot))===!1||!n_(W(this,Ol))||W(this,Ol)===0)&&Ne(this,Xu,Iu.setInterval(()=>{(this.options.refetchIntervalInBackground||_N.isFocused())&&ot(this,Vt,pm).call(this)},W(this,Ol)))},c_=function(){ot(this,Vt,s_).call(this),ot(this,Vt,u_).call(this,ot(this,Vt,l_).call(this))},d_=function(){W(this,Yu)&&(Iu.clearTimeout(W(this,Yu)),Ne(this,Yu,void 0))},f_=function(){W(this,Xu)&&(Iu.clearInterval(W(this,Xu)),Ne(this,Xu,void 0))},h_=function(){const t=W(this,pi).getQueryCache().build(W(this,pi),this.options);if(t===W(this,Ot))return;const n=W(this,Ot);Ne(this,Ot,t),Ne(this,dp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},mB=function(t){zn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Zr))}),W(this,pi).getQueryCache().notify({query:W(this,Ot),type:"observerResultsUpdated"})})},D$);function WZ(e,t){return aa(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zR(e,t){return WZ(e,t)||e.state.data!==void 0&&m_(e,t,t.refetchOnMount)}function m_(e,t,n){if(aa(t.enabled,e)!==!1&&Ll(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&CN(e,t)}return!1}function $R(e,t,n,r){return(e!==t||aa(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&CN(e,n)}function CN(e,t){return aa(t.enabled,e)!==!1&&e.isStaleByTime(Ll(t.staleTime,e))}function QZ(e,t){return!Dm(e.getCurrentResult(),t)}function qy(e){return{onFetch:(t,n)=>{var m,f,g,v,b;const r=t.options,i=(g=(f=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:f.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:[]},c=0;const d=async()=>{let w=!1;const S=_=>{HZ(_,()=>t.signal,()=>w=!0)},j=uB(t.options,t.fetchOptions),C=async(_,k,O)=>{if(w)return Promise.reject();if(k==null&&_.pages.length)return Promise.resolve(_);const T=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:k,direction:O?"backward":"forward",meta:t.options.meta};return S(F),F})(),P=await j(T),{maxPages:z}=t.options,L=O?UZ:FZ;return{pages:L(_.pages,P,z),pageParams:L(_.pageParams,k,z)}};if(i&&a.length){const _=i==="backward",k=_?pB:p_,O={pages:a,pageParams:o},A=k(r,O);l=await C(O,A,_)}else{const _=e??a.length;do{const k=c===0?o[0]??r.initialPageParam:p_(r,l);if(c>0&&k==null)break;l=await C(l,k),c++}while(c<_)}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 p_(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 pB(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 ZZ(e,t){return t?p_(e,t)!=null:!1}function JZ(e,t){return!t||!e.getPreviousPageParam?!1:pB(e,t)!=null}var eJ=class extends v0{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:qy()})}getOptimisticResult(e){return e.behavior=qy(),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,c=(w=(b=n.fetchMeta)==null?void 0:b.fetchMore)==null?void 0:w.direction,d=o&&c==="forward",m=i&&c==="forward",f=o&&c==="backward",g=i&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ZZ(t,n.data),hasPreviousPage:JZ(t,n.data),isFetchNextPageError:d,isFetchingNextPage:m,isFetchPreviousPageError:f,isFetchingPreviousPage:g,isRefetchError:l&&!d&&!f,isRefetching:a&&!m&&!g}}},hp,fo,zr,Gu,ho,xl,I$,tJ=(I$=class extends fB{constructor(t){super();Re(this,ho);Re(this,hp);Re(this,fo);Re(this,zr);Re(this,Gu);Ne(this,hp,t.client),this.mutationId=t.mutationId,Ne(this,zr,t.mutationCache),Ne(this,fo,[]),this.state=t.state||gB(),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,fo).includes(t)||(W(this,fo).push(t),this.clearGcTimeout(),W(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ne(this,fo,W(this,fo).filter(n=>n!==t)),this.scheduleGc(),W(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,fo).length||(this.state.status==="pending"?this.scheduleGc():W(this,zr).remove(this))}continue(){var t;return((t=W(this,Gu))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,d,m,f,g,v,b,w,S,j,C,_,k,O,A,T;const n=()=>{ot(this,ho,xl).call(this,{type:"continue"})},r={client:W(this,hp),meta:this.options.meta,mutationKey:this.options.mutationKey};Ne(this,Gu,dB({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,z)=>{ot(this,ho,xl).call(this,{type:"failed",failureCount:P,error:z})},onPause:()=>{ot(this,ho,xl).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,Gu).canStart();try{if(i)n();else{ot(this,ho,xl).call(this,{type:"pending",variables:t,isPaused:a}),W(this,zr).config.onMutate&&await W(this,zr).config.onMutate(t,this,r);const z=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));z!==this.state.context&&ot(this,ho,xl).call(this,{type:"pending",context:z,variables:t,isPaused:a})}const P=await W(this,Gu).start();return await((d=(c=W(this,zr).config).onSuccess)==null?void 0:d.call(c,P,t,this.state.context,this,r)),await((f=(m=this.options).onSuccess)==null?void 0:f.call(m,P,t,this.state.context,r)),await((v=(g=W(this,zr).config).onSettled)==null?void 0:v.call(g,P,null,this.state.variables,this.state.context,this,r)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,P,null,t,this.state.context,r)),ot(this,ho,xl).call(this,{type:"success",data:P}),P}catch(P){try{await((j=(S=W(this,zr).config).onError)==null?void 0:j.call(S,P,t,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((_=(C=this.options).onError)==null?void 0:_.call(C,P,t,this.state.context,r))}catch(z){Promise.reject(z)}try{await((O=(k=W(this,zr).config).onSettled)==null?void 0:O.call(k,void 0,P,this.state.variables,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((T=(A=this.options).onSettled)==null?void 0:T.call(A,void 0,P,t,this.state.context,r))}catch(z){Promise.reject(z)}throw ot(this,ho,xl).call(this,{type:"error",error:P}),P}finally{W(this,zr).runNext(this)}}},hp=new WeakMap,fo=new WeakMap,zr=new WeakMap,Gu=new WeakMap,ho=new WeakSet,xl=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),zn.batch(()=>{W(this,fo).forEach(r=>{r.onMutationUpdate(t)}),W(this,zr).notify({mutation:this,type:"updated",action:t})})},I$);function gB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var is,Da,mp,L$,nJ=(L$=class extends Cc{constructor(t={}){super();Re(this,is);Re(this,Da);Re(this,mp);this.config=t,Ne(this,is,new Set),Ne(this,Da,new Map),Ne(this,mp,0)}build(t,n,r){const i=new tJ({client:t,mutationCache:this,mutationId:++$v(this,mp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,is).add(t);const n=Fv(t);if(typeof n=="string"){const r=W(this,Da).get(n);r?r.push(t):W(this,Da).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,is).delete(t)){const n=Fv(t);if(typeof n=="string"){const r=W(this,Da).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,Da).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Fv(t);if(typeof n=="string"){const r=W(this,Da).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=Fv(t);if(typeof n=="string"){const i=(r=W(this,Da).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(){zn.batch(()=>{W(this,is).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,is).clear(),W(this,Da).clear()})}getAll(){return Array.from(W(this,is))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>MR(n,r))}findAll(t={}){return this.getAll().filter(n=>MR(t,n))}notify(t){zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return zn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Br))))}},is=new WeakMap,Da=new WeakMap,mp=new WeakMap,L$);function Fv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var as,Tl,gi,os,ms,ky,g_,z$,rJ=(z$=class extends Cc{constructor(n,r){super();Re(this,ms);Re(this,as);Re(this,Tl);Re(this,gi);Re(this,os);Ne(this,as,n),this.setOptions(r),this.bindMethods(),ot(this,ms,ky).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,as).defaultMutationOptions(n),Dm(this.options,r)||W(this,as).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,gi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&nc(r.mutationKey)!==nc(this.options.mutationKey)?this.reset():((i=W(this,gi))==null?void 0:i.state.status)==="pending"&&W(this,gi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,gi))==null||n.removeObserver(this)}onMutationUpdate(n){ot(this,ms,ky).call(this),ot(this,ms,g_).call(this,n)}getCurrentResult(){return W(this,Tl)}reset(){var n;(n=W(this,gi))==null||n.removeObserver(this),Ne(this,gi,void 0),ot(this,ms,ky).call(this),ot(this,ms,g_).call(this)}mutate(n,r){var i;return Ne(this,os,r),(i=W(this,gi))==null||i.removeObserver(this),Ne(this,gi,W(this,as).getMutationCache().build(W(this,as),this.options)),W(this,gi).addObserver(this),W(this,gi).execute(n)}},as=new WeakMap,Tl=new WeakMap,gi=new WeakMap,os=new WeakMap,ms=new WeakSet,ky=function(){var r;const n=((r=W(this,gi))==null?void 0:r.state)??gB();Ne(this,Tl,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},g_=function(n){zn.batch(()=>{var r,i,a,o,l,c,d,m;if(W(this,os)&&this.hasListeners()){const f=W(this,Tl).variables,g=W(this,Tl).context,v={client:W(this,as),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,os)).onSuccess)==null||i.call(r,n.data,f,g,v)}catch(b){Promise.reject(b)}try{(o=(a=W(this,os)).onSettled)==null||o.call(a,n.data,null,f,g,v)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(c=(l=W(this,os)).onError)==null||c.call(l,n.error,f,g,v)}catch(b){Promise.reject(b)}try{(m=(d=W(this,os)).onSettled)==null||m.call(d,void 0,n.error,f,g,v)}catch(b){Promise.reject(b)}}}this.listeners.forEach(f=>{f(W(this,Tl))})})},z$);function BR(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function iJ(e,t,n){const r=e.slice(0);return r[t]=n,r}var ef,Oi,tf,nf,ia,Pl,pp,gp,vp,yp,Mr,v_,y_,x_,b_,w_,$$,aJ=($$=class extends Cc{constructor(t,n,r){super();Re(this,Mr);Re(this,ef);Re(this,Oi);Re(this,tf);Re(this,nf);Re(this,ia);Re(this,Pl);Re(this,pp);Re(this,gp);Re(this,vp);Re(this,yp,[]);Ne(this,ef,t),Ne(this,nf,r),Ne(this,tf,[]),Ne(this,ia,[]),Ne(this,Oi,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,ia).forEach(t=>{t.subscribe(n=>{ot(this,Mr,b_).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,ia).forEach(t=>{t.destroy()})}setQueries(t,n){Ne(this,tf,t),Ne(this,nf,n),zn.batch(()=>{const r=W(this,ia),i=ot(this,Mr,x_).call(this,W(this,tf));i.forEach(f=>f.observer.setOptions(f.defaultedQueryOptions));const a=i.map(f=>f.observer),o=a.map(f=>f.getCurrentResult()),l=r.length!==a.length,c=a.some((f,g)=>f!==r[g]),d=l||c,m=d?!0:o.some((f,g)=>{const v=W(this,Oi)[g];return!v||!Dm(f,v)});!d&&!m||(d&&(Ne(this,yp,i),Ne(this,ia,a)),Ne(this,Oi,o),this.hasListeners()&&(d&&(BR(r,a).forEach(f=>{f.destroy()}),BR(a,r).forEach(f=>{f.subscribe(g=>{ot(this,Mr,b_).call(this,f,g)})})),ot(this,Mr,w_).call(this)))})}getCurrentResult(){return W(this,Oi)}getQueries(){return W(this,ia).map(t=>t.getCurrentQuery())}getObservers(){return W(this,ia)}getOptimisticResult(t,n){const r=ot(this,Mr,x_).call(this,t),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>ot(this,Mr,y_).call(this,o??i,n,a),()=>ot(this,Mr,v_).call(this,i,r)]}},ef=new WeakMap,Oi=new WeakMap,tf=new WeakMap,nf=new WeakMap,ia=new WeakMap,Pl=new WeakMap,pp=new WeakMap,gp=new WeakMap,vp=new WeakMap,yp=new WeakMap,Mr=new WeakSet,v_=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)})})})},y_=function(t,n,r){if(n){const i=W(this,vp),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((o,l)=>o!==i[l]));return(!W(this,Pl)||W(this,Oi)!==W(this,gp)||a||n!==W(this,pp))&&(Ne(this,pp,n),Ne(this,gp,W(this,Oi)),r!==void 0&&Ne(this,vp,r),Ne(this,Pl,SN(W(this,Pl),n(t)))),W(this,Pl)}return t},x_=function(t){const n=new Map;W(this,ia).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 c;const a=W(this,ef).defaultQueryOptions(i),l=((c=n.get(a.queryHash))==null?void 0:c.shift())??new v0(W(this,ef),a);r.push({defaultedQueryOptions:a,observer:l})}),r},b_=function(t,n){const r=W(this,ia).indexOf(t);r!==-1&&(Ne(this,Oi,iJ(W(this,Oi),r,n)),ot(this,Mr,w_).call(this))},w_=function(){var t;if(this.hasListeners()){const n=W(this,Pl),r=ot(this,Mr,v_).call(this,W(this,Oi),W(this,yp)),i=ot(this,Mr,y_).call(this,r,(t=W(this,nf))==null?void 0:t.combine);n!==i&&zn.batch(()=>{this.listeners.forEach(a=>{a(W(this,Oi))})})}},$$),mo,B$,oJ=(B$=class extends Cc{constructor(t={}){super();Re(this,mo);this.config=t,Ne(this,mo,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??wN(i,n);let o=this.get(a);return o||(o=new GZ({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){W(this,mo).has(t.queryHash)||(W(this,mo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,mo).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,mo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,mo).get(t)}getAll(){return[...W(this,mo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>PR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>PR(t,r)):n}notify(t){zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){zn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mo=new WeakMap,B$),Dn,Ml,Rl,rf,af,Dl,of,sf,F$,sJ=(F$=class{constructor(e={}){Re(this,Dn);Re(this,Ml);Re(this,Rl);Re(this,rf);Re(this,af);Re(this,Dl);Re(this,of);Re(this,sf);Ne(this,Dn,e.queryCache||new oJ),Ne(this,Ml,e.mutationCache||new nJ),Ne(this,Rl,e.defaultOptions||{}),Ne(this,rf,new Map),Ne(this,af,new Map),Ne(this,Dl,0)}mount(){$v(this,Dl)._++,W(this,Dl)===1&&(Ne(this,of,_N.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Dn).onFocus())})),Ne(this,sf,Hy.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Dn).onOnline())})))}unmount(){var e,t;$v(this,Dl)._--,W(this,Dl)===0&&((e=W(this,of))==null||e.call(this),Ne(this,of,void 0),(t=W(this,sf))==null||t.call(this),Ne(this,sf,void 0))}isFetching(e){return W(this,Dn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Ml).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,Dn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,Dn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ll(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,Dn).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,Dn).get(r.queryHash),a=i==null?void 0:i.state.data,o=zZ(t,a);if(o!==void 0)return W(this,Dn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return zn.batch(()=>W(this,Dn).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,Dn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,Dn);zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,Dn);return zn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=zn.batch(()=>W(this,Dn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Br).catch(Br)}invalidateQueries(e,t={}){return zn.batch(()=>(W(this,Dn).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=zn.batch(()=>W(this,Dn).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,Dn).build(this,t);return n.isStaleByTime(Ll(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=qy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Br).catch(Br)}ensureInfiniteQueryData(e){return e.behavior=qy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hy.isOnline()?W(this,Ml).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Dn)}getMutationCache(){return W(this,Ml)}getDefaultOptions(){return W(this,Rl)}setDefaultOptions(e){Ne(this,Rl,e)}setQueryDefaults(e,t){W(this,rf).set(nc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,rf).values()],n={};return t.forEach(r=>{Rm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,af).set(nc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,af).values()],n={};return t.forEach(r=>{Rm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Rl).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=wN(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===jN&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Rl).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,Dn).clear(),W(this,Ml).clear()}},Dn=new WeakMap,Ml=new WeakMap,Rl=new WeakMap,rf=new WeakMap,af=new WeakMap,Dl=new WeakMap,of=new WeakMap,sf=new WeakMap,F$),vB=y.createContext(void 0),lt=e=>{const t=y.useContext(vB);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]),h.jsx(vB.Provider,{value:e,children:t})),yB=y.createContext(!1),xB=()=>y.useContext(yB);yB.Provider;function uJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cJ=y.createContext(uJ()),bB=()=>y.useContext(cJ),wB=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?EN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},SB=e=>{y.useEffect(()=>{e.clearReset()},[e])},jB=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||EN(n,[e.error,r])),EB=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))}},dJ=(e,t)=>e.isLoading&&e.isFetching&&!t,S_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,j_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function fJ({queries:e,...t},n){const r=lt(),i=xB(),a=bB(),o=y.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);o.forEach(w=>{EB(w);const S=r.getQueryCache().get(w.queryHash);wB(w,a,S)}),SB(a);const[l]=y.useState(()=>new aJ(r,o,t)),[c,d,m]=l.getOptimisticResult(o,t.combine),f=!i&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(w=>f?l.subscribe(zn.batchCalls(w)):Br,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const v=c.some((w,S)=>S_(o[S],w))?c.flatMap((w,S)=>{const j=o[S];if(j&&S_(j,w)){const C=new v0(r,j);return j_(j,C,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=c.find((w,S)=>{const j=o[S];return j&&jB({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=xB(),i=bB(),a=lt(),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",EB(o),wB(o,i,l),SB(i);const c=!a.getQueryCache().get(o.queryHash),[d]=y.useState(()=>new t(a,o)),m=d.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(S=>{const j=f?d.subscribe(zn.batchCalls(S)):Br;return d.updateResult(),j},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),y.useEffect(()=>{d.setOptions(o)},[o,d]),S_(o,m))throw j_(o,d,i);if(jB({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&&!tc&&dJ(m,r)){const S=c?j_(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 On(e,t){return _B(e,v0)}function yt(e,t){const n=lt(),[r]=y.useState(()=>new rJ(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const i=y.useSyncExternalStore(y.useCallback(o=>r.subscribe(zn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((o,l)=>{r.mutate(o,l).catch(Br)},[r]);if(i.error&&EN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function hJ(e,t){return _B(e,eJ)}var mJ=(e,t,n,r,i,a,o,l)=>{let c=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?(c.classList.remove(...S),c.classList.add(a&&a[v]?a[v]:v)):c.setAttribute(b,v)}),f(v)}function f(v){l&&d.includes(v)&&(c.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{}},FR=["light","dark"],CB="(prefers-color-scheme: dark)",pJ=typeof window>"u",NN=y.createContext(void 0),gJ={setTheme:e=>{},themes:[]},kN=()=>{var e;return(e=y.useContext(NN))!=null?e:gJ},vJ=e=>y.useContext(NN)?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:c,children:d,nonce:m,scriptProps:f})=>{let[g,v]=y.useState(()=>wJ(i,o)),[b,w]=y.useState(()=>g==="system"?CS():g),S=c?Object.values(c):a,j=y.useCallback(O=>{let A=O;if(!A)return;O==="system"&&n&&(A=CS());let T=c?c[A]:A,P=t?SJ(m):null,z=document.documentElement,L=F=>{F==="class"?(z.classList.remove(...S),T&&z.classList.add(T)):F.startsWith("data-")&&(T?z.setAttribute(F,T):z.removeAttribute(F))};if(Array.isArray(l)?l.forEach(L):L(l),r){let F=FR.includes(o)?o:null,D=FR.includes(A)?A:F;z.style.colorScheme=D}P==null||P()},[m]),C=y.useCallback(O=>{let A=typeof O=="function"?O(g):O;v(A);try{localStorage.setItem(i,A)}catch{}},[g]),_=y.useCallback(O=>{let A=CS(O);w(A),g==="system"&&n&&!e&&j("system")},[g,e]);y.useEffect(()=>{let O=window.matchMedia(CB);return O.addListener(_),_(O),()=>O.removeListener(_)},[_]),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(NN.Provider,{value:k},y.createElement(bJ,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:m,scriptProps:f}),d)},bJ=y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:l,nonce:c,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"?c:"",dangerouslySetInnerHTML:{__html:`(${mJ.toString()})(${m})`}})}),wJ=(e,t)=>{if(pJ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},SJ=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)}},CS=e=>(e||(e=window.matchMedia(CB)),e.matches?"dark":"light");function UR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gs(...e){return t=>{let n=!1;const r=e.map(i=>{const a=UR(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():UR(e[i],null)}}}}function bt(...e){return y.useCallback(gs(...e),e)}function rc(e){const t=jJ(e),n=y.forwardRef((r,i)=>{const{children:a,...o}=r,l=y.Children.toArray(a),c=l.find(_J);if(c){const d=c.props.children,m=l.map(f=>f===c?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:f);return h.jsx(t,{...o,ref:i,children:y.isValidElement(d)?y.cloneElement(d,void 0,m):null})}return h.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var AN=rc("Slot");function jJ(e){const t=y.forwardRef((n,r)=>{const{children:i,...a}=n;if(y.isValidElement(i)){const o=NJ(i),l=CJ(a,i.props);return i.type!==y.Fragment&&(l.ref=r?gs(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 NB=Symbol("radix.slottable");function EJ(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=NB,t}function _J(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NB}function CJ(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 c=a(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function NJ(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 kJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ve=kJ.reduce((e,t)=>{const n=rc(`Primitive.${t}`),r=y.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kB(e,t){e&&Gl.flushSync(()=>e.dispatchEvent(t))}var AB=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"}),AJ="VisuallyHidden",OB=y.forwardRef((e,t)=>h.jsx(Ve.span,{...e,ref:t,style:{...AB,...e.style}}));OB.displayName=AJ;var OJ=OB;function TJ(e,t){const n=y.createContext(t),r=a=>{const{children:o,...l}=a,c=y.useMemo(()=>l,Object.values(l));return h.jsx(n.Provider,{value:c,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 ja(e,t=[]){let n=[];function r(a,o){const l=y.createContext(o),c=n.length;n=[...n,o];const d=f=>{var j;const{scope:g,children:v,...b}=f,w=((j=g==null?void 0:g[e])==null?void 0:j[c])||l,S=y.useMemo(()=>b,Object.values(b));return h.jsx(w.Provider,{value:S,children:v})};d.displayName=a+"Provider";function m(f,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[c])||l,b=y.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[d,m]}const i=()=>{const a=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,PJ(i,...t)]}function PJ(...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:c,scopeName:d})=>{const f=c(a)[`__scope${d}`];return{...l,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ON(e){const t=e+"CollectionProvider",[n,r]=ja(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:S,children:j}=w,C=Ce.useRef(null),_=Ce.useRef(new Map).current;return h.jsx(i,{scope:S,itemMap:_,collectionRef:C,children:j})};o.displayName=t;const l=e+"CollectionSlot",c=rc(l),d=Ce.forwardRef((w,S)=>{const{scope:j,children:C}=w,_=a(l,j),k=bt(S,_.collectionRef);return h.jsx(c,{ref:k,children:C})});d.displayName=l;const m=e+"CollectionItemSlot",f="data-radix-collection-item",g=rc(m),v=Ce.forwardRef((w,S)=>{const{scope:j,children:C,..._}=w,k=Ce.useRef(null),O=bt(S,k),A=a(m,j);return Ce.useEffect(()=>(A.itemMap.set(k,{ref:k,..._}),()=>void A.itemMap.delete(k))),h.jsx(g,{[f]:"",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 _=Array.from(C.querySelectorAll(`[${f}]`));return Array.from(S.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},b,r]}function ke(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 wr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},MJ=mN[" useInsertionEffect ".trim().toString()]||wr;function vs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=RJ({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const f=m.current;f!==l&&console.warn(`${r} is changing from ${f?"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 f;if(l){const g=DJ(m)?m(e):m;g!==e&&((f=o.current)==null||f.call(o,g))}else a(m)},[l,e,a,o]);return[c,d]}function RJ({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return MJ(()=>{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 DJ(e){return typeof e=="function"}function IJ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=LJ(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=bt(r.ref,zJ(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};qr.displayName="Presence";function LJ(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=IJ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=Uv(r.current);a.current=l==="mounted"?d:"none"},[l]),wr(()=>{const d=r.current,m=i.current;if(m!==e){const g=a.current,v=Uv(d);e?c("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),wr(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,f=v=>{const w=Uv(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(c("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=Uv(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Uv(e){return(e==null?void 0:e.animationName)||"none"}function zJ(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 $J=mN[" useId ".trim().toString()]||(()=>{}),BJ=0;function br(e){const[t,n]=y.useState($J());return wr(()=>{n(r=>r??String(BJ++))},[e]),e||(t?`radix-${t}`:"")}var y0="Collapsible",[FJ]=ja(y0),[UJ,TN]=FJ(y0),TB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,d]=vs({prop:r,defaultProp:i??!1,onChange:o,caller:y0});return h.jsx(UJ,{scope:n,disabled:a,contentId:br(),open:c,onOpenToggle:y.useCallback(()=>d(m=>!m),[d]),children:h.jsx(Ve.div,{"data-state":MN(c),"data-disabled":a?"":void 0,...l,ref:t})})});TB.displayName=y0;var PB="CollapsibleTrigger",MB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=TN(PB,n);return h.jsx(Ve.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":MN(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:ke(e.onClick,i.onOpenToggle)})});MB.displayName=PB;var PN="CollapsibleContent",RB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=TN(PN,e.__scopeCollapsible);return h.jsx(qr,{present:n||i.open,children:({present:a})=>h.jsx(HJ,{...r,ref:t,present:a})})});RB.displayName=PN;var HJ=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=TN(PN,n),[l,c]=y.useState(r),d=y.useRef(null),m=bt(t,d),f=y.useRef(0),g=f.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)},[]),wr(()=>{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 _=C.getBoundingClientRect();f.current=_.height,v.current=_.width,S.current||(C.style.transitionDuration=j.current.transitionDuration,C.style.animationName=j.current.animationName),c(r)}},[o.open,r]),h.jsx(Ve.div,{"data-state":MN(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 MN(e){return e?"open":"closed"}var qJ=TB,VJ=y.createContext(void 0);function Sp(e){const t=y.useContext(VJ);return e||t||"ltr"}function Tr(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 KJ(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(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 YJ="DismissableLayer",E_="dismissableLayer.update",XJ="dismissableLayer.pointerDownOutside",GJ="dismissableLayer.focusOutside",HR,DB=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jp=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,d=y.useContext(DB),[m,f]=y.useState(null),g=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),b=bt(t,T=>f(T)),w=Array.from(d.layers),[S]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf(S),C=m?w.indexOf(m):-1,_=d.layersWithOutsidePointerEventsDisabled.size>0,k=C>=j,O=ZJ(T=>{const P=T.target,z=[...d.branches].some(L=>L.contains(P));!k||z||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},g),A=JJ(T=>{const P=T.target;[...d.branches].some(L=>L.contains(P))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},g);return KJ(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&&(HR=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),qR(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=HR)}},[m,g,n,d]),y.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),qR())},[m,d]),y.useEffect(()=>{const T=()=>v({});return document.addEventListener(E_,T),()=>document.removeEventListener(E_,T)},[]),h.jsx(Ve.div,{...c,ref:b,style:{pointerEvents:_?k?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,O.onPointerDownCapture)})});jp.displayName=YJ;var WJ="DismissableLayerBranch",QJ=y.forwardRef((e,t)=>{const n=y.useContext(DB),r=y.useRef(null),i=bt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),h.jsx(Ve.div,{...e,ref:i})});QJ.displayName=WJ;function ZJ(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){IB(XJ,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}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 JJ(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&IB(GJ,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 qR(){const e=new CustomEvent(E_);document.dispatchEvent(e)}function IB(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?kB(i,a):i.dispatchEvent(a)}var NS="focusScope.autoFocusOnMount",kS="focusScope.autoFocusOnUnmount",VR={bubbles:!1,cancelable:!0},eee="FocusScope",x0=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=y.useState(null),d=Tr(i),m=Tr(a),f=y.useRef(null),g=bt(t,w=>c(w)),v=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let w=function(_){if(v.paused||!l)return;const k=_.target;l.contains(k)?f.current=k:bl(f.current,{select:!0})},S=function(_){if(v.paused||!l)return;const k=_.relatedTarget;k!==null&&(l.contains(k)||bl(f.current,{select:!0}))},j=function(_){if(document.activeElement===document.body)for(const O of _)O.removedNodes.length>0&&bl(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){YR.add(v);const w=document.activeElement;if(!l.contains(w)){const j=new CustomEvent(NS,VR);l.addEventListener(NS,d),l.dispatchEvent(j),j.defaultPrevented||(tee(oee(LB(l)),{select:!0}),document.activeElement===w&&bl(l))}return()=>{l.removeEventListener(NS,d),setTimeout(()=>{const j=new CustomEvent(kS,VR);l.addEventListener(kS,m),l.dispatchEvent(j),j.defaultPrevented||bl(w??document.body,{select:!0}),l.removeEventListener(kS,m),YR.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,[_,k]=nee(C);_&&k?!w.shiftKey&&j===k?(w.preventDefault(),n&&bl(_,{select:!0})):w.shiftKey&&j===_&&(w.preventDefault(),n&&bl(k,{select:!0})):j===C&&w.preventDefault()}},[n,r,v.paused]);return h.jsx(Ve.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});x0.displayName=eee;function tee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bl(r,{select:t}),document.activeElement!==n)return}function nee(e){const t=LB(e),n=KR(t,e),r=KR(t.reverse(),e);return[n,r]}function LB(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 KR(e,t){for(const n of e)if(!ree(n,{upTo:t}))return n}function ree(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 iee(e){return e instanceof HTMLInputElement&&"select"in e}function bl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&iee(e)&&t&&e.select()}}var YR=aee();function aee(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=XR(e,t),e.unshift(t)},remove(t){var n;e=XR(e,t),(n=e[0])==null||n.resume()}}}function XR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function oee(e){return e.filter(t=>t.tagName!=="A")}var see="Portal",Ep=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=y.useState(!1);wr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?sB.createPortal(h.jsx(Ve.div,{...r,ref:t}),o):null});Ep.displayName=see;var AS=0;function RN(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??GR()),document.body.insertAdjacentElement("beforeend",e[1]??GR()),AS++,()=>{AS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),AS--}},[])}function GR(){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 go=function(){return go=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},go.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 Ay="right-scroll-bar-position",Oy="width-before-scroll-bar",uee="with-scroll-bars-hidden",cee="--removed-body-scroll-bar-size";function OS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function dee(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,WR=new WeakMap;function hee(e,t){var n=dee(null,function(r){return e.forEach(function(i){return OS(i,r)})});return fee(function(){var r=WR.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||OS(l,null)}),a.forEach(function(l){i.has(l)||OS(l,o)})}WR.set(n,e)},[e]),n}function mee(e){return e}function pee(e,t){t===void 0&&(t=mee);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 c=function(){var m=o;o=[],m.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(m){o.push(m),d()},filter:function(m){return o=o.filter(m),n}}}};return i}function gee(e){e===void 0&&(e={});var t=pee(null);return t.options=go({async:!0,ssr:!1},e),t}var $B=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,go({},n))};$B.isSideCarExport=!0;function vee(e,t){return e.useMedium(t),$B}var BB=gee(),TS=function(){},b0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:TS,onWheelCapture:TS,onTouchMoveCapture:TS}),i=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,m=e.enabled,f=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.gapMode,k=zB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=hee([n,t]),T=go(go({},k),i);return y.createElement(y.Fragment,null,m&&y.createElement(O,{sideCar:BB,removeScrollBar:d,shards:f,noRelative:v,noIsolation:b,inert:w,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:_}),o?y.cloneElement(y.Children.only(l),go(go({},T),{ref:A})):y.createElement(C,go({},T,{className:c,ref:A}),l))});b0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};b0.classNames={fullWidth:Oy,zeroRight:Ay};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 bee(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 See=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xee())&&(bee(t,n),wee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jee=function(){var e=See();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},FB=function(){var e=jee(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Eee={left:0,top:0,right:0,gap:0},PS=function(e){return parseInt(e||"",10)||0},_ee=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[PS(n),PS(r),PS(i)]},Cee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Eee;var t=_ee(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])}},Nee=FB(),$d="data-scroll-locked",kee=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(uee,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat($d,`] {
    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(Ay,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(Oy,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(Ay," .").concat(Ay,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Oy," .").concat(Oy,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat($d,`] {
    `).concat(cee,": ").concat(l,`px;
  }
`)},QR=function(){var e=parseInt(document.body.getAttribute($d)||"0",10);return isFinite(e)?e:0},Aee=function(){y.useEffect(function(){return document.body.setAttribute($d,(QR()+1).toString()),function(){var e=QR()-1;e<=0?document.body.removeAttribute($d):document.body.setAttribute($d,e.toString())}},[])},Oee=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Aee();var a=y.useMemo(function(){return Cee(i)},[i]);return y.createElement(Nee,{styles:kee(a,!t,i,n?"":"!important")})},__=!1;if(typeof window<"u")try{var Hv=Object.defineProperty({},"passive",{get:function(){return __=!0,!0}});window.addEventListener("test",Hv,Hv),window.removeEventListener("test",Hv,Hv)}catch{__=!1}var vd=__?{passive:!1}:!1,Tee=function(e){return e.tagName==="TEXTAREA"},UB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Tee(e)&&n[t]==="visible")},Pee=function(e){return UB(e,"overflowY")},Mee=function(e){return UB(e,"overflowX")},ZR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=HB(e,r);if(i){var a=qB(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ree=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Dee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},HB=function(e,t){return e==="v"?Pee(t):Mee(t)},qB=function(e,t){return e==="v"?Ree(t):Dee(t)},Iee=function(e,t){return e==="h"&&t==="rtl"?-1:1},Lee=function(e,t,n,r,i){var a=Iee(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),d=!1,m=o>0,f=0,g=0;do{if(!l)break;var v=qB(e,l),b=v[0],w=v[1],S=v[2],j=w-S-a*b;(b||j)&&HB(e,l)&&(f+=j,g+=b);var C=l.parentNode;l=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(m&&Math.abs(f)<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]},JR=function(e){return[e.deltaX,e.deltaY]},eD=function(e){return e&&"current"in e?e.current:e},zee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$ee=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Bee=0,yd=[];function Fee(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(Bee++)[0],a=y.useState(FB)[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(eD),!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,_="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(_)>Math.abs(k)?"h":"v";if("touches"in w&&T==="h"&&A.type==="range")return!1;var P=window.getSelection(),z=P&&P.anchorNode,L=z?z===A||z.contains(A):!1;if(L)return!1;var F=ZR(T,A);if(!F)return!0;if(F?O=T:(O=T==="v"?"h":"v",F=ZR(T,A)),!F)return!1;if(!r.current&&"changedTouches"in w&&(_||k)&&(r.current=O),!O)return!0;var D=r.current||O;return Lee(D,S,w,D==="h"?_:k)},[]),c=y.useCallback(function(w){var S=w;if(!(!yd.length||yd[yd.length-1]!==a)){var j="deltaY"in S?JR(S):qv(S),C=t.current.filter(function(O){return O.name===S.type&&(O.target===S.target||S.target===O.shadowParent)&&zee(O.delta,j)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var _=(o.current.shards||[]).map(eD).filter(Boolean).filter(function(O){return O.contains(S.target)}),k=_.length>0?l(S,_[0]):!o.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),d=y.useCallback(function(w,S,j,C){var _={name:w,delta:S,target:j,should:C,shadowParent:Uee(j)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(k){return k!==_})},1)},[]),m=y.useCallback(function(w){n.current=qv(w),r.current=void 0},[]),f=y.useCallback(function(w){d(w.type,JR(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 yd.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",c,vd),document.addEventListener("touchmove",c,vd),document.addEventListener("touchstart",m,vd),function(){yd=yd.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,vd),document.removeEventListener("touchmove",c,vd),document.removeEventListener("touchstart",m,vd)}},[]);var v=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(a,{styles:$ee(i)}):null,v?y.createElement(Oee,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Uee(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hee=vee(BB,Fee);var w0=y.forwardRef(function(e,t){return y.createElement(b0,go({},e,{ref:t,sideCar:Hee}))});w0.classNames=b0.classNames;var qee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xd=new WeakMap,Vv=new WeakMap,Kv={},MS=0,VB=function(e){return e&&(e.host||VB(e.parentNode))},Vee=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=VB(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})},Kee=function(e,t,n,r){var i=Vee(t,Array.isArray(e)?e:[e]);Kv[n]||(Kv[n]=new WeakMap);var a=Kv[n],o=[],l=new Set,c=new Set(i),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};i.forEach(d);var m=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(g){if(l.has(g))m(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",w=(xd.get(g)||0)+1,S=(a.get(g)||0)+1;xd.set(g,w),a.set(g,S),o.push(g),w===1&&b&&Vv.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(),MS++,function(){o.forEach(function(f){var g=xd.get(f)-1,v=a.get(f)-1;xd.set(f,g),a.set(f,v),g||(Vv.has(f)||f.removeAttribute(r),Vv.delete(f)),v||f.removeAttribute(n)}),MS--,MS||(xd=new WeakMap,xd=new WeakMap,Vv=new WeakMap,Kv={})}},DN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=qee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Kee(r,i,n,"aria-hidden")):function(){return null}},S0="Dialog",[KB]=ja(S0),[Yee,Ya]=KB(S0),YB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=y.useRef(null),c=y.useRef(null),[d,m]=vs({prop:r,defaultProp:i??!1,onChange:a,caller:S0});return h.jsx(Yee,{scope:t,triggerRef:l,contentRef:c,contentId:br(),titleId:br(),descriptionId:br(),open:d,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(f=>!f),[m]),modal:o,children:n})};YB.displayName=S0;var XB="DialogTrigger",Xee=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(XB,n),a=bt(t,i.triggerRef);return h.jsx(Ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":zN(i.open),...r,ref:a,onClick:ke(e.onClick,i.onOpenToggle)})});Xee.displayName=XB;var IN="DialogPortal",[Gee,GB]=KB(IN,{forceMount:void 0}),WB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ya(IN,t);return h.jsx(Gee,{scope:t,forceMount:n,children:y.Children.map(r,o=>h.jsx(qr,{present:n||a.open,children:h.jsx(Ep,{asChild:!0,container:i,children:o})}))})};WB.displayName=IN;var Vy="DialogOverlay",QB=y.forwardRef((e,t)=>{const n=GB(Vy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ya(Vy,e.__scopeDialog);return a.modal?h.jsx(qr,{present:r||a.open,children:h.jsx(Qee,{...i,ref:t})}):null});QB.displayName=Vy;var Wee=rc("DialogOverlay.RemoveScroll"),Qee=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(Vy,n);return h.jsx(w0,{as:Wee,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Ve.div,{"data-state":zN(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ic="DialogContent",ZB=y.forwardRef((e,t)=>{const n=GB(ic,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ya(ic,e.__scopeDialog);return h.jsx(qr,{present:r||a.open,children:a.modal?h.jsx(Zee,{...i,ref:t}):h.jsx(Jee,{...i,ref:t})})});ZB.displayName=ic;var Zee=y.forwardRef((e,t)=>{const n=Ya(ic,e.__scopeDialog),r=y.useRef(null),i=bt(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return DN(a)},[]),h.jsx(JB,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:ke(e.onFocusOutside,a=>a.preventDefault())})}),Jee=y.forwardRef((e,t)=>{const n=Ya(ic,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return h.jsx(JB,{...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 c,d;(c=e.onInteractOutside)==null||c.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()}})}),JB=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Ya(ic,n),c=y.useRef(null),d=bt(t,c);return RN(),h.jsxs(h.Fragment,{children:[h.jsx(x0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:h.jsx(jp,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":zN(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(ete,{titleId:l.titleId}),h.jsx(nte,{contentRef:c,descriptionId:l.descriptionId})]})]})}),LN="DialogTitle",e6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(LN,n);return h.jsx(Ve.h2,{id:i.titleId,...r,ref:t})});e6.displayName=LN;var t6="DialogDescription",n6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(t6,n);return h.jsx(Ve.p,{id:i.descriptionId,...r,ref:t})});n6.displayName=t6;var r6="DialogClose",i6=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ya(r6,n);return h.jsx(Ve.button,{type:"button",...r,ref:t,onClick:ke(e.onClick,()=>i.onOpenChange(!1))})});i6.displayName=r6;function zN(e){return e?"open":"closed"}var a6="DialogTitleWarning",[h$e,o6]=TJ(a6,{contentName:ic,titleName:LN,docsSlug:"dialog"}),ete=({titleId:e})=>{const t=o6(a6),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},tte="DialogDescriptionWarning",nte=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${o6(tte).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},$N=YB,BN=WB,FN=QB,UN=ZB,s6=e6,l6=n6,HN=i6,RS={exports:{}},DS={};/**
 * @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 tD;function rte(){if(tD)return DS;tD=1;var e=Pf();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&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(f,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,c(w)&&S({inst:w})},[f,v,g]),i(function(){return c(w)&&S({inst:w}),f(function(){c(w)&&S({inst:w})})},[f]),o(v),v}function c(f){var g=f.getSnapshot;f=f.value;try{var v=g();return!n(f,v)}catch{return!0}}function d(f,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return DS.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,DS}var nD;function ite(){return nD||(nD=1,RS.exports=rte()),RS.exports}function u6(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 c6(e){const[t,n]=y.useState(void 0);return wr(()=>{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 c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;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 ate=["top","right","bottom","left"],Fl=Math.min,Ti=Math.max,Ky=Math.round,Yv=Math.floor,wo=e=>({x:e,y:e}),ote={left:"right",right:"left",bottom:"top",top:"bottom"};function C_(e,t,n){return Ti(e,Fl(t,n))}function ys(e,t){return typeof e=="function"?e(t):e}function xs(e){return e.split("-")[0]}function Df(e){return e.split("-")[1]}function qN(e){return e==="x"?"y":"x"}function VN(e){return e==="y"?"height":"width"}function vo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function KN(e){return qN(vo(e))}function ste(e,t,n){n===void 0&&(n=!1);const r=Df(e),i=KN(e),a=VN(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Yy(o)),[o,Yy(o)]}function lte(e){const t=Yy(e);return[N_(e),t,N_(t)]}function N_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const rD=["left","right"],iD=["right","left"],ute=["top","bottom"],cte=["bottom","top"];function dte(e,t,n){switch(e){case"top":case"bottom":return n?t?iD:rD:t?rD:iD;case"left":case"right":return t?ute:cte;default:return[]}}function fte(e,t,n,r){const i=Df(e);let a=dte(xs(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(N_)))),a}function Yy(e){const t=xs(e);return ote[t]+e.slice(t.length)}function hte(e){return{top:0,right:0,bottom:0,left:0,...e}}function d6(e){return typeof e!="number"?hte(e):{top:e,right:e,bottom:e,left:e}}function Xy(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 aD(e,t,n){let{reference:r,floating:i}=e;const a=vo(t),o=KN(t),l=VN(o),c=xs(t),d=a==="y",m=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[l]/2-i[l]/2;let v;switch(c){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:f};break;case"left":v={x:r.x-i.width,y:f};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 mte(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:g=!1,padding:v=0}=ys(t,e),b=d6(v),S=l[g?f==="floating"?"reference":"floating":f],j=Xy(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:c})),C=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),k=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},O=Xy(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:_,strategy:c}):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 pte=50,gte=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:mte},c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:f}=aD(d,r,c),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:_,y:k,data:O,reset:A}=await C({x:m,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:d,platform:l,elements:{reference:e,floating:t}});m=_??m,f=k??f,b[j]={...b[j],...O},A&&v<pte&&(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:f}=aD(d,g,c)),w=-1)}return{x:m,y:f,placement:g,strategy:i,middlewareData:b}},vte=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:m=0}=ys(e,t)||{};if(d==null)return{};const f=d6(m),g={x:n,y:r},v=KN(i),b=VN(v),w=await o.getDimensions(d),S=v==="y",j=S?"top":"left",C=S?"bottom":"right",_=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[_]:0;(!T||!await(o.isElement==null?void 0:o.isElement(A)))&&(T=l.floating[_]||a.floating[b]);const P=k/2-O/2,z=T/2-w[b]/2-1,L=Fl(f[j],z),F=Fl(f[C],z),D=L,X=T-w[b]-F,R=T/2-w[b]/2+P,q=C_(D,R,X),$=!c.arrow&&Df(i)!=null&&R!==q&&a.reference[b]/2-(R<D?L:F)-w[b]/2<0,V=$?R<D?R-D:R-X:0;return{[v]:g[v]+V,data:{[v]:q,centerOffset:R-q-V,...$&&{alignmentOffset:V}},reset:$}}}),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:c,elements:d}=t,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=ys(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const j=xs(i),C=vo(l),_=xs(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),O=g||(_||!w?[Yy(l)]:lte(l)),A=b!=="none";!g&&A&&O.push(...fte(l,w,b,k));const T=[l,...O],P=await c.detectOverflow(t,S),z=[];let L=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&z.push(P[j]),f){const R=ste(i,o,k);z.push(P[R[0]],P[R[1]])}if(L=[...L,{placement:i,overflows:z}],!z.every(R=>R<=0)){var F,D;const R=(((F=a.flip)==null?void 0:F.index)||0)+1,q=T[R];if(q&&(!(f==="alignment"?C!==vo(q):!1)||L.every(G=>vo(G.placement)===C?G.overflows[0]>0:!0)))return{data:{index:R,overflows:L},reset:{placement:q}};let $=(D=L.filter(V=>V.overflows[0]<=0).sort((V,G)=>V.overflows[1]-G.overflows[1])[0])==null?void 0:D.placement;if(!$)switch(v){case"bestFit":{var X;const V=(X=L.filter(G=>{if(A){const K=vo(G.placement);return K===C||K==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(K=>K>0).reduce((K,I)=>K+I,0)]).sort((G,K)=>G[1]-K[1])[0])==null?void 0:X[0];V&&($=V);break}case"initialPlacement":$=l;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function oD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sD(e){return ate.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}=ys(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=oD(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:sD(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=oD(o,n.floating);return{data:{escapedOffsets:l,escaped:sD(l)}}}default:return{}}}}},f6=new Set(["left","top"]);async function bte(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=xs(n),l=Df(n),c=vo(n)==="y",d=f6.has(o)?-1:1,m=a&&c?-1:1,f=ys(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),c?{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,c=await bte(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},Ste=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:c={fn:j=>{let{x:C,y:_}=j;return{x:C,y:_}}},...d}=ys(e,t),m={x:n,y:r},f=await a.detectOverflow(t,d),g=vo(xs(i)),v=qN(g);let b=m[v],w=m[g];if(o){const j=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=b+f[j],k=b-f[C];b=C_(_,b,k)}if(l){const j=g==="y"?"top":"left",C=g==="y"?"bottom":"right",_=w+f[j],k=w-f[C];w=C_(_,w,k)}const S=c.fn({...t,[v]:b,[g]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[g]:l}}}}}},jte=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:c=!0,crossAxis:d=!0}=ys(e,t),m={x:n,y:r},f=vo(i),g=qN(f);let v=m[g],b=m[f];const w=ys(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const _=g==="y"?"height":"width",k=a.reference[g]-a.floating[_]+S.mainAxis,O=a.reference[g]+a.reference[_]-S.mainAxis;v<k?v=k:v>O&&(v=O)}if(d){var j,C;const _=g==="y"?"width":"height",k=f6.has(xs(i)),O=a.reference[f]-a.floating[_]+(k&&((j=o.offset)==null?void 0:j[f])||0)+(k?0:S.crossAxis),A=a.reference[f]+a.reference[_]+(k?0:((C=o.offset)==null?void 0:C[f])||0)-(k?S.crossAxis:0);b<O?b=O:b>A&&(b=A)}return{[g]:v,[f]:b}}}},Ete=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:c=()=>{},...d}=ys(e,t),m=await o.detectOverflow(t,d),f=xs(i),g=Df(i),v=vo(i)==="y",{width:b,height:w}=a.floating;let S,j;f==="top"||f==="bottom"?(S=f,j=g===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(j=f,S=g==="end"?"top":"bottom");const C=w-m.top-m.bottom,_=b-m.left-m.right,k=Fl(w-m[S],C),O=Fl(b-m[j],_),A=!t.middlewareData.shift;let T=k,P=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),A&&!g){const L=Ti(m.left,0),F=Ti(m.right,0),D=Ti(m.top,0),X=Ti(m.bottom,0);v?P=b-2*(L!==0||F!==0?L+F:Ti(m.left,m.right)):T=w-2*(D!==0||X!==0?D+X:Ti(m.top,m.bottom))}await c({...t,availableWidth:P,availableHeight:T});const z=await o.getDimensions(l.floating);return b!==z.width||w!==z.height?{reset:{rects:!0}}:{}}}};function j0(){return typeof window<"u"}function If(e){return h6(e)?(e.nodeName||"").toLowerCase():"#document"}function Di(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Oo(e){var t;return(t=(h6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function h6(e){return j0()?e instanceof Node||e instanceof Di(e).Node:!1}function qa(e){return j0()?e instanceof Element||e instanceof Di(e).Element:!1}function Cs(e){return j0()?e instanceof HTMLElement||e instanceof Di(e).HTMLElement:!1}function lD(e){return!j0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Di(e).ShadowRoot}function _p(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Va(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function _te(e){return/^(table|td|th)$/.test(If(e))}function E0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Cte=/transform|translate|scale|rotate|perspective|filter/,Nte=/paint|layout|strict|content/,ju=e=>!!e&&e!=="none";let IS;function YN(e){const t=qa(e)?Va(e):e;return ju(t.transform)||ju(t.translate)||ju(t.scale)||ju(t.rotate)||ju(t.perspective)||!XN()&&(ju(t.backdropFilter)||ju(t.filter))||Cte.test(t.willChange||"")||Nte.test(t.contain||"")}function kte(e){let t=Ul(e);for(;Cs(t)&&!lf(t);){if(YN(t))return t;if(E0(t))return null;t=Ul(t)}return null}function XN(){return IS==null&&(IS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),IS}function lf(e){return/^(html|body|#document)$/.test(If(e))}function Va(e){return Di(e).getComputedStyle(e)}function _0(e){return qa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ul(e){if(If(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lD(e)&&e.host||Oo(e);return lD(t)?t.host:t}function m6(e){const t=Ul(e);return lf(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cs(t)&&_p(t)?t:m6(t)}function Im(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=m6(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Di(i);if(a){const l=k_(o);return t.concat(o,o.visualViewport||[],_p(i)?i:[],l&&n?Im(l):[])}else return t.concat(i,Im(i,[],n))}function k_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function p6(e){const t=Va(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Cs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=Ky(n)!==a||Ky(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function GN(e){return qa(e)?e:e.contextElement}function Bd(e){const t=GN(e);if(!Cs(t))return wo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=p6(t);let o=(a?Ky(n.width):n.width)/r,l=(a?Ky(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Ate=wo(0);function g6(e){const t=Di(e);return!XN()||!t.visualViewport?Ate:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ote(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Di(e)?!1:t}function ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=GN(e);let o=wo(1);t&&(r?qa(r)&&(o=Bd(r)):o=Bd(e));const l=Ote(a,n,r)?g6(a):wo(0);let c=(i.left+l.x)/o.x,d=(i.top+l.y)/o.y,m=i.width/o.x,f=i.height/o.y;if(a){const g=Di(a),v=r&&qa(r)?Di(r):r;let b=g,w=k_(b);for(;w&&r&&v!==b;){const S=Bd(w),j=w.getBoundingClientRect(),C=Va(w),_=j.left+(w.clientLeft+parseFloat(C.paddingLeft))*S.x,k=j.top+(w.clientTop+parseFloat(C.paddingTop))*S.y;c*=S.x,d*=S.y,m*=S.x,f*=S.y,c+=_,d+=k,b=Di(w),w=k_(b)}}return Xy({width:m,height:f,x:c,y:d})}function C0(e,t){const n=_0(e).scrollLeft;return t?t.left+n:ac(Oo(e)).left+n}function v6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-C0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Tte(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Oo(r),l=t?E0(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},d=wo(1);const m=wo(0),f=Cs(r);if((f||!f&&!a)&&((If(r)!=="body"||_p(o))&&(c=_0(r)),f)){const v=ac(r);d=Bd(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const g=o&&!f&&!a?v6(o,c):wo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+m.x+g.x,y:n.y*d.y-c.scrollTop*d.y+m.y+g.y}}function Pte(e){return Array.from(e.getClientRects())}function Mte(e){const t=Oo(e),n=_0(e),r=e.ownerDocument.body,i=Ti(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ti(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+C0(e);const l=-n.scrollTop;return Va(r).direction==="rtl"&&(o+=Ti(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}const uD=25;function Rte(e,t){const n=Di(e),r=Oo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){a=i.width,o=i.height;const m=XN();(!m||m&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const d=C0(r);if(d<=0){const m=r.ownerDocument,f=m.body,g=getComputedStyle(f),v=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-f.clientWidth-v);b<=uD&&(a-=b)}else d<=uD&&(a+=d);return{width:a,height:o,x:l,y:c}}function Dte(e,t){const n=ac(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Cs(e)?Bd(e):wo(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=i*a.x,d=r*a.y;return{width:o,height:l,x:c,y:d}}function cD(e,t,n){let r;if(t==="viewport")r=Rte(e,n);else if(t==="document")r=Mte(Oo(e));else if(qa(t))r=Dte(t,n);else{const i=g6(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Xy(r)}function y6(e,t){const n=Ul(e);return n===t||!qa(n)||lf(n)?!1:Va(n).position==="fixed"||y6(n,t)}function Ite(e,t){const n=t.get(e);if(n)return n;let r=Im(e,[],!1).filter(l=>qa(l)&&If(l)!=="body"),i=null;const a=Va(e).position==="fixed";let o=a?Ul(e):e;for(;qa(o)&&!lf(o);){const l=Va(o),c=YN(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||_p(o)&&!c&&y6(e,o))?r=r.filter(m=>m!==o):i=l,o=Ul(o)}return t.set(e,r),r}function Lte(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?E0(t)?[]:Ite(t,this._c):[].concat(n),r],l=cD(t,o[0],i);let c=l.top,d=l.right,m=l.bottom,f=l.left;for(let g=1;g<o.length;g++){const v=cD(t,o[g],i);c=Ti(v.top,c),d=Fl(v.right,d),m=Fl(v.bottom,m),f=Ti(v.left,f)}return{width:d-f,height:m-c,x:f,y:c}}function zte(e){const{width:t,height:n}=p6(e);return{width:t,height:n}}function $te(e,t,n){const r=Cs(t),i=Oo(t),a=n==="fixed",o=ac(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=wo(0);function d(){c.x=C0(i)}if(r||!r&&!a)if((If(t)!=="body"||_p(i))&&(l=_0(t)),r){const v=ac(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else i&&d();a&&!r&&i&&d();const m=i&&!r&&!a?v6(i,l):wo(0),f=o.left+l.scrollLeft-c.x-m.x,g=o.top+l.scrollTop-c.y-m.y;return{x:f,y:g,width:o.width,height:o.height}}function LS(e){return Va(e).position==="static"}function dD(e,t){if(!Cs(e)||Va(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Oo(e)===n&&(n=n.ownerDocument.body),n}function x6(e,t){const n=Di(e);if(E0(e))return n;if(!Cs(e)){let i=Ul(e);for(;i&&!lf(i);){if(qa(i)&&!LS(i))return i;i=Ul(i)}return n}let r=dD(e,t);for(;r&&_te(r)&&LS(r);)r=dD(r,t);return r&&lf(r)&&LS(r)&&!YN(r)?n:r||kte(e)||n}const Bte=async function(e){const t=this.getOffsetParent||x6,n=this.getDimensions,r=await n(e.floating);return{reference:$te(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fte(e){return Va(e).direction==="rtl"}const Ute={convertOffsetParentRelativeRectToViewportRelativeRect:Tte,getDocumentElement:Oo,getClippingRect:Lte,getOffsetParent:x6,getElementRects:Bte,getClientRects:Pte,getDimensions:zte,getScale:Bd,isElement:qa,isRTL:Fte};function b6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hte(e,t){let n=null,r;const i=Oo(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const d=e.getBoundingClientRect(),{left:m,top:f,width:g,height:v}=d;if(l||t(),!g||!v)return;const b=Yv(f),w=Yv(i.clientWidth-(m+g)),S=Yv(i.clientHeight-(f+v)),j=Yv(m),_={rootMargin:-b+"px "+-w+"px "+-S+"px "+-j+"px",threshold:Ti(0,Fl(1,c))||1};let k=!0;function O(A){const T=A[0].intersectionRatio;if(T!==c){if(!k)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!b6(d,e.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(O,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,_)}n.observe(e)}return o(!0),a}function qte(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:c=!1}=r,d=GN(e),m=i||a?[...d?Im(d):[],...t?Im(t):[]]:[];m.forEach(j=>{i&&j.addEventListener("scroll",n,{passive:!0}),a&&j.addEventListener("resize",n)});const f=d&&l?Hte(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 _;(_=v)==null||_.observe(t)})),n()}),d&&!c&&v.observe(d),t&&v.observe(t));let b,w=c?ac(e):null;c&&S();function S(){const j=ac(e);w&&!b6(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)}),f==null||f(),(j=v)==null||j.disconnect(),v=null,c&&cancelAnimationFrame(b)}}const Vte=wte,Kte=Ste,Yte=yte,Xte=Ete,Gte=xte,fD=vte,Wte=jte,Qte=(e,t,n)=>{const r=new Map,i={platform:Ute,...n},a={...i.platform,_c:r};return gte(e,t,{...i,platform:a})};var Zte=typeof document<"u",Jte=function(){},Ty=Zte?y.useLayoutEffect:Jte;function Gy(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(!Gy(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)&&!Gy(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function w6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hD(e,t){const n=w6(e);return Math.round(t*n)/n}function zS(e){const t=y.useRef(e);return Ty(()=>{t.current=e}),t}function ene(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:c,open:d}=e,[m,f]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=y.useState(r);Gy(g,r)||v(r);const[b,w]=y.useState(null),[S,j]=y.useState(null),C=y.useCallback(G=>{G!==A.current&&(A.current=G,w(G))},[]),_=y.useCallback(G=>{G!==T.current&&(T.current=G,j(G))},[]),k=a||b,O=o||S,A=y.useRef(null),T=y.useRef(null),P=y.useRef(m),z=c!=null,L=zS(c),F=zS(i),D=zS(d),X=y.useCallback(()=>{if(!A.current||!T.current)return;const G={placement:t,strategy:n,middleware:g};F.current&&(G.platform=F.current),Qte(A.current,T.current,G).then(K=>{const I={...K,isPositioned:D.current!==!1};R.current&&!Gy(P.current,I)&&(P.current=I,Gl.flushSync(()=>{f(I)}))})},[g,t,n,F,D]);Ty(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[d]);const R=y.useRef(!1);Ty(()=>(R.current=!0,()=>{R.current=!1}),[]),Ty(()=>{if(k&&(A.current=k),O&&(T.current=O),k&&O){if(L.current)return L.current(k,O,X);X()}},[k,O,X,L,z]);const q=y.useMemo(()=>({reference:A,floating:T,setReference:C,setFloating:_}),[C,_]),$=y.useMemo(()=>({reference:k,floating:O}),[k,O]),V=y.useMemo(()=>{const G={position:n,left:0,top:0};if(!$.floating)return G;const K=hD($.floating,m.x),I=hD($.floating,m.y);return l?{...G,transform:"translate("+K+"px, "+I+"px)",...w6($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:I}},[n,l,$.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:X,refs:q,elements:$,floatingStyles:V}),[m,X,q,$,V])}const tne=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?fD({element:r.current,padding:i}).fn(n):{}:r?fD({element:r,padding:i}).fn(n):{}}}},nne=(e,t)=>{const n=Vte(e);return{name:n.name,fn:n.fn,options:[e,t]}},rne=(e,t)=>{const n=Kte(e);return{name:n.name,fn:n.fn,options:[e,t]}},ine=(e,t)=>({fn:Wte(e).fn,options:[e,t]}),ane=(e,t)=>{const n=Yte(e);return{name:n.name,fn:n.fn,options:[e,t]}},one=(e,t)=>{const n=Xte(e);return{name:n.name,fn:n.fn,options:[e,t]}},sne=(e,t)=>{const n=Gte(e);return{name:n.name,fn:n.fn,options:[e,t]}},lne=(e,t)=>{const n=tne(e);return{name:n.name,fn:n.fn,options:[e,t]}};var une="Arrow",S6=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return h.jsx(Ve.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});S6.displayName=une;var cne=S6,WN="Popper",[j6,Lf]=ja(WN),[dne,E6]=j6(WN),_6=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return h.jsx(dne,{scope:t,anchor:r,onAnchorChange:i,children:n})};_6.displayName=WN;var C6="PopperAnchor",N6=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=E6(C6,n),o=y.useRef(null),l=bt(t,o),c=y.useRef(null);return y.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||o.current,d!==c.current&&a.onAnchorChange(c.current)}),r?null:h.jsx(Ve.div,{...i,ref:l})});N6.displayName=C6;var QN="PopperContent",[fne,hne]=j6(QN),k6=y.forwardRef((e,t)=>{var ae,re,ee,se,ge,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:f="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...w}=e,S=E6(QN,n),[j,C]=y.useState(null),_=bt(t,Se=>C(Se)),[k,O]=y.useState(null),A=c6(k),T=(A==null?void 0:A.width)??0,P=(A==null?void 0:A.height)??0,z=r+(a!=="center"?"-"+a:""),L=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},F=Array.isArray(d)?d:[d],D=F.length>0,X={padding:L,boundary:F.filter(pne),altBoundary:D},{refs:R,floatingStyles:q,placement:$,isPositioned:V,middlewareData:G}=ene({strategy:"fixed",placement:z,whileElementsMounted:(...Se)=>qte(...Se,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[nne({mainAxis:i+P,alignmentAxis:o}),c&&rne({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?ine():void 0,...X}),c&&ane({...X}),one({...X,apply:({elements:Se,rects:Ee,availableWidth:He,availableHeight:Oe})=>{const{width:at,height:Je}=Ee.reference,We=Se.floating.style;We.setProperty("--radix-popper-available-width",`${He}px`),We.setProperty("--radix-popper-available-height",`${Oe}px`),We.setProperty("--radix-popper-anchor-width",`${at}px`),We.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),k&&lne({element:k,padding:l}),gne({arrowWidth:T,arrowHeight:P}),g&&sne({strategy:"referenceHidden",...X})]}),[K,I]=T6($),H=Tr(b);wr(()=>{V&&(H==null||H())},[V,H]);const U=(ae=G.arrow)==null?void 0:ae.x,B=(re=G.arrow)==null?void 0:re.y,Q=((ee=G.arrow)==null?void 0:ee.centerOffset)!==0,[Z,te]=y.useState();return wr(()=>{j&&te(window.getComputedStyle(j).zIndex)},[j]),h.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:V?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(se=G.transformOrigin)==null?void 0:se.x,(ge=G.transformOrigin)==null?void 0:ge.y].join(" "),...((ie=G.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(fne,{scope:n,placedSide:K,onArrowChange:O,arrowX:U,arrowY:B,shouldHideArrow:Q,children:h.jsx(Ve.div,{"data-side":K,"data-align":I,...w,ref:_,style:{...w.style,animation:V?void 0:"none"}})})})});k6.displayName=QN;var A6="PopperArrow",mne={top:"bottom",right:"left",bottom:"top",left:"right"},O6=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=hne(A6,r),o=mne[a.placedSide];return h.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:h.jsx(cne,{...i,ref:n,style:{...i.style,display:"block"}})})});O6.displayName=A6;function pne(e){return e!==null}var gne=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,c=o?0:e.arrowHeight,[d,m]=T6(n),f={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)+c/2;let b="",w="";return d==="bottom"?(b=o?f:`${g}px`,w=`${-c}px`):d==="top"?(b=o?f:`${g}px`,w=`${r.floating.height+c}px`):d==="right"?(b=`${-c}px`,w=o?f:`${v}px`):d==="left"&&(b=`${r.floating.width+c}px`,w=o?f:`${v}px`),{data:{x:b,y:w}}}});function T6(e){const[t,n="center"]=e.split("-");return[t,n]}var ZN=_6,JN=N6,ek=k6,tk=O6,$S="rovingFocusGroup.onEntryFocus",vne={bubbles:!1,cancelable:!0},Cp="RovingFocusGroup",[A_,P6,yne]=ON(Cp),[xne,N0]=ja(Cp,[yne]),[bne,wne]=xne(Cp),M6=y.forwardRef((e,t)=>h.jsx(A_.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(A_.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Sne,{...e,ref:t})})}));M6.displayName=Cp;var Sne=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...f}=e,g=y.useRef(null),v=bt(t,g),b=Sp(a),[w,S]=vs({prop:o,defaultProp:l??null,onChange:c,caller:Cp}),[j,C]=y.useState(!1),_=Tr(d),k=P6(n),O=y.useRef(!1),[A,T]=y.useState(0);return y.useEffect(()=>{const P=g.current;if(P)return P.addEventListener($S,_),()=>P.removeEventListener($S,_)},[_]),h.jsx(bne,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:y.useCallback(P=>S(P),[S]),onItemShiftTab:y.useCallback(()=>C(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:y.useCallback(()=>T(P=>P-1),[]),children:h.jsx(Ve.div,{tabIndex:j||A===0?-1:0,"data-orientation":r,...f,ref:v,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{O.current=!0}),onFocus:ke(e.onFocus,P=>{const z=!O.current;if(P.target===P.currentTarget&&z&&!j){const L=new CustomEvent($S,vne);if(P.currentTarget.dispatchEvent(L),!L.defaultPrevented){const F=k().filter($=>$.focusable),D=F.find($=>$.active),X=F.find($=>$.id===w),q=[D,X,...F].filter(Boolean).map($=>$.ref.current);I6(q,m)}}O.current=!1}),onBlur:ke(e.onBlur,()=>C(!1))})})}),R6="RovingFocusGroupItem",D6=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=br(),d=a||c,m=wne(R6,n),f=m.currentTabStopId===d,g=P6(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=m;return y.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),h.jsx(A_.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:h.jsx(Ve.span,{tabIndex:f?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:ke(e.onMouseDown,S=>{r?m.onItemFocus(d):S.preventDefault()}),onFocus:ke(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:ke(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){m.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const j=_ne(S,m.orientation,m.dir);if(j!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let _=g().filter(k=>k.focusable).map(k=>k.ref.current);if(j==="last")_.reverse();else if(j==="prev"||j==="next"){j==="prev"&&_.reverse();const k=_.indexOf(S.currentTarget);_=m.loop?Cne(_,k+1):_.slice(k+1)}setTimeout(()=>I6(_))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:w!=null}):o})})});D6.displayName=R6;var jne={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ene(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _ne(e,t,n){const r=Ene(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return jne[r]}function I6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Cne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var L6=M6,z6=D6,O_=["Enter"," "],Nne=["ArrowDown","PageUp","Home"],$6=["ArrowUp","PageDown","End"],kne=[...Nne,...$6],Ane={ltr:[...O_,"ArrowRight"],rtl:[...O_,"ArrowLeft"]},One={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Np="Menu",[Lm,Tne,Pne]=ON(Np),[Nc,B6]=ja(Np,[Pne,Lf,N0]),k0=Lf(),F6=N0(),[Mne,kc]=Nc(Np),[Rne,kp]=Nc(Np),U6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=k0(t),[c,d]=y.useState(null),m=y.useRef(!1),f=Tr(a),g=Sp(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})}},[]),h.jsx(ZN,{...l,children:h.jsx(Mne,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:d,children:h.jsx(Rne,{scope:t,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:m,dir:g,modal:o,children:r})})})};U6.displayName=Np;var Dne="MenuAnchor",nk=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=k0(n);return h.jsx(JN,{...i,...r,ref:t})});nk.displayName=Dne;var rk="MenuPortal",[Ine,H6]=Nc(rk,{forceMount:void 0}),q6=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=kc(rk,t);return h.jsx(Ine,{scope:t,forceMount:n,children:h.jsx(qr,{present:n||a.open,children:h.jsx(Ep,{asChild:!0,container:i,children:r})})})};q6.displayName=rk;var ua="MenuContent",[Lne,ik]=Nc(ua),V6=y.forwardRef((e,t)=>{const n=H6(ua,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kc(ua,e.__scopeMenu),o=kp(ua,e.__scopeMenu);return h.jsx(Lm.Provider,{scope:e.__scopeMenu,children:h.jsx(qr,{present:r||a.open,children:h.jsx(Lm.Slot,{scope:e.__scopeMenu,children:o.modal?h.jsx(zne,{...i,ref:t}):h.jsx($ne,{...i,ref:t})})})})}),zne=y.forwardRef((e,t)=>{const n=kc(ua,e.__scopeMenu),r=y.useRef(null),i=bt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return DN(a)},[]),h.jsx(ak,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ke(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$ne=y.forwardRef((e,t)=>{const n=kc(ua,e.__scopeMenu);return h.jsx(ak,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Bne=rc("MenuContent.ScrollLock"),ak=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...w}=e,S=kc(ua,n),j=kp(ua,n),C=k0(n),_=F6(n),k=Tne(n),[O,A]=y.useState(null),T=y.useRef(null),P=bt(t,T,S.onContentChange),z=y.useRef(0),L=y.useRef(""),F=y.useRef(0),D=y.useRef(null),X=y.useRef("right"),R=y.useRef(0),q=b?w0:y.Fragment,$=b?{as:Bne,allowPinchZoom:!0}:void 0,V=K=>{var ae,re;const I=L.current+K,H=k().filter(ee=>!ee.disabled),U=document.activeElement,B=(ae=H.find(ee=>ee.ref.current===U))==null?void 0:ae.textValue,Q=H.map(ee=>ee.textValue),Z=Zne(Q,I,B),te=(re=H.find(ee=>ee.textValue===Z))==null?void 0:re.ref.current;(function ee(se){L.current=se,window.clearTimeout(z.current),se!==""&&(z.current=window.setTimeout(()=>ee(""),1e3))})(I),te&&setTimeout(()=>te.focus())};y.useEffect(()=>()=>window.clearTimeout(z.current),[]),RN();const G=y.useCallback(K=>{var H,U;return X.current===((H=D.current)==null?void 0:H.side)&&ere(K,(U=D.current)==null?void 0:U.area)},[]);return h.jsx(Lne,{scope:n,searchRef:L,onItemEnter:y.useCallback(K=>{G(K)&&K.preventDefault()},[G]),onItemLeave:y.useCallback(K=>{var I;G(K)||((I=T.current)==null||I.focus(),A(null))},[G]),onTriggerLeave:y.useCallback(K=>{G(K)&&K.preventDefault()},[G]),pointerGraceTimerRef:F,onPointerGraceIntentChange:y.useCallback(K=>{D.current=K},[]),children:h.jsx(q,{...$,children:h.jsx(x0,{asChild:!0,trapped:i,onMountAutoFocus:ke(a,K=>{var I;K.preventDefault(),(I=T.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:h.jsx(jp,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:g,onDismiss:v,children:h.jsx(L6,{asChild:!0,..._,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:ke(c,K=>{j.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(ek,{role:"menu","aria-orientation":"vertical","data-state":s8(S.open),"data-radix-menu-content":"",dir:j.dir,...C,...w,ref:P,style:{outline:"none",...w.style},onKeyDown:ke(w.onKeyDown,K=>{const H=K.target.closest("[data-radix-menu-content]")===K.currentTarget,U=K.ctrlKey||K.altKey||K.metaKey,B=K.key.length===1;H&&(K.key==="Tab"&&K.preventDefault(),!U&&B&&V(K.key));const Q=T.current;if(K.target!==Q||!kne.includes(K.key))return;K.preventDefault();const te=k().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);$6.includes(K.key)&&te.reverse(),Wne(te)}),onBlur:ke(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(z.current),L.current="")}),onPointerMove:ke(e.onPointerMove,zm(K=>{const I=K.target,H=R.current!==K.clientX;if(K.currentTarget.contains(I)&&H){const U=K.clientX>R.current?"right":"left";X.current=U,R.current=K.clientX}}))})})})})})})});V6.displayName=ua;var Fne="MenuGroup",ok=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ve.div,{role:"group",...r,ref:t})});ok.displayName=Fne;var Une="MenuLabel",K6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ve.div,{...r,ref:t})});K6.displayName=Une;var Wy="MenuItem",mD="menu.itemSelect",A0=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=kp(Wy,e.__scopeMenu),l=ik(Wy,e.__scopeMenu),c=bt(t,a),d=y.useRef(!1),m=()=>{const f=a.current;if(!n&&f){const g=new CustomEvent(mD,{bubbles:!0,cancelable:!0});f.addEventListener(mD,v=>r==null?void 0:r(v),{once:!0}),kB(f,g),g.defaultPrevented?d.current=!1:o.onClose()}};return h.jsx(Y6,{...i,ref:c,disabled:n,onClick:ke(e.onClick,m),onPointerDown:f=>{var g;(g=e.onPointerDown)==null||g.call(e,f),d.current=!0},onPointerUp:ke(e.onPointerUp,f=>{var g;d.current||(g=f.currentTarget)==null||g.click()}),onKeyDown:ke(e.onKeyDown,f=>{const g=l.searchRef.current!=="";n||g&&f.key===" "||O_.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});A0.displayName=Wy;var Y6=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=ik(Wy,n),l=F6(n),c=y.useRef(null),d=bt(t,c),[m,f]=y.useState(!1),[g,v]=y.useState("");return y.useEffect(()=>{const b=c.current;b&&v((b.textContent??"").trim())},[a.children]),h.jsx(Lm.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:h.jsx(z6,{asChild:!0,...l,focusable:!r,children:h.jsx(Ve.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:ke(e.onPointerMove,zm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ke(e.onPointerLeave,zm(b=>o.onItemLeave(b))),onFocus:ke(e.onFocus,()=>f(!0)),onBlur:ke(e.onBlur,()=>f(!1))})})})}),Hne="MenuCheckboxItem",X6=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return h.jsx(J6,{scope:e.__scopeMenu,checked:n,children:h.jsx(A0,{role:"menuitemcheckbox","aria-checked":Qy(n)?"mixed":n,...i,ref:t,"data-state":lk(n),onSelect:ke(i.onSelect,()=>r==null?void 0:r(Qy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});X6.displayName=Hne;var G6="MenuRadioGroup",[qne,Vne]=Nc(G6,{value:void 0,onValueChange:()=>{}}),W6=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Tr(r);return h.jsx(qne,{scope:e.__scopeMenu,value:n,onValueChange:a,children:h.jsx(ok,{...i,ref:t})})});W6.displayName=G6;var Q6="MenuRadioItem",Z6=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=Vne(Q6,e.__scopeMenu),a=n===i.value;return h.jsx(J6,{scope:e.__scopeMenu,checked:a,children:h.jsx(A0,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":lk(a),onSelect:ke(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});Z6.displayName=Q6;var sk="MenuItemIndicator",[J6,Kne]=Nc(sk,{checked:!1}),e8=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=Kne(sk,n);return h.jsx(qr,{present:r||Qy(a.checked)||a.checked===!0,children:h.jsx(Ve.span,{...i,ref:t,"data-state":lk(a.checked)})})});e8.displayName=sk;var Yne="MenuSeparator",t8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});t8.displayName=Yne;var Xne="MenuArrow",n8=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=k0(n);return h.jsx(tk,{...i,...r,ref:t})});n8.displayName=Xne;var Gne="MenuSub",[m$e,r8]=Nc(Gne),gm="MenuSubTrigger",i8=y.forwardRef((e,t)=>{const n=kc(gm,e.__scopeMenu),r=kp(gm,e.__scopeMenu),i=r8(gm,e.__scopeMenu),a=ik(gm,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=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 f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),h.jsx(nk,{asChild:!0,...d,children:h.jsx(Y6,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":s8(n.open),...e,ref:gs(t,i.onTriggerChange),onClick:f=>{var g;(g=e.onClick)==null||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ke(e.onPointerMove,zm(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:ke(e.onPointerLeave,zm(f=>{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"],_=g[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+j,y:f.clientY},{x:C,y:g.top},{x:_,y:g.top},{x:_,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(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:ke(e.onKeyDown,f=>{var v;const g=a.searchRef.current!=="";e.disabled||g&&f.key===" "||Ane[r.dir].includes(f.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),f.preventDefault())})})})});i8.displayName=gm;var a8="MenuSubContent",o8=y.forwardRef((e,t)=>{const n=H6(ua,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kc(ua,e.__scopeMenu),o=kp(ua,e.__scopeMenu),l=r8(a8,e.__scopeMenu),c=y.useRef(null),d=bt(t,c);return h.jsx(Lm.Provider,{scope:e.__scopeMenu,children:h.jsx(qr,{present:r||a.open,children:h.jsx(Lm.Slot,{scope:e.__scopeMenu,children:h.jsx(ak,{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 f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:ke(e.onFocusOutside,m=>{m.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:ke(e.onEscapeKeyDown,m=>{o.onClose(),m.preventDefault()}),onKeyDown:ke(e.onKeyDown,m=>{var v;const f=m.currentTarget.contains(m.target),g=One[o.dir].includes(m.key);f&&g&&(a.onOpenChange(!1),(v=l.trigger)==null||v.focus(),m.preventDefault())})})})})})});o8.displayName=a8;function s8(e){return e?"open":"closed"}function Qy(e){return e==="indeterminate"}function lk(e){return Qy(e)?"indeterminate":e?"checked":"unchecked"}function Wne(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Qne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Zne(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=Qne(e,Math.max(a,0));i.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function Jne(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],c=t[o],d=l.x,m=l.y,f=c.x,g=c.y;m>r!=g>r&&n<(f-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function ere(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Jne(n,t)}function zm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var tre=U6,nre=nk,rre=q6,ire=V6,are=ok,ore=K6,sre=A0,lre=X6,ure=W6,cre=Z6,dre=e8,fre=t8,hre=n8,mre=i8,pre=o8,O0="DropdownMenu",[gre]=ja(O0,[B6]),ii=B6(),[vre,l8]=gre(O0),u8=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=ii(t),d=y.useRef(null),[m,f]=vs({prop:i,defaultProp:a??!1,onChange:o,caller:O0});return h.jsx(vre,{scope:t,triggerId:br(),triggerRef:d,contentId:br(),open:m,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(g=>!g),[f]),modal:l,children:h.jsx(tre,{...c,open:m,onOpenChange:f,dir:r,modal:l,children:n})})};u8.displayName=O0;var c8="DropdownMenuTrigger",d8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=l8(c8,n),o=ii(n);return h.jsx(nre,{asChild:!0,...o,children:h.jsx(Ve.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:gs(t,a.triggerRef),onPointerDown:ke(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:ke(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});d8.displayName=c8;var yre="DropdownMenuPortal",f8=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ii(t);return h.jsx(rre,{...r,...n})};f8.displayName=yre;var h8="DropdownMenuContent",m8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=l8(h8,n),a=ii(n),o=y.useRef(!1);return h.jsx(ire,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:ke(e.onCloseAutoFocus,l=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:ke(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,m=c.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)"}})});m8.displayName=h8;var xre="DropdownMenuGroup",bre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(are,{...i,...r,ref:t})});bre.displayName=xre;var wre="DropdownMenuLabel",Sre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(ore,{...i,...r,ref:t})});Sre.displayName=wre;var jre="DropdownMenuItem",p8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(sre,{...i,...r,ref:t})});p8.displayName=jre;var Ere="DropdownMenuCheckboxItem",g8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(lre,{...i,...r,ref:t})});g8.displayName=Ere;var _re="DropdownMenuRadioGroup",Cre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(ure,{...i,...r,ref:t})});Cre.displayName=_re;var Nre="DropdownMenuRadioItem",kre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(cre,{...i,...r,ref:t})});kre.displayName=Nre;var Are="DropdownMenuItemIndicator",v8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(dre,{...i,...r,ref:t})});v8.displayName=Are;var Ore="DropdownMenuSeparator",Tre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(fre,{...i,...r,ref:t})});Tre.displayName=Ore;var Pre="DropdownMenuArrow",Mre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(hre,{...i,...r,ref:t})});Mre.displayName=Pre;var Rre="DropdownMenuSubTrigger",Dre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(mre,{...i,...r,ref:t})});Dre.displayName=Rre;var Ire="DropdownMenuSubContent",Lre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(pre,{...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)"}})});Lre.displayName=Ire;var zre=u8,$re=d8,Bre=f8,Fre=m8,Ure=p8,Hre=g8,qre=v8,Vre="Label",y8=y.forwardRef((e,t)=>h.jsx(Ve.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())}}));y8.displayName=Vre;var Kre=y8;function T_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yre(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var uk="ScrollArea",[x8]=ja(uk),[Xre,Ea]=x8(uk),b8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=y.useState(null),[d,m]=y.useState(null),[f,g]=y.useState(null),[v,b]=y.useState(null),[w,S]=y.useState(null),[j,C]=y.useState(0),[_,k]=y.useState(0),[O,A]=y.useState(!1),[T,P]=y.useState(!1),z=bt(t,F=>c(F)),L=Sp(i);return h.jsx(Xre,{scope:n,type:r,dir:L,scrollHideDelay:a,scrollArea:l,viewport:d,onViewportChange:m,content:f,onContentChange:g,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:O,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:C,onCornerHeightChange:k,children:h.jsx(Ve.div,{dir:L,...o,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});b8.displayName=uk;var w8="ScrollAreaViewport",S8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Ea(w8,n),l=y.useRef(null),c=bt(t,l,o.onViewportChange);return h.jsxs(h.Fragment,{children:[h.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}),h.jsx(Ve.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});S8.displayName=w8;var To="ScrollAreaScrollbar",j8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ea(To,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"?h.jsx(Gre,{...r,ref:t,forceMount:n}):i.type==="scroll"?h.jsx(Wre,{...r,ref:t,forceMount:n}):i.type==="auto"?h.jsx(E8,{...r,ref:t,forceMount:n}):i.type==="always"?h.jsx(ck,{...r,ref:t}):null});j8.displayName=To;var Gre=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ea(To,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),o(!0)},m=()=>{c=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),h.jsx(qr,{present:n||a,children:h.jsx(E8,{"data-state":a?"visible":"hidden",...r,ref:t})})}),Wre=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ea(To,e.__scopeScrollArea),a=e.orientation==="horizontal",o=P0(()=>c("SCROLL_END"),100),[l,c]=Yre("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(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,i.scrollHideDelay,c]),y.useEffect(()=>{const d=i.viewport,m=a?"scrollLeft":"scrollTop";if(d){let f=d[m];const g=()=>{const v=d[m];f!==v&&(c("SCROLL"),o()),f=v};return d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[i.viewport,a,c,o]),h.jsx(qr,{present:n||l!=="hidden",children:h.jsx(ck,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),E8=y.forwardRef((e,t)=>{const n=Ea(To,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),l=e.orientation==="horizontal",c=P0(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?d:m)}},10);return uf(n.viewport,c),uf(n.content,c),h.jsx(qr,{present:r||a,children:h.jsx(ck,{"data-state":a?"visible":"hidden",...i,ref:t})})}),ck=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Ea(To,e.__scopeScrollArea),a=y.useRef(null),o=y.useRef(0),[l,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=A8(l.viewport,l.content),m={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:g=>a.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function f(g,v){return nie(g,o.current,l,v)}return n==="horizontal"?h.jsx(Qre,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollLeft,v=pD(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=f(g,i.dir))}}):n==="vertical"?h.jsx(Zre,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollTop,v=pD(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=f(g))}}):null}),Qre=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ea(To,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),d=bt(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),h.jsx(C8,{"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":T0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,f)=>{if(a.viewport){const g=a.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),T8(g,f)&&m.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Jy(o.paddingLeft),paddingEnd:Jy(o.paddingRight)}})}})}),Zre=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ea(To,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),d=bt(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),h.jsx(C8,{"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":T0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,f)=>{if(a.viewport){const g=a.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),T8(g,f)&&m.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Jy(o.paddingTop),paddingEnd:Jy(o.paddingBottom)}})}})}),[Jre,_8]=x8(To),C8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:m,onResize:f,...g}=e,v=Ea(To,n),[b,w]=y.useState(null),S=bt(t,z=>w(z)),j=y.useRef(null),C=y.useRef(""),_=v.viewport,k=r.content-r.viewport,O=Tr(m),A=Tr(c),T=P0(f,10);function P(z){if(j.current){const L=z.clientX-j.current.left,F=z.clientY-j.current.top;d({x:L,y:F})}}return y.useEffect(()=>{const z=L=>{const F=L.target;(b==null?void 0:b.contains(F))&&O(L,k)};return document.addEventListener("wheel",z,{passive:!1}),()=>document.removeEventListener("wheel",z,{passive:!1})},[_,b,k,O]),y.useEffect(A,[r,A]),uf(b,T),uf(v.content,T),h.jsx(Jre,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:Tr(a),onThumbPointerUp:Tr(o),onThumbPositionChange:A,onThumbPointerDown:Tr(l),children:h.jsx(Ve.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:ke(e.onPointerDown,z=>{z.button===0&&(z.target.setPointerCapture(z.pointerId),j.current=b.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),P(z))}),onPointerMove:ke(e.onPointerMove,P),onPointerUp:ke(e.onPointerUp,z=>{const L=z.target;L.hasPointerCapture(z.pointerId)&&L.releasePointerCapture(z.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),Zy="ScrollAreaThumb",N8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_8(Zy,e.__scopeScrollArea);return h.jsx(qr,{present:n||i.hasThumb,children:h.jsx(eie,{ref:t,...r})})}),eie=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=Ea(Zy,n),o=_8(Zy,n),{onThumbPositionChange:l}=o,c=bt(t,f=>o.onThumbChange(f)),d=y.useRef(void 0),m=P0(()=>{d.current&&(d.current(),d.current=void 0)},100);return y.useEffect(()=>{const f=a.viewport;if(f){const g=()=>{if(m(),!d.current){const v=rie(f,l);d.current=v,l()}};return l(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,m,l]),h.jsx(Ve.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ke(e.onPointerDownCapture,f=>{const v=f.target.getBoundingClientRect(),b=f.clientX-v.left,w=f.clientY-v.top;o.onThumbPointerDown({x:b,y:w})}),onPointerUp:ke(e.onPointerUp,o.onThumbPointerUp)})});N8.displayName=Zy;var dk="ScrollAreaCorner",k8=y.forwardRef((e,t)=>{const n=Ea(dk,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(tie,{...e,ref:t}):null});k8.displayName=dk;var tie=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Ea(dk,n),[a,o]=y.useState(0),[l,c]=y.useState(0),d=!!(a&&l);return uf(i.scrollbarX,()=>{var f;const m=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(m),c(m)}),uf(i.scrollbarY,()=>{var f;const m=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(m),o(m)}),d?h.jsx(Ve.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 Jy(e){return e?parseInt(e,10):0}function A8(e,t){const n=e/t;return isNaN(n)?0:n}function T0(e){const t=A8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function nie(e,t,n,r="ltr"){const i=T0(n),a=i/2,o=t||a,l=i-o,c=n.scrollbar.paddingStart+o,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,f=r==="ltr"?[0,m]:[m*-1,0];return O8([c,d],f)(e)}function pD(e,t,n="ltr"){const r=T0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],d=T_(e,c);return O8([0,o],[0,l])(d)}function O8(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 T8(e,t){return e>0&&e<t}var rie=(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 P0(e,t){const n=Tr(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 uf(e,t){const n=Tr(t);wr(()=>{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 iie=b8,aie=S8,oie=k8,sie=[" ","Enter","ArrowUp","ArrowDown"],lie=[" ","Enter"],oc="Select",[M0,R0,uie]=ON(oc),[zf]=ja(oc,[uie,Lf]),D0=Lf(),[cie,Wl]=zf(oc),[die,fie]=zf(oc),P8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:d,name:m,autoComplete:f,disabled:g,required:v,form:b}=e,w=D0(t),[S,j]=y.useState(null),[C,_]=y.useState(null),[k,O]=y.useState(!1),A=Sp(d),[T,P]=vs({prop:r,defaultProp:i??!1,onChange:a,caller:oc}),[z,L]=vs({prop:o,defaultProp:l,onChange:c,caller:oc}),F=y.useRef(null),D=S?b||!!S.closest("form"):!0,[X,R]=y.useState(new Set),q=Array.from(X).map($=>$.props.value).join(";");return h.jsx(ZN,{...w,children:h.jsxs(cie,{required:v,scope:t,trigger:S,onTriggerChange:j,valueNode:C,onValueNodeChange:_,valueNodeHasChildren:k,onValueNodeHasChildrenChange:O,contentId:br(),value:z,onValueChange:L,open:T,onOpenChange:P,dir:A,triggerPointerDownPosRef:F,disabled:g,children:[h.jsx(M0.Provider,{scope:t,children:h.jsx(die,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback($=>{R(V=>new Set(V).add($))},[]),onNativeOptionRemove:y.useCallback($=>{R(V=>{const G=new Set(V);return G.delete($),G})},[]),children:n})}),D?h.jsxs(eF,{"aria-hidden":!0,required:v,tabIndex:-1,name:m,autoComplete:f,value:z,onChange:$=>L($.target.value),disabled:g,form:b,children:[z===void 0?h.jsx("option",{value:""}):null,Array.from(X)]},q):null]})})};P8.displayName=oc;var M8="SelectTrigger",R8=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=D0(n),o=Wl(M8,n),l=o.disabled||r,c=bt(t,o.onTriggerChange),d=R0(n),m=y.useRef("touch"),[f,g,v]=nF(w=>{const S=d().filter(_=>!_.disabled),j=S.find(_=>_.value===o.value),C=rF(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 h.jsx(JN,{asChild:!0,...a,children:h.jsx(Ve.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":tF(o.value)?"":void 0,...i,ref:c,onClick:ke(i.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&b(w)}),onPointerDown:ke(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:ke(i.onKeyDown,w=>{const S=f.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(S&&w.key===" ")&&sie.includes(w.key)&&(b(),w.preventDefault())})})})});R8.displayName=M8;var D8="SelectValue",I8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=Wl(D8,n),{onValueNodeHasChildrenChange:d}=c,m=a!==void 0,f=bt(t,c.onValueNodeChange);return wr(()=>{d(m)},[d,m]),h.jsx(Ve.span,{...l,ref:f,style:{pointerEvents:"none"},children:tF(c.value)?h.jsx(h.Fragment,{children:o}):a})});I8.displayName=D8;var hie="SelectIcon",L8=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return h.jsx(Ve.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});L8.displayName=hie;var mie="SelectPortal",z8=e=>h.jsx(Ep,{asChild:!0,...e});z8.displayName=mie;var sc="SelectContent",$8=y.forwardRef((e,t)=>{const n=Wl(sc,e.__scopeSelect),[r,i]=y.useState();if(wr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Gl.createPortal(h.jsx(B8,{scope:e.__scopeSelect,children:h.jsx(M0.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),a):null}return h.jsx(F8,{...e,ref:t})});$8.displayName=sc;var Ma=10,[B8,Ql]=zf(sc),pie="SelectContentImpl",gie=rc("SelectContent.RemoveScroll"),F8=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:m,arrowPadding:f,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S,...j}=e,C=Wl(sc,n),[_,k]=y.useState(null),[O,A]=y.useState(null),T=bt(t,ae=>k(ae)),[P,z]=y.useState(null),[L,F]=y.useState(null),D=R0(n),[X,R]=y.useState(!1),q=y.useRef(!1);y.useEffect(()=>{if(_)return DN(_)},[_]),RN();const $=y.useCallback(ae=>{const[re,...ee]=D().map(ie=>ie.ref.current),[se]=ee.slice(-1),ge=document.activeElement;for(const ie of ae)if(ie===ge||(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!==ge))return},[D,O]),V=y.useCallback(()=>$([P,_]),[$,P,_]);y.useEffect(()=>{X&&V()},[X,V]);const{onOpenChange:G,triggerPointerDownPosRef:K}=C;y.useEffect(()=>{if(_){let ae={x:0,y:0};const re=se=>{var ge,ie;ae={x:Math.abs(Math.round(se.pageX)-(((ge=K.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(se.pageY)-(((ie=K.current)==null?void 0:ie.y)??0))}},ee=se=>{ae.x<=10&&ae.y<=10?se.preventDefault():_.contains(se.target)||G(!1),document.removeEventListener("pointermove",re),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ee,{capture:!0})}}},[_,G,K]),y.useEffect(()=>{const ae=()=>G(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[G]);const[I,H]=nF(ae=>{const re=D().filter(ge=>!ge.disabled),ee=re.find(ge=>ge.ref.current===document.activeElement),se=rF(re,ae,ee);se&&setTimeout(()=>se.ref.current.focus())}),U=y.useCallback((ae,re,ee)=>{const se=!q.current&&!ee;(C.value!==void 0&&C.value===re||se)&&(z(ae),se&&(q.current=!0))},[C.value]),B=y.useCallback(()=>_==null?void 0:_.focus(),[_]),Q=y.useCallback((ae,re,ee)=>{const se=!q.current&&!ee;(C.value!==void 0&&C.value===re||se)&&F(ae)},[C.value]),Z=r==="popper"?P_:U8,te=Z===P_?{side:l,sideOffset:c,align:d,alignOffset:m,arrowPadding:f,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return h.jsx(B8,{scope:n,content:_,viewport:O,onViewportChange:A,itemRefCallback:U,selectedItem:P,onItemLeave:B,itemTextRefCallback:Q,focusSelectedItem:V,selectedItemText:L,position:r,isPositioned:X,searchRef:I,children:h.jsx(w0,{as:gie,allowPinchZoom:!0,children:h.jsx(x0,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:ke(i,ae=>{var re;(re=C.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:h.jsx(jp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:h.jsx(Z,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...j,...te,onPlaced:()=>R(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:ke(j.onKeyDown,ae=>{const re=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!re&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let se=D().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const ge=ae.target,ie=se.indexOf(ge);se=se.slice(ie+1)}setTimeout(()=>$(se)),ae.preventDefault()}})})})})})})});F8.displayName=pie;var vie="SelectItemAlignedPosition",U8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Wl(sc,n),o=Ql(sc,n),[l,c]=y.useState(null),[d,m]=y.useState(null),f=bt(t,T=>m(T)),g=R0(n),v=y.useRef(!1),b=y.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:j,focusSelectedItem:C}=o,_=y.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&w&&S&&j){const T=a.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),z=a.valueNode.getBoundingClientRect(),L=j.getBoundingClientRect();if(a.dir!=="rtl"){const ge=L.left-P.left,ie=z.left-ge,Se=T.left-ie,Ee=T.width+Se,He=Math.max(Ee,P.width),Oe=window.innerWidth-Ma,at=T_(ie,[Ma,Math.max(Ma,Oe-He)]);l.style.minWidth=Ee+"px",l.style.left=at+"px"}else{const ge=P.right-L.right,ie=window.innerWidth-z.right-ge,Se=window.innerWidth-T.right-ie,Ee=T.width+Se,He=Math.max(Ee,P.width),Oe=window.innerWidth-Ma,at=T_(ie,[Ma,Math.max(Ma,Oe-He)]);l.style.minWidth=Ee+"px",l.style.right=at+"px"}const F=g(),D=window.innerHeight-Ma*2,X=w.scrollHeight,R=window.getComputedStyle(d),q=parseInt(R.borderTopWidth,10),$=parseInt(R.paddingTop,10),V=parseInt(R.borderBottomWidth,10),G=parseInt(R.paddingBottom,10),K=q+$+X+G+V,I=Math.min(S.offsetHeight*5,K),H=window.getComputedStyle(w),U=parseInt(H.paddingTop,10),B=parseInt(H.paddingBottom,10),Q=T.top+T.height/2-Ma,Z=D-Q,te=S.offsetHeight/2,ae=S.offsetTop+te,re=q+$+ae,ee=K-re;if(re<=Q){const ge=F.length>0&&S===F[F.length-1].ref.current;l.style.bottom="0px";const ie=d.clientHeight-w.offsetTop-w.offsetHeight,Se=Math.max(Z,te+(ge?B:0)+ie+V),Ee=re+Se;l.style.height=Ee+"px"}else{const ge=F.length>0&&S===F[0].ref.current;l.style.top="0px";const Se=Math.max(Q,q+w.offsetTop+(ge?U:0)+te)+ee;l.style.height=Se+"px",w.scrollTop=re-Q+w.offsetTop}l.style.margin=`${Ma}px 0`,l.style.minHeight=I+"px",l.style.maxHeight=D+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[g,a.trigger,a.valueNode,l,d,w,S,j,a.dir,r]);wr(()=>_(),[_]);const[k,O]=y.useState();wr(()=>{d&&O(window.getComputedStyle(d).zIndex)},[d]);const A=y.useCallback(T=>{T&&b.current===!0&&(_(),C==null||C(),b.current=!1)},[_,C]);return h.jsx(xie,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:h.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:h.jsx(Ve.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});U8.displayName=vie;var yie="SelectPopperPosition",P_=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ma,...a}=e,o=D0(n);return h.jsx(ek,{...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)"}})});P_.displayName=yie;var[xie,fk]=zf(sc,{}),M_="SelectViewport",H8=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=Ql(M_,n),o=fk(M_,n),l=bt(t,a.onViewportChange),c=y.useRef(0);return h.jsxs(h.Fragment,{children:[h.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}),h.jsx(M0.Slot,{scope:n,children:h.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ke(i.onScroll,d=>{const m=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&f){const v=Math.abs(c.current-m.scrollTop);if(v>0){const b=window.innerHeight-Ma*2,w=parseFloat(f.style.minHeight),S=parseFloat(f.style.height),j=Math.max(w,S);if(j<b){const C=j+v,_=Math.min(b,C),k=C-_;f.style.height=_+"px",f.style.bottom==="0px"&&(m.scrollTop=k>0?k:0,f.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});H8.displayName=M_;var q8="SelectGroup",[bie,wie]=zf(q8),Sie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=br();return h.jsx(bie,{scope:n,id:i,children:h.jsx(Ve.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Sie.displayName=q8;var V8="SelectLabel",jie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=wie(V8,n);return h.jsx(Ve.div,{id:i.id,...r,ref:t})});jie.displayName=V8;var ex="SelectItem",[Eie,K8]=zf(ex),Y8=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Wl(ex,n),c=Ql(ex,n),d=l.value===r,[m,f]=y.useState(a??""),[g,v]=y.useState(!1),b=bt(t,C=>{var _;return(_=c.itemRefCallback)==null?void 0:_.call(c,C,r,i)}),w=br(),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 h.jsx(Eie,{scope:n,value:r,disabled:i,textId:w,isSelected:d,onItemTextChange:y.useCallback(C=>{f(_=>_||((C==null?void 0:C.textContent)??"").trim())},[]),children:h.jsx(M0.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:h.jsx(Ve.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:ke(o.onFocus,()=>v(!0)),onBlur:ke(o.onBlur,()=>v(!1)),onClick:ke(o.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:ke(o.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:ke(o.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:ke(o.onPointerMove,C=>{var _;S.current=C.pointerType,i?(_=c.onItemLeave)==null||_.call(c):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(o.onPointerLeave,C=>{var _;C.currentTarget===document.activeElement&&((_=c.onItemLeave)==null||_.call(c))}),onKeyDown:ke(o.onKeyDown,C=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&C.key===" "||(lie.includes(C.key)&&j(),C.key===" "&&C.preventDefault())})})})})});Y8.displayName=ex;var vm="SelectItemText",X8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Wl(vm,n),l=Ql(vm,n),c=K8(vm,n),d=fie(vm,n),[m,f]=y.useState(null),g=bt(t,j=>f(j),c.onItemTextChange,j=>{var C;return(C=l.itemTextRefCallback)==null?void 0:C.call(l,j,c.value,c.disabled)}),v=m==null?void 0:m.textContent,b=y.useMemo(()=>h.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=d;return wr(()=>(w(b),()=>S(b)),[w,S,b]),h.jsxs(h.Fragment,{children:[h.jsx(Ve.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Gl.createPortal(a.children,o.valueNode):null]})});X8.displayName=vm;var G8="SelectItemIndicator",W8=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return K8(G8,n).isSelected?h.jsx(Ve.span,{"aria-hidden":!0,...r,ref:t}):null});W8.displayName=G8;var R_="SelectScrollUpButton",Q8=y.forwardRef((e,t)=>{const n=Ql(R_,e.__scopeSelect),r=fk(R_,e.__scopeSelect),[i,a]=y.useState(!1),o=bt(t,r.onScrollButtonChange);return wr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;a(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?h.jsx(J8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Q8.displayName=R_;var D_="SelectScrollDownButton",Z8=y.forwardRef((e,t)=>{const n=Ql(D_,e.__scopeSelect),r=fk(D_,e.__scopeSelect),[i,a]=y.useState(!1),o=bt(t,r.onScrollButtonChange);return wr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<d;a(m)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?h.jsx(J8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Z8.displayName=D_;var J8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ql("SelectScrollButton",n),o=y.useRef(null),l=R0(n),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),wr(()=>{var m;const d=l().find(f=>f.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),h.jsx(Ve.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ke(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ke(i.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ke(i.onPointerLeave,()=>{c()})})}),_ie="SelectSeparator",Cie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(Ve.div,{"aria-hidden":!0,...r,ref:t})});Cie.displayName=_ie;var I_="SelectArrow",Nie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=D0(n),a=Wl(I_,n),o=Ql(I_,n);return a.open&&o.position==="popper"?h.jsx(tk,{...i,...r,ref:t}):null});Nie.displayName=I_;var kie="SelectBubbleInput",eF=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),a=bt(r,i),o=u6(t);return y.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&m){const f=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(f)}},[o,t]),h.jsx(Ve.select,{...n,style:{...AB,...n.style},ref:a,defaultValue:t})});eF.displayName=kie;function tF(e){return e===""||e===void 0}function nF(e){const t=Tr(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(o=>{const l=n.current+o;t(l),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function rF(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=Aie(e,Math.max(a,0));i.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function Aie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Oie=P8,Tie=R8,Pie=I8,Mie=L8,Rie=z8,Die=$8,Iie=H8,Lie=Y8,zie=X8,$ie=W8,Bie=Q8,Fie=Z8,Uie="Separator",gD="horizontal",Hie=["horizontal","vertical"],iF=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=gD,...i}=e,a=qie(r)?r:gD,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return h.jsx(Ve.div,{"data-orientation":a,...l,...i,ref:t})});iF.displayName=Uie;function qie(e){return Hie.includes(e)}var Vie=iF,I0="Switch",[Kie]=ja(I0),[Yie,Xie]=Kie(I0),aF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:d,form:m,...f}=e,[g,v]=y.useState(null),b=bt(t,_=>v(_)),w=y.useRef(!1),S=g?m||!!g.closest("form"):!0,[j,C]=vs({prop:i,defaultProp:a??!1,onChange:d,caller:I0});return h.jsxs(Yie,{scope:n,checked:j,disabled:l,children:[h.jsx(Ve.button,{type:"button",role:"switch","aria-checked":j,"aria-required":o,"data-state":uF(j),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:b,onClick:ke(e.onClick,_=>{C(k=>!k),S&&(w.current=_.isPropagationStopped(),w.current||_.stopPropagation())})}),S&&h.jsx(lF,{control:g,bubbles:!w.current,name:r,value:c,checked:j,required:o,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});aF.displayName=I0;var oF="SwitchThumb",sF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Xie(oF,n);return h.jsx(Ve.span,{"data-state":uF(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});sF.displayName=oF;var Gie="SwitchBubbleInput",lF=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{const o=y.useRef(null),l=bt(o,a),c=u6(n),d=c6(t);return y.useEffect(()=>{const m=o.current;if(!m)return;const f=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&v){const b=new Event("click",{bubbles:r});v.call(m,n),m.dispatchEvent(b)}},[c,n,r]),h.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}})});lF.displayName=Gie;function uF(e){return e?"checked":"unchecked"}var Wie=aF,Qie=sF,L0="Tabs",[Zie]=ja(L0,[N0]),cF=N0(),[Jie,hk]=Zie(L0),dF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,m=Sp(l),[f,g]=vs({prop:r,onChange:i,defaultProp:a??"",caller:L0});return h.jsx(Jie,{scope:n,baseId:br(),value:f,onValueChange:g,orientation:o,dir:m,activationMode:c,children:h.jsx(Ve.div,{dir:m,"data-orientation":o,...d,ref:t})})});dF.displayName=L0;var fF="TabsList",hF=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=hk(fF,n),o=cF(n);return h.jsx(L6,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:h.jsx(Ve.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});hF.displayName=fF;var mF="TabsTrigger",pF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=hk(mF,n),l=cF(n),c=yF(o.baseId,r),d=xF(o.baseId,r),m=r===o.value;return h.jsx(z6,{asChild:!0,...l,focusable:!i,active:m,children:h.jsx(Ve.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:ke(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:ke(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const f=o.activationMode!=="manual";!m&&!i&&f&&o.onValueChange(r)})})})});pF.displayName=mF;var gF="TabsContent",vF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=hk(gF,n),c=yF(l.baseId,r),d=xF(l.baseId,r),m=r===l.value,f=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),h.jsx(qr,{present:i||m,children:({present:g})=>h.jsx(Ve.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:g&&a})})});vF.displayName=gF;function yF(e,t){return`${e}-trigger-${t}`}function xF(e,t){return`${e}-content-${t}`}var eae=dF,tae=hF,nae=pF,rae=vF,[z0]=ja("Tooltip",[Lf]),$0=Lf(),bF="TooltipProvider",iae=700,L_="tooltip.open",[aae,mk]=z0(bF),wF=e=>{const{__scopeTooltip:t,delayDuration:n=iae,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),l=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),h.jsx(aae,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:a})};wF.displayName=bF;var $m="Tooltip",[oae,Ap]=z0($m),SF=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=mk($m,e.__scopeTooltip),d=$0(t),[m,f]=y.useState(null),g=br(),v=y.useRef(0),b=o??c.disableHoverableContent,w=l??c.delayDuration,S=y.useRef(!1),[j,C]=vs({prop:r,defaultProp:i??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(L_))):c.onClose(),a==null||a(T)},caller:$m}),_=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)},[]),h.jsx(ZN,{...d,children:h.jsx(oae,{scope:t,contentId:g,open:j,stateAttribute:_,trigger:m,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?A():k()},[c.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})})};SF.displayName=$m;var z_="TooltipTrigger",jF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Ap(z_,n),a=mk(z_,n),o=$0(n),l=y.useRef(null),c=bt(t,l,i.onTriggerChange),d=y.useRef(!1),m=y.useRef(!1),f=y.useCallback(()=>d.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),h.jsx(JN,{asChild:!0,...o,children:h.jsx(Ve.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:ke(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ke(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:ke(e.onBlur,i.onClose),onClick:ke(e.onClick,i.onClose)})})});jF.displayName=z_;var pk="TooltipPortal",[sae,lae]=z0(pk,{forceMount:void 0}),EF=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Ap(pk,t);return h.jsx(sae,{scope:t,forceMount:n,children:h.jsx(qr,{present:n||a.open,children:h.jsx(Ep,{asChild:!0,container:i,children:r})})})};EF.displayName=pk;var cf="TooltipContent",_F=y.forwardRef((e,t)=>{const n=lae(cf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Ap(cf,e.__scopeTooltip);return h.jsx(qr,{present:r||o.open,children:o.disableHoverableContent?h.jsx(CF,{side:i,...a,ref:t}):h.jsx(uae,{side:i,...a,ref:t})})}),uae=y.forwardRef((e,t)=>{const n=Ap(cf,e.__scopeTooltip),r=mk(cf,e.__scopeTooltip),i=y.useRef(null),a=bt(t,i),[o,l]=y.useState(null),{trigger:c,onClose:d}=n,m=i.current,{onPointerInTransitChange:f}=r,g=y.useCallback(()=>{l(null),f(!1)},[f]),v=y.useCallback((b,w)=>{const S=b.currentTarget,j={x:b.clientX,y:b.clientY},C=hae(j,S.getBoundingClientRect()),_=mae(j,C),k=pae(w.getBoundingClientRect()),O=vae([..._,...k]);l(O),f(!0)},[f]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(c&&m){const b=S=>v(S,m),w=S=>v(S,c);return c.addEventListener("pointerleave",b),m.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",w)}}},[c,m,v,g]),y.useEffect(()=>{if(o){const b=w=>{const S=w.target,j={x:w.clientX,y:w.clientY},C=(c==null?void 0:c.contains(S))||(m==null?void 0:m.contains(S)),_=!gae(j,o);C?g():_&&(g(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,m,o,d,g]),h.jsx(CF,{...e,ref:a})}),[cae,dae]=z0($m,{isInside:!1}),fae=EJ("TooltipContent"),CF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=Ap(cf,n),d=$0(n),{onClose:m}=c;return y.useEffect(()=>(document.addEventListener(L_,m),()=>document.removeEventListener(L_,m)),[m]),y.useEffect(()=>{if(c.trigger){const f=g=>{const v=g.target;v!=null&&v.contains(c.trigger)&&m()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,m]),h.jsx(jp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:m,children:h.jsxs(ek,{"data-state":c.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:[h.jsx(fae,{children:r}),h.jsx(cae,{scope:n,isInside:!0,children:h.jsx(OJ,{id:c.contentId,role:"tooltip",children:i||r})})]})})});_F.displayName=cf;var NF="TooltipArrow",kF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=$0(n);return dae(NF,n).isInside?null:h.jsx(tk,{...i,...r,ref:t})});kF.displayName=NF;function hae(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 mae(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 pae(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 gae(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],c=t[o],d=l.x,m=l.y,f=c.x,g=c.y;m>r!=g>r&&n<(f-d)*(r-m)/(g-m)+d&&(i=!i)}return i}function vae(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=wF,bae=SF,wae=jF,Sae=EF,jae=_F,Eae=kF;function AF(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=AF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Dt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=AF(e))&&(r&&(r+=" "),r+=t);return r}const _ae=(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},Cae=(e,t)=>({classGroupId:e,validator:t}),OF=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),tx="-",vD=[],Nae="arbitrary..",kae=e=>{const t=Oae(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Aae(o);const l=o.split(tx),c=l[0]===""&&l.length>1?1:0;return TF(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],d=n[o];return c?d?_ae(d,c):c:d||vD}return n[o]||vD}}},TF=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const d=TF(e,t+1,a);if(d)return d}const o=n.validators;if(o===null)return;const l=t===0?e.join(tx):e.slice(t).join(tx),c=o.length;for(let d=0;d<c;d++){const m=o[d];if(m.validator(l))return m.classGroupId}},Aae=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?Nae+r:void 0})(),Oae=e=>{const{theme:t,classGroups:n}=e;return Tae(n,t)},Tae=(e,t)=>{const n=OF();for(const r in e){const i=e[r];gk(i,n,r,t)}return n},gk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];Pae(o,t,n,r)}},Pae=(e,t,n,r)=>{if(typeof e=="string"){Mae(e,t,n);return}if(typeof e=="function"){Rae(e,t,n,r);return}Dae(e,t,n,r)},Mae=(e,t,n)=>{const r=e===""?t:PF(t,e);r.classGroupId=n},Rae=(e,t,n,r)=>{if(Iae(e)){gk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Cae(n,e))},Dae=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[l,c]=i[o];gk(c,PF(t,l),n,r)}},PF=(e,t)=>{let n=e;const r=t.split(tx),i=r.length;for(let a=0;a<i;a++){const o=r[a];let l=n.nextPart.get(o);l||(l=OF(),n.nextPart.set(o,l)),n=l}return n},Iae=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Lae=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)}}},$_="!",yD=":",zae=[],xD=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),$ae=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,l=0,c=0,d;const m=i.length;for(let w=0;w<m;w++){const S=i[w];if(o===0&&l===0){if(S===yD){a.push(i.slice(c,w)),c=w+1;continue}if(S==="/"){d=w;continue}}S==="["?o++:S==="]"?o--:S==="("?l++:S===")"&&l--}const f=a.length===0?i:i.slice(c);let g=f,v=!1;f.endsWith($_)?(g=f.slice(0,-1),v=!0):f.startsWith($_)&&(g=f.slice(1),v=!0);const b=d&&d>c?d-c:void 0;return xD(a,v,g,b)};if(t){const i=t+yD,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):xD(zae,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Bae=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]==="[",c=t.has(o);l||c?(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}},Fae=e=>({cache:Lae(e.cacheSize),parseClassName:$ae(e),sortModifiers:Bae(e),...kae(e)}),Uae=/\s+/,Hae=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],l=e.trim().split(Uae);let c="";for(let d=l.length-1;d>=0;d-=1){const m=l[d],{isExternal:f,modifiers:g,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:w}=n(m);if(f){c=m+(c.length>0?" "+c:c);continue}let S=!!w,j=r(S?b.substring(0,w):b);if(!j){if(!S){c=m+(c.length>0?" "+c:c);continue}if(j=r(b),!j){c=m+(c.length>0?" "+c:c);continue}S=!1}const C=g.length===0?"":g.length===1?g[0]:a(g).join(":"),_=v?C+$_:C,k=_+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(_+T)}c=m+(c.length>0?" "+c:c)}return c},qae=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=MF(n))&&(i&&(i+=" "),i+=r);return i},MF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=MF(e[r]))&&(n&&(n+=" "),n+=t);return n},Vae=(e,...t)=>{let n,r,i,a;const o=c=>{const d=t.reduce((m,f)=>f(m),e());return n=Fae(d),r=n.cache.get,i=n.cache.set,a=l,l(c)},l=c=>{const d=r(c);if(d)return d;const m=Hae(c,n);return i(c,m),m};return a=o,(...c)=>a(qae(...c))},Kae=[],nr=e=>{const t=n=>n[e]||Kae;return t.isThemeGetter=!0,t},RF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,DF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Yae=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Xae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gae=/\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$/,Wae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hl=e=>Yae.test(e),xt=e=>!!e&&!Number.isNaN(Number(e)),ml=e=>!!e&&Number.isInteger(Number(e)),BS=e=>e.endsWith("%")&&xt(e.slice(0,-1)),Jo=e=>Xae.test(e),IF=()=>!0,Jae=e=>Gae.test(e)&&!Wae.test(e),vk=()=>!1,eoe=e=>Qae.test(e),toe=e=>Zae.test(e),noe=e=>!Be(e)&&!Ue(e),roe=e=>Zl(e,$F,vk),Be=e=>RF.test(e),Eu=e=>Zl(e,BF,Jae),bD=e=>Zl(e,doe,xt),ioe=e=>Zl(e,UF,IF),aoe=e=>Zl(e,FF,vk),wD=e=>Zl(e,LF,vk),ooe=e=>Zl(e,zF,toe),Xv=e=>Zl(e,HF,eoe),Ue=e=>DF.test(e),Kh=e=>Ac(e,BF),soe=e=>Ac(e,FF),SD=e=>Ac(e,LF),loe=e=>Ac(e,$F),uoe=e=>Ac(e,zF),Gv=e=>Ac(e,HF,!0),coe=e=>Ac(e,UF,!0),Zl=(e,t,n)=>{const r=RF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ac=(e,t,n=!1)=>{const r=DF.exec(e);return r?r[1]?t(r[1]):n:!1},LF=e=>e==="position"||e==="percentage",zF=e=>e==="image"||e==="url",$F=e=>e==="length"||e==="size"||e==="bg-size",BF=e=>e==="length",doe=e=>e==="number",FF=e=>e==="family-name",UF=e=>e==="number"||e==="weight",HF=e=>e==="shadow",foe=()=>{const e=nr("color"),t=nr("font"),n=nr("text"),r=nr("font-weight"),i=nr("tracking"),a=nr("leading"),o=nr("breakpoint"),l=nr("container"),c=nr("spacing"),d=nr("radius"),m=nr("shadow"),f=nr("inset-shadow"),g=nr("text-shadow"),v=nr("drop-shadow"),b=nr("blur"),w=nr("perspective"),S=nr("aspect"),j=nr("ease"),C=nr("animate"),_=()=>["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(),Ue,Be],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],P=()=>[Ue,Be,c],z=()=>[hl,"full","auto",...P()],L=()=>[ml,"none","subgrid",Ue,Be],F=()=>["auto",{span:["full",ml,Ue,Be]},ml,Ue,Be],D=()=>[ml,"auto",Ue,Be],X=()=>["auto","min","max","fr",Ue,Be],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...P()],V=()=>[hl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],G=()=>[hl,"screen","full","dvw","lvw","svw","min","max","fit",...P()],K=()=>[hl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],I=()=>[e,Ue,Be],H=()=>[...k(),SD,wD,{position:[Ue,Be]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",loe,roe,{size:[Ue,Be]}],Q=()=>[BS,Kh,Eu],Z=()=>["","none","full",d,Ue,Be],te=()=>["",xt,Kh,Eu],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=()=>[xt,BS,SD,wD],se=()=>["","none",b,Ue,Be],ge=()=>["none",xt,Ue,Be],ie=()=>["none",xt,Ue,Be],Se=()=>[xt,Ue,Be],Ee=()=>[hl,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jo],breakpoint:[Jo],color:[IF],container:[Jo],"drop-shadow":[Jo],ease:["in","out","in-out"],font:[noe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jo],shadow:[Jo],spacing:["px",xt],text:[Jo],"text-shadow":[Jo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",hl,Be,Ue,S]}],container:["container"],columns:[{columns:[xt,Be,Ue,l]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[ml,"auto",Ue,Be]}],basis:[{basis:[hl,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xt,hl,"auto","initial","none",Be]}],grow:[{grow:["",xt,Ue,Be]}],shrink:[{shrink:["",xt,Ue,Be]}],order:[{order:[ml,"first","last","none",Ue,Be]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[l,"screen",...V()]}],"min-w":[{"min-w":[l,"screen","none",...V()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,Kh,Eu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,coe,ioe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",BS,Be]}],"font-family":[{font:[soe,aoe,t]}],"font-features":[{"font-features":[Be]}],"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,Ue,Be]}],"line-clamp":[{"line-clamp":[xt,"none",Ue,bD]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",Ue,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[xt,"from-font","auto",Ue,Eu]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[xt,"auto",Ue,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue,Be]}],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",Ue,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ml,Ue,Be],radial:["",Ue,Be],conic:[ml,Ue,Be]},uoe,ooe]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],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:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xt,Ue,Be]}],"outline-w":[{outline:["",xt,Kh,Eu]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",m,Gv,Xv]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",f,Gv,Xv]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[xt,Eu]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",g,Gv,Xv]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[xt,Ue,Be]}],"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":[xt]}],"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":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"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":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"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":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"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":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"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":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"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":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"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":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ue,Be]}],"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":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":[xt]}],"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":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ue,Be]}],filter:[{filter:["","none",Ue,Be]}],blur:[{blur:se()}],brightness:[{brightness:[xt,Ue,Be]}],contrast:[{contrast:[xt,Ue,Be]}],"drop-shadow":[{"drop-shadow":["","none",v,Gv,Xv]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",xt,Ue,Be]}],"hue-rotate":[{"hue-rotate":[xt,Ue,Be]}],invert:[{invert:["",xt,Ue,Be]}],saturate:[{saturate:[xt,Ue,Be]}],sepia:[{sepia:["",xt,Ue,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,Be]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[xt,Ue,Be]}],"backdrop-contrast":[{"backdrop-contrast":[xt,Ue,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xt,Ue,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xt,Ue,Be]}],"backdrop-invert":[{"backdrop-invert":["",xt,Ue,Be]}],"backdrop-opacity":[{"backdrop-opacity":[xt,Ue,Be]}],"backdrop-saturate":[{"backdrop-saturate":[xt,Ue,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",xt,Ue,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ue,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xt,"initial",Ue,Be]}],ease:[{ease:["linear","initial",j,Ue,Be]}],delay:[{delay:[xt,Ue,Be]}],animate:[{animate:["none",C,Ue,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ue,Be]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],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:[Ue,Be,"","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:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",Ue,Be]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Ue,Be]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[xt,Kh,Eu,bD]}],stroke:[{stroke:["none",...I()]}],"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"]}},hoe=Vae(foe);function Te(...e){return hoe(Dt(e))}function yk({delayDuration:e=0,...t}){return h.jsx(xae,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function qF({...e}){return h.jsx(bae,{"data-slot":"tooltip",...e})}function VF({...e}){return h.jsx(wae,{"data-slot":"tooltip-trigger",...e})}function KF({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(Sae,{children:h.jsxs(jae,{"data-slot":"tooltip-content",sideOffset:t,className:Te("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,h.jsx(Eae,{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 YF=(...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 moe=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 poe=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 jD=e=>{const t=poe(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 goe={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 voe=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 yoe=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>y.createElement("svg",{ref:c,...goe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:YF("lucide",i),...!a&&!voe(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 Ge=(e,t)=>{const n=y.forwardRef(({className:r,...i},a)=>y.createElement(yoe,{ref:a,iconNode:t,className:YF(`lucide-${moe(jD(e))}`,`lucide-${e}`,r),...i}));return n.displayName=jD(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 xoe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],XF=Ge("arrow-down",xoe);/**
 * @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 boe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],B0=Ge("arrow-left",boe);/**
 * @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:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],ED=Ge("arrow-up-right",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 Soe=[["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"}]],Op=Ge("bot-message-square",Soe);/**
 * @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"}]],GF=Ge("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 Eoe=[["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"}]],WF=Ge("brain",Eoe);/**
 * @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 _oe=[["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"}]],Coe=Ge("calendar-clock",_oe);/**
 * @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 Noe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xk=Ge("check",Noe);/**
 * @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 koe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],df=Ge("chevron-down",koe);/**
 * @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 Aoe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ooe=Ge("chevron-left",Aoe);/**
 * @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 Toe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Tp=Ge("chevron-right",Toe);/**
 * @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 Poe=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Moe=Ge("chevron-up",Poe);/**
 * @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 Roe=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Doe=Ge("chevrons-up-down",Roe);/**
 * @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 Ioe=[["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"}]],da=Ge("circle-alert",Ioe);/**
 * @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 Loe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Pp=Ge("circle-check",Loe);/**
 * @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=[["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"}]],F0=Ge("circle-x",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 $oe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Boe=Ge("clock",$oe);/**
 * @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 Foe=[["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"}]],Uoe=Ge("copy",Foe);/**
 * @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 Hoe=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],nx=Ge("corner-down-left",Hoe);/**
 * @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:"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"}]],Mp=Ge("download",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 Voe=[["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"}]],U0=Ge("external-link",Voe);/**
 * @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 Koe=[["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"}]],Yoe=Ge("eye-off",Koe);/**
 * @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=[["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"}]],Goe=Ge("eye",Xoe);/**
 * @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:"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"}]],B_=Ge("folder-kanban",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:"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"}]],Zoe=Ge("folder-up",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 Joe=[["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"}]],ese=Ge("folder",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 tse=[["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"}]],nse=Ge("history",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:"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"}]],ise=Ge("house",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 ase=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ose=Ge("info",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 sse=[["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"}]],lse=Ge("key-round",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 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"}]],QF=Ge("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 cse=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pr=Ge("loader-circle",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 dse=[["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"}]],Rp=Ge("message-square",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=[["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"}]],hse=Ge("monitor",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 mse=[["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"}]],ZF=Ge("moon",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 pse=[["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"}]],JF=Ge("octagon-x",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 gse=[["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"}]],bk=Ge("paperclip",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 vse=[["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"}]],eU=Ge("pause",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:"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"}]],Dp=Ge("pencil",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:"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"}]],Ip=Ge("play",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:"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"}]],wse=Ge("plug",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 Sse=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lc=Ge("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 jse=[["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"}]],tU=Ge("save",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 Ese=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],wk=Ge("search",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 _se=[["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"}]],Cse=Ge("send",_se);/**
 * @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:"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"}]],H0=Ge("settings",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 kse=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Sk=Ge("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 Ase=[["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"}]],nU=Ge("sun",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:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Tse=Ge("terminal",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 Pse=[["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"}]],_a=Ge("trash-2",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 Mse=[["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"}]],Rse=Ge("triangle-alert",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 Dse=[["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"}]],q0=Ge("upload",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 Ise=[["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"}]],rU=Ge("users",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 Lse=[["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"}]],iU=Ge("wrench",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 zse=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uc=Ge("x",zse);function $se(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 Bse=e=>{switch(e){case"success":return Hse;case"info":return Vse;case"warning":return qse;case"error":return Kse;default:return null}},Fse=Array(12).fill(0),Use=({visible:e,className:t})=>Ce.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ce.createElement("div",{className:"sonner-spinner"},Fse.map((n,r)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Hse=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"})),qse=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"})),Vse=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"})),Kse=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"})),Yse=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"})),Xse=()=>{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 F_=1;class Gse{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:F_++,o=this.toasts.find(c=>c.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(c=>c.id===a?(this.publish({...c,...t,id:a,title:r}),{...c,...t,id:a,dismissible:l,title:r}):c):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(Qse(d)&&!d.ok){a=!1;const f=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 f=="object"&&!Ce.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:g,...b})}else if(d instanceof Error){a=!1;const f=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,b=typeof f=="object"&&!Ce.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:g,...b})}else if(n.success!==void 0){a=!1;const f=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,b=typeof f=="object"&&!Ce.isValidElement(f)?f:{message:f};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,f=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:f,...v})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>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:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||F_++;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 vi=new Gse,Wse=(e,t)=>{const n=(t==null?void 0:t.id)||F_++;return vi.addToast({title:e,...t,id:n}),n},Qse=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Zse=Wse,Jse=()=>vi.toasts,ele=()=>vi.getActiveToasts(),it=Object.assign(Zse,{success:vi.success,info:vi.info,warning:vi.warning,error:vi.error,custom:vi.custom,message:vi.message,promise:vi.promise,dismiss:vi.dismiss,loading:vi.loading},{getHistory:Jse,getToasts:ele});$se("[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 Wv(e){return e.label!==void 0}const tle=3,nle="24px",rle="16px",_D=4e3,ile=356,ale=14,ole=45,sle=200;function oo(...e){return e.filter(Boolean).join(" ")}function lle(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const ule=e=>{var t,n,r,i,a,o,l,c,d;const{invert:m,toast:f,unstyled:g,interacting:v,setHeights:b,visibleToasts:w,heights:S,index:j,toasts:C,expanded:_,removeToast:k,defaultRichColors:O,closeButton:A,style:T,cancelButtonStyle:P,actionButtonStyle:z,className:L="",descriptionClassName:F="",duration:D,position:X,gap:R,expandByDefault:q,classNames:$,icons:V,closeButtonAriaLabel:G="Close toast"}=e,[K,I]=Ce.useState(null),[H,U]=Ce.useState(null),[B,Q]=Ce.useState(!1),[Z,te]=Ce.useState(!1),[ae,re]=Ce.useState(!1),[ee,se]=Ce.useState(!1),[ge,ie]=Ce.useState(!1),[Se,Ee]=Ce.useState(0),[He,Oe]=Ce.useState(0),at=Ce.useRef(f.duration||D||_D),Je=Ce.useRef(null),We=Ce.useRef(null),zt=j===0,mt=j+1<=w,_t=f.type,Kt=f.dismissible!==!1,It=f.className||"",dn=f.descriptionClassName||"",ce=Ce.useMemo(()=>S.findIndex(Qe=>Qe.toastId===f.id)||0,[S,f.id]),be=Ce.useMemo(()=>{var Qe;return(Qe=f.closeButton)!=null?Qe:A},[f.closeButton,A]),Me=Ce.useMemo(()=>f.duration||D||_D,[f.duration,D]),et=Ce.useRef(0),tt=Ce.useRef(0),Gt=Ce.useRef(0),nn=Ce.useRef(null),[je,ut]=X.split("-"),wt=Ce.useMemo(()=>S.reduce((Qe,qt,me)=>me>=ce?Qe:Qe+qt.height,0),[S,ce]),ct=Xse(),Bn=f.invert||m,rn=_t==="loading";tt.current=Ce.useMemo(()=>ce*R+wt,[ce,wt]),Ce.useEffect(()=>{at.current=Me},[Me]),Ce.useEffect(()=>{Q(!0)},[]),Ce.useEffect(()=>{const Qe=We.current;if(Qe){const qt=Qe.getBoundingClientRect().height;return Oe(qt),b(me=>[{toastId:f.id,height:qt,position:f.position},...me]),()=>b(me=>me.filter(Ze=>Ze.toastId!==f.id))}},[b,f.id]),Ce.useLayoutEffect(()=>{if(!B)return;const Qe=We.current,qt=Qe.style.height;Qe.style.height="auto";const me=Qe.getBoundingClientRect().height;Qe.style.height=qt,Oe(me),b(Ze=>Ze.find(Ct=>Ct.toastId===f.id)?Ze.map(Ct=>Ct.toastId===f.id?{...Ct,height:me}:Ct):[{toastId:f.id,height:me,position:f.position},...Ze])},[B,f.title,f.description,b,f.id,f.jsx,f.action,f.cancel]);const hr=Ce.useCallback(()=>{te(!0),Ee(tt.current),b(Qe=>Qe.filter(qt=>qt.toastId!==f.id)),setTimeout(()=>{k(f)},sle)},[f,k,b,tt]);Ce.useEffect(()=>{if(f.promise&&_t==="loading"||f.duration===1/0||f.type==="loading")return;let Qe;return _||v||ct?(()=>{if(Gt.current<et.current){const Ze=new Date().getTime()-et.current;at.current=at.current-Ze}Gt.current=new Date().getTime()})():(()=>{at.current!==1/0&&(et.current=new Date().getTime(),Qe=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),hr()},at.current))})(),()=>clearTimeout(Qe)},[_,v,f,_t,ct,hr]),Ce.useEffect(()=>{f.delete&&(hr(),f.onDismiss==null||f.onDismiss.call(f,f))},[hr,f.delete]);function Xr(){var Qe;if(V!=null&&V.loading){var qt;return Ce.createElement("div",{className:oo($==null?void 0:$.loader,f==null||(qt=f.classNames)==null?void 0:qt.loader,"sonner-loader"),"data-visible":_t==="loading"},V.loading)}return Ce.createElement(Use,{className:oo($==null?void 0:$.loader,f==null||(Qe=f.classNames)==null?void 0:Qe.loader),visible:_t==="loading"})}const Rr=f.icon||(V==null?void 0:V[_t])||Bse(_t);var ai,Er;return Ce.createElement("li",{tabIndex:0,ref:We,className:oo(L,It,$==null?void 0:$.toast,f==null||(t=f.classNames)==null?void 0:t.toast,$==null?void 0:$.default,$==null?void 0:$[_t],f==null||(n=f.classNames)==null?void 0:n[_t]),"data-sonner-toast":"","data-rich-colors":(ai=f.richColors)!=null?ai:O,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":B,"data-promise":!!f.promise,"data-swiped":ge,"data-removed":Z,"data-visible":mt,"data-y-position":je,"data-x-position":ut,"data-index":j,"data-front":zt,"data-swiping":ae,"data-dismissible":Kt,"data-type":_t,"data-invert":Bn,"data-swipe-out":ee,"data-swipe-direction":H,"data-expanded":!!(_||q&&B),"data-testid":f.testId,style:{"--index":j,"--toasts-before":j,"--z-index":C.length-j,"--offset":`${Z?Se:tt.current}px`,"--initial-height":q?"auto":`${He}px`,...T,...f.style},onDragEnd:()=>{re(!1),I(null),nn.current=null},onPointerDown:Qe=>{Qe.button!==2&&(rn||!Kt||(Je.current=new Date,Ee(tt.current),Qe.target.setPointerCapture(Qe.pointerId),Qe.target.tagName!=="BUTTON"&&(re(!0),nn.current={x:Qe.clientX,y:Qe.clientY})))},onPointerUp:()=>{var Qe,qt,me;if(ee||!Kt)return;nn.current=null;const Ze=Number(((Qe=We.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),an=Number(((qt=We.current)==null?void 0:qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ct=new Date().getTime()-((me=Je.current)==null?void 0:me.getTime()),Pn=K==="x"?Ze:an,Gr=Math.abs(Pn)/Ct;if(Math.abs(Pn)>=ole||Gr>.11){Ee(tt.current),f.onDismiss==null||f.onDismiss.call(f,f),U(K==="x"?Ze>0?"right":"left":an>0?"down":"up"),hr(),se(!0);return}else{var mr,er;(mr=We.current)==null||mr.style.setProperty("--swipe-amount-x","0px"),(er=We.current)==null||er.style.setProperty("--swipe-amount-y","0px")}ie(!1),re(!1),I(null)},onPointerMove:Qe=>{var qt,me,Ze;if(!nn.current||!Kt||((qt=window.getSelection())==null?void 0:qt.toString().length)>0)return;const Ct=Qe.clientY-nn.current.y,Pn=Qe.clientX-nn.current.x;var Gr;const mr=(Gr=e.swipeDirections)!=null?Gr:lle(X);!K&&(Math.abs(Pn)>1||Math.abs(Ct)>1)&&I(Math.abs(Pn)>Math.abs(Ct)?"x":"y");let er={x:0,y:0};const eo=Wr=>1/(1.5+Math.abs(Wr)/20);if(K==="y"){if(mr.includes("top")||mr.includes("bottom"))if(mr.includes("top")&&Ct<0||mr.includes("bottom")&&Ct>0)er.y=Ct;else{const Wr=Ct*eo(Ct);er.y=Math.abs(Wr)<Math.abs(Ct)?Wr:Ct}}else if(K==="x"&&(mr.includes("left")||mr.includes("right")))if(mr.includes("left")&&Pn<0||mr.includes("right")&&Pn>0)er.x=Pn;else{const Wr=Pn*eo(Pn);er.x=Math.abs(Wr)<Math.abs(Pn)?Wr:Pn}(Math.abs(er.x)>0||Math.abs(er.y)>0)&&ie(!0),(me=We.current)==null||me.style.setProperty("--swipe-amount-x",`${er.x}px`),(Ze=We.current)==null||Ze.style.setProperty("--swipe-amount-y",`${er.y}px`)}},be&&!f.jsx&&_t!=="loading"?Ce.createElement("button",{"aria-label":G,"data-disabled":rn,"data-close-button":!0,onClick:rn||!Kt?()=>{}:()=>{hr(),f.onDismiss==null||f.onDismiss.call(f,f)},className:oo($==null?void 0:$.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(Er=V==null?void 0:V.close)!=null?Er:Yse):null,(_t||f.icon||f.promise)&&f.icon!==null&&((V==null?void 0:V[_t])!==null||f.icon)?Ce.createElement("div",{"data-icon":"",className:oo($==null?void 0:$.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Xr():null,f.type!=="loading"?Rr:null):null,Ce.createElement("div",{"data-content":"",className:oo($==null?void 0:$.content,f==null||(a=f.classNames)==null?void 0:a.content)},Ce.createElement("div",{"data-title":"",className:oo($==null?void 0:$.title,f==null||(o=f.classNames)==null?void 0:o.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?Ce.createElement("div",{"data-description":"",className:oo(F,dn,$==null?void 0:$.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),Ce.isValidElement(f.cancel)?f.cancel:f.cancel&&Wv(f.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||P,onClick:Qe=>{Wv(f.cancel)&&Kt&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Qe),hr())},className:oo($==null?void 0:$.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Ce.isValidElement(f.action)?f.action:f.action&&Wv(f.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||z,onClick:Qe=>{Wv(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Qe),!Qe.defaultPrevented&&hr())},className:oo($==null?void 0:$.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function CD(){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 cle(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?rle:nle;function c(d){["top","right","bottom","left"].forEach(m=>{n[`${o}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(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]}):c(l)}),n}const dle=Ce.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:m,mobileOffset:f,theme:g="light",richColors:v,duration:b,style:w,visibleToasts:S=tle,toastOptions:j,dir:C=CD(),gap:_=ale,icons:k,containerAriaLabel:O="Notifications"}=t,[A,T]=Ce.useState([]),P=Ce.useMemo(()=>r?A.filter(B=>B.toasterId===r):A.filter(B=>!B.toasterId),[A,r]),z=Ce.useMemo(()=>Array.from(new Set([a].concat(P.filter(B=>B.position).map(B=>B.position)))),[P,a]),[L,F]=Ce.useState([]),[D,X]=Ce.useState(!1),[R,q]=Ce.useState(!1),[$,V]=Ce.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=Ce.useRef(null),K=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=Ce.useRef(null),H=Ce.useRef(!1),U=Ce.useCallback(B=>{T(Q=>{var Z;return(Z=Q.find(te=>te.id===B.id))!=null&&Z.delete||vi.dismiss(B.id),Q.filter(({id:te})=>te!==B.id)})},[]);return Ce.useEffect(()=>vi.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(Z=>Z.id===B.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{sB.flushSync(()=>{T(Q=>{const Z=Q.findIndex(te=>te.id===B.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...B},...Q.slice(Z+1)]:[B,...Q]})})})}),[A]),Ce.useEffect(()=>{if(g!=="system"){V(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:Q})=>{V(Q?"dark":"light")})}catch{B.addListener(({matches:Z})=>{try{V(Z?"dark":"light")}catch(te){console.error(te)}})}},[g]),Ce.useEffect(()=>{A.length<=1&&X(!1)},[A]),Ce.useEffect(()=>{const B=Q=>{var Z;if(o.every(re=>Q[re]||Q.code===re)){var ae;X(!0),(ae=G.current)==null||ae.focus()}Q.code==="Escape"&&(document.activeElement===G.current||(Z=G.current)!=null&&Z.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[o]),Ce.useEffect(()=>{if(G.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,H.current=!1)}},[G.current]),Ce.createElement("section",{ref:n,"aria-label":`${O} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((B,Q)=>{var Z;const[te,ae]=B.split("-");return P.length?Ce.createElement("ol",{key:B,dir:C==="auto"?CD():C,tabIndex:-1,ref:G,className:d,"data-sonner-toaster":!0,"data-sonner-theme":$,"data-y-position":te,"data-x-position":ae,style:{"--front-toast-height":`${((Z=L[0])==null?void 0:Z.height)||0}px`,"--width":`${ile}px`,"--gap":`${_}px`,...w,...cle(m,f)},onBlur:re=>{H.current&&!re.currentTarget.contains(re.relatedTarget)&&(H.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||H.current||(H.current=!0,I.current=re.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{R||X(!1)},onDragEnd:()=>X(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},P.filter(re=>!re.position&&Q===0||re.position===B).map((re,ee)=>{var se,ge;return Ce.createElement(ule,{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:(ge=j==null?void 0:j.closeButton)!=null?ge:c,interacting:R,position:B,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:U,toasts:P.filter(ie=>ie.position==re.position),heights:L.filter(ie=>ie.position==re.position),setHeights:F,expandByDefault:l,gap:_,expanded:D,swipeDirections:t.swipeDirections})})):null}))}),fle=({...e})=>{const{theme:t="system"}=kN();return h.jsx(dle,{theme:t,className:"toaster group",icons:{success:h.jsx(Pp,{className:"size-4"}),info:h.jsx(ose,{className:"size-4"}),warning:h.jsx(Rse,{className:"size-4"}),error:h.jsx(JF,{className:"size-4"}),loading:h.jsx(Pr,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},hle=new sJ({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),aU="/api";class oU extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function Yh(e,t){const n=`${aU}${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 oU(a.status,a.statusText,o)}if(!(a.status===204||a.headers.get("content-length")==="0"))return a.json()}async function mle(e,t){const n=`${aU}${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 oU(a.status,a.statusText,o)}return a.json()}const Pe={get:e=>Yh(e),post:(e,t)=>Yh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Yh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Yh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Yh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),mle(e,n)}},Ae={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:["integrations"],detail:e=>["integrations",e],config:e=>["integrations",e,"config"]}};function Oc(){return On({queryKey:Ae.projects.all,queryFn:()=>Pe.get("/projects")})}function jk(e,t){return On({queryKey:Ae.projects.detail(e),queryFn:()=>Pe.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function V0(e){return On({queryKey:Ae.projects.files(e),queryFn:()=>Pe.get(`/projects/${e}/files`)})}function Ek(e,t){return On({queryKey:Ae.projects.config(e),queryFn:()=>Pe.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function rx(e,t){return hJ({queryKey:Ae.conversations.detail(e),queryFn:({pageParam:n})=>Pe.get(`/conversations/${e}?limit=20${n?`&before_id=${encodeURIComponent(n)}`:""}`),initialPageParam:null,getPreviousPageParam:n=>{var r;return n.has_more?((r=n.sessions[0])==null?void 0:r.run_id)??null:null},getNextPageParam:()=>null,...t})}function ple(e=10){return On({queryKey:["conversations","recent",e],queryFn:()=>Pe.get(`/conversations/recent?limit=${e}`)})}function K0(){return On({queryKey:["imu","conversations"],queryFn:()=>Pe.get("/imu/conversations")})}function _k(e,t=1,n=20){return On({queryKey:[...Ae.conversations.all(e),t,n],queryFn:()=>Pe.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function sU(){const e=lt();return yt({mutationFn:t=>Pe.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ae.conversations.all(n.project_id)})}})}function lU(e){const t=lt();return yt({mutationFn:n=>Pe.post(`/conversations/${e}/tasks`,n),onSuccess:(n,r)=>{n.queued&&t.setQueryData(Ae.conversations.detail(e),i=>{if(!i)return i;const a=i.pages.map((o,l)=>{if(l!==i.pages.length-1)return o;const c=o.pending_task||"",d=c?`${c}

${r.task}`:r.task;return{...o,pending_task:d}});return{...i,pages:a}}),t.invalidateQueries({queryKey:Ae.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["imu","conversations"]})}})}function Ck(e){const t=lt();return yt({mutationFn:({conversationId:n,title:r})=>Pe.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:Ae.conversations.all(e)}),t.invalidateQueries({queryKey:Ae.conversations.detail(r)})}})}function uU(e){const t=lt();return yt({mutationFn:()=>Pe.delete(`/conversations/${e}/pending_task`),onSuccess:()=>{t.invalidateQueries({queryKey:Ae.conversations.detail(e)})}})}function cU(){const e=lt();return yt({mutationFn:()=>Pe.post("/imu/conversations",{}),onSuccess:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function Nk(){const e=lt();return yt({mutationFn:({conversationId:t,title:n})=>Pe.patch(`/conversations/${t}`,{title:n}),onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["imu","conversations"]}),e.invalidateQueries({queryKey:Ae.conversations.detail(n)})}})}function dU(){const e=lt();return yt({mutationFn:t=>Pe.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:Ae.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 fU(e){const t=lt();return yt({mutationFn:n=>Pe.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:Ae.conversations.all(e)});const r=t.getQueryData(Ae.conversations.all(e));return t.setQueryData(Ae.conversations.all(e),i=>i&&{...i,items:i.items.filter(a=>a.id!==n),total:i.total-1}),t.removeQueries({queryKey:Ae.conversations.detail(n)}),{previous:r}},onError:(n,r,i)=>{i!=null&&i.previous&&t.setQueryData(Ae.conversations.all(e),i.previous)},onSettled:()=>{t.invalidateQueries({queryKey:Ae.conversations.all(e)})}})}function Xe({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:Te("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 gle=500;function vle({onCommandPalette:e,onShortcutsHelp:t}){const n=Sa(),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},gle);return}}}}return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),clearTimeout(i.current)}},[n,e,t])}function hU(e){const t=e?"?"+new URLSearchParams(e).toString():"";return On({queryKey:Ae.sessions.all(e),queryFn:()=>Pe.get(`/sessions${t}`)})}function kk(){return hU({status:"running",per_page:"50"})}function yle(){return hU({per_page:"10"})}function mU(e,t=1,n=20){return On({queryKey:[...Ae.projects.sessions(e),t,n],queryFn:()=>Pe.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function xle(e,t,n){return On({queryKey:Ae.sessions.detail(e,t),queryFn:()=>Pe.get(`/projects/${e}/sessions/${t}`),...n})}var ND=1,ble=.9,wle=.8,Sle=.17,FS=.1,US=.999,jle=.9999,Ele=.99,_le=/[\\\/_+.#"@\[\(\{&]/,Cle=/[\\\/_+.#"@\[\(\{&]/g,Nle=/[\s-]/,pU=/[\s-]/g;function U_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?ND:Ele;var l=`${i},${a}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(a),d=n.indexOf(c,i),m=0,f,g,v,b;d>=0;)f=U_(e,t,n,r,d+1,a+1,o),f>m&&(d===i?f*=ND:_le.test(e.charAt(d-1))?(f*=wle,v=e.slice(i,d-1).match(Cle),v&&i>0&&(f*=Math.pow(US,v.length))):Nle.test(e.charAt(d-1))?(f*=ble,b=e.slice(i,d-1).match(pU),b&&i>0&&(f*=Math.pow(US,b.length))):(f*=Sle,i>0&&(f*=Math.pow(US,d-i))),e.charAt(d)!==t.charAt(a)&&(f*=jle)),(f<FS&&n.charAt(d-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(d-1)!==r.charAt(a))&&(g=U_(e,t,n,r,d+1,a+2,o),g*FS>f&&(f=g*FS)),f>m&&(m=f),d=n.indexOf(c,d+1);return o[l]=m,m}function kD(e){return e.toLowerCase().replace(pU," ")}function kle(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,U_(e,t,kD(e),kD(t),0,0,{})}var Xh='[cmdk-group=""]',HS='[cmdk-group-items=""]',Ale='[cmdk-group-heading=""]',gU='[cmdk-item=""]',AD=`${gU}:not([aria-disabled="true"])`,H_="cmdk-item-select",Td="data-value",Ole=(e,t,n)=>kle(e,t,n),vU=y.createContext(void 0),Lp=()=>y.useContext(vU),yU=y.createContext(void 0),Ak=()=>y.useContext(yU),xU=y.createContext(void 0),bU=y.forwardRef((e,t)=>{let n=Pd(()=>{var U,B;return{search:"",value:(B=(U=e.value)!=null?U:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Pd(()=>new Set),i=Pd(()=>new Map),a=Pd(()=>new Map),o=Pd(()=>new Set),l=wU(e),{label:c,children:d,value:m,onValueChange:f,filter:g,shouldFilter:v,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...j}=e,C=br(),_=br(),k=br(),O=y.useRef(null),A=Fle();cc(()=>{if(m!==void 0){let U=m.trim();n.current.value=U,T.emit()}},[m]),cc(()=>{A(6,X)},[]);let T=y.useMemo(()=>({subscribe:U=>(o.current.add(U),()=>o.current.delete(U)),snapshot:()=>n.current,setState:(U,B,Q)=>{var Z,te,ae,re;if(!Object.is(n.current[U],B)){if(n.current[U]=B,U==="search")D(),L(),A(1,F);else if(U==="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=R())==null?void 0:ee.id,T.emit()}),Q||A(5,X),((te=l.current)==null?void 0:te.value)!==void 0){let ee=B??"";(re=(ae=l.current).onValueChange)==null||re.call(ae,ee);return}}T.emit()}},emit:()=>{o.current.forEach(U=>U())}}),[]),P=y.useMemo(()=>({value:(U,B,Q)=>{var Z;B!==((Z=a.current.get(U))==null?void 0:Z.value)&&(a.current.set(U,{value:B,keywords:Q}),n.current.filtered.items.set(U,z(B,Q)),A(2,()=>{L(),T.emit()}))},item:(U,B)=>(r.current.add(U),B&&(i.current.has(B)?i.current.get(B).add(U):i.current.set(B,new Set([U]))),A(3,()=>{D(),L(),n.current.value||F(),T.emit()}),()=>{a.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let Q=R();A(4,()=>{D(),(Q==null?void 0:Q.getAttribute("id"))===U&&F(),T.emit()})}),group:U=>(i.current.has(U)||i.current.set(U,new Set),()=>{a.current.delete(U),i.current.delete(U)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:C,inputId:k,labelId:_,listInnerRef:O}),[]);function z(U,B){var Q,Z;let te=(Z=(Q=l.current)==null?void 0:Q.filter)!=null?Z:Ole;return U?te(U,n.current.search,B):0}function L(){if(!n.current.search||l.current.shouldFilter===!1)return;let U=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(Z=>{let te=i.current.get(Z),ae=0;te.forEach(re=>{let ee=U.get(re);ae=Math.max(ee,ae)}),B.push([Z,ae])});let Q=O.current;q().sort((Z,te)=>{var ae,re;let ee=Z.getAttribute("id"),se=te.getAttribute("id");return((ae=U.get(se))!=null?ae:0)-((re=U.get(ee))!=null?re:0)}).forEach(Z=>{let te=Z.closest(HS);te?te.appendChild(Z.parentElement===te?Z:Z.closest(`${HS} > *`)):Q.appendChild(Z.parentElement===Q?Z:Z.closest(`${HS} > *`))}),B.sort((Z,te)=>te[1]-Z[1]).forEach(Z=>{var te;let ae=(te=O.current)==null?void 0:te.querySelector(`${Xh}[${Td}="${encodeURIComponent(Z[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function F(){let U=q().find(Q=>Q.getAttribute("aria-disabled")!=="true"),B=U==null?void 0:U.getAttribute(Td);T.setState("value",B||void 0)}function D(){var U,B,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=(B=(U=a.current.get(ae))==null?void 0:U.value)!=null?B:"",ee=(Z=(Q=a.current.get(ae))==null?void 0:Q.keywords)!=null?Z:[],se=z(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 X(){var U,B,Q;let Z=R();Z&&(((U=Z.parentElement)==null?void 0:U.firstChild)===Z&&((Q=(B=Z.closest(Xh))==null?void 0:B.querySelector(Ale))==null||Q.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function R(){var U;return(U=O.current)==null?void 0:U.querySelector(`${gU}[aria-selected="true"]`)}function q(){var U;return Array.from(((U=O.current)==null?void 0:U.querySelectorAll(AD))||[])}function $(U){let B=q()[U];B&&T.setState("value",B.getAttribute(Td))}function V(U){var B;let Q=R(),Z=q(),te=Z.findIndex(re=>re===Q),ae=Z[te+U];(B=l.current)!=null&&B.loop&&(ae=te+U<0?Z[Z.length-1]:te+U===Z.length?Z[0]:Z[te+U]),ae&&T.setState("value",ae.getAttribute(Td))}function G(U){let B=R(),Q=B==null?void 0:B.closest(Xh),Z;for(;Q&&!Z;)Q=U>0?$le(Q,Xh):Ble(Q,Xh),Z=Q==null?void 0:Q.querySelector(AD);Z?T.setState("value",Z.getAttribute(Td)):V(U)}let K=()=>$(q().length-1),I=U=>{U.preventDefault(),U.metaKey?K():U.altKey?G(1):V(1)},H=U=>{U.preventDefault(),U.metaKey?$(0):U.altKey?G(-1):V(-1)};return y.createElement(Ve.div,{ref:t,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:U=>{var B;(B=j.onKeyDown)==null||B.call(j,U);let Q=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||Q))switch(U.key){case"n":case"j":{S&&U.ctrlKey&&I(U);break}case"ArrowDown":{I(U);break}case"p":case"k":{S&&U.ctrlKey&&H(U);break}case"ArrowUp":{H(U);break}case"Home":{U.preventDefault(),$(0);break}case"End":{U.preventDefault(),K();break}case"Enter":{U.preventDefault();let Z=R();if(Z){let te=new Event(H_);Z.dispatchEvent(te)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:Hle},c),Y0(e,U=>y.createElement(yU.Provider,{value:T},y.createElement(vU.Provider,{value:P},U))))}),Tle=y.forwardRef((e,t)=>{var n,r;let i=br(),a=y.useRef(null),o=y.useContext(xU),l=Lp(),c=wU(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;cc(()=>{if(!d)return l.item(i,o==null?void 0:o.id)},[d]);let m=SU(i,a,[e.value,e.children,a],e.keywords),f=Ak(),g=Hl(A=>A.value&&A.value===m.current),v=Hl(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(H_,b),()=>A.removeEventListener(H_,b)},[v,e.onSelect,e.disabled]);function b(){var A,T;w(),(T=(A=c.current).onSelect)==null||T.call(A,m.current)}function w(){f.setState("value",m.current,!0)}if(!v)return null;let{disabled:S,value:j,onSelect:C,forceMount:_,keywords:k,...O}=e;return y.createElement(Ve.div,{ref:gs(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)}),Ple=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=br(),l=y.useRef(null),c=y.useRef(null),d=br(),m=Lp(),f=Hl(v=>i||m.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);cc(()=>m.group(o),[]),SU(o,l,[e.value,e.heading,c]);let g=y.useMemo(()=>({id:o,forceMount:i}),[i]);return y.createElement(Ve.div,{ref:gs(l,t),...a,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&y.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Y0(e,v=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},y.createElement(xU.Provider,{value:g},v))))}),Mle=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=y.useRef(null),a=Hl(o=>!o.search);return!n&&!a?null:y.createElement(Ve.div,{ref:gs(i,t),...r,"cmdk-separator":"",role:"separator"})}),Rle=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Ak(),o=Hl(d=>d.search),l=Hl(d=>d.selectedItemId),c=Lp();return y.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),y.createElement(Ve.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:i?e.value:o,onChange:d=>{i||a.setState("search",d.target.value),n==null||n(d.target.value)}})}),Dle=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=y.useRef(null),o=y.useRef(null),l=Hl(d=>d.selectedItemId),c=Lp();return y.useEffect(()=>{if(o.current&&a.current){let d=o.current,m=a.current,f,g=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let v=d.offsetHeight;m.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(f),g.unobserve(d)}}},[]),y.createElement(Ve.div,{ref:gs(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Y0(e,d=>y.createElement("div",{ref:gs(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),Ile=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return y.createElement($N,{open:n,onOpenChange:r},y.createElement(BN,{container:o},y.createElement(FN,{"cmdk-overlay":"",className:i}),y.createElement(UN,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(bU,{ref:t,...l}))))}),Lle=y.forwardRef((e,t)=>Hl(n=>n.filtered.count===0)?y.createElement(Ve.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),zle=y.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return y.createElement(Ve.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Y0(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),$f=Object.assign(bU,{List:Dle,Item:Tle,Input:Rle,Group:Ple,Separator:Mle,Dialog:Ile,Empty:Lle,Loading:zle});function $le(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ble(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function wU(e){let t=y.useRef(e);return cc(()=>{t.current=e}),t}var cc=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Pd(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Hl(e){let t=Ak(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function SU(e,t,n,r=[]){let i=y.useRef(),a=Lp();return cc(()=>{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}})(),c=r.map(d=>d.trim());a.value(e,l,c),(o=t.current)==null||o.setAttribute(Td,l),i.current=l}),i}var Fle=()=>{let[e,t]=y.useState(),n=Pd(()=>new Map);return cc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function Ule(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Y0({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(Ule(t),{ref:t.ref},n(t.props.children)):n(t)}var Hle={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const OD=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TD=Dt,X0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return TD(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],f=a==null?void 0:a[d];if(m===null)return null;const g=OD(m)||OD(f);return i[d][g]}),l=n&&Object.entries(n).reduce((d,m)=>{let[f,g]=m;return g===void 0||(d[f]=g),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:f,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,f,g]:d},[]);return TD(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},qle=X0("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 xe({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const a=r?AN:"button";return h.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:Te(qle({variant:t,size:n,className:e})),...i})}function Xa({...e}){return h.jsx($N,{"data-slot":"dialog",...e})}function Vle({...e}){return h.jsx(BN,{"data-slot":"dialog-portal",...e})}function Kle({className:e,...t}){return h.jsx(FN,{"data-slot":"dialog-overlay",className:Te("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 Ga({className:e,children:t,showCloseButton:n=!0,...r}){return h.jsxs(Vle,{"data-slot":"dialog-portal",children:[h.jsx(Kle,{}),h.jsxs(UN,{"data-slot":"dialog-content",className:Te("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&&h.jsxs(HN,{"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:[h.jsx(uc,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Wa({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:Te("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Ok({className:e,showCloseButton:t=!1,children:n,...r}){return h.jsxs("div",{"data-slot":"dialog-footer",className:Te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&h.jsx(HN,{asChild:!0,children:h.jsx(xe,{variant:"outline",children:"Close"})})]})}function Qa({className:e,...t}){return h.jsx(s6,{"data-slot":"dialog-title",className:Te("text-lg leading-none font-semibold",e),...t})}function Tk({className:e,...t}){return h.jsx(l6,{"data-slot":"dialog-description",className:Te("text-sm text-muted-foreground",e),...t})}function Yle({className:e,...t}){return h.jsx($f,{"data-slot":"command",className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function Xle({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!0,...a}){return h.jsxs(Xa,{...a,children:[h.jsxs(Wa,{className:"sr-only",children:[h.jsx(Qa,{children:e}),h.jsx(Tk,{children:t})]}),h.jsx(Ga,{className:Te("overflow-hidden p-0",r),showCloseButton:i,children:h.jsx(Yle,{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 Gle({className:e,...t}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[h.jsx(wk,{className:"size-4 shrink-0 opacity-50"}),h.jsx($f.Input,{"data-slot":"command-input",className:Te("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 Wle({className:e,...t}){return h.jsx($f.List,{"data-slot":"command-list",className:Te("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Qle({...e}){return h.jsx($f.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Gh({className:e,...t}){return h.jsx($f.Group,{"data-slot":"command-group",className:Te("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 Pa({className:e,...t}){return h.jsx($f.Item,{"data-slot":"command-item",className:Te("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 PD({className:e,...t}){return h.jsx("span",{"data-slot":"command-shortcut",className:Te("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function Zle({open:e,onOpenChange:t}){var d;const n=Sa(),{setTheme:r}=kN(),i=Oc(),a=kk(),o=i.data??[],l=((d=a.data)==null?void 0:d.items)??[],c=m=>{t(!1),n(m)};return h.jsxs(Xle,{open:e,onOpenChange:t,showCloseButton:!1,children:[h.jsx(Gle,{placeholder:"Type a command or search..."}),h.jsxs(Wle,{children:[h.jsx(Qle,{children:"No results found."}),h.jsxs(Gh,{heading:"Navigation",children:[h.jsxs(Pa,{onSelect:()=>c("/"),children:[h.jsx(QF,{}),"Dashboard",h.jsx(PD,{children:"G D"})]}),h.jsxs(Pa,{onSelect:()=>c("/projects"),children:[h.jsx(B_,{}),"Projects",h.jsx(PD,{children:"G P"})]})]}),o.length>0&&h.jsx(Gh,{heading:"Projects",children:o.map(m=>h.jsxs(Pa,{onSelect:()=>c(`/projects/${m.id}`),children:[h.jsx(B_,{}),m.display_name]},m.id))}),l.length>0&&h.jsx(Gh,{heading:"Running Sessions",children:l.map(m=>h.jsxs(Pa,{onSelect:()=>c(`/projects/${m.project_id}/sessions/${m.run_id}`),children:[h.jsx(Ip,{}),m.role," (",m.run_id.slice(0,8),")"]},m.run_id))}),h.jsxs(Gh,{heading:"Resources",children:[h.jsxs(Pa,{onSelect:()=>c("/resources/roles"),children:[h.jsx(rU,{}),"Roles"]}),h.jsxs(Pa,{onSelect:()=>c("/resources/skills"),children:[h.jsx(iU,{}),"Skills"]}),h.jsxs(Pa,{onSelect:()=>c("/resources/agents"),children:[h.jsx(GF,{}),"Agents"]}),h.jsxs(Pa,{onSelect:()=>c("/resources/memories"),children:[h.jsx(WF,{}),"Memory"]})]}),h.jsxs(Gh,{heading:"Theme",children:[h.jsxs(Pa,{onSelect:()=>{r("light"),t(!1)},children:[h.jsx(nU,{}),"Light"]}),h.jsxs(Pa,{onSelect:()=>{r("dark"),t(!1)},children:[h.jsx(ZF,{}),"Dark"]}),h.jsxs(Pa,{onSelect:()=>{r("system"),t(!1)},children:[h.jsx(hse,{}),"System"]})]})]})]})}const Jle=[{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 eue({open:e,onOpenChange:t}){return h.jsx(Xa,{open:e,onOpenChange:t,children:h.jsxs(Ga,{className:"max-w-sm",children:[h.jsx(Wa,{children:h.jsx(Qa,{children:"Keyboard Shortcuts"})}),h.jsx("div",{className:"space-y-2",children:Jle.map(n=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:n.description}),h.jsx("div",{className:"flex gap-1",children:n.keys.map(r=>h.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 tue({...e}){return h.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function nue({className:e,...t}){return h.jsx("ol",{"data-slot":"breadcrumb-list",className:Te("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function rue({className:e,...t}){return h.jsx("li",{"data-slot":"breadcrumb-item",className:Te("inline-flex items-center gap-1.5",e),...t})}function iue({asChild:e,className:t,...n}){const r=e?AN:"a";return h.jsx(r,{"data-slot":"breadcrumb-link",className:Te("transition-colors hover:text-foreground",t),...n})}function aue({className:e,...t}){return h.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Te("font-normal text-foreground",e),...t})}function oue({children:e,className:t,...n}){return h.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Te("[&>svg]:size-3.5",t),...n,children:e??h.jsx(Tp,{})})}function ff({...e}){return h.jsx(zre,{"data-slot":"dropdown-menu",...e})}function hf({...e}){return h.jsx($re,{"data-slot":"dropdown-menu-trigger",...e})}function mf({className:e,sideOffset:t=4,...n}){return h.jsx(Bre,{children:h.jsx(Fre,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Te("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 ym({className:e,inset:t,variant:n="default",...r}){return h.jsx(Ure,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Te("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 Pk({className:e,children:t,checked:n,...r}){return h.jsxs(Hre,{"data-slot":"dropdown-menu-checkbox-item",className:Te("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:[h.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:h.jsx(qre,{children:h.jsx(xk,{className:"size-4"})})}),t]})}function jl({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return h.jsx(Vie,{"data-slot":"separator",decorative:n,orientation:t,className:Te("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 sue=[{to:"/imu",label:"Bot Imu",icon:Op},{to:"/dashboard",label:"Dashboard",icon:QF,end:!0},{to:"/projects",label:"Projects",icon:B_},{to:"/settings",label:"Settings",icon:H0}],lue=[{to:"/schedules/runs",label:"Run History",icon:nse},{to:"/schedules/recurring",label:"Recurring",icon:Boe},{to:"/schedules/one-time",label:"One-Time",icon:Coe}],uue=[{to:"/resources/roles",label:"Roles",icon:rU},{to:"/resources/skills",label:"Skills",icon:iU},{to:"/resources/agents",label:"Agents",icon:GF},{to:"/resources/memories",label:"Memory",icon:WF},{to:"/integrations",label:"Integrations",icon:wse}];function cue({conv:e,projectId:t,isActive:n,navigate:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(!1),[c,d]=y.useState(!1),[m,f]=y.useState(""),g=y.useRef(null),v=Ck(t),b=fU(t),w=j=>{j.stopPropagation(),j.preventDefault(),f(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?h.jsx("div",{className:"px-1",children:h.jsx(Xe,{ref:g,value:m,onChange:j=>f(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"})}):h.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:Te("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:[h.jsx("button",{onClick:()=>r(`/projects/${t}/conversations/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:h.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),c?h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.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"}),h.jsx("button",{onClick:j=>{j.stopPropagation(),d(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):h.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:o?1:0},children:[h.jsx("button",{onClick:w,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:h.jsx(Dp,{className:"h-3 w-3"})}),!n&&h.jsx("button",{onClick:j=>{j.stopPropagation(),d(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:h.jsx(_a,{className:"h-3 w-3"})})]})]})}function due({conv:e,isActive:t,navigate:n}){const[r,i]=y.useState(!1),[a,o]=y.useState(!1),[l,c]=y.useState(!1),[d,m]=y.useState(""),f=y.useRef(null),g=Nk(),v=dU(),b=S=>{S.stopPropagation(),S.preventDefault(),m(e.title??""),i(!0),setTimeout(()=>{var j;return(j=f.current)==null?void 0:j.focus()},0)},w=()=>{const S=d.trim();g.mutate({conversationId:e.id,title:S||null}),i(!1)};return r?h.jsx("div",{className:"px-1",children:h.jsx(Xe,{ref:f,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"})}):h.jsxs("div",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:Te("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:[h.jsx("button",{onClick:()=>n(`/imu/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:h.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),l?h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx("button",{onClick:S=>{S.stopPropagation(),v.mutate(e.id),c(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:v.isPending,children:"Delete"}),h.jsx("button",{onClick:S=>{S.stopPropagation(),c(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):h.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:a?1:0},children:[h.jsx("button",{onClick:b,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:h.jsx(Dp,{className:"h-3 w-3"})}),!t&&h.jsx("button",{onClick:S=>{S.stopPropagation(),c(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:h.jsx(_a,{className:"h-3 w-3"})})]})]})}function fue({conversationId:e}){const t=Sa(),n=K0(),r=cU();return h.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[h.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:h.jsx(lr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),h.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[h.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:[h.jsx(B0,{className:"h-4 w-4 shrink-0"}),h.jsx(Op,{className:"h-4 w-4 shrink-0"}),h.jsx("span",{className:"truncate",children:"Bot Imu"})]}),h.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),h.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:h.jsx(lc,{className:"h-3.5 w-3.5"})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(n.data??[]).map(i=>h.jsx(due,{conv:i,isActive:i.id===e,navigate:t},i.id))})]})]})}function hue({projectId:e,conversationId:t}){var o,l;const n=Sa(),r=_k(e,1,50),i=sU(),a=jk(e);return h.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[h.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:h.jsx(lr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),h.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[h.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:[h.jsx(B0,{className:"h-4 w-4 shrink-0"}),h.jsx("span",{className:"truncate",children:((o=a.data)==null?void 0:o.display_name)??"Back to Project"})]}),h.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),h.jsx("button",{onClick:()=>i.mutate({project_id:e},{onSuccess:c=>n(`/projects/${e}/conversations/${c.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:h.jsx(lc,{className:"h-3.5 w-3.5"})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(((l=r.data)==null?void 0:l.items)??[]).map(c=>h.jsx(cue,{conv:c,projectId:e,isActive:c.id===t,navigate:n},c.id))})]})]})}function mue(){var f,g;const t=wa().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}=jk(n,{enabled:n>0}),{data:a}=_k(n,1,50),o=((f=a==null?void 0:a.items.find(v=>v.id===r))==null?void 0:f.title)??null,l=t[0]==="imu"&&t[1]?Number(t[1]):0,{data:c}=K0(),d=((g=c==null?void 0:c.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,projectSwitcher:!0}),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 pue(){const e=mue(),t=Sa(),n=Oc(),{data:r}=K0(),i=(r??[]).some(S=>S.active_session_count>0),{setTheme:a}=kN(),[o,l]=y.useState(!1),[c,d]=y.useState(!1),m=jS("/projects/:projectId/conversations/:conversationId"),f=m?Number(m.params.projectId):0,g=m?Number(m.params.conversationId):0,v=jS("/imu/:conversationId"),b=v?Number(v.params.conversationId):0,w=jS("/projects/0/sessions/:runId");return vle({onCommandPalette:()=>l(!0),onShortcutsHelp:()=>d(!0)}),h.jsxs("div",{className:"flex h-screen",children:[m?h.jsx(hue,{projectId:f,conversationId:g}):v?h.jsx(fue,{conversationId:b}):h.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[h.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:h.jsx(lr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),h.jsxs("nav",{className:"flex flex-col gap-1 p-3",children:[sue.map(({to:S,label:j,icon:C,end:_})=>h.jsxs(Ny,{to:S,end:_,className:({isActive:k})=>Te("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",(k||S==="/imu"&&!!w)&&!(S==="/projects"&&w)?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[h.jsx(C,{className:"h-4 w-4"}),j,S==="/imu"&&i&&h.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-green-500 animate-pulse"})]},S)),h.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Schedules"}),lue.map(({to:S,label:j,icon:C})=>h.jsxs(Ny,{to:S,className:({isActive:_})=>Te("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",_?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[h.jsx(C,{className:"h-4 w-4"}),j]},S)),h.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),uue.map(({to:S,label:j,icon:C})=>h.jsxs(Ny,{to:S,className:({isActive:_})=>Te("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",_?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[h.jsx(C,{className:"h-4 w-4"}),j]},S))]})]}),h.jsxs("div",{className:"flex flex-1 flex-col",children:[h.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border px-6",children:[h.jsx(tue,{children:h.jsx(nue,{children:e.map((S,j)=>{const C=j===e.length-1;return h.jsxs(rue,{children:[j>0&&h.jsx(oue,{}),S.projectSwitcher?h.jsxs(ff,{children:[h.jsxs(hf,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[S.label,h.jsx(Doe,{className:"h-3 w-3 text-muted-foreground"})]}),h.jsx(mf,{align:"start",children:(n.data??[]).map(_=>h.jsxs(ym,{onClick:()=>t(`/projects/${_.id}`),children:[S.href===`/projects/${_.id}`?h.jsx(xk,{className:"mr-2 h-3.5 w-3.5"}):h.jsx("span",{className:"mr-2 inline-block w-3.5"}),_.display_name]},_.id))})]}):C?h.jsx(aue,{children:S.label}):h.jsx(iue,{href:S.href,children:S.label})]},S.label)})})}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("button",{onClick:()=>l(!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:h.jsx("kbd",{className:"font-mono",children:"⌘K"})}),h.jsxs(ff,{children:[h.jsx(hf,{asChild:!0,children:h.jsxs(xe,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[h.jsx(nU,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),h.jsx(ZF,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),h.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),h.jsxs(mf,{align:"end",children:[h.jsx(ym,{onClick:()=>a("light"),children:"Light"}),h.jsx(ym,{onClick:()=>a("dark"),children:"Dark"}),h.jsx(ym,{onClick:()=>a("system"),children:"System"})]})]})]})]}),h.jsx(jl,{}),h.jsx("main",{className:"flex-1 overflow-auto p-6",children:h.jsx(ZQ,{})})]}),h.jsx(Zle,{open:o,onOpenChange:l}),h.jsx(eue,{open:c,onOpenChange:d})]})}function gue(){const e=lt();return yt({mutationFn:t=>Pe.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ae.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function Mk(){const e=lt();return yt({mutationFn:t=>Pe.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function vue(){const e=lt();return yt({mutationFn:t=>Pe.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const yue=X0("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 ft({className:e,variant:t="default",asChild:n=!1,...r}){const i=n?AN:"span";return h.jsx(i,{"data-slot":"badge","data-variant":t,className:Te(yue({variant:t}),e),...r})}function fa({className:e,...t}){return h.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:h.jsx("table",{"data-slot":"table",className:Te("w-full caption-bottom text-sm",e),...t})})}function ha({className:e,...t}){return h.jsx("thead",{"data-slot":"table-header",className:Te("[&_tr]:border-b",e),...t})}function ma({className:e,...t}){return h.jsx("tbody",{"data-slot":"table-body",className:Te("[&_tr:last-child]:border-0",e),...t})}function yn({className:e,...t}){return h.jsx("tr",{"data-slot":"table-row",className:Te("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function Fe({className:e,...t}){return h.jsx("th",{"data-slot":"table-head",className:Te("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 ze({className:e,...t}){return h.jsx("td",{"data-slot":"table-cell",className:Te("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ix({sessions:e,projectNames:t}){return h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Run ID"}),t&&h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Role"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{children:"Started"}),h.jsx(Fe,{children:"Duration"}),h.jsx(Fe,{children:"Task"}),h.jsx(Fe,{className:"w-[80px]"})]})}),h.jsx(ma,{children:e.map(n=>h.jsxs(yn,{children:[h.jsx(ze,{children:h.jsx(lr,{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&&h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${n.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:t.get(n.project_id)??`#${n.project_id}`})}),h.jsx(ze,{className:"text-sm",children:n.role}),h.jsx(ze,{children:h.jsx(xue,{status:n.status})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:ax(n.started_at)}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:G0(n.duration_ms)}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:n.user_task??n.task??"—"}),h.jsx(ze,{children:h.jsx(bue,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function xue({status:e}){const t=jU(e);return h.jsxs(ft,{variant:"outline",className:Te("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&h.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}const MD=jU;function jU(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function ax(e){try{return new Date(e).toLocaleString()}catch{return e}}function G0(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 bue({runId:e,disabled:t}){const[n,r]=y.useState(!1),i=vue(),a=async()=>{try{await i.mutateAsync(e)}catch{}};return n?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(xe,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):h.jsx(xe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:h.jsx(_a,{className:"h-4 w-4"})})}function Nn({className:e,...t}){return h.jsx("div",{"data-slot":"card",className:Te("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function Wh({className:e,...t}){return h.jsx("div",{"data-slot":"card-header",className:Te("@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 Qh({className:e,...t}){return h.jsx("div",{"data-slot":"card-title",className:Te("leading-none font-semibold",e),...t})}function kn({className:e,...t}){return h.jsx("div",{"data-slot":"card-content",className:Te("px-6",e),...t})}const qS=1e4;function wue(e,t,n){const[r,i]=y.useState([]),[a,o]=y.useState(!1),[l,c]=y.useState(!1),d=y.useRef(null),m=y.useRef(void 0),f=y.useRef(1e3),g=y.useRef("");return y.useEffect(()=>{if(!t)return;const v=`${e}:${t}`;g.current!==v&&(i([]),c(!1),g.current=v);function b(){const w=new EventSource(`/api/sessions/${e}/logs/${t}`);d.current=w,w.onopen=()=>{o(!0),f.current=1e3},w.addEventListener("snapshot",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&i(j.lines.slice(-qS))}catch{}}),w.addEventListener("append",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&j.lines.length>0&&i(C=>{const _=[...C,...j.lines];return _.length>qS?_.slice(-qS):_})}catch{}}),w.addEventListener("done",()=>{c(!0),w.close(),d.current=null}),w.onerror=()=>{w.close(),d.current=null,o(!1),m.current=setTimeout(()=>{f.current=Math.min(f.current*2,15e3),b()},f.current)}}return b(),()=>{var w;(w=d.current)==null||w.close(),d.current=null,m.current&&clearTimeout(m.current)}},[e,t,n]),{lines:r,connected:a,done:l}}const Sue=5e3;function jue({runId:e,projectId:t,agentId:n,role:r,runtime:i,startedAt:a}){const{lines:o,done:l}=wue(e,n,!0),c=o.slice(-4),[d,m]=y.useState("");y.useEffect(()=>{const w=new Date(a).getTime(),S=()=>{const C=Date.now()-w,_=Math.floor(C/1e3)%60,k=Math.floor(C/6e4)%60,O=Math.floor(C/36e5);m(O>0?`${O}h ${k}m`:`${k}m ${_}s`)};S();const j=setInterval(S,1e3);return()=>clearInterval(j)},[a]);const f=y.useRef(o.length),g=y.useRef(Date.now()),[v,b]=y.useState(!1);return y.useEffect(()=>{o.length!==f.current&&(f.current=o.length,g.current=Date.now(),b(!1))},[o.length]),y.useEffect(()=>{const w=setInterval(()=>{Date.now()-g.current>Sue&&b(!0)},1e3);return()=>clearInterval(w)},[]),h.jsx(Nn,{className:"overflow-hidden",children:h.jsxs(kn,{className:"space-y-2 pt-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l?"bg-muted-foreground":v?"bg-green-300":"animate-pulse bg-green-500"}`}),h.jsx("span",{className:"font-medium text-sm",children:r})]}),h.jsx(ft,{variant:"outline",className:"text-xs",children:i.replace("strawpot-","")})]}),h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Session: ",e.slice(0,12)]}),h.jsx("span",{children:"·"}),h.jsx("span",{children:d})]}),h.jsx("div",{className:"rounded bg-[#1e1e1e] px-2 py-1.5 font-mono text-[11px] leading-[16px] text-[#d4d4d4]",children:c.length>0?c.map((w,S)=>h.jsxs("div",{className:"truncate",children:[h.jsx("span",{className:"text-[#666]",children:"> "}),w]},S)):h.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),h.jsx("div",{className:"flex justify-end",children:h.jsxs(lr,{to:`/projects/${t}/sessions/${e}?tab=logs`,className:"inline-flex items-center gap-0.5 text-xs text-primary hover:underline",children:["View Session",h.jsx(Tp,{className:"h-3 w-3"})]})})]})})}const VS=8;function Eue(){var o;const t=((o=kk().data)==null?void 0:o.items)??[],n=fJ({queries:t.slice(0,VS).map(l=>({queryKey:Ae.sessions.detail(l.project_id,l.run_id),queryFn:()=>Pe.get(`/projects/${l.project_id}/sessions/${l.run_id}`),staleTime:1e4}))}),r=[];for(const l of n){if(!l.data)continue;const c=l.data;for(const[d,m]of Object.entries(c.agents))r.push({runId:c.run_id,projectId:c.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,VS),a=r.length-VS;return h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Active Agents (",r.length,")"]}),h.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:i.map(l=>h.jsx(jue,{runId:l.runId,projectId:l.projectId,agentId:l.agentId,role:l.role,runtime:l.runtime,startedAt:l.startedAt},`${l.runId}:${l.agentId}`))}),a>0&&h.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",a," more agent",a!==1?"s":""," running"]})]})}function ln({className:e,...t}){return h.jsx("div",{"data-slot":"skeleton",className:Te("animate-pulse rounded-md bg-accent",e),...t})}function _ue(){return h.jsxs("div",{className:"space-y-8",children:[h.jsx(ln,{className:"h-8 w-40"}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(ln,{className:"h-4 w-24"}),h.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:[1,2,3].map(e=>h.jsx(ln,{className:"h-28 rounded-lg"},e))})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(ln,{className:"h-4 w-32"}),h.jsx(ln,{className:"h-48 rounded-lg"})]})]})}function Cue(){var f,g;const e=Oc(),t=kk(),n=yle(),r=ple(10),i=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(i)return h.jsx(_ue,{});if(a)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",a.message]})]});const o=e.data??[],l=((f=t.data)==null?void 0:f.items)??[],c=((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 h.jsxs("div",{className:"space-y-8",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),h.jsx(Eue,{}),h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",o.length,")"]}),o.length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Directory"}),h.jsx(Fe,{children:"Status"})]})}),h.jsxs(ma,{children:[o.slice(0,10).map(v=>h.jsxs(yn,{children:[h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.display_name})}),h.jsx(ze,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:v.working_dir}),h.jsx(ze,{children:h.jsxs("div",{className:"flex gap-1.5",children:[!v.dir_exists&&h.jsx(ft,{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&&h.jsxs(ft,{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:[h.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&&h.jsx(yn,{children:h.jsx(ze,{colSpan:3,className:"text-center",children:h.jsxs(lr,{to:"/projects",className:"text-sm text-muted-foreground underline-offset-4 hover:underline",children:["+",o.length-10," more — view all projects"]})})})]})]})})})]}),l.length>0&&h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",l.length,")"]}),h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsx(ix,{sessions:l,projectNames:d})})})]}),(r.data??[]).length>0&&h.jsxs("section",{className:"space-y-3",children:[h.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Conversations"}),h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Title"}),h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Sessions"}),h.jsx(Fe,{children:"Last Activity"})]})}),h.jsx(ma,{children:(r.data??[]).map(v=>h.jsxs(yn,{children:[h.jsx(ze,{children:h.jsx(lr,{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}`})}),h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${v.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:v.project_name})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:v.session_count}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:v.last_activity?new Date(v.last_activity).toLocaleString():"—"})]},v.id))})]})})})]}),h.jsxs("section",{className:"space-y-3",children:[h.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),c.length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsx(ix,{sessions:c,projectNames:d})})})]})]})}function EU(){return On({queryKey:Ae.config.global,queryFn:()=>Pe.get("/config/global")})}function Nue(){const e=lt();return yt({mutationFn:t=>Pe.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.projects.all})}})}function kue(){const e=lt();return yt({mutationFn:t=>Pe.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.projects.all})}})}function Aue(){const e=lt();return yt({mutationFn:({projectId:t,files:n})=>Pe.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ae.projects.files(n.projectId)})}})}function Oue(){const e=lt();return yt({mutationFn:({projectId:t,filePath:n})=>Pe.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ae.projects.files(n.projectId)})}})}function Tue(){const e=lt();return yt({mutationFn:t=>Pe.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(Ae.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:Ae.config.global})}})}function _U(){const e=lt();return yt({mutationFn:({projectId:t,data:n})=>Pe.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData(Ae.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:Ae.projects.config(n.projectId)})}})}function zp({className:e,children:t,...n}){return h.jsxs(iie,{"data-slot":"scroll-area",className:Te("relative",e),...n,children:[h.jsx(aie,{"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}),h.jsx(Pue,{}),h.jsx(oie,{})]})}function Pue({className:e,orientation:t="vertical",...n}){return h.jsx(j8,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Te("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:h.jsx(N8,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function Mue({initialPath:e,onSelect:t,onCancel:n}){const[r,i]=y.useState(null),[a,o]=y.useState(!0),[l,c]=y.useState(null),[d,m]=y.useState(null),f=v=>{o(!0),c(null);const b=v?`?path=${encodeURIComponent(v)}`:"";Pe.get(`/fs/browse${b}`).then(i).catch(w=>c(w.message??"Failed to browse")).finally(()=>o(!1))},g=async()=>{if(!(!r||!(d!=null&&d.trim())))try{const v=await Pe.post("/fs/mkdir",{path:r.path,name:d.trim()});m(null),f(v.path)}catch(v){c(v instanceof Error?v.message:"Failed to create folder")}};return y.useEffect(()=>{f(e||void 0)},[]),h.jsx(Xa,{open:!0,onOpenChange:v=>!v&&n(),children:h.jsxs(Ga,{className:"sm:max-w-[480px]",children:[h.jsx(Wa,{children:h.jsx(Qa,{children:"Select Directory"})}),r&&h.jsx("div",{className:"break-all rounded-md bg-muted px-3 py-1.5 font-mono text-xs",children:r.path}),l&&h.jsx("p",{className:"text-sm text-destructive",children:l}),a&&!r?h.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Loading..."}):h.jsx(zp,{className:"h-[300px]",children:h.jsxs("div",{className:"space-y-0.5",children:[(r==null?void 0:r.parent)&&h.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>f(r.parent),children:[h.jsx(Zoe,{className:"h-4 w-4"}),".."]}),r==null?void 0:r.entries.map(v=>h.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>f(v.path),children:[h.jsx(ese,{className:"h-4 w-4"}),v.name]},v.path)),(r==null?void 0:r.entries.length)===0&&h.jsx("p",{className:"px-3 py-4 text-sm italic text-muted-foreground",children:"No subdirectories"})]})}),h.jsx(Ok,{children:d!==null?h.jsxs("div",{className:"flex w-full gap-2",children:[h.jsx(Xe,{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"}),h.jsx(xe,{size:"sm",onClick:g,children:"Create"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:()=>m(null),children:"Cancel"})]}):h.jsxs(h.Fragment,{children:[h.jsx(xe,{variant:"outline",onClick:()=>m(""),disabled:!r,children:"New Folder"}),h.jsx("div",{className:"flex-1"}),h.jsx(xe,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),h.jsx(xe,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function st({className:e,...t}){return h.jsx(Kre,{"data-slot":"label",className:Te("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 pa({...e}){return h.jsx(Oie,{"data-slot":"select",...e})}function ga({...e}){return h.jsx(Pie,{"data-slot":"select-value",...e})}function va({className:e,size:t="default",children:n,...r}){return h.jsxs(Tie,{"data-slot":"select-trigger","data-size":t,className:Te("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,h.jsx(Mie,{asChild:!0,children:h.jsx(df,{className:"size-4 opacity-50"})})]})}function ya({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return h.jsx(Rie,{children:h.jsxs(Die,{"data-slot":"select-content",className:Te("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:[h.jsx(Rue,{}),h.jsx(Iie,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),h.jsx(Due,{})]})})}function An({className:e,children:t,...n}){return h.jsxs(Lie,{"data-slot":"select-item",className:Te("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:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx($ie,{children:h.jsx(xk,{className:"size-4"})})}),h.jsx(zie,{children:t})]})}function Rue({className:e,...t}){return h.jsx(Bie,{"data-slot":"select-scroll-up-button",className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(Moe,{className:"size-4"})})}function Due({className:e,...t}){return h.jsx(Fie,{"data-slot":"select-scroll-down-button",className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(df,{className:"size-4"})})}function Iue(){const{data:e,isLoading:t,error:n}=Oc(),[r,i]=y.useState(!1);if(t)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-32"}),h.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",n.message]})]});const a=e??[];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Projects"}),h.jsxs(xe,{onClick:()=>i(!0),children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&h.jsx(Lue,{onDone:()=>i(!1),onCancel:()=>i(!1)}),a.length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered yet."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Directory"}),h.jsx(Fe,{children:"Created"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{className:"w-[80px]"})]})}),h.jsx(ma,{children:a.map(o=>h.jsxs(yn,{children:[h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${o.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:o.display_name})}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:o.working_dir}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:$ue(o.created_at)}),h.jsx(ze,{children:o.dir_exists?h.jsx(ft,{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"}):h.jsx(ft,{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"})}),h.jsx(ze,{children:h.jsx(zue,{projectId:o.id})})]},o.id))})]})})})]})}function Lue({onDone:e,onCancel:t}){var P,z,L;const[n,r]=y.useState(""),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,d]=y.useState(""),[m,f]=y.useState(!1),[g,v]=y.useState(!1),b=Nue(),w=_U(),j=(P=EU().data)==null?void 0:P.defaults,C=(j==null?void 0:j.isolation)??"none",_=((z=j==null?void 0:j.session)==null?void 0:z.merge_strategy)??"auto",k=o||C,O=async()=>{const F=await b.mutateAsync({display_name:n.trim(),working_dir:i.trim()}),D={},X=c||_;D.isolation=k,D.session={merge_strategy:X},await w.mutateAsync({projectId:F.id,data:D}),e()},A=async F=>{F.preventDefault();try{if(k==="worktree"&&i.trim()&&!(await Pe.get(`/fs/git-check?path=${encodeURIComponent(i.trim())}`)).is_git){v(!0);return}await O()}catch{}},T=async()=>{try{await Pe.post("/fs/git-init",{path:i.trim()}),v(!1),await O()}catch{}};return h.jsx(Nn,{children:h.jsx(kn,{className:"pt-6",children:h.jsxs("form",{onSubmit:A,className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"display-name",children:"Display Name"}),h.jsx(Xe,{id:"display-name",value:n,onChange:F=>r(F.target.value),required:!0,autoFocus:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"working-dir",children:"Working Directory"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Xe,{id:"working-dir",value:i,onChange:F=>a(F.target.value),placeholder:"/path/to/project",required:!0}),h.jsx(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!m),children:"Browse"})]})]})]}),m&&h.jsx(Mue,{initialPath:i||void 0,onSelect:F=>{a(F),f(!1)},onCancel:()=>f(!1)}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"isolation",children:"Isolation"}),h.jsxs(pa,{value:o||C,onValueChange:l,children:[h.jsx(va,{id:"isolation",children:h.jsx(ga,{})}),h.jsxs(ya,{children:[h.jsx(An,{value:"none",children:"none"}),h.jsx(An,{value:"worktree",children:"worktree"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"merge-strategy",children:"Merge Strategy"}),h.jsxs(pa,{value:c||_,onValueChange:d,children:[h.jsx(va,{id:"merge-strategy",children:h.jsx(ga,{})}),h.jsxs(ya,{children:[h.jsx(An,{value:"auto",children:"auto"}),h.jsx(An,{value:"local",children:"local"}),h.jsx(An,{value:"pr",children:"pr"})]})]})]})]}),g&&h.jsxs("div",{className:"rounded-md border border-orange-200 bg-orange-50 p-3 dark:border-orange-800 dark:bg-orange-950",children:[h.jsxs("p",{className:"text-sm",children:["The selected directory is not a git repository. Worktree isolation requires git. Initialize a git repository with ",h.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"git init"}),"?"]}),h.jsxs("div",{className:"mt-2 flex gap-2",children:[h.jsx(xe,{type:"button",size:"sm",onClick:T,children:"Yes, initialize"}),h.jsx(xe,{type:"button",size:"sm",variant:"outline",onClick:()=>v(!1),children:"Cancel"})]})]}),(b.error||w.error)&&h.jsx("p",{className:"text-sm text-destructive",children:(L=b.error||w.error)==null?void 0:L.message}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(xe,{type:"submit",disabled:b.isPending||w.isPending,children:b.isPending||w.isPending?"Adding...":"Add"}),h.jsx(xe,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function zue({projectId:e}){const[t,n]=y.useState(!1),r=kue(),i=async()=>{try{await r.mutateAsync(e)}catch{}};return t?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(xe,{size:"sm",variant:"destructive",onClick:i,disabled:r.isPending,children:"Confirm"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):h.jsx(xe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:h.jsx(_a,{className:"h-4 w-4"})})}function $ue(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function Bf(e){return On({queryKey:Ae.projects.resources(e),queryFn:()=>Pe.get(`/projects/${e}/resources`)})}function Bue(e,t,n,r){return On({queryKey:Ae.projects.resourceDetail(e,t,n),queryFn:()=>Pe.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function Fue(e,t,n,r){return On({queryKey:Ae.projects.resourceConfig(e,t,n),queryFn:()=>Pe.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function Uue(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 Rk({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=Uue(e,t);return h.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[h.jsx(xe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:h.jsx(Ooe,{className:"h-4 w-4"})}),r.map((i,a)=>i==="..."?h.jsx("span",{className:"px-1 text-sm text-muted-foreground",children:"..."},`ellipsis-${a}`):h.jsx(xe,{variant:i===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(i),children:i},i)),h.jsx(xe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:h.jsx(Tp,{className:"h-4 w-4"})})]})}function CU(e,t,n){return On({queryKey:Ae.registry.config(e,t),queryFn:()=>Pe.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function Eo({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:Te("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 $p({...e}){return h.jsx(qJ,{"data-slot":"collapsible",...e})}function Bp({...e}){return h.jsx(MB,{"data-slot":"collapsible-trigger",...e})}function Fp({...e}){return h.jsx(RB,{"data-slot":"collapsible-content",...e})}function Hue({projectId:e,open:t,onOpenChange:n}){var be,Me,et,tt,Gt,nn;const r=Sa(),i=Ek(e),{data:a}=Bf(e),o=V0(e),l=gue(),c=(be=i.data)==null?void 0:be.merged,d="__empty__",[m,f]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,_]=y.useState(""),[k,O]=y.useState(""),[A,T]=y.useState(""),[P,z]=y.useState(""),[L,F]=y.useState(""),[D,X]=y.useState(!1),[R,q]=y.useState([]),[$,V]=y.useState(!1),[G,K]=y.useState(""),[I,H]=y.useState(!1),[U,B]=y.useState(!1),Q=lt(),Z=()=>{f(""),v(""),w(""),j(""),_(""),O(""),T(""),z(""),F(""),X(!1),q([]),V(!1)},te=je=>{je.preventDefault(),H(!0)},ae=je=>{je.preventDefault(),H(!0)},re=je=>{je.preventDefault(),H(!1)},ee=async je=>{je.preventDefault(),H(!1);const ut=Array.from(je.dataTransfer.files);if(ut.length){B(!0);try{const wt=await Pe.upload(`/projects/${e}/files`,ut);Q.invalidateQueries({queryKey:Ae.projects.files(e)}),q(ct=>{const Bn=wt.map(rn=>rn.path).filter(rn=>!ct.includes(rn));return[...ct,...Bn]})}catch{}finally{B(!1)}}},se=je=>{q(ut=>ut.includes(je)?ut.filter(wt=>wt!==je):[...ut,je])},ge=async je=>{je.preventDefault();try{const ut={project_id:e,task:m.trim()};g.trim()&&(ut.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())),P.trim()&&(wt.max_num_delegations=Number(P.trim())),Object.keys(wt).length>0&&(ut.overrides=wt),R.length>0&&(ut.context_files=R),L.trim()&&(ut.system_prompt=L.trim()),D&&(ut.interactive=!0);const ct=await l.mutateAsync(ut);Z(),n(!1),r(`/projects/${e}/sessions/${ct.run_id}`)}catch{}},ie=(c==null?void 0:c.orchestrator_role)??"orchestrator",Ee=(a??[]).filter(je=>je.type==="roles").map(je=>je.name).filter(je=>je!==ie),He=[ie,...Ee],Oe=(a??[]).filter(je=>je.type==="agents").map(je=>je.name),at=new Set((a??[]).filter(je=>je.type==="memories").map(je=>je.name));at.add("none");const Je=[...at].sort(),We=g.trim()||ie,zt=CU("roles",We,{enabled:!!We}),mt=((et=(Me=zt.data)==null?void 0:Me.params_values)==null?void 0:et.default_agent)??((nn=(Gt=(tt=zt.data)==null?void 0:tt.params_schema)==null?void 0:Gt.default_agent)==null?void 0:nn.default)??"",_t=mt&&Oe.includes(mt)?mt:(c==null?void 0:c.runtime)??"strawpot-claude-code",Kt=g.trim()&&!He.includes(g.trim())?"Role not found in installed roles":"",It=b.trim()&&Oe.length>0&&!Oe.includes(b.trim())?"Runtime not found in installed agents":"",dn=S.trim()&&!Je.includes(S.trim())?"Memory not found in installed providers":"",ce=!!Kt||!!It||!!dn;return h.jsx(Xa,{open:t,onOpenChange:n,children:h.jsxs(Ga,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[h.jsx(Wa,{children:h.jsx(Qa,{children:"Launch Session"})}),h.jsxs("form",{onSubmit:ge,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(st,{htmlFor:"task",children:["Task ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs("div",{className:"relative",onDragOver:te,onDragEnter:ae,onDragLeave:re,onDrop:ee,children:[h.jsx(Eo,{id:"task",value:m,onChange:je=>f(je.target.value),placeholder:"Describe what the agent should do… (drag & drop files to attach)",required:!0,autoFocus:!0,rows:3}),(I||U)&&h.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?h.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[h.jsx(Pr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):h.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[h.jsx(q0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]})]}),(o.data??[]).length>0&&h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(ff,{children:[h.jsx(hf,{asChild:!0,children:h.jsxs(xe,{type:"button",variant:"outline",size:"sm",children:[h.jsx(bk,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),h.jsxs(mf,{align:"start",className:"w-64",onCloseAutoFocus:je=>je.preventDefault(),children:[h.jsx("div",{className:"px-2 py-1.5",children:h.jsx(Xe,{placeholder:"Filter files...",value:G,onChange:je=>K(je.target.value),className:"h-7 text-xs",onKeyDown:je=>je.stopPropagation()})}),h.jsx("div",{className:"max-h-48 overflow-y-auto",children:(o.data??[]).filter(je=>je.path.toLowerCase().includes(G.toLowerCase())).map(je=>h.jsx(Pk,{checked:R.includes(je.path),onCheckedChange:()=>se(je.path),onSelect:ut=>ut.preventDefault(),children:h.jsx("span",{className:"font-mono text-xs",children:je.path})},je.path))})]})]}),R.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[R.length," file(s) attached"]})]}),R.length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1",children:[($?R:R.slice(0,3)).map(je=>h.jsxs(ft,{variant:"secondary",className:"max-w-[200px] gap-1 font-mono text-xs",children:[h.jsx("button",{type:"button",onClick:()=>se(je),className:"mr-0.5 shrink-0 rounded-sm hover:bg-muted",children:h.jsx(uc,{className:"h-3 w-3"})}),h.jsxs("span",{className:"truncate",children:["@",je]})]},je)),!$&&R.length>3&&h.jsxs("button",{type:"button",onClick:()=>V(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",R.length-3," more"]}),$&&R.length>3&&h.jsx("button",{type:"button",onClick:()=>V(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"role",children:"Role"}),h.jsx(Xe,{id:"role",list:"datalist-role",value:g,onChange:je=>v(je.target.value),placeholder:ie}),h.jsxs("datalist",{id:"datalist-role",children:[h.jsx("option",{value:ie}),Ee.map(je=>h.jsx("option",{value:je},je))]}),Kt&&h.jsx("p",{className:"text-xs text-destructive",children:Kt})]}),h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[h.jsx("input",{type:"checkbox",checked:D,onChange:je=>X(je.target.checked),className:"rounded border-input"}),h.jsx("span",{className:"text-sm",children:"Interactive mode"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Allow the agent to ask you questions via a chat panel"})]}),h.jsxs($p,{children:[h.jsx(Bp,{asChild:!0,children:h.jsxs(xe,{type:"button",variant:"ghost",size:"sm",children:[h.jsx(df,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),h.jsxs(Fp,{className:"mt-3 space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"runtime",children:"Runtime"}),h.jsx(Xe,{id:"runtime",list:"datalist-runtime",value:b,onChange:je=>w(je.target.value),placeholder:_t}),Oe.length>0&&h.jsx("datalist",{id:"datalist-runtime",children:Oe.map(je=>h.jsx("option",{value:je},je))}),It&&h.jsx("p",{className:"text-xs text-destructive",children:It})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"memory",children:"Memory"}),h.jsx(Xe,{id:"memory",list:"datalist-memory",value:S,onChange:je=>j(je.target.value),placeholder:(c==null?void 0:c.memory)||"dial"}),h.jsx("datalist",{id:"datalist-memory",children:Je.map(je=>h.jsx("option",{value:je},je))}),dn&&h.jsx("p",{className:"text-xs text-destructive",children:dn})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"system-prompt",children:"System Prompt"}),h.jsx(Eo,{id:"system-prompt",value:L,onChange:je=>F(je.target.value),placeholder:"Additional instructions for the agent...",rows:3})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Max Delegations"}),h.jsx(Xe,{type:"number",min:"0",value:P,onChange:je=>z(je.target.value),placeholder:c!=null&&c.max_num_delegations?String(c.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache Delegations"}),h.jsxs(pa,{value:C||d,onValueChange:je=>_(je===d?"":je),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:(c==null?void 0:c.cache_delegations)!==!1?"true":"false"})}),h.jsxs(ya,{children:[h.jsxs(An,{value:d,className:"text-muted-foreground",children:["Default (",(c==null?void 0:c.cache_delegations)!==!1?"true":"false",")"]}),h.jsx(An,{value:"true",children:"true"}),h.jsx(An,{value:"false",children:"false"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache Max Entries"}),h.jsx(Xe,{type:"number",min:"0",value:k,onChange:je=>O(je.target.value),placeholder:c!=null&&c.cache_max_entries?String(c.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache TTL (seconds)"}),h.jsx(Xe,{type:"number",min:"0",value:A,onChange:je=>T(je.target.value),placeholder:c!=null&&c.cache_ttl_seconds?String(c.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]})]}),l.error&&h.jsx("p",{className:"text-sm text-destructive",children:l.error.message}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(xe,{type:"submit",disabled:l.isPending||ce,children:l.isPending?"Launching...":"Launch"}),h.jsx(xe,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function que(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function NU({projectId:e}){const t=V0(e),n=Aue(),r=Oue(),i=y.useRef(null),[a,o]=y.useState(!1),[l,c]=y.useState(null),d=y.useCallback(j=>{const C=Array.from(j);C.length!==0&&n.mutate({projectId:e,files:C},{onSuccess:()=>it.success(`Uploaded ${C.length} file(s)`),onError:()=>it.error("Upload failed")})},[e,n]),m=y.useCallback(j=>{j.preventDefault(),o(!1),d(j.dataTransfer.files)},[d]),f=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:()=>{it.success("File deleted"),c(null)},onError:()=>{it.error("Failed to delete file"),c(null)}})},[e,r]),S=t.data??[];return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{onDrop:m,onDragOver:f,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:[h.jsx(q0,{className:"h-8 w-8 text-muted-foreground"}),h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Drag & drop files here, or"," ",h.jsx("button",{type:"button",onClick:v,className:"font-medium text-primary underline-offset-4 hover:underline",children:"browse"})]}),n.isPending&&h.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploading..."}),h.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:b})]}),S.length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{className:"w-24",children:"Size"}),h.jsx(Fe,{className:"w-44",children:"Modified"}),h.jsx(Fe,{className:"w-28"})]})}),h.jsx(ma,{children:S.map(j=>h.jsxs(yn,{children:[h.jsx(ze,{className:"font-mono text-xs",children:j.path}),h.jsx(ze,{className:"text-xs text-muted-foreground",children:que(j.size)}),h.jsx(ze,{className:"text-xs text-muted-foreground",children:new Date(j.modified_at).toLocaleString()}),h.jsx(ze,{children:l===j.path?h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:()=>w(j.path),disabled:r.isPending,className:"text-xs text-destructive hover:text-destructive/80 font-medium",children:"Confirm"}),h.jsx("button",{type:"button",onClick:()=>c(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):h.jsx("div",{className:"flex justify-end",children:h.jsx(xe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(j.path),disabled:r.isPending,children:h.jsx(_a,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},j.path))})]})})})]})}function Up({className:e,orientation:t="horizontal",...n}){return h.jsx(eae,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Te("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const Vue=X0("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 Hp({className:e,variant:t="default",...n}){return h.jsx(tae,{"data-slot":"tabs-list","data-variant":t,className:Te(Vue({variant:t}),e),...n})}function or({className:e,...t}){return h.jsx(nae,{"data-slot":"tabs-trigger",className:Te("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 sr({className:e,...t}){return h.jsx(rae,{"data-slot":"tabs-content",className:Te("flex-1 outline-none",e),...t})}function Kue(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yue=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xue=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gue={};function RD(e,t){return(Gue.jsx?Xue:Yue).test(e)}const Wue=/[ \t\n\f\r]/g;function Que(e){return typeof e=="object"?e.type==="text"?DD(e.value):!1:DD(e)}function DD(e){return e.replace(Wue,"")===""}class qp{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qp.prototype.normal={};qp.prototype.property={};qp.prototype.space=void 0;function kU(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qp(n,r,t)}function q_(e){return e.toLowerCase()}class bi{constructor(t,n){this.attribute=n,this.property=t}}bi.prototype.attribute="";bi.prototype.booleanish=!1;bi.prototype.boolean=!1;bi.prototype.commaOrSpaceSeparated=!1;bi.prototype.commaSeparated=!1;bi.prototype.defined=!1;bi.prototype.mustUseProperty=!1;bi.prototype.number=!1;bi.prototype.overloadedBoolean=!1;bi.prototype.property="";bi.prototype.spaceSeparated=!1;bi.prototype.space=void 0;let Zue=0;const vt=Tc(),Xn=Tc(),V_=Tc(),_e=Tc(),fn=Tc(),Fd=Tc(),Ai=Tc();function Tc(){return 2**++Zue}const K_=Object.freeze(Object.defineProperty({__proto__:null,boolean:vt,booleanish:Xn,commaOrSpaceSeparated:Ai,commaSeparated:Fd,number:_e,overloadedBoolean:V_,spaceSeparated:fn},Symbol.toStringTag,{value:"Module"})),KS=Object.keys(K_);class Dk extends bi{constructor(t,n,r,i){let a=-1;if(super(t,n),ID(this,"space",i),typeof r=="number")for(;++a<KS.length;){const o=KS[a];ID(this,KS[a],(r&K_[o])===K_[o])}}}Dk.prototype.defined=!0;function ID(e,t,n){n&&(e[t]=n)}function Ff(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Dk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[q_(r)]=r,n[q_(a.attribute)]=r}return new qp(t,n,e.space)}const AU=Ff({properties:{ariaActiveDescendant:null,ariaAtomic:Xn,ariaAutoComplete:null,ariaBusy:Xn,ariaChecked:Xn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:fn,ariaCurrent:null,ariaDescribedBy:fn,ariaDetails:null,ariaDisabled:Xn,ariaDropEffect:fn,ariaErrorMessage:null,ariaExpanded:Xn,ariaFlowTo:fn,ariaGrabbed:Xn,ariaHasPopup:null,ariaHidden:Xn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:fn,ariaLevel:_e,ariaLive:null,ariaModal:Xn,ariaMultiLine:Xn,ariaMultiSelectable:Xn,ariaOrientation:null,ariaOwns:fn,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:Xn,ariaReadOnly:Xn,ariaRelevant:null,ariaRequired:Xn,ariaRoleDescription:fn,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:Xn,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 OU(e,t){return t in e?e[t]:t}function TU(e,t){return OU(e,t.toLowerCase())}const Jue=Ff({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fd,acceptCharset:fn,accessKey:fn,action:null,allow:null,allowFullScreen:vt,allowPaymentRequest:vt,allowUserMedia:vt,alt:null,as:null,async:vt,autoCapitalize:null,autoComplete:fn,autoFocus:vt,autoPlay:vt,blocking:fn,capture:null,charSet:null,checked:vt,cite:null,className:fn,cols:_e,colSpan:null,content:null,contentEditable:Xn,controls:vt,controlsList:fn,coords:_e|Fd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:vt,defer:vt,dir:null,dirName:null,disabled:vt,download:V_,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:vt,formTarget:null,headers:fn,height:_e,hidden:V_,high:_e,href:null,hrefLang:null,htmlFor:fn,httpEquiv:fn,id:null,imageSizes:null,imageSrcSet:null,inert:vt,inputMode:null,integrity:null,is:null,isMap:vt,itemId:null,itemProp:fn,itemRef:fn,itemScope:vt,itemType:fn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:vt,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:vt,muted:vt,name:null,nonce:null,noModule:vt,noValidate:vt,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:vt,optimum:_e,pattern:null,ping:fn,placeholder:null,playsInline:vt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:vt,referrerPolicy:null,rel:fn,required:vt,reversed:vt,rows:_e,rowSpan:_e,sandbox:fn,scope:null,scoped:vt,seamless:vt,selected:vt,shadowRootClonable:vt,shadowRootDelegatesFocus:vt,shadowRootMode:null,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:Xn,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:vt,useMap:null,value:Xn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:fn,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:vt,declare:vt,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:vt,noHref:vt,noShade:vt,noWrap:vt,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:Xn,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:vt,disableRemotePlayback:vt,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:TU}),ece=Ff({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:Ai,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:fn,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:vt,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:Fd,g2:Fd,glyphName:Fd,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:Ai,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:fn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ai,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ai,rev:Ai,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ai,requiredFeatures:Ai,requiredFonts:Ai,requiredFormats:Ai,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:Ai,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:Ai,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:Ai,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:OU}),PU=Ff({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()}}),MU=Ff({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:TU}),RU=Ff({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),tce={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"},nce=/[A-Z]/g,LD=/-[a-z]/g,rce=/^data[-\w.:]+$/i;function ice(e,t){const n=q_(t);let r=t,i=bi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rce.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(LD,oce);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!LD.test(a)){let o=a.replace(nce,ace);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Dk}return new i(r,t)}function ace(e){return"-"+e.toLowerCase()}function oce(e){return e.charAt(1).toUpperCase()}const sce=kU([AU,Jue,PU,MU,RU],"html"),Ik=kU([AU,ece,PU,MU,RU],"svg");function lce(e){return e.join(" ").trim()}var bd={},YS,zD;function uce(){if(zD)return YS;zD=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
`,d="/",m="*",f="",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,_=1;function k(R){var q=R.match(t);q&&(C+=q.length);var $=R.lastIndexOf(c);_=~$?R.length-$:_+R.length}function O(){var R={line:C,column:_};return function(q){return q.position=new A(R),z(),q}}function A(R){this.start=R,this.end={line:C,column:_},this.source=j.source}A.prototype.content=S;function T(R){var q=new Error(j.source+":"+C+":"+_+": "+R);if(q.reason=R,q.filename=j.source,q.line=C,q.column=_,q.source=S,!j.silent)throw q}function P(R){var q=R.exec(S);if(q){var $=q[0];return k($),S=S.slice($.length),q}}function z(){P(n)}function L(R){var q;for(R=R||[];q=F();)q!==!1&&R.push(q);return R}function F(){var R=O();if(!(d!=S.charAt(0)||m!=S.charAt(1))){for(var q=2;f!=S.charAt(q)&&(m!=S.charAt(q)||d!=S.charAt(q+1));)++q;if(q+=2,f===S.charAt(q-1))return T("End of comment missing");var $=S.slice(2,q-2);return _+=2,k($),S=S.slice(q),_+=2,R({type:g,comment:$})}}function D(){var R=O(),q=P(r);if(q){if(F(),!P(i))return T("property missing ':'");var $=P(a),V=R({type:v,property:w(q[0].replace(e,f)),value:$?w($[0].replace(e,f)):f});return P(o),V}}function X(){var R=[];L(R);for(var q;q=D();)q!==!1&&(R.push(q),L(R));return R}return z(),X()}function w(S){return S?S.replace(l,f):f}return YS=b,YS}var $D;function cce(){if($D)return bd;$D=1;var e=bd&&bd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bd,"__esModule",{value:!0}),bd.default=n;const t=e(uce());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(c=>{if(c.type!=="declaration")return;const{property:d,value:m}=c;l?i(d,m,c):m&&(a=a||{},a[d]=m)}),a}return bd}var Zh={},BD;function dce(){if(BD)return Zh;BD=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.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,"-")},c=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 Zh.camelCase=c,Zh}var Jh,FD;function fce(){if(FD)return Jh;FD=1;var e=Jh&&Jh.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(cce()),n=dce();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(o[(0,n.camelCase)(l,a)]=c)}),o}return r.default=r,Jh=r,Jh}var hce=fce();const mce=Hi(hce),DU=IU("end"),Lk=IU("start");function IU(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 pce(e){const t=Lk(e),n=DU(e);if(t&&n)return{start:t,end:n}}function Em(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?UD(e.position):"start"in e||"end"in e?UD(e):"line"in e||"column"in e?Y_(e):""}function Y_(e){return HD(e&&e.line)+":"+HD(e&&e.column)}function UD(e){return Y_(e&&e.start)+"-"+Y_(e&&e.end)}function HD(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 c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.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=Em(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 zk={}.hasOwnProperty,gce=new Map,vce=/[A-Z]/g,yce=new Set(["table","tbody","thead","tfoot","tr"]),xce=new Set(["td","th"]),LU="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bce(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=kce(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=Nce(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"?Ik:sce,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=zU(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function zU(e,t,n){if(t.type==="element")return wce(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Sce(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ece(e,t,n);if(t.type==="mdxjsEsm")return jce(e,t);if(t.type==="root")return _ce(e,t,n);if(t.type==="text")return Cce(e,t)}function wce(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ik,e.schema=i),e.ancestors.push(t);const a=BU(e,t.tagName,!1),o=Ace(e,t);let l=Bk(e,t);return yce.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Que(c):!0})),$U(e,o,a,t),$k(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Sce(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)}Bm(e,t.position)}function jce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bm(e,t.position)}function Ece(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ik,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:BU(e,t.name,!0),o=Oce(e,t),l=Bk(e,t);return $U(e,o,a,t),$k(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function _ce(e,t,n){const r={};return $k(r,Bk(e,t)),e.create(t,e.Fragment,r,n)}function Cce(e,t){return t.value}function $U(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $k(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Nce(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 kce(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=Lk(r);return t(i,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Ace(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&zk.call(t.properties,i)){const a=Tce(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&xce.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 Oce(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 Bm(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 Bm(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Bk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:gce;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const d=i.get(c)||0;o=c+"-"+d,i.set(c,d+1)}}const l=zU(e,a,o);l!==void 0&&n.push(l)}return n}function Tce(e,t,n){const r=ice(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Kue(n):lce(n)),r.property==="style"){let i=typeof n=="object"?n:Pce(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Mce(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?tce[r.property]||r.property:r.attribute,n]}}function Pce(e,t){try{return mce(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=LU+"#cannot-parse-style-attribute",i}}function BU(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=RD(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=RD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return zk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bm(e)}function Bm(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=LU+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Mce(e){const t={};let n;for(n in e)zk.call(e,n)&&(t[Rce(n)]=e[n]);return t}function Rce(e){let t=e.replace(vce,Dce);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Dce(e){return"-"+e.toLowerCase()}const XS={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"]},Ice={};function Fk(e,t){const n=Ice,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return FU(e,r,i)}function FU(e,t,n){if(Lce(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 qD(e.children,t,n)}return Array.isArray(e)?qD(e,t,n):""}function qD(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=FU(e[i],t,n);return r.join("")}function Lce(e){return!!(e&&typeof e=="object")}const VD=document.createElement("i");function Uk(e){const t="&"+e+";";VD.innerHTML=t;const n=VD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ii(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 oa(e,t){return e.length>0?(Ii(e,e.length,0,t),e):t}const KD={}.hasOwnProperty;function UU(e){const t={};let n=-1;for(;++n<e.length;)zce(t,e[n]);return t}function zce(e,t){let n;for(n in t){const i=(KD.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){KD.call(i,o)||(i[o]=[]);const l=a[o];$ce(i[o],Array.isArray(l)?l:l?[l]:[])}}}function $ce(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ii(e,0,0,r)}function HU(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 Ha(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ei=Jl(/[A-Za-z]/),Ur=Jl(/[\dA-Za-z]/),Bce=Jl(/[#-'*+\--9=?A-Z^-~]/);function ox(e){return e!==null&&(e<32||e===127)}const X_=Jl(/\d/),Fce=Jl(/[\dA-Fa-f]/),Uce=Jl(/[!-/:-@[-`{-~]/);function nt(e){return e!==null&&e<-2}function cn(e){return e!==null&&(e<0||e===32)}function Et(e){return e===-2||e===-1||e===32}const W0=Jl(new RegExp("\\p{P}|\\p{S}","u")),dc=Jl(/\s/);function Jl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Uf(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 Mt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Et(c)?(e.enter(n),l(c)):t(c)}function l(c){return Et(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const Hce={tokenize:qce};function qce(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"),Mt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return nt(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const Vce={tokenize:Kce},YD={tokenize:Yce};function Kce(e){const t=this,n=[];let r=0,i,a,o;return l;function l(_){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,d)(_)}return d(_)}function c(_){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 Ii(t.events,O+1,0,t.events.slice(k)),t.events.length=T,d(_)}return l(_)}function d(_){if(r===n.length){if(!i)return g(_);if(i.currentConstruct&&i.currentConstruct.concrete)return b(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(YD,m,f)(_)}function m(_){return i&&C(),j(r),g(_)}function f(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,b(_)}function g(_){return t.containerState={},e.attempt(YD,v,b)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),g(_)}function b(_){if(_===null){i&&C(),j(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(_)}function w(_){if(_===null){S(e.exit("chunkFlow"),!0),j(0),e.consume(_);return}return nt(_)?(e.consume(_),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(_),w)}function S(_,k){const O=t.sliceStream(_);if(k&&O.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(O),t.parser.lazy[_.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 P=T,z,L;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(z){L=t.events[P][1].end;break}z=!0}for(j(r),A=T;A<t.events.length;)t.events[A][1].end={...L},A++;Ii(t.events,P+1,0,t.events.slice(T)),t.events.length=A}}function j(_){let k=n.length;for(;k-- >_;){const O=n[k];t.containerState=O[1],O[0].exit.call(t,e)}n.length=_}function C(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Yce(e,t,n){return Mt(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)||dc(e))return 1;if(W0(e))return 2}function Q0(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 G_={name:"attention",resolveAll:Xce,tokenize:Gce};function Xce(e,t){let n=-1,r,i,a,o,l,c,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;c=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 f={...e[r][1].end},g={...e[n][1].start};XD(f,-c),XD(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>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=oa(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=oa(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=oa(d,Q0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=oa(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=oa(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Ii(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 Gce(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=pf(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const d=e.exit("attentionSequence"),m=pf(c),f=!m||m===2&&i||n.includes(c),g=!i||i===2&&m||n.includes(r);return d._open=!!(a===42?f:f&&(i||!g)),d._close=!!(a===42?g:g&&(m||!f)),t(c)}}function XD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Wce={name:"autolink",tokenize:Qce};function Qce(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 ei(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,c):(v===43||v===45||v===46||Ur(v))&&r++<32?(e.consume(v),l):(r=0,d(v))}function c(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||ox(v)?n(v):(e.consume(v),c)}function d(v){return v===64?(e.consume(v),m):Bce(v)?(e.consume(v),d):n(v)}function m(v){return Ur(v)?f(v):n(v)}function f(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:f;return e.consume(v),b}return n(v)}}const Vp={partial:!0,tokenize:Zce};function Zce(e,t,n){return r;function r(a){return Et(a)?Mt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||nt(a)?t(a):n(a)}}const qU={continuation:{tokenize:ede},exit:tde,name:"blockQuote",tokenize:Jce};function Jce(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 Et(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function ede(e,t,n){const r=this;return i;function i(o){return Et(o)?Mt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(qU,t,n)(o)}}function tde(e){e.exit("blockQuote")}const VU={name:"characterEscape",tokenize:nde};function nde(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 Uce(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const KU={name:"characterReference",tokenize:rde};function rde(e,t,n){const r=this;let i=0,a,o;return l;function l(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,o=Ur,m(f))}function d(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Fce,m):(e.enter("characterReferenceValue"),a=7,o=X_,m(f))}function m(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return o===Ur&&!Uk(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<a?(e.consume(f),m):n(f)}}const GD={partial:!0,tokenize:ade},WD={concrete:!0,name:"codeFenced",tokenize:ide};function ide(e,t,n){const r=this,i={partial:!0,tokenize:O};let a=0,o=0,l;return c;function c(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"),Et(A)?Mt(e,f,"whitespace")(A):f(A))}function f(A){return A===null||nt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(GD,w,k)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||nt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(A)):Et(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,v,"whitespace")(A)):A===96&&A===l?n(A):(e.consume(A),g)}function v(A){return A===null||nt(A)?f(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||nt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(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&&Et(A)?Mt(e,C,"linePrefix",a+1)(A):C(A)}function C(A){return A===null||nt(A)?e.check(GD,w,k)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||nt(A)?(e.exit("codeFlowValue"),C(A)):(e.consume(A),_)}function k(A){return e.exit("codeFenced"),t(A)}function O(A,T,P){let z=0;return L;function L(q){return A.enter("lineEnding"),A.consume(q),A.exit("lineEnding"),F}function F(q){return A.enter("codeFencedFence"),Et(q)?Mt(A,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):D(q)}function D(q){return q===l?(A.enter("codeFencedFenceSequence"),X(q)):P(q)}function X(q){return q===l?(z++,A.consume(q),X):z>=o?(A.exit("codeFencedFenceSequence"),Et(q)?Mt(A,R,"whitespace")(q):R(q)):P(q)}function R(q){return q===null||nt(q)?(A.exit("codeFencedFence"),T(q)):P(q)}}}function ade(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 GS={name:"codeIndented",tokenize:sde},ode={partial:!0,tokenize:lde};function sde(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Mt(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?c(d):nt(d)?e.attempt(ode,o,c)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||nt(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function c(d){return e.exit("codeIndented"),t(d)}}function lde(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):nt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Mt(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):nt(o)?i(o):n(o)}}const ude={name:"codeText",previous:dde,resolve:cde,tokenize:fde};function cde(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 dde(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fde(e,t,n){let r=0,i,a;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),r++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(a=e.enter("codeTextSequence"),i=0,m(f)):nt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||nt(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),d)}function m(f){return f===96?(e.consume(f),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",d(f))}}class hde{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&&em(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),em(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),em(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);em(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);em(this.left,n.reverse())}}}function em(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 YU(e){const t={};let n=-1,r,i,a,o,l,c,d;const m=new hde(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"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,mde(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 Ii(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function mde(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,c=[],d={};let m,f,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),f&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(m),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=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();c.push([C,C+j.length-1]),e.splice(C,2,j)}for(c.reverse(),g=-1;++g<c.length;)d[b+c[g][0]]=b+c[g][1],b+=c[g][1]-c[g][0]-1;return d}const pde={resolve:vde,tokenize:yde},gde={partial:!0,tokenize:xde};function vde(e){return YU(e),e}function yde(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):nt(l)?e.check(gde,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 xde(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Mt(e,a,"linePrefix")}function a(o){if(o===null||nt(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 XU(e,t,n,r,i,a,o,l,c){const d=c||Number.POSITIVE_INFINITY;let m=0;return f;function f(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||ox(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||nt(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||ox(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 GU(e,t,n,r,i,a){const o=this;let l=0,c;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&&!c||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):nt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===null||v===91||v===93||nt(v)||l++>999?(e.exit("chunkString"),m(v)):(e.consume(v),c||(c=!Et(v)),v===92?g:f)}function g(v){return v===91||v===92||v===93?(e.consume(v),l++,f):f(v)}}function WU(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,c):n(g)}function c(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),c(o)):g===null?n(g):nt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Mt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===o||g===null||nt(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?f:m)}function f(g){return g===o||g===92?(e.consume(g),m):m(g)}}function _m(e,t){let n;return r;function r(i){return nt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Et(i)?Mt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bde={name:"definition",tokenize:Sde},wde={partial:!0,tokenize:jde};function Sde(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return GU.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return i=Ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return cn(v)?_m(e,d)(v):d(v)}function d(v){return XU(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(wde,f,f)(v)}function f(v){return Et(v)?Mt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||nt(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function jde(e,t,n){return r;function r(l){return cn(l)?_m(e,i)(l):n(l)}function i(l){return WU(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Et(l)?Mt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||nt(l)?t(l):n(l)}}const Ede={name:"hardBreakEscape",tokenize:_de};function _de(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return nt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Cde={name:"headingAtx",resolve:Nde,tokenize:kde};function Nde(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"},Ii(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function kde(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"),c(m)):m===null||nt(m)?(e.exit("atxHeading"),t(m)):Et(m)?Mt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function c(m){return m===35?(e.consume(m),c):(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 Ade=["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"],QD=["pre","script","style","textarea"],Ode={concrete:!0,name:"htmlFlow",resolveTo:Mde,tokenize:Rde},Tde={partial:!0,tokenize:Ide},Pde={partial:!0,tokenize:Dde};function Mde(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 Rde(e,t,n){const r=this;let i,a,o,l,c;return d;function d(B){return m(B)}function m(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),f}function f(B){return B===33?(e.consume(B),g):B===47?(e.consume(B),a=!0,w):B===63?(e.consume(B),i=3,r.interrupt?t:I):ei(B)?(e.consume(B),o=String.fromCharCode(B),S):n(B)}function g(B){return B===45?(e.consume(B),i=2,v):B===91?(e.consume(B),i=5,l=0,b):ei(B)?(e.consume(B),i=4,r.interrupt?t:I):n(B)}function v(B){return B===45?(e.consume(B),r.interrupt?t:I):n(B)}function b(B){const Q="CDATA[";return B===Q.charCodeAt(l++)?(e.consume(B),l===Q.length?r.interrupt?t:D:b):n(B)}function w(B){return ei(B)?(e.consume(B),o=String.fromCharCode(B),S):n(B)}function S(B){if(B===null||B===47||B===62||cn(B)){const Q=B===47,Z=o.toLowerCase();return!Q&&!a&&QD.includes(Z)?(i=1,r.interrupt?t(B):D(B)):Ade.includes(o.toLowerCase())?(i=6,Q?(e.consume(B),j):r.interrupt?t(B):D(B)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):a?C(B):_(B))}return B===45||Ur(B)?(e.consume(B),o+=String.fromCharCode(B),S):n(B)}function j(B){return B===62?(e.consume(B),r.interrupt?t:D):n(B)}function C(B){return Et(B)?(e.consume(B),C):L(B)}function _(B){return B===47?(e.consume(B),L):B===58||B===95||ei(B)?(e.consume(B),k):Et(B)?(e.consume(B),_):L(B)}function k(B){return B===45||B===46||B===58||B===95||Ur(B)?(e.consume(B),k):O(B)}function O(B){return B===61?(e.consume(B),A):Et(B)?(e.consume(B),O):_(B)}function A(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),c=B,T):Et(B)?(e.consume(B),A):P(B)}function T(B){return B===c?(e.consume(B),c=null,z):B===null||nt(B)?n(B):(e.consume(B),T)}function P(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||cn(B)?O(B):(e.consume(B),P)}function z(B){return B===47||B===62||Et(B)?_(B):n(B)}function L(B){return B===62?(e.consume(B),F):n(B)}function F(B){return B===null||nt(B)?D(B):Et(B)?(e.consume(B),F):n(B)}function D(B){return B===45&&i===2?(e.consume(B),$):B===60&&i===1?(e.consume(B),V):B===62&&i===4?(e.consume(B),H):B===63&&i===3?(e.consume(B),I):B===93&&i===5?(e.consume(B),K):nt(B)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Tde,U,X)(B)):B===null||nt(B)?(e.exit("htmlFlowData"),X(B)):(e.consume(B),D)}function X(B){return e.check(Pde,R,U)(B)}function R(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),q}function q(B){return B===null||nt(B)?X(B):(e.enter("htmlFlowData"),D(B))}function $(B){return B===45?(e.consume(B),I):D(B)}function V(B){return B===47?(e.consume(B),o="",G):D(B)}function G(B){if(B===62){const Q=o.toLowerCase();return QD.includes(Q)?(e.consume(B),H):D(B)}return ei(B)&&o.length<8?(e.consume(B),o+=String.fromCharCode(B),G):D(B)}function K(B){return B===93?(e.consume(B),I):D(B)}function I(B){return B===62?(e.consume(B),H):B===45&&i===2?(e.consume(B),I):D(B)}function H(B){return B===null||nt(B)?(e.exit("htmlFlowData"),U(B)):(e.consume(B),H)}function U(B){return e.exit("htmlFlow"),t(B)}}function Dde(e,t,n){const r=this;return i;function i(o){return nt(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 Ide(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Vp,t,n)}}const Lde={name:"htmlText",tokenize:zde};function zde(e,t,n){const r=this;let i,a,o;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),O):I===63?(e.consume(I),_):ei(I)?(e.consume(I),P):n(I)}function d(I){return I===45?(e.consume(I),m):I===91?(e.consume(I),a=0,b):ei(I)?(e.consume(I),C):n(I)}function m(I){return I===45?(e.consume(I),v):n(I)}function f(I){return I===null?n(I):I===45?(e.consume(I),g):nt(I)?(o=f,V(I)):(e.consume(I),f)}function g(I){return I===45?(e.consume(I),v):f(I)}function v(I){return I===62?$(I):I===45?g(I):f(I)}function b(I){const H="CDATA[";return I===H.charCodeAt(a++)?(e.consume(I),a===H.length?w:b):n(I)}function w(I){return I===null?n(I):I===93?(e.consume(I),S):nt(I)?(o=w,V(I)):(e.consume(I),w)}function S(I){return I===93?(e.consume(I),j):w(I)}function j(I){return I===62?$(I):I===93?(e.consume(I),j):w(I)}function C(I){return I===null||I===62?$(I):nt(I)?(o=C,V(I)):(e.consume(I),C)}function _(I){return I===null?n(I):I===63?(e.consume(I),k):nt(I)?(o=_,V(I)):(e.consume(I),_)}function k(I){return I===62?$(I):_(I)}function O(I){return ei(I)?(e.consume(I),A):n(I)}function A(I){return I===45||Ur(I)?(e.consume(I),A):T(I)}function T(I){return nt(I)?(o=T,V(I)):Et(I)?(e.consume(I),T):$(I)}function P(I){return I===45||Ur(I)?(e.consume(I),P):I===47||I===62||cn(I)?z(I):n(I)}function z(I){return I===47?(e.consume(I),$):I===58||I===95||ei(I)?(e.consume(I),L):nt(I)?(o=z,V(I)):Et(I)?(e.consume(I),z):$(I)}function L(I){return I===45||I===46||I===58||I===95||Ur(I)?(e.consume(I),L):F(I)}function F(I){return I===61?(e.consume(I),D):nt(I)?(o=F,V(I)):Et(I)?(e.consume(I),F):z(I)}function D(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,X):nt(I)?(o=D,V(I)):Et(I)?(e.consume(I),D):(e.consume(I),R)}function X(I){return I===i?(e.consume(I),i=void 0,q):I===null?n(I):nt(I)?(o=X,V(I)):(e.consume(I),X)}function R(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||cn(I)?z(I):(e.consume(I),R)}function q(I){return I===47||I===62||cn(I)?z(I):n(I)}function $(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function V(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),G}function G(I){return Et(I)?Mt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):K(I)}function K(I){return e.enter("htmlTextData"),o(I)}}const Hk={name:"labelEnd",resolveAll:Ude,resolveTo:Hde,tokenize:qde},$de={tokenize:Vde},Bde={tokenize:Kde},Fde={tokenize:Yde};function Ude(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&&Ii(e,0,e.length,n),e}function Hde(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 c={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",c,t],["enter",d,t]],l=oa(l,e.slice(a+1,a+r+3)),l=oa(l,[["enter",m,t]]),l=oa(l,Q0(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=oa(l,[["exit",m,t],e[o-2],e[o-1],["exit",d,t]]),l=oa(l,e.slice(o+1)),l=oa(l,[["exit",c,t]]),Ii(e,a,e.length,l),e}function qde(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?f(g):(o=r.parser.defined.includes(Ha(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),c):n(g)}function c(g){return g===40?e.attempt($de,m,o?m:f)(g):g===91?e.attempt(Bde,m,o?d:f)(g):o?m(g):f(g)}function d(g){return e.attempt(Fde,m,f)(g)}function m(g){return t(g)}function f(g){return a._balanced=!0,n(g)}}function Vde(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return cn(f)?_m(e,a)(f):a(f)}function a(f){return f===41?m(f):XU(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return cn(f)?_m(e,c)(f):m(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?WU(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):m(f)}function d(f){return cn(f)?_m(e,m)(f):m(f)}function m(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Kde(e,t,n){const r=this;return i;function i(l){return GU.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Ha(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Yde(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 Xde={name:"labelStartImage",resolveAll:Hk.resolveAll,tokenize:Gde};function Gde(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 Wde={name:"labelStartLink",resolveAll:Hk.resolveAll,tokenize:Qde};function Qde(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 WS={name:"lineEnding",tokenize:Zde};function Zde(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Mt(e,t,"linePrefix")}}const Py={name:"thematicBreak",tokenize:Jde};function Jde(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"),c(d)):r>=3&&(d===null||nt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===i?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),Et(d)?Mt(e,l,"whitespace")(d):l(d))}}const mi={continuation:{tokenize:rfe},exit:afe,name:"list",tokenize:nfe},efe={partial:!0,tokenize:ofe},tfe={partial:!0,tokenize:ife};function nfe(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:X_(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(Py,n,d)(v):d(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return X_(v)&&++o<10?(e.consume(v),c):(!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(Vp,r.interrupt?n:m,e.attempt(efe,g,f))}function m(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function f(v){return Et(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 rfe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Vp,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Et(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(tfe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(mi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function ife(e,t,n){const r=this;return Mt(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 afe(e){e.exit(this.containerState.type)}function ofe(e,t,n){const r=this;return Mt(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!Et(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const ZD={name:"setextUnderline",resolveTo:sfe,tokenize:lfe};function sfe(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 lfe(e,t,n){const r=this;let i;return a;function a(d){let m=r.events.length,f;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){f=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(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"),Et(d)?Mt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||nt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const ufe={tokenize:cfe};function cfe(e){const t=this,n=e.attempt(Vp,r,e.attempt(this.parser.constructs.flowInitial,i,Mt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pde,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 dfe={resolveAll:ZU()},ffe=QU("string"),hfe=QU("text");function QU(e){return{resolveAll:ZU(e==="text"?mfe: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),c}function c(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),c)}function d(m){if(m===null)return!0;const f=i[m];let g=-1;if(f)for(;++g<f.length;){const v=f[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function ZU(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 mfe(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,c;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)c=!0,l++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const d={type:n===e.length||c||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 pfe={42:mi,43:mi,45:mi,48:mi,49:mi,50:mi,51:mi,52:mi,53:mi,54:mi,55:mi,56:mi,57:mi,62:qU},gfe={91:bde},vfe={[-2]:GS,[-1]:GS,32:GS},yfe={35:Cde,42:Py,45:[ZD,Py],60:Ode,61:ZD,95:Py,96:WD,126:WD},xfe={38:KU,92:VU},bfe={[-5]:WS,[-4]:WS,[-3]:WS,33:Xde,38:KU,42:G_,60:[Wce,Lde],91:Wde,92:[Ede,VU],93:Hk,95:G_,96:ude},wfe={null:[G_,dfe]},Sfe={null:[42,95]},jfe={null:[]},Efe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sfe,contentInitial:gfe,disable:jfe,document:pfe,flow:yfe,flowInitial:vfe,insideSpan:wfe,string:xfe,text:bfe},Symbol.toStringTag,{value:"Module"}));function _fe(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 c={attempt:T(O),check:T(A),consume:C,enter:_,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:f};let m=t.tokenize.call(d,c);return t.resolveAll&&a.push(t),d;function f(F){return o=oa(o,F),S(),o[o.length-1]!==null?[]:(P(t,0),d.events=Q0(a,d.events,d),d.events)}function g(F,D){return Nfe(v(F),D)}function v(F){return Cfe(o,F)}function b(){const{_bufferIndex:F,_index:D,line:X,column:R,offset:q}=r;return{_bufferIndex:F,_index:D,line:X,column:R,offset:q}}function w(F){i[F.line]=F.column,L()}function S(){let F;for(;r._index<o.length;){const D=o[r._index];if(typeof D=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<D.length;)j(D.charCodeAt(r._bufferIndex));else j(D)}}function j(F){m=m(F)}function C(F){nt(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,L()):F!==-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=F}function _(F,D){const X=D||{};return X.type=F,X.start=b(),d.events.push(["enter",X,d]),l.push(X),X}function k(F){const D=l.pop();return D.end=b(),d.events.push(["exit",D,d]),D}function O(F,D){P(F,D.from)}function A(F,D){D.restore()}function T(F,D){return X;function X(R,q,$){let V,G,K,I;return Array.isArray(R)?U(R):"tokenize"in R?U([R]):H(R);function H(te){return ae;function ae(re){const ee=re!==null&&te[re],se=re!==null&&te.null,ge=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(se)?se:se?[se]:[]];return U(ge)(re)}}function U(te){return V=te,G=0,te.length===0?$:B(te[G])}function B(te){return ae;function ae(re){return I=z(),K=te,te.partial||(d.currentConstruct=te),te.name&&d.parser.constructs.disable.null.includes(te.name)?Z():te.tokenize.call(D?Object.assign(Object.create(d),D):d,c,Q,Z)(re)}}function Q(te){return F(K,I),q}function Z(te){return I.restore(),++G<V.length?B(V[G]):$}}}function P(F,D){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&Ii(d.events,D,d.events.length-D,F.resolve(d.events.slice(D),d)),F.resolveTo&&(d.events=F.resolveTo(d.events,d))}function z(){const F=b(),D=d.previous,X=d.currentConstruct,R=d.events.length,q=Array.from(l);return{from:R,restore:$};function $(){r=F,d.previous=D,d.currentConstruct=X,d.events.length=R,l=q,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Cfe(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 Nfe(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 kfe(e){const r={constructs:UU([Efe,...(e||{}).extensions||[]]),content:i(Hce),defined:[],document:i(Vce),flow:i(ufe),lazy:{},string:i(ffe),text:i(hfe)};return r;function i(a){return o;function o(l){return _fe(r,a,l)}}}function Afe(e){for(;!YU(e););return e}const JD=/[\0\t\n\r]/g;function Ofe(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let d,m,f,g,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(JD.lastIndex=f,d=JD.exec(a),g=d&&d.index!==void 0?d.index:a.length,v=a.charCodeAt(g),!d){t=a.slice(f);break}if(v===10&&f===g&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<g&&(c.push(a.slice(f,g)),e+=g-f),v){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Tfe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Pfe(e){return e.replace(Tfe,Mfe)}function Mfe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return HU(n.slice(a?2:1),a?16:10)}return Uk(n)||e}const JU={}.hasOwnProperty;function Rfe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Dfe(n)(Afe(kfe(n).document().write(Ofe()(e,t,!0))))}function Dfe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(We),autolinkProtocol:z,autolinkEmail:z,atxHeading:a(He),blockQuote:a(se),characterEscape:z,characterReference:z,codeFenced:a(ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ge,o),codeText:a(ie,o),codeTextData:z,data:z,codeFlowValue:z,definition:a(Se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ee),hardBreakEscape:a(Oe),hardBreakTrailing:a(Oe),htmlFlow:a(at,o),htmlFlowData:z,htmlText:a(at,o),htmlTextData:z,image:a(Je),label:o,link:a(We),listItem:a(mt),listItemValue:g,listOrdered:a(zt,f),listUnordered:a(zt),paragraph:a(_t),reference:B,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(He),strong:a(Kt),thematicBreak:a(dn)},exit:{atxHeading:c(),atxHeadingSequence:O,autolink:c(),autolinkEmail:ee,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:te,characterReference:ae,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:L,codeIndented:c(j),codeText:c(q),codeTextData:L,data:L,definition:c(),definitionDestinationString:k,definitionLabelString:C,definitionTitleString:_,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(X),htmlFlowData:L,htmlText:c(R),htmlTextData:L,image:c(V),label:K,labelText:G,lineEnding:F,link:c($),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:I,resourceTitleString:H,resource:U,setextHeading:c(P),setextHeadingLineSequence:T,setextHeadingText:A,strong:c(),thematicBreak:c()}};eH(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let be={type:"root",children:[]};const Me={stack:[be],tokenStack:[],config:t,enter:l,exit:d,buffer:o,resume:m,data:n},et=[];let tt=-1;for(;++tt<ce.length;)if(ce[tt][1].type==="listOrdered"||ce[tt][1].type==="listUnordered")if(ce[tt][0]==="enter")et.push(tt);else{const Gt=et.pop();tt=i(ce,Gt,tt)}for(tt=-1;++tt<ce.length;){const Gt=t[ce[tt][0]];JU.call(Gt,ce[tt][1].type)&&Gt[ce[tt][1].type].call(Object.assign({sliceSerialize:ce[tt][2].sliceSerialize},Me),ce[tt][1])}if(Me.tokenStack.length>0){const Gt=Me.tokenStack[Me.tokenStack.length-1];(Gt[1]||eI).call(Me,void 0,Gt[0])}for(be.position={start:pl(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:pl(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},tt=-1;++tt<t.transforms.length;)be=t.transforms[tt](be)||be;return be}function i(ce,be,Me){let et=be-1,tt=-1,Gt=!1,nn,je,ut,wt;for(;++et<=Me;){const ct=ce[et];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?tt++:tt--,wt=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(nn&&!wt&&!tt&&!ut&&(ut=et),wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wt=void 0}if(!tt&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||tt===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(nn){let Bn=et;for(je=void 0;Bn--;){const rn=ce[Bn];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;je&&(ce[je][1].type="lineEndingBlank",Gt=!0),rn[1].type="lineEnding",je=Bn}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}ut&&(!je||ut<je)&&(nn._spread=!0),nn.end=Object.assign({},je?ce[je][1].start:ct[1].end),ce.splice(je||et,0,["exit",nn,ct[2]]),et++,Me++}if(ct[1].type==="listItemPrefix"){const Bn={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};nn=Bn,ce.splice(et,0,["enter",Bn,ct[2]]),et++,Me++,ut=void 0,wt=!0}}}return ce[be][1]._spread=Gt,Me}function a(ce,be){return Me;function Me(et){l.call(this,ce(et),et),be&&be.call(this,et)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(ce,be,Me){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([be,Me||void 0]),ce.position={start:pl(be.start),end:void 0}}function c(ce){return be;function be(Me){ce&&ce.call(this,Me),d.call(this,Me)}}function d(ce,be){const Me=this.stack.pop(),et=this.tokenStack.pop();if(et)et[0].type!==ce.type&&(be?be.call(this,ce,et[0]):(et[1]||eI).call(this,ce,et[0]));else throw new Error("Cannot close `"+ce.type+"` ("+Em({start:ce.start,end:ce.end})+"): it’s not open");Me.position.end=pl(ce.end)}function m(){return Fk(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(ce){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.lang=ce}function b(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.meta=ce}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce.replace(/(\r?\n|\r)$/g,"")}function C(ce){const be=this.resume(),Me=this.stack[this.stack.length-1];Me.label=be,Me.identifier=Ha(this.sliceSerialize(ce)).toLowerCase()}function _(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.title=ce}function k(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.url=ce}function O(ce){const be=this.stack[this.stack.length-1];if(!be.depth){const Me=this.sliceSerialize(ce).length;be.depth=Me}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function T(ce){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function z(ce){const Me=this.stack[this.stack.length-1].children;let et=Me[Me.length-1];(!et||et.type!=="text")&&(et=It(),et.position={start:pl(ce.start),end:void 0},Me.push(et)),this.stack.push(et)}function L(ce){const be=this.stack.pop();be.value+=this.sliceSerialize(ce),be.position.end=pl(ce.end)}function F(ce){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=be.children[be.children.length-1];Me.position.end=pl(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(z.call(this,ce),L.call(this,ce))}function D(){this.data.atHardBreak=!0}function X(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce}function R(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce}function q(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce}function $(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=be,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function V(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=be,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function G(ce){const be=this.sliceSerialize(ce),Me=this.stack[this.stack.length-2];Me.label=Pfe(be),Me.identifier=Ha(be).toLowerCase()}function K(){const ce=this.stack[this.stack.length-1],be=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const et=ce.children;Me.children=et}else Me.alt=be}function I(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.url=ce}function H(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.title=ce}function U(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function Q(ce){const be=this.resume(),Me=this.stack[this.stack.length-1];Me.label=be,Me.identifier=Ha(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function Z(ce){this.data.characterReferenceType=ce.type}function te(ce){const be=this.sliceSerialize(ce),Me=this.data.characterReferenceType;let et;Me?(et=HU(be,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):et=Uk(be);const tt=this.stack[this.stack.length-1];tt.value+=et}function ae(ce){const be=this.stack.pop();be.position.end=pl(ce.end)}function re(ce){L.call(this,ce);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(ce)}function ee(ce){L.call(this,ce);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(ce)}function se(){return{type:"blockquote",children:[]}}function ge(){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 He(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function at(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function We(){return{type:"link",title:null,url:"",children:[]}}function zt(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function mt(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function _t(){return{type:"paragraph",children:[]}}function Kt(){return{type:"strong",children:[]}}function It(){return{type:"text",value:""}}function dn(){return{type:"thematicBreak"}}}function pl(e){return{line:e.line,column:e.column,offset:e.offset}}function eH(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?eH(e,r):Ife(e,r)}}function Ife(e,t){let n;for(n in t)if(JU.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 eI(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Em({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Em({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Em({start:t.start,end:t.end})+") is still open")}function Lfe(e){const t=this;t.parser=n;function n(r){return Rfe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function zfe(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 $fe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function Bfe(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 Ffe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ufe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hfe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Uf(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 c={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,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,d),e.applyData(t,d)}function qfe(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 Vfe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function tH(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 Kfe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tH(e,t);const i={src:Uf(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 Yfe(e,t){const n={src:Uf(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 Xfe(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 Gfe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tH(e,t);const i={href:Uf(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 Wfe(e,t){const n={href:Uf(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 Qfe(e,t,n){const r=e.all(t),i=n?Zfe(n):nH(t),a={},o=[];if(typeof t.checked=="boolean"){const m=r[0];let f;m&&m.type==="element"&&m.tagName==="p"?f=m:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.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 c=r[r.length-1];c&&(i||c.type!=="element"||c.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 Zfe(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=nH(n[r])}return t}function nH(e){const t=e.spread;return t??e.children.length>1}function Jfe(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 ehe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function the(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nhe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rhe(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=Lk(t.children[1]),c=DU(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),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 ihe(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 c=-1;const d=[];for(;++c<l;){const f=t.children[c],g={},v=o?o[c]:void 0;v&&(g.align=v);let b={type:"element",tagName:a,properties:g,children:[]};f&&(b.children=e.all(f),e.patch(f,b),b=e.applyData(f,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 ahe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const tI=9,nI=32;function ohe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(rI(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(rI(t.slice(i),i>0,!1)),a.join("")}function rI(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===tI||a===nI;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===tI||a===nI;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function she(e,t){const n={type:"text",value:ohe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lhe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const uhe={blockquote:zfe,break:$fe,code:Bfe,delete:Ffe,emphasis:Ufe,footnoteReference:Hfe,heading:qfe,html:Vfe,imageReference:Kfe,image:Yfe,inlineCode:Xfe,linkReference:Gfe,link:Wfe,listItem:Qfe,list:Jfe,paragraph:ehe,root:the,strong:nhe,table:rhe,tableCell:ahe,tableRow:ihe,text:she,thematicBreak:lhe,toml:Qv,yaml:Qv,definition:Qv,footnoteDefinition:Qv};function Qv(){}const rH=-1,Z0=0,Cm=1,sx=2,qk=3,Vk=4,Kk=5,Yk=6,iH=7,aH=8,iI=typeof self=="object"?self:globalThis,che=(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 Z0:case rH:return n(o,i);case Cm:{const l=n([],i);for(const c of o)l.push(r(c));return l}case sx:{const l=n({},i);for(const[c,d]of o)l[r(c)]=r(d);return l}case qk:return n(new Date(o),i);case Vk:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case Kk:{const l=n(new Map,i);for(const[c,d]of o)l.set(r(c),r(d));return l}case Yk:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case iH:{const{name:l,message:c}=o;return n(new iI[l](c),i)}case aH: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 iI[a](o),i)};return r},aI=e=>che(new Map,e)(0),wd="",{toString:dhe}={},{keys:fhe}=Object,tm=e=>{const t=typeof e;if(t!=="object"||!e)return[Z0,t];const n=dhe.call(e).slice(8,-1);switch(n){case"Array":return[Cm,wd];case"Object":return[sx,wd];case"Date":return[qk,wd];case"RegExp":return[Vk,wd];case"Map":return[Kk,wd];case"Set":return[Yk,wd];case"DataView":return[Cm,n]}return n.includes("Array")?[Cm,n]:n.includes("Error")?[iH,n]:[sx,n]},Zv=([e,t])=>e===Z0&&(t==="function"||t==="symbol"),hhe=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=tm(o);switch(l){case Z0:{let m=o;switch(c){case"bigint":l=aH,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return i([rH],o)}return i([l,m],o)}case Cm:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),i([c,[...g]],o)}const m=[],f=i([l,m],o);for(const g of o)m.push(a(g));return f}case sx:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const m=[],f=i([l,m],o);for(const g of fhe(o))(e||!Zv(tm(o[g])))&&m.push([a(g),a(o[g])]);return f}case qk:return i([l,o.toISOString()],o);case Vk:{const{source:m,flags:f}=o;return i([l,{source:m,flags:f}],o)}case Kk:{const m=[],f=i([l,m],o);for(const[g,v]of o)(e||!(Zv(tm(g))||Zv(tm(v))))&&m.push([a(g),a(v)]);return f}case Yk:{const m=[],f=i([l,m],o);for(const g of o)(e||!Zv(tm(g)))&&m.push(a(g));return f}}const{message:d}=o;return i([l,{name:c,message:d}],o)};return a},oI=(e,{json:t,lossy:n}={})=>{const r=[];return hhe(!(t||n),!!t,new Map,r)(e),r},lx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?aI(oI(e,t)):structuredClone(e):(e,t)=>aI(oI(e,t));function mhe(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 phe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ghe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mhe,r=e.options.footnoteBackLabel||phe,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[c]);if(!d)continue;const m=e.all(d),f=String(d.identifier).toUpperCase(),g=Uf(f.toLowerCase());let v=0;const b=[],w=e.footnoteCounts.get(f);for(;w!==void 0&&++v<=w;){b.length>0&&b.push({type:"text",value:" "});let C=typeof n=="string"?n:n(c,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(c,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:{...lx(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 J0=(function(e){if(e==null)return bhe;if(typeof e=="function")return eb(e);if(typeof e=="object")return Array.isArray(e)?vhe(e):yhe(e);if(typeof e=="string")return xhe(e);throw new Error("Expected function, string, or object as test")});function vhe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=J0(e[n]);return eb(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function yhe(e){const t=e;return eb(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function xhe(e){return eb(t);function t(n){return n&&n.type===e}}function eb(e){return t;function t(n,r,i){return!!(whe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function bhe(){return!0}function whe(e){return e!==null&&typeof e=="object"&&"type"in e}const oH=[],She=!0,W_=!1,jhe="skip";function sH(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=J0(i),o=r?-1:1;l(e,void 0,[])();function l(c,d,m){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const v=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=oH,b,w,S;if((!t||a(c,d,m[m.length-1]||void 0))&&(v=Ehe(n(c,m)),v[0]===W_))return v;if("children"in c&&c.children){const j=c;if(j.children&&v[0]!==jhe)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]===W_)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function Ehe(e){return Array.isArray(e)?e:typeof e=="number"?[She,e]:e==null?oH:[e]}function Xk(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),sH(e,a,l,i);function l(c,d){const m=d[d.length-1],f=m?m.children.indexOf(c):void 0;return o(c,f,m)}}const Q_={}.hasOwnProperty,_he={};function Che(e,t){const n=t||_he,r=new Map,i=new Map,a=new Map,o={...uhe,...n.handlers},l={all:d,applyData:khe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:Nhe,wrap:Ohe};return Xk(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const f=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();f.has(g)||f.set(g,m)}}),l;function c(m,f){const g=m.type,v=l.handlers[g];if(Q_.call(l.handlers,g)&&v)return v(l,m,f);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in m){const{children:w,...S}=m,j=lx(S);return j.children=l.all(m),j}return lx(m)}return(l.options.unknownHandler||Ahe)(l,m,f)}function d(m){const f=[];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=sI(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=sI(w.value))}Array.isArray(b)?f.push(...b):f.push(b)}}}return f}}function Nhe(e,t){e.position&&(t.position=pce(e))}function khe(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,lx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Ahe(e,t){const n=t.data||{},r="value"in t&&!(Q_.call(n,"hProperties")||Q_.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 Ohe(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 sI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function lI(e,t){const n=Che(e,t),r=n.one(e,void 0),i=ghe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function The(e,t){return e&&"run"in e?async function(n,r){const i=lI(n,{file:r,...t});await e.run(i,r)}:function(n,r){return lI(n,{file:r,...e||t})}}function uI(e){if(e)throw e}var QS,cI;function Phe(){if(cI)return QS;cI=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"),f=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!f)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 QS=function c(){var d,m,f,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)f=l(w,m),g=l(d,m),w!==g&&(C&&g&&(a(g)||(v=i(g)))?(v?(v=!1,b=f&&i(f)?f:[]):b=f&&a(f)?f:{},o(w,{name:m,newValue:c(C,b,g)})):typeof g<"u"&&o(w,{name:m,newValue:g}));return w},QS}var Mhe=Phe();const ZS=Hi(Mhe);function Z_(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 Rhe(){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(c,...d){const m=e[++a];let f=-1;if(c){o(c);return}for(;++f<i.length;)(d[f]===null||d[f]===void 0)&&(d[f]=i[f]);i=d,m?Dhe(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 Dhe(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(d){const m=d;if(l&&n)throw m;return i(m)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const co={basename:Ihe,dirname:Lhe,extname:zhe,join:$he,sep:"/"};function Ihe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Kp(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 Lhe(e){if(Kp(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 zhe(e){Kp(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 $he(...e){let t=-1,n;for(;++t<e.length;)Kp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Bhe(n)}function Bhe(e){Kp(e);const t=e.codePointAt(0)===47;let n=Fhe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Fhe(e,t){let n="",r=0,i=-1,a=0,o=-1,l,c;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(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),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 Kp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Uhe={cwd:Hhe};function Hhe(){return"/"}function J_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function qhe(e){if(typeof e=="string")e=new URL(e);else if(!J_(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 Vhe(e)}function Vhe(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 JS=["history","path","basename","stem","extname","dirname"];class lH{constructor(t){let n;t?J_(t)?n={path:t}:typeof t=="string"||Khe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Uhe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<JS.length;){const a=JS[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)JS.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?co.basename(this.path):void 0}set basename(t){tj(t,"basename"),ej(t,"basename"),this.path=co.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?co.dirname(this.path):void 0}set dirname(t){dI(this.basename,"dirname"),this.path=co.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?co.extname(this.path):void 0}set extname(t){if(ej(t,"extname"),dI(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=co.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){J_(t)&&(t=qhe(t)),tj(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?co.basename(this.path,this.extname):void 0}set stem(t){tj(t,"stem"),ej(t,"stem"),this.path=co.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 ej(e,t){if(e&&e.includes(co.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+co.sep+"`")}function tj(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function dI(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Khe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Yhe=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Xhe={}.hasOwnProperty;class Gk extends Yhe{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=Rhe()}copy(){const t=new Gk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ZS(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ij("data",this.frozen),this.namespace[t]=n,this):Xhe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ij("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=Jv(t),r=this.parser||this.Parser;return nj("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),nj("process",this.parser||this.Parser),rj("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=Jv(t),c=r.parse(l);r.run(c,l,function(m,f,g){if(m||!f||!g)return d(m);const v=f,b=r.stringify(v,g);Qhe(b)?g.value=b:g.result=b,d(m,g)});function d(m,f){m||!f?o(m):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),nj("processSync",this.parser||this.Parser),rj("processSync",this.compiler||this.Compiler),this.process(t,i),hI("processSync","process",n),r;function i(a,o){n=!0,uI(a),r=o}}run(t,n,r){fI(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 c=Jv(n);i.run(t,c,d);function d(m,f,g){const v=f||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),hI("runSync","run",r),i;function a(o,l){uI(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=Jv(n),i=this.compiler||this.Compiler;return rj("stringify",i),fI(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ij("use",this.frozen),t!=null)if(typeof t=="function")c(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")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...f]=d;c(m,f)}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=ZS(!0,i.settings,d.settings))}function l(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const f=d[m];a(f)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,m){let f=-1,g=-1;for(;++f<r.length;)if(r[f][0]===d){g=f;break}if(g===-1)r.push([d,...m]);else if(m.length>0){let[v,...b]=m;const w=r[g][1];Z_(w)&&Z_(v)&&(v=ZS(!0,w,v)),r[g]=[d,v,...b]}}}}const Ghe=new Gk().freeze();function nj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function rj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ij(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 fI(e){if(!Z_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jv(e){return Whe(e)?e:new lH(e)}function Whe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Qhe(e){return typeof e=="string"||Zhe(e)}function Zhe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Jhe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",mI=[],pI={allowDangerousHtml:!0},eme=/^(https?|ircs?|mailto|xmpp)$/i,tme=[{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 nme(e){const t=rme(e),n=ime(e);return ame(t.runSync(t.parse(n),n),e)}function rme(e){const t=e.rehypePlugins||mI,n=e.remarkPlugins||mI,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pI}:pI;return Ghe().use(Lfe).use(n).use(The,r).use(t)}function ime(e){const t=e.children||"",n=new lH;return typeof t=="string"&&(n.value=t),n}function ame(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||ome;for(const m of tme)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Jhe+m.id,void 0);return Xk(e,d),bce(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function d(m,f,g){if(m.type==="raw"&&g&&typeof f=="number")return o?g.children.splice(f,1):g.children[f]={type:"text",value:m.value},f;if(m.type==="element"){let v;for(v in XS)if(Object.hasOwn(XS,v)&&Object.hasOwn(m.properties,v)){const b=m.properties[v],w=XS[v];(w===null||w.includes(m.tagName))&&(m.properties[v]=c(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 f=="number"&&(v=!r(m,f,g)),v&&g&&typeof f=="number")return l&&m.children?g.children.splice(f,1,...m.children):g.children.splice(f,1),f}}}function ome(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||eme.test(e.slice(0,t))?e:""}function gI(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 sme(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lme(e,t,n){const i=J0((n||{}).ignore||[]),a=ume(t);let o=-1;for(;++o<a.length;)sH(e,"text",l);function l(d,m){let f=-1,g;for(;++f<m.length;){const v=m[f],b=g?g.children:void 0;if(i(v,b?b.indexOf(v):void 0,g))return;g=v}if(g)return c(d,m)}function c(d,m){const f=m[m.length-1],g=a[o][0],v=a[o][1];let b=0;const S=f.children.indexOf(d);let j=!1,C=[];g.lastIndex=0;let _=g.exec(d.value);for(;_;){const k=_.index,O={index:_.index,input:_.input,stack:[...m,d]};let A=v(..._,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+_[0].length,j=!0),!g.global)break;_=g.exec(d.value)}return j?(b<d.value.length&&C.push({type:"text",value:d.value.slice(b)}),f.children.splice(S,1,...C)):C=[d],S+C.length}}function ume(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([cme(i[0]),dme(i[1])])}return t}function cme(e){return typeof e=="string"?new RegExp(sme(e),"g"):e}function dme(e){return typeof e=="function"?e:function(){return e}}const aj="phrasing",oj=["autolink","link","image","label"];function fme(){return{transforms:[xme],enter:{literalAutolink:mme,literalAutolinkEmail:sj,literalAutolinkHttp:sj,literalAutolinkWww:sj},exit:{literalAutolink:yme,literalAutolinkEmail:vme,literalAutolinkHttp:pme,literalAutolinkWww:gme}}}function hme(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:aj,notInConstruct:oj},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:aj,notInConstruct:oj},{character:":",before:"[ps]",after:"\\/",inConstruct:aj,notInConstruct:oj}]}}function mme(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function sj(e){this.config.enter.autolinkProtocol.call(this,e)}function pme(e){this.config.exit.autolinkProtocol.call(this,e)}function gme(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 vme(e){this.config.exit.autolinkEmail.call(this,e)}function yme(e){this.exit(e)}function xme(e){lme(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,bme],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),wme]],{ignore:["link","linkReference"]})}function bme(e,t,n,r,i){let a="";if(!uH(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Sme(n)))return!1;const o=jme(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 wme(e,t,n,r){return!uH(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Sme(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 jme(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=gI(e,"(");let a=gI(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 uH(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||dc(n)||W0(n))&&(!t||n!==47)}cH.peek=Pme;function Eme(){this.buffer()}function _me(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Cme(){this.buffer()}function Nme(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function kme(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ame(e){this.exit(e)}function Ome(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ha(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tme(e){this.exit(e)}function Pme(){return"["}function cH(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 Mme(){return{enter:{gfmFootnoteCallString:Eme,gfmFootnoteCall:_me,gfmFootnoteDefinitionLabelString:Cme,gfmFootnoteDefinition:Nme},exit:{gfmFootnoteCallString:kme,gfmFootnoteCall:Ame,gfmFootnoteDefinitionLabelString:Ome,gfmFootnoteDefinition:Tme}}}function Rme(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cH},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let c=l.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),m(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?dH:Dme))),d(),c}}function Dme(e,t,n){return t===0?e:dH(e,t,n)}function dH(e,t,n){return(n?"":"    ")+e}const Ime=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fH.peek=Fme;function Lme(){return{canContainEols:["delete"],enter:{strikethrough:$me},exit:{strikethrough:Bme}}}function zme(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ime}],handlers:{delete:fH}}}function $me(e){this.enter({type:"delete",children:[]},e)}function Bme(e){this.exit(e)}function fH(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 Fme(){return"~"}function Ume(e){return e.length}function Hme(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ume,a=[],o=[],l=[],c=[];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=qme(e[m][j]);if(n.alignDelimiters!==!1){const _=i(C);S[j]=_,(c[j]===void 0||_>c[j])&&(c[j]=_)}w.push(C)}o[m]=w,l[m]=S}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<d;)a[f]=vI(r[f]);else{const w=vI(r);for(;++f<d;)a[f]=w}f=-1;const g=[],v=[];for(;++f<d;){const w=a[f];let S="",j="";w===99?(S=":",j=":"):w===108?S=":":w===114&&(j=":");let C=n.alignDelimiters===!1?1:Math.max(1,c[f]-S.length-j.length);const _=S+"-".repeat(C)+j;n.alignDelimiters!==!1&&(C=S.length+C+j.length,C>c[f]&&(c[f]=C),v[f]=C),g[f]=_}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];f=-1;const j=[];for(;++f<d;){const C=w[f]||"";let _="",k="";if(n.alignDelimiters!==!1){const O=c[f]-(S[f]||0),A=a[f];A===114?_=" ".repeat(O):A===99?O%2?(_=" ".repeat(O/2+.5),k=" ".repeat(O/2-.5)):(_=" ".repeat(O/2),k=_):k=" ".repeat(O)}n.delimiterStart!==!1&&!f&&j.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||f)&&j.push(" "),n.alignDelimiters!==!1&&j.push(_),j.push(C),n.alignDelimiters!==!1&&j.push(k),n.padding!==!1&&j.push(" "),(n.delimiterEnd!==!1||f!==d-1)&&j.push("|")}b.push(n.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return b.join(`
`)}function qme(e){return e==null?"":String(e)}function vI(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 Vme(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()),Kme);return i(),o}function Kme(e,t,n){return">"+(n?"":" ")+e}function Yme(e,t){return yI(e,t.inConstruct,!0)&&!yI(e,t.notInConstruct,!1)}function yI(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 xI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&Yme(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function Xme(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 Gme(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 Wme(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 Qme(e,t,n,r){const i=Wme(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Gme(e,n)){const f=n.enter("codeIndented"),g=n.indentLines(a,Zme);return f(),g}const l=n.createTracker(r),c=i.repeat(Math.max(Xme(a,i)+1,3)),d=n.enter("codeFenced");let m=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);m+=l.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,{before:m,after:`
`,encode:["`"],...l.current()})),f()}return m+=l.move(`
`),a&&(m+=l.move(a+`
`)),m+=l.move(c),d(),m}function Zme(e,t,n){return(n?"":"    ")+e}function Wk(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 Jme(e,t,n,r){const i=Wk(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":`
`,...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),o(),d}function epe(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 Fm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ux(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}}hH.peek=tpe;function hH(e,t,n,r){const i=epe(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=c.charCodeAt(0),m=ux(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(c=Fm(d)+c.slice(1));const f=c.charCodeAt(c.length-1),g=ux(r.after.charCodeAt(0),f,i);g.inside&&(c=c.slice(0,-1)+Fm(f));const v=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+v}function tpe(e,t,n){return n.options.emphasis||"*"}function npe(e,t){let n=!1;return Xk(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,W_}),!!((!e.depth||e.depth<3)&&Fk(e)&&(t.options.setext||n))}function rpe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(npe(e,n)){const m=n.enter("headingSetext"),f=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:`
`,after:`
`});return f(),m(),g+`
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(d)&&(d=Fm(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),c(),l(),d}mH.peek=ipe;function mH(e){return e.value||""}function ipe(){return"<"}pH.peek=ape;function pH(e,t,n,r){const i=Wk(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),d+=c.move(")"),o(),d}function ape(){return"!"}gH.peek=ope;function gH(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function ope(){return"!"}vH.peek=spe;function vH(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 c;if(o.atBreak)for(;c=l.exec(r);){let d=c.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(c.index+1)}}return i+r+i}function spe(){return"`"}function yH(e,t){const n=Fk(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))}xH.peek=lpe;function xH(e,t,n,r){const i=Wk(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(yH(e,n)){const m=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=m,f}l=n.enter("link"),c=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(c=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=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),c()),d+=o.move(")"),l(),d}function lpe(e,t,n){return yH(e,n)?"<":"["}bH.peek=upe;function bH(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const m=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!d||d!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function upe(){return"["}function Qk(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 cpe(e){const t=Qk(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 dpe(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 wH(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 fpe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?dpe(n):Qk(n);const l=e.ordered?o==="."?")":".":cpe(n);let c=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&&(c=!0),wH(n)===o&&m){let f=-1;for(;++f<e.children.length;){const g=e.children[f];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),n.bulletCurrent=o;const d=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),d}function hpe(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 mpe(e,t,n,r){const i=hpe(n);let a=n.bulletCurrent||Qk(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 c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),m);return c(),d;function m(f,g,v){return g?(v?"":" ".repeat(o))+f:(v?a:a+" ".repeat(o-a.length))+f}}function ppe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const gpe=J0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vpe(e,t,n,r){return(e.children.some(function(o){return gpe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ype(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}SH.peek=xpe;function SH(e,t,n,r){const i=ype(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=c.charCodeAt(0),m=ux(r.before.charCodeAt(r.before.length-1),d,i);m.inside&&(c=Fm(d)+c.slice(1));const f=c.charCodeAt(c.length-1),g=ux(r.after.charCodeAt(0),f,i);g.inside&&(c=c.slice(0,-1)+Fm(f));const v=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+v}function xpe(e,t,n){return n.options.strong||"*"}function bpe(e,t,n,r){return n.safe(e.value,r)}function wpe(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 Spe(e,t,n){const r=(wH(n)+(n.options.ruleSpaces?" ":"")).repeat(wpe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const jH={blockquote:Vme,break:xI,code:Qme,definition:Jme,emphasis:hH,hardBreak:xI,heading:rpe,html:mH,image:pH,imageReference:gH,inlineCode:vH,link:xH,linkReference:bH,list:fpe,listItem:mpe,paragraph:ppe,root:vpe,strong:SH,text:bpe,thematicBreak:Spe};function jpe(){return{enter:{table:Epe,tableData:bI,tableHeader:bI,tableRow:Cpe},exit:{codeText:Npe,table:_pe,tableData:lj,tableHeader:lj,tableRow:lj}}}function Epe(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 _pe(e){this.exit(e),this.data.inTable=void 0}function Cpe(e){this.enter({type:"tableRow",children:[]},e)}function lj(e){this.exit(e)}function bI(e){this.enter({type:"tableCell",children:[]},e)}function Npe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,kpe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function kpe(e,t){return t==="|"?t:e}function Ape(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:c,tableRow:l}};function o(v,b,w,S){return d(m(v,w,S),v.align)}function l(v,b,w,S){const j=f(v,w,S),C=d([j]);return C.slice(0,C.indexOf(`
`))}function c(v,b,w,S){const j=w.enter("tableCell"),C=w.enter("phrasing"),_=w.containerPhrasing(v,{...S,before:a,after:a});return C(),j(),_}function d(v,b){return Hme(v,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function m(v,b,w){const S=v.children;let j=-1;const C=[],_=b.enter("table");for(;++j<S.length;)C[j]=f(S[j],b,w);return _(),C}function f(v,b,w){const S=v.children;let j=-1;const C=[],_=b.enter("tableRow");for(;++j<S.length;)C[j]=c(S[j],v,b,w);return _(),C}function g(v,b,w){let S=jH.inlineCode(v,b,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function Ope(){return{exit:{taskListCheckValueChecked:wI,taskListCheckValueUnchecked:wI,paragraph:Ppe}}}function Tpe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Mpe}}}function wI(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Ppe(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 Mpe(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 c=jH.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(m){return m+o}}function Rpe(){return[fme(),Mme(),Lme(),jpe(),Ope()]}function Dpe(e){return{extensions:[hme(),Rme(e),zme(),Ape(e),Tpe()]}}const Ipe={tokenize:Upe,partial:!0},EH={tokenize:Hpe,partial:!0},_H={tokenize:qpe,partial:!0},CH={tokenize:Vpe,partial:!0},Lpe={tokenize:Kpe,partial:!0},NH={name:"wwwAutolink",tokenize:Bpe,previous:AH},kH={name:"protocolAutolink",tokenize:Fpe,previous:OH},Ns={name:"emailAutolink",tokenize:$pe,previous:TH},Po={};function zpe(){return{text:Po}}let _u=48;for(;_u<123;)Po[_u]=Ns,_u++,_u===58?_u=65:_u===91&&(_u=97);Po[43]=Ns;Po[45]=Ns;Po[46]=Ns;Po[95]=Ns;Po[72]=[Ns,kH];Po[104]=[Ns,kH];Po[87]=[Ns,NH];Po[119]=[Ns,NH];function $pe(e,t,n){const r=this;let i,a;return o;function o(f){return!eC(f)||!TH.call(r,r.previous)||Zk(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return eC(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(Lpe,m,d)(f):f===45||f===95||Ur(f)?(a=!0,e.consume(f),c):m(f)}function d(f){return e.consume(f),i=!0,c}function m(f){return a&&i&&ei(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Bpe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!AH.call(r,r.previous)||Zk(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Ipe,e.attempt(EH,e.attempt(_H,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Fpe(e,t,n){const r=this;let i="",a=!1;return o;function o(f){return(f===72||f===104)&&OH.call(r,r.previous)&&!Zk(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(ei(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),a?d:(a=!0,c)):n(f)}function d(f){return f===null||ox(f)||cn(f)||dc(f)||W0(f)?n(f):e.attempt(EH,e.attempt(_H,m),n)(f)}function m(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Upe(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 Hpe(e,t,n){let r,i,a;return o;function o(d){return d===46||d===95?e.check(CH,c,l)(d):d===null||cn(d)||dc(d)||d!==45&&W0(d)?c(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 c(d){return i||r||!a?n(d):t(d)}}function qpe(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(CH,t,a)(o):o===null||cn(o)||dc(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function Vpe(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)||dc(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||cn(l)||dc(l)?t(l):r(l)}function a(l){return ei(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):ei(l)?(e.consume(l),o):n(l)}}function Kpe(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ur(a)?n(a):t(a)}}function AH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||cn(e)}function OH(e){return!ei(e)}function TH(e){return!(e===47||eC(e))}function eC(e){return e===43||e===45||e===46||e===95||Ur(e)}function Zk(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 Ype={tokenize:tge,partial:!0};function Xpe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Zpe,continuation:{tokenize:Jpe},exit:ege}},text:{91:{name:"gfmFootnoteCall",tokenize:Qpe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Gpe,resolveTo:Wpe}}}}function Gpe(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const d=Ha(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Wpe(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 Qpe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(a>999||f===93&&!o||f===null||f===91||cn(f))return n(f);if(f===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(Ha(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return cn(f)||(o=!0),a++,e.consume(f),f===92?m:d}function m(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function Zpe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(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=Ha(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?f:m}function f(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),Mt(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function Jpe(e,t,n){return e.check(Vp,t,e.attempt(Ype,t,n))}function ege(e){e.exit("gfmFootnoteDefinition")}function tge(e,t,n){const r=this;return Mt(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 nge(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 c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let d=c;for(;d--;)if(o[d][0]==="exit"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[d][1].end.offset-o[d][1].start.offset){o[c][1].type="strikethroughSequence",o[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},o[d][1].start),end:Object.assign({},o[c][1].end)},f={type:"strikethroughText",start:Object.assign({},o[d][1].end),end:Object.assign({},o[c][1].start)},g=[["enter",m,l],["enter",o[d][1],l],["exit",o[d][1],l],["enter",f,l]],v=l.parser.constructs.insideSpan.null;v&&Ii(g,g.length,0,Q0(v,o.slice(d+1,c),l)),Ii(g,g.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",m,l]]),Ii(o,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function a(o,l,c){const d=this.previous,m=this.events;let f=0;return g;function g(b){return d===126&&m[m.length-1][1].type!=="characterEscape"?c(b):(o.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const w=pf(d);if(b===126)return f>1?c(b):(o.consume(b),f++,v);if(f<2&&!n)return c(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 rge{constructor(){this.map=[]}add(t,n,r){ige(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 ige(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 age(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 oge(){return{flow:{null:{name:"table",tokenize:sge,resolveAll:lge}}}}function sge(e,t,n){const r=this;let i=0,a=0,o;return l;function l(L){let F=r.events.length-1;for(;F>-1;){const R=r.events[F][1].type;if(R==="lineEnding"||R==="linePrefix")F--;else break}const D=F>-1?r.events[F][1].type:null,X=D==="tableHead"||D==="tableRow"?A:c;return X===A&&r.parser.lazy[r.now().line]?n(L):X(L)}function c(L){return e.enter("tableHead"),e.enter("tableRow"),d(L)}function d(L){return L===124||(o=!0,a+=1),m(L)}function m(L){return L===null?n(L):nt(L)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),v):n(L):Et(L)?Mt(e,m,"whitespace")(L):(a+=1,o&&(o=!1,i+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),f(L)))}function f(L){return L===null||L===124||cn(L)?(e.exit("data"),m(L)):(e.consume(L),L===92?g:f)}function g(L){return L===92||L===124?(e.consume(L),f):f(L)}function v(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),o=!1,Et(L)?Mt(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):b(L))}function b(L){return L===45||L===58?S(L):L===124?(o=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),w):O(L)}function w(L){return Et(L)?Mt(e,S,"whitespace")(L):S(L)}function S(L){return L===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),j):L===45?(a+=1,j(L)):L===null||nt(L)?k(L):O(L)}function j(L){return L===45?(e.enter("tableDelimiterFiller"),C(L)):O(L)}function C(L){return L===45?(e.consume(L),C):L===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(L))}function _(L){return Et(L)?Mt(e,k,"whitespace")(L):k(L)}function k(L){return L===124?b(L):L===null||nt(L)?!o||i!==a?O(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):O(L)}function O(L){return n(L)}function A(L){return e.enter("tableRow"),T(L)}function T(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),T):L===null||nt(L)?(e.exit("tableRow"),t(L)):Et(L)?Mt(e,T,"whitespace")(L):(e.enter("data"),P(L))}function P(L){return L===null||L===124||cn(L)?(e.exit("data"),T(L)):(e.consume(L),L===92?z:P)}function z(L){return L===92||L===124?(e.consume(L),P):P(L)}}function lge(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,d,m,f;const g=new rge;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,c!==0&&(SI(g,t,c,d,m),m=void 0,c=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,f=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],f=ey(g,t,a,i,void 0,f),a=[0,0,0,0]),o[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],f=ey(g,t,a,i,void 0,f)),a=o,o=[a[1],n,0,0])):b.type==="tableHead"?(l=!0,c=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],f=ey(g,t,a,i,n,f)):o[1]!==0&&(f=ey(g,t,o,i,n,f)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&SI(g,t,c,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=age(t.events,n))}return e}function ey(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Md(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Md(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const d=Md(t.events,n[2]),m=Md(t.events,n[3]),f={type:l,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",f,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",f,t]])}return i!==void 0&&(a.end=Object.assign({},Md(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function SI(e,t,n,r,i){const a=[],o=Md(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 Md(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const uge={name:"tasklistCheck",tokenize:dge};function cge(){return{text:{91:uge}}}function dge(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return cn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return nt(c)?t(c):Et(c)?e.check({tokenize:fge},t,n)(c):n(c)}}function fge(e,t,n){return Mt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function hge(e){return UU([zpe(),Xpe(),nge(e),oge(),cge()])}const mge={};function pge(e){const t=this,n=e||mge,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(hge(n)),a.push(Rpe()),o.push(Dpe(n))}function Li({content:e,className:t}){return h.jsx("div",{className:t,children:h.jsx(nme,{remarkPlugins:[pge],components:{h1:({children:n})=>h.jsx("h1",{className:"mb-2 mt-4 text-base font-bold first:mt-0",children:n}),h2:({children:n})=>h.jsx("h2",{className:"mb-2 mt-3 text-sm font-bold first:mt-0",children:n}),h3:({children:n})=>h.jsx("h3",{className:"mb-1 mt-3 text-sm font-semibold first:mt-0",children:n}),p:({children:n})=>h.jsx("p",{className:"mb-2 last:mb-0 leading-relaxed",children:n}),ul:({children:n})=>h.jsx("ul",{className:"mb-2 ml-4 list-disc space-y-0.5",children:n}),ol:({children:n})=>h.jsx("ol",{className:"mb-2 ml-4 list-decimal space-y-0.5",children:n}),li:({children:n})=>h.jsx("li",{className:"leading-relaxed",children:n}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?h.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}):h.jsx("code",{className:"rounded bg-muted/60 px-1 py-0.5 font-mono text-xs",children:n}),pre:({children:n})=>h.jsx("pre",{className:"mb-2 overflow-x-auto rounded-md bg-muted/60 p-0",children:n}),blockquote:({children:n})=>h.jsx("blockquote",{className:"mb-2 border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground",children:n}),a:({href:n,children:r})=>h.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:no-underline",children:r}),table:({children:n})=>h.jsx("div",{className:"mb-2 overflow-x-auto",children:h.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>h.jsx("th",{className:"border border-border bg-muted/50 px-2 py-1 text-left font-medium",children:n}),td:({children:n})=>h.jsx("td",{className:"border border-border px-2 py-1",children:n}),hr:()=>h.jsx("hr",{className:"my-3 border-border"}),strong:({children:n})=>h.jsx("strong",{className:"font-semibold",children:n}),em:({children:n})=>h.jsx("em",{className:"italic",children:n})},children:e})})}function tb({view:e,onChange:t}){return h.jsxs("div",{className:"mb-3 flex gap-1",children:[h.jsx("button",{className:Te("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"}),h.jsx("button",{className:Te("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 gge(){const e=lt();return yt({mutationFn:t=>Pe.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function PH(){const e=lt();return yt({mutationFn:({type:t,name:n})=>Pe.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function vge(){const e=lt();return yt({mutationFn:t=>Pe.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function yge(){const e=lt();return yt({mutationFn:t=>Pe.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function xge(){const e=lt();return yt({mutationFn:({type:t,name:n,env_values:r,params_values:i})=>Pe.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ae.registry.config(n.type,n.name)})}})}function bge(e){const t=lt();return yt({mutationFn:n=>Pe.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ae.projects.resources(e)})}})}function MH(e){const t=lt();return yt({mutationFn:({type:n,name:r})=>Pe.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Ae.projects.resources(e)})}})}function wge(e){const t=lt();return yt({mutationFn:n=>Pe.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ae.projects.resources(e)})}})}function Sge(e){const t=lt();return yt({mutationFn:n=>Pe.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ae.projects.resources(e)})}})}function jge(e){const t=lt();return yt({mutationFn:({type:n,name:r,env_values:i,params_values:a})=>Pe.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:i,params_values:a}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Ae.projects.resourceConfig(e,r.type,r.name)})}})}function Jk({...e}){return h.jsx($N,{"data-slot":"sheet",...e})}function Ege({...e}){return h.jsx(BN,{"data-slot":"sheet-portal",...e})}function _ge({className:e,...t}){return h.jsx(FN,{"data-slot":"sheet-overlay",className:Te("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 eA({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return h.jsxs(Ege,{children:[h.jsx(_ge,{}),h.jsxs(UN,{"data-slot":"sheet-content",className:Te("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&&h.jsxs(HN,{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:[h.jsx(uc,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function tA({className:e,...t}){return h.jsx("div",{"data-slot":"sheet-header",className:Te("flex flex-col gap-1.5 p-4",e),...t})}function nA({className:e,...t}){return h.jsx(s6,{"data-slot":"sheet-title",className:Te("font-semibold text-foreground",e),...t})}function rA({className:e,...t}){return h.jsx(l6,{"data-slot":"sheet-description",className:Te("text-sm text-muted-foreground",e),...t})}function Cge(e){return On({queryKey:Ae.registry.validate(e??""),queryFn:()=>Pe.get(`/registry/agents/${e}/validate`),enabled:!!e})}function Wu(e,t){return On({queryKey:Ae.registry.list(e),queryFn:()=>Pe.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function Nge(e,t,n){return On({queryKey:Ae.registry.detail(e,t),queryFn:()=>Pe.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}const kge=X0("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 Nm({className:e,variant:t,...n}){return h.jsx("div",{"data-slot":"alert",role:"alert",className:Te(kge({variant:t}),e),...n})}function km({className:e,...t}){return h.jsx("div",{"data-slot":"alert-title",className:Te("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Am({className:e,...t}){return h.jsx("div",{"data-slot":"alert-description",className:Te("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function Age({agentName:e}){const{data:t}=Cge(e);return!t||!(!t.tools_ok||t.setup_command||!t.env_ok)?null:h.jsxs("div",{className:"mb-4 space-y-3",children:[!t.tools_ok&&h.jsxs(Nm,{variant:"destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsx(km,{children:"Missing Prerequisites"}),h.jsx(Am,{children:t.missing_tools.map(r=>h.jsxs("div",{className:"mt-1",children:[h.jsx("strong",{children:r.name})," not found on PATH.",r.install_hint&&h.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&&h.jsxs(Nm,{children:[h.jsx(Tse,{className:"h-4 w-4"}),h.jsx(km,{children:"Setup"}),h.jsxs(Am,{children:[h.jsx("p",{children:t.setup_description||"Run initial authentication in your terminal:"}),h.jsx("code",{className:"mt-1 block rounded bg-muted px-2 py-1 text-xs",children:t.setup_command}),h.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&&h.jsxs(Nm,{children:[h.jsx(lse,{className:"h-4 w-4"}),h.jsx(km,{children:"API Key Required"}),h.jsx(Am,{children:h.jsxs("p",{children:["Set"," ",t.missing_env.map((r,i)=>h.jsxs("span",{children:[i>0&&", ",h.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:r})]},r))," ","in the config below to authenticate."]})})]})]})}function Oge({resourceType:e,resourceName:t,enabled:n,projectId:r}){const i=CU(e,t,{enabled:n&&!r}),a=Fue(r??0,e,t,{enabled:n&&!!r}),{data:o,isLoading:l}=r?a:i,c=xge(),d=jge(r??0),m=r?d:c,{data:f}=Wu("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),_=Object.keys(o.params_schema);if(C.length===0&&_.length===0)return null;const k=z=>j(L=>{const F=new Set(L);return F.has(z)?F.delete(z):F.add(z),F}),O=(f??[]).map(z=>z.name),A=String(b.default_agent??"").trim(),T=e==="roles"&&A&&O.length>0&&!O.includes(A)?"Agent not found in installed agents":"",P=()=>{m.mutate({type:e,name:t,env_values:C.length>0?g:void 0,params_values:_.length>0?b:void 0},{onSuccess:()=>it.success("Configuration saved"),onError:()=>it.error("Failed to save configuration")})};return h.jsxs("div",{className:"flex flex-col gap-4",children:[C.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(jl,{}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),C.map(z=>{const L=o.env_schema[z],F=S.has(z);return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(st,{className:"text-xs font-mono",children:z}),L.required&&h.jsx(ft,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),L.description&&h.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),h.jsxs("div",{className:"relative",children:[h.jsx(Xe,{type:F?"text":"password",value:g[z]??"",onChange:D=>v(X=>({...X,[z]:D.target.value})),placeholder:z,className:"h-8 pr-8 text-xs font-mono"}),h.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>k(z),children:F?h.jsx(Yoe,{className:"h-3.5 w-3.5"}):h.jsx(Goe,{className:"h-3.5 w-3.5"})})]})]},z)})]})]}),_.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(jl,{}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),_.map(z=>{const L=o.params_schema[z],F=b[z],D=L.default;if(L.type==="boolean")return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx(st,{className:"text-xs font-mono",children:z}),L.description&&h.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),h.jsxs(pa,{value:F!=null?String(F):D!=null?String(D):"",onValueChange:V=>w(G=>({...G,[z]:V==="true"})),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{})}),h.jsxs(ya,{children:[h.jsx(An,{value:"true",children:"true"}),h.jsx(An,{value:"false",children:"false"})]})]})]},z);const X=L.type==="int"||L.type==="float"?"number":"text",R=L.type==="float"?"any":void 0,q=z==="default_agent"&&f?f.map(V=>V.name):void 0,$=q?`datalist-${z}`:void 0;return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx(st,{className:"text-xs font-mono",children:z}),L.description&&h.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),h.jsx(Xe,{type:X,step:R,list:$,value:F!=null?String(F):"",onChange:V=>w(G=>({...G,[z]:X==="number"&&V.target.value!==""?Number(V.target.value):V.target.value})),placeholder:D!=null?String(D):void 0,className:"h-8 text-xs font-mono"}),q&&h.jsx("datalist",{id:$,children:q.map(V=>h.jsx("option",{value:V},V))}),z==="default_agent"&&T&&h.jsx("p",{className:"text-xs text-destructive",children:T})]},z)})]})]}),h.jsxs(xe,{size:"sm",onClick:P,disabled:m.isPending||!!T,className:"self-start",children:[h.jsx(tU,{className:"mr-2 h-3.5 w-3.5"}),m.isPending?"Saving...":"Save Configuration"]})]})}function RH({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:i}){var D,X;const a=lt(),o=()=>{i!=null&&a.invalidateQueries({queryKey:Ae.projects.resources(i)})},l=PH(),c=vge(),d=yge(),m=MH(i??0),f=wge(i??0),g=Sge(i??0),v=i!=null&&(e==null?void 0:e.source)==="project",b=v?m:l,w=v?f:c,S=v?g:d,[j,C]=y.useState(!1),[_,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:R=>{R.exit_code===0?(it.success(`Uninstalled ${e.name}`),v||o(),r(!1)):it.error(`Uninstall failed: ${R.stderr||R.stdout}`),C(!1)},onError:()=>{it.error("Uninstall request failed"),C(!1)}})},T=()=>{w.mutate({type:t,name:e.name},{onSuccess:R=>{R.exit_code===0?(it.success(`Updated ${e.name}`),v||o()):it.error(`Update failed: ${R.stderr||R.stdout}`)},onError:()=>it.error("Update request failed")})},P=()=>{S.mutate({type:t,name:e.name},{onSuccess:R=>{R.exit_code===0?(it.success(`Reinstalled ${e.name}`),v||o()):it.error(`Reinstall failed: ${R.stderr||R.stdout}`)},onError:()=>it.error("Reinstall request failed")})},L=((D={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:D.includes(e.name))??!1,F=(X=e.frontmatter)==null?void 0:X.metadata;return h.jsx(Jk,{open:n,onOpenChange:R=>{r(R),C(!1),k("markdown")},children:h.jsxs(eA,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[h.jsxs(tA,{className:"shrink-0",children:[h.jsxs(nA,{className:"flex items-center gap-2",children:[e.name,e.version&&h.jsxs(ft,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),h.jsx(rA,{children:e.description||"No description"})]}),h.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[h.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Source: ",h.jsx("strong",{children:e.source})]}),h.jsxs("span",{children:["Path: ",h.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]})]}),F&&Object.keys(F).length>0&&h.jsxs("details",{className:"text-sm",children:[h.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"Metadata"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(F,null,2)})]})]}),h.jsx(zp,{className:"min-h-0 flex-1",children:h.jsxs("div",{className:"px-4 overflow-hidden",children:[t==="agents"&&h.jsx(Age,{agentName:e.name}),h.jsx(Oge,{resourceType:t,resourceName:e.name,enabled:n,projectId:i}),h.jsx("div",{className:"mt-4",children:e.body?h.jsxs(h.Fragment,{children:[h.jsx(tb,{view:_,onChange:k}),_==="markdown"?h.jsx(Li,{content:e.body,className:"text-sm"}):h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e.body})]}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No content."})})]})}),h.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[h.jsx(xe,{size:"sm",onClick:T,disabled:O,children:w.isPending?"Updating...":"Update"}),h.jsx(xe,{variant:"outline",size:"sm",onClick:P,disabled:O,children:S.isPending?"Reinstalling...":"Reinstall"}),h.jsx("div",{className:"flex-1"}),!L&&h.jsxs(h.Fragment,{children:[h.jsx(xe,{variant:j?"destructive":"outline",size:"sm",onClick:A,disabled:O,children:b.isPending?"Uninstalling...":j?"Confirm Uninstall":"Uninstall"}),j&&!b.isPending&&h.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>C(!1),children:"Cancel"})]})]})]})})}const Tge=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function iA({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[i,a]=y.useState(n??"roles"),[o,l]=y.useState(""),[c,d]=y.useState(null),[m,f]=y.useState(null);y.useEffect(()=>{e&&n&&a(n)},[e,n]);const g=gge(),v=bge(r??0),b=r?v:g,w=(c==null?void 0:c.status)==="success",S=()=>{o.trim()&&(d(null),f(null),b.mutate({type:i,name:o.trim()},{onSuccess:C=>{C.exit_code===0?(it.success(`Installed ${o.trim()}`),d({status:"success",message:`Successfully installed ${o.trim()}`}),f(C.stdout||null)):(d({status:"error",message:"Installation failed"}),f(C.stderr||C.stdout||"Unknown error."))},onError:()=>{d({status:"error",message:"Install request failed"}),it.error("Install request failed")}}))},j=C=>{C||(d(null),f(null),l("")),t(C)};return h.jsx(Xa,{open:e,onOpenChange:j,children:h.jsxs(Ga,{className:"sm:max-w-md",children:[h.jsxs(Wa,{children:[h.jsx(Qa,{children:r?"Install Resource to Project":"Install Resource"}),h.jsx(Tk,{children:"Install a resource from StrawHub by name."})]}),h.jsxs("div",{className:"flex flex-col gap-4",children:[c&&h.jsxs(Nm,{variant:c.status==="error"?"destructive":"default",className:c.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[c.status==="success"?h.jsx(Pp,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):h.jsx(F0,{className:"h-4 w-4"}),h.jsx(km,{children:c.status==="success"?"Installed":"Error"}),h.jsx(Am,{children:c.message})]}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(st,{htmlFor:"install-type",children:"Type"}),h.jsxs(pa,{value:i,onValueChange:a,disabled:w,children:[h.jsx(va,{id:"install-type",children:h.jsx(ga,{})}),h.jsx(ya,{children:Tge.map(C=>h.jsx(An,{value:C.value,children:C.label},C.value))})]})]}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(st,{htmlFor:"install-name",children:"Package Name"}),h.jsx(Xe,{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&&h.jsxs("details",{className:"text-sm",children:[h.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:m})]})]}),h.jsx(Ok,{children:(c==null?void 0:c.status)==="success"?h.jsx(xe,{onClick:()=>j(!1),children:"Done"}):h.jsx(xe,{onClick:S,disabled:!o.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const jI=["roles","skills","agents","memories"],DH={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memories"};function Pge({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:i}=Bf(e),[a,o]=y.useState(null),[l,c]=y.useState(""),[d,m]=y.useState(!1),[f,g]=y.useState(!1),v=t??f,b=n??g,{data:w}=Bue(e,l,a??"",{enabled:d&&!!a&&!!l}),S=j=>{o(j.name),c(j.type),m(!0)};return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Resources available to this project"}),h.jsxs(xe,{onClick:()=>b(!0),size:"sm",children:[h.jsx(Mp,{className:"mr-2 h-4 w-4"}),"Install"]})]}),i?h.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((j,C)=>h.jsx(ln,{className:"h-12 w-full"},C))}):!r||r.length===0?h.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources available yet."}):h.jsxs(Up,{defaultValue:"all",children:[h.jsxs(Hp,{children:[h.jsx(or,{value:"all",children:"All"}),jI.map(j=>{const C=r.filter(_=>_.type===j).length;return h.jsxs(or,{value:j,disabled:C===0,children:[DH[j]," (",C,")"]},j)})]}),h.jsx(sr,{value:"all",children:h.jsx(EI,{resources:r,showType:!0,projectId:e,onSelect:S})}),jI.map(j=>h.jsx(sr,{value:j,children:h.jsx(EI,{resources:r.filter(C=>C.type===j),projectId:e,onSelect:S})},j))]}),h.jsx(RH,{resource:w??null,resourceType:l,open:d,onOpenChange:m,projectId:e}),h.jsx(iA,{open:v,onOpenChange:b,projectId:e})]})}function EI({resources:e,showType:t,projectId:n,onSelect:r}){return e.length===0?h.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources in this category."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Source"}),t&&h.jsx(Fe,{children:"Type"}),h.jsx(Fe,{children:"Version"}),h.jsx(Fe,{children:"Description"}),h.jsx(Fe,{children:"Config"}),h.jsx(Fe,{className:"w-24"})]})}),h.jsx(ma,{children:e.map(i=>h.jsxs(yn,{className:"cursor-pointer",onClick:()=>r(i),children:[h.jsx(ze,{className:"font-medium",children:i.name}),h.jsx(ze,{children:h.jsx(ft,{variant:"outline",className:`text-xs ${i.source==="global"?"border-dashed":""}`,children:i.source==="global"?"Global":"Project"})}),t&&h.jsx(ze,{children:h.jsx(ft,{variant:"outline",className:"text-xs",children:DH[i.type]??i.type})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:i.version??"—"}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:i.description||"—"}),h.jsx(ze,{children:i.config_count>0&&h.jsxs(ft,{variant:"secondary",className:"text-xs gap-1",children:[h.jsx(H0,{className:"h-3 w-3"}),i.config_count]})}),h.jsx(ze,{children:i.source==="project"&&h.jsx(Mge,{projectId:n,resourceType:i.type,name:i.name})})]},`${i.type}-${i.name}`))})]})})})}function Mge({projectId:e,resourceType:t,name:n}){const[r,i]=y.useState(!1),a=MH(e),o=l=>{l.stopPropagation(),a.mutate({type:t,name:n},{onSuccess:c=>{c.exit_code===0?it.success(`Uninstalled ${n}`):it.error(`Uninstall failed: ${c.stderr||c.stdout}`),i(!1)},onError:()=>{it.error("Uninstall request failed"),i(!1)}})};return r?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(xe,{size:"sm",variant:"destructive",onClick:o,disabled:a.isPending,children:"Confirm"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:l=>{l.stopPropagation(),i(!1)},children:"No"})]}):h.jsx(xe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l=>{l.stopPropagation(),i(!0)},children:h.jsx(_a,{className:"h-4 w-4"})})}function Rge(e,t="30d"){return On({queryKey:Ae.projects.stats(e,t),queryFn:()=>Pe.get(`/projects/${e}/stats?period=${t}`)})}var Dge=["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 aA(e){if(typeof e!="string")return!1;var t=Dge;return t.includes(e)}var Ige=["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"],Lge=new Set(Ige);function IH(e){return typeof e!="string"?!1:Lge.has(e)}function LH(e){return typeof e=="string"&&e.startsWith("data-")}function $i(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(IH(n)||LH(n))&&(t[n]=e[n]);return t}function fc(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return $i(t)}return typeof e=="object"&&!Array.isArray(e)?$i(e):null}function ni(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(IH(n)||LH(n)||aA(n))&&(t[n]=e[n]);return t}function zge(e){return e==null?null:y.isValidElement(e)?ni(e.props):typeof e=="object"&&!Array.isArray(e)?ni(e):null}var $ge=["children","width","height","viewBox","className","style","title","desc"];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 Bge(e,t){if(e==null)return{};var n,r,i=Fge(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 Fge(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 oA=y.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:c,desc:d}=e,m=Bge(e,$ge),f=a||{width:r,height:i,x:0,y:0},g=Dt("recharts-surface",o);return y.createElement("svg",tC({},ni(m),{className:g,width:r,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),y.createElement("title",null,c),y.createElement("desc",null,d),n)}),Uge=["children","className"];function nC(){return nC=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},nC.apply(null,arguments)}function Hge(e,t){if(e==null)return{};var n,r,i=qge(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 qge(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 ur=y.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Hge(e,Uge),a=Dt("recharts-layer",r);return y.createElement("g",nC({className:a},ni(i),{ref:t}),n)}),zH=y.createContext(null),Vge=()=>y.useContext(zH);function hn(e){return function(){return e}}const $H=Math.cos,cx=Math.sin,Za=Math.sqrt,dx=Math.PI,nb=2*dx,rC=Math.PI,iC=2*rC,Pu=1e-6,Kge=iC-Pu;function BH(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Yge(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return BH;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 Xge{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?BH:Yge(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,c=r-t,d=i-n,m=o-t,f=l-n,g=m*m+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Pu)if(!(Math.abs(f*c-d*m)>Pu)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,b=i-l,w=c*c+d*d,S=v*v+b*b,j=Math.sqrt(w),C=Math.sqrt(g),_=a*Math.tan((rC-Math.acos((w+g-S)/(2*j*C)))/2),k=_/C,O=_/j;Math.abs(k-1)>Pu&&this._append`L${t+k*m},${n+k*f}`,this._append`A${a},${a},0,0,${+(f*v>m*b)},${this._x1=t+O*c},${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),c=r*Math.sin(i),d=t+l,m=n+c,f=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>Pu||Math.abs(this._y1-m)>Pu)&&this._append`L${d},${m}`,r&&(g<0&&(g=g%iC+iC),g>Kge?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=d},${this._y1=m}`:g>Pu&&this._append`A${r},${r},0,${+(g>=rC)},${f},${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 sA(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 Xge(t)}function lA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function FH(e){this._context=e}FH.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 rb(e){return new FH(e)}function UH(e){return e[0]}function HH(e){return e[1]}function qH(e,t){var n=hn(!0),r=null,i=rb,a=null,o=sA(l);e=typeof e=="function"?e:e===void 0?UH:hn(e),t=typeof t=="function"?t:t===void 0?HH:hn(t);function l(c){var d,m=(c=lA(c)).length,f,g=!1,v;for(r==null&&(a=i(v=o())),d=0;d<=m;++d)!(d<m&&n(f=c[d],d,c))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(f,d,c),+t(f,d,c));if(v)return a=null,v+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:hn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:hn(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:hn(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function ty(e,t,n){var r=null,i=hn(!0),a=null,o=rb,l=null,c=sA(d);e=typeof e=="function"?e:e===void 0?UH:hn(+e),t=typeof t=="function"?t:hn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?HH:hn(+n);function d(f){var g,v,b,w=(f=lA(f)).length,S,j=!1,C,_=new Array(w),k=new Array(w);for(a==null&&(l=o(C=c())),g=0;g<=w;++g){if(!(g<w&&i(S=f[g],g,f))===j)if(j=!j)v=g,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),b=g-1;b>=v;--b)l.point(_[b],k[b]);l.lineEnd(),l.areaEnd()}j&&(_[g]=+e(S,g,f),k[g]=+t(S,g,f),l.point(r?+r(S,g,f):_[g],n?+n(S,g,f):k[g]))}if(C)return l=null,C+""||null}function m(){return qH().defined(i).curve(o).context(a)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:hn(+f),r=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:hn(+f),d):e},d.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:hn(+f),d):r},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:hn(+f),n=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:hn(+f),d):t},d.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:hn(+f),d):n},d.lineX0=d.lineY0=function(){return m().x(e).y(t)},d.lineY1=function(){return m().x(e).y(n)},d.lineX1=function(){return m().x(r).y(t)},d.defined=function(f){return arguments.length?(i=typeof f=="function"?f:hn(!!f),d):i},d.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),d):o},d.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),d):a},d}class VH{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 Gge(e){return new VH(e,!0)}function Wge(e){return new VH(e,!1)}const uA={draw(e,t){const n=Za(t/dx);e.moveTo(n,0),e.arc(0,0,n,0,nb)}},Qge={draw(e,t){const n=Za(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()}},KH=Za(1/3),Zge=KH*2,Jge={draw(e,t){const n=Za(t/Zge),r=n*KH;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},eve={draw(e,t){const n=Za(t),r=-n/2;e.rect(r,r,n,n)}},tve=.8908130915292852,YH=cx(dx/10)/cx(7*dx/10),nve=cx(nb/10)*YH,rve=-$H(nb/10)*YH,ive={draw(e,t){const n=Za(t*tve),r=nve*n,i=rve*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=nb*a/5,l=$H(o),c=cx(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},uj=Za(3),ave={draw(e,t){const n=-Za(t/(uj*3));e.moveTo(0,n*2),e.lineTo(-uj*n,-n),e.lineTo(uj*n,-n),e.closePath()}},Ji=-.5,ea=Za(3)/2,aC=1/Za(12),ove=(aC/2+1)*3,sve={draw(e,t){const n=Za(t/ove),r=n/2,i=n*aC,a=r,o=n*aC+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(Ji*r-ea*i,ea*r+Ji*i),e.lineTo(Ji*a-ea*o,ea*a+Ji*o),e.lineTo(Ji*l-ea*c,ea*l+Ji*c),e.lineTo(Ji*r+ea*i,Ji*i-ea*r),e.lineTo(Ji*a+ea*o,Ji*o-ea*a),e.lineTo(Ji*l+ea*c,Ji*c-ea*l),e.closePath()}};function lve(e,t){let n=null,r=sA(i);e=typeof e=="function"?e:hn(e||uA),t=typeof t=="function"?t:hn(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:hn(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:hn(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function fx(){}function hx(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 XH(e){this._context=e}XH.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:hx(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:hx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uve(e){return new XH(e)}function GH(e){this._context=e}GH.prototype={areaStart:fx,areaEnd:fx,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:hx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cve(e){return new GH(e)}function WH(e){this._context=e}WH.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:hx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dve(e){return new WH(e)}function QH(e){this._context=e}QH.prototype={areaStart:fx,areaEnd:fx,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 fve(e){return new QH(e)}function _I(e){return e<0?-1:1}function CI(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(_I(a)+_I(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function NI(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function cj(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 mx(e){this._context=e}mx.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:cj(this,this._t0,NI(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,cj(this,NI(this,n=CI(this,e,t)),n);break;default:cj(this,this._t0,n=CI(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function ZH(e){this._context=new JH(e)}(ZH.prototype=Object.create(mx.prototype)).point=function(e,t){mx.prototype.point.call(this,t,e)};function JH(e){this._context=e}JH.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 hve(e){return new mx(e)}function mve(e){return new ZH(e)}function eq(e){this._context=e}eq.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=kI(e),i=kI(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 kI(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 pve(e){return new eq(e)}function ib(e,t){this._context=e,this._t=t}ib.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 gve(e){return new ib(e,.5)}function vve(e){return new ib(e,0)}function yve(e){return new ib(e,1)}function hc(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 oC(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function xve(e,t){return e[t]}function bve(e){const t=[];return t.key=e,t}function wve(){var e=hn([]),t=oC,n=hc,r=xve;function i(a){var o=Array.from(e.apply(this,arguments),bve),l,c=o.length,d=-1,m;for(const f of a)for(l=0,++d;l<c;++l)(o[l][d]=[0,+r(f,o[l].key,d,a)]).data=f;for(l=0,m=lA(t(o));l<c;++l)o[m[l]].index=l;return n(o,m),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:hn(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:hn(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?oC:typeof a=="function"?a:hn(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??hc,i):n},i}function Sve(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}hc(e,t)}}function jve(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}hc(e,t)}}function Eve(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,c=0,d=0;l<o;++l){for(var m=e[t[l]],f=m[r][1]||0,g=m[r-1][1]||0,v=(f-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}c+=f,d+=v*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=d/c)}i[r-1][1]+=i[r-1][0]=n,hc(e,t)}}var dj={},fj={},AI;function _ve(){return AI||(AI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(fj)),fj}var hj={},OI;function tq(){return OI||(OI=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})(hj)),hj}var mj={},TI;function cA(){return TI||(TI=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})(mj)),mj}var pj={},gj={},PI;function Cve(){return PI||(PI=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})(gj)),gj}var MI;function dA(){return MI||(MI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cve(),n=cA();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,c="",d="",m=!1;for(i.charCodeAt(0)===46&&(a.push(""),l++);l<o;){const f=i[l];d?f==="\\"&&l+1<o?(l++,c+=i[l]):f===d?d="":c+=f:m?f==='"'||f==="'"?d=f:f==="]"?(m=!1,a.push(c),c=""):c+=f:f==="["?(m=!0,c&&(a.push(c),c="")):f==="."?c&&(a.push(c),c=""):c+=f,l++}return c&&a.push(c),a}e.toPath=r})(pj)),pj}var RI;function fA(){return RI||(RI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_ve(),n=tq(),r=cA(),i=dA();function a(l,c,d){if(l==null)return d;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return d;const m=l[c];return m===void 0?n.isDeepKey(c)?a(l,i.toPath(c),d):d:m}case"number":case"symbol":{typeof c=="number"&&(c=r.toKey(c));const m=l[c];return m===void 0?d:m}default:{if(Array.isArray(c))return o(l,c,d);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return d;const m=l[c];return m===void 0?d:m}}}function o(l,c,d){if(c.length===0)return d;let m=l;for(let f=0;f<c.length;f++){if(m==null||t.isUnsafeProperty(c[f]))return d;m=m[c[f]]}return m===void 0?d:m}e.get=a})(dj)),dj}var vj,DI;function Nve(){return DI||(DI=1,vj=fA().get),vj}var kve=Nve();const mc=Hi(kve);var Ave=4;function Il(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ave,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Ln(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+Il(l)+a:i+a},"")}var xr=e=>e===0?0:e>0?1:-1,_o=e=>typeof e=="number"&&e!=+e,pc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,De=e=>(typeof e=="number"||e instanceof Number)&&!_o(e),Co=e=>De(e)||typeof e=="string",Ove=0,Um=e=>{var t=++Ove;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(!De(t)&&typeof t!="string")return r;var a;if(pc(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return _o(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},nq=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 wn(e,t,n){return De(e)&&De(t)?Il(e+n*(t-e)):t}function rq(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):mc(r,t))===n)}var En=e=>e===null||typeof e>"u",Yp=e=>En(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function yi(e){return e!=null}function eu(){}var Tve=["type","size","sizeType"];function sC(){return sC=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},sC.apply(null,arguments)}function II(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 LI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?II(Object(n),!0).forEach(function(r){Pve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pve(e,t,n){return(t=Mve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mve(e){var t=Rve(e,"string");return typeof t=="symbol"?t:t+""}function Rve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dve(e,t){if(e==null)return{};var n,r,i=Ive(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 Ive(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 iq={symbolCircle:uA,symbolCross:Qge,symbolDiamond:Jge,symbolSquare:eve,symbolStar:ive,symbolTriangle:ave,symbolWye:sve},Lve=Math.PI/180,zve=e=>{var t="symbol".concat(Yp(e));return iq[t]||uA},$ve=(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*Lve;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}},Bve=(e,t)=>{iq["symbol".concat(Yp(e))]=t},hA=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Dve(e,Tve),a=LI(LI({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var g=zve(o),v=lve().type(g).size($ve(n,r,o)),b=v();if(b!==null)return b},{className:c,cx:d,cy:m}=a,f=ni(a);return De(d)&&De(m)&&De(n)?y.createElement("path",sC({},f,{className:Dt("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(m,")"),d:l()})):null};hA.registerSymbol=Bve;var aq=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,mA=(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=>{aA(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Fve=(e,t,n)=>r=>(e(t,n,r),null),Xp=(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];aA(i)&&typeof a=="function"&&(r||(r={}),r[i]=Fve(a,t,n))}),r};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 Uve(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){Hve(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 Hve(e,t,n){return(t=qve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qve(e){var t=Vve(e,"string");return typeof t=="symbol"?t:t+""}function Vve(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 Zn(e,t){var n=Uve({},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 px(){return px=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},px.apply(null,arguments)}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(r){Kve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kve(e,t,n){return(t=Yve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yve(e){var t=Xve(e,"string");return typeof t=="symbol"?t:t+""}function Xve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var na=32,Gve={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Wve(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Qve(e){var{data:t,iconType:n,inactiveColor:r}=e,i=na/2,a=na/6,o=na/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return y.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:Wve(t.payload),x1:0,y1:i,x2:na,y2:i,className:"recharts-legend-icon"});if(c==="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(na,"M").concat(2*o,",").concat(i,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return y.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(na/8,"h").concat(na,"v").concat(na*3/4,"h").concat(-na,"z"),className:"recharts-legend-icon"});if(y.isValidElement(t.legendIcon)){var d=oq({},t);return delete d.legendIcon,y.cloneElement(t.legendIcon,d)}return y.createElement(hA,{fill:l,cx:i,cy:i,size:na,sizeType:"diameter",type:c})}function Zve(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:l}=e,c={x:0,y:0,width:na,height:na},d={display:r==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((f,g)=>{var v=f.formatter||i,b=Dt({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:f.inactive});if(f.type==="none")return null;var w=typeof l=="object"?oq({},l):{};w.color=f.inactive?a:w.color||f.color;var S=v?v(f.value,f,g):f.value;return y.createElement("li",px({className:b,style:d,key:"legend-item-".concat(g)},Xp(e,f,g)),y.createElement(oA,{width:n,height:n,viewBox:c,style:m,"aria-label":"".concat(S," legend icon")},y.createElement(Qve,{data:f,iconType:o,inactiveColor:a})),y.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var Jve=e=>{var t=Zn(e,Gve),{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(Zve,px({},t,{payload:n})))},yj={},xj={},BI;function eye(){return BI||(BI=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})(xj)),xj}var bj={},FI;function tye(){return FI||(FI=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})(bj)),bj}var wj={},UI;function sq(){return UI||(UI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(wj)),wj}var Sj={},jj={},Ej={},HI;function nye(){return HI||(HI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Ej)),Ej}var qI;function lq(){return qI||(qI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nye();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(jj)),jj}var _j={},VI;function rye(){return VI||(VI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(_j)),_j}var KI;function iye(){return KI||(KI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lq(),n=rye();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Sj)),Sj}var Cj={},Nj={},YI;function aye(){return YI||(YI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fA();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Nj)),Nj}var kj={},Aj={},Oj={},Tj={},XI;function uq(){return XI||(XI=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})(Tj)),Tj}var Pj={},GI;function cq(){return GI||(GI=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})(Pj)),Pj}var Mj={},WI;function dq(){return WI||(WI=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})(Mj)),Mj}var QI;function oye(){return QI||(QI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uq(),n=cq(),r=dq();function i(m,f,g){return typeof g!="function"?i(m,f,()=>{}):a(m,f,function v(b,w,S,j,C,_){const k=g(b,w,S,j,C,_);return k!==void 0?!!k:a(b,w,v,_)},new Map)}function a(m,f,g,v){if(f===m)return!0;switch(typeof f){case"object":return o(m,f,g,v);case"function":return Object.keys(f).length>0?a(m,{...f},g,v):r.isEqualsSameValueZero(m,f);default:return t.isObject(m)?typeof f=="string"?f==="":!0:r.isEqualsSameValueZero(m,f)}}function o(m,f,g,v){if(f==null)return!0;if(Array.isArray(f))return c(m,f,g,v);if(f instanceof Map)return l(m,f,g,v);if(f instanceof Set)return d(m,f,g,v);const b=Object.keys(f);if(m==null||n.isPrimitive(m))return b.length===0;if(b.length===0)return!0;if(v!=null&&v.has(f))return v.get(f)===m;v==null||v.set(f,m);try{for(let w=0;w<b.length;w++){const S=b[w];if(!n.isPrimitive(m)&&!(S in m)||f[S]===void 0&&m[S]!==void 0||f[S]===null&&m[S]!==null||!g(m[S],f[S],S,m,f,v))return!1}return!0}finally{v==null||v.delete(f)}}function l(m,f,g,v){if(f.size===0)return!0;if(!(m instanceof Map))return!1;for(const[b,w]of f.entries()){const S=m.get(b);if(g(S,w,b,m,f,v)===!1)return!1}return!0}function c(m,f,g,v){if(f.length===0)return!0;if(!Array.isArray(m))return!1;const b=new Set;for(let w=0;w<f.length;w++){const S=f[w];let j=!1;for(let C=0;C<m.length;C++){if(b.has(C))continue;const _=m[C];let k=!1;if(g(_,S,w,m,f,v)&&(k=!0),k){b.add(C),j=!0;break}}if(!j)return!1}return!0}function d(m,f,g,v){return f.size===0?!0:m instanceof Set?c([...m],[...f],g,v):!1}e.isMatchWith=i,e.isSetMatch=d})(Oj)),Oj}var ZI;function fq(){return ZI||(ZI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oye();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Aj)),Aj}var Rj={},Dj={},Ij={},JI;function sye(){return JI||(JI=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})(Ij)),Ij}var Lj={},eL;function pA(){return eL||(eL=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})(Lj)),Lj}var zj={},tL;function hq(){return tL||(tL=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]",c="[object Map]",d="[object Set]",m="[object Array]",f="[object Function]",g="[object ArrayBuffer]",v="[object Object]",b="[object Error]",w="[object DataView]",S="[object Uint8Array]",j="[object Uint8ClampedArray]",C="[object Uint16Array]",_="[object Uint32Array]",k="[object BigUint64Array]",O="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",P="[object BigInt64Array]",z="[object Float32Array]",L="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=m,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=k,e.booleanTag=i,e.dataViewTag=w,e.dateTag=l,e.errorTag=b,e.float32ArrayTag=z,e.float64ArrayTag=L,e.functionTag=f,e.int16ArrayTag=A,e.int32ArrayTag=T,e.int8ArrayTag=O,e.mapTag=c,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=d,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=C,e.uint32ArrayTag=_,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=j})(zj)),zj}var $j={},nL;function lye(){return nL||(nL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})($j)),$j}var rL;function mq(){return rL||(rL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sye(),n=pA(),r=hq(),i=cq(),a=lye();function o(m,f){return l(m,void 0,m,new Map,f)}function l(m,f,g,v=new Map,b=void 0){const w=b==null?void 0:b(m,f,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),c(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),c(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),c(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,c(S,m,g,v,b),S}if(m instanceof Boolean){const S=new Boolean(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(m instanceof Number){const S=new Number(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(m instanceof String){const S=new String(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(typeof m=="object"&&d(m)){const S=Object.create(Object.getPrototypeOf(m));return v.set(m,S),c(S,m,g,v,b),S}return m}function c(m,f,g=m,v,b){const w=[...Object.keys(f),...t.getSymbols(f)];for(let S=0;S<w.length;S++){const j=w[S],C=Object.getOwnPropertyDescriptor(m,j);(C==null||C.writable)&&(m[j]=l(f[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=c})(Dj)),Dj}var iL;function uye(){return iL||(iL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mq();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Rj)),Rj}var aL;function cye(){return aL||(aL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fq(),n=uye();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(kj)),kj}var Bj={},Fj={},Uj={},oL;function dye(){return oL||(oL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mq(),n=pA(),r=hq();function i(a,o){return t.cloneDeepWith(a,(l,c,d,m)=>{const f=o==null?void 0:o(l,c,d,m);if(f!==void 0)return f;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})(Uj)),Uj}var sL;function fye(){return sL||(sL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dye();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Fj)),Fj}var Hj={},qj={},lL;function pq(){return lL||(lL=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})(qj)),qj}var Vj={},uL;function hye(){return uL||(uL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pA();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Vj)),Vj}var cL;function mye(){return cL||(cL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tq(),n=pq(),r=hye(),i=dA();function a(o,l){let c;if(Array.isArray(l)?c=l:typeof l=="string"&&t.isDeepKey(l)&&(o==null?void 0:o[l])==null?c=i.toPath(l):c=[l],c.length===0)return!1;let d=o;for(let m=0;m<c.length;m++){const f=c[m];if((d==null||!Object.hasOwn(d,f))&&!((Array.isArray(d)||r.isArguments(d))&&n.isIndex(f)&&f<d.length))return!1;d=d[f]}return!0}e.has=a})(Hj)),Hj}var dL;function pye(){return dL||(dL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fq(),n=cA(),r=fye(),i=fA(),a=mye();function o(l,c){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 c=r.cloneDeep(c),function(d){const m=i.get(d,l);return m===void 0?a.has(d,l):c===void 0?m===void 0:t.isMatch(m,c)}}e.matchesProperty=o})(Bj)),Bj}var fL;function gye(){return fL||(fL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sq(),n=aye(),r=cye(),i=pye();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})(Cj)),Cj}var hL;function vye(){return hL||(hL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=eye(),n=tye(),r=sq(),i=iye(),a=gye();function o(l,c=r.identity){return i.isArrayLikeObject(l)?t.uniqBy(Array.from(l),n.ary(a.iteratee(c),1)):[]}e.uniqBy=o})(yj)),yj}var Kj,mL;function yye(){return mL||(mL=1,Kj=vye().uniqBy),Kj}var xye=yye();const pL=Hi(xye);function gq(e,t,n){return t===!0?pL(e,n):typeof t=="function"?pL(e,t):e}var Yj={exports:{}},Xj={};/**
 * @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 gL;function bye(){if(gL)return Xj;gL=1;var e=Pf(),t=ite();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,c=e.useDebugValue;return Xj.useSyncExternalStoreWithSelector=function(d,m,f,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,_=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(_,A))return T;var P=g(A);return v!==void 0&&v(T,P)?(_=A,T):(_=A,k=P)}var C=!1,_,k,O=f===void 0?null:f;return[function(){return j(m())},O===null?void 0:function(){return j(O())}]},[m,f,g,v]);var S=i(d,b[0],b[1]);return o(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},Xj}var vL;function wye(){return vL||(vL=1,Yj.exports=bye()),Yj.exports}var vq=wye();const Sye=Hi(vq);var gA=y.createContext(null),jye=e=>e,tn=()=>{var e=y.useContext(gA);return e?e.store.dispatch:jye},My=()=>{},Eye=()=>My,_ye=(e,t)=>e===t;function $e(e){var t=y.useContext(gA),n=y.useMemo(()=>t?r=>{if(r!=null)return e(r)}:My,[t,e]);return vq.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Eye,t?t.store.getState:My,t?t.store.getState:My,n,_ye)}function Cye(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Nye(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function kye(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 yL=e=>Array.isArray(e)?e:[e];function Aye(e){const t=Array.isArray(e[0])?e[0]:e;return kye(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Oye(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Tye=class{constructor(e){this.value=e}deref(){return this.value}},Pye=typeof WeakRef<"u"?WeakRef:Tye,Mye=0,xL=1;function ny(){return{s:Mye,v:void 0,o:null,p:null}}function yq(e,t={}){let n=ny();const{resultEqualityCheck:r}=t;let i,a=0;function o(){var f;let l=n;const{length:c}=arguments;for(let g=0,v=c;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=ny(),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=ny(),w.set(b,l)):l=S}}const d=l;let m;if(l.s===xL)m=l.v;else if(m=e.apply(null,arguments),a++,r){const g=((f=i==null?void 0:i.deref)==null?void 0:f.call(i))??i;g!=null&&r(g,m)&&(m=g,a!==0&&a--),i=typeof m=="object"&&m!==null||typeof m=="function"?new Pye(m):m}return d.s=xL,d.v=m,m}return o.clearCache=()=>{n=ny(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Rye(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,l,c={},d=i.pop();typeof d=="object"&&(c=d,d=i.pop()),Cye(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...c},{memoize:f,memoizeOptions:g=[],argsMemoize:v=yq,argsMemoizeOptions:b=[]}=m,w=yL(g),S=yL(b),j=Aye(i),C=f(function(){return a++,d.apply(null,arguments)},...w),_=v(function(){o++;const O=Oye(j,arguments);return l=C.apply(null,O),l},...S);return Object.assign(_,{resultFunc:d,memoizedResultFunc:C,dependencies:j,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=Rye(yq),Dye=Object.assign((e,t=le)=>{Nye(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,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>Dye}),Gj={},Wj={},Qj={},bL;function Iye(){return bL||(bL=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})(Qj)),Qj}var Zj={},Jj={},wL;function xq(){return wL||(wL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Jj)),Jj}var SL;function Lye(){return SL||(SL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xq(),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})(Zj)),Zj}var jL;function zye(){return jL||(jL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Iye(),n=Lye(),r=dA();function i(a,o,l,c){if(a==null)return[];l=c?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,f=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:f.map(b=>m(b,v))})).slice().sort((v,b)=>{for(let w=0;w<f.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})(Wj)),Wj}var eE={},EL;function $ye(){return EL||(EL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(l,c)=>{for(let d=0;d<l.length;d++){const m=l[d];Array.isArray(m)&&c<a?o(m,c+1):i.push(m)}};return o(n,0),i}e.flatten=t})(eE)),eE}var tE={},_L;function bq(){return _L||(_L=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pq(),n=lq(),r=uq(),i=dq();function a(o,l,c){return r.isObject(c)&&(typeof l=="number"&&n.isArrayLike(c)&&t.isIndex(l)&&l<c.length||typeof l=="string"&&l in c)?i.isEqualsSameValueZero(c[l],o):!1}e.isIterateeCall=a})(tE)),tE}var CL;function Bye(){return CL||(CL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zye(),n=$ye(),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})(Gj)),Gj}var nE,NL;function Fye(){return NL||(NL=1,nE=Bye().sortBy),nE}var Uye=Fye();const ab=Hi(Uye);var wq=e=>e.legend.settings,Hye=e=>e.legend.size,qye=e=>e.legend.payload,Vye=le([qye,wq],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?ab(r,n):r});function Kye(){return $e(Vye)}var ry=1;function Sq(){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)>ry||Math.abs(o.left-t.left)>ry||Math.abs(o.top-t.top)>ry||Math.abs(o.width-t.width)>ry)&&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 Ar(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 Yye=typeof Symbol=="function"&&Symbol.observable||"@@observable",kL=Yye,rE=()=>Math.random().toString(36).substring(7).split("").join("."),Xye={INIT:`@@redux/INIT${rE()}`,REPLACE:`@@redux/REPLACE${rE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${rE()}`},gx=Xye;function vA(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 jq(e,t,n){if(typeof e!="function")throw new Error(Ar(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ar(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ar(1));return n(jq)(e,t)}let r=e,i=t,a=new Map,o=a,l=0,c=!1;function d(){o===a&&(o=new Map,a.forEach((S,j)=>{o.set(j,S)}))}function m(){if(c)throw new Error(Ar(3));return i}function f(S){if(typeof S!="function")throw new Error(Ar(4));if(c)throw new Error(Ar(5));let j=!0;d();const C=l++;return o.set(C,S),function(){if(j){if(c)throw new Error(Ar(6));j=!1,d(),o.delete(C),a=null}}}function g(S){if(!vA(S))throw new Error(Ar(7));if(typeof S.type>"u")throw new Error(Ar(8));if(typeof S.type!="string")throw new Error(Ar(17));if(c)throw new Error(Ar(9));try{c=!0,i=r(i,S)}finally{c=!1}return(a=o).forEach(C=>{C()}),S}function v(S){if(typeof S!="function")throw new Error(Ar(10));r=S,g({type:gx.REPLACE})}function b(){const S=f;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Ar(11));function C(){const k=j;k.next&&k.next(m())}return C(),{unsubscribe:S(C)}},[kL](){return this}}}return g({type:gx.INIT}),{dispatch:g,subscribe:f,getState:m,replaceReducer:v,[kL]:b}}function Gye(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:gx.INIT})>"u")throw new Error(Ar(12));if(typeof n(void 0,{type:gx.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ar(13))})}function Eq(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{Gye(n)}catch(a){i=a}return function(o={},l){if(i)throw i;let c=!1;const d={};for(let m=0;m<r.length;m++){const f=r[m],g=n[f],v=o[f],b=g(v,l);if(typeof b>"u")throw l&&l.type,new Error(Ar(14));d[f]=b,c=c||b!==v}return c=c||r.length!==Object.keys(o).length,c?d:o}}function vx(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Wye(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Ar(15))};const o={getState:i.getState,dispatch:(c,...d)=>a(c,...d)},l=e.map(c=>c(o));return a=vx(...l)(i.dispatch),{...i,dispatch:a}}}function _q(e){return vA(e)&&"type"in e&&typeof e.type=="string"}var Cq=Symbol.for("immer-nothing"),AL=Symbol.for("immer-draftable"),ri=Symbol.for("immer-state");function za(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ri=Object,gf=Ri.getPrototypeOf,yx="constructor",ob="prototype",lC="configurable",xx="enumerable",Ry="writable",Hm="value",bs=e=>!!e&&!!e[ri];function Ka(e){var t;return e?Nq(e)||lb(e)||!!e[AL]||!!((t=e[yx])!=null&&t[AL])||ub(e)||cb(e):!1}var Qye=Ri[ob][yx].toString(),OL=new WeakMap;function Nq(e){if(!e||!yA(e))return!1;const t=gf(e);if(t===null||t===Ri[ob])return!0;const n=Ri.hasOwnProperty.call(t,yx)&&t[yx];if(n===Object)return!0;if(!Rd(n))return!1;let r=OL.get(n);return r===void 0&&(r=Function.toString.call(n),OL.set(n,r)),r===Qye}function sb(e,t,n=!0){Gp(e)===0?(n?Reflect.ownKeys(e):Ri.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Gp(e){const t=e[ri];return t?t.type_:lb(e)?1:ub(e)?2:cb(e)?3:0}var TL=(e,t,n=Gp(e))=>n===2?e.has(t):Ri[ob].hasOwnProperty.call(e,t),uC=(e,t,n=Gp(e))=>n===2?e.get(t):e[t],bx=(e,t,n,r=Gp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Zye(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var lb=Array.isArray,ub=e=>e instanceof Map,cb=e=>e instanceof Set,yA=e=>typeof e=="object",Rd=e=>typeof e=="function",iE=e=>typeof e=="boolean";function Jye(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ns=e=>e.copy_||e.base_,xA=e=>e.modified_?e.copy_:e.base_;function cC(e,t){if(ub(e))return new Map(e);if(cb(e))return new Set(e);if(lb(e))return Array[ob].slice.call(e);const n=Nq(e);if(t===!0||t==="class_only"&&!n){const r=Ri.getOwnPropertyDescriptors(e);delete r[ri];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l[Ry]===!1&&(l[Ry]=!0,l[lC]=!0),(l.get||l.set)&&(r[o]={[lC]:!0,[Ry]:!0,[xx]:l[xx],[Hm]:e[o]})}return Ri.create(gf(e),r)}else{const r=gf(e);if(r!==null&&n)return{...e};const i=Ri.create(r);return Ri.assign(i,e)}}function bA(e,t=!1){return db(e)||bs(e)||!Ka(e)||(Gp(e)>1&&Ri.defineProperties(e,{set:iy,add:iy,clear:iy,delete:iy}),Ri.freeze(e),t&&sb(e,(n,r)=>{bA(r,!0)},!1)),e}function exe(){za(2)}var iy={[Hm]:exe};function db(e){return e===null||!yA(e)?!0:Ri.isFrozen(e)}var wx="MapSet",dC="Patches",PL="ArrayMethods",kq={};function gc(e){const t=kq[e];return t||za(0,e),t}var ML=e=>!!kq[e],qm,Aq=()=>qm,txe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ML(wx)?gc(wx):void 0,arrayMethodsPlugin_:ML(PL)?gc(PL):void 0});function RL(e,t){t&&(e.patchPlugin_=gc(dC),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fC(e){hC(e),e.drafts_.forEach(nxe),e.drafts_=null}function hC(e){e===qm&&(qm=e.parent_)}var DL=e=>qm=txe(qm,e);function nxe(e){const t=e[ri];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function IL(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ri].modified_&&(fC(t),za(4)),Ka(e)&&(e=LL(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ri].base_,e,t)}else e=LL(t,n);return rxe(t,e,!0),fC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Cq?e:void 0}function LL(e,t){if(db(t))return t;const n=t[ri];if(!n)return Sx(t,e.handledSet_,e);if(!fb(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);Pq(n,e)}return n.copy_}function rxe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&bA(t,n)}function Oq(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var fb=(e,t)=>e.scope_===t,ixe=[];function Tq(e,t,n,r){const i=ns(e),a=e.type_;if(r!==void 0&&uC(i,r,a)===t){bx(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;sb(i,(c,d)=>{if(bs(d)){const m=l.get(d)||[];m.push(c),l.set(d,m)}})}const o=e.draftLocations_.get(t)??ixe;for(const l of o)bx(i,l,n,a)}function axe(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!fb(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=xA(a);Tq(e,a.draft_??a,o,n),Pq(a,i)})}function Pq(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)}Oq(e)}}function oxe(e,t,n){const{scope_:r}=e;if(bs(n)){const i=n[ri];fb(i,r)&&i.callbacks_.push(function(){Dy(e);const o=xA(i);Tq(e,n,o,t)})}else Ka(n)&&e.callbacks_.push(function(){const a=ns(e);e.type_===3?a.has(n)&&Sx(n,r.handledSet_,r):uC(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Sx(uC(e.copy_,t,e.type_),r.handledSet_,r)})}function Sx(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||bs(e)||t.has(e)||!Ka(e)||db(e)||(t.add(e),sb(e,(r,i)=>{if(bs(i)){const a=i[ri];if(fb(a,n)){const o=xA(a);bx(e,r,o,e.type_),Oq(a)}}else Ka(i)&&Sx(i,t,n)})),e}function sxe(e,t){const n=lb(e),r={type_:n?1:0,scope_:t?t.scope_:Aq(),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=jx;n&&(i=[r],a=Vm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var jx={get(e,t){if(t===ri)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=ns(e);if(!TL(i,t,e.type_))return lxe(e,i,t);const a=i[t];if(e.finalized_||!Ka(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&Jye(t))return a;if(a===aE(e.base_,t)){Dy(e);const o=e.type_===1?+t:t,l=pC(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in ns(e)},ownKeys(e){return Reflect.ownKeys(ns(e))},set(e,t,n){const r=Mq(ns(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=aE(ns(e),t),a=i==null?void 0:i[ri];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Zye(n,i)&&(n!==void 0||TL(e.base_,t,e.type_)))return!0;Dy(e),mC(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),oxe(e,t,n)),!0},deleteProperty(e,t){return Dy(e),aE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),mC(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ns(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ry]:!0,[lC]:e.type_!==1||t!=="length",[xx]:r[xx],[Hm]:n[t]}},defineProperty(){za(11)},getPrototypeOf(e){return gf(e.base_)},setPrototypeOf(){za(12)}},Vm={};for(let e in jx){let t=jx[e];Vm[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Vm.deleteProperty=function(e,t){return Vm.set.call(this,e,t,void 0)};Vm.set=function(e,t,n){return jx.set.call(this,e[0],t,n,e[0])};function aE(e,t){const n=e[ri];return(n?ns(n):e)[t]}function lxe(e,t,n){var i;const r=Mq(t,n);return r?Hm in r?r[Hm]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Mq(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 mC(e){e.modified_||(e.modified_=!0,e.parent_&&mC(e.parent_))}function Dy(e){e.copy_||(e.assigned_=new Map,e.copy_=cC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var uxe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Rd(n)&&!Rd(r)){const o=r;r=n;const l=this;return function(d=o,...m){return l.produce(d,f=>r.call(this,f,...m))}}Rd(r)||za(6),i!==void 0&&!Rd(i)&&za(7);let a;if(Ka(n)){const o=DL(this),l=pC(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?fC(o):hC(o)}return RL(o,i),IL(a,o)}else if(!n||!yA(n)){if(a=r(n),a===void 0&&(a=n),a===Cq&&(a=void 0),this.autoFreeze_&&bA(a,!0),i){const o=[],l=[];gc(dC).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else za(1,n)},this.produceWithPatches=(n,r)=>{if(Rd(n))return(l,...c)=>this.produceWithPatches(l,d=>n(d,...c));let i,a;return[this.produce(n,r,(l,c)=>{i=l,a=c}),i,a]},iE(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),iE(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),iE(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Ka(t)||za(8),bs(t)&&(t=sa(t));const n=DL(this),r=pC(n,t,void 0);return r[ri].isManual_=!0,hC(n),r}finishDraft(t,n){const r=t&&t[ri];(!r||!r.isManual_)&&za(9);const{scope_:i}=r;return RL(i,n),IL(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=gc(dC).applyPatches_;return bs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function pC(e,t,n,r){const[i,a]=ub(t)?gc(wx).proxyMap_(t,n):cb(t)?gc(wx).proxySet_(t,n):sxe(t,n);return((n==null?void 0:n.scope_)??Aq()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?axe(n,a,r):a.callbacks_.push(function(c){var m;(m=c.mapSetPlugin_)==null||m.fixSetContents(a);const{patchPlugin_:d}=c;a.modified_&&d&&d.generatePatches_(a,[],c)}),i}function sa(e){return bs(e)||za(10,e),Rq(e)}function Rq(e){if(!Ka(e)||db(e))return e;const t=e[ri];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=cC(e,!0);return sb(n,(i,a)=>{bx(n,i,Rq(a))},r),t&&(t.finalized_=!1),n}var cxe=new uxe,Dq=cxe.produce;function Iq(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var dxe=Iq(),fxe=Iq,hxe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vx:vx.apply(null,arguments)};function Bi(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(zi(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=>_q(r)&&r.type===e,n}var Lq=class xm extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,xm.prototype)}static get[Symbol.species](){return xm}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new xm(...t[0].concat(this)):new xm(...t.concat(this))}};function zL(e){return Ka(e)?Dq(e,()=>{}):e}function ay(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function mxe(e){return typeof e=="boolean"}var pxe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new Lq;return n&&(mxe(n)?o.push(dxe):o.push(fxe(n.extraArgument))),o},zq="RTK_autoBatch",gn=()=>e=>({payload:e,meta:{[zq]:!0}}),$L=e=>t=>{setTimeout(t,e)},$q=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:$L(10):e.type==="callback"?e.queueNotification:$L(e.timeout),d=()=>{o=!1,a&&(a=!1,l.forEach(m=>m()))};return Object.assign({},r,{subscribe(m){const f=()=>i&&m(),g=r.subscribe(f);return l.add(m),()=>{g(),l.delete(m)}},dispatch(m){var f;try{return i=!((f=m==null?void 0:m.meta)!=null&&f[zq]),a=!i,a&&(o||(o=!0,c(d))),r.dispatch(m)}finally{i=!0}}})},gxe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Lq(e);return r&&i.push($q(typeof r=="object"?r:void 0)),i};function vxe(e){const t=pxe(),{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(vA(n))l=Eq(n);else throw new Error(zi(1));let c;typeof r=="function"?c=r(t):c=t();let d=vx;i&&(d=hxe({trace:!1,...typeof i=="object"&&i}));const m=Wye(...c),f=gxe(m);let g=typeof o=="function"?o(f):f();const v=d(...g);return jq(l,a,v)}function Bq(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(zi(28));if(l in t)throw new Error(zi(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 yxe(e){return typeof e=="function"}function xxe(e,t){let[n,r,i]=Bq(t),a;if(yxe(e))a=()=>zL(e());else{const l=zL(e);a=()=>l}function o(l=a(),c){let d=[n[c.type],...r.filter(({matcher:m})=>m(c)).map(({reducer:m})=>m)];return d.filter(m=>!!m).length===0&&(d=[i]),d.reduce((m,f)=>{if(f)if(bs(m)){const v=f(m,c);return v===void 0?m:v}else{if(Ka(m))return Dq(m,g=>f(g,c));{const g=f(m,c);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 bxe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",wxe=(e=21)=>{let t="",n=e;for(;n--;)t+=bxe[Math.random()*64|0];return t},Sxe=Symbol.for("rtk-slice-createasyncthunk");function jxe(e,t){return`${e}/${t}`}function Exe({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[Sxe];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(zi(11));const l=(typeof i.reducers=="function"?i.reducers(Cxe()):i.reducers)||{},c=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(zi(12));if(A in d.sliceCaseReducersByType)throw new Error(zi(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}};c.forEach(k=>{const O=l[k],A={reducerName:k,type:jxe(a,k),createNotation:typeof i.reducers=="function"};kxe(O)?Oxe(A,O,m,t):Nxe(A,O,m)});function f(){const[k={},O=[],A=void 0]=typeof i.extraReducers=="function"?Bq(i.extraReducers):[i.extraReducers],T={...k,...d.sliceCaseReducersByType};return xxe(i.initialState,P=>{for(let z in T)P.addCase(z,T[z]);for(let z of d.sliceMatchers)P.addMatcher(z.matcher,z.reducer);for(let z of O)P.addMatcher(z.matcher,z.reducer);A&&P.addDefaultCase(A)})}const g=k=>k,v=new Map,b=new WeakMap;let w;function S(k,O){return w||(w=f()),w(k,O)}function j(){return w||(w=f()),w.getInitialState()}function C(k,O=!1){function A(P){let z=P[k];return typeof z>"u"&&O&&(z=ay(b,A,j)),z}function T(P=g){const z=ay(v,O,()=>new WeakMap);return ay(z,P,()=>{const L={};for(const[F,D]of Object.entries(i.selectors??{}))L[F]=_xe(D,P,()=>ay(b,P,j),O);return L})}return{reducerPath:k,getSelectors:T,get selectors(){return T(A)},selectSlice:A}}const _={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),{..._,...C(T,!0)}}};return _}}function _xe(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=Exe();function Cxe(){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 Nxe({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!Axe(r))throw new Error(zi(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Bi(e,o):Bi(e))}function kxe(e){return e._reducerDefinitionType==="asyncThunk"}function Axe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Oxe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(zi(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:c,settled:d,options:m}=n,f=i(e,a,m);r.exposeAction(t,f),o&&r.addCase(f.fulfilled,o),l&&r.addCase(f.pending,l),c&&r.addCase(f.rejected,c),d&&r.addMatcher(f.settled,d),r.exposeCaseReducer(t,{fulfilled:o||oy,pending:l||oy,rejected:c||oy,settled:d||oy})}function oy(){}var Txe="task",Fq="listener",Uq="completed",wA="cancelled",Pxe=`task-${wA}`,Mxe=`task-${Uq}`,gC=`${Fq}-${wA}`,Rxe=`${Fq}-${Uq}`,hb=class{constructor(e){mS(this,"name","TaskAbortError");mS(this,"message");this.code=e,this.message=`${Txe} ${wA} (reason: ${e})`}},SA=(e,t)=>{if(typeof e!="function")throw new TypeError(zi(32))},Ex=()=>{},Hq=(e,t=Ex)=>(e.catch(t),e),qq=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Qu=e=>{if(e.aborted)throw new hb(e.reason)};function Vq(e,t){let n=Ex;return new Promise((r,i)=>{const a=()=>i(new hb(e.reason));if(e.aborted){a();return}n=qq(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Ex})}var Dxe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof hb?"cancelled":"rejected",error:n}}finally{t==null||t()}},_x=e=>t=>Hq(Vq(e,t).then(n=>(Qu(e),n))),Kq=e=>{const t=_x(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Ud}=Object,BL={},mb="listenerMiddleware",Ixe=(e,t)=>{const n=r=>qq(e,()=>r.abort(e.reason));return(r,i)=>{SA(r);const a=new AbortController;n(a);const o=Dxe(async()=>{Qu(e),Qu(a.signal);const l=await r({pause:_x(a.signal),delay:Kq(a.signal),signal:a.signal});return Qu(a.signal),l},()=>a.abort(Mxe));return i!=null&&i.autoJoin&&t.push(o.catch(Ex)),{result:_x(e)(o),cancel(){a.abort(Pxe)}}}},Lxe=(e,t)=>{const n=async(r,i)=>{Qu(t);let a=()=>{};const l=[new Promise((c,d)=>{let m=e({predicate:r,effect:(f,g)=>{g.unsubscribe(),c([f,g.getState(),g.getOriginalState()])}});a=()=>{m(),d()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await Vq(t,Promise.race(l));return Qu(t),c}finally{a()}};return(r,i)=>Hq(n(r,i))},Yq=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Bi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(zi(21));return SA(a),{predicate:i,type:t,effect:a}},Xq=Ud(e=>{const{type:t,predicate:n,effect:r}=Yq(e);return{id:wxe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(zi(22))}}},{withTypes:()=>Xq}),FL=(e,t)=>{const{type:n,effect:r,predicate:i}=Yq(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},vC=e=>{e.pending.forEach(t=>{t.abort(gC)})},zxe=(e,t)=>()=>{for(const n of t.keys())vC(n);e.clear()},UL=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},Gq=Ud(Bi(`${mb}/add`),{withTypes:()=>Gq}),$xe=Bi(`${mb}/removeAll`),Wq=Ud(Bi(`${mb}/remove`),{withTypes:()=>Wq}),Bxe=(...e)=>{console.error(`${mb}/error`,...e)},Wp=(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=Bxe}=e;SA(o);const l=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&vC(v)}),c=v=>{const b=FL(t,v)??Xq(v);return l(b)};Ud(c,{withTypes:()=>c});const d=v=>{const b=FL(t,v);return b&&(b.unsubscribe(),v.cancelActive&&vC(b)),!!b};Ud(d,{withTypes:()=>d});const m=async(v,b,w,S)=>{const j=new AbortController,C=Lxe(c,j.signal),_=[];try{v.pending.add(j),r(v),await Promise.resolve(v.effect(b,Ud({},w,{getOriginalState:S,condition:(k,O)=>C(k,O).then(Boolean),take:C,delay:Kq(j.signal),pause:_x(j.signal),extra:a,signal:j.signal,fork:Ixe(j.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((k,O,A)=>{k!==j&&(k.abort(gC),A.delete(k))})},cancel:()=>{j.abort(gC),v.pending.delete(j)},throwIfCancelled:()=>{Qu(j.signal)}})))}catch(k){k instanceof hb||UL(o,k,{raisedBy:"effect"})}finally{await Promise.all(_),j.abort(Rxe),i(v),v.pending.delete(j)}},f=zxe(t,n);return{middleware:v=>b=>w=>{if(!_q(w))return b(w);if(Gq.match(w))return c(w.payload);if($xe.match(w)){f();return}if(Wq.match(w))return d(w.payload);let S=v.getState();const j=()=>{if(S===BL)throw new Error(zi(23));return S};let C;try{if(C=b(w),t.size>0){const _=v.getState(),k=Array.from(t.values());for(const O of k){let A=!1;try{A=O.predicate(w,_,S)}catch(T){A=!1,UL(o,T,{raisedBy:"predicate"})}A&&m(O,w,v,j)}}}finally{S=BL}return C},startListening:c,stopListening:d,clearListeners:f}};function zi(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 Fxe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Qq=Kr({name:"chartLayout",initialState:Fxe,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:Uxe,setLayout:Hxe,setChartSize:qxe,setScale:Vxe}=Qq.actions,Kxe=Qq.reducer;function Zq(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 No(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function HL(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 Dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HL(Object(n),!0).forEach(function(r){Yxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yxe(e,t,n){return(t=Xxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xxe(e){var t=Gxe(e,"string");return typeof t=="symbol"?t:t+""}function Gxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function en(e,t,n){return En(e)||En(t)?n:Co(t)?mc(e,t,n):typeof t=="function"?t(e):n}var Wxe=(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"&&De(e[a]))return Dd(Dd({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&De(e[o]))return Dd(Dd({},e),{},{[o]:e[o]+(i||0)})}return e},ks=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Jq=(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},e9=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:d,tickCount:m,ticks:f,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?xr(a[0]-a[1])*2*w:w,f||g){var S=(f||g||[]).map((j,C)=>{var _=r?r.indexOf(j):j,k=o.map(_);return Pt(k)?{coordinate:k+w,value:j,offset:w,index:C}:null}).filter(yi);return S}return c&&d?d.map((j,C)=>{var _=o.map(j);return Pt(_)?{coordinate:_+w,value:j,index:C,offset:w}:null}).filter(yi):o.ticks&&m!=null?o.ticks(m).map((j,C)=>{var _=o.map(j);return Pt(_)?{coordinate:_+w,value:j,index:C,offset:w}:null}).filter(yi):o.domain().map((j,C)=>{var _=o.map(j);return Pt(_)?{coordinate:_+w,value:r?r[j]:j,index:C,offset:w}:null}).filter(yi)},Qxe=(e,t)=>{if(!t||t.length!==2||!De(t[0])||!De(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(!De(e[0])||e[0]<n)&&(i[0]=n),(!De(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Zxe=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 c=e[l],d=c==null?void 0:c[i];if(d!=null){var m=d[1],f=d[0],g=_o(m)?f:m;g>=0?(d[0]=a,a+=g,d[1]=a):(d[0]=o,o+=g,d[1]=o)}}}},Jxe=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],c=l==null?void 0:l[i];if(c!=null){var d=_o(c[1])?c[0]:c[1];d>=0?(c[0]=a,a+=d,c[1]=a):(c[0]=0,c[1]=0)}}}},e0e={sign:Zxe,expand:Sve,none:hc,silhouette:jve,wiggle:Eve,positive:Jxe},t0e=(e,t,n)=>{var r,i=(r=e0e[n])!==null&&r!==void 0?r:hc,a=wve().keys(t).value((l,c)=>Number(en(l,c,0))).order(oC).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((d,m)=>{var f=en(e[m],t[c],0);Array.isArray(f)&&f.length===2&&De(f[0])&&De(f[1])&&(d[0]=f[0],d[1]=f[1])})}),o};function n0e(e){return e==null?void 0:String(e)}function qL(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!En(i[t.dataKey])){var l=rq(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=en(i,En(o)?t.dataKey:o),d=t.scale.map(c);return De(d)?d:null}var VL=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=en(a,t.dataKey,t.scale.domain()[o]);if(En(l))return null;var c=t.scale.map(l);return De(c)?c-i/2+r:null},r0e=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]},i0e=e=>{var t=e.flat(2).filter(De);return[Math.min(...t),Math.max(...t)]},a0e=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],o0e=(e,t,n)=>{if(e!=null)return a0e(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,l=o.reduce((c,d)=>{var m=Zq(d,t,n),f=i0e(m);return!Pt(f[0])||!Pt(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},KL=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,YL=/^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=ab(t,m=>m.coordinate),a=1/0,o=1,l=i.length;o<l;o++){var c=i[o],d=i[o-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((d==null?void 0:d.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function XL(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Dd(Dd({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Hf(e,t){if(e)return String(e);if(typeof t=="string")return t}var s0e=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},l0e=(e,t)=>t==="centric"?e.angle:e.radius,As=e=>e.layout.width,Os=e=>e.layout.height,u0e=e=>e.layout.scale,t9=e=>e.layout.margin,pb=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),gb=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),n9="data-recharts-item-index",r9="data-recharts-item-id",Qp=60;function GL(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?GL(Object(n),!0).forEach(function(r){c0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function c0e(e,t,n){return(t=d0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d0e(e){var t=f0e(e,"string");return typeof t=="symbol"?t:t+""}function f0e(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 h0e=e=>e.brush.height;function m0e(e){var t=gb(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Qp;return n+i}return n},0)}function p0e(e){var t=gb(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Qp;return n+i}return n},0)}function g0e(e){var t=pb(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function v0e(e){var t=pb(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var cr=le([As,Os,t9,h0e,m0e,p0e,g0e,v0e,wq,Hye],(e,t,n,r,i,a,o,l,c,d)=>{var m={left:(n.left||0)+i,right:(n.right||0)+a},f={top:(n.top||0)+o,bottom:(n.bottom||0)+l},g=sy(sy({},f),m),v=g.bottom;g.bottom+=r,g=Wxe(g,c,d);var b=e-g.left-g.right,w=t-g.top-g.bottom;return sy(sy({brushBottom:v},g),{},{width:Math.max(b,0),height:Math.max(w,0)})}),y0e=le(cr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),jA=le(As,Os,(e,t)=>({x:0,y:0,width:e,height:t})),x0e=y.createContext(null),Yr=()=>y.useContext(x0e)!=null,vb=e=>e.brush,yb=le([vb,cr,t9],(e,t,n)=>({height:e.height,x:De(e.x)?e.x:t.left,y:De(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:De(e.width)?e.width:t.width})),oE={},sE={},lE={},WL;function b0e(){return WL||(WL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,l=null;const c=a!=null&&a.includes("leading"),d=a==null||a.includes("trailing"),m=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},f=()=>{d&&m(),w()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,f()},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 _=g==null;v(),c&&_&&m()};return j.schedule=v,j.cancel=w,j.flush=S,i==null||i.addEventListener("abort",w,{once:!0}),j}e.debounce=t})(lE)),lE}var QL;function w0e(){return QL||(QL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=b0e();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:l=!0,maxWait:c}=a,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let m,f=null;const g=t.debounce(function(...w){m=r.apply(this,w),f=null},i,{edges:d}),v=function(...w){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(m=r.apply(this,w),f=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})(sE)),sE}var ZL;function S0e(){return ZL||(ZL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=w0e();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})(oE)),oE}var uE,JL;function j0e(){return JL||(JL=1,uE=S0e().throttle),uE}var E0e=j0e();const _0e=Hi(E0e);var Cx=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++]))}},yo={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},i9=(e,t,n)=>{var{width:r=yo.width,height:i=yo.height,aspect:a,maxHeight:o}=n,l=pc(r)?e:Number(r),c=pc(i)?t:Number(i);return a&&a>0&&(l?c=l/a:c&&(l=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},C0e={width:0,height:0,overflow:"visible"},N0e={width:0,overflowX:"visible"},k0e={height:0,overflowY:"visible"},A0e={},O0e=e=>{var{width:t,height:n}=e,r=pc(t),i=pc(n);return r&&i?C0e:r?N0e:i?k0e:A0e};function T0e(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=yo.width,a=yo.height):i===void 0?i=r&&r>0?void 0:yo.width:a===void 0&&(a=r&&r>0?void 0:yo.height),{width:i,height:a}}function yC(){return yC=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},yC.apply(null,arguments)}function e3(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?e3(Object(n),!0).forEach(function(r){P0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P0e(e,t,n){return(t=M0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M0e(e){var t=R0e(e,"string");return typeof t=="symbol"?t:t+""}function R0e(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 a9=y.createContext(yo.initialDimension);function D0e(e){return No(e.width)&&No(e.height)}function o9(e){var{children:t,width:n,height:r}=e,i=y.useMemo(()=>({width:n,height:r}),[n,r]);return D0e(i)?y.createElement(a9.Provider,{value:i},t):null}var EA=()=>y.useContext(a9),I0e=y.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=yo.initialDimension,width:i,height:a,minWidth:o=yo.minWidth,minHeight:l,maxHeight:c,children:d,debounce:m=yo.debounce,id:f,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}),_=y.useCallback((P,z)=>{C(L=>{var F=Math.round(P),D=Math.round(z);return L.containerWidth===F&&L.containerHeight===D?L:{containerWidth:F,containerHeight:D}})},[]);y.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return eu;var P=D=>{var X,R=D[0];if(R!=null){var{width:q,height:$}=R.contentRect;_(q,$),(X=S.current)===null||X===void 0||X.call(S,q,$)}};m>0&&(P=_0e(P,m,{trailing:!0,leading:!1}));var z=new ResizeObserver(P),{width:L,height:F}=w.current.getBoundingClientRect();return _(L,F),z.observe(w.current),()=>{z.disconnect()}},[_,m]);var{containerWidth:k,containerHeight:O}=j;Cx(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:T}=i9(k,O,{width:i,height:a,aspect:n,maxHeight:c});return Cx(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:f?"".concat(f):void 0,className:Dt("recharts-responsive-container",g),style:t3(t3({},b),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:w},y.createElement("div",{style:O0e({width:i,height:a})},y.createElement(o9,{width:A,height:T},d)))}),_A=y.forwardRef((e,t)=>{var n=EA();if(No(n.width)&&No(n.height))return e.children;var{width:r,height:i}=T0e({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=i9(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return De(a)&&De(o)?y.createElement(o9,{width:a,height:o},e.children):y.createElement(I0e,yC({},e,{width:r,height:i,ref:t}))});function CA(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 xb=()=>{var e,t=Yr(),n=$e(y0e),r=$e(yb),i=(e=$e(vb))===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}},L0e={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},s9=()=>{var e;return(e=$e(cr))!==null&&e!==void 0?e:L0e},NA=()=>$e(As),kA=()=>$e(Os),z0e=()=>$e(e=>e.layout.margin),Ut=e=>e.layout.layoutType,Pc=()=>$e(Ut),l9=()=>{var e=Pc();if(e==="horizontal"||e==="vertical")return e},u9=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},$0e=()=>{var e=Pc();return e!==void 0},Zp=e=>{var t=tn(),n=Yr(),{width:r,height:i}=e,a=EA(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),y.useEffect(()=>{!n&&No(o)&&No(l)&&t(qxe({width:o,height:l}))},[t,n,o,l]),null},c9=Symbol.for("immer-nothing"),n3=Symbol.for("immer-draftable"),Fi=Symbol.for("immer-state");function $a(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Km=Object.getPrototypeOf;function yf(e){return!!e&&!!e[Fi]}function vc(e){var t;return e?d9(e)||Array.isArray(e)||!!e[n3]||!!((t=e.constructor)!=null&&t[n3])||Jp(e)||wb(e):!1}var B0e=Object.prototype.constructor.toString(),r3=new WeakMap;function d9(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=r3.get(n);return r===void 0&&(r=Function.toString.call(n),r3.set(n,r)),r===B0e}function Nx(e,t,n=!0){bb(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 bb(e){const t=e[Fi];return t?t.type_:Array.isArray(e)?1:Jp(e)?2:wb(e)?3:0}function xC(e,t){return bb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function f9(e,t,n){const r=bb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function F0e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Jp(e){return e instanceof Map}function wb(e){return e instanceof Set}function Mu(e){return e.copy_||e.base_}function bC(e,t){if(Jp(e))return new Map(e);if(wb(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=d9(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Fi];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(Km(e),r)}else{const r=Km(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function AA(e,t=!1){return Sb(e)||yf(e)||!vc(e)||(bb(e)>1&&Object.defineProperties(e,{set:ly,add:ly,clear:ly,delete:ly}),Object.freeze(e),t&&Object.values(e).forEach(n=>AA(n,!0))),e}function U0e(){$a(2)}var ly={value:U0e};function Sb(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var H0e={};function yc(e){const t=H0e[e];return t||$a(0,e),t}var Ym;function h9(){return Ym}function q0e(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function i3(e,t){t&&(yc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wC(e){SC(e),e.drafts_.forEach(V0e),e.drafts_=null}function SC(e){e===Ym&&(Ym=e.parent_)}function a3(e){return Ym=q0e(Ym,e)}function V0e(e){const t=e[Fi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function o3(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Fi].modified_&&(wC(t),$a(4)),vc(e)&&(e=kx(t,e),t.parent_||Ax(t,e)),t.patches_&&yc("Patches").generateReplacementPatches_(n[Fi].base_,e,t.patches_,t.inversePatches_)):e=kx(t,n,[]),wC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==c9?e:void 0}function kx(e,t,n){if(Sb(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Fi];if(!i)return Nx(t,(a,o)=>s3(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Ax(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),Nx(o,(c,d)=>s3(e,i,a,c,d,n,l),r),Ax(e,a,!1),n&&e.patches_&&yc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function s3(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=Sb(i);if(!(l&&!o)){if(yf(i)){const c=a&&t&&t.type_!==3&&!xC(t.assigned_,r)?a.concat(r):void 0,d=kx(e,i,c);if(f9(n,r,d),yf(d))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(vc(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;kx(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Jp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Ax(e,i)}}}function Ax(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&AA(t,n)}function K0e(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:h9(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=OA;n&&(i=[r],a=Xm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var OA={get(e,t){if(t===Fi)return e;const n=Mu(e);if(!xC(n,t))return Y0e(e,n,t);const r=n[t];return e.finalized_||!vc(r)?r:r===cE(e.base_,t)?(dE(e),e.copy_[t]=EC(r,e)):r},has(e,t){return t in Mu(e)},ownKeys(e){return Reflect.ownKeys(Mu(e))},set(e,t,n){const r=m9(Mu(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=cE(Mu(e),t),a=i==null?void 0:i[Fi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(F0e(n,i)&&(n!==void 0||xC(e.base_,t)))return!0;dE(e),jC(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 cE(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dE(e),jC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Mu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){$a(11)},getPrototypeOf(e){return Km(e.base_)},setPrototypeOf(){$a(12)}},Xm={};Nx(OA,(e,t)=>{Xm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Xm.deleteProperty=function(e,t){return Xm.set.call(this,e,t,void 0)};Xm.set=function(e,t,n){return OA.set.call(this,e[0],t,n,e[0])};function cE(e,t){const n=e[Fi];return(n?Mu(n):e)[t]}function Y0e(e,t,n){var i;const r=m9(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function m9(e,t){if(!(t in e))return;let n=Km(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Km(n)}}function jC(e){e.modified_||(e.modified_=!0,e.parent_&&jC(e.parent_))}function dE(e){e.copy_||(e.copy_=bC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var X0e=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(c=a,...d){return o.produce(c,m=>n.call(this,m,...d))}}typeof n!="function"&&$a(6),r!==void 0&&typeof r!="function"&&$a(7);let i;if(vc(t)){const a=a3(this),o=EC(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?wC(a):SC(a)}return i3(a,r),o3(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===c9&&(i=void 0),this.autoFreeze_&&AA(i,!0),r){const a=[],o=[];yc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else $a(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...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){vc(e)||$a(8),yf(e)&&(e=G0e(e));const t=a3(this),n=EC(e,void 0);return n[Fi].isManual_=!0,SC(t),n}finishDraft(e,t){const n=e&&e[Fi];(!n||!n.isManual_)&&$a(9);const{scope_:r}=n;return i3(r,t),o3(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=yc("Patches").applyPatches_;return yf(e)?r(e,t):this.produce(e,i=>r(i,t))}};function EC(e,t){const n=Jp(e)?yc("MapSet").proxyMap_(e,t):wb(e)?yc("MapSet").proxySet_(e,t):K0e(e,t);return(t?t.scope_:h9()).drafts_.push(n),n}function G0e(e){return yf(e)||$a(10,e),p9(e)}function p9(e){if(!vc(e)||Sb(e))return e;const t=e[Fi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=bC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=bC(e,!0);return Nx(n,(i,a)=>{f9(n,i,p9(a))},r),t&&(t.finalized_=!1),n}var W0e=new X0e;W0e.produce;var Q0e={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},g9=Kr({name:"legend",initialState:Q0e,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:gn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=sa(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:gn()},removeLegendPayload:{reducer(e,t){var n=sa(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:gn()}}}),{setLegendSize:l3,setLegendSettings:Z0e,addLegendPayload:v9,replaceLegendPayload:y9,removeLegendPayload:x9}=g9.actions,J0e=g9.reducer,fE={exports:{}},hE={};/**
 * @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 u3;function ebe(){if(u3)return hE;u3=1;var e=Pf();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&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 hE.useSyncExternalStoreWithSelector=function(c,d,m,f,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=f(O),g!==void 0&&b.hasValue){var A=b.value;if(g(A,O))return _=A}return _=O}if(A=_,n(C,O))return A;var T=f(O);return g!==void 0&&g(A,T)?(C=O,A):(C=O,_=T)}var j=!1,C,_,k=m===void 0?null:m;return[function(){return S(d())},k===null?void 0:function(){return S(k())}]},[d,m,f,g]);var w=r(c,v[0],v[1]);return a(function(){b.hasValue=!0,b.value=w},[w]),l(w),w},hE}var c3;function tbe(){return c3||(c3=1,fE.exports=ebe()),fE.exports}tbe();function nbe(e){e()}function rbe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){nbe(()=>{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 d3={notify(){},get:()=>[]};function ibe(e,t){let n,r=d3,i=0,a=!1;function o(w){m();const S=r.subscribe(w);let j=!1;return()=>{j||(j=!0,S(),f())}}function l(){r.notify()}function c(){b.onStateChange&&b.onStateChange()}function d(){return a}function m(){i++,n||(n=e.subscribe(c),r=rbe())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=d3)}function g(){a||(a=!0,m())}function v(){a&&(a=!1,f())}const b={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return b}var abe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",obe=abe(),sbe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",lbe=sbe(),ube=()=>obe||lbe?y.useLayoutEffect:y.useEffect,cbe=ube();function f3(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function dbe(e,t){if(f3(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])||!f3(e[n[i]],t[n[i]]))return!1;return!0}var mE=Symbol.for("react-redux-context"),pE=typeof globalThis<"u"?globalThis:{};function fbe(){if(!y.createContext)return{};const e=pE[mE]??(pE[mE]=new Map);let t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var hbe=fbe();function mbe(e){const{children:t,context:n,serverState:r,store:i}=e,a=y.useMemo(()=>{const c=ibe(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=y.useMemo(()=>i.getState(),[i]);cbe(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,o]);const l=n||hbe;return y.createElement(l.Provider,{value:a},t)}var pbe=mbe,gbe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function vbe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function qf(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(gbe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!dbe(e[r],t[r]))return!1}else if(!vbe(e[r],t[r]))return!1;return!0}var ybe=["contextPayload"];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 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 xf(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){xbe(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 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)}function Sbe(e,t){if(e==null)return{};var n,r,i=jbe(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 jbe(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 Ebe(e){return e.value}function _be(e){var{contextPayload:t}=e,n=Sbe(e,ybe),r=gq(t,e.payloadUniqBy,Ebe),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(Jve,i)}function Cbe(e,t,n,r,i,a){var{layout:o,align:l,verticalAlign:c}=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))&&(c==="middle"?m={top:((i||0)-a.height)/2}:m=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),xf(xf({},d),m)}function Nbe(e){var t=tn();return y.useEffect(()=>{t(Z0e(e))},[t,e]),null}function kbe(e){var t=tn();return y.useEffect(()=>(t(l3(e)),()=>{t(l3({width:0,height:0}))}),[t,e]),null}function Abe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Obe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Tbe(e){var t=Zn(e,Obe),n=Kye(),r=Vge(),i=z0e(),{width:a,height:o,wrapperStyle:l,portal:c}=t,[d,m]=Sq([n]),f=NA(),g=kA();if(f==null||g==null)return null;var v=f-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),b=Abe(t.layout,o,a,v),w=c?l:xf(xf({position:"absolute",width:(b==null?void 0:b.width)||a||"auto",height:(b==null?void 0:b.height)||o||"auto"},Cbe(l,t,i,f,g,d)),l),S=c??r;if(S==null||n==null)return null;var j=y.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:m},y.createElement(Nbe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&y.createElement(kbe,{width:d.width,height:d.height}),y.createElement(_be,_C({},t,b,{margin:i,chartWidth:f,chartHeight:g,contextPayload:n})));return Gl.createPortal(j,S)}var b9=y.memo(Tbe,qf);b9.displayName="Legend";function CC(){return CC=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},CC.apply(null,arguments)}function m3(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 nm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m3(Object(n),!0).forEach(function(r){Pbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pbe(e,t,n){return(t=Mbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mbe(e){var t=Rbe(e,"string");return typeof t=="symbol"?t:t+""}function Rbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dbe(e){return Array.isArray(e)&&Co(e[0])&&Co(e[1])?e.join(" ~ "):e}var Sd={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 Ibe(e,t){return t==null?e:ab(e,t)}var Lbe=e=>{var{separator:t=Sd.separator,contentStyle:n,itemStyle:r,labelStyle:i=Sd.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:m,labelFormatter:f,accessibilityLayer:g=Sd.accessibilityLayer}=e,v=()=>{if(a&&a.length){var O={padding:0,margin:0},A=Ibe(a,l),T=A.map((P,z)=>{if(P.type==="none")return null;var L=P.formatter||o||Dbe,{value:F,name:D}=P,X=F,R=D;if(L){var q=L(F,D,P,z,a);if(Array.isArray(q))[X,R]=q;else if(q!=null)X=q;else return null}var $=nm(nm({},Sd.itemStyle),{},{color:P.color||Sd.itemStyle.color},r);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:$},Co(R)?y.createElement("span",{className:"recharts-tooltip-item-name"},R):null,Co(R)?y.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,y.createElement("span",{className:"recharts-tooltip-item-value"},X),y.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:O},T)}return null},b=nm(nm({},Sd.contentStyle),n),w=nm({margin:0},i),S=!En(m),j=S?m:"",C=Dt("recharts-default-tooltip",c),_=Dt("recharts-tooltip-label",d);S&&f&&a!==void 0&&a!==null&&(j=f(m,a));var k=g?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",CC({className:C,style:b},k),y.createElement("p",{className:_,style:w},y.isValidElement(j)?j:"".concat(j)),v())},rm="recharts-tooltip-wrapper",zbe={visibility:"hidden"};function $be(e){var{coordinate:t,translateX:n,translateY:r}=e;return Dt(rm,{["".concat(rm,"-right")]:De(n)&&t&&De(t.x)&&n>=t.x,["".concat(rm,"-left")]:De(n)&&t&&De(t.x)&&n<t.x,["".concat(rm,"-bottom")]:De(r)&&t&&De(t.y)&&r>=t.y,["".concat(rm,"-top")]:De(r)&&t&&De(t.y)&&r<t.y})}function p3(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(a&&De(a[r]))return a[r];var m=n[r]-l-(i>0?i:0),f=n[r]+i;if(t[r])return o[r]?m:f;var g=c[r];if(g==null)return 0;if(o[r]){var v=m,b=g;return v<b?Math.max(f,g):Math.max(m,g)}if(d==null)return 0;var w=f+l,S=g+d;return w>S?Math.max(m,g):Math.max(f,g)}function Bbe(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 Fbe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:d}=e,m,f,g;return l.height>0&&l.width>0&&n?(f=p3({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),g=p3({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),m=Bbe({translateX:f,translateY:g,useTranslate3d:c})):m=zbe,{cssProperties:m,cssClasses:$be({translateX:f,translateY:g,coordinate:n})}}var Ube=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),eg={isSsr:Ube()};function w9(){var[e,t]=y.useState(()=>eg.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 g3(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 jd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g3(Object(n),!0).forEach(function(r){Hbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hbe(e,t,n){return(t=qbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qbe(e){var t=Vbe(e,"string");return typeof t=="symbol"?t:t+""}function Vbe(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 Kbe(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Ybe(e){var t,n,r,i,a,o,l=w9(),[c,d]=y.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));y.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,j,C,_;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.coordinate)===null||_===void 0?void 0:_.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]),c.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==c.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==c.dismissedAtCoordinate.y)&&d(jd(jd({},c),{},{dismissed:!1}));var{cssClasses:m,cssProperties:f}=Fbe({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?{}:jd(jd({transition:Kbe({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},f),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=jd(jd({},g),{},{visibility:!c.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 Xbe=y.memo(Ybe),S9=()=>{var e;return(e=$e(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function NC(){return NC=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},NC.apply(null,arguments)}function v3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function y3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v3(Object(n),!0).forEach(function(r){Gbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gbe(e,t,n){return(t=Wbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wbe(e){var t=Qbe(e,"string");return typeof t=="symbol"?t:t+""}function Qbe(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 x3={curveBasisClosed:cve,curveBasisOpen:dve,curveBasis:uve,curveBumpX:Gge,curveBumpY:Wge,curveLinearClosed:fve,curveLinear:rb,curveMonotoneX:hve,curveMonotoneY:mve,curveNatural:pve,curveStep:gve,curveStepAfter:yve,curveStepBefore:vve},Ox=e=>Pt(e.x)&&Pt(e.y),b3=e=>e.base!=null&&Ox(e.base)&&Ox(e),im=e=>e.x,am=e=>e.y,Zbe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Yp(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=x3["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return x3[n]||rb},w3={connectNulls:!1,type:"linear"},Jbe=e=>{var{type:t=w3.type,points:n=[],baseLine:r,layout:i,connectNulls:a=w3.connectNulls}=e,o=Zbe(t,i),l=a?n.filter(Ox):n;if(Array.isArray(r)){var c,d=n.map((b,w)=>y3(y3({},b),{},{base:r[w]}));i==="vertical"?c=ty().y(am).x1(im).x0(b=>b.base.x):c=ty().x(im).y1(am).y0(b=>b.base.y);var m=c.defined(b3).curve(o),f=a?d.filter(b3):d;return m(f)}var g;i==="vertical"&&De(r)?g=ty().y(am).x1(im).x0(r):De(r)?g=ty().x(im).y1(am).y0(r):g=qH().x(im).y(am);var v=g.defined(Ox).curve(o);return v(l)},TA=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Pc();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?Jbe(o):r;return y.createElement("path",NC({},$i(e),mA(e),{className:Dt("recharts-curve",t),d:l===null?void 0:l,ref:i}))},ewe=["x","y","top","left","width","height","className"];function kC(){return kC=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},kC.apply(null,arguments)}function S3(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 twe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S3(Object(n),!0).forEach(function(r){nwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nwe(e,t,n){return(t=rwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rwe(e){var t=iwe(e,"string");return typeof t=="symbol"?t:t+""}function iwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function awe(e,t){if(e==null)return{};var n,r,i=owe(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 owe(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 swe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),lwe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=awe(e,ewe),d=twe({x:t,y:n,top:r,left:i,width:a,height:o},c);return!De(t)||!De(n)||!De(a)||!De(o)||!De(r)||!De(i)?null:y.createElement("path",kC({},ni(d),{className:Dt("recharts-cross",l),d:swe(t,n,a,o,r,i)}))};function uwe(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 j3(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 E3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j3(Object(n),!0).forEach(function(r){cwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cwe(e,t,n){return(t=dwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dwe(e){var t=fwe(e,"string");return typeof t=="symbol"?t:t+""}function fwe(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 hwe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),j9=(e,t,n)=>e.map(r=>"".concat(hwe(r)," ").concat(t,"ms ").concat(n)).join(","),mwe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Gm=(e,t)=>Object.keys(t).reduce((n,r)=>E3(E3({},n),{},{[r]:e(r,t[r])}),{});function _3(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 ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_3(Object(n),!0).forEach(function(r){pwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pwe(e,t,n){return(t=gwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gwe(e){var t=vwe(e,"string");return typeof t=="symbol"?t:t+""}function vwe(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 Tx=(e,t,n)=>e+(t-e)*n,AC=e=>{var{from:t,to:n}=e;return t!==n},E9=(e,t,n)=>{var r=Gm((i,a)=>{if(AC(a)){var[o,l]=e(a.from,a.to,a.velocity);return ar(ar({},a),{},{from:o,velocity:l})}return a},t);return n<1?Gm((i,a)=>AC(a)&&r[i]!=null?ar(ar({},a),{},{velocity:Tx(a.velocity,r[i].velocity,n),from:Tx(a.from,r[i].from,n)}):a,t):E9(e,r,n-1)};function ywe(e,t,n,r,i,a){var o,l=r.reduce((g,v)=>ar(ar({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),c=()=>Gm((g,v)=>v.from,l),d=()=>!Object.values(l).filter(AC).length,m=null,f=g=>{o||(o=g);var v=g-o,b=v/n.dt;l=E9(n,l,b),i(ar(ar(ar({},e),t),c())),o=g,d()||(m=a.setTimeout(f))};return()=>(m=a.setTimeout(f),()=>{var g;(g=m)===null||g===void 0||g()})}function xwe(e,t,n,r,i,a,o){var l=null,c=i.reduce((f,g)=>{var v=e[g],b=t[g];return v==null||b==null?f:ar(ar({},f),{},{[g]:[v,b]})},{}),d,m=f=>{d||(d=f);var g=(f-d)/r,v=Gm((w,S)=>Tx(...S,n(g)),c);if(a(ar(ar(ar({},e),t),v)),g<1)l=o.setTimeout(m);else{var b=Gm((w,S)=>Tx(...S,n(1)),c);a(ar(ar(ar({},e),t),b))}};return()=>(l=o.setTimeout(m),()=>{var f;(f=l)===null||f===void 0||f()})}const bwe=(e,t,n,r,i,a)=>{var o=mwe(e,t);return n==null?()=>(i(ar(ar({},e),t)),()=>{}):n.isStepper===!0?ywe(e,t,n,o,i,a):xwe(e,t,n,r,o,i,a)};var Px=1e-4,_9=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],C9=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),C3=(e,t)=>n=>{var r=_9(e,t);return C9(r,n)},wwe=(e,t)=>n=>{var r=_9(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return C9(i,n)},Swe=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]]},jwe=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=Swe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Ewe=(e,t,n,r)=>{var i=C3(e,n),a=C3(t,r),o=wwe(e,n),l=d=>d>1?1:d<0?0:d,c=d=>{for(var m=d>1?1:d,f=m,g=0;g<8;++g){var v=i(f)-m,b=o(f);if(Math.abs(v-m)<Px||b<Px)return a(f);f=l(f-v/b)}return a(f)};return c.isStepper=!1,c},N3=function(){return Ewe(...jwe(...arguments))},_we=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,c)=>{var d=-(o-l)*n,m=c*r,f=c+(d-m)*i/1e3,g=c*i/1e3+o;return Math.abs(g-l)<Px&&Math.abs(f)<Px?[l,0]:[g,f]};return a.isStepper=!0,a.dt=i,a},Cwe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return N3(e);case"spring":return _we();default:if(e.split("(")[0]==="cubic-bezier")return N3(e)}return typeof e=="function"?e:null};function Nwe(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...d]=l;if(typeof c=="number"){i=e.setTimeout(a.bind(null,d),c);return}a(c),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 kwe{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 Awe(){return Nwe(new kwe)}var Owe=y.createContext(Awe);function Twe(e,t){var n=y.useContext(Owe);return y.useMemo(()=>t??n(e),[e,t,n])}var Pwe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},k3={t:0},gE={t:1};function tg(e){var t=Zn(e,Pwe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,m=w9(),f=n==="auto"?!eg.isSsr&&!m:n,g=Twe(t.animationId,t.animationManager),[v,b]=y.useState(f?k3:gE),w=y.useRef(null);return y.useEffect(()=>{f||b(gE)},[f]),y.useEffect(()=>{if(!f||!r)return eu;var S=bwe(k3,gE,Cwe(a),i,b,g.getTimeoutController()),j=()=>{w.current=S()};return g.start([c,o,j,i,l]),()=>{g.stop(),w.current&&w.current(),l()}},[f,r,i,a,o,c,l,g]),d(v.t)}function ng(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=y.useRef(Um(t)),r=y.useRef(e);return r.current!==e&&(n.current=Um(t),r.current=e),n.current}var Mwe=["radius"],Rwe=["radius"],A3,O3,T3,P3,M3,R3,D3,I3,L3,z3;function $3(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 B3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$3(Object(n),!0).forEach(function(r){Dwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dwe(e,t,n){return(t=Iwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iwe(e){var t=Lwe(e,"string");return typeof t=="symbol"?t:t+""}function Lwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mx(){return Mx=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},Mx.apply(null,arguments)}function F3(e,t){if(e==null)return{};var n,r,i=zwe(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 zwe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function so(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var U3=(e,t,n,r,i)=>{var a=Il(n),o=Il(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,d=a>=0?1:-1,m=o>=0&&a>=0||o<0&&a<0?1:0,f;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}f=Ln(A3||(A3=so(["M",",",""])),e,t+c*g[0]),g[0]>0&&(f+=Ln(O3||(O3=so(["A ",",",",0,0,",",",",",""])),g[0],g[0],m,e+d*g[0],t)),f+=Ln(T3||(T3=so(["L ",",",""])),e+n-d*g[1],t),g[1]>0&&(f+=Ln(P3||(P3=so(["A ",",",",0,0,",`,
        `,",",""])),g[1],g[1],m,e+n,t+c*g[1])),f+=Ln(M3||(M3=so(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(f+=Ln(R3||(R3=so(["A ",",",",0,0,",`,
        `,",",""])),g[2],g[2],m,e+n-d*g[2],t+r)),f+=Ln(D3||(D3=so(["L ",",",""])),e+d*g[3],t+r),g[3]>0&&(f+=Ln(I3||(I3=so(["A ",",",",0,0,",`,
        `,",",""])),g[3],g[3],m,e,t+r-c*g[3])),f+="Z"}else if(l>0&&i===+i&&i>0){var j=Math.min(l,i);f=Ln(L3||(L3=so(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+c*j,j,j,m,e+d*j,t,e+n-d*j,t,j,j,m,e+n,t+c*j,e+n,t+r-c*j,j,j,m,e+n-d*j,t+r,e+d*j,t+r,j,j,m,e,t+r-c*j)}else f=Ln(z3||(z3=so(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},H3={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},N9=e=>{var t=Zn(e,H3),n=y.useRef(null),[r,i]=y.useState(-1);y.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var V=n.current.getTotalLength();V&&i(V)}catch{}},[]);var{x:a,y:o,width:l,height:c,radius:d,className:m}=t,{animationEasing:f,animationDuration:g,animationBegin:v,isAnimationActive:b,isUpdateAnimationActive:w}=t,S=y.useRef(l),j=y.useRef(c),C=y.useRef(a),_=y.useRef(o),k=y.useMemo(()=>({x:a,y:o,width:l,height:c,radius:d}),[a,o,l,c,d]),O=ng(k,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var A=Dt("recharts-rectangle",m);if(!w){var T=ni(t),{radius:P}=T,z=F3(T,Mwe);return y.createElement("path",Mx({},z,{x:Il(a),y:Il(o),width:Il(l),height:Il(c),radius:typeof d=="number"?d:void 0,className:A,d:U3(a,o,l,c,d)}))}var L=S.current,F=j.current,D=C.current,X=_.current,R="0px ".concat(r===-1?1:r,"px"),q="".concat(r,"px ").concat(r,"px"),$=j9(["strokeDasharray"],g,typeof f=="string"?f:H3.animationEasing);return y.createElement(tg,{animationId:O,key:O,canBegin:r>0,duration:g,easing:f,isActive:w,begin:v},V=>{var G=wn(L,l,V),K=wn(F,c,V),I=wn(D,a,V),H=wn(X,o,V);n.current&&(S.current=G,j.current=K,C.current=I,_.current=H);var U;b?V>0?U={transition:$,strokeDasharray:q}:U={strokeDasharray:R}:U={strokeDasharray:q};var B=ni(t),{radius:Q}=B,Z=F3(B,Rwe);return y.createElement("path",Mx({},Z,{radius:typeof d=="number"?d:void 0,className:A,d:U3(I,H,G,K,d),ref:n,style:B3(B3({},U),t.style)}))})};function q3(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 V3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q3(Object(n),!0).forEach(function(r){$we(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $we(e,t,n){return(t=Bwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bwe(e){var t=Fwe(e,"string");return typeof t=="symbol"?t:t+""}function Fwe(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 Rx=Math.PI/180,Uwe=e=>e*180/Math.PI,Gn=(e,t,n,r)=>({x:e+Math.cos(-Rx*r)*n,y:t+Math.sin(-Rx*r)*n}),k9=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},Hwe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},qwe=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Hwe({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var l=(n-i)/o,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:o,angle:Uwe(c),angleInRadian:c}},Vwe=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}},Kwe=(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},Ywe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=qwe({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:d}=Vwe(t),m=a,f;if(c<=d){for(;m>d;)m-=360;for(;m<c;)m+=360;f=m>=c&&m<=d}else{for(;m>c;)m-=360;for(;m<d;)m+=360;f=m>=d&&m<=c}return f?V3(V3({},t),{},{radius:i,angle:Kwe(m,t)}):null};function A9(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Gn(t,n,r,i),l=Gn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var K3,Y3,X3,G3,W3,Q3,Z3;function OC(){return OC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OC.apply(null,arguments)}function Lu(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Xwe=(e,t)=>{var n=xr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},uy=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,d=l*(o?1:-1)+r,m=Math.asin(l/d)/Rx,f=c?i:i+a*m,g=Gn(t,n,d,f),v=Gn(t,n,r,f),b=c?i-a*m:i,w=Gn(t,n,d*Math.cos(m*Rx),b);return{center:g,circleTangency:v,lineTangency:w,theta:m}},O9=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=Xwe(a,o),c=a+l,d=Gn(t,n,i,a),m=Gn(t,n,i,c),f=Ln(K3||(K3=Lu(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),d.x,d.y,i,i,+(Math.abs(l)>180),+(a>c),m.x,m.y);if(r>0){var g=Gn(t,n,r,a),v=Gn(t,n,r,c);f+=Ln(Y3||(Y3=Lu(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),v.x,v.y,r,r,+(Math.abs(l)>180),+(a<=c),g.x,g.y)}else f+=Ln(X3||(X3=Lu(["L ",","," Z"])),t,n);return f},Gwe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,m=xr(d-c),{circleTangency:f,lineTangency:g,theta:v}=uy({cx:t,cy:n,radius:i,angle:c,sign:m,cornerRadius:a,cornerIsExternal:l}),{circleTangency:b,lineTangency:w,theta:S}=uy({cx:t,cy:n,radius:i,angle:d,sign:-m,cornerRadius:a,cornerIsExternal:l}),j=l?Math.abs(c-d):Math.abs(c-d)-v-S;if(j<0)return o?Ln(G3||(G3=Lu(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),g.x,g.y,a,a,a*2,a,a,-a*2):O9({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:d});var C=Ln(W3||(W3=Lu(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),g.x,g.y,a,a,+(m<0),f.x,f.y,i,i,+(j>180),+(m<0),b.x,b.y,a,a,+(m<0),w.x,w.y);if(r>0){var{circleTangency:_,lineTangency:k,theta:O}=uy({cx:t,cy:n,radius:r,angle:c,sign:m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:A,lineTangency:T,theta:P}=uy({cx:t,cy:n,radius:r,angle:d,sign:-m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),z=l?Math.abs(c-d):Math.abs(c-d)-O-P;if(z<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=Ln(Q3||(Q3=Lu(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(m<0),A.x,A.y,r,r,+(z>180),+(m>0),_.x,_.y,a,a,+(m<0),k.x,k.y)}else C+=Ln(Z3||(Z3=Lu(["L",",","Z"])),t,n);return C},Wwe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},T9=e=>{var t=Zn(e,Wwe),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:m,className:f}=t;if(a<i||d===m)return null;var g=Dt("recharts-sector",f),v=a-i,b=Hr(o,v,0,!0),w;return b>0&&Math.abs(d-m)<360?w=Gwe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(b,v/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:m}):w=O9({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:d,endAngle:m}),y.createElement("path",OC({},ni(t),{className:g,d:w}))};function Qwe(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(aq(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=Gn(r,i,a,l),d=Gn(r,i,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return A9(t)}}var vE={},yE={},xE={},J3;function Zwe(){return J3||(J3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xq();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(xE)),xE}var ez;function Jwe(){return ez||(ez=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zwe();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})(yE)),yE}var tz;function e1e(){return tz||(tz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bq(),n=Jwe();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),c=new Array(l);for(let d=0;d<l;d++)c[d]=i,i+=o;return c}e.range=r})(vE)),vE}var bE,nz;function t1e(){return nz||(nz=1,bE=e1e().range),bE}var n1e=t1e();const P9=Hi(n1e);var Ts=e=>e.chartData,jb=le([Ts],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),PA=(e,t,n,r)=>r?jb(e):Ts(e),r1e=(e,t,n)=>n?jb(e):Ts(e);function So(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Pt(t)&&Pt(n))return!0}return!1}function rz(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function M9(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(So(o))return o}}function i1e(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(So(r))return rz(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(De(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"&&KL.test(i)){var c=KL.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var d=+c[1];o=t[0]-d}}else o=t==null?void 0:t[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(De(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"&&YL.test(a)){var m=YL.exec(a);if(m==null||m[1]==null||t==null)l=void 0;else{var f=+m[1];l=t[1]+f}}else l=t==null?void 0:t[1];var g=[o,l];if(So(g))return t==null?g:rz(g,t,n)}}}var Vf=1e9,a1e={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},RA,jn=!0,xa="[DecimalError] ",Zu=xa+"Invalid argument: ",MA=xa+"Exponent out of range: ",Kf=Math.floor,Ru=Math.pow,o1e=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Pi,yr=1e7,vn=7,R9=9007199254740991,Dx=Kf(R9/vn),Ie={};Ie.absoluteValue=Ie.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ie.comparedTo=Ie.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};Ie.decimalPlaces=Ie.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*vn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ie.dividedBy=Ie.div=function(e){return ds(this,new this.constructor(e))};Ie.dividedToIntegerBy=Ie.idiv=function(e){var t=this,n=t.constructor;return un(ds(t,new n(e),0,1),n.precision)};Ie.equals=Ie.eq=function(e){return!this.cmp(e)};Ie.exponent=function(){return Qn(this)};Ie.greaterThan=Ie.gt=function(e){return this.cmp(e)>0};Ie.greaterThanOrEqualTo=Ie.gte=function(e){return this.cmp(e)>=0};Ie.isInteger=Ie.isint=function(){return this.e>this.d.length-2};Ie.isNegative=Ie.isneg=function(){return this.s<0};Ie.isPositive=Ie.ispos=function(){return this.s>0};Ie.isZero=function(){return this.s===0};Ie.lessThan=Ie.lt=function(e){return this.cmp(e)<0};Ie.lessThanOrEqualTo=Ie.lte=function(e){return this.cmp(e)<1};Ie.logarithm=Ie.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(Pi))throw Error(xa+"NaN");if(n.s<1)throw Error(xa+(n.s?"NaN":"-Infinity"));return n.eq(Pi)?new r(0):(jn=!1,t=ds(Wm(n,a),Wm(e,a),a),jn=!0,un(t,i))};Ie.minus=Ie.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?L9(t,e):D9(t,(e.s=-e.s,e))};Ie.modulo=Ie.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(xa+"NaN");return n.s?(jn=!1,t=ds(n,e,0,1).times(e),jn=!0,n.minus(t)):un(new r(n),i)};Ie.naturalExponential=Ie.exp=function(){return I9(this)};Ie.naturalLogarithm=Ie.ln=function(){return Wm(this)};Ie.negated=Ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ie.plus=Ie.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?D9(t,e):L9(t,(e.s=-e.s,e))};Ie.precision=Ie.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Zu+e);if(t=Qn(i)+1,r=i.d.length-1,n=r*vn+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};Ie.squareRoot=Ie.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(xa+"NaN")}for(e=Qn(l),jn=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=xo(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Kf((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 c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(ds(l,a,o+2)).times(.5),xo(a.d).slice(0,o)===(t=xo(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(un(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return jn=!0,un(r,n)};Ie.times=Ie.mul=function(e){var t,n,r,i,a,o,l,c,d,m=this,f=m.constructor,g=m.d,v=(e=new f(e)).d;if(!m.s||!e.s)return new f(0);for(e.s*=m.s,n=m.e+e.e,c=g.length,d=v.length,c<d&&(a=g,g=v,v=a,o=c,c=d,d=o),a=[],o=c+d,r=o;r--;)a.push(0);for(r=d;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+v[r]*g[i-r-1]+t,a[i--]=l%yr|0,t=l/yr|0;a[i]=(a[i]+t)%yr|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,jn?un(e,f.precision):e};Ie.toDecimalPlaces=Ie.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ko(e,0,Vf),t===void 0?t=r.rounding:ko(t,0,8),un(n,e+Qn(n)+1,t))};Ie.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=xc(r,!0):(ko(e,0,Vf),t===void 0?t=i.rounding:ko(t,0,8),r=un(new i(r),e+1,t),n=xc(r,!0,e+1)),n};Ie.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?xc(i):(ko(e,0,Vf),t===void 0?t=a.rounding:ko(t,0,8),r=un(new a(i),e+Qn(i)+1,t),n=xc(r.abs(),!1,e+Qn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ie.toInteger=Ie.toint=function(){var e=this,t=e.constructor;return un(new t(e),Qn(e)+1,t.rounding)};Ie.toNumber=function(){return+this};Ie.toPower=Ie.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,d=12,m=+(e=new c(e));if(!e.s)return new c(Pi);if(l=new c(l),!l.s){if(e.s<1)throw Error(xa+"Infinity");return l}if(l.eq(Pi))return l;if(r=c.precision,e.eq(Pi))return un(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=m<0?-m:m)<=R9){for(i=new c(Pi),t=Math.ceil(r/vn+4),jn=!1;n%2&&(i=i.times(l),az(i.d,t)),n=Kf(n/2),n!==0;)l=l.times(l),az(l.d,t);return jn=!0,e.s<0?new c(Pi).div(i):un(i,r)}}else if(a<0)throw Error(xa+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,jn=!1,i=e.times(Wm(l,r+d)),jn=!0,i=I9(i),i.s=a,i};Ie.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Qn(i),r=xc(i,n<=a.toExpNeg||n>=a.toExpPos)):(ko(e,1,Vf),t===void 0?t=a.rounding:ko(t,0,8),i=un(new a(i),e,t),n=Qn(i),r=xc(i,e<=n||n<=a.toExpNeg,e)),r};Ie.toSignificantDigits=Ie.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ko(e,1,Vf),t===void 0?t=r.rounding:ko(t,0,8)),un(new r(n),e,t)};Ie.toString=Ie.valueOf=Ie.val=Ie.toJSON=Ie[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Qn(e),n=e.constructor;return xc(e,t<=n.toExpNeg||t>=n.toExpPos)};function D9(e,t){var n,r,i,a,o,l,c,d,m=e.constructor,f=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),jn?un(t,f):t;if(c=e.d,d=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=d.length):(r=d,i=o,l=c.length),o=Math.ceil(f/vn),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=d.length,l-a<0&&(a=l,r=d,d=c,c=r),n=0;a;)n=(c[--a]=c[a]+d[a]+n)/yr|0,c[a]%=yr;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,jn?un(t,f):t}function ko(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Zu+e)}function xo(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=vn-r.length,n&&(a+=wl(n)),a+=r;o=e[t],r=o+"",n=vn-r.length,n&&(a+=wl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ds=(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%yr|0,o=a/yr|0;return o&&r.unshift(o),r}function t(r,i,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*yr+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,d,m,f,g,v,b,w,S,j,C,_,k,O,A,T,P,z=r.constructor,L=r.s==i.s?1:-1,F=r.d,D=i.d;if(!r.s)return new z(r);if(!i.s)throw Error(xa+"Division by zero");for(c=r.e-i.e,T=D.length,O=F.length,v=new z(L),b=v.d=[],d=0;D[d]==(F[d]||0);)++d;if(D[d]>(F[d]||0)&&--c,a==null?C=a=z.precision:o?C=a+(Qn(r)-Qn(i))+1:C=a,C<0)return new z(0);if(C=C/vn+2|0,d=0,T==1)for(m=0,D=D[0],C++;(d<O||m)&&C--;d++)_=m*yr+(F[d]||0),b[d]=_/D|0,m=_%D|0;else{for(m=yr/(D[0]+1)|0,m>1&&(D=e(D,m),F=e(F,m),T=D.length,O=F.length),k=T,w=F.slice(0,T),S=w.length;S<T;)w[S++]=0;P=D.slice(),P.unshift(0),A=D[0],D[1]>=yr/2&&++A;do m=0,l=t(D,w,T,S),l<0?(j=w[0],T!=S&&(j=j*yr+(w[1]||0)),m=j/A|0,m>1?(m>=yr&&(m=yr-1),f=e(D,m),g=f.length,S=w.length,l=t(f,w,g,S),l==1&&(m--,n(f,T<g?P:D,g))):(m==0&&(l=m=1),f=D.slice()),g=f.length,g<S&&f.unshift(0),n(w,f,S),l==-1&&(S=w.length,l=t(D,w,T,S),l<1&&(m++,n(w,T<S?P:D,S))),S=w.length):l===0&&(m++,w=[0]),b[d++]=m,l&&w[0]?w[S++]=F[k]||0:(w=[F[k]],S=1);while((k++<O||w[0]!==void 0)&&C--)}return b[0]||b.shift(),v.e=c,un(v,o?a+Qn(v)+1:a)}})();function I9(e,t){var n,r,i,a,o,l,c=0,d=0,m=e.constructor,f=m.precision;if(Qn(e)>16)throw Error(MA+Qn(e));if(!e.s)return new m(Pi);for(jn=!1,l=f,o=new m(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(r=Math.log(Ru(2,d))/Math.LN10*2+5|0,l+=r,n=i=a=new m(Pi),m.precision=l;;){if(i=un(i.times(e),l),n=n.times(++c),o=a.plus(ds(i,n,l)),xo(o.d).slice(0,l)===xo(a.d).slice(0,l)){for(;d--;)a=un(a.times(a),l);return m.precision=f,t==null?(jn=!0,un(a,f)):a}a=o}}function Qn(e){for(var t=e.e*vn,n=e.d[0];n>=10;n/=10)t++;return t}function wE(e,t,n){if(t>e.LN10.sd())throw jn=!0,n&&(e.precision=n),Error(xa+"LN10 precision limit exceeded");return un(new e(e.LN10),t)}function wl(e){for(var t="";e--;)t+="0";return t}function Wm(e,t){var n,r,i,a,o,l,c,d,m,f=1,g=10,v=e,b=v.d,w=v.constructor,S=w.precision;if(v.s<1)throw Error(xa+(v.s?"NaN":"-Infinity"));if(v.eq(Pi))return new w(0);if(t==null?(jn=!1,d=S):d=t,v.eq(10))return t==null&&(jn=!0),wE(w,d);if(d+=g,w.precision=d,n=xo(b),r=n.charAt(0),a=Qn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=xo(v.d),r=n.charAt(0),f++;a=Qn(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return c=wE(w,d+2,S).times(a+""),v=Wm(new w(r+"."+n.slice(1)),d-g).plus(c),w.precision=S,t==null?(jn=!0,un(v,S)):v;for(l=o=v=ds(v.minus(Pi),v.plus(Pi),d),m=un(v.times(v),d),i=3;;){if(o=un(o.times(m),d),c=l.plus(ds(o,new w(i),d)),xo(c.d).slice(0,d)===xo(l.d).slice(0,d))return l=l.times(2),a!==0&&(l=l.plus(wE(w,d+2,S).times(a+""))),l=ds(l,new w(f),d),w.precision=S,t==null?(jn=!0,un(l,S)):l;l=c,i+=2}}function iz(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=Kf(n/vn),e.d=[],r=(n+1)%vn,n<0&&(r+=vn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=vn;r<i;)e.d.push(+t.slice(r,r+=vn));t=t.slice(r),r=vn-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),jn&&(e.e>Dx||e.e<-Dx))throw Error(MA+n)}else e.s=0,e.e=0,e.d=[0];return e}function un(e,t,n){var r,i,a,o,l,c,d,m,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=vn,i=t,d=f[m=0];else{if(m=Math.ceil((r+1)/vn),a=f.length,m>=a)return e;for(d=a=f[m],o=1;a>=10;a/=10)o++;r%=vn,i=r-vn+o}if(n!==void 0&&(a=Ru(10,o-i-1),l=d/a%10|0,c=t<0||f[m+1]!==void 0||d%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?d/Ru(10,o-i):0:f[m-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Qn(e),f.length=1,t=t-a-1,f[0]=Ru(10,(vn-t%vn)%vn),e.e=Kf(-t/vn)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=m,a=1,m--):(f.length=m+1,a=Ru(10,vn-r),f[m]=i>0?(d/Ru(10,o-i)%Ru(10,i)|0)*a:0),c)for(;;)if(m==0){(f[0]+=a)==yr&&(f[0]=1,++e.e);break}else{if(f[m]+=a,f[m]!=yr)break;f[m--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(jn&&(e.e>Dx||e.e<-Dx))throw Error(MA+Qn(e));return e}function L9(e,t){var n,r,i,a,o,l,c,d,m,f,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),jn?un(t,v):t;if(c=e.d,f=t.d,r=t.e,d=e.e,c=c.slice(),o=d-r,o){for(m=o<0,m?(n=c,o=-o,l=f.length):(n=f,r=d,l=c.length),i=Math.max(Math.ceil(v/vn),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,m=i<l,m&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){m=c[i]<f[i];break}o=0}for(m&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>o;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=yr-1;--c[a],c[i]+=yr}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,jn?un(t,v):t):new g(0)}function xc(e,t,n){var r,i=Qn(e),a=xo(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+wl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+wl(-i-1)+a,n&&(r=n-o)>0&&(a+=wl(r))):i>=o?(a+=wl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+wl(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=wl(r))),e.s<0?"-"+a:a}function az(e,t){if(e.length>t)return e.length=t,!0}function z9(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(Zu+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 iz(o,a.toString())}else if(typeof a!="string")throw Error(Zu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,o1e.test(a))iz(o,a);else throw Error(Zu+a)}if(i.prototype=Ie,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=z9,i.config=i.set=s1e,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 s1e(e){if(!e||typeof e!="object")throw Error(xa+"Object expected");var t,n,r,i=["precision",1,Vf,"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(Kf(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Zu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Zu+n+": "+r);return this}var RA=z9(a1e);Pi=new RA(1);const Tt=RA;function $9(e){var t;return e===0?t=1:t=Math.floor(new Tt(e).abs().log(10).toNumber())+1,t}function B9(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 F9=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},DA=(e,t,n)=>{if(e.lte(0))return new Tt(0);var r=$9(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),c=l.mul(i);return t?new Tt(c.toNumber()):new Tt(Math.ceil(c.toNumber()))},U9=(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),c=e.div(l).toNumber(),d=i.findIndex(v=>v>=c-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 f=(r=i[d])!==null&&r!==void 0?r:1,g=new Tt(f).mul(l);return t?g:new Tt(Math.ceil(g.toNumber()))},l1e=(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($9(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=[],c=0;c<t;c++)l.push(i.add(new Tt(c-o).mul(r)).toNumber());return l},H9=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]:DA;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),c;t<=0&&n>=0?c=new Tt(0):(c=new Tt(t).add(n).div(2),c=c.sub(new Tt(c).mod(l)));var d=Math.ceil(c.sub(t).div(l).toNumber()),m=Math.ceil(new Tt(n).sub(c).div(l).toNumber()),f=d+m+1;return f>r?H9(t,n,r,i,a+1,o):(f<r&&(m=n>0?m+(r-f):m,d=n>0?d:d+(r-f)),{step:l,tickMin:c.sub(new Tt(d).mul(l)),tickMax:c.add(new Tt(m).mul(l))})},oz=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),[c,d]=F9([n,r]);if(c===-1/0||d===1/0){var m=d===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),d];return n>r?m.reverse():m}if(c===d)return l1e(c,i,a);var f=o==="snap125"?U9:DA,{step:g,tickMin:v,tickMax:b}=H9(c,d,l,a,0,f),w=B9(v,b.add(new Tt(.1).mul(g)),g);return n>r?w.reverse():w},sz=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,c]=F9([r,i]);if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var d=o==="snap125"?U9:DA,m=Math.max(n,2),f=d(new Tt(c).sub(l).div(m-1),a,0),g=[...B9(new Tt(l),new Tt(c),f),c];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},q9=e=>e.rootProps.maxBarSize,u1e=e=>e.rootProps.barGap,V9=e=>e.rootProps.barCategoryGap,c1e=e=>e.rootProps.barSize,rg=e=>e.rootProps.stackOffset,K9=e=>e.rootProps.reverseStackOrder,IA=e=>e.options.chartName,LA=e=>e.rootProps.syncId,Y9=e=>e.rootProps.syncMethod,zA=e=>e.options.eventEmitter,Wn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Cu={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},lo={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Eb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function _b(e,t,n){if(n!=="auto")return n;if(e!=null)return ks(e,t)?"category":"number"}function lz(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 Ix(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lz(Object(n),!0).forEach(function(r){d1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lz(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)}var uz={allowDataOverflow:Cu.allowDataOverflow,allowDecimals:Cu.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Cu.angleAxisId,includeHidden:!1,name:void 0,reversed:Cu.reversed,scale:Cu.scale,tick:Cu.tick,tickCount:void 0,ticks:void 0,type:Cu.type,unit:void 0,niceTicks:"auto"},cz={allowDataOverflow:lo.allowDataOverflow,allowDecimals:lo.allowDecimals,allowDuplicatedCategory:lo.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:lo.radiusAxisId,includeHidden:lo.includeHidden,name:void 0,reversed:lo.reversed,scale:lo.scale,tick:lo.tick,tickCount:lo.tickCount,ticks:void 0,type:lo.type,unit:void 0,niceTicks:"auto"},m1e=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},$A=le([m1e,u9],(e,t)=>{var n;if(e!=null)return e;var r=(n=_b(t,"angleAxis",uz.type))!==null&&n!==void 0?n:"category";return Ix(Ix({},uz),{},{type:r})}),p1e=(e,t)=>e.polarAxis.radiusAxis[t],BA=le([p1e,u9],(e,t)=>{var n;if(e!=null)return e;var r=(n=_b(t,"radiusAxis",cz.type))!==null&&n!==void 0?n:"category";return Ix(Ix({},cz),{},{type:r})}),Cb=e=>e.polarOptions,FA=le([As,Os,cr],k9),X9=le([Cb,FA],(e,t)=>{if(e!=null)return Hr(e.innerRadius,t,0)}),G9=le([Cb,FA],(e,t)=>{if(e!=null)return Hr(e.outerRadius,t,t*.8)}),g1e=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},W9=le([Cb],g1e);le([$A,W9],Eb);var Q9=le([FA,X9,G9],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([BA,Q9],Eb);var Z9=le([Ut,Cb,X9,G9,As,Os],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:c,endAngle:d}=t;return{cx:Hr(o,i,i/2),cy:Hr(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:d,clockWise:!1}}}),Tn=(e,t)=>t,ig=(e,t,n)=>n;function UA(e){return e==null?void 0:e.id}function J9(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(l=>{var c,d=(c=l.data)!==null&&c!==void 0?c:r;if(!(d==null||d.length===0)){var m=UA(l);d.forEach((f,g)=>{var v=a==null||i?g:String(en(f,a,null)),b=en(f,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 Nb(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var kb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Ab(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function v1e(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 Sr=e=>{var t=Ut(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Yf=e=>e.tooltip.settings.axisId;function HA(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 c=e.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var e7=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!So(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 zl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function y1e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qA(e){let t,n,r;e.length!==2?(t=zl,n=(l,c)=>zl(e(l),c),r=(l,c)=>e(l)-c):(t=e===zl||e===y1e?e:x1e,n=e,r=e);function i(l,c,d=0,m=l.length){if(d<m){if(t(c,c)!==0)return m;do{const f=d+m>>>1;n(l[f],c)<0?d=f+1:m=f}while(d<m)}return d}function a(l,c,d=0,m=l.length){if(d<m){if(t(c,c)!==0)return m;do{const f=d+m>>>1;n(l[f],c)<=0?d=f+1:m=f}while(d<m)}return d}function o(l,c,d=0,m=l.length){const f=i(l,c,d,m-1);return f>d&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:o,right:a}}function x1e(){return 0}function t7(e){return e===null?NaN:+e}function*b1e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const w1e=qA(zl),ag=w1e.right;qA(t7).center;class dz extends Map{constructor(t,n=E1e){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(fz(this,t))}has(t){return super.has(fz(this,t))}set(t,n){return super.set(S1e(this,t),n)}delete(t){return super.delete(j1e(this,t))}}function fz({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function S1e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function j1e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function E1e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function _1e(e=zl){if(e===zl)return n7;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 n7(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const C1e=Math.sqrt(50),N1e=Math.sqrt(10),k1e=Math.sqrt(2);function Lx(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>=C1e?10:a>=N1e?5:a>=k1e?2:1;let l,c,d;return i<0?(d=Math.pow(10,-i)/o,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,i)*o,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=n&&n<2?Lx(e,t,n*2):[l,c,d]}function TC(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?Lx(t,e,n):Lx(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(o<0)for(let d=0;d<l;++d)c[d]=(a-d)/-o;else for(let d=0;d<l;++d)c[d]=(a-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(i+d)/-o;else for(let d=0;d<l;++d)c[d]=(i+d)*o;return c}function PC(e,t,n){return t=+t,e=+e,n=+n,Lx(e,t,n)[2]}function MC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?PC(t,e,n):PC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function hz(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function mz(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function r7(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?n7:_1e(i);r>n;){if(r-n>600){const c=r-n+1,d=t-n+1,m=Math.log(c),f=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*f*(c-f)/c)*(d-c/2<0?-1:1),v=Math.max(n,Math.floor(t-d*f/c+g)),b=Math.min(r,Math.floor(t+(c-d)*f/c+g));r7(e,t,v,b,i)}const a=e[t];let o=n,l=r;for(om(e,n,t),i(e[r],a)>0&&om(e,n,r);o<l;){for(om(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?om(e,n,l):(++l,om(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function om(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function A1e(e,t,n){if(e=Float64Array.from(b1e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return mz(e);if(t>=1)return hz(e);var r,i=(r-1)*t,a=Math.floor(i),o=hz(r7(e,a).subarray(0,a+1)),l=mz(e.subarray(a+1));return o+(l-o)*(i-a)}}function O1e(e,t,n=t7){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 T1e(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 Ca(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ps(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 RC=Symbol("implicit");function VA(){var e=new dz,t=[],n=[],r=RC;function i(a){let o=e.get(a);if(o===void 0){if(r!==RC)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 dz;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 VA(t,n).unknown(r)},Ca.apply(i,arguments),i}function KA(){var e=VA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,c=0,d=0,m=.5;delete e.unknown;function f(){var g=t().length,v=i<r,b=v?i:r,w=v?r:i;a=(w-b)/Math.max(1,g-c+d*2),l&&(a=Math.floor(a)),b+=(w-b-a*(g-c))*m,o=a*(1-c),l&&(b=Math.round(b),o=Math.round(o));var S=T1e(g).map(function(j){return b+a*j});return n(v?S.reverse():S)}return e.domain=function(g){return arguments.length?(t(g),f()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(g){return arguments.length?(l=!!g,f()):l},e.padding=function(g){return arguments.length?(c=Math.min(1,d=+g),f()):c},e.paddingInner=function(g){return arguments.length?(c=Math.min(1,g),f()):c},e.paddingOuter=function(g){return arguments.length?(d=+g,f()):d},e.align=function(g){return arguments.length?(m=Math.max(0,Math.min(1,g)),f()):m},e.copy=function(){return KA(t(),[r,i]).round(l).paddingInner(c).paddingOuter(d).align(m)},Ca.apply(f(),arguments)}function i7(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return i7(t())},e}function P1e(){return i7(KA.apply(null,arguments).paddingInner(1))}function YA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function a7(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function og(){}var Qm=.7,zx=1/Qm,Hd="\\s*([+-]?\\d+)\\s*",Zm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",M1e=/^#([0-9a-f]{3,8})$/,R1e=new RegExp(`^rgb\\(${Hd},${Hd},${Hd}\\)$`),D1e=new RegExp(`^rgb\\(${jo},${jo},${jo}\\)$`),I1e=new RegExp(`^rgba\\(${Hd},${Hd},${Hd},${Zm}\\)$`),L1e=new RegExp(`^rgba\\(${jo},${jo},${jo},${Zm}\\)$`),z1e=new RegExp(`^hsl\\(${Zm},${jo},${jo}\\)$`),$1e=new RegExp(`^hsla\\(${Zm},${jo},${jo},${Zm}\\)$`),pz={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};YA(og,bc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gz,formatHex:gz,formatHex8:B1e,formatHsl:F1e,formatRgb:vz,toString:vz});function gz(){return this.rgb().formatHex()}function B1e(){return this.rgb().formatHex8()}function F1e(){return o7(this).formatHsl()}function vz(){return this.rgb().formatRgb()}function bc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=M1e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?yz(t):n===3?new xi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?cy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?cy(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=R1e.exec(e))?new xi(t[1],t[2],t[3],1):(t=D1e.exec(e))?new xi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=I1e.exec(e))?cy(t[1],t[2],t[3],t[4]):(t=L1e.exec(e))?cy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=z1e.exec(e))?wz(t[1],t[2]/100,t[3]/100,1):(t=$1e.exec(e))?wz(t[1],t[2]/100,t[3]/100,t[4]):pz.hasOwnProperty(e)?yz(pz[e]):e==="transparent"?new xi(NaN,NaN,NaN,0):null}function yz(e){return new xi(e>>16&255,e>>8&255,e&255,1)}function cy(e,t,n,r){return r<=0&&(e=t=n=NaN),new xi(e,t,n,r)}function U1e(e){return e instanceof og||(e=bc(e)),e?(e=e.rgb(),new xi(e.r,e.g,e.b,e.opacity)):new xi}function DC(e,t,n,r){return arguments.length===1?U1e(e):new xi(e,t,n,r??1)}function xi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}YA(xi,DC,a7(og,{brighter(e){return e=e==null?zx:Math.pow(zx,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qm:Math.pow(Qm,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xi(Ju(this.r),Ju(this.g),Ju(this.b),$x(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:xz,formatHex:xz,formatHex8:H1e,formatRgb:bz,toString:bz}));function xz(){return`#${zu(this.r)}${zu(this.g)}${zu(this.b)}`}function H1e(){return`#${zu(this.r)}${zu(this.g)}${zu(this.b)}${zu((isNaN(this.opacity)?1:this.opacity)*255)}`}function bz(){const e=$x(this.opacity);return`${e===1?"rgb(":"rgba("}${Ju(this.r)}, ${Ju(this.g)}, ${Ju(this.b)}${e===1?")":`, ${e})`}`}function $x(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ju(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zu(e){return e=Ju(e),(e<16?"0":"")+e.toString(16)}function wz(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ba(e,t,n,r)}function o7(e){if(e instanceof Ba)return new Ba(e.h,e.s,e.l,e.opacity);if(e instanceof og||(e=bc(e)),!e)return new Ba;if(e instanceof Ba)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,c=(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/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new Ba(o,l,c,e.opacity)}function q1e(e,t,n,r){return arguments.length===1?o7(e):new Ba(e,t,n,r??1)}function Ba(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}YA(Ba,q1e,a7(og,{brighter(e){return e=e==null?zx:Math.pow(zx,e),new Ba(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qm:Math.pow(Qm,e),new Ba(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 xi(SE(e>=240?e-240:e+120,i,r),SE(e,i,r),SE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ba(Sz(this.h),dy(this.s),dy(this.l),$x(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=$x(this.opacity);return`${e===1?"hsl(":"hsla("}${Sz(this.h)}, ${dy(this.s)*100}%, ${dy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Sz(e){return e=(e||0)%360,e<0?e+360:e}function dy(e){return Math.max(0,Math.min(1,e||0))}function SE(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 XA=e=>()=>e;function V1e(e,t){return function(n){return e+n*t}}function K1e(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 Y1e(e){return(e=+e)==1?s7:function(t,n){return n-t?K1e(t,n,e):XA(isNaN(t)?n:t)}}function s7(e,t){var n=t-e;return n?V1e(e,n):XA(isNaN(e)?t:e)}const Bx=(function e(t){var n=Y1e(t);function r(i,a){var o=n((i=DC(i)).r,(a=DC(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),d=s7(i.opacity,a.opacity);return function(m){return i.r=o(m),i.g=l(m),i.b=c(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function X1e(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 G1e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function W1e(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]=fs(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 Q1e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function La(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Z1e(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]=fs(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var IC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jE=new RegExp(IC.source,"g");function J1e(e){return function(){return e}}function eSe(e){return function(t){return e(t)+""}}function l7(e,t){var n=IC.lastIndex=jE.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=IC.exec(e))&&(i=jE.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,c.push({i:o,x:La(r,i)})),n=jE.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?eSe(c[0].x):J1e(t):(t=c.length,function(d){for(var m=0,f;m<t;++m)l[(f=c[m]).i]=f.x(d);return l.join("")})}function fs(e,t){var n=typeof t,r;return t==null||n==="boolean"?XA(t):(n==="number"?La:n==="string"?(r=bc(t))?(t=r,Bx):l7:t instanceof bc?Bx:t instanceof Date?Q1e:G1e(t)?X1e:Array.isArray(t)?W1e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Z1e:La)(e,t)}function GA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var jz=180/Math.PI,LC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function u7(e,t,n,r,i,a){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*jz,skewX:Math.atan(c)*jz,scaleX:o,scaleY:l}}var fy;function tSe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?LC:u7(t.a,t.b,t.c,t.d,t.e,t.f)}function nSe(e){return e==null||(fy||(fy=document.createElementNS("http://www.w3.org/2000/svg","g")),fy.setAttribute("transform",e),!(e=fy.transform.baseVal.consolidate()))?LC:(e=e.matrix,u7(e.a,e.b,e.c,e.d,e.e,e.f))}function c7(e,t,n,r){function i(d){return d.length?d.pop()+" ":""}function a(d,m,f,g,v,b){if(d!==f||m!==g){var w=v.push("translate(",null,t,null,n);b.push({i:w-4,x:La(d,f)},{i:w-2,x:La(m,g)})}else(f||g)&&v.push("translate("+f+t+g+n)}function o(d,m,f,g){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),g.push({i:f.push(i(f)+"rotate(",null,r)-2,x:La(d,m)})):m&&f.push(i(f)+"rotate("+m+r)}function l(d,m,f,g){d!==m?g.push({i:f.push(i(f)+"skewX(",null,r)-2,x:La(d,m)}):m&&f.push(i(f)+"skewX("+m+r)}function c(d,m,f,g,v,b){if(d!==f||m!==g){var w=v.push(i(v)+"scale(",null,",",null,")");b.push({i:w-4,x:La(d,f)},{i:w-2,x:La(m,g)})}else(f!==1||g!==1)&&v.push(i(v)+"scale("+f+","+g+")")}return function(d,m){var f=[],g=[];return d=e(d),m=e(m),a(d.translateX,d.translateY,m.translateX,m.translateY,f,g),o(d.rotate,m.rotate,f,g),l(d.skewX,m.skewX,f,g),c(d.scaleX,d.scaleY,m.scaleX,m.scaleY,f,g),d=m=null,function(v){for(var b=-1,w=g.length,S;++b<w;)f[(S=g[b]).i]=S.x(v);return f.join("")}}}var rSe=c7(tSe,"px, ","px)","deg)"),iSe=c7(nSe,", ",")",")"),aSe=1e-12;function Ez(e){return((e=Math.exp(e))+1/e)/2}function oSe(e){return((e=Math.exp(e))-1/e)/2}function sSe(e){return((e=Math.exp(2*e))-1)/(e+1)}const Iy=(function e(t,n,r){function i(a,o){var l=a[0],c=a[1],d=a[2],m=o[0],f=o[1],g=o[2],v=m-l,b=f-c,w=v*v+b*b,S,j;if(w<aSe)j=Math.log(g/d)/t,S=function(T){return[l+T*v,c+T*b,d*Math.exp(t*T*j)]};else{var C=Math.sqrt(w),_=(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(_*_+1)-_),A=Math.log(Math.sqrt(k*k+1)-k);j=(A-O)/t,S=function(T){var P=T*j,z=Ez(O),L=d/(n*C)*(z*sSe(t*P+O)-oSe(O));return[l+L*v,c+L*b,d*z/Ez(t*P+O)]}}return S.duration=j*1e3*t/Math.SQRT2,S}return i.rho=function(a){var o=Math.max(.001,+a),l=o*o,c=l*l;return e(o,l,c)},i})(Math.SQRT2,2,4);function lSe(e,t){t===void 0&&(t=e,e=fs);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 uSe(e){return function(){return e}}function Fx(e){return+e}var _z=[0,1];function ti(e){return e}function zC(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:uSe(isNaN(t)?NaN:.5)}function cSe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function dSe(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=zC(i,r),a=n(o,a)):(r=zC(r,i),a=n(a,o)),function(l){return a(r(l))}}function fSe(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]=zC(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=ag(e,l,1,r)-1;return a[c](i[c](l))}}function sg(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ob(){var e=_z,t=_z,n=fs,r,i,a,o=ti,l,c,d;function m(){var g=Math.min(e.length,t.length);return o!==ti&&(o=cSe(e[0],e[g-1])),l=g>2?fSe:dSe,c=d=null,f}function f(g){return g==null||isNaN(g=+g)?a:(c||(c=l(e.map(r),t,n)))(r(o(g)))}return f.invert=function(g){return o(i((d||(d=l(t,e.map(r),La)))(g)))},f.domain=function(g){return arguments.length?(e=Array.from(g,Fx),m()):e.slice()},f.range=function(g){return arguments.length?(t=Array.from(g),m()):t.slice()},f.rangeRound=function(g){return t=Array.from(g),n=GA,m()},f.clamp=function(g){return arguments.length?(o=g?!0:ti,m()):o!==ti},f.interpolate=function(g){return arguments.length?(n=g,m()):n},f.unknown=function(g){return arguments.length?(a=g,f):a},function(g,v){return r=g,i=v,m()}}function WA(){return Ob()(ti,ti)}function hSe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ux(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=Ux(Math.abs(e)),e?e[1]:NaN}function mSe(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function pSe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var gSe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jm(e){if(!(t=gSe.exec(e)))throw new Error("invalid format: "+e);var t;return new QA({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]})}Jm.prototype=QA.prototype;function QA(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+""}QA.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 vSe(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 Hx;function ySe(e,t){var n=Ux(e,t);if(!n)return Hx=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Hx=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")+Ux(e,Math.max(0,t+a-1))[0]}function Cz(e,t){var n=Ux(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 Nz={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:hSe,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)=>Cz(e*100,t),r:Cz,s:ySe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function kz(e){return e}var Az=Array.prototype.map,Oz=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xSe(e){var t=e.grouping===void 0||e.thousands===void 0?kz:mSe(Az.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?kz:pSe(Az.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(f,g){f=Jm(f);var v=f.fill,b=f.align,w=f.sign,S=f.symbol,j=f.zero,C=f.width,_=f.comma,k=f.precision,O=f.trim,A=f.type;A==="n"?(_=!0,A="g"):Nz[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():""),P=(S==="$"?r:/[%p]/.test(A)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),z=Nz[A],L=/[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 F(D){var X=T,R=P,q,$,V;if(A==="c")R=z(D)+R,D="";else{D=+D;var G=D<0||1/D<0;if(D=isNaN(D)?c:z(Math.abs(D),k),O&&(D=vSe(D)),G&&+D==0&&w!=="+"&&(G=!1),X=(G?w==="("?w:l:w==="-"||w==="("?"":w)+X,R=(A==="s"&&!isNaN(D)&&Hx!==void 0?Oz[8+Hx/3]:"")+R+(G&&w==="("?")":""),L){for(q=-1,$=D.length;++q<$;)if(V=D.charCodeAt(q),48>V||V>57){R=(V===46?i+D.slice(q+1):D.slice(q))+R,D=D.slice(0,q);break}}}_&&!j&&(D=t(D,1/0));var K=X.length+D.length+R.length,I=K<C?new Array(C-K+1).join(v):"";switch(_&&j&&(D=t(I+D,I.length?C-R.length:1/0),I=""),b){case"<":D=X+D+R+I;break;case"=":D=X+I+D+R;break;case"^":D=I.slice(0,K=I.length>>1)+X+D+R+I.slice(K);break;default:D=I+X+D+R;break}return a(D)}return F.toString=function(){return f+""},F}function m(f,g){var v=Math.max(-8,Math.min(8,Math.floor(bf(g)/3)))*3,b=Math.pow(10,-v),w=d((f=Jm(f),f.type="f",f),{suffix:Oz[8+v/3]});return function(S){return w(b*S)}}return{format:d,formatPrefix:m}}var hy,ZA,d7;bSe({thousands:",",grouping:[3],currency:["$",""]});function bSe(e){return hy=xSe(e),ZA=hy.format,d7=hy.formatPrefix,hy}function wSe(e){return Math.max(0,-bf(Math.abs(e)))}function SSe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(bf(t)/3)))*3-bf(Math.abs(e)))}function jSe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,bf(t)-bf(e))+1}function f7(e,t,n,r){var i=MC(e,t,n),a;switch(r=Jm(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=SSe(i,o))&&(r.precision=a),d7(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=jSe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=wSe(i))&&(r.precision=a-(r.type==="%")*2);break}}return ZA(r)}function tu(e){var t=e.domain;return e.ticks=function(n){var r=t();return TC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return f7(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],c,d,m=10;for(l<o&&(d=o,o=l,l=d,d=i,i=a,a=d);m-- >0;){if(d=PC(o,l,n),d===c)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;c=d}return e},e}function h7(){var e=WA();return e.copy=function(){return sg(e,h7())},Ca.apply(e,arguments),tu(e)}function m7(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,Fx),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return m7(e).unknown(t)},e=arguments.length?Array.from(e,Fx):[0,1],tu(n)}function p7(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 Tz(e){return Math.log(e)}function Pz(e){return Math.exp(e)}function ESe(e){return-Math.log(-e)}function _Se(e){return-Math.exp(-e)}function CSe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function NSe(e){return e===10?CSe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function kSe(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 Mz(e){return(t,n)=>-e(-t,n)}function JA(e){const t=e(Tz,Pz),n=t.domain;let r=10,i,a;function o(){return i=kSe(r),a=NSe(r),n()[0]<0?(i=Mz(i),a=Mz(a),e(ESe,_Se)):e(Tz,Pz),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 c=n();let d=c[0],m=c[c.length-1];const f=m<d;f&&([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=TC(d,m,S))}else j=TC(g,v,Math.min(v-g,S)).map(a);return f?j.reverse():j},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Jm(c)).precision==null&&(c.trim=!0),c=ZA(c)),l===1/0)return c;const d=Math.max(1,r*l/t.ticks().length);return m=>{let f=m/a(Math.round(i(m)));return f*r<r-.5&&(f*=r),f<=d?c(m):""}},t.nice=()=>n(p7(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function g7(){const e=JA(Ob()).domain([1,10]);return e.copy=()=>sg(e,g7()).base(e.base()),Ca.apply(e,arguments),e}function Rz(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Dz(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function eO(e){var t=1,n=e(Rz(t),Dz(t));return n.constant=function(r){return arguments.length?e(Rz(t=+r),Dz(t)):t},tu(n)}function v7(){var e=eO(Ob());return e.copy=function(){return sg(e,v7()).constant(e.constant())},Ca.apply(e,arguments)}function Iz(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ASe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function OSe(e){return e<0?-e*e:e*e}function tO(e){var t=e(ti,ti),n=1;function r(){return n===1?e(ti,ti):n===.5?e(ASe,OSe):e(Iz(n),Iz(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},tu(t)}function nO(){var e=tO(Ob());return e.copy=function(){return sg(e,nO()).exponent(e.exponent())},Ca.apply(e,arguments),e}function TSe(){return nO.apply(null,arguments).exponent(.5)}function Lz(e){return Math.sign(e)*e*e}function PSe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function y7(){var e=WA(),t=[0,1],n=!1,r;function i(a){var o=PSe(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(Lz(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,Fx)).map(Lz)),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 y7(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ca.apply(i,arguments),tu(i)}function x7(){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]=O1e(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[ag(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(zl),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 x7().domain(e).range(t).unknown(r)},Ca.apply(a,arguments)}function b7(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[ag(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var d=i.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,r[0]]:d>=n?[r[n-1],t]:[r[d-1],r[d]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return b7().domain([e,t]).range(i).unknown(a)},Ca.apply(tu(o),arguments)}function w7(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[ag(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 w7().domain(e).range(t).unknown(n)},Ca.apply(i,arguments)}const EE=new Date,_E=new Date;function dr(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 c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let d;do c.push(d=new Date(+a)),t(a,l),e(a);while(d<a&&a<o);return c},i.filter=a=>dr(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)=>(EE.setTime(+a),_E.setTime(+o),e(EE),e(_E),Math.floor(n(EE,_E))),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 qx=dr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);qx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?dr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):qx);qx.range;const ls=1e3,la=ls*60,us=la*60,ws=us*24,rO=ws*7,zz=ws*30,CE=ws*365,$u=dr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ls)},(e,t)=>(t-e)/ls,e=>e.getUTCSeconds());$u.range;const iO=dr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ls)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getMinutes());iO.range;const aO=dr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getUTCMinutes());aO.range;const oO=dr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ls-e.getMinutes()*la)},(e,t)=>{e.setTime(+e+t*us)},(e,t)=>(t-e)/us,e=>e.getHours());oO.range;const sO=dr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*us)},(e,t)=>(t-e)/us,e=>e.getUTCHours());sO.range;const lg=dr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*la)/ws,e=>e.getDate()-1);lg.range;const Tb=dr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ws,e=>e.getUTCDate()-1);Tb.range;const S7=dr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ws,e=>Math.floor(e/ws));S7.range;function Mc(e){return dr(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())*la)/rO)}const Pb=Mc(0),Vx=Mc(1),MSe=Mc(2),RSe=Mc(3),wf=Mc(4),DSe=Mc(5),ISe=Mc(6);Pb.range;Vx.range;MSe.range;RSe.range;wf.range;DSe.range;ISe.range;function Rc(e){return dr(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)/rO)}const Mb=Rc(0),Kx=Rc(1),LSe=Rc(2),zSe=Rc(3),Sf=Rc(4),$Se=Rc(5),BSe=Rc(6);Mb.range;Kx.range;LSe.range;zSe.range;Sf.range;$Se.range;BSe.range;const lO=dr(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());lO.range;const uO=dr(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());uO.range;const Ss=dr(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());Ss.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:dr(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)});Ss.range;const js=dr(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());js.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:dr(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)});js.range;function j7(e,t,n,r,i,a){const o=[[$u,1,ls],[$u,5,5*ls],[$u,15,15*ls],[$u,30,30*ls],[a,1,la],[a,5,5*la],[a,15,15*la],[a,30,30*la],[i,1,us],[i,3,3*us],[i,6,6*us],[i,12,12*us],[r,1,ws],[r,2,2*ws],[n,1,rO],[t,1,zz],[t,3,3*zz],[e,1,CE]];function l(d,m,f){const g=m<d;g&&([d,m]=[m,d]);const v=f&&typeof f.range=="function"?f:c(d,m,f),b=v?v.range(d,+m+1):[];return g?b.reverse():b}function c(d,m,f){const g=Math.abs(m-d)/f,v=qA(([,,S])=>S).right(o,g);if(v===o.length)return e.every(MC(d/CE,m/CE,f));if(v===0)return qx.every(Math.max(MC(d,m,f),1));const[b,w]=o[g/o[v-1][2]<o[v][2]/g?v-1:v];return b.every(w)}return[l,c]}const[FSe,USe]=j7(js,uO,Mb,S7,sO,aO),[HSe,qSe]=j7(Ss,lO,Pb,lg,oO,iO);function NE(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 kE(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 sm(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function VSe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=lm(i),m=um(i),f=lm(a),g=um(a),v=lm(o),b=um(o),w=lm(l),S=um(l),j=lm(c),C=um(c),_={a:V,A:G,b:K,B:I,c:null,d:qz,e:qz,f:mje,g:Eje,G:Cje,H:dje,I:fje,j:hje,L:E7,m:pje,M:gje,p:H,q:U,Q:Yz,s:Xz,S:vje,u:yje,U:xje,V:bje,w:wje,W:Sje,x:null,X:null,y:jje,Y:_je,Z:Nje,"%":Kz},k={a:B,A:Q,b:Z,B:te,c:null,d:Vz,e:Vz,f:Tje,g:Fje,G:Hje,H:kje,I:Aje,j:Oje,L:C7,m:Pje,M:Mje,p:ae,q:re,Q:Yz,s:Xz,S:Rje,u:Dje,U:Ije,V:Lje,w:zje,W:$je,x:null,X:null,y:Bje,Y:Uje,Z:qje,"%":Kz},O={a:L,A:F,b:D,B:X,c:R,d:Uz,e:Uz,f:sje,g:Fz,G:Bz,H:Hz,I:Hz,j:rje,L:oje,m:nje,M:ije,p:z,q:tje,Q:uje,s:cje,S:aje,u:WSe,U:QSe,V:ZSe,w:GSe,W:JSe,x:q,X:$,y:Fz,Y:Bz,Z:eje,"%":lje};_.x=A(n,_),_.X=A(r,_),_.c=A(t,_),k.x=A(n,k),k.X=A(r,k),k.c=A(t,k);function A(ee,se){return function(ge){var ie=[],Se=-1,Ee=0,He=ee.length,Oe,at,Je;for(ge instanceof Date||(ge=new Date(+ge));++Se<He;)ee.charCodeAt(Se)===37&&(ie.push(ee.slice(Ee,Se)),(at=$z[Oe=ee.charAt(++Se)])!=null?Oe=ee.charAt(++Se):at=Oe==="e"?" ":"0",(Je=se[Oe])&&(Oe=Je(ge,at)),ie.push(Oe),Ee=Se+1);return ie.push(ee.slice(Ee,Se)),ie.join("")}}function T(ee,se){return function(ge){var ie=sm(1900,void 0,1),Se=P(ie,ee,ge+="",0),Ee,He;if(Se!=ge.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=kE(sm(ie.y,0,1)),He=Ee.getUTCDay(),Ee=He>4||He===0?Kx.ceil(Ee):Kx(Ee),Ee=Tb.offset(Ee,(ie.V-1)*7),ie.y=Ee.getUTCFullYear(),ie.m=Ee.getUTCMonth(),ie.d=Ee.getUTCDate()+(ie.w+6)%7):(Ee=NE(sm(ie.y,0,1)),He=Ee.getDay(),Ee=He>4||He===0?Vx.ceil(Ee):Vx(Ee),Ee=lg.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),He="Z"in ie?kE(sm(ie.y,0,1)).getUTCDay():NE(sm(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(He+5)%7:ie.w+ie.U*7-(He+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,kE(ie)):NE(ie)}}function P(ee,se,ge,ie){for(var Se=0,Ee=se.length,He=ge.length,Oe,at;Se<Ee;){if(ie>=He)return-1;if(Oe=se.charCodeAt(Se++),Oe===37){if(Oe=se.charAt(Se++),at=O[Oe in $z?se.charAt(Se++):Oe],!at||(ie=at(ee,ge,ie))<0)return-1}else if(Oe!=ge.charCodeAt(ie++))return-1}return ie}function z(ee,se,ge){var ie=d.exec(se.slice(ge));return ie?(ee.p=m.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function L(ee,se,ge){var ie=v.exec(se.slice(ge));return ie?(ee.w=b.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function F(ee,se,ge){var ie=f.exec(se.slice(ge));return ie?(ee.w=g.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function D(ee,se,ge){var ie=j.exec(se.slice(ge));return ie?(ee.m=C.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function X(ee,se,ge){var ie=w.exec(se.slice(ge));return ie?(ee.m=S.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function R(ee,se,ge){return P(ee,t,se,ge)}function q(ee,se,ge){return P(ee,n,se,ge)}function $(ee,se,ge){return P(ee,r,se,ge)}function V(ee){return o[ee.getDay()]}function G(ee){return a[ee.getDay()]}function K(ee){return c[ee.getMonth()]}function I(ee){return l[ee.getMonth()]}function H(ee){return i[+(ee.getHours()>=12)]}function U(ee){return 1+~~(ee.getMonth()/3)}function B(ee){return o[ee.getUTCDay()]}function Q(ee){return a[ee.getUTCDay()]}function Z(ee){return c[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+="",_);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 $z={"-":"",_:" ",0:"0"},jr=/^\s*\d+/,KSe=/^%/,YSe=/[\\^$*+?|[\]().{}]/g;function Ft(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 XSe(e){return e.replace(YSe,"\\$&")}function lm(e){return new RegExp("^(?:"+e.map(XSe).join("|")+")","i")}function um(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function GSe(e,t,n){var r=jr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function WSe(e,t,n){var r=jr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function QSe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ZSe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function JSe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Bz(e,t,n){var r=jr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Fz(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function eje(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 tje(e,t,n){var r=jr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function nje(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Uz(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function rje(e,t,n){var r=jr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Hz(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function ije(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function aje(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function oje(e,t,n){var r=jr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function sje(e,t,n){var r=jr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function lje(e,t,n){var r=KSe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function uje(e,t,n){var r=jr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function cje(e,t,n){var r=jr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qz(e,t){return Ft(e.getDate(),t,2)}function dje(e,t){return Ft(e.getHours(),t,2)}function fje(e,t){return Ft(e.getHours()%12||12,t,2)}function hje(e,t){return Ft(1+lg.count(Ss(e),e),t,3)}function E7(e,t){return Ft(e.getMilliseconds(),t,3)}function mje(e,t){return E7(e,t)+"000"}function pje(e,t){return Ft(e.getMonth()+1,t,2)}function gje(e,t){return Ft(e.getMinutes(),t,2)}function vje(e,t){return Ft(e.getSeconds(),t,2)}function yje(e){var t=e.getDay();return t===0?7:t}function xje(e,t){return Ft(Pb.count(Ss(e)-1,e),t,2)}function _7(e){var t=e.getDay();return t>=4||t===0?wf(e):wf.ceil(e)}function bje(e,t){return e=_7(e),Ft(wf.count(Ss(e),e)+(Ss(e).getDay()===4),t,2)}function wje(e){return e.getDay()}function Sje(e,t){return Ft(Vx.count(Ss(e)-1,e),t,2)}function jje(e,t){return Ft(e.getFullYear()%100,t,2)}function Eje(e,t){return e=_7(e),Ft(e.getFullYear()%100,t,2)}function _je(e,t){return Ft(e.getFullYear()%1e4,t,4)}function Cje(e,t){var n=e.getDay();return e=n>=4||n===0?wf(e):wf.ceil(e),Ft(e.getFullYear()%1e4,t,4)}function Nje(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ft(t/60|0,"0",2)+Ft(t%60,"0",2)}function Vz(e,t){return Ft(e.getUTCDate(),t,2)}function kje(e,t){return Ft(e.getUTCHours(),t,2)}function Aje(e,t){return Ft(e.getUTCHours()%12||12,t,2)}function Oje(e,t){return Ft(1+Tb.count(js(e),e),t,3)}function C7(e,t){return Ft(e.getUTCMilliseconds(),t,3)}function Tje(e,t){return C7(e,t)+"000"}function Pje(e,t){return Ft(e.getUTCMonth()+1,t,2)}function Mje(e,t){return Ft(e.getUTCMinutes(),t,2)}function Rje(e,t){return Ft(e.getUTCSeconds(),t,2)}function Dje(e){var t=e.getUTCDay();return t===0?7:t}function Ije(e,t){return Ft(Mb.count(js(e)-1,e),t,2)}function N7(e){var t=e.getUTCDay();return t>=4||t===0?Sf(e):Sf.ceil(e)}function Lje(e,t){return e=N7(e),Ft(Sf.count(js(e),e)+(js(e).getUTCDay()===4),t,2)}function zje(e){return e.getUTCDay()}function $je(e,t){return Ft(Kx.count(js(e)-1,e),t,2)}function Bje(e,t){return Ft(e.getUTCFullYear()%100,t,2)}function Fje(e,t){return e=N7(e),Ft(e.getUTCFullYear()%100,t,2)}function Uje(e,t){return Ft(e.getUTCFullYear()%1e4,t,4)}function Hje(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Sf(e):Sf.ceil(e),Ft(e.getUTCFullYear()%1e4,t,4)}function qje(){return"+0000"}function Kz(){return"%"}function Yz(e){return+e}function Xz(e){return Math.floor(+e/1e3)}var Ed,k7,A7;Vje({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 Vje(e){return Ed=VSe(e),k7=Ed.format,Ed.parse,A7=Ed.utcFormat,Ed.utcParse,Ed}function Kje(e){return new Date(e)}function Yje(e){return e instanceof Date?+e:+new Date(+e)}function cO(e,t,n,r,i,a,o,l,c,d){var m=WA(),f=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"),_=d("%B"),k=d("%Y");function O(A){return(c(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?_:k)(A)}return m.invert=function(A){return new Date(f(A))},m.domain=function(A){return arguments.length?g(Array.from(A,Yje)):g().map(Kje)},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(p7(T,A)):m},m.copy=function(){return sg(m,cO(e,t,n,r,i,a,o,l,c,d))},m}function Xje(){return Ca.apply(cO(HSe,qSe,Ss,lO,Pb,lg,oO,iO,$u,k7).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Gje(){return Ca.apply(cO(FSe,USe,js,uO,Mb,Tb,sO,aO,$u,A7).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Rb(){var e=0,t=1,n,r,i,a,o=ti,l=!1,c;function d(f){return f==null||isNaN(f=+f)?c:o(i===0?.5:(f=(a(f)-n)*i,l?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),d):[e,t]},d.clamp=function(f){return arguments.length?(l=!!f,d):l},d.interpolator=function(f){return arguments.length?(o=f,d):o};function m(f){return function(g){var v,b;return arguments.length?([v,b]=g,o=f(v,b),d):[o(0),o(1)]}}return d.range=m(fs),d.rangeRound=m(GA),d.unknown=function(f){return arguments.length?(c=f,d):c},function(f){return a=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),d}}function nu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function O7(){var e=tu(Rb()(ti));return e.copy=function(){return nu(e,O7())},Ps.apply(e,arguments)}function T7(){var e=JA(Rb()).domain([1,10]);return e.copy=function(){return nu(e,T7()).base(e.base())},Ps.apply(e,arguments)}function P7(){var e=eO(Rb());return e.copy=function(){return nu(e,P7()).constant(e.constant())},Ps.apply(e,arguments)}function dO(){var e=tO(Rb());return e.copy=function(){return nu(e,dO()).exponent(e.exponent())},Ps.apply(e,arguments)}function Wje(){return dO.apply(null,arguments).exponent(.5)}function M7(){var e=[],t=ti;function n(r){if(r!=null&&!isNaN(r=+r))return t((ag(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(zl),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)=>A1e(e,a/r))},n.copy=function(){return M7(t).domain(e)},Ps.apply(n,arguments)}function Db(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,d=ti,m,f=!1,g;function v(w){return isNaN(w=+w)?g:(w=.5+((w=+m(w))-a)*(r*w<r*a?l:c),d(f?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),c=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(w){return arguments.length?(f=!!w,v):f},v.interpolator=function(w){return arguments.length?(d=w,v):d};function b(w){return function(S){var j,C,_;return arguments.length?([j,C,_]=S,d=lSe(w,[j,C,_]),v):[d(0),d(.5),d(1)]}}return v.range=b(fs),v.rangeRound=b(GA),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),c=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function R7(){var e=tu(Db()(ti));return e.copy=function(){return nu(e,R7())},Ps.apply(e,arguments)}function D7(){var e=JA(Db()).domain([.1,1,10]);return e.copy=function(){return nu(e,D7()).base(e.base())},Ps.apply(e,arguments)}function I7(){var e=eO(Db());return e.copy=function(){return nu(e,I7()).constant(e.constant())},Ps.apply(e,arguments)}function fO(){var e=tO(Db());return e.copy=function(){return nu(e,fO()).exponent(e.exponent())},Ps.apply(e,arguments)}function Qje(){return fO.apply(null,arguments).exponent(.5)}const bm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:KA,scaleDiverging:R7,scaleDivergingLog:D7,scaleDivergingPow:fO,scaleDivergingSqrt:Qje,scaleDivergingSymlog:I7,scaleIdentity:m7,scaleImplicit:RC,scaleLinear:h7,scaleLog:g7,scaleOrdinal:VA,scalePoint:P1e,scalePow:nO,scaleQuantile:x7,scaleQuantize:b7,scaleRadial:y7,scaleSequential:O7,scaleSequentialLog:T7,scaleSequentialPow:dO,scaleSequentialQuantile:M7,scaleSequentialSqrt:Wje,scaleSequentialSymlog:P7,scaleSqrt:TSe,scaleSymlog:v7,scaleThreshold:w7,scaleTime:Xje,scaleUtc:Gje,tickFormat:f7},Symbol.toStringTag,{value:"Module"}));function Zje(e){if(e in bm)return bm[e]();var t="scale".concat(Yp(e));if(t in bm)return bm[t]()}function Gz(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Zje(e);if(r!=null)return r.domain(t).range(n),r}}function hO(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?Gz(e.scale,n,r):Gz(t,n,r)}function Jje(e){return"scale".concat(Yp(e))}function eEe(e){return Jje(e)in bm}var L7=(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 eEe(r)?r:"point"}};function tEe(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 z7(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,c=tEe(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var d=(o=r[c-1])!==null&&o!==void 0?o:0,m=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-d)<=Math.abs(a-m)?n[c-1]:n[c]}}}function nEe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):z7(e,void 0)}function Wz(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 Yx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wz(Object(n),!0).forEach(function(r){rEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rEe(e,t,n){return(t=iEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iEe(e){var t=aEe(e,"string");return typeof t=="symbol"?t:t+""}function aEe(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 $C=[0,"auto"],rr={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"},$7=(e,t)=>e.cartesianAxis.xAxis[t],Ms=(e,t)=>{var n=$7(e,t);return n??rr},ir={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:$C,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:Qp},B7=(e,t)=>e.cartesianAxis.yAxis[t],Rs=(e,t)=>{var n=B7(e,t);return n??ir},oEe={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:""},mO=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??oEe},$n=(e,t,n)=>{switch(t){case"xAxis":return Ms(e,n);case"yAxis":return Rs(e,n);case"zAxis":return mO(e,n);case"angleAxis":return $A(e,n);case"radiusAxis":return BA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},sEe=(e,t,n)=>{switch(t){case"xAxis":return Ms(e,n);case"yAxis":return Rs(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Xf=(e,t,n)=>{switch(t){case"xAxis":return Ms(e,n);case"yAxis":return Rs(e,n);case"angleAxis":return $A(e,n);case"radiusAxis":return BA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},F7=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function pO(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 Ib=e=>e.graphicalItems.cartesianItems,lEe=le([Tn,ig],pO),gO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),ug=le([Ib,$n,lEe],gO,{memoizeOptions:{resultEqualityCheck:Ab}}),U7=le([ug],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Nb)),H7=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),uEe=le([ug],H7),vO=e=>e.map(t=>t.data).filter(Boolean).flat(1),cEe=le([ug],vO,{memoizeOptions:{resultEqualityCheck:Ab}}),yO=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},xO=le([cEe,PA],yO),bO=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:en(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:en(i,r)}))):e.map(r=>({value:r})),cg=le([xO,$n,ug],bO);function qd(e){if(Co(e)||e instanceof Date){var t=Number(e);if(Pt(t))return t}}function Qz(e){if(Array.isArray(e)){var t=[qd(e[0]),qd(e[1])];return So(t)?t:void 0}var n=qd(e);if(n!=null)return[n,n]}function Es(e){return e.map(qd).filter(yi)}function dEe(e,t){var n=qd(e),r=qd(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var fEe=le([cg],e=>e==null?void 0:e.map(t=>t.value).sort(dEe));function q7(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function hEe(e,t,n){return!n||typeof t!="number"||_o(t)?[]:n.length?Es(n.flatMap(r=>{var i=en(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 fr=e=>{var t=Sr(e),n=Yf(e);return Xf(e,t,n)},dg=le([fr],e=>e==null?void 0:e.dataKey),mEe=le([U7,PA,fr],J9),V7=(e,t,n,r)=>{var i={},a=t.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[l,c]=o,d=r?[...c].reverse():c,m=d.map(UA);return[l,{stackedData:t0e(e,m,n),graphicalItems:d}]}))},BC=le([mEe,U7,rg,K9],V7),K7=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=o0e(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},pEe=le([$n],e=>e.allowDataOverflow),wO=e=>{var t;if(e==null||!("domain"in e))return $C;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Es(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:$C},SO=le([$n],wO),jO=le([SO,pEe],M9),gEe=le([BC,Ts,Tn,jO],K7,{memoizeOptions:{resultEqualityCheck:kb}}),Lb=e=>e.errorBars,vEe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>q7(n,r)),Xx=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]}},EO=(e,t,n,r,i)=>{var a,o;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var d,m,f=(d=r[c.id])===null||d===void 0?void 0:d.filter(j=>q7(i,j)),g=en(l,(m=t.dataKey)!==null&&m!==void 0?m:c.dataKey),v=hEe(l,g,f);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=Qz(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 c=Qz(en(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Pt(a)&&Pt(o))return[a,o]},yEe=le([xO,$n,uEe,Lb,Tn],EO,{memoizeOptions:{resultEqualityCheck:kb}});function xEe(e){var{value:t}=e;if(Co(t)||t instanceof Date)return t}var bEe=(e,t,n)=>{var r=e.map(xEe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&nq(r))?P9(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},Y7=e=>e.referenceElements.dots,Gf=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),wEe=le([Y7,Tn,ig],Gf),X7=e=>e.referenceElements.areas,SEe=le([X7,Tn,ig],Gf),G7=e=>e.referenceElements.lines,jEe=le([G7,Tn,ig],Gf),W7=(e,t)=>{if(e!=null){var n=Es(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},EEe=le(wEe,Tn,W7),Q7=(e,t)=>{if(e!=null){var n=Es(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)]}},_Ee=le([SEe,Tn],Q7);function CEe(e){var t;if(e.x!=null)return Es([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Es(n)}function NEe(e){var t;if(e.y!=null)return Es([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Es(n)}var Z7=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?CEe(r):NEe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},kEe=le([jEe,Tn],Z7),AEe=le(EEe,kEe,_Ee,(e,t,n)=>Xx(e,n,t)),_O=(e,t,n,r,i,a,o,l)=>{if(n!=null)return n;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=c?Xx(r,a,i):Xx(a,i);return i1e(t,d,e.allowDataOverflow)},OEe=le([$n,SO,jO,gEe,yEe,AEe,Ut,Tn],_O,{memoizeOptions:{resultEqualityCheck:kb}}),TEe=[0,1],CO=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,d=ks(t,a);if(d&&l==null){var m;return P9(0,(m=n==null?void 0:n.length)!==null&&m!==void 0?m:0)}return c==="category"?bEe(r,e,d):i==="expand"?TEe:o}},NO=le([$n,Ut,xO,cg,rg,Tn,OEe],CO),ru=le([$n,F7,IA],L7),kO=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=wO(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&So(e)){if(a)return oz(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return sz(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&So(e))return oz(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&So(e))return sz(e,t.tickCount,t.allowDecimals,"adaptive")}}},AO=le([NO,Xf,ru],kO),OO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&So(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],d=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(c,d)]}return t},PEe=le([$n,NO,AO,Tn],OO),MEe=le(cg,$n,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Es(e.map(f=>f.value))).sort((f,g)=>f-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 c=r[l],d=r[l+1];if(!(c==null||d==null)){var m=d-c;n=Math.min(n,m)}}return n/o}}),J7=le(MEe,Ut,V9,cr,(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}),REe=(e,t,n)=>{var r=Ms(e,t);return r==null||typeof r.padding!="string"?0:J7(e,"xAxis",t,n,r.padding)},DEe=(e,t,n)=>{var r=Rs(e,t);return r==null||typeof r.padding!="string"?0:J7(e,"yAxis",t,n,r.padding)},IEe=le(Ms,REe,(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}}),LEe=le(Rs,DEe,(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}}),zEe=le([cr,IEe,yb,vb,(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]}),$Ee=le([cr,Ut,LEe,yb,vb,(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]}),fg=(e,t,n,r)=>{var i;switch(t){case"xAxis":return zEe(e,n,r);case"yAxis":return $Ee(e,n,r);case"zAxis":return(i=mO(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return W9(e);case"radiusAxis":return Q9(e,n);default:return}},eV=le([$n,fg],Eb),BEe=le([ru,PEe],e7),TO=le([$n,ru,BEe,eV],hO),tV=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=ks(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},PO=le([Ut,cg,Xf,Tn],tV),zb=le([TO],HA);le([TO],nEe);le([TO,fEe],z7);le([ug,Lb,Tn],vEe);function nV(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var $b=(e,t)=>t,Bb=(e,t,n)=>n,FEe=le(pb,$b,Bb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(nV)),UEe=le(gb,$b,Bb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(nV)),rV=(e,t)=>({width:e.width,height:t.height}),HEe=(e,t)=>{var n=typeof t.width=="number"?t.width:Qp;return{width:n,height:e.height}},iV=le(cr,Ms,rV),qEe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},VEe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},KEe=le(Os,cr,FEe,$b,Bb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=rV(t,l);o==null&&(o=qEe(t,r,e));var d=r==="top"&&!i||r==="bottom"&&i;a[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),a}),YEe=le(As,cr,UEe,$b,Bb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=HEe(t,l);o==null&&(o=VEe(t,r,e));var d=r==="left"&&!i||r==="right"&&i;a[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),a}),XEe=(e,t)=>{var n=Ms(e,t);if(n!=null)return KEe(e,n.orientation,n.mirror)},GEe=le([cr,Ms,XEe,(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}}}),WEe=(e,t)=>{var n=Rs(e,t);if(n!=null)return YEe(e,n.orientation,n.mirror)},QEe=le([cr,Rs,WEe,(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}}}),aV=le(cr,Rs,(e,t)=>{var n=typeof t.width=="number"?t.width:Qp;return{width:n,height:e.height}}),Zz=(e,t,n)=>{switch(t){case"xAxis":return iV(e,n).width;case"yAxis":return aV(e,n).height;default:return}},oV=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=ks(e,r),c=t.map(d=>d.value);if(o&&l&&a==="category"&&i&&nq(c))return c}},MO=le([Ut,cg,$n,Tn],oV),Jz=le([Ut,sEe,ru,zb,MO,PO,fg,AO,Tn],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var d=ks(e,c);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:c,categoricalDomain:a,duplicateDomain:i,isCategorical:d,niceTicks:l,range:o,realScaleType:n,scale:r}}}),ZEe=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var d=ks(e,c),{type:m,ticks:f,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,b=m==="category"&&r.bandwidth?r.bandwidth()/v:0;b=c==="angleAxis"&&a!=null&&a.length>=2?xr(a[0]-a[1])*2*b:b;var w=f||i;return w?w.map((S,j)=>{var C=o?o.indexOf(S):S,_=r.map(C);return Pt(_)?{index:j,coordinate:_+b,value:S,offset:b}:null}).filter(yi):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(yi):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(yi):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(yi)}},sV=le([Ut,Xf,ru,zb,AO,fg,MO,PO,Tn],ZEe),JEe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=ks(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(r==null?void 0:r.length)>=2?xr(r[0]-r[1])*2*d:d,l&&a?a.map((m,f)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:m,index:f,offset:d}:null}).filter(yi):n.ticks?n.ticks(c).map((m,f)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:m,index:f,offset:d}:null}).filter(yi):n.domain().map((m,f)=>{var g=n.map(m);return Pt(g)?{coordinate:g+d,value:i?i[m]:m,index:f,offset:d}:null}).filter(yi)}},ql=le([Ut,Xf,zb,fg,MO,PO,Tn],JEe),Vl=le($n,zb,(e,t)=>{if(!(e==null||t==null))return Yx(Yx({},e),{},{scale:t})}),e_e=le([$n,ru,NO,eV],hO),t_e=le([e_e],HA);le((e,t,n)=>mO(e,n),t_e,(e,t)=>{if(!(e==null||t==null))return Yx(Yx({},e),{},{scale:t})});var n_e=le([Ut,pb,gb],(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}}),r_e=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([r_e],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 lV=e=>e.options.defaultTooltipEventType,uV=e=>e.options.validateTooltipEventTypes;function cV(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function RO(e,t){var n=lV(e),r=uV(e);return cV(t,n,r)}function i_e(e){return $e(t=>RO(t,e))}var dV=(e,t)=>{var n,r=Number(t);if(!(_o(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},a_e=e=>e.tooltip.settings,El={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},o_e={itemInteraction:{click:El,hover:El},axisInteraction:{click:El,hover:El},keyboardInteraction:El,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}},fV=Kr({name:"tooltip",initialState:o_e,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:gn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=sa(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:gn()},removeTooltipEntrySettings:{reducer(e,t){var n=sa(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:gn()},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:s_e,replaceTooltipEntrySettings:l_e,removeTooltipEntrySettings:u_e,setTooltipSettingsState:c_e,setActiveMouseOverItemIndex:hV,mouseLeaveItem:d_e,mouseLeaveChart:mV,setActiveClickItemIndex:f_e,setMouseOverAxisIndex:pV,setMouseClickAxisIndex:h_e,setSyncInteraction:FC,setKeyboardInteraction:Gx}=fV.actions,m_e=fV.reducer;function e4(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?e4(Object(n),!0).forEach(function(r){p_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p_e(e,t,n){return(t=g_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g_e(e){var t=v_e(e,"string");return typeof t=="symbol"?t:t+""}function v_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)}function y_e(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function x_e(e){return e.index!=null}var gV=(e,t,n,r)=>{if(t==null)return El;var i=y_e(e,t,n);if(i==null)return El;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(x_e(i)){if(a)return my(my({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return my(my({},El),{},{coordinate:i.coordinate})};function b_e(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 w_e(e,t){var n=b_e(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 S_e(e,t,n){if(n==null||t==null)return!0;var r=en(e,t);return r==null||!So(n)?!0:w_e(r,n)}var DO=(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 c=Math.max(o,Math.min(a,l)),d=t[c];return d==null||S_e(d,n,r)?String(c):null},vV=(e,t,n,r,i,a,o)=>{if(a!=null){var l=o[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;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}}}},yV=(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})},xV=e=>e.options.tooltipPayloadSearcher,Wf=e=>e.tooltip;function t4(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 n4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t4(Object(n),!0).forEach(function(r){j_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j_e(e,t,n){return(t=E_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E_e(e){var t=__e(e,"string");return typeof t=="symbol"?t:t+""}function __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)}function C_e(e){if(typeof e=="string"||typeof e=="number")return e}function N_e(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function k_e(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function r4(e){if(typeof e=="string")return e}function A_e(e){if(!(e==null||typeof e!="object")){var t="name"in e?C_e(e.name):void 0,n="unit"in e?N_e(e.unit):void 0,r="dataKey"in e?k_e(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?r4(e.color):void 0,o="fill"in e?r4(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function O_e(e,t){return e??t}var bV=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:m}=n,f=[];return e.reduce((g,v)=>{var b,{dataDefinedOnItem:w,settings:S}=v,j=O_e(w,l),C=Array.isArray(j)?Zq(j,d,m):j,_=(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=rq(C,r,i):O=a(C,t,c,k),Array.isArray(O))O.forEach(T=>{var P,z,L=A_e(T),F=L==null?void 0:L.name,D=L==null?void 0:L.dataKey,X=L==null?void 0:L.payload,R=n4(n4({},S),{},{name:F,unit:L==null?void 0:L.unit,color:(P=L==null?void 0:L.color)!==null&&P!==void 0?P:S==null?void 0:S.color,fill:(z=L==null?void 0:L.fill)!==null&&z!==void 0?z:S==null?void 0:S.fill});g.push(XL({tooltipEntrySettings:R,dataKey:D,payload:X,value:en(X,D),name:F==null?void 0:String(F)}))});else{var A;g.push(XL({tooltipEntrySettings:S,dataKey:_,payload:O,value:en(O,_),name:(A=en(O,k))!==null&&A!==void 0?A:S==null?void 0:S.name}))}return g},f)}},IO=le([fr,F7,IA],L7),T_e=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),P_e=le([Sr,Yf],pO),Qf=le([T_e,fr,P_e],gO,{memoizeOptions:{resultEqualityCheck:Ab}}),M_e=le([Qf],e=>e.filter(Nb)),R_e=le([Qf],vO,{memoizeOptions:{resultEqualityCheck:Ab}}),Zf=le([R_e,Ts],yO),D_e=le([M_e,Ts,fr],J9),LO=le([Zf,fr,Qf],bO),wV=le([fr],wO),I_e=le([fr],e=>e.allowDataOverflow),SV=le([wV,I_e],M9),L_e=le([Qf],e=>e.filter(Nb)),z_e=le([D_e,L_e,rg,K9],V7),$_e=le([z_e,Ts,Sr,SV],K7),B_e=le([Qf],H7),F_e=le([Zf,fr,B_e,Lb,Sr],EO,{memoizeOptions:{resultEqualityCheck:kb}}),U_e=le([Y7,Sr,Yf],Gf),H_e=le([U_e,Sr],W7),q_e=le([X7,Sr,Yf],Gf),V_e=le([q_e,Sr],Q7),K_e=le([G7,Sr,Yf],Gf),Y_e=le([K_e,Sr],Z7),X_e=le([H_e,Y_e,V_e],Xx),G_e=le([fr,wV,SV,$_e,F_e,X_e,Ut,Sr],_O),hg=le([fr,Ut,Zf,LO,rg,Sr,G_e],CO),W_e=le([hg,fr,IO],kO),Q_e=le([fr,hg,W_e,Sr],OO),jV=e=>{var t=Sr(e),n=Yf(e),r=!1;return fg(e,t,n,r)},EV=le([fr,jV],Eb),Z_e=le([fr,IO,Q_e,EV],hO),_V=le([Z_e],HA),J_e=le([Ut,LO,fr,Sr],oV),eCe=le([Ut,LO,fr,Sr],tV),tCe=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,d=ks(e,l);if(r){var m=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,f=c==="category"&&r.bandwidth?r.bandwidth()/m:0;return f=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?xr(i[0]-i[1])*2*f:f,d&&o?o.map((g,v)=>{var b=r.map(g);return Pt(b)?{coordinate:b+f,value:g,index:v,offset:f}:null}).filter(yi):r.domain().map((g,v)=>{var b=r.map(g);return Pt(b)?{coordinate:b+f,value:a?a[g]:g,index:v,offset:f}:null}).filter(yi)}}},Ds=le([Ut,fr,IO,_V,jV,J_e,eCe,Sr],tCe),zO=le([lV,uV,a_e],(e,t,n)=>cV(n.shared,e,t)),CV=e=>e.tooltip.settings.trigger,$O=e=>e.tooltip.settings.defaultIndex,mg=le([Wf,zO,CV,$O],gV),Kl=le([mg,Zf,dg,hg],DO),NV=le([Ds,Kl],dV),BO=le([mg],e=>{if(e)return e.dataKey}),kV=le([mg],e=>{if(e)return e.graphicalItemId}),AV=le([Wf,zO,CV,$O],yV),nCe=le([As,Os,Ut,cr,Ds,$O,AV],vV),rCe=le([mg,nCe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),iCe=le([mg],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),aCe=le([AV,Kl,Ts,dg,NV,xV,zO],bV),oCe=le([aCe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function i4(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 a4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i4(Object(n),!0).forEach(function(r){sCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sCe(e,t,n){return(t=lCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lCe(e){var t=uCe(e,"string");return typeof t=="symbol"?t:t+""}function uCe(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 cCe=()=>$e(fr),dCe=()=>{var e=cCe(),t=$e(Ds),n=$e(_V);return vf(!e||!n?void 0:a4(a4({},e),{},{scale:n}),t)};function o4(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?o4(Object(n),!0).forEach(function(r){fCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fCe(e,t,n){return(t=hCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hCe(e){var t=mCe(e,"string");return typeof t=="symbol"?t:t+""}function mCe(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 pCe=(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}},gCe=(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 _d(_d(_d({},r),Gn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return _d(_d(_d({},r),Gn(r.cx,r.cy,l,c)),{},{angle:c,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 vCe(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 OV=(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 c,d,m,f,g,v=l>0?(c=n[l-1])===null||c===void 0?void 0:c.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?(f=n[0])===null||f===void 0?void 0:f.coordinate:(g=n[l+1])===null||g===void 0?void 0:g.coordinate,S=void 0;if(!(v==null||b==null||w==null))if(xr(b-v)!==xr(w-b)){var j=[];if(xr(w-b)===xr(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 _=w+i[1]-i[0];j[0]=Math.min(b,(_+b)/2),j[1]=Math.max(b,(_+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 P;return(P=n[l])===null||P===void 0?void 0:P.index}}}else if(t)for(var z=0;z<o;z++){var L=t[z];if(L!=null){var F=t[z+1],D=t[z-1];if(z===0&&F!=null&&e<=(L.coordinate+F.coordinate)/2||z===o-1&&D!=null&&e>(L.coordinate+D.coordinate)/2||z>0&&z<o-1&&D!=null&&F!=null&&e>(L.coordinate+D.coordinate)/2&&e<=(L.coordinate+F.coordinate)/2)return L.index}}return-1},yCe=()=>$e(IA),FO=(e,t)=>t,TV=(e,t,n)=>n,UO=(e,t,n,r)=>r,xCe=le(Ds,e=>ab(e,t=>t.coordinate)),HO=le([Wf,FO,TV,UO],gV),qO=le([HO,Zf,dg,hg],DO),bCe=(e,t,n)=>{if(t!=null){var r=Wf(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},PV=le([Wf,FO,TV,UO],yV),Wx=le([As,Os,Ut,cr,Ds,UO,PV],vV),wCe=le([HO,Wx],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),MV=le([Ds,qO],dV),SCe=le([PV,qO,Ts,dg,MV,xV,FO],bV),jCe=le([HO,qO],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),ECe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&vCe(e,o)){var l=s0e(e,t),c=OV(l,a,i,n,r),d=pCe(t,i,c,e);return{activeIndex:String(c),activeCoordinate:d}}},_Ce=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=Ywe(e,n);if(l){var c=l0e(l,t),d=OV(c,o,a,r,i),m=gCe(t,a,d,l);return{activeIndex:String(d),activeCoordinate:m}}}},CCe=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?ECe(e,t,r,i,a,o,l):_Ce(e,t,n,r,i,a,o)},NCe=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}}),kCe=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Wn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:v1e}});function s4(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 l4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s4(Object(n),!0).forEach(function(r){ACe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ACe(e,t,n){return(t=OCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OCe(e){var t=TCe(e,"string");return typeof t=="symbol"?t:t+""}function TCe(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 PCe={},MCe={zIndexMap:Object.values(Wn).reduce((e,t)=>l4(l4({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),PCe)},RCe=new Set(Object.values(Wn));function DCe(e){return RCe.has(e)}var RV=Kr({name:"zIndex",initialState:MCe,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:gn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!DCe(n)&&delete e.zIndexMap[n])},prepare:gn()},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:gn()},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:gn()}}}),{registerZIndexPortal:ICe,unregisterZIndexPortal:LCe,registerZIndexPortalElement:zCe,unregisterZIndexPortalElement:$Ce}=RV.actions,BCe=RV.reducer;function wi(e){var{zIndex:t,children:n}=e,r=$0e(),i=r&&t!==void 0&&t!==0,a=Yr(),o=tn();y.useLayoutEffect(()=>i?(o(ICe({zIndex:t})),()=>{o(LCe({zIndex:t}))}):eu,[o,t,i]);var l=$e(c=>NCe(c,t,a));return i?l?Gl.createPortal(n,l):null:n}function UC(){return UC=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},UC.apply(null,arguments)}function u4(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 py(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u4(Object(n),!0).forEach(function(r){FCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FCe(e,t,n){return(t=UCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UCe(e){var t=HCe(e,"string");return typeof t=="symbol"?t:t+""}function HCe(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 qCe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return y.isValidElement(t)?y.cloneElement(t,r):y.createElement(n,r)}function VCe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:d,chartName:m}=e,f=n,g=r,v=i;if(!c||!f||m!=="ScatterChart"&&d!=="axis")return null;var b,w,S;if(m==="ScatterChart")b=f,w=lwe,S=Wn.cursorLine;else if(m==="BarChart")b=uwe(l,f,a,o),w=N9,S=Wn.cursorRectangle;else if(l==="radial"&&aq(f)){var{cx:j,cy:C,radius:_,startAngle:k,endAngle:O}=A9(f);b={cx:j,cy:C,startAngle:k,endAngle:O,innerRadius:_,outerRadius:_},w=T9,S=Wn.cursorLine}else b={points:Qwe(l,f,a)},w=TA,S=Wn.cursorLine;var A=typeof c=="object"&&"className"in c?c.className:void 0,T=py(py(py(py({stroke:"#ccc",pointerEvents:"none"},a),b),fc(c)),{},{payload:g,payloadIndex:v,className:Dt("recharts-tooltip-cursor",A)});return y.createElement(wi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},y.createElement(qCe,{cursor:c,cursorComp:w,cursorProps:T}))}function KCe(e){var t=dCe(),n=s9(),r=Pc(),i=yCe();return t==null||n==null||r==null||i==null?null:y.createElement(VCe,UC({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var DV=y.createContext(null),YCe=()=>y.useContext(DV),AE={exports:{}},c4;function XCe(){return c4||(c4=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(c,d,m){this.fn=c,this.context=d,this.once=m||!1}function a(c,d,m,f,g){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new i(m,f||c,g),b=n?n+d:d;return c._events[b]?c._events[b].fn?c._events[b]=[c._events[b],v]:c._events[b].push(v):(c._events[b]=v,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new r:delete c._events[d]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],m,f;if(this._eventsCount===0)return d;for(f in m=this._events)t.call(m,f)&&d.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(m)):d},l.prototype.listeners=function(d){var m=n?n+d:d,f=this._events[m];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,v=f.length,b=new Array(v);g<v;g++)b[g]=f[g].fn;return b},l.prototype.listenerCount=function(d){var m=n?n+d:d,f=this._events[m];return f?f.fn?1:f.length:0},l.prototype.emit=function(d,m,f,g,v,b){var w=n?n+d:d;if(!this._events[w])return!1;var S=this._events[w],j=arguments.length,C,_;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,f),!0;case 4:return S.fn.call(S.context,m,f,g),!0;case 5:return S.fn.call(S.context,m,f,g,v),!0;case 6:return S.fn.call(S.context,m,f,g,v,b),!0}for(_=1,C=new Array(j-1);_<j;_++)C[_-1]=arguments[_];S.fn.apply(S.context,C)}else{var k=S.length,O;for(_=0;_<k;_++)switch(S[_].once&&this.removeListener(d,S[_].fn,void 0,!0),j){case 1:S[_].fn.call(S[_].context);break;case 2:S[_].fn.call(S[_].context,m);break;case 3:S[_].fn.call(S[_].context,m,f);break;case 4:S[_].fn.call(S[_].context,m,f,g);break;default:if(!C)for(O=1,C=new Array(j-1);O<j;O++)C[O-1]=arguments[O];S[_].fn.apply(S[_].context,C)}}return!0},l.prototype.on=function(d,m,f){return a(this,d,m,f,!1)},l.prototype.once=function(d,m,f){return a(this,d,m,f,!0)},l.prototype.removeListener=function(d,m,f,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)&&(!f||b.context===f)&&o(this,v);else{for(var w=0,S=[],j=b.length;w<j;w++)(b[w].fn!==m||g&&!b[w].once||f&&b[w].context!==f)&&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})(AE)),AE.exports}var GCe=XCe();const WCe=Hi(GCe);var ep=new WCe,HC="recharts.syncEvent.tooltip",d4="recharts.syncEvent.brush",VO=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!_o(n))return e[n]}},QCe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},IV=Kr({name:"options",initialState:QCe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),ZCe=IV.reducer,{createEventEmitter:JCe}=IV.actions;function eNe(e){return e.tooltip.syncInteraction}var tNe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},LV=Kr({name:"chartData",initialState:tNe,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:f4,setDataStartEndIndexes:nNe,setComputedData:g$e}=LV.actions,rNe=LV.reducer,iNe=["x","y"];function h4(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 Cd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h4(Object(n),!0).forEach(function(r){aNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aNe(e,t,n){return(t=oNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oNe(e){var t=sNe(e,"string");return typeof t=="symbol"?t:t+""}function sNe(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 lNe(e,t){if(e==null)return{};var n,r,i=uNe(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 uNe(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 cNe(){var e=$e(LA),t=$e(zA),n=tn(),r=$e(Y9),i=$e(Ds),a=Pc(),o=xb(),l=$e(c=>c.rootProps.className);y.useEffect(()=>{if(e==null)return eu;var c=(d,m,f)=>{if(t!==f&&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=lNe(v,iNe),{x:j,y:C,width:_,height:k}=m.payload.sourceViewBox,O=Cd(Cd({},S),{},{x:o.x+(_?(b-j)/_:0)*o.width,y:o.y+(k?(w-C)/k:0)*o.height});n(Cd(Cd({},m),{},{payload:Cd(Cd({},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},P=r(i,T);A=i[P]}else r==="value"&&(A=i.find($=>String($.value)===m.payload.label));var{coordinate:z}=m.payload;if(A==null||m.payload.active===!1||z==null||o==null){n(FC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:L,y:F}=z,D=Math.min(L,o.x+o.width),X=Math.min(F,o.y+o.height),R={x:a==="horizontal"?A.coordinate:D,y:a==="horizontal"?X:A.coordinate},q=FC({active:m.payload.active,coordinate:R,dataKey:m.payload.dataKey,index:String(A.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(q)}}};return ep.on(HC,c),()=>{ep.off(HC,c)}},[l,n,t,e,r,i,a,o])}function dNe(){var e=$e(LA),t=$e(zA),n=tn();y.useEffect(()=>{if(e==null)return eu;var r=(i,a,o)=>{t!==o&&e===i&&n(nNe(a))};return ep.on(d4,r),()=>{ep.off(d4,r)}},[n,t,e])}function fNe(){var e=tn();y.useEffect(()=>{e(JCe())},[e]),cNe(),dNe()}function hNe(e,t,n,r,i,a){var o=$e(b=>bCe(b,e,t)),l=$e(kV),c=$e(zA),d=$e(LA),m=$e(Y9),f=$e(eNe),g=f==null?void 0:f.active,v=xb();y.useEffect(()=>{if(!g&&d!=null&&c!=null){var b=FC({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:l});ep.emit(HC,d,b,c)}},[g,n,o,l,i,r,c,d,m,a,v])}function m4(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 p4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m4(Object(n),!0).forEach(function(r){mNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mNe(e,t,n){return(t=pNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pNe(e){var t=gNe(e,"string");return typeof t=="symbol"?t:t+""}function gNe(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 vNe(e){return e.dataKey}function yNe(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(Lbe,t)}var g4=[],xNe={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 zV(e){var t,n,r=Zn(e,xNe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:m,offset:f,payloadUniqBy:g,position:v,reverseDirection:b,useTranslate3d:w,wrapperStyle:S,cursor:j,shared:C,trigger:_,defaultIndex:k,portal:O,axisId:A}=r,T=tn(),P=typeof k=="number"?String(k):k;y.useEffect(()=>{T(c_e({shared:C,trigger:_,axisId:A,active:i,defaultIndex:P}))},[T,C,_,A,i,P]);var z=xb(),L=S9(),F=i_e(C),{activeIndex:D,isActive:X}=(t=$e(re=>jCe(re,F,_,P)))!==null&&t!==void 0?t:{},R=$e(re=>SCe(re,F,_,P)),q=$e(re=>MV(re,F,_,P)),$=$e(re=>wCe(re,F,_,P)),V=R,G=YCe(),K=(n=i??X)!==null&&n!==void 0?n:!1,[I,H]=Sq([V,K]),U=F==="axis"?q:void 0;hNe(F,_,$,U,D,K);var B=O??G;if(B==null||z==null||F==null)return null;var Q=V??g4;K||(Q=g4),d&&Q.length&&(Q=gq(Q.filter(re=>re.value!=null&&(re.hide!==!0||r.includeHidden)),g,vNe));var Z=Q.length>0,te=p4(p4({},r),{},{payload:Q,label:U,active:K,activeIndex:D,coordinate:$,accessibilityLayer:L}),ae=y.createElement(Xbe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:m,active:K,coordinate:$,hasPayload:Z,offset:f,position:v,reverseDirection:b,useTranslate3d:w,viewBox:z,wrapperStyle:S,lastBoundingBox:I,innerRef:H,hasPortalFromProps:!!O},yNe(c,te));return y.createElement(y.Fragment,null,Gl.createPortal(ae,B),K&&y.createElement(KCe,{cursor:j,tooltipEventType:F,coordinate:$,payload:Q,index:D}))}var pg=e=>null;pg.displayName="Cell";function bNe(e,t,n){return(t=wNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wNe(e){var t=SNe(e,"string");return typeof t=="symbol"?t:t+""}function SNe(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 jNe{constructor(t){bNe(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 v4(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 ENe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v4(Object(n),!0).forEach(function(r){_Ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Ne(e,t,n){return(t=CNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CNe(e){var t=NNe(e,"string");return typeof t=="symbol"?t:t+""}function NNe(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 kNe={cacheSize:2e3,enableCache:!0},$V=ENe({},kNe),y4=new jNe($V.cacheSize),ANe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},x4="recharts_measurement_span";function ONe(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 b4=(e,t)=>{try{var n=document.getElementById(x4);n||(n=document.createElement("span"),n.setAttribute("id",x4),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,ANe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Om=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||eg.isSsr)return{width:0,height:0};if(!$V.enableCache)return b4(t,n);var r=ONe(t,n),i=y4.get(r);if(i)return i;var a=b4(t,n);return y4.set(r,a),a},BV;function TNe(e,t,n){return(t=PNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PNe(e){var t=MNe(e,"string");return typeof t=="symbol"?t:t+""}function MNe(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 w4=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,S4=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,RNe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,DNe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,INe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},LNe=["cm","mm","pt","pc","in","Q","px"];function zNe(e){return LNe.includes(e)}var Id="NaN";function $Ne(e,t){return e*INe[t]}class Or{static parse(t){var n,[,r,i]=(n=DNe.exec(t))!==null&&n!==void 0?n:[];return r==null?Or.NaN:new Or(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,_o(t)&&(this.unit=""),n!==""&&!RNe.test(n)&&(this.num=NaN,this.unit=""),zNe(n)&&(this.num=$Ne(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Or(NaN,""):new Or(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Or(NaN,""):new Or(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Or(NaN,""):new Or(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Or(NaN,""):new Or(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return _o(this.num)}}BV=Or;TNe(Or,"NaN",new BV(NaN,""));function FV(e){if(e==null||e.includes(Id))return Id;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=w4.exec(t))!==null&&n!==void 0?n:[],o=Or.parse(r??""),l=Or.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Id;t=t.replace(w4,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,m,f,g]=(d=S4.exec(t))!==null&&d!==void 0?d:[],v=Or.parse(m??""),b=Or.parse(g??""),w=f==="+"?v.add(b):v.subtract(b);if(w.isNaN())return Id;t=t.replace(S4,w.toString())}return t}var j4=/\(([^()]*)\)/;function BNe(e){for(var t=e,n;(n=j4.exec(t))!=null;){var[,r]=n;t=t.replace(j4,FV(r))}return t}function FNe(e){var t=e.replace(/\s+/g,"");return t=BNe(t),t=FV(t),t}function UNe(e){try{return FNe(e)}catch{return Id}}function OE(e){var t=UNe(e.slice(5,-1));return t===Id?"":t}var HNe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],qNe=["dx","dy","angle","className","breakAll"];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 E4(e,t){if(e==null)return{};var n,r,i=VNe(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 VNe(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 UV=/[ \f\n\r\t\v\u2028\u2029]+/,HV=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];En(t)||(n?i=t.toString().split(""):i=t.toString().split(UV));var a=i.map(l=>({word:l,width:Om(l,r).width})),o=n?0:Om(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function qV(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function KNe(e){return En(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var VV=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:l}=a,c=i[i.length-1];if(c&&l!=null&&(t==null||r||c.width+l+n<Number(t)))c.words.push(o),c.width+=l+n;else{var d={words:[o],width:l};i.push(d)}return i},[]),KV=e=>e.reduce((t,n)=>t.width>n.width?t:n),YNe="…",_4=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),d=HV({breakAll:n,style:r,children:c+YNe});if(!d)return[!1,[]];var m=VV(d.wordsWithComputedWidth,a,o,l),f=m.length>i||KV(m).width>Number(a);return[f,m]},XNe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,d=De(a),m=String(o),f=VV(t,r,n,i);if(!d||i)return f;var g=f.length>a||KV(f).width>Number(r);if(!g)return f;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,[_,k]=_4(m,C,c,l,a,r,n,i),[O]=_4(m,j,c,l,a,r,n,i);if(!_&&!O&&(v=j+1),_&&O&&(b=j-1),!_&&O){S=k;break}w++}return S||f},C4=e=>{var t=En(e)?[]:e.toString().split(UV);return[{words:t,width:void 0}]},GNe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!eg.isSsr){var l,c,d=HV({breakAll:a,children:r,style:i});if(d){var{wordsWithComputedWidth:m,spaceWidth:f}=d;l=m,c=f}else return C4(r);return XNe({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return C4(r)},YV="#808080",WNe={angle:0,breakAll:!1,capHeight:"0.71em",fill:YV,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Fb=y.forwardRef((e,t)=>{var n=Zn(e,WNe),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:m}=n,f=E4(n,HNe),g=y.useMemo(()=>GNe({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:v,dy:b,angle:w,className:S,breakAll:j}=f,C=E4(f,qNe);if(!Co(r)||!Co(i)||g.length===0)return null;var _=Number(r)+(De(v)?v:0),k=Number(i)+(De(b)?b:0);if(!Pt(_)||!Pt(k))return null;var O;switch(m){case"start":O=OE("calc(".concat(o,")"));break;case"middle":O=OE("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=OE("calc(".concat(g.length-1," * -").concat(a,")"));break}var A=[],T=g[0];if(c&&T!=null){var P=T.width,{width:z}=f;A.push("scale(".concat(De(z)&&De(P)?z/P:1,")"))}return w&&A.push("rotate(".concat(w,", ").concat(_,", ").concat(k,")")),A.length&&(C.transform=A.join(" ")),y.createElement("text",qC({},ni(C),{ref:t,x:_,y:k,className:Dt("recharts-text",S),textAnchor:d,fill:l.includes("url")?YV:l}),g.map((L,F)=>{var D=L.words.join(j?"":" ");return y.createElement("tspan",{x:_,dy:F===0?O:a,key:"".concat(D,"-").concat(F)},D)}))});Fb.displayName="Text";function N4(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 uo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N4(Object(n),!0).forEach(function(r){QNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QNe(e,t,n){return(t=ZNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZNe(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 eke=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:d}=CA(t),m=a,f=a+(c-d)/2,g=(m+f)/2,v=(c+d)/2,b=m+c/2,w=l>=0?1:-1,S=w*r,j=w>0?"end":"start",C=w>0?"start":"end",_=c>=0?1:-1,k=_*r,O=_>0?"end":"start",A=_>0?"start":"end",T=i;if(n==="top"){var P={x:m+c/2,y:o-S,horizontalAnchor:"middle",verticalAnchor:j};return T&&(P.height=Math.max(o-T.y,0),P.width=c),P}if(n==="bottom"){var z={x:f+d/2,y:o+l+S,horizontalAnchor:"middle",verticalAnchor:C};return T&&(z.height=Math.max(T.y+T.height-(o+l),0),z.width=d),z}if(n==="left"){var L={x:g-k,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"};return T&&(L.width=Math.max(L.x-T.x,0),L.height=l),L}if(n==="right"){var F={x:g+v+k,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"};return T&&(F.width=Math.max(T.x+T.width-F.x,0),F.height=l),F}var D=T?{width:v,height:l}:{};return n==="insideLeft"?uo({x:g+k,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"},D):n==="insideRight"?uo({x:g+v-k,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"},D):n==="insideTop"?uo({x:m+c/2,y:o+S,horizontalAnchor:"middle",verticalAnchor:C},D):n==="insideBottom"?uo({x:f+d/2,y:o+l-S,horizontalAnchor:"middle",verticalAnchor:j},D):n==="insideTopLeft"?uo({x:m+k,y:o+S,horizontalAnchor:A,verticalAnchor:C},D):n==="insideTopRight"?uo({x:m+c-k,y:o+S,horizontalAnchor:O,verticalAnchor:C},D):n==="insideBottomLeft"?uo({x:f+k,y:o+l-S,horizontalAnchor:A,verticalAnchor:j},D):n==="insideBottomRight"?uo({x:f+d-k,y:o+l-S,horizontalAnchor:O,verticalAnchor:j},D):n&&typeof n=="object"&&(De(n.x)||pc(n.x))&&(De(n.y)||pc(n.y))?uo({x:a+Hr(n.x,v),y:o+Hr(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},D):uo({x:b,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},D)},tke=["labelRef"],nke=["content"];function k4(e,t){if(e==null)return{};var n,r,i=rke(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 rke(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 A4(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 wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A4(Object(n),!0).forEach(function(r){ike(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ike(e,t,n){return(t=ake(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ake(e){var t=oke(e,"string");return typeof t=="symbol"?t:t+""}function oke(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 ss(){return ss=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},ss.apply(null,arguments)}var XV=y.createContext(null),ske=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:l}=e,c=y.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return y.createElement(XV.Provider,{value:c},l)},GV=()=>{var e=y.useContext(XV),t=xb();return e||(t?CA(t):void 0)},lke=y.createContext(null),uke=()=>{var e=y.useContext(lke),t=$e(Z9);return e||t},cke=e=>{var{value:t,formatter:n}=e,r=En(e.children)?t:e.children;return typeof n=="function"?n(r):r},KO=e=>e!=null&&typeof e=="function",dke=(e,t)=>{var n=xr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},fke=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:m,startAngle:f,endAngle:g,clockWise:v}=i,b=(d+m)/2,w=dke(f,g),S=w>=0?1:-1,j,C;switch(t){case"insideStart":j=f+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 _=Gn(l,c,b,j),k=Gn(l,c,b,j+(C?1:-1)*359),O="M".concat(_.x,",").concat(_.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
    `).concat(k.x,",").concat(k.y),A=En(e.id)?Um("recharts-radial-line-"):e.id;return y.createElement("text",ss({},r,{dominantBaseline:"central",className:Dt("recharts-radial-bar-label",o)}),y.createElement("defs",null,y.createElement("path",{id:A,d:O})),y.createElement("textPath",{xlinkHref:"#".concat(A)},n))},hke=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(n==="outside"){var{x:m,y:f}=Gn(r,i,o+t,d);return{x:m,y:f,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}=Gn(r,i,g,d);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Ly=e=>e!=null&&"cx"in e&&De(e.cx),mke={angle:0,offset:5,zIndex:Wn.label,position:"middle",textBreakAll:!1};function pke(e){if(!Ly(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 Sl(e){var t=Zn(e,mke),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:d,labelRef:m}=t,f=uke(),g=GV(),v=i==="center"?g:f??g,b,w,S;n==null?b=v:Ly(n)?b=n:b=CA(n);var j=pke(b);if(!b||En(a)&&En(o)&&!y.isValidElement(l)&&typeof l!="function")return null;var C=wm(wm({},t),{},{viewBox:b});if(y.isValidElement(l)){var{labelRef:_}=C,k=k4(C,tke);return y.cloneElement(l,k)}if(typeof l=="function"){var{content:O}=C,A=k4(C,nke);if(w=y.createElement(l,A),y.isValidElement(w))return w}else w=cke(t);var T=ni(t);if(Ly(b)){if(i==="insideStart"||i==="insideEnd"||i==="end")return fke(t,i,w,T,b);S=hke(b,t.offset,t.position)}else{if(!j)return null;var P=eke({viewBox:j,position:i,offset:t.offset,parentViewBox:Ly(r)?void 0:r});S=wm(wm({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return y.createElement(wi,{zIndex:t.zIndex},y.createElement(Fb,ss({ref:m,className:Dt("recharts-label",c)},T,S,{textAnchor:qV(T.textAnchor)?T.textAnchor:S.textAnchor,breakAll:d}),w))}Sl.displayName="Label";var gke=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?y.createElement(Sl,ss({key:"label-implicit"},r)):Co(e)?y.createElement(Sl,ss({key:"label-implicit",value:e},r)):y.isValidElement(e)?e.type===Sl?y.cloneElement(e,wm({key:"label-implicit"},r)):y.createElement(Sl,ss({key:"label-implicit",content:e},r)):KO(e)?y.createElement(Sl,ss({key:"label-implicit",content:e},r)):e&&typeof e=="object"?y.createElement(Sl,ss({},e,{key:"label-implicit"},r)):null};function vke(e){var{label:t,labelRef:n}=e,r=GV();return gke(t,r,n)||null}var yke=["valueAccessor"],xke=["dataKey","clockWise","id","textBreakAll","zIndex"];function Qx(){return Qx=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},Qx.apply(null,arguments)}function O4(e,t){if(e==null)return{};var n,r,i=bke(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 bke(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 wke=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(KNe(t))return t},WV=y.createContext(void 0),QV=WV.Provider,ZV=y.createContext(void 0),Ske=ZV.Provider;function jke(){return y.useContext(WV)}function Eke(){return y.useContext(ZV)}function zy(e){var{valueAccessor:t=wke}=e,n=O4(e,yke),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=O4(n,xke),d=jke(),m=Eke(),f=d||m;return!f||!f.length?null:y.createElement(wi,{zIndex:l??Wn.label},y.createElement(ur,{className:"recharts-label-list"},f.map((g,v)=>{var b,w=En(r)?t(g,v):en(g.payload,r),S=En(a)?{}:{id:"".concat(a,"-").concat(v)};return y.createElement(Sl,Qx({key:"label-".concat(v)},ni(g),c,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}))})))}zy.displayName="LabelList";function YO(e){var{label:t}=e;return t?t===!0?y.createElement(zy,{key:"labelList-implicit"}):y.isValidElement(t)||KO(t)?y.createElement(zy,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(zy,Qx({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function VC(){return VC=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},VC.apply(null,arguments)}var JV=e=>{var{cx:t,cy:n,r,className:i}=e,a=Dt("recharts-dot",i);return De(t)&&De(n)&&De(r)?y.createElement("circle",VC({},$i(e),mA(e),{className:a,cx:t,cy:n,r})):null},eK=e=>e.graphicalItems.polarItems,_ke=le([Tn,ig],pO),Ub=le([eK,$n,_ke],gO),Cke=le([Ub],vO),Hb=le([Cke,jb],yO),Nke=le([Hb,$n,Ub],bO);le([Hb,$n,Ub],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=en(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:en(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var T4=()=>{},kke=le([Hb,$n,Ub,Lb,Tn],EO),Ake=le([$n,SO,jO,T4,kke,T4,Ut,Tn],_O),tK=le([$n,Ut,Hb,Nke,rg,Tn,Ake],CO),Oke=le([tK,Xf,ru],kO),Tke=le([$n,tK,Oke,Tn],OO);le([ru,Tke],e7);var Pke={radiusAxis:{},angleAxis:{}},nK=Kr({name:"polarAxis",initialState:Pke,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:v$e,removeRadiusAxis:y$e,addAngleAxis:x$e,removeAngleAxis:b$e}=nK.actions,Mke=nK.reducer;function rK(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function P4(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 M4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P4(Object(n),!0).forEach(function(r){Rke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P4(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=(e,t)=>t,XO=le([eK,Lke],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),zke=[],GO=(e,t,n)=>(n==null?void 0:n.length)===0?zke:n,iK=le([jb,XO,GO],(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=>M4(M4({},t.presentationProps),a.props))),i!=null)return i}}),$ke=le([iK,XO,GO],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=en(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:Hf(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),Bke=le([iK,XO,GO,cr],(e,t,n,r)=>{if(!(t==null||e==null))return qAe({offset:r,pieSettings:t,displayedData:e,cells:n})}),TE={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 R4;function Fke(){if(R4)return Jt;R4=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"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=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 c:case d:case g:return w;default:switch(w=w&&w.$$typeof,w){case o:case l:case f: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=f,Jt.Memo=m,Jt.Portal=t,Jt.Profiler=i,Jt.StrictMode=r,Jt.Suspense=c,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)===f},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)===c},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===c||w===d||typeof w=="object"&&w!==null&&(w.$$typeof===f||w.$$typeof===m||w.$$typeof===o||w.$$typeof===a||w.$$typeof===l||w.$$typeof===v||w.getModuleId!==void 0)},Jt.typeOf=b,Jt}var D4;function Uke(){return D4||(D4=1,TE.exports=Fke()),TE.exports}var Hke=Uke(),I4=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",L4=null,PE=null,aK=e=>{if(e===L4&&Array.isArray(PE))return PE;var t=[];return y.Children.forEach(e,n=>{En(n)||(Hke.isFragment(n)?t=t.concat(aK(n.props.children)):t.push(n))}),PE=t,L4=e,t};function WO(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>I4(i)):r=[I4(t)],aK(e).forEach(i=>{var a=mc(i,"type.displayName")||mc(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var oK=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,ME={},z4;function qke(){return z4||(z4=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})(ME)),ME}var RE,$4;function Vke(){return $4||($4=1,RE=qke().isPlainObject),RE}var Kke=Vke();const Yke=Hi(Kke);var B4,F4,U4,H4,q4;function V4(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 K4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V4(Object(n),!0).forEach(function(r){Xke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xke(e,t,n){return(t=Gke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gke(e){var t=Wke(e,"string");return typeof t=="symbol"?t:t+""}function Wke(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 Zx(){return Zx=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},Zx.apply(null,arguments)}function cm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Y4=(e,t,n,r,i)=>{var a=n-r,o;return o=Ln(B4||(B4=cm(["M ",",",""])),e,t),o+=Ln(F4||(F4=cm(["L ",",",""])),e+n,t),o+=Ln(U4||(U4=cm(["L ",",",""])),e+n-a/2,t+i),o+=Ln(H4||(H4=cm(["L ",",",""])),e+n-a/2-r,t+i),o+=Ln(q4||(q4=cm(["L ",","," Z"])),e,t),o},Qke={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Zke=e=>{var t=Zn(e,Qke),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:m,isUpdateAnimationActive:f}=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),_=y.useRef(r),k=ng(e,"trapezoid-");if(y.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var R=g.current.getTotalLength();R&&b(R)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var O=Dt("recharts-trapezoid",l);if(!f)return y.createElement("g",null,y.createElement("path",Zx({},ni(t),{className:O,d:Y4(n,r,i,a,o)})));var A=w.current,T=S.current,P=j.current,z=C.current,L=_.current,F="0px ".concat(v===-1?1:v,"px"),D="".concat(v,"px ").concat(v,"px"),X=j9(["strokeDasharray"],d,c);return y.createElement(tg,{animationId:k,key:k,canBegin:v>0,duration:d,easing:c,isActive:f,begin:m},R=>{var q=wn(A,i,R),$=wn(T,a,R),V=wn(P,o,R),G=wn(z,n,R),K=wn(L,r,R);g.current&&(w.current=q,S.current=$,j.current=V,C.current=G,_.current=K);var I=R>0?{transition:X,strokeDasharray:D}:{strokeDasharray:F};return y.createElement("path",Zx({},ni(t),{className:O,d:Y4(G,K,q,$,V),ref:g,style:K4(K4({},I),t.style)}))})},Jke=["option","shapeType","activeClassName","inActiveClassName"];function eAe(e,t){if(e==null)return{};var n,r,i=tAe(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 tAe(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 X4(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 Jx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X4(Object(n),!0).forEach(function(r){nAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nAe(e,t,n){return(t=rAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rAe(e){var t=iAe(e,"string");return typeof t=="symbol"?t:t+""}function iAe(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 aAe(e,t){return Jx(Jx({},t),e)}function oAe(e,t){return e==="symbols"}function G4(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return y.createElement(N9,n);case"trapezoid":return y.createElement(Zke,n);case"sector":return y.createElement(T9,n);case"symbols":if(oAe(t))return y.createElement(hA,n);break;case"curve":return y.createElement(TA,n);default:return null}}function sAe(e){return y.isValidElement(e)?e.props:e}function QO(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=eAe(e,Jke),o;if(y.isValidElement(t))o=y.cloneElement(t,Jx(Jx({},a),sAe(t)));else if(typeof t=="function")o=t(a,a.index);else if(Yke(t)&&typeof t!="boolean"){var l=aAe(t,a);o=y.createElement(G4,{shapeType:n,elementProps:l})}else{var c=a;o=y.createElement(G4,{shapeType:n,elementProps:c})}return a.isActive?y.createElement(ur,{className:r},o):y.createElement(ur,{className:i},o)}var ZO=(e,t,n)=>{var r=tn();return(i,a)=>o=>{e==null||e(i,a,o),r(hV({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},JO=e=>{var t=tn();return(n,r)=>i=>{e==null||e(n,r,i),t(d_e())}},e2=(e,t,n)=>{var r=tn();return(i,a)=>o=>{e==null||e(i,a,o),r(f_e({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function t2(e){var{tooltipEntrySettings:t}=e,n=tn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(s_e(t)):i.current!==t&&n(l_e({prev:i.current,next:t})),i.current=t)},[t,n,r]),y.useLayoutEffect(()=>()=>{i.current&&(n(u_e(i.current)),i.current=null)},[n]),null}function sK(e){var{legendPayload:t}=e,n=tn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(v9(t)):i.current!==t&&n(y9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(x9(i.current)),i.current=null)},[n]),null}function lAe(e){var{legendPayload:t}=e,n=tn(),r=$e(Ut),i=y.useRef(null);return y.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(v9(t)):i.current!==t&&n(y9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(x9(i.current)),i.current=null)},[n]),null}var DE,uAe=()=>{var[e]=y.useState(()=>Um("uid-"));return e},cAe=(DE=mN.useId)!==null&&DE!==void 0?DE:uAe;function dAe(e,t){var n=cAe();return t||(e?"".concat(e,"-").concat(n):n)}var fAe=y.createContext(void 0),n2=e=>{var{id:t,type:n,children:r}=e,i=dAe("recharts-".concat(n),t);return y.createElement(fAe.Provider,{value:i},r(i))},hAe={cartesianItems:[],polarItems:[]},lK=Kr({name:"graphicalItems",initialState:hAe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:gn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=sa(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:gn()},removeCartesianGraphicalItem:{reducer(e,t){var n=sa(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:gn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:gn()},removePolarGraphicalItem:{reducer(e,t){var n=sa(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:gn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=sa(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:gn()}}}),{addCartesianGraphicalItem:mAe,replaceCartesianGraphicalItem:pAe,removeCartesianGraphicalItem:gAe,addPolarGraphicalItem:vAe,removePolarGraphicalItem:yAe,replacePolarGraphicalItem:xAe}=lK.actions,bAe=lK.reducer,wAe=e=>{var t=tn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(mAe(e)):n.current!==e&&t(pAe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(gAe(n.current)),n.current=null)},[t]),null},uK=y.memo(wAe),SAe=e=>{var t=tn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(vAe(e)):n.current!==e&&t(xAe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(yAe(n.current)),n.current=null)},[t]),null},jAe=y.memo(SAe),EAe=["key"],_Ae=["onMouseEnter","onClick","onMouseLeave"],CAe=["id"],NAe=["id"];function Yl(){return Yl=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},Yl.apply(null,arguments)}function qb(e,t){if(e==null)return{};var n,r,i=kAe(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 kAe(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 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 Sn(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){AAe(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 AAe(e,t,n){return(t=OAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OAe(e){var t=TAe(e,"string");return typeof t=="symbol"?t:t+""}function TAe(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 PAe(e){var t=y.useMemo(()=>WO(e.children,pg),[e.children]),n=$e(r=>$ke(r,e.id,t));return n==null?null:y.createElement(lAe,{legendPayload:n})}function MAe(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 RAe=y.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:l,hide:c,tooltipType:d,id:m,activeShape:f}=e,g=MAe(f),v=r.map(w=>{var S=w.tooltipPayload;return g==null||S==null?S:S.map(j=>Sn(Sn({},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:Hf(l,t),hide:c,type:d,color:o,unit:"",graphicalItemId:m}};return y.createElement(t2,{tooltipEntrySettings:b})}),DAe=(e,t)=>e>t?"start":e<t?"end":"middle",IAe=(e,t,n)=>Hr(typeof t=="function"?t(e):t,n,n*.8),LAe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=k9(a,o),c=i+Hr(e.cx,a,a/2),d=r+Hr(e.cy,o,o/2),m=Hr(e.innerRadius,l,0),f=IAe(n,e.outerRadius,l),g=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:d,innerRadius:m,outerRadius:f,maxRadius:g}},zAe=(e,t)=>{var n=xr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},$Ae=(e,t)=>{if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Dt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=qb(t,EAe);return y.createElement(TA,Yl({},i,{type:"linear",className:n}))},BAe=(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=Dt("recharts-pie-label-text",rK(e));return y.createElement(Fb,Yl({},t,{alignmentBaseline:"middle",className:i}),r)};function FAe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=$i(n),c=fc(i),d=fc(a),m=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,f=t.map((g,v)=>{var b=(g.startAngle+g.endAngle)/2,w=Gn(g.cx,g.cy,g.outerRadius+m,b),S=Sn(Sn(Sn(Sn({},l),g),{},{stroke:"none"},c),{},{index:v,textAnchor:DAe(w.x,g.cx)},w),j=Sn(Sn(Sn(Sn({},l),g),{},{fill:"none",stroke:g.fill},d),{},{index:v,points:[Gn(g.cx,g.cy,g.outerRadius,b),w],key:"line"});return y.createElement(wi,{zIndex:Wn.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},y.createElement(ur,null,a&&$Ae(a,j),BAe(i,S,en(g,o))))});return y.createElement(ur,{className:"recharts-pie-labels"},f)}function UAe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?y.createElement(YO,{label:i}):y.createElement(FAe,{sectors:t,props:n,showLabels:r})}function HAe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=$e(Kl),c=$e(BO),d=$e(kV),{onMouseEnter:m,onClick:f,onMouseLeave:g}=i,v=qb(i,_Ae),b=ZO(m,i.dataKey,o),w=JO(g),S=e2(f,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 _=d==null||d===o,k=String(C)===l&&(c==null||i.dataKey===c)&&_,O=l?r:null,A=n&&k?n:O,T=Sn(Sn({},j),{},{stroke:j.stroke,tabIndex:-1,[n9]:C,[r9]:o});return y.createElement(ur,Yl({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"},Xp(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),y.createElement(QO,Yl({option:a??A,index:C,shapeType:"sector",isActive:k},T)))}))}function qAe(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:l,endAngle:c,dataKey:d,nameKey:m,tooltipType:f}=n,g=Math.abs(n.minAngle),v=zAe(l,c),b=Math.abs(v),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(A=>en(A,d,0)!==0).length,j=(b>=360?S:S-1)*w,C=b-S*g-j,_=r.reduce((A,T)=>{var P=en(T,d,0);return A+(De(P)?P:0)},0),k;if(_>0){var O;k=r.map((A,T)=>{var P=en(A,d,0),z=en(A,m,T),L=LAe(n,a,A),F=(De(P)?P:0)/_,D,X=Sn(Sn({},A),i&&i[T]&&i[T].props),R=X!=null&&"fill"in X&&typeof X.fill=="string"?X.fill:n.fill;T?D=O.endAngle+xr(v)*w*(P!==0?1:0):D=l;var q=D+xr(v)*((P!==0?g:0)+F*C),$=(D+q)/2,V=(L.innerRadius+L.outerRadius)/2,G=[{name:z,value:P,payload:X,dataKey:d,type:f,color:R,fill:R,graphicalItemId:n.id}],K=Gn(L.cx,L.cy,V,$);return O=Sn(Sn(Sn(Sn({},n.presentationProps),{},{percent:F,cornerRadius:typeof o=="string"?parseFloat(o):o,name:z,tooltipPayload:G,midAngle:$,middleRadius:V,tooltipPosition:K},X),L),{},{value:P,dataKey:d,startAngle:D,endAngle:q,payload:X,paddingAngle:xr(v)*w}),O})}return k}function VAe(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(Ske,{value:t?i:void 0},r)}function KAe(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,activeShape:d,inactiveShape:m,onAnimationStart:f,onAnimationEnd:g}=t,v=ng(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 f=="function"&&f(),S(!0)},[f]);return y.createElement(VAe,{showLabels:!w,sectors:i},y.createElement(tg,{animationId:v,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:C,onAnimationEnd:j,key:v},_=>{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((P,z)=>{var L=b&&b[z],F=z>0?mc(P,"paddingAngle",0):0;if(L){var D=wn(L.endAngle-L.startAngle,P.endAngle-P.startAngle,_),X=Sn(Sn({},P),{},{startAngle:T+F,endAngle:T+D+F});O.push(X),T=X.endAngle}else{var{endAngle:R,startAngle:q}=P,$=wn(0,R-q,_),V=Sn(Sn({},P),{},{startAngle:T+F,endAngle:T+$+F});O.push(V),T=V.endAngle}}),n.current=O,y.createElement(ur,null,y.createElement(HAe,{sectors:O,activeShape:d,inactiveShape:m,allOtherPieProps:t,shape:t.shape,id:r}))}),y.createElement(UAe,{showLabels:!w,sectors:i,props:t}),t.children)}var YAe={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:Wn.area};function XAe(e){var{id:t}=e,n=qb(e,CAe),{hide:r,className:i,rootTabIndex:a}=e,o=y.useMemo(()=>WO(e.children,pg),[e.children]),l=$e(m=>Bke(m,t,o)),c=y.useRef(null),d=Dt("recharts-pie",i);return r||l==null?(c.current=null,y.createElement(ur,{tabIndex:a,className:d})):y.createElement(wi,{zIndex:e.zIndex},y.createElement(RAe,{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(ur,{tabIndex:a,className:d},y.createElement(KAe,{props:Sn(Sn({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function GAe(e){var t=Zn(e,YAe),{id:n}=t,r=qb(t,NAe),i=$i(r);return y.createElement(n2,{id:n,type:"pie"},a=>y.createElement(y.Fragment,null,y.createElement(jAe,{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(PAe,Yl({},r,{id:a})),y.createElement(XAe,Yl({},r,{id:a}))))}var cK=GAe;cK.displayName="Pie";var WAe=["points"];function Q4(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 IE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q4(Object(n),!0).forEach(function(r){QAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QAe(e,t,n){return(t=ZAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZAe(e){var t=JAe(e,"string");return typeof t=="symbol"?t:t+""}function JAe(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 e0(){return e0=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},e0.apply(null,arguments)}function eOe(e,t){if(e==null)return{};var n,r,i=tOe(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 tOe(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 nOe(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=Dt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,l=eOe(a,WAe);return y.createElement(JV,e0({},l,{className:i}))}function rOe(e,t){return e==null?!1:t?!0:e.length===1}function iOe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:l,clipPathId:c,zIndex:d=Wn.scatter}=e;if(!rOe(t,n))return null;var m=oK(n),f=zge(n),g=t.map((b,w)=>{var S,j,C=IE(IE(IE({r:3},o),f),{},{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(nOe,{key:"dot-".concat(w),option:n,dotProps:C,className:i})}),v={};return l&&c!=null&&(v.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(c,")")),y.createElement(wi,{zIndex:d},y.createElement(ur,e0({className:r},v),g))}function Z4(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 J4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z4(Object(n),!0).forEach(function(r){aOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aOe(e,t,n){return(t=oOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oOe(e){var t=sOe(e,"string");return typeof t=="symbol"?t:t+""}function sOe(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 dK=0,lOe={xAxis:{},yAxis:{},zAxis:{}},fK=Kr({name:"cartesianAxis",initialState:lOe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:gn()},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:gn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:gn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:gn()},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:gn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:gn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:gn()},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:gn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:gn()},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]=J4(J4({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:uOe,replaceXAxis:cOe,removeXAxis:dOe,addYAxis:fOe,replaceYAxis:hOe,removeYAxis:mOe,addZAxis:w$e,replaceZAxis:S$e,removeZAxis:j$e,updateYAxisWidth:pOe}=fK.actions,gOe=fK.reducer,vOe=le([cr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),yOe=le([vOe,As,Os],(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)}}),r2=()=>$e(yOe),xOe=()=>$e(oCe);function e5(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 LE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e5(Object(n),!0).forEach(function(r){bOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bOe(e,t,n){return(t=wOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wOe(e){var t=SOe(e,"string");return typeof t=="symbol"?t:t+""}function SOe(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 jOe=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},c=LE(LE(LE({},l),fc(i)),mA(i)),d;return y.isValidElement(i)?d=y.cloneElement(i,c):typeof i=="function"?d=i(c):d=y.createElement(JV,c),y.createElement(ur,{className:"recharts-active-dot",clipPath:o},d)};function EOe(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Wn.activeDot}=e,l=$e(Kl),c=xOe();if(t==null||c==null)return null;var d=t.find(m=>c.includes(m.payload));return En(d)?null:y.createElement(wi,{zIndex:o},y.createElement(jOe,{point:d,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var t5=(e,t,n)=>{var r=n??e;if(!En(r))return Hr(r,t,0)},_Oe=(e,t,n)=>{var r={},i=e.filter(Nb),a=e.filter(d=>d.stackId==null),o=i.reduce((d,m)=>{var f=d[m.stackId];return f==null&&(f=[]),f.push(m),d[m.stackId]=f,d},r),l=Object.entries(o).map(d=>{var m,[f,g]=d,v=g.map(w=>w.dataKey),b=t5(t,n,(m=g[0])===null||m===void 0?void 0:m.barSize);return{stackId:f,dataKeys:v,barSize:b}}),c=a.map(d=>{var m=[d.dataKey].filter(g=>g!=null),f=t5(t,n,d.barSize);return{stackId:void 0,dataKeys:m,barSize:f}});return[...l,...c]};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 gy(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){COe(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 COe(e,t,n){return(t=NOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NOe(e){var t=kOe(e,"string");return typeof t=="symbol"?t:t+""}function kOe(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 AOe(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var l=Hr(e,n,0,!0),c,d=[];if(Pt((a=r[0])===null||a===void 0?void 0:a.barSize)){var m=!1,f=n/o,g=r.reduce((C,_)=>C+(_.barSize||0),0);g+=(o-1)*l,g>=n&&(g-=(o-1)*l,l=0),g>=n&&f>0&&(m=!0,f*=.9,g=o*f);var v=(n-g)/2>>0,b={offset:v-l,size:0};c=r.reduce((C,_)=>{var k,O={stackId:_.stackId,dataKeys:_.dataKeys,position:{offset:b.offset+b.size+l,size:m?f:(k=_.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;c=r.reduce((C,_,k)=>[...C,{stackId:_.stackId,dataKeys:_.dataKeys,position:{offset:w+(S+l)*k+(S-j)/2,size:j}}],d)}return c}}var OOe=(e,t,n,r,i,a,o)=>{var l=En(o)?t:o,c=AOe(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(d=>gy(gy({},d),{},{position:gy(gy({},d.position),{},{offset:d.position.offset-i/2})}))),c},TOe=(e,t)=>{var n=UA(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)}}}},POe=(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 MOe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Pt(e.zIndex)?e.zIndex:t}var hK=e=>{var{chartData:t}=e,n=tn(),r=Yr();return y.useEffect(()=>r?()=>{}:(n(f4(t)),()=>{n(f4(void 0))}),[t,n,r]),null},r5={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},mK=Kr({name:"brush",initialState:r5,reducers:{setBrushSettings(e,t){return t.payload==null?r5:t.payload}}}),{setBrushSettings:E$e}=mK.actions,ROe=mK.reducer;function DOe(e){return(e%180+180)%180}var IOe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=DOe(i),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},LOe={dots:[],areas:[],lines:[]},pK=Kr({name:"referenceElements",initialState:LOe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=sa(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=sa(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=sa(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:_$e,removeDot:C$e,addArea:N$e,removeArea:k$e,addLine:A$e,removeLine:O$e}=pK.actions,zOe=pK.reducer,$Oe=y.createContext(void 0),BOe=e=>{var{children:t}=e,[n]=y.useState("".concat(Um("recharts"),"-clip")),r=r2();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return y.createElement($Oe.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 gK(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 FOe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return IOe(r,n)}function UOe(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 tp(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 HOe(e,t){return gK(e,t+1)}function qOe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:l}=t,c=0,d=1,m=o,f=function(){var b=r==null?void 0:r[c];if(b===void 0)return{v:gK(r,d)};var w=c,S,j=()=>(S===void 0&&(S=n(b,w)),S),C=b.coordinate,_=c===0||tp(e,C,j,m,l);_||(c=0,m=o,d+=1),_&&(m=C+e*(j()/2+i),c+=d)},g;d<=a.length;)if(g=f(),g)return g.v;return[]}function VOe(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:l,end:c}=t,d=1;d<=o;d++){for(var m=(o-1)%d,f=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),P=k.coordinate,z=w===m||tp(e,P,T,f,c);if(!z)return g=!1,1;z&&(f=P+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 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 $r(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){KOe(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 KOe(e,t,n){return(t=YOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YOe(e){var t=XOe(e,"string");return typeof t=="symbol"?t:t+""}function XOe(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 GOe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:l}=t,{end:c}=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-c);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=tp(e,b.tickCoord,S,l,c);C&&(c=b.tickCoord-e*(S()/2+i),a[g]=$r($r({},b),{},{isShow:!0}))}},m=o-1;m>=0;m--)d(m);return a}function WOe(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,{start:c,end:d}=t;if(a){var m=r[l-1];if(m!=null){var f=n(m,l-1),g=e*(m.coordinate+e*f/2-d);if(o[l-1]=m=$r($r({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate}),m.tickCoord!=null){var v=tp(e,m.tickCoord,()=>f,c,d);v&&(d=m.tickCoord-e*(f/2+i),o[l-1]=$r($r({},m),{},{isShow:!0}))}}}for(var b=a?l-1:l,w=function(C){var _=o[C];if(_==null)return 1;var k=_,O,A=()=>(O===void 0&&(O=n(_,C)),O);if(C===0){var T=e*(k.coordinate-e*A()/2-c);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 P=tp(e,k.tickCoord,A,c,d);P&&(c=k.tickCoord+e*(A()/2+i),o[C]=$r($r({},k),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return o}function i2(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:l,interval:c,tickFormatter:d,unit:m,angle:f}=e;if(!i||!i.length||!r)return[];if(De(c)||eg.isSsr){var g;return(g=HOe(i,De(c)?c:0))!==null&&g!==void 0?g:[]}var v=[],b=l==="top"||l==="bottom"?"width":"height",w=m&&b==="width"?Om(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"?FOe(Om(T,{fontSize:t,letterSpacing:n}),w,f):Om(T,{fontSize:t,letterSpacing:n})[b]},j=i[0],C=i[1],_=i.length>=2&&j!=null&&C!=null?xr(C.coordinate-j.coordinate):1,k=UOe(a,_,b);return c==="equidistantPreserveStart"?qOe(_,k,S,i,o):c==="equidistantPreserveEnd"?VOe(_,k,S,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=WOe(_,k,S,i,o,c==="preserveStartEnd"):v=GOe(_,k,S,i,o),v.filter(O=>O.isShow))}var QOe=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 f=m.getBoundingClientRect();f.width>o&&(o=f.width)}});var l=n?n.getBoundingClientRect().width:0,c=i+a,d=o+c+l+(n?r:0);return Math.round(d)}return 0},ZOe={xAxis:{},yAxis:{}},vK=Kr({name:"renderedTicks",initialState:ZOe,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:JOe,removeRenderedTicks:e2e}=vK.actions,t2e=vK.reducer,n2e=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function r2e(e,t){if(e==null)return{};var n,r,i=i2e(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 i2e(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 wc(){return wc=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},wc.apply(null,arguments)}function a5(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 In(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a5(Object(n),!0).forEach(function(r){a2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a5(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=s2e(e,"string");return typeof t=="symbol"?t:t+""}function s2e(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 hs={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:Wn.axis};function l2e(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=In(In(In({},c),$i(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var m=+(a==="top"&&!o||a==="bottom"&&o);d=In(In({},d),{},{x1:t,y1:n+m*i,x2:t+r,y2:n+m*i})}else{var f=+(a==="left"&&!o||a==="right"&&o);d=In(In({},d),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+i})}return y.createElement("line",wc({},d,{className:Dt("recharts-cartesian-axis-line",mc(l,"className"))}))}function u2e(e,t,n,r,i,a,o,l,c){var d,m,f,g,v,b,w=l?-1:1,S=e.tickSize||o,j=De(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":d=m=e.coordinate,g=n+ +!l*i,f=g-w*S,b=f-w*c,v=j;break;case"left":f=g=e.coordinate,m=t+ +!l*r,d=m-w*S,v=d-w*c,b=j;break;case"right":f=g=e.coordinate,m=t+ +l*r,d=m+w*S,v=d+w*c,b=j;break;default:d=m=e.coordinate,g=n+ +l*i,f=g+w*S,b=f+w*c,v=j;break}return{line:{x1:d,y1:f,x2:m,y2:g},tick:{x:v,y:b}}}function c2e(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function d2e(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function f2e(e){var{option:t,tickProps:n,value:r}=e,i,a=Dt(n.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))i=y.cloneElement(t,In(In({},n),{},{className:a}));else if(typeof t=="function")i=t(In(In({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Dt(o,rK(t))),i=y.createElement(Fb,wc({},n,{className:o}),r)}return i}function h2e(e){var{ticks:t,axisType:n,axisId:r}=e,i=tn();return y.useEffect(()=>{if(r==null||n==null)return eu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(JOe({ticks:a,axisId:r,axisType:n})),()=>{i(e2e({axisId:r,axisType:n}))}},[i,t,r,n]),null}var m2e=y.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:l,padding:c,tickTextProps:d,orientation:m,mirror:f,x:g,y:v,width:b,height:w,tickSize:S,tickMargin:j,fontSize:C,letterSpacing:_,getTicksConfig:k,events:O,axisType:A,axisId:T}=e,P=i2(In(In({},k),{},{ticks:n}),C,_),z=$i(k),L=fc(r),F=qV(z.textAnchor)?z.textAnchor:c2e(m,f),D=d2e(m,f),X={};typeof i=="object"&&(X=i);var R=In(In({},z),{},{fill:"none"},X),q=P.map(G=>In({entry:G},u2e(G,g,v,b,w,m,S,f,j))),$=q.map(G=>{var{entry:K,line:I}=G;return y.createElement(ur,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(K.value,"-").concat(K.coordinate,"-").concat(K.tickCoord)},i&&y.createElement("line",wc({},R,I,{className:Dt("recharts-cartesian-axis-tick-line",mc(i,"className"))})))}),V=q.map((G,K)=>{var I,H,{entry:U,tick:B}=G,Q=In(In(In(In({verticalAnchor:D},z),{},{textAnchor:F,stroke:"none",fill:a},B),{},{index:K,payload:U,visibleTicksCount:P.length,tickFormatter:o,padding:c},d),{},{angle:(I=(H=d==null?void 0:d.angle)!==null&&H!==void 0?H:z.angle)!==null&&I!==void 0?I:0}),Z=In(In({},Q),L);return y.createElement(ur,wc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},Xp(O,U,K)),r&&y.createElement(f2e,{option:r,tickProps:Z,value:"".concat(typeof o=="function"?o(U.value,K):U.value).concat(l||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},y.createElement(h2e,{ticks:P,axisId:T,axisType:A}),V.length>0&&y.createElement(wi,{zIndex:Wn.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},V)),$.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},$))}),p2e=y.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:l,axisType:c,axisId:d}=e,m=r2e(e,n2e),[f,g]=y.useState(""),[v,b]=y.useState(""),w=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return QOe({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 _=C[0];if(_){var k=window.getComputedStyle(_),O=k.fontSize,A=k.letterSpacing;(O!==f||A!==v)&&(g(O),b(A))}}},[f,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:y.createElement(wi,{zIndex:e.zIndex},y.createElement(ur,{className:Dt("recharts-cartesian-axis",a)},y.createElement(l2e,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:$i(e)}),y.createElement(m2e,{ref:S,axisType:c,events:m,fontSize:f,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(ske,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(vke,{label:e.label,labelRef:e.labelRef}),e.children)))}),a2=y.forwardRef((e,t)=>{var n=Zn(e,hs);return y.createElement(p2e,wc({},n,{ref:t}))});a2.displayName="CartesianAxis";var g2e=["x1","y1","x2","y2","key"],v2e=["offset"],y2e=["xAxisId","yAxisId"],x2e=["xAxisId","yAxisId"];function o5(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?o5(Object(n),!0).forEach(function(r){b2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b2e(e,t,n){return(t=w2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w2e(e){var t=S2e(e,"string");return typeof t=="symbol"?t:t+""}function S2e(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 Bu(){return Bu=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},Bu.apply(null,arguments)}function t0(e,t){if(e==null)return{};var n,r,i=j2e(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 j2e(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 E2e=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 yK(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:c,key:d}=n,m=t0(n,g2e),f=(i=$i(m))!==null&&i!==void 0?i:{},{offset:g}=f,v=t0(f,v2e);r=y.createElement("line",Bu({},v,{x1:a,y1:o,x2:l,y2:c,fill:"none",key:d}))}return r}function _2e(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=t0(e,y2e),c=i.map((d,m)=>{var f=Fr(Fr({},l),{},{x1:t,y1:d,x2:t+n,y2:d,key:"line-".concat(m),index:m});return y.createElement(yK,{key:"line-".concat(m),option:r,lineItemProps:f})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function C2e(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=t0(e,x2e),c=i.map((d,m)=>{var f=Fr(Fr({},l),{},{x1:d,y1:t,x2:d,y2:t+n,key:"line-".concat(m),index:m});return y.createElement(yK,{option:r,lineItemProps:f,key:"line-".concat(m)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function N2e(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var d=l.map(f=>Math.round(f+i-i)).sort((f,g)=>f-g);i!==d[0]&&d.unshift(0);var m=d.map((f,g)=>{var v=d[g+1],b=v==null,w=b?i+o-f:v-f;if(w<=0)return null;var S=g%t.length;return y.createElement("rect",{key:"react-".concat(g),y:f,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 k2e(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:l,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var d=c.map(f=>Math.round(f+i-i)).sort((f,g)=>f-g);i!==d[0]&&d.unshift(0);var m=d.map((f,g)=>{var v=d[g+1],b=v==null,w=b?i+o-f:v-f;if(w<=0)return null;var S=g%n.length;return y.createElement("rect",{key:"react-".concat(g),x:f,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 A2e=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return Jq(i2(Fr(Fr(Fr({},hs),n),{},{ticks:e9(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},O2e=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return Jq(i2(Fr(Fr(Fr({},hs),n),{},{ticks:e9(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},T2e={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Wn.grid};function o2(e){var t=NA(),n=kA(),r=s9(),i=Fr(Fr({},Zn(e,T2e)),{},{x:De(e.x)?e.x:r.left,y:De(e.y)?e.y:r.top,width:De(e.width)?e.width:r.width,height:De(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:l,y:c,width:d,height:m,syncWithTicks:f,horizontalValues:g,verticalValues:v}=i,b=Yr(),w=$e(z=>Jz(z,"xAxis",a,b)),S=$e(z=>Jz(z,"yAxis",o,b));if(!No(d)||!No(m)||!De(l)||!De(c))return null;var j=i.verticalCoordinatesGenerator||A2e,C=i.horizontalCoordinatesGenerator||O2e,{horizontalPoints:_,verticalPoints:k}=i;if((!_||!_.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:f);Cx(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(_=A)}if((!k||!k.length)&&typeof j=="function"){var T=v&&v.length,P=j({xAxis:w?Fr(Fr({},w),{},{ticks:T?v:w.ticks}):void 0,width:t??d,height:n??m,offset:r},T?!0:f);Cx(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(k=P)}return y.createElement(wi,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(E2e,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement(N2e,Bu({},i,{horizontalPoints:_})),y.createElement(k2e,Bu({},i,{verticalPoints:k})),y.createElement(_2e,Bu({},i,{offset:r,horizontalPoints:_,xAxis:w,yAxis:S})),y.createElement(C2e,Bu({},i,{offset:r,verticalPoints:k,xAxis:w,yAxis:S}))))}o2.displayName="CartesianGrid";var P2e={},xK=Kr({name:"errorBars",initialState:P2e,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:T$e,replaceErrorBar:P$e,removeErrorBar:M$e}=xK.actions,M2e=xK.reducer,R2e=["children"];function D2e(e,t){if(e==null)return{};var n,r,i=I2e(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 I2e(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 L2e={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},z2e=y.createContext(L2e);function bK(e){var{children:t}=e,n=D2e(e,R2e);return y.createElement(z2e.Provider,{value:n},t)}function s2(e,t){var n,r,i=$e(d=>Ms(d,e)),a=$e(d=>Rs(d,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:rr.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:ir.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function wK(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=r2(),{needClipX:a,needClipY:o,needClip:l}=s2(t,n);if(!l||!i)return null;var{x:c,y:d,width:m,height:f}=i;return y.createElement("clipPath",{id:"clipPath-".concat(r)},y.createElement("rect",{x:a?c:c-m/2,y:o?d:d-f/2,width:a?m:m*2,height:o?f:f*2}))}var SK=(e,t,n,r)=>Vl(e,"xAxis",t,r),jK=(e,t,n,r)=>ql(e,"xAxis",t,r),EK=(e,t,n,r)=>Vl(e,"yAxis",n,r),_K=(e,t,n,r)=>ql(e,"yAxis",n,r),$2e=le([Ut,SK,EK,jK,_K],(e,t,n,r,i)=>ks(e,"xAxis")?vf(t,r,!1):vf(n,i,!1)),B2e=(e,t,n,r,i)=>i;function F2e(e){return e.type==="line"}var U2e=le([Ib,B2e],(e,t)=>e.filter(F2e).find(n=>n.id===t)),H2e=le([Ut,SK,EK,jK,_K,U2e,$2e,PA],(e,t,n,r,i,a,o,l)=>{var{chartData:c,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:f,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=c==null?void 0:c.slice(d,m+1),v!=null)return cTe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:f,bandSize:o,displayedData:v})}});function q2e(e){var t=fc(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 V2e=["id"],K2e=["type","layout","connectNulls","needClip","shape"],Y2e=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function np(){return np=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},np.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 po(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){X2e(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 X2e(e,t,n){return(t=G2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G2e(e){var t=W2e(e,"string");return typeof t=="symbol"?t:t+""}function W2e(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 l2(e,t){if(e==null)return{};var n,r,i=Q2e(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 Q2e(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 Z2e=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Hf(n,t),payload:e}]},J2e=y.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:l,unit:c,tooltipType:d,id:m}=e,f={dataDefinedOnItem:n,getPosition:eu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Hf(o,t),hide:l,type:d,color:r,unit:c,graphicalItemId:m}};return y.createElement(t2,{tooltipEntrySettings:f})}),CK=(e,t)=>"".concat(t,"px ").concat(e,"px");function eTe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var tTe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return CK(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],l=0,c=0;l<n.length;c+=(d=n[l])!==null&&d!==void 0?d:0,++l){var d,m=n[l];if(m!=null&&c+m>a){o=[...n.slice(0,l),a-c];break}}var f=o.length%2===0?[0,t]:[t];return[...eTe(n,i),...o,...f].map(g=>"".concat(g,"px")).join(", ")};function nTe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:l}=r,c=l2(r,V2e),d=$i(c);return y.createElement(iOe,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:d,needClip:o,clipPathId:t})}function rTe(e){var{showLabels:t,children:n,points:r}=e,i=y.useMemo(()=>r==null?void 0:r.map(a=>{var o,l,c={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 po(po({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return y.createElement(QV,{value:t?i:void 0},n)}function l5(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:l,connectNulls:c,needClip:d,shape:m}=a,f=l2(a,K2e),g=po(po({},ni(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):void 0,points:r,type:o,layout:l,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return y.createElement(y.Fragment,null,(r==null?void 0:r.length)>1&&y.createElement(QO,np({shapeType:"curve",option:m},g,{pathRef:n})),y.createElement(nTe,{points:r,clipPathId:t,props:a}))}function iTe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function aTe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:d,animationDuration:m,animationEasing:f,animateNewValues:g,width:v,height:b,onAnimationEnd:w,onAnimationStart:S}=n,j=i.current,C=ng(o,"recharts-line-"),_=y.useRef(C),[k,O]=y.useState(!1),A=!k,T=y.useCallback(()=>{typeof w=="function"&&w(),O(!1)},[w]),P=y.useCallback(()=>{typeof S=="function"&&S(),O(!0)},[S]),z=iTe(r.current),L=y.useRef(0);_.current!==C&&(L.current=a.current,_.current=C);var F=L.current;return y.createElement(rTe,{points:o,showLabels:A},n.children,y.createElement(tg,{animationId:C,begin:d,duration:m,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:P,key:C},D=>{var X=wn(F,z+F,D),R=Math.min(X,z),q;if(c)if(l){var $="".concat(l).split(/[,\s]+/gim).map(K=>parseFloat(K));q=tTe(R,z,$)}else q=CK(z,R);else q=l==null?void 0:String(l);if(D>0&&z>0&&(i.current=o,a.current=Math.max(a.current,R)),j){var V=j.length/o.length,G=D===1?o:o.map((K,I)=>{var H=Math.floor(I*V);if(j[H]){var U=j[H];return po(po({},K),{},{x:wn(U.x,K.x,D),y:wn(U.y,K.y,D)})}return g?po(po({},K),{},{x:wn(v*2,K.x,D),y:wn(b/2,K.y,D)}):po(po({},K),{},{x:K.x,y:K.y})});return i.current=G,y.createElement(l5,{props:n,points:G,clipPathId:t,pathRef:r,strokeDasharray:q})}return y.createElement(l5,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:q})}),y.createElement(YO,{label:n.label}))}function oTe(e){var{clipPathId:t,props:n}=e,r=y.useRef(null),i=y.useRef(0),a=y.useRef(null);return y.createElement(aTe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var sTe=(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:en(e.payload,t)}};class lTe extends y.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:l,left:c,width:d,height:m,id:f,needClip:g,zIndex:v}=this.props;if(t)return null;var b=Dt("recharts-line",i),w=f,{r:S,strokeWidth:j}=q2e(n),C=oK(n),_=S*2+j,k=g?"url(#clipPath-".concat(C?"":"dots-").concat(w,")"):void 0;return y.createElement(wi,{zIndex:v},y.createElement(ur,{className:b},g&&y.createElement("defs",null,y.createElement(wK,{clipPathId:w,xAxisId:a,yAxisId:o}),!C&&y.createElement("clipPath",{id:"clipPath-dots-".concat(w)},y.createElement("rect",{x:c-_/2,y:l-_/2,width:d+_,height:m+_}))),y.createElement(bK,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:sTe,errorBarOffset:0},y.createElement(oTe,{props:this.props,clipPathId:w}))),y.createElement(EOe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var NK={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:Wn.line,type:"linear"};function uTe(e){var t=Zn(e,NK),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:l,dot:c,hide:d,isAnimationActive:m,label:f,legendType:g,xAxisId:v,yAxisId:b,id:w}=t,S=l2(t,Y2e),{needClip:j}=s2(v,b),C=r2(),_=Pc(),k=Yr(),O=$e(L=>H2e(L,v,b,k,w));if(_!=="horizontal"&&_!=="vertical"||O==null||C==null)return null;var{height:A,width:T,x:P,y:z}=C;return y.createElement(lTe,np({},S,{id:w,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:m,hide:d,label:f,legendType:g,xAxisId:v,yAxisId:b,points:O,layout:_,height:A,width:T,left:P,top:z,needClip:j}))}function cTe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:l,displayedData:c}=e;return c.map((d,m)=>{var f=en(d,o);if(t==="horizontal"){var g=qL({axis:n,ticks:i,bandSize:l,entry:d,index:m}),v=En(f)?null:r.scale.map(f);return{x:g,y:v??null,value:f,payload:d}}var b=En(f)?null:n.scale.map(f),w=qL({axis:r,ticks:a,bandSize:l,entry:d,index:m});return b==null||w==null?null:{x:b,y:w,value:f,payload:d}}).filter(Boolean)}function dTe(e){var t=Zn(e,NK),n=Yr();return y.createElement(n2,{id:t.id,type:"line"},r=>y.createElement(y.Fragment,null,y.createElement(sK,{legendPayload:Z2e(t)}),y.createElement(J2e,{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(uK,{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(uTe,np({},t,{id:r}))))}var kK=y.memo(dTe,qf);kK.displayName="Line";function Dc(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:dK}function Ic(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:dK}var fTe="Invariant failed";function hTe(e,t){throw new Error(fTe)}function KC(){return KC=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},KC.apply(null,arguments)}function u2(e){return y.createElement(QO,KC({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var mTe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(De(t))return t;var a=De(r)||En(r);return a?t(r,i):(a||hTe(),n)}},pTe=(e,t,n)=>n,gTe=(e,t)=>t,gg=le([Ib,gTe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),vTe=le([gg],e=>e==null?void 0:e.maxBarSize),yTe=(e,t,n,r)=>r,xTe=le([Ut,Ib,Dc,Ic,pTe],(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")),bTe=(e,t,n)=>{var r=Ut(e),i=Dc(e,t),a=Ic(e,t);if(!(i==null||a==null))return r==="horizontal"?BC(e,"yAxis",a,n):BC(e,"xAxis",i,n)},wTe=(e,t)=>{var n=Ut(e),r=Dc(e,t),i=Ic(e,t);if(!(r==null||i==null))return n==="horizontal"?Zz(e,"xAxis",r):Zz(e,"yAxis",i)},STe=le([xTe,c1e,wTe],_Oe),jTe=(e,t,n)=>{var r,i,a=gg(e,t);if(a==null)return 0;var o=Dc(e,t),l=Ic(e,t);if(o==null||l==null)return 0;var c=Ut(e),d=q9(e),{maxBarSize:m}=a,f=En(m)?d:m,g,v;return c==="horizontal"?(g=Vl(e,"xAxis",o,n),v=ql(e,"xAxis",o,n)):(g=Vl(e,"yAxis",l,n),v=ql(e,"yAxis",l,n)),(r=(i=vf(g,v,!0))!==null&&i!==void 0?i:f)!==null&&r!==void 0?r:0},AK=(e,t,n)=>{var r=Ut(e),i=Dc(e,t),a=Ic(e,t);if(!(i==null||a==null)){var o,l;return r==="horizontal"?(o=Vl(e,"xAxis",i,n),l=ql(e,"xAxis",i,n)):(o=Vl(e,"yAxis",a,n),l=ql(e,"yAxis",a,n)),vf(o,l)}},ETe=le([STe,q9,u1e,V9,jTe,AK,vTe],OOe),_Te=(e,t,n)=>{var r=Dc(e,t);if(r!=null)return Vl(e,"xAxis",r,n)},CTe=(e,t,n)=>{var r=Ic(e,t);if(r!=null)return Vl(e,"yAxis",r,n)},NTe=(e,t,n)=>{var r=Dc(e,t);if(r!=null)return ql(e,"xAxis",r,n)},kTe=(e,t,n)=>{var r=Ic(e,t);if(r!=null)return ql(e,"yAxis",r,n)},ATe=le([ETe,gg],POe),OTe=le([bTe,gg],TOe),TTe=le([cr,jA,_Te,CTe,NTe,kTe,ATe,Ut,r1e,AK,OTe,gg,yTe],(e,t,n,r,i,a,o,l,c,d,m,f,g)=>{var{chartData:v,dataStartIndex:b,dataEndIndex:w}=c;if(!(f==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||d==null)){var{data:S}=f,j;if(S!=null&&S.length>0?j=S:j=v==null?void 0:v.slice(b,w+1),j!=null)return aPe({layout:l,barSettings:f,pos:o,parentViewBox:t,bandSize:d,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:m,displayedData:j,offset:e,cells:g,dataStartIndex:b})}}),PTe=["index"];function YC(){return YC=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},YC.apply(null,arguments)}function MTe(e,t){if(e==null)return{};var n,r,i=RTe(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 RTe(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 OK=y.createContext(void 0),DTe=e=>{var t=y.useContext(OK);if(t!=null)return t.stackId;if(e!=null)return n0e(e)},ITe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),LTe=e=>{var t=y.useContext(OK);if(t!=null){var{stackId:n}=t;return"url(#".concat(ITe(n,e),")")}},TK=e=>{var{index:t}=e,n=MTe(e,PTe),r=LTe(t);return y.createElement(ur,YC({className:"recharts-bar-stack-layer",clipPath:r},n))},zTe=["onMouseEnter","onMouseLeave","onClick"],$Te=["value","background","tooltipPosition"],BTe=["id"],FTe=["onMouseEnter","onClick","onMouseLeave"];function Xl(){return Xl=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},Xl.apply(null,arguments)}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 Jr(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){UTe(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 UTe(e,t,n){return(t=HTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HTe(e){var t=qTe(e,"string");return typeof t=="symbol"?t:t+""}function qTe(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 n0(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=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Hf(n,t),payload:e}]},YTe=y.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:l,tooltipType:c,id:d}=e,m={dataDefinedOnItem:void 0,getPosition:eu,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Hf(a,t),hide:o,type:c,color:i,unit:l,graphicalItemId:d}};return y.createElement(t2,{tooltipEntrySettings:m})});function XTe(e){var t=$e(Kl),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=a,d=n0(a,zTe),m=ZO(o,r,a.id),f=JO(l),g=e2(c,r,a.id);if(!i||n==null)return null;var v=fc(i);return y.createElement(wi,{zIndex:MOe(i,Wn.barBackground)},n.map((b,w)=>{var{value:S,background:j,tooltipPosition:C}=b,_=n0(b,$Te);if(!j)return null;var k=m(b,w),O=f(b,w),A=g(b,w),T=Jr(Jr(Jr(Jr(Jr({option:i,isActive:String(w)===t},_),{},{fill:"#eee"},j),v),Xp(d,b,w)),{},{onMouseEnter:k,onMouseLeave:O,onClick:A,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return y.createElement(u2,Xl({key:"background-bar-".concat(w)},T))}))}function GTe(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 Jr(Jr({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return y.createElement(QV,{value:t?i:void 0},n)}function WTe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,l=$e(Kl),c=$e(BO),d=n&&String(i.originalDataIndex)===l&&(c==null||o===c),[m,f]=y.useState(!1),[g,v]=y.useState(!1);y.useEffect(()=>{var _;return d?(f(!0),_=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(_)}},[d]);var b=y.useCallback(()=>{d||f(!1)},[d]),w=d&&g,S=d||m,j;d?n===!0?j=t:j=n:j=t;var C=y.createElement(u2,Xl({},r,{name:String(r.name)},i,{isActive:w,option:j,index:a,dataKey:o,onTransitionEnd:b}));return S?y.createElement(wi,{zIndex:Wn.activeBar},y.createElement(TK,{index:i.originalDataIndex},C)):C}function QTe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return y.createElement(u2,Xl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function ZTe(e){var t,{data:n,props:r}=e,i=(t=$i(r))!==null&&t!==void 0?t:{},{id:a}=i,o=n0(i,BTe),{shape:l,dataKey:c,activeBar:d}=r,{onMouseEnter:m,onClick:f,onMouseLeave:g}=r,v=n0(r,FTe),b=ZO(m,c,a),w=JO(g),S=e2(f,c,a);return n?y.createElement(y.Fragment,null,n.map((j,C)=>y.createElement(TK,Xl({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"},Xp(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),d?y.createElement(WTe,{shape:l,activeBar:d,baseProps:o,entry:j,index:C,dataKey:c}):y.createElement(QTe,{shape:l,baseProps:o,entry:j,index:C,dataKey:c})))):null}function JTe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:m}=t,f=n.current,g=ng(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(GTe,{showLabels:w,rects:r},y.createElement(tg,{animationId:g,begin:o,duration:l,isActive:a,easing:c,onAnimationEnd:S,onAnimationStart:j,key:g},C=>{var _=C===1?r:r==null?void 0:r.map((k,O)=>{var A=f&&f[O];if(A)return Jr(Jr({},k),{},{x:wn(A.x,k.x,C),y:wn(A.y,k.y,C),width:wn(A.width,k.width,C),height:wn(A.height,k.height,C)});if(i==="horizontal"){var T=wn(0,k.height,C),P=wn(k.stackedBarStart,k.y,C);return Jr(Jr({},k),{},{y:P,height:T})}var z=wn(0,k.width,C),L=wn(k.stackedBarStart,k.x,C);return Jr(Jr({},k),{},{width:z,x:L})});return C>0&&(n.current=_??null),_==null?null:y.createElement(ur,null,y.createElement(ZTe,{props:t,data:_}))}),y.createElement(YO,{label:t.label}),t.children)}function ePe(e){var t=y.useRef(null);return y.createElement(JTe,{previousRectanglesRef:t,props:e})}var PK=0,tPe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:en(e,t)}};class nPe extends y.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:l,background:c,id:d}=this.props;if(t||n==null)return null;var m=Dt("recharts-bar",i),f=d;return y.createElement(ur,{className:m,id:d},l&&y.createElement("defs",null,y.createElement(wK,{clipPathId:f,xAxisId:a,yAxisId:o})),y.createElement(ur,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},y.createElement(XTe,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),y.createElement(ePe,this.props)))}}var rPe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:PK,xAxisId:0,yAxisId:0,zIndex:Wn.bar};function iPe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:m}=e,{needClip:f}=s2(t,n),g=Pc(),v=Yr(),b=WO(e.children,pg),w=$e(C=>TTe(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:tPe,errorBarOffset:S},y.createElement(nPe,Xl({},e,{layout:g,needClip:f,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:m})))}function aPe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:l,yAxis:c,xAxisTicks:d,yAxisTicks:m,stackedData:f,displayedData:g,offset:v,cells:b,parentViewBox:w,dataStartIndex:S}=e,j=t==="horizontal"?c:l,C=f?j.scale.domain():null,_=r0e({numericAxis:j}),k=j.scale.map(_);return g.map((O,A)=>{var T,P,z,L,F,D;if(f){var X=f[A+S];if(X==null)return null;T=Qxe(X,C)}else T=en(O,n),Array.isArray(T)||(T=[_,T]);var R=mTe(r,PK)(T[1],A);if(t==="horizontal"){var q,$=c.scale.map(T[0]),V=c.scale.map(T[1]);if($==null||V==null)return null;P=VL({axis:l,ticks:d,bandSize:o,offset:a.offset,entry:O,index:A}),z=(q=V??$)!==null&&q!==void 0?q:void 0,L=a.size;var G=$-V;if(F=_o(G)?0:G,D={x:P,y:v.top,width:L,height:v.height},Math.abs(R)>0&&Math.abs(F)<Math.abs(R)){var K=xr(F||R)*(Math.abs(R)-Math.abs(F));z-=K,F+=K}}else{var I=l.scale.map(T[0]),H=l.scale.map(T[1]);if(I==null||H==null)return null;if(P=I,z=VL({axis:c,ticks:m,bandSize:o,offset:a.offset,entry:O,index:A}),L=H-I,F=a.size,D={x:v.left,y:z,width:v.width,height:F},Math.abs(R)>0&&Math.abs(L)<Math.abs(R)){var U=xr(L||R)*(Math.abs(R)-Math.abs(L));L+=U}}if(P==null||z==null||L==null||F==null||!i&&(L===0||F===0))return null;var B=Jr(Jr({},O),{},{stackedBarStart:k,x:P,y:z,width:L,height:F,value:f?T:T[1],payload:O,background:D,tooltipPosition:{x:P+L/2,y:z+F/2},parentViewBox:w,originalDataIndex:A},b&&b[A]&&b[A].props);return B}).filter(Boolean)}function oPe(e){var t=Zn(e,rPe),n=DTe(t.stackId),r=Yr();return y.createElement(n2,{id:t.id,type:"bar"},i=>y.createElement(y.Fragment,null,y.createElement(sK,{legendPayload:KTe(t)}),y.createElement(YTe,{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(uK,{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(wi,{zIndex:t.zIndex},y.createElement(iPe,Xl({},t,{id:i})))))}var XC=y.memo(oPe,qf);XC.displayName="Bar";var sPe=["domain","range"],lPe=["domain","range"];function c5(e,t){if(e==null)return{};var n,r,i=uPe(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 uPe(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 d5(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 MK(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=c5(e,sPe),{domain:a,range:o}=t,l=c5(t,lPe);return!d5(n,a)||!d5(r,o)?!1:qf(i,l)}var cPe=["type"],dPe=["dangerouslySetInnerHTML","ticks","scale"],fPe=["id","scale"];function GC(){return GC=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},GC.apply(null,arguments)}function f5(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 h5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f5(Object(n),!0).forEach(function(r){hPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hPe(e,t,n){return(t=mPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mPe(e){var t=pPe(e,"string");return typeof t=="symbol"?t:t+""}function pPe(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 WC(e,t){if(e==null)return{};var n,r,i=gPe(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 gPe(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 vPe(e){var t=tn(),n=y.useRef(null),r=l9(),{type:i}=e,a=WC(e,cPe),o=_b(r,"xAxis",i),l=y.useMemo(()=>{if(o!=null)return h5(h5({},a),{},{type:o})},[a,o]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(uOe(l)):n.current!==l&&t(cOe({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(dOe(n.current)),n.current=null)},[t]),null}var yPe=e=>{var{xAxisId:t,className:n}=e,r=$e(jA),i=Yr(),a="xAxis",o=$e(j=>sV(j,a,t,i)),l=$e(j=>iV(j,t)),c=$e(j=>GEe(j,t)),d=$e(j=>$7(j,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:m,ticks:f,scale:g}=e,v=WC(e,dPe),{id:b,scale:w}=d,S=WC(d,fPe);return y.createElement(a2,GC({},v,S,{x:c.x,y:c.y,width:l.width,height:l.height,className:Dt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},xPe={allowDataOverflow:rr.allowDataOverflow,allowDecimals:rr.allowDecimals,allowDuplicatedCategory:rr.allowDuplicatedCategory,angle:rr.angle,axisLine:hs.axisLine,height:rr.height,hide:!1,includeHidden:rr.includeHidden,interval:rr.interval,label:!1,minTickGap:rr.minTickGap,mirror:rr.mirror,orientation:rr.orientation,padding:rr.padding,reversed:rr.reversed,scale:rr.scale,tick:rr.tick,tickCount:rr.tickCount,tickLine:hs.tickLine,tickSize:hs.tickSize,type:rr.type,niceTicks:rr.niceTicks,xAxisId:0},bPe=e=>{var t=Zn(e,xPe);return y.createElement(y.Fragment,null,y.createElement(vPe,{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(yPe,t))},c2=y.memo(bPe,MK);c2.displayName="XAxis";var wPe=["type"],SPe=["dangerouslySetInnerHTML","ticks","scale"],jPe=["id","scale"];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 m5(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 p5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m5(Object(n),!0).forEach(function(r){EPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EPe(e,t,n){return(t=_Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Pe(e){var t=CPe(e,"string");return typeof t=="symbol"?t:t+""}function CPe(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 ZC(e,t){if(e==null)return{};var n,r,i=NPe(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 NPe(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 kPe(e){var t=tn(),n=y.useRef(null),r=l9(),{type:i}=e,a=ZC(e,wPe),o=_b(r,"yAxis",i),l=y.useMemo(()=>{if(o!=null)return p5(p5({},a),{},{type:o})},[o,a]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(fOe(l)):n.current!==l&&t(hOe({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(mOe(n.current)),n.current=null)},[t]),null}function APe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=y.useRef(null),o=y.useRef(null),l=$e(jA),c=Yr(),d=tn(),m="yAxis",f=$e(A=>aV(A,t)),g=$e(A=>QEe(A,t)),v=$e(A=>sV(A,m,t,c)),b=$e(A=>B7(A,t));if(y.useLayoutEffect(()=>{if(!(r!=="auto"||!f||KO(i)||y.isValidElement(i)||b==null)){var A=a.current;if(A){var T=A.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&d(pOe({id:t,width:T}))}}},[v,f,d,i,t,r,b]),f==null||g==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:S,scale:j}=e,C=ZC(e,SPe),{id:_,scale:k}=b,O=ZC(b,jPe);return y.createElement(a2,QC({},C,O,{ref:a,labelRef:o,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:f.width,height:f.height,className:Dt("recharts-".concat(m," ").concat(m),n),viewBox:l,ticks:v,axisType:m,axisId:t}))}var OPe={allowDataOverflow:ir.allowDataOverflow,allowDecimals:ir.allowDecimals,allowDuplicatedCategory:ir.allowDuplicatedCategory,angle:ir.angle,axisLine:hs.axisLine,hide:!1,includeHidden:ir.includeHidden,interval:ir.interval,label:!1,minTickGap:ir.minTickGap,mirror:ir.mirror,orientation:ir.orientation,padding:ir.padding,reversed:ir.reversed,scale:ir.scale,tick:ir.tick,tickCount:ir.tickCount,tickLine:hs.tickLine,tickSize:hs.tickSize,type:ir.type,niceTicks:ir.niceTicks,width:ir.width,yAxisId:0},TPe=e=>{var t=Zn(e,OPe);return y.createElement(y.Fragment,null,y.createElement(kPe,{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(APe,t))},d2=y.memo(TPe,MK);d2.displayName="YAxis";var PPe=(e,t)=>t,f2=le([PPe,Ut,Z9,Sr,EV,Ds,xCe,cr],CCe);function MPe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function h2(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(MPe(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,c)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>o(l.clientX,l.clientY)):o(e.clientX,e.clientY)}var RK=Bi("mouseClick"),DK=Wp();DK.startListening({actionCreator:RK,effect:(e,t)=>{var n=e.payload,r=f2(t.getState(),h2(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(h_e({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var JC=Bi("mouseMove"),IK=Wp(),Nd=null,Nu=null,zE=null;IK.startListening({actionCreator:JC,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"));Nd!==null&&(cancelAnimationFrame(Nd),Nd=null),Nu!==null&&(typeof i!="number"||!o)&&(clearTimeout(Nu),Nu=null),zE=h2(n);var l=()=>{var c=t.getState(),d=RO(c,c.tooltip.settings.shared);if(!zE){Nd=null,Nu=null;return}if(d==="axis"){var m=f2(c,zE);(m==null?void 0:m.activeIndex)!=null?t.dispatch(pV({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(mV())}Nd=null,Nu=null};if(!o){l();return}i==="raf"?Nd=requestAnimationFrame(l):typeof i=="number"&&Nu===null&&(Nu=setTimeout(l,i))}});function RPe(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 g5={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},LK=Kr({name:"rootProps",initialState:g5,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:g5.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}}}),DPe=LK.reducer,{updateOptions:IPe}=LK.actions,LPe=null,zPe={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)},zK=Kr({name:"polarOptions",initialState:LPe,reducers:zPe}),{updatePolarOptions:$Pe}=zK.actions,BPe=zK.reducer,$K=Bi("keyDown"),BK=Bi("focus"),FK=Bi("blur"),Vb=Wp(),kd=null,ku=null,vy=null;Vb.startListening({actionCreator:$K,effect:(e,t)=>{vy=e.payload,kd!==null&&(cancelAnimationFrame(kd),kd=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");ku!==null&&(typeof r!="number"||!a)&&(clearTimeout(ku),ku=null);var o=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:d}=l.tooltip,m=vy;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var f=DO(d,Zf(l),dg(l),hg(l)),g=f==null?-1:Number(f);if(!Number.isFinite(g)||g<0)return;var v=Ds(l);if(m==="Enter"){var b=Wx(l,"axis","hover",String(d.index));t.dispatch(Gx({active:!d.active,activeIndex:d.index,activeCoordinate:b}));return}var w=n_e(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 _=Wx(l,"axis","hover",String(C));t.dispatch(Gx({active:!0,activeIndex:C.toString(),activeCoordinate:_}))}finally{kd=null,ku=null}};if(!a){o();return}r==="raf"?kd=requestAnimationFrame(o):typeof r=="number"&&ku===null&&(o(),vy=null,ku=setTimeout(()=>{vy?o():(ku=null,kd=null)},r))}});Vb.startListening({actionCreator:BK,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=Wx(n,"axis","hover",String(a));t.dispatch(Gx({active:!0,activeIndex:a,activeCoordinate:o}))}}}});Vb.startListening({actionCreator:FK,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Gx({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function UK(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 ta=Bi("externalEvent"),HK=Wp(),yy=new Map,dm=new Map,$E=new Map;HK.startListening({actionCreator:ta,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=UK(r);$E.set(i,{handler:n,reactEvent:a});var o=yy.get(i);o!==void 0&&(cancelAnimationFrame(o),yy.delete(i));var l=t.getState(),{throttleDelay:c,throttledEvents:d}=l.eventSettings,m=d,f=m==="all"||(m==null?void 0:m.includes(i)),g=dm.get(i);g!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(g),dm.delete(i));var v=()=>{var S=$E.get(i);try{if(!S)return;var{handler:j,reactEvent:C}=S,_=t.getState(),k={activeCoordinate:rCe(_),activeDataKey:BO(_),activeIndex:Kl(_),activeLabel:NV(_),activeTooltipIndex:Kl(_),isTooltipActive:iCe(_)};j&&j(k,C)}finally{yy.delete(i),dm.delete(i),$E.delete(i)}};if(!f){v();return}if(c==="raf"){var b=requestAnimationFrame(v);yy.set(i,b)}else if(typeof c=="number"){if(!dm.has(i)){v();var w=setTimeout(v,c);dm.set(i,w)}}else v()}}});var FPe=le([Wf],e=>e.tooltipItemPayloads),UPe=le([FPe,(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)}}}),qK=Bi("touchMove"),VK=Wp(),Au=null,gl=null,v5=null,fm=null;VK.startListening({actionCreator:qK,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){fm=UK(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");Au!==null&&(cancelAnimationFrame(Au),Au=null),gl!==null&&(typeof i!="number"||!o)&&(clearTimeout(gl),gl=null),v5=Array.from(n.touches).map(c=>h2({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(fm!=null){var c=t.getState(),d=RO(c,c.tooltip.settings.shared);if(d==="axis"){var m,f=(m=v5)===null||m===void 0?void 0:m[0];if(f==null){Au=null,gl=null;return}var g=f2(c,f);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(pV({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(d==="item"){var v,b=fm.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(n9),j=(v=w.getAttribute(r9))!==null&&v!==void 0?v:void 0,C=Qf(c).find(O=>O.id===j);if(S==null||C==null||j==null)return;var{dataKey:_}=C,k=UPe(c,S,j);t.dispatch(hV({activeDataKey:_,activeIndex:S,activeCoordinate:k,activeGraphicalItemId:j}))}Au=null,gl=null}};if(!o){l();return}i==="raf"?Au=requestAnimationFrame(l):typeof i=="number"&&gl===null&&(l(),fm=null,gl=setTimeout(()=>{fm?l():(gl=null,Au=null)},i))}}});var m2={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},KK=Kr({name:"eventSettings",initialState:m2,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:HPe}=KK.actions,qPe=KK.reducer,VPe=Eq({brush:ROe,cartesianAxis:gOe,chartData:rNe,errorBars:M2e,eventSettings:qPe,graphicalItems:bAe,layout:Kxe,legend:J0e,options:ZCe,polarAxis:Mke,polarOptions:BPe,referenceElements:zOe,renderedTicks:t2e,rootProps:DPe,tooltip:m_e,zIndex:BCe}),KPe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return vxe({reducer:VPe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([DK.middleware,IK.middleware,Vb.middleware,HK.middleware,VK.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat($q({type:"raf"}))},devTools:{serialize:{replacer:RPe},name:"recharts-".concat(n)}})};function YK(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Yr(),a=y.useRef(null);if(i)return n;a.current==null&&(a.current=KPe(t,r));var o=gA;return y.createElement(pbe,{context:o,store:a.current},n)}function YPe(e){var{layout:t,margin:n}=e,r=tn(),i=Yr();return y.useEffect(()=>{i||(r(Hxe(t)),r(Uxe(n)))},[r,i,t,n]),null}var XK=y.memo(YPe,qf);function GK(e){var t=tn();return y.useEffect(()=>{t(IPe(e))},[t,e]),null}var XPe=e=>{var t=tn();return y.useEffect(()=>{t(HPe(e))},[t,e]),null},WK=y.memo(XPe,qf);function y5(e){var{zIndex:t,isPanorama:n}=e,r=y.useRef(null),i=tn();return y.useLayoutEffect(()=>(r.current&&i(zCe({zIndex:t,element:r.current,isPanorama:n})),()=>{i($Ce({zIndex:t,isPanorama:n}))}),[i,t,n]),y.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function x5(e){var{children:t,isPanorama:n}=e,r=$e(kCe);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(y5,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>y.createElement(y5,{key:o,zIndex:o,isPanorama:n})))}var GPe=["children"];function WPe(e,t){if(e==null)return{};var n,r,i=QPe(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 QPe(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 r0(){return r0=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},r0.apply(null,arguments)}var ZPe={width:"100%",height:"100%",display:"block"},JPe=y.forwardRef((e,t)=>{var n=NA(),r=kA(),i=S9();if(!No(n)||!No(r))return null;var{children:a,otherAttributes:o,title:l,desc:c}=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(oA,r0({},o,{title:l,desc:c,role:m,tabIndex:d,width:n,height:r,style:ZPe,ref:t}),a)}),eMe=e=>{var{children:t}=e,n=$e(yb);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return y.createElement(oA,{width:r,height:i,x:o,y:a},t)},b5=y.forwardRef((e,t)=>{var{children:n}=e,r=WPe(e,GPe),i=Yr();return i?y.createElement(eMe,null,y.createElement(x5,{isPanorama:!0},n)):y.createElement(JPe,r0({ref:t},r),y.createElement(x5,{isPanorama:!1},n))});function tMe(){var e=tn(),[t,n]=y.useState(null),r=$e(u0e);return y.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Pt(a)&&a!==r&&e(Vxe(a))}},[t,e,r]),n}function w5(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 nMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w5(Object(n),!0).forEach(function(r){rMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rMe(e,t,n){return(t=iMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iMe(e){var t=aMe(e,"string");return typeof t=="symbol"?t:t+""}function aMe(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 $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$l.apply(null,arguments)}var oMe=()=>(fNe(),null);function i0(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var sMe=y.forwardRef((e,t)=>{var n,r,i=y.useRef(null),[a,o]=y.useState({containerWidth:i0((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:i0((r=e.style)===null||r===void 0?void 0:r.height)}),l=y.useCallback((d,m)=>{o(f=>{var g=Math.round(d),v=Math.round(m);return f.containerWidth===g&&f.containerHeight===v?f:{containerWidth:g,containerHeight:v}})},[]),c=y.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:m,height:f}=d.getBoundingClientRect();l(m,f);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(Zp,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",$l({ref:c},e)))}),lMe=y.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=y.useState({containerWidth:i0(n),containerHeight:i0(r)}),o=y.useCallback((c,d)=>{a(m=>{var f=Math.round(c),g=Math.round(d);return m.containerWidth===f&&m.containerHeight===g?m:{containerWidth:f,containerHeight:g}})},[]),l=y.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:m}=c.getBoundingClientRect();o(d,m)}},[t,o]);return y.createElement(y.Fragment,null,y.createElement(Zp,{width:i.containerWidth,height:i.containerHeight}),y.createElement("div",$l({ref:l},e)))}),uMe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return y.createElement(y.Fragment,null,y.createElement(Zp,{width:n,height:r}),y.createElement("div",$l({ref:t},e)))}),cMe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?y.createElement(lMe,$l({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?y.createElement(uMe,$l({},e,{width:n,height:r,ref:t})):y.createElement(y.Fragment,null,y.createElement(Zp,{width:n,height:r}),y.createElement("div",$l({ref:t},e)))});function dMe(e){return e?sMe:cMe}var fMe=y.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:m,onMouseMove:f,onMouseUp:g,onTouchEnd:v,onTouchMove:b,onTouchStart:w,style:S,width:j,responsive:C,dispatchTouchEvents:_=!0}=e,k=y.useRef(null),O=tn(),[A,T]=y.useState(null),[P,z]=y.useState(null),L=tMe(),F=EA(),D=(F==null?void 0:F.width)>0?F.width:j,X=(F==null?void 0:F.height)>0?F.height:i,R=y.useCallback(se=>{L(se),typeof t=="function"&&t(se),T(se),z(se),se!=null&&(k.current=se)},[L,t,T,z]),q=y.useCallback(se=>{O(RK(se)),O(ta({handler:a,reactEvent:se}))},[O,a]),$=y.useCallback(se=>{O(JC(se)),O(ta({handler:d,reactEvent:se}))},[O,d]),V=y.useCallback(se=>{O(mV()),O(ta({handler:m,reactEvent:se}))},[O,m]),G=y.useCallback(se=>{O(JC(se)),O(ta({handler:f,reactEvent:se}))},[O,f]),K=y.useCallback(()=>{O(BK())},[O]),I=y.useCallback(()=>{O(FK())},[O]),H=y.useCallback(se=>{O($K(se.key))},[O]),U=y.useCallback(se=>{O(ta({handler:o,reactEvent:se}))},[O,o]),B=y.useCallback(se=>{O(ta({handler:l,reactEvent:se}))},[O,l]),Q=y.useCallback(se=>{O(ta({handler:c,reactEvent:se}))},[O,c]),Z=y.useCallback(se=>{O(ta({handler:g,reactEvent:se}))},[O,g]),te=y.useCallback(se=>{O(ta({handler:w,reactEvent:se}))},[O,w]),ae=y.useCallback(se=>{_&&O(qK(se)),O(ta({handler:b,reactEvent:se}))},[O,_,b]),re=y.useCallback(se=>{O(ta({handler:v,reactEvent:se}))},[O,v]),ee=dMe(C);return y.createElement(DV.Provider,{value:A},y.createElement(zH.Provider,{value:P},y.createElement(ee,{width:D??(S==null?void 0:S.width),height:X??(S==null?void 0:S.height),className:Dt("recharts-wrapper",r),style:nMe({position:"relative",cursor:"default",width:D,height:X},S),onClick:q,onContextMenu:U,onDoubleClick:B,onFocus:K,onBlur:I,onKeyDown:H,onMouseDown:Q,onMouseEnter:$,onMouseLeave:V,onMouseMove:G,onMouseUp:Z,onTouchEnd:re,onTouchMove:ae,onTouchStart:te,ref:R},y.createElement(oMe,null),n)))}),hMe=["width","height","responsive","children","className","style","compact","title","desc"];function mMe(e,t){if(e==null)return{};var n,r,i=pMe(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 pMe(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 QK=y.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:c,title:d,desc:m}=e,f=mMe(e,hMe),g=$i(f);return c?y.createElement(y.Fragment,null,y.createElement(Zp,{width:n,height:r}),y.createElement(b5,{otherAttributes:g,title:d,desc:m},a)):y.createElement(fMe,{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(b5,{otherAttributes:g,title:d,desc:m,ref:t},y.createElement(BOe,null,a)))});function eN(){return eN=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},eN.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 gMe(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){vMe(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 vMe(e,t,n){return(t=yMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yMe(e){var t=xMe(e,"string");return typeof t=="symbol"?t:t+""}function xMe(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 bMe={top:5,right:5,bottom:5,left:5},wMe=gMe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:bMe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},m2),ZK=y.forwardRef(function(t,n){var r,i=Zn(t.categoricalChartProps,wMe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,m={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return y.createElement(YK,{preloadedState:{options:m},reduxStoreName:(r=d.id)!==null&&r!==void 0?r:a},y.createElement(hK,{chartData:d.data}),y.createElement(XK,{layout:i.layout,margin:i.margin}),y.createElement(WK,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(GK,{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(QK,eN({},i,{ref:n})))}),SMe=["axis"],jMe=y.forwardRef((e,t)=>y.createElement(ZK,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:SMe,tooltipPayloadSearcher:VO,categoricalChartProps:e,ref:t})),EMe=["axis","item"],_Me=y.forwardRef((e,t)=>y.createElement(ZK,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:EMe,tooltipPayloadSearcher:VO,categoricalChartProps:e,ref:t}));function CMe(e){var t=tn();return y.useEffect(()=>{t($Pe(e))},[t,e]),null}var NMe=["layout"];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 kMe(e,t){if(e==null)return{};var n,r,i=AMe(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 AMe(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 j5(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 OMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j5(Object(n),!0).forEach(function(r){TMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TMe(e,t,n){return(t=PMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PMe(e){var t=MMe(e,"string");return typeof t=="symbol"?t:t+""}function MMe(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 RMe={top:5,right:5,bottom:5,left:5},JK=OMe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:RMe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},m2),DMe=y.forwardRef(function(t,n){var r,i=Zn(t.categoricalChartProps,JK),{layout:a}=i,o=kMe(i,NMe),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:m}=t,f={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:m,eventEmitter:void 0};return y.createElement(YK,{preloadedState:{options:f},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},y.createElement(hK,{chartData:i.data}),y.createElement(XK,{layout:a,margin:i.margin}),y.createElement(WK,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(GK,{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(CMe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),y.createElement(QK,tN({},o,{ref:n})))});function E5(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 _5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E5(Object(n),!0).forEach(function(r){IMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IMe(e,t,n){return(t=LMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LMe(e){var t=zMe(e,"string");return typeof t=="symbol"?t:t+""}function zMe(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 $Me=["item"],BMe=_5(_5({},JK),{},{layout:"centric",startAngle:0,endAngle:360}),FMe=y.forwardRef((e,t)=>{var n=Zn(e,BMe);return y.createElement(DMe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:$Me,tooltipPayloadSearcher:VO,categoricalChartProps:n,ref:t})});function UMe({completed:e,failed:t}){const n=e+t;if(n===0)return h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsxs("div",{className:"relative h-32 w-32",children:[h.jsx("svg",{viewBox:"0 0 100 100",className:"h-full w-full",children:h.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"12"})}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.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 h.jsxs("div",{className:"relative flex h-full items-center justify-center",children:[h.jsx(_A,{width:140,height:140,children:h.jsx(FMe,{children:h.jsx(cK,{data:i,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:i.map((o,l)=>h.jsx(pg,{fill:a[l]},l))})})}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsxs("span",{className:"text-lg font-semibold",children:[r,"%"]})})]})}function C5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function HMe({data:e}){return e.some(n=>n.total>0)?h.jsx(_A,{width:"100%",height:280,children:h.jsxs(_Me,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[h.jsx(o2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),h.jsx(c2,{dataKey:"date",tickFormatter:C5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),h.jsx(d2,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),h.jsx(zV,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>C5(String(n))}),h.jsx(b9,{wrapperStyle:{fontSize:12,paddingTop:8}}),h.jsx(XC,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),h.jsx(XC,{dataKey:"failed",name:"Failed",stackId:"a",fill:"#c62828",radius:[2,2,0,0]})]})}):h.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"})}function N5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function qMe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function VMe({data:e}){if(e.filter(r=>r.avg_duration_ms!==null).length===0)return h.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 h.jsx(_A,{width:"100%",height:280,children:h.jsxs(jMe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[h.jsx(o2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),h.jsx(c2,{dataKey:"date",tickFormatter:N5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),h.jsx(d2,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),h.jsx(zV,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>N5(String(r)),formatter:r=>[qMe(Number(r)*6e4),"Avg Duration"]}),h.jsx(kK,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const KMe=["7d","30d","90d"];function YMe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function eY({projectId:e}){const[t,n]=y.useState("30d"),{data:r,isLoading:i}=Rge(e,t);return i?h.jsxs("div",{className:"space-y-4",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsx(ln,{className:"h-32"}),h.jsx(ln,{className:"h-32"}),h.jsx(ln,{className:"h-32"})]}),h.jsx(ln,{className:"h-72"})]}):r?h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"flex gap-1",children:KMe.map(a=>h.jsx(xe,{size:"sm",variant:t===a?"default":"outline",onClick:()=>n(a),children:a},a))}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsxs(Nn,{children:[h.jsx(Wh,{className:"pb-2",children:h.jsx(Qh,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),h.jsxs(kn,{children:[h.jsx("div",{className:"text-3xl font-bold",children:r.total_runs}),h.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[r.completed," completed · ",r.failed," failed"]})]})]}),h.jsxs(Nn,{children:[h.jsx(Wh,{className:"pb-2",children:h.jsx(Qh,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),h.jsx(kn,{className:"h-36",children:h.jsx(UMe,{completed:r.completed,failed:r.failed})})]}),h.jsxs(Nn,{children:[h.jsx(Wh,{className:"pb-2",children:h.jsx(Qh,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),h.jsxs(kn,{children:[h.jsx("div",{className:"text-3xl font-bold",children:YMe(r.avg_duration_ms)}),h.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),h.jsxs(Nn,{children:[h.jsx(Wh,{children:h.jsx(Qh,{className:"text-base",children:"Run Frequency"})}),h.jsx(kn,{children:h.jsx(HMe,{data:r.daily})})]}),h.jsxs(Nn,{children:[h.jsx(Wh,{children:h.jsx(Qh,{className:"text-base",children:"Duration Trends"})}),h.jsx(kn,{children:h.jsx(VMe,{data:r.daily})})]})]}):null}function XMe(){return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsx(ln,{className:"h-24 rounded-lg"}),h.jsx(ln,{className:"h-64 rounded-lg"})]})}function GMe({projectId:e,conversationId:t,title:n,fallback:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(""),c=y.useRef(null),d=Ck(e);function m(v){v.stopPropagation(),l(n??""),a(!0),setTimeout(()=>{var b;return(b=c.current)==null?void 0:b.select()},0)}function f(v){v.stopPropagation();const b=o.trim();d.mutate({conversationId:t,title:b||null}),a(!1)}function g(v){v.key==="Enter"&&(v.preventDefault(),f(v)),v.key==="Escape"&&(v.stopPropagation(),a(!1))}return i?h.jsx(Xe,{ref:c,value:o,onChange:v=>l(v.target.value),onBlur:f,onKeyDown:g,onClick:v=>v.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:r}):h.jsxs("div",{className:"flex items-center gap-1.5 group",children:[h.jsx("span",{className:"font-medium",children:n??r}),h.jsx(xe,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:m,"aria-label":"Rename",children:h.jsx(Dp,{className:"h-3 w-3"})})]})}function WMe({projectId:e,conversationId:t,label:n}){const[r,i]=y.useState(!1),a=fU(e);return r?h.jsxs("div",{className:"flex justify-end gap-1",onClick:o=>o.stopPropagation(),children:[h.jsx(xe,{size:"sm",variant:"destructive",disabled:a.isPending,onClick:o=>{o.stopPropagation(),a.mutate(t,{onSuccess:()=>i(!1),onError:()=>i(!1)})},children:"Confirm"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),i(!1)},children:"No"})]}):h.jsx(xe,{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:h.jsx(_a,{className:"h-3.5 w-3.5"})})}const k5={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function QMe(){var L,F,D;const{projectId:e}=bp(),t=Number(e),n=Sa(),r=jk(t),[i,a]=y.useState(1),[o]=y.useState(1),l=mU(t,i),c=Bf(t),d=_k(t,o),m=sU(),[f,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 h.jsx(XMe,{});if(C)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",C.message]})]});if(!r.data)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsx("span",{children:"Project not found"})]});const _=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,P=c.data??[],z=P.reduce((X,R)=>(X[R.type]=(X[R.type]||0)+1,X),{});return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(xe,{variant:"outline",size:"sm",asChild:!0,children:h.jsxs(lr,{to:"/projects",children:[h.jsx(B0,{className:"mr-2 h-4 w-4"}),"Back"]})}),h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:_.display_name})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(xe,{disabled:!_.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:X=>n(`/projects/${t}/conversations/${X.id}`)})},children:[h.jsx(Rp,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),h.jsxs(xe,{variant:"outline",onClick:()=>g(!0),disabled:!_.dir_exists,children:[h.jsx(Ip,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),h.jsxs(xe,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[h.jsx(Mp,{className:"mr-2 h-4 w-4"}),"Install Resource"]})]})]}),h.jsx(Nn,{children:h.jsx(kn,{className:"pt-6",children:h.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Directory"}),h.jsxs("dd",{className:"flex items-center gap-2 break-all",children:[_.working_dir,_.dir_exists?h.jsx(ft,{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"}):h.jsx(ft,{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"})]}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Created"}),h.jsx("dd",{children:new Date(_.created_at).toLocaleString()}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),h.jsx("dd",{children:P.length===0?h.jsx("span",{className:"text-sm text-muted-foreground",children:"None installed"}):h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(z).map(([X,R])=>h.jsxs(ft,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[R," ",R===1?k5[X]??X:`${k5[X]??X}s`]},X))})})]})})}),h.jsx(Hue,{projectId:t,open:f,onOpenChange:g}),h.jsx(iA,{open:v,onOpenChange:b,projectId:t}),h.jsxs(Up,{value:w,onValueChange:S,children:[h.jsxs(Hp,{children:[h.jsxs(or,{value:"conversations",children:["Conversations (",((L=d.data)==null?void 0:L.total)??0,")"]}),h.jsxs(or,{value:"sessions",children:["Sessions (",A,")"]}),h.jsx(or,{value:"activity",children:"Activity"}),h.jsxs(or,{value:"resources",children:["Resources (",P.length,")"]}),h.jsx(or,{value:"files",children:"Files"})]}),h.jsx(sr,{value:"sessions",className:"mt-4 space-y-3",children:A===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):h.jsxs(h.Fragment,{children:[h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsx(ix,{sessions:O})})}),h.jsx(Rk,{page:i,totalPages:T,onPageChange:a})]})}),h.jsx(sr,{value:"conversations",className:"mt-4 space-y-3",children:(((F=d.data)==null?void 0:F.items)??[]).length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:'No conversations yet. Click "New Conversation" to start one.'}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[h.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),h.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),h.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),h.jsx("th",{className:"px-4 py-2"})]})}),h.jsx("tbody",{children:(((D=d.data)==null?void 0:D.items)??[]).map(X=>h.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>n(`/projects/${t}/conversations/${X.id}`),children:[h.jsx("td",{className:"px-4 py-2",children:h.jsx(GMe,{projectId:t,conversationId:X.id,title:X.title,fallback:`Conversation #${X.id}`})}),h.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:X.session_count}),h.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:X.last_activity?new Date(X.last_activity).toLocaleString():"—"}),h.jsx("td",{className:"px-4 py-2 text-right",children:h.jsx(WMe,{projectId:t,conversationId:X.id,label:X.title??`Conversation #${X.id}`})})]},X.id))})]})})})}),h.jsx(sr,{value:"activity",className:"mt-4",children:h.jsx(eY,{projectId:t})}),h.jsx(sr,{value:"resources",className:"mt-4",children:h.jsx(Pge,{projectId:t,installOpen:v,onInstallOpenChange:b})}),h.jsx(sr,{value:"files",className:"mt-4",children:h.jsx(NU,{projectId:t})})]})]})}function Jn(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=Jn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ZMe={value:()=>{}};function Kb(){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 $y(n)}function $y(e){this._=e}function JMe(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}})}$y.prototype=Kb.prototype={constructor:$y,on:function(e,t){var n=this._,r=JMe(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=eRe(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]=A5(n[i],e.name,t);else if(t==null)for(i in n)n[i]=A5(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 $y(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 eRe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function A5(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ZMe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var nN="http://www.w3.org/1999/xhtml";const O5={svg:"http://www.w3.org/2000/svg",xhtml:nN,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),O5.hasOwnProperty(t)?{space:O5[t],local:e}:e}function tRe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===nN&&t.documentElement.namespaceURI===nN?t.createElement(e):t.createElementNS(n,e)}}function nRe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tY(e){var t=Yb(e);return(t.local?nRe:tRe)(t)}function rRe(){}function p2(e){return e==null?rRe:function(){return this.querySelector(e)}}function iRe(e){typeof e!="function"&&(e=p2(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),c,d,m=0;m<o;++m)(c=a[m])&&(d=e.call(c,c.__data__,m,a))&&("__data__"in c&&(d.__data__=c.__data__),l[m]=d);return new Ui(r,this._parents)}function aRe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function oRe(){return[]}function nY(e){return e==null?oRe:function(){return this.querySelectorAll(e)}}function sRe(e){return function(){return aRe(e.apply(this,arguments))}}function lRe(e){typeof e=="function"?e=sRe(e):e=nY(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],l=o.length,c,d=0;d<l;++d)(c=o[d])&&(r.push(e.call(c,c.__data__,d,o)),i.push(c));return new Ui(r,i)}function rY(e){return function(){return this.matches(e)}}function iY(e){return function(t){return t.matches(e)}}var uRe=Array.prototype.find;function cRe(e){return function(){return uRe.call(this.children,e)}}function dRe(){return this.firstElementChild}function fRe(e){return this.select(e==null?dRe:cRe(typeof e=="function"?e:iY(e)))}var hRe=Array.prototype.filter;function mRe(){return Array.from(this.children)}function pRe(e){return function(){return hRe.call(this.children,e)}}function gRe(e){return this.selectAll(e==null?mRe:pRe(typeof e=="function"?e:iY(e)))}function vRe(e){typeof e!="function"&&(e=rY(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]=[],c,d=0;d<o;++d)(c=a[d])&&e.call(c,c.__data__,d,a)&&l.push(c);return new Ui(r,this._parents)}function aY(e){return new Array(e.length)}function yRe(){return new Ui(this._enter||this._groups.map(aY),this._parents)}function a0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}a0.prototype={constructor:a0,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 xRe(e){return function(){return e}}function bRe(e,t,n,r,i,a){for(var o=0,l,c=t.length,d=a.length;o<d;++o)(l=t[o])?(l.__data__=a[o],r[o]=l):n[o]=new a0(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function wRe(e,t,n,r,i,a,o){var l,c,d=new Map,m=t.length,f=a.length,g=new Array(m),v;for(l=0;l<m;++l)(c=t[l])&&(g[l]=v=o.call(c,c.__data__,l,t)+"",d.has(v)?i[l]=c:d.set(v,c));for(l=0;l<f;++l)v=o.call(e,a[l],l,a)+"",(c=d.get(v))?(r[l]=c,c.__data__=a[l],d.delete(v)):n[l]=new a0(e,a[l]);for(l=0;l<m;++l)(c=t[l])&&d.get(g[l])===c&&(i[l]=c)}function SRe(e){return e.__data__}function jRe(e,t){if(!arguments.length)return Array.from(this,SRe);var n=t?wRe:bRe,r=this._parents,i=this._groups;typeof e!="function"&&(e=xRe(e));for(var a=i.length,o=new Array(a),l=new Array(a),c=new Array(a),d=0;d<a;++d){var m=r[d],f=i[d],g=f.length,v=ERe(e.call(m,m&&m.__data__,d,r)),b=v.length,w=l[d]=new Array(b),S=o[d]=new Array(b),j=c[d]=new Array(g);n(m,f,w,S,j,v,t);for(var C=0,_=0,k,O;C<b;++C)if(k=w[C]){for(C>=_&&(_=C+1);!(O=S[_])&&++_<b;);k._next=O||null}}return o=new Ui(o,r),o._enter=l,o._exit=c,o}function ERe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _Re(){return new Ui(this._exit||this._groups.map(aY),this._parents)}function CRe(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 NRe(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),c=0;c<o;++c)for(var d=n[c],m=r[c],f=d.length,g=l[c]=new Array(f),v,b=0;b<f;++b)(v=d[b]||m[b])&&(g[b]=v);for(;c<i;++c)l[c]=n[c];return new Ui(l,this._parents)}function kRe(){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 ARe(e){e||(e=ORe);function t(f,g){return f&&g?e(f.__data__,g.__data__):!f-!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,c=i[a]=new Array(l),d,m=0;m<l;++m)(d=o[m])&&(c[m]=d);c.sort(t)}return new Ui(i,this._parents).order()}function ORe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function TRe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function PRe(){return Array.from(this)}function MRe(){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 RRe(){let e=0;for(const t of this)++e;return e}function DRe(){return!this.node()}function IRe(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 LRe(e){return function(){this.removeAttribute(e)}}function zRe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $Re(e,t){return function(){this.setAttribute(e,t)}}function BRe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function FRe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function URe(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 HRe(e,t){var n=Yb(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?zRe:LRe:typeof t=="function"?n.local?URe:FRe:n.local?BRe:$Re)(n,t))}function oY(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qRe(e){return function(){this.style.removeProperty(e)}}function VRe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function KRe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function YRe(e,t,n){return arguments.length>1?this.each((t==null?qRe:typeof t=="function"?KRe:VRe)(e,t,n??"")):jf(this.node(),e)}function jf(e,t){return e.style.getPropertyValue(t)||oY(e).getComputedStyle(e,null).getPropertyValue(t)}function XRe(e){return function(){delete this[e]}}function GRe(e,t){return function(){this[e]=t}}function WRe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function QRe(e,t){return arguments.length>1?this.each((t==null?XRe:typeof t=="function"?WRe:GRe)(e,t)):this.node()[e]}function sY(e){return e.trim().split(/^|\s+/)}function g2(e){return e.classList||new lY(e)}function lY(e){this._node=e,this._names=sY(e.getAttribute("class")||"")}lY.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 uY(e,t){for(var n=g2(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function cY(e,t){for(var n=g2(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function ZRe(e){return function(){uY(this,e)}}function JRe(e){return function(){cY(this,e)}}function eDe(e,t){return function(){(t.apply(this,arguments)?uY:cY)(this,e)}}function tDe(e,t){var n=sY(e+"");if(arguments.length<2){for(var r=g2(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?eDe:t?ZRe:JRe)(n,t))}function nDe(){this.textContent=""}function rDe(e){return function(){this.textContent=e}}function iDe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function aDe(e){return arguments.length?this.each(e==null?nDe:(typeof e=="function"?iDe:rDe)(e)):this.node().textContent}function oDe(){this.innerHTML=""}function sDe(e){return function(){this.innerHTML=e}}function lDe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function uDe(e){return arguments.length?this.each(e==null?oDe:(typeof e=="function"?lDe:sDe)(e)):this.node().innerHTML}function cDe(){this.nextSibling&&this.parentNode.appendChild(this)}function dDe(){return this.each(cDe)}function fDe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hDe(){return this.each(fDe)}function mDe(e){var t=typeof e=="function"?e:tY(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function pDe(){return null}function gDe(e,t){var n=typeof e=="function"?e:tY(e),r=t==null?pDe:typeof t=="function"?t:p2(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function vDe(){var e=this.parentNode;e&&e.removeChild(this)}function yDe(){return this.each(vDe)}function xDe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bDe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function wDe(e){return this.select(e?bDe:xDe)}function SDe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function jDe(e){return function(t){e.call(this,t,this.__data__)}}function EDe(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 _De(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 CDe(e,t,n){return function(){var r=this.__on,i,a=jDe(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 NDe(e,t,n){var r=EDe(e+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,d=l.length,m;c<d;++c)for(i=0,m=l[c];i<a;++i)if((o=r[i]).type===m.type&&o.name===m.name)return m.value}return}for(l=t?CDe:_De,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function dY(e,t,n){var r=oY(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 kDe(e,t){return function(){return dY(this,e,t)}}function ADe(e,t){return function(){return dY(this,e,t.apply(this,arguments))}}function ODe(e,t){return this.each((typeof t=="function"?ADe:kDe)(e,t))}function*TDe(){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 fY=[null];function Ui(e,t){this._groups=e,this._parents=t}function vg(){return new Ui([[document.documentElement]],fY)}function PDe(){return this}Ui.prototype=vg.prototype={constructor:Ui,select:iRe,selectAll:lRe,selectChild:fRe,selectChildren:gRe,filter:vRe,data:jRe,enter:yRe,exit:_Re,join:CRe,merge:NRe,selection:PDe,order:kRe,sort:ARe,call:TRe,nodes:PRe,node:MRe,size:RRe,empty:DRe,each:IRe,attr:HRe,style:YRe,property:QRe,classed:tDe,text:aDe,html:uDe,raise:dDe,lower:hDe,append:mDe,insert:gDe,remove:yDe,clone:wDe,datum:SDe,on:NDe,dispatch:ODe,[Symbol.iterator]:TDe};function Mi(e){return typeof e=="string"?new Ui([[document.querySelector(e)]],[document.documentElement]):new Ui([[e]],fY)}function MDe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ia(e,t){if(e=MDe(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 RDe={passive:!1},rp={capture:!0,passive:!1};function BE(e){e.stopImmediatePropagation()}function Vd(e){e.preventDefault(),e.stopImmediatePropagation()}function hY(e){var t=e.document.documentElement,n=Mi(e).on("dragstart.drag",Vd,rp);"onselectstart"in t?n.on("selectstart.drag",Vd,rp):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mY(e,t){var n=e.document.documentElement,r=Mi(e).on("dragstart.drag",null);t&&(r.on("click.drag",Vd,rp),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 xy=e=>()=>e;function rN(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:c,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:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}rN.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function DDe(e){return!e.ctrlKey&&!e.button}function IDe(){return this.parentNode}function LDe(e,t){return t??{x:e.x,y:e.y}}function zDe(){return navigator.maxTouchPoints||"ontouchstart"in this}function pY(){var e=DDe,t=IDe,n=LDe,r=zDe,i={},a=Kb("start","drag","end"),o=0,l,c,d,m,f=0;function g(k){k.on("mousedown.drag",v).filter(r).on("touchstart.drag",S).on("touchmove.drag",j,RDe).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=_(this,t.call(this,k,O),k,O,"mouse");A&&(Mi(k.view).on("mousemove.drag",b,rp).on("mouseup.drag",w,rp),hY(k.view),BE(k),d=!1,l=k.clientX,c=k.clientY,A("start",k))}}function b(k){if(Vd(k),!d){var O=k.clientX-l,A=k.clientY-c;d=O*O+A*A>f}i.mouse("drag",k)}function w(k){Mi(k.view).on("mousemove.drag mouseup.drag",null),mY(k.view,d),Vd(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),P=A.length,z,L;for(z=0;z<P;++z)(L=_(this,T,k,O,A[z].identifier,A[z]))&&(BE(k),L("start",k,A[z]))}}function j(k){var O=k.changedTouches,A=O.length,T,P;for(T=0;T<A;++T)(P=i[O[T].identifier])&&(Vd(k),P("drag",k,O[T]))}function C(k){var O=k.changedTouches,A=O.length,T,P;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),T=0;T<A;++T)(P=i[O[T].identifier])&&(BE(k),P("end",k,O[T]))}function _(k,O,A,T,P,z){var L=a.copy(),F=Ia(z||A,O),D,X,R;if((R=n.call(k,new rN("beforestart",{sourceEvent:A,target:g,identifier:P,active:o,x:F[0],y:F[1],dx:0,dy:0,dispatch:L}),T))!=null)return D=R.x-F[0]||0,X=R.y-F[1]||0,function q($,V,G){var K=F,I;switch($){case"start":i[P]=q,I=o++;break;case"end":delete i[P],--o;case"drag":F=Ia(G||V,O),I=o;break}L.call($,k,new rN($,{sourceEvent:V,subject:R,target:g,identifier:P,active:I,x:F[0]+D,y:F[1]+X,dx:F[0]-K[0],dy:F[1]-K[1],dispatch:L}),T)}}return g.filter=function(k){return arguments.length?(e=typeof k=="function"?k:xy(!!k),g):e},g.container=function(k){return arguments.length?(t=typeof k=="function"?k:xy(k),g):t},g.subject=function(k){return arguments.length?(n=typeof k=="function"?k:xy(k),g):n},g.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:xy(!!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?(f=(k=+k)*k,g):Math.sqrt(f)},g}var Ef=0,Sm=0,hm=0,gY=1e3,o0,jm,s0=0,Sc=0,Xb=0,ip=typeof performance=="object"&&performance.now?performance:Date,vY=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function v2(){return Sc||(vY($De),Sc=ip.now()+Xb)}function $De(){Sc=0}function l0(){this._call=this._time=this._next=null}l0.prototype=yY.prototype={constructor:l0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?v2():+n)+(t==null?0:+t),!this._next&&jm!==this&&(jm?jm._next=this:o0=this,jm=this),this._call=e,this._time=n,iN()},stop:function(){this._call&&(this._call=null,this._time=1/0,iN())}};function yY(e,t,n){var r=new l0;return r.restart(e,t,n),r}function BDe(){v2(),++Ef;for(var e=o0,t;e;)(t=Sc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ef}function T5(){Sc=(s0=ip.now())+Xb,Ef=Sm=0;try{BDe()}finally{Ef=0,UDe(),Sc=0}}function FDe(){var e=ip.now(),t=e-s0;t>gY&&(Xb-=t,s0=e)}function UDe(){for(var e,t=o0,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:o0=n);jm=e,iN(r)}function iN(e){if(!Ef){Sm&&(Sm=clearTimeout(Sm));var t=e-Sc;t>24?(e<1/0&&(Sm=setTimeout(T5,e-ip.now()-Xb)),hm&&(hm=clearInterval(hm))):(hm||(s0=ip.now(),hm=setInterval(FDe,gY)),Ef=1,vY(T5))}}function P5(e,t,n){var r=new l0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var HDe=Kb("start","end","cancel","interrupt"),qDe=[],xY=0,M5=1,aN=2,By=3,R5=4,oN=5,Fy=6;function Gb(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;VDe(e,n,{name:t,index:r,group:i,on:HDe,tween:qDe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:xY})}function y2(e,t){var n=Ja(e,t);if(n.state>xY)throw new Error("too late; already scheduled");return n}function Mo(e,t){var n=Ja(e,t);if(n.state>By)throw new Error("too late; already running");return n}function Ja(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function VDe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=yY(a,0,n.time);function a(d){n.state=M5,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var m,f,g,v;if(n.state!==M5)return c();for(m in r)if(v=r[m],v.name===n.name){if(v.state===By)return P5(o);v.state===R5?(v.state=Fy,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[m]):+m<t&&(v.state=Fy,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[m])}if(P5(function(){n.state===By&&(n.state=R5,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=aN,n.on.call("start",e,e.__data__,n.index,n.group),n.state===aN){for(n.state=By,i=new Array(g=n.tween.length),m=0,f=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=v);i.length=f+1}}function l(d){for(var m=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=oN,1),f=-1,g=i.length;++f<g;)i[f].call(e,m);n.state===oN&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Fy,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Uy(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>aN&&r.state<oN,r.state=Fy,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function KDe(e){return this.each(function(){Uy(this,e)})}function YDe(e,t){var n,r;return function(){var i=Mo(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 XDe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Mo(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},c=0,d=i.length;c<d;++c)if(i[c].name===t){i[c]=l;break}c===d&&i.push(l)}a.tween=i}}function GDe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ja(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?YDe:XDe)(n,e,t))}function x2(e,t,n){var r=e._id;return e.each(function(){var i=Mo(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ja(i,r).value[t]}}function bY(e,t){var n;return(typeof t=="number"?La:t instanceof bc?Bx:(n=bc(t))?(t=n,Bx):l7)(e,t)}function WDe(e){return function(){this.removeAttribute(e)}}function QDe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ZDe(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 JDe(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 eIe(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function tIe(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function nIe(e,t){var n=Yb(e),r=n==="transform"?iSe:bY;return this.attrTween(e,typeof t=="function"?(n.local?tIe:eIe)(n,r,x2(this,"attr."+e,t)):t==null?(n.local?QDe:WDe)(n):(n.local?JDe:ZDe)(n,r,t))}function rIe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function iIe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function aIe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&iIe(e,a)),n}return i._value=t,i}function oIe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&rIe(e,a)),n}return i._value=t,i}function sIe(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=Yb(e);return this.tween(n,(r.local?aIe:oIe)(r,t))}function lIe(e,t){return function(){y2(this,e).delay=+t.apply(this,arguments)}}function uIe(e,t){return t=+t,function(){y2(this,e).delay=t}}function cIe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?lIe:uIe)(t,e)):Ja(this.node(),t).delay}function dIe(e,t){return function(){Mo(this,e).duration=+t.apply(this,arguments)}}function fIe(e,t){return t=+t,function(){Mo(this,e).duration=t}}function hIe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dIe:fIe)(t,e)):Ja(this.node(),t).duration}function mIe(e,t){if(typeof t!="function")throw new Error;return function(){Mo(this,e).ease=t}}function pIe(e){var t=this._id;return arguments.length?this.each(mIe(t,e)):Ja(this.node(),t).ease}function gIe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Mo(this,e).ease=n}}function vIe(e){if(typeof e!="function")throw new Error;return this.each(gIe(this._id,e))}function yIe(e){typeof e!="function"&&(e=rY(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]=[],c,d=0;d<o;++d)(c=a[d])&&e.call(c,c.__data__,d,a)&&l.push(c);return new _s(r,this._parents,this._name,this._id)}function xIe(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 c=t[l],d=n[l],m=c.length,f=o[l]=new Array(m),g,v=0;v<m;++v)(g=c[v]||d[v])&&(f[v]=g);for(;l<r;++l)o[l]=t[l];return new _s(o,this._parents,this._name,this._id)}function bIe(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 wIe(e,t,n){var r,i,a=bIe(t)?y2:Mo;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function SIe(e,t){var n=this._id;return arguments.length<2?Ja(this.node(),n).on.on(e):this.each(wIe(n,e,t))}function jIe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function EIe(){return this.on("end.remove",jIe(this._id))}function _Ie(e){var t=this._name,n=this._id;typeof e!="function"&&(e=p2(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var l=r[o],c=l.length,d=a[o]=new Array(c),m,f,g=0;g<c;++g)(m=l[g])&&(f=e.call(m,m.__data__,g,l))&&("__data__"in m&&(f.__data__=m.__data__),d[g]=f,Gb(d[g],t,n,g,d,Ja(m,n)));return new _s(a,this._parents,t,n)}function CIe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nY(e));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var c=r[l],d=c.length,m,f=0;f<d;++f)if(m=c[f]){for(var g=e.call(m,m.__data__,f,c),v,b=Ja(m,n),w=0,S=g.length;w<S;++w)(v=g[w])&&Gb(v,t,n,w,g,b);a.push(g),o.push(m)}return new _s(a,o,t,n)}var NIe=vg.prototype.constructor;function kIe(){return new NIe(this._groups,this._parents)}function AIe(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 wY(e){return function(){this.style.removeProperty(e)}}function OIe(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 TIe(e,t,n){var r,i,a;return function(){var o=jf(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),jf(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function PIe(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=Mo(this,e),d=c.on,m=c.value[a]==null?l||(l=wY(t)):void 0;(d!==n||i!==m)&&(r=(n=d).copy()).on(o,i=m),c.on=r}}function MIe(e,t,n){var r=(e+="")=="transform"?rSe:bY;return t==null?this.styleTween(e,AIe(e,r)).on("end.style."+e,wY(e)):typeof t=="function"?this.styleTween(e,TIe(e,r,x2(this,"style."+e,t))).each(PIe(this._id,e)):this.styleTween(e,OIe(e,r,t),n).on("end.style."+e,null)}function RIe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DIe(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&RIe(e,o,n)),r}return a._value=t,a}function IIe(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,DIe(e,t,n??""))}function LIe(e){return function(){this.textContent=e}}function zIe(e){return function(){var t=e(this);this.textContent=t??""}}function $Ie(e){return this.tween("text",typeof e=="function"?zIe(x2(this,"text",e)):LIe(e==null?"":e+""))}function BIe(e){return function(t){this.textContent=e.call(this,t)}}function FIe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&BIe(i)),t}return r._value=e,r}function UIe(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,FIe(e))}function HIe(){for(var e=this._name,t=this._id,n=SY(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,d=0;d<l;++d)if(c=o[d]){var m=Ja(c,t);Gb(c,e,n,d,o,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new _s(r,this._parents,e,n)}function qIe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var l={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var d=Mo(this,r),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),d.on=t}),i===0&&a()})}var VIe=0;function _s(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function SY(){return++VIe}var es=vg.prototype;_s.prototype={constructor:_s,select:_Ie,selectAll:CIe,selectChild:es.selectChild,selectChildren:es.selectChildren,filter:yIe,merge:xIe,selection:kIe,transition:HIe,call:es.call,nodes:es.nodes,node:es.node,size:es.size,empty:es.empty,each:es.each,on:SIe,attr:nIe,attrTween:sIe,style:MIe,styleTween:IIe,text:$Ie,textTween:UIe,remove:EIe,tween:GDe,delay:cIe,duration:hIe,ease:pIe,easeVarying:vIe,end:qIe,[Symbol.iterator]:es[Symbol.iterator]};function KIe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var YIe={time:null,delay:0,duration:250,ease:KIe};function XIe(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 GIe(e){var t,n;e instanceof _s?(t=e._id,e=e._name):(t=SY(),(n=YIe).time=v2(),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,c,d=0;d<l;++d)(c=o[d])&&Gb(c,e,t,d,o,n||XIe(c,t));return new _s(r,this._parents,e,t)}vg.prototype.interrupt=KDe;vg.prototype.transition=GIe;const by=e=>()=>e;function WIe(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 cs(e,t,n){this.k=e,this.x=t,this.y=n}cs.prototype={constructor:cs,scale:function(e){return e===1?this:new cs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new cs(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 Wb=new cs(1,0,0);jY.prototype=cs.prototype;function jY(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Wb;return e.__zoom}function FE(e){e.stopImmediatePropagation()}function mm(e){e.preventDefault(),e.stopImmediatePropagation()}function QIe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ZIe(){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 D5(){return this.__zoom||Wb}function JIe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eLe(){return navigator.maxTouchPoints||"ontouchstart"in this}function tLe(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 EY(){var e=QIe,t=ZIe,n=tLe,r=JIe,i=eLe,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Iy,d=Kb("start","zoom","end"),m,f,g,v=500,b=150,w=0,S=10;function j(R){R.property("__zoom",D5).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",L).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(R,q,$,V){var G=R.selection?R.selection():R;G.property("__zoom",D5),R!==G?O(R,q,$,V):G.interrupt().each(function(){A(this,arguments).event(V).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},j.scaleBy=function(R,q,$,V){j.scaleTo(R,function(){var G=this.__zoom.k,K=typeof q=="function"?q.apply(this,arguments):q;return G*K},$,V)},j.scaleTo=function(R,q,$,V){j.transform(R,function(){var G=t.apply(this,arguments),K=this.__zoom,I=$==null?k(G):typeof $=="function"?$.apply(this,arguments):$,H=K.invert(I),U=typeof q=="function"?q.apply(this,arguments):q;return n(_(C(K,U),I,H),G,o)},$,V)},j.translateBy=function(R,q,$,V){j.transform(R,function(){return n(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),o)},null,V)},j.translateTo=function(R,q,$,V,G){j.transform(R,function(){var K=t.apply(this,arguments),I=this.__zoom,H=V==null?k(K):typeof V=="function"?V.apply(this,arguments):V;return n(Wb.translate(H[0],H[1]).scale(I.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof $=="function"?-$.apply(this,arguments):-$),K,o)},V,G)};function C(R,q){return q=Math.max(a[0],Math.min(a[1],q)),q===R.k?R:new cs(q,R.x,R.y)}function _(R,q,$){var V=q[0]-$[0]*R.k,G=q[1]-$[1]*R.k;return V===R.x&&G===R.y?R:new cs(R.k,V,G)}function k(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function O(R,q,$,V){R.on("start.zoom",function(){A(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(V).end()}).tween("zoom",function(){var G=this,K=arguments,I=A(G,K).event(V),H=t.apply(G,K),U=$==null?k(H):typeof $=="function"?$.apply(G,K):$,B=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Q=G.__zoom,Z=typeof q=="function"?q.apply(G,K):q,te=c(Q.invert(U).concat(B/Q.k),Z.invert(U).concat(B/Z.k));return function(ae){if(ae===1)ae=Z;else{var re=te(ae),ee=B/re[2];ae=new cs(ee,U[0]-re[0]*ee,U[1]-re[1]*ee)}I.zoom(null,ae)}})}function A(R,q,$){return!$&&R.__zooming||new T(R,q)}function T(R,q){this.that=R,this.args=q,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,q),this.taps=0}T.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,q){return this.mouse&&R!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var q=Mi(this.that).datum();d.call(R,this.that,new WIe(R,{sourceEvent:this.sourceEvent,target:j,transform:this.that.__zoom,dispatch:d}),q)}};function P(R,...q){if(!e.apply(this,arguments))return;var $=A(this,q).event(R),V=this.__zoom,G=Math.max(a[0],Math.min(a[1],V.k*Math.pow(2,r.apply(this,arguments)))),K=Ia(R);if($.wheel)($.mouse[0][0]!==K[0]||$.mouse[0][1]!==K[1])&&($.mouse[1]=V.invert($.mouse[0]=K)),clearTimeout($.wheel);else{if(V.k===G)return;$.mouse=[K,V.invert(K)],Uy(this),$.start()}mm(R),$.wheel=setTimeout(I,b),$.zoom("mouse",n(_(C(V,G),$.mouse[0],$.mouse[1]),$.extent,o));function I(){$.wheel=null,$.end()}}function z(R,...q){if(g||!e.apply(this,arguments))return;var $=R.currentTarget,V=A(this,q,!0).event(R),G=Mi(R.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",B,!0),K=Ia(R,$),I=R.clientX,H=R.clientY;hY(R.view),FE(R),V.mouse=[K,this.__zoom.invert(K)],Uy(this),V.start();function U(Q){if(mm(Q),!V.moved){var Z=Q.clientX-I,te=Q.clientY-H;V.moved=Z*Z+te*te>w}V.event(Q).zoom("mouse",n(_(V.that.__zoom,V.mouse[0]=Ia(Q,$),V.mouse[1]),V.extent,o))}function B(Q){G.on("mousemove.zoom mouseup.zoom",null),mY(Q.view,V.moved),mm(Q),V.event(Q).end()}}function L(R,...q){if(e.apply(this,arguments)){var $=this.__zoom,V=Ia(R.changedTouches?R.changedTouches[0]:R,this),G=$.invert(V),K=$.k*(R.shiftKey?.5:2),I=n(_(C($,K),V,G),t.apply(this,q),o);mm(R),l>0?Mi(this).transition().duration(l).call(O,I,V,R):Mi(this).call(j.transform,I,V,R)}}function F(R,...q){if(e.apply(this,arguments)){var $=R.touches,V=$.length,G=A(this,q,R.changedTouches.length===V).event(R),K,I,H,U;for(FE(R),I=0;I<V;++I)H=$[I],U=Ia(H,this),U=[U,this.__zoom.invert(U),H.identifier],G.touch0?!G.touch1&&G.touch0[2]!==U[2]&&(G.touch1=U,G.taps=0):(G.touch0=U,K=!0,G.taps=1+!!m);m&&(m=clearTimeout(m)),K&&(G.taps<2&&(f=U[0],m=setTimeout(function(){m=null},v)),Uy(this),G.start())}}function D(R,...q){if(this.__zooming){var $=A(this,q).event(R),V=R.changedTouches,G=V.length,K,I,H,U;for(mm(R),K=0;K<G;++K)I=V[K],H=Ia(I,this),$.touch0&&$.touch0[2]===I.identifier?$.touch0[0]=H:$.touch1&&$.touch1[2]===I.identifier&&($.touch1[0]=H);if(I=$.that.__zoom,$.touch1){var B=$.touch0[0],Q=$.touch0[1],Z=$.touch1[0],te=$.touch1[1],ae=(ae=Z[0]-B[0])*ae+(ae=Z[1]-B[1])*ae,re=(re=te[0]-Q[0])*re+(re=te[1]-Q[1])*re;I=C(I,Math.sqrt(ae/re)),H=[(B[0]+Z[0])/2,(B[1]+Z[1])/2],U=[(Q[0]+te[0])/2,(Q[1]+te[1])/2]}else if($.touch0)H=$.touch0[0],U=$.touch0[1];else return;$.zoom("touch",n(_(I,H,U),$.extent,o))}}function X(R,...q){if(this.__zooming){var $=A(this,q).event(R),V=R.changedTouches,G=V.length,K,I;for(FE(R),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),K=0;K<G;++K)I=V[K],$.touch0&&$.touch0[2]===I.identifier?delete $.touch0:$.touch1&&$.touch1[2]===I.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(I=Ia(I,this),Math.hypot(f[0]-I[0],f[1]-I[1])<S)){var H=Mi(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return j.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:by(+R),j):r},j.filter=function(R){return arguments.length?(e=typeof R=="function"?R:by(!!R),j):e},j.touchable=function(R){return arguments.length?(i=typeof R=="function"?R:by(!!R),j):i},j.extent=function(R){return arguments.length?(t=typeof R=="function"?R:by([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),j):t},j.scaleExtent=function(R){return arguments.length?(a[0]=+R[0],a[1]=+R[1],j):[a[0],a[1]]},j.translateExtent=function(R){return arguments.length?(o[0][0]=+R[0][0],o[1][0]=+R[1][0],o[0][1]=+R[0][1],o[1][1]=+R[1][1],j):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},j.constrain=function(R){return arguments.length?(n=R,j):n},j.duration=function(R){return arguments.length?(l=+R,j):l},j.interpolate=function(R){return arguments.length?(c=R,j):c},j.on=function(){var R=d.on.apply(d,arguments);return R===d?j:R},j.clickDistance=function(R){return arguments.length?(w=(R=+R)*R,j):Math.sqrt(w)},j.tapDistance=function(R){return arguments.length?(S=+R,j):S},j}const Ao={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."},ap=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_Y=["Enter"," ","Escape"],CY={"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 ec;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ec||(ec={}));var op;(function(e){e.Partial="partial",e.Full="full"})(op||(op={}));const NY={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var _l;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(_l||(_l={}));var Cf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Cf||(Cf={}));var Ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ke||(Ke={}));const I5={[Ke.Left]:Ke.Right,[Ke.Right]:Ke.Left,[Ke.Top]:Ke.Bottom,[Ke.Bottom]:Ke.Top};function kY(e){return e===null?null:e?"valid":"invalid"}const AY=e=>"id"in e&&"source"in e&&"target"in e,nLe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),b2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),yg=(e,t=[0,0])=>{const{width:n,height:r}=Is(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},rLe=(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):b2(i)?i:t.nodeLookup.get(i.id));const l=o?u0(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Qb(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zb(n)},xg=(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=Qb(n,u0(i)),r=!0)}),r?Zb(n):{x:0,y:0,width:0,height:0}},w2=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...wg(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const d of e.values()){const{measured:m,selectable:f=!0,hidden:g=!1}=d;if(o&&!f||g)continue;const v=m.width??d.width??d.initialWidth??null,b=m.height??d.height??d.initialHeight??null,w=sp(l,kf(d)),S=(v??0)*(b??0),j=a&&w>0;(!d.internals.handleBounds||j||w>=S||d.dragging)&&c.push(d)}return c},iLe=(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 aLe(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 oLe({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=aLe(e,o),c=xg(l),d=S2(c,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 OY({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:c,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},m=o.origin??r;let f=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Ao.error005());else{const v=l.measured.width,b=l.measured.height;v&&b&&(f=[[c,d],[c+v,d+b]])}else l&&Af(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+d],[o.extent[1][0]+c,o.extent[1][1]+d]]);const g=Af(f)?jc(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Ao.error015())),{position:{x:g.x-c+(o.measured.width??0)*m[0],y:g.y-d+(o.measured.height??0)*m[1]},positionAbsolute:g}}async function sLe({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)),c=r.filter(g=>g.deletable!==!1),m=iLe(o,c);for(const g of c)l.has(g.id)&&!m.find(b=>b.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:o};const f=await i({nodes:o,edges:m});return typeof f=="boolean"?f?{edges:m,nodes:o}:{edges:[],nodes:[]}:f}const Nf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),jc=(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 TY(e,t,n){const{width:r,height:i}=Is(n),{x:a,y:o}=n.internals.positionAbsolute;return jc(e,[[a,o],[a+r,o+i]],t)}const L5=(e,t,n)=>e<t?Nf(Math.abs(e-t),1,t)/t:e>n?-Nf(Math.abs(e-n),1,t)/t:0,PY=(e,t,n=15,r=40)=>{const i=L5(e.x,r,t.width-r)*n,a=L5(e.y,r,t.height-r)*n;return[i,a]},Qb=(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)}),sN=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Zb=({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}=b2(e)?e.internals.positionAbsolute:yg(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}},u0=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=b2(e)?e.internals.positionAbsolute:yg(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)}},MY=(e,t)=>Zb(Qb(sN(e),sN(t))),sp=(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)},z5=e=>Fa(e.width)&&Fa(e.height)&&Fa(e.x)&&Fa(e.y),Fa=e=>!isNaN(e)&&isFinite(e),lLe=(e,t)=>{},bg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wg=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?bg(l,o):l},c0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Ad(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 uLe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ad(e,n),i=Ad(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Ad(e.top??e.y??0,n),i=Ad(e.bottom??e.y??0,n),a=Ad(e.left??e.x??0,t),o=Ad(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 cLe(e,t,n,r,i,a){const{x:o,y:l}=c0(e,[t,n,r]),{x:c,y:d}=c0({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-c,f=a-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(m),bottom:Math.floor(f)}}const S2=(e,t,n,r,i,a)=>{const o=uLe(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,d=Math.min(l,c),m=Nf(d,r,i),f=e.x+e.width/2,g=e.y+e.height/2,v=t/2-f*m,b=n/2-g*m,w=cLe(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}},lp=()=>{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 Is(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 RY(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 DY(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 $5(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function dLe(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function fLe(e){return{...CY,...e||{}}}function Tm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Ua(e),l=wg({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:d}=n?bg(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const j2=e=>({width:e.offsetWidth,height:e.offsetHeight}),IY=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},hLe=["INPUT","SELECT","TEXTAREA"];function LY(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:hLe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const zY=e=>"clientX"in e,Ua=(e,t)=>{var a,o;const n=zY(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)}},B5=(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,...j2(o)}})};function $Y({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const c=e*.125+i*.375+o*.375+n*.125,d=t*.125+a*.375+l*.375+r*.125,m=Math.abs(c-e),f=Math.abs(d-t);return[c,d,m,f]}function wy(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function F5({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Ke.Left:return[t-wy(t-r,a),n];case Ke.Right:return[t+wy(r-t,a),n];case Ke.Top:return[t,n-wy(n-i,a)];case Ke.Bottom:return[t,n+wy(i-n,a)]}}function BY({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top,curvature:o=.25}){const[l,c]=F5({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,m]=F5({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[f,g,v,b]=$Y({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:m});return[`M${e},${t} C${l},${c} ${d},${m} ${r},${i}`,f,g,v,b]}function FY({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 mLe({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 pLe({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=Qb(u0(e),u0(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 sp(o,Zb(a))>0}const gLe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,vLe=(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)),yLe=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||gLe;let i;return AY(e)?i={...e}:i={...e,id:r(e)},vLe(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function UY({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=FY({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const U5={[Ke.Left]:{x:-1,y:0},[Ke.Right]:{x:1,y:0},[Ke.Top]:{x:0,y:-1},[Ke.Bottom]:{x:0,y:1}},xLe=({source:e,sourcePosition:t=Ke.Bottom,target:n})=>t===Ke.Left||t===Ke.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},H5=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function bLe({source:e,sourcePosition:t=Ke.Bottom,target:n,targetPosition:r=Ke.Top,center:i,offset:a,stepPosition:o}){const l=U5[t],c=U5[r],d={x:e.x+l.x*a,y:e.y+l.y*a},m={x:n.x+c.x*a,y:n.y+c.y*a},f=xLe({source:d,sourcePosition:t,target:m}),g=f.x!==0?"x":"y",v=f[g];let b=[],w,S;const j={x:0,y:0},C={x:0,y:0},[,,_,k]=FY({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*c[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 D=Math.abs(e[g]-n[g]);if(D<=a){const X=Math.min(a-1,a-D);l[g]===v?j[g]=(d[g]>e[g]?-1:1)*X:C[g]=(m[g]>n[g]?-1:1)*X}}if(t!==r){const D=g==="x"?"y":"x",X=l[g]===c[D],R=d[D]>m[D],q=d[D]<m[D];(l[g]===1&&(!X&&R||X&&q)||l[g]!==1&&(!X&&q||X&&R))&&(b=g==="x"?A:T)}const P={x:d.x+j.x,y:d.y+j.y},z={x:m.x+C.x,y:m.y+C.y},L=Math.max(Math.abs(P.x-b[0].x),Math.abs(z.x-b[0].x)),F=Math.max(Math.abs(P.y-b[0].y),Math.abs(z.y-b[0].y));L>=F?(w=(P.x+z.x)/2,S=b[0].y):(w=b[0].x,S=(P.y+z.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,_,k]}function wLe(e,t,n,r){const i=Math.min(H5(e,t)/2,H5(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,c=e.y<n.y?-1:1;return`L ${a},${o+i*c}Q ${a},${o} ${a+i*l},${o}`}function lN({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top,borderRadius:o=5,centerX:l,centerY:c,offset:d=20,stepPosition:m=.5}){const[f,g,v,b,w]=bLe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:l,y:c},offset:d,stepPosition:m});return[f.reduce((j,C,_)=>{let k="";return _>0&&_<f.length-1?k=wLe(f[_-1],C,f[_+1],o):k=`${_===0?"M":"L"}${C.x} ${C.y}`,j+=k,j},""),g,v,b,w]}function q5(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function SLe(e){var f;const{sourceNode:t,targetNode:n}=e;if(!q5(t)||!q5(n))return null;const r=t.internals.handleBounds||V5(t.handles),i=n.internals.handleBounds||V5(n.handles),a=K5((r==null?void 0:r.source)??[],e.sourceHandle),o=K5(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(f=e.onError)==null||f.call(e,"008",Ao.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||Ke.Bottom,c=(o==null?void 0:o.position)||Ke.Top,d=Ec(t,a,l),m=Ec(n,o,c);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:l,targetPosition:c}}function V5(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 Ec(e,t,n=Ke.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??Is(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case Ke.Top:return{x:i+o/2,y:a};case Ke.Right:return{x:i+o,y:a+l/2};case Ke.Bottom:return{x:i+o/2,y:a+l};case Ke.Left:return{x:i,y:a+l/2}}}function K5(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function uN(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function jLe(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(c=>{if(c&&typeof c=="object"){const d=uN(c,t);a.has(d)||(o.push({id:d,color:c.color||n,...c}),a.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const HY=1e3,ELe=10,E2={nodeOrigin:[0,0],nodeExtent:ap,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_Le={...E2,checkEquality:!0};function _2(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function CLe(e,t,n){const r=_2(E2,n);for(const i of e.values())if(i.parentId)N2(i,e,t,r);else{const a=yg(i,r.nodeOrigin),o=Af(i.extent)?i.extent:r.nodeExtent,l=jc(a,o,Is(i));i.internals.positionAbsolute=l}}function NLe(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 C2(e){return e==="manual"}function cN(e,t,n,r={}){var d,m;const i=_2(_Le,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!C2(i.zIndexMode)?HY:0;let c=e.length>0;t.clear(),n.clear();for(const f of e){let g=o.get(f.id);if(i.checkEquality&&f===(g==null?void 0:g.internals.userNode))t.set(f.id,g);else{const v=yg(f,i.nodeOrigin),b=Af(f.extent)?f.extent:i.nodeExtent,w=jc(v,b,Is(f));g={...i.defaults,...f,measured:{width:(d=f.measured)==null?void 0:d.width,height:(m=f.measured)==null?void 0:m.height},internals:{positionAbsolute:w,handleBounds:NLe(f,g),z:qY(f,l,i.zIndexMode),userNode:f}},t.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(c=!1),f.parentId&&N2(g,t,n,r,a)}return c}function kLe(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 N2(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=_2(E2,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}kLe(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&c==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*ELe),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const f=a&&!C2(c)?HY:0,{x:g,y:v,z:b}=ALe(e,m,o,l,f,c),{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 qY(e,t,n){const r=Fa(e.zIndex)?e.zIndex:0;return C2(n)?r:r+(e.selected?t:0)}function ALe(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,c=Is(e),d=yg(e,n),m=Af(e.extent)?jc(d,e.extent,c):d;let f=jc({x:o+m.x,y:l+m.y},r,c);e.extent==="parent"&&(f=TY(f,c,t));const g=qY(e,i,a),v=t.internals.z??0;return{x:f.x,y:f.y,z:v>=g?v+1:g}}function k2(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const d=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??kf(c),m=MY(d,l.rect);a.set(l.parentId,{expandedRect:m,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},d)=>{var _;const m=c.internals.positionAbsolute,f=Is(c),g=c.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(f.width,Math.round(l.width)),S=Math.max(f.height,Math.round(l.height)),j=(w-f.width)*g[0],C=(S-f.height)*g[1];(v>0||b>0||j||C)&&(i.push({id:d,type:"position",position:{x:c.position.x-v+j,y:c.position.y-b+C}}),(_=n.get(d))==null||_.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}})})),(f.width<l.width||f.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 OLe(e,t,n,r,i,a,o){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const d=[],m=window.getComputedStyle(l),{m22:f}=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}}),c=!0;continue}const w=j2(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(),_=Af(b.extent)?b.extent:a;let{positionAbsolute:k}=b.internals;b.parentId&&b.extent==="parent"?k=TY(k,w,t.get(b.parentId)):_&&(k=jc(k,_,w));const O={...b,measured:w,internals:{...b.internals,positionAbsolute:k,handleBounds:{source:B5("source",v.nodeElement,C,f,b.id),target:B5("target",v.nodeElement,C,f,b.id)}}};t.set(b.id,O),b.parentId&&N2(O,t,n,{nodeOrigin:i,zIndexMode:o}),c=!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=k2(g,t,n,i);d.push(...v)}return{changes:d,updatedInternals:c}}async function TLe({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 Y5(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 c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function VY(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},d=`${i}-${o}--${a}-${l}`,m=`${a}-${l}--${i}-${o}`;Y5("source",c,m,e,i,o),Y5("target",c,d,e,a,l),t.set(r.id,r)}}function KY(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:KY(n,t):!1}function X5(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 PLe(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!KY(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 UE({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const i=[];for(const[d,m]of t){const f=(o=n.get(d))==null?void 0:o.internals.userNode;f&&i.push({...f,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:((c=t.get(e))==null?void 0:c.position)||a.position,dragging:r}:i[0],i]}function MLe({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=bg(a,t);return{x:o.x-a.x,y:o.y-a.y}}function RLe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,c=!1,d={x:0,y:0},m=null,f=!1,g=null,v=!1,b=!1,w=null;function S({noDragClassName:C,handleSelector:_,domNode:k,isSelectable:O,nodeId:A,nodeClickDistance:T=0}){g=Mi(k);function P({x:D,y:X}){const{nodeLookup:R,nodeExtent:q,snapGrid:$,snapToGrid:V,nodeOrigin:G,onNodeDrag:K,onSelectionDrag:I,onError:H,updateNodePositions:U}=t();a={x:D,y:X};let B=!1;const Q=l.size>1,Z=Q&&q?sN(xg(l)):null,te=Q&&V?MLe({dragItems:l,snapGrid:$,x:D,y:X}):null;for(const[ae,re]of l){if(!R.has(ae))continue;let ee={x:D-re.distance.x,y:X-re.distance.y};V&&(ee=te?{x:Math.round(ee.x+te.x),y:Math.round(ee.y+te.y)}:bg(ee,$));let se=null;if(Q&&q&&!re.extent&&Z){const{positionAbsolute:Se}=re.internals,Ee=Se.x-Z.x+q[0][0],He=Se.x+re.measured.width-Z.x2+q[1][0],Oe=Se.y-Z.y+q[0][1],at=Se.y+re.measured.height-Z.y2+q[1][1];se=[[Ee,Oe],[He,at]]}const{position:ge,positionAbsolute:ie}=OY({nodeId:ae,nextPosition:ee,nodeLookup:R,nodeExtent:se||q,nodeOrigin:G,onError:H});B=B||re.position.x!==ge.x||re.position.y!==ge.y,re.position=ge,re.internals.positionAbsolute=ie}if(b=b||B,!!B&&(U(l,!0),w&&(r||K||!A&&I))){const[ae,re]=UE({nodeId:A,dragItems:l,nodeLookup:R});r==null||r(w,l,ae,re),K==null||K(w,ae,re),A||I==null||I(w,re)}}async function z(){if(!m)return;const{transform:D,panBy:X,autoPanSpeed:R,autoPanOnNodeDrag:q}=t();if(!q){c=!1,cancelAnimationFrame(o);return}const[$,V]=PY(d,m,R);($!==0||V!==0)&&(a.x=(a.x??0)-$/D[2],a.y=(a.y??0)-V/D[2],await X({x:$,y:V})&&P(a)),o=requestAnimationFrame(z)}function L(D){var Q;const{nodeLookup:X,multiSelectionActive:R,nodesDraggable:q,transform:$,snapGrid:V,snapToGrid:G,selectNodesOnDrag:K,onNodeDragStart:I,onSelectionDragStart:H,unselectNodesAndEdges:U}=t();f=!0,(!K||!O)&&!R&&A&&((Q=X.get(A))!=null&&Q.selected||U()),O&&K&&A&&(e==null||e(A));const B=Tm(D.sourceEvent,{transform:$,snapGrid:V,snapToGrid:G,containerBounds:m});if(a=B,l=PLe(X,q,B,A),l.size>0&&(n||I||!A&&H)){const[Z,te]=UE({nodeId:A,dragItems:l,nodeLookup:X});n==null||n(D.sourceEvent,l,Z,te),I==null||I(D.sourceEvent,Z,te),A||H==null||H(D.sourceEvent,te)}}const F=pY().clickDistance(T).on("start",D=>{const{domNode:X,nodeDragThreshold:R,transform:q,snapGrid:$,snapToGrid:V}=t();m=(X==null?void 0:X.getBoundingClientRect())||null,v=!1,b=!1,w=D.sourceEvent,R===0&&L(D),a=Tm(D.sourceEvent,{transform:q,snapGrid:$,snapToGrid:V,containerBounds:m}),d=Ua(D.sourceEvent,m)}).on("drag",D=>{const{autoPanOnNodeDrag:X,transform:R,snapGrid:q,snapToGrid:$,nodeDragThreshold:V,nodeLookup:G}=t(),K=Tm(D.sourceEvent,{transform:R,snapGrid:q,snapToGrid:$,containerBounds:m});if(w=D.sourceEvent,(D.sourceEvent.type==="touchmove"&&D.sourceEvent.touches.length>1||A&&!G.has(A))&&(v=!0),!v){if(!c&&X&&f&&(c=!0,z()),!f){const I=Ua(D.sourceEvent,m),H=I.x-d.x,U=I.y-d.y;Math.sqrt(H*H+U*U)>V&&L(D)}(a.x!==K.xSnapped||a.y!==K.ySnapped)&&l&&f&&(d=Ua(D.sourceEvent,m),P(K))}}).on("end",D=>{if(!(!f||v)&&(c=!1,f=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:X,updateNodePositions:R,onNodeDragStop:q,onSelectionDragStop:$}=t();if(b&&(R(l,!1),b=!1),i||q||!A&&$){const[V,G]=UE({nodeId:A,dragItems:l,nodeLookup:X,dragging:!1});i==null||i(D.sourceEvent,l,V,G),q==null||q(D.sourceEvent,V,G),A||$==null||$(D.sourceEvent,G)}}}).filter(D=>{const X=D.target;return!D.button&&(!C||!X5(X,`.${C}`,k))&&(!_||X5(X,_,k))});g.call(F)}function j(){g==null||g.on(".drag",null)}return{update:S,destroy:j}}function DLe(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())sp(i,kf(a))>0&&r.push(a);return r}const ILe=250;function LLe(e,t,n,r){var l,c;let i=[],a=1/0;const o=DLe(e,n,t+ILe);for(const d of o){const m=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((c=d.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of m){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:g,y:v}=Ec(d,f,f.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));b>t||(b<a?(i=[{...f,x:g,y:v}],a=b):b===a&&i.push({...f,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 YY(e,t,n,r,i,a=!1){var d,m,f;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)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return c&&a?{...c,...Ec(o,c,c.position,!0)}:c}function XY(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function zLe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const GY=()=>!0;function $Le(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:d,autoPanOnConnect:m,flowId:f,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:w,onConnectEnd:S,isValidConnection:j=GY,onReconnectEnd:C,updateConnection:_,getTransform:k,getFromHandle:O,autoPanSpeed:A,dragThreshold:T=1,handleDomNode:P}){const z=IY(e.target);let L=0,F;const{x:D,y:X}=Ua(e),R=XY(a,P),q=l==null?void 0:l.getBoundingClientRect();let $=!1;if(!q||!R)return;const V=YY(i,R,r,c,t);if(!V)return;let G=Ua(e,q),K=!1,I=null,H=!1,U=null;function B(){if(!m||!q)return;const[ge,ie]=PY(G,q,A);g({x:ge,y:ie}),L=requestAnimationFrame(B)}const Q={...V,nodeId:i,type:R,position:V.position},Z=c.get(i);let ae={inProgress:!0,isValid:null,from:Ec(Z,Q,Ke.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:Z,to:G,toHandle:null,toPosition:I5[Q.position],toNode:null,pointer:G};function re(){$=!0,_(ae),b==null||b(e,{nodeId:i,handleId:r,handleType:R})}T===0&&re();function ee(ge){if(!$){const{x:at,y:Je}=Ua(ge),We=at-D,zt=Je-X;if(!(We*We+zt*zt>T*T))return;re()}if(!O()||!Q){se(ge);return}const ie=k();G=Ua(ge,q),F=LLe(wg(G,ie,!1,[1,1]),n,c,Q),K||(B(),K=!0);const Se=WY(ge,{handle:F,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:j,doc:z,lib:d,flowId:f,nodeLookup:c});U=Se.handleDomNode,I=Se.connection,H=zLe(!!F,Se.isValid);const Ee=c.get(i),He=Ee?Ec(Ee,Q,Ke.Left,!0):ae.from,Oe={...ae,from:He,isValid:H,to:Se.toHandle&&H?c0({x:Se.toHandle.x,y:Se.toHandle.y},ie):G,toHandle:Se.toHandle,toPosition:H&&Se.toHandle?Se.toHandle.position:I5[Q.position],toNode:Se.toHandle?c.get(Se.toHandle.nodeId):null,pointer:G};_(Oe),ae=Oe}function se(ge){if(!("touches"in ge&&ge.touches.length>0)){if($){(F||U)&&I&&H&&(w==null||w(I));const{inProgress:ie,...Se}=ae,Ee={...Se,toPosition:ae.toHandle?ae.toPosition:null};S==null||S(ge,Ee),a&&(C==null||C(ge,Ee))}v(),cancelAnimationFrame(L),K=!1,H=!1,I=null,U=null,z.removeEventListener("mousemove",ee),z.removeEventListener("mouseup",se),z.removeEventListener("touchmove",ee),z.removeEventListener("touchend",se)}}z.addEventListener("mousemove",ee),z.addEventListener("mouseup",se),z.addEventListener("touchmove",ee),z.addEventListener("touchend",se)}function WY(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:d=GY,nodeLookup:m}){const f=a==="target",g=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Ua(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=XY(void 0,S),_=S.getAttribute("data-nodeid"),k=S.getAttribute("data-handleid"),O=S.classList.contains("connectable"),A=S.classList.contains("connectableend");if(!_||!C)return j;const T={source:f?_:r,sourceHandle:f?k:i,target:f?r:_,targetHandle:f?i:k};j.connection=T;const z=O&&A&&(n===_f.Strict?f&&C==="source"||!f&&C==="target":_!==r||k!==i);j.isValid=z&&d(T),j.toHandle=YY(_,C,k,m,n,!0)}return j}const dN={onPointerDown:$Le,isValid:WY};function BLe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Mi(e);function a({translateExtent:l,width:c,height:d,zoomStep:m=1,pannable:f=!0,zoomable:g=!0,inversePan:v=!1}){const b=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const k=n(),O=_.sourceEvent.ctrlKey&&lp()?10:1,A=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*m,T=k[2]*Math.pow(2,A*O);t.scaleTo(T)};let w=[0,0];const S=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(w=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},j=_=>{const k=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const O=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.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),P={x:k[0]-A[0]*T,y:k[1]-A[1]*T},z=[[0,0],[c,d]];t.setViewportConstrained({x:P.x,y:P.y,zoom:k[2]},z,l)},C=EY().on("start",S).on("zoom",f?j:null).on("zoom.wheel",g?b:null);i.call(C,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:Ia}}const Jb=e=>({x:e.x,y:e.y,zoom:e.k}),HE=({x:e,y:t,zoom:n})=>Wb.translate(e,t).scale(n),Ld=(e,t)=>e.target.closest(`.${t}`),QY=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),FLe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,qE=(e,t=0,n=FLe,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},ZY=e=>{const t=e.ctrlKey&&lp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function ULe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return m=>{if(Ld(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(m.ctrlKey&&o){const S=Ia(m),j=ZY(m),C=f*Math.pow(2,j);r.scaleTo(n,C,S,m);return}const g=m.deltaMode===1?20:1;let v=i===ec.Vertical?0:m.deltaX*g,b=i===ec.Horizontal?0:m.deltaY*g;!lp()&&m.shiftKey&&i!==ec.Vertical&&(v=m.deltaY*g,b=0),r.translateBy(n,-(v/f)*a,-(b/f)*a,{internal:!0});const w=Jb(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(m,w),e.panScrollTimeout=setTimeout(()=>{d==null||d(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(m,w))}}function HLe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Ld(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function qLe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=Jb(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 VLe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&QY(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,Jb(a.transform)))}}function KLe({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&&QY(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=Jb(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function YLe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:d,connectionInProgress:m}){return f=>{var S;const g=e||t,v=n&&f.ctrlKey,b=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Ld(f,`${d}-flow__node`)||Ld(f,`${d}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||m&&!b||Ld(f,l)&&b||Ld(f,c)&&(!b||i&&b&&!e)||!n&&f.ctrlKey&&b)return!1;if(!n&&f.type==="touchstart"&&((S=f.touches)==null?void 0:S.length)>1)return f.preventDefault(),!1;if(!g&&!i&&!v&&b||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||b)&&w}}function XLe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),f=EY().scaleExtent([t,n]).translateExtent(r),g=Mi(e).call(f);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");f.wheelDelta(ZY);function w(F,D){return g?new Promise(X=>{f==null||f.interpolate((D==null?void 0:D.interpolate)==="linear"?fs:Iy).transform(qE(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>X(!0)),F)}):Promise.resolve(!1)}function S({noWheelClassName:F,noPanClassName:D,onPaneContextMenu:X,userSelectionActive:R,panOnScroll:q,panOnDrag:$,panOnScrollMode:V,panOnScrollSpeed:G,preventScrolling:K,zoomOnPinch:I,zoomOnScroll:H,zoomOnDoubleClick:U,zoomActivationKeyPressed:B,lib:Q,onTransformChange:Z,connectionInProgress:te,paneClickDistance:ae,selectionOnDrag:re}){R&&!d.isZoomingOrPanning&&j();const ee=q&&!B&&!R;f.clickDistance(re?1/0:!Fa(ae)||ae<0?0:ae);const se=ee?ULe({zoomPanValues:d,noWheelClassName:F,d3Selection:g,d3Zoom:f,panOnScrollMode:V,panOnScrollSpeed:G,zoomOnPinch:I,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):HLe({noWheelClassName:F,preventScrolling:K,d3ZoomHandler:v});if(g.on("wheel.zoom",se,{passive:!1}),!R){const ie=qLe({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:o});f.on("start",ie);const Se=VLe({zoomPanValues:d,panOnDrag:$,onPaneContextMenu:!!X,onPanZoom:a,onTransformChange:Z});f.on("zoom",Se);const Ee=KLe({zoomPanValues:d,panOnDrag:$,panOnScroll:q,onPaneContextMenu:X,onPanZoomEnd:l,onDraggingChange:c});f.on("end",Ee)}const ge=YLe({zoomActivationKeyPressed:B,panOnDrag:$,zoomOnScroll:H,panOnScroll:q,zoomOnDoubleClick:U,zoomOnPinch:I,userSelectionActive:R,noPanClassName:D,noWheelClassName:F,lib:Q,connectionInProgress:te});f.filter(ge),U?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function j(){f.on("zoom",null)}async function C(F,D,X){const R=HE(F),q=f==null?void 0:f.constrain()(R,D,X);return q&&await w(q),new Promise($=>$(q))}async function _(F,D){const X=HE(F);return await w(X,D),new Promise(R=>R(X))}function k(F){if(g){const D=HE(F),X=g.property("__zoom");(X.k!==F.zoom||X.x!==F.x||X.y!==F.y)&&(f==null||f.transform(g,D,null,{sync:!0}))}}function O(){const F=g?jY(g.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function A(F,D){return g?new Promise(X=>{f==null||f.interpolate((D==null?void 0:D.interpolate)==="linear"?fs:Iy).scaleTo(qE(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>X(!0)),F)}):Promise.resolve(!1)}function T(F,D){return g?new Promise(X=>{f==null||f.interpolate((D==null?void 0:D.interpolate)==="linear"?fs:Iy).scaleBy(qE(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>X(!0)),F)}):Promise.resolve(!1)}function P(F){f==null||f.scaleExtent(F)}function z(F){f==null||f.translateExtent(F)}function L(F){const D=!Fa(F)||F<0?0:F;f==null||f.clickDistance(D)}return{update:S,destroy:j,setViewport:_,setViewportConstrained:C,getViewport:O,scaleTo:A,scaleBy:T,setScaleExtent:P,setTranslateExtent:z,syncViewport:k,setClickDistance:L}}var Of;(function(e){e.Line="line",e.Handle="handle"})(Of||(Of={}));function GLe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(c[0]=c[0]*-1),l&&a&&(c[1]=c[1]*-1),c}function G5(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 vl(e,t){return Math.max(0,t-e)}function yl(e,t){return Math.max(0,e-t)}function Sy(e,t,n){return Math.max(0,t-e,e-n)}function W5(e,t){return e?!t:t}function WLe(e,t,n,r,i,a,o,l){let{affectsX:c,affectsY:d}=t;const{isHorizontal:m,isVertical:f}=t,g=m&&f,{xSnapped:v,ySnapped:b}=n,{minWidth:w,maxWidth:S,minHeight:j,maxHeight:C}=r,{x:_,y:k,width:O,height:A,aspectRatio:T}=e;let P=Math.floor(m?v-e.pointerX:0),z=Math.floor(f?b-e.pointerY:0);const L=O+(c?-P:P),F=A+(d?-z:z),D=-a[0]*O,X=-a[1]*A;let R=Sy(L,w,S),q=Sy(F,j,C);if(o){let G=0,K=0;c&&P<0?G=vl(_+P+D,o[0][0]):!c&&P>0&&(G=yl(_+L+D,o[1][0])),d&&z<0?K=vl(k+z+X,o[0][1]):!d&&z>0&&(K=yl(k+F+X,o[1][1])),R=Math.max(R,G),q=Math.max(q,K)}if(l){let G=0,K=0;c&&P>0?G=yl(_+P,l[0][0]):!c&&P<0&&(G=vl(_+L,l[1][0])),d&&z>0?K=yl(k+z,l[0][1]):!d&&z<0&&(K=vl(k+F,l[1][1])),R=Math.max(R,G),q=Math.max(q,K)}if(i){if(m){const G=Sy(L/T,j,C)*T;if(R=Math.max(R,G),o){let K=0;!c&&!d||c&&!d&&g?K=yl(k+X+L/T,o[1][1])*T:K=vl(k+X+(c?P:-P)/T,o[0][1])*T,R=Math.max(R,K)}if(l){let K=0;!c&&!d||c&&!d&&g?K=vl(k+L/T,l[1][1])*T:K=yl(k+(c?P:-P)/T,l[0][1])*T,R=Math.max(R,K)}}if(f){const G=Sy(F*T,w,S)/T;if(q=Math.max(q,G),o){let K=0;!c&&!d||d&&!c&&g?K=yl(_+F*T+D,o[1][0])/T:K=vl(_+(d?z:-z)*T+D,o[0][0])/T,q=Math.max(q,K)}if(l){let K=0;!c&&!d||d&&!c&&g?K=vl(_+F*T,l[1][0])/T:K=yl(_+(d?z:-z)*T,l[0][0])/T,q=Math.max(q,K)}}}z=z+(z<0?q:-q),P=P+(P<0?R:-R),i&&(g?L>F*T?z=(W5(c,d)?-P:P)/T:P=(W5(c,d)?-z:z)*T:m?(z=P/T,d=c):(P=z*T,c=d));const $=c?_+P:_,V=d?k+z:k;return{width:O+(c?-P:P),height:A+(d?-z:z),x:a[0]*P*(c?-1:1)+$,y:a[1]*z*(d?-1:1)+V}}const JY={width:0,height:0,x:0,y:0},QLe={...JY,pointerX:0,pointerY:0,aspectRatio:1};function ZLe(e){return[[0,0],[e.measured.width,e.measured.height]]}function JLe(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,c=n[1]*o;return[[r-l,i-c],[r+a-l,i+o-c]]}function e3e({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Mi(e);let o={controlDirection:G5("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:f,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:w,shouldResize:S}){let j={...JY},C={...QLe};o={boundaries:m,resizeDirection:g,keepAspectRatio:f,controlDirection:G5(d)};let _,k=null,O=[],A,T,P,z=!1;const L=pY().on("start",F=>{const{nodeLookup:D,transform:X,snapGrid:R,snapToGrid:q,nodeOrigin:$,paneDomNode:V}=n();if(_=D.get(t),!_)return;k=(V==null?void 0:V.getBoundingClientRect())??null;const{xSnapped:G,ySnapped:K}=Tm(F.sourceEvent,{transform:X,snapGrid:R,snapToGrid:q,containerBounds:k});j={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},C={...j,pointerX:G,pointerY:K,aspectRatio:j.width/j.height},A=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(A=D.get(_.parentId),T=A&&_.extent==="parent"?ZLe(A):void 0),O=[],P=void 0;for(const[I,H]of D)if(H.parentId===t&&(O.push({id:I,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const U=JLe(H,_,H.origin??$);P?P=[[Math.min(U[0][0],P[0][0]),Math.min(U[0][1],P[0][1])],[Math.max(U[1][0],P[1][0]),Math.max(U[1][1],P[1][1])]]:P=U}v==null||v(F,{...j})}).on("drag",F=>{const{transform:D,snapGrid:X,snapToGrid:R,nodeOrigin:q}=n(),$=Tm(F.sourceEvent,{transform:D,snapGrid:X,snapToGrid:R,containerBounds:k}),V=[];if(!_)return;const{x:G,y:K,width:I,height:H}=j,U={},B=_.origin??q,{width:Q,height:Z,x:te,y:ae}=WLe(C,o.controlDirection,$,o.boundaries,o.keepAspectRatio,B,T,P),re=Q!==I,ee=Z!==H,se=te!==G&&re,ge=ae!==K&&ee;if(!se&&!ge&&!re&&!ee)return;if((se||ge||B[0]===1||B[1]===1)&&(U.x=se?te:j.x,U.y=ge?ae:j.y,j.x=U.x,j.y=U.y,O.length>0)){const He=te-G,Oe=ae-K;for(const at of O)at.position={x:at.position.x-He+B[0]*(Q-I),y:at.position.y-Oe+B[1]*(Z-H)},V.push(at)}if((re||ee)&&(U.width=re&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Q:j.width,U.height=ee&&(!o.resizeDirection||o.resizeDirection==="vertical")?Z:j.height,j.width=U.width,j.height=U.height),A&&_.expandParent){const He=B[0]*(U.width??0);U.x&&U.x<He&&(j.x=He,C.x=C.x-(U.x-He));const Oe=B[1]*(U.height??0);U.y&&U.y<Oe&&(j.y=Oe,C.y=C.y-(U.y-Oe))}const ie=GLe({width:j.width,prevWidth:I,height:j.height,prevHeight:H,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),Se={...j,direction:ie};(S==null?void 0:S(F,Se))!==!1&&(z=!0,b==null||b(F,Se),r(U,V))}).on("end",F=>{z&&(w==null||w(F,{...j}),i==null||i({...j}),z=!1)});a.call(L)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}const t3e={},Q5=e=>{let t;const n=new Set,r=(m,f)=>{const g=typeof m=="function"?m(t):m;if(!Object.is(g,t)){const v=t;t=f??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,v))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(t3e?"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,c);return c},n3e=e=>e?Q5(e):Q5,{useDebugValue:r3e}=Ce,{useSyncExternalStoreWithSelector:i3e}=Sye,a3e=e=>e;function eX(e,t=a3e,n){const r=i3e(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return r3e(r),r}const Z5=(e,t)=>{const n=n3e(e),r=(i,a=t)=>eX(n,i,a);return Object.assign(r,n),r},o3e=(e,t)=>e?Z5(e,t):Z5;function _n(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 ew=y.createContext(null),s3e=ew.Provider,tX=Ao.error001();function Rt(e,t){const n=y.useContext(ew);if(n===null)throw new Error(tX);return eX(n,e,t)}function Cn(){const e=y.useContext(ew);if(e===null)throw new Error(tX);return y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const J5={display:"none"},l3e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},nX="react-flow__node-desc",rX="react-flow__edge-desc",u3e="react-flow__aria-live",c3e=e=>e.ariaLiveMessage,d3e=e=>e.ariaLabelConfig;function f3e({rfId:e}){const t=Rt(c3e);return h.jsx("div",{id:`${u3e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:l3e,children:t})}function h3e({rfId:e,disableKeyboardA11y:t}){const n=Rt(d3e);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${nX}-${e}`,style:J5,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${rX}-${e}`,style:J5,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(f3e,{rfId:e})]})}const tw=y.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return h.jsx("div",{className:Jn(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});tw.displayName="Panel";function m3e({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(tw,{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:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const p3e=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}},jy=e=>e.id;function g3e(e,t){return _n(e.selectedNodes.map(jy),t.selectedNodes.map(jy))&&_n(e.selectedEdges.map(jy),t.selectedEdges.map(jy))}function v3e({onSelectionChange:e}){const t=Cn(),{selectedNodes:n,selectedEdges:r}=Rt(p3e,g3e);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 y3e=e=>!!e.onSelectionChangeHandlers;function x3e({onSelectionChange:e}){const t=Rt(y3e);return e||t?h.jsx(v3e,{onSelectionChange:e}):null}const iX=[0,0],b3e={x:0,y:0,zoom:1},w3e=["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"],e$=[...w3e,"rfId"],S3e=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}),t$={translateExtent:ap,nodeOrigin:iX,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function j3e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Rt(S3e,_n),d=Cn();y.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{m.current=t$,l()}),[]);const m=y.useRef(t$);return y.useEffect(()=>{for(const f of e$){const g=e[f],v=m.current[f];g!==v&&(typeof e[f]>"u"||(f==="nodes"?t(g):f==="edges"?n(g):f==="minZoom"?r(g):f==="maxZoom"?i(g):f==="translateExtent"?a(g):f==="nodeExtent"?o(g):f==="ariaLabelConfig"?d.setState({ariaLabelConfig:fLe(g)}):f==="fitView"?d.setState({fitViewQueued:g}):f==="fitViewOptions"?d.setState({fitViewOptions:g}):d.setState({[f]:g})))}m.current=e},e$.map(f=>e[f])),null}function n$(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function E3e(e){var r;const[t,n]=y.useState(e==="system"?null:e);return y.useEffect(()=>{if(e!=="system"){n(e);return}const i=n$(),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=n$())!=null&&r.matches?"dark":"light"}const r$=typeof document<"u"?document:null;function up(e=null,t={target:r$,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(f=>typeof f=="string").map(f=>f.replace("+",`
`).replace(`

`,`
+`).split(`
`)),m=d.reduce((f,g)=>f.concat(...g),[]);return[d,m]}return[[],[]]},[e]);return y.useEffect(()=>{const c=(t==null?void 0:t.target)??r$,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)&&LY(v))return!1;const w=a$(v.code,l);if(a.current.add(v[w]),i$(o,a.current,!1)){const C=((j=(S=v.composedPath)==null?void 0:S.call(v))==null?void 0:j[0])||v.target,_=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!_)&&v.preventDefault(),r(!0)}},f=v=>{const b=a$(v.code,l);i$(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 c==null||c.addEventListener("keydown",m),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{c==null||c.removeEventListener("keydown",m),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function i$(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function a$(e,t){return t.includes(e)?"code":"key"}const _3e=()=>{const e=Cn();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(),c=S2(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{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:c}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-c},m=n.snapGrid??i,f=n.snapToGrid??a;return wg(d,r,f,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=c0(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function aX(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 c of o)C3e(c,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 C3e(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 N3e(e,t){return aX(e,t)}function k3e(e,t){return aX(e,t)}function Du(e,t){return{id:e,type:"select",selected:t}}function zd(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(Du(a.id,o)))}return r}function o$({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),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===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 s$(e){return{id:e.id,type:"remove"}}const l$=e=>nLe(e),A3e=e=>AY(e);function oX(e){return y.forwardRef(e)}const O3e=typeof window<"u"?y.useLayoutEffect:y.useEffect;function u$(e){const[t,n]=y.useState(BigInt(0)),[r]=y.useState(()=>T3e(()=>n(i=>i+BigInt(1))));return O3e(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function T3e(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const sX=y.createContext(null);function P3e({children:e}){const t=Cn(),n=y.useCallback(l=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:m,onNodesChange:f,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let w=c;for(const j of l)w=typeof j=="function"?j(w):j;let S=o$({items:w,lookup:g});for(const j of b.values())S=j(S);m&&d(w),S.length>0?f==null||f(S):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:j,nodes:C,setNodes:_}=t.getState();j&&_(C)})},[]),r=u$(n),i=y.useCallback(l=>{const{edges:c=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:f,edgeLookup:g}=t.getState();let v=c;for(const b of l)v=typeof b=="function"?b(v):b;m?d(v):f&&f(o$({items:v,lookup:g}))},[]),a=u$(i),o=y.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return h.jsx(sX.Provider,{value:o,children:e})}function M3e(){const e=y.useContext(sX);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const R3e=e=>!!e.panZoom;function nw(){const e=_3e(),t=Cn(),n=M3e(),r=Rt(R3e),i=y.useMemo(()=>{const a=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var j,C;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=l$(f)?f:g.get(f.id),w=b.parentId?DY(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=(f,g,v={replace:!1})=>{o(b=>b.map(w=>{if(w.id===f){const S=typeof g=="function"?g(w):g;return v.replace&&l$(S)?S:{...w,...S}}return w}))},m=(f,g,v={replace:!1})=>{l(b=>b.map(w=>{if(w.id===f){const S=typeof g=="function"?g(w):g;return v.replace&&A3e(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var g;return(g=a(f))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(g=>({...g}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const g=Array.isArray(f)?f:[f];n.nodeQueue.push(v=>[...v,...g])},addEdges:f=>{const g=Array.isArray(f)?f:[f];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:f=[],edges:g=[],transform:v}=t.getState(),[b,w,S]=v;return{nodes:f.map(j=>({...j})),edges:g.map(j=>({...j})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:f=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:j,triggerEdgeChanges:C,onDelete:_,onBeforeDelete:k}=t.getState(),{nodes:O,edges:A}=await sLe({nodesToRemove:f,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:k}),T=A.length>0,P=O.length>0;if(T){const z=A.map(s$);S==null||S(A),C(z)}if(P){const z=O.map(s$);w==null||w(O),j(z)}return(P||T)&&(_==null||_({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(f,g=!0,v)=>{const b=z5(f),w=b?f:c(f),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===f.id||!C.internals.positionAbsolute))return!1;const _=kf(S?j:C),k=sp(_,w);return g&&k>0||k>=_.width*_.height||k>=w.width*w.height}):[]},isNodeIntersecting:(f,g,v=!0)=>{const w=z5(f)?f:c(f);if(!w)return!1;const S=sp(w,g);return v&&S>0||S>=g.width*g.height||S>=w.width*w.height},updateNode:d,updateNodeData:(f,g,v={replace:!1})=>{d(f,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},updateEdge:m,updateEdgeData:(f,g,v={replace:!1})=>{m(f,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},getNodesBounds:f=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return rLe(f,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:f,id:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${f}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:f,handleId:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${f?g?`-${f}-${g}`:`-${f}`:""}`))==null?void 0:b.values())??[])},fitView:async f=>{const g=t.getState().fitViewResolver??dLe();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return y.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const c$=e=>e.selected,D3e=typeof window<"u"?window:void 0;function I3e({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Cn(),{deleteElements:r}=nw(),i=up(e,{actInsideInputWithModifier:!1}),a=up(t,{target:D3e});y.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(c$),edges:o.filter(c$)}),n.setState({nodesSelectionActive:!1})}},[i]),y.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function L3e(e){const t=Cn();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=j2(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Ao.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 rw={position:"absolute",width:"100%",height:"100%",top:0,left:0},z3e=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function $3e({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=ec.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:d,minZoom:m,maxZoom:f,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:S,onViewportChange:j,isControlledViewport:C,paneClickDistance:_,selectionOnDrag:k}){const O=Cn(),A=y.useRef(null),{userSelectionActive:T,lib:P,connectionInProgress:z}=Rt(z3e,_n),L=up(g),F=y.useRef();L3e(A);const D=y.useCallback(X=>{j==null||j({x:X[0],y:X[1],zoom:X[2]}),C||O.setState({transform:X})},[j,C]);return y.useEffect(()=>{if(A.current){F.current=XLe({domNode:A.current,minZoom:m,maxZoom:f,translateExtent:d,viewport:c,onDraggingChange:$=>O.setState(V=>V.paneDragging===$?V:{paneDragging:$}),onPanZoomStart:($,V)=>{const{onViewportChangeStart:G,onMoveStart:K}=O.getState();K==null||K($,V),G==null||G(V)},onPanZoom:($,V)=>{const{onViewportChange:G,onMove:K}=O.getState();K==null||K($,V),G==null||G(V)},onPanZoomEnd:($,V)=>{const{onViewportChangeEnd:G,onMoveEnd:K}=O.getState();K==null||K($,V),G==null||G(V)}});const{x:X,y:R,zoom:q}=F.current.getViewport();return O.setState({panZoom:F.current,transform:[X,R,q],domNode:A.current.closest(".react-flow")}),()=>{var $;($=F.current)==null||$.destroy()}}},[]),y.useEffect(()=>{var X;(X=F.current)==null||X.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:L,preventScrolling:v,noPanClassName:S,userSelectionActive:T,noWheelClassName:w,lib:P,onTransformChange:D,connectionInProgress:z,selectionOnDrag:k,paneClickDistance:_})},[e,t,n,r,i,a,o,l,L,v,S,T,w,P,D,z,k,_]),h.jsx("div",{className:"react-flow__renderer",ref:A,style:rw,children:b})}const B3e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function F3e(){const{userSelectionActive:e,userSelectionRect:t}=Rt(B3e,_n);return e&&t?h.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 VE=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},U3e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function H3e({isSelecting:e,selectionKeyPressed:t,selectionMode:n=op.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:m,onPaneMouseEnter:f,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const w=Cn(),{userSelectionActive:S,elementsSelectable:j,dragging:C,connectionInProgress:_}=Rt(U3e,_n),k=j&&(e||S),O=y.useRef(null),A=y.useRef(),T=y.useRef(new Set),P=y.useRef(new Set),z=y.useRef(!1),L=G=>{if(z.current||_){z.current=!1;return}c==null||c(G),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},F=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}d==null||d(G)},D=m?G=>m(G):void 0,X=G=>{z.current&&(G.stopPropagation(),z.current=!1)},R=G=>{var Z,te;const{domNode:K}=w.getState();if(A.current=K==null?void 0:K.getBoundingClientRect(),!A.current)return;const I=G.target===O.current;if(!I&&!!G.target.closest(".nokey")||!e||!(a&&I||t)||G.button!==0||!G.isPrimary)return;(te=(Z=G.target)==null?void 0:Z.setPointerCapture)==null||te.call(Z,G.pointerId),z.current=!1;const{x:B,y:Q}=Ua(G.nativeEvent,A.current);w.setState({userSelectionRect:{width:0,height:0,startX:B,startY:Q,x:B,y:Q}}),I||(G.stopPropagation(),G.preventDefault())},q=G=>{const{userSelectionRect:K,transform:I,nodeLookup:H,edgeLookup:U,connectionLookup:B,triggerNodeChanges:Q,triggerEdgeChanges:Z,defaultEdgeOptions:te,resetSelectedElements:ae}=w.getState();if(!A.current||!K)return;const{x:re,y:ee}=Ua(G.nativeEvent,A.current),{startX:se,startY:ge}=K;if(!z.current){const Oe=t?0:i;if(Math.hypot(re-se,ee-ge)<=Oe)return;ae(),o==null||o(G)}z.current=!0;const ie={startX:se,startY:ge,x:re<se?re:se,y:ee<ge?ee:ge,width:Math.abs(re-se),height:Math.abs(ee-ge)},Se=T.current,Ee=P.current;T.current=new Set(w2(H,ie,I,n===op.Partial,!0).map(Oe=>Oe.id)),P.current=new Set;const He=(te==null?void 0:te.selectable)??!0;for(const Oe of T.current){const at=B.get(Oe);if(at)for(const{edgeId:Je}of at.values()){const We=U.get(Je);We&&(We.selectable??He)&&P.current.add(Je)}}if(!$5(Se,T.current)){const Oe=zd(H,T.current,!0);Q(Oe)}if(!$5(Ee,P.current)){const Oe=zd(U,P.current);Z(Oe)}w.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},$=G=>{var K,I;G.button===0&&((I=(K=G.target)==null?void 0:K.releasePointerCapture)==null||I.call(K,G.pointerId),!S&&G.target===O.current&&w.getState().userSelectionRect&&(L==null||L(G)),w.setState({userSelectionActive:!1,userSelectionRect:null}),z.current&&(l==null||l(G),w.setState({nodesSelectionActive:T.current.size>0})))},V=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:Jn(["react-flow__pane",{draggable:V,dragging:C,selection:e}]),onClick:k?void 0:VE(L,O),onContextMenu:VE(F,O),onWheel:VE(D,O),onPointerEnter:k?void 0:f,onPointerMove:k?q:g,onPointerUp:k?$:void 0,onPointerDownCapture:k?R:void 0,onClickCapture:k?X:void 0,onPointerLeave:v,ref:O,style:rw,children:[b,h.jsx(F3e,{})]})}function fN({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),d=l.get(e);if(!d){c==null||c("012",Ao.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 lX({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=Cn(),[c,d]=y.useState(!1),m=y.useRef();return y.useEffect(()=>{m.current=RLe({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{fN({id:f,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 f;(f=m.current)==null||f.destroy()}},[n,r,t,a,e,i,o]),c}const q3e=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function uX(){const e=Cn();return y.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:d,nodeOrigin:m}=e.getState(),f=new Map,g=q3e(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=bg(C,a));const{position:_,positionAbsolute:k}=OY({nodeId:j.id,nextPosition:C,nodeLookup:d,nodeExtent:r,nodeOrigin:m,onError:l});j.position=_,j.internals.positionAbsolute=k,f.set(j.id,j)}c(f)},[])}const A2=y.createContext(null),V3e=A2.Provider;A2.Consumer;const cX=()=>y.useContext(A2),K3e=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Y3e=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:d}=o,m=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.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 X3e({type:e="source",position:t=Ke.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:d,onMouseDown:m,onTouchStart:f,...g},v){var q,$;const b=o||null,w=e==="target",S=Cn(),j=cX(),{connectOnClick:C,noPanClassName:_,rfId:k}=Rt(K3e,_n),{connectingFrom:O,connectingTo:A,clickConnecting:T,isPossibleEndHandle:P,connectionInProcess:z,clickConnectionInProcess:L,valid:F}=Rt(Y3e(j,b,e),_n);j||($=(q=S.getState()).onError)==null||$.call(q,"010",Ao.error010());const D=V=>{const{defaultEdgeOptions:G,onConnect:K,hasDefaultEdges:I}=S.getState(),H={...G,...V};if(I){const{edges:U,setEdges:B}=S.getState();B(yLe(H,U))}K==null||K(H),l==null||l(H)},X=V=>{if(!j)return;const G=zY(V.nativeEvent);if(i&&(G&&V.button===0||!G)){const K=S.getState();dN.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:w,handleId:b,nodeId:j,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:(...I)=>{var H,U;return(U=(H=S.getState()).onConnectEnd)==null?void 0:U.call(H,...I)},updateConnection:K.updateConnection,onConnect:D,isValidConnection:n||((...I)=>{var H,U;return((U=(H=S.getState()).isValidConnection)==null?void 0:U.call(H,...I))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}G?m==null||m(V):f==null||f(V)},R=V=>{const{onClickConnectStart:G,onClickConnectEnd:K,connectionClickStartHandle:I,connectionMode:H,isValidConnection:U,lib:B,rfId:Q,nodeLookup:Z,connection:te}=S.getState();if(!j||!I&&!i)return;if(!I){G==null||G(V.nativeEvent,{nodeId:j,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:j,type:e,id:b}});return}const ae=IY(V.target),re=n||U,{connection:ee,isValid:se}=dN.isValid(V.nativeEvent,{handle:{nodeId:j,id:b,type:e},connectionMode:H,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:re,flowId:Q,doc:ae,lib:B,nodeLookup:Z});se&&ee&&D(ee);const ge=structuredClone(te);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,K==null||K(V,ge),S.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":b,"data-nodeid":j,"data-handlepos":t,"data-id":`${k}-${j}-${b}-${e}`,className:Jn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,d,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:T,connectingfrom:O,connectingto:A,valid:F,connectionindicator:r&&(!z||P)&&(z||L?a:i)}]),onMouseDown:X,onTouchStart:X,onClick:C?R:void 0,ref:v,...g,children:c})}const Tf=y.memo(oX(X3e));function G3e({data:e,isConnectable:t,sourcePosition:n=Ke.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Tf,{type:"source",position:n,isConnectable:t})]})}function W3e({data:e,isConnectable:t,targetPosition:n=Ke.Top,sourcePosition:r=Ke.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Tf,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Tf,{type:"source",position:r,isConnectable:t})]})}function Q3e(){return null}function Z3e({data:e,isConnectable:t,targetPosition:n=Ke.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Tf,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const d0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},d$={input:G3e,default:W3e,output:Z3e,group:Q3e};function J3e(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 eze=e=>{const{width:t,height:n,x:r,y:i}=xg(e.nodeLookup,{filter:a=>!!a.selected});return{width:Fa(t)?t:null,height:Fa(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 tze({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Cn(),{width:i,height:a,transformString:o,userSelectionActive:l}=Rt(eze,_n),c=uX(),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(lX({nodeRef:d,disabled:!m}),!m)return null;const f=e?v=>{const b=r.getState().nodes.filter(w=>w.selected);e(v,b)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(d0,v.key)&&(v.preventDefault(),c({direction:d0[v.key],factor:v.shiftKey?4:1}))};return h.jsx("div",{className:Jn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:h.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const f$=typeof window<"u"?window:void 0,nze=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function dX({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:m,selectionMode:f,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:k,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:P,defaultViewport:z,translateExtent:L,minZoom:F,maxZoom:D,preventScrolling:X,onSelectionContextMenu:R,noWheelClassName:q,noPanClassName:$,disableKeyboardA11y:V,onViewportChange:G,isControlledViewport:K}){const{nodesSelectionActive:I,userSelectionActive:H}=Rt(nze,_n),U=up(d,{target:f$}),B=up(w,{target:f$}),Q=B||P,Z=B||k,te=m&&Q!==!0,ae=U||H||te;return I3e({deleteKeyCode:c,multiSelectionKeyCode:b}),h.jsx($3e,{onPaneContextMenu:a,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:Z,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:!U&&Q,defaultViewport:z,translateExtent:L,minZoom:F,maxZoom:D,zoomActivationKeyCode:S,preventScrolling:X,noWheelClassName:q,noPanClassName:$,onViewportChange:G,isControlledViewport:K,paneClickDistance:l,selectionOnDrag:te,children:h.jsxs(H3e,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:Q,isSelecting:!!ae,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:te,children:[e,I&&h.jsx(tze,{onSelectionContextMenu:R,noPanClassName:$,disableKeyboardA11y:V})]})})}dX.displayName="FlowRenderer";const rze=y.memo(dX),ize=e=>t=>e?w2(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 aze(e){return Rt(y.useCallback(ize(e),[e]),_n)}const oze=e=>e.updateNodeInternals;function sze(){const e=Rt(oze),[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 lze({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Cn(),a=y.useRef(null),o=y.useRef(null),l=y.useRef(e.sourcePosition),c=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 f=d.current!==t,g=l.current!==e.sourcePosition,v=c.current!==e.targetPosition;(f||g||v)&&(d.current=t,l.current=e.sourcePosition,c.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 uze({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:d,nodesFocusable:m,resizeObserver:f,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:w,nodeTypes:S,nodeClickDistance:j,onError:C}){const{node:_,internals:k,isParent:O}=Rt(re=>{const ee=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:se}},_n);let A=_.type||"default",T=(S==null?void 0:S[A])||d$[A];T===void 0&&(C==null||C("003",Ao.error003(A)),A="default",T=(S==null?void 0:S.default)||d$.default);const P=!!(_.draggable||l&&typeof _.draggable>"u"),z=!!(_.selectable||c&&typeof _.selectable>"u"),L=!!(_.connectable||d&&typeof _.connectable>"u"),F=!!(_.focusable||m&&typeof _.focusable>"u"),D=Cn(),X=RY(_),R=lze({node:_,nodeType:A,hasDimensions:X,resizeObserver:f}),q=lX({nodeRef:R,disabled:_.hidden||!P,noDragClassName:g,handleSelector:_.dragHandle,nodeId:e,isSelectable:z,nodeClickDistance:j}),$=uX();if(_.hidden)return null;const V=Is(_),G=J3e(_),K=z||P||t||n||r||i,I=n?re=>n(re,{...k.userNode}):void 0,H=r?re=>r(re,{...k.userNode}):void 0,U=i?re=>i(re,{...k.userNode}):void 0,B=a?re=>a(re,{...k.userNode}):void 0,Q=o?re=>o(re,{...k.userNode}):void 0,Z=re=>{const{selectNodesOnDrag:ee,nodeDragThreshold:se}=D.getState();z&&(!ee||!P||se>0)&&fN({id:e,store:D,nodeRef:R}),t&&t(re,{...k.userNode})},te=re=>{if(!(LY(re.nativeEvent)||b)){if(_Y.includes(re.key)&&z){const ee=re.key==="Escape";fN({id:e,store:D,unselect:ee,nodeRef:R})}else if(P&&_.selected&&Object.prototype.hasOwnProperty.call(d0,re.key)){re.preventDefault();const{ariaLabelConfig:ee}=D.getState();D.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),$({direction:d0[re.key],factor:re.shiftKey?4:1})}}},ae=()=>{var Ee;if(b||!((Ee=R.current)!=null&&Ee.matches(":focus-visible")))return;const{transform:re,width:ee,height:se,autoPanOnNodeFocus:ge,setCenter:ie}=D.getState();if(!ge)return;w2(new Map([[e,_]]),{x:0,y:0,width:ee,height:se},re,!0).length>0||ie(_.position.x+V.width/2,_.position.y+V.height/2,{zoom:re[2]})};return h.jsx("div",{className:Jn(["react-flow__node",`react-flow__node-${A}`,{[v]:P},_.className,{selected:_.selected,selectable:z,parent:O,draggable:P,dragging:q}]),ref:R,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:X?"visible":"hidden",..._.style,...G},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:H,onMouseLeave:U,onContextMenu:B,onClick:Z,onDoubleClick:Q,onKeyDown:F?te:void 0,tabIndex:F?0:void 0,onFocus:F?ae:void 0,role:_.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${nX}-${w}`,"aria-label":_.ariaLabel,..._.domAttributes,children:h.jsx(V3e,{value:e,children:h.jsx(T,{id:e,data:_.data,type:A,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:_.selected??!1,selectable:z,draggable:P,deletable:_.deletable??!0,isConnectable:L,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:q,dragHandle:_.dragHandle,zIndex:k.z,parentId:_.parentId,...V})})})}var cze=y.memo(uze);const dze=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function fX(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Rt(dze,_n),o=aze(e.onlyRenderVisibleElements),l=sze();return h.jsx("div",{className:"react-flow__nodes",style:rw,children:o.map(c=>h.jsx(cze,{id:c,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},c))})}fX.displayName="NodeRenderer";const fze=y.memo(fX);function hze(e){return Rt(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&&pLe({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),_n)}const mze=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},pze=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},h$={[Cf.Arrow]:mze,[Cf.ArrowClosed]:pze};function gze(e){const t=Cn();return y.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(h$,e)?h$[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Ao.error009(e)),null)},[e])}const vze=({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 c=gze(t);return c?h.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:h.jsx(c,{color:n,strokeWidth:o})}):null},hX=({defaultColor:e,rfId:t})=>{const n=Rt(a=>a.edges),r=Rt(a=>a.defaultEdgeOptions),i=y.useMemo(()=>jLe(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?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:i.map(a=>h.jsx(vze,{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};hX.displayName="MarkerDefinitions";var yze=y.memo(hX);function mX({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...m}){const[f,g]=y.useState({x:1,y:0,width:0,height:0}),v=Jn(["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?h.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:v,visibility:f.width?"visible":"hidden",...m,children:[i&&h.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:b,style:r,children:n}),c]}):null}mX.displayName="EdgeText";const xze=y.memo(mX);function iw({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:d=20,...m}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...m,d:e,fill:"none",className:Jn(["react-flow__edge-path",m.className])}),d?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&Fa(t)&&Fa(n)?h.jsx(xze,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function m$({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ke.Left||e===Ke.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function pX({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top}){const[o,l]=m$({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,d]=m$({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,f,g,v]=$Y({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${r},${i}`,m,f,g,v]}function gX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})=>{const[C,_,k]=pX({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),O=e.isInternal?void 0:t;return h.jsx(iw,{id:O,path:C,labelX:_,labelY:k,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})})}const bze=gX({isInternal:!1}),vX=gX({isInternal:!0});bze.displayName="SimpleBezierEdge";vX.displayName="SimpleBezierEdgeInternal";function yX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,sourcePosition:v=Ke.Bottom,targetPosition:b=Ke.Top,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[_,k,O]=lN({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 h.jsx(iw,{id:A,path:_,labelX:k,labelY:O,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:w,markerStart:S,interactionWidth:C})})}const xX=yX({isInternal:!1}),bX=yX({isInternal:!0});xX.displayName="SmoothStepEdge";bX.displayName="SmoothStepEdgeInternal";function wX(e){return y.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return h.jsx(xX,{...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 wze=wX({isInternal:!1}),SX=wX({isInternal:!0});wze.displayName="StepEdge";SX.displayName="StepEdgeInternal";function jX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[S,j,C]=UY({sourceX:n,sourceY:r,targetX:i,targetY:a}),_=e.isInternal?void 0:t;return h.jsx(iw,{id:_,path:S,labelX:j,labelY:C,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:f,style:g,markerEnd:v,markerStart:b,interactionWidth:w})})}const Sze=jX({isInternal:!1}),EX=jX({isInternal:!0});Sze.displayName="StraightEdge";EX.displayName="StraightEdgeInternal";function _X(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Ke.Bottom,targetPosition:l=Ke.Top,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[_,k,O]=BY({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 h.jsx(iw,{id:A,path:_,labelX:k,labelY:O,label:c,labelStyle:d,labelShowBg:m,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:C})})}const jze=_X({isInternal:!1}),CX=_X({isInternal:!0});jze.displayName="BezierEdge";CX.displayName="BezierEdgeInternal";const p$={default:CX,straight:EX,step:SX,smoothstep:bX,simplebezier:vX},g$={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Eze=(e,t,n)=>n===Ke.Left?e-t:n===Ke.Right?e+t:e,_ze=(e,t,n)=>n===Ke.Top?e-t:n===Ke.Bottom?e+t:e,v$="react-flow__edgeupdater";function y$({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return h.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Jn([v$,`${v$}-${l}`]),cx:Eze(t,r,e),cy:_ze(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Cze({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:d,onReconnectStart:m,onReconnectEnd:f,setReconnecting:g,setUpdateHover:v}){const b=Cn(),w=(k,O)=>{if(k.button!==0)return;const{autoPanOnConnect:A,domNode:T,connectionMode:P,connectionRadius:z,lib:L,onConnectStart:F,cancelConnection:D,nodeLookup:X,rfId:R,panBy:q,updateConnection:$}=b.getState(),V=O.type==="target",G=(H,U)=>{g(!1),f==null||f(H,n,O.type,U)},K=H=>d==null?void 0:d(n,H),I=(H,U)=>{g(!0),m==null||m(k,n,O.type),F==null||F(H,U)};dN.onPointerDown(k.nativeEvent,{autoPanOnConnect:A,connectionMode:P,connectionRadius:z,domNode:T,handleId:O.id,nodeId:O.nodeId,nodeLookup:X,isTarget:V,edgeUpdaterType:O.type,lib:L,flowId:R,cancelConnection:D,panBy:q,isValidConnection:(...H)=>{var U,B;return((B=(U=b.getState()).isValidConnection)==null?void 0:B.call(U,...H))??!0},onConnect:K,onConnectStart:I,onConnectEnd:(...H)=>{var U,B;return(B=(U=b.getState()).onConnectEnd)==null?void 0:B.call(U,...H)},onReconnectEnd:G,updateConnection:$,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),_=()=>v(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(y$,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&h.jsx(y$,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:j,onMouseEnter:C,onMouseOut:_,type:"target"})]})}function Nze({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:w,noPanClassName:S,onError:j,disableKeyboardA11y:C}){let _=Rt(ie=>ie.edgeLookup.get(e));const k=Rt(ie=>ie.defaultEdgeOptions);_=k?{...k,..._}:_;let O=_.type||"default",A=(w==null?void 0:w[O])||p$[O];A===void 0&&(j==null||j("011",Ao.error011(O)),O="default",A=(w==null?void 0:w.default)||p$.default);const T=!!(_.focusable||t&&typeof _.focusable>"u"),P=typeof f<"u"&&(_.reconnectable||n&&typeof _.reconnectable>"u"),z=!!(_.selectable||r&&typeof _.selectable>"u"),L=y.useRef(null),[F,D]=y.useState(!1),[X,R]=y.useState(!1),q=Cn(),{zIndex:$,sourceX:V,sourceY:G,targetX:K,targetY:I,sourcePosition:H,targetPosition:U}=Rt(y.useCallback(ie=>{const Se=ie.nodeLookup.get(_.source),Ee=ie.nodeLookup.get(_.target);if(!Se||!Ee)return{zIndex:_.zIndex,...g$};const He=SLe({id:e,sourceNode:Se,targetNode:Ee,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ie.connectionMode,onError:j});return{zIndex:mLe({selected:_.selected,zIndex:_.zIndex,sourceNode:Se,targetNode:Ee,elevateOnSelect:ie.elevateEdgesOnSelect,zIndexMode:ie.zIndexMode}),...He||g$}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),_n),B=y.useMemo(()=>_.markerStart?`url('#${uN(_.markerStart,b)}')`:void 0,[_.markerStart,b]),Q=y.useMemo(()=>_.markerEnd?`url('#${uN(_.markerEnd,b)}')`:void 0,[_.markerEnd,b]);if(_.hidden||V===null||G===null||K===null||I===null)return null;const Z=ie=>{var Oe;const{addSelectedEdges:Se,unselectNodesAndEdges:Ee,multiSelectionActive:He}=q.getState();z&&(q.setState({nodesSelectionActive:!1}),_.selected&&He?(Ee({nodes:[],edges:[_]}),(Oe=L.current)==null||Oe.blur()):Se([e])),i&&i(ie,_)},te=a?ie=>{a(ie,{..._})}:void 0,ae=o?ie=>{o(ie,{..._})}:void 0,re=l?ie=>{l(ie,{..._})}:void 0,ee=c?ie=>{c(ie,{..._})}:void 0,se=d?ie=>{d(ie,{..._})}:void 0,ge=ie=>{var Se;if(!C&&_Y.includes(ie.key)&&z){const{unselectNodesAndEdges:Ee,addSelectedEdges:He}=q.getState();ie.key==="Escape"?((Se=L.current)==null||Se.blur(),Ee({edges:[_]})):He([e])}};return h.jsx("svg",{style:{zIndex:$},children:h.jsxs("g",{className:Jn(["react-flow__edge",`react-flow__edge-${O}`,_.className,S,{selected:_.selected,animated:_.animated,inactive:!z&&!i,updating:F,selectable:z}]),onClick:Z,onDoubleClick:te,onContextMenu:ae,onMouseEnter:re,onMouseMove:ee,onMouseLeave:se,onKeyDown:T?ge:void 0,tabIndex:T?0:void 0,role:_.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":T?`${rX}-${b}`:void 0,ref:L,..._.domAttributes,children:[!X&&h.jsx(A,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:z,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:V,sourceY:G,targetX:K,targetY:I,sourcePosition:H,targetPosition:U,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:B,markerEnd:Q,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),P&&h.jsx(Cze,{edge:_,isReconnectable:P,reconnectRadius:m,onReconnect:f,onReconnectStart:g,onReconnectEnd:v,sourceX:V,sourceY:G,targetX:K,targetY:I,sourcePosition:H,targetPosition:U,setUpdateHover:D,setReconnecting:R})]})})}var kze=y.memo(Nze);const Aze=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function NX({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:f,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,onError:_}=Rt(Aze,_n),k=hze(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(yze,{defaultColor:e,rfId:n}),k.map(O=>h.jsx(kze,{id:O,edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:m,reconnectRadius:f,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:_,edgeTypes:r,disableKeyboardA11y:w},O))]})}NX.displayName="EdgeRenderer";const Oze=y.memo(NX),Tze=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Pze({children:e}){const t=Rt(Tze);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Mze(e){const t=nw(),n=y.useRef(!1);y.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Rze=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Dze(e){const t=Rt(Rze),n=Cn();return y.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Ize(e){return e.connection.inProgress?{...e.connection,to:wg(e.connection.to,e.transform)}:{...e.connection}}function Lze(e){return Ize}function zze(e){const t=Lze();return Rt(t,_n)}const $ze=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Bze({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=Rt($ze,_n);return!(a&&i&&c)?null:h.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Jn(["react-flow__connection",kY(l)]),children:h.jsx(kX,{style:t,type:n,CustomComponent:r,isValid:l})})})}const kX=({style:e,type:t=_l.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:d,toNode:m,toHandle:f,toPosition:g,pointer:v}=zze();if(!i)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:g,connectionStatus:kY(r),toNode:m,toHandle:f,pointer:v});let b="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:g};switch(t){case _l.Bezier:[b]=BY(w);break;case _l.SimpleBezier:[b]=pX(w);break;case _l.Step:[b]=lN({...w,borderRadius:0});break;case _l.SmoothStep:[b]=lN(w);break;default:[b]=UY(w)}return h.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};kX.displayName="ConnectionLine";const Fze={};function x$(e=Fze){y.useRef(e),Cn(),y.useEffect(()=>{},[e])}function Uze(){Cn(),y.useRef(!1),y.useEffect(()=>{},[])}function AX({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:f,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:j,selectionKeyCode:C,selectionOnDrag:_,selectionMode:k,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,deleteKeyCode:P,onlyRenderVisibleElements:z,elementsSelectable:L,defaultViewport:F,translateExtent:D,minZoom:X,maxZoom:R,preventScrolling:q,defaultMarkerColor:$,zoomOnScroll:V,zoomOnPinch:G,panOnScroll:K,panOnScrollSpeed:I,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:B,onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneScroll:re,onPaneContextMenu:ee,paneClickDistance:se,nodeClickDistance:ge,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:Oe,onReconnect:at,onReconnectStart:Je,onReconnectEnd:We,noDragClassName:zt,noWheelClassName:mt,noPanClassName:_t,disableKeyboardA11y:Kt,nodeExtent:It,rfId:dn,viewport:ce,onViewportChange:be}){return x$(e),x$(t),Uze(),Mze(n),Dze(ce),h.jsx(rze,{onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneContextMenu:ee,onPaneScroll:re,paneClickDistance:se,deleteKeyCode:P,selectionKeyCode:C,selectionOnDrag:_,selectionMode:k,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:L,zoomOnScroll:V,zoomOnPinch:G,zoomOnDoubleClick:U,panOnScroll:K,panOnScrollSpeed:I,panOnScrollMode:H,panOnDrag:B,defaultViewport:F,translateExtent:D,minZoom:X,maxZoom:R,onSelectionContextMenu:f,preventScrolling:q,noDragClassName:zt,noWheelClassName:mt,noPanClassName:_t,disableKeyboardA11y:Kt,onViewportChange:be,isControlledViewport:!!ce,children:h.jsxs(Pze,{children:[h.jsx(Oze,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:at,onReconnectStart:Je,onReconnectEnd:We,onlyRenderVisibleElements:z,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:Oe,defaultMarkerColor:$,noPanClassName:_t,disableKeyboardA11y:Kt,rfId:dn}),h.jsx(Bze,{style:w,type:b,component:S,containerStyle:j}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(fze,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:ge,onlyRenderVisibleElements:z,noPanClassName:_t,noDragClassName:zt,disableKeyboardA11y:Kt,nodeExtent:It,rfId:dn}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}AX.displayName="GraphView";const Hze=y.memo(AX),b$=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:f,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,w=new Map,S=new Map,j=r??t??[],C=n??e??[],_=m??[0,0],k=f??ap;VY(w,S,j);const O=cN(C,v,b,{nodeOrigin:_,nodeExtent:k,zIndexMode:g});let A=[0,0,1];if(o&&i&&a){const T=xg(v,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:P,y:z,zoom:L}=S2(T,i,a,c,d,(l==null?void 0:l.padding)??.1);A=[P,z,L]}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:c,maxZoom:d,translateExtent:ap,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:_f.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,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:{...NY},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:lLe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:CY,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},qze=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:m,nodeExtent:f,zIndexMode:g})=>o3e((v,b)=>{async function w(){const{nodeLookup:S,panZoom:j,fitViewOptions:C,fitViewResolver:_,width:k,height:O,minZoom:A,maxZoom:T}=b();j&&(await oLe({nodes:S,width:k,height:O,panZoom:j,minZoom:A,maxZoom:T},C),_==null||_.resolve(!0),v({fitViewResolver:null}))}return{...b$({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:m,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:S=>{const{nodeLookup:j,parentLookup:C,nodeOrigin:_,elevateNodesOnSelect:k,fitViewQueued:O,zIndexMode:A}=b(),T=cN(S,j,C,{nodeOrigin:_,nodeExtent:f,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();VY(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:_,domNode:k,nodeOrigin:O,nodeExtent:A,debug:T,fitViewQueued:P,zIndexMode:z}=b(),{changes:L,updatedInternals:F}=OLe(S,C,_,k,O,A,z);F&&(CLe(C,_,{nodeOrigin:O,nodeExtent:A,zIndexMode:z}),P?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(L==null?void 0:L.length)>0&&(T&&console.log("React Flow: trigger node changes",L),j==null||j(L)))},updateNodePositions:(S,j=!1)=>{const C=[];let _=[];const{nodeLookup:k,triggerNodeChanges:O,connection:A,updateConnection:T,onNodesChangeMiddlewareMap:P}=b();for(const[z,L]of S){const F=k.get(z),D=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(L!=null&&L.position)),X={id:z,type:"position",position:D?{x:Math.max(0,L.position.x),y:Math.max(0,L.position.y)}:L.position,dragging:j};if(F&&A.inProgress&&A.fromNode.id===F.id){const R=Ec(F,A.fromHandle,Ke.Left,!0);T({...A,from:R})}D&&F.parentId&&C.push({id:z,parentId:F.parentId,rect:{...L.internals.positionAbsolute,width:L.measured.width??0,height:L.measured.height??0}}),_.push(X)}if(C.length>0){const{parentLookup:z,nodeOrigin:L}=b(),F=k2(C,k,z,L);_.push(...F)}for(const z of P.values())_=z(_);O(_)},triggerNodeChanges:S=>{const{onNodesChange:j,setNodes:C,nodes:_,hasDefaultNodes:k,debug:O}=b();if(S!=null&&S.length){if(k){const A=N3e(S,_);C(A)}O&&console.log("React Flow: trigger node changes",S),j==null||j(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:j,setEdges:C,edges:_,hasDefaultEdges:k,debug:O}=b();if(S!=null&&S.length){if(k){const A=k3e(S,_);C(A)}O&&console.log("React Flow: trigger edge changes",S),j==null||j(S)}},addSelectedNodes:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>Du(T,!0));k(A);return}k(zd(_,new Set([...S]),!0)),O(zd(C))},addSelectedEdges:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>Du(T,!0));O(A);return}O(zd(C,new Set([...S]))),k(zd(_,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:j}={})=>{const{edges:C,nodes:_,nodeLookup:k,triggerNodeChanges:O,triggerEdgeChanges:A}=b(),T=S||_,P=j||C,z=[];for(const F of T){if(!F.selected)continue;const D=k.get(F.id);D&&(D.selected=!1),z.push(Du(F.id,!1))}const L=[];for(const F of P)F.selected&&L.push(Du(F.id,!1));O(z),A(L)},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:_,elementsSelectable:k}=b();if(!k)return;const O=j.reduce((T,P)=>P.selected?[...T,Du(P.id,!1)]:T,[]),A=S.reduce((T,P)=>P.selected?[...T,Du(P.id,!1)]:T,[]);C(O),_(A)},setNodeExtent:S=>{const{nodes:j,nodeLookup:C,parentLookup:_,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]||(cN(j,C,_,{nodeOrigin:k,nodeExtent:S,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:T}),v({nodeExtent:S}))},panBy:S=>{const{transform:j,width:C,height:_,panZoom:k,translateExtent:O}=b();return TLe({delta:S,panZoom:k,transform:j,translateExtent:O,width:C,height:_})},setCenter:async(S,j,C)=>{const{width:_,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:_/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:{...NY}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...b$()})}},Object.is);function OX({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:d,nodeOrigin:m,nodeExtent:f,zIndexMode:g,children:v}){const[b]=y.useState(()=>qze({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:m,nodeExtent:f,zIndexMode:g}));return h.jsx(s3e,{value:b,children:h.jsx(P3e,{children:v})})}function Vze({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:v}){return y.useContext(ew)?h.jsx(h.Fragment,{children:e}):h.jsx(OX,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:f,nodeExtent:g,zIndexMode:v,children:e})}const Kze={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Yze({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:m,onMoveStart:f,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:k,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:z,onNodesDelete:L,onEdgesDelete:F,onDelete:D,onSelectionChange:X,onSelectionDragStart:R,onSelectionDrag:q,onSelectionDragStop:$,onSelectionContextMenu:V,onSelectionStart:G,onSelectionEnd:K,onBeforeDelete:I,connectionMode:H,connectionLineType:U=_l.Bezier,connectionLineStyle:B,connectionLineComponent:Q,connectionLineContainerStyle:Z,deleteKeyCode:te="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:re=!1,selectionMode:ee=op.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ge=lp()?"Meta":"Control",zoomActivationKeyCode:ie=lp()?"Meta":"Control",snapToGrid:Se,snapGrid:Ee,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Oe,nodesDraggable:at,autoPanOnNodeFocus:Je,nodesConnectable:We,nodesFocusable:zt,nodeOrigin:mt=iX,edgesFocusable:_t,edgesReconnectable:Kt,elementsSelectable:It=!0,defaultViewport:dn=b3e,minZoom:ce=.5,maxZoom:be=2,translateExtent:Me=ap,preventScrolling:et=!0,nodeExtent:tt,defaultMarkerColor:Gt="#b1b1b7",zoomOnScroll:nn=!0,zoomOnPinch:je=!0,panOnScroll:ut=!1,panOnScrollSpeed:wt=.5,panOnScrollMode:ct=ec.Free,zoomOnDoubleClick:Bn=!0,panOnDrag:rn=!0,onPaneClick:hr,onPaneMouseEnter:Xr,onPaneMouseMove:Rr,onPaneMouseLeave:ai,onPaneScroll:Er,onPaneContextMenu:Qe,paneClickDistance:qt=1,nodeClickDistance:me=0,children:Ze,onReconnect:an,onReconnectStart:Ct,onReconnectEnd:Pn,onEdgeContextMenu:Gr,onEdgeDoubleClick:mr,onEdgeMouseEnter:er,onEdgeMouseMove:eo,onEdgeMouseLeave:Wr,reconnectRadius:Ls=10,onNodesChange:pe,onEdgesChange:pt,noDragClassName:Lt="nodrag",noWheelClassName:on="nowheel",noPanClassName:Na="nopan",fitView:to,fitViewOptions:Sg,connectOnClick:aw,attributionPosition:jg,proOptions:iu,defaultEdgeOptions:Jf,elevateNodesOnSelect:zs=!0,elevateEdgesOnSelect:$s=!1,disableKeyboardA11y:Bs=!1,autoPanOnConnect:Fs,autoPanOnNodeDrag:Hn,autoPanSpeed:Eg,connectionRadius:_g,isValidConnection:Ro,onError:Us,style:ow,id:eh,nodeDragThreshold:Cg,connectionDragThreshold:sw,viewport:Lc,onViewportChange:zc,width:ka,height:oi,colorMode:Ng="light",debug:lw,onScroll:Hs,ariaLabelConfig:kg,zIndexMode:au="basic",...uw},si){const ou=eh||"1",Ag=E3e(Ng),th=y.useCallback(Do=>{Do.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Hs==null||Hs(Do)},[Hs]);return h.jsx("div",{"data-testid":"rf__wrapper",...uw,onScroll:th,style:{...ow,...Kze},ref:si,className:Jn(["react-flow",i,Ag]),id:eh,role:"application",children:h.jsxs(Vze,{nodes:e,edges:t,width:ka,height:oi,fitView:to,fitViewOptions:Sg,minZoom:ce,maxZoom:be,nodeOrigin:mt,nodeExtent:tt,zIndexMode:au,children:[h.jsx(Hze,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:k,onNodeContextMenu:O,onNodeDoubleClick:A,nodeTypes:a,edgeTypes:o,connectionLineType:U,connectionLineStyle:B,connectionLineComponent:Q,connectionLineContainerStyle:Z,selectionKeyCode:ae,selectionOnDrag:re,selectionMode:ee,deleteKeyCode:te,multiSelectionKeyCode:ge,panActivationKeyCode:se,zoomActivationKeyCode:ie,onlyRenderVisibleElements:He,defaultViewport:dn,translateExtent:Me,minZoom:ce,maxZoom:be,preventScrolling:et,zoomOnScroll:nn,zoomOnPinch:je,zoomOnDoubleClick:Bn,panOnScroll:ut,panOnScrollSpeed:wt,panOnScrollMode:ct,panOnDrag:rn,onPaneClick:hr,onPaneMouseEnter:Xr,onPaneMouseMove:Rr,onPaneMouseLeave:ai,onPaneScroll:Er,onPaneContextMenu:Qe,paneClickDistance:qt,nodeClickDistance:me,onSelectionContextMenu:V,onSelectionStart:G,onSelectionEnd:K,onReconnect:an,onReconnectStart:Ct,onReconnectEnd:Pn,onEdgeContextMenu:Gr,onEdgeDoubleClick:mr,onEdgeMouseEnter:er,onEdgeMouseMove:eo,onEdgeMouseLeave:Wr,reconnectRadius:Ls,defaultMarkerColor:Gt,noDragClassName:Lt,noWheelClassName:on,noPanClassName:Na,rfId:ou,disableKeyboardA11y:Bs,nodeExtent:tt,viewport:Lc,onViewportChange:zc}),h.jsx(j3e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,nodesDraggable:at,autoPanOnNodeFocus:Je,nodesConnectable:We,nodesFocusable:zt,edgesFocusable:_t,edgesReconnectable:Kt,elementsSelectable:It,elevateNodesOnSelect:zs,elevateEdgesOnSelect:$s,minZoom:ce,maxZoom:be,nodeExtent:tt,onNodesChange:pe,onEdgesChange:pt,snapToGrid:Se,snapGrid:Ee,connectionMode:H,translateExtent:Me,connectOnClick:aw,defaultEdgeOptions:Jf,fitView:to,fitViewOptions:Sg,onNodesDelete:L,onEdgesDelete:F,onDelete:D,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:z,onSelectionDrag:q,onSelectionDragStart:R,onSelectionDragStop:$,onMove:m,onMoveStart:f,onMoveEnd:g,noPanClassName:Na,nodeOrigin:mt,rfId:ou,autoPanOnConnect:Fs,autoPanOnNodeDrag:Hn,autoPanSpeed:Eg,onError:Us,connectionRadius:_g,isValidConnection:Ro,selectNodesOnDrag:Oe,nodeDragThreshold:Cg,connectionDragThreshold:sw,onBeforeDelete:I,debug:lw,ariaLabelConfig:kg,zIndexMode:au}),h.jsx(x3e,{onSelectionChange:X}),Ze,h.jsx(m3e,{proOptions:iu,position:jg}),h.jsx(h3e,{rfId:ou,disableKeyboardA11y:Bs})]})})}var Xze=oX(Yze);function Gze({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Jn(["react-flow__background-pattern",n,r])})}function Wze({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Jn(["react-flow__background-pattern","dots",t])})}var Bl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Bl||(Bl={}));const Qze={[Bl.Dots]:1,[Bl.Lines]:1,[Bl.Cross]:6},Zze=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function TX({id:e,variant:t=Bl.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:d,patternClassName:m}){const f=y.useRef(null),{transform:g,patternId:v}=Rt(Zze,_n),b=r||Qze[t],w=t===Bl.Dots,S=t===Bl.Cross,j=Array.isArray(n)?n:[n,n],C=[j[0]*g[2]||1,j[1]*g[2]||1],_=b*g[2],k=Array.isArray(a)?a:[a,a],O=S?[_,_]:C,A=[k[0]*g[2]||1+O[0]/2,k[1]*g[2]||1+O[1]/2],T=`${v}${e||""}`;return h.jsxs("svg",{className:Jn(["react-flow__background",d]),style:{...c,...rw,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[h.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?h.jsx(Wze,{radius:_/2,className:m}):h.jsx(Gze,{dimensions:O,lineWidth:i,variant:t,className:m})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}TX.displayName="Background";y.memo(TX);function Jze(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function e4e(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function t4e(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 n4e(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 r4e(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 Ey({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:Jn(["react-flow__controls-button",t]),...n,children:e})}const i4e=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function PX({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:d,children:m,position:f="bottom-left",orientation:g="vertical","aria-label":v}){const b=Cn(),{isInteractive:w,minZoomReached:S,maxZoomReached:j,ariaLabelConfig:C}=Rt(i4e,_n),{zoomIn:_,zoomOut:k,fitView:O}=nw(),A=()=>{_(),a==null||a()},T=()=>{k(),o==null||o()},P=()=>{O(i),l==null||l()},z=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},L=g==="horizontal"?"horizontal":"vertical";return h.jsxs(tw,{className:Jn(["react-flow__controls",L,d]),position:f,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Ey,{onClick:A,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:j,children:h.jsx(Jze,{})}),h.jsx(Ey,{onClick:T,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:h.jsx(e4e,{})})]}),n&&h.jsx(Ey,{className:"react-flow__controls-fitview",onClick:P,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:h.jsx(t4e,{})}),r&&h.jsx(Ey,{className:"react-flow__controls-interactive",onClick:z,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?h.jsx(r4e,{}):h.jsx(n4e,{})}),m]})}PX.displayName="Controls";y.memo(PX);function a4e({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:c,className:d,borderRadius:m,shapeRendering:f,selected:g,onClick:v}){const{background:b,backgroundColor:w}=a||{},S=o||b||w;return h.jsx("rect",{className:Jn(["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:c},shapeRendering:f,onClick:v?j=>v(j,e):void 0})}const o4e=y.memo(a4e),s4e=e=>e.nodes.map(t=>t.id),KE=e=>e instanceof Function?e:()=>e;function l4e({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=o4e,onClick:o}){const l=Rt(s4e,_n),c=KE(t),d=KE(e),m=KE(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(g=>h.jsx(c4e,{id:g,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:f},g))})}function u4e({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:d,x:m,y:f,width:g,height:v}=Rt(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:_,height:k}=Is(S);return{node:S,x:j,y:C,width:_,height:k}},_n);return!d||d.hidden||!RY(d)?null:h.jsx(l,{x:m,y:f,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:c,id:d.id})}const c4e=y.memo(u4e);var d4e=y.memo(l4e);const f4e=200,h4e=150,m4e=e=>!e.hidden,p4e=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?MY(xg(e.nodeLookup,{filter:m4e}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},g4e="react-flow__minimap-desc";function MX({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:d,maskStrokeColor:m,maskStrokeWidth:f,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:j,inversePan:C,zoomStep:_=1,offsetScale:k=5}){const O=Cn(),A=y.useRef(null),{boundingRect:T,viewBB:P,rfId:z,panZoom:L,translateExtent:F,flowWidth:D,flowHeight:X,ariaLabelConfig:R}=Rt(p4e,_n),q=(e==null?void 0:e.width)??f4e,$=(e==null?void 0:e.height)??h4e,V=T.width/q,G=T.height/$,K=Math.max(V,G),I=K*q,H=K*$,U=k*K,B=T.x-(I-T.width)/2-U,Q=T.y-(H-T.height)/2-U,Z=I+U*2,te=H+U*2,ae=`${g4e}-${z}`,re=y.useRef(0),ee=y.useRef();re.current=K,y.useEffect(()=>{if(A.current&&L)return ee.current=BLe({domNode:A.current,panZoom:L,getTransform:()=>O.getState().transform,getViewScale:()=>re.current}),()=>{var Se;(Se=ee.current)==null||Se.destroy()}},[L]),y.useEffect(()=>{var Se;(Se=ee.current)==null||Se.update({translateExtent:F,width:D,height:X,inversePan:C,pannable:w,zoomStep:_,zoomable:S})},[w,S,C,_,F,D,X]);const se=v?Se=>{var Oe;const[Ee,He]=((Oe=ee.current)==null?void 0:Oe.pointer(Se))||[0,0];v(Se,{x:Ee,y:He})}:void 0,ge=b?y.useCallback((Se,Ee)=>{const He=O.getState().nodeLookup.get(Ee).internals.userNode;b(Se,He)},[]):void 0,ie=j??R["minimap.ariaLabel"];return h.jsx(tw,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*K: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:Jn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:q,height:$,viewBox:`${B} ${Q} ${Z} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:A,onClick:se,children:[ie&&h.jsx("title",{id:ae,children:ie}),h.jsx(d4e,{onClick:ge,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-U},${Q-U}h${Z+U*2}v${te+U*2}h${-Z-U*2}z
        M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}MX.displayName="MiniMap";y.memo(MX);const v4e=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,y4e={[Of.Line]:"right",[Of.Handle]:"bottom-right"};function x4e({nodeId:e,position:t,variant:n=Of.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:w,onResize:S,onResizeEnd:j}){const C=cX(),_=typeof e=="string"?e:C,k=Cn(),O=y.useRef(null),A=n===Of.Handle,T=Rt(y.useCallback(v4e(A&&v),[A,v]),_n),P=y.useRef(null),z=t??y4e[n];y.useEffect(()=>{if(!(!O.current||!_))return P.current||(P.current=e3e({domNode:O.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:F,transform:D,snapGrid:X,snapToGrid:R,nodeOrigin:q,domNode:$}=k.getState();return{nodeLookup:F,transform:D,snapGrid:X,snapToGrid:R,nodeOrigin:q,paneDomNode:$}},onChange:(F,D)=>{const{triggerNodeChanges:X,nodeLookup:R,parentLookup:q,nodeOrigin:$}=k.getState(),V=[],G={x:F.x,y:F.y},K=R.get(_);if(K&&K.expandParent&&K.parentId){const I=K.origin??$,H=F.width??K.measured.width??0,U=F.height??K.measured.height??0,B={id:K.id,parentId:K.parentId,rect:{width:H,height:U,...DY({x:F.x??K.position.x,y:F.y??K.position.y},{width:H,height:U},K.parentId,R,I)}},Q=k2([B],R,q,$);V.push(...Q),G.x=F.x?Math.max(I[0]*H,F.x):void 0,G.y=F.y?Math.max(I[1]*U,F.y):void 0}if(G.x!==void 0&&G.y!==void 0){const I={id:_,type:"position",position:{...G}};V.push(I)}if(F.width!==void 0&&F.height!==void 0){const H={id:_,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};V.push(H)}for(const I of D){const H={...I,type:"position"};V.push(H)}X(V)},onEnd:({width:F,height:D})=>{const X={id:_,type:"dimensions",resizing:!1,dimensions:{width:F,height:D}};k.getState().triggerNodeChanges([X])}})),P.current.update({controlPosition:z,boundaries:{minWidth:l,minHeight:c,maxWidth:d,maxHeight:m},keepAspectRatio:f,resizeDirection:g,onResizeStart:w,onResize:S,onResizeEnd:j,shouldResize:b}),()=>{var F;(F=P.current)==null||F.destroy()}},[z,l,c,d,m,f,w,S,j,b]);const L=z.split("-");return h.jsx("div",{className:Jn(["react-flow__resize-control","nodrag",...L,n,r]),ref:O,style:{...i,scale:T,...o&&{[A?"backgroundColor":"borderColor"]:o}},children:a})}y.memo(x4e);const RX=180,b4e=70,f0=24,w4e=60;function S4e({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${MD(e.status)}`;return h.jsxs("div",{className:t,children:[h.jsx(Tf,{type:"target",position:Ke.Top}),h.jsx("div",{className:"agent-flow-role",children:e.pending?`[pending: ${e.role}]`:e.role}),!e.pending&&h.jsxs("div",{className:"agent-flow-meta",children:[h.jsx("span",{className:`status-dot ${MD(e.status)}`}),h.jsx("span",{children:e.status}),e.duration_ms!=null&&h.jsx("span",{children:G0(e.duration_ms)}),e.exit_code!=null&&h.jsxs("span",{children:["exit ",e.exit_code]})]}),h.jsx(Tf,{type:"source",position:Ke.Bottom})]})}const j4e={agent:S4e};function E4e(e,t){const n=new Map(e.map(l=>[l.agent_id,l])),r=new Map;for(const l of e){const c=l.parent;r.has(c)||r.set(c,[]),r.get(c).push(l.agent_id)}const i=new Map;for(const l of t){const c=l.requested_by;c&&n.has(c)&&(i.has(c)||i.set(c,[]),i.get(c).push(l))}function a(l){const c=(r.get(l)||[]).map(a),d=(i.get(l)||[]).map(m=>({id:`pending-${m.span_id}`,children:[]}));return{id:l,children:[...c,...d]}}return(r.get(null)||[]).map(a)}function h0(e){return e.children.length===0?RX:e.children.reduce((t,n)=>t+h0(n)+f0,-f0)}function DX(e,t,n,r){if(r.set(e.id,{x:t-RX/2,y:n}),e.children.length===0)return;const i=h0(e);let a=t-i/2;for(const o of e.children){const l=h0(o),c=a+l/2;DX(o,c,n+b4e+w4e,r),a+=l+f0}}function _4e({treeData:e,connected:t}){return h.jsx(OX,{children:h.jsx(C4e,{treeData:e,connected:t})})}function C4e({treeData:e,connected:t}){const{fitView:n}=nw(),r=y.useCallback(()=>{n({duration:300})},[n]),{flowNodes:i,flowEdges:a}=y.useMemo(()=>{if(!e)return{flowNodes:[],flowEdges:[]};const o=E4e(e.nodes,e.pending_delegations),l=new Map;let c=0;for(const v of o){const b=h0(v),w=c+b/2;DX(v,w,0,l),c+=b+f0*2}const d=new Map(e.nodes.map(v=>[v.agent_id,v])),m=new Map(e.pending_delegations.map(v=>[`pending-${v.span_id}`,v])),f=[];for(const[v,b]of l){const w=d.get(v),S=m.get(v);w?f.push({id:v,type:"agent",position:b,data:{label:w.role,role:w.role,status:w.status,runtime:w.runtime,duration_ms:w.duration_ms,exit_code:w.exit_code}}):S&&f.push({id:v,type:"agent",position:b,data:{label:S.role,role:S.role,status:"running",runtime:"",duration_ms:null,exit_code:null,pending:!0}})}const g=[];for(const v of e.nodes)v.parent&&g.push({id:`e-${v.parent}-${v.agent_id}`,source:v.parent,target:v.agent_id,type:"smoothstep",markerEnd:{type:Cf.ArrowClosed,width:16,height:16}});for(const v of e.pending_delegations)v.requested_by&&g.push({id:`e-${v.requested_by}-pending-${v.span_id}`,source:v.requested_by,target:`pending-${v.span_id}`,type:"smoothstep",markerEnd:{type:Cf.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:f,flowEdges:g}},[e]);return e?h.jsxs("div",{children:[h.jsxs("div",{className:"react-flow-wrapper",children:[h.jsx(Xze,{nodes:i,edges:a,nodeTypes:j4e,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0}}),h.jsx("button",{className:"tree-reset-btn",onClick:r,children:"Reset View"})]}),e.denied_delegations.length>0&&h.jsxs("div",{className:"denied-list",children:[h.jsx("strong",{children:"Denied delegations:"}),e.denied_delegations.map(o=>h.jsxs("span",{className:"denied-item",children:[o.role," (",o.reason,")"]},o.span_id))]})]}):h.jsx("div",{className:"agent-tree",children:h.jsx("p",{className:"agent-meta",children:t?"Loading tree...":"Connecting..."})})}const Ou=18,w$=10;function N4e({runId:e,agents:t,active:n,agentLogs:r,wsConnected:i,subscribeLogs:a,unsubscribeLogs:o}){var H;const l=Object.keys(t),c=l.find(U=>t[U].parent===null)??l[0]??"",[d,m]=y.useState(c),f=y.useRef(null);y.useEffect(()=>{!d||!i||(f.current&&f.current!==d&&o(f.current),f.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(),_=S?v.reduce((U,B,Q)=>(B.toLowerCase().includes(C)&&U.push(Q),U),[]):[],k=y.useRef(null),[O,A]=y.useState(0),[T,P]=y.useState(0),[z,L]=y.useState(!0),F=y.useRef(0),D=v.length*Ou,X=Math.max(0,Math.floor(O/Ou)-w$),R=Math.ceil(T/Ou)+w$*2,q=Math.min(v.length,X+R),$=v.slice(X,q),V=String(v.length).length,G=y.useCallback(()=>{const U=k.current;if(!U)return;A(U.scrollTop),P(U.clientHeight);const B=U.scrollTop+U.clientHeight>=U.scrollHeight-Ou*2;L(B)},[]);y.useEffect(()=>{const U=k.current;U&&P(U.clientHeight)},[]),y.useEffect(()=>{if(z&&v.length>F.current){const U=k.current;U&&(U.scrollTop=U.scrollHeight)}F.current=v.length},[v.length,z]);const K=()=>{const U=k.current;U&&(U.scrollTop=U.scrollHeight,L(!0))},I=async()=>{try{const U=await fetch(`/api/sessions/${e}/logs/${d}/full`);if(!U.ok)return;const B=await U.text(),Q=new Blob([B],{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 h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[l.length>1&&h.jsxs(pa,{value:d,onValueChange:m,children:[h.jsx(va,{className:"w-[220px]",children:h.jsx(ga,{})}),h.jsx(ya,{children:l.map(U=>h.jsxs(An,{value:U,children:[t[U].role," (",U.slice(0,8),")"]},U))})]}),l.length===1&&h.jsxs("span",{className:"text-sm text-muted-foreground",children:[(H=t[d])==null?void 0:H.role," (",d.slice(0,8),")"]}),h.jsxs("div",{className:"relative ml-auto",children:[h.jsx(wk,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),h.jsx(Xe,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:S,onChange:U=>j(U.target.value)})]}),S&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[_.length," match",_.length!==1?"es":""]}),h.jsxs(xe,{variant:"outline",size:"sm",onClick:I,children:[h.jsx(Mp,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),h.jsx(k4e,{connected:w,done:b,active:n})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{ref:k,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:G,children:v.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:n&&!b?"Waiting for log output...":"No log output."}):h.jsx("div",{style:{height:D,position:"relative"},children:h.jsx("div",{style:{position:"absolute",top:X*Ou,left:0,right:0},children:$.map((U,B)=>{const Q=X+B,Z=S&&U.toLowerCase().includes(C);return h.jsxs("div",{className:Z?"bg-yellow-900/30":void 0,style:{height:Ou,lineHeight:`${Ou}px`,display:"flex",whiteSpace:"pre"},children:[h.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(V+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:Q+1}),h.jsx("span",{children:Z?h.jsx(A4e,{line:U,search:C}):U})]},Q)})})})}),!z&&v.length>0&&h.jsxs(xe,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:K,children:[h.jsx(XF,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function k4e({connected:e,done:t,active:n}){return t||!n?h.jsx("span",{className:"text-xs text-muted-foreground",children:"Session ended"}):h.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[h.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 A4e({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(h.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)),h.jsx(h.Fragment,{children:n})}function O4e({pendingAskUsers:e,initialMessages:t,respond:n}){const[r,i]=y.useState([]),[a,o]=y.useState(""),l=y.useRef(null),c=y.useRef(new Set);y.useEffect(()=>{!t||t.length===0||i(f=>{const g=new Set(f.map(w=>w.id)),v=t.filter(w=>!g.has(w.id));if(v.length===0)return f;const b=[...v,...f];b.sort((w,S)=>w.timestamp-S.timestamp);for(const w of b)c.current.add(w.id);return b})},[t]),y.useEffect(()=>{if(e.length===0)return;const f=[];for(const g of e)c.current.has(g.request_id)||(c.current.add(g.request_id),f.push({id:g.request_id,role:"agent",text:g.question,timestamp:g.timestamp}));f.length>0&&i(g=>[...g,...f])},[e]),y.useEffect(()=>{var f;(f=l.current)==null||f.scrollIntoView({behavior:"smooth"})},[r]);const d=(f,g)=>{if(!f.trim())return;const v=`user-${g.request_id}`;c.current.has(v)||(c.current.add(v),i(b=>[...b,{id:v,role:"user",text:f.trim(),timestamp:Date.now()/1e3}])),o(""),n(g.request_id,f.trim())},m=e.length>0?e[0]:null;return h.jsx(Nn,{className:"flex h-[500px] flex-col",children:h.jsxs(kn,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[h.jsx(zp,{className:"flex-1",children:h.jsxs("div",{className:"space-y-3 pr-3",children:[r.length===0&&h.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-muted-foreground",children:[h.jsx(Rp,{className:"h-8 w-8"}),h.jsx("p",{className:"text-sm",children:"Waiting for the agent to ask a question..."})]}),r.map(f=>{const g=f.role==="agent"?e.find(v=>v.request_id===f.id):void 0;return h.jsxs("div",{children:[h.jsx("div",{className:Te("flex",f.role==="user"?"justify-end":"justify-start"),children:h.jsx("div",{className:Te("max-w-[80%] rounded-lg px-3 py-2 text-sm",f.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:h.jsx(Li,{content:f.text,className:"whitespace-pre-wrap"})})}),(g==null?void 0:g.choices)&&g.choices.length>0&&h.jsx("div",{className:"ml-3 mt-1 flex flex-wrap gap-1.5",children:g.choices.map(v=>h.jsx(xe,{variant:"outline",size:"sm",onClick:()=>d(v,g),children:v},v))})]},f.id)}),h.jsx("div",{ref:l})]})}),e.length>0&&h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs(ft,{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:[h.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`]})}),h.jsxs("form",{className:"flex gap-2",onSubmit:f=>{f.preventDefault(),m&&d(a,m)},children:[h.jsx(Xe,{value:a,onChange:f=>o(f.target.value),placeholder:m?"Type your response...":"Waiting for agent question...",disabled:!m}),h.jsx(xe,{type:"submit",size:"icon",disabled:!m||!a.trim(),children:h.jsx(Cse,{className:"h-4 w-4"})})]})]})})}const YE=1e4;function O2(e,t){const[n,r]=y.useState([]),[i,a]=y.useState([]),[o,l]=y.useState([]),[c,d]=y.useState(null),[m,f]=y.useState(!1),[g,v]=y.useState(new Map),b=y.useRef(null),w=y.useRef(0),S=y.useRef(void 0),j=y.useRef(1e3),C=y.useRef(!1),_=y.useRef(new Set),k=y.useCallback((T,P)=>{var z;(z=b.current)==null||z.send(JSON.stringify({type:"ask_user_response",request_id:T,text:P}))},[]),O=y.useCallback((T,P)=>{var z;_.current.add(T),(z=b.current)==null||z.send(JSON.stringify({type:"subscribe_logs",agent_id:T,...P!=null&&{offset:P}}))},[]),A=y.useCallback(T=>{var P;_.current.delete(T),v(z=>{const L=new Map(z);return L.delete(T),L}),(P=b.current)==null||P.send(JSON.stringify({type:"unsubscribe_logs",agent_id:T}))},[]);return y.useEffect(()=>{r([]),a([]),l([]),d(null),v(new Map),_.current.clear(),C.current=!1,w.current=0},[e]),y.useEffect(()=>{if(!t){r([]),f(!1);return}function T(){if(C.current)return;const z=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/sessions/${e}`,L=new WebSocket(z);b.current=L,L.onopen=()=>{f(!0),j.current=1e3,L.send(JSON.stringify({type:"init",trace_offset:w.current}));for(const F of _.current)L.send(JSON.stringify({type:"subscribe_logs",agent_id:F}))},L.onmessage=F=>{let D;try{D=JSON.parse(F.data)}catch{return}switch(D.type){case"tree_snapshot":case"tree_delta":{const{type:X,...R}=D;d(R);break}case"trace_snapshot":Array.isArray(D.events)&&l(D.events),typeof D.next_offset=="number"&&(w.current=D.next_offset);break;case"trace_delta":Array.isArray(D.events)&&l(X=>[...X,...D.events]),typeof D.next_offset=="number"&&(w.current=D.next_offset);break;case"ask_user":{const X=D;r(R=>R.some(q=>q.request_id===X.request_id)?R:[...R,X]);break}case"ask_user_resolved":typeof D.request_id=="string"?r(X=>X.filter(R=>R.request_id!==D.request_id)):r([]);break;case"chat_history":Array.isArray(D.messages)&&a(D.messages);break;case"agent_log_snapshot":{const X=D.agent_id,R=D.lines??[],q=D.offset??0;v($=>{const V=new Map($);return V.set(X,{lines:R.slice(-YE),offset:q,done:!1}),V});break}case"agent_log_delta":{const X=D.agent_id,R=D.lines??[],q=D.offset??0;R.length>0&&v($=>{const V=new Map($),G=V.get(X),K=[...(G==null?void 0:G.lines)??[],...R];return V.set(X,{lines:K.length>YE?K.slice(-YE):K,offset:q,done:(G==null?void 0:G.done)??!1}),V});break}case"agent_log_done":{const X=D.agent_id;v(R=>{const q=new Map(R),$=q.get(X);return $&&q.set(X,{...$,done:!0}),q});break}case"stream_complete":C.current=!0,r([]),L.close(),b.current=null,f(!1);break}},L.onclose=()=>{b.current=null,f(!1),!C.current&&(S.current=setTimeout(()=>{j.current=Math.min(j.current*2,15e3),T()},j.current))},L.onerror=()=>{L.close()}}return T(),()=>{var P;(P=b.current)==null||P.close(),b.current=null,S.current&&clearTimeout(S.current)}},[e,t]),{pendingAskUsers:n,chatMessages:i,traceEvents:o,treeData:c,connected:m,agentLogs:g,respond:k,subscribeLogs:O,unsubscribeLogs:A}}function T4e(){return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-64"}),h.jsx(ln,{className:"h-32 rounded-lg"}),h.jsx(ln,{className:"h-64 rounded-lg"})]})}function P4e(){const{projectId:e,runId:t}=bp(),[n]=AZ(),r=Number(e),i=L=>L==="starting"||L==="running",a=xle(r,t??"",{refetchInterval:void 0}),o=a.data,l=i(o==null?void 0:o.status);y.useEffect(()=>{if(!l)return;const L=setInterval(()=>a.refetch(),2e3);return()=>clearInterval(L)},[l,a]);const c=!!(o!=null&&o.interactive),{pendingAskUsers:d,chatMessages:m,traceEvents:f,treeData:g,connected:v,agentLogs:b,respond:w,subscribeLogs:S,unsubscribeLogs:j}=O2(t??"",!0),C=g??(o==null?void 0:o.tree)??null,_=(o==null?void 0:o.events)??[],k=f.length>0?f:_,[O,A]=y.useState(void 0);if(y.useEffect(()=>{d.length>0&&A("chat")},[d]),a.isLoading)return h.jsx(T4e,{});if(a.error)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",a.error.message]})]});if(!o)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsx("span",{children:"Session not found"})]});const T=$4e(k),P=z4e(k),z=n.get("tab")??(l?"agent-tree":"overview");return h.jsxs("div",{className:"space-y-6",children:[h.jsx(M4e,{session:o,projectId:r,runId:t??"",onStopped:()=>a.refetch()}),h.jsx(I4e,{session:o}),h.jsxs(Up,{value:O??z,onValueChange:A,children:[h.jsxs(Hp,{children:[h.jsx(or,{value:"overview",children:"Overview"}),c&&h.jsxs(or,{value:"chat",className:"relative",children:["Chat",d.length>0&&h.jsx("span",{className:"ml-1.5 inline-block h-2 w-2 animate-pulse rounded-full bg-amber-500"})]}),h.jsx(or,{value:"agent-tree",children:"Agent Tree"}),h.jsx(or,{value:"logs",children:"Logs"}),h.jsxs(or,{value:"trace",children:["Trace",k.length>0&&` (${k.length})`]}),h.jsxs(or,{value:"artifacts",children:["Artifacts",T.length>0&&` (${T.length})`]})]}),h.jsxs(sr,{value:"overview",className:"space-y-4",children:[o.user_task&&h.jsx(XE,{label:"User Task",defaultOpen:!0,children:h.jsx(S$,{content:o.user_task})}),o.task&&h.jsx(XE,{label:"Task",defaultOpen:!o.user_task,children:h.jsx(S$,{content:o.task})}),P&&h.jsx(XE,{label:"Output",defaultOpen:!0,children:h.jsx(L4e,{runId:o.run_id,hash:P})}),!o.user_task&&!o.task&&!P&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),c&&h.jsx(sr,{value:"chat",children:h.jsx(O4e,{pendingAskUsers:d,initialMessages:m,respond:w})}),h.jsx(sr,{value:"agent-tree",children:h.jsx(_4e,{treeData:C,connected:v})}),h.jsx(sr,{value:"logs",children:Object.keys(o.agents).length>0?h.jsx(N4e,{runId:o.run_id,agents:o.agents,active:l,agentLogs:b,wsConnected:v,subscribeLogs:S,unsubscribeLogs:j}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),h.jsx(sr,{value:"trace",children:k.length>0?h.jsx(q4e,{events:k,runId:o.run_id}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),h.jsx(sr,{value:"artifacts",children:T.length>0?h.jsx(B4e,{artifacts:T,runId:o.run_id}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function M4e({session:e,projectId:t,runId:n,onStopped:r}){const[i,a]=y.useState(!1),o=Mk(),l=e.status==="starting"||e.status==="running";return h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(xe,{variant:"outline",size:"sm",asChild:!0,children:h.jsxs(lr,{to:t===0?"/imu":`/projects/${t}`,children:[h.jsx(B0,{className:"mr-2 h-4 w-4"}),"Back"]})}),h.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:["Session ",e.run_id.slice(0,16)]})]}),h.jsx("div",{className:"flex gap-2",children:l&&(i?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(xe,{size:"sm",variant:"destructive",onClick:async()=>{await o.mutateAsync(n),a(!1),r()},disabled:o.isPending,children:"Confirm"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:()=>a(!1),children:"Cancel"})]}):h.jsxs(xe,{variant:"destructive",onClick:()=>a(!0),children:[h.jsx(JF,{className:"mr-2 h-4 w-4"}),"Stop Session"]}))})]})}function R4e({status:e}){const t=D4e(e);return h.jsxs(ft,{variant:"outline",className:Te("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&h.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}function D4e(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function I4e({session:e}){return h.jsx(Nn,{children:h.jsx(kn,{className:"pt-6",children:h.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status"}),h.jsx("dd",{children:h.jsx(R4e,{status:e.status})}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Role"}),h.jsx("dd",{children:e.role}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Runtime"}),h.jsx("dd",{children:e.runtime}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Isolation"}),h.jsx("dd",{children:e.isolation}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),h.jsx("dd",{children:ax(e.started_at)}),e.ended_at&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Ended"}),h.jsx("dd",{children:ax(e.ended_at)})]}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),h.jsx("dd",{children:G0(e.duration_ms)}),e.exit_code!==null&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Exit Code"}),h.jsx("dd",{children:e.exit_code})]})]})})})}function XE({label:e,defaultOpen:t,children:n}){return h.jsx($p,{defaultOpen:t,children:h.jsxs("div",{className:"space-y-2",children:[h.jsxs(Bp,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[h.jsx(Tp,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),e]}),h.jsx(Fp,{children:h.jsx(Nn,{children:h.jsx(kn,{className:"pt-4",children:n})})})]})})}function S$({content:e}){const[t,n]=y.useState("markdown");return h.jsxs(h.Fragment,{children:[h.jsx(tb,{view:t,onChange:n}),t==="markdown"?h.jsx(Li,{content:e,className:"text-sm"}):h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e})]})}function L4e({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(c=>{if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return c.text()}).then(r).catch(c=>a(c.message))},[e,t]),i?h.jsxs("span",{className:"text-destructive",children:["Error: ",i]}):n===null?h.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):h.jsxs(h.Fragment,{children:[h.jsx(tb,{view:o,onChange:l}),o==="markdown"?h.jsx(Li,{content:n,className:"text-sm"}):h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:n})]})}function z4e(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function $4e(e){const t=[];for(const n of e){const r=n.data;n.event==="agent_spawn"&&(r.context_ref&&t.push({label:`Agent Context (${r.role||"agent"})`,hash:String(r.context_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0}),r.task_ref&&t.push({label:`Agent Task (${r.role||"agent"})`,hash:String(r.task_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0})),n.event==="session_end"&&r.output_ref&&t.push({label:"Session Output",hash:String(r.output_ref),event:n.event}),n.event==="agent_end"&&r.output_ref&&t.push({label:`Agent Output (${r.agent_id||"agent"})`,hash:String(r.output_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0}),n.event==="memory_get"&&(r.cards_ref&&t.push({label:`Memory Cards (${r.provider||"memory"})`,hash:String(r.cards_ref),event:n.event}),r.behavior_ref&&t.push({label:`Memory Get Behavior (${r.role||"agent"})`,hash:String(r.behavior_ref),event:n.event}),r.task_ref&&t.push({label:`Memory Get Task (${r.role||"agent"})`,hash:String(r.task_ref),event:n.event})),n.event==="memory_dump"&&(r.output_ref&&t.push({label:`Memory Dump Output (${r.provider||"memory"})`,hash:String(r.output_ref),event:n.event}),r.behavior_ref&&t.push({label:`Memory Dump Behavior (${r.provider||"memory"})`,hash:String(r.behavior_ref),event:n.event}),r.task_ref&&t.push({label:`Memory Dump Task (${r.provider||"memory"})`,hash:String(r.task_ref),event:n.event})),n.event==="delegate_start"&&r.context_ref&&t.push({label:`Delegation Context (${r.role||"delegate"})`,hash:String(r.context_ref),event:n.event}),n.event==="delegate_end"&&r.output_ref&&t.push({label:`Delegation Output (${r.role||"delegate"})`,hash:String(r.output_ref),event:n.event})}return t}function B4e({artifacts:e,runId:t}){return h.jsx("div",{className:"space-y-1",children:e.map(n=>h.jsxs($p,{children:[h.jsxs(Bp,{className:"flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-sm hover:bg-muted",children:[h.jsx(Tp,{className:"h-3 w-3 transition-transform [[data-state=open]>&]:rotate-90"}),h.jsx("span",{className:"font-medium text-primary",children:n.label})]}),h.jsx(Fp,{children:h.jsx(F4e,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function F4e({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?h.jsxs("p",{className:"px-3 py-2 text-sm text-destructive",children:["Error: ",i]}):n===null?h.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading..."}):h.jsx(zp,{className:"max-h-[300px] overflow-hidden",children:h.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 U4e({event:e}){const t=H4e(e);return h.jsx(ft,{variant:"outline",className:Te("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 H4e(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function q4e({events:e,runId:t}){const[n,r]=y.useState(null);return h.jsxs(h.Fragment,{children:[h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Time"}),h.jsx(Fe,{children:"Event"}),h.jsx(Fe,{children:"Span"}),h.jsx(Fe,{children:"Details"})]})}),h.jsx(ma,{children:e.map((i,a)=>h.jsxs(yn,{children:[h.jsx(ze,{className:"text-sm text-muted-foreground",children:ax(i.ts)}),h.jsx(ze,{children:h.jsx(U4e,{event:i.event})}),h.jsx(ze,{className:"font-mono text-xs text-muted-foreground",children:i.span_id.slice(0,8)}),h.jsx(ze,{className:"max-w-[400px] text-sm",children:K4e(i,(o,l)=>r({hash:o,label:l}))})]},a))})]})})}),h.jsx(Xa,{open:!!n,onOpenChange:()=>r(null),children:h.jsxs(Ga,{className:"max-w-3xl overflow-hidden",children:[h.jsx(Wa,{children:h.jsx(Qa,{children:n==null?void 0:n.label})}),n&&h.jsx(V4e,{runId:t,hash:n.hash})]})})]})}function V4e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState("markdown"),c=y.useRef(null),d=y.useRef(null);return y.useEffect(()=>{const m=f=>{const g=d.current??c.current;if(g&&(f.metaKey||f.ctrlKey)&&f.key==="a"){f.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]),h.jsx("div",{ref:c,className:"space-y-2",children:i?h.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",i]}):n===null?h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):h.jsxs(h.Fragment,{children:[h.jsx(tb,{view:o,onChange:l}),h.jsx("div",{ref:d,className:"max-h-[60vh] overflow-y-auto",children:o==="markdown"?h.jsx("div",{className:"p-4",children:h.jsx(Li,{content:n,className:"text-sm"})}):h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-4 font-mono text-xs leading-relaxed",children:n})})]})})}function K4e(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(h.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"?G0(o):Array.isArray(o)?o.join(", "):String(o);i.push(h.jsxs("span",{children:[h.jsxs("span",{className:"text-muted-foreground",children:[a,"="]}),h.jsx("span",{children:l})]},a))}return h.jsxs(h.Fragment,{children:[r.length>0&&h.jsx("div",{className:"mb-1 flex flex-wrap gap-1",children:r}),i.length>0&&h.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:i})]})}function Y4e(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 X4e({status:e}){return e==="running"||e==="starting"?h.jsxs(ft,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[h.jsx(Pr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?h.jsxs(ft,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[h.jsx(Pp,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?h.jsxs(ft,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[h.jsx(F0,{className:"h-3 w-3"}),"Failed"]}):h.jsx(ft,{variant:"outline",children:e})}function G4e({session:e,projectId:t}){const n=e.status==="running"||e.status==="starting";return h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"StrawPot"}),h.jsx(X4e,{status:e.status}),e.duration_ms!==null&&h.jsx("span",{className:"text-xs text-muted-foreground",children:Y4e(e.duration_ms)}),h.jsx("span",{className:"text-xs text-muted-foreground",children:e.role})]}),h.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:n?h.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[h.jsx(Pr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?h.jsx(Li,{content:e.summary,className:"text-sm text-foreground"}):h.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),h.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:[h.jsx(U0,{className:"h-3 w-3"}),"View session"]})]})}function W4e({task:e}){return h.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),h.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:h.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}function Q4e(){var Ls;const{projectId:e,conversationId:t}=bp(),n=Number(e),r=Number(t),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,d]=y.useState([]),[m,f]=y.useState(!1),[g,v]=y.useState(!1),[b,w]=y.useState(!1),[S,j]=y.useState(""),[C,_]=y.useState(!1),[k,O]=y.useState(""),[A,T]=y.useState(!1),[P,z]=y.useState(""),[L,F]=y.useState(""),[D,X]=y.useState(""),[R,q]=y.useState(""),[$,V]=y.useState(""),[G,K]=y.useState(""),[I,H]=y.useState(""),[U,B]=y.useState(!0),[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),ge=y.useRef(null),ie=y.useRef(null),Se=lt(),{data:Ee}=Bf(n),He=(Ee??[]).filter(pe=>pe.type==="roles").map(pe=>pe.name),Oe=Ek(n),at=V0(n),Je=(Ls=Oe.data)==null?void 0:Ls.merged,{data:We,isLoading:zt,error:mt,fetchPreviousPage:_t,hasPreviousPage:Kt,isFetchingPreviousPage:It}=rx(r),dn=(We==null?void 0:We.pages.flatMap(pe=>pe.sessions))??[],ce=We==null?void 0:We.pages[We.pages.length-1],be=dn[dn.length-1],Me=(be==null?void 0:be.status)==="running"||(be==null?void 0:be.status)==="starting";rx(r,{refetchInterval:Me?2e3:!1});const et=lU(r),tt=Mk(),Gt=uU(r),nn=Ck(n),{pendingAskUsers:je,chatMessages:ut,respond:wt}=O2((be==null?void 0:be.run_id)??"",Me&&U),ct=o.trim()&&!He.includes(o.trim())?"Role not found in installed roles":"",Bn=Me;y.useEffect(()=>{if(!te.current)return;const pe=te.current.scrollHeight-re.current;pe>0&&(te.current.scrollTop+=pe,re.current=0)},[We==null?void 0:We.pages.length]),y.useEffect(()=>{te.current&&((be==null?void 0:be.run_id)!==ee.current&&(te.current.scrollTop=te.current.scrollHeight),ee.current=be==null?void 0:be.run_id)},[be==null?void 0:be.run_id]),y.useEffect(()=>{te.current&&(ut.length>se.current&&(te.current.scrollTop=te.current.scrollHeight),se.current=ut.length)},[ut.length]),y.useEffect(()=>{if(!ae.current||!te.current)return;const pe=new IntersectionObserver(([pt])=>{var Lt;pt.isIntersecting&&Kt&&!It&&(re.current=((Lt=te.current)==null?void 0:Lt.scrollHeight)??0,_t())},{root:te.current,threshold:.1});return pe.observe(ae.current),()=>pe.disconnect()},[Kt,It,_t]);const rn=(Ee??[]).filter(pe=>pe.type==="agents").map(pe=>pe.name),hr=[...new Set((Ee??[]).filter(pe=>pe.type==="memories").map(pe=>pe.name)),"none"].sort(),Xr=P.trim()&&rn.length>0&&!rn.includes(P.trim())?"Runtime not found in installed agents":"",Rr=L.trim()&&hr.length>0&&!hr.includes(L.trim())?"Memory not found in installed providers":"",ai=!!Xr||!!Rr,Er=[P,L,D,R,$,G,I].filter(pe=>pe.trim()).length,Qe=pe=>d(pt=>pt.includes(pe)?pt.filter(Lt=>Lt!==pe):[...pt,pe]),qt=pe=>{pe.preventDefault(),v(!0)},me=pe=>{pe.preventDefault(),v(!0)},Ze=pe=>{pe.preventDefault(),v(!1)},an=async pe=>{pe.preventDefault(),v(!1);const pt=Array.from(pe.dataTransfer.files);if(pt.length){w(!0);try{const Lt=await Pe.upload(`/projects/${n}/files`,pt);Se.invalidateQueries({queryKey:Ae.projects.files(n)}),d(on=>{const Na=Lt.map(to=>to.path).filter(to=>!on.includes(to));return[...on,...Na]})}catch{}finally{w(!1)}}};function Ct(pe){pe.preventDefault();const pt=i.trim();if(!pt||ct||ai)return;const Lt={task:pt,role:o.trim()||void 0,context_files:c.length>0?c:void 0,interactive:U,system_prompt:D.trim()||void 0,runtime:P.trim()||void 0,memory:L.trim()||void 0,max_num_delegations:R.trim()?Number(R):void 0,cache_delegations:$?$==="true":void 0,cache_max_entries:G.trim()?Number(G):void 0,cache_ttl_seconds:I.trim()?Number(I):void 0};et.mutate(Lt,{onSuccess:()=>{a(""),d([]),f(!1),setTimeout(()=>{var on;return(on=ie.current)==null?void 0:on.focus()},0)}})}function Pn(pe,pt){pt.trim()&&(wt(pe.request_id,pt.trim()),Z(""))}function Gr(pe){pe.key==="Enter"&&!pe.shiftKey&&(pe.preventDefault(),Ct(pe))}function mr(){O((ce==null?void 0:ce.title)??""),_(!0),setTimeout(()=>{var pe;return(pe=ge.current)==null?void 0:pe.select()},0)}function er(){const pe=k.trim();nn.mutate({conversationId:r,title:pe||null}),_(!1)}function eo(pe){pe.key==="Enter"&&(pe.preventDefault(),er()),pe.key==="Escape"&&_(!1)}if(mt)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",mt.message]})]});const Wr=(ce==null?void 0:ce.title)??`Conversation #${r}`;return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[h.jsx("div",{className:"flex items-center gap-3",children:C?h.jsx(Xe,{ref:ge,value:k,onChange:pe=>O(pe.target.value),onBlur:er,onKeyDown:eo,className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${r}`}):h.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:mr,title:"Click to rename",children:Wr})}),dn.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[dn.length," session",dn.length!==1?"s":""]})]}),(ce==null?void 0:ce.parent)&&h.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:[h.jsx(Op,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:"Spawned from"}),h.jsxs(lr,{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}`,h.jsx(ED,{className:"h-3 w-3"})]})]}),(ce==null?void 0:ce.children)&&ce.children.length>0&&h.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:[h.jsx(U0,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:"Delegated to:"}),ce.children.map(pe=>h.jsxs(lr,{to:`/projects/${pe.project_id}/conversations/${pe.id}`,className:"text-primary hover:underline inline-flex items-center gap-1",children:[pe.project_name,": ",pe.title||`#${pe.id}`,h.jsx(ED,{className:"h-3 w-3"})]},pe.id))]}),h.jsx("div",{ref:te,className:"min-h-0 flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[h.jsx("div",{ref:ae,className:"h-1"}),It&&h.jsx("div",{className:"flex justify-center py-2",children:h.jsx(Pr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!zt&&dn.length===0&&h.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),dn.map((pe,pt)=>{const Lt=pt===dn.length-1;return h.jsxs("div",{className:"space-y-4",children:[(pe.user_task??pe.task)&&h.jsx(W4e,{task:pe.user_task??pe.task}),(Lt&&Me?ut:pe.chat_messages??[]).map(on=>h.jsx("div",{className:`flex ${on.role==="user"?"justify-end":"justify-start"}`,children:h.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${on.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:h.jsx(Li,{content:on.text,className:"whitespace-pre-wrap"})})},on.id)),h.jsx(G4e,{session:pe,projectId:n})]},pe.run_id)})]})}),(ce==null?void 0:ce.pending_task)&&(()=>{const pe=ce.pending_task.split(`

`).filter(Boolean);return h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:h.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[pe.map((pt,Lt)=>h.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[h.jsx(Pr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),h.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",pe.length>1?` (${Lt+1}/${pe.length})`:"",":"," ",h.jsx("span",{className:"text-foreground",children:pt.split(`
`)[0]})]})]},Lt)),h.jsx("div",{className:"flex justify-end",children:h.jsxs(xe,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>Gt.mutate(),disabled:Gt.isPending,children:[h.jsx(uc,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),je.length>0&&h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:h.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:je.map(pe=>h.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[h.jsx(Li,{content:pe.question,className:"text-sm font-medium"}),pe.why&&h.jsx(Li,{content:pe.why,className:"text-xs text-muted-foreground"}),pe.choices&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:pe.choices.map(pt=>h.jsx(xe,{type:"button",size:"sm",variant:"outline",onClick:()=>Pn(pe,pt),children:pt},pt))}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Xe,{value:Q,onChange:pt=>Z(pt.target.value),onKeyDown:pt=>{pt.key==="Enter"&&!pt.shiftKey&&(pt.preventDefault(),Pn(pe,Q))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),h.jsx(xe,{type:"button",size:"icon",disabled:!Q.trim(),onClick:()=>Pn(pe,Q),children:h.jsx(nx,{className:"h-4 w-4"})})]})]},pe.request_id))})}),h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:h.jsxs("form",{onSubmit:Ct,className:"mx-auto max-w-2xl space-y-2",children:[h.jsxs("div",{className:"relative",onDragOver:qt,onDragEnter:me,onDragLeave:Ze,onDrop:an,children:[h.jsx(Eo,{ref:ie,value:i,onChange:pe=>a(pe.target.value),onKeyDown:Gr,placeholder:Bn?"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:et.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(g||b)&&h.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?h.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[h.jsx(Pr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):h.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[h.jsx(q0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(at.data??[]).length>0&&h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(ff,{children:[h.jsx(hf,{asChild:!0,children:h.jsxs(xe,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[h.jsx(bk,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),h.jsxs(mf,{align:"start",className:"w-64",onCloseAutoFocus:pe=>pe.preventDefault(),children:[h.jsx("div",{className:"px-2 py-1.5",children:h.jsx(Xe,{placeholder:"Filter files…",value:S,onChange:pe=>j(pe.target.value),className:"h-7 text-xs",onKeyDown:pe=>pe.stopPropagation()})}),h.jsx("div",{className:"max-h-48 overflow-y-auto",children:(at.data??[]).filter(pe=>pe.path.toLowerCase().includes(S.toLowerCase())).map(pe=>h.jsx(Pk,{checked:c.includes(pe.path),onCheckedChange:()=>Qe(pe.path),onSelect:pt=>pt.preventDefault(),children:h.jsx("span",{className:"font-mono text-xs",children:pe.path})},pe.path))})]})]}),c.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.length," attached"]})]}),c.length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1",children:[(m?c:c.slice(0,3)).map(pe=>h.jsxs(ft,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[h.jsx("button",{type:"button",onClick:()=>Qe(pe),className:"mr-0.5 rounded-sm hover:bg-muted",children:h.jsx(uc,{className:"h-3 w-3"})}),"@",pe]},pe)),!m&&c.length>3&&h.jsxs("button",{type:"button",onClick:()=>f(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",c.length-3," more"]}),m&&c.length>3&&h.jsx("button",{type:"button",onClick:()=>f(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),h.jsx("div",{className:"flex flex-col gap-1.5",children:h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx(Xe,{list:"datalist-role",value:o,onChange:pe=>l(pe.target.value),placeholder:"Default role",className:"w-48 text-sm"}),ct&&h.jsx("p",{className:"text-xs text-destructive",children:ct})]}),h.jsx("datalist",{id:"datalist-role",children:He.map(pe=>h.jsx("option",{value:pe},pe))}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs(xe,{type:"button",variant:U?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>B(pe=>!pe),title:U?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[h.jsx(Rp,{className:"h-3.5 w-3.5"}),U?"Interactive":"Auto"]}),h.jsxs(xe,{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:[h.jsx(H0,{className:"h-4 w-4"}),Er>0&&h.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:Er})]}),Bn&&h.jsxs(xe,{type:"button",variant:"destructive",onClick:()=>be&&tt.mutate(be.run_id),disabled:tt.isPending,children:[tt.isPending?h.jsx(Pr,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Sk,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),h.jsx(xe,{type:"submit",disabled:!i.trim()||et.isPending||!!ct||ai,variant:Bn?"outline":"default",title:Bn?"Queue task (runs after current session)":void 0,children:et.isPending?h.jsx(Pr,{className:"h-4 w-4 animate-spin"}):h.jsx(nx,{className:"h-4 w-4"})})]})]})})]})}),h.jsx(Xa,{open:A,onOpenChange:T,children:h.jsxs(Ga,{className:"max-w-lg",children:[h.jsx(Wa,{children:h.jsx(Qa,{children:"Advanced Options"})}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Runtime"}),h.jsx(Xe,{list:"adv-datalist-runtime",value:P,onChange:pe=>z(pe.target.value),placeholder:(Je==null?void 0:Je.runtime)??"default",className:"text-sm"}),h.jsx("datalist",{id:"adv-datalist-runtime",children:rn.map(pe=>h.jsx("option",{value:pe},pe))}),Xr&&h.jsx("p",{className:"text-xs text-destructive",children:Xr})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Memory"}),h.jsx(Xe,{list:"adv-datalist-memory",value:L,onChange:pe=>F(pe.target.value),placeholder:(Je==null?void 0:Je.memory)??"dial",className:"text-sm"}),h.jsx("datalist",{id:"adv-datalist-memory",children:hr.map(pe=>h.jsx("option",{value:pe},pe))}),Rr&&h.jsx("p",{className:"text-xs text-destructive",children:Rr})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"System Prompt"}),h.jsx(Eo,{value:D,onChange:pe=>X(pe.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Max Delegations"}),h.jsx(Xe,{type:"number",min:"0",value:R,onChange:pe=>q(pe.target.value),placeholder:Je!=null&&Je.max_num_delegations?String(Je.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache Delegations"}),h.jsxs(pa,{value:$||"__empty__",onValueChange:pe=>V(pe==="__empty__"?"":pe),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:`Default (${(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false"})`})}),h.jsxs(ya,{children:[h.jsxs(An,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false",")"]}),h.jsx(An,{value:"true",children:"true"}),h.jsx(An,{value:"false",children:"false"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache Max Entries"}),h.jsx(Xe,{type:"number",min:"0",value:G,onChange:pe=>K(pe.target.value),placeholder:Je!=null&&Je.cache_max_entries?String(Je.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache TTL (seconds)"}),h.jsx(Xe,{type:"number",min:"0",value:I,onChange:pe=>H(pe.target.value),placeholder:Je!=null&&Je.cache_ttl_seconds?String(Je.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[h.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>{z(""),F(""),X(""),q(""),V(""),K(""),H("")},children:"Reset"}),h.jsx(xe,{size:"sm",onClick:()=>T(!1),children:"Done"})]})]})})]})}const GE="imu";function Z4e(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 J4e({status:e}){return e==="running"||e==="starting"?h.jsxs(ft,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[h.jsx(Pr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?h.jsxs(ft,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[h.jsx(Pp,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?h.jsxs(ft,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[h.jsx(F0,{className:"h-3 w-3"}),"Failed"]}):h.jsx(ft,{variant:"outline",children:e})}function e5e({session:e}){const t=e.status==="running"||e.status==="starting";return h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Bot Imu"}),h.jsx(J4e,{status:e.status}),e.duration_ms!==null&&h.jsx("span",{className:"text-xs text-muted-foreground",children:Z4e(e.duration_ms)})]}),h.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:t?h.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[h.jsx(Pr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?h.jsx(Li,{content:e.summary,className:"text-sm text-foreground"}):h.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),h.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:[h.jsx(U0,{className:"h-3 w-3"}),"View session"]})]})}function t5e({task:e}){return h.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),h.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:h.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}const n5e=[{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"}]}];function r5e({onSelectPrompt:e}){return h.jsxs("div",{className:"flex flex-col items-center gap-6 py-12 px-4",children:[h.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[h.jsx(Op,{className:"h-10 w-10 text-muted-foreground"}),h.jsx("h2",{className:"text-lg font-semibold",children:"Hi, I'm Imu"}),h.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."})]}),h.jsx("div",{className:"w-full max-w-md space-y-4",children:n5e.map(t=>h.jsxs("div",{className:"space-y-2",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t.group}),h.jsx("div",{className:"flex flex-col gap-1.5",children:t.prompts.map(n=>h.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 i5e({cid:e}){const[t,n]=y.useState(""),[r,i]=y.useState(!0),[a,o]=y.useState(!1),[l,c]=y.useState(""),[d,m]=y.useState(!1),[f,g]=y.useState(""),[v,b]=y.useState(""),[w,S]=y.useState(""),[j,C]=y.useState(""),[_,k]=y.useState(""),[O,A]=y.useState(""),[T,P]=y.useState(""),[z,L]=y.useState(!1),[F,D]=y.useState(!1),[X,R]=y.useState([]),[q,$]=y.useState(!1),[V,G]=y.useState(""),[K,I]=y.useState(""),H=lt(),U=y.useRef(null),B=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}=Wu("agents"),{data:se}=Wu("memories"),ge=V0(0),ie=me=>R(Ze=>Ze.includes(me)?Ze.filter(an=>an!==me):[...Ze,me]),{data:Se,isLoading:Ee,error:He,fetchPreviousPage:Oe,hasPreviousPage:at,isFetchingPreviousPage:Je}=rx(e),We=(Se==null?void 0:Se.pages.flatMap(me=>me.sessions))??[],zt=Se==null?void 0:Se.pages[Se.pages.length-1],mt=We[We.length-1],_t=(mt==null?void 0:mt.status)==="running"||(mt==null?void 0:mt.status)==="starting";rx(e,{refetchInterval:_t?2e3:!1});const Kt=lU(e),It=Mk(),dn=uU(e),ce=Nk(),{pendingAskUsers:be,chatMessages:Me,respond:et}=O2((mt==null?void 0:mt.run_id)??"",_t&&r),tt=(ee??[]).map(me=>me.name),Gt=[...new Set((se??[]).map(me=>me.name)),"none"].sort(),nn=f.trim()&&tt.length>0&&!tt.includes(f.trim())?"Runtime not found in installed agents":"",je=v.trim()&&Gt.length>0&&!Gt.includes(v.trim())?"Memory not found in installed providers":"",ut=!!nn||!!je,wt=[f,v,w,j,_,O,T].filter(me=>me.trim()).length;y.useEffect(()=>{if(!U.current)return;const me=U.current.scrollHeight-Q.current;me>0&&(U.current.scrollTop+=me,Q.current=0)},[Se==null?void 0:Se.pages.length]),y.useEffect(()=>{U.current&&((mt==null?void 0:mt.run_id)!==Z.current&&(U.current.scrollTop=U.current.scrollHeight),Z.current=mt==null?void 0:mt.run_id)},[mt==null?void 0:mt.run_id]),y.useEffect(()=>{U.current&&(Me.length>te.current&&(U.current.scrollTop=U.current.scrollHeight),te.current=Me.length)},[Me.length]),y.useEffect(()=>{if(!B.current||!U.current)return;const me=new IntersectionObserver(([Ze])=>{var an;Ze.isIntersecting&&at&&!Je&&(Q.current=((an=U.current)==null?void 0:an.scrollHeight)??0,Oe())},{root:U.current,threshold:.1});return me.observe(B.current),()=>me.disconnect()},[at,Je,Oe]);const ct=me=>{me.preventDefault(),L(!0)},Bn=me=>{me.preventDefault(),L(!0)},rn=me=>{me.preventDefault(),L(!1)},hr=async me=>{me.preventDefault(),L(!1);const Ze=Array.from(me.dataTransfer.files);if(Ze.length){D(!0);try{const an=await Pe.upload("/projects/0/files",Ze);H.invalidateQueries({queryKey:Ae.projects.files(0)}),R(Ct=>{const Pn=an.map(Gr=>Gr.path).filter(Gr=>!Ct.includes(Gr));return[...Ct,...Pn]})}catch{}finally{D(!1)}}};function Xr(me){me.preventDefault();const Ze=t.trim();!Ze||ut||Kt.mutate({task:Ze,role:GE,interactive:r,context_files:X.length>0?X:void 0,system_prompt:w.trim()||void 0,runtime:f.trim()||void 0,memory:v.trim()||void 0,max_num_delegations:j.trim()?Number(j):void 0,cache_delegations:_?_==="true":void 0,cache_max_entries:O.trim()?Number(O):void 0,cache_ttl_seconds:T.trim()?Number(T):void 0},{onSuccess:()=>{n(""),R([]),$(!1),setTimeout(()=>{var an;return(an=re.current)==null?void 0:an.focus()},0)}})}function Rr(me,Ze){Ze.trim()&&(et(me.request_id,Ze.trim()),I(""))}function ai(me){me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),Xr(me))}function Er(){c((zt==null?void 0:zt.title)??""),o(!0),setTimeout(()=>{var me;return(me=ae.current)==null?void 0:me.select()},0)}function Qe(){const me=l.trim();ce.mutate({conversationId:e,title:me||null}),o(!1)}if(He)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",He.message]})]});const qt=(zt==null?void 0:zt.title)??`Conversation #${e}`;return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[h.jsx("div",{className:"flex items-center gap-3",children:a?h.jsx(Xe,{ref:ae,value:l,onChange:me=>c(me.target.value),onBlur:Qe,onKeyDown:me=>{me.key==="Enter"&&(me.preventDefault(),Qe()),me.key==="Escape"&&o(!1)},className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${e}`}):h.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:Er,title:"Click to rename",children:qt})}),We.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[We.length," session",We.length!==1?"s":""]})]}),h.jsx("div",{ref:U,className:"min-h-0 flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[h.jsx("div",{ref:B,className:"h-1"}),Je&&h.jsx("div",{className:"flex justify-center py-2",children:h.jsx(Pr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!Ee&&We.length===0&&h.jsx(r5e,{onSelectPrompt:me=>{Kt.mutate({task:me,role:GE,interactive:r},{onSuccess:()=>{setTimeout(()=>{var Ze;return(Ze=re.current)==null?void 0:Ze.focus()},0)}})}}),We.map((me,Ze)=>{const an=Ze===We.length-1;return h.jsxs("div",{className:"space-y-4",children:[(me.user_task??me.task)&&h.jsx(t5e,{task:me.user_task??me.task}),(an&&_t?Me:me.chat_messages??[]).map(Ct=>h.jsx("div",{className:`flex ${Ct.role==="user"?"justify-end":"justify-start"}`,children:h.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${Ct.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:h.jsx(Li,{content:Ct.text,className:"whitespace-pre-wrap"})})},Ct.id)),h.jsx(e5e,{session:me})]},me.run_id)})]})}),(zt==null?void 0:zt.pending_task)&&(()=>{const me=zt.pending_task.split(`

`).filter(Boolean);return h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:h.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[me.map((Ze,an)=>h.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[h.jsx(Pr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),h.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",me.length>1?` (${an+1}/${me.length})`:"",":"," ",h.jsx("span",{className:"text-foreground",children:Ze.split(`
`)[0]})]})]},an)),h.jsx("div",{className:"flex justify-end",children:h.jsxs(xe,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>dn.mutate(),disabled:dn.isPending,children:[h.jsx(uc,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),be.length>0&&h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:h.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:be.map(me=>h.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[h.jsx(Li,{content:me.question,className:"text-sm font-medium"}),me.why&&h.jsx(Li,{content:me.why,className:"text-xs text-muted-foreground"}),me.choices&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:me.choices.map(Ze=>h.jsx(xe,{type:"button",size:"sm",variant:"outline",onClick:()=>Rr(me,Ze),children:Ze},Ze))}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Xe,{value:K,onChange:Ze=>I(Ze.target.value),onKeyDown:Ze=>{Ze.key==="Enter"&&!Ze.shiftKey&&(Ze.preventDefault(),Rr(me,K))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),h.jsx(xe,{type:"button",size:"icon",disabled:!K.trim(),onClick:()=>Rr(me,K),children:h.jsx(nx,{className:"h-4 w-4"})})]})]},me.request_id))})}),h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:h.jsxs("form",{onSubmit:Xr,className:"mx-auto max-w-2xl space-y-2",children:[h.jsxs("div",{className:"relative",onDragOver:ct,onDragEnter:Bn,onDragLeave:rn,onDrop:hr,children:[h.jsx(Eo,{ref:re,value:t,onChange:me=>n(me.target.value),onKeyDown:ai,placeholder:_t?"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}),(z||F)&&h.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?h.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[h.jsx(Pr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):h.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[h.jsx(q0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(ff,{children:[h.jsx(hf,{asChild:!0,children:h.jsxs(xe,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[h.jsx(bk,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),h.jsxs(mf,{align:"start",className:"w-64",onCloseAutoFocus:me=>me.preventDefault(),children:[h.jsx("div",{className:"px-2 py-1.5",children:h.jsx(Xe,{placeholder:"Filter files…",value:V,onChange:me=>G(me.target.value),className:"h-7 text-xs",onKeyDown:me=>me.stopPropagation()})}),h.jsx("div",{className:"max-h-48 overflow-y-auto",children:(ge.data??[]).filter(me=>me.path.toLowerCase().includes(V.toLowerCase())).map(me=>h.jsx(Pk,{checked:X.includes(me.path),onCheckedChange:()=>ie(me.path),onSelect:Ze=>Ze.preventDefault(),children:h.jsx("span",{className:"font-mono text-xs",children:me.path})},me.path))})]})]}),X.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[X.length," attached"]})]}),X.length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1",children:[(q?X:X.slice(0,3)).map(me=>h.jsxs(ft,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[h.jsx("button",{type:"button",onClick:()=>ie(me),className:"mr-0.5 rounded-sm hover:bg-muted",children:h.jsx(uc,{className:"h-3 w-3"})}),"@",me]},me)),!q&&X.length>3&&h.jsxs("button",{type:"button",onClick:()=>$(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",X.length-3," more"]}),q&&X.length>3&&h.jsx("button",{type:"button",onClick:()=>$(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{className:"text-xs text-muted-foreground px-1",children:["Role: ",GE]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs(xe,{type:"button",variant:r?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>i(me=>!me),title:r?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[h.jsx(Rp,{className:"h-3.5 w-3.5"}),r?"Interactive":"Auto"]}),h.jsxs(xe,{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:[h.jsx(H0,{className:"h-4 w-4"}),wt>0&&h.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:wt})]}),_t&&h.jsxs(xe,{type:"button",variant:"destructive",onClick:()=>mt&&It.mutate(mt.run_id),disabled:It.isPending,children:[It.isPending?h.jsx(Pr,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Sk,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),h.jsx(xe,{type:"submit",disabled:!t.trim()||Kt.isPending||ut,variant:_t?"outline":"default",title:_t?"Queue task (runs after current session)":void 0,children:Kt.isPending?h.jsx(Pr,{className:"h-4 w-4 animate-spin"}):h.jsx(nx,{className:"h-4 w-4"})})]})]})]})}),h.jsx(Xa,{open:d,onOpenChange:m,children:h.jsxs(Ga,{className:"max-w-lg",children:[h.jsx(Wa,{children:h.jsx(Qa,{children:"Advanced Options"})}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Runtime"}),h.jsx(Xe,{list:"imu-adv-runtime",value:f,onChange:me=>g(me.target.value),placeholder:"default",className:"text-sm"}),h.jsx("datalist",{id:"imu-adv-runtime",children:tt.map(me=>h.jsx("option",{value:me},me))}),nn&&h.jsx("p",{className:"text-xs text-destructive",children:nn})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Memory"}),h.jsx(Xe,{list:"imu-adv-memory",value:v,onChange:me=>b(me.target.value),placeholder:"dial",className:"text-sm"}),h.jsx("datalist",{id:"imu-adv-memory",children:Gt.map(me=>h.jsx("option",{value:me},me))}),je&&h.jsx("p",{className:"text-xs text-destructive",children:je})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"System Prompt"}),h.jsx(Eo,{value:w,onChange:me=>S(me.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Max Delegations"}),h.jsx(Xe,{type:"number",min:"0",value:j,onChange:me=>C(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache Delegations"}),h.jsxs(pa,{value:_||"__empty__",onValueChange:me=>k(me==="__empty__"?"":me),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:"Default (true)"})}),h.jsxs(ya,{children:[h.jsx(An,{value:"__empty__",className:"text-muted-foreground",children:"Default (true)"}),h.jsx(An,{value:"true",children:"true"}),h.jsx(An,{value:"false",children:"false"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache Max Entries"}),h.jsx(Xe,{type:"number",min:"0",value:O,onChange:me=>A(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{children:"Cache TTL (seconds)"}),h.jsx(Xe,{type:"number",min:"0",value:T,onChange:me=>P(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[h.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>{g(""),b(""),S(""),C(""),k(""),A(""),P("")},children:"Reset"}),h.jsx(xe,{size:"sm",onClick:()=>m(!1),children:"Done"})]})]})})]})}function a5e({conv:e}){const[t,n]=y.useState(!1),[r,i]=y.useState(""),a=y.useRef(null),o=Nk();function l(d){d.stopPropagation(),i(e.title??""),n(!0),setTimeout(()=>{var m;return(m=a.current)==null?void 0:m.select()},0)}function c(d){d.stopPropagation(),o.mutate({conversationId:e.id,title:r.trim()||null}),n(!1)}return t?h.jsx(Xe,{ref:a,value:r,onChange:d=>i(d.target.value),onBlur:c,onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),c(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}`}):h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-medium",children:e.title??`Conversation #${e.id}`}),h.jsx(xe,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:l,"aria-label":"Rename",children:h.jsx(Dp,{className:"h-3 w-3"})})]})}function o5e({conv:e}){const[t,n]=y.useState(!1),r=dU();return t?h.jsxs("div",{className:"flex justify-end gap-1",onClick:i=>i.stopPropagation(),children:[h.jsx(xe,{size:"sm",variant:"destructive",disabled:r.isPending,onClick:i=>{i.stopPropagation(),r.mutate(e.id,{onSuccess:()=>n(!1),onError:()=>n(!1)})},children:"Confirm"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:i=>{i.stopPropagation(),n(!1)},children:"No"})]}):h.jsx(xe,{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:h.jsx(_a,{className:"h-3.5 w-3.5"})})}function s5e(){var f,g,v;const e=Sa(),t=K0(),n=cU(),[r,i]=y.useState(1),a=mU(0,r),[o,l]=y.useState("conversations"),c=((f=a.data)==null?void 0:f.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 h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{children:[h.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[h.jsx(Op,{className:"h-6 w-6"}),"Bot Imu"]}),h.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."})]}),h.jsxs(xe,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?h.jsx(Pr,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Rp,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}),h.jsxs(Up,{value:o,onValueChange:l,children:[h.jsxs(Hp,{children:[h.jsxs(or,{value:"conversations",children:["Conversations (",((v=t.data)==null?void 0:v.length)??0,")"]}),h.jsxs(or,{value:"sessions",children:["Sessions (",d,")"]}),h.jsx(or,{value:"activity",children:"Activity"}),h.jsx(or,{value:"files",children:"Files"})]}),h.jsx(sr,{value:"conversations",className:"mt-4 space-y-3",children:(t.data??[]).length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:'No conversations yet. Click "New Conversation" to start one.'}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[h.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),h.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),h.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),h.jsx("th",{className:"px-4 py-2"})]})}),h.jsx("tbody",{children:(t.data??[]).map(b=>h.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>e(`/imu/${b.id}`),children:[h.jsx("td",{className:"px-4 py-2",children:h.jsx(a5e,{conv:b})}),h.jsxs("td",{className:"px-4 py-2 text-muted-foreground",children:[b.session_count,b.spawned_count>0&&h.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]})]}),h.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()}),h.jsx("td",{className:"px-4 py-2 text-right",children:h.jsx(o5e,{conv:b})})]},b.id))})]})})})}),h.jsx(sr,{value:"sessions",className:"mt-4 space-y-3",children:d===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):h.jsxs(h.Fragment,{children:[h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsx(ix,{sessions:c})})}),h.jsx(Rk,{page:r,totalPages:m,onPageChange:i})]})}),h.jsx(sr,{value:"activity",className:"mt-4",children:h.jsx(eY,{projectId:0})}),h.jsx(sr,{value:"files",className:"mt-4",children:h.jsx(NU,{projectId:0})})]})]})}function j$(){const{conversationId:e}=bp(),t=e?Number(e):null;return t!==null?h.jsx(i5e,{cid:t}):h.jsx(s5e,{})}const l5e={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},u5e={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function c5e(){const{resourceType:e="roles"}=bp(),{data:t,isLoading:n}=Wu(e),[r,i]=y.useState(null),[a,o]=y.useState(!1),[l,c]=y.useState(!1),{data:d}=Nge(e,r??"",{enabled:a&&!!r}),m=u5e[e]??e;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:m}),h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",m.toLowerCase()," from StrawHub"]})]}),h.jsxs(xe,{onClick:()=>c(!0),size:"sm",children:[h.jsx(Mp,{className:"mr-2 h-4 w-4"}),"Install"]})]}),n?h.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((f,g)=>h.jsx(ln,{className:"h-12 w-full"},g))}):!t||t.length===0?h.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",m.toLowerCase()," installed yet."]}):h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Version"}),h.jsx(Fe,{children:"Description"}),h.jsx(Fe,{children:"Source"}),h.jsx(Fe,{className:"w-24"})]})}),h.jsx(ma,{children:t.map(f=>{var g;return h.jsxs(yn,{className:"cursor-pointer",onClick:()=>{i(f.name),o(!0)},children:[h.jsx(ze,{className:"font-medium",children:f.name}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:f.version??"—"}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:f.description||"—"}),h.jsx(ze,{children:h.jsx(ft,{variant:"outline",className:"text-xs",children:f.source})}),h.jsx(ze,{children:!((g=l5e[e])!=null&&g.includes(f.name))&&h.jsx(d5e,{resourceType:e,name:f.name})})]},f.name)})})]}),h.jsx(RH,{resource:d??null,resourceType:e,open:a,onOpenChange:o}),h.jsx(iA,{open:l,onOpenChange:c,defaultType:e})]})}function d5e({resourceType:e,name:t}){const[n,r]=y.useState(!1),i=PH(),a=o=>{o.stopPropagation(),i.mutate({type:e,name:t},{onSuccess:l=>{l.exit_code===0?it.success(`Uninstalled ${t}`):it.error(`Uninstall failed: ${l.stderr||l.stdout}`),r(!1)},onError:()=>{it.error("Uninstall request failed"),r(!1)}})};return n?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(xe,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),r(!1)},children:"No"})]}):h.jsx(xe,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),r(!0)},children:h.jsx(_a,{className:"h-4 w-4"})})}function IX(e){return On({queryKey:e?[...Ae.schedules.all,e]:Ae.schedules.all,queryFn:()=>Pe.get(e?`/schedules?type=${e}`:"/schedules")})}function f5e(e=1,t=20){return On({queryKey:[...Ae.schedules.runs,e,t],queryFn:()=>Pe.get(`/schedules/runs?page=${e}&per_page=${t}`)})}function h5e(){const e=lt();return yt({mutationFn:t=>Pe.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.schedules.all})}})}function m5e(){const e=lt();return yt({mutationFn:t=>Pe.post("/schedules/one-time",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.schedules.all})}})}function p5e(){const e=lt();return yt({mutationFn:({id:t,...n})=>Pe.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.schedules.all})}})}function LX(){const e=lt();return yt({mutationFn:t=>Pe.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.schedules.all})}})}function zX(){const e=lt();return yt({mutationFn:({id:t,enable:n})=>Pe.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.schedules.all})}})}var WE={exports:{}},E$;function g5e(){return E$||(E$=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var n={949(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.CronParser=void 0;var d=c(515),m=(function(){function f(g,v,b){v===void 0&&(v=!0),b===void 0&&(b=!1),this.expression=g,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=b}return f.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},f.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},f.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},f.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 _=null;switch(C){case 4:_="12";break;case 5:_="6";break;case 6:_="9999";break;default:_=null;break}if(_!==null){var k=g[C].split("/");g[C]="".concat(k[0],"-").concat(_,"/").concat(k[1])}}},f.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)},f.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)},f.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(),"'"))},f})();l.CronParser=m},333(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.ExpressionDescriptor=void 0;var d=c(823),m=c(949),f=(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,_=C===void 0?!1:C,k=w.dayOfWeekStartIndexZero,O=k===void 0?!0:k,A=w.monthStartIndexZero,T=A===void 0?!1:A,P=w.use24HourTimeFormat,z=w.locale,L=z===void 0?null:z,F=w.logicalAndDayFields,D=F===void 0?!1:F,X={throwExceptionOnParseError:j,verbose:_,dayOfWeekStartIndexZero:O,monthStartIndexZero:T,use24HourTimeFormat:P,locale:L,logicalAndDayFields:D};X.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var R=new g(v,X);return R.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(),_=this.getMonthDescription(),k=this.getDayOfWeekDescription(),O=this.getYearDescription();w+=j+C+k+_+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 _=0;_<C.length;_++)S+=" ",S+=this.formatTime(C[_],b,""),_<C.length-2&&(S+=","),_==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,_;try{return j=="0"&&w.indexOf("/")==-1&&b==""?v.i18n.everyHour():j=="0"?((_=(C=v.i18n).onTheHour)===null||_===void 0?void 0:_.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(_){var k=_.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(_){var k=S.find(function(A){return A.value===_&&A.index===j}),O=k&&v.expressionParts[1]!=="0";return j++,O?v.formatTime(_,"59",""):v.formatTime(_,"0","")},function(_){return d.StringUtilities.format(v.i18n.everyX0Hours(_),_)},function(_){return v.i18n.betweenX0AndX1()},function(_){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 _=parseInt(C),k=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(j)[_]:b[_];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),_=S.substring(0,S.indexOf("#"));j=v.i18n.commaOnThe(C,_).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 _=w.match(/L-(\d{1,2})/);if(_){var k=_[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 _=null,k=v.indexOf("/")>-1,O=v.indexOf("-")>-1,A=v.indexOf(",")>-1;if(!v)_="";else if(v==="*")_=b;else if(!k&&!O&&!A)_=d.StringUtilities.format(C(v),w(v));else if(A){for(var T=v.split(","),P="",z=0;z<T.length;z++)if(z>0&&T.length>2&&(P+=",",z<T.length-1&&(P+=" ")),z>0&&T.length>1&&(z==T.length-1||T.length==2)&&(P+="".concat(this.i18n.spaceAnd()," ")),T[z].indexOf("/")>-1||T[z].indexOf("-")>-1){var L=T[z].indexOf("-")>-1&&T[z].indexOf("/")==-1,F=this.getSegmentDescription(T[z],b,w,S,L?this.i18n.commaX0ThroughX1:j,C);L&&(F=F.replace(", ","")),P+=F}else if(!k)P+=w(T[z]);else{var D=this.getSegmentDescription(T[z],b,w,S,j,C);D&&D.startsWith(", ")&&(D=D.substring(2)),P+=D}k?_=P:_=d.StringUtilities.format(C(v),P)}else if(k){var T=v.split("/");if(_=d.StringUtilities.format(S(T[1]),T[1]),T[0].indexOf("-")>-1){var X=this.generateRangeSegmentDescription(T[0],j,w);X.indexOf(", ")!=0&&(_+=", "),_+=X}else if(T[0].indexOf("*")==-1){var R=d.StringUtilities.format(C(T[0]),w(T[0]));R=R.replace(", ",""),_+=d.StringUtilities.format(this.i18n.commaStartingX0(),R)}}else O&&(_=this.generateRangeSegmentDescription(v,j,w));return _},g.prototype.generateRangeSegmentDescription=function(v,b,w){var S="",j=v.split("-"),C=w(j[0],1),_=w(j[1],2),k=b(v);return S+=d.StringUtilities.format(k,C,_),S},g.prototype.formatTime=function(v,b,w){var S=0,j=0,C=parseInt(v)+S,_=parseInt(b)+j;_>=60?(_-=60,C+=1):_<0&&(_+=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"+_.toString()).substring(_.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],_=j[1];v=v.replace(new RegExp(C,"g"),_)}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=f},747(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.enLocaleLoader=void 0;var d=c(486),m=(function(){function f(){}return f.prototype.load=function(g){g.en=new d.en},f})();l.enLocaleLoader=m},486(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.en=void 0;var c=(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=c},515(o,l){Object.defineProperty(l,"__esModule",{value:!0});function c(m,f){if(!m)throw new Error(f)}var d=(function(){function m(){}return m.secondRange=function(f){for(var g=f.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);c(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},m.minuteRange=function(f){for(var g=f.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);c(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},m.hourRange=function(f){for(var g=f.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);c(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},m.dayOfMonthRange=function(f){for(var g=f.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var b=parseInt(g[v],10);c(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},m.monthRange=function(f,g){for(var v=f.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var w=parseInt(v[b],10);c(w>=1&&w<=12,g?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},m.dayOfWeekRange=function(f,g){for(var v=f.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var w=parseInt(v[b],10);c(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 c=(function(){function d(){}return d.format=function(m){for(var f=[],g=1;g<arguments.length;g++)f[g-1]=arguments[g];return m.replace(/%s/g,function(v){return f.shift()})},d.containsAny=function(m,f){return f.some(function(g){return m.indexOf(g)>-1})},d})();l.StringUtilities=c}},r={};function i(o){var l=r[o];if(l!==void 0)return l.exports;var c=r[o]={exports:{}};return n[o](c,c.exports,i),c.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.toString=void 0;var l=i(333),c=i(747);l.ExpressionDescriptor.initialize(new c.enLocaleLoader),o.default=l.ExpressionDescriptor;var d=l.ExpressionDescriptor.toString;o.toString=d})(),a})())})(WE)),WE.exports}var v5e=g5e();const y5e=Hi(v5e),x5e=[{label:"Every 1 minute",value:"* * * * *"},{label:"Every 5 minutes",value:"*/5 * * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Daily at midnight",value:"0 0 * * *"},{label:"Weekdays at 9am",value:"0 9 * * 1-5"},{label:"Weekly Monday 9am",value:"0 9 * * 1"}];function b5e({open:e,onOpenChange:t,editing:n}){const{data:r}=Oc(),i=h5e(),a=p5e(),[o,l]=y.useState(""),[c,d]=y.useState(""),[m,f]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,_]=y.useState(!0),[k,O]=y.useState(!1),A=n?n.project_id:Number(c)||0,{data:T}=Bf(A),P=y.useMemo(()=>(T??[]).filter(R=>R.type==="roles").map(R=>R.name),[T]);y.useEffect(()=>{e&&n?(l(n.name),d(String(n.project_id)),f(n.task),v(n.cron_expr??""),w(n.role??""),j(n.system_prompt??""),_(n.skip_if_running)):e&&!n&&z()},[e,n]);function z(){l(""),d(""),f(""),v(""),w(""),j(""),_(!0),O(!1)}async function L(R){R.preventDefault();try{const q={name:o.trim(),task:m.trim(),cron_expr:g.trim(),role:b.trim()||void 0,system_prompt:S.trim()||void 0,skip_if_running:C};n?await a.mutateAsync({id:n.id,...q}):await i.mutateAsync({...q,project_id:Number(c)}),z(),t(!1)}catch{}}const F=y.useMemo(()=>{if(!g.trim())return null;try{return y5e.toString(g.trim())}catch{return null}},[g]),D=i.isPending||a.isPending,X=i.error||a.error;return h.jsx(Xa,{open:e,onOpenChange:t,children:h.jsxs(Ga,{className:"max-w-lg",children:[h.jsx(Wa,{children:h.jsx(Qa,{children:n?"Edit Schedule":"Create Schedule"})}),h.jsxs("form",{onSubmit:L,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(st,{htmlFor:"sched-name",children:["Name ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Xe,{id:"sched-name",value:o,onChange:R=>l(R.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&h.jsxs("div",{className:"space-y-2",children:[h.jsxs(st,{htmlFor:"sched-project",children:["Project ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs(pa,{value:c,onValueChange:d,required:!0,children:[h.jsx(va,{id:"sched-project",children:h.jsx(ga,{placeholder:"Select a project"})}),h.jsx(ya,{children:(r??[]).map(R=>h.jsx(An,{value:String(R.id),children:R.display_name},R.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(st,{htmlFor:"sched-task",children:["Task ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Eo,{id:"sched-task",value:m,onChange:R=>f(R.target.value),placeholder:"What should the agent do each time this runs?",required:!0,rows:3})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs(st,{htmlFor:"sched-cron",children:["Cron Expression ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs(ff,{children:[h.jsx(hf,{asChild:!0,children:h.jsxs(xe,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",h.jsx(df,{className:"ml-1 h-3 w-3"})]})}),h.jsx(mf,{align:"end",children:x5e.map(R=>h.jsxs(ym,{onClick:()=>v(R.value),children:[h.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:R.value}),R.label]},R.value))})]})]}),h.jsx(Xe,{id:"sched-cron",value:g,onChange:R=>v(R.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),F&&h.jsx("p",{className:"text-xs text-muted-foreground",children:F})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"sched-role",children:"Role"}),h.jsx(Xe,{id:"sched-role",value:b,onChange:R=>w(R.target.value),placeholder:P[0]??"orchestrator",list:"sched-role-list"}),h.jsx("datalist",{id:"sched-role-list",children:P.map(R=>h.jsx("option",{value:R},R))}),b.trim()&&P.length>0&&!P.includes(b.trim())&&h.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[h.jsx("input",{type:"checkbox",checked:C,onChange:R=>_(R.target.checked),className:"rounded border-input"}),h.jsx("span",{className:"text-sm",children:"Skip if already running"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"— don't start a new session while a previous one is still active"})]}),h.jsxs($p,{open:k,onOpenChange:O,children:[h.jsx(Bp,{asChild:!0,children:h.jsxs(xe,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[h.jsx(df,{className:`h-3 w-3 transition-transform ${k?"rotate-180":""}`}),"Advanced Options"]})}),h.jsx(Fp,{className:"space-y-4 pt-2",children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"sched-prompt",children:"System Prompt"}),h.jsx(Eo,{id:"sched-prompt",value:S,onChange:R=>j(R.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),X&&h.jsx("p",{className:"text-sm text-destructive",children:X.message}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(xe,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(xe,{type:"submit",disabled:D||!!b.trim()&&P.length>0&&!P.includes(b.trim()),children:D?"Saving...":n?"Update":"Create"})]})]})]})})}function _$(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 w5e({schedule:e}){return e.enabled?e.last_error?h.jsx(yk,{children:h.jsxs(qF,{children:[h.jsx(VF,{children:h.jsx(ft,{variant:"destructive",children:"Error"})}),h.jsx(KF,{className:"max-w-xs",children:h.jsx("p",{className:"text-xs",children:e.last_error})})]})}):h.jsx(ft,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):h.jsx(ft,{variant:"secondary",children:"Disabled"})}function S5e(){const{data:e,isLoading:t,error:n}=IX("recurring"),[r,i]=y.useState(!1),[a,o]=y.useState(null),l=LX(),c=zX();if(t)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",n.message]})]});const d=e??[];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Recurring Schedules"}),h.jsxs(xe,{onClick:()=>{o(null),i(!0)},children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),d.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[h.jsx("p",{className:"text-muted-foreground",children:"No recurring schedules yet."}),h.jsxs(xe,{variant:"outline",className:"mt-4",onClick:()=>{o(null),i(!0)},children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):h.jsx("div",{className:"rounded-lg border",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Cron"}),h.jsx(Fe,{children:"Next Run"}),h.jsx(Fe,{children:"Last Run"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{className:"w-[120px]",children:"Actions"})]})}),h.jsx(ma,{children:d.map(m=>h.jsxs(yn,{children:[h.jsx(ze,{className:"font-medium",children:m.name}),h.jsx(ze,{className:"text-muted-foreground",children:m.project_name}),h.jsx(ze,{children:h.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:m.cron_expr})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:_$(m.next_run_at)}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:_$(m.last_run_at)}),h.jsx(ze,{children:h.jsx(w5e,{schedule:m})}),h.jsx(ze,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(xe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{o(m),i(!0)},children:h.jsx(Dp,{className:"h-3.5 w-3.5"})}),h.jsx(xe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c.mutate({id:m.id,enable:!m.enabled}),children:m.enabled?h.jsx(eU,{className:"h-3.5 w-3.5"}):h.jsx(Ip,{className:"h-3.5 w-3.5"})}),h.jsx(xe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${m.name}"?`)&&l.mutate(m.id)},children:h.jsx(_a,{className:"h-3.5 w-3.5"})})]})})]},m.id))})]})}),h.jsx(b5e,{open:r,onOpenChange:i,editing:a})]})}function j5e({open:e,onOpenChange:t}){const{data:n}=Oc(),r=m5e(),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,d]=y.useState(""),[m,f]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(!1),C=Number(o)||0,{data:_}=Bf(C),k=y.useMemo(()=>(_??[]).filter(P=>P.type==="roles").map(P=>P.name),[_]);y.useEffect(()=>{e&&O()},[e]);function O(){a(""),l(""),d(""),f(""),v(""),w(""),j(!1)}async function A(P){P.preventDefault();try{const z=new Date(m);await r.mutateAsync({name:i.trim(),project_id:Number(o),task:c.trim(),run_at:z.toISOString(),role:g.trim()||void 0,system_prompt:b.trim()||void 0}),O(),t(!1)}catch{}}const T=y.useMemo(()=>{const P=new Date(Date.now()+6e4);return P.setSeconds(0,0),P.toISOString().slice(0,16)},[e]);return h.jsx(Xa,{open:e,onOpenChange:t,children:h.jsxs(Ga,{className:"max-w-lg",children:[h.jsx(Wa,{children:h.jsx(Qa,{children:"Create One-Time Schedule"})}),h.jsxs("form",{onSubmit:A,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(st,{htmlFor:"ot-name",children:["Name ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Xe,{id:"ot-name",value:i,onChange:P=>a(P.target.value),placeholder:"e.g. deploy-tonight",required:!0,autoFocus:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(st,{htmlFor:"ot-project",children:["Project ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs(pa,{value:o,onValueChange:l,required:!0,children:[h.jsx(va,{id:"ot-project",children:h.jsx(ga,{placeholder:"Select a project"})}),h.jsx(ya,{children:(n??[]).map(P=>h.jsx(An,{value:String(P.id),children:P.display_name},P.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(st,{htmlFor:"ot-task",children:["Task ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Eo,{id:"ot-task",value:c,onChange:P=>d(P.target.value),placeholder:"What should the agent do?",required:!0,rows:3})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(st,{htmlFor:"ot-run-at",children:["Run At ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Xe,{id:"ot-run-at",type:"datetime-local",value:m,onChange:P=>f(P.target.value),min:T,required:!0}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Schedule will fire once at this time and then auto-disable."})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"ot-role",children:"Role"}),h.jsx(Xe,{id:"ot-role",value:g,onChange:P=>v(P.target.value),placeholder:k[0]??"orchestrator",list:"ot-role-list"}),h.jsx("datalist",{id:"ot-role-list",children:k.map(P=>h.jsx("option",{value:P},P))}),g.trim()&&k.length>0&&!k.includes(g.trim())&&h.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),h.jsxs($p,{open:S,onOpenChange:j,children:[h.jsx(Bp,{asChild:!0,children:h.jsxs(xe,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[h.jsx(df,{className:`h-3 w-3 transition-transform ${S?"rotate-180":""}`}),"Advanced Options"]})}),h.jsx(Fp,{className:"space-y-4 pt-2",children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(st,{htmlFor:"ot-prompt",children:"System Prompt"}),h.jsx(Eo,{id:"ot-prompt",value:b,onChange:P=>w(P.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),r.error&&h.jsx("p",{className:"text-sm text-destructive",children:r.error.message}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(xe,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(xe,{type:"submit",disabled:r.isPending||!!g.trim()&&k.length>0&&!k.includes(g.trim()),children:r.isPending?"Creating...":"Create"})]})]})]})})}function C$(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function E5e({schedule:e}){return!e.enabled&&e.last_run_at?h.jsx(ft,{variant:"secondary",children:"Fired"}):e.enabled?e.last_error?h.jsx(yk,{children:h.jsxs(qF,{children:[h.jsx(VF,{children:h.jsx(ft,{variant:"destructive",children:"Error"})}),h.jsx(KF,{className:"max-w-xs",children:h.jsx("p",{className:"text-xs",children:e.last_error})})]})}):h.jsx(ft,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Pending"}):h.jsx(ft,{variant:"secondary",children:"Disabled"})}function _5e(){const{data:e,isLoading:t,error:n}=IX("one_time"),[r,i]=y.useState(!1),a=LX(),o=zX();if(t)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",n.message]})]});const l=e??[];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"One-Time Schedules"}),h.jsxs(xe,{onClick:()=>i(!0),children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Create One-Time Schedule"]})]}),l.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[h.jsx("p",{className:"text-muted-foreground",children:"No one-time schedules yet."}),h.jsxs(xe,{variant:"outline",className:"mt-4",onClick:()=>i(!0),children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Create your first one-time schedule"]})]}):h.jsx("div",{className:"rounded-lg border",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Scheduled For"}),h.jsx(Fe,{children:"Last Run"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{className:"w-[100px]",children:"Actions"})]})}),h.jsx(ma,{children:l.map(c=>h.jsxs(yn,{children:[h.jsx(ze,{className:"font-medium",children:c.name}),h.jsx(ze,{className:"text-muted-foreground",children:c.project_name}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:C$(c.run_at)}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:C$(c.last_run_at)}),h.jsx(ze,{children:h.jsx(E5e,{schedule:c})}),h.jsx(ze,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(xe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o.mutate({id:c.id,enable:!c.enabled}),children:c.enabled?h.jsx(eU,{className:"h-3.5 w-3.5"}):h.jsx(Ip,{className:"h-3.5 w-3.5"})}),h.jsx(xe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${c.name}"?`)&&a.mutate(c.id)},children:h.jsx(_a,{className:"h-3.5 w-3.5"})})]})})]},c.id))})]})}),h.jsx(j5e,{open:r,onOpenChange:i})]})}function C5e(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function N5e(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 k5e({status:e}){switch(e){case"completed":return h.jsx(ft,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Completed"});case"running":case"starting":return h.jsx(ft,{className:"bg-blue-600 hover:bg-blue-600",children:"Running"});case"failed":return h.jsx(ft,{variant:"destructive",children:"Failed"});default:return h.jsx(ft,{variant:"secondary",children:e})}}function A5e({type:e}){return h.jsx(ft,{variant:"outline",className:"text-xs",children:e==="one_time"?"One-Time":"Recurring"})}function O5e(e){return e.schedule_type==="one_time"?"/schedules/one-time":"/schedules/recurring"}function T5e(){const[e,t]=y.useState(1),{data:n,isLoading:r,error:i}=f5e(e),a=Sa();if(r)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsx(ln,{className:"h-64 rounded-lg"})]});if(i)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(da,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",i.message]})]});const o=(n==null?void 0:n.items)??[],l=n?Math.ceil(n.total/n.per_page):0;return h.jsxs("div",{className:"space-y-6",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Run History"}),(n==null?void 0:n.total)===0?h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[h.jsx("p",{className:"text-muted-foreground",children:"No schedule runs yet."}),h.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sessions triggered by schedules will appear here."})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"rounded-lg border",children:h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Schedule"}),h.jsx(Fe,{children:"Type"}),h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{children:"Started"}),h.jsx(Fe,{children:"Duration"}),h.jsx(Fe,{className:"w-[80px]",children:"Session"})]})}),h.jsx(ma,{children:o.map(c=>h.jsxs(yn,{children:[h.jsx(ze,{className:"font-medium",children:h.jsx(lr,{to:O5e(c),className:"hover:underline text-foreground",children:c.schedule_name})}),h.jsx(ze,{children:h.jsx(A5e,{type:c.schedule_type})}),h.jsx(ze,{className:"text-muted-foreground",children:c.project_name}),h.jsx(ze,{children:h.jsx(k5e,{status:c.status})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:C5e(c.started_at)}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:N5e(c.duration_ms)}),h.jsx(ze,{children:h.jsx(xe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a(`/projects/${c.project_id}/sessions/${c.run_id}`),children:h.jsx(U0,{className:"h-3.5 w-3.5"})})})]},c.run_id))})]})}),h.jsx(Rk,{page:e,totalPages:l,onPageChange:t})]})]})}function QE(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},i=e.trace??{};return{runtime:Ir(e.runtime),isolation:Ir(e.isolation),memory:Ir(e.memory),orchestrator_role:Ir(t.role),orchestrator_permission_mode:Ir(t.permission_mode),policy_max_depth:Ir(n.max_depth),policy_agent_timeout:Ir(n.agent_timeout),policy_max_delegate_retries:Ir(n.max_delegate_retries),policy_cache_delegations:Ir(n.cache_delegations),policy_cache_max_entries:Ir(n.cache_max_entries),policy_cache_ttl_seconds:Ir(n.cache_ttl_seconds),policy_max_num_delegations:Ir(n.max_num_delegations),session_merge_strategy:Ir(r.merge_strategy),session_pull_before_session:Ir(r.pull_before_session),session_pr_command:Ir(r.pr_command),trace_enabled:Ir(i.enabled)}}function Ir(e){return e==null?"":String(e)}function P5e(e){const t={};e.runtime&&(t.runtime=e.runtime),e.isolation&&(t.isolation=e.isolation),e.memory&&(t.memory=e.memory);const n={};e.orchestrator_role&&(n.role=e.orchestrator_role),e.orchestrator_permission_mode&&(n.permission_mode=e.orchestrator_permission_mode),Object.keys(n).length>0&&(t.orchestrator=n);const r={};e.policy_max_depth&&(r.max_depth=Number(e.policy_max_depth)),e.policy_agent_timeout&&(r.agent_timeout=Number(e.policy_agent_timeout)),e.policy_max_delegate_retries&&(r.max_delegate_retries=Number(e.policy_max_delegate_retries)),e.policy_cache_delegations&&(r.cache_delegations=e.policy_cache_delegations==="true"),e.policy_cache_max_entries&&(r.cache_max_entries=Number(e.policy_cache_max_entries)),e.policy_cache_ttl_seconds&&(r.cache_ttl_seconds=Number(e.policy_cache_ttl_seconds)),e.policy_max_num_delegations&&(r.max_num_delegations=Number(e.policy_max_num_delegations)),Object.keys(r).length>0&&(t.policy=r);const i={};e.session_merge_strategy&&(i.merge_strategy=e.session_merge_strategy),e.session_pull_before_session&&(i.pull_before_session=e.session_pull_before_session),e.session_pr_command&&(i.pr_command=e.session_pr_command),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 M5e=["none","worktree"],R5e=["default","plan","bypassPermissions"],D5e=["auto","local","pr"],I5e=["prompt","always","never"],N$=["true","false"],ZE="__empty__";function k$({values:e,placeholders:t,onSave:n,saving:r}){const[i,a]=y.useState(QE(e)),{data:o}=Wu("agents"),{data:l}=Wu("roles"),{data:c}=Wu("memories"),d=t?QE(t):void 0,m=JSON.stringify(e);y.useEffect(()=>{a(QE(e))},[m]);const f=O=>A=>a(T=>({...T,[O]:A})),g=()=>{n(P5e(i))},v=(o??[]).map(O=>O.name),b=(l??[]).map(O=>O.name),w=new Set((c??[]).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":"",_=i.memory&&!S.includes(i.memory)?"Memory not found in installed providers":"",k=!!j||!!C||!!_;return h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"General"}),h.jsx(jl,{}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsxs(Lr,{label:"Runtime",children:[h.jsx(Xe,{list:"cfg-dl-runtime",value:i.runtime,onChange:O=>f("runtime")(O.target.value),placeholder:(d==null?void 0:d.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),v.length>0&&h.jsx("datalist",{id:"cfg-dl-runtime",children:v.map(O=>h.jsx("option",{value:O},O))}),j&&h.jsx("p",{className:"text-xs text-destructive",children:j})]}),h.jsx(Lr,{label:"Isolation",children:h.jsx(Od,{value:i.isolation,onChange:f("isolation"),options:M5e,placeholder:(d==null?void 0:d.isolation)||"none",allowEmpty:!0})}),h.jsxs(Lr,{label:"Memory",children:[h.jsx(Xe,{list:"cfg-dl-memory",value:i.memory,onChange:O=>f("memory")(O.target.value),placeholder:(d==null?void 0:d.memory)||"dial",className:"h-8 text-xs"}),h.jsx("datalist",{id:"cfg-dl-memory",children:S.map(O=>h.jsx("option",{value:O},O))}),_&&h.jsx("p",{className:"text-xs text-destructive",children:_})]})]})]}),h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),h.jsx(jl,{}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[h.jsxs(Lr,{label:"Role",children:[h.jsx(Xe,{list:"cfg-dl-role",value:i.orchestrator_role,onChange:O=>f("orchestrator_role")(O.target.value),placeholder:(d==null?void 0:d.orchestrator_role)||"ai-ceo",className:"h-8 text-xs"}),b.length>0&&h.jsx("datalist",{id:"cfg-dl-role",children:b.map(O=>h.jsx("option",{value:O},O))}),C&&h.jsx("p",{className:"text-xs text-destructive",children:C})]}),h.jsx(Lr,{label:"Permission Mode",children:h.jsx(Od,{value:i.orchestrator_permission_mode,onChange:f("orchestrator_permission_mode"),options:R5e,placeholder:(d==null?void 0:d.orchestrator_permission_mode)||"default",allowEmpty:!0})})]})]}),h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"Policy"}),h.jsx(jl,{}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsx(Lr,{label:"Max Depth",children:h.jsx(Xe,{type:"number",value:i.policy_max_depth,onChange:O=>f("policy_max_depth")(O.target.value),placeholder:(d==null?void 0:d.policy_max_depth)||"3",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Agent Timeout (seconds)",children:h.jsx(Xe,{type:"number",value:i.policy_agent_timeout,onChange:O=>f("policy_agent_timeout")(O.target.value),placeholder:(d==null?void 0:d.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Max Delegate Retries",children:h.jsx(Xe,{type:"number",value:i.policy_max_delegate_retries,onChange:O=>f("policy_max_delegate_retries")(O.target.value),placeholder:(d==null?void 0:d.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Cache Delegations",children:h.jsx(Od,{value:i.policy_cache_delegations,onChange:f("policy_cache_delegations"),options:N$,placeholder:(d==null?void 0:d.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),h.jsx(Lr,{label:"Cache Max Entries",children:h.jsx(Xe,{value:i.policy_cache_max_entries,onChange:O=>f("policy_cache_max_entries")(O.target.value),placeholder:(d==null?void 0:d.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Cache TTL (seconds)",children:h.jsx(Xe,{value:i.policy_cache_ttl_seconds,onChange:O=>f("policy_cache_ttl_seconds")(O.target.value),placeholder:(d==null?void 0:d.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Max Delegations",children:h.jsx(Xe,{type:"number",min:"0",value:i.policy_max_num_delegations,onChange:O=>f("policy_max_num_delegations")(O.target.value),placeholder:(d==null?void 0:d.policy_max_num_delegations)||"0 (unlimited)",className:"h-8 text-xs"})})]})]}),h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"Session"}),h.jsx(jl,{}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsx(Lr,{label:"Merge Strategy",children:h.jsx(Od,{value:i.session_merge_strategy,onChange:f("session_merge_strategy"),options:D5e,placeholder:(d==null?void 0:d.session_merge_strategy)||"auto",allowEmpty:!0})}),h.jsx(Lr,{label:"Pull Before Session",children:h.jsx(Od,{value:i.session_pull_before_session,onChange:f("session_pull_before_session"),options:I5e,placeholder:(d==null?void 0:d.session_pull_before_session)||"prompt",allowEmpty:!0})}),h.jsx(Lr,{label:"PR Command",className:"sm:col-span-3",children:h.jsx(Xe,{value:i.session_pr_command,onChange:O=>f("session_pr_command")(O.target.value),placeholder:(d==null?void 0:d.session_pr_command)||"gh pr create --base {base_branch} --head {session_branch}",className:"h-8 text-xs font-mono"})})]})]}),h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),h.jsx(jl,{}),h.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:h.jsx(Lr,{label:"Enabled",children:h.jsx(Od,{value:i.trace_enabled,onChange:f("trace_enabled"),options:N$,placeholder:(d==null?void 0:d.trace_enabled)||"true",allowEmpty:!0})})})]}),h.jsxs(xe,{size:"sm",onClick:g,disabled:r||k,className:"self-start",children:[h.jsx(tU,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function Lr({label:e,children:t,className:n}){return h.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[h.jsx(st,{className:"text-xs",children:e}),t]})}function Od({value:e,onChange:t,options:n,placeholder:r,allowEmpty:i}){return h.jsxs(pa,{value:e||(i?ZE:""),onValueChange:a=>t(a===ZE?"":a),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:r})}),h.jsxs(ya,{children:[i&&h.jsx(An,{value:ZE,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(a=>h.jsx(An,{value:a,children:a},a))]})]})}function L5e(){var g,v;const[e,t]=y.useState("global"),[n,r]=y.useState(null),i=lt(),a=EU(),o=Oc(),l=Ek(n??0,{enabled:n!=null}),c=Tue(),d=_U(),m=b=>{c.mutate(b,{onSuccess:()=>it.success("Global configuration saved"),onError:()=>it.error("Failed to save global configuration")})},f=b=>{n!=null&&d.mutate({projectId:n,data:b},{onSuccess:()=>it.success("Project configuration saved"),onError:()=>it.error("Failed to save project configuration")})};return y.useEffect(()=>{e==="project"&&n!=null&&i.invalidateQueries({queryKey:Ae.projects.config(n)})},[e,n,i]),h.jsxs("div",{className:"space-y-6",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),h.jsxs(Up,{value:e,onValueChange:t,children:[h.jsxs(Hp,{children:[h.jsx(or,{value:"global",children:"Global"}),h.jsx(or,{value:"project",children:"Project"})]}),h.jsx(sr,{value:"global",className:"mt-4",children:a.isLoading?h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):h.jsx(k$,{values:((g=a.data)==null?void 0:g.values)??{},placeholders:(v=a.data)==null?void 0:v.defaults,onSave:m,saving:c.isPending})}),h.jsx(sr,{value:"project",className:"mt-4",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[h.jsx(st,{className:"text-xs",children:"Project"}),h.jsxs(pa,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:"Select a project"})}),h.jsx(ya,{children:(o.data??[]).map(b=>h.jsx(An,{value:String(b.id),children:b.display_name},b.id))})]})]}),n!=null&&l.isLoading&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),n!=null&&l.data&&h.jsx(k$,{values:l.data.project,placeholders:l.data.merged_nested,onSave:f,saving:d.isPending},n)]})})]})]})}function z5e(){return On({queryKey:Ae.integrations.all,queryFn:()=>Pe.get("/integrations"),refetchInterval:1e4})}function $5e(e,t){return On({queryKey:Ae.integrations.config(e),queryFn:()=>Pe.get(`/integrations/${e}/config`),enabled:(t==null?void 0:t.enabled)??!!e})}function B5e(){const e=lt();return yt({mutationFn:t=>Pe.post(`/integrations/${t}/start`),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.integrations.all})}})}function F5e(){const e=lt();return yt({mutationFn:t=>Pe.post(`/integrations/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.integrations.all})}})}function U5e(){const e=lt();return yt({mutationFn:({name:t,config_values:n})=>Pe.put(`/integrations/${t}/config`,{config_values:n}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ae.integrations.config(n.name)}),e.invalidateQueries({queryKey:Ae.integrations.all})}})}function H5e(){const e=lt();return yt({mutationFn:t=>Pe.post("/integrations/install",{name:t}),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.integrations.all})}})}function q5e(){const e=lt();return yt({mutationFn:t=>Pe.delete(`/integrations/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.integrations.all})}})}function V5e(){const e=lt();return yt({mutationFn:t=>Pe.post("/integrations/update",{name:t}),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.integrations.all})}})}function K5e(){const e=lt();return yt({mutationFn:t=>Pe.post("/integrations/reinstall",{name:t}),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.integrations.all})}})}function Y5e(){const e=lt();return yt({mutationFn:({name:t,enabled:n})=>Pe.put(`/integrations/${t}/auto-start`,{enabled:n}),onSuccess:()=>{e.invalidateQueries({queryKey:Ae.integrations.all})}})}function X5e({className:e,size:t="default",...n}){return h.jsx(Wie,{"data-slot":"switch","data-size":t,className:Te("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:h.jsx(Qie,{"data-slot":"switch-thumb",className:Te("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 G5e({integration:e,open:t,onOpenChange:n,onLogs:r}){const i=B5e(),a=F5e(),o=Y5e(),l=V5e(),c=K5e(),d=q5e(),[m,f]=y.useState(!1);if(!e)return null;const g=e.status==="running",v=l.isPending||c.isPending||d.isPending,b=()=>{g?a.mutate(e.name,{onSuccess:()=>it.success(`Stopped ${e.name}`),onError:C=>it.error(`Failed to stop: ${C.message}`)}):i.mutate(e.name,{onSuccess:()=>it.success(`Started ${e.name}`),onError:C=>it.error(`Failed to start: ${C.message}`)})},w=()=>{l.mutate(e.name,{onSuccess:C=>{C.exit_code===0?it.success(`Updated ${e.name}`):it.error(`Update failed: ${C.stderr||C.stdout}`)},onError:C=>it.error(`Failed to update: ${C.message}`)})},S=()=>{c.mutate(e.name,{onSuccess:C=>{C.exit_code===0?it.success(`Reinstalled ${e.name}`):it.error(`Reinstall failed: ${C.stderr||C.stdout}`)},onError:C=>it.error(`Failed to reinstall: ${C.message}`)})},j=()=>{if(!m){f(!0);return}d.mutate(e.name,{onSuccess:C=>{C.exit_code===0?(it.success(`Uninstalled ${e.name}`),n(!1)):it.error(`Uninstall failed: ${C.stderr||C.stdout}`),f(!1)},onError:C=>{it.error(`Failed to uninstall: ${C.message}`),f(!1)}})};return h.jsx(Jk,{open:t,onOpenChange:C=>{n(C),f(!1)},children:h.jsxs(eA,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[h.jsxs(tA,{className:"shrink-0",children:[h.jsxs(nA,{className:"flex items-center gap-2",children:[e.name,h.jsx(W5e,{status:e.status}),g&&h.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]}),h.jsx(rA,{children:e.description||"No description"})]}),h.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[h.jsxs("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Path:"," ",h.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]}),e.started_at&&h.jsxs("span",{children:["Started:"," ",h.jsx("strong",{children:new Date(e.started_at).toLocaleString()})]}),e.pid&&h.jsxs("span",{children:["PID: ",h.jsx("strong",{children:e.pid})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(X5e,{id:"auto-start",checked:e.auto_start,onCheckedChange:C=>{o.mutate({name:e.name,enabled:C},{onSuccess:()=>it.success(C?"Auto-start enabled":"Auto-start disabled"),onError:_=>it.error(`Failed to update: ${_.message}`)})},disabled:o.isPending}),h.jsx(st,{htmlFor:"auto-start",className:"text-xs",children:"Start automatically when StrawPot launches"})]}),e.last_error&&h.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-xs text-destructive",children:e.last_error})]}),h.jsx(zp,{className:"min-h-0 flex-1",children:h.jsx("div",{className:"px-4 space-y-6",children:h.jsx(Q5e,{name:e.name,enabled:t})})}),h.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[h.jsx(xe,{size:"sm",variant:g?"destructive":"default",onClick:b,disabled:i.isPending||a.isPending,children:g?h.jsxs(h.Fragment,{children:[h.jsx(Sk,{className:"mr-1 h-3.5 w-3.5"})," Stop"]}):h.jsxs(h.Fragment,{children:[h.jsx(Ip,{className:"mr-1 h-3.5 w-3.5"})," Start"]})}),h.jsx(xe,{size:"sm",variant:"outline",onClick:()=>r(e.name),children:"Logs"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:w,disabled:v,children:l.isPending?"Updating...":"Update"}),h.jsx(xe,{size:"sm",variant:"outline",onClick:S,disabled:v,children:c.isPending?"Reinstalling...":"Reinstall"}),h.jsx("div",{className:"flex-1"}),h.jsx(xe,{variant:m?"destructive":"outline",size:"sm",onClick:j,disabled:v,children:d.isPending?"Uninstalling...":m?"Confirm Uninstall":"Uninstall"}),m&&!d.isPending&&h.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>f(!1),children:"Cancel"})]})]})})}function W5e({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 h.jsx(ft,{variant:n,children:r})}function Q5e({name:e,enabled:t}){const{data:n}=$5e(e,{enabled:t}),r=U5e(),[i,a]=y.useState({}),[o,l]=y.useState(!1);if(n&&!o){const m={};for(const f of Object.keys(n.env_schema))m[f]=n.config_values[f]??"";a(m),l(!0)}const c=(n==null?void 0:n.env_schema)??{};if(Object.keys(c).length===0)return null;const d=()=>{r.mutate({name:e,config_values:i},{onSuccess:()=>it.success("Configuration saved"),onError:m=>it.error(`Failed to save: ${m.message}`)})};return h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-sm font-medium",children:"Configuration"}),Object.entries(c).map(([m,f])=>h.jsx(Z5e,{name:m,field:f,value:i[m]??"",onChange:g=>a(v=>({...v,[m]:g}))},m)),h.jsx(xe,{size:"sm",onClick:d,disabled:r.isPending,children:r.isPending?"Saving...":"Save Configuration"})]})}function Z5e({name:e,field:t,value:n,onChange:r}){return h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs(st,{htmlFor:`config-${e}`,children:[e,t.required&&h.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),h.jsx(Xe,{id:`config-${e}`,type:"password",value:n,onChange:i=>r(i.target.value),placeholder:t.description}),t.description&&h.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]})}function J5e(e){const[t,n]=y.useState([]),[r,i]=y.useState(!1),[a,o]=y.useState(!1),l=y.useRef(null),c=y.useCallback(()=>{if(!e)return;const f=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/integrations/${e}/logs/ws`,g=new WebSocket(f);return l.current=g,g.onopen=()=>o(!0),g.onmessage=v=>{try{const b=JSON.parse(v.data);switch(b.type){case"log_snapshot":n(b.lines??[]);break;case"log_delta":n(w=>[...w,...b.lines??[]]);break;case"log_done":i(!0);break;case"error":i(!0);break}}catch{}},g.onclose=()=>{o(!1),l.current=null},g.onerror=()=>{o(!1)},g},[e]);y.useEffect(()=>{n([]),i(!1),o(!1);const m=c();return()=>{m&&m.readyState<=WebSocket.OPEN&&m.close()}},[c]);const d=y.useCallback(()=>n([]),[]);return{lines:t,done:r,connected:a,clearLines:d}}const Tu=18,A$=10;function e$e({name:e,open:t,onOpenChange:n}){const r=t?e:null,{lines:i,done:a,connected:o,clearLines:l}=J5e(r);return h.jsx(Jk,{open:t,onOpenChange:n,children:h.jsxs(eA,{side:"right",className:"flex h-full w-[700px] flex-col sm:max-w-[700px] overflow-hidden",children:[h.jsxs(tA,{children:[h.jsxs(nA,{children:["Logs: ",e]}),h.jsx(rA,{children:"Adapter stdout/stderr output"})]}),h.jsx("div",{className:"flex-1 min-h-0 min-w-0 px-4 pb-4",children:h.jsx(t$e,{lines:i,done:a,connected:o,onClear:l,onClose:()=>n(!1)})})]})})}function t$e({lines:e,done:t,connected:n,onClear:r,onClose:i}){const[a,o]=y.useState(""),[l,c]=y.useState(!1),d=a.toLowerCase(),m=a?e.reduce((D,X,R)=>(X.toLowerCase().includes(d)&&D.push(R),D),[]):[],f=y.useRef(null),[g,v]=y.useState(0),[b,w]=y.useState(0),[S,j]=y.useState(!0),C=y.useRef(0),_=e.length*Tu,k=Math.max(0,Math.floor(g/Tu)-A$),O=Math.ceil(b/Tu)+A$*2,A=Math.min(e.length,k+O),T=e.slice(k,A),P=String(e.length).length,z=y.useCallback(()=>{const D=f.current;if(!D)return;v(D.scrollTop),w(D.clientHeight);const X=D.scrollTop+D.clientHeight>=D.scrollHeight-Tu*2;j(X)},[]);y.useEffect(()=>{const D=f.current;D&&w(D.clientHeight)},[]),y.useEffect(()=>{if(S&&e.length>C.current){const D=f.current;D&&(D.scrollTop=D.scrollHeight)}C.current=e.length},[e.length,S]);const L=()=>{const D=f.current;D&&(D.scrollTop=D.scrollHeight,j(!0))},F=y.useCallback(D=>{if((D.metaKey||D.ctrlKey)&&D.key==="a"){D.preventDefault();const X=f.current;if(X){const R=window.getSelection(),q=document.createRange();q.selectNodeContents(X),R==null||R.removeAllRanges(),R==null||R.addRange(q)}}},[]);return h.jsxs("div",{className:"flex h-full flex-col gap-3",children:[h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(wk,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),h.jsx(Xe,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:a,onChange:D=>o(D.target.value)})]}),a&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.length," match",m.length!==1?"es":""]}),e.length>0&&h.jsxs(xe,{variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:()=>{navigator.clipboard.writeText(e.join(`
`)),it.success("Copied all logs to clipboard")},children:[h.jsx(Uoe,{className:"mr-1 h-3 w-3"}),"Copy all"]}),h.jsx("span",{className:"ml-auto flex items-center gap-1 text-xs text-muted-foreground",children:t?"Stream ended":h.jsxs(h.Fragment,{children:[h.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..."]})})]}),h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx("div",{ref:f,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:z,onKeyDown:F,children:e.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:t?"No log output.":"Waiting for log output..."}):h.jsx("div",{style:{height:_,position:"relative",minWidth:"fit-content"},children:h.jsx("div",{style:{position:"absolute",top:k*Tu,left:0},children:T.map((D,X)=>{const R=k+X,q=a&&D.toLowerCase().includes(d);return h.jsxs("div",{className:q?"bg-yellow-900/30":void 0,style:{height:Tu,lineHeight:`${Tu}px`,display:"flex",whiteSpace:"pre"},children:[h.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(P+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:R+1}),h.jsx("span",{className:"pr-4",children:D})]},R)})})})}),!S&&e.length>0&&h.jsxs(xe,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:L,children:[h.jsx(XF,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2 pt-1",children:[h.jsx(xe,{size:"sm",variant:"ghost",onClick:i,children:"Close"}),h.jsx("div",{className:"flex-1"}),l?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:"Clear all logs?"}),h.jsx(xe,{size:"sm",variant:"destructive",onClick:()=>{r(),c(!1)},children:"Confirm"}),h.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>c(!1),children:"Cancel"})]}):h.jsxs(xe,{size:"sm",variant:"ghost",className:"text-xs",disabled:e.length===0,onClick:()=>c(!0),children:[h.jsx(_a,{className:"mr-1 h-3 w-3"}),"Clear"]})]})]})}function n$e({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 h.jsx(ft,{variant:n,children:r})}function r$e(){const{data:e,isLoading:t}=z5e(),[n,r]=y.useState(null),[i,a]=y.useState(!1),[o,l]=y.useState(null),[c,d]=y.useState(!1),m=n?(e==null?void 0:e.find(f=>f.name===n.name))??n:null;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Chat and community platform adapters"})]}),h.jsxs(xe,{onClick:()=>d(!0),size:"sm",children:[h.jsx(Mp,{className:"mr-2 h-4 w-4"}),"Install"]})]}),t?h.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((f,g)=>h.jsx(ln,{className:"h-12 w-full"},g))}):!e||e.length===0?h.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:[h.jsx("p",{children:"No integrations installed yet."}),h.jsxs("p",{className:"mt-1 text-xs",children:["Install from Strawhub or place adapter directories in ",h.jsx("code",{className:"rounded bg-muted px-1",children:"~/.strawpot/integrations/"})]})]}):h.jsxs(fa,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Version"}),h.jsx(Fe,{children:"Description"}),h.jsx(Fe,{children:"Status"})]})}),h.jsx(ma,{children:e.map(f=>h.jsxs(yn,{className:"cursor-pointer",onClick:()=>{r(f),a(!0)},children:[h.jsx(ze,{className:"font-medium",children:f.name}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:f.version?`v${f.version}`:"—"}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:f.description||"—"}),h.jsx(ze,{children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(n$e,{status:f.status}),f.status==="running"&&h.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]})})]},f.name))})]}),h.jsx(G5e,{integration:m,open:i,onOpenChange:a,onLogs:f=>l(f)}),h.jsx(e$e,{name:o,open:!!o,onOpenChange:f=>{f||l(null)}}),h.jsx(i$e,{open:c,onOpenChange:d})]})}function i$e({open:e,onOpenChange:t}){const n=H5e(),[r,i]=y.useState(""),[a,o]=y.useState(null),[l,c]=y.useState(null),d=(a==null?void 0:a.status)==="success",m=()=>{r.trim()&&(o(null),c(null),n.mutate(r.trim(),{onSuccess:g=>{g.exit_code===0?(it.success(`Installed ${r.trim()}`),o({status:"success",message:`Successfully installed ${r.trim()}`}),c(g.stdout||null)):(o({status:"error",message:"Installation failed"}),c(g.stderr||g.stdout||"Unknown error."))},onError:()=>{o({status:"error",message:"Install request failed"}),it.error("Install request failed")}}))},f=g=>{g||(o(null),c(null),i("")),t(g)};return h.jsx(Xa,{open:e,onOpenChange:f,children:h.jsxs(Ga,{className:"sm:max-w-md",children:[h.jsxs(Wa,{children:[h.jsx(Qa,{children:"Install Integration"}),h.jsx(Tk,{children:"Install a chat adapter from Strawhub by name."})]}),h.jsxs("div",{className:"flex flex-col gap-4",children:[a&&h.jsxs(Nm,{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"?h.jsx(Pp,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):h.jsx(F0,{className:"h-4 w-4"}),h.jsx(km,{children:a.status==="success"?"Installed":"Error"}),h.jsx(Am,{children:a.message})]}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(st,{htmlFor:"install-integration-name",children:"Package Name"}),h.jsx(Xe,{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&&h.jsxs("details",{className:"text-sm",children:[h.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:l})]})]}),h.jsx(Ok,{children:d?h.jsx(xe,{onClick:()=>f(!1),children:"Done"}):h.jsx(xe,{onClick:m,disabled:!r.trim()||n.isPending,children:n.isPending?"Installing...":"Install"})})]})})}function a$e(){return h.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20",children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Page not found"}),h.jsx(xe,{variant:"outline",asChild:!0,children:h.jsxs(lr,{to:"/",children:[h.jsx(ise,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const o$e=3,s$e=1e4,l$e=2e3;function u$e(){const e=lt(),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 f=Date.now();if(f-i.current<l$e)return!1;const g=(a.current[m]??[]).filter(v=>f-v<s$e);return g.length>=o$e?!1:(g.push(f),a.current[m]=g,!0)}function c(m){const f=m.type,g=(m.run_id??"unknown").slice(0,12);l(f)&&(f==="session_started"?it.info(`Session ${g} started`):f==="session_completed"?it.success(`Session ${g} completed`):f==="session_failed"?it.error(`Session ${g} failed`):f==="session_stopped"&&it.warning(`Session ${g} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),m.project_id&&(e.invalidateQueries({queryKey:Ae.projects.sessions(m.project_id)}),e.invalidateQueries({queryKey:Ae.conversations.all(m.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}function d(){const f=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`,g=new WebSocket(f);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"&&c(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 c$e(){return u$e(),h.jsx(eZ,{children:h.jsxs(gr,{element:h.jsx(pue,{}),children:[h.jsx(gr,{index:!0,element:h.jsx(OR,{to:"/imu",replace:!0})}),h.jsx(gr,{path:"dashboard",element:h.jsx(Cue,{})}),h.jsx(gr,{path:"projects",element:h.jsx(Iue,{})}),h.jsx(gr,{path:"projects/:projectId",element:h.jsx(QMe,{})}),h.jsx(gr,{path:"projects/:projectId/sessions/:runId",element:h.jsx(P4e,{})}),h.jsx(gr,{path:"projects/:projectId/conversations/:conversationId",element:h.jsx(Q4e,{})}),h.jsx(gr,{path:"imu",element:h.jsx(j$,{})}),h.jsx(gr,{path:"imu/:conversationId",element:h.jsx(j$,{})}),h.jsx(gr,{path:"schedules",element:h.jsx(OR,{to:"/schedules/recurring",replace:!0})}),h.jsx(gr,{path:"schedules/recurring",element:h.jsx(S5e,{})}),h.jsx(gr,{path:"schedules/one-time",element:h.jsx(_5e,{})}),h.jsx(gr,{path:"schedules/runs",element:h.jsx(T5e,{})}),h.jsx(gr,{path:"resources/:resourceType",element:h.jsx(c5e,{})}),h.jsx(gr,{path:"integrations",element:h.jsx(r$e,{})}),h.jsx(gr,{path:"settings",element:h.jsx(L5e,{})}),h.jsx(gr,{path:"*",element:h.jsx(a$e,{})})]})})}tQ.createRoot(document.getElementById("root")).render(h.jsx(y.StrictMode,{children:h.jsx(vJ,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:h.jsx(lJ,{client:hle,children:h.jsxs(yk,{children:[h.jsx(_Z,{children:h.jsx(c$e,{})}),h.jsx(fle,{position:"top-right",offset:{top:"8px",right:"60px"}})]})})})}));
